IDS peak AFL  v1.3.0
peak_afl.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 
13 #include "peak_afl/peak_afl.h"
14 #include "peak_ipl/types/peak_ipl_image.hpp"
15 #include "peak_ipl/algorithm/peak_ipl_gain.hpp"
16 #include "peak/node_map/peak_node_map.hpp"
17 
18 #include <type_traits>
19 #include <cstdint>
20 #include <exception>
21 #include <string>
22 #include <tuple>
23 #include <utility>
24 #include <vector>
25 #include <memory>
26 #include <functional>
27 
28 #if __cplusplus >= 201703L || _MSVC_LANG >= 201703L
29 # define PEAK_AFL_NO_DISCARD [[nodiscard]]
30 # define PEAK_AFL_MAYBE_UNUSED [[maybe_unused]]
31 #else
32 # ifdef _MSC_VER
33 # define PEAK_AFL_NO_DISCARD _Check_return_
34 # define PEAK_AFL_MAYBE_UNUSED
35 # elif defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
36 # define PEAK_AFL_NO_DISCARD __attribute__((warn_unused_result))
37 # define PEAK_AFL_MAYBE_UNUSED __attribute__((unused))
38 # else
39 # define PEAK_AFL_NO_DISCARD
40 # define PEAK_AFL_MAYBE_UNUSED
41 # endif
42 #endif
43 
56 namespace peak
57 {
58 namespace afl
59 {
60 namespace library
61 {
62 
67 struct Version_t
68 {
69  std::uint32_t major;
70  std::uint32_t minor;
71  std::uint32_t subminor;
72  std::uint32_t patch;
73 
78  PEAK_AFL_NO_DISCARD std::string ToString() const
79  {
80  return std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(subminor) + "."
81  + std::to_string(patch);
82  }
83 
89  PEAK_AFL_NO_DISCARD uint32_t Major() const
90  {
91  return major;
92  }
93 
99  PEAK_AFL_NO_DISCARD uint32_t Minor() const
100  {
101  return minor;
102  }
108  PEAK_AFL_NO_DISCARD uint32_t Subminor() const
109  {
110  return subminor;
111  }
112 
118  PEAK_AFL_NO_DISCARD uint32_t Patch() const
119  {
120  return patch;
121  }
122 };
123 
137 inline void Init();
138 
152 inline void Exit();
153 
161 PEAK_AFL_NO_DISCARD inline std::string GetLastError();
162 
175 PEAK_AFL_NO_DISCARD inline Version_t Version();
176 } // namespace library
177 
178 namespace error
179 {
180 
181 
186 class Exception : public std::exception
187 {
188 public:
189  explicit Exception(peak_afl_status code, bool get_text=true)
190  : m_code(code)
191  {
192  if (get_text)
193  {
194  m_text = library::GetLastError();
195  }
196  }
197 
203  PEAK_AFL_NO_DISCARD peak_afl_status code() const
204  {
205  return m_code;
206  }
207 
213  PEAK_AFL_NO_DISCARD const char* what() const noexcept override
214  {
215  if(m_text.empty())
216  {
217  return "-";
218  }
219  else
220  {
221  return m_text.c_str();
222  }
223  }
224 
232  PEAK_AFL_NO_DISCARD static std::string translateCode(peak_afl_status status)
233  {
234  switch(status)
235  {
237  return "PEAK_AFL_STATUS_SUCCESS";
238 
240  return "PEAK_AFL_STATUS_ERROR";
241 
243  return "PEAK_AFL_STATUS_NOT_INITIALIZED";
244 
246  return "PEAK_AFL_STATUS_INVALID_PARAMETER";
247 
249  return "PEAK_AFL_STATUS_ACCESS_DENIED";
250 
252  return "PEAK_AFL_STATUS_BUSY";
253 
255  return "PEAK_AFL_STATUS_BUFFER_TOO_SMALL";
256 
258  return "PEAK_AFL_STATUS_INVALID_IMAGE_FORMAT";
259 
261  return "PEAK_AFL_STATUS_NOT_SUPPORTED";
262 
263  case PEAK_AFL_STATUS_VALUE_ADJUSTED:
264  return "PEAK_AFL_STATUS_VALUE_ADJUSTED";
265 
266  default:
267  return "Unknown Status code";
268  }
269  }
270 
271 private:
272  peak_afl_status m_code{};
273  std::string m_text{};
274 };
275 } // namespace error
276 
277 class Controller;
278 
283 class Manager
284 {
285 public:
295  inline explicit Manager(const std::shared_ptr<peak::core::NodeMap>& node_map);
296 
300  inline ~Manager();
301 
302  Manager(const Manager&) = delete;
303  inline Manager(Manager&&) noexcept;
304 
305  Manager& operator=(const Manager&) noexcept = delete;
306  inline Manager& operator=(Manager&&) noexcept;
307 
318  inline void AddController(const std::shared_ptr<Controller>& controller);
319 
330  inline void RemoveController(const std::shared_ptr<Controller>& controller);
331 
341  inline void Process(const peak::ipl::Image& image) const;
342 
355  PEAK_AFL_NO_DISCARD inline std::shared_ptr<Controller> CreateController(peak_afl_controllerType type);
356 
364  inline void DestroyAllController();
365 
375  inline void DestroyController(const std::shared_ptr<Controller>& controller);
376 
384  inline void SetGainIPL(const peak::ipl::Gain& gain);
385 
395  PEAK_AFL_NO_DISCARD inline bool Status() const;
396 
402  PEAK_AFL_NO_DISCARD inline std::vector<std::shared_ptr<Controller>> ControllerList() const;
403 
409  PEAK_AFL_NO_DISCARD inline size_t ControllerCount() const;
410 
420  PEAK_AFL_NO_DISCARD inline std::shared_ptr<Controller> GetController(peak_afl_controllerType type) const;
421 
422 private:
423  std::vector<std::shared_ptr<Controller>> m_controllerList;
424  mutable std::mutex m_mutex{};
425  peak_afl_manager_handle m_handle{};
426 };
427 
437 template<typename... ControllerTypes>
438 std::tuple<Manager, std::vector<std::shared_ptr<Controller>>>
439 CreateManager(const std::shared_ptr<peak::core::NodeMap>& node_map, ControllerTypes... types)
440 {
441  constexpr int size = sizeof...(types);
442  constexpr std::array<peak_afl_controllerType, size> controller_types{types...};
443  std::vector<std::shared_ptr<Controller>> controller{};
444  Manager manager{node_map};
445  controller.reserve(size);
446 
447  std::for_each(controller_types.cbegin(), controller_types.cend(), [&manager, &controller](peak_afl_controllerType type) {
448  controller.emplace_back(std::move(manager.CreateController(type)));
449  });
450 
451  return { std::move(manager), std::move(controller) };
452 }
453 
454 
459 template <typename T, typename std::enable_if_t<std::is_arithmetic<T>::value, int> = 0>
460 struct Range
461 {
462  T min;
463  T max;
464  T inc;
465 };
466 
467 namespace callback
468 {
469 using FinishedCallback = std::function<void(void)>;
470 using DataProcessingCallback = std::function<void(int, int)>;
471 using ComponentCallback = std::function<void(void)>;
472 
473 using RegisterFunction = std::function<PEAK_AFL_API_STATUS(void*, void*)>;
474 using UnRegisterFunction = std::function<void()>;
475 }
476 
481 class Controller : public std::enable_shared_from_this<Controller>
482 {
483  friend class Manager;
484 
485  template<class T>
486  class Callback
487  {
488 #ifndef SWIG
489  public:
490  template<typename R, typename ...Args>
491  Callback(const std::shared_ptr<peak::afl::Controller>& controller, callback::RegisterFunction register_function,
492  callback::UnRegisterFunction unregister_function, std::function<R(Args...)> callback) :
493  m_callback(std::move(callback)),
494  m_unregister_function(std::move(unregister_function))
495  {
496  const auto ret = register_function(reinterpret_cast<void*>(&Callback::Func<Args...>), this);
497  if (ret != PEAK_AFL_STATUS_SUCCESS)
498  {
499  throw error::Exception(ret);
500  }
501  m_controller = controller;
502  }
503 
504  virtual ~Callback()
505  {
506  if (auto controller = m_controller.lock())
507  {
508  m_unregister_function();
509  }
510  }
511 
512  private:
513  template<typename ...Args>
514  static void Func(Args... args, void* ptr)
515  {
516  static_cast<Callback *>(ptr)->m_callback(args...);
517  };
518 #endif
519 
520  std::weak_ptr<peak::afl::Controller> m_controller{};
521  callback::UnRegisterFunction m_unregister_function{};
522  T m_callback{};
523  };
524 
525 
533  inline explicit Controller(peak_afl_controller_handle handle)
534  : m_handle(handle) {};
535 
536 public:
540  inline ~Controller();
541 
542  Controller(const Controller&) = delete;
543  Controller(Controller&&) = delete;
544  Controller& operator=(const Controller&) = delete;
545  Controller& operator=(Controller&&) = delete;
546 
556  PEAK_AFL_NO_DISCARD inline static std::shared_ptr<Controller> Create(peak_afl_controllerType type);
557 
565  PEAK_AFL_NO_DISCARD inline bool IsSkipFramesSupported() const;
566 
576  inline void SetSkipFrames(std::uint32_t count);
577 
587  PEAK_AFL_NO_DISCARD inline std::uint32_t GetSkipFrames() const;
588 
596  PEAK_AFL_NO_DISCARD inline Range<std::uint32_t> GetSkipFramesRange() const;
597 
607  PEAK_AFL_NO_DISCARD inline bool IsROISupported() const;
608 
618  inline void SetROI(peak_afl_rectangle rect);
619 
629  PEAK_AFL_NO_DISCARD inline peak_afl_rectangle GetROI() const;
630 
640  PEAK_AFL_NO_DISCARD inline bool IsROIPresetSupported() const;
641 
651  inline void SetROIPreset(peak_afl_roi_preset preset);
652 
662  PEAK_AFL_NO_DISCARD inline bool IsModeSupported() const;
663 
673  inline void SetMode(peak_afl_controller_automode mode);
674 
682  PEAK_AFL_NO_DISCARD inline peak_afl_controller_automode GetMode() const;
683 
693  PEAK_AFL_NO_DISCARD inline peak_afl_controller_status Status() const;
694 
704  PEAK_AFL_NO_DISCARD inline std::uint8_t GetLastAutoAverage() const;
705 
715  PEAK_AFL_NO_DISCARD inline std::tuple<std::uint8_t, std::uint8_t, std::uint8_t> GetLastAutoAverages() const;
716 
726  PEAK_AFL_NO_DISCARD inline bool IsAutoTargetSupported() const;
727 
738  inline void SetAutoTarget(uint32_t target);
739 
747  PEAK_AFL_NO_DISCARD inline std::uint32_t GetAutoTarget() const;
748 
759  PEAK_AFL_NO_DISCARD inline Range<std::uint32_t> GetAutoTargetRange() const;
760 
770  PEAK_AFL_NO_DISCARD inline bool IsAutoToleranceSupported() const;
771 
781  inline void SetAutoTolerance(std::uint32_t tolerance);
782 
790  PEAK_AFL_NO_DISCARD inline std::uint32_t GetAutoTolerance() const;
791 
802  PEAK_AFL_NO_DISCARD inline Range<std::uint32_t> GetAutoToleranceRange() const;
803 
813  PEAK_AFL_NO_DISCARD inline bool IsAutoPercentileSupported() const;
814 
825  inline void SetAutoPercentile(double percentile);
826 
834  PEAK_AFL_NO_DISCARD inline double GetAutoPercentile() const;
835 
846  PEAK_AFL_NO_DISCARD inline Range<double> GetAutoPercentileRange() const;
847 
857  PEAK_AFL_NO_DISCARD inline peak_afl_controllerType Type() const;
858 
870  PEAK_AFL_NO_DISCARD inline bool IsAlgorithmSupported() const;
871 
881  inline void SetAlgorithm(peak_afl_controller_algorithm algorithm);
882 
889  PEAK_AFL_NO_DISCARD inline peak_afl_controller_algorithm GetAlgorithm() const;
890 
900  PEAK_AFL_NO_DISCARD inline std::vector<peak_afl_controller_algorithm> GetAlgorithmList() const;
901 
913  PEAK_AFL_NO_DISCARD inline bool IsSharpnessAlgorithmSupported() const;
914 
924  inline void SetSharpnessAlgorithm(peak_afl_controller_sharpness_algorithm algorithm);
925 
933  PEAK_AFL_NO_DISCARD inline peak_afl_controller_sharpness_algorithm GetSharpnessAlgorithm() const;
934 
944  PEAK_AFL_NO_DISCARD inline std::vector<peak_afl_controller_sharpness_algorithm> GetSharpnessAlgorithmList() const;
945 
949  inline void RegisterFinishedCallback(const callback::FinishedCallback& callback);
950 
954  inline void UnRegisterFinishedCallback();
955 
959  inline void RegisterComponentCallback(peak_afl_controller_brightness_component component, const callback::FinishedCallback& callback);
960 
964  inline void UnRegisterComponentCallback(peak_afl_controller_brightness_component component);
965 
970  inline void RegisterDataProcessingCallback(const callback::DataProcessingCallback& callback);
971 
975  inline void UnRegisterDataProcessingCallback();
976 
986  PEAK_AFL_NO_DISCARD inline bool IsWeightedROISupported() const;
987 
997  inline void SetWeightedROIs(const std::vector<peak_afl_weighted_rectangle>& list);
998 
1008  inline void SetWeightedROI(const peak_afl_weighted_rectangle& rect);
1009 
1017  PEAK_AFL_NO_DISCARD inline peak_afl_size GetWeightedROIMinSize() const;
1018 
1026  PEAK_AFL_NO_DISCARD inline std::vector<peak_afl_weighted_rectangle> GetWeightedROIs() const;
1027 
1037  PEAK_AFL_NO_DISCARD inline bool IsLimitSupported() const;
1038 
1048  inline void SetLimit(peak_afl_controller_limit limit);
1049 
1057  PEAK_AFL_NO_DISCARD inline peak_afl_controller_limit GetLimit() const;
1058 
1066  PEAK_AFL_NO_DISCARD inline peak_afl_controller_limit GetDefaultLimit() const;
1067 
1077  PEAK_AFL_NO_DISCARD inline bool IsHysteresisSupported() const;
1078 
1088  inline void SetHysteresis(std::uint8_t hysteresis);
1089 
1097  PEAK_AFL_NO_DISCARD inline std::uint8_t GetHysteresis() const;
1098 
1106  PEAK_AFL_NO_DISCARD inline std::uint8_t GetDefaultHysteresis() const;
1107 
1115  PEAK_AFL_NO_DISCARD inline Range<std::uint8_t> GetHysteresisRange() const;
1116 
1126  PEAK_AFL_NO_DISCARD inline bool IsBrightnessComponentModeSupported() const;
1127 
1138  inline void BrightnessComponentSetMode(peak_afl_controller_brightness_component component, peak_afl_controller_automode mode);
1139 
1148  PEAK_AFL_NO_DISCARD inline peak_afl_controller_automode BrightnessComponentGetMode(peak_afl_controller_brightness_component component) const;
1149 
1160  PEAK_AFL_NO_DISCARD inline peak_afl_controller_status BrightnessComponentStatus(peak_afl_controller_brightness_component component) const;
1161 
1169  PEAK_AFL_NO_DISCARD inline bool IsGainLimitSupported() const;
1170 
1185  inline void SetGainLimit(peak_afl_double_limit limit);
1186 
1194  inline peak_afl_double_limit GetGainLimit() const;
1195 
1203  inline peak_afl_double_limit GetGainLimitRange() const;
1204 
1205 
1206 private:
1207  using FinishedCallbackType = Callback<callback::FinishedCallback>;
1208  using DataProcessingCallbackType = Callback<callback::DataProcessingCallback>;
1209  using ComponentCallbackType = Callback<callback::ComponentCallback>;
1210 
1211  peak_afl_controller_handle m_handle{};
1212  std::unique_ptr<FinishedCallbackType> m_finishedCallback{};
1213  std::unique_ptr<DataProcessingCallbackType> m_dataProcessingCallback{};
1214  std::unique_ptr<ComponentCallbackType> m_finishedExposureCallback{};
1215  std::unique_ptr<ComponentCallbackType> m_finishedGainCallback{};
1216 };
1217 
1218 namespace library
1219 {
1220 inline void Init()
1221 {
1222  const auto ret = peak_afl_Init();
1223  if (ret != PEAK_AFL_STATUS_SUCCESS)
1224 
1225  {
1226  throw error::Exception(ret, false);
1227  }
1228 }
1229 
1230 inline void Exit()
1231 {
1232  const auto ret = peak_afl_Exit();
1233  if (ret != PEAK_AFL_STATUS_SUCCESS)
1234  {
1235  throw error::Exception(ret, false);
1236  }
1237 }
1238 
1240 {
1241  Version_t version{};
1242 
1243  const auto ret = peak_afl_GetVersion(&version.major, &version.minor, &version.subminor, &version.patch);
1244  if (ret != PEAK_AFL_STATUS_SUCCESS)
1245  {
1246  throw error::Exception(ret, false);
1247  }
1248 
1249  return version;
1250 }
1251 
1252 inline std::string GetLastError()
1253 {
1254  std::size_t lastErrorMessageSize;
1255  peak_afl_status code;
1256 
1257  auto ret = peak_afl_GetLastError(&code, nullptr, &lastErrorMessageSize);
1258  if (ret != PEAK_AFL_STATUS_SUCCESS)
1259  {
1260  return "Cannot get last error!";
1261  }
1262 
1263  std::vector<char> text;
1264  text.resize(lastErrorMessageSize);
1265 
1266  ret = peak_afl_GetLastError(&code, text.data(), &lastErrorMessageSize);
1267  if (ret != PEAK_AFL_STATUS_SUCCESS)
1268  {
1269  return "Cannot get last error!";
1270  }
1271 
1272  return { text.begin(), text.end() };
1273 }
1274 } // namespace library
1275 
1276 inline Manager::Manager(const std::shared_ptr<peak::core::NodeMap>& node_map)
1277 {
1278  if(!node_map)
1279  {
1280  throw std::runtime_error("Invalid node map handle!");
1281  }
1282 
1283  const auto ret = peak_afl_AutoFeatureManager_Create(&m_handle, node_map->Handle());
1284  if (ret != PEAK_AFL_STATUS_SUCCESS)
1285  {
1286  throw error::Exception(ret);
1287  }
1288 }
1289 
1291 {
1292  if (m_handle != nullptr)
1293  {
1295 
1296  {
1297  std::lock_guard<std::mutex> lck(m_mutex);
1298  for (auto& c : m_controllerList)
1299  {
1300  c->m_handle = nullptr;
1301  }
1302  }
1303 
1305  m_handle = nullptr;
1306  }
1307 }
1308 
1309 inline Manager::Manager(Manager&& other) noexcept {
1310  m_handle = other.m_handle;
1311  other.m_handle = nullptr;
1312 
1313  std::lock_guard<std::mutex> lck(other.m_mutex);
1314  m_controllerList = std::move(other.m_controllerList);
1315 }
1316 
1317 inline Manager& Manager::operator=(Manager&& other) noexcept
1318 {
1319  m_handle = other.m_handle;
1320  other.m_handle = nullptr;
1321 
1322  std::lock_guard<std::mutex> lck(other.m_mutex);
1323  m_controllerList = std::move(other.m_controllerList);
1324 
1325  return *this;
1326 }
1327 
1328 inline void Manager::AddController(const std::shared_ptr<Controller>& controller)
1329 {
1330  std::lock_guard<std::mutex> lck(m_mutex);
1331 
1332  auto cnt = std::any_of(m_controllerList.begin(), m_controllerList.end(), [controller](const std::shared_ptr<Controller>& c) {
1333  return c == controller;
1334  });
1335 
1336  if(cnt)
1337  {
1338  return;
1339  }
1340 
1341  const auto ret = peak_afl_AutoFeatureManager_AddController(m_handle, controller->m_handle);
1342  if (ret != PEAK_AFL_STATUS_SUCCESS)
1343  {
1344  throw error::Exception(ret);
1345  }
1346 
1347  m_controllerList.emplace_back(controller);
1348 }
1349 
1350 inline void Manager::RemoveController(const std::shared_ptr<Controller>& controller)
1351 {
1352  std::lock_guard<std::mutex> lck(m_mutex);
1353 
1354  const auto ret = peak_afl_AutoFeatureManager_RemoveController(m_handle, controller->m_handle);
1355  if (ret != PEAK_AFL_STATUS_SUCCESS)
1356  {
1357  throw error::Exception(ret);
1358  }
1359 
1360  auto it = std::remove_if(m_controllerList.begin(), m_controllerList.end(), [controller](const std::shared_ptr<Controller>& c) {
1361  return c == controller;
1362  });
1363 
1364  m_controllerList.erase(it, m_controllerList.end());
1365 }
1366 
1367 inline void Manager::Process(const peak::ipl::Image& image) const
1368 {
1369  const auto ret = peak_afl_AutoFeatureManager_Process(m_handle, ImageBackendAccessor::BackendHandle(image));
1370  if (ret != PEAK_AFL_STATUS_SUCCESS)
1371  {
1372  throw error::Exception(ret);
1373  }
1374 }
1375 
1376 inline std::shared_ptr<Controller> Manager::CreateController(peak_afl_controllerType type)
1377 {
1378  std::lock_guard<std::mutex> lck(m_mutex);
1379 
1380  peak_afl_controller_handle handle{};
1381  const auto ret = peak_afl_AutoFeatureManager_CreateController(m_handle, &handle, type);
1382  if (ret != PEAK_AFL_STATUS_SUCCESS)
1383  {
1384  throw error::Exception(ret);
1385  }
1386 
1387  auto shared = std::shared_ptr<Controller>(new Controller(handle));
1388  m_controllerList.emplace_back(shared);
1389 
1390  return shared;
1391 }
1392 
1394 {
1395  std::lock_guard<std::mutex> lck(m_mutex);
1396 
1397  const auto ret = peak_afl_AutoFeatureManager_DestroyAllController(m_handle);
1398  if (ret != PEAK_AFL_STATUS_SUCCESS)
1399  {
1400  throw error::Exception(ret);
1401  }
1402 
1403  for(auto& c : m_controllerList)
1404  {
1405  c->m_handle = nullptr;
1406  }
1407 
1408  m_controllerList.clear();
1409 }
1410 
1411 inline void Manager::DestroyController(const std::shared_ptr<Controller>& controller)
1412 {
1413  std::lock_guard<std::mutex> lck(m_mutex);
1414 
1415  const auto ret = peak_afl_AutoFeatureManager_DestroyController(m_handle, controller->m_handle);
1416  if (ret != PEAK_AFL_STATUS_SUCCESS)
1417  {
1418  throw error::Exception(ret);
1419  }
1420 
1421  auto it = std::remove_if(m_controllerList.begin(), m_controllerList.end(), [controller](const std::shared_ptr<Controller>& c) {
1422  return c == controller;
1423  });
1424 
1425  m_controllerList.erase(it, m_controllerList.end());
1426 
1427  controller->m_handle = nullptr;
1428 }
1429 
1430 inline void Manager::SetGainIPL(const peak::ipl::Gain& gain)
1431 {
1432  const auto ret = peak_afl_AutoFeatureManager_SetGainIPL(m_handle, GainBackendAccessor::BackendHandle(gain));
1433  if (ret != PEAK_AFL_STATUS_SUCCESS)
1434  {
1435  throw error::Exception(ret);
1436  }
1437 }
1438 
1439 inline bool Manager::Status() const
1440 {
1441  std::uint8_t status;
1442  const auto ret = peak_afl_AutoFeatureManager_Status(m_handle, &status);
1443  if (ret != PEAK_AFL_STATUS_SUCCESS)
1444  {
1445  throw error::Exception(ret);
1446  }
1447 
1448  return status;
1449 }
1450 
1451 inline std::vector<std::shared_ptr<Controller>> Manager::ControllerList() const
1452 {
1453  std::lock_guard<std::mutex> lck(m_mutex);
1454 
1455  std::vector<std::shared_ptr<Controller>> controller{};
1456 
1457  std::copy(m_controllerList.begin(), m_controllerList.end(), std::back_inserter(controller));
1458 
1459  return controller;
1460 }
1461 
1462 inline size_t Manager::ControllerCount() const
1463 {
1464  return m_controllerList.size();
1465 }
1466 
1467 inline std::shared_ptr<Controller> Manager::GetController(peak_afl_controllerType type) const
1468 {
1469  std::lock_guard<std::mutex> lck(m_mutex);
1470 
1471  auto it = std::find_if(m_controllerList.cbegin(), m_controllerList.cend(), [=](const std::shared_ptr<Controller>& controller) {
1472  return type == controller->Type();
1473  });
1474 
1475  if(it != m_controllerList.cend())
1476  {
1477  return *it;
1478  }
1479  else
1480  {
1482  }
1483 }
1484 
1485 inline std::shared_ptr<Controller> Controller::Create(peak_afl_controllerType type)
1486 {
1487  peak_afl_controller_handle handle{};
1488  const auto ret = peak_afl_AutoController_Create(&handle, type);
1489  if (ret != PEAK_AFL_STATUS_SUCCESS)
1490  {
1491  throw error::Exception(ret);
1492  }
1493 
1494  return std::shared_ptr<Controller>(new Controller(handle));
1495 }
1496 
1498 {
1499  if (m_handle != nullptr)
1500  {
1502  m_handle = nullptr;
1503  }
1504 }
1505 
1507 {
1508  peak_afl_BOOL8 supported{};
1509  const auto ret = peak_afl_AutoController_SkipFrames_IsSupported(m_handle, &supported);
1510  if (ret != PEAK_AFL_STATUS_SUCCESS)
1511  {
1512  throw error::Exception(ret);
1513  }
1514 
1515  return supported;
1516 }
1517 
1518 inline void Controller::SetSkipFrames(std::uint32_t count)
1519 {
1520  const auto ret = peak_afl_AutoController_SkipFrames_Set(m_handle, count);
1521  if (ret != PEAK_AFL_STATUS_SUCCESS)
1522  {
1523  throw error::Exception(ret);
1524  }
1525 }
1526 
1527 inline std::uint32_t Controller::GetSkipFrames() const
1528 {
1529  std::uint32_t count{};
1530  const auto ret = peak_afl_AutoController_SkipFrames_Get(m_handle, &count);
1531  if (ret != PEAK_AFL_STATUS_SUCCESS)
1532  {
1533  throw error::Exception(ret);
1534  }
1535 
1536  return count;
1537 }
1538 
1540 {
1541  Range<std::uint32_t> range{};
1542  const auto ret = peak_afl_AutoController_SkipFrames_GetRange(m_handle, &range.min, &range.max, &range.inc);
1543  if (ret != PEAK_AFL_STATUS_SUCCESS)
1544  {
1545  throw error::Exception(ret);
1546  }
1547 
1548  return range;
1549 }
1550 
1551 inline bool Controller::IsROISupported() const
1552 {
1553  peak_afl_BOOL8 supported{};
1554  const auto ret = peak_afl_AutoController_ROI_IsSupported(m_handle, &supported);
1555  if (ret != PEAK_AFL_STATUS_SUCCESS)
1556  {
1557  throw error::Exception(ret);
1558  }
1559 
1560  return supported;
1561 }
1562 
1564 {
1565  const auto ret = peak_afl_AutoController_ROI_Set(m_handle, rect);
1566  if (ret != PEAK_AFL_STATUS_SUCCESS)
1567  {
1568  throw error::Exception(ret);
1569  }
1570 }
1571 
1573 {
1574  peak_afl_rectangle rect{};
1575  const auto ret = peak_afl_AutoController_ROI_Get(m_handle, &rect);
1576  if (ret != PEAK_AFL_STATUS_SUCCESS)
1577  {
1578  throw error::Exception(ret);
1579  }
1580  return rect;
1581 }
1582 
1584 {
1585  peak_afl_BOOL8 supported{};
1586  const auto ret = peak_afl_AutoController_ROI_Preset_IsSupported(m_handle, &supported);
1587  if (ret != PEAK_AFL_STATUS_SUCCESS)
1588  {
1589  throw error::Exception(ret);
1590  }
1591 
1592  return supported;
1593 }
1594 
1596 {
1597  const auto ret = peak_afl_AutoController_ROI_Preset_Set(m_handle, preset);
1598  if (ret != PEAK_AFL_STATUS_SUCCESS)
1599  {
1600  throw error::Exception(ret);
1601  }
1602 }
1603 
1604 inline bool Controller::IsModeSupported() const
1605 {
1606  peak_afl_BOOL8 supported{};
1607  const auto ret = peak_afl_AutoController_Mode_IsSupported(m_handle, &supported);
1608  if (ret != PEAK_AFL_STATUS_SUCCESS)
1609  {
1610  throw error::Exception(ret);
1611  }
1612 
1613  return supported;
1614 }
1615 
1617 {
1618  const auto ret = peak_afl_AutoController_Mode_Set(m_handle, mode);
1619  if (ret != PEAK_AFL_STATUS_SUCCESS)
1620  {
1621  throw error::Exception(ret);
1622  }
1623 }
1624 
1626 {
1628  const auto ret = peak_afl_AutoController_Mode_Get(m_handle, &mode);
1629  if (ret != PEAK_AFL_STATUS_SUCCESS)
1630  {
1631  throw error::Exception(ret);
1632  }
1633  return mode;
1634 }
1635 
1637 {
1638  peak_afl_controller_status status{};
1639  const auto ret = peak_afl_AutoController_Status(m_handle, &status);
1640  if (ret != PEAK_AFL_STATUS_SUCCESS)
1641  {
1642  throw error::Exception(ret);
1643  }
1644  return status;
1645 }
1646 
1647 
1648 inline std::uint8_t Controller::GetLastAutoAverage() const
1649 {
1650  std::uint8_t average{};
1651  const auto ret = peak_afl_AutoController_GetLastAutoAverage(m_handle, &average);
1652  if (ret != PEAK_AFL_STATUS_SUCCESS)
1653  {
1654  throw error::Exception(ret);
1655  }
1656  return average;
1657 }
1658 
1659 inline std::tuple<std::uint8_t, std::uint8_t, std::uint8_t> Controller::GetLastAutoAverages() const
1660 {
1661  std::uint8_t averageRed{}, averageGreen{}, averageBlue{};
1662  const auto ret = peak_afl_AutoController_GetLastAutoAverages(m_handle, &averageRed, &averageGreen, &averageBlue);
1663  if (ret != PEAK_AFL_STATUS_SUCCESS)
1664  {
1665  throw error::Exception(ret);
1666  }
1667  return { averageRed, averageGreen, averageBlue };
1668 }
1669 
1671 {
1672  peak_afl_BOOL8 supported{};
1673  const auto ret = peak_afl_AutoController_AutoTarget_IsSupported(m_handle, &supported);
1674  if (ret != PEAK_AFL_STATUS_SUCCESS)
1675  {
1676  throw error::Exception(ret);
1677  }
1678 
1679  return supported;
1680 }
1681 
1682 inline void Controller::SetAutoTarget(std::uint32_t target)
1683 {
1684  const auto ret = peak_afl_AutoController_AutoTarget_Set(m_handle, target);
1685  if (ret != PEAK_AFL_STATUS_SUCCESS)
1686  {
1687  throw error::Exception(ret);
1688  }
1689 }
1690 
1691 inline std::uint32_t Controller::GetAutoTarget() const
1692 {
1693  std::uint32_t target{};
1694  const auto ret = peak_afl_AutoController_AutoTarget_Get(m_handle, &target);
1695  if (ret != PEAK_AFL_STATUS_SUCCESS)
1696  {
1697  throw error::Exception(ret);
1698  }
1699  return target;
1700 }
1701 
1703 {
1704  Range<std::uint32_t> range{};
1705  const auto ret = peak_afl_AutoController_AutoTarget_GetRange(m_handle, &range.min, &range.max, &range.inc);
1706  if (ret != PEAK_AFL_STATUS_SUCCESS)
1707  {
1708  throw error::Exception(ret);
1709  }
1710  return range;
1711 }
1712 
1714 {
1715  peak_afl_BOOL8 supported{};
1716  const auto ret = peak_afl_AutoController_AutoTolerance_IsSupported(m_handle, &supported);
1717  if (ret != PEAK_AFL_STATUS_SUCCESS)
1718  {
1719  throw error::Exception(ret);
1720  }
1721 
1722  return supported;
1723 }
1724 
1725 inline void Controller::SetAutoTolerance(uint32_t tolerance)
1726 {
1727  const auto ret = peak_afl_AutoController_AutoTolerance_Set(m_handle, tolerance);
1728  if (ret != PEAK_AFL_STATUS_SUCCESS)
1729  {
1730  throw error::Exception(ret);
1731  }
1732 }
1733 
1734 inline uint32_t Controller::GetAutoTolerance() const
1735 {
1736  std::uint32_t tolerance;
1737  const auto ret = peak_afl_AutoController_AutoTolerance_Get(m_handle, &tolerance);
1738  if (ret != PEAK_AFL_STATUS_SUCCESS)
1739  {
1740  throw error::Exception(ret);
1741  }
1742  return tolerance;
1743 }
1744 
1746 {
1747  Range<uint32_t> range{};
1748  const auto ret = peak_afl_AutoController_AutoTolerance_GetRange(m_handle, &range.min, &range.max, &range.inc);
1749  if (ret != PEAK_AFL_STATUS_SUCCESS)
1750  {
1751  throw error::Exception(ret);
1752  }
1753  return range;
1754 }
1755 
1757 {
1758  peak_afl_BOOL8 supported{};
1759  const auto ret = peak_afl_AutoController_AutoPercentile_IsSupported(m_handle, &supported);
1760  if (ret != PEAK_AFL_STATUS_SUCCESS)
1761  {
1762  throw error::Exception(ret);
1763  }
1764 
1765  return supported;
1766 }
1767 
1768 inline void Controller::SetAutoPercentile(double percentile)
1769 {
1770  const auto ret = peak_afl_AutoController_AutoPercentile_Set(m_handle, percentile);
1771  if (ret != PEAK_AFL_STATUS_SUCCESS)
1772  {
1773  throw error::Exception(ret);
1774  }
1775 }
1776 
1777 inline double Controller::GetAutoPercentile() const
1778 {
1779  double percentile;
1780  const auto ret = peak_afl_AutoController_AutoPercentile_Get(m_handle, &percentile);
1781  if (ret != PEAK_AFL_STATUS_SUCCESS)
1782  {
1783  throw error::Exception(ret);
1784  }
1785  return percentile;
1786 }
1787 
1789 {
1790  Range<double> range{};
1791  const auto ret = peak_afl_AutoController_AutoPercentile_GetRange(m_handle, &range.min, &range.max, &range.inc);
1792  if (ret != PEAK_AFL_STATUS_SUCCESS)
1793  {
1794  throw error::Exception(ret);
1795  }
1796  return range;
1797 }
1798 
1800 {
1801  peak_afl_controllerType type{};
1802  const auto ret = peak_afl_AutoController_Type_Get(m_handle, &type);
1803  if (ret != PEAK_AFL_STATUS_SUCCESS)
1804  {
1805  throw error::Exception(ret);
1806  }
1807  return type;
1808 }
1809 
1811 {
1812  peak_afl_BOOL8 supported{};
1813  const auto ret = peak_afl_AutoController_Algorithm_IsSupported(m_handle, &supported);
1814  if (ret != PEAK_AFL_STATUS_SUCCESS)
1815  {
1816  throw error::Exception(ret);
1817  }
1818 
1819  return supported;
1820 }
1821 
1823 {
1824  const auto ret = peak_afl_AutoController_Algorithm_Set(m_handle, alg);
1825  if (ret != PEAK_AFL_STATUS_SUCCESS)
1826  {
1827  throw error::Exception(ret);
1828  }
1829 }
1830 
1832 {
1834  const auto ret = peak_afl_AutoController_Algorithm_Get(m_handle, &alg);
1835  if (ret != PEAK_AFL_STATUS_SUCCESS)
1836  {
1837  throw error::Exception(ret);
1838  }
1839 
1840  return alg;
1841 }
1842 
1843 inline std::vector<peak_afl_controller_algorithm> Controller::GetAlgorithmList() const
1844 {
1845  std::vector<peak_afl_controller_algorithm> algList{};
1846  std::uint32_t listSize{};
1847 
1848  auto ret = peak_afl_AutoController_Algorithm_GetList(m_handle, nullptr, &listSize);
1849  if (ret != PEAK_AFL_STATUS_SUCCESS)
1850  {
1851  throw error::Exception(ret);
1852  }
1853 
1854  algList.resize(listSize);
1855 
1856  ret = peak_afl_AutoController_Algorithm_GetList(m_handle, algList.data(), &listSize);
1857  if (ret != PEAK_AFL_STATUS_SUCCESS)
1858  {
1859  throw error::Exception(ret);
1860  }
1861 
1862  return algList;
1863 }
1864 
1866 {
1867  peak_afl_BOOL8 supported{};
1868  const auto ret = peak_afl_AutoController_SharpnessAlgorithm_IsSupported(m_handle, &supported);
1869  if (ret != PEAK_AFL_STATUS_SUCCESS)
1870  {
1871  throw error::Exception(ret);
1872  }
1873 
1874  return supported;
1875 }
1876 
1878 {
1879  const auto ret = peak_afl_AutoController_SharpnessAlgorithm_Set(m_handle, alg);
1880  if (ret != PEAK_AFL_STATUS_SUCCESS)
1881  {
1882  throw error::Exception(ret);
1883  }
1884 }
1885 
1887 {
1889  const auto ret = peak_afl_AutoController_SharpnessAlgorithm_Get(m_handle, &alg);
1890  if (ret != PEAK_AFL_STATUS_SUCCESS)
1891  {
1892  throw error::Exception(ret);
1893  }
1894 
1895  return alg;
1896 }
1897 
1898 inline std::vector<peak_afl_controller_sharpness_algorithm> Controller::GetSharpnessAlgorithmList() const
1899 {
1900  std::vector<peak_afl_controller_sharpness_algorithm> algList{};
1901  std::uint32_t listSize{};
1902 
1903  auto ret = peak_afl_AutoController_SharpnessAlgorithm_GetList(m_handle, nullptr, &listSize);
1904  if (ret != PEAK_AFL_STATUS_SUCCESS)
1905  {
1906  throw error::Exception(ret);
1907  }
1908 
1909  algList.resize(listSize);
1910 
1911  ret = peak_afl_AutoController_SharpnessAlgorithm_GetList(m_handle, algList.data(), &listSize);
1912  if (ret != PEAK_AFL_STATUS_SUCCESS)
1913  {
1914  throw error::Exception(ret);
1915  }
1916 
1917  return algList;
1918 }
1919 
1920 inline void Controller::RegisterFinishedCallback(const callback::FinishedCallback& callback)
1921 {
1922  m_finishedCallback = std::make_unique<FinishedCallbackType>(shared_from_this(),
1923  [handle = m_handle](void* ptr, void* ctx) {
1925  [handle = m_handle] {
1927  callback);
1928 }
1929 
1931 {
1932  m_finishedCallback.reset();
1933 }
1934 
1935 inline void Controller::RegisterComponentCallback(peak_afl_controller_brightness_component component, const callback::FinishedCallback& callback)
1936 {
1937  if (!IsBrightnessComponentModeSupported())
1938  {
1940  }
1941 
1943  {
1944  m_finishedExposureCallback = std::make_unique<ComponentCallbackType>(shared_from_this(),
1945  [handle = m_handle, component](void* ptr, void* ctx) {
1947  ptr, ctx); },
1948  [handle = m_handle, component] {
1950  nullptr, nullptr); },
1951  callback);
1952  }
1953  else if (PEAK_AFL_CONTROLLER_BRIGHTNESS_COMPONENT_GAIN == component)
1954  {
1955  m_finishedGainCallback = std::make_unique<ComponentCallbackType>(shared_from_this(),
1956  [handle = m_handle, component](void* ptr, void* ctx) {
1958  ptr, ctx); },
1959  [handle = m_handle, component] {
1961  nullptr, nullptr); },
1962  callback);
1963  }
1964  else
1965  {
1967  }
1968 }
1969 
1971 {
1973  {
1974  m_finishedExposureCallback.reset();
1975  }
1976  else if (PEAK_AFL_CONTROLLER_BRIGHTNESS_COMPONENT_GAIN == component)
1977  {
1978  m_finishedGainCallback.reset();
1979  }
1980  else
1981  {
1983  }
1984 }
1985 
1986 inline void Controller::RegisterDataProcessingCallback(const callback::DataProcessingCallback& callback)
1987 {
1988  m_dataProcessingCallback = std::make_unique<DataProcessingCallbackType>(shared_from_this(),
1989  [handle = m_handle](void* ptr, void* ctx) {
1991  [handle = m_handle] {
1993  callback);
1994 }
1995 
1997 {
1998  m_dataProcessingCallback.reset();
1999 }
2000 
2002 {
2003  peak_afl_BOOL8 supported{};
2004  const auto ret = peak_afl_AutoController_Weighted_ROI_IsSupported(m_handle, &supported);
2005  if (ret != PEAK_AFL_STATUS_SUCCESS)
2006  {
2007  throw error::Exception(ret);
2008  }
2009 
2010  return supported;
2011 }
2012 
2013 inline void Controller::SetWeightedROIs(const std::vector<peak_afl_weighted_rectangle>& list)
2014 {
2015  const auto ret = peak_afl_AutoController_Weighted_ROI_Set(m_handle, list.data(), static_cast<uint32_t>(list.size()));
2016  if (ret != PEAK_AFL_STATUS_SUCCESS)
2017  {
2018  throw error::Exception(ret);
2019  }
2020 }
2021 
2023 {
2024  const auto ret = peak_afl_AutoController_Weighted_ROI_Set(m_handle, &rect, 1);
2025  if (ret != PEAK_AFL_STATUS_SUCCESS)
2026  {
2027  throw error::Exception(ret);
2028  }
2029 }
2030 
2032 {
2033  peak_afl_size minSize{};
2034  const auto ret = peak_afl_AutoController_Weighted_ROI_Min_Size(m_handle, &minSize);
2035  if (ret != PEAK_AFL_STATUS_SUCCESS)
2036  {
2037  throw error::Exception(ret);
2038  }
2039  return minSize;
2040 }
2041 
2042 inline std::vector<peak_afl_weighted_rectangle> Controller::GetWeightedROIs() const
2043 {
2044  std::vector<peak_afl_weighted_rectangle> list;
2045  std::uint32_t listSize{};
2046 
2047  auto ret = peak_afl_AutoController_Weighted_ROI_Get(m_handle, nullptr, &listSize);
2048  if (ret != PEAK_AFL_STATUS_SUCCESS)
2049  {
2050  throw error::Exception(ret);
2051  }
2052 
2053  list.resize(listSize);
2054 
2055  ret = peak_afl_AutoController_Weighted_ROI_Get(m_handle, list.data(), &listSize);
2056  if (ret != PEAK_AFL_STATUS_SUCCESS)
2057  {
2058  throw error::Exception(ret);
2059  }
2060 
2061  return list;
2062 }
2063 
2064 inline bool Controller::IsLimitSupported() const
2065 {
2066  peak_afl_BOOL8 supported{};
2067  const auto ret = peak_afl_AutoController_Limit_IsSupported(m_handle, &supported);
2068  if (ret != PEAK_AFL_STATUS_SUCCESS)
2069  {
2070  throw error::Exception(ret);
2071  }
2072 
2073  return supported;
2074 }
2075 
2077 {
2078  const auto ret = peak_afl_AutoController_Limit_Set(m_handle, limit);
2079  if (ret != PEAK_AFL_STATUS_SUCCESS)
2080  {
2081  throw error::Exception(ret);
2082  }
2083 }
2084 
2086 {
2087  peak_afl_controller_limit limit{};
2088  const auto ret = peak_afl_AutoController_Limit_Get(m_handle, &limit);
2089  if (ret != PEAK_AFL_STATUS_SUCCESS)
2090  {
2091  throw error::Exception(ret);
2092  }
2093  return limit;
2094 }
2095 
2097 {
2098  peak_afl_controller_limit limit{};
2099  const auto ret = peak_afl_AutoController_Limit_Default(m_handle, &limit);
2100  if (ret != PEAK_AFL_STATUS_SUCCESS)
2101  {
2102  throw error::Exception(ret);
2103  }
2104  return limit;
2105 }
2106 
2108 {
2109  peak_afl_BOOL8 supported{};
2110  const auto ret = peak_afl_AutoController_Hysteresis_IsSupported(m_handle, &supported);
2111  if (ret != PEAK_AFL_STATUS_SUCCESS)
2112  {
2113  throw error::Exception(ret);
2114  }
2115 
2116  return supported;
2117 }
2118 
2119 inline void Controller::SetHysteresis(std::uint8_t hysteresis)
2120 {
2121  const auto ret = peak_afl_AutoController_Hysteresis_Set(m_handle, hysteresis);
2122  if (ret != PEAK_AFL_STATUS_SUCCESS)
2123  {
2124  throw error::Exception(ret);
2125  }
2126 }
2127 
2128 inline std::uint8_t Controller::GetHysteresis() const
2129 {
2130  std::uint8_t hysteresis{};
2131  const auto ret = peak_afl_AutoController_Hysteresis_Get(m_handle, &hysteresis);
2132  if (ret != PEAK_AFL_STATUS_SUCCESS)
2133  {
2134  throw error::Exception(ret);
2135  }
2136 
2137  return hysteresis;
2138 }
2139 
2140 inline std::uint8_t Controller::GetDefaultHysteresis() const
2141 {
2142  std::uint8_t hysteresis{};
2143  const auto ret = peak_afl_AutoController_Hysteresis_Default(m_handle, &hysteresis);
2144  if (ret != PEAK_AFL_STATUS_SUCCESS)
2145  {
2146  throw error::Exception(ret);
2147  }
2148 
2149  return hysteresis;
2150 }
2151 
2153 {
2154  Range<std::uint8_t> hysteresis{};
2156  m_handle, &hysteresis.min, &hysteresis.max, &hysteresis.inc);
2157  if (ret != PEAK_AFL_STATUS_SUCCESS)
2158  {
2159  throw error::Exception(ret);
2160  }
2161 
2162  return hysteresis;
2163 }
2164 
2165 PEAK_AFL_NO_DISCARD inline bool Controller::IsBrightnessComponentModeSupported() const
2166 {
2167  peak_afl_BOOL8 supported{};
2168  const auto ret = peak_afl_AutoController_BrightnessComponent_Mode_IsSupported(m_handle, &supported);
2169  if (ret != PEAK_AFL_STATUS_SUCCESS)
2170  {
2171  throw error::Exception(ret);
2172  }
2173 
2174  return supported;
2175 }
2176 
2179 {
2180  const auto ret = peak_afl_AutoController_BrightnessComponent_Mode_Set(m_handle, component, mode);
2181  if (ret != PEAK_AFL_STATUS_SUCCESS)
2182  {
2183  throw error::Exception(ret);
2184  }
2185 }
2186 
2189 {
2191  const auto ret = peak_afl_AutoController_BrightnessComponent_Mode_Get(m_handle, component, &mode);
2192  if (ret != PEAK_AFL_STATUS_SUCCESS)
2193  {
2194  throw error::Exception(ret);
2195  }
2196  return mode;
2197 }
2198 
2201 {
2202  peak_afl_controller_status status{};
2203  const auto ret = peak_afl_AutoController_BrightnessComponent_Status(m_handle, component, &status);
2204  if (ret != PEAK_AFL_STATUS_SUCCESS)
2205  {
2206  throw error::Exception(ret);
2207  }
2208  return status;
2209 }
2210 
2212 {
2213  peak_afl_BOOL8 supported{};
2214  const auto ret = peak_afl_AutoController_GainLimit_IsSupported(m_handle, &supported);
2215  if (ret != PEAK_AFL_STATUS_SUCCESS)
2216  {
2217  throw error::Exception(ret);
2218  }
2219 
2220  return supported;
2221 }
2222 
2224 {
2225  const auto ret = peak_afl_AutoController_GainLimit_Set(m_handle, limit);
2226  if (ret == PEAK_AFL_STATUS_VALUE_ADJUSTED)
2227  {
2228  // Do nothing. Not an error.
2229  }
2230  else if (ret != PEAK_AFL_STATUS_SUCCESS)
2231  {
2232  throw error::Exception(ret);
2233  }
2234 }
2235 
2237 {
2238  peak_afl_double_limit limit{};
2239  const auto ret = peak_afl_AutoController_GainLimit_Get(m_handle, &limit);
2240  if (ret != PEAK_AFL_STATUS_SUCCESS)
2241  {
2242  throw error::Exception(ret);
2243  }
2244 
2245  return limit;
2246 }
2247 
2249 {
2250  peak_afl_double_limit limit{};
2251  const auto ret = peak_afl_AutoController_GainLimit_GetRange(m_handle, &limit);
2252  if (ret != PEAK_AFL_STATUS_SUCCESS)
2253  {
2254  throw error::Exception(ret);
2255  }
2256 
2257  return limit;
2258 }
2259 
2260 
2261 } /* namespace afl */
2262 } /* namespace peak */
peak_afl_status peak_afl_GetVersion(uint32_t *majorVersion, uint32_t *minorVersion, uint32_t *subminorVersion, uint32_t *patchVersion)
Query the library version.
std::vector< std::shared_ptr< Controller > > ControllerList() const
Get the list of the controller associated with the manager.
Definition: peak_afl.hpp:1451
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_Get(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm *algorithm)
Get the used sharpness algorithm for a controller.
peak_afl_status peak_afl_AutoFeatureManager_AddController(peak_afl_manager_handle handle, peak_afl_manager_handle controller)
Add a controller to an auto manager instance.
peak_afl_controller_algorithm GetAlgorithm() const
Get the used algorithm for a controller.
Definition: peak_afl.hpp:1831
~Controller()
Definition: peak_afl.hpp:1497
Range< std::uint8_t > GetHysteresisRange() const
Get autofeature hysteresis range for a controller.
Definition: peak_afl.hpp:2152
std::vector< peak_afl_controller_algorithm > GetAlgorithmList() const
Get the list of supported algorithms for a controller.
Definition: peak_afl.hpp:1843
peak_afl_status peak_afl_AutoController_GainLimit_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if gain limit is supported for a controller.
void SetWeightedROIs(const std::vector< peak_afl_weighted_rectangle > &list)
Set the autofeature weighted region of interest for a controller.
Definition: peak_afl.hpp:2013
bool IsGainLimitSupported() const
Check if auto gain limit is supported for a controller.
Definition: peak_afl.hpp:2211
void SetHysteresis(std::uint8_t hysteresis)
Set the autofeature hysteresis for a controller.
Definition: peak_afl.hpp:2119
peak_afl_status peak_afl_AutoController_SkipFrames_Get(peak_afl_controller_handle controller, uint32_t *count)
Get number of frames skipped for a controller.
peak_afl_status peak_afl_AutoController_SkipFrames_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if skip frames is supported for a controller.
peak_afl_controller_sharpness_algorithm
controller sharpness algorithm (focus)
Definition: peak_afl.h:209
peak_afl_status peak_afl_AutoController_AutoPercentile_GetRange(peak_afl_controller_handle controller, double *min, double *max, double *inc)
Get the auto percentile range for a controller.
size_t ControllerCount() const
Get the list count of the controller associated with the manager.
Definition: peak_afl.hpp:1462
peak_afl_status peak_afl_AutoController_SkipFrames_Set(peak_afl_controller_handle controller, uint32_t count)
Set number of frames skipped for a controller.
bool IsAlgorithmSupported() const
check if setting an algorithm is supported for a controller.
Definition: peak_afl.hpp:1810
peak_afl_status peak_afl_AutoController_BrightnessComponent_Mode_Get(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_automode *mode)
Get the current brightness component mode for a controller.
peak_afl_status peak_afl_AutoController_Limit_Default(peak_afl_controller_handle controller, peak_afl_controller_limit *limit)
Get the autofeature default limit.
void UnRegisterComponentCallback(peak_afl_controller_brightness_component component)
Reset the component callback for a controller.
Definition: peak_afl.hpp:1970
peak_afl_status peak_afl_AutoController_Algorithm_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if setting an algorithm is supported for a controller.
peak_afl_status peak_afl_AutoController_ROI_Get(peak_afl_controller_handle controller, peak_afl_rectangle *roi)
Get the autofeature region of interest for a controller.
void Exit()
Exit the peak_afl auto feature library.
Definition: peak_afl.hpp:1230
peak_afl_status peak_afl_AutoController_Algorithm_Get(peak_afl_controller_handle controller, peak_afl_controller_algorithm *algorithm)
Get the used algorithm for a controller.
peak_afl_status peak_afl_AutoController_Weighted_ROI_Get(peak_afl_controller_handle controller, peak_afl_weighted_rectangle *weightedRoiList, uint32_t *listSize)
Get the autofeature weighted region of interest for a controller.
peak_afl_controller_status BrightnessComponentStatus(peak_afl_controller_brightness_component component) const
Get the status for a brightness controller component.
Definition: peak_afl.hpp:2199
peak_afl_status peak_afl_AutoFeatureManager_Status(peak_afl_manager_handle handle, peak_afl_BOOL8 *running)
Get the status of a manager.
std::shared_ptr< Controller > GetController(peak_afl_controllerType type) const
Get the controller for a type.
Definition: peak_afl.hpp:1467
peak_afl_controller_limit GetLimit() const
Get the autofeature limit for a controller.
Definition: peak_afl.hpp:2085
Library not initialized.
Definition: peak_afl.h:96
peak_afl_status
peak_afl Status codes
Definition: peak_afl.h:87
Definition: peak_afl.hpp:56
std::uint8_t GetDefaultHysteresis() const
Get the autofeature hysteresis default.
Definition: peak_afl.hpp:2140
peak_afl Size (2D)
Definition: peak_afl.h:300
void Init()
Init the peak_afl auto feature library.
Definition: peak_afl.hpp:1220
std::uint32_t GetAutoTarget() const
Get the currently set auto target for a controller.
Definition: peak_afl.hpp:1691
peak_afl_status peak_afl_AutoController_Mode_Get(peak_afl_controller_handle controller, peak_afl_controller_automode *mode)
Get the current autofeature mode for a controller.
std::string GetLastError()
Get the last error message.
Definition: peak_afl.hpp:1252
void SetAutoTolerance(std::uint32_t tolerance)
Set the auto tolerance for a controller.
Definition: peak_afl.hpp:1725
Error.
Definition: peak_afl.h:93
uint32_t Patch() const
Returns the patch part of the version which is the fourth part of the version scheme separated by dot...
Definition: peak_afl.hpp:118
std::uint8_t GetHysteresis() const
Get the autofeature hysteresis for a controller.
Definition: peak_afl.hpp:2128
void RegisterComponentCallback(peak_afl_controller_brightness_component component, const callback::FinishedCallback &callback)
Set component callback for a controller.
Definition: peak_afl.hpp:1935
void SetWeightedROI(const peak_afl_weighted_rectangle &rect)
Set single autofeature weighted region of interest for a controller.
Definition: peak_afl.hpp:2022
void RegisterDataProcessingCallback(const callback::DataProcessingCallback &callback)
Set the data callback for a controller.
Definition: peak_afl.hpp:1986
void BrightnessComponentSetMode(peak_afl_controller_brightness_component component, peak_afl_controller_automode mode)
Set the autofeature mode for a brightness controller component.
Definition: peak_afl.hpp:2177
peak_afl_status peak_afl_AutoController_ROI_Set(peak_afl_controller_handle controller, peak_afl_rectangle roi)
Set the autofeature region of interest for a controller.
peak_afl_status peak_afl_AutoController_Weighted_ROI_Set(peak_afl_controller_handle controller, const peak_afl_weighted_rectangle *weightedRoiList, uint32_t listSize)
Set the autofeature weighted region of interest for a controller.
peak_afl_status peak_afl_AutoController_Limit_Get(peak_afl_controller_handle controller, peak_afl_controller_limit *limit)
Get the autofeature limit for a controller.
uint32_t Minor() const
Returns the minor part of the version which is the second part of the version scheme separated by dot...
Definition: peak_afl.hpp:99
Invalid image format.
Definition: peak_afl.h:111
void UnRegisterFinishedCallback()
Reset the finished callback for a controller.
Definition: peak_afl.hpp:1930
peak_afl Rectangle (2D)
Definition: peak_afl.h:334
peak_afl_status peak_afl_AutoController_Callback_Set(peak_afl_controller_handle controller, peak_afl_callback_type type, void *funcPtr, void *context)
Set a callback for a controller.
peak_afl_status peak_afl_AutoController_GetLastAutoAverages(peak_afl_controller_handle controller, uint8_t *averageRed, uint8_t *averageGreen, uint8_t *averageBlue)
Get the last auto average for a controller.
std::vector< peak_afl_controller_sharpness_algorithm > GetSharpnessAlgorithmList() const
Get the list of supported sharpness algorithms for a controller.
Definition: peak_afl.hpp:1898
void SetAutoTarget(uint32_t target)
Set the auto target for a controller.
Definition: peak_afl.hpp:1682
peak_afl_status peak_afl_AutoController_Mode_Set(peak_afl_controller_handle controller, peak_afl_controller_automode mode)
Set the autofeature mode for a controller.
exposure
Definition: peak_afl.h:234
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check setting a sharpness algorithm is supported by a controller.
peak_afl_status peak_afl_AutoController_Type_Get(peak_afl_controller_handle controller, peak_afl_controllerType *type)
Get the controller type.
peak_afl_status peak_afl_AutoController_AutoPercentile_Get(peak_afl_controller_handle controller, double *percentile)
Get the auto percentile for a controller.
std::uint32_t patch
Subminor.
Definition: peak_afl.hpp:72
peak_afl_controller_automode BrightnessComponentGetMode(peak_afl_controller_brightness_component component) const
Get the current autofeature mode for a brightness controller component.
Definition: peak_afl.hpp:2187
peak_afl_status peak_afl_AutoController_ROI_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if setting a region of interest is supported for a controller.
peak_afl Focus Limit
Definition: peak_afl.h:372
void SetSharpnessAlgorithm(peak_afl_controller_sharpness_algorithm algorithm)
Set the used sharpness algorithm for a controller.
Definition: peak_afl.hpp:1877
void SetAlgorithm(peak_afl_controller_algorithm algorithm)
Set the used algorithm for a controller.
Definition: peak_afl.hpp:1822
bool IsWeightedROISupported() const
Check if weighted region of interest is supported for a controller.
Definition: peak_afl.hpp:2001
std::uint32_t GetSkipFrames() const
Get number of frames skipped for a controller.
Definition: peak_afl.hpp:1527
peak_afl_status peak_afl_AutoController_Weighted_ROI_Min_Size(peak_afl_controller_handle controller, peak_afl_size *size)
Get the autofeature minimum size for the weighted region of interest for a controller.
peak_afl_status peak_afl_AutoController_BrightnessComponent_Mode_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if brightness component mode is supported for a controller component.
std::string ToString() const
Patch.
Definition: peak_afl.hpp:78
std::uint32_t subminor
Minor.
Definition: peak_afl.hpp:71
peak_afl_status peak_afl_AutoFeatureManager_Destroy(peak_afl_manager_handle handle)
Destroy an automanager instance.
peak_afl_status peak_afl_AutoFeatureManager_RemoveController(peak_afl_manager_handle handle, peak_afl_manager_handle controller)
Remove a controller to an automanager instance.
void SetROIPreset(peak_afl_roi_preset preset)
Set the autofeature region of interest preset for a controller.
Definition: peak_afl.hpp:1595
peak_afl_status peak_afl_AutoController_AutoTarget_GetRange(peak_afl_controller_handle controller, uint32_t *min, uint32_t *max, uint32_t *inc)
Get the auto target range for a controller.
peak_afl_double_limit GetGainLimitRange() const
Get autofeature gain limit range for a controller.
Definition: peak_afl.hpp:2248
peak_afl_roi_preset
controller roi preset
Definition: peak_afl.h:286
peak_afl_status peak_afl_AutoController_Limit_Set(peak_afl_controller_handle controller, peak_afl_controller_limit limit)
Set the autofeature limit for a controller.
void RegisterFinishedCallback(const callback::FinishedCallback &callback)
Set finished callback for a controller.
Definition: peak_afl.hpp:1920
peak_afl_controller_automode
controller automode
Definition: peak_afl.h:143
std::vector< peak_afl_weighted_rectangle > GetWeightedROIs() const
Get the autofeature weighted region of interest for a controller.
Definition: peak_afl.hpp:2042
Definition: peak_afl.hpp:481
peak_afl_controller_automode GetMode() const
Get the current autofeature mode for a controller.
Definition: peak_afl.hpp:1625
void SetSkipFrames(std::uint32_t count)
Set number of frames skipped for a controller.
Definition: peak_afl.hpp:1518
void SetROI(peak_afl_rectangle rect)
Set the autofeature region of interest for a controller.
Definition: peak_afl.hpp:1563
peak_afl_status peak_afl_AutoController_SkipFrames_GetRange(peak_afl_controller_handle controller, uint32_t *min, uint32_t *max, uint32_t *inc)
Get range for frames skipped for a controller.
static std::shared_ptr< Controller > Create(peak_afl_controllerType type)
Create a new controller.
Definition: peak_afl.hpp:1485
uint8_t peak_afl_BOOL8
custom boolean type
Definition: peak_afl.h:397
peak_afl_double_limit GetGainLimit() const
Get autofeature gain limit for a controller.
Definition: peak_afl.hpp:2236
peak_afl_status peak_afl_AutoFeatureManager_CreateController(peak_afl_manager_handle handle, peak_afl_controller_handle *controller, peak_afl_controllerType controllerType)
Create a controller and append it to Manager.
void * peak_afl_manager_handle
opaque manager handle type
Definition: peak_afl.h:51
Success.
Definition: peak_afl.h:90
peak_afl_status peak_afl_AutoController_GainLimit_GetRange(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature gain limit range for a controller.
bool IsModeSupported() const
Check if auto mode is supported for a controller.
Definition: peak_afl.hpp:1604
std::uint32_t GetAutoTolerance() const
Get the current auto tolerance for a controller.
Definition: peak_afl.hpp:1734
Definition: peak_afl.hpp:67
bool IsAutoToleranceSupported() const
check if auto tolerance is supported for a controller.
Definition: peak_afl.hpp:1713
peak_afl_rectangle GetROI() const
Get the autofeature region of interest for a controller.
Definition: peak_afl.hpp:1572
peak_afl_status peak_afl_AutoController_Hysteresis_GetRange(peak_afl_controller_handle controller, uint8_t *min, uint8_t *max, uint8_t *inc)
Get autofeature hysteresis range for a controller.
peak_afl_status peak_afl_AutoFeatureManager_DestroyAllController(peak_afl_manager_handle handle)
Destroy all controllers for a manager.
peak_afl_status peak_afl_AutoController_AutoTarget_Set(peak_afl_controller_handle controller, uint32_t target)
Set the auto target for a controller.
gain
Definition: peak_afl.h:237
bool IsBrightnessComponentModeSupported() const
Check if auto mode is supported for a brightness controller component.
Definition: peak_afl.hpp:2165
std::tuple< Manager, std::vector< std::shared_ptr< Controller > > > CreateManager(const std::shared_ptr< peak::core::NodeMap > &node_map, ControllerTypes... types)
Convenience function to create a manager with the supplied controllers.
Definition: peak_afl.hpp:439
bool IsSharpnessAlgorithmSupported() const
check setting a sharpness algorithm is supported by a controller.
Definition: peak_afl.hpp:1865
peak_afl_status peak_afl_Init(void)
Init the peak_afl auto feature library.
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_Set(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm algorithm)
Set the used sharpness algorithm for a controller.
peak_afl_status peak_afl_AutoController_GetLastAutoAverage(peak_afl_controller_handle controller, uint8_t *average)
Get the last auto average for a controller.
peak_afl_controller_algorithm
controller algorithm
Definition: peak_afl.h:187
std::tuple< std::uint8_t, std::uint8_t, std::uint8_t > GetLastAutoAverages() const
Get the last auto average for a controller.
Definition: peak_afl.hpp:1659
uint32_t Major() const
Returns the major part of the version which is the first part of the version scheme separated by dots...
Definition: peak_afl.hpp:89
Not supported.
Definition: peak_afl.h:114
Version_t Version()
Query the library version.
Definition: peak_afl.hpp:1239
peak_afl_status peak_afl_Exit(void)
Exit the peak_afl auto feature library.
peak_afl_status peak_afl_AutoController_AutoTolerance_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto tolerance is supported for a controller.
peak_afl_status peak_afl_AutoController_ROI_Preset_Set(peak_afl_controller_handle controller, peak_afl_roi_preset roiPreset)
Set the autofeature region of interest preset for a controller.
peak_afl_status peak_afl_AutoController_ROI_Preset_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if ROI preset is supported for a controller.
peak_afl_controllerType Type() const
Get the controller type.
Definition: peak_afl.hpp:1799
std::uint8_t GetLastAutoAverage() const
Get the last auto average for a controller.
Definition: peak_afl.hpp:1648
Controller callback type processing data.
Definition: peak_afl.h:267
bool IsAutoTargetSupported() const
check if auto target is supported for a controller.
Definition: peak_afl.hpp:1670
peak_afl_status peak_afl_AutoController_AutoTarget_Get(peak_afl_controller_handle controller, uint32_t *target)
Get the currently set auto target for a controller.
std::shared_ptr< Controller > CreateController(peak_afl_controllerType type)
Create a controller and append it to Manager.
Definition: peak_afl.hpp:1376
peak_afl_status peak_afl_AutoController_Destroy(peak_afl_controller_handle controller)
Destroy a controller. Will fail if it is queued inside a manager.
Manager(const std::shared_ptr< peak::core::NodeMap > &node_map)
Create an automanager instance.
Definition: peak_afl.hpp:1276
Definition: peak_afl.hpp:460
peak_afl_status peak_afl_AutoController_GainLimit_Get(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature gain limit for a controller.
Range< std::uint32_t > GetAutoTargetRange() const
Get the auto target range for a controller.
Definition: peak_afl.hpp:1702
void SetAutoPercentile(double percentile)
Set the auto percentile for a controller.
Definition: peak_afl.hpp:1768
void RemoveController(const std::shared_ptr< Controller > &controller)
Remove a controller from an automanager.
Definition: peak_afl.hpp:1350
peak_afl_controller_sharpness_algorithm GetSharpnessAlgorithm() const
Get the used sharpness algorithm for a controller.
Definition: peak_afl.hpp:1886
peak_afl_status peak_afl_AutoFeatureManager_Create(peak_afl_manager_handle *handle, PEAK_NODE_MAP_HANDLE nodeMapHandle)
Create an automanager instance.
peak_afl_status peak_afl_AutoController_GainLimit_Set(peak_afl_controller_handle controller, peak_afl_double_limit limit)
Set autofeature gain limit for a controller.
peak_afl_status peak_afl_AutoController_AutoTarget_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto target is supported for a controller.
bool IsROISupported() const
Check if setting a region of interest is supported for a controller.
Definition: peak_afl.hpp:1551
bool IsHysteresisSupported() const
Check if hysteresis is supported for a controller.
Definition: peak_afl.hpp:2107
void UnRegisterDataProcessingCallback()
Reset the finished callback for a controller.
Definition: peak_afl.hpp:1996
Definition: peak_afl.hpp:186
peak_afl_status peak_afl_AutoController_Algorithm_Set(peak_afl_controller_handle controller, peak_afl_controller_algorithm algorithm)
Set the used algorithm for a controller.
Definition: peak_afl.hpp:283
peak_afl_controller_limit GetDefaultLimit() const
Get the autofeature default limit.
Definition: peak_afl.hpp:2096
bool IsLimitSupported() const
Check if limit is supported for a controller.
Definition: peak_afl.hpp:2064
peak_afl_controller_status Status() const
Get the status for a controller.
Definition: peak_afl.hpp:1636
peak_afl_status peak_afl_AutoController_AutoPercentile_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto percentile is supported for a controller.
Access Denied.
Definition: peak_afl.h:102
peak_afl_status peak_afl_AutoController_Limit_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if limit is supported for a controller.
void SetMode(peak_afl_controller_automode mode)
Set the autofeature mode for a controller.
Definition: peak_afl.hpp:1616
void DestroyController(const std::shared_ptr< Controller > &controller)
Destroy a controller.
Definition: peak_afl.hpp:1411
peak_afl_status peak_afl_AutoController_Status(peak_afl_controller_handle controller, peak_afl_controller_status *status)
Get the status for a controller.
Buffer too small.
Definition: peak_afl.h:108
peak_afl_status peak_afl_AutoFeatureManager_SetGainIPL(peak_afl_manager_handle handle, PEAK_IPL_GAIN_HANDLE gainHandle)
Set the IPL Gain.
Range< std::uint32_t > GetSkipFramesRange() const
Get range for frames skipped for a controller.
Definition: peak_afl.hpp:1539
peak_afl_status peak_afl_AutoController_Hysteresis_Default(peak_afl_controller_handle controller, uint8_t *hysteresis)
Get the autofeature hysteresis default.
std::uint32_t minor
Major.
Definition: peak_afl.hpp:70
peak_afl Double Limit
Definition: peak_afl.h:388
peak_afl_status peak_afl_AutoController_AutoTolerance_Set(peak_afl_controller_handle controller, uint32_t tolerance)
Set the auto tolerance for a controller.
bool IsROIPresetSupported() const
Check if ROI preset is supported for a controller.
Definition: peak_afl.hpp:1583
void SetLimit(peak_afl_controller_limit limit)
Set the autofeature limit for a controller.
Definition: peak_afl.hpp:2076
peak_afl Focus Rectangle
Definition: peak_afl.h:356
peak_afl_status peak_afl_AutoController_BrightnessComponent_Callback_Set(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_callback_type type, void *funcPtr, void *context)
Set a callback for a controller component.
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_GetList(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm *typeList, uint32_t *listSize)
Get the list of supported sharpness algorithms for a controller.
peak_afl_size GetWeightedROIMinSize() const
Get the autofeature minimum size of weighted region of interest for a controller. ...
Definition: peak_afl.hpp:2031
peak_afl_status peak_afl_AutoController_BrightnessComponent_Status(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_status *status)
Get the status for a controller component.
uint32_t Subminor() const
Returns the subminor part of the version which is the third part of the version scheme separated by d...
Definition: peak_afl.hpp:108
void AddController(const std::shared_ptr< Controller > &controller)
Add a controller to an automanager.
Definition: peak_afl.hpp:1328
void SetGainIPL(const peak::ipl::Gain &gain)
Sets the ipl gain.
Definition: peak_afl.hpp:1430
void SetGainLimit(peak_afl_double_limit limit)
Set the gain limit for a controller.
Definition: peak_afl.hpp:2223
double GetAutoPercentile() const
Get the auto percentile for a controller.
Definition: peak_afl.hpp:1777
void Process(const peak::ipl::Image &image) const
Process an image.
Definition: peak_afl.hpp:1367
Range< std::uint32_t > GetAutoToleranceRange() const
Get the auto tolerance range for a controller.
Definition: peak_afl.hpp:1745
peak_afl_status peak_afl_AutoController_AutoTolerance_Get(peak_afl_controller_handle controller, uint32_t *tolerance)
Get the current auto tolerance for a controller.
Invalid Parameter.
Definition: peak_afl.h:99
peak_afl_status peak_afl_AutoController_Weighted_ROI_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if weighted region of interest is supported for a controller.
peak_afl_status peak_afl_AutoController_Create(peak_afl_controller_handle *controller, peak_afl_controllerType controllerType)
Create a new controller.
peak_afl_status peak_afl_AutoController_BrightnessComponent_Mode_Set(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_automode mode)
Set the autofeature mode for a brightness component.
peak_afl_controller_status
controller status
Definition: peak_afl.h:159
peak_afl_status peak_afl_AutoFeatureManager_Process(peak_afl_manager_handle handle, PEAK_IPL_IMAGE_HANDLE imageHandle)
Process an image.
peak_afl_status peak_afl_AutoController_Hysteresis_Get(peak_afl_controller_handle controller, uint8_t *hysteresis)
Get the autofeature hysteresis for a controller.
Busy.
Definition: peak_afl.h:105
peak_afl_status peak_afl_AutoController_AutoTolerance_GetRange(peak_afl_controller_handle controller, uint32_t *min, uint32_t *max, uint32_t *inc)
Get the auto tolerance range for a controller.
void * peak_afl_controller_handle
opaque controller handle type
Definition: peak_afl.h:49
bool IsAutoPercentileSupported() const
check if auto percentile is supported for a controller.
Definition: peak_afl.hpp:1756
peak_afl_status peak_afl_GetLastError(peak_afl_status *lastErrorCode, char *lastErrorMessage, size_t *lastErrorMessageSize)
Get the last error message.
peak_afl_status peak_afl_AutoController_Algorithm_GetList(peak_afl_controller_handle controller, peak_afl_controller_algorithm *typeList, uint32_t *listSize)
Get the list of supported algorithms for a controller.
void DestroyAllController()
Destroy all controllers for a manager.
Definition: peak_afl.hpp:1393
peak_afl_status peak_afl_AutoController_Hysteresis_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if hysteresis is supported for a controller.
peak_afl_controllerType
controller types
Definition: peak_afl.h:124
peak_afl_status peak_afl_AutoController_Mode_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if auto mode is supported for a controller.
peak_afl_controller_brightness_component
controller brightness component
Definition: peak_afl.h:231
Controller callback type finished.
Definition: peak_afl.h:264
Range< double > GetAutoPercentileRange() const
Get the auto percentile range for a controller.
Definition: peak_afl.hpp:1788
peak_afl_status peak_afl_AutoController_AutoPercentile_Set(peak_afl_controller_handle controller, double percentile)
Set the auto percentile for a controller.
peak_afl_status peak_afl_AutoController_Hysteresis_Set(peak_afl_controller_handle controller, uint8_t hysteresis)
Set the autofeature hysteresis for a controller.
~Manager()
Destructor of an automanager instance.
Definition: peak_afl.hpp:1290
bool Status() const
Get the status of a manager.
Definition: peak_afl.hpp:1439
bool IsSkipFramesSupported() const
Check if skip frames is supported for a controller.
Definition: peak_afl.hpp:1506
peak_afl_status peak_afl_AutoFeatureManager_DestroyController(peak_afl_manager_handle handle, peak_afl_controller_handle controller)
Destroy a controller.