Pleora Technologies Inc. eBUS SDK v6.2.8.5877 API



PvImage Class Referenceabstract

Image interface to a PvBuffer. More...

Public Member Functions

virtual uint32_t GetMaximumChunkLength () const =0
 Returns the maximum chunk length possible for the currently allocated memory vs image attributes. More...
 
virtual uint32_t GetRequiredSize () const =0
 Gets the size of buffer required to hold the acquired image. More...
 
virtual uint32_t GetEffectiveImageSize () const =0
 Effective image size. More...
 
virtual void SetOffsetX (uint32_t aValue)=0
 Sets the Offset X attribute of the image. More...
 
virtual void SetOffsetY (uint32_t aValue)=0
 Sets the Offset X attribute of the image. More...
 
virtual PvResult Alloc (uint32_t aSizeX, uint32_t aSizeY, PvPixelType aPixelType, uint16_t aPaddingX=0, uint16_t aPaddingY=0, uint32_t aMaximumChunkLength=0)=0
 Allocates memory for this PvImage. More...
 
virtual void Free ()=0
 Frees (de-allocates) the buffer's internal memory. More...
 
virtual PvResult Attach (void *aRawBuffer, uint32_t aSizeX, uint32_t aSizeY, PvPixelType aPixelType, uint16_t aPaddingX=0, uint16_t aPaddingY=0, uint32_t aMaximumChunkLength=0)=0
 Attach this PvImage to an external memory buffer. More...
 
virtual uint8_t * Detach ()=0
 Releases an attached memory buffer. More...
 
virtual bool IsPartialLineMissing () const =0
 If true, the grabber (on the device) was missing at least one pixel in at least one of the lines when the frame was grabbed. More...
 
virtual bool IsFullLineMissing () const =0
 If true, the grabber (on the device) was missing at least one line when the frame was grabbed. More...
 
virtual void SetEOFByLineCount (bool aValue=true)=0
 Simulates the EOFByLineCount used by Pleora video interfaces. More...
 
virtual bool IsEOFByLineCount () const =0
 End of Frame by Line Count status bit. More...
 
virtual bool IsInterlacedEven () const =0
 The image contained in the PvImage is an interlaced Even field. More...
 
virtual bool IsInterlacedOdd () const =0
 The image contained in the PvImage is an interlaced Odd field. More...
 
virtual bool IsImageDropped () const =0
 Image dropped status bit. More...
 
virtual bool IsDataOverrun () const =0
 Data overrun status bit. More...
 
virtual PvBufferGetBuffer ()=0
 Returns the PvBuffer this PvImage belongs to. More...
 
- Public Member Functions inherited from IPvImage
virtual const uint8_t * GetDataPointer () const =0
 Get the image's data pointer. More...
 
virtual uint32_t GetImageSize () const =0
 Actual image size within the payload or buffer. More...
 
virtual uint32_t GetWidth () const =0
 Get the image's width. More...
 
virtual uint32_t GetHeight () const =0
 Get the image's height. More...
 
virtual PvPixelType GetPixelType () const =0
 The buffer's pixel type. More...
 
virtual uint32_t GetBitsPerPixel () const =0
 Returns how many bits are required to hold a pixel using the current buffer's pixel type. More...
 
virtual uint32_t GetOffsetX () const =0
 Get the image's horizontal offset. More...
 
virtual uint32_t GetOffsetY () const =0
 Get the image's vertical offset. More...
 
virtual uint16_t GetPaddingX () const =0
 Get the horizontal image padding. More...
 
virtual uint16_t GetPaddingY () const =0
 Get the vertical image padding. More...
 
virtual uint64_t GetBlockID () const =0
 Return the block ID. More...
 
virtual uint64_t GetTimestamp () const =0
 Get the image's timestamp. More...
 
virtual uint64_t GetReceptionTime () const =0
 Get the buffer's reception timestamp. More...
 

Static Public Member Functions

static uint32_t GetPixelSize (PvPixelType aPixelType)
 Static method returning the pixel size in bits for a specific pixel type. More...
 
static bool IsPixelColor (PvPixelType aPixelType)
 Static method returning whether a pixel type is color or not. More...
 
static bool IsPixelHighRes (PvPixelType aPixelType)
 Static method returning whether a pixel type is higher than 8-bit per channel or not. More...
 
