![]() |
![]() |
Creates new images by converting a source image to another format. More...
#include <pylon/ImageFormatConverter.h>
Public Member Functions | |
CImageFormatConverter () | |
Creates an image format converter. More... | |
virtual | ~CImageFormatConverter () |
Destroys the image format converter. More... | |
virtual void | Initialize (EPixelType sourcePixelType) |
Optionally initializes the image format converter before conversion. More... | |
virtual bool | IsInitialized (EPixelType sourcePixelType) const |
Returns information about the converter being initialized. More... | |
virtual void | Uninitialize () |
Destroys data structures required for conversion. More... | |
virtual bool | ImageHasDestinationFormat (const IImage &sourceImage) const |
Checks to see if a conversion is required or if the source image already has the desired format. More... | |
virtual bool | ImageHasDestinationFormat (EPixelType sourcePixelType, size_t sourcePaddingX, EImageOrientation sourceOrientation) const |
Checks to see if a conversion is required or if the source image already has the desired format. More... | |
virtual size_t | GetBufferSizeForConversion (const IImage &sourceImage) const |
Computes the size of the destination image buffer in byte. More... | |
virtual size_t | GetBufferSizeForConversion (EPixelType sourcePixelType, uint32_t sourceWidth, uint32_t sourceHeight) const |
Computes the size of the destination image buffer in byte. More... | |
virtual void | Convert (IReusableImage &destinationImage, const IImage &sourceImage) |
Creates a new image by converting an image to a different format. More... | |
virtual void | Convert (IReusableImage &destinationImage, const void *pSourceBuffer, size_t sourceBufferSizeBytes, EPixelType sourcePixelType, uint32_t sourceWidth, uint32_t sourceHeight, size_t sourcePaddingX, EImageOrientation sourceOrientation) |
Creates a new image by converting an image to a different format. More... | |
virtual void | Convert (void *pDestinationBuffer, size_t destinationBufferSizeBytes, const IImage &sourceImage) |
Creates a new image by converting an image to a different format. More... | |
virtual void | Convert (void *pDestinationBuffer, size_t destinationBufferSizeBytes, const void *pSourceBuffer, size_t sourceBufferSizeBytes, EPixelType sourcePixelType, uint32_t sourceWidth, uint32_t sourceHeight, size_t sourcePaddingX, EImageOrientation sourceOrientation) |
Creates a new image by converting an image to a different format. More... | |
virtual GenApi::INodeMap & | GetNodeMap () |
Provides access to the node map of the format converter. More... | |
Static Public Member Functions | |
static bool | IsSupportedInputFormat (EPixelType sourcePixelType) |
Returns true if the image format defined by the given pixel type is a supported input format. More... | |
static bool | IsSupportedOutputFormat (EPixelType destinationPixelType) |
Returns true if the image format defined by the given pixel type is a supported output format. More... | |
Public Attributes | |
IOutputPixelFormatEnum & | OutputPixelFormat |
The pixel data format of the output image. More... | |
Categories: MonoConversion | |
Pylon::IIntegerEx & | AdditionalLeftShift |
Additional shifting value used for converting monochrome images - Applies to: ImageFormatConverter. More... | |
Pylon::IFloatEx & | Gamma |
Gamma value for converting monochrome images - Applies to: ImageFormatConverter. More... | |
Pylon::IEnumParameterT< MonoConversionMethodEnums > & | MonoConversionMethod |
Sets the conversion method for monochrome images - Applies to: ImageFormatConverter. More... | |
Categories: Root | |
Pylon::IEnumParameterT< InconvertibleEdgeHandlingEnums > & | InconvertibleEdgeHandling |
Sets how to handle rows and columns that can't be converted - Applies to: ImageFormatConverter. More... | |
Pylon::IEnumParameterT< OutputBitAlignmentEnums > & | OutputBitAlignment |
Sets the alignment of the bits in the target pixel type - Applies to: ImageFormatConverter. More... | |
Pylon::IEnumParameterT< OutputOrientationEnums > & | OutputOrientation |
Sets the vertical orientation of the output image in the buffer - Applies to: ImageFormatConverter. More... | |
Pylon::IIntegerEx & | OutputPaddingX |
Number of additional data bytes at the end of each line - Applies to: ImageFormatConverter. More... | |
Creates new images by converting a source image to another format.
Supported input image formats defined by the pixel type:
Supported output image formats defined by the pixel type:
All input image formats can be converted to all output image formats.
RGB, BGR and Bayer image formats are converted to monochrome formats by using the following formula:
YUV formats are converted to 16 bit bit depth in an intermediate conversion step. This is why the output is always aligned at the most significant bit when converting to 16 bit color output formats like PixelType_RGB16packed.
The default treatment of rows and columns that cannot be converted due to their location on edges, can be controlled using the CImageFormatConverter::InconvertibleEdgeHandling parameter. See also the Convert() method description.
Pylon::CImageFormatConverter::CImageFormatConverter | ( | ) |
Creates an image format converter.
|
virtual |
Destroys the image format converter.
|
virtual |
Creates a new image by converting an image to a different format.
The IReusableImage::Reset() method of the destination image is called to set the destination format. The image is converted to the destination image according to the current converter settings. The padding area of a row in the destination image is set to zero.
The OutputPaddingX setting is ignored for images that do not support user defined padding, e.g. CPylonBitmapImage. See also IReusableImage::IsAdditionalPaddingSupported().
[out] | destinationImage | The destination image, e.g. a CPylonImage or CPylonBitmapImage object. When passing a CPylonBitmapImage object the target format must be supported by the CPylonBitmapImage class. |
[in] | sourceImage | The source image, e.g. a CPylonImage, CPylonBitmapImage, or Grab Result Smart Pointer object. |
|
virtual |
Creates a new image by converting an image to a different format.
The IReusableImage::Reset() method of the destination image is called to set the destination format. The image is converted to the destination image according to the current converter settings. The padding area of a row in the destination image is set to zero.
The OutputPaddingX setting is ignored for images that do not support user defined padding, e.g. CPylonBitmapImage. See also IReusableImage::IsAdditionalPaddingSupported().
[out] | destinationImage | The destination image. |
[in] | pSourceBuffer | The pointer to the buffer of the source image. |
[in] | sourceBufferSizeBytes | The size of the buffer of the source image. |
[in] | sourcePixelType | The pixel type of the source image. |
[in] | sourceWidth | The number of pixels in a row in the source image. |
[in] | sourceHeight | The number of rows in the source image. |
[in] | sourcePaddingX | The number of extra data bytes at the end of each row. The default value is usually 0. |
[in] | sourceOrientation | The vertical orientation of the source image in the image buffer. The default value is usually ImageOrientation_TopDown. |
sourceWidth
value must be >= 0 and < _I32_MAX. sourceHeight
value must be >= 0 and < _I32_MAX.
|
virtual |
Creates a new image by converting an image to a different format.
The image is converted to the destination image according to the current converter settings. The padding area of a row in the destination image is set to zero.
[out] | pDestinationBuffer | The pointer to the buffer of the destination image. |
[in] | destinationBufferSizeBytes | The size of the buffer of the destination image. |
[in] | sourceImage | The source image, e.g. a CPylonImage, CPylonBitmapImage, or Grab Result Smart Pointer object. |
|
virtual |
Creates a new image by converting an image to a different format.
The image is converted to the destination image according to the current converter settings. The padding area of a row in the destination image is set to zero.
[out] | pDestinationBuffer | The pointer to the buffer of the destination image. |
[in] | destinationBufferSizeBytes | The size of the buffer of the destination image. |
[in] | pSourceBuffer | The pointer to the buffer of the source image. |
[in] | sourceBufferSizeBytes | The size of the buffer of the source image. |
[in] | sourcePixelType | The pixel type of the source image. |
[in] | sourceWidth | The number of pixels in a row in the source image. |
[in] | sourceHeight | The number of rows in the source image. |
[in] | sourcePaddingX | The number of extra data bytes at the end of each row. The default value is usually 0. |
[in] | sourceOrientation | The vertical orientation of the source image in the image buffer. The default value is usually ImageOrientation_TopDown. |
|
virtual |
Computes the size of the destination image buffer in byte.
[in] | sourceImage | The source image, e.g. a CPylonImage, CPylonBitmapImage, or Grab Result Smart Pointer object. |
|
virtual |
Computes the size of the destination image buffer in byte.
[in] | sourceWidth | The number of pixels in a row in the source image. |
[in] | sourceHeight | The number of rows in the source image. |
[in] | sourcePixelType | The pixel type of the source image. |
sourceWidth
value must be >= 0 and < _I32_MAX. sourceHeight
value must be >= 0 and < _I32_MAX.
|
virtual |
Provides access to the node map of the format converter.
|
virtual |
Checks to see if a conversion is required or if the source image already has the desired format.
[in] | sourceImage | The source image, e.g. a CPylonImage, CPylonBitmapImage, or Grab Result Smart Pointer object. |
A conversion may even be required image format does not change e.g. if the gamma conversion method is selected and the format describes a monochrome image.
|
virtual |
Checks to see if a conversion is required or if the source image already has the desired format.
[in] | sourcePixelType | The pixel type of the source image. |
[in] | sourcePaddingX | The number of extra data bytes at the end of each row. The default value is usually 0. |
[in] | sourceOrientation | The vertical orientation of the image in the image buffer. The default value is usually ImageOrientation_TopDown. |
A conversion may even be required image format does not change e.g. if the gamma conversion method is selected and the format describes a monochrome image.
|
virtual |
Optionally initializes the image format converter before conversion.
[in] | sourcePixelType | The pixel type of the source image. |
pixelTypeSource
must be supported by the converter. Lookup tables are created when using monochrome images as input and when the gamma conversion method is selected or when the shift conversion method is selected and the value of AdditionalLeftShift is not zero. The converter can be reinitialized with other settings if required.
|
virtual |
Returns information about the converter being initialized.
[in] | sourcePixelType | The pixel type of the source image. |
The result depends on the converter settings.
|
static |
Returns true if the image format defined by the given pixel type is a supported input format.
[in] | sourcePixelType | The pixel type of the source image. |
|
static |
Returns true if the image format defined by the given pixel type is a supported output format.
[in] | destinationPixelType | The pixel type of the destination image. |
|
virtual |
Destroys data structures required for conversion.
This function can be called to free resources held by the format converter.
|
inherited |
Additional shifting value used for converting monochrome images - Applies to: ImageFormatConverter.
Additional shifting value used for converting monochrome images. Only effective if the Mono Conversion Method parameter is set to Truncate. If the parameter value isn't zero, the image data is converted using a lookup table. Shifted values exceeding the maximum output value boundary are set to the maximum allowed value. Negative values are treated as right-shifted values.
Visibility: Beginner
|
inherited |
Gamma value for converting monochrome images - Applies to: ImageFormatConverter.
Gamma value for converting monochrome images. The image data is converted using a lookup table.
Visibility: Beginner
|
inherited |
Sets how to handle rows and columns that can't be converted - Applies to: ImageFormatConverter.
Visibility: Beginner
|
inherited |
Sets the conversion method for monochrome images - Applies to: ImageFormatConverter.
Visibility: Beginner
|
inherited |
Sets the alignment of the bits in the target pixel type - Applies to: ImageFormatConverter.
Sets the alignment of the bits in the target pixel type if the target bit depth is greater than the source bit depth, e.g., if you are converting from a 10-bit to a 16-bit format.
Visibility: Beginner
|
inherited |
Sets the vertical orientation of the output image in the buffer - Applies to: ImageFormatConverter.
Visibility: Beginner
|
inherited |
Number of additional data bytes at the end of each line - Applies to: ImageFormatConverter.
Number of additional data bytes at the end of each line. These bytes are set to zero during the conversion.
Visibility: Beginner
IOutputPixelFormatEnum& Pylon::CImageFormatConverter::OutputPixelFormat |
The pixel data format of the output image.
This member can be used to get and set the output pixel format using the EPixelType enumeration. It emulates the behavior of native parameter access.