IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
PixelFormatConversionModule Class Reference
Inheritance diagram for PixelFormatConversionModule:

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
 

Detailed Description

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.

Defaults
  • PixelFormat.RGB_8
Since
ids_peak_icv 1.0

Definition at line 13 of file pixelformat_conversion_module.py.

Constructor & Destructor Documentation

◆ __init__()

None __init__ ( self)

Initializes a pixel format conversion module with default output pixelformat.

Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 31 of file pixelformat_conversion_module.py.

◆ __del__()

None __del__ ( self)

Definition at line 48 of file pixelformat_conversion_module.py.

Member Function Documentation

◆ deserialize()

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.

Parameters
archiveThe source archive containing the serialized parameters.
Exceptions
CorruptedExceptionIf Archive is malformed, misses keys or the values are invalid
NotSupportedExceptionIf the 'Version' entry indicates an unsupported version.
Note
This function requires that the archive contains all expected fields as produced by a corresponding serialize() call.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 166 of file pixelformat_conversion_module.py.

◆ output_pixel_format() [1/2]

PixelFormat output_pixel_format ( self)

Returns the currently set output pixel format.

Returns
The current output pixel format.
Since
ids_peak_icv 1.0

Definition at line 77 of file pixelformat_conversion_module.py.

◆ output_pixel_format() [2/2]

None output_pixel_format ( self,
PixelFormat output_pixel_format )

Sets the desired output pixel format.

Parameters
output_pixel_formatThe desired output pixel format.
Since
ids_peak_icv 1.0

Definition at line 89 of file pixelformat_conversion_module.py.

◆ process()

Image process ( self,
Image input_image )

Converts the input image to the configured output pixel format.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
input_imageThe input image to convert.
Returns
The converted image in the specified pixel format.
Since
ids_peak_icv 1.0

Definition at line 100 of file pixelformat_conversion_module.py.

◆ release_buffers()

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.

Note
Avoid calling this function too frequently (e.g., after every resize or format change), as it introduces some overhead.
Since
ids_peak_icv 1.0

Definition at line 129 of file pixelformat_conversion_module.py.

◆ reset_to_default()

None reset_to_default ( self)

Resets the output pixel format to its default value.

Note
The enabled state does not change when calling this function.
Since
ids_peak_icv 1.0

Definition at line 64 of file pixelformat_conversion_module.py.

◆ serialize()

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.

Parameters
archiveThe target archive that will store the serialized parameters.
Since
ids_peak_icv 1.0

Reimplemented from ModuleBase.

Definition at line 150 of file pixelformat_conversion_module.py.

◆ type()

str type ( self)

Returns the type of the module for serialization purposes.

Returns
Module type
Since
ids_peak_icv 1.0

Definition at line 53 of file pixelformat_conversion_module.py.

Field Documentation

◆ _enabled [1/2]

bool _enabled = True
protected

Definition at line 46 of file pixelformat_conversion_module.py.

◆ _enabled [2/2]

PixelFormat _enabled = self._output_pixel_format:

Definition at line 114 of file pixelformat_conversion_module.py.

◆ _handle

_handle = image_converter_handle
protected

Definition at line 44 of file pixelformat_conversion_module.py.

◆ _output_pixel_format

PixelFormat _output_pixel_format = self.DEFAULT_OUTPUT_PIXEL_FORMAT
protected

Definition at line 45 of file pixelformat_conversion_module.py.

◆ DEFAULT_OUTPUT_PIXEL_FORMAT

PixelFormat DEFAULT_OUTPUT_PIXEL_FORMAT = PixelFormat.RGB_8
static

Definition at line 29 of file pixelformat_conversion_module.py.