![]() |
IDS peak ICV v1.1.0
|

Public Member Functions | |
| None | __init__ (self) |
| Creates an instance of class UnpackModule. | |
| None | __del__ (self) |
| int | target_bit_depth (self) |
| Get the target bit depth used during image processing. | |
| None | target_bit_depth (self, int bit_depth) |
| Set the target bit depth for image processing. | |
| ProcessingPolicy | processing_policy (self) |
| Get the currently configured processing policy. | |
| None | processing_policy (self, ProcessingPolicy policy) |
| Set the processing policy. | |
| bool | enabled (self) |
| Returns true since the unpack module is always enabled. | |
| None | enabled (self, bool enabled) |
| Does nothing. | |
| str | type (self) |
| Returns the type of the module for serialization purposes. | |
| Image | process (self, Image input_image) |
| Converts a packed pixel format image into an unpacked Bayer or monochrome format. | |
| None | reset_to_default (self) |
| Resets all module settings. | |
| 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. | |
Static Public Attributes | |
| DEFAULT_POLICY = ProcessingPolicy.FAST | |
| int | DEFAULT_TARGET_BIT_DEPTH = 8 |
Protected Member Functions | |
| int | _get_output_bit_depth (self, int input_bit_depth) |
| PixelFormat | _get_output_pixel_format (self, PixelFormat input_pixel_format, int output_bit_depth) |
Static Protected Member Functions | |
| PixelFormat | _bayer_bg_format (int bit_depth) |
| PixelFormat | _bayer_gb_format (int bit_depth) |
| PixelFormat | _bayer_gr_format (int bit_depth) |
| PixelFormat | _bayer_rg_format (int bit_depth) |
| PixelFormat | _mono_format (int bit_depth) |
Protected Attributes | |
| _handle = image_converter_handle | |
| int | _target_bit_depth = self.DEFAULT_TARGET_BIT_DEPTH |
| ProcessingPolicy | _policy = self.DEFAULT_POLICY |
Unpack is an image pipeline module that converts packed pixel formats into corresponding unpacked Bayer or mono formats.
The unpack module is always enabled and cannot be disabled. It converts input images with packed pixel formats into their corresponding unpacked Bayer or monochrome formats, preserving the original bit depth of the image.
Default configuration:
Definition at line 13 of file unpack_module.py.
| None __init__ | ( | self | ) |
Creates an instance of class UnpackModule.
Reimplemented from ModuleBase.
Definition at line 33 of file unpack_module.py.
| None __del__ | ( | self | ) |
Definition at line 49 of file unpack_module.py.
|
staticprotected |
Definition at line 313 of file unpack_module.py.
|
staticprotected |
Definition at line 321 of file unpack_module.py.
|
staticprotected |
Definition at line 329 of file unpack_module.py.
|
staticprotected |
Definition at line 337 of file unpack_module.py.
|
protected |
Definition at line 246 of file unpack_module.py.
|
protected |
Definition at line 253 of file unpack_module.py.
|
staticprotected |
Definition at line 345 of file unpack_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. |
Reimplemented from ModuleBase.
Definition at line 227 of file unpack_module.py.
| bool enabled | ( | self | ) |
Returns true since the unpack module is always enabled.
Reimplemented from ModuleBase.
Definition at line 118 of file unpack_module.py.
| None enabled | ( | self, | |
| bool | enabled ) |
Does nothing.
The module is always enabled, because otherwise following modules will fail.
Reimplemented from ModuleBase.
Definition at line 129 of file unpack_module.py.
Converts a packed pixel format image into an unpacked Bayer or monochrome format.
This function unpacks the input image from a packed format to its corresponding unpacked Bayer or monochrome format, preserving the input bit depth.
This operation disregards any specified image regions and processes the entire image.
| input_image | input The packed input image to unpack. |
Reimplemented from IModule.
Definition at line 149 of file unpack_module.py.
| ProcessingPolicy processing_policy | ( | self | ) |
Get the currently configured processing policy.
Definition at line 96 of file unpack_module.py.
| None processing_policy | ( | self, | |
| ProcessingPolicy | policy ) |
Set the processing policy.
| policy | The desired processing policy. |
Definition at line 107 of file unpack_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 192 of file unpack_module.py.
| None reset_to_default | ( | self | ) |
Resets all module settings.
Resets the target bit depth to 8 and the processing policy to ProcessingPolicy.FAST
Reimplemented from IModule.
Definition at line 180 of file unpack_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 211 of file unpack_module.py.
| int target_bit_depth | ( | self | ) |
Get the target bit depth used during image processing.
This value specifies the bit depth the module will aim for when unpacking packed pixel formats. The actual output bit depth depends on the selected :class:ProcessingPolicy.
Definition at line 54 of file unpack_module.py.
| None target_bit_depth | ( | self, | |
| int | bit_depth ) |
Set the target bit depth for image processing.
The target bit depth acts as a reference when deciding how to unpack packed pixel formats. The actual resulting bit depth depends on the selected :class:ProcessingPolicy:
This allows you to downsample, preserve, or enhance bit depth depending on your use case.
| bit_depth | The desired target bit depth (e.g., 8, 10, 12). |
Definition at line 70 of file unpack_module.py.
| str type | ( | self | ) |
Returns the type of the module for serialization purposes.
Reimplemented from IModule.
Definition at line 139 of file unpack_module.py.
|
protected |
Definition at line 45 of file unpack_module.py.
|
protected |
Definition at line 47 of file unpack_module.py.
|
protected |
Definition at line 46 of file unpack_module.py.
|
static |
Definition at line 30 of file unpack_module.py.
|
static |
Definition at line 31 of file unpack_module.py.