![]() |
IDS peak ICV v1.2.0
|
Public Member Functions | |
| None | __init__ (self) |
| Creates an instance of class ModuleBase. | |
| None | __del__ (self) |
| str | type (self) |
| Returns the type of the module (used for serialization or UI). | |
| None | reset_to_default (self) |
| Resets the output pixel format to its default value (RGB8). | |
| 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) |
| Processes the input image, performing mono conversion if enabled. | |
| 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.
This module allows explicit control over the output pixel format and provides serialization capabilities for saving/restoring state.
Default pixel format: PixelFormat.RGB8
Definition at line 13 of file pixelformat_conversion_module.py.
| None __init__ | ( | self | ) |
Creates an instance of class ModuleBase.
Reimplemented from ModuleBase.
Definition at line 28 of file pixelformat_conversion_module.py.
| None __del__ | ( | self | ) |
Definition at line 44 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 159 of file pixelformat_conversion_module.py.
| PixelFormat output_pixel_format | ( | self | ) |
Returns the currently set output pixel format.
Definition at line 70 of file pixelformat_conversion_module.py.
| None output_pixel_format | ( | self, | |
| PixelFormat | output_pixel_format ) |
Sets the desired output pixel format.
| output_pixel_format | PixelFormat to be set as output. |
Definition at line 82 of file pixelformat_conversion_module.py.
Processes the input image, performing mono conversion if enabled.
This function converts the input image to a monochrome format if the module is enabled. The output image preserves the bit depth of the input. If the module is disabled, the input image is returned unchanged.
| input_image | The input image to convert. |
Reimplemented from IModule.
Definition at line 93 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.
Avoid calling this function too frequently (e.g., after every resize or format change), as it introduces some overhead.
Definition at line 122 of file pixelformat_conversion_module.py.
| None reset_to_default | ( | self | ) |
Resets the output pixel format to its default value (RGB8).
Reimplemented from IModule.
Definition at line 60 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.
Reimplemented from ModuleBase.
Definition at line 143 of file pixelformat_conversion_module.py.
| str type | ( | self | ) |
Returns the type of the module (used for serialization or UI).
Reimplemented from IModule.
Definition at line 49 of file pixelformat_conversion_module.py.
|
protected |
Definition at line 42 of file pixelformat_conversion_module.py.
| PixelFormat _enabled = self._output_pixel_format: |
Definition at line 107 of file pixelformat_conversion_module.py.
|
protected |
Definition at line 40 of file pixelformat_conversion_module.py.
|
protected |
Definition at line 41 of file pixelformat_conversion_module.py.
|
static |
Definition at line 26 of file pixelformat_conversion_module.py.