IDS peak ICV v1.4.0
Loading...
Searching...
No Matches
GainFeature Class Reference
Inheritance diagram for GainFeature:

Public Member Functions

 GainFeature (GainModule module)
 Creates a GainFeature for an existing gain module.
 
void ResetToDefault ()
 Resets the gain values to their defaults.
 

Properties

float Master [get, set]
 The current master gain value.
 
float Red [get, set]
 The current red gain value.
 
float Green [get, set]
 The current green gain value.
 
float Blue [get, set]
 The current blue gain value.
 
IntervalF Range [get]
 Retrieves the valid range for the master or color gains.
 
bool IsEnabled [get, set]
 Enables or disables the feature.
 

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
DigitalBlackFeature, GammaFeature
Since
IDSImaging.Peak.ICV 1.3

Constructor & Destructor Documentation

◆ GainFeature()

GainFeature ( GainModule module)
inline

Creates a GainFeature for an existing gain module.

Parameters
moduleReference to the underlying GainModule.

Member Function Documentation

◆ ResetToDefault()

void ResetToDefault ( )
inline

Resets the gain values to their defaults.

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

Implements IFeature.

Property Documentation

◆ Blue

float Blue
getset

The current blue gain value.

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

Exceptions
IcvOutOfRangeExceptionThe gain value is outside the valid range.

◆ Green

float Green
getset

The current green gain value.

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

Exceptions
IcvOutOfRangeExceptionThe gain value is outside the valid range.

◆ IsEnabled

bool IsEnabled
getset

Enables or disables the feature.

Implements IFeature.

◆ Master

float Master
getset

The current master gain value.

Sets the overall master gain. The valid range for the gain value can be obtained using the Range property.

Exceptions
IcvOutOfRangeExceptionThe gain value is outside the valid range.

◆ Range

Retrieves the valid range for the master or color gains.

The returned interval specifies the minimum and maximum values that can be passed to Master, Red, Green and Blue.

◆ Red

float Red
getset

The current red gain value.

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

Exceptions
IcvOutOfRangeExceptionThe gain value is outside the valid range.