
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:
| None __init__ | ( | self | ) |
| None __del__ | ( | self | ) |
|
protected |
|
protected |
| float blue | ( | self | ) |
Returns the current blue gain value.
| None blue | ( | self, | |
| float | value ) |
| 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.
| float green | ( | self | ) |
Returns the current green gain value.
| None green | ( | self, | |
| float | value ) |
| float master | ( | self | ) |
Returns the current master gain value.
| 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. |
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. |
| Interval range | ( | self | ) |
Returns the valid range for all gain values.
The range applies to master and per-channel gains.
| float red | ( | self | ) |
Returns the current red gain value.
| None red | ( | self, | |
| float | value ) |
| None reset_to_default | ( | self | ) |
Resets all gain values to their default value (1.0).
| 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.
| str type | ( | self | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| blue |
|
static |
|
static |
|
static |
|
static |
| green |
| master |
| red |
|
static |