14 #include "peak_ipl/types/peak_ipl_image.hpp" 15 #include "peak/node_map/peak_node_map.hpp" 17 #include <type_traits> 27 #if __cplusplus >= 201703L || _MSVC_LANG >= 201703L 28 # define PEAK_AFL_NO_DISCARD [[nodiscard]] 29 # define PEAK_AFL_MAYBE_UNUSED [[maybe_unused]] 32 # define PEAK_AFL_NO_DISCARD _Check_return_ 33 # define PEAK_AFL_MAYBE_UNUSED 34 # elif defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) 35 # define PEAK_AFL_NO_DISCARD __attribute__((warn_unused_result)) 36 # define PEAK_AFL_MAYBE_UNUSED __attribute__((unused)) 38 # define PEAK_AFL_NO_DISCARD 39 # define PEAK_AFL_MAYBE_UNUSED 77 PEAK_AFL_NO_DISCARD std::string
ToString()
const 79 return std::to_string(major) +
"." + std::to_string(minor) +
"." + std::to_string(subminor) +
"." 80 + std::to_string(patch);
88 PEAK_AFL_NO_DISCARD uint32_t
Major()
const 98 PEAK_AFL_NO_DISCARD uint32_t
Minor()
const 117 PEAK_AFL_NO_DISCARD uint32_t
Patch()
const 212 PEAK_AFL_NO_DISCARD
const char* what() const noexcept
override 220 return m_text.c_str();
236 return "PEAK_AFL_STATUS_SUCCESS";
239 return "PEAK_AFL_STATUS_ERROR";
242 return "PEAK_AFL_STATUS_NOT_INITIALIZED";
245 return "PEAK_AFL_STATUS_INVALID_PARAMETER";
248 return "PEAK_AFL_STATUS_ACCESS_DENIED";
251 return "PEAK_AFL_STATUS_BUSY";
254 return "PEAK_AFL_STATUS_BUFFER_TOO_SMALL";
257 return "PEAK_AFL_STATUS_INVALID_IMAGE_FORMAT";
260 return "PEAK_AFL_STATUS_NOT_SUPPORTED";
263 return "Unknown Status code";
269 std::string m_text{};
291 inline explicit Manager(
const std::shared_ptr<peak::core::NodeMap>& node_map);
314 inline void AddController(
const std::shared_ptr<Controller>& controller);
326 inline void RemoveController(
const std::shared_ptr<Controller>& controller);
337 inline void Process(
const peak::ipl::Image& img)
const;
360 inline void DestroyAllController();
371 inline void DestroyController(
const std::shared_ptr<Controller>& controller);
382 PEAK_AFL_NO_DISCARD
inline bool Status()
const;
389 PEAK_AFL_NO_DISCARD
inline std::vector<std::shared_ptr<Controller>> ControllerList()
const;
396 PEAK_AFL_NO_DISCARD
inline size_t ControllerCount()
const;
410 std::vector<std::shared_ptr<Controller>> m_controllerList;
411 mutable std::mutex m_mutex{};
424 template<
typename... ControllerTypes>
425 std::tuple<Manager, std::vector<std::shared_ptr<Controller>>>
426 CreateManager(
const std::shared_ptr<peak::core::NodeMap>& node_map, ControllerTypes... types)
428 constexpr
int size =
sizeof...(types);
429 constexpr std::array<peak_afl_controllerType, size> controller_types{types...};
430 std::vector<std::shared_ptr<Controller>> controller{};
432 controller.reserve(size);
434 std::for_each(controller_types.cbegin(), controller_types.cend(), [&manager, &controller](
peak_afl_controllerType type) {
435 controller.emplace_back(std::move(manager.CreateController(type)));
438 return { std::move(manager), std::move(controller) };
446 template <typename T, typename std::enable_if_t<std::is_arithmetic<T>::value,
int> = 0>
456 using FinishedCallback = std::function<void(void)>;
457 using DataProcessingCallback = std::function<void(int, int)>;
464 class Controller :
public std::enable_shared_from_this<Controller>
468 template<
class T, enum peak_afl_callback_type type>
473 template<
typename R,
typename ...Args>
474 Callback(
const std::shared_ptr<peak::afl::Controller>& controller, std::function<R(Args...)> callback) :
475 m_callback(std::move(callback))
478 reinterpret_cast<void*>(&Callback::Func<Args...>),
this);
483 m_controller = controller;
488 if (
auto controller = m_controller.lock())
495 template<
typename ...Args>
496 static void Func(Args&&... args,
void* ptr)
498 static_cast<Callback *
>(ptr)->m_callback(std::forward<Args>(args)...);
502 std::weak_ptr<peak::afl::Controller> m_controller;
514 : m_handle(handle) {};
545 PEAK_AFL_NO_DISCARD
inline bool IsSkipFramesSupported()
const;
556 inline void SetSkipFrames(std::uint32_t count);
567 PEAK_AFL_NO_DISCARD
inline std::uint32_t GetSkipFrames()
const;
587 PEAK_AFL_NO_DISCARD
inline bool IsROISupported()
const;
620 PEAK_AFL_NO_DISCARD
inline bool IsROIPresetSupported()
const;
642 PEAK_AFL_NO_DISCARD
inline bool IsModeSupported()
const;
684 PEAK_AFL_NO_DISCARD
inline std::uint8_t GetLastAutoAverage()
const;
695 PEAK_AFL_NO_DISCARD
inline std::tuple<std::uint8_t, std::uint8_t, std::uint8_t> GetLastAutoAverages()
const;
706 PEAK_AFL_NO_DISCARD
inline bool IsAutoTargetSupported()
const;
718 inline void SetAutoTarget(uint32_t target);
727 PEAK_AFL_NO_DISCARD
inline std::uint32_t GetAutoTarget()
const;
750 PEAK_AFL_NO_DISCARD
inline bool IsAutoToleranceSupported()
const;
761 inline void SetAutoTolerance(std::uint32_t tolerance);
770 PEAK_AFL_NO_DISCARD
inline std::uint32_t GetAutoTolerance()
const;
793 PEAK_AFL_NO_DISCARD
inline bool IsAutoPercentileSupported()
const;
805 inline void SetAutoPercentile(
double tolerance);
814 PEAK_AFL_NO_DISCARD
inline double GetAutoPercentile()
const;
826 PEAK_AFL_NO_DISCARD
inline Range<double> GetAutoPercentileRange()
const;
850 PEAK_AFL_NO_DISCARD
inline bool IsAlgorithmSupported()
const;
880 PEAK_AFL_NO_DISCARD
inline std::vector<peak_afl_controller_algorithm> GetAlgorithmList()
const;
893 PEAK_AFL_NO_DISCARD
inline bool IsSharpnessAlgorithmSupported()
const;
924 PEAK_AFL_NO_DISCARD
inline std::vector<peak_afl_controller_sharpness_algorithm> GetSharpnessAlgorithmList()
const;
929 inline void RegisterFinishedCallback(
const callback::FinishedCallback& callback);
934 inline void UnRegisterFinishedCallback();
940 inline void RegisterDataProcessingCallback(
const callback::DataProcessingCallback& callback);
945 inline void UnRegisterDataProcessingCallback();
956 PEAK_AFL_NO_DISCARD
inline bool IsWeightedROISupported()
const;
967 inline void SetWeightedROIs(
const std::vector<peak_afl_weighted_rectangle>& list);
987 PEAK_AFL_NO_DISCARD
inline peak_afl_size GetWeightedROIMinSize()
const;
996 PEAK_AFL_NO_DISCARD
inline std::vector<peak_afl_weighted_rectangle> GetWeightedROIs()
const;
1007 PEAK_AFL_NO_DISCARD
inline bool IsLimitSupported()
const;
1047 PEAK_AFL_NO_DISCARD
inline bool IsHysteresisSupported()
const;
1058 inline void SetHysteresis(std::uint8_t hysteresis);
1067 PEAK_AFL_NO_DISCARD
inline std::uint8_t GetHysteresis()
const;
1076 PEAK_AFL_NO_DISCARD
inline std::uint8_t GetDefaultHysteresis()
const;
1088 using FinishedCallbackType = Callback<callback::FinishedCallback, PEAK_AFL_CONTROLLER_CALLBACK_FINISHED>;
1089 using DataProcessingCallbackType = Callback<callback::DataProcessingCallback, PEAK_AFL_CONTROLLER_CALLBACK_PROCESSING_DATA>;
1092 std::unique_ptr<FinishedCallbackType> m_finishedCallback{};
1093 std::unique_ptr<DataProcessingCallbackType> m_dataProcessingCallback{};
1121 const auto ret =
peak_afl_GetVersion(&version.major, &version.minor, &version.subminor, &version.patch);
1132 std::size_t lastErrorMessageSize;
1138 return "Cannot get last error!";
1141 std::vector<char> text;
1142 text.resize(lastErrorMessageSize);
1147 return "Cannot get last error!";
1150 return { text.begin(), text.end() };
1158 throw std::runtime_error(
"Invalid node map handle!");
1170 if (m_handle !=
nullptr)
1175 std::lock_guard<std::mutex> lck(m_mutex);
1176 for (
auto& c : m_controllerList)
1178 c->m_handle =
nullptr;
1188 m_handle = other.m_handle;
1189 other.m_handle =
nullptr;
1191 std::lock_guard<std::mutex> lck(other.m_mutex);
1192 m_controllerList = std::move(other.m_controllerList);
1197 m_handle = other.m_handle;
1198 other.m_handle =
nullptr;
1200 std::lock_guard<std::mutex> lck(other.m_mutex);
1201 m_controllerList = std::move(other.m_controllerList);
1208 std::lock_guard<std::mutex> lck(m_mutex);
1210 auto cnt = std::any_of(m_controllerList.begin(), m_controllerList.end(), [controller](
const std::shared_ptr<Controller>& c) {
1211 return c == controller;
1225 m_controllerList.emplace_back(controller);
1230 std::lock_guard<std::mutex> lck(m_mutex);
1238 auto it = std::remove_if(m_controllerList.begin(), m_controllerList.end(), [controller](
const std::shared_ptr<Controller>& c) {
1239 return c == controller;
1242 m_controllerList.erase(it, m_controllerList.end());
1256 std::lock_guard<std::mutex> lck(m_mutex);
1265 auto shared = std::shared_ptr<Controller>(
new Controller(handle));
1266 m_controllerList.emplace_back(shared);
1273 std::lock_guard<std::mutex> lck(m_mutex);
1281 for(
auto& c : m_controllerList)
1283 c->m_handle =
nullptr;
1286 m_controllerList.clear();
1291 std::lock_guard<std::mutex> lck(m_mutex);
1299 auto it = std::remove_if(m_controllerList.begin(), m_controllerList.end(), [controller](
const std::shared_ptr<Controller>& c) {
1300 return c == controller;
1303 m_controllerList.erase(it, m_controllerList.end());
1305 controller->m_handle =
nullptr;
1310 std::uint8_t status;
1322 std::lock_guard<std::mutex> lck(m_mutex);
1324 std::vector<std::shared_ptr<Controller>> controller{};
1326 std::copy(m_controllerList.begin(), m_controllerList.end(), controller.begin());
1333 return m_controllerList.size();
1338 std::lock_guard<std::mutex> lck(m_mutex);
1340 auto it = std::find_if(m_controllerList.cbegin(), m_controllerList.cend(), [=](
const std::shared_ptr<Controller>& controller) {
1341 return type == controller->Type();
1344 if(it != m_controllerList.cend())
1363 return std::shared_ptr<Controller>(
new Controller(handle));
1368 if (m_handle !=
nullptr)
1398 std::uint32_t count{};
1519 std::uint8_t average{};
1530 std::uint8_t averageRed{}, averageGreen{}, averageBlue{};
1536 return { averageRed, averageGreen, averageBlue };
1562 std::uint32_t target{};
1605 std::uint32_t tolerance;
1714 std::vector<peak_afl_controller_algorithm> algList{};
1715 std::uint32_t listSize{};
1723 algList.resize(listSize);
1769 std::vector<peak_afl_controller_sharpness_algorithm> algList{};
1770 std::uint32_t listSize{};
1778 algList.resize(listSize);
1791 m_finishedCallback = std::make_unique<FinishedCallbackType>(shared_from_this(), callback);
1796 m_finishedCallback.reset();
1801 m_dataProcessingCallback = std::make_unique<DataProcessingCallbackType>(shared_from_this(), callback);
1806 m_dataProcessingCallback.reset();
1852 std::vector<peak_afl_weighted_rectangle> list;
1853 std::uint32_t listSize{};
1861 list.resize(listSize);
1938 std::uint8_t hysteresis{};
1950 std::uint8_t hysteresis{};
1964 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:1320
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:1700
~Controller()
Definition: peak_afl.hpp:1366
Range< std::uint8_t > GetHysteresisRange() const
Get autofeature hysteresis range for a controller.
Definition: peak_afl.hpp:1960
std::vector< peak_afl_controller_algorithm > GetAlgorithmList() const
Get the list of supported algorithms for a controller.
Definition: peak_afl.hpp:1712
void SetWeightedROIs(const std::vector< peak_afl_weighted_rectangle > &list)
Set the autofeature weighted region of interest for a controller.
Definition: peak_afl.hpp:1821
void SetHysteresis(std::uint8_t hysteresis)
Set the autofeature hysteresis for a controller.
Definition: peak_afl.hpp:1927
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:199
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:1331
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:1679
peak_afl_status peak_afl_AutoController_Limit_Default(peak_afl_controller_handle controller, peak_afl_controller_limit *limit)
Get the autofeature default limit.
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:1108
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_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:1336
peak_afl_controller_limit GetLimit() const
Get the autofeature limit for a controller.
Definition: peak_afl.hpp:1893
Library not Initialized.
Definition: peak_afl.h:95
peak_afl_status
peak_afl Status codes
Definition: peak_afl.h:86
Definition: peak_afl.hpp:55
std::uint8_t GetDefaultHysteresis() const
Get the autofeature hysteresis default.
Definition: peak_afl.hpp:1948
peak_afl Size (2D)
Definition: peak_afl.h:270
void Init()
Init the peak_afl auto feature library.
Definition: peak_afl.hpp:1098
std::uint32_t GetAutoTarget() const
Get the currently set auto target for a controller.
Definition: peak_afl.hpp:1560
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:1130
void SetAutoTolerance(std::uint32_t tolerance)
Set the auto tolerance for a controller.
Definition: peak_afl.hpp:1594
Error.
Definition: peak_afl.h:92
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:117
std::uint8_t GetHysteresis() const
Get the autofeature hysteresis for a controller.
Definition: peak_afl.hpp:1936
void SetWeightedROI(const peak_afl_weighted_rectangle &rect)
Set single autofeature weighted region of interest for a controller.
Definition: peak_afl.hpp:1830
void RegisterDataProcessingCallback(const callback::DataProcessingCallback &callback)
Set the data callback for a controller.
Definition: peak_afl.hpp:1799
void SetAutoPercentile(double tolerance)
Set the auto percentile for a controller.
Definition: peak_afl.hpp:1637
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:98
Invalid image format.
Definition: peak_afl.h:110
void UnRegisterFinishedCallback()
Reset the finished callback for a controller.
Definition: peak_afl.hpp:1794
peak_afl Rectangle (2D)
Definition: peak_afl.h:304
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:1767
void SetAutoTarget(uint32_t target)
Set the auto target for a controller.
Definition: peak_afl.hpp:1551
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.
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:71
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:342
void SetSharpnessAlgorithm(peak_afl_controller_sharpness_algorithm algorithm)
Set the used sharpness algorithm for a controller.
Definition: peak_afl.hpp:1746
void SetAlgorithm(peak_afl_controller_algorithm algorithm)
Set the used algorithm for a controller.
Definition: peak_afl.hpp:1691
bool IsWeightedROISupported() const
Check if weighted region of interest is supported for a controller.
Definition: peak_afl.hpp:1809
std::uint32_t GetSkipFrames() const
Get number of frames skipped for a controller.
Definition: peak_afl.hpp:1396
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. ...
std::string ToString() const
Patch.
Definition: peak_afl.hpp:77
std::uint32_t subminor
Minor.
Definition: peak_afl.hpp:70
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:1464
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:256
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:1789
peak_afl_controller_automode
controller automode
Definition: peak_afl.h:133
std::vector< peak_afl_weighted_rectangle > GetWeightedROIs() const
Get the autofeature weighted region of interest for a controller.
Definition: peak_afl.hpp:1850
Definition: peak_afl.hpp:464
peak_afl_controller_automode GetMode() const
Get the current autofeature mode for a controller.
Definition: peak_afl.hpp:1494
void SetSkipFrames(std::uint32_t count)
Set number of frames skipped for a controller.
Definition: peak_afl.hpp:1387
void SetROI(peak_afl_rectangle rect)
Set the autofeature region of interest for a controller.
Definition: peak_afl.hpp:1432
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:1354
uint8_t peak_afl_BOOL8
custom boolean type
Definition: peak_afl.h:352
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:50
Success.
Definition: peak_afl.h:89
bool IsModeSupported() const
Check if auto mode is supported for a controller.
Definition: peak_afl.hpp:1473
std::uint32_t GetAutoTolerance() const
Get the current auto tolerance for a controller.
Definition: peak_afl.hpp:1603
Definition: peak_afl.hpp:66
bool IsAutoToleranceSupported() const
check if auto tolerance is supported for a controller.
Definition: peak_afl.hpp:1582
peak_afl_rectangle GetROI() const
Get the autofeature region of interest for a controller.
Definition: peak_afl.hpp:1441
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.
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:426
bool IsSharpnessAlgorithmSupported() const
check setting a sharpness algorithm is supported by a controller.
Definition: peak_afl.hpp:1734
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:177
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:1528
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:88
Not supported.
Definition: peak_afl.h:113
Version_t Version()
Query the library version.
Definition: peak_afl.hpp:1117
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:1668
std::uint8_t GetLastAutoAverage() const
Get the last auto average for a controller.
Definition: peak_afl.hpp:1517
bool IsAutoTargetSupported() const
check if auto target is supported for a controller.
Definition: peak_afl.hpp:1539
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:1254
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:1154
Definition: peak_afl.hpp:447
Range< std::uint32_t > GetAutoTargetRange() const
Get the auto target range for a controller.
Definition: peak_afl.hpp:1571
void RemoveController(const std::shared_ptr< Controller > &controller)
Remove a controller from an automanager.
Definition: peak_afl.hpp:1228
peak_afl_controller_sharpness_algorithm GetSharpnessAlgorithm() const
Get the used sharpness algorithm for a controller.
Definition: peak_afl.hpp:1755
peak_afl_status peak_afl_AutoFeatureManager_Create(peak_afl_manager_handle *handle, PEAK_NODE_MAP_HANDLE nodeMapHandle)
Create an automanager instance.
void Process(const peak::ipl::Image &img) const
Process an image.
Definition: peak_afl.hpp:1245
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:1420
bool IsHysteresisSupported() const
Check if hysteresis is supported for a controller.
Definition: peak_afl.hpp:1915
void UnRegisterDataProcessingCallback()
Reset the finished callback for a controller.
Definition: peak_afl.hpp:1804
Definition: peak_afl.hpp:185
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:279
peak_afl_controller_limit GetDefaultLimit() const
Get the autofeature default limit.
Definition: peak_afl.hpp:1904
bool IsLimitSupported() const
Check if limit is supported for a controller.
Definition: peak_afl.hpp:1872
peak_afl_controller_status Status() const
Get the status for a controller.
Definition: peak_afl.hpp:1505
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:101
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:1485
void DestroyController(const std::shared_ptr< Controller > &controller)
Destroy a controller.
Definition: peak_afl.hpp:1289
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:107
Range< std::uint32_t > GetSkipFramesRange() const
Get range for frames skipped for a controller.
Definition: peak_afl.hpp:1408
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:69
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:1452
void SetLimit(peak_afl_controller_limit limit)
Set the autofeature limit for a controller.
Definition: peak_afl.hpp:1884
peak_afl Focus Rectangle
Definition: peak_afl.h:326
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:1839
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:107
void AddController(const std::shared_ptr< Controller > &controller)
Add a controller to an automanager.
Definition: peak_afl.hpp:1206
double GetAutoPercentile() const
Get the auto percentile for a controller.
Definition: peak_afl.hpp:1646
Range< std::uint32_t > GetAutoToleranceRange() const
Get the auto tolerance range for a controller.
Definition: peak_afl.hpp:1614
Invalid Parameter.
Definition: peak_afl.h:98
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_controller_status
controller status
Definition: peak_afl.h:149
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:104
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:48
bool IsAutoPercentileSupported() const
check if auto percentile is supported for a controller.
Definition: peak_afl.hpp:1625
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:1271
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:120
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.
Range< double > GetAutoPercentileRange() const
Get the auto percentile range for a controller.
Definition: peak_afl.hpp:1657
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:1168
bool Status() const
Get the status of a manager.
Definition: peak_afl.hpp:1308
bool IsSkipFramesSupported() const
Check if skip frames is supported for a controller.
Definition: peak_afl.hpp:1375
peak_afl_status peak_afl_AutoFeatureManager_DestroyController(peak_afl_manager_handle handle, peak_afl_controller_handle controller)
Destroy a controller.