Public Member Functions | |
| None | __init__ (self) |
| Initializes a pixel format conversion module with default output pixelformat. | |
| None | __del__ (self) |
| str | type (self) |
| Returns the type of the module for serialization purposes. | |
| None | reset_to_default (self) |
| Resets the output pixel format to its default value. | |
| PixelFormat | output_pixel_format (self) |
| Returns the currently set output pixel format. | |
| None | output_pixel_format (self, PixelFormat output_pixel_format) |
| Sets the desired output pixel format. | |
| Image | process (self, Image input_image) |
| Converts the input image to the configured output pixel format. | |
| None | release_buffers (self) |
| Frees unused internal buffers. | |
| 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 | |
| PixelFormat | _enabled = self._output_pixel_format: |
Static Public Attributes | |
| PixelFormat | DEFAULT_OUTPUT_PIXEL_FORMAT = PixelFormat.RGB_8 |
Protected Attributes | |
| _handle = image_converter_handle | |
| PixelFormat | _output_pixel_format = self.DEFAULT_OUTPUT_PIXEL_FORMAT |
| bool | _enabled = True |
Pixel format conversion module that transforms images to a specified output pixel format.
The pixel format conversion module allows explicit control over the output pixel format.
Definition at line 13 of file pixelformat_conversion_module.py.
| None __init__ | ( | self | ) |
Initializes a pixel format conversion module with default output pixelformat.
Reimplemented from ModuleBase.
Definition at line 31 of file pixelformat_conversion_module.py.
| None __del__ | ( | self | ) |
Definition at line 48 of file pixelformat_conversion_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 166 of file pixelformat_conversion_module.py.
| PixelFormat output_pixel_format | ( | self | ) |
Returns the currently set output pixel format.
Definition at line 77 of file pixelformat_conversion_module.py.
| None output_pixel_format | ( | self, | |
| PixelFormat | output_pixel_format ) |
Sets the desired output pixel format.
| output_pixel_format | The desired output pixel format. |
Definition at line 89 of file pixelformat_conversion_module.py.
Converts the input image to the configured output pixel format.
| input_image | The input image to convert. |
Definition at line 100 of file pixelformat_conversion_module.py.
| None release_buffers | ( | self | ) |
Frees unused internal buffers.
This module uses pre-allocated internal buffers to accelerate conversions. When the image size or pixel format changes, new buffers are allocated, which may cause the internal buffer pool to grow over time. This function can be used to release unused buffers and reduce memory usage.
Definition at line 129 of file pixelformat_conversion_module.py.
| None reset_to_default | ( | self | ) |
Resets the output pixel format to its default value.
Definition at line 64 of file pixelformat_conversion_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 150 of file pixelformat_conversion_module.py.
| str type | ( | self | ) |
Returns the type of the module for serialization purposes.
Definition at line 53 of file pixelformat_conversion_module.py.
|
protected |
Definition at line 46 of file pixelformat_conversion_module.py.
| PixelFormat _enabled = self._output_pixel_format: |
Definition at line 114 of file pixelformat_conversion_module.py.
|
protected |
Definition at line 44 of file pixelformat_conversion_module.py.
|
protected |
Definition at line 45 of file pixelformat_conversion_module.py.
|
static |
Definition at line 29 of file pixelformat_conversion_module.py.