IDS peak IPL  v1.3.2
peak::ipl::ImageConverter Class Referencefinal

Converts images from one PixelFormat to another. More...

#include <peak_ipl/algorithm/peak_ipl_image_converter.hpp>

Public Member Functions

 ImageConverter ()
 
 ~ImageConverter ()
 
 ImageConverter (const ImageConverter &other)=delete
 
ImageConverter & operator= (const ImageConverter &other)=delete
 
 ImageConverter (ImageConverter &&other) noexcept
 
ImageConverter & operator= (ImageConverter &&other) noexcept
 
peak::ipl::ConversionMode ConversionMode () const
 Returns the current conversion mode. More...
 
void SetConversionMode (peak::ipl::ConversionMode conversionMode)
 Set conversion mode. More...
 
std::vector< peak::ipl::PixelFormatName > SupportedOutputPixelFormatNames (const peak::ipl::PixelFormat &inputPixelFormat) const
 Returns the supported output pixel formats for a given input pixel format. More...
 
Image Convert (const Image &inputImage, const peak::ipl::PixelFormat &outputPixelFormat) const
 Converts the input image converted to the given pixel format. More...
 
Image Convert (const Image &inputImage, const peak::ipl::PixelFormat &outputPixelFormat, uint8_t *outputImageBuffer, size_t outputImageBufferSize) const
 Saves the data of the current image converted to the given pixel format into a destination buffer and creates an image from that buffer. More...
 

Detailed Description

Converts images from one PixelFormat to another.

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

Constructor & Destructor Documentation

◆ ImageConverter() [1/3]

peak::ipl::ImageConverter::ImageConverter ( )
inline

◆ ~ImageConverter()

peak::ipl::ImageConverter::~ImageConverter ( )
inline

◆ ImageConverter() [2/3]

peak::ipl::ImageConverter::ImageConverter ( const ImageConverter &  other)
delete

◆ ImageConverter() [3/3]

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

Member Function Documentation

◆ ConversionMode()

peak::ipl::ConversionMode peak::ipl::ImageConverter::ConversionMode ( ) const
inline

Returns the current conversion mode.

Returns
The current conversion mode
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ Convert() [1/2]

Image peak::ipl::ImageConverter::Convert ( const Image &  inputImage,
const peak::ipl::PixelFormat &  outputPixelFormat 
) const
inline

Converts the input image converted to the given pixel format.

Parameters
[in]inputImageThe input image.
[in]outputPixelFormatThe output pixel format.
Returns
A new created image containing the data of the input image converted to the given pixel format
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ Convert() [2/2]

Image peak::ipl::ImageConverter::Convert ( const Image &  inputImage,
const peak::ipl::PixelFormat &  outputPixelFormat,
uint8_t *  outputImageBuffer,
size_t  outputImageBufferSize 
) const
inline

Saves the data of the current image converted to the given pixel format into a destination buffer and creates an image from that buffer.

Parameters
[in]inputImageThe input image.
[in]outputPixelFormatThe output pixel format.
[out]outputImageBufferPointer to destination buffer.
[in]outputImageBufferSizeSize of destination buffer.
Returns
Converted image
Exceptions
BufferTooSmallExceptionThe provided buffer is too small for the output image.
ExceptionAn internal error has occurred.
Since
1.1

◆ operator=() [1/2]

ImageConverter& peak::ipl::ImageConverter::operator= ( const ImageConverter &  other)
delete

◆ operator=() [2/2]

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

◆ SetConversionMode()

void peak::ipl::ImageConverter::SetConversionMode ( peak::ipl::ConversionMode  conversionMode)
inline

Set conversion mode.

Parameters
[in]conversionModeThe conversion mode to set.
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

◆ SupportedOutputPixelFormatNames()

std::vector< PixelFormatName > peak::ipl::ImageConverter::SupportedOutputPixelFormatNames ( const peak::ipl::PixelFormat &  inputPixelFormat) const
inline

Returns the supported output pixel formats for a given input pixel format.

Parameters
[in]inputPixelFormatThe input pixel format.
Returns
A vector of supported pixel formats for the given input pixel format
Exceptions
ExceptionAn internal error has occurred.
Since
1.0

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