IDS peak AFL v1.8.0
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 }
299 throw peak::common::NotSupportedException("Brightness controller is not supported for the current device!");
300 }
301
314 {
315 return m_genericModule.HasController(autofeature::ControllerType::Brightness);
316 }
317
337 {
338 auto* controller = m_genericModule.GetController(autofeature::ControllerType::Focus);
339 if (controller != nullptr)
340 {
341 return *static_cast<autofeature::BasicAutoFocus*>(controller);
342 }
343
344 throw peak::common::NotSupportedException("Focus controller is not supported for the current device!");
345 }
346
359 {
360 return m_genericModule.HasController(autofeature::ControllerType::Focus);
361 }
362
382 {
383 auto* controller = m_genericModule.GetController(autofeature::ControllerType::WhiteBalance);
384 if (controller != nullptr)
385 {
386 return *static_cast<autofeature::BasicAutoWhiteBalance*>(controller);
387 }
388
389 throw peak::common::NotSupportedException("White balance controller is not supported for the current device!");
390 }
391
404 {
405 return m_genericModule.HasController(autofeature::ControllerType::WhiteBalance);
406 }
407
427 {
428 for (auto* controller : m_genericModule.GetControllers())
429 {
430 controller->SetMode(mode);
431 }
432 }
433
453 void SetAllSkipFrames(uint32_t value)
454 {
455 auto* brightnessController = m_genericModule.GetController(autofeature::ControllerType::Brightness);
456 if (brightnessController != nullptr)
457 {
458 static_cast<autofeature::BasicAutoBrightness*>(brightnessController)->SetSkipFrames(value);
459 }
460
461 auto* focusController = m_genericModule.GetController(autofeature::ControllerType::Focus);
462 if (focusController != nullptr)
463 {
464 static_cast<autofeature::BasicAutoFocus*>(focusController)->SetSkipFrames(value);
465 }
466
467 auto* awbController = m_genericModule.GetController(autofeature::ControllerType::WhiteBalance);
468 if (awbController != nullptr)
469 {
470 static_cast<autofeature::BasicAutoWhiteBalance*>(awbController)->SetSkipFrames(value);
471 }
472 }
473
474private:
481 detail::GenericAutoFeatures m_genericModule;
482};
483
484
485} /* namespace modules */
486} /* namespace pipeline */
487} /* namespace peak */
A type-erased container for any copyable value.
Definition peak_common_any.hpp:36
Thrown when an unsupported operation or feature is used.
Definition peak_common_exceptions.hpp:150
Interface for a hierarchical key-value archive system.
Definition peak_common_iarchive.hpp:59
PEAK_COMMON_NO_DISCARD bool IsEnabled() const override
Checks if basic auto features are currently enabled.
Definition peak_afl_basic_auto_features.hpp:269
PEAK_COMMON_NO_DISCARD bool HasAutoFocus() const
Checks if basic focus control is available.
Definition peak_afl_basic_auto_features.hpp:358
void SetEnabled(const bool enabled) override
Sets the enabled state for all basic auto feature controllers.
Definition peak_afl_basic_auto_features.hpp:253
PEAK_COMMON_NO_DISCARD bool HasAutoWhiteBalance() const
Checks if basic white balance control is available.
Definition peak_afl_basic_auto_features.hpp:403
void SetAllSkipFrames(uint32_t value)
Sets the skip frames value for all available auto feature controllers.
Definition peak_afl_basic_auto_features.hpp:453
void SetAllModes(autofeature::ControllerMode mode)
Sets the operating mode for all available auto feature controllers.
Definition peak_afl_basic_auto_features.hpp:426
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
PEAK_COMMON_NO_DISCARD 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
PEAK_COMMON_NO_DISCARD bool HasAutoBrightness() const
Checks if basic brightness control is available.
Definition peak_afl_basic_auto_features.hpp:313
PEAK_COMMON_NO_DISCARD autofeature::BasicAutoFocus & AutoFocus() const
Gets a reference to the basic focus controller.
Definition peak_afl_basic_auto_features.hpp:336
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
PEAK_COMMON_NO_DISCARD autofeature::BasicAutoWhiteBalance & AutoWhiteBalance() const
Gets a reference to the basic white balance controller.
Definition peak_afl_basic_auto_features.hpp:381
PEAK_COMMON_NO_DISCARD const char * GetType() const override
Returns the type identifier for this basic auto features implementation.
Definition peak_afl_basic_auto_features.hpp:142
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
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
PEAK_COMMON_NO_DISCARD autofeature::BasicAutoBrightness & AutoBrightness() const
Gets a reference to the basic brightness controller.
Definition peak_afl_basic_auto_features.hpp:292
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:76
Basic automatic white balance controller implementation.
Definition peak_afl_basic_auto_white_balance.hpp:54
ControllerMode
Controller operation mode enumeration.
Definition peak_afl_icontroller.hpp:60
@ WhiteBalance
Automatic white balance controller - manages color correction.
Definition peak_afl_icontroller.hpp:47
@ Brightness
Automatic brightness controller - manages exposure and gain.
Definition peak_afl_icontroller.hpp:45
@ Focus
Automatic focus controller - manages lens focus positioning.
Definition peak_afl_icontroller.hpp:43
#define PEAK_COMMON_NO_DISCARD
Compatability macro for the nodiscard attribute.
Definition peak_common_defines.hpp:91
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