IDS peak AFL v2.1.0
Loading...
Searching...
No Matches
peak_afl_basic_auto_focus.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
17
19
20namespace peak
21{
22namespace pipeline
23{
24namespace modules
25{
26namespace autofeature
27{
71{
72public:
81 : IController(manager)
82 , m_genericController(manager)
83 {}
84
91 ~BasicAutoFocus() override = default;
92
100 void SetMode(ControllerMode mode) override
101 {
102 m_genericController.SetMode(mode);
103 }
104
111 PEAK_COMMON_NO_DISCARD ControllerMode GetMode() const override
112 {
113 return m_genericController.GetMode();
114 }
115
122 PEAK_COMMON_NO_DISCARD bool IsRunning() const override
123 {
124 return m_genericController.IsRunning();
125 }
126
135 void ResetToDefault() override
136 {
137 m_genericController.ResetToDefault();
138 }
139
150 void SetSkipFrames(uint32_t value)
151 {
152 m_genericController.SkipFrames().Set(value);
153 }
154
161 PEAK_COMMON_NO_DISCARD uint32_t GetSkipFrames() const
162 {
163 return m_genericController.SkipFrames().Get();
164 }
165
173 PEAK_COMMON_NO_DISCARD peak::common::RangeU GetSkipFramesRange() const
174 {
175 return m_genericController.SkipFrames().GetRange();
176 }
177
189 void SetHysteresis(uint8_t value)
190 {
191 m_genericController.Hysteresis().Set(value);
192 }
193
200 PEAK_COMMON_NO_DISCARD uint8_t GetHysteresis() const
201 {
202 return m_genericController.Hysteresis().Get();
203 }
204
212 PEAK_COMMON_NO_DISCARD peak::common::RangeU8 GetHysteresisRange() const
213 {
214 return m_genericController.Hysteresis().GetRange();
215 }
216
229 {
230 m_genericController.SharpnessAlgorithm().Set(algorithm);
231 }
232
239 PEAK_COMMON_NO_DISCARD FocusSharpnessAlgorithm GetSharpnessAlgorithm() const
240 {
241 return m_genericController.SharpnessAlgorithm().Get();
242 }
243
255 {
256 m_genericController.SearchAlgorithm().Set(algorithm);
257 }
258
265 PEAK_COMMON_NO_DISCARD FocusSearchAlgorithm GetSearchAlgorithm() const
266 {
267 return m_genericController.SearchAlgorithm().Get();
268 }
269
282 {
283 m_genericController.FocusLimit().Set(limit);
284 }
285
292 PEAK_COMMON_NO_DISCARD peak::common::Interval GetFocusLimit() const
293 {
294 return m_genericController.FocusLimit().Get();
295 }
296
309 void SetWeightedROIs(const std::vector<WeightedROI>& rois)
310 {
311 m_genericController.WeightedROIs().Set(rois);
312 }
313
320 PEAK_COMMON_NO_DISCARD std::vector<WeightedROI> GetWeightedROIs() const
321 {
322 return m_genericController.WeightedROIs().Get();
323 }
324
332 void ResetWeightedROIs() const
333 {
334 m_genericController.WeightedROIs().SetPreset(RoiPreset::Center);
335 }
336
349 IController::FinishedCallbackHandle RegisterFinishedCallback(const IController::FinishedCallback& callback)
350 {
351 return m_genericController.RegisterFinishedCallback(callback);
352 }
353
361 void UnregisterFinishedCallback(IController::FinishedCallbackHandle callbackHandle)
362 {
363 m_genericController.UnregisterFinishedCallback(callbackHandle);
364 }
365
366private:
367 detail::GenericAutoFocus m_genericController;
368
375 PEAK_COMMON_NO_DISCARD std::string GetName() const override
376 {
377 return "BasicAutoFocus";
378 }
379
389 void Serialize(peak::common::serialization::IArchive& archive) const override
390 {
391 m_genericController.Serialize(archive);
392 }
393
403 void Deserialize(const peak::common::serialization::IArchive& archive) override
404 {
405 m_genericController.Deserialize(archive);
406 }
407
414 PEAK_COMMON_NO_DISCARD ControllerType GetType() const override
415 {
416 return m_genericController.GetType();
417 }
418};
419} // namespace autofeature
420} // namespace modules
421} // namespace pipeline
422} // namespace peak
Central coordination object for automatic camera feature control.
Definition peak_afl.hpp:708
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:54
void ResetWeightedROIs() const
Resets the weighted roi to a single center ROI.
Definition peak_afl_basic_auto_focus.hpp:332
FocusSharpnessAlgorithm GetSharpnessAlgorithm() const
Gets the current sharpness algorithm.
Definition peak_afl_basic_auto_focus.hpp:239
void UnregisterFinishedCallback(IController::FinishedCallbackHandle callbackHandle)
Unregisters a previously registered finished callback.
Definition peak_afl_basic_auto_focus.hpp:361
void SetWeightedROIs(const std::vector< WeightedROI > &rois)
Sets the weighted regions of interest (ROIs) for focus evaluation.
Definition peak_afl_basic_auto_focus.hpp:309
peak::common::RangeU GetSkipFramesRange() const
Gets the valid range for the skip frames parameter.
Definition peak_afl_basic_auto_focus.hpp:173
void SetSharpnessAlgorithm(FocusSharpnessAlgorithm algorithm)
Sets the sharpness algorithm used for focus quality evaluation.
Definition peak_afl_basic_auto_focus.hpp:228
uint8_t GetHysteresis() const
Gets the current hysteresis value.
Definition peak_afl_basic_auto_focus.hpp:200
ControllerMode GetMode() const override
Gets the current operating mode of the auto-focus controller.
Definition peak_afl_basic_auto_focus.hpp:111
uint32_t GetSkipFrames() const
Gets the current number of frames being skipped.
Definition peak_afl_basic_auto_focus.hpp:161
peak::common::RangeU8 GetHysteresisRange() const
Gets the valid range for the hysteresis parameter.
Definition peak_afl_basic_auto_focus.hpp:212
void SetFocusLimit(const peak::common::Interval &limit)
Sets the focus limit range for auto-focus operations.
Definition peak_afl_basic_auto_focus.hpp:281
FocusSearchAlgorithm GetSearchAlgorithm() const
Gets the current search algorithm.
Definition peak_afl_basic_auto_focus.hpp:265
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:349
void SetMode(ControllerMode mode) override
Sets the operating mode of the auto-focus controller.
Definition peak_afl_basic_auto_focus.hpp:100
void SetHysteresis(uint8_t value)
Sets the hysteresis value for focus operations.
Definition peak_afl_basic_auto_focus.hpp:189
peak::common::Interval GetFocusLimit() const
Gets the current focus limit range.
Definition peak_afl_basic_auto_focus.hpp:292
void SetSkipFrames(uint32_t value)
Sets the number of frames to skip during auto-focus operations.
Definition peak_afl_basic_auto_focus.hpp:150
std::vector< WeightedROI > GetWeightedROIs() const
Gets the current weighted regions of interest.
Definition peak_afl_basic_auto_focus.hpp:320
BasicAutoFocus(peak::afl::Manager &manager)
Constructs a BasicAutoFocus controller.
Definition peak_afl_basic_auto_focus.hpp:80
void ResetToDefault() override
Resets all controller parameters to their default values.
Definition peak_afl_basic_auto_focus.hpp:135
bool IsRunning() const override
Checks if the auto-focus controller is currently running.
Definition peak_afl_basic_auto_focus.hpp:122
void SetSearchAlgorithm(FocusSearchAlgorithm algorithm)
Sets the search algorithm used for finding the optimal focus position.
Definition peak_afl_basic_auto_focus.hpp:254
Abstract base interface for all automatic controllers.
Definition peak_afl_icontroller.hpp:223
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:55
ControllerType
Controller type enumeration.
Definition peak_afl_icontroller.hpp:36
FocusSharpnessAlgorithm
Focus sharpness algorithm enumeration.
Definition peak_afl_sharpness_algorithm.hpp:35
FocusSearchAlgorithm
Focus search algorithm enumeration.
Definition peak_afl_search_algorithm.hpp:35
@ Center
Sets a centered ROI that is one-third of the image dimensions.
Definition peak_afl_weighted_rois.hpp:57
detail::IntervalT< int32_t > Interval
Interval with signed 32-bit integer boundaries.
Definition peak_common_interval.hpp:242
detail::RangeT< uint8_t > RangeU8
Alias for a range of 8-bit unsigned integers.
Definition peak_common_range.hpp:297
detail::RangeT< uint32_t > RangeU
Alias for a range of 32-bit unsigned integers.
Definition peak_common_range.hpp:222
Interface definitions and implementations for individual module types used within a pipeline.
Definition peak_afl_generic_auto_brightness.hpp:35
Interfaces and implementations for defining and controlling data processing pipelines.
Definition peak_afl_generic_auto_brightness.hpp:33