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" 18 #include <type_traits> 28 #if __cplusplus >= 201703L || _MSVC_LANG >= 201703L 29 # define PEAK_AFL_NO_DISCARD [[nodiscard]] 30 # define PEAK_AFL_MAYBE_UNUSED [[maybe_unused]] 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)) 39 # define PEAK_AFL_NO_DISCARD 40 # define PEAK_AFL_MAYBE_UNUSED 78 PEAK_AFL_NO_DISCARD std::string
ToString()
const 80 return std::to_string(major) +
"." + std::to_string(minor) +
"." + std::to_string(subminor) +
"." 81 + std::to_string(patch);
89 PEAK_AFL_NO_DISCARD uint32_t
Major()
const 99 PEAK_AFL_NO_DISCARD uint32_t
Minor()
const 118 PEAK_AFL_NO_DISCARD uint32_t
Patch()
const 213 PEAK_AFL_NO_DISCARD
const char* what() const noexcept
override 221 return m_text.c_str();
237 return "PEAK_AFL_STATUS_SUCCESS";
240 return "PEAK_AFL_STATUS_ERROR";
243 return "PEAK_AFL_STATUS_NOT_INITIALIZED";
246 return "PEAK_AFL_STATUS_INVALID_PARAMETER";
249 return "PEAK_AFL_STATUS_ACCESS_DENIED";
252 return "PEAK_AFL_STATUS_BUSY";
255 return "PEAK_AFL_STATUS_BUFFER_TOO_SMALL";
258 return "PEAK_AFL_STATUS_INVALID_IMAGE_FORMAT";
261 return "PEAK_AFL_STATUS_NOT_SUPPORTED";
264 return "Unknown Status code";
270 std::string m_text{};
292 inline explicit Manager(
const std::shared_ptr<peak::core::NodeMap>& node_map);
315 inline void AddController(
const std::shared_ptr<Controller>& controller);
327 inline void RemoveController(
const std::shared_ptr<Controller>& controller);
338 inline void Process(
const peak::ipl::Image& image)
const;
361 inline void DestroyAllController();
372 inline void DestroyController(
const std::shared_ptr<Controller>& controller);
381 inline void SetGainIPL(
const peak::ipl::Gain& gain);
392 PEAK_AFL_NO_DISCARD
inline bool Status()
const;
399 PEAK_AFL_NO_DISCARD
inline std::vector<std::shared_ptr<Controller>> ControllerList()
const;
406 PEAK_AFL_NO_DISCARD
inline size_t ControllerCount()
const;
420 std::vector<std::shared_ptr<Controller>> m_controllerList;
421 mutable std::mutex m_mutex{};
434 template<
typename... ControllerTypes>
435 std::tuple<Manager, std::vector<std::shared_ptr<Controller>>>
436 CreateManager(
const std::shared_ptr<peak::core::NodeMap>& node_map, ControllerTypes... types)
438 constexpr
int size =
sizeof...(types);
439 constexpr std::array<peak_afl_controllerType, size> controller_types{types...};
440 std::vector<std::shared_ptr<Controller>> controller{};
442 controller.reserve(size);
444 std::for_each(controller_types.cbegin(), controller_types.cend(), [&manager, &controller](
peak_afl_controllerType type) {
445 controller.emplace_back(std::move(manager.CreateController(type)));
448 return { std::move(manager), std::move(controller) };
456 template <typename T, typename std::enable_if_t<std::is_arithmetic<T>::value,
int> = 0>
466 using FinishedCallback = std::function<void(void)>;
467 using DataProcessingCallback = std::function<void(int, int)>;
468 using ComponentCallback = std::function<void(void)>;
470 using RegisterFunction = std::function<PEAK_AFL_API_STATUS(void*, void*)>;
471 using UnRegisterFunction = std::function<void()>;
478 class Controller :
public std::enable_shared_from_this<Controller>
487 template<
typename R,
typename ...Args>
488 Callback(
const std::shared_ptr<peak::afl::Controller>& controller, callback::RegisterFunction register_function,
489 callback::UnRegisterFunction unregister_function, std::function<R(Args...)> callback) :
490 m_callback(std::move(callback)),
491 m_unregister_function(std::move(unregister_function))
493 const auto ret = register_function(reinterpret_cast<void*>(&Callback::Func<Args...>),
this);
498 m_controller = controller;
503 if (
auto controller = m_controller.lock())
505 m_unregister_function();
510 template<
typename ...Args>
511 static void Func(Args... args,
void* ptr)
513 static_cast<Callback *
>(ptr)->m_callback(args...);
517 std::weak_ptr<peak::afl::Controller> m_controller{};
518 callback::UnRegisterFunction m_unregister_function{};
531 : m_handle(handle) {};
562 PEAK_AFL_NO_DISCARD
inline bool IsSkipFramesSupported()
const;
573 inline void SetSkipFrames(std::uint32_t count);
584 PEAK_AFL_NO_DISCARD
inline std::uint32_t GetSkipFrames()
const;
604 PEAK_AFL_NO_DISCARD
inline bool IsROISupported()
const;
637 PEAK_AFL_NO_DISCARD
inline bool IsROIPresetSupported()
const;
659 PEAK_AFL_NO_DISCARD
inline bool IsModeSupported()
const;
701 PEAK_AFL_NO_DISCARD
inline std::uint8_t GetLastAutoAverage()
const;
712 PEAK_AFL_NO_DISCARD
inline std::tuple<std::uint8_t, std::uint8_t, std::uint8_t> GetLastAutoAverages()
const;
723 PEAK_AFL_NO_DISCARD
inline bool IsAutoTargetSupported()
const;
735 inline void SetAutoTarget(uint32_t target);
744 PEAK_AFL_NO_DISCARD
inline std::uint32_t GetAutoTarget()
const;
767 PEAK_AFL_NO_DISCARD
inline bool IsAutoToleranceSupported()
const;
778 inline void SetAutoTolerance(std::uint32_t tolerance);
787 PEAK_AFL_NO_DISCARD
inline std::uint32_t GetAutoTolerance()
const;
810 PEAK_AFL_NO_DISCARD
inline bool IsAutoPercentileSupported()
const;
822 inline void SetAutoPercentile(
double percentile);
831 PEAK_AFL_NO_DISCARD
inline double GetAutoPercentile()
const;
843 PEAK_AFL_NO_DISCARD
inline Range<double> GetAutoPercentileRange()
const;
867 PEAK_AFL_NO_DISCARD
inline bool IsAlgorithmSupported()
const;
897 PEAK_AFL_NO_DISCARD
inline std::vector<peak_afl_controller_algorithm> GetAlgorithmList()
const;
910 PEAK_AFL_NO_DISCARD
inline bool IsSharpnessAlgorithmSupported()
const;
941 PEAK_AFL_NO_DISCARD
inline std::vector<peak_afl_controller_sharpness_algorithm> GetSharpnessAlgorithmList()
const;
946 inline void RegisterFinishedCallback(
const callback::FinishedCallback& callback);
951 inline void UnRegisterFinishedCallback();
967 inline void RegisterDataProcessingCallback(
const callback::DataProcessingCallback& callback);
972 inline void UnRegisterDataProcessingCallback();
983 PEAK_AFL_NO_DISCARD
inline bool IsWeightedROISupported()
const;
994 inline void SetWeightedROIs(
const std::vector<peak_afl_weighted_rectangle>& list);
1014 PEAK_AFL_NO_DISCARD
inline peak_afl_size GetWeightedROIMinSize()
const;
1023 PEAK_AFL_NO_DISCARD
inline std::vector<peak_afl_weighted_rectangle> GetWeightedROIs()
const;
1034 PEAK_AFL_NO_DISCARD
inline bool IsLimitSupported()
const;
1074 PEAK_AFL_NO_DISCARD
inline bool IsHysteresisSupported()
const;
1085 inline void SetHysteresis(std::uint8_t hysteresis);
1094 PEAK_AFL_NO_DISCARD
inline std::uint8_t GetHysteresis()
const;
1103 PEAK_AFL_NO_DISCARD
inline std::uint8_t GetDefaultHysteresis()
const;
1123 PEAK_AFL_NO_DISCARD
inline bool IsBrightnessComponentModeSupported()
const;
1160 using FinishedCallbackType = Callback<callback::FinishedCallback>;
1161 using DataProcessingCallbackType = Callback<callback::DataProcessingCallback>;
1162 using ComponentCallbackType = Callback<callback::ComponentCallback>;
1165 std::unique_ptr<FinishedCallbackType> m_finishedCallback{};
1166 std::unique_ptr<DataProcessingCallbackType> m_dataProcessingCallback{};
1167 std::unique_ptr<ComponentCallbackType> m_finishedExposureCallback{};
1168 std::unique_ptr<ComponentCallbackType> m_finishedGainCallback{};
1196 const auto ret =
peak_afl_GetVersion(&version.major, &version.minor, &version.subminor, &version.patch);
1207 std::size_t lastErrorMessageSize;
1213 return "Cannot get last error!";
1216 std::vector<char> text;
1217 text.resize(lastErrorMessageSize);
1222 return "Cannot get last error!";
1225 return { text.begin(), text.end() };
1233 throw std::runtime_error(
"Invalid node map handle!");
1245 if (m_handle !=
nullptr)
1250 std::lock_guard<std::mutex> lck(m_mutex);
1251 for (
auto& c : m_controllerList)
1253 c->m_handle =
nullptr;
1263 m_handle = other.m_handle;
1264 other.m_handle =
nullptr;
1266 std::lock_guard<std::mutex> lck(other.m_mutex);
1267 m_controllerList = std::move(other.m_controllerList);
1272 m_handle = other.m_handle;
1273 other.m_handle =
nullptr;
1275 std::lock_guard<std::mutex> lck(other.m_mutex);
1276 m_controllerList = std::move(other.m_controllerList);
1283 std::lock_guard<std::mutex> lck(m_mutex);
1285 auto cnt = std::any_of(m_controllerList.begin(), m_controllerList.end(), [controller](
const std::shared_ptr<Controller>& c) {
1286 return c == controller;
1300 m_controllerList.emplace_back(controller);
1305 std::lock_guard<std::mutex> lck(m_mutex);
1313 auto it = std::remove_if(m_controllerList.begin(), m_controllerList.end(), [controller](
const std::shared_ptr<Controller>& c) {
1314 return c == controller;
1317 m_controllerList.erase(it, m_controllerList.end());
1331 std::lock_guard<std::mutex> lck(m_mutex);
1340 auto shared = std::shared_ptr<Controller>(
new Controller(handle));
1341 m_controllerList.emplace_back(shared);
1348 std::lock_guard<std::mutex> lck(m_mutex);
1356 for(
auto& c : m_controllerList)
1358 c->m_handle =
nullptr;
1361 m_controllerList.clear();
1366 std::lock_guard<std::mutex> lck(m_mutex);
1374 auto it = std::remove_if(m_controllerList.begin(), m_controllerList.end(), [controller](
const std::shared_ptr<Controller>& c) {
1375 return c == controller;
1378 m_controllerList.erase(it, m_controllerList.end());
1380 controller->m_handle =
nullptr;
1394 std::uint8_t status;
1406 std::lock_guard<std::mutex> lck(m_mutex);
1408 std::vector<std::shared_ptr<Controller>> controller{};
1410 std::copy(m_controllerList.begin(), m_controllerList.end(), std::back_inserter(controller));
1417 return m_controllerList.size();
1422 std::lock_guard<std::mutex> lck(m_mutex);
1424 auto it = std::find_if(m_controllerList.cbegin(), m_controllerList.cend(), [=](
const std::shared_ptr<Controller>& controller) {
1425 return type == controller->Type();
1428 if(it != m_controllerList.cend())
1447 return std::shared_ptr<Controller>(
new Controller(handle));
1452 if (m_handle !=
nullptr)
1482 std::uint32_t count{};
1603 std::uint8_t average{};
1614 std::uint8_t averageRed{}, averageGreen{}, averageBlue{};
1620 return { averageRed, averageGreen, averageBlue };
1646 std::uint32_t target{};
1689 std::uint32_t tolerance;
1798 std::vector<peak_afl_controller_algorithm> algList{};
1799 std::uint32_t listSize{};
1807 algList.resize(listSize);
1853 std::vector<peak_afl_controller_sharpness_algorithm> algList{};
1854 std::uint32_t listSize{};
1862 algList.resize(listSize);
1875 m_finishedCallback = std::make_unique<FinishedCallbackType>(shared_from_this(),
1876 [handle = m_handle](
void* ptr,
void* ctx) {
1878 [handle = m_handle] {
1885 m_finishedCallback.reset();
1890 if (!IsBrightnessComponentModeSupported())
1897 m_finishedExposureCallback = std::make_unique<ComponentCallbackType>(shared_from_this(),
1898 [handle = m_handle, component](
void* ptr,
void* ctx) {
1901 [handle = m_handle, component] {
1903 nullptr,
nullptr); },
1908 m_finishedGainCallback = std::make_unique<ComponentCallbackType>(shared_from_this(),
1909 [handle = m_handle, component](
void* ptr,
void* ctx) {
1912 [handle = m_handle, component] {
1914 nullptr,
nullptr); },
1927 m_finishedExposureCallback.reset();
1931 m_finishedGainCallback.reset();
1941 m_dataProcessingCallback = std::make_unique<DataProcessingCallbackType>(shared_from_this(),
1942 [handle = m_handle](
void* ptr,
void* ctx) {
1944 [handle = m_handle] {
1951 m_dataProcessingCallback.reset();
1997 std::vector<peak_afl_weighted_rectangle> list;
1998 std::uint32_t listSize{};
2006 list.resize(listSize);
2083 std::uint8_t hysteresis{};
2095 std::uint8_t hysteresis{};
2109 m_handle, &hysteresis.min, &hysteresis.max, &hysteresis.inc);
peak_afl_status peak_afl_GetVersion(uint32_t *majorVersion, uint32_t *minorVersion, uint32_t *subminorVersion, uint32_t *patchVersion)
Query the library version.
std::vector< std::shared_ptr< Controller > > ControllerList() const
Get the list of the controller associated with the manager.
Definition: peak_afl.hpp:1404
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_Get(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm *algorithm)
Get the used sharpness algorithm for a controller.
peak_afl_status peak_afl_AutoFeatureManager_AddController(peak_afl_manager_handle handle, peak_afl_manager_handle controller)
Add a controller to an automanager instance.
peak_afl_controller_algorithm GetAlgorithm() const
Get the used algorithm for a controller.
Definition: peak_afl.hpp:1784
~Controller()
Definition: peak_afl.hpp:1450
Range< std::uint8_t > GetHysteresisRange() const
Get autofeature hysteresis range for a controller.
Definition: peak_afl.hpp:2105
std::vector< peak_afl_controller_algorithm > GetAlgorithmList() const
Get the list of supported algorithms for a controller.
Definition: peak_afl.hpp:1796
void SetWeightedROIs(const std::vector< peak_afl_weighted_rectangle > &list)
Set the autofeature weighted region of interest for a controller.
Definition: peak_afl.hpp:1966
void SetHysteresis(std::uint8_t hysteresis)
Set the autofeature hysteresis for a controller.
Definition: peak_afl.hpp:2072
peak_afl_status peak_afl_AutoController_SkipFrames_Get(peak_afl_controller_handle controller, uint32_t *count)
Get number of frames skipped for a controller.
peak_afl_status peak_afl_AutoController_SkipFrames_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if skip frames is supported for a controller.
peak_afl_controller_sharpness_algorithm
controller sharpness algorithm (focus)
Definition: peak_afl.h:206
peak_afl_status peak_afl_AutoController_AutoPercentile_GetRange(peak_afl_controller_handle controller, double *min, double *max, double *inc)
Get the auto percentile range for a controller.
size_t ControllerCount() const
Get the list count of the controller associated with the manager.
Definition: peak_afl.hpp:1415
peak_afl_status peak_afl_AutoController_SkipFrames_Set(peak_afl_controller_handle controller, uint32_t count)
Set number of frames skipped for a controller.
bool IsAlgorithmSupported() const
check if setting an algorithm is supported for a controller.
Definition: peak_afl.hpp:1763
peak_afl_status peak_afl_AutoController_BrightnessComponent_Mode_Get(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_automode *mode)
Get the current brightness component mode for a controller.
peak_afl_status peak_afl_AutoController_Limit_Default(peak_afl_controller_handle controller, peak_afl_controller_limit *limit)
Get the autofeature default limit.
void UnRegisterComponentCallback(peak_afl_controller_brightness_component component)
Reset the component callback for a controller.
Definition: peak_afl.hpp:1923
peak_afl_status peak_afl_AutoController_Algorithm_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if setting an algorithm is supported for a controller.
peak_afl_status peak_afl_AutoController_ROI_Get(peak_afl_controller_handle controller, peak_afl_rectangle *roi)
Get the autofeature region of interest for a controller.
void Exit()
Exit the peak_afl auto feature library.
Definition: peak_afl.hpp:1183
peak_afl_status peak_afl_AutoController_Algorithm_Get(peak_afl_controller_handle controller, peak_afl_controller_algorithm *algorithm)
Get the used algorithm for a controller.
peak_afl_status peak_afl_AutoController_Weighted_ROI_Get(peak_afl_controller_handle controller, peak_afl_weighted_rectangle *weightedRoiList, uint32_t *listSize)
Get the autofeature weighted region of interest for a controller.
peak_afl_controller_status BrightnessComponentStatus(peak_afl_controller_brightness_component component) const
Get the status for a brightness controller component.
Definition: peak_afl.hpp:2152
peak_afl_status peak_afl_AutoFeatureManager_Status(peak_afl_manager_handle handle, peak_afl_BOOL8 *running)
Get the status of a manager.
std::shared_ptr< Controller > GetController(peak_afl_controllerType type) const
Get the controller for a type.
Definition: peak_afl.hpp:1420
peak_afl_controller_limit GetLimit() const
Get the autofeature limit for a controller.
Definition: peak_afl.hpp:2038
Library not Initialized.
Definition: peak_afl.h:96
peak_afl_status
peak_afl Status codes
Definition: peak_afl.h:87
Definition: peak_afl.hpp:56
std::uint8_t GetDefaultHysteresis() const
Get the autofeature hysteresis default.
Definition: peak_afl.hpp:2093
peak_afl Size (2D)
Definition: peak_afl.h:297
void Init()
Init the peak_afl auto feature library.
Definition: peak_afl.hpp:1173
std::uint32_t GetAutoTarget() const
Get the currently set auto target for a controller.
Definition: peak_afl.hpp:1644
peak_afl_status peak_afl_AutoController_Mode_Get(peak_afl_controller_handle controller, peak_afl_controller_automode *mode)
Get the current autofeature mode for a controller.
std::string GetLastError()
Get the last error message.
Definition: peak_afl.hpp:1205
void SetAutoTolerance(std::uint32_t tolerance)
Set the auto tolerance for a controller.
Definition: peak_afl.hpp:1678
Error.
Definition: peak_afl.h:93
uint32_t Patch() const
Returns the patch part of the version which is the fourth part of the version scheme separated by dot...
Definition: peak_afl.hpp:118
std::uint8_t GetHysteresis() const
Get the autofeature hysteresis for a controller.
Definition: peak_afl.hpp:2081
void RegisterComponentCallback(peak_afl_controller_brightness_component component, const callback::FinishedCallback &callback)
Set component callback for a controller.
Definition: peak_afl.hpp:1888
void SetWeightedROI(const peak_afl_weighted_rectangle &rect)
Set single autofeature weighted region of interest for a controller.
Definition: peak_afl.hpp:1975
void RegisterDataProcessingCallback(const callback::DataProcessingCallback &callback)
Set the data callback for a controller.
Definition: peak_afl.hpp:1939
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:2130
peak_afl_status peak_afl_AutoController_ROI_Set(peak_afl_controller_handle controller, peak_afl_rectangle roi)
Set the autofeature region of interest for a controller.
peak_afl_status peak_afl_AutoController_Weighted_ROI_Set(peak_afl_controller_handle controller, const peak_afl_weighted_rectangle *weightedRoiList, uint32_t listSize)
Set the autofeature weighted region of interest for a controller.
peak_afl_status peak_afl_AutoController_Limit_Get(peak_afl_controller_handle controller, peak_afl_controller_limit *limit)
Get the autofeature limit for a controller.
uint32_t Minor() const
Returns the minor part of the version which is the second part of the version scheme separated by dot...
Definition: peak_afl.hpp:99
Invalid image format.
Definition: peak_afl.h:111
void UnRegisterFinishedCallback()
Reset the finished callback for a controller.
Definition: peak_afl.hpp:1883
peak_afl Rectangle (2D)
Definition: peak_afl.h:331
peak_afl_status peak_afl_AutoController_Callback_Set(peak_afl_controller_handle controller, peak_afl_callback_type type, void *funcPtr, void *context)
Set a callback for a controller.
peak_afl_status peak_afl_AutoController_GetLastAutoAverages(peak_afl_controller_handle controller, uint8_t *averageRed, uint8_t *averageGreen, uint8_t *averageBlue)
Get the last auto average for a controller.
std::vector< peak_afl_controller_sharpness_algorithm > GetSharpnessAlgorithmList() const
Get the list of supported sharpness algorithms for a controller.
Definition: peak_afl.hpp:1851
void SetAutoTarget(uint32_t target)
Set the auto target for a controller.
Definition: peak_afl.hpp:1635
peak_afl_status peak_afl_AutoController_Mode_Set(peak_afl_controller_handle controller, peak_afl_controller_automode mode)
Set the autofeature mode for a controller.
exposure
Definition: peak_afl.h:231
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check setting a sharpness algorithm is supported by a controller.
peak_afl_status peak_afl_AutoController_Type_Get(peak_afl_controller_handle controller, peak_afl_controllerType *type)
Get the controller type.
peak_afl_status peak_afl_AutoController_AutoPercentile_Get(peak_afl_controller_handle controller, double *percentile)
Get the auto percentile for a controller.
std::uint32_t patch
Subminor.
Definition: peak_afl.hpp:72
peak_afl_controller_automode BrightnessComponentGetMode(peak_afl_controller_brightness_component component) const
Get the current autofeature mode for a brightness controller component.
Definition: peak_afl.hpp:2140
peak_afl_status peak_afl_AutoController_ROI_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if setting a region of interest is supported for a controller.
peak_afl Focus Limit
Definition: peak_afl.h:369
void SetSharpnessAlgorithm(peak_afl_controller_sharpness_algorithm algorithm)
Set the used sharpness algorithm for a controller.
Definition: peak_afl.hpp:1830
void SetAlgorithm(peak_afl_controller_algorithm algorithm)
Set the used algorithm for a controller.
Definition: peak_afl.hpp:1775
bool IsWeightedROISupported() const
Check if weighted region of interest is supported for a controller.
Definition: peak_afl.hpp:1954
std::uint32_t GetSkipFrames() const
Get number of frames skipped for a controller.
Definition: peak_afl.hpp:1480
peak_afl_status peak_afl_AutoController_Weighted_ROI_Min_Size(peak_afl_controller_handle controller, peak_afl_size *size)
Get the autofeature minimum size of weighted region of interest for a controller. ...
peak_afl_status peak_afl_AutoController_BrightnessComponent_Mode_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if brightness component is supported for a controller component.
std::string ToString() const
Patch.
Definition: peak_afl.hpp:78
std::uint32_t subminor
Minor.
Definition: peak_afl.hpp:71
peak_afl_status peak_afl_AutoFeatureManager_Destroy(peak_afl_manager_handle handle)
Destroy an automanager instance.
peak_afl_status peak_afl_AutoFeatureManager_RemoveController(peak_afl_manager_handle handle, peak_afl_manager_handle controller)
Remove a controller to an automanager instance.
void SetROIPreset(peak_afl_roi_preset preset)
Set the autofeature region of interest preset for a controller.
Definition: peak_afl.hpp:1548
peak_afl_status peak_afl_AutoController_AutoTarget_GetRange(peak_afl_controller_handle controller, uint32_t *min, uint32_t *max, uint32_t *inc)
Get the auto target range for a controller.
peak_afl_roi_preset
controller roi preset
Definition: peak_afl.h:283
peak_afl_status peak_afl_AutoController_Limit_Set(peak_afl_controller_handle controller, peak_afl_controller_limit limit)
Set the autofeature limit for a controller.
void RegisterFinishedCallback(const callback::FinishedCallback &callback)
Set finished callback for a controller.
Definition: peak_afl.hpp:1873
peak_afl_controller_automode
controller automode
Definition: peak_afl.h:140
std::vector< peak_afl_weighted_rectangle > GetWeightedROIs() const
Get the autofeature weighted region of interest for a controller.
Definition: peak_afl.hpp:1995
Definition: peak_afl.hpp:478
peak_afl_controller_automode GetMode() const
Get the current autofeature mode for a controller.
Definition: peak_afl.hpp:1578
void SetSkipFrames(std::uint32_t count)
Set number of frames skipped for a controller.
Definition: peak_afl.hpp:1471
void SetROI(peak_afl_rectangle rect)
Set the autofeature region of interest for a controller.
Definition: peak_afl.hpp:1516
peak_afl_status peak_afl_AutoController_SkipFrames_GetRange(peak_afl_controller_handle controller, uint32_t *min, uint32_t *max, uint32_t *inc)
Get range for frames skipped for a controller.
static std::shared_ptr< Controller > Create(peak_afl_controllerType type)
Create a new controller.
Definition: peak_afl.hpp:1438
uint8_t peak_afl_BOOL8
custom boolean type
Definition: peak_afl.h:379
peak_afl_status peak_afl_AutoFeatureManager_CreateController(peak_afl_manager_handle handle, peak_afl_controller_handle *controller, peak_afl_controllerType controllerType)
Create a controller and append it to Manager.
void * peak_afl_manager_handle
opaque manager handle type
Definition: peak_afl.h:51
Success.
Definition: peak_afl.h:90
bool IsModeSupported() const
Check if auto mode is supported for a controller.
Definition: peak_afl.hpp:1557
std::uint32_t GetAutoTolerance() const
Get the current auto tolerance for a controller.
Definition: peak_afl.hpp:1687
Definition: peak_afl.hpp:67
bool IsAutoToleranceSupported() const
check if auto tolerance is supported for a controller.
Definition: peak_afl.hpp:1666
peak_afl_rectangle GetROI() const
Get the autofeature region of interest for a controller.
Definition: peak_afl.hpp:1525
peak_afl_status peak_afl_AutoController_Hysteresis_GetRange(peak_afl_controller_handle controller, uint8_t *min, uint8_t *max, uint8_t *inc)
Get autofeature hysteresis range for a controller.
peak_afl_status peak_afl_AutoFeatureManager_DestroyAllController(peak_afl_manager_handle handle)
Destroy all controllers for a manager.
peak_afl_status peak_afl_AutoController_AutoTarget_Set(peak_afl_controller_handle controller, uint32_t target)
Set the auto target for a controller.
gain
Definition: peak_afl.h:234
bool IsBrightnessComponentModeSupported() const
Check if auto mode is supported for a brightness controller component.
Definition: peak_afl.hpp:2118
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:436
bool IsSharpnessAlgorithmSupported() const
check setting a sharpness algorithm is supported by a controller.
Definition: peak_afl.hpp:1818
peak_afl_status peak_afl_Init(void)
Init the peak_afl auto feature library.
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_Set(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm algorithm)
Set the used sharpness algorithm for a controller.
peak_afl_status peak_afl_AutoController_GetLastAutoAverage(peak_afl_controller_handle controller, uint8_t *average)
Get the last auto average for a controller.
peak_afl_controller_algorithm
controller algorithm
Definition: peak_afl.h:184
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:1612
uint32_t Major() const
Returns the major part of the version which is the first part of the version scheme separated by dots...
Definition: peak_afl.hpp:89
Not supported.
Definition: peak_afl.h:114
Version_t Version()
Query the library version.
Definition: peak_afl.hpp:1192
peak_afl_status peak_afl_Exit(void)
Exit the peak_afl auto feature library.
peak_afl_status peak_afl_AutoController_AutoTolerance_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto tolerance is supported for a controller.
peak_afl_status peak_afl_AutoController_ROI_Preset_Set(peak_afl_controller_handle controller, peak_afl_roi_preset roiPreset)
Set the autofeature region of interest preset for a controller.
peak_afl_status peak_afl_AutoController_ROI_Preset_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if ROI preset is supported for a controller.
peak_afl_controllerType Type() const
Get the controller type.
Definition: peak_afl.hpp:1752
std::uint8_t GetLastAutoAverage() const
Get the last auto average for a controller.
Definition: peak_afl.hpp:1601
Controller callback type processing data.
Definition: peak_afl.h:264
bool IsAutoTargetSupported() const
check if auto target is supported for a controller.
Definition: peak_afl.hpp:1623
peak_afl_status peak_afl_AutoController_AutoTarget_Get(peak_afl_controller_handle controller, uint32_t *target)
Get the currently set auto target for a controller.
std::shared_ptr< Controller > CreateController(peak_afl_controllerType type)
Create a controller and append it to Manager.
Definition: peak_afl.hpp:1329
peak_afl_status peak_afl_AutoController_Destroy(peak_afl_controller_handle controller)
Destroy a controller. Will fail if it is queued inside a manager.
Manager(const std::shared_ptr< peak::core::NodeMap > &node_map)
Create an automanager instance.
Definition: peak_afl.hpp:1229
Definition: peak_afl.hpp:457
Range< std::uint32_t > GetAutoTargetRange() const
Get the auto target range for a controller.
Definition: peak_afl.hpp:1655
void SetAutoPercentile(double percentile)
Set the auto percentile for a controller.
Definition: peak_afl.hpp:1721
void RemoveController(const std::shared_ptr< Controller > &controller)
Remove a controller from an automanager.
Definition: peak_afl.hpp:1303
peak_afl_controller_sharpness_algorithm GetSharpnessAlgorithm() const
Get the used sharpness algorithm for a controller.
Definition: peak_afl.hpp:1839
peak_afl_status peak_afl_AutoFeatureManager_Create(peak_afl_manager_handle *handle, PEAK_NODE_MAP_HANDLE nodeMapHandle)
Create an automanager instance.
peak_afl_status peak_afl_AutoController_AutoTarget_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto target is supported for a controller.
bool IsROISupported() const
Check if setting a region of interest is supported for a controller.
Definition: peak_afl.hpp:1504
bool IsHysteresisSupported() const
Check if hysteresis is supported for a controller.
Definition: peak_afl.hpp:2060
void UnRegisterDataProcessingCallback()
Reset the finished callback for a controller.
Definition: peak_afl.hpp:1949
Definition: peak_afl.hpp:186
peak_afl_status peak_afl_AutoController_Algorithm_Set(peak_afl_controller_handle controller, peak_afl_controller_algorithm algorithm)
Set the used algorithm for a controller.
Definition: peak_afl.hpp:280
peak_afl_controller_limit GetDefaultLimit() const
Get the autofeature default limit.
Definition: peak_afl.hpp:2049
bool IsLimitSupported() const
Check if limit is supported for a controller.
Definition: peak_afl.hpp:2017
peak_afl_controller_status Status() const
Get the status for a controller.
Definition: peak_afl.hpp:1589
peak_afl_status peak_afl_AutoController_AutoPercentile_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
check if auto percentile is supported for a controller.
Access Denied.
Definition: peak_afl.h:102
peak_afl_status peak_afl_AutoController_Limit_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if limit is supported for a controller.
void SetMode(peak_afl_controller_automode mode)
Set the autofeature mode for a controller.
Definition: peak_afl.hpp:1569
void DestroyController(const std::shared_ptr< Controller > &controller)
Destroy a controller.
Definition: peak_afl.hpp:1364
peak_afl_status peak_afl_AutoController_Status(peak_afl_controller_handle controller, peak_afl_controller_status *status)
Get the status for a controller.
Buffer too small.
Definition: peak_afl.h:108
peak_afl_status peak_afl_AutoFeatureManager_SetGainIPL(peak_afl_manager_handle handle, PEAK_IPL_GAIN_HANDLE gainHandle)
Set the IPL Gain.
Range< std::uint32_t > GetSkipFramesRange() const
Get range for frames skipped for a controller.
Definition: peak_afl.hpp:1492
peak_afl_status peak_afl_AutoController_Hysteresis_Default(peak_afl_controller_handle controller, uint8_t *hysteresis)
Get the autofeature hysteresis default.
std::uint32_t minor
Major.
Definition: peak_afl.hpp:70
peak_afl_status peak_afl_AutoController_AutoTolerance_Set(peak_afl_controller_handle controller, uint32_t tolerance)
Set the auto tolerance for a controller.
bool IsROIPresetSupported() const
Check if ROI preset is supported for a controller.
Definition: peak_afl.hpp:1536
void SetLimit(peak_afl_controller_limit limit)
Set the autofeature limit for a controller.
Definition: peak_afl.hpp:2029
peak_afl Focus Rectangle
Definition: peak_afl.h:353
peak_afl_status peak_afl_AutoController_BrightnessComponent_Callback_Set(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_callback_type type, void *funcPtr, void *context)
Set a callback for a controller component.
peak_afl_status peak_afl_AutoController_SharpnessAlgorithm_GetList(peak_afl_controller_handle controller, peak_afl_controller_sharpness_algorithm *typeList, uint32_t *listSize)
Get the list of supported sharpness algorithms for a controller.
peak_afl_size GetWeightedROIMinSize() const
Get the autofeature minimum size of weighted region of interest for a controller. ...
Definition: peak_afl.hpp:1984
peak_afl_status peak_afl_AutoController_BrightnessComponent_Status(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_status *status)
Get the status for a controller component.
uint32_t Subminor() const
Returns the subminor part of the version which is the third part of the version scheme separated by d...
Definition: peak_afl.hpp:108
void AddController(const std::shared_ptr< Controller > &controller)
Add a controller to an automanager.
Definition: peak_afl.hpp:1281
void SetGainIPL(const peak::ipl::Gain &gain)
Sets the ipl gain.
Definition: peak_afl.hpp:1383
double GetAutoPercentile() const
Get the auto percentile for a controller.
Definition: peak_afl.hpp:1730
void Process(const peak::ipl::Image &image) const
Process an image.
Definition: peak_afl.hpp:1320
Range< std::uint32_t > GetAutoToleranceRange() const
Get the auto tolerance range for a controller.
Definition: peak_afl.hpp:1698
peak_afl_status peak_afl_AutoController_AutoTolerance_Get(peak_afl_controller_handle controller, uint32_t *tolerance)
Get the current auto tolerance for a controller.
Invalid Parameter.
Definition: peak_afl.h:99
peak_afl_status peak_afl_AutoController_Weighted_ROI_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if weighted region of interest is supported for a controller.
peak_afl_status peak_afl_AutoController_Create(peak_afl_controller_handle *controller, peak_afl_controllerType controllerType)
Create a new controller.
peak_afl_status peak_afl_AutoController_BrightnessComponent_Mode_Set(peak_afl_controller_handle controller, peak_afl_controller_brightness_component component, peak_afl_controller_automode mode)
Set the autofeature mode for a brightness component.
peak_afl_controller_status
controller status
Definition: peak_afl.h:156
peak_afl_status peak_afl_AutoFeatureManager_Process(peak_afl_manager_handle handle, PEAK_IPL_IMAGE_HANDLE imageHandle)
Process an image.
peak_afl_status peak_afl_AutoController_Hysteresis_Get(peak_afl_controller_handle controller, uint8_t *hysteresis)
Get the autofeature hysteresis for a controller.
Busy.
Definition: peak_afl.h:105
peak_afl_status peak_afl_AutoController_AutoTolerance_GetRange(peak_afl_controller_handle controller, uint32_t *min, uint32_t *max, uint32_t *inc)
Get the auto tolerance range for a controller.
void * peak_afl_controller_handle
opaque controller handle type
Definition: peak_afl.h:49
bool IsAutoPercentileSupported() const
check if auto percentile is supported for a controller.
Definition: peak_afl.hpp:1709
peak_afl_status peak_afl_GetLastError(peak_afl_status *lastErrorCode, char *lastErrorMessage, size_t *lastErrorMessageSize)
Get the last error message.
peak_afl_status peak_afl_AutoController_Algorithm_GetList(peak_afl_controller_handle controller, peak_afl_controller_algorithm *typeList, uint32_t *listSize)
Get the list of supported algorithms for a controller.
void DestroyAllController()
Destroy all controllers for a manager.
Definition: peak_afl.hpp:1346
peak_afl_status peak_afl_AutoController_Hysteresis_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if hysteresis is supported for a controller.
peak_afl_controllerType
controller types
Definition: peak_afl.h:121
peak_afl_status peak_afl_AutoController_Mode_IsSupported(peak_afl_controller_handle controller, peak_afl_BOOL8 *supported)
Check if auto mode is supported for a controller.
peak_afl_controller_brightness_component
controller brightness component
Definition: peak_afl.h:228
Controller callback type finished.
Definition: peak_afl.h:261
Range< double > GetAutoPercentileRange() const
Get the auto percentile range for a controller.
Definition: peak_afl.hpp:1741
peak_afl_status peak_afl_AutoController_AutoPercentile_Set(peak_afl_controller_handle controller, double percentile)
Set the auto percentile for a controller.
peak_afl_status peak_afl_AutoController_Hysteresis_Set(peak_afl_controller_handle controller, uint8_t hysteresis)
Set the autofeature hysteresis for a controller.
~Manager()
Destructor of an automanager instance.
Definition: peak_afl.hpp:1243
bool Status() const
Get the status of a manager.
Definition: peak_afl.hpp:1392
bool IsSkipFramesSupported() const
Check if skip frames is supported for a controller.
Definition: peak_afl.hpp:1459
peak_afl_status peak_afl_AutoFeatureManager_DestroyController(peak_afl_manager_handle handle, peak_afl_controller_handle controller)
Destroy a controller.