static uint32_t GetBitsPerComponent (PvPixelType aPixelType)
 Static method returning the number of bit per components for a pixel type. More...
 
static PvString PixelTypeToString (PvPixelType aPixelType)
 Static method returning a string representation of a pixel type. More...
 

Friends

class PvTruesenseConverter
 

Detailed Description

Image interface to a PvBuffer.

A PvBuffer represents a generic buffer with no specific payload type. If the payload type is image, the user can obtain a pointer to a PvImage buffer interface through PvBuffer::GetImage.

This PvImage pointer is owned by the PvBuffer and does not need to be released after use. It is valid as long as the PvBuffer exists.

Accessing image specific data

To determinate the payload type and access image specific data:

  1. Retrieve the PvPayloadType using PvBuffer::GetPayloadType
  2. If PvPayloadType is PvPayloadTypeImage, retrieve PvImage pointer from your PvBuffer
  3. Access image specific data through the PvImage pointer, like PvImage::GetWidth, PvImage::GetHeight, etc.
  4. There is no need to release or delete the PvImage pointer. It is valid as long as the PvBuffer exists.

Member Function Documentation

◆ Alloc()

PvResult PvImage::Alloc ( uint32_t  aSizeX,
uint32_t  aSizeY,
PvPixelType  aPixelType,
uint16_t  aPaddingX = 0,
uint16_t  aPaddingY = 0,
uint32_t  aMaximumChunkLength = 0 
)
pure virtual

Allocates memory for this PvImage.

Allocs a PvImage of specific width, height and pixel format

Parameters
[in]aSizeXThe width of the image, in pixels. See GetWidth.
[in]aSizeYThe height of the image, in pixels. See GetHeight.
[in]aPixelTypeThe GEV pixel type from which the pixel depth is extracted. For supported pixel types, see PvPixelType.h.
[in]aPaddingXThe horizontal padding of the image, in pixels. See GetPaddingX.
[in]aPaddingYThe vertical padding of the image, in pixels. See GetPaddingY.
[in]aMaximumChunkLengthThe chunk size in bytes.
Returns
Includes:

◆ Attach()

PvResult PvImage::Attach ( void *  aRawBuffer,
uint32_t  aSizeX,
uint32_t  aSizeY,
PvPixelType  aPixelType,
uint16_t  aPaddingX = 0,
uint16_t  aPaddingY = 0,
uint32_t  aMaximumChunkLength = 0 
)
pure virtual

Attach this PvImage to an external memory buffer.

This method is identical to Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t), with the following exceptions:

  • This method uses an external memory buffer, controlled by the caller.
Parameters
[in]aRawBufferA pointer to the buffer.
[in]aSizeXSee Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t).
[in]aSizeYSee Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t).
[in]aPixelTypeSee Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t).
[in]aPaddingXSee Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t).
[in]aPaddingYSee Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t).
[in]aMaximumChunkLengthSee Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t).
Returns
Includes:

◆ Detach()

uint8_t * PvImage::Detach ( )
pure virtual

Releases an attached memory buffer.

Does nothing other then resetting the memory buffer pointer to NULL.

Returns
The buffer's location in memory.
See also
Attach

◆ Free()

void PvImage::Free ( )
pure virtual

Frees (de-allocates) the buffer's internal memory.

See also
Alloc

◆ GetBitsPerComponent()

uint32_t PvImage::GetBitsPerComponent ( PvPixelType  aPixelType)
static

Static method returning the number of bit per components for a pixel type.

PvPixelMono8 and PvPixelRGBa8 would be 8. Mono16, PvPixelRGB16, PvPixelBayerRG16 would be 16, etc.

Parameters
[in]aPixelTypePixel type.
Returns
True if higher than 8 bit per channel.

◆ GetBuffer()

PvBuffer * PvImage::GetBuffer ( )
pure virtual

Returns the PvBuffer this PvImage belongs to.

Returns
Pointer to a PvBuffer.

◆ GetEffectiveImageSize()

uint32_t PvImage::GetEffectiveImageSize ( ) const
pure virtual

Effective image size.

Uses same size x and y as GetImageSize() but excludes all padding.

Returns
The effective image size

◆ GetMaximumChunkLength()

uint32_t PvImage::GetMaximumChunkLength ( ) const
pure virtual

