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