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

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

Inheritance diagram for TransformationModule:
Collaboration diagram for TransformationModule:

Public Member Functions

 TransformationModule ()=default
 Creates a TransformationModule module with default values for mirror and rotation.
 
 ~TransformationModule () override=default
 
 TransformationModule (const TransformationModule &other)=delete
 Copy constructor for class TransformationModule is deleted.
 
 TransformationModule (TransformationModule &&other) noexcept
 
TransformationModule & operator= (const TransformationModule &other)=delete
 Copy assignment for class TransformationModule is deleted.
 
TransformationModule & operator= (TransformationModule &&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 all settings to the default values for mirror and rotation.
 
void SetMirrorLeftRightEnabled (bool enabled)
 Sets whether the image should be mirrored left-right.
 
void SetMirrorUpDownEnabled (bool enabled)
 Sets whether the image should be mirrored up-down.
 
bool IsMirrorLeftRightEnabled () const
 Gets the current left-right mirroring setting.
 
bool IsMirrorUpDownEnabled () const
 Gets the current up-down mirroring setting.
 
void SetRotationAngle (Rotation angle)
 Sets the desired rotation angle.
 
Rotation GetRotationAngle () const
 Retrieves the current rotation angle.
 
peak::icv::Image Process (const peak::icv::Image &input) const
 Processes the input image and returns a mirrored and/or rotated copy based on current settings.
 
peak::common::Any Process (const peak::common::Any &input) const override
 Processes the input image and returns a mirrored and/or rotated copy based on current settings.
 

Detailed Description

Transformation is an image pipeline module that provides mirror and rotation functionality.

See also
features::MirrorFeature and features::RotationFeature

Definition at line 40 of file peak_icv_transformation_module.hpp.

Constructor & Destructor Documentation

◆ TransformationModule() [1/3]

TransformationModule ( )
default

Creates a TransformationModule module with default values for mirror and rotation.

Since
1.0

◆ ~TransformationModule()

~TransformationModule ( )
overridedefault
Since
1.0

◆ TransformationModule() [2/3]

TransformationModule ( const TransformationModule & other)
delete

Copy constructor for class TransformationModule 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

◆ TransformationModule() [3/3]

TransformationModule ( TransformationModule && other)
inlinenoexcept
Since
1.0

Definition at line 301 of file peak_icv_transformation_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 343 of file peak_icv_transformation_module.hpp.

◆ GetRotationAngle()

Rotation GetRotationAngle ( ) const
inline

Retrieves the current rotation angle.

Returns
The currently configured rotation angle.
Since
1.0

Definition at line 401 of file peak_icv_transformation_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 296 of file peak_icv_transformation_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 291 of file peak_icv_transformation_module.hpp.

◆ IsMirrorLeftRightEnabled()

bool IsMirrorLeftRightEnabled ( ) const
inline

Gets the current left-right mirroring setting.

Returns
True if left-right mirroring is enabled so that left and right will be flipped.
Since
1.0

Definition at line 382 of file peak_icv_transformation_module.hpp.

◆ IsMirrorUpDownEnabled()

bool IsMirrorUpDownEnabled ( ) const
inline

Gets the current up-down mirroring setting.

Returns
True if up-down mirroring is enabled so that up and down will be flipped.
Since
1.0

Definition at line 387 of file peak_icv_transformation_module.hpp.

◆ operator=() [1/2]

TransformationModule & operator= ( const TransformationModule & other)
delete

Copy assignment for class TransformationModule 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]

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

Definition at line 310 of file peak_icv_transformation_module.hpp.

◆ Process() [1/2]

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

Processes the input image and returns a mirrored and/or rotated copy based on current settings.

Note
Supported pixel formats: BayerGR8, BayerGR10, BayerGR12, BayerRG8, BayerRG10, BayerRG12, BayerGB8, BayerGB10, BayerGB12, BayerBG8, BayerBG10, BayerBG12, Mono8, Mono10, Mono12, Mono16, Confidence8, Confidence16, Coord3D_C8, Coord3D_C16, Coord3D_C32f, Coord3D_ABC32f, RGB8, RGB10, RGB12, BGR8, BGR10, BGR12, RGBa8, RGBa10, RGBa12, BGRa8, BGRa10, BGRa12.
When processing images with a Bayer pattern, the result may have a different pixel format, though the bit depth remains unchanged.
This operation disregards any specified image regions and processes the entire image.
Parameters
inputThe input image to be processed.
Returns
A new image object that is the transformed result of the input.
Exceptions
peak::common::InvalidCastExceptionIf the input cast to peak::icv::Image failed.
NotSupportedExceptionIf image has any other than the supported pixel formats.
Since
1.0

Implements IModule.

Definition at line 411 of file peak_icv_transformation_module.hpp.

◆ Process() [2/2]

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

Processes the input image and returns a mirrored and/or rotated copy based on current settings.

Note
Supported pixel formats: BayerGR8, BayerGR10, BayerGR12, BayerRG8, BayerRG10, BayerRG12, BayerGB8, BayerGB10, BayerGB12, BayerBG8, BayerBG10, BayerBG12, Mono8, Mono10, Mono12, Mono16, Confidence8, Confidence16, Coord3D_C8, Coord3D_C16, Coord3D_C32f, Coord3D_ABC32f, RGB8, RGB10, RGB12, BGR8, BGR10, BGR12, RGBa8, RGBa10, RGBa12, BGRa8, BGRa10, BGRa12.
When processing images with a Bayer pattern, the result may have a different pixel format, though the bit depth remains unchanged.
This operation disregards any specified image regions and processes the entire image.
Parameters
inputThe input image to be processed.
Returns
A new image object that is the transformed result of the input.
Exceptions
NotSupportedExceptionIf image has any other than the supported pixel formats.
Since
1.0

Definition at line 406 of file peak_icv_transformation_module.hpp.

◆ ResetToDefault()

void ResetToDefault ( )
inlineoverridevirtual

Resets all settings to the default values for mirror and rotation.

Since
1.0

Implements IModule.

Definition at line 365 of file peak_icv_transformation_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 324 of file peak_icv_transformation_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 285 of file peak_icv_transformation_module.hpp.

◆ SetMirrorLeftRightEnabled()

void SetMirrorLeftRightEnabled ( bool enabled)
inline

Sets whether the image should be mirrored left-right.

Parameters
enabledIf true, the image will be mirrored along the vertical axis.
Since
1.0

Definition at line 372 of file peak_icv_transformation_module.hpp.

◆ SetMirrorUpDownEnabled()

void SetMirrorUpDownEnabled ( bool enabled)
inline

Sets whether the image should be mirrored up-down.

Parameters
enabledIf true, the image will be mirrored along the horizontal axis.
Since
1.0

Definition at line 377 of file peak_icv_transformation_module.hpp.

◆ SetRotationAngle()

void SetRotationAngle ( Rotation angle)
inline

Sets the desired rotation angle.

Parameters
angleThe rotation angle to apply (see Rotation enum).
Since
1.0

Definition at line 392 of file peak_icv_transformation_module.hpp.