IDS peak ICV v1.5.0
Loading...
Searching...
No Matches
ColorMatrixTransformationModule Class Reference

#include <peak_icv/pipeline/detail/peak_icv_color_matrix_transformation_module.hpp>

Inheritance diagram for ColorMatrixTransformationModule:

Public Member Functions

 ColorMatrixTransformationModule ()
 Creates an instance of class ColorMatrixTransformationModule with the default color correction matrix, saturation value and chromatic adaption value.
 
 ~ColorMatrixTransformationModule () override
 
 ColorMatrixTransformationModule (const ColorMatrixTransformationModule &other)=delete
 Copy constructor for class ColorMatrixTransformation is deleted.
 
 ColorMatrixTransformationModule (ColorMatrixTransformationModule &&other) noexcept
 
ColorMatrixTransformationModule & operator= (const ColorMatrixTransformationModule &other)=delete
 Copy assignment for class ColorMatrixTransformation is deleted.
 
ColorMatrixTransformationModule & operator= (ColorMatrixTransformationModule &&other) noexcept
 
void Serialize (peak::common::serialization::IArchive &archive) const override
 Serializes the object's internal state into the provided archive.
 
void Deserialize (const peak::common::serialization::IArchive &archive) override
 Restores the object's state from the provided archive.
 
void SetEnabled (bool enabled) override
 Enables or disables the module. When disabled, Process returns the input image unchanged.
 
bool IsEnabled () const override
 Gets whether this module is currently enabled.
 
const char * GetType () const override
 Returns the type of the module for serialization purposes.
 
void ResetToDefault () override
 Resets the ColorCorrectionMatrix to the default, the chromatic adaption color space and algorithm to the default and the saturation value to the default.
 
void SetMatrix (const ColorCorrectionMatrix &matrix)
 Sets the ColorCorrectionMatrix.
 
ColorCorrectionMatrix GetMatrix () const
 Gets the current ColorCorrectionMatrix.
 
void SetSaturation (float saturation)
 Sets the saturation value.
 
float GetSaturation () const
 Gets the current saturation value.
 
peak::common::IntervalF GetSaturationRange () const
 Gets the valid range for saturation.
 
peak::icv::Image Process (const peak::icv::Image &input) const
 Processes the input image and returns a color corrected and/or saturated output image.
 
peak::common::Any Process (const peak::common::Any &input) const override
 Processes the input image and returns a color corrected and/or saturated output image.
 
void SetAutoFeatureModule (const std::shared_ptr< modules::IAutoFeature > &module)
 Sets the auto feature module that should take the color correction matrix into account for automatic white balancing.
 
ColorCorrectionMatrix GetEffectiveMatrix () const
 Returns the final effective matrix calculated by concatenating all enabled transformations (e.g., Chromatic Adaptation, Color Correction, and Saturation).
 
void SetChromaticAdaptionAlgorithm (ChromaticAdaptionAlgorithm algorithm)
 Sets the algorithm used to calculate the chromatic adaptation transformation.
 
ChromaticAdaptionAlgorithm GetChromaticAdaptionAlgorithm () const
 Returns the current algorithm used for chromatic adaptation.
 
void SetTargetColorSpace (ColorSpace colorSpace)
 Sets the target color space for the chromatic adaptation transformation.
 
ColorSpace GetTargetColorSpace () const
 Returns the target color space used for chromatic adaptation.
 
void SetColorTemperature (uint32_t temperature)
 Sets the source color temperature in Kelvin to be used for chromatic adaptation.
 
uint32_t GetColorTemperature () const
 Returns the currently configured source color temperature in Kelvin.
 
peak::common::RangeU GetColorTemperatureRange () const
 Returns the valid range of values for color temperature.
 
void ResetColorTemperature () const
 Resets the color temperature to its default, uninitialized state.
 
bool HasColorTemperature () const
 Checks if a specific color temperature has been explicitly set.
 
void SetChromaticAdaptionEnabled (bool enabled)
 Enables or disables the chromatic adaptation feature.
 
bool IsChromaticAdaptionEnabled () const
 Checks if the chromatic adaptation feature is enabled.
 
void SetSaturationEnabled (bool enabled)
 Enables or disables the saturation adjustment feature.
 
bool IsSaturationEnabled () const
 Checks if the saturation adjustment feature is enabled.
 
void SetColorCorrectionEnabled (bool enabled)
 Enables or disables the static color correction matrix feature.
 
bool IsColorCorrectionEnabled () const
 Checks if the static color correction matrix feature is enabled.
 
void ResetChromaticAdaption ()
 Resets all chromatic adaptation settings (temperature, algorithm, color space) to their default values.
 

Detailed Description

Color matrix transformation is an image pipeline module that applies a ColorCorrectionMatrix to an image.

Provides the features features::ColorCorrectionFeature, features::SaturationFeature and features::ChromaticAdaptionFeature

Default configuration:

  • Color correction matrix = 3x3 identity matrix
  • Saturation = 1.0
Since
ids_peak_icv 1.0

Constructor & Destructor Documentation

