IDS peak ICV v1.0.0
Loading...
Searching...
No Matches
PixelFormatConversionModule Class Reference

#include <peak_icv/pipeline/detail/peak_icv_pixel_format_conversion_module.hpp>

Inheritance diagram for PixelFormatConversionModule:
Collaboration diagram for PixelFormatConversionModule:

Public Member Functions

 PixelFormatConversionModule ()
 Creates an instance of class PixelFormatConversionModule with default output pixelformat.
 
 ~PixelFormatConversionModule () override
 
 PixelFormatConversionModule (const PixelFormatConversionModule &other)=delete
 Copy constructor for class PixelFormatConversionModule is deleted.
 
 PixelFormatConversionModule (PixelFormatConversionModule &&other) noexcept
 
PixelFormatConversionModule & operator= (const PixelFormatConversionModule &other)=delete
 Copy assignment for class PixelFormatConversionModule is deleted.
 
PixelFormatConversionModule & operator= (PixelFormatConversionModule &&other) noexcept
 
void Serialize (peak::common::serialization::IArchive &archive) const override
 Serializes the object's internal state into the provided archive.
 
void Deserialize (const peak::common::serialization::IArchive &archive) override
 Restores the object's state from the provided archive.
 
void SetEnabled (bool enabled) override
 Sets the enabled state of this module.
 
bool IsEnabled () const override
 Checks if the module is currently enabled.
 
const char * GetType () const override
 Returns the type of the module for serialization purposes.
 
void ResetToDefault () override
 Resets the output pixel format to its default value.
 
void SetOutputPixelFormat (peak::common::PixelFormat format)
 Sets the desired output pixel format.
 
peak::common::PixelFormat GetOutputPixelFormat () const
 Gets the currently set output pixel format.
 
peak::icv::Image Process (const peak::icv::Image &input) const
 Converts the input image to the configured output pixel format.
 
peak::common::Any Process (const peak::common::Any &input) const override
 Converts the input image to the configured output pixel format.
 
void ReleaseBuffers () const
 Frees unused internal buffers.
 

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
Since
1.0

Definition at line 38 of file peak_icv_pixel_format_conversion_module.hpp.

Constructor & Destructor Documentation

◆ PixelFormatConversionModule() [1/3]

Creates an instance of class PixelFormatConversionModule with default output pixelformat.

Since
1.0

Definition at line 221 of file peak_icv_pixel_format_conversion_module.hpp.

◆ ~PixelFormatConversionModule()

~PixelFormatConversionModule ( )
inlineoverride
Since
1.0

Definition at line 228 of file peak_icv_pixel_format_conversion_module.hpp.

◆ PixelFormatConversionModule() [2/3]

Copy constructor for class PixelFormatConversionModule is deleted.

Note
If you need to copy a module, you can create a new one and copy the parameters via Serialize() and Deserialize().
Since
1.0

◆ PixelFormatConversionModule() [3/3]

Since
1.0

Definition at line 236 of file peak_icv_pixel_format_conversion_module.hpp.

Member Function Documentation

◆ Deserialize()

void Deserialize ( const peak::common::serialization::IArchive & archive)
inlineoverridevirtual

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 the 'Version' entry in archive is missing, malformed, or indicates an unsupported version.
Note
This function requires that the archive contains all expected fields as produced by a corresponding Serialize() call.
Since
1.0

Implements ISerializable.

Definition at line 263 of file peak_icv_pixel_format_conversion_module.hpp.

◆ GetOutputPixelFormat()

peak::common::PixelFormat GetOutputPixelFormat ( ) const
inline

Gets the currently set output pixel format.

Returns
The current output pixel format.
Since
1.0

Definition at line 277 of file peak_icv_pixel_format_conversion_module.hpp.

◆ GetType()

const char * GetType ( ) const
inlineoverridevirtual

Returns the type of the module for serialization purposes.

Returns
A string representing the module's type.
Since
1.0

Implements IModule.

Definition at line 297 of file peak_icv_pixel_format_conversion_module.hpp.

◆ IsEnabled()

bool IsEnabled ( ) const
inlineoverridevirtual

Checks if the module is currently enabled.

Returns
True if the module is enabled, false otherwise.
Since
1.0

Implements IModule.

Definition at line 292 of file peak_icv_pixel_format_conversion_module.hpp.

◆ operator=() [1/2]

PixelFormatConversionModule & operator= ( const PixelFormatConversionModule & other)
delete

Copy assignment for class PixelFormatConversionModule is deleted.

Note
If you need to copy a module, you can create a new one and copy the parameters via Serialize() and Deserialize().
Since
1.0

◆ operator=() [2/2]

PixelFormatConversionModule & operator= ( PixelFormatConversionModule && other)
inlinenoexcept
Since
1.0

Definition at line 243 of file peak_icv_pixel_format_conversion_module.hpp.

◆ Process() [1/2]

peak::common::Any Process ( const peak::common::Any & input) const
inlineoverridevirtual

Converts the input image to the configured output pixel format.

Note
This operation disregards any specified image regions and processes the entire image.
Parameters
inputThe input image to convert.
Returns
The converted image in the specified pixel format.
Exceptions
peak::common::InvalidCastExceptionIf the input cast to peak::icv::Image failed.
Since
1.0

Implements IModule.

Definition at line 307 of file peak_icv_pixel_format_conversion_module.hpp.

◆ Process() [2/2]

peak::icv::Image Process ( const peak::icv::Image & input) const
inline

Converts the input image to the configured output pixel format.

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

Definition at line 302 of file peak_icv_pixel_format_conversion_module.hpp.

◆ ReleaseBuffers()

void ReleaseBuffers ( ) const
inline

Frees unused internal buffers.

This module uses pre-allocated internal buffers to accelerate pixel format 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
1.0

Definition at line 334 of file peak_icv_pixel_format_conversion_module.hpp.

◆ ResetToDefault()

void ResetToDefault ( )
inlineoverridevirtual

Resets the output pixel format to its default value.

Since
1.0

Implements IModule.

Definition at line 282 of file peak_icv_pixel_format_conversion_module.hpp.

◆ Serialize()

void Serialize ( peak::common::serialization::IArchive & archive) const
inlineoverridevirtual

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
1.0

Implements ISerializable.

Definition at line 255 of file peak_icv_pixel_format_conversion_module.hpp.

◆ SetEnabled()

void SetEnabled ( bool enabled)
inlineoverridevirtual

Sets the enabled state of this module.

Parameters
enabledIf true, the module is enabled; otherwise, it is disabled.
Since
1.0

Implements IModule.

Definition at line 287 of file peak_icv_pixel_format_conversion_module.hpp.

◆ SetOutputPixelFormat()

void SetOutputPixelFormat ( peak::common::PixelFormat format)
inline

Sets the desired output pixel format.

Parameters
formatThe output pixel format to use.
Since
1.0

Definition at line 272 of file peak_icv_pixel_format_conversion_module.hpp.