IDS peak AFL v1.8.0
Loading...
Searching...
No Matches
BasicAutoFeatures Class Reference

Basic automatic features module. More...

#include <peak_afl/pipeline/modules/peak_afl_basic_auto_features.hpp>

Inheritance diagram for BasicAutoFeatures:
IAutoFeature IModule ISerializable

Public Member Functions

 BasicAutoFeatures (const std::shared_ptr< peak::core::Device > &device)
 Constructs a BasicAutoFeatures instance with the specified device.
 
void Serialize (peak::common::serialization::IArchive &archive) const override
 Serializes the current state of all basic auto features to an archive.
 
void Deserialize (const peak::common::serialization::IArchive &archive) override
 Deserializes basic auto features state from an archive.
 
PEAK_COMMON_NO_DISCARD const char * GetType () const override
 Returns the type identifier for this basic auto features implementation.
 
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.
 
void ResetToDefault () override
 Resets all basic auto feature controllers to their default settings.
 
void SetGainModule (std::shared_ptr< peak::pipeline::modules::IGain > gainModule) override
 Sets the gain module for use when host gains are applied.
 
void SetColorCorrectionMatrix (const std::array< float, 9 > &ccm) override
 Sets the color correction matrix for basic image processing.
 
void SetEnabled (const bool enabled) override
 Sets the enabled state for all basic auto feature controllers.
 
PEAK_COMMON_NO_DISCARD bool IsEnabled () const override
 Checks if basic auto features are currently enabled.
 
PEAK_COMMON_NO_DISCARD autofeature::BasicAutoBrightness & AutoBrightness () const
 Gets a reference to the basic brightness controller.
 
PEAK_COMMON_NO_DISCARD bool HasAutoBrightness () const
 Checks if basic brightness control is available.
 
PEAK_COMMON_NO_DISCARD autofeature::BasicAutoFocus & AutoFocus () const
 Gets a reference to the basic focus controller.
 
PEAK_COMMON_NO_DISCARD bool HasAutoFocus () const
 Checks if basic focus control is available.
 
PEAK_COMMON_NO_DISCARD autofeature::BasicAutoWhiteBalance & AutoWhiteBalance () const
 Gets a reference to the basic white balance controller.
 
PEAK_COMMON_NO_DISCARD bool HasAutoWhiteBalance () const
 Checks if basic white balance control is available.
 
void SetAllModes (autofeature::ControllerMode mode)
 Sets the operating mode for all available auto feature controllers.
 
void SetAllSkipFrames (uint32_t value)
 Sets the skip frames value for all available auto feature controllers.
 

Detailed Description

Basic automatic features module.

The BasicAutoFeatures class provides a comprehensive yet simplified interface for managing automatic camera features. This module integrates basic controllers for brightness, focus, and white balance with streamlined configuration options suitable for most common use cases.

Integrated Controllers:

  • BasicAutoBrightness: Essential exposure and gain control
  • BasicAutoFocus: Standard focus algorithms and ROI support
  • BasicAutoWhiteBalance: Fundamental color correction capabilities

Key Features:

  • Unified Interface: Single point of access for all auto features
  • Bulk Configuration: Convenient methods for configuring multiple controllers
  • Serialization Support: Complete configuration persistence

Bulk Configuration Methods:

Note
This class requires a valid device instance that supports basic auto features
For advanced control, consider AdvancedAutoFeatures
See also
AdvancedAutoFeatures
IAutoFeature
autofeature::BasicAutoBrightness
autofeature::BasicAutoFocus
autofeature::BasicAutoWhiteBalance
Since
1.8

Constructor & Destructor Documentation

◆ BasicAutoFeatures()

BasicAutoFeatures ( const std::shared_ptr< peak::core::Device > & device)
inlineexplicit

Constructs a BasicAutoFeatures instance with the specified device.

Initializes the generic module with the provided device in basic mode and sets up the basic automatic feature controllers based on device capabilities.

Parameters
deviceShared pointer to the device instance that will be used for camera operations. Must be valid and non-null.
Precondition
device must be a valid, non-null shared pointer
device must support basic auto features for full functionality
Exceptions
peak::common::InvalidParameterExceptionif device is nullptr
peak::common::InternalErrorExceptionif an internal error occurs
Note
The device must support basic auto features for full functionality
Since
1.8

Member Function Documentation

◆ AutoBrightness()

PEAK_COMMON_NO_DISCARD autofeature::BasicAutoBrightness & AutoBrightness ( ) const
inline

Gets a reference to the basic brightness controller.

Provides access to the basic brightness controller for standard control over automatic brightness adjustments with standard algorithms.