◆ ColorMatrixTransformationModule() [1/3]

◆ ~ColorMatrixTransformationModule()

~ColorMatrixTransformationModule ( )
inlineoverride
Since
ids_peak_icv 1.0

◆ ColorMatrixTransformationModule() [2/3]

Copy constructor for class ColorMatrixTransformation is deleted.

Note
If you need to copy a module, you can create a new one and copy the parameters via Serialize() and Deserialize().
Since
ids_peak_icv 1.0

◆ ColorMatrixTransformationModule() [3/3]

Member Function Documentation

◆ Deserialize()

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

Restores the object's state from the provided archive.

This function reads and applies all necessary parameters from the given archive to reconstruct the internal state of the object. It ensures that the object is restored to a valid and consistent state.

Parameters
archiveThe source archive containing the serialized parameters.
Exceptions
CorruptedExceptionIf Archive is malformed, misses keys or the values are invalid
NotSupportedExceptionIf the 'Version' entry indicates an unsupported version.
Note
This function requires that the archive contains all expected fields as produced by a corresponding Serialize() call.
Since
ids_peak_icv 1.0

Implements ISerializable.

◆ GetChromaticAdaptionAlgorithm()

ChromaticAdaptionAlgorithm GetChromaticAdaptionAlgorithm ( ) const
inline

Returns the current algorithm used for chromatic adaptation.

Returns
The active ChromaticAdaptionAlgorithm.
Since
ids_peak_icv 1.3

◆ GetColorTemperature()

uint32_t GetColorTemperature ( ) const
inline

Returns the currently configured source color temperature in Kelvin.

Returns
The color temperature value in Kelvin.
Since
ids_peak_icv 1.3

◆ GetColorTemperatureRange()

peak::common::RangeU GetColorTemperatureRange ( ) const
inline

Returns the valid range of values for color temperature.

Returns
A peak::common::RangeU denoting the min and max allowed temperature values.
Since
ids_peak_icv 1.3

◆ GetEffectiveMatrix()

ColorCorrectionMatrix GetEffectiveMatrix ( ) const
inline

Returns the final effective matrix calculated by concatenating all enabled transformations (e.g., Chromatic Adaptation, Color Correction, and Saturation).

Returns
The combined effective ColorCorrectionMatrix.
Since
ids_peak_icv 1.3

◆ GetMatrix()

ColorCorrectionMatrix GetMatrix ( ) const
inline

Gets the current ColorCorrectionMatrix.

Returns
The current ColorCorrectionMatrix.
Since
ids_peak_icv 1.0

◆ GetSaturation()

float GetSaturation ( ) const
inline

Gets the current saturation value.

Returns
The current saturation value.
Since
ids_peak_icv 1.0

◆ GetSaturationRange()

peak::common::IntervalF GetSaturationRange ( ) const
inline

Gets the valid range for saturation.

Returns
The valid saturation range.
Since
ids_peak_icv 1.0

◆ GetTargetColorSpace()

ColorSpace GetTargetColorSpace ( ) const
inline

Returns the target color space used for chromatic adaptation.

Returns
The current target ColorSpace.
Since
ids_peak_icv 1.3

◆ GetType()

const char * GetType ( ) const
inlineoverridevirtual

Returns the type of the module for serialization purposes.

Returns
A string representing the module's type.
Since
ids_peak_icv 1.0

Implements IModule.

◆ HasColorTemperature()

bool HasColorTemperature ( ) const
inline

Checks if a specific color temperature has been explicitly set.

Returns
True if a color temperature is configured, false otherwise.
Since
ids_peak_icv 1.3

◆ IsChromaticAdaptionEnabled()

bool IsChromaticAdaptionEnabled ( ) const
inline

Checks if the chromatic adaptation feature is enabled.

Returns
True if chromatic adaptation is currently active, false otherwise.
Since
ids_peak_icv 1.3

◆ IsColorCorrectionEnabled()

bool IsColorCorrectionEnabled ( ) const
inline

Checks if the static color correction matrix feature is enabled.

Returns
True if color correction is currently active, false otherwise.
Since
ids_peak_icv 1.3

◆ IsEnabled()

bool IsEnabled ( ) const
inlineoverridevirtual

Gets whether this module is currently enabled.

Returns
true if enabled; otherwise false. When disabled, Process returns the input image unchanged.
Since
ids_peak_icv 1.0

Implements IModule.

◆ IsSaturationEnabled()

bool IsSaturationEnabled ( ) const
inline

Checks if the saturation adjustment feature is enabled.

Returns
True if saturation adjustment is currently active, false otherwise.
Since
ids_peak_icv 1.3

◆ operator=() [1/2]

ColorMatrixTransformationModule & operator= ( ColorMatrixTransformationModule && other)
inlinenoexcept
Since
ids_peak_icv 1.0

◆ operator=() [2/2]

Copy assignment for class ColorMatrixTransformation is deleted.

Note
If you need to copy a module, you can create a new one and copy the parameters via Serialize() and Deserialize().
Since
ids_peak_icv 1.0

