75 return "ExposureAndGain";
77 return "ExposureOnly";
95 if (name ==
"ExposureAndGain")
99 if (name ==
"ExposureOnly")
103 if (name ==
"GainOnly")
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)
689 component->SetLimit(interval);
707 auto* component = GetExposureComponent();
708 if (component !=
nullptr)
710 return component->GetLimit();
736 auto* component = GetGainComponent();
737 if (component ==
nullptr)
743 component->SetLimit(interval);
761 auto* component = GetGainComponent();
762 if (component !=
nullptr)
764 return component->GetLimit();
773 detail::GenericAutoBrightness m_genericController;
784 BrightnessComponent* GetExposureComponent()
const
797 BrightnessComponent* GetGainComponent()
const
812 return "BasicAutoBrightness";
827 void Serialize(peak::common::serialization::IArchive& archive)
const override
829 m_genericController.Serialize(archive);
847 void Deserialize(
const peak::common::serialization::IArchive& archive)
override
849 m_genericController.Deserialize(archive);
851 m_cachedMode = GetMode();
852 SetPolicy(detail::ToAutoBrightnessPolicy(archive.
GetString(
"Policy")));
865 return m_genericController.GetType();
Central coordination object for automatic camera feature control.
Definition peak_afl.hpp:663
The exception thrown for passing an invalid parameter to a function.
Definition peak_afl.hpp:391
The exception thrown when a functionality is not supported.
Definition peak_afl.hpp:416
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:540
void UnregisterFinishedCallback(IController::FinishedCallbackHandle callbackHandle)
Unregisters a previously registered completion callback.
Definition peak_afl_basic_auto_brightness.hpp:658
peak::common::RangeU GetSkipFramesRange() const
Gets the valid range for skip frames values.
Definition peak_afl_basic_auto_brightness.hpp:520
peak::common::RangeU GetAutoToleranceRange() const
Gets the valid range for tolerance values.
Definition peak_afl_basic_auto_brightness.hpp:467
BrightnessAnalysisAlgorithm GetAnalysisAlgorithm() const
Gets the current brightness analysis algorithm.
Definition peak_afl_basic_auto_brightness.hpp:310
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
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:734
void SetAutoTolerance(uint32_t value)
Sets the tolerance value for brightness stability control.
Definition peak_afl_basic_auto_brightness.hpp:435
ControllerMode GetMode() const override
Gets the current operation mode of the brightness controller.
Definition peak_afl_basic_auto_brightness.hpp:244
uint32_t GetSkipFrames() const
Gets the current number of frames to skip.
Definition peak_afl_basic_auto_brightness.hpp:504
uint32_t GetAutoTolerance() const
Gets the current tolerance value for brightness stability control.
Definition peak_afl_basic_auto_brightness.hpp:451
peak::common::Rectangle GetRoi()
Gets the current region of interest (ROI) for brightness analysis.
Definition peak_afl_basic_auto_brightness.hpp:556
void SetExposureLimit(const IntervalD &interval)
Sets the exposure time limits for the exposure component.
Definition peak_afl_basic_auto_brightness.hpp:680
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
uint32_t GetAutoTarget() const
Gets the current target brightness value.
Definition peak_afl_basic_auto_brightness.hpp:398
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
AutoBrightnessPolicy GetPolicy() const
Gets the current brightness adjustment policy.
Definition peak_afl_basic_auto_brightness.hpp:595
double GetAutoPercentile() const
Gets the current percentile value for brightness calculation.
Definition peak_afl_basic_auto_brightness.hpp:346
IntervalD GetGainLimit() const
Gets the current gain limits for the gain component.
Definition peak_afl_basic_auto_brightness.hpp:759
void SetSkipFrames(uint32_t value)
Sets the number of frames to skip for performance optimization.
Definition peak_afl_basic_auto_brightness.hpp:488
IntervalD GetExposureLimit() const
Gets the current exposure time limits for the exposure component.
Definition peak_afl_basic_auto_brightness.hpp:705
void ResetToDefault() override
Resets all controller settings to their default values.
Definition peak_afl_basic_auto_brightness.hpp:617
peak::common::RangeU GetAutoTargetRange() const
Gets the valid range for target brightness values.
Definition peak_afl_basic_auto_brightness.hpp:414
bool IsRunning() const override
Checks if the brightness controller is currently running.
Definition peak_afl_basic_auto_brightness.hpp:275
void SetAnalysisAlgorithm(BrightnessAnalysisAlgorithm algorithm)
Sets the brightness analysis algorithm.
Definition peak_afl_basic_auto_brightness.hpp:294
RangeD GetAutoPercentileRange() const
Gets the valid range for percentile values.
Definition peak_afl_basic_auto_brightness.hpp:362
~BasicAutoBrightness() override=default
Destructor for BasicAutoBrightness.
Abstract base interface for all automatic controllers.
Definition peak_afl_icontroller.hpp:227
@ PEAK_AFL_STATUS_NOT_SUPPORTED
Feature or operation not supported.
Definition peak_afl.h:465
@ PEAK_AFL_STATUS_INVALID_PARAMETER
Invalid parameter provided.
Definition peak_afl.h:419
@ PEAK_AFL_STATUS_ERROR
General error occurred.
Definition peak_afl.h:399
ControllerMode
Controller operation mode enumeration.
Definition peak_afl_icontroller.hpp:59
ControllerType
Controller type enumeration.
Definition peak_afl_icontroller.hpp:40
std::string ToString(ControllerType mode)
Converts ControllerType enumeration to string representation.
Definition peak_afl_icontroller.hpp:78
@ Continuous
Continuous operation - automatic processing on every frame.
Definition peak_afl_icontroller.hpp:63
@ Off
Controller is disabled - no automatic processing.
Definition peak_afl_icontroller.hpp:61
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:40
@ 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:52
@ Exposure
Exposure time component - controls sensor integration time.
Definition peak_afl_brightness_component.hpp:42
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.h:86
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:172
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:26
peak::common::detail::IntervalT< double > IntervalD
Type alias for double-precision interval values.
Definition peak_afl_ifeature.hpp:28