IDSpeakIPL  v1.8.0
peak::ipl::ImageTransformer Class Referencefinal

Performs transformations like mirror and rotate on images. More...

#include <peak_ipl/algorithm/peak_ipl_image_transformer.hpp>

Public Types

enum  RotationAngle : uint16_t {
  RotationAngle::Degree90Counterclockwise = 90,
  RotationAngle::Degree90Clockwise = 270,
  RotationAngle::Degree180 = 180
}
 Angle parameter for the Rotation algorithm. More...
 

Public Member Functions

 ImageTransformer ()
 Constructor for a new ImageTransformer instance. More...
 
 ~ImageTransformer ()
 Destructor for the ImageTransformer instance. More...
 
 ImageTransformer (const ImageTransformer &other)
 Copy Constructor for a new ImageTransformer instance. More...
 
ImageTransformer & operator= (const ImageTransformer &other)
 Copy assigment for ImageTransformer instance. More...
 
 ImageTransformer (ImageTransformer &&other) noexcept
 Move constructor for ImageTransformer instance. More...
 
ImageTransformer & operator= (ImageTransformer &&other) noexcept
 Move assignment for ImageTransformer instance. More...
 
PEAK_IPL_NO_DISCARD Image MirrorUpDown (const Image &inputImage) const
 Mirrors the input image in up-down direction. More...
 
PEAK_IPL_NO_DISCARD Image MirrorLeftRight (const Image &inputImage) const
 Mirrors the input image in the left-right direction. More...
 
PEAK_IPL_NO_DISCARD Image MirrorUpDownLeftRight (const Image &inputImage) const
 Mirrors the input image in up-down and left-right direction. More...
 
void MirrorUpDownInPlace (Image &image) const
 Mirrors the given image in up-down direction in place i.e. it will change the input image itself. More...
 
void MirrorLeftRightInPlace (Image &image) const
 Mirrors the given image in the left-right direction in place i.e. it will change the input image itself. More...
 
void MirrorUpDownLeftRightInPlace (Image &image) const
 Mirrors the given image in up-down and left-right direction in place i.e. it will change the input image itself. More...
 
PEAK_IPL_NO_DISCARD Image Rotate (const Image &inputImage, RotationAngle rotationAngle) const
 Rotate the input image with the given rotationAngle. More...
 
void RotateInPlace (Image &image, RotationAngle rotationAngle) const
 Rotate the input image with the given rotationAngle. More...
 

Detailed Description

Performs transformations like mirror and rotate on images.

Note
To speed up processing instances of this class, maintain internal memory pools to reuse memory instead of allocating new memory for each transformation. The memory is freed when the instance is destroyed.

Member Enumeration Documentation

◆ RotationAngle

Angle parameter for the Rotation algorithm.

The enum holding the possible rotation angles and the rotation direction.

Enumerator
Degree90Counterclockwise 
Degree90Clockwise 
Degree180 

Constructor & Destructor Documentation

◆ ImageTransformer() [1/3]

peak::ipl::ImageTransformer::ImageTransformer ( )
inline

Constructor for a new ImageTransformer instance.

Creates a new ImageTransformer instance.

Since
1.0

◆ ~ImageTransformer()

peak::ipl::ImageTransformer::~ImageTransformer ( )
inline

Destructor for the ImageTransformer instance.

Destroys an ImageTransformer instance.

Since
1.0

◆ ImageTransformer() [2/3]

peak::ipl::ImageTransformer::ImageTransformer ( const ImageTransformer &  other)
inline

Copy Constructor for a new ImageTransformer instance.

Creates a new ImageTransformer instance.

Note
This only creates a shallow copy. See Shallow copy (since 1.8) for a detailed explanation.
Parameters
[in]otherThe other instance to acquire a reference for.
Since
1.0 Deleted
1.8 Implemented as shallow copy

◆ ImageTransformer() [3/3]

peak::ipl::ImageTransformer::ImageTransformer ( ImageTransformer &&  other)
inlinenoexcept

Move constructor for ImageTransformer instance.

Moves the instance from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move.
Since
1.0

Member Function Documentation

◆ MirrorLeftRight()

Image peak::ipl::ImageTransformer::MirrorLeftRight ( const Image &  inputImage) const
inline

Mirrors the input image in the left-right direction.

If the transformed image is a bayer-format image and the number of columns is even, the format will change. (e.g. BayerBG8 -> BayerGB8)

Parameters
[in]inputImageThe handle to the created image.
Returns
A new created image containing the data of the input image mirrored in the left-right direction
Exceptions
ImageFormatNotSupportedExceptioninputImage has a packed pixel format
ExceptionAn internal error has occurred.
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if inputImage has a packed pixel format

◆ MirrorLeftRightInPlace()

void peak::ipl::ImageTransformer::MirrorLeftRightInPlace ( Image &  image) const
inline