◆ Process() [1/2]

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

Processes the input image and returns a color corrected and/or saturated output image.

Note
Supported pixel formats: RGB8, RGB10, RGB12, BGR8, BGR10, BGR12, RGBa8, RGBa10, RGBa12, BGRa8, BGRa10, BGRa12. Images with other formats are passed through unmodified.

Images with other formats are passed through unmodified.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
inputThe input image to be processed.
Returns
The input image after in-place color correction and/or saturation has been applied.
Exceptions
peak::common::InvalidCastExceptionIf the input cast to peak::icv::Image failed.
Since
ids_peak_icv 1.0

Implements IModule.

◆ Process() [2/2]

peak::icv::Image Process ( const peak::icv::Image & input) const
inline

Processes the input image and returns a color corrected and/or saturated output image.

Note
Supported pixel formats: RGB8, RGB10, RGB12, BGR8, BGR10, BGR12, RGBa8, RGBa10, RGBa12, BGRa8, BGRa10, BGRa12. Images with other formats are passed through unmodified.

Images with other formats are passed through unmodified.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
inputThe input image to be processed.
Returns
The input image after in-place color correction and/or saturation has been applied.
Since
ids_peak_icv 1.0

◆ ResetChromaticAdaption()

void ResetChromaticAdaption ( )
inline

Resets all chromatic adaptation settings (temperature, algorithm, color space) to their default values.

Since
ids_peak_icv 1.3

◆ ResetColorTemperature()

void ResetColorTemperature ( ) const
inline

Resets the color temperature to its default, uninitialized state.

Since
ids_peak_icv 1.3

◆ ResetToDefault()

void ResetToDefault ( )
inlineoverridevirtual

Resets the ColorCorrectionMatrix to the default, the chromatic adaption color space and algorithm to the default and the saturation value to the default.

Note
The enabled state does not change when calling this function.
Since
ids_peak_icv 1.0

Implements IModule.

◆ Serialize()

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

Serializes the object's internal state into the provided archive.

This function populates the given archive with all parameters required to fully represent the current state of the object. It ensures that the object can be reconstructed or transmitted accurately by saving all relevant data members in a consistent and structured format.

Parameters
archiveThe target archive that will store the serialized parameters.
Since
ids_peak_icv 1.0

Implements ISerializable.

◆ SetAutoFeatureModule()

void SetAutoFeatureModule ( const std::shared_ptr< modules::IAutoFeature > & module)
inline

Sets the auto feature module that should take the color correction matrix into account for automatic white balancing.

Since
ids_peak_icv 1.0

◆ SetChromaticAdaptionAlgorithm()

void SetChromaticAdaptionAlgorithm ( ChromaticAdaptionAlgorithm algorithm)
inline

Sets the algorithm used to calculate the chromatic adaptation transformation.

Parameters
algorithmThe ChromaticAdaptionAlgorithm to apply.
Since
ids_peak_icv 1.3

◆ SetChromaticAdaptionEnabled()

void SetChromaticAdaptionEnabled ( bool enabled)
inline

Enables or disables the chromatic adaptation feature.

Parameters
enabledTrue to enable chromatic adaptation, false to disable it.
Since
ids_peak_icv 1.3

◆ SetColorCorrectionEnabled()

void SetColorCorrectionEnabled ( bool enabled)
inline

Enables or disables the static color correction matrix feature.

Parameters
enabledTrue to enable color correction, false to disable it.
Since
ids_peak_icv 1.3

◆ SetColorTemperature()

void SetColorTemperature ( uint32_t temperature)
inline

Sets the source color temperature in Kelvin to be used for chromatic adaptation.

Parameters
temperatureThe color temperature value in Kelvin.
Since
ids_peak_icv 1.3

◆ SetEnabled()

void SetEnabled ( bool enabled)
inlineoverridevirtual

Enables or disables the module. When disabled, Process returns the input image unchanged.

Parameters
enabledSet to true to enable, or false to disable.
Since
ids_peak_icv 1.0

Implements IModule.

◆ SetMatrix()

void SetMatrix ( const ColorCorrectionMatrix & matrix)
inline

Sets the ColorCorrectionMatrix.

Parameters
matrixThe ColorCorrectionMatrix.
Since
ids_peak_icv 1.0

◆ SetSaturation()

void SetSaturation ( float saturation)
inline

Sets the saturation value.

Parameters
saturationThe saturation value.
Exceptions
OutOfRangeExceptionIf saturation is outside the valid range (see GetSaturationRange).
Since
ids_peak_icv 1.0

◆ SetSaturationEnabled()

void SetSaturationEnabled ( bool enabled)
inline

Enables or disables the saturation adjustment feature.

Parameters
enabledTrue to enable saturation adjustment, false to disable it.
Since
ids_peak_icv 1.3

◆ SetTargetColorSpace()

void SetTargetColorSpace ( ColorSpace colorSpace)
inline

Sets the target color space for the chromatic adaptation transformation.

Parameters
colorSpaceThe target ColorSpace.
Since
ids_peak_icv 1.3