![]() |
IDS peak ICV v1.2.0
|

Public Member Functions | |
| None | __init__ (self, GainModule module) |
| Creates a gain feature for an existing gain module. | |
| bool | enabled (self) |
| Indicates whether the feature is currently enabled. | |
| None | enabled (self, bool value) |
| Enables or disables the feature. | |
| None | reset_to_default (self) |
| Resets the all gain values to 1.0. | |
| float | red (self) |
| Retrieves the current red gain. | |
| None | red (self, float value) |
| Sets the red gain value. | |
| float | green (self) |
| Retrieves the current green gain. | |
| None | green (self, float value) |
| Sets the green gain value. | |
| float | blue (self) |
| Retrieves the current blue gain. | |
| None | blue (self, float value) |
| Sets the blue gain value. | |
| float | master (self) |
| Retrieves the current master gain. | |
| None | master (self, float value) |
| Sets the master gain value. | |
| Interval | range (self) |
| Retrieves the valid range for the gamma correction exponent. | |
Protected Attributes | |
| _module = module | |
Gain is an image pipeline feature that applies gain correction to an image.
|
|
See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.
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.
Default configuration:
Definition at line 8 of file gain_feature.py.
| None __init__ | ( | self, | |
| GainModule | module ) |
Creates a gain feature for an existing gain module.
| module | Reference to the underlying module |
Definition at line 46 of file gain_feature.py.
| float blue | ( | self | ) |
Retrieves the current blue gain.
Definition at line 146 of file gain_feature.py.
| None blue | ( | self, | |
| float | value ) |
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 range property.
| value | The blue gain value to set. |
| OutOfRangeException | If the gain value is outside the valid range. |
Definition at line 157 of file gain_feature.py.
| bool enabled | ( | self | ) |
Indicates whether the feature is currently enabled.
Reimplemented from IFeature.
Definition at line 57 of file gain_feature.py.
| None enabled | ( | self, | |
| bool | value ) |
Enables or disables the feature.
| value | Set to True to enable the feature, or False to disable it. |
Reimplemented from IFeature.
Definition at line 68 of file gain_feature.py.
| float green | ( | self | ) |
Retrieves the current green gain.
Definition at line 118 of file gain_feature.py.
| None green | ( | self, | |
| float | value ) |
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 range property.
| value | The green gain value to set. |
| OutOfRangeException | If the gain value is outside the valid range. |
Definition at line 129 of file gain_feature.py.
| float master | ( | self | ) |
Retrieves the current master gain.
Definition at line 174 of file gain_feature.py.
| None master | ( | self, | |
| float | value ) |
Sets the master gain value.
Sets the color gain for the master channel. The valid range for the gain value can be obtained using the range property.
| value | The master gain value to set. |
| OutOfRangeException | If the gain value is outside the valid range. |
Definition at line 185 of file gain_feature.py.
| Interval range | ( | self | ) |
Retrieves the valid range for the gamma correction exponent.
The returned interval specifies the minimum and maximum values that can be passed to value property.
Definition at line 202 of file gain_feature.py.
| float red | ( | self | ) |
Retrieves the current red gain.
Definition at line 90 of file gain_feature.py.
| None red | ( | self, | |
| float | value ) |
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 range property.
| value | The red gain value to set. |
| OutOfRangeException | If the gain value is outside the valid range. |
Definition at line 101 of file gain_feature.py.
| None reset_to_default | ( | self | ) |
Resets the all gain values to 1.0.
Reimplemented from IFeature.
Definition at line 78 of file gain_feature.py.
|
protected |
Definition at line 54 of file gain_feature.py.