
Public Member Functions | |
| None | __init__ (self) |
| Initialize a tone curve correction module with default settings. | |
| None | __del__ (self) |
| str | type (self) |
| Returns the type of the module for serialization purposes. | |
| bool | enabled (self) |
| Gets whether this module is enabled. | |
| None | enabled (self, bool enabled) |
| Enables or disables the module. | |
| float | gamma (self) |
| Gets the current gamma correction exponent. | |
| None | gamma (self, float value) |
| Sets the gamma correction exponent. | |
| Interval | gamma_range (self) |
| Returns the valid range for the gamma correction exponent. | |
| bool | gamma_enabled (self) |
| Whether gamma correction is enabled. | |
| None | gamma_enabled (self, bool enabled) |
| Whether gamma correction is enabled. | |
| float | digital_black (self) |
| Gets the current digital black offset. | |
| None | digital_black (self, float value) |
| Sets the digital black used for digital black correction. | |
| Interval | digital_black_range (self) |
| Returns the valid range for the digital black correction value. | |
| bool | digital_black_enabled (self) |
| Whether digital black correction is enabled. | |
| None | digital_black_enabled (self, bool enabled) |
| Whether digital black correction is enabled. | |
| None | reset_to_default (self) |
| Resets all settings to their defaults. | |
| Image | process (self, Image input_image) |
| Processes the input image and returns a tone curve corrected output image. | |
| None | serialize (self, IArchive archive) |
| Serializes the object's internal state into the provided archive. | |
| None | deserialize (self, IArchive archive) |
| Restores the object's state from the provided archive. | |
Data Fields | |
| bool | digital_black_enabled = enabled |
| bool | gamma_enabled = enabled |
| digital_black | |
| enabled | |
| version | |
| gamma = float(gamma_archive.get("Value", float)) | |
Static Public Attributes | |
| float | DEFAULT_GAMMA = 1.0 |
| float | DEFAULT_DIGITAL_BLACK = 0.0 |
| list | SUPPORTED_PIXEL_FORMATS |
Protected Member Functions | |
| None | _apply_gamma (self, float value) |
| Apply gamma correction to the backend. | |
| None | _apply_digital_black (self, float value) |
| Apply digital black correction to the backend. | |
Protected Attributes | |
| _handle = handle | |
| float | _gamma = 1.0 |
| float | _digital_black = 0.0 |
| bool | _gamma_enabled = True |
| bool | _digital_black_enabled = True |
A pipeline module for applying tone curve corrections such as gamma adjustment and digital black offset.
Both, gamma and digital black corrections can be individually enabled or disabled.
Default configuration:
| None __init__ | ( | self | ) |
Initialize a tone curve correction module with default settings.
Reimplemented from ModuleBase.
| None __del__ | ( | self | ) |
|
protected |
Apply digital black correction to the backend.
|
protected |
Apply gamma correction to the backend.
| None deserialize | ( | self, | |
| IArchive | archive ) |
Restores the object's state from the provided archive.
This function reads and applies all necessary parameters from the given archive to reconstruct the internal state of the object. It ensures that the object is restored to a valid and consistent state.
| archive | The source archive containing the serialized parameters. |
| CorruptedException | If Archive is malformed, misses keys or the values are invalid |
| NotSupportedException | If the 'Version' entry indicates an unsupported version. |
Reimplemented from ModuleBase.
| float digital_black | ( | self | ) |
Gets the current digital black offset.
| None digital_black | ( | self, | |
| float | value ) |
Sets the digital black used for digital black correction.
This value is subtracted from the input image channel values before gamma correction. It typically represents sensor black offset.
| value | The digital black value in normalized units. |
| bool digital_black_enabled | ( | self | ) |
Whether digital black correction is enabled.
| None digital_black_enabled | ( | self, | |
| bool | enabled ) |
Whether digital black correction is enabled.
| enabled | True if the digital black offset is applied. |
| Interval digital_black_range | ( | self | ) |
Returns the valid range for the digital black correction value.
| bool enabled | ( | self | ) |
Gets whether this module is enabled.
When disabled, :func:process returns the input image unchanged.
Reimplemented from ModuleBase.
| None enabled | ( | self, | |
| bool | enabled ) |
Enables or disables the module.
When disabled, :func:process returns the input image unchanged.
| enabled | True to enable, False to disable. |
Reimplemented from ModuleBase.
| float gamma | ( | self | ) |
Gets the current gamma correction exponent.
| None gamma | ( | self, | |
| float | value ) |
Sets the gamma correction exponent.
This value determines the degree of inverse gamma correction applied during processing, where output values are computed as pow(input, 1/gamma). Higher gamma values lighten the image, while values closer to zero darken it.
| value | The gamma exponent. |
| bool gamma_enabled | ( | self | ) |
Whether gamma correction is enabled.
| None gamma_enabled | ( | self, | |
| bool | enabled ) |
Whether gamma correction is enabled.
| enabled | True if gamma correction is enabled. |
| Interval gamma_range | ( | self | ) |
Returns the valid range for the gamma correction exponent.
Processes the input image and returns a tone curve corrected output image.
|
|
|
See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.
Images with other formats are passed through unmodified.
This operation disregards any specified image regions and processes the entire image.
| input_image | The input image to be processed. |
| None reset_to_default | ( | self | ) |
Resets all settings to their defaults.
Default configuration:
| None serialize | ( | self, | |
| IArchive | archive ) |
Serializes the object's internal state into the provided archive.
This function populates the given archive with all parameters required to fully represent the current state of the object. It ensures that the object can be reconstructed or transmitted accurately by saving all relevant data members in a consistent and structured format.
| archive | The target archive that will store the serialized parameters. |
Reimplemented from ModuleBase.
| str type | ( | self | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
static |
| digital_black |
| bool digital_black_enabled = enabled |
| enabled |
| gamma = float(gamma_archive.get("Value", float)) |
| bool gamma_enabled = enabled |
|
static |
| version |