IDS peak AFL v1.4.0
Loading...
Searching...
No Matches
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
56namespace peak
57{
58namespace afl
59{
60namespace library
61{
62
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
137inline void Init();
138
152inline void Exit();
153
161PEAK_AFL_NO_DISCARD inline std::string GetLastError();
162
175PEAK_AFL_NO_DISCARD inline Version_t Version();
176} // namespace library
177
178namespace error
179{
180
181
186class Exception : public std::exception
187{
188public:
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
271private:
272 peak_afl_status m_code{};
273 std::string m_text{};
274};
275} // namespace error
276
277class Controller;
278
284{
285public:
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
422private:
423 std::vector<std::shared_ptr<Controller>> m_controllerList;
424 mutable std::mutex m_mutex{};
425 peak_afl_manager_handle m_handle{};
426};
427
437template<typename... ControllerTypes>
438std::tuple<Manager, std::vector<std::shared_ptr<Controller>>>
439CreateManager(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
459template <typename T, typename std::enable_if_t<std::is_arithmetic<T>::value, int> = 0>
460struct Range
461{
462 T min;
463 T max;
464 T inc;
465};
466
467namespace callback
468{
469using FinishedCallback = std::function<void(void)>;
470using DataProcessingCallback = std::function<void(int, int)>;
471using ComponentCallback = std::function<void(void)>;
472
473using RegisterFunction = std::function<PEAK_AFL_API_STATUS(void*, void*)>;
474using UnRegisterFunction = std::function<void()>;
475}
476
481class 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
536public:
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
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
965
970 inline void RegisterDataProcessingCallback(const callback::DataProcessingCallback& callback);
971
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
1139
1149
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
1204
1212 inline void SetExposureLimit(peak_afl_double_limit limit);
1213
1222
1223
1224private:
1225 using FinishedCallbackType = Callback<callback::FinishedCallback>;
1226 using DataProcessingCallbackType = Callback<callback::DataProcessingCallback>;
1227 using ComponentCallbackType = Callback<callback::ComponentCallback>;
1228
1229 peak_afl_controller_handle m_handle{};
1230 std::unique_ptr<FinishedCallbackType> m_finishedCallback{};
1231 std::unique_ptr<DataProcessingCallbackType> m_dataProcessingCallback{};
1232 std::unique_ptr<ComponentCallbackType> m_finishedExposureCallback{};
1233 std::unique_ptr<ComponentCallbackType> m_finishedGainCallback{};
1234};
1235
1236namespace library
1237{
1238inline void Init()
1239{
1240 const auto ret = peak_afl_Init();
1241 if (ret != PEAK_AFL_STATUS_SUCCESS)
1242
1243 {
1244 throw error::Exception(ret, false);
1245 }
1246}
1247
1248inline void Exit()
1249{
1250 const auto ret = peak_afl_Exit();
1251 if (ret != PEAK_AFL_STATUS_SUCCESS)
1252 {
1253 throw error::Exception(ret, false);
1254 }
1255}
1256
1258{
1259 Version_t version{};
1260
1261 const auto ret = peak_afl_GetVersion(&version.major, &version.minor, &version.subminor, &version.patch);
1262 if (ret != PEAK_AFL_STATUS_SUCCESS)
1263 {
1264 throw error::Exception(ret, false);
1265 }
1266
1267 return version;
1268}
1269
1270inline std::string GetLastError()
1271{
1272 std::size_t lastErrorMessageSize;
1273 peak_afl_status code;
1274
1275 auto ret = peak_afl_GetLastError(&code, nullptr, &lastErrorMessageSize);
1276 if (ret != PEAK_AFL_STATUS_SUCCESS)
1277 {
1278 return "Cannot get last error!";
1279 }
1280
1281 std::vector<char> text;
1282 text.resize(lastErrorMessageSize);
1283
1284 ret = peak_afl_GetLastError(&code, text.data(), &lastErrorMessageSize);
1285 if (ret != PEAK_AFL_STATUS_SUCCESS)
1286 {
1287 return "Cannot get last error!";
1288 }
1289
1290 return { text.begin(), text.end() };
1291}
1292} // namespace library
1293
1294inline Manager::Manager(const std::shared_ptr<peak::core::NodeMap>& node_map)
1295{
1296 if(!node_map)
1297 {
1298 throw std::runtime_error("Invalid node map handle!");
1299 }
1300
1301 const auto ret = peak_afl_AutoFeatureManager_Create(&m_handle, node_map->Handle());
1302 if (ret != PEAK_AFL_STATUS_SUCCESS)
1303 {
1304 throw error::Exception(ret);
1305 }
1306}
1307
1309{
1310 if (m_handle != nullptr)
1311 {
1313
1314 {
1315 std::lock_guard<std::mutex> lck(m_mutex);
1316 for (auto& c : m_controllerList)
1317 {
1318 c->m_handle = nullptr;
1319 }
1320 }
1321
1323 m_handle = nullptr;
1324 }
1325}
1326
1327inline Manager::Manager(Manager&& other) noexcept {
1328 m_handle = other.m_handle;
1329 other.m_handle = nullptr;
1330
1331 std::lock_guard<std::mutex> lck(other.m_mutex);
1332 m_controllerList = std::move(other.m_controllerList);
1333}
1334
1335inline Manager& Manager::operator=(Manager&& other) noexcept
1336{
1337 m_handle = other.m_handle;
1338 other.m_handle = nullptr;
1339
1340 std::lock_guard<std::mutex> lck(other.m_mutex);
1341 m_controllerList = std::move(other.m_controllerList);
1342
1343 return *this;
1344}
1345
1346inline void Manager::AddController(const std::shared_ptr<Controller>& controller)
1347{
1348 std::lock_guard<std::mutex> lck(m_mutex);
1349
1350 auto cnt = std::any_of(m_controllerList.begin(), m_controllerList.end(), [controller](const std::shared_ptr<Controller>& c) {
1351 return c == controller;
1352 });
1353
1354 if(cnt)
1355 {
1356 return;
1357 }
1358
1359 const auto ret = peak_afl_AutoFeatureManager_AddController(m_handle, controller->m_handle);
1360 if (ret != PEAK_AFL_STATUS_SUCCESS)
1361 {
1362 throw error::Exception(ret);
1363 }
1364
1365 m_controllerList.emplace_back(controller);
1366}
1367
1368inline void Manager::RemoveController(const std::shared_ptr<Controller>& controller)
1369{
1370 std::lock_guard<std::mutex> lck(m_mutex);
1371
1372 const auto ret = peak_afl_AutoFeatureManager_RemoveController(m_handle, controller->m_handle);
1373 if (ret != PEAK_AFL_STATUS_SUCCESS)
1374 {
1375 throw error::Exception(ret);
1376 }
1377
1378 auto it = std::remove_if(m_controllerList.begin(), m_controllerList.end(), [controller](const std::shared_ptr<Controller>& c) {
1379 return c == controller;
1380 });
1381
1382 m_controllerList.erase(it, m_controllerList.end());
1383}
1384
1385inline void Manager::Process(const peak::ipl::Image& image) const
1386{
1387 const auto ret = peak_afl_AutoFeatureManager_Process(m_handle, ImageBackendAccessor::BackendHandle(image));
1388 if (ret != PEAK_AFL_STATUS_SUCCESS)
1389 {
1390 throw error::Exception(ret);
1391 }
1392}
1393
1394inline std::shared_ptr<Controller> Manager::CreateController(peak_afl_controllerType type)
1395{
1396 std::lock_guard<std::mutex> lck(m_mutex);
1397
1399 const auto ret = peak_afl_AutoFeatureManager_CreateController(m_handle, &handle, type);
1400 if (ret != PEAK_AFL_STATUS_SUCCESS)
1401 {
1402 throw error::Exception(ret);
1403 }
1404
1405 auto shared = std::shared_ptr<Controller>(new Controller(handle));
1406 m_controllerList.emplace_back(shared);
1407
1408 return shared;
1409}
1410
1412{
1413 std::lock_guard<std::mutex> lck(m_mutex);
1414
1415 const auto ret = peak_afl_AutoFeatureManager_DestroyAllController(m_handle);
1416 if (ret != PEAK_AFL_STATUS_SUCCESS)
1417 {
1418 throw error::Exception(ret);
1419 }
1420
1421 for(auto& c : m_controllerList)
1422 {
1423 c->m_handle = nullptr;
1424 }
1425
1426 m_controllerList.clear();
1427}
1428
1429inline void Manager::DestroyController(const std::shared_ptr<Controller>& controller)
1430{
1431 std::lock_guard<std::mutex> lck(m_mutex);
1432
1433 const auto ret = peak_afl_AutoFeatureManager_DestroyController(m_handle, controller->m_handle);
1434 if (ret != PEAK_AFL_STATUS_SUCCESS)
1435 {
1436 throw error::Exception(ret);
1437 }
1438
1439 auto it = std::remove_if(m_controllerList.begin(), m_controllerList.end(), [controller](const std::shared_ptr<Controller>& c) {
1440 return c == controller;
1441 });
1442
1443 m_controllerList.erase(it, m_controllerList.end());
1444
1445 controller->m_handle = nullptr;
1446}
1447
1448inline void Manager::SetGainIPL(const peak::ipl::Gain& gain)
1449{
1450 const auto ret = peak_afl_AutoFeatureManager_SetGainIPL(m_handle, GainBackendAccessor::BackendHandle(gain));
1451 if (ret != PEAK_AFL_STATUS_SUCCESS)
1452 {
1453 throw error::Exception(ret);
1454 }
1455}
1456
1457inline bool Manager::Status() const
1458{
1459 std::uint8_t status;
1460 const auto ret = peak_afl_AutoFeatureManager_Status(m_handle, &status);
1461 if (ret != PEAK_AFL_STATUS_SUCCESS)
1462 {
1463 throw error::Exception(ret);
1464 }
1465
1466 return status;
1467}
1468
1469inline std::vector<std::shared_ptr<Controller>> Manager::ControllerList() const
1470{
1471 std::lock_guard<std::mutex> lck(m_mutex);
1472
1473 std::vector<std::shared_ptr<Controller>> controller{};
1474
1475 std::copy(m_controllerList.begin(), m_controllerList.end(), std::back_inserter(controller));
1476
1477 return controller;
1478}
1479
1480inline size_t Manager::ControllerCount() const
1481{
1482 return m_controllerList.size();
1483}
1484
1485inline std::shared_ptr<Controller> Manager::GetController(peak_afl_controllerType type) const
1486{
1487 std::lock_guard<std::mutex> lck(m_mutex);
1488
1489 auto it = std::find_if(m_controllerList.cbegin(), m_controllerList.cend(), [=](const std::shared_ptr<Controller>& controller) {
1490 return type == controller->Type();
1491 });
1492
1493 if(it != m_controllerList.cend())
1494 {
1495 return *it;
1496 }
1497 else
1498 {
1500 }
1501}
1502
1503inline std::shared_ptr<Controller> Controller::Create(peak_afl_controllerType type)
1504{
1506 const auto ret = peak_afl_AutoController_Create(&handle, type);
1507 if (ret != PEAK_AFL_STATUS_SUCCESS)
1508 {
1509 throw error::Exception(ret);
1510 }
1511
1512 return std::shared_ptr<Controller>(new Controller(handle));
1513}
1514
1516{
1517 if (m_handle != nullptr)
1518 {
1520 m_handle = nullptr;
1521 }
1522}
1523
1525{
1526 peak_afl_BOOL8 supported{};
1527 const auto ret = peak_afl_AutoController_SkipFrames_IsSupported(m_handle, &supported);
1528 if (ret != PEAK_AFL_STATUS_SUCCESS)
1529 {
1530 throw error::Exception(ret);
1531 }
1532
1533 return supported;
1534}
1535
1536inline void Controller::SetSkipFrames(std::uint32_t count)
1537{
1538 const auto ret = peak_afl_AutoController_SkipFrames_Set(m_handle, count);
1539 if (ret != PEAK_AFL_STATUS_SUCCESS)
1540 {
1541 throw error::Exception(ret);
1542 }
1543}
1544
1545inline std::uint32_t Controller::GetSkipFrames() const
1546{
1547 std::uint32_t count{};
1548 const auto ret = peak_afl_AutoController_SkipFrames_Get(m_handle, &count);
1549 if (ret != PEAK_AFL_STATUS_SUCCESS)
1550 {
1551 throw error::Exception(ret);
1552 }
1553
1554 return count;
1555}
1556
1558{
1559 Range<std::uint32_t> range{};
1560 const auto ret = peak_afl_AutoController_SkipFrames_GetRange(m_handle, &range.min, &range.max, &range.inc);
1561 if (ret != PEAK_AFL_STATUS_SUCCESS)
1562 {
1563 throw error::Exception(ret);
1564 }
1565
1566 return range;
1567}
1568
1570{
1571 peak_afl_BOOL8 supported{};
1572 const auto ret = peak_afl_AutoController_ROI_IsSupported(m_handle, &supported);
1573 if (ret != PEAK_AFL_STATUS_SUCCESS)
1574 {
1575 throw error::Exception(ret);
1576 }
1577
1578 return supported;
1579}
1580
1582{
1583 const auto ret = peak_afl_AutoController_ROI_Set(m_handle, rect);
1584 if (ret != PEAK_AFL_STATUS_SUCCESS)
1585 {
1586 throw error::Exception(ret);
1587 }
1588}
1589
1591{
1592 peak_afl_rectangle rect{};
1593 const auto ret = peak_afl_AutoController_ROI_Get(m_handle, &rect);
1594 if (ret != PEAK_AFL_STATUS_SUCCESS)
1595 {
1596 throw error::Exception(ret);
1597 }
1598 return rect;
1599}
1600
1602{
1603 peak_afl_BOOL8 supported{};
1604 const auto ret = peak_afl_AutoController_ROI_Preset_IsSupported(m_handle, &supported);
1605 if (ret != PEAK_AFL_STATUS_SUCCESS)
1606 {
1607 throw error::Exception(ret);
1608 }
1609
1610 return supported;
1611}
1612
1614{
1615 const auto ret = peak_afl_AutoController_ROI_Preset_Set(m_handle, preset);
1616 if (ret != PEAK_AFL_STATUS_SUCCESS)
1617 {
1618 throw error::Exception(ret);
1619 }
1620}
1621
1623{
1624 peak_afl_BOOL8 supported{};
1625 const auto ret = peak_afl_AutoController_Mode_IsSupported(m_handle, &supported);
1626 if (ret != PEAK_AFL_STATUS_SUCCESS)
1627 {
1628 throw error::Exception(ret);
1629 }
1630
1631 return supported;
1632}
1633
1635{
1636 const auto ret = peak_afl_AutoController_Mode_Set(m_handle, mode);
1637 if (ret != PEAK_AFL_STATUS_SUCCESS)
1638 {
1639 throw error::Exception(ret);
1640 }
1641}
1642
1644{
1646 const auto ret = peak_afl_AutoController_Mode_Get(m_handle, &mode);
1647 if (ret != PEAK_AFL_STATUS_SUCCESS)
1648 {
1649 throw error::Exception(ret);
1650 }
1651 return mode;
1652}
1653
1655{
1657 const auto ret = peak_afl_AutoController_Status(m_handle, &status);
1658 if (ret != PEAK_AFL_STATUS_SUCCESS)
1659 {
1660 throw error::Exception(ret);
1661 }
1662 return status;
1663}
1664
1665
1666inline std::uint8_t Controller::GetLastAutoAverage() const
1667{
1668 std::uint8_t average{};
1669 const auto ret = peak_afl_AutoController_GetLastAutoAverage(m_handle, &average);
1670 if (ret != PEAK_AFL_STATUS_SUCCESS)
1671 {
1672 throw error::Exception(ret);
1673 }
1674 return average;
1675}
1676
1677inline std::tuple<std::uint8_t, std::uint8_t, std::uint8_t> Controller::GetLastAutoAverages() const
1678{
1679 std::uint8_t averageRed{}, averageGreen{}, averageBlue{};
1680 const auto ret = peak_afl_AutoController_GetLastAutoAverages(m_handle, &averageRed, &averageGreen, &averageBlue);
1681 if (ret != PEAK_AFL_STATUS_SUCCESS)
1682 {
1683 throw error::Exception(ret);
1684 }
1685 return { averageRed, averageGreen, averageBlue };
1686}
1687
1689{
1690 peak_afl_BOOL8 supported{};
1691 const auto ret = peak_afl_AutoController_AutoTarget_IsSupported(m_handle, &supported);
1692 if (ret != PEAK_AFL_STATUS_SUCCESS)
1693 {
1694 throw error::Exception(ret);
1695 }
1696
1697 return supported;
1698}
1699
1700inline void Controller::SetAutoTarget(std::uint32_t target)
1701{
1702 const auto ret = peak_afl_AutoController_AutoTarget_Set(m_handle, target);
1703 if (ret != PEAK_AFL_STATUS_SUCCESS)
1704 {
1705 throw error::Exception(ret);
1706 }
1707}
1708
1709inline std::uint32_t Controller::GetAutoTarget() const
1710{
1711 std::uint32_t target{};
1712 const auto ret = peak_afl_AutoController_AutoTarget_Get(m_handle, &target);
1713 if (ret != PEAK_AFL_STATUS_SUCCESS)
1714 {
1715 throw error::Exception(ret);
1716 }
1717 return target;
1718}
1719
1721{
1722 Range<std::uint32_t> range{};
1723 const auto ret = peak_afl_AutoController_AutoTarget_GetRange(m_handle, &range.min, &range.max, &range.inc);
1724 if (ret != PEAK_AFL_STATUS_SUCCESS)
1725 {
1726 throw error::Exception(ret);
1727 }
1728 return range;
1729}
1730
1732{
1733 peak_afl_BOOL8 supported{};
1734 const auto ret = peak_afl_AutoController_AutoTolerance_IsSupported(m_handle, &supported);
1735 if (ret != PEAK_AFL_STATUS_SUCCESS)
1736 {
1737 throw error::Exception(ret);
1738 }
1739
1740 return supported;
1741}
1742
1743inline void Controller::SetAutoTolerance(uint32_t tolerance)
1744{
1745 const auto ret = peak_afl_AutoController_AutoTolerance_Set(m_handle, tolerance);
1746 if (ret != PEAK_AFL_STATUS_SUCCESS)
1747 {
1748 throw error::Exception(ret);
1749 }
1750}
1751
1752inline uint32_t Controller::GetAutoTolerance() const
1753{
1754 std::uint32_t tolerance;
1755 const auto ret = peak_afl_AutoController_AutoTolerance_Get(m_handle, &tolerance);
1756 if (ret != PEAK_AFL_STATUS_SUCCESS)
1757 {
1758 throw error::Exception(ret);
1759 }
1760 return tolerance;
1761}
1762
1764{
1765 Range<uint32_t> range{};
1766 const auto ret = peak_afl_AutoController_AutoTolerance_GetRange(m_handle, &range.min, &range.max, &range.inc);
1767 if (ret != PEAK_AFL_STATUS_SUCCESS)
1768 {
1769 throw error::Exception(ret);
1770 }
1771 return range;
1772}
1773
1775{
1776 peak_afl_BOOL8 supported{};
1777 const auto ret = peak_afl_AutoController_AutoPercentile_IsSupported(m_handle, &supported);
1778 if (ret != PEAK_AFL_STATUS_SUCCESS)
1779 {
1780 throw error::Exception(ret);
1781 }
1782
1783 return supported;
1784}
1785
1786inline void Controller::SetAutoPercentile(double percentile)
1787{
1788 const auto ret = peak_afl_AutoController_AutoPercentile_Set(m_handle, percentile);
1789 if (ret != PEAK_AFL_STATUS_SUCCESS)
1790 {
1791 throw error::Exception(ret);
1792 }
1793}
1794
1796{
1797 double percentile;
1798 const auto ret = peak_afl_AutoController_AutoPercentile_Get(m_handle, &percentile);
1799 if (ret != PEAK_AFL_STATUS_SUCCESS)
1800 {
1801 throw error::Exception(ret);
1802 }
1803 return percentile;
1804}
1805
1807{
1808 Range<double> range{};
1809 const auto ret = peak_afl_AutoController_AutoPercentile_GetRange(m_handle, &range.min, &range.max, &range.inc);
1810 if (ret != PEAK_AFL_STATUS_SUCCESS)
1811 {
1812 throw error::Exception(ret);
1813 }
1814 return range;
1815}
1816
1818{
1820 const auto ret = peak_afl_AutoController_Type_Get(m_handle, &type);
1821 if (ret != PEAK_AFL_STATUS_SUCCESS)
1822 {
1823 throw error::Exception(ret);
1824 }
1825 return type;
1826}
1827
1829{
1830 peak_afl_BOOL8 supported{};
1831 const auto ret = peak_afl_AutoController_Algorithm_IsSupported(m_handle, &supported);
1832 if (ret != PEAK_AFL_STATUS_SUCCESS)
1833 {
1834 throw error::Exception(ret);
1835 }
1836
1837 return supported;
1838}
1839
1841{
1842 const auto ret = peak_afl_AutoController_Algorithm_Set(m_handle, alg);
1843 if (ret != PEAK_AFL_STATUS_SUCCESS)
1844 {
1845 throw error::Exception(ret);
1846 }
1847}
1848
1850{
1852 const auto ret = peak_afl_AutoController_Algorithm_Get(m_handle, &alg);
1853 if (ret != PEAK_AFL_STATUS_SUCCESS)
1854 {
1855 throw error::Exception(ret);
1856 }
1857
1858 return alg;
1859}
1860
1861inline std::vector<peak_afl_controller_algorithm> Controller::GetAlgorithmList() const
1862{
1863 std::vector<peak_afl_controller_algorithm> algList{};
1864 std::uint32_t listSize{};
1865
1866 auto ret = peak_afl_AutoController_Algorithm_GetList(m_handle, nullptr, &listSize);
1867 if (ret != PEAK_AFL_STATUS_SUCCESS)
1868 {
1869 throw error::Exception(ret);
1870 }
1871
1872 algList.resize(listSize);
1873
1874 ret = peak_afl_AutoController_Algorithm_GetList(m_handle, algList.data(), &listSize);
1875 if (ret != PEAK_AFL_STATUS_SUCCESS)
1876 {
1877 throw error::Exception(ret);
1878 }
1879
1880 return algList;
1881}
1882
1884{
1885 peak_afl_BOOL8 supported{};
1886 const auto ret = peak_afl_AutoController_SharpnessAlgorithm_IsSupported(m_handle, &supported);
1887 if (ret != PEAK_AFL_STATUS_SUCCESS)
1888 {
1889 throw error::Exception(ret);
1890 }
1891
1892 return supported;
1893}
1894
1896{
1897 const auto ret = peak_afl_AutoController_SharpnessAlgorithm_Set(m_handle, alg);
1898 if (ret != PEAK_AFL_STATUS_SUCCESS)
1899 {
1900 throw error::Exception(ret);
1901 }
1902}
1903
1905{
1907 const auto ret = peak_afl_AutoController_SharpnessAlgorithm_Get(m_handle, &alg);
1908 if (ret != PEAK_AFL_STATUS_SUCCESS)
1909 {
1910 throw error::Exception(ret);
1911 }
1912
1913 return alg;
1914}
1915
1916inline std::vector<peak_afl_controller_sharpness_algorithm> Controller::GetSharpnessAlgorithmList() const
1917{
1918 std::vector<peak_afl_controller_sharpness_algorithm> algList{};
1919 std::uint32_t listSize{};
1920
1921 auto ret = peak_afl_AutoController_SharpnessAlgorithm_GetList(m_handle, nullptr, &listSize);
1922 if (ret != PEAK_AFL_STATUS_SUCCESS)
1923 {
1924 throw error::Exception(ret);
1925 }
1926
1927 algList.resize(listSize);
1928
1929 ret = peak_afl_AutoController_SharpnessAlgorithm_GetList(m_handle, algList.data(), &listSize);
1930 if (ret != PEAK_AFL_STATUS_SUCCESS)
1931 {
1932 throw error::Exception(ret);
1933 }
1934
1935 return algList;
1936}
1937
1938inline void Controller::RegisterFinishedCallback(const callback::FinishedCallback& callback)
1939{
1940 m_finishedCallback = std::make_unique<FinishedCallbackType>(shared_from_this(),
1941 [handle = m_handle](void* ptr, void* ctx) {
1943 [handle = m_handle] {
1945 callback);
1946}
1947
1949{
1950 m_finishedCallback.reset();
1951}
1952
1953inline void Controller::RegisterComponentCallback(peak_afl_controller_brightness_component component, const callback::FinishedCallback& callback)
1954{
1956 {
1958 }
1959
1961 {
1962 m_finishedExposureCallback = std::make_unique<ComponentCallbackType>(shared_from_this(),
1963 [handle = m_handle, component](void* ptr, void* ctx) {
1965 ptr, ctx); },
1966 [handle = m_handle, component] {
1968 nullptr, nullptr); },
1969 callback);
1970 }
1972 {
1973 m_finishedGainCallback = std::make_unique<ComponentCallbackType>(shared_from_this(),
1974 [handle = m_handle, component](void* ptr, void* ctx) {
1976 ptr, ctx); },
1977 [handle = m_handle, component] {
1979 nullptr, nullptr); },
1980 callback);
1981 }
1982 else
1983 {
1985 }
1986}
1987
1989{
1991 {
1992 m_finishedExposureCallback.reset();
1993 }
1995 {
1996 m_finishedGainCallback.reset();
1997 }
1998 else
1999 {
2001 }
2002}
2003
2004inline void Controller::RegisterDataProcessingCallback(const callback::DataProcessingCallback& callback)
2005{
2006 m_dataProcessingCallback = std::make_unique<DataProcessingCallbackType>(shared_from_this(),
2007 [handle = m_handle](void* ptr, void* ctx) {
2009 [handle = m_handle] {
2011 callback);
2012}
2013
2015{
2016 m_dataProcessingCallback.reset();
2017}
2018
2020{
2021 peak_afl_BOOL8 supported{};
2022 const auto ret = peak_afl_AutoController_Weighted_ROI_IsSupported(m_handle, &supported);
2023 if (ret != PEAK_AFL_STATUS_SUCCESS)
2024 {
2025 throw error::Exception(ret);
2026 }
2027
2028 return supported;
2029}
2030
2031inline void Controller::SetWeightedROIs(const std::vector<peak_afl_weighted_rectangle>& list)
2032{
2033 const auto ret = peak_afl_AutoController_Weighted_ROI_Set(m_handle, list.data(), static_cast<uint32_t>(list.size()));
2034 if (ret != PEAK_AFL_STATUS_SUCCESS)
2035 {
2036 throw error::Exception(ret);
2037 }
2038}
2039
2041{
2042 const auto ret = peak_afl_AutoController_Weighted_ROI_Set(m_handle, &rect, 1);
2043 if (ret != PEAK_AFL_STATUS_SUCCESS)
2044 {
2045 throw error::Exception(ret);
2046 }
2047}
2048
2050{
2051 peak_afl_size minSize{};
2052 const auto ret = peak_afl_AutoController_Weighted_ROI_Min_Size(m_handle, &minSize);
2053 if (ret != PEAK_AFL_STATUS_SUCCESS)
2054 {
2055 throw error::Exception(ret);
2056 }
2057 return minSize;
2058}
2059
2060inline std::vector<peak_afl_weighted_rectangle> Controller::GetWeightedROIs() const
2061{
2062 std::vector<peak_afl_weighted_rectangle> list;
2063 std::uint32_t listSize{};
2064
2065 auto ret = peak_afl_AutoController_Weighted_ROI_Get(m_handle, nullptr, &listSize);
2066 if (ret != PEAK_AFL_STATUS_SUCCESS)
2067 {
2068 throw error::Exception(ret);
2069 }
2070
2071 list.resize(listSize);
2072
2073 ret = peak_afl_AutoController_Weighted_ROI_Get(m_handle, list.data(), &listSize);
2074 if (ret != PEAK_AFL_STATUS_SUCCESS)
2075 {
2076 throw error::Exception(ret);
2077 }
2078
2079 return list;
2080}
2081
2083{
2084 peak_afl_BOOL8 supported{};
2085 const auto ret = peak_afl_AutoController_Limit_IsSupported(m_handle, &supported);
2086 if (ret != PEAK_AFL_STATUS_SUCCESS)
2087 {
2088 throw error::Exception(ret);
2089 }
2090
2091 return supported;
2092}
2093
2095{
2096 const auto ret = peak_afl_AutoController_Limit_Set(m_handle, limit);
2097 if (ret != PEAK_AFL_STATUS_SUCCESS)
2098 {
2099 throw error::Exception(ret);
2100 }
2101}
2102
2104{
2106 const auto ret = peak_afl_AutoController_Limit_Get(m_handle, &limit);
2107 if (ret != PEAK_AFL_STATUS_SUCCESS)
2108 {
2109 throw error::Exception(ret);
2110 }
2111 return limit;
2112}
2113
2115{
2117 const auto ret = peak_afl_AutoController_Limit_Default(m_handle, &limit);
2118 if (ret != PEAK_AFL_STATUS_SUCCESS)
2119 {
2120 throw error::Exception(ret);
2121 }
2122 return limit;
2123}
2124
2126{
2127 peak_afl_BOOL8 supported{};
2128 const auto ret = peak_afl_AutoController_Hysteresis_IsSupported(m_handle, &supported);
2129 if (ret != PEAK_AFL_STATUS_SUCCESS)
2130 {
2131 throw error::Exception(ret);
2132 }
2133
2134 return supported;
2135}
2136
2137inline void Controller::SetHysteresis(std::uint8_t hysteresis)
2138{
2139 const auto ret = peak_afl_AutoController_Hysteresis_Set(m_handle, hysteresis);
2140 if (ret != PEAK_AFL_STATUS_SUCCESS)
2141 {
2142 throw error::Exception(ret);
2143 }
2144}
2145
2146inline std::uint8_t Controller::GetHysteresis() const
2147{
2148 std::uint8_t hysteresis{};
2149 const auto ret = peak_afl_AutoController_Hysteresis_Get(m_handle, &hysteresis);
2150 if (ret != PEAK_AFL_STATUS_SUCCESS)
2151 {
2152 throw error::Exception(ret);
2153 }
2154
2155 return hysteresis;
2156}
2157
2158inline std::uint8_t Controller::GetDefaultHysteresis() const
2159{
2160 std::uint8_t hysteresis{};
2161 const auto ret = peak_afl_AutoController_Hysteresis_Default(m_handle, &hysteresis);
2162 if (ret != PEAK_AFL_STATUS_SUCCESS)
2163 {
2164 throw error::Exception(ret);
2165 }
2166
2167 return hysteresis;
2168}
2169
2171{
2172 Range<std::uint8_t> hysteresis{};
2174 m_handle, &hysteresis.min, &hysteresis.max, &hysteresis.inc);
2175 if (ret != PEAK_AFL_STATUS_SUCCESS)
2176 {
2177 throw error::Exception(ret);
2178 }
2179
2180 return hysteresis;
2181}
2182
2183PEAK_AFL_NO_DISCARD inline bool Controller::IsBrightnessComponentModeSupported() const
2184{
2185 peak_afl_BOOL8 supported{};
2186 const auto ret = peak_afl_AutoController_BrightnessComponent_Mode_IsSupported(m_handle, &supported);
2187 if (ret != PEAK_AFL_STATUS_SUCCESS)
2188 {
2189 throw error::Exception(ret);
2190 }
2191
2192 return supported;
2193}
2194
2197{
2198 const auto ret = peak_afl_AutoController_BrightnessComponent_Mode_Set(m_handle, component, mode);
2199 if (ret != PEAK_AFL_STATUS_SUCCESS)
2200 {
2201 throw error::Exception(ret);
2202 }
2203}
2204
2207{
2209 const auto ret = peak_afl_AutoController_BrightnessComponent_Mode_Get(m_handle, component, &mode);
2210 if (ret != PEAK_AFL_STATUS_SUCCESS)
2211 {
2212 throw error::Exception(ret);
2213 }
2214 return mode;
2215}
2216
2219{
2221 const auto ret = peak_afl_AutoController_BrightnessComponent_Status(m_handle, component, &status);
2222 if (ret != PEAK_AFL_STATUS_SUCCESS)
2223 {
2224 throw error::Exception(ret);
2225 }
2226 return status;
2227}
2228
2230{
2231 peak_afl_BOOL8 supported{};
2232 const auto ret = peak_afl_AutoController_GainLimit_IsSupported(m_handle, &supported);
2233 if (ret != PEAK_AFL_STATUS_SUCCESS)
2234 {
2235 throw error::Exception(ret);
2236 }
2237
2238 return supported;
2239}
2240
2242{
2243 const auto ret = peak_afl_AutoController_GainLimit_Set(m_handle, limit);
2244 if (ret == PEAK_AFL_STATUS_VALUE_ADJUSTED)
2245 {
2246 // Do nothing. Not an error.
2247 }
2248 else if (ret != PEAK_AFL_STATUS_SUCCESS)
2249 {
2250 throw error::Exception(ret);
2251 }
2252}
2253
2255{
2256 peak_afl_double_limit limit{};
2257 const auto ret = peak_afl_AutoController_GainLimit_Get(m_handle, &limit);
2258 if (ret != PEAK_AFL_STATUS_SUCCESS)
2259 {
2260 throw error::Exception(ret);
2261 }
2262
2263 return limit;
2264}
2265
2267{
2268 peak_afl_double_limit limit{};
2269 const auto ret = peak_afl_AutoController_GainLimit_GetRange(m_handle, &limit);
2270 if (ret != PEAK_AFL_STATUS_SUCCESS)
2271 {
2272 throw error::Exception(ret);
2273 }
2274
2275 return limit;
2276}
2277
2279{
2280 const auto ret = peak_afl_AutoController_ExposureLimit_Set(m_handle, limit);
2281 if (ret != PEAK_AFL_STATUS_SUCCESS)
2282 {
2283 throw error::Exception(ret);
2284 }
2285}
2286
2288{
2289 peak_afl_double_limit limit{};
2290 const auto ret = peak_afl_AutoController_ExposureLimit_Get(m_handle, &limit);
2291 if (ret != PEAK_AFL_STATUS_SUCCESS)
2292 {
2293 throw error::Exception(ret);
2294 }
2295
2296 return limit;
2297}
2298
2299} /* namespace afl */
2300} /* namespace peak */
Definition peak_afl.hpp:482
PEAK_AFL_NO_DISCARD peak_afl_controllerType Type() const
Get the controller type.
Definition peak_afl.hpp:1817
void SetROIPreset(peak_afl_roi_preset preset)
Set the autofeature region of interest preset for a controller.
Definition peak_afl.hpp:1613
PEAK_AFL_NO_DISCARD bool IsAutoPercentileSupported() const
check if auto percentile is supported for a controller.
Definition peak_afl.hpp:1774
PEAK_AFL_NO_DISCARD bool IsAutoToleranceSupported() const
check if auto tolerance is supported for a controller.
Definition peak_afl.hpp:1731
peak_afl_double_limit GetGainLimit() const
Get autofeature gain limit for a controller.
Definition peak_afl.hpp:2254
void SetGainLimit(peak_afl_double_limit limit)
Set the gain limit for a controller.
Definition peak_afl.hpp:2241
PEAK_AFL_NO_DISCARD std::uint8_t GetDefaultHysteresis() const
Get the autofeature hysteresis default.
Definition peak_afl.hpp:2158
PEAK_AFL_NO_DISCARD std::uint8_t GetHysteresis() const
Get the autofeature hysteresis for a controller.
Definition peak_afl.hpp:2146
void SetMode(peak_afl_controller_automode mode)
Set the autofeature mode for a controller.
Definition peak_afl.hpp:1634
PEAK_AFL_NO_DISCARD bool IsROISupported() const
Check if setting a region of interest is supported for a controller.
Definition peak_afl.hpp:1569
void SetWeightedROIs(const std::vector< peak_afl_weighted_rectangle > &list)
Set the autofeature weighted region of interest for a controller.
Definition peak_afl.hpp:2031
void UnRegisterFinishedCallback()
Reset the finished callback for a controller.
Definition peak_afl.hpp:1948
PEAK_AFL_NO_DISCARD Range< std::uint32_t > GetSkipFramesRange() const
Get range for frames skipped for a controller.
Definition peak_afl.hpp:1557
PEAK_AFL_NO_DISCARD bool IsROIPresetSupported() const
Check if ROI preset is supported for a controller.
Definition peak_afl.hpp:1601
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:2195
PEAK_AFL_NO_DISCARD std::uint8_t GetLastAutoAverage() const
Get the last auto average for a controller.
Definition peak_afl.hpp:1666
PEAK_AFL_NO_DISCARD peak_afl_controller_limit GetLimit() const
Get the autofeature limit for a controller.
Definition peak_afl.hpp:2103
void SetHysteresis(std::uint8_t hysteresis)
Set the autofeature hysteresis for a controller.
Definition peak_afl.hpp:2137
void SetExposureLimit(peak_afl_double_limit limit)
Set the exposure limit for a controller.
Definition peak_afl.hpp:2278
void SetSkipFrames(std::uint32_t count)
Set number of frames skipped for a controller.
Definition peak_afl.hpp:1536
PEAK_AFL_NO_DISCARD std::vector< peak_afl_controller_sharpness_algorithm > GetSharpnessAlgorithmList() const
Get the list of supported sharpness algorithms for a controller.
Definition peak_afl.hpp:1916
PEAK_AFL_NO_DISCARD 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:2205
PEAK_AFL_NO_DISCARD bool IsModeSupported() const
Check if auto mode is supported for a controller.
Definition peak_afl.hpp:1622
PEAK_AFL_NO_DISCARD Range< std::uint32_t > GetAutoToleranceRange() const
Get the auto tolerance range for a controller.
Definition peak_afl.hpp:1763
void SetAutoPercentile(double percentile)
Set the auto percentile for a controller.
Definition peak_afl.hpp:1786
PEAK_AFL_NO_DISCARD peak_afl_rectangle GetROI() const
Get the autofeature region of interest for a controller.
Definition peak_afl.hpp:1590
peak_afl_double_limit GetExposureLimit() const
Get autofeature exposure limit for a controller.
Definition peak_afl.hpp:2287
void UnRegisterDataProcessingCallback()
Reset the finished callback for a controller.
Definition peak_afl.hpp:2014
PEAK_AFL_NO_DISCARD std::vector< peak_afl_controller_algorithm > GetAlgorithmList() const
Get the list of supported algorithms for a controller.
Definition peak_afl.hpp:1861
~Controller()
Definition peak_afl.hpp:1515
void RegisterDataProcessingCallback(const callback::DataProcessingCallback &callback)
Set the data callback for a controller.
Definition peak_afl.hpp:2004
PEAK_AFL_NO_DISCARD bool IsSharpnessAlgorithmSupported() const
check setting a sharpness algorithm is supported by a controller.
Definition peak_afl.hpp:1883
PEAK_AFL_NO_DISCARD peak_afl_controller_status BrightnessComponentStatus(peak_afl_controller_brightness_component component) const
Get the status for a brightness controller component.
Definition peak_afl.hpp:2217
void UnRegisterComponentCallback(peak_afl_controller_brightness_component component)
Reset the component callback for a controller.
Definition peak_afl.hpp:1988
PEAK_AFL_NO_DISCARD 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:1677
PEAK_AFL_NO_DISCARD std::uint32_t GetAutoTolerance() const
Get the current auto tolerance for a controller.
Definition peak_afl.hpp:1752
void SetAlgorithm(peak_afl_controller_algorithm algorithm)
Set the used algorithm for a controller.
Definition peak_afl.hpp:1840
void SetROI(peak_afl_rectangle rect)
Set the autofeature region of interest for a controller.
Definition peak_afl.hpp:1581
PEAK_AFL_NO_DISCARD bool IsSkipFramesSupported() const
Check if skip frames is supported for a controller.
Definition peak_afl.hpp:1524
PEAK_AFL_NO_DISCARD peak_afl_controller_limit GetDefaultLimit() const
Get the autofeature default limit.
Definition peak_afl.hpp:2114
PEAK_AFL_NO_DISCARD bool IsLimitSupported() const
Check if limit is supported for a controller.
Definition peak_afl.hpp:2082
PEAK_AFL_NO_DISCARD peak_afl_size GetWeightedROIMinSize() const
Get the autofeature minimum size of weighted region of interest for a controller.
Definition peak_afl.hpp:2049
PEAK_AFL_NO_DISCARD peak_afl_controller_automode GetMode() const
Get the current autofeature mode for a controller.
Definition peak_afl.hpp:1643
static PEAK_AFL_NO_DISCARD std::shared_ptr< Controller > Create(peak_afl_controllerType type)
Create a new controller.
Definition peak_afl.hpp:1503
void RegisterFinishedCallback(const callback::FinishedCallback &callback)
Set finished callback for a controller.
Definition peak_afl.hpp:1938
PEAK_AFL_NO_DISCARD peak_afl_controller_algorithm GetAlgorithm() const
Get the used algorithm for a controller.
Definition peak_afl.hpp:1849
PEAK_AFL_NO_DISCARD bool IsGainLimitSupported() const
Check if auto gain limit is supported for a controller.
Definition peak_afl.hpp:2229
peak_afl_double_limit GetGainLimitRange() const
Get autofeature gain limit range for a controller.
Definition peak_afl.hpp:2266
void SetWeightedROI(const peak_afl_weighted_rectangle &rect)
Set single autofeature weighted region of interest for a controller.
Definition peak_afl.hpp:2040
PEAK_AFL_NO_DISCARD std::uint32_t GetSkipFrames() const
Get number of frames skipped for a controller.
Definition peak_afl.hpp:1545
PEAK_AFL_NO_DISCARD peak_afl_controller_sharpness_algorithm GetSharpnessAlgorithm() const
Get the used sharpness algorithm for a controller.
Definition peak_afl.hpp:1904
PEAK_AFL_NO_DISCARD peak_afl_controller_status Status() const
Get the status for a controller.
Definition peak_afl.hpp:1654
PEAK_AFL_NO_DISCARD bool IsAlgorithmSupported() const
check if setting an algorithm is supported for a controller.
Definition peak_afl.hpp:1828
PEAK_AFL_NO_DISCARD Range< double > GetAutoPercentileRange() const
Get the auto percentile range for a controller.
Definition peak_afl.hpp:1806
PEAK_AFL_NO_DISCARD double GetAutoPercentile() const
Get the auto percentile for a controller.
Definition peak_afl.hpp:1795
void SetAutoTarget(uint32_t target)
Set the auto target for a controller.
Definition peak_afl.hpp:1700
PEAK_AFL_NO_DISCARD bool IsBrightnessComponentModeSupported() const
Check if auto mode is supported for a brightness controller component.
Definition peak_afl.hpp:2183
void SetAutoTolerance(std::uint32_t tolerance)
Set the auto tolerance for a controller.
Definition peak_afl.hpp:1743
PEAK_AFL_NO_DISCARD std::uint32_t GetAutoTarget() const
Get the currently set auto target for a controller.
Definition peak_afl.hpp:1709
PEAK_AFL_NO_DISCARD Range< std::uint32_t > GetAutoTargetRange() const
Get the auto target range for a controller.
Definition peak_afl.hpp:1720
PEAK_AFL_NO_DISCARD Range< std::uint8_t > GetHysteresisRange() const
Get autofeature hysteresis range for a controller.
Definition peak_afl.hpp:2170
void SetLimit(peak_afl_controller_limit limit)
Set the autofeature limit for a controller.
Definition peak_afl.hpp:2094
PEAK_AFL_NO_DISCARD bool IsWeightedROISupported() const
Check if weighted region of interest is supported for a controller.
Definition peak_afl.hpp:2019
PEAK_AFL_NO_DISCARD bool IsHysteresisSupported() const
Check if hysteresis is supported for a controller.
Definition peak_afl.hpp:2125
void RegisterComponentCallback(peak_afl_controller_brightness_component component, const callback::FinishedCallback &callback)
Set component callback for a controller.
Definition peak_afl.hpp:1953
void SetSharpnessAlgorithm(peak_afl_controller_sharpness_algorithm algorithm)
Set the used sharpness algorithm for a controller.
Definition peak_afl.hpp:1895
PEAK_AFL_NO_DISCARD bool IsAutoTargetSupported() const
check if auto target is supported for a controller.
Definition peak_afl.hpp:1688
PEAK_AFL_NO_DISCARD std::vector< peak_afl_weighted_rectangle > GetWeightedROIs() const
Get the autofeature weighted region of interest for a controller.
Definition peak_afl.hpp:2060
Definition peak_afl.hpp:284
Manager(const std::shared_ptr< peak::core::NodeMap > &node_map)
Create an automanager instance.
Definition peak_afl.hpp:1294
void RemoveController(const std::shared_ptr< Controller > &controller)
Remove a controller from an automanager.
Definition peak_afl.hpp:1368
PEAK_AFL_NO_DISCARD std::shared_ptr< Controller > GetController(peak_afl_controllerType type) const
Get the controller for a type.
Definition peak_afl.hpp:1485
void DestroyAllController()
Destroy all controllers for a manager.
Definition peak_afl.hpp:1411
void DestroyController(const std::shared_ptr< Controller > &controller)
Destroy a controller.
Definition peak_afl.hpp:1429
PEAK_AFL_NO_DISCARD std::shared_ptr< Controller > CreateController(peak_afl_controllerType type)
Create a controller and append it to Manager.
Definition peak_afl.hpp:1394
PEAK_AFL_NO_DISCARD size_t ControllerCount() const
Get the list count of the controller associated with the manager.
Definition peak_afl.hpp:1480
PEAK_AFL_NO_DISCARD bool Status() const
Get the status of a manager.
Definition peak_afl.hpp:1457
~Manager()
Destructor of an automanager instance.
Definition peak_afl.hpp:1308
void SetGainIPL(const peak::ipl::Gain &gain)
Sets the ipl gain.
Definition peak_afl.hpp:1448
PEAK_AFL_NO_DISCARD std::vector< std::shared_ptr< Controller > > ControllerList() const
Get the list of the controller associated with the manager.
Definition peak_afl.hpp:1469
void AddController(const std::shared_ptr< Controller > &controller)
Add a controller to an automanager.
Definition peak_afl.hpp:1346
void Process(const peak::ipl::Image &image) const
Process an image.
Definition peak_afl.hpp:1385
Definition peak_afl.hpp:187
PEAK_AFL_NO_DISCARD const char * what() const noexcept override
Get the string representation for the exception.
Definition peak_afl.hpp:213
static PEAK_AFL_NO_DISCARD std::string translateCode(peak_afl_status status)
Get a string representation for an error code.
Definition peak_afl.hpp:232
PEAK_AFL_NO_DISCARD peak_afl_status code() const
Get the return code for the failure.
Definition peak_afl.hpp:203
PEAK_AFL_API_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_API_STATUS peak_afl_AutoController_Limit_Default(peak_afl_controller_handle controller, peak_afl_controller_limit *limit)
Get the autofeature default limit.
PEAK_AFL_API_STATUS peak_afl_AutoController_AutoPercentile_GetRange(peak_afl_controller_handle controller, double *min, double *max, double *inc)
Get the auto percentile range for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_BrightnessComponent_Callback_Set(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_callback_type type, void *funcPtr, void *context)
Set a callback for a controller component.
PEAK_AFL_API_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.
PEAK_AFL_API_STATUS peak_afl_AutoController_Hysteresis_Default(peak_afl_controller_handle controller, uint8_t *hysteresis)
Get the autofeature hysteresis default.
PEAK_AFL_API_STATUS peak_afl_AutoController_Mode_Get(peak_afl_controller_handle controller, peak_afl_controller_automode *mode)
Get the current autofeature mode for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_AutoPercentile_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto percentile is supported for a controller.
peak_afl_controllerType
controller types
Definition peak_afl.h:125
PEAK_AFL_API_STATUS peak_afl_AutoController_BrightnessComponent_Status(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_status *status)
Get the status for a controller component.
peak_afl_controller_brightness_component
controller brightness component
Definition peak_afl.h:232
PEAK_AFL_API_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_API_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_controller_automode
controller automode
Definition peak_afl.h:144
PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTarget_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto target is supported for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_Limit_Get(peak_afl_controller_handle controller, peak_afl_controller_limit *limit)
Get the autofeature limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_Status(peak_afl_controller_handle controller, peak_afl_controller_status *status)
Get the status for a controller.
peak_afl_roi_preset
controller roi preset
Definition peak_afl.h:287
PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTarget_Get(peak_afl_controller_handle controller, uint32_t *target)
Get the currently set auto target for a controller.
PEAK_AFL_API_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_API_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_API_STATUS peak_afl_AutoController_GainLimit_GetRange(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature gain limit range for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_SkipFrames_Set(peak_afl_controller_handle controller, uint32_t count)
Set number of frames skipped for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_SkipFrames_Get(peak_afl_controller_handle controller, uint32_t *count)
Get number of frames skipped for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTolerance_Set(peak_afl_controller_handle controller, uint32_t tolerance)
Set the auto tolerance for a controller.
PEAK_AFL_API_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_API_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_API_STATUS peak_afl_AutoController_Hysteresis_Set(peak_afl_controller_handle controller, uint8_t hysteresis)
Set the autofeature hysteresis for a controller.
PEAK_AFL_API_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_API_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_API_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_API_STATUS peak_afl_AutoController_Mode_Set(peak_afl_controller_handle controller, peak_afl_controller_automode mode)
Set the autofeature mode for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_ROI_Get(peak_afl_controller_handle controller, peak_afl_rectangle *roi)
Get the autofeature region of interest for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_ExposureLimit_Set(peak_afl_controller_handle controller, peak_afl_double_limit limit)
Set autofeature exposure limit for a controller.
PEAK_AFL_API_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_API_STATUS peak_afl_AutoController_Hysteresis_Get(peak_afl_controller_handle controller, uint8_t *hysteresis)
Get the autofeature hysteresis for a controller.
PEAK_AFL_API_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_API_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_controller_status
controller status
Definition peak_afl.h:160
PEAK_AFL_API_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_API_STATUS peak_afl_AutoController_ExposureLimit_Get(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature exposure limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_Create(peak_afl_controller_handle *controller, peak_afl_controllerType controllerType)
Create a new controller.
PEAK_AFL_API_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_API_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_API_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_API_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_controller_algorithm
controller algorithm
Definition peak_afl.h:188
PEAK_AFL_API_STATUS peak_afl_AutoController_AutoPercentile_Set(peak_afl_controller_handle controller, double percentile)
Set the auto percentile for a controller.
PEAK_AFL_API_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_API_STATUS peak_afl_AutoController_Limit_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if limit is supported for a controller.
peak_afl_controller_sharpness_algorithm
controller sharpness algorithm (focus)
Definition peak_afl.h:210
PEAK_AFL_API_STATUS peak_afl_AutoController_GetLastAutoAverage(peak_afl_controller_handle controller, uint8_t *average)
Get the last auto average for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GetLastAutoAverages(peak_afl_controller_handle controller, uint8_t *averageRed, uint8_t *averageGreen, uint8_t *averageBlue)
Get the last auto average for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTarget_Set(peak_afl_controller_handle controller, uint32_t target)
Set the auto target for a controller.
PEAK_AFL_API_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_API_STATUS peak_afl_AutoController_Type_Get(peak_afl_controller_handle controller, peak_afl_controllerType *type)
Get the controller type.
PEAK_AFL_API_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_API_STATUS peak_afl_AutoController_Destroy(peak_afl_controller_handle controller)
Destroy a controller. Will fail if it is queued inside a manager.
PEAK_AFL_API_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.
PEAK_AFL_API_STATUS peak_afl_AutoController_Algorithm_GetList(peak_afl_controller_handle controller, peak_afl_controller_algorithm *typeList, uint32_t *listSize)
Get the list of supported algorithms for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_AutoTolerance_Get(peak_afl_controller_handle controller, uint32_t *tolerance)
Get the current auto tolerance for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_AutoPercentile_Get(peak_afl_controller_handle controller, double *percentile)
Get the auto percentile for a controller.
PEAK_AFL_API_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_API_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_API_STATUS peak_afl_AutoController_BrightnessComponent_Mode_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if brightness component mode is supported for a controller component.
PEAK_AFL_API_STATUS peak_afl_AutoController_Algorithm_Set(peak_afl_controller_handle controller, peak_afl_controller_algorithm algorithm)
Set the used algorithm for a controller.
PEAK_AFL_API_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_API_STATUS peak_afl_AutoController_Limit_Set(peak_afl_controller_handle controller, peak_afl_controller_limit limit)
Set the autofeature limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainLimit_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if gain limit is supported for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainLimit_Get(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature gain limit for a controller.
@ PEAK_AFL_CONTROLLER_CALLBACK_FINISHED
Controller callback type finished.
Definition peak_afl.h:264
@ PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING_DATA
Controller callback type processing data.
Definition peak_afl.h:267
@ PEAK_AFL_CONTROLLER_BRIGHTNESS_COMPONENT_GAIN
gain
Definition peak_afl.h:237
@ PEAK_AFL_CONTROLLER_BRIGHTNESS_COMPONENT_EXPOSURE
exposure
Definition peak_afl.h:234
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Create(peak_afl_manager_handle *handle, PEAK_NODE_MAP_HANDLE nodeMapHandle)
Create an automanager instance.
PEAK_AFL_API_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.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Process(peak_afl_manager_handle handle, PEAK_IPL_IMAGE_HANDLE imageHandle)
Process an image.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_DestroyController(peak_afl_manager_handle handle, peak_afl_controller_handle controller)
Destroy a controller.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Status(peak_afl_manager_handle handle, peak_afl_BOOL8 *running)
Get the status of a manager.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Destroy(peak_afl_manager_handle handle)
Destroy an automanager instance.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_DestroyAllController(peak_afl_manager_handle handle)
Destroy all controllers for a manager.
PEAK_AFL_API_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_API_STATUS peak_afl_AutoFeatureManager_RemoveController(peak_afl_manager_handle handle, peak_afl_manager_handle controller)
Remove a controller to an automanager instance.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_SetGainIPL(peak_afl_manager_handle handle, PEAK_IPL_GAIN_HANDLE gainHandle)
Set the IPL Gain.
void Exit()
Exit the peak_afl auto feature library.
Definition peak_afl.hpp:1248
void Init()
Init the peak_afl auto feature library.
Definition peak_afl.hpp:1238
PEAK_AFL_NO_DISCARD std::string GetLastError()
Get the last error message.
Definition peak_afl.hpp:1270
PEAK_AFL_NO_DISCARD Version_t Version()
Query the library version.
Definition peak_afl.hpp:1257
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
PEAK_AFL_API_STATUS peak_afl_Init(void)
Init the peak_afl auto feature library.
PEAK_AFL_API_STATUS peak_afl_Exit(void)
Exit the peak_afl auto feature library.
PEAK_AFL_API_STATUS peak_afl_GetVersion(uint32_t *majorVersion, uint32_t *minorVersion, uint32_t *subminorVersion, uint32_t *patchVersion)
Query the library version.
PEAK_AFL_API_STATUS peak_afl_GetLastError(peak_afl_status *lastErrorCode, char *lastErrorMessage, size_t *lastErrorMessageSize)
Get the last error message.
peak_afl_status
peak_afl Status codes
Definition peak_afl.h:88
@ PEAK_AFL_STATUS_SUCCESS
Success.
Definition peak_afl.h:90
@ PEAK_AFL_STATUS_INVALID_IMAGE_FORMAT
Invalid image format.
Definition peak_afl.h:111
@ PEAK_AFL_STATUS_ACCESS_DENIED
Access Denied.
Definition peak_afl.h:102
@ PEAK_AFL_STATUS_BUSY
Busy.
Definition peak_afl.h:105
@ PEAK_AFL_STATUS_NOT_SUPPORTED
Not supported.
Definition peak_afl.h:114
@ PEAK_AFL_STATUS_INVALID_PARAMETER
Invalid Parameter.
Definition peak_afl.h:99
@ PEAK_AFL_STATUS_BUFFER_TOO_SMALL
Buffer too small.
Definition peak_afl.h:108
@ PEAK_AFL_STATUS_NOT_INITIALIZED
Library not initialized.
Definition peak_afl.h:96
@ PEAK_AFL_STATUS_ERROR
Error.
Definition peak_afl.h:93
void * peak_afl_controller_handle
opaque controller handle type
Definition peak_afl.h:49
void * peak_afl_manager_handle
opaque manager handle type
Definition peak_afl.h:51
uint8_t peak_afl_BOOL8
custom boolean type
Definition peak_afl.h:397
Definition peak_afl.hpp:461
Definition peak_afl.hpp:68
PEAK_AFL_NO_DISCARD 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
std::uint32_t minor
Major.
Definition peak_afl.hpp:70
std::uint32_t subminor
Minor.
Definition peak_afl.hpp:71
PEAK_AFL_NO_DISCARD std::string ToString() const
Patch.
Definition peak_afl.hpp:78
PEAK_AFL_NO_DISCARD 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
PEAK_AFL_NO_DISCARD 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
std::uint32_t patch
Subminor.
Definition peak_afl.hpp:72
PEAK_AFL_NO_DISCARD 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
peak_afl Focus Limit
Definition peak_afl.h:373
peak_afl Double Limit
Definition peak_afl.h:389
peak_afl Rectangle (2D)
Definition peak_afl.h:335
peak_afl Size (2D)
Definition peak_afl.h:301
peak_afl Focus Rectangle
Definition peak_afl.h:357