Returns the maximum chunk length possible for the currently allocated memory vs image attributes.

Returns
Maximum chunk length, in bytes.

◆ GetPixelSize()

uint32_t PvImage::GetPixelSize ( PvPixelType  aPixelType)
static

Static method returning the pixel size in bits for a specific pixel type.

Parameters
[in]aPixelTypePixel type.
Returns
Pixel size, in bits.

◆ GetRequiredSize()

uint32_t PvImage::GetRequiredSize ( ) const
pure virtual

Gets the size of buffer required to hold the acquired image.

This attribute is valid if the last image acquisition was successful or if it failed because the buffer was too small. It can be used to re-allocate the acquisition buffers if the acquisition failed because the buffer was too small.

The required size is only computed for the last image - based on the number of lines as provided in the GigE Vision or USB3 Vision streaming protocol trailer.

It is possible that with devices outputting images of varying length (like line scan cameras) that the last image required size may be smaller than the maximum possible size.

In order to be 100% sure of allocating buffers correctly, you should either hard code the buffer size to known big enough sizes or use the device GenICam GevPayloadSize parameter for dynamic cases.

Returns
The size, in bytes, required to hold the image in this buffer.

◆ IsDataOverrun()

bool PvImage::IsDataOverrun ( ) const
pure virtual

Data overrun status bit.

Returns
True if there was a data overrun. False otherwise.

◆ IsEOFByLineCount()

bool PvImage::IsEOFByLineCount ( ) const
pure virtual

End of Frame by Line Count status bit.

Returns
True if previous frame was NOT the last one of a sequence of sub frames. False otherwise.

◆ IsFullLineMissing()

bool PvImage::IsFullLineMissing ( ) const
pure virtual

If true, the grabber (on the device) was missing at least one line when the frame was grabbed.

Returns
True if full lines were missing, false otherwise

◆ IsImageDropped()

bool PvImage::IsImageDropped ( ) const
pure virtual

Image dropped status bit.

Returns
True if the previous frame was dropped. False otherwise.

◆ IsInterlacedEven()

bool PvImage::IsInterlacedEven ( ) const
pure virtual

The image contained in the PvImage is an interlaced Even field.

Returns
True interlaced Even field. False otherwise.

◆ IsInterlacedOdd()

bool PvImage::IsInterlacedOdd ( ) const
pure virtual

The image contained in the PvImage is an interlaced Odd field.

Returns
True interlaced Odd field. False otherwise.

◆ IsPartialLineMissing()

bool PvImage::IsPartialLineMissing ( ) const
pure virtual

If true, the grabber (on the device) was missing at least one pixel in at least one of the lines when the frame was grabbed.

Returns
True if at least one pixel was missing, false otherwise

◆ IsPixelColor()

bool PvImage::IsPixelColor ( PvPixelType  aPixelType)
static

Static method returning whether a pixel type is color or not.

Parameters
[in]aPixelTypePixel type.
Returns
True if color.

◆ IsPixelHighRes()

bool PvImage::IsPixelHighRes ( PvPixelType  aPixelType)
static

Static method returning whether a pixel type is higher than 8-bit per channel or not.

10, 12, 14 and 16-bit pixel type are considered high resolution. RGB8 counts as 8 so high resolution here means per channel.

Parameters
[in]aPixelTypePixel type.
Returns
True if higher than 8 bit per channel.

◆ PixelTypeToString()

PvString PvImage::PixelTypeToString ( PvPixelType  aPixelType)
static

Static method returning a string representation of a pixel type.

Parameters
[in]aPixelTypePixel type.
Returns
String representation of the pixel type.

◆ SetEOFByLineCount()

void PvImage::SetEOFByLineCount ( bool  aValue = true)
pure virtual

Simulates the EOFByLineCount used by Pleora video interfaces.

Parameters
[in]aValueTrue to enable, false to disable

◆ SetOffsetX()

void PvImage::SetOffsetX ( uint32_t  aValue)
pure virtual

Sets the Offset X attribute of the image.

Parameters
[in]aValueNew value.

◆ SetOffsetY()

void PvImage::SetOffsetY ( uint32_t  aValue)
pure virtual

Sets the Offset X attribute of the image.

Parameters
[in]aValueNew value.

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

Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com