75 return "ExposureAndGain";
77 return "ExposureOnly";
95 if (name ==
"ExposureAndGain")
99 if (name ==
"ExposureOnly")
103 if (name ==
"GainOnly")
108 throw peak::common::InternalErrorException(
"Invalid brightness policy!");
148 using ProcessingCallback = std::function<void()>;
151 friend BrightnessComponent;
170 : IController(manager)
203 auto* exposureComponent = GetExposureComponent();
204 if (exposureComponent !=
nullptr)
211 exposureComponent->SetMode(controllerMode);
214 auto* gainComponent = GetGainComponent();
215 if (gainComponent !=
nullptr)
221 gainComponent->SetMode(controllerMode);
246 auto*
const exposureComponent = GetExposureComponent();
247 if (exposureComponent !=
nullptr)
255 auto*
const gainComponent = GetGainComponent();
256 if (gainComponent !=
nullptr)
258 return gainComponent->GetMode();
296 m_genericController.AnalysisAlgorithm().Set(algorithm);
312 return m_genericController.AnalysisAlgorithm().Get();
332 m_genericController.AutoPercentile().Set(value);
348 return m_genericController.AutoPercentile().Get();
364 return m_genericController.AutoPercentile().GetRange();
384 m_genericController.AutoTarget().Set(value);
400 return m_genericController.AutoTarget().Get();
416 return m_genericController.AutoTarget().GetRange();
437 m_genericController.AutoTolerance().Set(value);
453 return m_genericController.AutoTolerance().Get();
469 return m_genericController.AutoTolerance().GetRange();
490 m_genericController.SkipFrames().Set(value);
506 return m_genericController.SkipFrames().Get();
522 return m_genericController.SkipFrames().GetRange();
542 m_genericController.Roi().Set(roi);
558 return m_genericController.Roi().Get();
621 m_genericController.ResetToDefault();
643 return m_genericController.RegisterFinishedCallback(callback);
660 m_genericController.UnregisterFinishedCallback(callbackHandle);
682 auto* component = GetExposureComponent();
683 if (component ==
nullptr)
688 component->SetLimit(interval);
706 auto* component = GetExposureComponent();
707 if (component !=
nullptr)
709 return component->GetLimit();
734 auto* component = GetGainComponent();
735 if (component ==
nullptr)
740 component->SetLimit(interval);
758 auto* component = GetGainComponent();
759 if (component !=
nullptr)
761 return component->GetLimit();
769 detail::GenericAutoBrightness m_genericController;
780 BrightnessComponent* GetExposureComponent()
const
793 BrightnessComponent* GetGainComponent()
const
808 return "BasicAutoBrightness";
823 void Serialize(peak::common::serialization::IArchive& archive)
const override
825 m_genericController.Serialize(archive);
843 void Deserialize(
const peak::common::serialization::IArchive& archive)
override
845 m_genericController.Deserialize(archive);
847 m_cachedMode = GetMode();
848 SetPolicy(detail::ToAutoBrightnessPolicy(archive.
GetString(
"Policy")));
861 return m_genericController.GetType();
The autofeature manager.
Definition peak_afl.hpp:306
Thrown when a function receives an invalid parameter.
Definition peak_common_exceptions.hpp:50
Thrown when an unsupported operation or feature is used.
Definition peak_common_exceptions.hpp:150
virtual PEAK_COMMON_NO_DISCARD std::string GetString(const std::string &key) const =0
Retrieves a string value by key.
virtual void SetString(const std::string &key, const std::string &value)=0
Stores a UTF-8 string.
PEAK_COMMON_NO_DISCARD peak::common::RangeU GetAutoTargetRange() const
Gets the valid range for target brightness values.
Definition peak_afl_basic_auto_brightness.hpp:414
void SetRoi(const peak::common::Rectangle &roi)
Sets the region of interest (ROI) for selective brightness analysis.
Definition peak_afl_basic_auto_brightness.hpp:540
void UnregisterFinishedCallback(IController::FinishedCallbackHandle callbackHandle)
Unregisters a previously registered completion callback.
Definition peak_afl_basic_auto_brightness.hpp:658
PEAK_COMMON_NO_DISCARD RangeD GetAutoPercentileRange() const
Gets the valid range for percentile values.
Definition peak_afl_basic_auto_brightness.hpp:362
PEAK_COMMON_NO_DISCARD peak::common::Rectangle GetRoi()
Gets the current region of interest (ROI) for brightness analysis.
Definition peak_afl_basic_auto_brightness.hpp:556
PEAK_COMMON_NO_DISCARD IntervalD GetGainLimit() const
Gets the current gain limits for the gain component.
Definition peak_afl_basic_auto_brightness.hpp:756
PEAK_COMMON_NO_DISCARD uint32_t GetAutoTarget() const
Gets the current target brightness value.
Definition peak_afl_basic_auto_brightness.hpp:398
PEAK_COMMON_NO_DISCARD AutoBrightnessPolicy GetPolicy() const
Gets the current brightness adjustment policy.
Definition peak_afl_basic_auto_brightness.hpp:595
PEAK_COMMON_NO_DISCARD peak::common::RangeU GetSkipFramesRange() const
Gets the valid range for skip frames values.
Definition peak_afl_basic_auto_brightness.hpp:520
PEAK_COMMON_NO_DISCARD BrightnessAnalysisAlgorithm GetAnalysisAlgorithm() const
Gets the current brightness analysis algorithm.
Definition peak_afl_basic_auto_brightness.hpp:310
PEAK_COMMON_NO_DISCARD bool IsRunning() const override
Checks if the brightness controller is currently running.
Definition peak_afl_basic_auto_brightness.hpp:275
BasicAutoBrightness(peak::afl::Manager &manager, ProcessingCallback callback)
Constructs a BasicAutoBrightness controller with the specified manager and callback.
Definition peak_afl_basic_auto_brightness.hpp:169
PEAK_COMMON_NO_DISCARD uint32_t GetSkipFrames() const
Gets the current number of frames to skip.
Definition peak_afl_basic_auto_brightness.hpp:504
void SetAutoTarget(uint32_t value)
Sets the target brightness value.
Definition peak_afl_basic_auto_brightness.hpp:382
void SetGainLimit(const IntervalD &interval)
Sets the gain limits for the gain component.
Definition peak_afl_basic_auto_brightness.hpp:732
void SetAutoTolerance(uint32_t value)
Sets the tolerance value for brightness stability control.
Definition peak_afl_basic_auto_brightness.hpp:435
PEAK_COMMON_NO_DISCARD ControllerMode GetMode() const override
Gets the current operation mode of the brightness controller.
Definition peak_afl_basic_auto_brightness.hpp:244
PEAK_COMMON_NO_DISCARD double GetAutoPercentile() const
Gets the current percentile value for brightness calculation.
Definition peak_afl_basic_auto_brightness.hpp:346
PEAK_COMMON_NO_DISCARD IntervalD GetExposureLimit() const
Gets the current exposure time limits for the exposure component.
Definition peak_afl_basic_auto_brightness.hpp:704
PEAK_COMMON_NO_DISCARD uint32_t GetAutoTolerance() const
Gets the current tolerance value for brightness stability control.
Definition peak_afl_basic_auto_brightness.hpp:451
void SetExposureLimit(const IntervalD &interval)
Sets the exposure time limits for the exposure component.
Definition peak_afl_basic_auto_brightness.hpp:680
PEAK_COMMON_NO_DISCARD peak::common::RangeU GetAutoToleranceRange() const
Gets the valid range for tolerance values.
Definition peak_afl_basic_auto_brightness.hpp:467
IController::FinishedCallbackHandle RegisterFinishedCallback(const IController::FinishedCallback &callback)
Registers a callback function to be invoked when brightness adjustment completes.
Definition peak_afl_basic_auto_brightness.hpp:641
void SetPolicy(AutoBrightnessPolicy policy)
Sets the brightness adjustment policy.
Definition peak_afl_basic_auto_brightness.hpp:578
void SetMode(ControllerMode mode) override
Sets the operation mode for the brightness controller.
Definition peak_afl_basic_auto_brightness.hpp:201
void SetAutoPercentile(double value)
Sets the percentile value for brightness calculation.
Definition peak_afl_basic_auto_brightness.hpp:330
void SetSkipFrames(uint32_t value)
Sets the number of frames to skip for performance optimization.
Definition peak_afl_basic_auto_brightness.hpp:488
void ResetToDefault() override
Resets all controller settings to their default values.
Definition peak_afl_basic_auto_brightness.hpp:617
void SetAnalysisAlgorithm(BrightnessAnalysisAlgorithm algorithm)
Sets the brightness analysis algorithm.
Definition peak_afl_basic_auto_brightness.hpp:294
~BasicAutoBrightness() override=default
Destructor for BasicAutoBrightness.
Abstract base interface for all automatic controllers.
Definition peak_afl_icontroller.hpp:228
ControllerMode
Controller operation mode enumeration.
Definition peak_afl_icontroller.hpp:60
PEAK_COMMON_NO_DISCARD std::string ToString(ControllerType mode)
Converts ControllerType enumeration to string representation.
Definition peak_afl_icontroller.hpp:79
ControllerType
Controller type enumeration.
Definition peak_afl_icontroller.hpp:41
@ Continuous
Continuous operation - automatic processing on every frame.
Definition peak_afl_icontroller.hpp:64
@ Off
Controller is disabled - no automatic processing.
Definition peak_afl_icontroller.hpp:62
AutoBrightnessPolicy
Auto brightness control policy enumeration.
Definition peak_afl_basic_auto_brightness.hpp:49
BrightnessAnalysisAlgorithm
Brightness analysis algorithm enumeration.
Definition peak_afl_brightness_algorithm.hpp:41
@ GainOnly
Use only gain adjustments, keeping exposure time constant.
Definition peak_afl_basic_auto_brightness.hpp:55
@ ExposureOnly
Use only exposure time adjustments, keeping gain constant.
Definition peak_afl_basic_auto_brightness.hpp:53
@ ExposureAndGain
Use both exposure time and gain adjustments for optimal brightness control.
Definition peak_afl_basic_auto_brightness.hpp:51
@ Gain
Automatic gain component - automatic gain control.
Definition peak_afl_brightness_component.hpp:53
@ Exposure
Exposure time component - controls sensor integration time.
Definition peak_afl_brightness_component.hpp:43
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.hpp:91
detail::RectangleT< int32_t, uint32_t > Rectangle
Rectangle with integer coordinates and unsigned dimensions.
Definition peak_common_rectangle.hpp:235
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
peak::common::detail::RangeT< double > RangeD
Type alias for double-precision range values.
Definition peak_afl_ifeature.hpp:27
peak::common::detail::IntervalT< double > IntervalD
Type alias for double-precision interval values.
Definition peak_afl_ifeature.hpp:29