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