Converts images from one PixelFormat to another.
More...
#include <peak_ipl/algorithm/peak_ipl_image_converter.hpp>
|
| | ImageConverter () |
| |
| | ~ImageConverter () |
| |
| | ImageConverter (const ImageConverter &other)=delete |
| |
| ImageConverter & | operator= (const ImageConverter &other)=delete |
| |
| | ImageConverter (ImageConverter &&other) noexcept |
| |
| ImageConverter & | operator= (ImageConverter &&other) noexcept |
| |
| | 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. More...
|
| |
| 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. More...
|
| |
| 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...
|
| |
Converts images from one PixelFormat to another.
- Note
- In order to speed up processing, instances of this class maintain internal memory pools, which allows reuse of memory instead of allocating new memory on each conversion.
The memory is freed when the instance is destroyed. There is one pool for every needed byte count, therefore a new pool will be allocated if an image with a new size or format needs to be processed.
One may choose to create a new instance of this class when changing image settings in order to free old pools. If a new pool or buffer is needed they will get allocated automatically during the conversion, which results in the first conversion taking more time.
This can be prevented by using the function PreAllocateConversion before the conversion. Buffers can be reused once a converted image gets freed.
◆ ImageConverter() [1/4]
| peak::ipl::ImageConverter::ImageConverter |
( |
| ) |
|
|
inline |
◆ ~ImageConverter()
| peak::ipl::ImageConverter::~ImageConverter |
( |
| ) |
|
|
inline |
◆ ImageConverter() [2/4]
| peak::ipl::ImageConverter::ImageConverter |
( |
const ImageConverter & |
other | ) |
|
|
delete |
◆ ImageConverter() [3/4]
◆ ImageConverter() [4/4]
Convenience constructor to directly pre-allocate an internal buffer pool. This calls PreAllocateConversion internally.
- Parameters
-
| [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 amount of converted images held at one time |
- Exceptions
-
- Since
- 1.4
◆ ConversionMode()
Returns the current conversion mode.
- Returns
- The current conversion mode
- Exceptions
-
- Since
- 1.0
◆ Convert() [1/2]
Converts the input image converted to the given pixel format.
- Parameters
-
| [in] | inputImage | The input image. |
| [in] | outputPixelFormat | The output pixel format. |
- Returns
- A new created image containing the data of the input image converted to the given pixel format
- Exceptions
-
- 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] | inputImage | The input image. |
| [in] | outputPixelFormat | The output pixel format. |
| [out] | outputImageBuffer | Pointer to destination buffer. |
| [in] | outputImageBufferSize | Size of destination buffer. |
- Returns
- Converted image
- Exceptions
-
- Since
- 1.1
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ PreAllocateConversion()
Pre-allocate buffer pools needed for the specified conversion.
- Parameters
-
| [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 amount of converted images held at one time |
- Exceptions
-
- Since
- 1.4
◆ SetConversionMode()
Set conversion mode.
- Parameters
-
| [in] | conversionMode | The conversion mode to set. |
- Exceptions
-
- Since
- 1.0
◆ SupportedOutputPixelFormatNames()
Returns the supported output pixel formats for a given input pixel format.
- Parameters
-
| [in] | inputPixelFormat | The input pixel format. |
- Returns
- A vector of supported pixel formats for the given input pixel format
- Exceptions
-
- Since
- 1.0
The documentation for this class was generated from the following file: