IDS peak AFL v2.1.0
Loading...
Searching...
No Matches
peak_afl_basic_auto_features.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
12
15#include <peak/device/peak_device.hpp>
16
17namespace peak
18{
19namespace pipeline
20{
21namespace modules
22{
23
59{
60public:
79 explicit BasicAutoFeatures(const std::shared_ptr<peak::core::Device>& device)
80 : m_genericModule{ device, false }
81 {}
82
101 {
102 m_genericModule.Serialize(archive);
103 }
104
125 {
126 m_genericModule.Deserialize(archive);
127 }
128
138 PEAK_COMMON_NO_DISCARD const char* GetType() const override
139 {
140 return "BasicAutoFeatures";
141 }
142
163 PEAK_COMMON_NO_DISCARD peak::common::Any Process(const peak::common::Any& input) const override
164 {
165 return m_genericModule.Process(input);
166 }
167
184 void ResetToDefault() override
185 {
186 m_genericModule.ResetToDefault();
187 }
188
204 void SetGainModule(std::shared_ptr<peak::pipeline::modules::IGain> gainModule) override
205 {
206 m_genericModule.SetGainModule(gainModule);
207 }
208
228 void SetColorCorrectionMatrix(const std::array<float, 9>& ccm) override
229 {
230 m_genericModule.SetColorCorrectionMatrix(ccm);
231 }
232
249 void SetEnabled(const bool enabled) override
250 {
251 m_genericModule.SetEnabled(enabled);
252 }
253
265 PEAK_COMMON_NO_DISCARD bool IsEnabled() const override
266 {
267 return m_genericModule.IsEnabled();
268 }
269
288 PEAK_COMMON_NO_DISCARD autofeature::BasicAutoBrightness& AutoBrightness() const
289 {
290 auto* controller = m_genericModule.GetController(autofeature::ControllerType::Brightness);
291 if (controller != nullptr)
292 {
293 return *static_cast<autofeature::BasicAutoBrightness*>(controller);
294 }
296 "Brightness controller is not supported for the current device!", PEAK_AFL_STATUS_NOT_SUPPORTED);
297 }
298
310 PEAK_COMMON_NO_DISCARD bool HasAutoBrightness() const
311 {
312 return m_genericModule.HasController(autofeature::ControllerType::Brightness);
313 }
314
333 PEAK_COMMON_NO_DISCARD autofeature::BasicAutoFocus& AutoFocus() const
334 {
335 auto* controller = m_genericModule.GetController(autofeature::ControllerType::Focus);
336 if (controller != nullptr)
337 {
338 return *static_cast<autofeature::BasicAutoFocus*>(controller);
339 }
340
342 "Focus controller is not supported for the current device!", PEAK_AFL_STATUS_NOT_SUPPORTED);
343 }
344
356 PEAK_COMMON_NO_DISCARD bool HasAutoFocus() const
357 {
358 return m_genericModule.HasController(autofeature::ControllerType::Focus);
359 }
360
380 {
381 auto* controller = m_genericModule.GetController(autofeature::ControllerType::WhiteBalance);
382 if (controller != nullptr)
383 {
384 return *static_cast<autofeature::BasicAutoWhiteBalance*>(controller);
385 }
386
388 "White balance controller is not supported for the current device!", PEAK_AFL_STATUS_NOT_SUPPORTED);
389 }
390
402 PEAK_COMMON_NO_DISCARD bool HasAutoWhiteBalance() const
403 {
404 return m_genericModule.HasController(autofeature::ControllerType::WhiteBalance);
405 }
406
426 {
427 for (auto* controller : m_genericModule.GetControllers())
428 {
429 controller->SetMode(mode);
430 }
431 }
432
452 void SetAllSkipFrames(uint32_t value)
453 {
454 auto* brightnessController = m_genericModule.GetController(autofeature::ControllerType::Brightness);
455 if (brightnessController != nullptr)
456 {
457 static_cast<autofeature::BasicAutoBrightness*>(brightnessController)->SetSkipFrames(value);
458 }
459
460 auto* focusController = m_genericModule.GetController(autofeature::ControllerType::Focus);
461 if (focusController != nullptr)
462 {
463 static_cast<autofeature::BasicAutoFocus*>(focusController)->SetSkipFrames(value);
464 }
465
466 auto* awbController = m_genericModule.GetController(autofeature::ControllerType::WhiteBalance);
467 if (awbController != nullptr)
468 {
469 static_cast<autofeature::BasicAutoWhiteBalance*>(awbController)->SetSkipFrames(value);
470 }
471 }
472
473private:
480 detail::GenericAutoFeatures m_genericModule;
481};
482
483
484} /* namespace modules */
485} /* namespace pipeline */
486} /* namespace peak */
The exception thrown when a functionality is not supported.
Definition peak_afl.hpp:461
A type-erased container for any copyable value.
Definition peak_common_any.hpp:31
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:54
const char * GetType() const override
Returns the type identifier for this basic auto features implementation.
Definition peak_afl_basic_auto_features.hpp:138
void SetEnabled(const bool enabled) override
Sets the enabled state for all basic auto feature controllers.
Definition peak_afl_basic_auto_features.hpp:249
autofeature::BasicAutoWhiteBalance & AutoWhiteBalance() const
Gets a reference to the basic white balance controller.
Definition peak_afl_basic_auto_features.hpp:379
void SetAllSkipFrames(uint32_t value)
Sets the skip frames value for all available auto feature controllers.
Definition peak_afl_basic_auto_features.hpp:452
void SetAllModes(autofeature::ControllerMode mode)
Sets the operating mode for all available auto feature controllers.
Definition peak_afl_basic_auto_features.hpp:425
void SetGainModule(std::shared_ptr< peak::pipeline::modules::IGain > gainModule) override
Sets the gain module for use when host gains are applied.
Definition peak_afl_basic_auto_features.hpp:204
void SetColorCorrectionMatrix(const std::array< float, 9 > &ccm) override
Sets the color correction matrix for basic image processing.
Definition peak_afl_basic_auto_features.hpp:228
void Serialize(peak::common::serialization::IArchive &archive) const override
Serializes the current state of all basic auto features to an archive.
Definition peak_afl_basic_auto_features.hpp:100
bool HasAutoFocus() const
Checks if basic focus control is available.
Definition peak_afl_basic_auto_features.hpp:356
peak::common::Any Process(const peak::common::Any &input) const override
Processes input data through all enabled basic auto feature controllers.
Definition peak_afl_basic_auto_features.hpp:163
bool HasAutoBrightness() const
Checks if basic brightness control is available.
Definition peak_afl_basic_auto_features.hpp:310
autofeature::BasicAutoFocus & AutoFocus() const
Gets a reference to the basic focus controller.
Definition peak_afl_basic_auto_features.hpp:333
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes basic auto features state from an archive.
Definition peak_afl_basic_auto_features.hpp:124
autofeature::BasicAutoBrightness & AutoBrightness() const
Gets a reference to the basic brightness controller.
Definition peak_afl_basic_auto_features.hpp:288
void ResetToDefault() override
Resets all basic auto feature controllers to their default settings.
Definition peak_afl_basic_auto_features.hpp:184
BasicAutoFeatures(const std::shared_ptr< peak::core::Device > &device)
Constructs a BasicAutoFeatures instance with the specified device.
Definition peak_afl_basic_auto_features.hpp:79
bool IsEnabled() const override
Checks if basic auto features are currently enabled.
Definition peak_afl_basic_auto_features.hpp:265
bool HasAutoWhiteBalance() const
Checks if basic white balance control is available.
Definition peak_afl_basic_auto_features.hpp:402
Interface for modules that provide auto feature functionality.
Definition peak_common_iautofeature_module.hpp:31
Basic automatic brightness controller implementation.
Definition peak_afl_basic_auto_brightness.hpp:143
Basic automatic focus controller implementation.
Definition peak_afl_basic_auto_focus.hpp:71
Basic automatic white balance controller implementation.
Definition peak_afl_basic_auto_white_balance.hpp:50
@ PEAK_AFL_STATUS_NOT_SUPPORTED
Feature or operation not supported.
Definition peak_afl.h:462
ControllerMode
Controller operation mode enumeration.
Definition peak_afl_icontroller.hpp:55
@ WhiteBalance
Automatic white balance controller - manages color correction.
Definition peak_afl_icontroller.hpp:42
@ Brightness
Automatic brightness controller - manages exposure and gain.
Definition peak_afl_icontroller.hpp:40
@ Focus
Automatic focus controller - manages lens focus positioning.
Definition peak_afl_icontroller.hpp:38
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