IDS peak AFL v1.8.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{
32
76{
77public:
86 : IController(manager)
87 , m_genericController(manager)
88 {}
89
96 ~BasicAutoFocus() override = default;
97
105 void SetMode(ControllerMode mode) override
106 {
107 m_genericController.SetMode(mode);
108 }
109
117 {
118 return m_genericController.GetMode();
119 }
120
127 PEAK_COMMON_NO_DISCARD bool IsRunning() const override
128 {
129 return m_genericController.IsRunning();
130 }
131
140 void ResetToDefault() override
141 {
142 m_genericController.ResetToDefault();
143 }
144
155 void SetSkipFrames(uint32_t value)
156 {
157 m_genericController.SkipFrames().Set(value);
158 }
159
167 {
168 return m_genericController.SkipFrames().Get();
169 }
170
179 {
180 return m_genericController.SkipFrames().GetRange();
181 }
182
194 void SetHysteresis(uint8_t value)
195 {
196 m_genericController.Hysteresis().Set(value);
197 }
198
206 {
207 return m_genericController.Hysteresis().Get();
208 }
209
218 {
219 return m_genericController.Hysteresis().GetRange();
220 }
221
234 {
235 m_genericController.SharpnessAlgorithm().Set(algorithm);
236 }
237
245 {
246 return m_genericController.SharpnessAlgorithm().Get();
247 }
248
260 {
261 m_genericController.SearchAlgorithm().Set(algorithm);
262 }
263
271 {
272 return m_genericController.SearchAlgorithm().Get();
273 }
274
287 {
288 m_genericController.FocusLimit().Set(limit);
289 }
290
298 {
299 return m_genericController.FocusLimit().Get();
300 }
301
314 void SetWeightedROIs(const std::vector<WeightedROI>& rois)
315 {
316 m_genericController.WeightedROIs().Set(rois);
317 }
318
325 PEAK_COMMON_NO_DISCARD std::vector<WeightedROI> GetWeightedROIs() const
326 {
327 return m_genericController.WeightedROIs().Get();
328 }
329
342 IController::FinishedCallbackHandle RegisterFinishedCallback(const IController::FinishedCallback& callback)
343 {
344 return m_genericController.RegisterFinishedCallback(callback);
345 }
346
354 void UnregisterFinishedCallback(IController::FinishedCallbackHandle callbackHandle)
355 {
356 m_genericController.UnregisterFinishedCallback(callbackHandle);
357 }
358
359private:
360 detail::GenericAutoFocus m_genericController;
361
368 PEAK_COMMON_NO_DISCARD std::string GetName() const override
369 {
370 return "BasicAutoFocus";
371 }
372
382 void Serialize(peak::common::serialization::IArchive& archive) const override
383 {
384 m_genericController.Serialize(archive);
385 }
386
396 void Deserialize(const peak::common::serialization::IArchive& archive) override
397 {
398 m_genericController.Deserialize(archive);
399 }
400
407 PEAK_COMMON_NO_DISCARD ControllerType GetType() const override
408 {
409 return m_genericController.GetType();
410 }
411};
412
413} // namespace autofeature
414} // namespace modules
415} // namespace pipeline
416} // namespace peak
The autofeature manager.
Definition peak_afl.hpp:306
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:59
PEAK_COMMON_NO_DISCARD FocusSearchAlgorithm GetSearchAlgorithm() const
Gets the current search algorithm.
Definition peak_afl_basic_auto_focus.hpp:270
void UnregisterFinishedCallback(IController::FinishedCallbackHandle callbackHandle)
Unregisters a previously registered finished callback.
Definition peak_afl_basic_auto_focus.hpp:354
PEAK_COMMON_NO_DISCARD peak::common::Interval GetFocusLimit() const
Gets the current focus limit range.
Definition peak_afl_basic_auto_focus.hpp:297
void SetWeightedROIs(const std::vector< WeightedROI > &rois)
Sets the weighted regions of interest (ROIs) for focus evaluation.
Definition peak_afl_basic_auto_focus.hpp:314
PEAK_COMMON_NO_DISCARD peak::common::RangeU GetSkipFramesRange() const
Gets the valid range for the skip frames parameter.
Definition peak_afl_basic_auto_focus.hpp:178
PEAK_COMMON_NO_DISCARD uint8_t GetHysteresis() const
Gets the current hysteresis value.
Definition peak_afl_basic_auto_focus.hpp:205
void SetSharpnessAlgorithm(FocusSharpnessAlgorithm algorithm)
Sets the sharpness algorithm used for focus quality evaluation.
Definition peak_afl_basic_auto_focus.hpp:233
PEAK_COMMON_NO_DISCARD peak::common::RangeU8 GetHysteresisRange() const
Gets the valid range for the hysteresis parameter.
Definition peak_afl_basic_auto_focus.hpp:217
PEAK_COMMON_NO_DISCARD bool IsRunning() const override
Checks if the auto-focus controller is currently running.
Definition peak_afl_basic_auto_focus.hpp:127
PEAK_COMMON_NO_DISCARD uint32_t GetSkipFrames() const
Gets the current number of frames being skipped.
Definition peak_afl_basic_auto_focus.hpp:166
PEAK_COMMON_NO_DISCARD FocusSharpnessAlgorithm GetSharpnessAlgorithm() const
Gets the current sharpness algorithm.
Definition peak_afl_basic_auto_focus.hpp:244
PEAK_COMMON_NO_DISCARD ControllerMode GetMode() const override
Gets the current operating mode of the auto-focus controller.
Definition peak_afl_basic_auto_focus.hpp:116
void SetFocusLimit(const peak::common::Interval &limit)
Sets the focus limit range for auto-focus operations.
Definition peak_afl_basic_auto_focus.hpp:286
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:342
void SetMode(ControllerMode mode) override
Sets the operating mode of the auto-focus controller.
Definition peak_afl_basic_auto_focus.hpp:105
void SetHysteresis(uint8_t value)
Sets the hysteresis value for focus operations.
Definition peak_afl_basic_auto_focus.hpp:194
void SetSkipFrames(uint32_t value)
Sets the number of frames to skip during auto-focus operations.
Definition peak_afl_basic_auto_focus.hpp:155
PEAK_COMMON_NO_DISCARD std::vector< WeightedROI > GetWeightedROIs() const
Gets the current weighted regions of interest.
Definition peak_afl_basic_auto_focus.hpp:325
BasicAutoFocus(peak::afl::Manager &manager)
Constructs a BasicAutoFocus controller.
Definition peak_afl_basic_auto_focus.hpp:85
void ResetToDefault() override
Resets all controller parameters to their default values.
Definition peak_afl_basic_auto_focus.hpp:140
void SetSearchAlgorithm(FocusSearchAlgorithm algorithm)
Sets the search algorithm used for finding the optimal focus position.
Definition peak_afl_basic_auto_focus.hpp:259
Abstract base interface for all automatic controllers.
Definition peak_afl_icontroller.hpp:228
ControllerMode
Controller operation mode enumeration.
Definition peak_afl_icontroller.hpp:60
ControllerType
Controller type enumeration.
Definition peak_afl_icontroller.hpp:41
FocusSharpnessAlgorithm
Focus sharpness algorithm enumeration.
Definition peak_afl_sharpness_algorithm.hpp:40
FocusSearchAlgorithm
Focus search algorithm enumeration.
Definition peak_afl_search_algorithm.hpp:40
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.hpp:91
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