IDS peak ICV v1.1.0
Loading...
Searching...
No Matches
GainFeature Class Reference

#include <peak_icv/pipeline/features/peak_icv_gain_feature.hpp>

Inheritance diagram for GainFeature:

Public Member Functions

 GainFeature (detail::GainModule &module)
 Creates a GainFeature for an existing gain module.
 
void SetEnabled (bool enabled) override
 Enables or disables the feature.
 
bool IsEnabled () const override
 Indicates whether the feature is currently enabled.
 
void ResetToDefault () override
 Resets the gain values to their defaults.
 
void SetMaster (float value)
 Sets the master gain value.
 
float GetMaster () const
 Retrieves the current master gain.
 
void SetRed (float value)
 Sets the red gain value.
 
float GetRed () const
 Retrieves the current red gain.
 
void SetGreen (float value)
 Sets the green gain value.
 
float GetGreen () const
 Retrieves the current green gain.
 
void SetBlue (float value)
 Sets the blue gain value.
 
float GetBlue () const
 Retrieves the current blue gain.
 
peak::common::IntervalF GetRange () const
 Retrieves the valid range for the master or color gains.
 

Detailed Description

The GainFeature applies gain to the image.

Gain is used to adjust pixel intensities either uniformly across all color channels using the master gain, or individually per channel using the red, green, and blue gains. With master gain, image brightness can be increased. With color gains, the white balance can be adjusted.

For color images, gain is applied as follows:

red_value_out = red_value_in * red_gain * master_gain
green_value_out = green_value_in * green_gain * master_gain
blue_value_out = blue_value_in * blue_gain * master_gain

where red_value_in, green_value_in, and blue_value_in are the input red, green, and blue channel values, respectively, and red_value_out, green_value_out, and blue_value_out are the corresponding output values. All RGB values are normalized to the range [0.0, 1.0].

For mono images, the color gains are ignored and applied as follows:

gray_value_out = gray_value_in * master_gain

where gray_value_in is the input and gray_value_out the output value, normalized to the range [0.0, 1.0].

Warning
Excessive gain values may cause clipping and loss of image detail in bright areas.

Defaults
  • red_gain = 1.0
  • green_gain = 1.0
  • blue_gain = 1.0
  • master_gain = 1.0
See also
features::DigitalBlackFeature, features::GammaFeature
Since
ids_peak_icv 1.0

Definition at line 65 of file peak_icv_gain_feature.hpp.

Constructor & Destructor Documentation

◆ GainFeature()

GainFeature ( detail::GainModule & module)
inlineexplicit

Creates a GainFeature for an existing gain module.

Parameters
moduleReference to the underlying detail::GainModule.
Since
ids_peak_icv 1.0

Definition at line 204 of file peak_icv_gain_feature.hpp.

Member Function Documentation

◆ GetBlue()

float GetBlue ( ) const
inline

Retrieves the current blue gain.

Returns
The current blue gain.
Since
ids_peak_icv 1.0

Definition at line 258 of file peak_icv_gain_feature.hpp.

◆ GetGreen()

float GetGreen ( ) const
inline

Retrieves the current green gain.

Returns
The current green gain.
Since
ids_peak_icv 1.0

Definition at line 248 of file peak_icv_gain_feature.hpp.

◆ GetMaster()

float GetMaster ( ) const
inline

Retrieves the current master gain.

Returns
The current master gain.
Since
ids_peak_icv 1.0

Definition at line 228 of file peak_icv_gain_feature.hpp.

◆ GetRange()

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

Retrieves the valid range for the master or color gains.

The returned interval specifies the minimum and maximum values that can be passed to SetMaster, SetRed, SetGreen and SetBlue.

Returns
An IntervalF representing the valid gain range.
Since
ids_peak_icv 1.0

Definition at line 263 of file peak_icv_gain_feature.hpp.

◆ GetRed()

float GetRed ( ) const
inline

Retrieves the current red gain.

Returns
The current red gain.
Since
ids_peak_icv 1.0

Definition at line 238 of file peak_icv_gain_feature.hpp.

◆ IsEnabled()

bool IsEnabled ( ) const
inlineoverridevirtual

Indicates whether the feature is currently enabled.

Returns
true if enabled; otherwise, false.
Since
ids_peak_icv 1.0

Implements IFeature.

Definition at line 213 of file peak_icv_gain_feature.hpp.

◆ ResetToDefault()

void ResetToDefault ( )
inlineoverridevirtual

Resets the gain values to their defaults.

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

Implements IFeature.

Definition at line 218 of file peak_icv_gain_feature.hpp.

◆ SetBlue()

void SetBlue ( float value)
inline

Sets the blue gain value.

Sets the color gain for the blue channel. The valid range for the gain value can be obtained using the GetRange function.

Parameters
valueThe blue gain value to set.
Exceptions
peak::icv::OutOfRangeExceptionIf the gain value is outside the valid range.
Since
ids_peak_icv 1.0

Definition at line 253 of file peak_icv_gain_feature.hpp.

◆ SetEnabled()

void SetEnabled ( bool enabled)
inlineoverridevirtual

Enables or disables the feature.

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

Implements IFeature.

Definition at line 208 of file peak_icv_gain_feature.hpp.

◆ SetGreen()

void SetGreen ( float value)
inline

Sets the green gain value.

Sets the color gain for the green channel. The valid range for the gain value can be obtained using the GetRange function.

Parameters
valueThe green gain value to set.
Exceptions
peak::icv::OutOfRangeExceptionIf the gain value is outside the valid range.
Since
ids_peak_icv 1.0

Definition at line 243 of file peak_icv_gain_feature.hpp.

◆ SetMaster()

void SetMaster ( float value)
inline

Sets the master gain value.

Sets the overall master gain. The valid range for the gain value can be obtained using the GetRange function.

Parameters
valueThe master gain value to set.
Exceptions
peak::icv::OutOfRangeExceptionIf the gain value is outside the valid range.
Since
ids_peak_icv 1.0

Definition at line 223 of file peak_icv_gain_feature.hpp.

◆ SetRed()

void SetRed ( float value)
inline

Sets the red gain value.

Sets the color gain for the red channel. The valid range for the gain value can be obtained using the GetRange function.

Parameters
valueThe red gain value to set.
Exceptions
peak::icv::OutOfRangeExceptionIf the gain value is outside the valid range.
Since
ids_peak_icv 1.0

Definition at line 233 of file peak_icv_gain_feature.hpp.