Converts images from one PixelFormat to another. More...
#include <peak_ipl/algorithm/peak_ipl_image_converter.hpp>
Public Member Functions | |
| ImageConverter () | |
| Constructor for a new ImageConverter instance. | |
| ~ImageConverter () | |
| Destructor for the ImageConverter instance. | |
| ImageConverter (const ImageConverter &other) | |
| Copy Constructor for a new ImageConverter instance. | |
| ImageConverter & | operator= (const ImageConverter &other) |
| Copy assigment for ImageConverter instance. | |
| ImageConverter (ImageConverter &&other) noexcept | |
| Move constructor for ImageConverter instance. | |
| ImageConverter & | operator= (ImageConverter &&other) noexcept |
| Move assignment for ImageConverter instance. | |
| ImageConverter (const peak::ipl::PixelFormat &inputPixelFormat, const peak::ipl::PixelFormat &outputPixelFormat, size_t width, size_t height, size_t imageCount=5) | |
| Convenience constructor to directly pre-allocate an internal buffer pool. This calls PreAllocateConversion internally. | |
| void | PreAllocateConversion (const peak::ipl::PixelFormat &inputPixelFormat, const peak::ipl::PixelFormat &outputPixelFormat, size_t width, size_t height, size_t imageCount=5) |
| Pre-allocate buffer pools needed for the specified conversion. | |
| peak::ipl::ConversionMode | ConversionMode () const |
| Returns the current conversion mode. | |
| void | SetConversionMode (peak::ipl::ConversionMode conversionMode) |
| Set conversion mode. | |
| std::vector< peak::ipl::PixelFormatName > | SupportedOutputPixelFormatNames (const peak::ipl::PixelFormat &inputPixelFormat) const |
| Returns the supported output pixel formats for a given input pixel format. | |
| Image | Convert (const Image &inputImage, const peak::ipl::PixelFormat &outputPixelFormat) const |
Converts the given inputImage to the specified outputPixelFormat. | |
| Image | Convert (const Image &inputImage, const peak::ipl::PixelFormat &outputPixelFormat, uint8_t *outputImageBuffer, size_t outputImageBufferSize) const |
Converts the given inputImage to the specified outputPixelFormat into an existing outputImageBuffer. | |
| Image | Convert (const Image &inputImage, const peak::ipl::PixelFormat &outputPixelFormat, double factor, double offset=0.0) const |
Converts the given inputImage to the specified outputPixelFormat and scales the pixel values by the factor. | |
| Image | Convert (const Image &inputImage, const peak::ipl::PixelFormat &outputPixelFormat, uint8_t *outputImageBuffer, size_t outputImageBufferSize, double factor, double offset=0.0) const |
Converts the given inputImage to the specified outputPixelFormat into an existing outputImageBuffer and scales the pixel values by the factor. | |
| Image | Convert (const Image &inputImage, const peak::ipl::PixelFormat &outputPixelFormat, peak::ipl::Interval< double > interval) const |
Converts the given inputImage to the specified outputPixelFormat. The pixel values are mapped from interval to the value range of the outputPixelFormat. All pixel values outside the interval will be clamped. | |
| Image | Convert (const Image &inputImage, const peak::ipl::PixelFormat &outputPixelFormat, uint8_t *outputImageBuffer, size_t outputImageBufferSize, peak::ipl::Interval< double > interval) const |
Converts the given inputImage to the specified outputPixelFormat into an existing outputImageBuffer. The pixel values are mapped from interval to the value range of the outputPixelFormat. All pixel values outside the interval will be clamped. | |
Converts images from one PixelFormat to another.
|
inline |
|
inline |
|
inline |
Copy Constructor for a new ImageConverter instance.
Creates a new ImageConverter instance.
| [in] | other | The other instance to acquire a reference for. |
|
inlinenoexcept |
Move constructor for ImageConverter instance.
Moves the instance from other to this. Afterwards other is invalid.
| [in] | other | The other instance to move. |
|
inline |
Convenience constructor to directly pre-allocate an internal buffer pool. This calls PreAllocateConversion internally.
| [in] | inputPixelFormat | The pixelformat of the source image |
| [in] | outputPixelFormat | The pixelformat of the converted image |
| [in] | width | Width of the source image |
| [in] | height | Height of the source image |
| [in] | imageCount | Maximum number of converted images held at one time |
| Exception | An internal error has occurred. |
|
inline |
Returns the current conversion mode.
| Exception | An internal error has occurred. |
|
inline |
Converts the given inputImage to the specified outputPixelFormat.
| [in] | inputImage | The source image to be converted. |
| [in] | outputPixelFormat | The desired pixel format for the output image. |
inputImage in the specified outputPixelFormat.| Exception | An internal error has occurred. |
|
inline |
Converts the given inputImage to the specified outputPixelFormat and scales the pixel values by the factor.
outputPixelFormat must be a float pixel format.| [in] | inputImage | The source image to be converted. |
| [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | factor | Scale factor that is applied to each pixel value. |
| [in] | offset | The offset to apply to all output pixels. |
inputImage in the specified outputPixelFormat with pixel values scaled by factor (m) and offset (c) added according to y = m · x + c.| ImageFormatNotSupportedException | The given input or output pixel format is not supported. |
| Exception | An internal error has occurred. |
|
inline |
Converts the given inputImage to the specified outputPixelFormat. The pixel values are mapped from interval to the value range of the outputPixelFormat. All pixel values outside the interval will be clamped.
inputImage must be a float pixel format.| [in] | inputImage | The source image to be converted. |
| [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | interval | The interval of the input range. |
inputImage in the specified outputPixelFormat with mapped pixel values.| ImageFormatNotSupportedException | The given input or output pixel format is not supported. |
| Exception | An internal error has occurred. |
|
inline |
Converts the given inputImage to the specified outputPixelFormat into an existing outputImageBuffer.
| [in] | inputImage | The source image to be converted. |
| [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | outputImageBuffer | Pointer to the output buffer. |
| [in] | outputImageBufferSize | Size of the output buffer. |
outputImageBuffer. Note that the memory is not owned by the image object. Ensure the buffer is not deleted until you have finished working with the image.| BufferTooSmallException | The provided output buffer is too small for the output image. |
| InvalidArgumentException | The provided output buffer pointer is invalid. |
| Exception | An internal error has occurred. |
|
inline |
Converts the given inputImage to the specified outputPixelFormat into an existing outputImageBuffer and scales the pixel values by the factor.
| [in] | inputImage | The source image to be converted. |
| [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | outputImageBuffer | Pointer to the output buffer. |
| [in] | outputImageBufferSize | Size of the output buffer. |
| [in] | factor | Scale factor that is applied to each pixel value. |
| [in] | offset | The offset to apply to all output pixels. |
outputImageBuffer with pixel values scaled by factor (m) and offset (c) added according to y = m · x + c. Note that the memory is not owned by the image object. Ensure the buffer is not deleted until you have finished working with the image.| ImageFormatNotSupportedException | The given input or output pixel format is not supported. |
| BufferTooSmallException | The provided buffer is too small for the output image. |
| InvalidArgumentException | The given output buffer pointer is invalid. |
| Exception | An internal error has occurred. |
|
inline |
Converts the given inputImage to the specified outputPixelFormat into an existing outputImageBuffer. The pixel values are mapped from interval to the value range of the outputPixelFormat. All pixel values outside the interval will be clamped.
inputImage must be a float pixel format.| [in] | inputImage | The source image to be converted. |
| [in] | outputPixelFormat | The desired pixel format for the output image. |
| [in] | outputImageBuffer | Pointer to the output buffer. |
| [in] | outputImageBufferSize | Size of the output buffer. |
| [in] | interval | The interval of the input range. |
outputImageBuffer with mapped pixel values. Note that the memory is not owned by the image object. Ensure the buffer is not deleted until you have finished working with the image.| ImageFormatNotSupportedException | The given input or output pixel format is not supported. |
| BufferTooSmallException | The provided buffer is too small for the output image. |
| InvalidArgumentException | The given output buffer pointer is invalid. |
| Exception | An internal error has occurred. |
|
inline |
Copy assigment for ImageConverter instance.
Acquires a reference from other to this instance. If this instance already has a reference, it will be destroyed.
| [in] | other | The other instance to acquire a reference for. |
|
inlinenoexcept |
Move assignment for ImageConverter instance.
Moves the instance from other to this. Afterwards other is invalid.
| [in] | other | The other instance to move. |
|
inline |
Pre-allocate buffer pools needed for the specified conversion.
| [in] | inputPixelFormat | The pixelformat of the source image |
| [in] | outputPixelFormat | The pixelformat of the converted image |
| [in] | width | Width of the source image |
| [in] | height | Height of the source image |
| [in] | imageCount | Maximum number of converted images held at one time |
| Exception | An internal error has occurred. |
|
inline |
Set conversion mode.
| [in] | conversionMode | The conversion mode to set. |
| Exception | An internal error has occurred. |
|
inline |
Returns the supported output pixel formats for a given input pixel format.
| [in] | inputPixelFormat | The input pixel format. |
| Exception | An internal error has occurred. |