Returns
Reference to the basic AutoBrightness controller
Precondition
Device must support basic brightness control
Postcondition
Returns valid reference to brightness controller
Exceptions
peak::common::NotSupportedExceptionif basic brightness control is not supported by the device
Note
Check HasAutoBrightness() before calling this method to avoid exceptions
See also
HasAutoBrightness()
Since
1.8

◆ AutoFocus()

Gets a reference to the basic focus controller.

Provides access to the basic focus controller for standard control over automatic focus adjustments with standard algorithms.

Returns
Reference to the basic AutoFocus controller
Precondition
Device must support basic focus control
Postcondition
Returns valid reference to focus controller
Exceptions
peak::common::NotSupportedExceptionif basic focus control is not supported by the device
Note
Check HasAutoFocus() before calling this method to avoid exceptions
See also
HasAutoFocus()
Since
1.8

◆ AutoWhiteBalance()

PEAK_COMMON_NO_DISCARD autofeature::BasicAutoWhiteBalance & AutoWhiteBalance ( ) const
inline

Gets a reference to the basic white balance controller.

Provides access to the basic white balance controller for standard control over automatic white balance adjustments with standard algorithms.

Returns
Reference to the basic AutoWhiteBalance controller
Precondition
Device must support basic white balance control
Postcondition
Returns valid reference to white balance controller
Exceptions
peak::common::NotSupportedExceptionif basic white balance control is not supported by the device
Note
Check HasAutoWhiteBalance() before calling this method to avoid exceptions
See also
HasAutoWhiteBalance()
Since
1.8

◆ Deserialize()

void Deserialize ( const peak::common::serialization::IArchive & archive)
inlineoverridevirtual

Deserializes basic auto features state from an archive.

Restores the configuration and state of all basic controllers from previously serialized data, including settings and parameters.

Parameters
archiveReference to the archive containing the serialized data
Precondition
archive must contain valid serialized BasicAutoFeatures data
Postcondition
Current controller settings are restored from archive
Exceptions
peak::common::Exceptionif deserialization fails
Warning
This will overwrite current controller settings
Note
Basic features require less device compatibility validation during deserialization
See also
Serialize()
Since
1.8

Implements ISerializable.

◆ GetType()

PEAK_COMMON_NO_DISCARD const char * GetType ( ) const
inlineoverridevirtual

Returns the type identifier for this basic auto features implementation.

Returns
Constant string "BasicAutoFeatures" identifying this implementation
Note
This is used for type identification in serialization and factory patterns
Distinguishes this from the advanced auto features implementation
Since
1.8

Implements IModule.

◆ HasAutoBrightness()

PEAK_COMMON_NO_DISCARD bool HasAutoBrightness ( ) const
inline

Checks if basic brightness control is available.

Returns
True if the device supports basic brightness control, false otherwise
Note
Use this method before calling AutoBrightness() to avoid exceptions
Basic brightness control may have different availability than advanced version
See also
AutoBrightness()
Since
1.8

◆ HasAutoFocus()

PEAK_COMMON_NO_DISCARD bool HasAutoFocus ( ) const
inline

Checks if basic focus control is available.

Returns
True if the device supports basic focus control, false otherwise
Note
Use this method before calling AutoFocus() to avoid exceptions
Basic focus control may have different availability than advanced version
See also
AutoFocus()
Since
1.8

◆ HasAutoWhiteBalance()

PEAK_COMMON_NO_DISCARD bool HasAutoWhiteBalance ( ) const
inline

Checks if basic white balance control is available.

Returns
True if the device supports basic white balance control, false otherwise
Note
Use this method before calling AutoWhiteBalance() to avoid exceptions
Basic white balance control may have different availability than advanced version
See also
AutoWhiteBalance()
Since
1.8

◆ IsEnabled()

PEAK_COMMON_NO_DISCARD bool IsEnabled ( ) const
inlineoverridevirtual

Checks if basic auto features are currently enabled.

Returns
True if basic auto features are enabled, false otherwise
Note
This returns the overall enabled state, individual controllers may have different states
Use individual controller GetMode() methods to check specific controller availability
See also
SetEnabled()
Since
1.8

Implements IModule.

◆ Process()

PEAK_COMMON_NO_DISCARD peak::common::Any Process ( const peak::common::Any & input) const
inlineoverridevirtual

Processes input data through all enabled basic auto feature controllers.

Applies basic automatic adjustments for brightness, focus, and white balance using standard algorithms and processing capabilities.

Parameters
inputThe input data to be processed by the basic auto features
Returns
Processed data with basic automatic adjustments applied
Precondition
input must be compatible with the underlying basic controllers
Postcondition
Returns processed data with automatic adjustments applied
Exceptions
peak::common::InvalidCastExceptionif input type is incompatible
Note
Only enabled controllers will process the input
Processing order: brightness → white balance → focus
See also
SetEnabled()
Since
1.8

