
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:
| None __init__ | ( | self | ) |
Initialize a color matrix transformation module with default settings.
Reimplemented from ModuleBase.
| None __del__ | ( | self | ) |
|
protected |
|
protected |
| 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.
| algorithm | The ChromaticAdaptionAlgorithm to apply. |
| 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.
| enabled | True to enable chromatic adaptation, false to disable it. |
| bool color_correction_enabled | ( | self | ) |
Gets whether color correction is enabled.
When enabled, :func:process applies color correction to the input image.
| 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. |
| 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.
| temperature | The color temperature value in Kelvin. |
| Range color_temperature_range | ( | self | ) |
Returns the valid range of values for color temperature.
| 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.
| np.ndarray effective_matrix | ( | self | ) |
Returns the final effective matrix calculated by concatenating all enabled transformations (e.g., Chromatic Adaptation, Color Correction, and Saturation).
| 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.
| bool has_color_temperature | ( | self | ) |
Checks if a specific color temperature has been explicitly set.
| np.ndarray matrix | ( | self | ) |
Gets the current color correction matrix.
| None matrix | ( | self, | |
| np.ndarray | matrix ) |
Sets the color correction matrix.
| matrix | The color correction matrix. |
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. |
| None reset_chromatic_adaption | ( | self | ) |
Resets all chromatic adaptation settings (temperature, algorithm, color space) to their default values.
| None reset_color_temperature | ( | self | ) |
Resets the color temperature to its default, uninitialized state.
| None reset_to_default | ( | self | ) |
Resets all settings to their defaults.
Default configuration:
| float saturation | ( | self | ) |
| None saturation | ( | self, | |
| float | saturation ) |
| bool saturation_enabled | ( | self | ) |
Gets whether saturation is enabled.
When enabled, :func:process applies saturation to the input image.
| 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. |
| Interval saturation_range | ( | self | ) |
| 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.
| 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.
| color_space | The target ColorSpace. |
| str type | ( | self | ) |
| int version | ( | self | ) |
Return the module version.
Reimplemented from ModuleBase.
|
protected |
| np.ndarray _auto_feature_module = self.effective_matrix |
|
protected |
| chromatic_adaption_algorithm = ChromaticAdaptionAlgorithm.BRADFORD |
| chromatic_adaption_enabled = enabled |
| color_correction_enabled = enabled |
| color_temperature |
|
static |
|
static |
| enabled |
| matrix = self.DEFAULT_MATRIX |
| saturation = self.DEFAULT_SATURATION |
| saturation_enabled = enabled |
|
static |
| target_color_space = ColorSpace.SRGB_D65 |
| version |