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

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) |
| Get whether this module is enabled. | |
| None | enabled (self, bool value) |
| Enable or disable 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 module settings. | |
| 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 | |
| digital_black | |
| enabled | |
| digital_black_enabled | |
| version | |
| gamma_enabled = gamma_archive.get("Enabled", bool) | |
| 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:
Definition at line 12 of file tone_curve_correction_module.py.
| None __init__ | ( | self | ) |
Initialize a tone curve correction module with default settings.
Reimplemented from ModuleBase.
Definition at line 38 of file tone_curve_correction_module.py.
| None __del__ | ( | self | ) |
Definition at line 59 of file tone_curve_correction_module.py.
|
protected |
Apply digital black correction to the backend.
Definition at line 362 of file tone_curve_correction_module.py.
|
protected |
Apply gamma correction to the backend.
Definition at line 349 of file tone_curve_correction_module.py.
| 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.
Definition at line 322 of file tone_curve_correction_module.py.
| float digital_black | ( | self | ) |
Gets the current digital black offset.
Definition at line 177 of file tone_curve_correction_module.py.
| 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. |
Definition at line 189 of file tone_curve_correction_module.py.
| bool digital_black_enabled | ( | self | ) |
Whether digital black correction is enabled.
Definition at line 222 of file tone_curve_correction_module.py.
| None digital_black_enabled | ( | self, | |
| bool | enabled ) |
Whether digital black correction is enabled.
| enabled | True if the digital black offset is applied. |
Definition at line 234 of file tone_curve_correction_module.py.
| Interval digital_black_range | ( | self | ) |
Returns the valid range for the digital black correction value.
Definition at line 207 of file tone_curve_correction_module.py.
| bool enabled | ( | self | ) |
Get whether this module is enabled.
When disabled, :func:process returns the input image unchanged.
Reimplemented from ModuleBase.
Definition at line 75 of file tone_curve_correction_module.py.
| None enabled | ( | self, | |
| bool | value ) |
Enable or disable the module.
When disabled, :func:process returns the input image unchanged.
| value | True to enable, False to disable. |
Reimplemented from ModuleBase.
Definition at line 89 of file tone_curve_correction_module.py.
| float gamma | ( | self | ) |
Gets the current gamma correction exponent.
Definition at line 104 of file tone_curve_correction_module.py.
| 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. |
Definition at line 116 of file tone_curve_correction_module.py.
| bool gamma_enabled | ( | self | ) |
Whether gamma correction is enabled.
Definition at line 151 of file tone_curve_correction_module.py.
| None gamma_enabled | ( | self, | |
| bool | enabled ) |
Whether gamma correction is enabled.
| enabled | True if gamma correction is enabled. |
Definition at line 163 of file tone_curve_correction_module.py.
| Interval gamma_range | ( | self | ) |
Returns the valid range for the gamma correction exponent.
Definition at line 136 of file tone_curve_correction_module.py.
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. |
Reimplemented from IModule.
Definition at line 263 of file tone_curve_correction_module.py.
| None reset_to_default | ( | self | ) |
Resets all module settings.
Restores the module configuration to its default values:
Reimplemented from IModule.
Definition at line 247 of file tone_curve_correction_module.py.
| 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.
Reimplemented from ModuleBase.
Definition at line 296 of file tone_curve_correction_module.py.
| str type | ( | self | ) |
Returns the type of the module for serialization purposes.
Reimplemented from IModule.
Definition at line 64 of file tone_curve_correction_module.py.
|
protected |
Definition at line 55 of file tone_curve_correction_module.py.
|
protected |
Definition at line 57 of file tone_curve_correction_module.py.
|
protected |
Definition at line 54 of file tone_curve_correction_module.py.
|
protected |
Definition at line 56 of file tone_curve_correction_module.py.
|
protected |
Definition at line 53 of file tone_curve_correction_module.py.
|
static |
Definition at line 29 of file tone_curve_correction_module.py.
|
static |
Definition at line 28 of file tone_curve_correction_module.py.
| digital_black |
Definition at line 261 of file tone_curve_correction_module.py.
| digital_black_enabled |
Definition at line 286 of file tone_curve_correction_module.py.
| enabled |
Definition at line 280 of file tone_curve_correction_module.py.
| gamma = float(gamma_archive.get("Value", float)) |
Definition at line 343 of file tone_curve_correction_module.py.
| gamma_enabled = gamma_archive.get("Enabled", bool) |
Definition at line 342 of file tone_curve_correction_module.py.
|
static |
Definition at line 31 of file tone_curve_correction_module.py.
| version |
Definition at line 310 of file tone_curve_correction_module.py.