
Public Member Functions | |
| None | __init__ (self) |
| Creates an instance of the gain module. | |
| None | __del__ (self) |
| str | type (self) |
| Returns the type of the module for serialization purposes. | |
| None | reset_to_default (self) |
| Resets all gain values to their default value (1.0). | |
| float | master (self) |
| Returns the current master gain value. | |
| None | master (self, float value) |
| Sets the master gain. | |
| float | red (self) |
| Returns the current red gain value. | |
| None | red (self, float value) |
| Sets the red channel gain. | |
| float | green (self) |
| Returns the current green gain value. | |
| None | green (self, float value) |
| Sets the green channel gain. | |
| float | blue (self) |
| Returns the current blue gain value. | |
| None | blue (self, float value) |
| Sets the blue channel gain. | |
| Interval | range (self) |
| Returns the valid range for all gain values. | |
| Image | process (self, Image input_image) |
| Processes the input image by applying gain correction (if enabled). | |
| None | serialize (self, IArchive archive) |
| Serializes the module’s internal state into an archive. | |
| None | deserialize (self, IArchive archive) |
| Restores the module’s state from an archive. | |
Data Fields | |
| master | |
| red | |
| green | |
| blue | |
Static Public Attributes | |
| float | DEFAULT_MASTER = 1.0 |
| float | DEFAULT_RED = 1.0 |
| float | DEFAULT_GREEN = 1.0 |
| float | DEFAULT_BLUE = 1.0 |
| list | SUPPORTED_PIXEL_FORMATS |
Protected Member Functions | |
| None | _apply (self, _GainType gain_type, float value) |
| float | _fetch (self, _GainType gain_type) |
Protected Attributes | |
| float | _master = self.DEFAULT_MASTER |
| float | _red = self.DEFAULT_RED |
| float | _green = self.DEFAULT_GREEN |
| float | _blue = self.DEFAULT_BLUE |
| _handle = ctypes.c_void_p() | |
| _enabled | |
Gain is an image pipeline module that applies gain correction to an image.
This module adjusts the intensity or color gain of an image by modifying the master and per-channel (R, G, B) gain factors. It can be used to correct image brightness or color balance after acquisition.
The gain correction is applied independently to each channel, and is typically used as part of the early preprocessing stages of an image pipeline.
Default configuration:
Definition at line 21 of file gain_module.py.
| None __init__ | ( | self | ) |
Creates an instance of the gain module.
Reimplemented from ModuleBase.
Definition at line 81 of file gain_module.py.
| None __del__ | ( | self | ) |
Definition at line 100 of file gain_module.py.
|
protected |
Definition at line 298 of file gain_module.py.
|
protected |
Definition at line 306 of file gain_module.py.
| float blue | ( | self | ) |
Returns the current blue gain value.
Definition at line 200 of file gain_module.py.
| None blue | ( | self, | |
| float | value ) |
Sets the blue channel gain.
| value | Gain value within valid range. |
Definition at line 209 of file gain_module.py.
| None deserialize | ( | self, | |
| IArchive | archive ) |
Restores the module’s state from an archive.
| archive | Archive containing the serialized state. |
| CorruptedException | If the archive is malformed. |
| NotSupportedException | If version is unsupported. |
Reimplemented from ModuleBase.
Definition at line 280 of file gain_module.py.
| float green | ( | self | ) |
Returns the current green gain value.
Definition at line 179 of file gain_module.py.
| None green | ( | self, | |
| float | value ) |
Sets the green channel gain.
| value | Gain value within valid range. |
Definition at line 188 of file gain_module.py.
| float master | ( | self | ) |
Returns the current master gain value.
Definition at line 136 of file gain_module.py.
| None master | ( | self, | |
| float | value ) |
Sets the master gain.
| value | Gain value within the valid range returned by :py:meth:range. |
| OutOfRangeException | If value is outside the valid range. |
Definition at line 145 of file gain_module.py.
Processes the input image by applying gain correction (if enabled).
|
|
See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.
| input_image | Input image to be processed. |
Definition at line 240 of file gain_module.py.
| Interval range | ( | self | ) |
Returns the valid range for all gain values.
The range applies to master and per-channel gains.
Definition at line 221 of file gain_module.py.
| float red | ( | self | ) |
Returns the current red gain value.
Definition at line 158 of file gain_module.py.
| None red | ( | self, | |
| float | value ) |
Sets the red channel gain.
| value | Gain value within valid range. |
Definition at line 167 of file gain_module.py.
| None reset_to_default | ( | self | ) |
Resets all gain values to their default value (1.0).
Definition at line 116 of file gain_module.py.
| None serialize | ( | self, | |
| IArchive | archive ) |
Serializes the module’s internal state into an archive.
| archive | The target archive that will store the serialized parameters. |
Reimplemented from ModuleBase.
Definition at line 265 of file gain_module.py.
| str type | ( | self | ) |
Returns the type of the module for serialization purposes.
Definition at line 105 of file gain_module.py.
|
protected |
Definition at line 92 of file gain_module.py.
|
protected |
Definition at line 251 of file gain_module.py.
|
protected |
Definition at line 91 of file gain_module.py.
|
protected |
Definition at line 94 of file gain_module.py.
|
protected |
Definition at line 89 of file gain_module.py.
|
protected |
Definition at line 90 of file gain_module.py.
| blue |
Definition at line 278 of file gain_module.py.
|
static |
Definition at line 67 of file gain_module.py.
|
static |
Definition at line 59 of file gain_module.py.
|
static |
Definition at line 43 of file gain_module.py.
|
static |
Definition at line 51 of file gain_module.py.
| green |
Definition at line 277 of file gain_module.py.
| master |
Definition at line 275 of file gain_module.py.
| red |
Definition at line 276 of file gain_module.py.
|
static |
Definition at line 75 of file gain_module.py.