IDSpeakAFL  v1.2.1
peak_afl_dynamic_loader.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "peak_afl.h"
13 #include <string>
14 #include <cstdint>
15 
16 #ifdef __linux__
17  #include <dlfcn.h>
18 #else
19  #include <vector>
20  #include <windows.h>
21  #include <tchar.h>
22 #endif
23 
24 #include <stdexcept>
25 
26 #undef PEAK_AFL_EXPORT
27 #define PEAK_AFL_EXPORT
28 #undef PEAK_AFL_CALLCONV
29 #define PEAK_AFL_CALLCONV
30 
31 
32 namespace peak
33 {
34 namespace afl
35 {
36 namespace dynamic
37 {
38 
39 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_Init)(void );
40 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_Exit)(void );
41 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_GetLastError)(peak_afl_status * lastErrorCode, char * lastErrorMessage, size_t * lastErrorMessageSize);
42 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_GetVersion)(uint32_t * majorVersion, uint32_t * minorVersion, uint32_t * subminorVersion, uint32_t * patchVersion);
43 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoFeatureManager_Create)(peak_afl_manager_handle * handle, PEAK_NODE_MAP_HANDLE nodeMapHandle);
44 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoFeatureManager_Destroy)(peak_afl_manager_handle handle);
45 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoFeatureManager_AddController)(peak_afl_manager_handle handle, peak_afl_manager_handle controller);
46 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoFeatureManager_RemoveController)(peak_afl_manager_handle handle, peak_afl_manager_handle controller);
47 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoFeatureManager_Process)(peak_afl_manager_handle handle, PEAK_IPL_IMAGE_HANDLE imageHandle);
48 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoFeatureManager_CreateController)(peak_afl_manager_handle handle, peak_afl_controller_handle * controller, peak_afl_controllerType controllerType);
49 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoFeatureManager_DestroyAllController)(peak_afl_manager_handle handle);
50 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoFeatureManager_DestroyController)(peak_afl_manager_handle handle, peak_afl_controller_handle controller);
51 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoFeatureManager_SetGainIPL)(peak_afl_manager_handle handle, PEAK_IPL_GAIN_HANDLE gainHandle);
52 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoFeatureManager_Status)(peak_afl_manager_handle handle, peak_afl_BOOL8 * running);
53 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Create)(peak_afl_controller_handle * controller, peak_afl_controllerType controllerType);
54 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Destroy)(peak_afl_controller_handle controller);
55 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_SkipFrames_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
56 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_SkipFrames_Set)(peak_afl_controller_handle controller, uint32_t count);
57 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_SkipFrames_Get)(peak_afl_controller_handle controller, uint32_t * count);
58 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_SkipFrames_GetRange)(peak_afl_controller_handle controller, uint32_t * min, uint32_t * max, uint32_t * inc);
59 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_ROI_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
60 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_ROI_Set)(peak_afl_controller_handle controller, peak_afl_rectangle roi);
61 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_ROI_Get)(peak_afl_controller_handle controller, peak_afl_rectangle * roi);
62 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_ROI_Preset_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
63 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_ROI_Preset_Set)(peak_afl_controller_handle controller, peak_afl_roi_preset roiPreset);
64 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Mode_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
65 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Mode_Set)(peak_afl_controller_handle controller, peak_afl_controller_automode mode);
66 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Mode_Get)(peak_afl_controller_handle controller, peak_afl_controller_automode * mode);
67 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_BrightnessComponent_Mode_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
68 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_BrightnessComponent_Mode_Set)(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_automode mode);
69 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_BrightnessComponent_Mode_Get)(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_automode * mode);
70 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_BrightnessComponent_Status)(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_status * status);
71 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_BrightnessComponent_Callback_Set)(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_callback_type type, void * funcPtr, void * context);
72 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Status)(peak_afl_controller_handle controller, peak_afl_controller_status * status);
73 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_GetLastAutoAverage)(peak_afl_controller_handle controller, uint8_t * average);
74 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_GetLastAutoAverages)(peak_afl_controller_handle controller, uint8_t * averageRed, uint8_t * averageGreen, uint8_t * averageBlue);
75 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoTarget_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
76 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoTarget_Set)(peak_afl_controller_handle controller, uint32_t target);
77 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoTarget_Get)(peak_afl_controller_handle controller, uint32_t * target);
78 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoTarget_GetRange)(peak_afl_controller_handle controller, uint32_t * min, uint32_t * max, uint32_t * inc);
79 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoTolerance_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
80 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoTolerance_Set)(peak_afl_controller_handle controller, uint32_t tolerance);
81 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoTolerance_Get)(peak_afl_controller_handle controller, uint32_t * tolerance);
82 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoTolerance_GetRange)(peak_afl_controller_handle controller, uint32_t * min, uint32_t * max, uint32_t * inc);
83 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoPercentile_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
84 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoPercentile_Set)(peak_afl_controller_handle controller, double percentile);
85 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoPercentile_Get)(peak_afl_controller_handle controller, double * percentile);
86 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_AutoPercentile_GetRange)(peak_afl_controller_handle controller, double * min, double * max, double * inc);
87 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Type_Get)(peak_afl_controller_handle controller, peak_afl_controllerType * type);
88 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Algorithm_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
89 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Algorithm_Set)(peak_afl_controller_handle controller, peak_afl_controller_algorithm algorithm);
90 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Algorithm_Get)(peak_afl_controller_handle controller, peak_afl_controller_algorithm * algorithm);
91 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Algorithm_GetList)(peak_afl_controller_handle controller, peak_afl_controller_algorithm * typeList, uint32_t * listSize);
92 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_SharpnessAlgorithm_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
93 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_SharpnessAlgorithm_Set)(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm algorithm);
94 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_SharpnessAlgorithm_Get)(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm * algorithm);
95 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_SharpnessAlgorithm_GetList)(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm * typeList, uint32_t * listSize);
96 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Callback_Set)(peak_afl_controller_handle controller, peak_afl_callback_type type, void * funcPtr, void * context);
97 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Weighted_ROI_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
98 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Weighted_ROI_Min_Size)(peak_afl_controller_handle controller, peak_afl_size * size);
99 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Weighted_ROI_Set)(peak_afl_controller_handle controller, const peak_afl_weighted_rectangle * weightedRoiList, uint32_t listSize);
100 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Weighted_ROI_Get)(peak_afl_controller_handle controller, peak_afl_weighted_rectangle * weightedRoiList, uint32_t * listSize);
101 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Limit_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
102 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Limit_Default)(peak_afl_controller_handle controller, peak_afl_controller_limit * limit);
103 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Limit_Set)(peak_afl_controller_handle controller, peak_afl_controller_limit limit);
104 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Limit_Get)(peak_afl_controller_handle controller, peak_afl_controller_limit * limit);
105 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Hysteresis_IsSupported)(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
106 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Hysteresis_Default)(peak_afl_controller_handle controller, uint8_t * hysteresis);
107 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Hysteresis_Set)(peak_afl_controller_handle controller, uint8_t hysteresis);
108 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Hysteresis_Get)(peak_afl_controller_handle controller, uint8_t * hysteresis);
109 typedef PEAK_AFL_API_STATUS (*dyn_peak_afl_AutoController_Hysteresis_GetRange)(peak_afl_controller_handle controller, uint8_t * min, uint8_t * max, uint8_t * inc);
110 
111 
112 class DynamicLoader
113 {
114 private:
115  DynamicLoader();
116 
117  static DynamicLoader& instance()
118  {
119  static DynamicLoader dynamicLoader{};
120  return dynamicLoader;
121  }
122  bool loadLib(const char* file);
123  void unload();
124  bool setPointers(bool load);
125 
126 public:
127  ~DynamicLoader();
128 
129  static bool isLoaded();
130 
131  static PEAK_AFL_API_STATUS peak_afl_Init(void );
132  static PEAK_AFL_API_STATUS peak_afl_Exit(void );
133  static PEAK_AFL_API_STATUS peak_afl_GetLastError(peak_afl_status * lastErrorCode, char * lastErrorMessage, size_t * lastErrorMessageSize);
134  static PEAK_AFL_API_STATUS peak_afl_GetVersion(uint32_t * majorVersion, uint32_t * minorVersion, uint32_t * subminorVersion, uint32_t * patchVersion);
135  static PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Create(peak_afl_manager_handle * handle, PEAK_NODE_MAP_HANDLE nodeMapHandle);
136  static PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Destroy(peak_afl_manager_handle handle);
139  static PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Process(peak_afl_manager_handle handle, PEAK_IPL_IMAGE_HANDLE imageHandle);
143  static PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_SetGainIPL(peak_afl_manager_handle handle, PEAK_IPL_GAIN_HANDLE gainHandle);
144  static PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Status(peak_afl_manager_handle handle, peak_afl_BOOL8 * running);
145  static PEAK_AFL_API_STATUS peak_afl_AutoController_Create(peak_afl_controller_handle * controller, peak_afl_controllerType controllerType);
146  static PEAK_AFL_API_STATUS peak_afl_AutoController_Destroy(peak_afl_controller_handle controller);
147  static PEAK_AFL_API_STATUS peak_afl_AutoController_SkipFrames_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
148  static PEAK_AFL_API_STATUS peak_afl_AutoController_SkipFrames_Set(peak_afl_controller_handle controller, uint32_t count);
149  static PEAK_AFL_API_STATUS peak_afl_AutoController_SkipFrames_Get(peak_afl_controller_handle controller, uint32_t * count);
150  static PEAK_AFL_API_STATUS peak_afl_AutoController_SkipFrames_GetRange(peak_afl_controller_handle controller, uint32_t * min, uint32_t * max, uint32_t * inc);
151  static PEAK_AFL_API_STATUS peak_afl_AutoController_ROI_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
152  static PEAK_AFL_API_STATUS peak_afl_AutoController_ROI_Set(peak_afl_controller_handle controller, peak_afl_rectangle roi);
153  static PEAK_AFL_API_STATUS peak_afl_AutoController_ROI_Get(peak_afl_controller_handle controller, peak_afl_rectangle * roi);
154  static PEAK_AFL_API_STATUS peak_afl_AutoController_ROI_Preset_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
155  static PEAK_AFL_API_STATUS peak_afl_AutoController_ROI_Preset_Set(peak_afl_controller_handle controller, peak_afl_roi_preset roiPreset);
156  static PEAK_AFL_API_STATUS peak_afl_AutoController_Mode_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
163  static PEAK_AFL_API_STATUS peak_afl_AutoController_BrightnessComponent_Callback_Set(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_callback_type type, void * funcPtr, void * context);
164  static PEAK_AFL_API_STATUS peak_afl_AutoController_Status(peak_afl_controller_handle controller, peak_afl_controller_status * status);
165  static PEAK_AFL_API_STATUS peak_afl_AutoController_GetLastAutoAverage(peak_afl_controller_handle controller, uint8_t * average);
166  static PEAK_AFL_API_STATUS peak_afl_AutoController_GetLastAutoAverages(peak_afl_controller_handle controller, uint8_t * averageRed, uint8_t * averageGreen, uint8_t * averageBlue);
167  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTarget_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
168  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTarget_Set(peak_afl_controller_handle controller, uint32_t target);
169  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTarget_Get(peak_afl_controller_handle controller, uint32_t * target);
170  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTarget_GetRange(peak_afl_controller_handle controller, uint32_t * min, uint32_t * max, uint32_t * inc);
171  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTolerance_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
172  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTolerance_Set(peak_afl_controller_handle controller, uint32_t tolerance);
173  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTolerance_Get(peak_afl_controller_handle controller, uint32_t * tolerance);
174  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTolerance_GetRange(peak_afl_controller_handle controller, uint32_t * min, uint32_t * max, uint32_t * inc);
175  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoPercentile_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
176  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoPercentile_Set(peak_afl_controller_handle controller, double percentile);
177  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoPercentile_Get(peak_afl_controller_handle controller, double * percentile);
178  static PEAK_AFL_API_STATUS peak_afl_AutoController_AutoPercentile_GetRange(peak_afl_controller_handle controller, double * min, double * max, double * inc);
179  static PEAK_AFL_API_STATUS peak_afl_AutoController_Type_Get(peak_afl_controller_handle controller, peak_afl_controllerType * type);
180  static PEAK_AFL_API_STATUS peak_afl_AutoController_Algorithm_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
182  static PEAK_AFL_API_STATUS peak_afl_AutoController_Algorithm_Get(peak_afl_controller_handle controller, peak_afl_controller_algorithm * algorithm);
183  static PEAK_AFL_API_STATUS peak_afl_AutoController_Algorithm_GetList(peak_afl_controller_handle controller, peak_afl_controller_algorithm * typeList, uint32_t * listSize);
187  static PEAK_AFL_API_STATUS peak_afl_AutoController_SharpnessAlgorithm_GetList(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm * typeList, uint32_t * listSize);
188  static PEAK_AFL_API_STATUS peak_afl_AutoController_Callback_Set(peak_afl_controller_handle controller, peak_afl_callback_type type, void * funcPtr, void * context);
189  static PEAK_AFL_API_STATUS peak_afl_AutoController_Weighted_ROI_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
190  static PEAK_AFL_API_STATUS peak_afl_AutoController_Weighted_ROI_Min_Size(peak_afl_controller_handle controller, peak_afl_size * size);
191  static PEAK_AFL_API_STATUS peak_afl_AutoController_Weighted_ROI_Set(peak_afl_controller_handle controller, const peak_afl_weighted_rectangle * weightedRoiList, uint32_t listSize);
192  static PEAK_AFL_API_STATUS peak_afl_AutoController_Weighted_ROI_Get(peak_afl_controller_handle controller, peak_afl_weighted_rectangle * weightedRoiList, uint32_t * listSize);
193  static PEAK_AFL_API_STATUS peak_afl_AutoController_Limit_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
195  static PEAK_AFL_API_STATUS peak_afl_AutoController_Limit_Set(peak_afl_controller_handle controller, peak_afl_controller_limit limit);
196  static PEAK_AFL_API_STATUS peak_afl_AutoController_Limit_Get(peak_afl_controller_handle controller, peak_afl_controller_limit * limit);
197  static PEAK_AFL_API_STATUS peak_afl_AutoController_Hysteresis_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 * supported);
198  static PEAK_AFL_API_STATUS peak_afl_AutoController_Hysteresis_Default(peak_afl_controller_handle controller, uint8_t * hysteresis);
199  static PEAK_AFL_API_STATUS peak_afl_AutoController_Hysteresis_Set(peak_afl_controller_handle controller, uint8_t hysteresis);
200  static PEAK_AFL_API_STATUS peak_afl_AutoController_Hysteresis_Get(peak_afl_controller_handle controller, uint8_t * hysteresis);
201  static PEAK_AFL_API_STATUS peak_afl_AutoController_Hysteresis_GetRange(peak_afl_controller_handle controller, uint8_t * min, uint8_t * max, uint8_t * inc);
202 
203 private:
204  void* m_handle = nullptr;
205  dyn_peak_afl_Init m_peak_afl_Init{};
206  dyn_peak_afl_Exit m_peak_afl_Exit{};
207  dyn_peak_afl_GetLastError m_peak_afl_GetLastError{};
208  dyn_peak_afl_GetVersion m_peak_afl_GetVersion{};
209  dyn_peak_afl_AutoFeatureManager_Create m_peak_afl_AutoFeatureManager_Create{};
210  dyn_peak_afl_AutoFeatureManager_Destroy m_peak_afl_AutoFeatureManager_Destroy{};
211  dyn_peak_afl_AutoFeatureManager_AddController m_peak_afl_AutoFeatureManager_AddController{};
212  dyn_peak_afl_AutoFeatureManager_RemoveController m_peak_afl_AutoFeatureManager_RemoveController{};
213  dyn_peak_afl_AutoFeatureManager_Process m_peak_afl_AutoFeatureManager_Process{};
214  dyn_peak_afl_AutoFeatureManager_CreateController m_peak_afl_AutoFeatureManager_CreateController{};
215  dyn_peak_afl_AutoFeatureManager_DestroyAllController m_peak_afl_AutoFeatureManager_DestroyAllController{};
216  dyn_peak_afl_AutoFeatureManager_DestroyController m_peak_afl_AutoFeatureManager_DestroyController{};
217  dyn_peak_afl_AutoFeatureManager_SetGainIPL m_peak_afl_AutoFeatureManager_SetGainIPL{};
218  dyn_peak_afl_AutoFeatureManager_Status m_peak_afl_AutoFeatureManager_Status{};
219  dyn_peak_afl_AutoController_Create m_peak_afl_AutoController_Create{};
220  dyn_peak_afl_AutoController_Destroy m_peak_afl_AutoController_Destroy{};
221  dyn_peak_afl_AutoController_SkipFrames_IsSupported m_peak_afl_AutoController_SkipFrames_IsSupported{};
222  dyn_peak_afl_AutoController_SkipFrames_Set m_peak_afl_AutoController_SkipFrames_Set{};
223  dyn_peak_afl_AutoController_SkipFrames_Get m_peak_afl_AutoController_SkipFrames_Get{};
224  dyn_peak_afl_AutoController_SkipFrames_GetRange m_peak_afl_AutoController_SkipFrames_GetRange{};
225  dyn_peak_afl_AutoController_ROI_IsSupported m_peak_afl_AutoController_ROI_IsSupported{};
226  dyn_peak_afl_AutoController_ROI_Set m_peak_afl_AutoController_ROI_Set{};
227  dyn_peak_afl_AutoController_ROI_Get m_peak_afl_AutoController_ROI_Get{};
228  dyn_peak_afl_AutoController_ROI_Preset_IsSupported m_peak_afl_AutoController_ROI_Preset_IsSupported{};
229  dyn_peak_afl_AutoController_ROI_Preset_Set m_peak_afl_AutoController_ROI_Preset_Set{};
230  dyn_peak_afl_AutoController_Mode_IsSupported m_peak_afl_AutoController_Mode_IsSupported{};
231  dyn_peak_afl_AutoController_Mode_Set m_peak_afl_AutoController_Mode_Set{};
232  dyn_peak_afl_AutoController_Mode_Get m_peak_afl_AutoController_Mode_Get{};
233  dyn_peak_afl_AutoController_BrightnessComponent_Mode_IsSupported m_peak_afl_AutoController_BrightnessComponent_Mode_IsSupported{};
234  dyn_peak_afl_AutoController_BrightnessComponent_Mode_Set m_peak_afl_AutoController_BrightnessComponent_Mode_Set{};
235  dyn_peak_afl_AutoController_BrightnessComponent_Mode_Get m_peak_afl_AutoController_BrightnessComponent_Mode_Get{};
236  dyn_peak_afl_AutoController_BrightnessComponent_Status m_peak_afl_AutoController_BrightnessComponent_Status{};
237  dyn_peak_afl_AutoController_BrightnessComponent_Callback_Set m_peak_afl_AutoController_BrightnessComponent_Callback_Set{};
238  dyn_peak_afl_AutoController_Status m_peak_afl_AutoController_Status{};
239  dyn_peak_afl_AutoController_GetLastAutoAverage m_peak_afl_AutoController_GetLastAutoAverage{};
240  dyn_peak_afl_AutoController_GetLastAutoAverages m_peak_afl_AutoController_GetLastAutoAverages{};
241  dyn_peak_afl_AutoController_AutoTarget_IsSupported m_peak_afl_AutoController_AutoTarget_IsSupported{};
242  dyn_peak_afl_AutoController_AutoTarget_Set m_peak_afl_AutoController_AutoTarget_Set{};
243  dyn_peak_afl_AutoController_AutoTarget_Get m_peak_afl_AutoController_AutoTarget_Get{};
244  dyn_peak_afl_AutoController_AutoTarget_GetRange m_peak_afl_AutoController_AutoTarget_GetRange{};
245  dyn_peak_afl_AutoController_AutoTolerance_IsSupported m_peak_afl_AutoController_AutoTolerance_IsSupported{};
246  dyn_peak_afl_AutoController_AutoTolerance_Set m_peak_afl_AutoController_AutoTolerance_Set{};
247  dyn_peak_afl_AutoController_AutoTolerance_Get m_peak_afl_AutoController_AutoTolerance_Get{};
248  dyn_peak_afl_AutoController_AutoTolerance_GetRange m_peak_afl_AutoController_AutoTolerance_GetRange{};
249  dyn_peak_afl_AutoController_AutoPercentile_IsSupported m_peak_afl_AutoController_AutoPercentile_IsSupported{};
250  dyn_peak_afl_AutoController_AutoPercentile_Set m_peak_afl_AutoController_AutoPercentile_Set{};
251  dyn_peak_afl_AutoController_AutoPercentile_Get m_peak_afl_AutoController_AutoPercentile_Get{};
252  dyn_peak_afl_AutoController_AutoPercentile_GetRange m_peak_afl_AutoController_AutoPercentile_GetRange{};
253  dyn_peak_afl_AutoController_Type_Get m_peak_afl_AutoController_Type_Get{};
254  dyn_peak_afl_AutoController_Algorithm_IsSupported m_peak_afl_AutoController_Algorithm_IsSupported{};
255  dyn_peak_afl_AutoController_Algorithm_Set m_peak_afl_AutoController_Algorithm_Set{};
256  dyn_peak_afl_AutoController_Algorithm_Get m_peak_afl_AutoController_Algorithm_Get{};
257  dyn_peak_afl_AutoController_Algorithm_GetList m_peak_afl_AutoController_Algorithm_GetList{};
258  dyn_peak_afl_AutoController_SharpnessAlgorithm_IsSupported m_peak_afl_AutoController_SharpnessAlgorithm_IsSupported{};
259  dyn_peak_afl_AutoController_SharpnessAlgorithm_Set m_peak_afl_AutoController_SharpnessAlgorithm_Set{};
260  dyn_peak_afl_AutoController_SharpnessAlgorithm_Get m_peak_afl_AutoController_SharpnessAlgorithm_Get{};
261  dyn_peak_afl_AutoController_SharpnessAlgorithm_GetList m_peak_afl_AutoController_SharpnessAlgorithm_GetList{};
262  dyn_peak_afl_AutoController_Callback_Set m_peak_afl_AutoController_Callback_Set{};
263  dyn_peak_afl_AutoController_Weighted_ROI_IsSupported m_peak_afl_AutoController_Weighted_ROI_IsSupported{};
264  dyn_peak_afl_AutoController_Weighted_ROI_Min_Size m_peak_afl_AutoController_Weighted_ROI_Min_Size{};
265  dyn_peak_afl_AutoController_Weighted_ROI_Set m_peak_afl_AutoController_Weighted_ROI_Set{};
266  dyn_peak_afl_AutoController_Weighted_ROI_Get m_peak_afl_AutoController_Weighted_ROI_Get{};
267  dyn_peak_afl_AutoController_Limit_IsSupported m_peak_afl_AutoController_Limit_IsSupported{};
268  dyn_peak_afl_AutoController_Limit_Default m_peak_afl_AutoController_Limit_Default{};
269  dyn_peak_afl_AutoController_Limit_Set m_peak_afl_AutoController_Limit_Set{};
270  dyn_peak_afl_AutoController_Limit_Get m_peak_afl_AutoController_Limit_Get{};
271  dyn_peak_afl_AutoController_Hysteresis_IsSupported m_peak_afl_AutoController_Hysteresis_IsSupported{};
272  dyn_peak_afl_AutoController_Hysteresis_Default m_peak_afl_AutoController_Hysteresis_Default{};
273  dyn_peak_afl_AutoController_Hysteresis_Set m_peak_afl_AutoController_Hysteresis_Set{};
274  dyn_peak_afl_AutoController_Hysteresis_Get m_peak_afl_AutoController_Hysteresis_Get{};
275  dyn_peak_afl_AutoController_Hysteresis_GetRange m_peak_afl_AutoController_Hysteresis_GetRange{};
276 
277 };
278 
279 inline void* import_function(void *module, const char* proc_name)
280 {
281 #ifdef __linux__
282  return dlsym(module, proc_name);
283 #else
284  return GetProcAddress(static_cast<HMODULE>(module), proc_name);
285 #endif
286 }
287 
288 inline DynamicLoader::DynamicLoader()
289 {
290 #if defined _WIN32 || defined _WIN64
291  size_t sz = 0;
292  if (_wgetenv_s(&sz, NULL, 0, L"aapienvvarrootpath") == 0
293  && sz > 0)
294  {
295  std::vector<wchar_t> env_peak_afl(sz);
296  if (_wgetenv_s(&sz, env_peak_afl.data(), sz, L"aapienvvarrootpath") == 0)
297  {
298  if (_wgetenv_s(&sz, NULL, 0, L"PATH") == 0
299  && sz > 0)
300  {
301  std::vector<wchar_t> env_path(sz);
302  if (_wgetenv_s(&sz, env_path.data(), sz, L"PATH") == 0)
303  {
304  std::wstring peak_afl_path(env_peak_afl.data());
305 #ifdef _WIN64
306  peak_afl_path.append(L"\\aapi\\lib\\x86_64");
307 #else
308  peak_afl_path.append(L"\\aapi\\lib\\x86_32");
309 #endif
310  std::wstring path_var(env_path.data());
311  path_var.append(L";").append(peak_afl_path);
312  _wputenv_s(L"PATH", path_var.c_str());
313  }
314  }
315  }
316  }
317 
318  loadLib("peak_afl.dll");
319 #else
320  loadLib("libpeak_afl.so");
321 #endif
322 }
323 
324 inline DynamicLoader::~DynamicLoader()
325 {
326  if(m_handle != nullptr)
327  {
328  unload();
329  }
330 }
331 
332 inline bool DynamicLoader::isLoaded()
333 {
334  auto&& inst = instance();
335  return inst.m_handle != nullptr;
336 }
337 
338 inline void DynamicLoader::unload()
339 {
340  setPointers(false);
341 
342  if (m_handle != nullptr)
343  {
344 #ifdef __linux__
345  dlclose(m_handle);
346 #else
347  FreeLibrary(static_cast<HMODULE>(m_handle));
348 #endif
349  }
350  m_handle = nullptr;
351 }
352 
353 
354 inline bool DynamicLoader::loadLib(const char* file)
355 {
356  bool ret = false;
357 
358  if (file)
359  {
360 #ifdef __linux__
361  m_handle = dlopen(file, RTLD_NOW);
362 #else
363  m_handle = LoadLibraryA(file);
364 #endif
365  if (m_handle != nullptr)
366  {
367  try {
368  setPointers(true);
369  ret = true;
370  } catch (const std::exception&) {
371  unload();
372  throw;
373  }
374  }
375  else
376  {
377  throw std::runtime_error(std::string("Lib load failed: ") + file);
378  }
379  }
380  else
381  {
382  throw std::runtime_error("Filename empty");
383  }
384 
385  return ret;
386 }
387 
388 inline bool DynamicLoader::setPointers(bool load)
389 {
390 
391  m_peak_afl_Init = (dyn_peak_afl_Init) (load ? import_function(m_handle, "peak_afl_Init") : nullptr);
392  if(m_peak_afl_Init == nullptr && load)
393  {
394  throw std::runtime_error("Failed to load peak_afl_Init");
395  }
396 
397  m_peak_afl_Exit = (dyn_peak_afl_Exit) (load ? import_function(m_handle, "peak_afl_Exit") : nullptr);
398  if(m_peak_afl_Exit == nullptr && load)
399  {
400  throw std::runtime_error("Failed to load peak_afl_Exit");
401  }
402 
403  m_peak_afl_GetLastError = (dyn_peak_afl_GetLastError) (load ? import_function(m_handle, "peak_afl_GetLastError") : nullptr);
404  if(m_peak_afl_GetLastError == nullptr && load)
405  {
406  throw std::runtime_error("Failed to load peak_afl_GetLastError");
407  }
408 
409  m_peak_afl_GetVersion = (dyn_peak_afl_GetVersion) (load ? import_function(m_handle, "peak_afl_GetVersion") : nullptr);
410  if(m_peak_afl_GetVersion == nullptr && load)
411  {
412  throw std::runtime_error("Failed to load peak_afl_GetVersion");
413  }
414 
415  m_peak_afl_AutoFeatureManager_Create = (dyn_peak_afl_AutoFeatureManager_Create) (load ? import_function(m_handle, "peak_afl_AutoFeatureManager_Create") : nullptr);
416  if(m_peak_afl_AutoFeatureManager_Create == nullptr && load)
417  {
418  throw std::runtime_error("Failed to load peak_afl_AutoFeatureManager_Create");
419  }
420 
421  m_peak_afl_AutoFeatureManager_Destroy = (dyn_peak_afl_AutoFeatureManager_Destroy) (load ? import_function(m_handle, "peak_afl_AutoFeatureManager_Destroy") : nullptr);
422  if(m_peak_afl_AutoFeatureManager_Destroy == nullptr && load)
423  {
424  throw std::runtime_error("Failed to load peak_afl_AutoFeatureManager_Destroy");
425  }
426 
427  m_peak_afl_AutoFeatureManager_AddController = (dyn_peak_afl_AutoFeatureManager_AddController) (load ? import_function(m_handle, "peak_afl_AutoFeatureManager_AddController") : nullptr);
428  if(m_peak_afl_AutoFeatureManager_AddController == nullptr && load)
429  {
430  throw std::runtime_error("Failed to load peak_afl_AutoFeatureManager_AddController");
431  }
432 
433  m_peak_afl_AutoFeatureManager_RemoveController = (dyn_peak_afl_AutoFeatureManager_RemoveController) (load ? import_function(m_handle, "peak_afl_AutoFeatureManager_RemoveController") : nullptr);
434  if(m_peak_afl_AutoFeatureManager_RemoveController == nullptr && load)
435  {
436  throw std::runtime_error("Failed to load peak_afl_AutoFeatureManager_RemoveController");
437  }
438 
439  m_peak_afl_AutoFeatureManager_Process = (dyn_peak_afl_AutoFeatureManager_Process) (load ? import_function(m_handle, "peak_afl_AutoFeatureManager_Process") : nullptr);
440  if(m_peak_afl_AutoFeatureManager_Process == nullptr && load)
441  {
442  throw std::runtime_error("Failed to load peak_afl_AutoFeatureManager_Process");
443  }
444 
445  m_peak_afl_AutoFeatureManager_CreateController = (dyn_peak_afl_AutoFeatureManager_CreateController) (load ? import_function(m_handle, "peak_afl_AutoFeatureManager_CreateController") : nullptr);
446  if(m_peak_afl_AutoFeatureManager_CreateController == nullptr && load)
447  {
448  throw std::runtime_error("Failed to load peak_afl_AutoFeatureManager_CreateController");
449  }
450 
451  m_peak_afl_AutoFeatureManager_DestroyAllController = (dyn_peak_afl_AutoFeatureManager_DestroyAllController) (load ? import_function(m_handle, "peak_afl_AutoFeatureManager_DestroyAllController") : nullptr);
452  if(m_peak_afl_AutoFeatureManager_DestroyAllController == nullptr && load)
453  {
454  throw std::runtime_error("Failed to load peak_afl_AutoFeatureManager_DestroyAllController");
455  }
456 
457  m_peak_afl_AutoFeatureManager_DestroyController = (dyn_peak_afl_AutoFeatureManager_DestroyController) (load ? import_function(m_handle, "peak_afl_AutoFeatureManager_DestroyController") : nullptr);
458  if(m_peak_afl_AutoFeatureManager_DestroyController == nullptr && load)
459  {
460  throw std::runtime_error("Failed to load peak_afl_AutoFeatureManager_DestroyController");
461  }
462 
463  m_peak_afl_AutoFeatureManager_SetGainIPL = (dyn_peak_afl_AutoFeatureManager_SetGainIPL) (load ? import_function(m_handle, "peak_afl_AutoFeatureManager_SetGainIPL") : nullptr);
464  if(m_peak_afl_AutoFeatureManager_SetGainIPL == nullptr && load)
465  {
466  throw std::runtime_error("Failed to load peak_afl_AutoFeatureManager_SetGainIPL");
467  }
468 
469  m_peak_afl_AutoFeatureManager_Status = (dyn_peak_afl_AutoFeatureManager_Status) (load ? import_function(m_handle, "peak_afl_AutoFeatureManager_Status") : nullptr);
470  if(m_peak_afl_AutoFeatureManager_Status == nullptr && load)
471  {
472  throw std::runtime_error("Failed to load peak_afl_AutoFeatureManager_Status");
473  }
474 
475  m_peak_afl_AutoController_Create = (dyn_peak_afl_AutoController_Create) (load ? import_function(m_handle, "peak_afl_AutoController_Create") : nullptr);
476  if(m_peak_afl_AutoController_Create == nullptr && load)
477  {
478  throw std::runtime_error("Failed to load peak_afl_AutoController_Create");
479  }
480 
481  m_peak_afl_AutoController_Destroy = (dyn_peak_afl_AutoController_Destroy) (load ? import_function(m_handle, "peak_afl_AutoController_Destroy") : nullptr);
482  if(m_peak_afl_AutoController_Destroy == nullptr && load)
483  {
484  throw std::runtime_error("Failed to load peak_afl_AutoController_Destroy");
485  }
486 
487  m_peak_afl_AutoController_SkipFrames_IsSupported = (dyn_peak_afl_AutoController_SkipFrames_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_SkipFrames_IsSupported") : nullptr);
488  if(m_peak_afl_AutoController_SkipFrames_IsSupported == nullptr && load)
489  {
490  throw std::runtime_error("Failed to load peak_afl_AutoController_SkipFrames_IsSupported");
491  }
492 
493  m_peak_afl_AutoController_SkipFrames_Set = (dyn_peak_afl_AutoController_SkipFrames_Set) (load ? import_function(m_handle, "peak_afl_AutoController_SkipFrames_Set") : nullptr);
494  if(m_peak_afl_AutoController_SkipFrames_Set == nullptr && load)
495  {
496  throw std::runtime_error("Failed to load peak_afl_AutoController_SkipFrames_Set");
497  }
498 
499  m_peak_afl_AutoController_SkipFrames_Get = (dyn_peak_afl_AutoController_SkipFrames_Get) (load ? import_function(m_handle, "peak_afl_AutoController_SkipFrames_Get") : nullptr);
500  if(m_peak_afl_AutoController_SkipFrames_Get == nullptr && load)
501  {
502  throw std::runtime_error("Failed to load peak_afl_AutoController_SkipFrames_Get");
503  }
504 
505  m_peak_afl_AutoController_SkipFrames_GetRange = (dyn_peak_afl_AutoController_SkipFrames_GetRange) (load ? import_function(m_handle, "peak_afl_AutoController_SkipFrames_GetRange") : nullptr);
506  if(m_peak_afl_AutoController_SkipFrames_GetRange == nullptr && load)
507  {
508  throw std::runtime_error("Failed to load peak_afl_AutoController_SkipFrames_GetRange");
509  }
510 
511  m_peak_afl_AutoController_ROI_IsSupported = (dyn_peak_afl_AutoController_ROI_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_ROI_IsSupported") : nullptr);
512  if(m_peak_afl_AutoController_ROI_IsSupported == nullptr && load)
513  {
514  throw std::runtime_error("Failed to load peak_afl_AutoController_ROI_IsSupported");
515  }
516 
517  m_peak_afl_AutoController_ROI_Set = (dyn_peak_afl_AutoController_ROI_Set) (load ? import_function(m_handle, "peak_afl_AutoController_ROI_Set") : nullptr);
518  if(m_peak_afl_AutoController_ROI_Set == nullptr && load)
519  {
520  throw std::runtime_error("Failed to load peak_afl_AutoController_ROI_Set");
521  }
522 
523  m_peak_afl_AutoController_ROI_Get = (dyn_peak_afl_AutoController_ROI_Get) (load ? import_function(m_handle, "peak_afl_AutoController_ROI_Get") : nullptr);
524  if(m_peak_afl_AutoController_ROI_Get == nullptr && load)
525  {
526  throw std::runtime_error("Failed to load peak_afl_AutoController_ROI_Get");
527  }
528 
529  m_peak_afl_AutoController_ROI_Preset_IsSupported = (dyn_peak_afl_AutoController_ROI_Preset_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_ROI_Preset_IsSupported") : nullptr);
530  if(m_peak_afl_AutoController_ROI_Preset_IsSupported == nullptr && load)
531  {
532  throw std::runtime_error("Failed to load peak_afl_AutoController_ROI_Preset_IsSupported");
533  }
534 
535  m_peak_afl_AutoController_ROI_Preset_Set = (dyn_peak_afl_AutoController_ROI_Preset_Set) (load ? import_function(m_handle, "peak_afl_AutoController_ROI_Preset_Set") : nullptr);
536  if(m_peak_afl_AutoController_ROI_Preset_Set == nullptr && load)
537  {
538  throw std::runtime_error("Failed to load peak_afl_AutoController_ROI_Preset_Set");
539  }
540 
541  m_peak_afl_AutoController_Mode_IsSupported = (dyn_peak_afl_AutoController_Mode_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_Mode_IsSupported") : nullptr);
542  if(m_peak_afl_AutoController_Mode_IsSupported == nullptr && load)
543  {
544  throw std::runtime_error("Failed to load peak_afl_AutoController_Mode_IsSupported");
545  }
546 
547  m_peak_afl_AutoController_Mode_Set = (dyn_peak_afl_AutoController_Mode_Set) (load ? import_function(m_handle, "peak_afl_AutoController_Mode_Set") : nullptr);
548  if(m_peak_afl_AutoController_Mode_Set == nullptr && load)
549  {
550  throw std::runtime_error("Failed to load peak_afl_AutoController_Mode_Set");
551  }
552 
553  m_peak_afl_AutoController_Mode_Get = (dyn_peak_afl_AutoController_Mode_Get) (load ? import_function(m_handle, "peak_afl_AutoController_Mode_Get") : nullptr);
554  if(m_peak_afl_AutoController_Mode_Get == nullptr && load)
555  {
556  throw std::runtime_error("Failed to load peak_afl_AutoController_Mode_Get");
557  }
558 
559  m_peak_afl_AutoController_BrightnessComponent_Mode_IsSupported = (dyn_peak_afl_AutoController_BrightnessComponent_Mode_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_BrightnessComponent_Mode_IsSupported") : nullptr);
560  if(m_peak_afl_AutoController_BrightnessComponent_Mode_IsSupported == nullptr && load)
561  {
562  throw std::runtime_error("Failed to load peak_afl_AutoController_BrightnessComponent_Mode_IsSupported");
563  }
564 
565  m_peak_afl_AutoController_BrightnessComponent_Mode_Set = (dyn_peak_afl_AutoController_BrightnessComponent_Mode_Set) (load ? import_function(m_handle, "peak_afl_AutoController_BrightnessComponent_Mode_Set") : nullptr);
566  if(m_peak_afl_AutoController_BrightnessComponent_Mode_Set == nullptr && load)
567  {
568  throw std::runtime_error("Failed to load peak_afl_AutoController_BrightnessComponent_Mode_Set");
569  }
570 
571  m_peak_afl_AutoController_BrightnessComponent_Mode_Get = (dyn_peak_afl_AutoController_BrightnessComponent_Mode_Get) (load ? import_function(m_handle, "peak_afl_AutoController_BrightnessComponent_Mode_Get") : nullptr);
572  if(m_peak_afl_AutoController_BrightnessComponent_Mode_Get == nullptr && load)
573  {
574  throw std::runtime_error("Failed to load peak_afl_AutoController_BrightnessComponent_Mode_Get");
575  }
576 
577  m_peak_afl_AutoController_BrightnessComponent_Status = (dyn_peak_afl_AutoController_BrightnessComponent_Status) (load ? import_function(m_handle, "peak_afl_AutoController_BrightnessComponent_Status") : nullptr);
578  if(m_peak_afl_AutoController_BrightnessComponent_Status == nullptr && load)
579  {
580  throw std::runtime_error("Failed to load peak_afl_AutoController_BrightnessComponent_Status");
581  }
582 
583  m_peak_afl_AutoController_BrightnessComponent_Callback_Set = (dyn_peak_afl_AutoController_BrightnessComponent_Callback_Set) (load ? import_function(m_handle, "peak_afl_AutoController_BrightnessComponent_Callback_Set") : nullptr);
584  if(m_peak_afl_AutoController_BrightnessComponent_Callback_Set == nullptr && load)
585  {
586  throw std::runtime_error("Failed to load peak_afl_AutoController_BrightnessComponent_Callback_Set");
587  }
588 
589  m_peak_afl_AutoController_Status = (dyn_peak_afl_AutoController_Status) (load ? import_function(m_handle, "peak_afl_AutoController_Status") : nullptr);
590  if(m_peak_afl_AutoController_Status == nullptr && load)
591  {
592  throw std::runtime_error("Failed to load peak_afl_AutoController_Status");
593  }
594 
595  m_peak_afl_AutoController_GetLastAutoAverage = (dyn_peak_afl_AutoController_GetLastAutoAverage) (load ? import_function(m_handle, "peak_afl_AutoController_GetLastAutoAverage") : nullptr);
596  if(m_peak_afl_AutoController_GetLastAutoAverage == nullptr && load)
597  {
598  throw std::runtime_error("Failed to load peak_afl_AutoController_GetLastAutoAverage");
599  }
600 
601  m_peak_afl_AutoController_GetLastAutoAverages = (dyn_peak_afl_AutoController_GetLastAutoAverages) (load ? import_function(m_handle, "peak_afl_AutoController_GetLastAutoAverages") : nullptr);
602  if(m_peak_afl_AutoController_GetLastAutoAverages == nullptr && load)
603  {
604  throw std::runtime_error("Failed to load peak_afl_AutoController_GetLastAutoAverages");
605  }
606 
607  m_peak_afl_AutoController_AutoTarget_IsSupported = (dyn_peak_afl_AutoController_AutoTarget_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_AutoTarget_IsSupported") : nullptr);
608  if(m_peak_afl_AutoController_AutoTarget_IsSupported == nullptr && load)
609  {
610  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoTarget_IsSupported");
611  }
612 
613  m_peak_afl_AutoController_AutoTarget_Set = (dyn_peak_afl_AutoController_AutoTarget_Set) (load ? import_function(m_handle, "peak_afl_AutoController_AutoTarget_Set") : nullptr);
614  if(m_peak_afl_AutoController_AutoTarget_Set == nullptr && load)
615  {
616  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoTarget_Set");
617  }
618 
619  m_peak_afl_AutoController_AutoTarget_Get = (dyn_peak_afl_AutoController_AutoTarget_Get) (load ? import_function(m_handle, "peak_afl_AutoController_AutoTarget_Get") : nullptr);
620  if(m_peak_afl_AutoController_AutoTarget_Get == nullptr && load)
621  {
622  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoTarget_Get");
623  }
624 
625  m_peak_afl_AutoController_AutoTarget_GetRange = (dyn_peak_afl_AutoController_AutoTarget_GetRange) (load ? import_function(m_handle, "peak_afl_AutoController_AutoTarget_GetRange") : nullptr);
626  if(m_peak_afl_AutoController_AutoTarget_GetRange == nullptr && load)
627  {
628  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoTarget_GetRange");
629  }
630 
631  m_peak_afl_AutoController_AutoTolerance_IsSupported = (dyn_peak_afl_AutoController_AutoTolerance_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_AutoTolerance_IsSupported") : nullptr);
632  if(m_peak_afl_AutoController_AutoTolerance_IsSupported == nullptr && load)
633  {
634  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoTolerance_IsSupported");
635  }
636 
637  m_peak_afl_AutoController_AutoTolerance_Set = (dyn_peak_afl_AutoController_AutoTolerance_Set) (load ? import_function(m_handle, "peak_afl_AutoController_AutoTolerance_Set") : nullptr);
638  if(m_peak_afl_AutoController_AutoTolerance_Set == nullptr && load)
639  {
640  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoTolerance_Set");
641  }
642 
643  m_peak_afl_AutoController_AutoTolerance_Get = (dyn_peak_afl_AutoController_AutoTolerance_Get) (load ? import_function(m_handle, "peak_afl_AutoController_AutoTolerance_Get") : nullptr);
644  if(m_peak_afl_AutoController_AutoTolerance_Get == nullptr && load)
645  {
646  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoTolerance_Get");
647  }
648 
649  m_peak_afl_AutoController_AutoTolerance_GetRange = (dyn_peak_afl_AutoController_AutoTolerance_GetRange) (load ? import_function(m_handle, "peak_afl_AutoController_AutoTolerance_GetRange") : nullptr);
650  if(m_peak_afl_AutoController_AutoTolerance_GetRange == nullptr && load)
651  {
652  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoTolerance_GetRange");
653  }
654 
655  m_peak_afl_AutoController_AutoPercentile_IsSupported = (dyn_peak_afl_AutoController_AutoPercentile_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_AutoPercentile_IsSupported") : nullptr);
656  if(m_peak_afl_AutoController_AutoPercentile_IsSupported == nullptr && load)
657  {
658  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoPercentile_IsSupported");
659  }
660 
661  m_peak_afl_AutoController_AutoPercentile_Set = (dyn_peak_afl_AutoController_AutoPercentile_Set) (load ? import_function(m_handle, "peak_afl_AutoController_AutoPercentile_Set") : nullptr);
662  if(m_peak_afl_AutoController_AutoPercentile_Set == nullptr && load)
663  {
664  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoPercentile_Set");
665  }
666 
667  m_peak_afl_AutoController_AutoPercentile_Get = (dyn_peak_afl_AutoController_AutoPercentile_Get) (load ? import_function(m_handle, "peak_afl_AutoController_AutoPercentile_Get") : nullptr);
668  if(m_peak_afl_AutoController_AutoPercentile_Get == nullptr && load)
669  {
670  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoPercentile_Get");
671  }
672 
673  m_peak_afl_AutoController_AutoPercentile_GetRange = (dyn_peak_afl_AutoController_AutoPercentile_GetRange) (load ? import_function(m_handle, "peak_afl_AutoController_AutoPercentile_GetRange") : nullptr);
674  if(m_peak_afl_AutoController_AutoPercentile_GetRange == nullptr && load)
675  {
676  throw std::runtime_error("Failed to load peak_afl_AutoController_AutoPercentile_GetRange");
677  }
678 
679  m_peak_afl_AutoController_Type_Get = (dyn_peak_afl_AutoController_Type_Get) (load ? import_function(m_handle, "peak_afl_AutoController_Type_Get") : nullptr);
680  if(m_peak_afl_AutoController_Type_Get == nullptr && load)
681  {
682  throw std::runtime_error("Failed to load peak_afl_AutoController_Type_Get");
683  }
684 
685  m_peak_afl_AutoController_Algorithm_IsSupported = (dyn_peak_afl_AutoController_Algorithm_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_Algorithm_IsSupported") : nullptr);
686  if(m_peak_afl_AutoController_Algorithm_IsSupported == nullptr && load)
687  {
688  throw std::runtime_error("Failed to load peak_afl_AutoController_Algorithm_IsSupported");
689  }
690 
691  m_peak_afl_AutoController_Algorithm_Set = (dyn_peak_afl_AutoController_Algorithm_Set) (load ? import_function(m_handle, "peak_afl_AutoController_Algorithm_Set") : nullptr);
692  if(m_peak_afl_AutoController_Algorithm_Set == nullptr && load)
693  {
694  throw std::runtime_error("Failed to load peak_afl_AutoController_Algorithm_Set");
695  }
696 
697  m_peak_afl_AutoController_Algorithm_Get = (dyn_peak_afl_AutoController_Algorithm_Get) (load ? import_function(m_handle, "peak_afl_AutoController_Algorithm_Get") : nullptr);
698  if(m_peak_afl_AutoController_Algorithm_Get == nullptr && load)
699  {
700  throw std::runtime_error("Failed to load peak_afl_AutoController_Algorithm_Get");
701  }
702 
703  m_peak_afl_AutoController_Algorithm_GetList = (dyn_peak_afl_AutoController_Algorithm_GetList) (load ? import_function(m_handle, "peak_afl_AutoController_Algorithm_GetList") : nullptr);
704  if(m_peak_afl_AutoController_Algorithm_GetList == nullptr && load)
705  {
706  throw std::runtime_error("Failed to load peak_afl_AutoController_Algorithm_GetList");
707  }
708 
709  m_peak_afl_AutoController_SharpnessAlgorithm_IsSupported = (dyn_peak_afl_AutoController_SharpnessAlgorithm_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_SharpnessAlgorithm_IsSupported") : nullptr);
710  if(m_peak_afl_AutoController_SharpnessAlgorithm_IsSupported == nullptr && load)
711  {
712  throw std::runtime_error("Failed to load peak_afl_AutoController_SharpnessAlgorithm_IsSupported");
713  }
714 
715  m_peak_afl_AutoController_SharpnessAlgorithm_Set = (dyn_peak_afl_AutoController_SharpnessAlgorithm_Set) (load ? import_function(m_handle, "peak_afl_AutoController_SharpnessAlgorithm_Set") : nullptr);
716  if(m_peak_afl_AutoController_SharpnessAlgorithm_Set == nullptr && load)
717  {
718  throw std::runtime_error("Failed to load peak_afl_AutoController_SharpnessAlgorithm_Set");
719  }
720 
721  m_peak_afl_AutoController_SharpnessAlgorithm_Get = (dyn_peak_afl_AutoController_SharpnessAlgorithm_Get) (load ? import_function(m_handle, "peak_afl_AutoController_SharpnessAlgorithm_Get") : nullptr);
722  if(m_peak_afl_AutoController_SharpnessAlgorithm_Get == nullptr && load)
723  {
724  throw std::runtime_error("Failed to load peak_afl_AutoController_SharpnessAlgorithm_Get");
725  }
726 
727  m_peak_afl_AutoController_SharpnessAlgorithm_GetList = (dyn_peak_afl_AutoController_SharpnessAlgorithm_GetList) (load ? import_function(m_handle, "peak_afl_AutoController_SharpnessAlgorithm_GetList") : nullptr);
728  if(m_peak_afl_AutoController_SharpnessAlgorithm_GetList == nullptr && load)
729  {
730  throw std::runtime_error("Failed to load peak_afl_AutoController_SharpnessAlgorithm_GetList");
731  }
732 
733  m_peak_afl_AutoController_Callback_Set = (dyn_peak_afl_AutoController_Callback_Set) (load ? import_function(m_handle, "peak_afl_AutoController_Callback_Set") : nullptr);
734  if(m_peak_afl_AutoController_Callback_Set == nullptr && load)
735  {
736  throw std::runtime_error("Failed to load peak_afl_AutoController_Callback_Set");
737  }
738 
739  m_peak_afl_AutoController_Weighted_ROI_IsSupported = (dyn_peak_afl_AutoController_Weighted_ROI_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_Weighted_ROI_IsSupported") : nullptr);
740  if(m_peak_afl_AutoController_Weighted_ROI_IsSupported == nullptr && load)
741  {
742  throw std::runtime_error("Failed to load peak_afl_AutoController_Weighted_ROI_IsSupported");
743  }
744 
745  m_peak_afl_AutoController_Weighted_ROI_Min_Size = (dyn_peak_afl_AutoController_Weighted_ROI_Min_Size) (load ? import_function(m_handle, "peak_afl_AutoController_Weighted_ROI_Min_Size") : nullptr);
746  if(m_peak_afl_AutoController_Weighted_ROI_Min_Size == nullptr && load)
747  {
748  throw std::runtime_error("Failed to load peak_afl_AutoController_Weighted_ROI_Min_Size");
749  }
750 
751  m_peak_afl_AutoController_Weighted_ROI_Set = (dyn_peak_afl_AutoController_Weighted_ROI_Set) (load ? import_function(m_handle, "peak_afl_AutoController_Weighted_ROI_Set") : nullptr);
752  if(m_peak_afl_AutoController_Weighted_ROI_Set == nullptr && load)
753  {
754  throw std::runtime_error("Failed to load peak_afl_AutoController_Weighted_ROI_Set");
755  }
756 
757  m_peak_afl_AutoController_Weighted_ROI_Get = (dyn_peak_afl_AutoController_Weighted_ROI_Get) (load ? import_function(m_handle, "peak_afl_AutoController_Weighted_ROI_Get") : nullptr);
758  if(m_peak_afl_AutoController_Weighted_ROI_Get == nullptr && load)
759  {
760  throw std::runtime_error("Failed to load peak_afl_AutoController_Weighted_ROI_Get");
761  }
762 
763  m_peak_afl_AutoController_Limit_IsSupported = (dyn_peak_afl_AutoController_Limit_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_Limit_IsSupported") : nullptr);
764  if(m_peak_afl_AutoController_Limit_IsSupported == nullptr && load)
765  {
766  throw std::runtime_error("Failed to load peak_afl_AutoController_Limit_IsSupported");
767  }
768 
769  m_peak_afl_AutoController_Limit_Default = (dyn_peak_afl_AutoController_Limit_Default) (load ? import_function(m_handle, "peak_afl_AutoController_Limit_Default") : nullptr);
770  if(m_peak_afl_AutoController_Limit_Default == nullptr && load)
771  {
772  throw std::runtime_error("Failed to load peak_afl_AutoController_Limit_Default");
773  }
774 
775  m_peak_afl_AutoController_Limit_Set = (dyn_peak_afl_AutoController_Limit_Set) (load ? import_function(m_handle, "peak_afl_AutoController_Limit_Set") : nullptr);
776  if(m_peak_afl_AutoController_Limit_Set == nullptr && load)
777  {
778  throw std::runtime_error("Failed to load peak_afl_AutoController_Limit_Set");
779  }
780 
781  m_peak_afl_AutoController_Limit_Get = (dyn_peak_afl_AutoController_Limit_Get) (load ? import_function(m_handle, "peak_afl_AutoController_Limit_Get") : nullptr);
782  if(m_peak_afl_AutoController_Limit_Get == nullptr && load)
783  {
784  throw std::runtime_error("Failed to load peak_afl_AutoController_Limit_Get");
785  }
786 
787  m_peak_afl_AutoController_Hysteresis_IsSupported = (dyn_peak_afl_AutoController_Hysteresis_IsSupported) (load ? import_function(m_handle, "peak_afl_AutoController_Hysteresis_IsSupported") : nullptr);
788  if(m_peak_afl_AutoController_Hysteresis_IsSupported == nullptr && load)
789  {
790  throw std::runtime_error("Failed to load peak_afl_AutoController_Hysteresis_IsSupported");
791  }
792 
793  m_peak_afl_AutoController_Hysteresis_Default = (dyn_peak_afl_AutoController_Hysteresis_Default) (load ? import_function(m_handle, "peak_afl_AutoController_Hysteresis_Default") : nullptr);
794  if(m_peak_afl_AutoController_Hysteresis_Default == nullptr && load)
795  {
796  throw std::runtime_error("Failed to load peak_afl_AutoController_Hysteresis_Default");
797  }
798 
799  m_peak_afl_AutoController_Hysteresis_Set = (dyn_peak_afl_AutoController_Hysteresis_Set) (load ? import_function(m_handle, "peak_afl_AutoController_Hysteresis_Set") : nullptr);
800  if(m_peak_afl_AutoController_Hysteresis_Set == nullptr && load)
801  {
802  throw std::runtime_error("Failed to load peak_afl_AutoController_Hysteresis_Set");
803  }
804 
805  m_peak_afl_AutoController_Hysteresis_Get = (dyn_peak_afl_AutoController_Hysteresis_Get) (load ? import_function(m_handle, "peak_afl_AutoController_Hysteresis_Get") : nullptr);
806  if(m_peak_afl_AutoController_Hysteresis_Get == nullptr && load)
807  {
808  throw std::runtime_error("Failed to load peak_afl_AutoController_Hysteresis_Get");
809  }
810 
811  m_peak_afl_AutoController_Hysteresis_GetRange = (dyn_peak_afl_AutoController_Hysteresis_GetRange) (load ? import_function(m_handle, "peak_afl_AutoController_Hysteresis_GetRange") : nullptr);
812  if(m_peak_afl_AutoController_Hysteresis_GetRange == nullptr && load)
813  {
814  throw std::runtime_error("Failed to load peak_afl_AutoController_Hysteresis_GetRange");
815  }
816 
817 
818  return true;
819 }
820 
821 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_Init(void )
822 {
823  auto& inst = instance();
824  if(inst.m_peak_afl_Init)
825  {
826  return inst.m_peak_afl_Init();
827  }
828  else
829  {
830  throw std::runtime_error("Library not loaded!");
831  }
832 }
833 
834 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_Exit(void )
835 {
836  auto& inst = instance();
837  if(inst.m_peak_afl_Exit)
838  {
839  return inst.m_peak_afl_Exit();
840  }
841  else
842  {
843  throw std::runtime_error("Library not loaded!");
844  }
845 }
846 
847 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_GetLastError(peak_afl_status * lastErrorCode, char * lastErrorMessage, size_t * lastErrorMessageSize)
848 {
849  auto& inst = instance();
850  if(inst.m_peak_afl_GetLastError)
851  {
852  return inst.m_peak_afl_GetLastError(lastErrorCode, lastErrorMessage, lastErrorMessageSize);
853  }
854  else
855  {
856  throw std::runtime_error("Library not loaded!");
857  }
858 }
859 
860 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_GetVersion(uint32_t * majorVersion, uint32_t * minorVersion, uint32_t * subminorVersion, uint32_t * patchVersion)
861 {
862  auto& inst = instance();
863  if(inst.m_peak_afl_GetVersion)
864  {
865  return inst.m_peak_afl_GetVersion(majorVersion, minorVersion, subminorVersion, patchVersion);
866  }
867  else
868  {
869  throw std::runtime_error("Library not loaded!");
870  }
871 }
872 
873 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoFeatureManager_Create(peak_afl_manager_handle * handle, PEAK_NODE_MAP_HANDLE nodeMapHandle)
874 {
875  auto& inst = instance();
876  if(inst.m_peak_afl_AutoFeatureManager_Create)
877  {
878  return inst.m_peak_afl_AutoFeatureManager_Create(handle, nodeMapHandle);
879  }
880  else
881  {
882  throw std::runtime_error("Library not loaded!");
883  }
884 }
885 
887 {
888  auto& inst = instance();
889  if(inst.m_peak_afl_AutoFeatureManager_Destroy)
890  {
891  return inst.m_peak_afl_AutoFeatureManager_Destroy(handle);
892  }
893  else
894  {
895  throw std::runtime_error("Library not loaded!");
896  }
897 }
898 
900 {
901  auto& inst = instance();
902  if(inst.m_peak_afl_AutoFeatureManager_AddController)
903  {
904  return inst.m_peak_afl_AutoFeatureManager_AddController(handle, controller);
905  }
906  else
907  {
908  throw std::runtime_error("Library not loaded!");
909  }
910 }
911 
913 {
914  auto& inst = instance();
915  if(inst.m_peak_afl_AutoFeatureManager_RemoveController)
916  {
917  return inst.m_peak_afl_AutoFeatureManager_RemoveController(handle, controller);
918  }
919  else
920  {
921  throw std::runtime_error("Library not loaded!");
922  }
923 }
924 
925 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoFeatureManager_Process(peak_afl_manager_handle handle, PEAK_IPL_IMAGE_HANDLE imageHandle)
926 {
927  auto& inst = instance();
928  if(inst.m_peak_afl_AutoFeatureManager_Process)
929  {
930  return inst.m_peak_afl_AutoFeatureManager_Process(handle, imageHandle);
931  }
932  else
933  {
934  throw std::runtime_error("Library not loaded!");
935  }
936 }
937 
939 {
940  auto& inst = instance();
941  if(inst.m_peak_afl_AutoFeatureManager_CreateController)
942  {
943  return inst.m_peak_afl_AutoFeatureManager_CreateController(handle, controller, controllerType);
944  }
945  else
946  {
947  throw std::runtime_error("Library not loaded!");
948  }
949 }
950 
952 {
953  auto& inst = instance();
954  if(inst.m_peak_afl_AutoFeatureManager_DestroyAllController)
955  {
956  return inst.m_peak_afl_AutoFeatureManager_DestroyAllController(handle);
957  }
958  else
959  {
960  throw std::runtime_error("Library not loaded!");
961  }
962 }
963 
965 {
966  auto& inst = instance();
967  if(inst.m_peak_afl_AutoFeatureManager_DestroyController)
968  {
969  return inst.m_peak_afl_AutoFeatureManager_DestroyController(handle, controller);
970  }
971  else
972  {
973  throw std::runtime_error("Library not loaded!");
974  }
975 }
976 
977 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoFeatureManager_SetGainIPL(peak_afl_manager_handle handle, PEAK_IPL_GAIN_HANDLE gainHandle)
978 {
979  auto& inst = instance();
980  if(inst.m_peak_afl_AutoFeatureManager_SetGainIPL)
981  {
982  return inst.m_peak_afl_AutoFeatureManager_SetGainIPL(handle, gainHandle);
983  }
984  else
985  {
986  throw std::runtime_error("Library not loaded!");
987  }
988 }
989 
991 {
992  auto& inst = instance();
993  if(inst.m_peak_afl_AutoFeatureManager_Status)
994  {
995  return inst.m_peak_afl_AutoFeatureManager_Status(handle, running);
996  }
997  else
998  {
999  throw std::runtime_error("Library not loaded!");
1000  }
1001 }
1002 
1003 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_Create(peak_afl_controller_handle * controller, peak_afl_controllerType controllerType)
1004 {
1005  auto& inst = instance();
1006  if(inst.m_peak_afl_AutoController_Create)
1007  {
1008  return inst.m_peak_afl_AutoController_Create(controller, controllerType);
1009  }
1010  else
1011  {
1012  throw std::runtime_error("Library not loaded!");
1013  }
1014 }
1015 
1017 {
1018  auto& inst = instance();
1019  if(inst.m_peak_afl_AutoController_Destroy)
1020  {
1021  return inst.m_peak_afl_AutoController_Destroy(controller);
1022  }
1023  else
1024  {
1025  throw std::runtime_error("Library not loaded!");
1026  }
1027 }
1028 
1030 {
1031  auto& inst = instance();
1032  if(inst.m_peak_afl_AutoController_SkipFrames_IsSupported)
1033  {
1034  return inst.m_peak_afl_AutoController_SkipFrames_IsSupported(controller, supported);
1035  }
1036  else
1037  {
1038  throw std::runtime_error("Library not loaded!");
1039  }
1040 }
1041 
1042 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_SkipFrames_Set(peak_afl_controller_handle controller, uint32_t count)
1043 {
1044  auto& inst = instance();
1045  if(inst.m_peak_afl_AutoController_SkipFrames_Set)
1046  {
1047  return inst.m_peak_afl_AutoController_SkipFrames_Set(controller, count);
1048  }
1049  else
1050  {
1051  throw std::runtime_error("Library not loaded!");
1052  }
1053 }
1054 
1055 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_SkipFrames_Get(peak_afl_controller_handle controller, uint32_t * count)
1056 {
1057  auto& inst = instance();
1058  if(inst.m_peak_afl_AutoController_SkipFrames_Get)
1059  {
1060  return inst.m_peak_afl_AutoController_SkipFrames_Get(controller, count);
1061  }
1062  else
1063  {
1064  throw std::runtime_error("Library not loaded!");
1065  }
1066 }
1067 
1068 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_SkipFrames_GetRange(peak_afl_controller_handle controller, uint32_t * min, uint32_t * max, uint32_t * inc)
1069 {
1070  auto& inst = instance();
1071  if(inst.m_peak_afl_AutoController_SkipFrames_GetRange)
1072  {
1073  return inst.m_peak_afl_AutoController_SkipFrames_GetRange(controller, min, max, inc);
1074  }
1075  else
1076  {
1077  throw std::runtime_error("Library not loaded!");
1078  }
1079 }
1080 
1082 {
1083  auto& inst = instance();
1084  if(inst.m_peak_afl_AutoController_ROI_IsSupported)
1085  {
1086  return inst.m_peak_afl_AutoController_ROI_IsSupported(controller, supported);
1087  }
1088  else
1089  {
1090  throw std::runtime_error("Library not loaded!");
1091  }
1092 }
1093 
1095 {
1096  auto& inst = instance();
1097  if(inst.m_peak_afl_AutoController_ROI_Set)
1098  {
1099  return inst.m_peak_afl_AutoController_ROI_Set(controller, roi);
1100  }
1101  else
1102  {
1103  throw std::runtime_error("Library not loaded!");
1104  }
1105 }
1106 
1108 {
1109  auto& inst = instance();
1110  if(inst.m_peak_afl_AutoController_ROI_Get)
1111  {
1112  return inst.m_peak_afl_AutoController_ROI_Get(controller, roi);
1113  }
1114  else
1115  {
1116  throw std::runtime_error("Library not loaded!");
1117  }
1118 }
1119 
1121 {
1122  auto& inst = instance();
1123  if(inst.m_peak_afl_AutoController_ROI_Preset_IsSupported)
1124  {
1125  return inst.m_peak_afl_AutoController_ROI_Preset_IsSupported(controller, supported);
1126  }
1127  else
1128  {
1129  throw std::runtime_error("Library not loaded!");
1130  }
1131 }
1132 
1134 {
1135  auto& inst = instance();
1136  if(inst.m_peak_afl_AutoController_ROI_Preset_Set)
1137  {
1138  return inst.m_peak_afl_AutoController_ROI_Preset_Set(controller, roiPreset);
1139  }
1140  else
1141  {
1142  throw std::runtime_error("Library not loaded!");
1143  }
1144 }
1145 
1147 {
1148  auto& inst = instance();
1149  if(inst.m_peak_afl_AutoController_Mode_IsSupported)
1150  {
1151  return inst.m_peak_afl_AutoController_Mode_IsSupported(controller, supported);
1152  }
1153  else
1154  {
1155  throw std::runtime_error("Library not loaded!");
1156  }
1157 }
1158 
1160 {
1161  auto& inst = instance();
1162  if(inst.m_peak_afl_AutoController_Mode_Set)
1163  {
1164  return inst.m_peak_afl_AutoController_Mode_Set(controller, mode);
1165  }
1166  else
1167  {
1168  throw std::runtime_error("Library not loaded!");
1169  }
1170 }
1171 
1173 {
1174  auto& inst = instance();
1175  if(inst.m_peak_afl_AutoController_Mode_Get)
1176  {
1177  return inst.m_peak_afl_AutoController_Mode_Get(controller, mode);
1178  }
1179  else
1180  {
1181  throw std::runtime_error("Library not loaded!");
1182  }
1183 }
1184 
1186 {
1187  auto& inst = instance();
1188  if(inst.m_peak_afl_AutoController_BrightnessComponent_Mode_IsSupported)
1189  {
1190  return inst.m_peak_afl_AutoController_BrightnessComponent_Mode_IsSupported(controller, supported);
1191  }
1192  else
1193  {
1194  throw std::runtime_error("Library not loaded!");
1195  }
1196 }
1197 
1199 {
1200  auto& inst = instance();
1201  if(inst.m_peak_afl_AutoController_BrightnessComponent_Mode_Set)
1202  {
1203  return inst.m_peak_afl_AutoController_BrightnessComponent_Mode_Set(controller, component, mode);
1204  }
1205  else
1206  {
1207  throw std::runtime_error("Library not loaded!");
1208  }
1209 }
1210 
1212 {
1213  auto& inst = instance();
1214  if(inst.m_peak_afl_AutoController_BrightnessComponent_Mode_Get)
1215  {
1216  return inst.m_peak_afl_AutoController_BrightnessComponent_Mode_Get(controller, component, mode);
1217  }
1218  else
1219  {
1220  throw std::runtime_error("Library not loaded!");
1221  }
1222 }
1223 
1225 {
1226  auto& inst = instance();
1227  if(inst.m_peak_afl_AutoController_BrightnessComponent_Status)
1228  {
1229  return inst.m_peak_afl_AutoController_BrightnessComponent_Status(controller, component, status);
1230  }
1231  else
1232  {
1233  throw std::runtime_error("Library not loaded!");
1234  }
1235 }
1236 
1238 {
1239  auto& inst = instance();
1240  if(inst.m_peak_afl_AutoController_BrightnessComponent_Callback_Set)
1241  {
1242  return inst.m_peak_afl_AutoController_BrightnessComponent_Callback_Set(controller, component, type, funcPtr, context);
1243  }
1244  else
1245  {
1246  throw std::runtime_error("Library not loaded!");
1247  }
1248 }
1249 
1251 {
1252  auto& inst = instance();
1253  if(inst.m_peak_afl_AutoController_Status)
1254  {
1255  return inst.m_peak_afl_AutoController_Status(controller, status);
1256  }
1257  else
1258  {
1259  throw std::runtime_error("Library not loaded!");
1260  }
1261 }
1262 
1263 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_GetLastAutoAverage(peak_afl_controller_handle controller, uint8_t * average)
1264 {
1265  auto& inst = instance();
1266  if(inst.m_peak_afl_AutoController_GetLastAutoAverage)
1267  {
1268  return inst.m_peak_afl_AutoController_GetLastAutoAverage(controller, average);
1269  }
1270  else
1271  {
1272  throw std::runtime_error("Library not loaded!");
1273  }
1274 }
1275 
1276 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_GetLastAutoAverages(peak_afl_controller_handle controller, uint8_t * averageRed, uint8_t * averageGreen, uint8_t * averageBlue)
1277 {
1278  auto& inst = instance();
1279  if(inst.m_peak_afl_AutoController_GetLastAutoAverages)
1280  {
1281  return inst.m_peak_afl_AutoController_GetLastAutoAverages(controller, averageRed, averageGreen, averageBlue);
1282  }
1283  else
1284  {
1285  throw std::runtime_error("Library not loaded!");
1286  }
1287 }
1288 
1290 {
1291  auto& inst = instance();
1292  if(inst.m_peak_afl_AutoController_AutoTarget_IsSupported)
1293  {
1294  return inst.m_peak_afl_AutoController_AutoTarget_IsSupported(controller, supported);
1295  }
1296  else
1297  {
1298  throw std::runtime_error("Library not loaded!");
1299  }
1300 }
1301 
1302 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_AutoTarget_Set(peak_afl_controller_handle controller, uint32_t target)
1303 {
1304  auto& inst = instance();
1305  if(inst.m_peak_afl_AutoController_AutoTarget_Set)
1306  {
1307  return inst.m_peak_afl_AutoController_AutoTarget_Set(controller, target);
1308  }
1309  else
1310  {
1311  throw std::runtime_error("Library not loaded!");
1312  }
1313 }
1314 
1315 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_AutoTarget_Get(peak_afl_controller_handle controller, uint32_t * target)
1316 {
1317  auto& inst = instance();
1318  if(inst.m_peak_afl_AutoController_AutoTarget_Get)
1319  {
1320  return inst.m_peak_afl_AutoController_AutoTarget_Get(controller, target);
1321  }
1322  else
1323  {
1324  throw std::runtime_error("Library not loaded!");
1325  }
1326 }
1327 
1328 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_AutoTarget_GetRange(peak_afl_controller_handle controller, uint32_t * min, uint32_t * max, uint32_t * inc)
1329 {
1330  auto& inst = instance();
1331  if(inst.m_peak_afl_AutoController_AutoTarget_GetRange)
1332  {
1333  return inst.m_peak_afl_AutoController_AutoTarget_GetRange(controller, min, max, inc);
1334  }
1335  else
1336  {
1337  throw std::runtime_error("Library not loaded!");
1338  }
1339 }
1340 
1342 {
1343  auto& inst = instance();
1344  if(inst.m_peak_afl_AutoController_AutoTolerance_IsSupported)
1345  {
1346  return inst.m_peak_afl_AutoController_AutoTolerance_IsSupported(controller, supported);
1347  }
1348  else
1349  {
1350  throw std::runtime_error("Library not loaded!");
1351  }
1352 }
1353 
1354 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_AutoTolerance_Set(peak_afl_controller_handle controller, uint32_t tolerance)
1355 {
1356  auto& inst = instance();
1357  if(inst.m_peak_afl_AutoController_AutoTolerance_Set)
1358  {
1359  return inst.m_peak_afl_AutoController_AutoTolerance_Set(controller, tolerance);
1360  }
1361  else
1362  {
1363  throw std::runtime_error("Library not loaded!");
1364  }
1365 }
1366 
1367 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_AutoTolerance_Get(peak_afl_controller_handle controller, uint32_t * tolerance)
1368 {
1369  auto& inst = instance();
1370  if(inst.m_peak_afl_AutoController_AutoTolerance_Get)
1371  {
1372  return inst.m_peak_afl_AutoController_AutoTolerance_Get(controller, tolerance);
1373  }
1374  else
1375  {
1376  throw std::runtime_error("Library not loaded!");
1377  }
1378 }
1379 
1380 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_AutoTolerance_GetRange(peak_afl_controller_handle controller, uint32_t * min, uint32_t * max, uint32_t * inc)
1381 {
1382  auto& inst = instance();
1383  if(inst.m_peak_afl_AutoController_AutoTolerance_GetRange)
1384  {
1385  return inst.m_peak_afl_AutoController_AutoTolerance_GetRange(controller, min, max, inc);
1386  }
1387  else
1388  {
1389  throw std::runtime_error("Library not loaded!");
1390  }
1391 }
1392 
1394 {
1395  auto& inst = instance();
1396  if(inst.m_peak_afl_AutoController_AutoPercentile_IsSupported)
1397  {
1398  return inst.m_peak_afl_AutoController_AutoPercentile_IsSupported(controller, supported);
1399  }
1400  else
1401  {
1402  throw std::runtime_error("Library not loaded!");
1403  }
1404 }
1405 
1406 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_AutoPercentile_Set(peak_afl_controller_handle controller, double percentile)
1407 {
1408  auto& inst = instance();
1409  if(inst.m_peak_afl_AutoController_AutoPercentile_Set)
1410  {
1411  return inst.m_peak_afl_AutoController_AutoPercentile_Set(controller, percentile);
1412  }
1413  else
1414  {
1415  throw std::runtime_error("Library not loaded!");
1416  }
1417 }
1418 
1419 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_AutoPercentile_Get(peak_afl_controller_handle controller, double * percentile)
1420 {
1421  auto& inst = instance();
1422  if(inst.m_peak_afl_AutoController_AutoPercentile_Get)
1423  {
1424  return inst.m_peak_afl_AutoController_AutoPercentile_Get(controller, percentile);
1425  }
1426  else
1427  {
1428  throw std::runtime_error("Library not loaded!");
1429  }
1430 }
1431 
1432 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_AutoPercentile_GetRange(peak_afl_controller_handle controller, double * min, double * max, double * inc)
1433 {
1434  auto& inst = instance();
1435  if(inst.m_peak_afl_AutoController_AutoPercentile_GetRange)
1436  {
1437  return inst.m_peak_afl_AutoController_AutoPercentile_GetRange(controller, min, max, inc);
1438  }
1439  else
1440  {
1441  throw std::runtime_error("Library not loaded!");
1442  }
1443 }
1444 
1446 {
1447  auto& inst = instance();
1448  if(inst.m_peak_afl_AutoController_Type_Get)
1449  {
1450  return inst.m_peak_afl_AutoController_Type_Get(controller, type);
1451  }
1452  else
1453  {
1454  throw std::runtime_error("Library not loaded!");
1455  }
1456 }
1457 
1459 {
1460  auto& inst = instance();
1461  if(inst.m_peak_afl_AutoController_Algorithm_IsSupported)
1462  {
1463  return inst.m_peak_afl_AutoController_Algorithm_IsSupported(controller, supported);
1464  }
1465  else
1466  {
1467  throw std::runtime_error("Library not loaded!");
1468  }
1469 }
1470 
1472 {
1473  auto& inst = instance();
1474  if(inst.m_peak_afl_AutoController_Algorithm_Set)
1475  {
1476  return inst.m_peak_afl_AutoController_Algorithm_Set(controller, algorithm);
1477  }
1478  else
1479  {
1480  throw std::runtime_error("Library not loaded!");
1481  }
1482 }
1483 
1485 {
1486  auto& inst = instance();
1487  if(inst.m_peak_afl_AutoController_Algorithm_Get)
1488  {
1489  return inst.m_peak_afl_AutoController_Algorithm_Get(controller, algorithm);
1490  }
1491  else
1492  {
1493  throw std::runtime_error("Library not loaded!");
1494  }
1495 }
1496 
1497 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_Algorithm_GetList(peak_afl_controller_handle controller, peak_afl_controller_algorithm * typeList, uint32_t * listSize)
1498 {
1499  auto& inst = instance();
1500  if(inst.m_peak_afl_AutoController_Algorithm_GetList)
1501  {
1502  return inst.m_peak_afl_AutoController_Algorithm_GetList(controller, typeList, listSize);
1503  }
1504  else
1505  {
1506  throw std::runtime_error("Library not loaded!");
1507  }
1508 }
1509 
1511 {
1512  auto& inst = instance();
1513  if(inst.m_peak_afl_AutoController_SharpnessAlgorithm_IsSupported)
1514  {
1515  return inst.m_peak_afl_AutoController_SharpnessAlgorithm_IsSupported(controller, supported);
1516  }
1517  else
1518  {
1519  throw std::runtime_error("Library not loaded!");
1520  }
1521 }
1522 
1524 {
1525  auto& inst = instance();
1526  if(inst.m_peak_afl_AutoController_SharpnessAlgorithm_Set)
1527  {
1528  return inst.m_peak_afl_AutoController_SharpnessAlgorithm_Set(controller, algorithm);
1529  }
1530  else
1531  {
1532  throw std::runtime_error("Library not loaded!");
1533  }
1534 }
1535 
1537 {
1538  auto& inst = instance();
1539  if(inst.m_peak_afl_AutoController_SharpnessAlgorithm_Get)
1540  {
1541  return inst.m_peak_afl_AutoController_SharpnessAlgorithm_Get(controller, algorithm);
1542  }
1543  else
1544  {
1545  throw std::runtime_error("Library not loaded!");
1546  }
1547 }
1548 
1550 {
1551  auto& inst = instance();
1552  if(inst.m_peak_afl_AutoController_SharpnessAlgorithm_GetList)
1553  {
1554  return inst.m_peak_afl_AutoController_SharpnessAlgorithm_GetList(controller, typeList, listSize);
1555  }
1556  else
1557  {
1558  throw std::runtime_error("Library not loaded!");
1559  }
1560 }
1561 
1562 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_Callback_Set(peak_afl_controller_handle controller, peak_afl_callback_type type, void * funcPtr, void * context)
1563 {
1564  auto& inst = instance();
1565  if(inst.m_peak_afl_AutoController_Callback_Set)
1566  {
1567  return inst.m_peak_afl_AutoController_Callback_Set(controller, type, funcPtr, context);
1568  }
1569  else
1570  {
1571  throw std::runtime_error("Library not loaded!");
1572  }
1573 }
1574 
1576 {
1577  auto& inst = instance();
1578  if(inst.m_peak_afl_AutoController_Weighted_ROI_IsSupported)
1579  {
1580  return inst.m_peak_afl_AutoController_Weighted_ROI_IsSupported(controller, supported);
1581  }
1582  else
1583  {
1584  throw std::runtime_error("Library not loaded!");
1585  }
1586 }
1587 
1589 {
1590  auto& inst = instance();
1591  if(inst.m_peak_afl_AutoController_Weighted_ROI_Min_Size)
1592  {
1593  return inst.m_peak_afl_AutoController_Weighted_ROI_Min_Size(controller, size);
1594  }
1595  else
1596  {
1597  throw std::runtime_error("Library not loaded!");
1598  }
1599 }
1600 
1601 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_Weighted_ROI_Set(peak_afl_controller_handle controller, const peak_afl_weighted_rectangle * weightedRoiList, uint32_t listSize)
1602 {
1603  auto& inst = instance();
1604  if(inst.m_peak_afl_AutoController_Weighted_ROI_Set)
1605  {
1606  return inst.m_peak_afl_AutoController_Weighted_ROI_Set(controller, weightedRoiList, listSize);
1607  }
1608  else
1609  {
1610  throw std::runtime_error("Library not loaded!");
1611  }
1612 }
1613 
1614 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_Weighted_ROI_Get(peak_afl_controller_handle controller, peak_afl_weighted_rectangle * weightedRoiList, uint32_t * listSize)
1615 {
1616  auto& inst = instance();
1617  if(inst.m_peak_afl_AutoController_Weighted_ROI_Get)
1618  {
1619  return inst.m_peak_afl_AutoController_Weighted_ROI_Get(controller, weightedRoiList, listSize);
1620  }
1621  else
1622  {
1623  throw std::runtime_error("Library not loaded!");
1624  }
1625 }
1626 
1628 {
1629  auto& inst = instance();
1630  if(inst.m_peak_afl_AutoController_Limit_IsSupported)
1631  {
1632  return inst.m_peak_afl_AutoController_Limit_IsSupported(controller, supported);
1633  }
1634  else
1635  {
1636  throw std::runtime_error("Library not loaded!");
1637  }
1638 }
1639 
1641 {
1642  auto& inst = instance();
1643  if(inst.m_peak_afl_AutoController_Limit_Default)
1644  {
1645  return inst.m_peak_afl_AutoController_Limit_Default(controller, limit);
1646  }
1647  else
1648  {
1649  throw std::runtime_error("Library not loaded!");
1650  }
1651 }
1652 
1654 {
1655  auto& inst = instance();
1656  if(inst.m_peak_afl_AutoController_Limit_Set)
1657  {
1658  return inst.m_peak_afl_AutoController_Limit_Set(controller, limit);
1659  }
1660  else
1661  {
1662  throw std::runtime_error("Library not loaded!");
1663  }
1664 }
1665 
1667 {
1668  auto& inst = instance();
1669  if(inst.m_peak_afl_AutoController_Limit_Get)
1670  {
1671  return inst.m_peak_afl_AutoController_Limit_Get(controller, limit);
1672  }
1673  else
1674  {
1675  throw std::runtime_error("Library not loaded!");
1676  }
1677 }
1678 
1680 {
1681  auto& inst = instance();
1682  if(inst.m_peak_afl_AutoController_Hysteresis_IsSupported)
1683  {
1684  return inst.m_peak_afl_AutoController_Hysteresis_IsSupported(controller, supported);
1685  }
1686  else
1687  {
1688  throw std::runtime_error("Library not loaded!");
1689  }
1690 }
1691 
1692 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_Hysteresis_Default(peak_afl_controller_handle controller, uint8_t * hysteresis)
1693 {
1694  auto& inst = instance();
1695  if(inst.m_peak_afl_AutoController_Hysteresis_Default)
1696  {
1697  return inst.m_peak_afl_AutoController_Hysteresis_Default(controller, hysteresis);
1698  }
1699  else
1700  {
1701  throw std::runtime_error("Library not loaded!");
1702  }
1703 }
1704 
1705 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_Hysteresis_Set(peak_afl_controller_handle controller, uint8_t hysteresis)
1706 {
1707  auto& inst = instance();
1708  if(inst.m_peak_afl_AutoController_Hysteresis_Set)
1709  {
1710  return inst.m_peak_afl_AutoController_Hysteresis_Set(controller, hysteresis);
1711  }
1712  else
1713  {
1714  throw std::runtime_error("Library not loaded!");
1715  }
1716 }
1717 
1718 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_Hysteresis_Get(peak_afl_controller_handle controller, uint8_t * hysteresis)
1719 {
1720  auto& inst = instance();
1721  if(inst.m_peak_afl_AutoController_Hysteresis_Get)
1722  {
1723  return inst.m_peak_afl_AutoController_Hysteresis_Get(controller, hysteresis);
1724  }
1725  else
1726  {
1727  throw std::runtime_error("Library not loaded!");
1728  }
1729 }
1730 
1731 inline PEAK_AFL_API_STATUS DynamicLoader::peak_afl_AutoController_Hysteresis_GetRange(peak_afl_controller_handle controller, uint8_t * min, uint8_t * max, uint8_t * inc)
1732 {
1733  auto& inst = instance();
1734  if(inst.m_peak_afl_AutoController_Hysteresis_GetRange)
1735  {
1736  return inst.m_peak_afl_AutoController_Hysteresis_GetRange(controller, min, max, inc);
1737  }
1738  else
1739  {
1740  throw std::runtime_error("Library not loaded!");
1741  }
1742 }
1743 
1744 } /* namespace dynamic */
1745 } /* namespace afl */
1746 } /* namespace peak */
1747 
peak_afl_status peak_afl_GetVersion(uint32_t *majorVersion, uint32_t *minorVersion, uint32_t *subminorVersion, uint32_t *patchVersion)
Query the library version.
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_Get(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm *algorithm)
Get the used sharpness algorithm for a controller.
peak_afl_status peak_afl_AutoFeatureManager_AddController(peak_afl_manager_handle handle, peak_afl_manager_handle controller)
Add a controller to an automanager instance.
peak_afl_status peak_afl_AutoController_SkipFrames_Get(peak_afl_controller_handle controller, uint32_t *count)
Get number of frames skipped for a controller.
peak_afl_status peak_afl_AutoController_SkipFrames_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if skip frames is supported for a controller.
peak_afl_controller_sharpness_algorithm
controller sharpness algorithm (focus)
Definition: peak_afl.h:206
peak_afl_status peak_afl_AutoController_AutoPercentile_GetRange(peak_afl_controller_handle controller, double *min, double *max, double *inc)
Get the auto percentile range for a controller.
peak_afl_status peak_afl_AutoController_SkipFrames_Set(peak_afl_controller_handle controller, uint32_t count)
Set number of frames skipped for a controller.
peak_afl_status peak_afl_AutoController_BrightnessComponent_Mode_Get(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_automode *mode)
Get the current brightness component mode for a controller.
peak_afl_status peak_afl_AutoController_Limit_Default(peak_afl_controller_handle controller, peak_afl_controller_limit *limit)
Get the autofeature default limit.
peak_afl_status peak_afl_AutoController_Algorithm_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if setting an algorithm is supported for a controller.
peak_afl_status peak_afl_AutoController_ROI_Get(peak_afl_controller_handle controller, peak_afl_rectangle *roi)
Get the autofeature region of interest for a controller.
peak_afl_status peak_afl_AutoController_Algorithm_Get(peak_afl_controller_handle controller, peak_afl_controller_algorithm *algorithm)
Get the used algorithm for a controller.
peak_afl_status peak_afl_AutoController_Weighted_ROI_Get(peak_afl_controller_handle controller, peak_afl_weighted_rectangle *weightedRoiList, uint32_t *listSize)
Get the autofeature weighted region of interest for a controller.
peak_afl_status peak_afl_AutoFeatureManager_Status(peak_afl_manager_handle handle, peak_afl_BOOL8 *running)
Get the status of a manager.
peak_afl_status
peak_afl Status codes
Definition: peak_afl.h:87
Definition: peak_afl.hpp:56
peak_afl Size (2D)
Definition: peak_afl.h:297
peak_afl_status peak_afl_AutoController_Mode_Get(peak_afl_controller_handle controller, peak_afl_controller_automode *mode)
Get the current autofeature mode for a controller.
peak_afl_status peak_afl_AutoController_ROI_Set(peak_afl_controller_handle controller, peak_afl_rectangle roi)
Set the autofeature region of interest for a controller.
peak_afl_status peak_afl_AutoController_Weighted_ROI_Set(peak_afl_controller_handle controller, const peak_afl_weighted_rectangle *weightedRoiList, uint32_t listSize)
Set the autofeature weighted region of interest for a controller.
peak_afl_status peak_afl_AutoController_Limit_Get(peak_afl_controller_handle controller, peak_afl_controller_limit *limit)
Get the autofeature limit for a controller.
peak_afl Rectangle (2D)
Definition: peak_afl.h:331
peak_afl_status peak_afl_AutoController_Callback_Set(peak_afl_controller_handle controller, peak_afl_callback_type type, void *funcPtr, void *context)
Set a callback for a controller.
peak_afl_status peak_afl_AutoController_GetLastAutoAverages(peak_afl_controller_handle controller, uint8_t *averageRed, uint8_t *averageGreen, uint8_t *averageBlue)
Get the last auto average for a controller.
peak_afl_status peak_afl_AutoController_Mode_Set(peak_afl_controller_handle controller, peak_afl_controller_automode mode)
Set the autofeature mode for a controller.
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check setting a sharpness algorithm is supported by a controller.
peak_afl_status peak_afl_AutoController_Type_Get(peak_afl_controller_handle controller, peak_afl_controllerType *type)
Get the controller type.
peak_afl_status peak_afl_AutoController_AutoPercentile_Get(peak_afl_controller_handle controller, double *percentile)
Get the auto percentile for a controller.
peak_afl_status peak_afl_AutoController_ROI_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if setting a region of interest is supported for a controller.
peak_afl Focus Limit
Definition: peak_afl.h:369
peak_afl_status peak_afl_AutoController_Weighted_ROI_Min_Size(peak_afl_controller_handle controller, peak_afl_size *size)
Get the autofeature minimum size of weighted region of interest for a controller. ...
peak_afl_status peak_afl_AutoController_BrightnessComponent_Mode_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if brightness component is supported for a controller component.
peak_afl_status peak_afl_AutoFeatureManager_Destroy(peak_afl_manager_handle handle)
Destroy an automanager instance.
peak_afl_status peak_afl_AutoFeatureManager_RemoveController(peak_afl_manager_handle handle, peak_afl_manager_handle controller)
Remove a controller to an automanager instance.
peak_afl_status peak_afl_AutoController_AutoTarget_GetRange(peak_afl_controller_handle controller, uint32_t *min, uint32_t *max, uint32_t *inc)
Get the auto target range for a controller.
peak_afl_roi_preset
controller roi preset
Definition: peak_afl.h:283
peak_afl_status peak_afl_AutoController_Limit_Set(peak_afl_controller_handle controller, peak_afl_controller_limit limit)
Set the autofeature limit for a controller.
peak_afl_controller_automode
controller automode
Definition: peak_afl.h:140
peak_afl_status peak_afl_AutoController_SkipFrames_GetRange(peak_afl_controller_handle controller, uint32_t *min, uint32_t *max, uint32_t *inc)
Get range for frames skipped for a controller.
uint8_t peak_afl_BOOL8
custom boolean type
Definition: peak_afl.h:379
peak_afl_status peak_afl_AutoFeatureManager_CreateController(peak_afl_manager_handle handle, peak_afl_controller_handle *controller, peak_afl_controllerType controllerType)
Create a controller and append it to Manager.
void * peak_afl_manager_handle
opaque manager handle type
Definition: peak_afl.h:51
peak_afl_status peak_afl_AutoController_Hysteresis_GetRange(peak_afl_controller_handle controller, uint8_t *min, uint8_t *max, uint8_t *inc)
Get autofeature hysteresis range for a controller.
peak_afl_status peak_afl_AutoFeatureManager_DestroyAllController(peak_afl_manager_handle handle)
Destroy all controllers for a manager.
peak_afl_status peak_afl_AutoController_AutoTarget_Set(peak_afl_controller_handle controller, uint32_t target)
Set the auto target for a controller.
peak_afl_status peak_afl_Init(void)
Init the peak_afl auto feature library.
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_Set(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm algorithm)
Set the used sharpness algorithm for a controller.
peak_afl_status peak_afl_AutoController_GetLastAutoAverage(peak_afl_controller_handle controller, uint8_t *average)
Get the last auto average for a controller.
peak_afl_controller_algorithm
controller algorithm
Definition: peak_afl.h:184
peak_afl_status peak_afl_Exit(void)
Exit the peak_afl auto feature library.
peak_afl_status peak_afl_AutoController_AutoTolerance_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto tolerance is supported for a controller.
peak_afl_status peak_afl_AutoController_ROI_Preset_Set(peak_afl_controller_handle controller, peak_afl_roi_preset roiPreset)
Set the autofeature region of interest preset for a controller.
peak_afl_status peak_afl_AutoController_ROI_Preset_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if ROI preset is supported for a controller.
peak_afl_status peak_afl_AutoController_AutoTarget_Get(peak_afl_controller_handle controller, uint32_t *target)
Get the currently set auto target for a controller.
peak_afl_status peak_afl_AutoController_Destroy(peak_afl_controller_handle controller)
Destroy a controller. Will fail if it is queued inside a manager.
peak_afl_status peak_afl_AutoFeatureManager_Create(peak_afl_manager_handle *handle, PEAK_NODE_MAP_HANDLE nodeMapHandle)
Create an automanager instance.
peak_afl_status peak_afl_AutoController_AutoTarget_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto target is supported for a controller.
peak_afl_status peak_afl_AutoController_Algorithm_Set(peak_afl_controller_handle controller, peak_afl_controller_algorithm algorithm)
Set the used algorithm for a controller.
peak_afl_status peak_afl_AutoController_AutoPercentile_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto percentile is supported for a controller.
peak_afl_status peak_afl_AutoController_Limit_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if limit is supported for a controller.
peak_afl_status peak_afl_AutoController_Status(peak_afl_controller_handle controller, peak_afl_controller_status *status)
Get the status for a controller.
peak_afl_status peak_afl_AutoFeatureManager_SetGainIPL(peak_afl_manager_handle handle, PEAK_IPL_GAIN_HANDLE gainHandle)
Set the IPL Gain.
peak_afl_status peak_afl_AutoController_Hysteresis_Default(peak_afl_controller_handle controller, uint8_t *hysteresis)
Get the autofeature hysteresis default.
peak_afl_status peak_afl_AutoController_AutoTolerance_Set(peak_afl_controller_handle controller, uint32_t tolerance)
Set the auto tolerance for a controller.
peak_afl Focus Rectangle
Definition: peak_afl.h:353
peak_afl_status peak_afl_AutoController_BrightnessComponent_Callback_Set(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_callback_type type, void *funcPtr, void *context)
Set a callback for a controller component.
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_GetList(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm *typeList, uint32_t *listSize)
Get the list of supported sharpness algorithms for a controller.
peak_afl_status peak_afl_AutoController_BrightnessComponent_Status(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_status *status)
Get the status for a controller component.
peak_afl_status peak_afl_AutoController_AutoTolerance_Get(peak_afl_controller_handle controller, uint32_t *tolerance)
Get the current auto tolerance for a controller.
peak_afl_status peak_afl_AutoController_Weighted_ROI_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if weighted region of interest is supported for a controller.
peak_afl_status peak_afl_AutoController_Create(peak_afl_controller_handle *controller, peak_afl_controllerType controllerType)
Create a new controller.
peak_afl_status peak_afl_AutoController_BrightnessComponent_Mode_Set(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_automode mode)
Set the autofeature mode for a brightness component.
peak_afl_controller_status
controller status
Definition: peak_afl.h:156
peak_afl_status peak_afl_AutoFeatureManager_Process(peak_afl_manager_handle handle, PEAK_IPL_IMAGE_HANDLE imageHandle)
Process an image.
peak_afl_status peak_afl_AutoController_Hysteresis_Get(peak_afl_controller_handle controller, uint8_t *hysteresis)
Get the autofeature hysteresis for a controller.
peak_afl_status peak_afl_AutoController_AutoTolerance_GetRange(peak_afl_controller_handle controller, uint32_t *min, uint32_t *max, uint32_t *inc)
Get the auto tolerance range for a controller.
void * peak_afl_controller_handle
opaque controller handle type
Definition: peak_afl.h:49
peak_afl_status peak_afl_GetLastError(peak_afl_status *lastErrorCode, char *lastErrorMessage, size_t *lastErrorMessageSize)
Get the last error message.
peak_afl_status peak_afl_AutoController_Algorithm_GetList(peak_afl_controller_handle controller, peak_afl_controller_algorithm *typeList, uint32_t *listSize)
Get the list of supported algorithms for a controller.
peak_afl_status peak_afl_AutoController_Hysteresis_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if hysteresis is supported for a controller.
peak_afl_controllerType
controller types
Definition: peak_afl.h:121
peak_afl_status peak_afl_AutoController_Mode_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if auto mode is supported for a controller.
peak_afl_controller_brightness_component
controller brightness component
Definition: peak_afl.h:228
peak_afl_status peak_afl_AutoController_AutoPercentile_Set(peak_afl_controller_handle controller, double percentile)
Set the auto percentile for a controller.
peak_afl_status peak_afl_AutoController_Hysteresis_Set(peak_afl_controller_handle controller, uint8_t hysteresis)
Set the autofeature hysteresis for a controller.
peak_afl_callback_type
controller callback type
Definition: peak_afl.h:258
peak_afl_status peak_afl_AutoFeatureManager_DestroyController(peak_afl_manager_handle handle, peak_afl_controller_handle controller)
Destroy a controller.