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.
| None __init__ | ( | self | ) |
Initializes a pixel format conversion module with default output pixelformat.
Reimplemented from ModuleBase.
| None __del__ | ( | self | ) |
| 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.
| 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.
| output_pixel_format | The desired output pixel format. |
Converts the input image to the configured output pixel format.
| input_image | The input image to convert. |
| 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.
| None reset_to_default | ( | self | ) |
Resets the output pixel format to its default value.
| 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 |
| PixelFormat _enabled = self._output_pixel_format: |
|
protected |
|
protected |
|
static |