Mirrors the given image in the left-right direction in place i.e. it will change the input image itself.

If the transformed image is a bayer-format image and the number of columns is even, the format will change. (e.g. BayerBG8 -> BayerGB8)

Parameters
[in,out]imageThe handle to the image to mirror
Exceptions
ImageFormatNotSupportedExceptionimage has a packed pixel format
ExceptionAn internal error has occurred.
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if image has packed a pixel format

◆ MirrorUpDown()

Image peak::ipl::ImageTransformer::MirrorUpDown ( const Image &  inputImage) const
inline

Mirrors the input image in up-down direction.

If the transformed image is a bayer-format image and the number of rows is even, the format will change. (e.g. BayerBG8 -> BayerGR8)

Parameters
[in]inputImageThe handle to the created image.
Returns
A new created image containing the data of the input image mirrored in up-down direction
Exceptions
ImageFormatNotSupportedExceptioninputImage has a packed pixel format
ExceptionAn internal error has occurred.
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if inputImage has a packed pixel format

◆ MirrorUpDownInPlace()

void peak::ipl::ImageTransformer::MirrorUpDownInPlace ( Image &  image) const
inline

Mirrors the given image in up-down direction in place i.e. it will change the input image itself.

If the transformed image is a bayer-format image and the number of rows is even, the format will change. (e.g. BayerBG8 -> BayerGR8)

Parameters
[in,out]imageThe handle to the image to mirror
Exceptions
ImageFormatNotSupportedExceptionimage has a packed pixel format
ExceptionAn internal error has occurred.
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if image has packed a pixel format

◆ MirrorUpDownLeftRight()

Image peak::ipl::ImageTransformer::MirrorUpDownLeftRight ( const Image &  inputImage) const
inline

Mirrors the input image in up-down and left-right direction.

If the transformed image is a bayer-format image and the number of rows or columns are even, the format will change. (e.g. BayerBG8 -> BayerRG8)

Parameters
[in]inputImageThe handle to the created image.
Returns
A new created image containing the data of the input image mirrored in up-down and left-right direction
Exceptions
ImageFormatNotSupportedExceptioninputImage has a packed pixel format
ExceptionAn internal error has occurred.
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if inputImage has a packed pixel format

◆ MirrorUpDownLeftRightInPlace()

void peak::ipl::ImageTransformer::MirrorUpDownLeftRightInPlace ( Image &  image) const
inline

Mirrors the given image in up-down and left-right direction in place i.e. it will change the input image itself.

If the transformed image is a bayer-format image and the number of rows or columns are even, the format will change. (e.g. BayerBG8 -> BayerRG8)

Parameters
[in,out]imageThe handle to the image to mirror
Exceptions
ImageFormatNotSupportedExceptionimage has a packed pixel format
ExceptionAn internal error has occurred.
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if image has a packed pixel format

◆ operator=() [1/2]

ImageTransformer & peak::ipl::ImageTransformer::operator= ( const ImageTransformer &  other)
inline

Copy assigment for ImageTransformer instance.

Acquires a reference from other to this instance. If this instance already has a reference, it will be destroyed.

Note
See Shallow copy (since 1.8) for a detailed explanation.
Parameters
[in]otherThe other instance to acquire a reference for.
Since
1.0 Deleted
1.8 Implemented as shallow copy

◆ operator=() [2/2]

ImageTransformer & peak::ipl::ImageTransformer::operator= ( ImageTransformer &&  other)
inlinenoexcept

Move assignment for ImageTransformer instance.

Moves the instance from other to this. Afterwards other is invalid.

Parameters
[in]otherThe other instance to move.
Since
1.0

◆ Rotate()

Image peak::ipl::ImageTransformer::Rotate ( const Image &  inputImage,
RotationAngle  rotationAngle 
) const
inline

Rotate the input image with the given rotationAngle.

If the transformed image is a bayer-format image and the number of rows or columns are even, the format will change. (e.g. BayerBG8 -> BayerRG8)

Parameters
[in]inputImageThe handle to the created image.
[in]rotationAngleThe rotation angle.
Returns
A new created image containing the data of the input image rotated with the given rotationAngle
Exceptions
ImageFormatNotSupportedExceptioninputImage has a packed pixel format
ExceptionAn internal error has occurred.
Since
1.2

◆ RotateInPlace()

void peak::ipl::ImageTransformer::RotateInPlace ( Image &  image,
RotationAngle  rotationAngle 
) const
inline

Rotate the input image with the given rotationAngle.

If the transformed image is a bayer-format image and the number of rows or columns are even, the format will change. (e.g. BayerBG8 -> BayerRG8)

Parameters
[in,out]imageThe handle to the created image.
[in]rotationAngleThe rotation angle.
Exceptions
ImageFormatNotSupportedExceptionimage has a packed pixel format
ExceptionAn internal error has occurred.
Since
1.2

The documentation for this class was generated from the following file: