IDS peak AFL v1.8.0
Loading...
Searching...
No Matches
peak_afl.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
13
14#ifdef PEAK_AFL_DYNAMIC_LOADING
15# define PEAK_AFL_C_ABI_PREFIX peak::afl::dynamic::DynamicLoader::
16#else
17# define PEAK_AFL_C_ABI_PREFIX // we could also set ::
18#endif
19
20#include <peak_afl/peak_afl.h>
21#include <peak_ipl/algorithm/peak_ipl_gain.hpp>
22#include <peak_ipl/types/peak_ipl_image.hpp>
23#include <peak/node_map/peak_node_map.hpp>
25
26#include <type_traits>
27#include <array>
28#include <cstdint>
29#include <exception>
30#include <functional>
31#include <memory>
32#include <string>
33#include <tuple>
34#include <utility>
35#include <vector>
36
37#if __cplusplus >= 201703L || _MSVC_LANG >= 201703L
38# define PEAK_AFL_NO_DISCARD [[nodiscard]]
39# define PEAK_AFL_MAYBE_UNUSED [[maybe_unused]]
40#else
41# ifdef _MSC_VER
42# define PEAK_AFL_NO_DISCARD _Check_return_
43# define PEAK_AFL_MAYBE_UNUSED
44# elif defined(__clang__) || defined(__GNUC__) || defined(__GNUG__)
45# define PEAK_AFL_NO_DISCARD __attribute__((warn_unused_result))
46# define PEAK_AFL_MAYBE_UNUSED __attribute__((unused))
47# else
48# define PEAK_AFL_NO_DISCARD
49# define PEAK_AFL_MAYBE_UNUSED
50# endif
51#endif
52
58
64
65namespace peak
66{
67namespace afl
68{
69namespace library
70{
71
77{
78 std::uint32_t major;
79 std::uint32_t minor;
80 std::uint32_t subminor;
81 std::uint32_t patch;
82
87 PEAK_AFL_NO_DISCARD std::string ToString() const
88 {
89 return std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(subminor) + "."
90 + std::to_string(patch);
91 }
92
98 PEAK_AFL_NO_DISCARD uint32_t Major() const
99 {
100 return major;
101 }
102
108 PEAK_AFL_NO_DISCARD uint32_t Minor() const
109 {
110 return minor;
111 }
112
117 PEAK_AFL_NO_DISCARD uint32_t Subminor() const
118 {
119 return subminor;
120 }
121
127 PEAK_AFL_NO_DISCARD uint32_t Patch() const
128 {
129 return patch;
130 }
131};
132
148inline void Init();
149
165inline void Exit();
166
175PEAK_AFL_NO_DISCARD inline std::string GetLastError();
176
191PEAK_AFL_NO_DISCARD inline Version_t Version();
192} // namespace library
193
194namespace error
195{
196
197
202class Exception : public virtual peak::common::Exception
203{
204public:
205 explicit Exception(peak_afl_status code, bool get_text=true)
206 : peak::common::Exception(""), m_code(code)
207 {
208 if (get_text)
209 {
210 m_text = library::GetLastError();
211 }
212 }
213
221 PEAK_AFL_NO_DISCARD peak_afl_status code() const
222 {
223 return m_code;
224 }
225
233 PEAK_AFL_NO_DISCARD const char* what() const noexcept override
234 {
235 if(m_text.empty())
236 {
237 return "-";
238 }
239 else
240 {
241 return m_text.c_str();
242 }
243 }
244
254 PEAK_AFL_NO_DISCARD static std::string translateCode(peak_afl_status status)
255 {
256 switch(status)
257 {
259 return "PEAK_AFL_STATUS_SUCCESS";
260
262 return "PEAK_AFL_STATUS_ERROR";
263
265 return "PEAK_AFL_STATUS_NOT_INITIALIZED";
266
268 return "PEAK_AFL_STATUS_INVALID_PARAMETER";
269
271 return "PEAK_AFL_STATUS_ACCESS_DENIED";
272
274 return "PEAK_AFL_STATUS_BUSY";
275
277 return "PEAK_AFL_STATUS_BUFFER_TOO_SMALL";
278
280 return "PEAK_AFL_STATUS_INVALID_IMAGE_FORMAT";
281
283 return "PEAK_AFL_STATUS_NOT_SUPPORTED";
284
286 return "PEAK_AFL_STATUS_VALUE_ADJUSTED";
287
288 default:
289 return "Unknown Status code";
290 }
291 }
292
293private:
294 peak_afl_status m_code{};
295 std::string m_text{};
296};
297} // namespace error
298
299class Controller;
300
306{
307public:
319 inline explicit Manager(const std::shared_ptr<peak::core::NodeMap>& node_map);
320
324 inline ~Manager();
325
326 Manager(const Manager&) = delete;
327 inline Manager(Manager&&) noexcept;
328
329 Manager& operator=(const Manager&) noexcept = delete;
330 inline Manager& operator=(Manager&&) noexcept;
331
344 inline void AddController(const std::shared_ptr<Controller>& controller);
345
358 inline void RemoveController(const std::shared_ptr<Controller>& controller);
359
371 inline void Process(const peak::ipl::Image& image) const;
372
387 PEAK_AFL_NO_DISCARD inline std::shared_ptr<Controller> CreateController(peak_afl_controllerType type);
388
398 inline void DestroyAllController();
399
409 inline void DestroyController(const std::shared_ptr<Controller>& controller);
410
420 inline void SetGainIPL(const peak::ipl::Gain& gain);
421
435 inline void SetCCM(std::array<float, 9> ccm);
436
448 PEAK_AFL_NO_DISCARD inline bool Status() const;
449
457 PEAK_AFL_NO_DISCARD inline std::vector<std::shared_ptr<Controller>> ControllerList() const;
458
466 PEAK_AFL_NO_DISCARD inline size_t ControllerCount() const;
467
479 PEAK_AFL_NO_DISCARD inline std::shared_ptr<Controller> GetController(peak_afl_controllerType type) const;
480
490 PEAK_AFL_NO_DISCARD inline bool IsControllerSupported(peak_afl_controllerType type) const;
491private:
492 std::vector<std::shared_ptr<Controller>> m_controllerList;
493 mutable std::mutex m_mutex{};
494 peak_afl_manager_handle m_handle{};
495};
496
506template<typename... ControllerTypes>
507std::tuple<Manager, std::vector<std::shared_ptr<Controller>>>
508CreateManager(const std::shared_ptr<peak::core::NodeMap>& node_map, ControllerTypes... types)
509{
510 constexpr int size = sizeof...(types);
511 constexpr std::array<peak_afl_controllerType, size> controller_types{types...};
512 std::vector<std::shared_ptr<Controller>> controller{};
513 Manager manager{node_map};
514 controller.reserve(size);
515
516 std::for_each(controller_types.cbegin(), controller_types.cend(), [&manager, &controller](peak_afl_controllerType type) {
517 controller.emplace_back(manager.CreateController(type));
518 });
519
520 return { std::move(manager), std::move(controller) };
521}
522
523
528template <typename T, typename std::enable_if_t<std::is_arithmetic<T>::value, int> = 0>
529struct Range
530{
531 T min;
532 T max;
533 T inc;
534};
535
536namespace callback
537{
538using FinishedCallback = std::function<void(void)>;
539using DataProcessingCallback = std::function<void(int, int)>;
540using ProcessingCallback = std::function<void(peak_afl_process_data*)>;
541using ComponentCallback = std::function<void(void)>;
542
543using RegisterFunction = std::function<PEAK_AFL_API_STATUS(void*, void*)>;
544using UnRegisterFunction = std::function<void()>;
545}
546
551class Controller : public std::enable_shared_from_this<Controller>
552{
553 friend class Manager;
554
555 template<class T>
556 class Callback
557 {
558#ifndef SWIG
559 public:
560 template<typename R, typename ...Args>
561 Callback(const std::shared_ptr<peak::afl::Controller>& controller, callback::RegisterFunction register_function,
562 callback::UnRegisterFunction unregister_function, std::function<R(Args...)> callback) :
563 m_unregister_function(std::move(unregister_function)),
564 m_callback(std::move(callback))
565 {
566 const auto ret = register_function(reinterpret_cast<void*>(&Callback::Func<Args...>), this);
567 if (ret != PEAK_AFL_STATUS_SUCCESS)
568 {
569 throw error::Exception(ret);
570 }
571 m_controller = controller;
572 }
573
574 virtual ~Callback()
575 {
576 if (auto controller = m_controller.lock())
577 {
578 m_unregister_function();
579 }
580 }
581
582 private:
583 template<typename ...Args>
584 static void Func(Args... args, void* ptr)
585 {
586 static_cast<Callback *>(ptr)->m_callback(args...);
587 };
588#endif
589
590 std::weak_ptr<peak::afl::Controller> m_controller{};
591 callback::UnRegisterFunction m_unregister_function{};
592 T m_callback{};
593 };
594
595
605 inline explicit Controller(peak_afl_controller_handle handle)
606 : m_handle(handle) {};
607
608public:
612 inline ~Controller();
613
614 Controller(const Controller&) = delete;
615 Controller(Controller&&) = delete;
616 Controller& operator=(const Controller&) = delete;
617 Controller& operator=(Controller&&) = delete;
618
630 PEAK_AFL_NO_DISCARD inline static std::shared_ptr<Controller> Create(peak_afl_controllerType type);
631
641 PEAK_AFL_NO_DISCARD inline bool IsSkipFramesSupported() const;
642
654 inline void SetSkipFrames(std::uint32_t count);
655
667 PEAK_AFL_NO_DISCARD inline std::uint32_t GetSkipFrames() const;
668
678 PEAK_AFL_NO_DISCARD inline Range<std::uint32_t> GetSkipFramesRange() const;
679
691 PEAK_AFL_NO_DISCARD inline bool IsROISupported() const;
692
704 inline void SetROI(peak_afl_rectangle rect);
705
717 PEAK_AFL_NO_DISCARD inline peak_afl_rectangle GetROI() const;
718
730 PEAK_AFL_NO_DISCARD inline bool IsROIPresetSupported() const;
731
743 inline void SetROIPreset(peak_afl_roi_preset preset);
744
756 PEAK_AFL_NO_DISCARD inline bool IsModeSupported() const;
757
769 inline void SetMode(peak_afl_controller_automode mode);
770
780 PEAK_AFL_NO_DISCARD inline peak_afl_controller_automode GetMode() const;
781
793 PEAK_AFL_NO_DISCARD bool IsBrightnessAlgorithmSupported() const;
794
807
816
828 PEAK_AFL_NO_DISCARD inline peak_afl_controller_status Status() const;
829
841 PEAK_AFL_NO_DISCARD inline std::uint8_t GetLastAutoAverage() const;
842
854 PEAK_AFL_NO_DISCARD inline std::tuple<std::uint8_t, std::uint8_t, std::uint8_t> GetLastAutoAverages() const;
855
867 PEAK_AFL_NO_DISCARD inline bool IsAutoTargetSupported() const;
868
881 inline void SetAutoTarget(uint32_t target);
882
892 PEAK_AFL_NO_DISCARD inline std::uint32_t GetAutoTarget() const;
893
906 PEAK_AFL_NO_DISCARD inline Range<std::uint32_t> GetAutoTargetRange() const;
907
919 PEAK_AFL_NO_DISCARD inline bool IsAutoToleranceSupported() const;
920
932 inline void SetAutoTolerance(std::uint32_t tolerance);
933
943 PEAK_AFL_NO_DISCARD inline std::uint32_t GetAutoTolerance() const;
944
957 PEAK_AFL_NO_DISCARD inline Range<std::uint32_t> GetAutoToleranceRange() const;
958
970 PEAK_AFL_NO_DISCARD inline bool IsAutoPercentileSupported() const;
971
984 inline void SetAutoPercentile(double percentile);
985
995 PEAK_AFL_NO_DISCARD inline double GetAutoPercentile() const;
996
1009 PEAK_AFL_NO_DISCARD inline Range<double> GetAutoPercentileRange() const;
1010
1022 PEAK_AFL_NO_DISCARD inline peak_afl_controllerType Type() const;
1023
1037 PEAK_AFL_NO_DISCARD inline bool IsAlgorithmSupported() const;
1038
1050 inline void SetAlgorithm(peak_afl_controller_algorithm algorithm);
1051
1059 PEAK_AFL_NO_DISCARD inline peak_afl_controller_algorithm GetAlgorithm() const;
1060
1072 PEAK_AFL_NO_DISCARD inline std::vector<peak_afl_controller_algorithm> GetAlgorithmList() const;
1073
1085 PEAK_AFL_NO_DISCARD inline bool IsSharpnessAlgorithmSupported() const;
1086
1099
1109 PEAK_AFL_NO_DISCARD inline peak_afl_controller_sharpness_algorithm GetSharpnessAlgorithm() const;
1110
1122 PEAK_AFL_NO_DISCARD inline std::vector<peak_afl_controller_sharpness_algorithm> GetSharpnessAlgorithmList() const;
1123
1133 inline void RegisterFinishedCallback(const callback::FinishedCallback& callback);
1134
1142 inline void UnRegisterFinishedCallback();
1143
1152 inline void RegisterComponentCallback(peak_afl_controller_brightness_component component, const callback::FinishedCallback& callback);
1153
1164
1174 inline void RegisterDataProcessingCallback(const callback::DataProcessingCallback& callback);
1175
1184
1192 inline void RegisterProcessingCallback(const callback::ProcessingCallback& callback);
1193
1201 inline void UnRegisterProcessingCallback();
1202
1214 PEAK_AFL_NO_DISCARD inline bool IsWeightedROISupported() const;
1215
1227 inline void SetWeightedROIs(const std::vector<peak_afl_weighted_rectangle>& list);
1228
1240 inline void SetWeightedROI(const peak_afl_weighted_rectangle& rect);
1241
1251 PEAK_AFL_NO_DISCARD inline peak_afl_size GetWeightedROIMinSize() const;
1252
1262 PEAK_AFL_NO_DISCARD inline std::vector<peak_afl_weighted_rectangle> GetWeightedROIs() const;
1263
1275 PEAK_AFL_NO_DISCARD inline bool IsLimitSupported() const;
1276
1288 inline void SetLimit(peak_afl_controller_limit limit);
1289
1299 PEAK_AFL_NO_DISCARD inline peak_afl_controller_limit GetLimit() const;
1300
1310 PEAK_AFL_NO_DISCARD inline peak_afl_controller_limit GetDefaultLimit() const;
1311
1323 PEAK_AFL_NO_DISCARD inline bool IsHysteresisSupported() const;
1324
1336 inline void SetHysteresis(std::uint8_t hysteresis);
1337
1347 PEAK_AFL_NO_DISCARD inline std::uint8_t GetHysteresis() const;
1348
1358 PEAK_AFL_NO_DISCARD inline std::uint8_t GetDefaultHysteresis() const;
1359
1369 PEAK_AFL_NO_DISCARD inline Range<std::uint8_t> GetHysteresisRange() const;
1370
1382 PEAK_AFL_NO_DISCARD inline bool IsBrightnessComponentModeSupported() const;
1383
1396 PEAK_AFL_NO_DISCARD inline bool IsBrightnessComponentUnitSupported(peak_afl_controller_brightness_component component) const;
1397
1411
1423
1437
1447 PEAK_AFL_NO_DISCARD inline bool IsGainLimitSupported() const;
1448
1465 inline void SetGainLimit(peak_afl_double_limit limit);
1466
1476 inline peak_afl_double_limit GetGainLimit() const;
1477
1488
1504 inline void SetGainAnalogLimit(peak_afl_double_limit limit);
1505
1516
1527
1543 inline void SetGainDigitalLimit(peak_afl_double_limit limit);
1544
1555
1566
1583
1594
1605
1621 inline void SetGainHostLimit(peak_afl_double_limit limit);
1622
1633
1644
1654 inline void SetExposureLimit(peak_afl_double_limit limit);
1655
1666
1667
1668private:
1669 using FinishedCallbackType = Callback<callback::FinishedCallback>;
1670 using DataProcessingCallbackType = Callback<callback::DataProcessingCallback>;
1671 using ProcessingCallbackType = Callback<callback::ProcessingCallback>;
1672 using ComponentCallbackType = Callback<callback::ComponentCallback>;
1673
1674 peak_afl_controller_handle m_handle{};
1675 std::unique_ptr<FinishedCallbackType> m_finishedCallback{};
1676 std::unique_ptr<DataProcessingCallbackType> m_dataProcessingCallback{};
1677 std::unique_ptr<ProcessingCallbackType> m_ProcessingCallback{};
1678 std::unique_ptr<ComponentCallbackType> m_finishedExposureCallback{};
1679
1680 std::unique_ptr<ComponentCallbackType> m_finishedGainCallback{};
1681
1682 std::unique_ptr<ComponentCallbackType> m_AnalogGainCallback{};
1683 std::unique_ptr<ComponentCallbackType> m_DigitalGainCallback{};
1684 std::unique_ptr<ComponentCallbackType> m_CombinedGainCallback{};
1685 std::unique_ptr<ComponentCallbackType> m_HostGainCallback{};
1686};
1687
1688namespace library
1689{
1690inline void Init()
1691{
1692 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_Init();
1693 if (ret != PEAK_AFL_STATUS_SUCCESS)
1694
1695 {
1696 throw error::Exception(ret, false);
1697 }
1698}
1699
1700inline void Exit()
1701{
1702 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_Exit();
1703 if (ret != PEAK_AFL_STATUS_SUCCESS)
1704 {
1705 throw error::Exception(ret, false);
1706 }
1707}
1708
1710{
1711 Version_t version{};
1712
1713 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_GetVersion(&version.major, &version.minor, &version.subminor, &version.patch);
1714 if (ret != PEAK_AFL_STATUS_SUCCESS)
1715 {
1716 throw error::Exception(ret, false);
1717 }
1718
1719 return version;
1720}
1721
1722inline std::string GetLastError()
1723{
1724 std::size_t lastErrorMessageSize;
1725 peak_afl_status code;
1726
1727 auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_GetLastError(&code, nullptr, &lastErrorMessageSize);
1728 if (ret != PEAK_AFL_STATUS_SUCCESS)
1729 {
1730 return "Cannot get last error!";
1731 }
1732
1733 std::vector<char> text;
1734 text.resize(lastErrorMessageSize);
1735
1736 ret = PEAK_AFL_C_ABI_PREFIX peak_afl_GetLastError(&code, text.data(), &lastErrorMessageSize);
1737 if (ret != PEAK_AFL_STATUS_SUCCESS)
1738 {
1739 return "Cannot get last error!";
1740 }
1741
1742 return { text.begin(), text.end() };
1743}
1744} // namespace library
1745
1746inline Manager::Manager(const std::shared_ptr<peak::core::NodeMap>& node_map)
1747{
1748 if(!node_map)
1749 {
1750 throw peak::common::Exception("Invalid node map handle!");
1751 }
1752
1753 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_Create(&m_handle, node_map->Handle());
1754 if (ret != PEAK_AFL_STATUS_SUCCESS)
1755 {
1756 throw error::Exception(ret);
1757 }
1758}
1759
1761{
1762 if (m_handle != nullptr)
1763 {
1764 PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_DestroyAllController(m_handle);
1765
1766 {
1767 std::lock_guard<std::mutex> lck(m_mutex);
1768 for (auto& c : m_controllerList)
1769 {
1770 c->m_handle = nullptr;
1771 }
1772 }
1773
1774 PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_Destroy(m_handle);
1775 m_handle = nullptr;
1776 }
1777}
1778
1779inline Manager::Manager(Manager&& other) noexcept {
1780 m_handle = other.m_handle;
1781 other.m_handle = nullptr;
1782
1783 std::lock_guard<std::mutex> lck(other.m_mutex);
1784 m_controllerList = std::move(other.m_controllerList);
1785}
1786
1787inline Manager& Manager::operator=(Manager&& other) noexcept
1788{
1789 m_handle = other.m_handle;
1790 other.m_handle = nullptr;
1791
1792 std::lock_guard<std::mutex> lck(other.m_mutex);
1793 m_controllerList = std::move(other.m_controllerList);
1794
1795 return *this;
1796}
1797
1798inline void Manager::AddController(const std::shared_ptr<Controller>& controller)
1799{
1800 std::lock_guard<std::mutex> lck(m_mutex);
1801
1802 auto cnt = std::any_of(m_controllerList.begin(), m_controllerList.end(), [controller](const std::shared_ptr<Controller>& c) {
1803 return c == controller;
1804 });
1805
1806 if(cnt)
1807 {
1808 return;
1809 }
1810
1811 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_AddController(m_handle, controller->m_handle);
1812 if (ret != PEAK_AFL_STATUS_SUCCESS)
1813 {
1814 throw error::Exception(ret);
1815 }
1816
1817 m_controllerList.emplace_back(controller);
1818}
1819
1820inline void Manager::RemoveController(const std::shared_ptr<Controller>& controller)
1821{
1822 std::lock_guard<std::mutex> lck(m_mutex);
1823
1824 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_RemoveController(m_handle, controller->m_handle);
1825 if (ret != PEAK_AFL_STATUS_SUCCESS)
1826 {
1827 throw error::Exception(ret);
1828 }
1829
1830 auto it = std::remove_if(m_controllerList.begin(), m_controllerList.end(), [controller](const std::shared_ptr<Controller>& c) {
1831 return c == controller;
1832 });
1833
1834 m_controllerList.erase(it, m_controllerList.end());
1835}
1836
1837inline void Manager::Process(const peak::ipl::Image& image) const
1838{
1839 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_Process(m_handle, ImageBackendAccessor::BackendHandle(image));
1840 if (ret != PEAK_AFL_STATUS_SUCCESS)
1841 {
1842 throw error::Exception(ret);
1843 }
1844}
1845
1846inline std::shared_ptr<Controller> Manager::CreateController(peak_afl_controllerType type)
1847{
1848 std::lock_guard<std::mutex> lck(m_mutex);
1849
1851 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_CreateController(m_handle, &handle, type);
1852 if (ret != PEAK_AFL_STATUS_SUCCESS)
1853 {
1854 throw error::Exception(ret);
1855 }
1856
1857 auto shared = std::shared_ptr<Controller>(new Controller(handle));
1858 m_controllerList.emplace_back(shared);
1859
1860 return shared;
1861}
1862
1864{
1865 std::lock_guard<std::mutex> lck(m_mutex);
1866
1867 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_DestroyAllController(m_handle);
1868 if (ret != PEAK_AFL_STATUS_SUCCESS)
1869 {
1870 throw error::Exception(ret);
1871 }
1872
1873 for(auto& c : m_controllerList)
1874 {
1875 c->m_handle = nullptr;
1876 }
1877
1878 m_controllerList.clear();
1879}
1880
1881inline void Manager::DestroyController(const std::shared_ptr<Controller>& controller)
1882{
1883 std::lock_guard<std::mutex> lck(m_mutex);
1884
1885 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_DestroyController(m_handle, controller->m_handle);
1886 if (ret != PEAK_AFL_STATUS_SUCCESS)
1887 {
1888 throw error::Exception(ret);
1889 }
1890
1891 auto it = std::remove_if(m_controllerList.begin(), m_controllerList.end(), [controller](const std::shared_ptr<Controller>& c) {
1892 return c == controller;
1893 });
1894
1895 m_controllerList.erase(it, m_controllerList.end());
1896
1897 controller->m_handle = nullptr;
1898}
1899
1900inline void Manager::SetGainIPL(const peak::ipl::Gain& gain)
1901{
1902 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_SetGainIPL(m_handle, GainBackendAccessor::BackendHandle(gain));
1903 if (ret != PEAK_AFL_STATUS_SUCCESS)
1904 {
1905 throw error::Exception(ret);
1906 }
1907}
1908
1909inline void Manager::SetCCM(std::array<float, 9> ccm)
1910{
1911 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_SetCCM(m_handle, ccm.data(), ccm.size());
1912 if (ret != PEAK_AFL_STATUS_SUCCESS)
1913 {
1914 throw error::Exception(ret);
1915 }
1916}
1917
1918inline bool Manager::Status() const
1919{
1920 std::uint8_t status;
1921 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_Status(m_handle, &status);
1922 if (ret != PEAK_AFL_STATUS_SUCCESS)
1923 {
1924 throw error::Exception(ret);
1925 }
1926
1927 return status;
1928}
1929
1930inline std::vector<std::shared_ptr<Controller>> Manager::ControllerList() const
1931{
1932 std::lock_guard<std::mutex> lck(m_mutex);
1933
1934 std::vector<std::shared_ptr<Controller>> controller{};
1935
1936 std::copy(m_controllerList.begin(), m_controllerList.end(), std::back_inserter(controller));
1937
1938 return controller;
1939}
1940
1941inline size_t Manager::ControllerCount() const
1942{
1943 return m_controllerList.size();
1944}
1945
1946inline std::shared_ptr<Controller> Manager::GetController(peak_afl_controllerType type) const
1947{
1948 std::lock_guard<std::mutex> lck(m_mutex);
1949
1950 auto it = std::find_if(m_controllerList.cbegin(), m_controllerList.cend(), [=](const std::shared_ptr<Controller>& controller) {
1951 return type == controller->Type();
1952 });
1953
1954 if(it != m_controllerList.cend())
1955 {
1956 return *it;
1957 }
1958 else
1959 {
1961 }
1962}
1963
1965{
1966 peak_afl_BOOL8 supported{};
1967 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoFeatureManager_Controller_IsSupported(m_handle, type, &supported);
1968 if (ret != PEAK_AFL_STATUS_SUCCESS)
1969 {
1970 throw error::Exception(ret);
1971 }
1972
1973 return supported != PEAK_AFL_FALSE;
1974}
1975
1976
1977inline std::shared_ptr<Controller> Controller::Create(peak_afl_controllerType type)
1978{
1980 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Create(&handle, type);
1981 if (ret != PEAK_AFL_STATUS_SUCCESS)
1982 {
1983 throw error::Exception(ret);
1984 }
1985
1986 return std::shared_ptr<Controller>(new Controller(handle));
1987}
1988
1990{
1991 if (m_handle != nullptr)
1992 {
1993 PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Destroy(m_handle);
1994 m_handle = nullptr;
1995 }
1996}
1997
1999{
2000 peak_afl_BOOL8 supported{};
2001 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_SkipFrames_IsSupported(m_handle, &supported);
2002 if (ret != PEAK_AFL_STATUS_SUCCESS)
2003 {
2004 throw error::Exception(ret);
2005 }
2006
2007 return supported;
2008}
2009
2010inline void Controller::SetSkipFrames(std::uint32_t count)
2011{
2012 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_SkipFrames_Set(m_handle, count);
2013 if (ret != PEAK_AFL_STATUS_SUCCESS)
2014 {
2015 throw error::Exception(ret);
2016 }
2017}
2018
2019inline std::uint32_t Controller::GetSkipFrames() const
2020{
2021 std::uint32_t count{};
2022 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_SkipFrames_Get(m_handle, &count);
2023 if (ret != PEAK_AFL_STATUS_SUCCESS)
2024 {
2025 throw error::Exception(ret);
2026 }
2027
2028 return count;
2029}
2030
2032{
2033 Range<std::uint32_t> range{};
2034 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_SkipFrames_GetRange(m_handle, &range.min, &range.max, &range.inc);
2035 if (ret != PEAK_AFL_STATUS_SUCCESS)
2036 {
2037 throw error::Exception(ret);
2038 }
2039
2040 return range;
2041}
2042
2044{
2045 peak_afl_BOOL8 supported{};
2046 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_ROI_IsSupported(m_handle, &supported);
2047 if (ret != PEAK_AFL_STATUS_SUCCESS)
2048 {
2049 throw error::Exception(ret);
2050 }
2051
2052 return supported;
2053}
2054
2056{
2057 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_ROI_Set(m_handle, rect);
2058 if (ret != PEAK_AFL_STATUS_SUCCESS)
2059 {
2060 throw error::Exception(ret);
2061 }
2062}
2063
2065{
2066 peak_afl_rectangle rect{};
2067 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_ROI_Get(m_handle, &rect);
2068 if (ret != PEAK_AFL_STATUS_SUCCESS)
2069 {
2070 throw error::Exception(ret);
2071 }
2072 return rect;
2073}
2074
2076{
2077 peak_afl_BOOL8 supported{};
2078 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_ROI_Preset_IsSupported(m_handle, &supported);
2079 if (ret != PEAK_AFL_STATUS_SUCCESS)
2080 {
2081 throw error::Exception(ret);
2082 }
2083
2084 return supported;
2085}
2086
2088{
2089 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_ROI_Preset_Set(m_handle, preset);
2090 if (ret != PEAK_AFL_STATUS_SUCCESS)
2091 {
2092 throw error::Exception(ret);
2093 }
2094}
2095
2097{
2098 peak_afl_BOOL8 supported{};
2099 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Mode_IsSupported(m_handle, &supported);
2100 if (ret != PEAK_AFL_STATUS_SUCCESS)
2101 {
2102 throw error::Exception(ret);
2103 }
2104
2105 return supported;
2106}
2107
2109{
2110 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Mode_Set(m_handle, mode);
2111 if (ret != PEAK_AFL_STATUS_SUCCESS)
2112 {
2113 throw error::Exception(ret);
2114 }
2115}
2116
2118{
2120 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Mode_Get(m_handle, &mode);
2121 if (ret != PEAK_AFL_STATUS_SUCCESS)
2122 {
2123 throw error::Exception(ret);
2124 }
2125 return mode;
2126}
2127
2129{
2130 peak_afl_BOOL8 supported{};
2131 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_BrightnessAlgorithm_IsSupported(m_handle, &supported);
2132 if (ret != PEAK_AFL_STATUS_SUCCESS)
2133 {
2134 throw error::Exception(ret);
2135 }
2136
2137 return supported;
2138}
2139
2141{
2142 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_BrightnessAlgorithm_Set(m_handle, algorithm);
2143 if (ret != PEAK_AFL_STATUS_SUCCESS)
2144 {
2145 throw error::Exception(ret);
2146 }
2147}
2148
2150{
2152 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_BrightnessAlgorithm_Get(m_handle, &algorithm);
2153 if (ret != PEAK_AFL_STATUS_SUCCESS)
2154 {
2155 throw error::Exception(ret);
2156 }
2157 return algorithm;
2158}
2159
2161{
2163 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Status(m_handle, &status);
2164 if (ret != PEAK_AFL_STATUS_SUCCESS)
2165 {
2166 throw error::Exception(ret);
2167 }
2168 return status;
2169}
2170
2171
2172inline std::uint8_t Controller::GetLastAutoAverage() const
2173{
2174 std::uint8_t average{};
2175 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GetLastAutoAverage(m_handle, &average);
2176 if (ret != PEAK_AFL_STATUS_SUCCESS)
2177 {
2178 throw error::Exception(ret);
2179 }
2180 return average;
2181}
2182
2183inline std::tuple<std::uint8_t, std::uint8_t, std::uint8_t> Controller::GetLastAutoAverages() const
2184{
2185 std::uint8_t averageRed{}, averageGreen{}, averageBlue{};
2186 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GetLastAutoAverages(m_handle, &averageRed, &averageGreen, &averageBlue);
2187 if (ret != PEAK_AFL_STATUS_SUCCESS)
2188 {
2189 throw error::Exception(ret);
2190 }
2191 return { averageRed, averageGreen, averageBlue };
2192}
2193
2195{
2196 peak_afl_BOOL8 supported{};
2197 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoTarget_IsSupported(m_handle, &supported);
2198 if (ret != PEAK_AFL_STATUS_SUCCESS)
2199 {
2200 throw error::Exception(ret);
2201 }
2202
2203 return supported;
2204}
2205
2206inline void Controller::SetAutoTarget(std::uint32_t target)
2207{
2208 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoTarget_Set(m_handle, target);
2209 if (ret != PEAK_AFL_STATUS_SUCCESS)
2210 {
2211 throw error::Exception(ret);
2212 }
2213}
2214
2215inline std::uint32_t Controller::GetAutoTarget() const
2216{
2217 std::uint32_t target{};
2218 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoTarget_Get(m_handle, &target);
2219 if (ret != PEAK_AFL_STATUS_SUCCESS)
2220 {
2221 throw error::Exception(ret);
2222 }
2223 return target;
2224}
2225
2227{
2228 Range<std::uint32_t> range{};
2229 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoTarget_GetRange(m_handle, &range.min, &range.max, &range.inc);
2230 if (ret != PEAK_AFL_STATUS_SUCCESS)
2231 {
2232 throw error::Exception(ret);
2233 }
2234 return range;
2235}
2236
2238{
2239 peak_afl_BOOL8 supported{};
2240 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoTolerance_IsSupported(m_handle, &supported);
2241 if (ret != PEAK_AFL_STATUS_SUCCESS)
2242 {
2243 throw error::Exception(ret);
2244 }
2245
2246 return supported;
2247}
2248
2249inline void Controller::SetAutoTolerance(uint32_t tolerance)
2250{
2251 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoTolerance_Set(m_handle, tolerance);
2252 if (ret != PEAK_AFL_STATUS_SUCCESS)
2253 {
2254 throw error::Exception(ret);
2255 }
2256}
2257
2258inline uint32_t Controller::GetAutoTolerance() const
2259{
2260 std::uint32_t tolerance;
2261 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoTolerance_Get(m_handle, &tolerance);
2262 if (ret != PEAK_AFL_STATUS_SUCCESS)
2263 {
2264 throw error::Exception(ret);
2265 }
2266 return tolerance;
2267}
2268
2270{
2271 Range<uint32_t> range{};
2272 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoTolerance_GetRange(m_handle, &range.min, &range.max, &range.inc);
2273 if (ret != PEAK_AFL_STATUS_SUCCESS)
2274 {
2275 throw error::Exception(ret);
2276 }
2277 return range;
2278}
2279
2281{
2282 peak_afl_BOOL8 supported{};
2283 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoPercentile_IsSupported(m_handle, &supported);
2284 if (ret != PEAK_AFL_STATUS_SUCCESS)
2285 {
2286 throw error::Exception(ret);
2287 }
2288
2289 return supported;
2290}
2291
2292inline void Controller::SetAutoPercentile(double percentile)
2293{
2294 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoPercentile_Set(m_handle, percentile);
2295 if (ret != PEAK_AFL_STATUS_SUCCESS)
2296 {
2297 throw error::Exception(ret);
2298 }
2299}
2300
2302{
2303 double percentile;
2304 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoPercentile_Get(m_handle, &percentile);
2305 if (ret != PEAK_AFL_STATUS_SUCCESS)
2306 {
2307 throw error::Exception(ret);
2308 }
2309 return percentile;
2310}
2311
2313{
2314 Range<double> range{};
2315 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_AutoPercentile_GetRange(m_handle, &range.min, &range.max, &range.inc);
2316 if (ret != PEAK_AFL_STATUS_SUCCESS)
2317 {
2318 throw error::Exception(ret);
2319 }
2320 return range;
2321}
2322
2324{
2326 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Type_Get(m_handle, &type);
2327 if (ret != PEAK_AFL_STATUS_SUCCESS)
2328 {
2329 throw error::Exception(ret);
2330 }
2331 return type;
2332}
2333
2335{
2336 peak_afl_BOOL8 supported{};
2337 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Algorithm_IsSupported(m_handle, &supported);
2338 if (ret != PEAK_AFL_STATUS_SUCCESS)
2339 {
2340 throw error::Exception(ret);
2341 }
2342
2343 return supported;
2344}
2345
2347{
2348 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Algorithm_Set(m_handle, alg);
2349 if (ret != PEAK_AFL_STATUS_SUCCESS)
2350 {
2351 throw error::Exception(ret);
2352 }
2353}
2354
2356{
2358 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Algorithm_Get(m_handle, &alg);
2359 if (ret != PEAK_AFL_STATUS_SUCCESS)
2360 {
2361 throw error::Exception(ret);
2362 }
2363
2364 return alg;
2365}
2366
2367inline std::vector<peak_afl_controller_algorithm> Controller::GetAlgorithmList() const
2368{
2369 std::vector<peak_afl_controller_algorithm> algList{};
2370 std::uint32_t listSize{};
2371
2372 auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Algorithm_GetList(m_handle, nullptr, &listSize);
2373 if (ret != PEAK_AFL_STATUS_SUCCESS)
2374 {
2375 throw error::Exception(ret);
2376 }
2377
2378 algList.resize(listSize);
2379
2380 ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Algorithm_GetList(m_handle, algList.data(), &listSize);
2381 if (ret != PEAK_AFL_STATUS_SUCCESS)
2382 {
2383 throw error::Exception(ret);
2384 }
2385
2386 return algList;
2387}
2388
2390{
2391 peak_afl_BOOL8 supported{};
2392 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_SharpnessAlgorithm_IsSupported(m_handle, &supported);
2393 if (ret != PEAK_AFL_STATUS_SUCCESS)
2394 {
2395 throw error::Exception(ret);
2396 }
2397
2398 return supported;
2399}
2400
2402{
2403 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_SharpnessAlgorithm_Set(m_handle, alg);
2404 if (ret != PEAK_AFL_STATUS_SUCCESS)
2405 {
2406 throw error::Exception(ret);
2407 }
2408}
2409
2411{
2413 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_SharpnessAlgorithm_Get(m_handle, &alg);
2414 if (ret != PEAK_AFL_STATUS_SUCCESS)
2415 {
2416 throw error::Exception(ret);
2417 }
2418
2419 return alg;
2420}
2421
2422inline std::vector<peak_afl_controller_sharpness_algorithm> Controller::GetSharpnessAlgorithmList() const
2423{
2424 std::vector<peak_afl_controller_sharpness_algorithm> algList{};
2425 std::uint32_t listSize{};
2426
2427 auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_SharpnessAlgorithm_GetList(m_handle, nullptr, &listSize);
2428 if (ret != PEAK_AFL_STATUS_SUCCESS)
2429 {
2430 throw error::Exception(ret);
2431 }
2432
2433 algList.resize(listSize);
2434
2435 ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_SharpnessAlgorithm_GetList(m_handle, algList.data(), &listSize);
2436 if (ret != PEAK_AFL_STATUS_SUCCESS)
2437 {
2438 throw error::Exception(ret);
2439 }
2440
2441 return algList;
2442}
2443
2444inline void Controller::RegisterFinishedCallback(const callback::FinishedCallback& callback)
2445{
2446 m_finishedCallback = std::make_unique<FinishedCallbackType>(shared_from_this(),
2447 [handle = m_handle](void* ptr, void* ctx) {
2448 return PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Callback_Set(handle, PEAK_AFL_CONTROLLER_CALLBACK_FINISHED, ptr, ctx); },
2449 [handle = m_handle] {
2450 PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Callback_Set(handle, PEAK_AFL_CONTROLLER_CALLBACK_FINISHED, nullptr, nullptr); },
2451 callback);
2452}
2453
2455{
2456 m_finishedCallback.reset();
2457}
2458
2459inline void Controller::RegisterComponentCallback(peak_afl_controller_brightness_component component, const callback::FinishedCallback& callback)
2460{
2462 {
2464 }
2465
2466 const auto registerCallback = [&](peak_afl_controller_brightness_component component)
2467 {
2468 return std::make_unique<ComponentCallbackType>(shared_from_this(),
2469 [handle = m_handle, component](void* ptr, void* ctx) {
2471 ptr, ctx); },
2472 [handle = m_handle, component] {
2474 nullptr, nullptr); },
2475 callback);
2476 };
2477
2479 {
2480 m_finishedExposureCallback = registerCallback(component);
2481 }
2483 {
2484 m_finishedGainCallback = registerCallback(component);
2485 }
2487 {
2488 m_AnalogGainCallback = registerCallback(component);
2489 }
2491 {
2492 m_DigitalGainCallback = registerCallback(component);
2493 }
2495 {
2496 m_CombinedGainCallback = registerCallback(component);
2497 }
2499 {
2500 m_HostGainCallback = registerCallback(component);
2501 }
2502 else
2503 {
2505 }
2506}
2507
2509{
2511 {
2512 m_finishedExposureCallback.reset();
2513 }
2515 {
2516 m_finishedGainCallback.reset();
2517 }
2519 {
2520 m_AnalogGainCallback.reset();
2521 }
2523 {
2524 m_DigitalGainCallback.reset();
2525 }
2527 {
2528 m_CombinedGainCallback.reset();
2529 }
2531 {
2532 m_HostGainCallback.reset();
2533 }
2534 else
2535 {
2537 }
2538}
2539
2540inline void Controller::RegisterDataProcessingCallback(const callback::DataProcessingCallback& callback)
2541{
2542 m_dataProcessingCallback = std::make_unique<DataProcessingCallbackType>(shared_from_this(),
2543 [handle = m_handle](void* ptr, void* ctx) {
2544 return PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Callback_Set(handle, PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING_DATA, ptr, ctx); },
2545 [handle = m_handle] {
2546 PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Callback_Set(handle, PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING_DATA, nullptr, nullptr);},
2547 callback);
2548}
2549
2550inline void Controller::RegisterProcessingCallback(const callback::ProcessingCallback& callback)
2551{
2552 m_ProcessingCallback = std::make_unique<ProcessingCallbackType>(shared_from_this(),
2553 [handle = m_handle](void* ptr, void* ctx) {
2554 return PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Callback_Set(handle, PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING, ptr, ctx); },
2555 [handle = m_handle] {
2556 PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Callback_Set(handle, PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING, nullptr, nullptr);},
2557 callback);
2558}
2559
2561{
2562 m_ProcessingCallback.reset();
2563}
2564
2566{
2567 m_dataProcessingCallback.reset();
2568}
2569
2571{
2572 peak_afl_BOOL8 supported{};
2573 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Weighted_ROI_IsSupported(m_handle, &supported);
2574 if (ret != PEAK_AFL_STATUS_SUCCESS)
2575 {
2576 throw error::Exception(ret);
2577 }
2578
2579 return supported;
2580}
2581
2582inline void Controller::SetWeightedROIs(const std::vector<peak_afl_weighted_rectangle>& list)
2583{
2584 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Weighted_ROI_Set(m_handle, list.data(), static_cast<uint32_t>(list.size()));
2585 if (ret != PEAK_AFL_STATUS_SUCCESS)
2586 {
2587 throw error::Exception(ret);
2588 }
2589}
2590
2592{
2593 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Weighted_ROI_Set(m_handle, &rect, 1);
2594 if (ret != PEAK_AFL_STATUS_SUCCESS)
2595 {
2596 throw error::Exception(ret);
2597 }
2598}
2599
2601{
2602 peak_afl_size minSize{};
2603 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Weighted_ROI_Min_Size(m_handle, &minSize);
2604 if (ret != PEAK_AFL_STATUS_SUCCESS)
2605 {
2606 throw error::Exception(ret);
2607 }
2608 return minSize;
2609}
2610
2611inline std::vector<peak_afl_weighted_rectangle> Controller::GetWeightedROIs() const
2612{
2613 std::vector<peak_afl_weighted_rectangle> list;
2614 std::uint32_t listSize{};
2615
2616 auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Weighted_ROI_Get(m_handle, nullptr, &listSize);
2617 if (ret != PEAK_AFL_STATUS_SUCCESS)
2618 {
2619 throw error::Exception(ret);
2620 }
2621
2622 list.resize(listSize);
2623
2624 ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Weighted_ROI_Get(m_handle, list.data(), &listSize);
2625 if (ret != PEAK_AFL_STATUS_SUCCESS)
2626 {
2627 throw error::Exception(ret);
2628 }
2629
2630 return list;
2631}
2632
2634{
2635 peak_afl_BOOL8 supported{};
2636 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Limit_IsSupported(m_handle, &supported);
2637 if (ret != PEAK_AFL_STATUS_SUCCESS)
2638 {
2639 throw error::Exception(ret);
2640 }
2641
2642 return supported;
2643}
2644
2646{
2647 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Limit_Set(m_handle, limit);
2648 if (ret != PEAK_AFL_STATUS_SUCCESS)
2649 {
2650 throw error::Exception(ret);
2651 }
2652}
2653
2655{
2657 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Limit_Get(m_handle, &limit);
2658 if (ret != PEAK_AFL_STATUS_SUCCESS)
2659 {
2660 throw error::Exception(ret);
2661 }
2662 return limit;
2663}
2664
2666{
2668 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Limit_Default(m_handle, &limit);
2669 if (ret != PEAK_AFL_STATUS_SUCCESS)
2670 {
2671 throw error::Exception(ret);
2672 }
2673 return limit;
2674}
2675
2677{
2678 peak_afl_BOOL8 supported{};
2679 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Hysteresis_IsSupported(m_handle, &supported);
2680 if (ret != PEAK_AFL_STATUS_SUCCESS)
2681 {
2682 throw error::Exception(ret);
2683 }
2684
2685 return supported;
2686}
2687
2688inline void Controller::SetHysteresis(std::uint8_t hysteresis)
2689{
2690 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Hysteresis_Set(m_handle, hysteresis);
2691 if (ret != PEAK_AFL_STATUS_SUCCESS)
2692 {
2693 throw error::Exception(ret);
2694 }
2695}
2696
2697inline std::uint8_t Controller::GetHysteresis() const
2698{
2699 std::uint8_t hysteresis{};
2700 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Hysteresis_Get(m_handle, &hysteresis);
2701 if (ret != PEAK_AFL_STATUS_SUCCESS)
2702 {
2703 throw error::Exception(ret);
2704 }
2705
2706 return hysteresis;
2707}
2708
2709inline std::uint8_t Controller::GetDefaultHysteresis() const
2710{
2711 std::uint8_t hysteresis{};
2712 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Hysteresis_Default(m_handle, &hysteresis);
2713 if (ret != PEAK_AFL_STATUS_SUCCESS)
2714 {
2715 throw error::Exception(ret);
2716 }
2717
2718 return hysteresis;
2719}
2720
2722{
2723 Range<std::uint8_t> hysteresis{};
2724 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_Hysteresis_GetRange(
2725 m_handle, &hysteresis.min, &hysteresis.max, &hysteresis.inc);
2726 if (ret != PEAK_AFL_STATUS_SUCCESS)
2727 {
2728 throw error::Exception(ret);
2729 }
2730
2731 return hysteresis;
2732}
2733
2734PEAK_AFL_NO_DISCARD inline bool Controller::IsBrightnessComponentModeSupported() const
2735{
2736 peak_afl_BOOL8 supported{};
2737 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_BrightnessComponent_Mode_IsSupported(m_handle, &supported);
2738 if (ret != PEAK_AFL_STATUS_SUCCESS)
2739 {
2740 throw error::Exception(ret);
2741 }
2742
2743 return supported;
2744}
2745
2747{
2748 peak_afl_BOOL8 supported{};
2749 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_BrightnessComponent_Unit_IsSupported(m_handle, component, &supported);
2750 if (ret != PEAK_AFL_STATUS_SUCCESS)
2751 {
2752 throw error::Exception(ret);
2753 }
2754
2755 return supported;
2756}
2757
2760{
2761 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_BrightnessComponent_Mode_Set(m_handle, component, mode);
2762 if (ret != PEAK_AFL_STATUS_SUCCESS)
2763 {
2764 throw error::Exception(ret);
2765 }
2766}
2767
2770{
2772 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_BrightnessComponent_Mode_Get(m_handle, component, &mode);
2773 if (ret != PEAK_AFL_STATUS_SUCCESS)
2774 {
2775 throw error::Exception(ret);
2776 }
2777 return mode;
2778}
2779
2782{
2784 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_BrightnessComponent_Status(m_handle, component, &status);
2785 if (ret != PEAK_AFL_STATUS_SUCCESS)
2786 {
2787 throw error::Exception(ret);
2788 }
2789 return status;
2790}
2791
2793{
2794 peak_afl_BOOL8 supported{};
2795 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainLimit_IsSupported(m_handle, &supported);
2796 if (ret != PEAK_AFL_STATUS_SUCCESS)
2797 {
2798 throw error::Exception(ret);
2799 }
2800
2801 return supported;
2802}
2803
2805{
2806 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainLimit_Set(m_handle, limit);
2808 {
2809 // Do nothing. Not an error.
2810 }
2811 else if (ret != PEAK_AFL_STATUS_SUCCESS)
2812 {
2813 throw error::Exception(ret);
2814 }
2815}
2816
2818{
2819 peak_afl_double_limit limit{};
2820 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainLimit_Get(m_handle, &limit);
2821 if (ret != PEAK_AFL_STATUS_SUCCESS)
2822 {
2823 throw error::Exception(ret);
2824 }
2825
2826 return limit;
2827}
2828
2830{
2831 peak_afl_double_limit limit{};
2832 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainLimit_GetRange(m_handle, &limit);
2833 if (ret != PEAK_AFL_STATUS_SUCCESS)
2834 {
2835 throw error::Exception(ret);
2836 }
2837
2838 return limit;
2839}
2840
2842{
2843 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainAnalogLimit_Set(m_handle, limit);
2845 {
2846 // Do nothing. Not an error.
2847 }
2848 else if (ret != PEAK_AFL_STATUS_SUCCESS)
2849 {
2850 throw error::Exception(ret);
2851 }
2852}
2853
2855{
2856 peak_afl_double_limit limit{};
2857 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainAnalogLimit_Get(m_handle, &limit);
2858 if (ret != PEAK_AFL_STATUS_SUCCESS)
2859 {
2860 throw error::Exception(ret);
2861 }
2862
2863 return limit;
2864}
2865
2867{
2868 peak_afl_double_limit limit{};
2869 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainAnalogLimit_GetRange(m_handle, &limit);
2870 if (ret != PEAK_AFL_STATUS_SUCCESS)
2871 {
2872 throw error::Exception(ret);
2873 }
2874
2875 return limit;
2876}
2877
2879{
2880 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainDigitalLimit_Set(m_handle, limit);
2882 {
2883 // Do nothing. Not an error.
2884 }
2885 else if (ret != PEAK_AFL_STATUS_SUCCESS)
2886 {
2887 throw error::Exception(ret);
2888 }
2889}
2890
2892{
2893 peak_afl_double_limit limit{};
2894 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainDigitalLimit_Get(m_handle, &limit);
2895 if (ret != PEAK_AFL_STATUS_SUCCESS)
2896 {
2897 throw error::Exception(ret);
2898 }
2899
2900 return limit;
2901}
2902
2904{
2905 peak_afl_double_limit limit{};
2906 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainDigitalLimit_GetRange(m_handle, &limit);
2907 if (ret != PEAK_AFL_STATUS_SUCCESS)
2908 {
2909 throw error::Exception(ret);
2910 }
2911
2912 return limit;
2913}
2914
2916{
2917 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainCombinedLimit_Set(m_handle, limit);
2919 {
2920 // Do nothing. Not an error.
2921 }
2922 else if (ret != PEAK_AFL_STATUS_SUCCESS)
2923 {
2924 throw error::Exception(ret);
2925 }
2926}
2927
2929{
2930 peak_afl_double_limit limit{};
2931 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainCombinedLimit_Get(m_handle, &limit);
2932 if (ret != PEAK_AFL_STATUS_SUCCESS)
2933 {
2934 throw error::Exception(ret);
2935 }
2936
2937 return limit;
2938}
2939
2941{
2942 peak_afl_double_limit limit{};
2943 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainCombinedLimit_GetRange(m_handle, &limit);
2944 if (ret != PEAK_AFL_STATUS_SUCCESS)
2945 {
2946 throw error::Exception(ret);
2947 }
2948
2949 return limit;
2950}
2951
2953{
2954 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainHostLimit_Set(m_handle, limit);
2956 {
2957 // Do nothing. Not an error.
2958 }
2959 else if (ret != PEAK_AFL_STATUS_SUCCESS)
2960 {
2961 throw error::Exception(ret);
2962 }
2963}
2964
2966{
2967 peak_afl_double_limit limit{};
2968 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainHostLimit_Get(m_handle, &limit);
2969 if (ret != PEAK_AFL_STATUS_SUCCESS)
2970 {
2971 throw error::Exception(ret);
2972 }
2973
2974 return limit;
2975}
2976
2978{
2979 peak_afl_double_limit limit{};
2980 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_GainHostLimit_GetRange(m_handle, &limit);
2981 if (ret != PEAK_AFL_STATUS_SUCCESS)
2982 {
2983 throw error::Exception(ret);
2984 }
2985
2986 return limit;
2987}
2988
2990{
2991 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_ExposureLimit_Set(m_handle, limit);
2992 if (ret != PEAK_AFL_STATUS_SUCCESS)
2993 {
2994 throw error::Exception(ret);
2995 }
2996}
2997
2999{
3000 peak_afl_double_limit limit{};
3001 const auto ret = PEAK_AFL_C_ABI_PREFIX peak_afl_AutoController_ExposureLimit_Get(m_handle, &limit);
3002 if (ret != PEAK_AFL_STATUS_SUCCESS)
3003 {
3004 throw error::Exception(ret);
3005 }
3006
3007 return limit;
3008}
3009
3010} /* namespace afl */
3011} /* namespace peak */
The Controller class.
Definition peak_afl.hpp:552
PEAK_AFL_NO_DISCARD peak_afl_controllerType Type() const
Get the controller type.
Definition peak_afl.hpp:2323
void SetROIPreset(peak_afl_roi_preset preset)
Set the autofeature region of interest preset for a controller.
Definition peak_afl.hpp:2087
void SetBrightnessAlgorithm(peak_afl_controller_brightness_algorithm algorithm)
Set the autofeature brightness algorithm for a controller.
Definition peak_afl.hpp:2140
PEAK_AFL_NO_DISCARD bool IsAutoPercentileSupported() const
check if auto percentile is supported for a controller.
Definition peak_afl.hpp:2280
PEAK_AFL_NO_DISCARD bool IsAutoToleranceSupported() const
check if auto tolerance is supported for a controller.
Definition peak_afl.hpp:2237
peak_afl_double_limit GetGainLimit() const
Get autofeature gain limit for a controller.
Definition peak_afl.hpp:2817
void SetGainLimit(peak_afl_double_limit limit)
Set the gain limit for a controller.
Definition peak_afl.hpp:2804
PEAK_AFL_NO_DISCARD std::uint8_t GetDefaultHysteresis() const
Get the autofeature hysteresis default.
Definition peak_afl.hpp:2709
PEAK_AFL_NO_DISCARD std::uint8_t GetHysteresis() const
Get the autofeature hysteresis for a controller.
Definition peak_afl.hpp:2697
void SetGainCombinedLimit(peak_afl_double_limit limit)
Set the combined gain limit for a controller.
Definition peak_afl.hpp:2915
void SetMode(peak_afl_controller_automode mode)
Set the autofeature mode for a controller.
Definition peak_afl.hpp:2108
PEAK_AFL_NO_DISCARD bool IsROISupported() const
Check if setting a region of interest is supported for a controller.
Definition peak_afl.hpp:2043
void SetGainHostLimit(peak_afl_double_limit limit)
Set the host gain limit for a controller.
Definition peak_afl.hpp:2952
void SetWeightedROIs(const std::vector< peak_afl_weighted_rectangle > &list)
Set the autofeature weighted region of interest for a controller.
Definition peak_afl.hpp:2582
void UnRegisterFinishedCallback()
Reset the finished callback for a controller.
Definition peak_afl.hpp:2454
peak_afl_double_limit GetGainDigitalLimit() const
Get autofeature digital gain limit for a controller.
Definition peak_afl.hpp:2891
PEAK_AFL_NO_DISCARD Range< std::uint32_t > GetSkipFramesRange() const
Get range for frames skipped for a controller.
Definition peak_afl.hpp:2031
PEAK_AFL_NO_DISCARD bool IsROIPresetSupported() const
Check if ROI preset is supported for a controller.
Definition peak_afl.hpp:2075
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:2758
PEAK_AFL_NO_DISCARD std::uint8_t GetLastAutoAverage() const
Get the last auto average for a controller.
Definition peak_afl.hpp:2172
PEAK_AFL_NO_DISCARD peak_afl_controller_limit GetLimit() const
Get the autofeature limit for a controller.
Definition peak_afl.hpp:2654
void SetHysteresis(std::uint8_t hysteresis)
Set the autofeature hysteresis for a controller.
Definition peak_afl.hpp:2688
void SetExposureLimit(peak_afl_double_limit limit)
Set the exposure limit for a controller.
Definition peak_afl.hpp:2989
void SetSkipFrames(std::uint32_t count)
Set number of frames skipped for a controller.
Definition peak_afl.hpp:2010
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:2422
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:2768
PEAK_AFL_NO_DISCARD bool IsModeSupported() const
Check if auto mode is supported for a controller.
Definition peak_afl.hpp:2096
PEAK_AFL_NO_DISCARD Range< std::uint32_t > GetAutoToleranceRange() const
Get the auto tolerance range for a controller.
Definition peak_afl.hpp:2269
void SetGainAnalogLimit(peak_afl_double_limit limit)
Set the analog gain limit for a controller.
Definition peak_afl.hpp:2841
void SetAutoPercentile(double percentile)
Set the auto percentile for a controller.
Definition peak_afl.hpp:2292
void UnRegisterProcessingCallback()
Reset the data callback for a controller.
Definition peak_afl.hpp:2560
PEAK_AFL_NO_DISCARD peak_afl_rectangle GetROI() const
Get the autofeature region of interest for a controller.
Definition peak_afl.hpp:2064
peak_afl_double_limit GetExposureLimit() const
Get autofeature exposure limit for a controller.
Definition peak_afl.hpp:2998
void UnRegisterDataProcessingCallback()
Reset the data callback for a controller.
Definition peak_afl.hpp:2565
peak_afl_double_limit GetGainCombinedLimitRange() const
Get autofeature combined gain limit range for a controller.
Definition peak_afl.hpp:2940
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:2367
~Controller()
Definition peak_afl.hpp:1989
void RegisterDataProcessingCallback(const callback::DataProcessingCallback &callback)
Set the data callback for a controller.
Definition peak_afl.hpp:2540
PEAK_AFL_NO_DISCARD bool IsSharpnessAlgorithmSupported() const
check setting a sharpness algorithm is supported by a controller.
Definition peak_afl.hpp:2389
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:2780
void UnRegisterComponentCallback(peak_afl_controller_brightness_component component)
Reset the component callback for a controller.
Definition peak_afl.hpp:2508
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:2183
PEAK_AFL_NO_DISCARD std::uint32_t GetAutoTolerance() const
Get the current auto tolerance for a controller.
Definition peak_afl.hpp:2258
void SetAlgorithm(peak_afl_controller_algorithm algorithm)
Set the used algorithm for a controller.
Definition peak_afl.hpp:2346
peak_afl_double_limit GetGainDigitalLimitRange() const
Get autofeature digital gain limit range for a controller.
Definition peak_afl.hpp:2903
void SetROI(peak_afl_rectangle rect)
Set the autofeature region of interest for a controller.
Definition peak_afl.hpp:2055
peak_afl_double_limit GetGainAnalogLimitRange() const
Get autofeature analog gain limit range for a controller.
Definition peak_afl.hpp:2866
PEAK_AFL_NO_DISCARD bool IsSkipFramesSupported() const
Check if skip frames is supported for a controller.
Definition peak_afl.hpp:1998
PEAK_AFL_NO_DISCARD peak_afl_controller_limit GetDefaultLimit() const
Get the autofeature default limit.
Definition peak_afl.hpp:2665
PEAK_AFL_NO_DISCARD bool IsLimitSupported() const
Check if limit is supported for a controller.
Definition peak_afl.hpp:2633
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:2600
PEAK_AFL_NO_DISCARD peak_afl_controller_automode GetMode() const
Get the current autofeature mode for a controller.
Definition peak_afl.hpp:2117
static PEAK_AFL_NO_DISCARD std::shared_ptr< Controller > Create(peak_afl_controllerType type)
Create a new controller.
Definition peak_afl.hpp:1977
void RegisterFinishedCallback(const callback::FinishedCallback &callback)
Set finished callback for a controller.
Definition peak_afl.hpp:2444
PEAK_AFL_NO_DISCARD peak_afl_controller_algorithm GetAlgorithm() const
Get the used algorithm for a controller.
Definition peak_afl.hpp:2355
PEAK_AFL_NO_DISCARD bool IsBrightnessAlgorithmSupported() const
Check if auto brightness algorithm is supported for a controller.
Definition peak_afl.hpp:2128
peak_afl_double_limit GetGainCombinedLimit() const
Get autofeature combined gain limit for a controller.
Definition peak_afl.hpp:2928
PEAK_AFL_NO_DISCARD bool IsGainLimitSupported() const
Check if auto gain limit is supported for a controller.
Definition peak_afl.hpp:2792
peak_afl_double_limit GetGainLimitRange() const
Get autofeature gain limit range for a controller.
Definition peak_afl.hpp:2829
void SetWeightedROI(const peak_afl_weighted_rectangle &rect)
Set single autofeature weighted region of interest for a controller.
Definition peak_afl.hpp:2591
PEAK_AFL_NO_DISCARD std::uint32_t GetSkipFrames() const
Get number of frames skipped for a controller.
Definition peak_afl.hpp:2019
PEAK_AFL_NO_DISCARD peak_afl_controller_sharpness_algorithm GetSharpnessAlgorithm() const
Get the used sharpness algorithm for a controller.
Definition peak_afl.hpp:2410
PEAK_AFL_NO_DISCARD peak_afl_controller_status Status() const
Get the status for a controller.
Definition peak_afl.hpp:2160
PEAK_AFL_NO_DISCARD bool IsBrightnessComponentUnitSupported(peak_afl_controller_brightness_component component) const
Check if a specific unit is supported for a brightness controller component.
Definition peak_afl.hpp:2746
void SetGainDigitalLimit(peak_afl_double_limit limit)
Set the digital gain limit for a controller.
Definition peak_afl.hpp:2878
PEAK_AFL_NO_DISCARD bool IsAlgorithmSupported() const
check if setting an algorithm is supported for a controller.
Definition peak_afl.hpp:2334
PEAK_AFL_NO_DISCARD Range< double > GetAutoPercentileRange() const
Get the auto percentile range for a controller.
Definition peak_afl.hpp:2312
PEAK_AFL_NO_DISCARD double GetAutoPercentile() const
Get the auto percentile for a controller.
Definition peak_afl.hpp:2301
PEAK_AFL_NO_DISCARD peak_afl_controller_brightness_algorithm GetBrightnessAlgorithm() const
Get the current autofeature brightness algorithm for a controller.
Definition peak_afl.hpp:2149
peak_afl_double_limit GetGainAnalogLimit() const
Get autofeature analog gain limit for a controller.
Definition peak_afl.hpp:2854
void SetAutoTarget(uint32_t target)
Set the auto target for a controller.
Definition peak_afl.hpp:2206
PEAK_AFL_NO_DISCARD bool IsBrightnessComponentModeSupported() const
Check if auto mode is supported for a brightness controller component.
Definition peak_afl.hpp:2734
peak_afl_double_limit GetGainHostLimit() const
Get autofeature host gain limit for a controller.
Definition peak_afl.hpp:2965
void SetAutoTolerance(std::uint32_t tolerance)
Set the auto tolerance for a controller.
Definition peak_afl.hpp:2249
PEAK_AFL_NO_DISCARD std::uint32_t GetAutoTarget() const
Get the currently set auto target for a controller.
Definition peak_afl.hpp:2215
PEAK_AFL_NO_DISCARD Range< std::uint32_t > GetAutoTargetRange() const
Get the auto target range for a controller.
Definition peak_afl.hpp:2226
PEAK_AFL_NO_DISCARD Range< std::uint8_t > GetHysteresisRange() const
Get autofeature hysteresis range for a controller.
Definition peak_afl.hpp:2721
void SetLimit(peak_afl_controller_limit limit)
Set the autofeature limit for a controller.
Definition peak_afl.hpp:2645
PEAK_AFL_NO_DISCARD bool IsWeightedROISupported() const
Check if weighted region of interest is supported for a controller.
Definition peak_afl.hpp:2570
PEAK_AFL_NO_DISCARD bool IsHysteresisSupported() const
Check if hysteresis is supported for a controller.
Definition peak_afl.hpp:2676
void RegisterComponentCallback(peak_afl_controller_brightness_component component, const callback::FinishedCallback &callback)
Set component callback for a controller.
Definition peak_afl.hpp:2459
void SetSharpnessAlgorithm(peak_afl_controller_sharpness_algorithm algorithm)
Set the used sharpness algorithm for a controller.
Definition peak_afl.hpp:2401
void RegisterProcessingCallback(const callback::ProcessingCallback &callback)
Set the data callback for a controller.
Definition peak_afl.hpp:2550
peak_afl_double_limit GetGainHostLimitRange() const
Get autofeature host gain limit range for a controller.
Definition peak_afl.hpp:2977
PEAK_AFL_NO_DISCARD bool IsAutoTargetSupported() const
check if auto target is supported for a controller.
Definition peak_afl.hpp:2194
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:2611
The autofeature manager.
Definition peak_afl.hpp:306
PEAK_AFL_NO_DISCARD bool IsControllerSupported(peak_afl_controllerType type) const
Get if the given controller type is supported.
Definition peak_afl.hpp:1964
Manager(const std::shared_ptr< peak::core::NodeMap > &node_map)
Create an automanager instance.
Definition peak_afl.hpp:1746
void RemoveController(const std::shared_ptr< Controller > &controller)
Remove a controller from an automanager.
Definition peak_afl.hpp:1820
PEAK_AFL_NO_DISCARD std::shared_ptr< Controller > GetController(peak_afl_controllerType type) const
Get the controller for a type.
Definition peak_afl.hpp:1946
void DestroyAllController()
Destroy all controllers for a manager.
Definition peak_afl.hpp:1863
void DestroyController(const std::shared_ptr< Controller > &controller)
Destroy a controller.
Definition peak_afl.hpp:1881
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:1846
void SetCCM(std::array< float, 9 > ccm)
Set the Color Correction Matrix (CCM)
Definition peak_afl.hpp:1909
PEAK_AFL_NO_DISCARD size_t ControllerCount() const
Get the list count of the controller associated with the manager.
Definition peak_afl.hpp:1941
PEAK_AFL_NO_DISCARD bool Status() const
Get the status of a manager.
Definition peak_afl.hpp:1918
~Manager()
Destructor of an automanager instance.
Definition peak_afl.hpp:1760
void SetGainIPL(const peak::ipl::Gain &gain)
Sets the ipl gain.
Definition peak_afl.hpp:1900
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:1930
void AddController(const std::shared_ptr< Controller > &controller)
Add a controller to an automanager.
Definition peak_afl.hpp:1798
void Process(const peak::ipl::Image &image) const
Process an image.
Definition peak_afl.hpp:1837
General Error type.
Definition peak_afl.hpp:203
PEAK_AFL_NO_DISCARD const char * what() const noexcept override
Get the string representation for the exception.
Definition peak_afl.hpp:233
static PEAK_AFL_NO_DISCARD std::string translateCode(peak_afl_status status)
Get a string representation for an error code.
Definition peak_afl.hpp:254
PEAK_AFL_NO_DISCARD peak_afl_status code() const
Get the return code for the failure.
Definition peak_afl.hpp:221
Base class for all exceptions thrown by the library.
Definition peak_common_exceptions.hpp:37
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_AutoPercentile_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if auto percentile is supported for a controller.
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_AutoPercentile_Get(peak_afl_controller_handle controller, double *percentile)
Get the auto percentile for a controller.
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_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_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_AutoTarget_Set(peak_afl_controller_handle controller, uint32_t target)
Set the auto target 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_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_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_AutoTolerance_Get(peak_afl_controller_handle controller, uint32_t *tolerance)
Get the current auto tolerance for a controller.
peak_afl_controllerType
Auto feature controller types.
Definition peak_afl.h:223
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_API_STATUS peak_afl_AutoController_Create(peak_afl_controller_handle *controller, peak_afl_controllerType controllerType)
Create a new auto feature 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_Destroy(peak_afl_controller_handle controller)
Destroy a standalone controller.
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_AddController(peak_afl_manager_handle handle, peak_afl_controller_handle controller)
Add a controller to an auto manager instance.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_SetCCM(peak_afl_manager_handle handle, float *ccm, size_t ccm_size)
Set the Color Correction Matrix (CCM) for image processing.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Process(peak_afl_manager_handle handle, PEAK_IPL_IMAGE_HANDLE imageHandle)
Process an image through the auto feature pipeline.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_DestroyController(peak_afl_manager_handle handle, peak_afl_controller_handle controller)
Destroy a controller from a manager.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Status(peak_afl_manager_handle handle, peak_afl_BOOL8 *running)
Get the processing status of an auto feature 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 associated with a manager.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_Controller_IsSupported(peak_afl_manager_handle handle, peak_afl_controllerType controllerType, peak_afl_BOOL8 *supported)
Check if a controller type is supported by the manager.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_SetGainIPL(peak_afl_manager_handle handle, PEAK_IPL_GAIN_HANDLE gainHandle)
Set the IPL Gain for image processing.
PEAK_AFL_API_STATUS peak_afl_AutoFeatureManager_RemoveController(peak_afl_manager_handle handle, peak_afl_controller_handle controller)
Remove a controller from an auto feature manager instance.
PEAK_AFL_API_STATUS peak_afl_AutoController_BrightnessAlgorithm_Set(peak_afl_controller_handle controller, peak_afl_controller_brightness_algorithm algorithm)
Set the brightness analysis algorithm for a controller.
peak_afl_controller_brightness_algorithm
Brightness calculation algorithms.
Definition peak_afl.h:505
PEAK_AFL_API_STATUS peak_afl_AutoController_BrightnessAlgorithm_Get(peak_afl_controller_handle controller, peak_afl_controller_brightness_algorithm *algorithm)
Get the current brightness analysis algorithm for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_BrightnessAlgorithm_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if brightness algorithm configuration is supported 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 function for a specific brightness component.
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 operational status for a specific brightness component.
peak_afl_controller_brightness_component
Brightness control components.
Definition peak_afl.h:609
PEAK_AFL_API_STATUS peak_afl_AutoController_BrightnessComponent_Unit_IsSupported(peak_afl_controller_handle controller, peak_afl_controller_brightness_component unit, peak_afl_BOOL8 *supported)
Check if a specific brightness component unit is supported for a controller.
@ PEAK_AFL_CONTROLLER_BRIGHTNESS_COMPONENT_ANALOG_GAIN
Analog gain control.
Definition peak_afl.h:651
@ PEAK_AFL_CONTROLLER_BRIGHTNESS_COMPONENT_GAIN
Generic gain control.
Definition peak_afl.h:639
@ PEAK_AFL_CONTROLLER_BRIGHTNESS_COMPONENT_COMBINED_GAIN
Combined analog and digital gain.
Definition peak_afl.h:675
@ PEAK_AFL_CONTROLLER_BRIGHTNESS_COMPONENT_HOST_GAIN
Host-based software gain.
Definition peak_afl.h:687
@ PEAK_AFL_CONTROLLER_BRIGHTNESS_COMPONENT_DIGITAL_GAIN
Digital gain control.
Definition peak_afl.h:663
@ PEAK_AFL_CONTROLLER_BRIGHTNESS_COMPONENT_EXPOSURE
Camera exposure time control.
Definition peak_afl.h:628
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 automatic mode for a specific brightness component.
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 automatic mode for a specific brightness component.
PEAK_AFL_API_STATUS peak_afl_AutoController_BrightnessComponent_Mode_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if brightness component mode configuration is supported for a controller.
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_Callback_Set(peak_afl_controller_handle controller, peak_afl_callback_type type, void *funcPtr, void *context)
Set a callback for a controller.
@ PEAK_AFL_CONTROLLER_CALLBACK_FINISHED
Controller operation finished callback.
Definition peak_afl.h:818
@ PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING_DATA
Legacy processing data callback.
Definition peak_afl.h:832
@ PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING
Enhanced processing callback.
Definition peak_afl.h:843
void Exit()
Exit the peak_afl auto feature library.
Definition peak_afl.hpp:1700
void Init()
Init the peak_afl auto feature library.
Definition peak_afl.hpp:1690
PEAK_AFL_NO_DISCARD std::string GetLastError()
Get the last error message.
Definition peak_afl.hpp:1722
PEAK_AFL_NO_DISCARD Version_t Version()
Query the library version.
Definition peak_afl.hpp:1709
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:508
PEAK_AFL_API_STATUS peak_afl_AutoController_ExposureLimit_Set(peak_afl_controller_handle controller, peak_afl_double_limit limit)
Set exposure time limits for automatic exposure control.
PEAK_AFL_API_STATUS peak_afl_AutoController_ExposureLimit_Get(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get the current exposure time limits for a controller.
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_controller_algorithm
Focus search algorithms.
Definition peak_afl.h:429
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_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_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_Limit_Default(peak_afl_controller_handle controller, peak_afl_controller_limit *limit)
Get the autofeature default limit.
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_Limit_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if limit is supported for 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_GainAnalogLimit_Get(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature analog gain limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainAnalogLimit_GetRange(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature analog gain limit range for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainAnalogLimit_Set(peak_afl_controller_handle controller, peak_afl_double_limit limit)
Set autofeature analog gain limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainCombinedLimit_Set(peak_afl_controller_handle controller, peak_afl_double_limit limit)
Set autofeature combined gain limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainCombinedLimit_GetRange(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature combined gain limit range for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainCombinedLimit_Get(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature combined gain limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainDigitalLimit_GetRange(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature digital gain limit range for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainDigitalLimit_Get(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature digital gain limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainDigitalLimit_Set(peak_afl_controller_handle controller, peak_afl_double_limit limit)
Set autofeature digital gain limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainHostLimit_Get(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature host gain limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainHostLimit_Set(peak_afl_controller_handle controller, peak_afl_double_limit limit)
Set autofeature host gain limit for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_GainHostLimit_GetRange(peak_afl_controller_handle controller, peak_afl_double_limit *limit)
Get autofeature host gain limit range 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_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_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_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_Hysteresis_Set(peak_afl_controller_handle controller, uint8_t hysteresis)
Set the autofeature hysteresis 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_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_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_API_STATUS peak_afl_AutoController_Mode_Get(peak_afl_controller_handle controller, peak_afl_controller_automode *mode)
Get the current automatic processing mode for a controller.
peak_afl_controller_automode
Auto feature controller operation modes.
Definition peak_afl.h:277
PEAK_AFL_API_STATUS peak_afl_AutoController_Mode_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if automatic mode configuration 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 automatic processing mode for a controller.
peak_afl_roi_preset
Predefined ROI preset configurations.
Definition peak_afl.h:1141
PEAK_AFL_API_STATUS peak_afl_AutoController_ROI_Preset_Set(peak_afl_controller_handle controller, peak_afl_roi_preset roiPreset)
Set a predefined region of interest preset 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 feature is supported for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_ROI_Get(peak_afl_controller_handle controller, peak_afl_rectangle *roi)
Get the current region of interest for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_ROI_Set(peak_afl_controller_handle controller, peak_afl_rectangle roi)
Set the region of interest for automatic feature processing.
PEAK_AFL_API_STATUS peak_afl_AutoController_ROI_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if region of interest (ROI) feature is supported 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_SharpnessAlgorithm_Set(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm algorithm)
Set the used sharpness algorithm for a controller.
peak_afl_controller_sharpness_algorithm
Focus sharpness calculation algorithms.
Definition peak_afl.h:541
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_SharpnessAlgorithm_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if setting a sharpness algorithm is supported by a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_SkipFrames_GetRange(peak_afl_controller_handle controller, uint32_t *min, uint32_t *max, uint32_t *inc)
Get the valid range for skip frames count.
PEAK_AFL_API_STATUS peak_afl_AutoController_SkipFrames_Set(peak_afl_controller_handle controller, uint32_t count)
Set number of frames to skip for a controller.
PEAK_AFL_API_STATUS peak_afl_AutoController_SkipFrames_Get(peak_afl_controller_handle controller, uint32_t *count)
Get the current skip frames count 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 feature is supported for a controller.
peak_afl_status
Auto feature library status codes.
Definition peak_afl.h:117
peak_afl_controller_status
Controller operational status.
Definition peak_afl.h:323
@ PEAK_AFL_STATUS_SUCCESS
Operation completed successfully.
Definition peak_afl.h:123
@ PEAK_AFL_STATUS_INVALID_IMAGE_FORMAT
Invalid or unsupported image format.
Definition peak_afl.h:191
@ PEAK_AFL_STATUS_VALUE_ADJUSTED
Parameter value was adjusted.
Definition peak_afl.h:209
@ PEAK_AFL_STATUS_ACCESS_DENIED
Access denied to resource.
Definition peak_afl.h:161
@ PEAK_AFL_STATUS_BUSY
Resource is busy.
Definition peak_afl.h:171
@ PEAK_AFL_STATUS_NOT_SUPPORTED
Feature or operation not supported.
Definition peak_afl.h:199
@ PEAK_AFL_STATUS_INVALID_PARAMETER
Invalid parameter provided.
Definition peak_afl.h:153
@ PEAK_AFL_STATUS_BUFFER_TOO_SMALL
Provided buffer is too small.
Definition peak_afl.h:181
@ PEAK_AFL_STATUS_NOT_INITIALIZED
Library not initialized.
Definition peak_afl.h:143
@ PEAK_AFL_STATUS_ERROR
General error occurred.
Definition peak_afl.h:133
#define PEAK_AFL_FALSE
Boolean false value.
Definition peak_afl.h:1377
uint8_t peak_afl_BOOL8
Custom 8-bit boolean type.
Definition peak_afl.h:1359
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_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_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_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.
C API interface for automatic camera feature control.
void * peak_afl_controller_handle
Opaque handle for auto feature controllers.
Definition peak_afl.h:91
void * peak_afl_manager_handle
Opaque handle for auto feature managers.
Definition peak_afl.h:103
Simple range type.
Definition peak_afl.hpp:530
Version information for ids_peak_afl.
Definition peak_afl.hpp:77
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:108
std::uint32_t minor
Major.
Definition peak_afl.hpp:79
std::uint32_t subminor
Minor.
Definition peak_afl.hpp:80
PEAK_AFL_NO_DISCARD std::string ToString() const
Patch.
Definition peak_afl.hpp:87
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:117
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:98
std::uint32_t patch
Subminor.
Definition peak_afl.hpp:81
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:127
Controller parameter limit range.
Definition peak_afl.h:1300
Floating-point parameter limit range.
Definition peak_afl.h:1330
Generic process data structure.
Definition peak_afl.h:861
2D rectangle structure
Definition peak_afl.h:1228
2D size structure
Definition peak_afl.h:1166
Weighted region of interest for focus control.
Definition peak_afl.h:1270