
Public Member Functions | |
| None | __init__ (self, GainModule module) |
| Creates a gain feature for an existing gain module. | |
| bool | enabled (self) |
| Gets whether this feature is currently enabled. | |
| None | enabled (self, bool enabled) |
| Enables or disables the feature. | |
| None | reset_to_default (self) |
| Resets the all gain values to their default value (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 148 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 159 of file gain_feature.py.
| bool enabled | ( | self | ) |
Gets whether this feature is currently enabled.
Reimplemented from IFeature.
Definition at line 57 of file gain_feature.py.
| None enabled | ( | self, | |
| bool | enabled ) |
Enables or disables the feature.
| enabled | True to enable, False to disable. |
Reimplemented from IFeature.
Definition at line 69 of file gain_feature.py.
| float green | ( | self | ) |
Retrieves the current green gain.
Definition at line 120 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 131 of file gain_feature.py.
| float master | ( | self | ) |
Retrieves the current master gain.
Definition at line 176 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 187 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 204 of file gain_feature.py.
| float red | ( | self | ) |
Retrieves the current red gain.
Definition at line 92 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 103 of file gain_feature.py.
| None reset_to_default | ( | self | ) |
Resets the all gain values to their default value (1.0).
Reimplemented from IFeature.
Definition at line 80 of file gain_feature.py.
|
protected |
Definition at line 54 of file gain_feature.py.