IDS peak AFL v2.0.0
Loading...
Searching...
No Matches
peak_afl_basic_auto_focus.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
13#include <peak_afl/peak_afl.hpp>
21
23
24namespace peak
25{
26namespace pipeline
27{
28namespace modules
29{
30namespace autofeature
31{
75{
76public:
85 : IController(manager)
86 , m_genericController(manager)
87 {}
88
95 ~BasicAutoFocus() override = default;
96
104 void SetMode(ControllerMode mode) override
105 {
106 m_genericController.SetMode(mode);
107 }
108
116 {
117 return m_genericController.GetMode();
118 }
119
126 PEAK_COMMON_NO_DISCARD bool IsRunning() const override
127 {
128 return m_genericController.IsRunning();
129 }
130
139 void ResetToDefault() override
140 {
141 m_genericController.ResetToDefault();
142 }
143
154 void SetSkipFrames(uint32_t value)
155 {
156 m_genericController.SkipFrames().Set(value);
157 }
158
166 {
167 return m_genericController.SkipFrames().Get();
168 }
169
178 {
179 return m_genericController.SkipFrames().GetRange();
180 }
181
193 void SetHysteresis(uint8_t value)
194 {
195 m_genericController.Hysteresis().Set(value);
196 }
197
205 {
206 return m_genericController.Hysteresis().Get();
207 }
208
217 {
218 return m_genericController.Hysteresis().GetRange();
219 }
220
233 {
234 m_genericController.SharpnessAlgorithm().Set(algorithm);
235 }
236
244 {
245 return m_genericController.SharpnessAlgorithm().Get();
246 }
247
259 {
260 m_genericController.SearchAlgorithm().Set(algorithm);
261 }
262
270 {
271 return m_genericController.SearchAlgorithm().Get();
272 }
273
286 {
287 m_genericController.FocusLimit().Set(limit);
288 }
289
297 {
298 return m_genericController.FocusLimit().Get();
299 }
300
313 void SetWeightedROIs(const std::vector<WeightedROI>& rois)
314 {
315 m_genericController.WeightedROIs().Set(rois);
316 }
317
324 PEAK_COMMON_NO_DISCARD std::vector<WeightedROI> GetWeightedROIs() const
325 {
326 return m_genericController.WeightedROIs().Get();
327 }
328
336 void ResetWeightedROIs() const
337 {
338 m_genericController.WeightedROIs().SetPreset(RoiPreset::Center);
339 }
340
353 IController::FinishedCallbackHandle RegisterFinishedCallback(const IController::FinishedCallback& callback)
354 {
355 return m_genericController.RegisterFinishedCallback(callback);
356 }
357
365 void UnregisterFinishedCallback(IController::FinishedCallbackHandle callbackHandle)
366 {
367 m_genericController.UnregisterFinishedCallback(callbackHandle);
368 }
369
370private:
371 detail::GenericAutoFocus m_genericController;
372
379 PEAK_COMMON_NO_DISCARD std::string GetName() const override
380 {
381 return "BasicAutoFocus";
382 }
383
393 void Serialize(peak::common::serialization::IArchive& archive) const override
394 {
395 m_genericController.Serialize(archive);
396 }
397
407 void Deserialize(const peak::common::serialization::IArchive& archive) override
408 {
409 m_genericController.Deserialize(archive);
410 }
411
419 {
420 return m_genericController.GetType();
421 }
422};
423} // namespace autofeature
424} // namespace modules
425} // namespace pipeline
426} // namespace peak
Central coordination object for automatic camera feature control.
Definition peak_afl.hpp:663
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:59
void ResetWeightedROIs() const
Resets the weighted roi to a single center ROI.
Definition peak_afl_basic_auto_focus.hpp:336
FocusSharpnessAlgorithm GetSharpnessAlgorithm() const
Gets the current sharpness algorithm.
Definition peak_afl_basic_auto_focus.hpp:243
void UnregisterFinishedCallback(IController::FinishedCallbackHandle callbackHandle)
Unregisters a previously registered finished callback.
Definition peak_afl_basic_auto_focus.hpp:365
void SetWeightedROIs(const std::vector< WeightedROI > &rois)
Sets the weighted regions of interest (ROIs) for focus evaluation.
Definition peak_afl_basic_auto_focus.hpp:313
peak::common::RangeU GetSkipFramesRange() const
Gets the valid range for the skip frames parameter.
Definition peak_afl_basic_auto_focus.hpp:177
void SetSharpnessAlgorithm(FocusSharpnessAlgorithm algorithm)
Sets the sharpness algorithm used for focus quality evaluation.
Definition peak_afl_basic_auto_focus.hpp:232
uint8_t GetHysteresis() const
Gets the current hysteresis value.
Definition peak_afl_basic_auto_focus.hpp:204
ControllerMode GetMode() const override
Gets the current operating mode of the auto-focus controller.
Definition peak_afl_basic_auto_focus.hpp:115
uint32_t GetSkipFrames() const
Gets the current number of frames being skipped.
Definition peak_afl_basic_auto_focus.hpp:165
peak::common::RangeU8 GetHysteresisRange() const
Gets the valid range for the hysteresis parameter.
Definition peak_afl_basic_auto_focus.hpp:216
void SetFocusLimit(const peak::common::Interval &limit)
Sets the focus limit range for auto-focus operations.
Definition peak_afl_basic_auto_focus.hpp:285
FocusSearchAlgorithm GetSearchAlgorithm() const
Gets the current search algorithm.
Definition peak_afl_basic_auto_focus.hpp:269
IController::FinishedCallbackHandle RegisterFinishedCallback(const IController::FinishedCallback &callback)
Registers a callback function to be called when focus operations complete.
Definition peak_afl_basic_auto_focus.hpp:353
void SetMode(ControllerMode mode) override
Sets the operating mode of the auto-focus controller.
Definition peak_afl_basic_auto_focus.hpp:104
void SetHysteresis(uint8_t value)
Sets the hysteresis value for focus operations.
Definition peak_afl_basic_auto_focus.hpp:193
peak::common::Interval GetFocusLimit() const
Gets the current focus limit range.
Definition peak_afl_basic_auto_focus.hpp:296
void SetSkipFrames(uint32_t value)
Sets the number of frames to skip during auto-focus operations.
Definition peak_afl_basic_auto_focus.hpp:154
std::vector< WeightedROI > GetWeightedROIs() const
Gets the current weighted regions of interest.
Definition peak_afl_basic_auto_focus.hpp:324
BasicAutoFocus(peak::afl::Manager &manager)
Constructs a BasicAutoFocus controller.
Definition peak_afl_basic_auto_focus.hpp:84
void ResetToDefault() override
Resets all controller parameters to their default values.
Definition peak_afl_basic_auto_focus.hpp:139
bool IsRunning() const override
Checks if the auto-focus controller is currently running.
Definition peak_afl_basic_auto_focus.hpp:126
void SetSearchAlgorithm(FocusSearchAlgorithm algorithm)
Sets the search algorithm used for finding the optimal focus position.
Definition peak_afl_basic_auto_focus.hpp:258
Abstract base interface for all automatic controllers.
Definition peak_afl_icontroller.hpp:227
virtual std::string GetName() const =0
Gets the unique name of this controller.
virtual ControllerType GetType() const =0
Gets the type of this controller.
ControllerMode
Controller operation mode enumeration.
Definition peak_afl_icontroller.hpp:59
ControllerType
Controller type enumeration.
Definition peak_afl_icontroller.hpp:40
FocusSharpnessAlgorithm
Focus sharpness algorithm enumeration.
Definition peak_afl_sharpness_algorithm.hpp:39
FocusSearchAlgorithm
Focus search algorithm enumeration.
Definition peak_afl_search_algorithm.hpp:39
@ Center
Sets a centered ROI that is one-third of the image dimensions.
Definition peak_afl_weighted_rois.hpp:61
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.h:86
detail::IntervalT< int32_t > Interval
Interval with signed 32-bit integer boundaries.
Definition peak_common_interval.hpp:230
detail::RangeT< uint8_t > RangeU8
Alias for a range of 8-bit unsigned integers.
Definition peak_common_range.hpp:177
detail::RangeT< uint32_t > RangeU
Alias for a range of 32-bit unsigned integers.
Definition peak_common_range.hpp:132
Interface definitions and implementations for individual module types used within a pipeline.
Definition peak_afl_generic_auto_brightness.hpp:39
Interfaces and implementations for defining and controlling data processing pipelines.
Definition peak_afl_generic_auto_brightness.hpp:37