71 return "ExposureAndGain";
73 return "ExposureOnly";
89PEAK_COMMON_NO_DISCARD
inline AutoBrightnessPolicy ToAutoBrightnessPolicy(
const std::string& name)
91 if (name ==
"ExposureAndGain")
95 if (name ==
"ExposureOnly")
99 if (name ==
"GainOnly")
144 using ProcessingCallback = std::function<void()>;
147 friend BrightnessComponent;
166 : IController(manager)
199 auto* exposureComponent = GetExposureComponent();
200 if (exposureComponent !=
nullptr)
207 exposureComponent->SetMode(controllerMode);
210 auto* gainComponent = GetGainComponent();
211 if (gainComponent !=
nullptr)
217 gainComponent->SetMode(controllerMode);
242 auto*
const exposureComponent = GetExposureComponent();
243 if (exposureComponent !=
nullptr)
251 auto*
const gainComponent = GetGainComponent();
252 if (gainComponent !=
nullptr)
254 return gainComponent->GetMode();
292 m_genericController.AnalysisAlgorithm().Set(algorithm);
308 return m_genericController.AnalysisAlgorithm().Get();
328 m_genericController.AutoPercentile().Set(value);
344 return m_genericController.AutoPercentile().Get();
360 return m_genericController.AutoPercentile().GetRange();
380 m_genericController.AutoTarget().Set(value);
396 return m_genericController.AutoTarget().Get();
412 return m_genericController.AutoTarget().GetRange();
433 m_genericController.AutoTolerance().Set(value);
449 return m_genericController.AutoTolerance().Get();
465 return m_genericController.AutoTolerance().GetRange();
486 m_genericController.SkipFrames().Set(value);
502 return m_genericController.SkipFrames().Get();
518 return m_genericController.SkipFrames().GetRange();
538 m_genericController.Roi().Set(roi);
554 return m_genericController.Roi().Get();
617 m_genericController.ResetToDefault();
639 return m_genericController.RegisterFinishedCallback(callback);
656 m_genericController.UnregisterFinishedCallback(callbackHandle);
678 auto* component = GetExposureComponent();
679 if (component ==
nullptr)
685 component->SetLimit(interval);
703 auto* component = GetExposureComponent();
704 if (component !=
nullptr)
706 return component->GetLimit();
732 auto* component = GetGainComponent();
733 if (component ==
nullptr)
739 component->SetLimit(interval);
757 auto* component = GetGainComponent();
758 if (component !=
nullptr)
760 return component->GetLimit();
769 detail::GenericAutoBrightness m_genericController;
780 BrightnessComponent* GetExposureComponent()
const
793 BrightnessComponent* GetGainComponent()
const
806 PEAK_COMMON_NO_DISCARD std::string GetName()
const override
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();
Central coordination object for automatic camera feature control.
Definition peak_afl.hpp:708
The exception thrown for passing an invalid parameter to a function.
Definition peak_afl.hpp:436
The exception thrown when a functionality is not supported.
Definition peak_afl.hpp:461
virtual 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.
void SetRoi(const peak::common::Rectangle &roi)
Sets the region of interest (ROI) for selective brightness analysis.
Definition peak_afl_basic_auto_brightness.hpp:536
void UnregisterFinishedCallback(IController::FinishedCallbackHandle callbackHandle)
Unregisters a previously registered completion callback.
Definition peak_afl_basic_auto_brightness.hpp:654
peak::common::RangeU GetSkipFramesRange() const
Gets the valid range for skip frames values.
Definition peak_afl_basic_auto_brightness.hpp:516
peak::common::RangeU GetAutoToleranceRange() const
Gets the valid range for tolerance values.
Definition peak_afl_basic_auto_brightness.hpp:463
BrightnessAnalysisAlgorithm GetAnalysisAlgorithm() const
Gets the current brightness analysis algorithm.
Definition peak_afl_basic_auto_brightness.hpp:306
BasicAutoBrightness(peak::afl::Manager &manager, ProcessingCallback callback)
Constructs a BasicAutoBrightness controller with the specified manager and callback.
Definition peak_afl_basic_auto_brightness.hpp:165
void SetAutoTarget(uint32_t value)
Sets the target brightness value.
Definition peak_afl_basic_auto_brightness.hpp:378
void SetGainLimit(const IntervalD &interval)
Sets the gain limits for the gain component.
Definition peak_afl_basic_auto_brightness.hpp:730
void SetAutoTolerance(uint32_t value)
Sets the tolerance value for brightness stability control.
Definition peak_afl_basic_auto_brightness.hpp:431
ControllerMode GetMode() const override
Gets the current operation mode of the brightness controller.
Definition peak_afl_basic_auto_brightness.hpp:240
uint32_t GetSkipFrames() const
Gets the current number of frames to skip.
Definition peak_afl_basic_auto_brightness.hpp:500
uint32_t GetAutoTolerance() const
Gets the current tolerance value for brightness stability control.
Definition peak_afl_basic_auto_brightness.hpp:447
peak::common::Rectangle GetRoi()
Gets the current region of interest (ROI) for brightness analysis.
Definition peak_afl_basic_auto_brightness.hpp:552
void SetExposureLimit(const IntervalD &interval)
Sets the exposure time limits for the exposure component.
Definition peak_afl_basic_auto_brightness.hpp:676
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:637
void SetPolicy(AutoBrightnessPolicy policy)
Sets the brightness adjustment policy.
Definition peak_afl_basic_auto_brightness.hpp:574
uint32_t GetAutoTarget() const
Gets the current target brightness value.
Definition peak_afl_basic_auto_brightness.hpp:394
void SetMode(ControllerMode mode) override
Sets the operation mode for the brightness controller.
Definition peak_afl_basic_auto_brightness.hpp:197
void SetAutoPercentile(double value)
Sets the percentile value for brightness calculation.
Definition peak_afl_basic_auto_brightness.hpp:326
AutoBrightnessPolicy GetPolicy() const
Gets the current brightness adjustment policy.
Definition peak_afl_basic_auto_brightness.hpp:591
double GetAutoPercentile() const
Gets the current percentile value for brightness calculation.
Definition peak_afl_basic_auto_brightness.hpp:342
IntervalD GetGainLimit() const
Gets the current gain limits for the gain component.
Definition peak_afl_basic_auto_brightness.hpp:755
void SetSkipFrames(uint32_t value)
Sets the number of frames to skip for performance optimization.
Definition peak_afl_basic_auto_brightness.hpp:484
IntervalD GetExposureLimit() const
Gets the current exposure time limits for the exposure component.
Definition peak_afl_basic_auto_brightness.hpp:701
void ResetToDefault() override
Resets all controller settings to their default values.
Definition peak_afl_basic_auto_brightness.hpp:613
peak::common::RangeU GetAutoTargetRange() const
Gets the valid range for target brightness values.
Definition peak_afl_basic_auto_brightness.hpp:410
bool IsRunning() const override
Checks if the brightness controller is currently running.
Definition peak_afl_basic_auto_brightness.hpp:271
void SetAnalysisAlgorithm(BrightnessAnalysisAlgorithm algorithm)
Sets the brightness analysis algorithm.
Definition peak_afl_basic_auto_brightness.hpp:290
RangeD GetAutoPercentileRange() const
Gets the valid range for percentile values.
Definition peak_afl_basic_auto_brightness.hpp:358
~BasicAutoBrightness() override=default
Destructor for BasicAutoBrightness.
Abstract base interface for all automatic controllers.
Definition peak_afl_icontroller.hpp:223
@ PEAK_AFL_STATUS_NOT_SUPPORTED
Feature or operation not supported.
Definition peak_afl.h:462
@ PEAK_AFL_STATUS_INVALID_PARAMETER
Invalid parameter provided.
Definition peak_afl.h:416
@ PEAK_AFL_STATUS_ERROR
General error occurred.
Definition peak_afl.h:396
ControllerMode
Controller operation mode enumeration.
Definition peak_afl_icontroller.hpp:55
ControllerType
Controller type enumeration.
Definition peak_afl_icontroller.hpp:36
std::string ToString(ControllerType mode)
Converts ControllerType enumeration to string representation.
Definition peak_afl_icontroller.hpp:74
@ Continuous
Continuous operation - automatic processing on every frame.
Definition peak_afl_icontroller.hpp:59
@ Off
Controller is disabled - no automatic processing.
Definition peak_afl_icontroller.hpp:57
AutoBrightnessPolicy
Auto brightness control policy enumeration.
Definition peak_afl_basic_auto_brightness.hpp:45
BrightnessAnalysisAlgorithm
Brightness analysis algorithm enumeration.
Definition peak_afl_brightness_algorithm.hpp:36
@ GainOnly
Use only gain adjustments, keeping exposure time constant.
Definition peak_afl_basic_auto_brightness.hpp:51
@ ExposureOnly
Use only exposure time adjustments, keeping gain constant.
Definition peak_afl_basic_auto_brightness.hpp:49
@ ExposureAndGain
Use both exposure time and gain adjustments for optimal brightness control.
Definition peak_afl_basic_auto_brightness.hpp:47
@ Gain
Automatic gain component - automatic gain control.
Definition peak_afl_brightness_component.hpp:48
@ Exposure
Exposure time component - controls sensor integration time.
Definition peak_afl_brightness_component.hpp:38
detail::RectangleT< int32_t, uint32_t > Rectangle
Rectangle with integer coordinates and unsigned dimensions.
Definition peak_common_rectangle.hpp:231
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
peak::common::detail::RangeT< double > RangeD
Type alias for double-precision range values.
Definition peak_afl_ifeature.hpp:22
peak::common::detail::IntervalT< double > IntervalD
Type alias for double-precision interval values.
Definition peak_afl_ifeature.hpp:24