Contains static functions supporting loading and saving of images. More...
#include <pylon/ImagePersistence.h>
Static Public Member Functions | |
static void | Save (EImageFileFormat imageFileFormat, const String_t &filename, const void *pBuffer, size_t bufferSize, EPixelType pixelType, uint32_t width, uint32_t height, size_t paddingX, EImageOrientation orientation, CImagePersistenceOptions *pOptions=NULL) |
Saves the image to disk. More... | |
static void | Save (EImageFileFormat imageFileFormat, const String_t &filename, const IImage &image, CImagePersistenceOptions *pOptions=NULL) |
Saves the image to disk. More... | |
static bool | CanSaveWithoutConversion (EImageFileFormat imageFileFormat, EPixelType pixelType, uint32_t width, uint32_t height, size_t paddingX, EImageOrientation orientation) |
Can be used to check whether the given image can be saved without prior conversion. More... | |
static bool | CanSaveWithoutConversion (EImageFileFormat imageFileFormat, const IImage &image) |
Can be used to check whether the image can be saved without prior conversion. More... | |
static void | Load (const String_t &filename, IReusableImage &image) |
Loads an image from disk. More... | |
static void | LoadFromMemory (const void *pBuffer, size_t bufferSizeBytes, IReusableImage &image) |
Loads an image from memory. More... | |
Contains static functions supporting loading and saving of images.
|
static |
Can be used to check whether the given image can be saved without prior conversion.
See the CImagePersistence::CanSaveWithoutConversion( EImageFileFormat, const IImage&) method documentation for a list of supported pixel formats.
[in] | imageFileFormat | The target file format for the image to save. |
[in] | pixelType | The pixel type of the image to save. |
[in] | width | The number of pixels in a row of the image to save. |
[in] | height | The number of rows of the image to save. |
[in] | paddingX | The number of extra data bytes at the end of each row. |
[in] | orientation | The vertical orientation of the image in the image buffer. |
|
static |
Can be used to check whether the image can be saved without prior conversion.
Supported formats for TIFF:
Supported formats for BMP, JPEG and PNG:
[in] | imageFileFormat | The target file format for the image to save. |
[in] | image | The image to save, e.g. a CPylonImage, CPylonBitmapImage, or Grab Result Smart Pointer object. |
|
static |
Loads an image from disk.
The orientation of loaded images is always ImageOrientation_TopDown.
[in] | filename | Name and path of the image. |
[in] | image | The target image object, e.g. a CPylonImage or CPylonBitmapImage object. When passing a CPylonBitmapImage object the loaded format must be supported by the CPylonBitmapImage class. |
|
static |
Loads an image from memory.
The orientation of loaded images is always ImageOrientation_TopDown. Currently BMP, JPEG & PNG images are supported.
[in] | pBuffer | The pointer to the buffer of the source image. |
[in] | bufferSizeBytes | The size of the buffer of the source image. |
[in] | image | The target image object, e.g. a CPylonImage or CPylonBitmapImage object. When passing a CPylonBitmapImage object the loaded format must be supported by the CPylonBitmapImage class. |
|
static |
Saves the image to disk.
Converts the image to a format that can be saved if required.
If required, the image is automatically converted to a new image and then saved. See CanSaveWithoutConversion() for more information. An image with a bit depth higher than 8 bit is stored with 16 bit bit depth if supported by the image file format. In this case the pixel data is MSB aligned.
If more control over the conversion is required then the CImageFormatConverter class can be used to convert the input image before saving it.
[in] | imageFileFormat | The file format to save the image in. |
[in] | filename | Name and path of the image. |
[in] | pBuffer | The pointer to the buffer of the image. |
[in] | bufferSize | The size of the buffer in byte. |
[in] | pixelType | The pixel type of the image to save. |
[in] | width | The number of pixels in a row of the image to save. |
[in] | height | The number of rows of the image to save. |
[in] | paddingX | The number of extra data bytes at the end of each row. |
[in] | orientation | The vertical orientation of the image in the image buffer. |
[in] | pOptions | Additional options. |
width
value must be >= 0 and < _I32_MAX. height
value must be >= 0 and < _I32_MAX.
|
static |
Saves the image to disk.
Converts the image to a format that can be if required.
If required, the image is automatically converted to a new image and then saved. See CanSaveWithoutConversion() for more information. An image with a bit depth higher than 8 bit is stored with 16 bit bit depth if supported by the image file format. In this case the pixel data is MSB aligned.
If more control over the conversion is required then the CImageFormatConverter class can be used to convert the input image before saving it.
[in] | imageFileFormat | The target file format for the image to save. |
[in] | filename | Name and path of the image. |
[in] | image | The image to save, e.g. a CPylonImage, CPylonBitmapImage, or Grab Result Smart Pointer object. |
[in] | pOptions | Additional options. |