IDS peak AFL v2.0.1
Loading...
Searching...
No Matches
peak_afl_basic_auto_features.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
16
19#include <peak/device/peak_device.hpp>
20
21namespace peak
22{
23namespace pipeline
24{
25namespace modules
26{
27
63{
64public:
83 explicit BasicAutoFeatures(const std::shared_ptr<peak::core::Device>& device)
84 : m_genericModule{ device, false }
85 {}
86
105 {
106 m_genericModule.Serialize(archive);
107 }
108
129 {
130 m_genericModule.Deserialize(archive);
131 }
132
142 PEAK_COMMON_NO_DISCARD const char* GetType() const override
143 {
144 return "BasicAutoFeatures";
145 }
146
168 {
169 return m_genericModule.Process(input);
170 }
171
188 void ResetToDefault() override
189 {
190 m_genericModule.ResetToDefault();
191 }
192
208 void SetGainModule(std::shared_ptr<peak::pipeline::modules::IGain> gainModule) override
209 {
210 m_genericModule.SetGainModule(gainModule);
211 }
212
232 void SetColorCorrectionMatrix(const std::array<float, 9>& ccm) override
233 {
234 m_genericModule.SetColorCorrectionMatrix(ccm);
235 }
236
253 void SetEnabled(const bool enabled) override
254 {
255 m_genericModule.SetEnabled(enabled);
256 }
257
269 PEAK_COMMON_NO_DISCARD bool IsEnabled() const override
270 {
271 return m_genericModule.IsEnabled();
272 }
273
293 {
294 auto* controller = m_genericModule.GetController(autofeature::ControllerType::Brightness);
295 if (controller != nullptr)
296 {
297 return *static_cast<autofeature::BasicAutoBrightness*>(controller);
298 }
300 "Brightness controller is not supported for the current device!", PEAK_AFL_STATUS_NOT_SUPPORTED);
301 }
302
315 {
316 return m_genericModule.HasController(autofeature::ControllerType::Brightness);
317 }
318
338 {
339 auto* controller = m_genericModule.GetController(autofeature::ControllerType::Focus);
340 if (controller != nullptr)
341 {
342 return *static_cast<autofeature::BasicAutoFocus*>(controller);
343 }
344
346 "Focus controller is not supported for the current device!", PEAK_AFL_STATUS_NOT_SUPPORTED);
347 }
348
361 {
362 return m_genericModule.HasController(autofeature::ControllerType::Focus);
363 }
364
384 {
385 auto* controller = m_genericModule.GetController(autofeature::ControllerType::WhiteBalance);
386 if (controller != nullptr)
387 {
388 return *static_cast<autofeature::BasicAutoWhiteBalance*>(controller);
389 }
390
392 "White balance controller is not supported for the current device!", PEAK_AFL_STATUS_NOT_SUPPORTED);
393 }
394
407 {
408 return m_genericModule.HasController(autofeature::ControllerType::WhiteBalance);
409 }
410
430 {
431 for (auto* controller : m_genericModule.GetControllers())
432 {
433 controller->SetMode(mode);
434 }
435 }
436
456 void SetAllSkipFrames(uint32_t value)
457 {
458 auto* brightnessController = m_genericModule.GetController(autofeature::ControllerType::Brightness);
459 if (brightnessController != nullptr)
460 {
461 static_cast<autofeature::BasicAutoBrightness*>(brightnessController)->SetSkipFrames(value);
462 }
463
464 auto* focusController = m_genericModule.GetController(autofeature::ControllerType::Focus);
465 if (focusController != nullptr)
466 {
467 static_cast<autofeature::BasicAutoFocus*>(focusController)->SetSkipFrames(value);
468 }
469
470 auto* awbController = m_genericModule.GetController(autofeature::ControllerType::WhiteBalance);
471 if (awbController != nullptr)
472 {
473 static_cast<autofeature::BasicAutoWhiteBalance*>(awbController)->SetSkipFrames(value);
474 }
475 }
476
477private:
484 detail::GenericAutoFeatures m_genericModule;
485};
486
487
488} /* namespace modules */
489} /* namespace pipeline */
490} /* namespace peak */
The exception thrown when a functionality is not supported.
Definition peak_afl.hpp:416
A type-erased container for any copyable value.
Definition peak_common_any.hpp:36
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:59
const char * GetType() const override
Returns the type identifier for this basic auto features implementation.
Definition peak_afl_basic_auto_features.hpp:142
void SetEnabled(const bool enabled) override
Sets the enabled state for all basic auto feature controllers.
Definition peak_afl_basic_auto_features.hpp:253
autofeature::BasicAutoWhiteBalance & AutoWhiteBalance() const
Gets a reference to the basic white balance controller.
Definition peak_afl_basic_auto_features.hpp:383
void SetAllSkipFrames(uint32_t value)
Sets the skip frames value for all available auto feature controllers.
Definition peak_afl_basic_auto_features.hpp:456
void SetAllModes(autofeature::ControllerMode mode)
Sets the operating mode for all available auto feature controllers.
Definition peak_afl_basic_auto_features.hpp:429
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:208
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:232
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:104
bool HasAutoFocus() const
Checks if basic focus control is available.
Definition peak_afl_basic_auto_features.hpp:360
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:167
bool HasAutoBrightness() const
Checks if basic brightness control is available.
Definition peak_afl_basic_auto_features.hpp:314
autofeature::BasicAutoFocus & AutoFocus() const
Gets a reference to the basic focus controller.
Definition peak_afl_basic_auto_features.hpp:337
void Deserialize(const peak::common::serialization::IArchive &archive) override
Deserializes basic auto features state from an archive.
Definition peak_afl_basic_auto_features.hpp:128
autofeature::BasicAutoBrightness & AutoBrightness() const
Gets a reference to the basic brightness controller.
Definition peak_afl_basic_auto_features.hpp:292
void ResetToDefault() override
Resets all basic auto feature controllers to their default settings.
Definition peak_afl_basic_auto_features.hpp:188
BasicAutoFeatures(const std::shared_ptr< peak::core::Device > &device)
Constructs a BasicAutoFeatures instance with the specified device.
Definition peak_afl_basic_auto_features.hpp:83
bool IsEnabled() const override
Checks if basic auto features are currently enabled.
Definition peak_afl_basic_auto_features.hpp:269
bool HasAutoWhiteBalance() const
Checks if basic white balance control is available.
Definition peak_afl_basic_auto_features.hpp:406
Interface for modules that provide auto feature functionality.
Definition peak_common_iautofeature_module.hpp:36
Basic automatic brightness controller implementation.
Definition peak_afl_basic_auto_brightness.hpp:147
Basic automatic focus controller implementation.
Definition peak_afl_basic_auto_focus.hpp:75
Basic automatic white balance controller implementation.
Definition peak_afl_basic_auto_white_balance.hpp:54
@ PEAK_AFL_STATUS_NOT_SUPPORTED
Feature or operation not supported.
Definition peak_afl.h:465
ControllerMode
Controller operation mode enumeration.
Definition peak_afl_icontroller.hpp:59
@ WhiteBalance
Automatic white balance controller - manages color correction.
Definition peak_afl_icontroller.hpp:46
@ Brightness
Automatic brightness controller - manages exposure and gain.
Definition peak_afl_icontroller.hpp:44
@ Focus
Automatic focus controller - manages lens focus positioning.
Definition peak_afl_icontroller.hpp:42
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.h:86
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