All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | List of all members
Pylon::CPylonImage Class Reference

Describes an image. More...

#include <pylon/PylonImage.h>

Inheritance diagram for Pylon::CPylonImage:
Inheritance graph
[legend]

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 CPylonImageoperator= (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...
 

Detailed Description

Describes an image.

Buffer Handling:
The buffer that is automatically created by the CPylonImage class or a hosted grab result buffer are replaced by a larger buffer if required. The size of the allocated buffer is never decreased. Referenced user buffers are never automatically replaced by a larger buffer. Referenced grab result buffers are never reused. See the Reset() method for more details. The Release() method can be used to detach a user buffer, release a hosted grab result buffer or to free an allocated buffer.
Thread Safety:
The CPylonImage class is not thread-safe.

Constructor & Destructor Documentation

Pylon::CPylonImage::CPylonImage ( )

Creates an invalid image.

See Pylon::IImage on how the properties of an invalid image are returned.

Error Safety:
Does not throw C++ exceptions.
Pylon::CPylonImage::CPylonImage ( const CPylonImage source)

Copies the image properties and creates a reference to the buffer of the source image.

Parameters
[in]sourceThe source image.
Postcondition
  • Another reference to the source image buffer is created.
  • Creates an invalid image if the source image is invalid.
Error Safety:
Does not throw C++ exceptions.
virtual Pylon::CPylonImage::~CPylonImage ( )
virtual

Destroys a pylon image object.

Error Safety:
Does not throw C++ exceptions.

Member Function Documentation

virtual void Pylon::CPylonImage::AttachGrabResultBuffer ( const CGrabResultPtr grabResult)
virtual

Attaches a grab result buffer.

Parameters
[in]grabResultThe source image represented by a grab result.
Postcondition
  • The image properties are taken over from the grab result.
  • The grab result buffer is used by the image class.
  • Another reference to the grab result buffer is created. This prevents the buffer's reuse for grabbing.
  • Creates an invalid image if the grabResult is invalid.
  • Creates an invalid image if the grab was not successful. See CGrabResultData::GrabSucceeded().
Error Safety:
Throws an exception when no buffer with the required size could be allocated. Throws an exception when the preconditions of the Reset() method are not met.
virtual void Pylon::CPylonImage::AttachUserBuffer ( void *  pBuffer,
size_t  bufferSizeBytes,
EPixelType  pixelType,
uint32_t  width,
uint32_t  height,
size_t  paddingX,
EImageOrientation  orientation = ImageOrientation_TopDown 
)
virtual

Attaches a user buffer.

Parameters
[in]pBufferThe pointer to the buffer of the source image.
[in]bufferSizeBytesThe size of the buffer of the source image.
[in]pixelTypeThe pixel type of the source image.
[in]widthThe number of pixels in a row in the source image.
[in]heightThe number of rows in the source image.
[in]paddingXThe number of extra data bytes at the end of each row.
[in]orientationThe vertical orientation of the image in the image buffer.
Precondition
  • The pixel type must be valid.
  • The width value must be >= 0 and < _I32_MAX.
  • The height value must be >= 0 and < _I32_MAX.
  • The pointer to the source buffer must not be NULL.
  • The source buffer must be large enough to hold the image described by the parameters.
Postcondition
  • The image properties are taken over from the passed parameters.
  • The user buffer is used by the image class.
  • The buffer must not be freed while being attached.
Error Safety:
Throws an exception if the preconditions are not met.
virtual bool Pylon::CPylonImageBase::CanSaveWithoutConversion ( EImageFileFormat  imageFileFormat) const
virtualinherited

Can be used to check whether the image can be saved without prior conversion.

This is a convenience method that calls CImagePersistence::CanSaveWithoutConversion().

Parameters
[in]imageFileFormatTarget file format for the image to be saved.
Returns
Returns true, if the image can be saved without prior conversion.
Error Safety:
Does not throw C++ exceptions.
virtual void Pylon::CPylonImage::ChangePixelType ( EPixelType  pixelType)
virtual

Changes the pixel type of the image.

Parameters
[in]pixelTypeThe new pixel type.
Precondition
  • Pylon::SamplesPerPixel( oldPixelType) == Pylon::SamplesPerPixel( newPixelType)
  • Pylon::BitPerPixel( oldPixelType) == Pylon::BitPerPixel( newPixelType)
Error Safety:
Throws an exception when the new pixel type properties do not match the existing ones.
virtual void Pylon::CPylonImage::CopyImage ( const IImage image)
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.

Parameters
[in]imageThe source image, e.g. a CPylonImage, CPylonBitmapImage, or Grab Result Smart Pointer object.
Precondition
The preconditions of the Reset() method must be met.
Postcondition
  • The image contains a copy of the image data contained by the source image.
  • Creates an invalid image if the source image is invalid.
Error Safety:
Throws an exception when no buffer with the required size could be allocated. Throws an exception when the preconditions of the Reset() method are not met.
virtual void Pylon::CPylonImage::CopyImage ( const IImage image,
size_t  newPaddingX 
)
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.

Parameters
[in]imageThe source image, e.g. a CPylonImage, CPylonBitmapImage, or Grab Result Smart Pointer object.
[in]newPaddingXThe number of extra data bytes at the end of each row.
Precondition
  • The preconditions of the Reset() method must be met.
  • The rows of the source image must be byte aligned. This may not be the case for packed pixel types. See Pylon::IsPacked().
  • The rows of the newly created image must be byte aligned. This may not be the case for packed pixel types. See Pylon::IsPacked().
Postcondition
  • The image contains a copy of the image data contained by the source image.
  • The line padding is adjusted.
  • The byte aligned row padding area is set to zero.
  • Creates an invalid image if the source image is invalid.
Error Safety:
Throws an exception when no buffer with the required size could be allocated. Throws an exception when the preconditions of the Reset() method are not met.
virtual void Pylon::CPylonImage::CopyImage ( void *  pBuffer,
size_t  bufferSizeBytes,
EPixelType  pixelType,
uint32_t  width,
uint32_t  height,
size_t  paddingX,
EImageOrientation  orientation = ImageOrientation_TopDown 
)
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.

Parameters
[in]pBufferThe pointer to the buffer of the source image.
[in]bufferSizeBytesThe size of the buffer of the source image.
[in]pixelTypeThe pixel type of the source image.
[in]widthThe number of pixels in a row in the source image.
[in]heightThe number of rows in the source image.
[in]paddingXThe number of extra data bytes at the end of each row.
[in]orientationThe vertical orientation of the image in the image buffer.
Precondition
  • The pixel type must be valid.
  • The width value must be >= 0 and < _I32_MAX.
  • The height value must be >= 0 and < _I32_MAX.
  • The pointer to the source buffer must not be NULL.
  • The source buffer must be large enough to hold the image described by the parameters.
  • The preconditions of the Reset() method must be met.
Postcondition
A copy of the image contained by the source image buffer is made.
Error Safety:
Throws an exception when no buffer with the required size could be allocated. Throws an exception when the preconditions of the Reset() method are not met.
static CPylonImage Pylon::CPylonImage::Create ( EPixelType  pixelType,
uint32_t  width,
uint32_t  height,
size_t  paddingX = 0,
EImageOrientation  orientation = ImageOrientation_TopDown 
)
static

Creates an image and allocates a buffer for it.

Parameters
[in]pixelTypeThe pixel type of the new image.
[in]widthThe number of pixels in a row in the new image.
[in]heightThe number of rows in the new image.
[in]paddingXThe number of extra data bytes at the end of each row.
[in]orientationThe vertical orientation of the image in the image buffer.
Precondition
  • The pixel type must be valid.
  • The width value must be >= 0 and < _I32_MAX.
  • The height value must be >= 0 and < _I32_MAX.
Error Safety:
Throws an exception when the parameters are invalid. Throws an exception when no buffer with the required size could be allocated.
virtual size_t Pylon::CPylonImage::GetAllocatedBufferSize ( ) const
virtual

Returns the size of the used buffer.

This method is useful when working with so-called user buffers.

Error Safety:
Does not throw C++ exceptions.
virtual CPylonImage Pylon::CPylonImage::GetAoi ( uint32_t  topLeftX,
uint32_t  topLeftY,
uint32_t  width,
uint32_t  height 
) const
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.

copiedAoi.CopyImage( image.GetAoi( 80, 90, 100, 100), 0);
Parameters
[in]topLeftXThe x-coordinate of the top left corner of the image AOI in pixels.
[in]topLeftYThe y-coordinate of the top left corner of the image AOI in pixels.
[in]widthThe width of the image AOI in pixels.
[in]heightThe height of the image AOI in pixels.
Returns
A pylon image referencing an image AOI of the image.
Precondition
  • The image must be valid.
  • The image AOI is located inside the image.
  • The image is not in a planar format, see Pylon::IsPlanar(). Use GetPlane() first in this case.
  • The rows of the image must be byte aligned. This may not be the case for packed pixel types. See Pylon::IsPacked().
  • The x-coordinate must be byte aligned. This may not be the case for packed pixel types. See Pylon::IsPacked().
  • The topLeftX parameter must be divisible by the return value of Pylon::GetPixelIncrementX() for the image's pixel type.
  • The topLeftY parameter must be divisible by the return value of Pylon::GetPixelIncrementY() for the image's pixel type.
Postcondition
  • A reference to the same buffer is created. The image data is not copied.
  • The returned image uses the paddingX property to skip over image content outside of the image AOI.
Error Safety:
Throws an exception when the preconditions are not met.
virtual void* Pylon::CPylonImage::GetBuffer ( )
virtual

Get the pointer to the buffer.

Returns
Returns the pointer to the used buffer or NULL if the image is invalid.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual const void* Pylon::CPylonImage::GetBuffer ( ) const
virtual

Get the pointer to the buffer containing the image.

The buffer is at least as large as the value returned by GetImageSize().

Returns
Returns the pointer to the used buffer or NULL if the image is invalid.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual uint32_t Pylon::CPylonImage::GetHeight ( ) const
virtual

Get the current number of rows.

Returns
Returns the current number of rows or 0 if the image is invalid.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual size_t Pylon::CPylonImage::GetImageSize ( ) const
virtual

Get the size of the image in bytes.

Returns
Returns the size of the image in bytes or 0 if the image is invalid.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual EImageOrientation Pylon::CPylonImage::GetOrientation ( ) const
virtual

Get the vertical orientation of the image in memory.

Returns
Returns the orientation of the image or ImageOrientation_TopDown if the image is invalid.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual size_t Pylon::CPylonImage::GetPaddingX ( ) const
virtual

Get the number of extra data bytes at the end of each row.

Returns
Returns the number of extra data bytes at the end of each row or 0 if the image is invalid.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual SPixelData Pylon::CPylonImageBase::GetPixelData ( uint32_t  posX,
uint32_t  posY 
) const
virtualinherited

Retrieves the data of a pixel.

Note
This method is relativly slow. Do not use it for image processing tasks.
Parameters
[in]posXHorizontal position of the pixel. The first column has position 0.
[in]posYVertical position of the pixel. The first row has position 0.
Returns
Returns the data of a pixel for supported pixel types. For unsupported pixel types pixel data of the SPixelData::PixelDataType_Unknown type is returned.
Precondition
  • The image must be valid.
  • The pixel position defined by posX and posY must be located inside the image area.

Supported pixel types:

  • PixelType_Mono1packed
  • PixelType_Mono2packed
  • PixelType_Mono4packed
  • PixelType_Mono8
  • PixelType_Mono8signed
  • PixelType_Mono10
  • PixelType_Mono10packed
  • PixelType_Mono10p
  • PixelType_Mono12
  • PixelType_Mono12packed
  • PixelType_Mono12p
  • PixelType_Mono16
  • PixelType_BayerGR8
  • PixelType_BayerRG8
  • PixelType_BayerGB8
  • PixelType_BayerBG8
  • PixelType_BayerGR10
  • PixelType_BayerRG10
  • PixelType_BayerGB10
  • PixelType_BayerBG10
  • PixelType_BayerGR12
  • PixelType_BayerRG12
  • PixelType_BayerGB12
  • PixelType_BayerBG12
  • PixelType_BayerGR12Packed
  • PixelType_BayerRG12Packed
  • PixelType_BayerGB12Packed
  • PixelType_BayerBG12Packed
  • PixelType_BayerGR10p
  • PixelType_BayerRG10p
  • PixelType_BayerGB10p
  • PixelType_BayerBG10p
  • PixelType_BayerGR12p
  • PixelType_BayerRG12p
  • PixelType_BayerGB12p
  • PixelType_BayerBG12p
  • PixelType_BayerGR16
  • PixelType_BayerRG16
  • PixelType_BayerGB16
  • PixelType_BayerBG16
  • PixelType_RGB8packed
  • PixelType_BGR8packed
  • PixelType_RGBA8packed
  • PixelType_BGRA8packed
  • PixelType_RGB10packed
  • PixelType_BGR10packed
  • PixelType_RGB12packed
  • PixelType_BGR12packed
  • PixelType_RGB12V1packed
  • PixelType_RGB16packed
  • PixelType_RGB8planar
  • PixelType_RGB10planar
  • PixelType_RGB12planar
  • PixelType_RGB16planar
  • PixelType_YUV422packed
  • PixelType_YUV422_YUYV_Packed
Error Safety:
Throws an exception, if the preconditions are not met.
virtual EPixelType Pylon::CPylonImage::GetPixelType ( ) const
virtual

Get the current pixel type.

Returns
Returns the pixel type or PixelType_Undefined if the image is invalid.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual CPylonImage Pylon::CPylonImage::GetPlane ( size_t  planeIndex) const
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.

copiedPlane.CopyImage( planarImage.GetPlane( 2));
Parameters
[in]planeIndexThe zero based index of the plane.
Returns
A pylon image referencing a plane of the image.
Precondition
The value of planeIndex < Pylon::PlaneCount( GetPixelType()).
Postcondition
  • A reference to the same buffer is created. No image data is copied.
  • The returned image has the Pylon::GetPlanePixelType( GetPixelType()) pixel type.
  • If the image is not planar only index 0 is allowed. A call passing index 0 returns a copy of the image. No image data is copied.
Error Safety:
Throws an exception when the plane index is out of range.
virtual bool Pylon::CPylonImage::GetStride ( size_t &  strideBytes) const
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.

Parameters
[out]strideBytesThe stride in byte if it can be computed.
Returns
Returns true if the stride can be computed.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual uint32_t Pylon::CPylonImage::GetWidth ( ) const
virtual

Get the current number of columns in pixels.

Returns
Returns the current number of columns in pixels or 0 if the image is invalid.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual bool Pylon::CPylonImage::IsAdditionalPaddingSupported ( ) const
virtual

Can be used to check whether the value of PaddingX can be defined by the user.

Returns
Returns true if the value of PaddingX can be defined by the user.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IReusableImage.

virtual bool Pylon::CPylonImage::IsSupportedPixelType ( EPixelType  pixelType) const
virtual

Can be used to check whether the pixel type is supported.

Returns
Returns true if the pixel type is supported.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IReusableImage.

virtual bool Pylon::CPylonImage::IsUnique ( ) const
virtual

Indicates that the referenced buffer is only referenced by this image.

Returns
Returns true if the referenced buffer is only referenced by this image. Returns false if the image is invalid.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual bool Pylon::CPylonImage::IsValid ( ) const
virtual

Can be used to check whether an image is valid.

Returns
Returns false if the image is invalid.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IImage.

virtual void Pylon::CPylonImageBase::Load ( const String_t filename)
virtualinherited

Loads an image from a disk.

This is a convenience method that calls CImagePersistence::Load()

Parameters
[in]filenameName and path of the image.
Precondition
The image object must be able to hold the image format of the loaded image.
Error Safety:
Throws an exception if the image cannot be loaded. The image buffer content is undefined when the loading of the image fails.
virtual CPylonImage& Pylon::CPylonImage::operator= ( const CPylonImage source)
virtual

Copies the image properties and creates a reference to the buffer of the source image.

Parameters
[in]sourceThe source image.
Postcondition
  • Another reference to the source image buffer is created.
  • Creates an invalid image if the source image is invalid.
Error Safety:
Does not throw C++ exceptions.
virtual void Pylon::CPylonImage::Release ( )
virtual

Releases the image buffer and resets to an invalid image.

Postcondition
  • PixelType = PixelType_Undefined.
  • Width = 0.
  • Height = 0.
  • PaddingX = 0.
  • No buffer is allocated.
Error Safety:
Does not throw C++ exceptions.

Implements Pylon::IReusableImage.

virtual void Pylon::CPylonImage::Reset ( EPixelType  pixelType,
uint32_t  width,
uint32_t  height,
EImageOrientation  orientation = ImageOrientation_TopDown 
)
virtual

Resets the image properties and allocates a new buffer if required.

Parameters
[in]pixelTypeThe pixel type of the new image.
[in]widthThe number of pixels in a row in the new image.
[in]heightThe number of rows in the new image.
[in]orientationThe vertical orientation of the image in the image buffer.
Precondition
  • The width value must be >= 0 and < _I32_MAX.
  • The height value must be >= 0 and < _I32_MAX.
  • If a user buffer is referenced then this buffer must not be referenced by another pylon image. See the IsUnique() and IsUserBufferAttached() methods.
  • If a user buffer is referenced then this buffer must be large enough to hold the destination image. See the GetAllocatedBufferSize() and IsUserBufferAttached() methods.
Postcondition
  • If the previously referenced buffer is a grab result buffer, a new buffer has been allocated.
  • If the previously referenced buffer is also referenced by another pylon image, a new buffer has been allocated.
  • If the previously referenced buffer is not large enough to hold an image with the given properties, a new buffer has been allocated.
  • If no buffer has been allocated before, a buffer has been allocated.
Error Safety:
Throws an exception when the preconditions are not met. Throws an exception when no buffer with the required size could be allocated.

Implements Pylon::IReusableImage.

virtual void Pylon::CPylonImage::Reset ( EPixelType  pixelType,
uint32_t  width,
uint32_t  height,
size_t  paddingX,
EImageOrientation  orientation = ImageOrientation_TopDown 
)
virtual

Extends the Reset( EPixelType, uint32_t, uint32_t, EImageOrientation) method by settable paddingX.

Parameters
[in]pixelTypeThe pixel type of the new image.
[in]widthThe number of pixels in a row in the new image.
[in]heightThe number of rows in the new image.
[in]orientationThe vertical orientation of the image in the image buffer.
Precondition
  • The width value must be >= 0 and < _I32_MAX.
  • The height value must be >= 0 and < _I32_MAX.
  • If a user buffer is referenced then this buffer must not be referenced by another pylon image. See the IsUnique() and IsUserBufferAttached() methods.
  • If a user buffer is referenced then this buffer must be large enough to hold the destination image. See the GetAllocatedBufferSize() and IsUserBufferAttached() methods.
Postcondition
  • If the previously referenced buffer is a grab result buffer, a new buffer has been allocated.
  • If the previously referenced buffer is also referenced by another pylon image, a new buffer has been allocated.
  • If the previously referenced buffer is not large enough to hold an image with the given properties, a new buffer has been allocated.
  • If no buffer has been allocated before, a buffer has been allocated.
Error Safety:
Throws an exception when the preconditions are not met. Throws an exception when no buffer with the required size could be allocated.
Parameters
[in]paddingXThe number of extra data bytes at the end of each row.

Implements Pylon::IReusableImage.

virtual void Pylon::CPylonImageBase::Save ( EImageFileFormat  imageFileFormat,
const String_t filename,
CImagePersistenceOptions pOptions = NULL 
) const
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.

Parameters
[in]imageFileFormatFile format to save the image in.
[in]filenameName and path of the image.
[in]pOptionsAdditional options.
Precondition
The pixel type of the image to be saved must be a supported input format of the Pylon::CImageFormatConverter.
Error Safety:
Throws an exception if the saving of the image fails.

The documentation for this class was generated from the following file:

pylon 5.0.9
Copyright © 2006-2017 Basler AG (Tue May 30 2017 17:24:58)