Describes an image. More...
#include <pylon/PylonImage.h>
Public Member Functions | |
CPylonImage () | |
Creates an invalid image. More... | |
CPylonImage (const CPylonImage &source) | |
Copies the image properties and creates a reference to the buffer of the source image. More... | |
virtual | ~CPylonImage () |
Destroys a pylon image object. More... | |
virtual CPylonImage & | operator= (const CPylonImage &source) |
Copies the image properties and creates a reference to the buffer of the source image. More... | |
virtual void | CopyImage (const IImage &image) |
Copies the image data from a different image. More... | |
virtual void | CopyImage (const IImage &image, size_t newPaddingX) |
Copies the image data from a different image and changes the padding while copying. More... | |
virtual void | CopyImage (void *pBuffer, size_t bufferSizeBytes, EPixelType pixelType, uint32_t width, uint32_t height, size_t paddingX, EImageOrientation orientation=ImageOrientation_TopDown) |
Copies the image data from a provided buffer. More... | |
virtual void | AttachGrabResultBuffer (const CGrabResultPtr &grabResult) |
Attaches a grab result buffer. More... | |
virtual void | AttachUserBuffer (void *pBuffer, size_t bufferSizeBytes, EPixelType pixelType, uint32_t width, uint32_t height, size_t paddingX, EImageOrientation orientation=ImageOrientation_TopDown) |
Attaches a user buffer. More... | |
virtual bool | IsValid () const |
Can be used to check whether an image is valid. More... | |
virtual EPixelType | GetPixelType () const |
Get the current pixel type. More... | |
virtual uint32_t | GetWidth () const |
Get the current number of columns in pixels. More... | |
virtual uint32_t | GetHeight () const |
Get the current number of rows. More... | |
virtual size_t | GetPaddingX () const |
Get the number of extra data bytes at the end of each row. More... | |
virtual EImageOrientation | GetOrientation () const |
Get the vertical orientation of the image in memory. More... | |
virtual void * | GetBuffer () |
Get the pointer to the buffer. More... | |
virtual const void * | GetBuffer () const |
Get the pointer to the buffer containing the image. More... | |
virtual size_t | GetImageSize () const |
Get the size of the image in bytes. More... | |
virtual bool | IsUnique () const |
Indicates that the referenced buffer is only referenced by this image. More... | |
virtual bool | GetStride (size_t &strideBytes) const |
Get the stride in bytes. More... | |
virtual bool | IsSupportedPixelType (EPixelType pixelType) const |
Can be used to check whether the pixel type is supported. More... | |
virtual bool | IsAdditionalPaddingSupported () const |
Can be used to check whether the value of PaddingX can be defined by the user. More... | |
virtual void | Reset (EPixelType pixelType, uint32_t width, uint32_t height, EImageOrientation orientation=ImageOrientation_TopDown) |
Resets the image properties and allocates a new buffer if required. More... | |
virtual void | Reset (EPixelType pixelType, uint32_t width, uint32_t height, size_t paddingX, EImageOrientation orientation=ImageOrientation_TopDown) |
Extends the Reset( EPixelType, uint32_t, uint32_t, EImageOrientation) method by settable paddingX. More... | |
virtual void | Release () |
Releases the image buffer and resets to an invalid image. More... | |
virtual bool | IsUserBufferAttached () const |
Returns true if the referenced buffer has been provided by the user. | |
virtual bool | IsGrabResultBufferAttached () const |
Returns true if the referenced buffer has been provided by a grab result. | |
virtual size_t | GetAllocatedBufferSize () const |
Returns the size of the used buffer. More... | |
virtual void | ChangePixelType (EPixelType pixelType) |
Changes the pixel type of the image. More... | |
virtual CPylonImage | GetPlane (size_t planeIndex) const |
Creates a new pylon image for a plane of the image. More... | |
virtual CPylonImage | GetAoi (uint32_t topLeftX, uint32_t topLeftY, uint32_t width, uint32_t height) const |
Creates a new pylon image for an image area of interest (Image AOI) derived from the image. More... | |
virtual void | Save (EImageFileFormat imageFileFormat, const String_t &filename, CImagePersistenceOptions *pOptions=NULL) const |
Saves the image to disk. More... | |
virtual void | Load (const String_t &filename) |
Loads an image from a disk. More... | |
virtual bool | CanSaveWithoutConversion (EImageFileFormat imageFileFormat) const |
Can be used to check whether the image can be saved without prior conversion. More... | |
virtual SPixelData | GetPixelData (uint32_t posX, uint32_t posY) const |
Retrieves the data of a pixel. More... | |
Static Public Member Functions | |
static CPylonImage | Create (EPixelType pixelType, uint32_t width, uint32_t height, size_t paddingX=0, EImageOrientation orientation=ImageOrientation_TopDown) |
Creates an image and allocates a buffer for it. More... | |
Describes an image.
CImageFormatConverter
. Pylon::CPylonImage::CPylonImage | ( | ) |
Creates an invalid image.
See Pylon::IImage on how the properties of an invalid image are returned.
Pylon::CPylonImage::CPylonImage | ( | const CPylonImage & | source | ) |
Copies the image properties and creates a reference to the buffer of the source image.
[in] | source | The source image. |
|
virtual |
Destroys a pylon image object.
|
virtual |
Attaches a grab result buffer.
[in] | grabResult | The source image represented by a grab result. |
grabResult
is invalid.
|
virtual |
Attaches a user buffer.
[in] | pBuffer | The pointer to the buffer of the source image. |
[in] | bufferSizeBytes | The size of the buffer of the source image. |
[in] | pixelType | The pixel type of the source image. |
[in] | width | The number of pixels in a row in the source image. |
[in] | height | The number of rows in the source image. |
[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. |
width
value must be >= 0 and < _I32_MAX. height
value must be >= 0 and < _I32_MAX.
|
virtualinherited |
Can be used to check whether the image can be saved without prior conversion.
This is a convenience method that calls CImagePersistence::CanSaveWithoutConversion().
[in] | imageFileFormat | Target file format for the image to be saved. |
|
virtual |
Changes the pixel type of the image.
[in] | pixelType | The new pixel type. |
|
virtual |
Copies the image data from a different image.
This method is used for making a full copy of an image. Calls the Reset() method to set the same image properties as the source image and copies the image data.
[in] | image | The source image, e.g. a CPylonImage, CPylonBitmapImage, or Grab Result Smart Pointer object. |
|
virtual |
Copies the image data from a different image and changes the padding while copying.
This method is used for making a full copy of an image except for changing the padding. Calls the Reset() method to set the same image properties as the source image and copies the image data. This method is useful in combination with the GetAoi() method.
[in] | image | The source image, e.g. a CPylonImage, CPylonBitmapImage, or Grab Result Smart Pointer object. |
[in] | newPaddingX | The number of extra data bytes at the end of each row. |
|
virtual |
Copies the image data from a provided buffer.
This method is used for making a full copy of an image. Calls the Reset() method to set the same image properties as the source image and copies the image data.
[in] | pBuffer | The pointer to the buffer of the source image. |
[in] | bufferSizeBytes | The size of the buffer of the source image. |
[in] | pixelType | The pixel type of the source image. |
[in] | width | The number of pixels in a row in the source image. |
[in] | height | The number of rows in the source image. |
[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. |
width
value must be >= 0 and < _I32_MAX. height
value must be >= 0 and < _I32_MAX.
|
static |
Creates an image and allocates a buffer for it.
[in] | pixelType | The pixel type of the new image. |
[in] | width | The number of pixels in a row in the new image. |
[in] | height | The number of rows in the new image. |
[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. |
width
value must be >= 0 and < _I32_MAX. height
value must be >= 0 and < _I32_MAX.
|
virtual |
Returns the size of the used buffer.
This method is useful when working with so-called user buffers.
|
virtual |
Creates a new pylon image for an image area of interest (Image AOI) derived from the image.
No image data is copied.
Use CopyImage( const IImage& image, size_t newPaddingX) to create a full copy and to remove the additional padding.
[in] | topLeftX | The x-coordinate of the top left corner of the image AOI in pixels. |
[in] | topLeftY | The y-coordinate of the top left corner of the image AOI in pixels. |
[in] | width | The width of the image AOI in pixels. |
[in] | height | The height of the image AOI in pixels. |
topLeftX
parameter must be divisible by the return value of Pylon::GetPixelIncrementX() for the image's pixel type. topLeftY
parameter must be divisible by the return value of Pylon::GetPixelIncrementY() for the image's pixel type.
|
virtual |
Get the pointer to the buffer.
Implements Pylon::IImage.
|
virtual |
Get the pointer to the buffer containing the image.
The buffer is at least as large as the value returned by GetImageSize().
Implements Pylon::IImage.
|
virtual |
Get the current number of rows.
Implements Pylon::IImage.
|
virtual |
Get the size of the image in bytes.
Implements Pylon::IImage.
|
virtual |
Get the vertical orientation of the image in memory.
Implements Pylon::IImage.
|
virtual |
Get the number of extra data bytes at the end of each row.
Implements Pylon::IImage.
|
virtualinherited |
Retrieves the data of a pixel.
[in] | posX | Horizontal position of the pixel. The first column has position 0. |
[in] | posY | Vertical position of the pixel. The first row has position 0. |
posX
and posY
must be located inside the image area. Supported pixel types:
|
virtual |
Get the current pixel type.
Implements Pylon::IImage.
|
virtual |
Creates a new pylon image for a plane of the image.
No image data is copied.
Use CopyImage( const IImage& image) to create a full copy.
[in] | planeIndex | The zero based index of the plane. |
|
virtual |
Get the stride in bytes.
The stride in bytes can not be computed for packed image format when the stride is not byte aligned. See also Pylon::IsPacked(). The stride in bytes can not be computed if the image is invalid.
[out] | strideBytes | The stride in byte if it can be computed. |
Implements Pylon::IImage.
|
virtual |
Get the current number of columns in pixels.
Implements Pylon::IImage.
|
virtual |
Can be used to check whether the value of PaddingX can be defined by the user.
Implements Pylon::IReusableImage.
|
virtual |
Can be used to check whether the pixel type is supported.
Implements Pylon::IReusableImage.
|
virtual |
Indicates that the referenced buffer is only referenced by this image.
Implements Pylon::IImage.
|
virtual |
Can be used to check whether an image is valid.
Implements Pylon::IImage.
|
virtualinherited |
Loads an image from a disk.
This is a convenience method that calls CImagePersistence::Load()
[in] | filename | Name and path of the image. |
|
virtual |
Copies the image properties and creates a reference to the buffer of the source image.
[in] | source | The source image. |
|
virtual |
Releases the image buffer and resets to an invalid image.
Implements Pylon::IReusableImage.
|
virtual |
Resets the image properties and allocates a new buffer if required.
[in] | pixelType | The pixel type of the new image. |
[in] | width | The number of pixels in a row in the new image. |
[in] | height | The number of rows in the new image. |
[in] | orientation | The vertical orientation of the image in the image buffer. |
width
value must be >= 0 and < _I32_MAX. height
value must be >= 0 and < _I32_MAX. Implements Pylon::IReusableImage.
|
virtual |
Extends the Reset( EPixelType, uint32_t, uint32_t, EImageOrientation) method by settable paddingX.
[in] | pixelType | The pixel type of the new image. |
[in] | width | The number of pixels in a row in the new image. |
[in] | height | The number of rows in the new image. |
[in] | orientation | The vertical orientation of the image in the image buffer. |
width
value must be >= 0 and < _I32_MAX. height
value must be >= 0 and < _I32_MAX. [in] | paddingX | The number of extra data bytes at the end of each row. |
Implements Pylon::IReusableImage.
|
virtualinherited |
Saves the image to disk.
Converts the image to a format that can be saved if required.
This is a convenience method that calls CImagePersistence::Save().
If required, the image is automatically converted into a new image and saved afterwards. See CImagePersistence::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, the CImageFormatConverter class can be used to convert the input image before saving it.
[in] | imageFileFormat | File format to save the image in. |
[in] | filename | Name and path of the image. |
[in] | pOptions | Additional options. |