Implements IModule.

◆ ResetToDefault()

void ResetToDefault ( )
inlineoverridevirtual

Resets all basic auto feature controllers to their default settings.

This will restore factory defaults for all basic controllers including:

  • Default processing modes
  • Default parameters and thresholds
  • Default enable/disable states
  • Default skip frame values
Postcondition
All controllers are reset to factory default settings
Warning
This operation cannot be undone
Note
Basic controllers have simpler default configurations than advanced versions
Consider using Serialize() before calling this method to save current state
Since
1.8

Implements IModule.

◆ Serialize()

void Serialize ( peak::common::serialization::IArchive & archive) const
inlineoverridevirtual

Serializes the current state of all basic auto features to an archive.

Saves the configuration and state of all basic controllers including their current settings, modes, and parameters.

Parameters
archiveReference to the archive where the serialized data will be stored
Precondition
archive must be a valid, writable archive
Postcondition
archive contains serialized state of all basic auto features
Note
This method is const as it doesn't modify the object state
Basic controllers have simpler serialization data than advanced versions
See also
Deserialize()
Since
1.8

Implements ISerializable.

◆ SetAllModes()

void SetAllModes ( autofeature::ControllerMode mode)
inline

Sets the operating mode for all available auto feature controllers.

This convenience method applies the specified controller mode to all available controllers (brightness, focus, and white balance) simultaneously.

Parameters
modeThe controller mode to apply to all controllers
Postcondition
All available controllers have their mode set to the specified value
Note
Only controllers that are supported by the device will be affected
This method will not fail if some controllers are not available
Individual controller modes can still be changed separately after this call
See also
autofeature::ControllerMode
SetAllSkipFrames()
Since
1.8

◆ SetAllSkipFrames()

void SetAllSkipFrames ( uint32_t value)
inline

Sets the skip frames value for all available auto feature controllers.

This convenience method sets the number of frames to skip before processing for all available controllers (brightness, focus, and white balance) simultaneously. Skip frames help reduce computational load by processing only every Nth frame.

Parameters
valueNumber of frames to skip between processing cycles
Postcondition
All available controllers have their skip frames value set to the specified value
Note
Only controllers that are supported by the device will be affected
This method will not fail if some controllers are not available
Individual controller skip frames can still be changed separately after this call
Higher skip frame values reduce computational load but may decrease responsiveness
See also
SetAllModes()
Since
1.8

◆ SetColorCorrectionMatrix()

void SetColorCorrectionMatrix ( const std::array< float, 9 > & ccm)
inlineoverridevirtual

Sets the color correction matrix for basic image processing.

The color correction matrix is a 3x3 matrix used by basic controllers for standard color processing and white balance calculations.

Parameters
ccmArray of 9 float values representing the 3x3 color correction matrix in row-major order: [0,0] [0,1] [0,2] [1,0] [1,1] [1,2] [2,0] [2,1] [2,2]
Precondition
ccm must contain 9 valid float values
Matrix values should be within reasonable ranges to avoid poor image quality
Postcondition
Color correction matrix is set and available for basic processing
Exceptions
peak::common::InvalidParameterExceptionif matrix values are invalid
Note
Matrix elements should be in row-major order
Invalid matrix values may result in poor image quality
Since
1.8

Implements IAutoFeature.

◆ SetEnabled()

void SetEnabled ( const bool enabled)
inlineoverridevirtual

Sets the enabled state for all basic auto feature controllers.

Controls the overall enabled state of the basic auto features system.

Parameters
enabledTrue to enable basic auto features, false to disable them
Postcondition
Overall enabled state is set to the specified value
Note
Individual controllers can still be enabled/disabled separately
Basic controllers may have different enable/disable behavior than advanced versions
Disabling does not affect individual controller settings, only their operation
See also
IsEnabled()
Since
1.8

Implements IModule.

◆ SetGainModule()

void SetGainModule ( std::shared_ptr< peak::pipeline::modules::IGain > gainModule)
inlineoverridevirtual

Sets the gain module for use when host gains are applied.

The gain module is utilized by the basic auto features when host-side gain adjustments are being used, allowing the controllers to compensate and optimize their algorithms based on the applied gain values.

Parameters
gainModuleShared pointer to the gain module implementation. Pass nullptr to disable host gain integration.
Note
Passing nullptr will disable host gain integration with auto features
This is only relevant when using host-side gain control rather than hardware gain
Basic controllers use gain information for auto white balance
Since
1.8

Implements IAutoFeature.


The documentation for this class was generated from the following file: