
Public Member Functions | |
| None | __init__ (self) |
| Initialize a color matrix transformation module with default settings. | |
| None | __del__ (self) |
| str | type (self) |
| Returns the type of the module for serialization purposes. | |
| int | version (self) |
| Return the module version. | |
| bool | enabled (self) |
| Gets whether this module is enabled. | |
| None | enabled (self, bool enabled) |
| Enables or disables the module. | |
| np.ndarray | matrix (self) |
| Gets the current color correction matrix. | |
| None | matrix (self, np.ndarray matrix) |
| Sets the color correction matrix. | |
| float | saturation (self) |
| Gets the current saturation value. | |
| None | saturation (self, float saturation) |
| Sets the saturation value. | |
| Interval | saturation_range (self) |
| Gets the valid range for saturation. | |
| bool | color_correction_enabled (self) |
| Gets whether color correction is enabled. | |
| None | color_correction_enabled (self, bool enabled) |
| Enables or disables color correction. | |
| bool | chromatic_adaption_enabled (self) |
| Checks if the chromatic adaptation feature is enabled. | |
| None | chromatic_adaption_enabled (self, bool enabled) |
| Enables or disables the chromatic adaptation feature. | |
| ChromaticAdaptionAlgorithm | chromatic_adaption_algorithm (self) |
| Returns the current algorithm used for chromatic adaptation. | |
| None | chromatic_adaption_algorithm (self, ChromaticAdaptionAlgorithm algorithm) |
| Sets the algorithm used to calculate the chromatic adaptation transformation. | |
| ColorSpace | target_color_space (self) |
| Returns the target color space used for chromatic adaptation. | |
| None | target_color_space (self, ColorSpace color_space) |
| Sets the target color space for the chromatic adaptation transformation. | |
| int | color_temperature (self) |
| Returns the currently configured source color temperature in Kelvin. | |
| None | color_temperature (self, int temperature) |
| Sets the source color temperature in Kelvin to be used for chromatic adaptation. | |
| Range | color_temperature_range (self) |
| Returns the valid range of values for color temperature. | |
| bool | has_color_temperature (self) |
| Checks if a specific color temperature has been explicitly set. | |
| None | reset_color_temperature (self) |
| Resets the color temperature to its default, uninitialized state. | |
| None | reset_chromatic_adaption (self) |
| Resets all chromatic adaptation settings (temperature, algorithm, color space) to their default values. | |
| bool | saturation_enabled (self) |
| Gets whether saturation is enabled. | |
| None | saturation_enabled (self, bool enabled) |
| Enables or disables saturation. | |
| Image | process (self, Image input_image) |
| Processes the input image and returns a color corrected and/or saturated output image. | |
| None | reset_to_default (self) |
| Resets all settings to their defaults. | |
| 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. | |
| np.ndarray | effective_matrix (self) |
| Returns the final effective matrix calculated by concatenating all enabled transformations (e.g., Chromatic Adaptation, Color Correction, and Saturation). | |
Data Fields | |
| bool | color_correction_enabled = enabled |
| bool | saturation_enabled = enabled |
| bool | chromatic_adaption_enabled = enabled |
| chromatic_adaption_algorithm = ChromaticAdaptionAlgorithm.BRADFORD | |
| target_color_space = ColorSpace.SRGB_D65 | |
| enabled | |
| np | matrix = self.DEFAULT_MATRIX |
| float | saturation = self.DEFAULT_SATURATION |
| version | |
| color_temperature | |
| np.ndarray | _auto_feature_module = self.effective_matrix |
Static Public Attributes | |
| np | DEFAULT_MATRIX = np.eye(3) |
| float | DEFAULT_SATURATION = 1.0 |
| list | SUPPORTED_PIXEL_FORMATS |
Protected Member Functions | |
| None | _set_autofeature_module (self, IAutoFeature|None auto_feature_module) |
| None | _update_matrix_in_auto_feature_module (self) |
Protected Attributes | |
| _handle = _color_matrix_transformation_handle | |
| IAutoFeature|None | _auto_feature_module = None |
Color matrix transformation is an image pipeline module that applies a color correction matrix to an image.
Provides the features ColorCorrectionFeature, SaturationFeature and ChromaticAdaptionFeature.
Default configuration:
Definition at line 19 of file color_matrix_transformation_module.py.
| None __init__ | ( | self | ) |
Initialize a color matrix transformation module with default settings.
Reimplemented from ModuleBase.
Definition at line 56 of file color_matrix_transformation_module.py.
| None __del__ | ( | self | ) |
Definition at line 75 of file color_matrix_transformation_module.py.
|
protected |
Definition at line 639 of file color_matrix_transformation_module.py.
|
protected |
Definition at line 661 of file color_matrix_transformation_module.py.
| ChromaticAdaptionAlgorithm chromatic_adaption_algorithm | ( | self | ) |
Returns the current algorithm used for chromatic adaptation.
Definition at line 303 of file color_matrix_transformation_module.py.
| None chromatic_adaption_algorithm | ( | self, | |
| ChromaticAdaptionAlgorithm | algorithm ) |
Sets the algorithm used to calculate the chromatic adaptation transformation.
| algorithm | The ChromaticAdaptionAlgorithm to apply. |
Definition at line 321 of file color_matrix_transformation_module.py.
| bool chromatic_adaption_enabled | ( | self | ) |
Checks if the chromatic adaptation feature is enabled.
Definition at line 267 of file color_matrix_transformation_module.py.
| None chromatic_adaption_enabled | ( | self, | |
| bool | enabled ) |
Enables or disables the chromatic adaptation feature.
| enabled | True to enable chromatic adaptation, false to disable it. |
Definition at line 286 of file color_matrix_transformation_module.py.
| bool color_correction_enabled | ( | self | ) |
Gets whether color correction is enabled.
When enabled, :func:process applies color correction to the input image.
Definition at line 227 of file color_matrix_transformation_module.py.
| None color_correction_enabled | ( | self, | |
| bool | enabled ) |
Enables or disables color correction.
When enabled, :func:process applies color correction to the input image.
| enabled | True to enable, False to disable. |
Definition at line 248 of file color_matrix_transformation_module.py.
| int color_temperature | ( | self | ) |
Returns the currently configured source color temperature in Kelvin.
Definition at line 373 of file color_matrix_transformation_module.py.
| None color_temperature | ( | self, | |
| int | temperature ) |
Sets the source color temperature in Kelvin to be used for chromatic adaptation.
| temperature | The color temperature value in Kelvin. |
Definition at line 391 of file color_matrix_transformation_module.py.
| Range color_temperature_range | ( | self | ) |
Returns the valid range of values for color temperature.
Definition at line 408 of file color_matrix_transformation_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 593 of file color_matrix_transformation_module.py.
| np.ndarray effective_matrix | ( | self | ) |
Returns the final effective matrix calculated by concatenating all enabled transformations (e.g., Chromatic Adaptation, Color Correction, and Saturation).
Definition at line 644 of file color_matrix_transformation_module.py.
| bool enabled | ( | self | ) |
Gets whether this module is enabled.
When disabled, :func:process returns the input image unchanged.
Reimplemented from ModuleBase.
Definition at line 104 of file color_matrix_transformation_module.py.
| 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.
Definition at line 118 of file color_matrix_transformation_module.py.
| bool has_color_temperature | ( | self | ) |
Checks if a specific color temperature has been explicitly set.
Definition at line 425 of file color_matrix_transformation_module.py.
| np.ndarray matrix | ( | self | ) |
Gets the current color correction matrix.
Definition at line 135 of file color_matrix_transformation_module.py.
| None matrix | ( | self, | |
| np.ndarray | matrix ) |
Sets the color correction matrix.
| matrix | The color correction matrix. |
Definition at line 157 of file color_matrix_transformation_module.py.
Processes the input image and returns a color corrected and/or saturated 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.
| input_image | The input image to be processed. |
Definition at line 506 of file color_matrix_transformation_module.py.
| None reset_chromatic_adaption | ( | self | ) |
Resets all chromatic adaptation settings (temperature, algorithm, color space) to their default values.
Definition at line 455 of file color_matrix_transformation_module.py.
| None reset_color_temperature | ( | self | ) |
Resets the color temperature to its default, uninitialized state.
Definition at line 442 of file color_matrix_transformation_module.py.
| None reset_to_default | ( | self | ) |
Resets all settings to their defaults.
Default configuration:
Definition at line 536 of file color_matrix_transformation_module.py.
| float saturation | ( | self | ) |
Gets the current saturation value.
Definition at line 177 of file color_matrix_transformation_module.py.
| None saturation | ( | self, | |
| float | saturation ) |
Sets the saturation value.
| saturation | The saturation value. |
Definition at line 194 of file color_matrix_transformation_module.py.
| bool saturation_enabled | ( | self | ) |
Gets whether saturation is enabled.
When enabled, :func:process applies saturation to the input image.
Definition at line 467 of file color_matrix_transformation_module.py.
| None saturation_enabled | ( | self, | |
| bool | enabled ) |
Enables or disables saturation.
When enabled, :func:process applies saturation to the input image.
| enabled | True to enable, False to disable. |
Definition at line 488 of file color_matrix_transformation_module.py.
| Interval saturation_range | ( | self | ) |
Gets the valid range for saturation.
Definition at line 211 of file color_matrix_transformation_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.
| archive | The target archive that will store the serialized parameters. |
Reimplemented from ModuleBase.
Definition at line 554 of file color_matrix_transformation_module.py.
| ColorSpace target_color_space | ( | self | ) |
Returns the target color space used for chromatic adaptation.
Definition at line 338 of file color_matrix_transformation_module.py.
| None target_color_space | ( | self, | |
| ColorSpace | color_space ) |
Sets the target color space for the chromatic adaptation transformation.
| color_space | The target ColorSpace. |
Definition at line 356 of file color_matrix_transformation_module.py.
| str type | ( | self | ) |
Returns the type of the module for serialization purposes.
Definition at line 80 of file color_matrix_transformation_module.py.
| int version | ( | self | ) |
Return the module version.
Reimplemented from ModuleBase.
Definition at line 92 of file color_matrix_transformation_module.py.
|
protected |
Definition at line 71 of file color_matrix_transformation_module.py.
| np.ndarray _auto_feature_module = self.effective_matrix |
Definition at line 662 of file color_matrix_transformation_module.py.
|
protected |
Definition at line 70 of file color_matrix_transformation_module.py.
| chromatic_adaption_algorithm = ChromaticAdaptionAlgorithm.BRADFORD |
Definition at line 462 of file color_matrix_transformation_module.py.
| chromatic_adaption_enabled = enabled |
Definition at line 131 of file color_matrix_transformation_module.py.
| color_correction_enabled = enabled |
Definition at line 129 of file color_matrix_transformation_module.py.
| color_temperature |
Definition at line 589 of file color_matrix_transformation_module.py.
|
static |
Definition at line 34 of file color_matrix_transformation_module.py.
|
static |
Definition at line 42 of file color_matrix_transformation_module.py.
| enabled |
Definition at line 523 of file color_matrix_transformation_module.py.
| matrix = self.DEFAULT_MATRIX |
Definition at line 550 of file color_matrix_transformation_module.py.
| saturation = self.DEFAULT_SATURATION |
Definition at line 551 of file color_matrix_transformation_module.py.
| saturation_enabled = enabled |
Definition at line 130 of file color_matrix_transformation_module.py.
|
static |
Definition at line 50 of file color_matrix_transformation_module.py.
| target_color_space = ColorSpace.SRGB_D65 |
Definition at line 463 of file color_matrix_transformation_module.py.
| version |
Definition at line 571 of file color_matrix_transformation_module.py.