Pleora Technologies Inc. eBUS SDK v6.5.1.6797 API



PvImage.h
1 // *****************************************************************************
2 //
3 // Copyright (c) 2010, Pleora Technologies Inc., All rights reserved.
4 //
5 // *****************************************************************************
6 
7 #ifndef __PVIMAGE_H__
8 #define __PVIMAGE_H__
9 
10 #include <PvPixelType.h>
11 
12 
13 class PvBuffer;
15 
20 class PV_BUFFER_API IPvImage
21 {
22 public:
23 
24  virtual ~IPvImage() {}
25 
31  virtual const uint8_t *GetDataPointer() const = 0;
32 
41  virtual uint8_t *GetDataPointer() = 0;
42 
51  virtual uint32_t GetImageSize() const = 0;
52 
58  virtual uint32_t GetWidth() const = 0;
59 
65  virtual uint32_t GetHeight() const = 0;
66 
72  virtual PvPixelType GetPixelType() const = 0;
73 
79  virtual uint32_t GetBitsPerPixel() const = 0;
80 
86  virtual uint32_t GetOffsetX() const = 0;
87 
93  virtual uint32_t GetOffsetY() const = 0;
94 
108  virtual uint16_t GetPaddingX() const = 0;
109 
121  virtual uint16_t GetPaddingY() const = 0;
122 
133  virtual uint64_t GetBlockID() const = 0;
134 
150  virtual uint64_t GetTimestamp() const = 0;
151 
157  virtual uint64_t GetReceptionTime() const = 0;
158 
159 };
160 
161 
181 class PV_BUFFER_API PvImage
182  : public IPvImage
183 {
184 public:
185 
191  virtual uint32_t GetMaximumChunkLength() const = 0;
192 
200  static uint32_t GetPixelSize( PvPixelType aPixelType );
201 
209  static bool IsPixelColor( PvPixelType aPixelType );
210 
221  static bool IsPixelHighRes( PvPixelType aPixelType );
222 
233  static uint32_t GetBitsPerComponent( PvPixelType aPixelType );
234 
242  static PvString PixelTypeToString( PvPixelType aPixelType );
243 
264  virtual uint32_t GetRequiredSize() const = 0;
265 
273  virtual uint32_t GetEffectiveImageSize() const = 0;
274 
280  virtual void SetOffsetX( uint32_t aValue ) = 0;
281 
287  virtual void SetOffsetY( uint32_t aValue ) = 0;
288 
289  virtual bool IsAllocated() const = 0;
290  virtual bool IsAttached() const = 0;
291 
309  virtual PvResult Alloc( uint32_t aSizeX, uint32_t aSizeY, PvPixelType aPixelType, uint16_t aPaddingX = 0, uint16_t aPaddingY = 0, uint32_t aMaximumChunkLength = 0 ) = 0;
310 
316  virtual void Free() = 0;
317 
338  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;
339 
349  virtual uint8_t *Detach() = 0;
350 
356  virtual bool IsPartialLineMissing() const = 0;
357 
363  virtual bool IsFullLineMissing() const = 0;
364 
371  virtual void SetFullLineMissing( bool aValue, uint32_t aLineNumber ) = 0;
372 
378  virtual void SetEOFByLineCount( bool aValue = true ) = 0;
379 
387  virtual void ClearEOFStatus() = 0;
388 
394  virtual bool IsEOFByLineCount() const = 0;
395 
401  virtual bool IsInterlacedEven() const = 0;
402 
408  virtual bool IsInterlacedOdd() const = 0;
409 
415  virtual bool IsImageDropped() const = 0;
416 
422  virtual bool IsDataOverrun() const = 0;
423 
429  virtual PvBuffer *GetBuffer() = 0;
430 
440  virtual bool HasWatermark() const = 0;
441 
442 private:
443 
444  friend class PvTruesenseConverter;
445 
446 };
447 
448 
449 #endif
PvPixelType
Definition: PvPixelType.h:58
Generic image interface.
Definition: PvImage.h:21
virtual uint8_t * GetDataPointer()=0
Get the image's data pointer.
virtual uint32_t GetOffsetY() const =0
Get the image's vertical offset.
virtual uint32_t GetHeight() const =0
Get the image's height.
virtual const uint8_t * GetDataPointer() const =0
Get the image's data pointer.
virtual uint16_t GetPaddingX() const =0
Get the horizontal image padding.
virtual uint64_t GetBlockID() const =0
Return the block ID.
virtual uint64_t GetTimestamp() const =0
Get the image's timestamp.
virtual uint32_t GetImageSize() const =0
Actual image size within the payload or buffer.
virtual uint32_t GetWidth() const =0
Get the image's width.
virtual PvPixelType GetPixelType() const =0
The buffer's pixel type.
virtual uint32_t GetOffsetX() const =0
Get the image's horizontal offset.
virtual uint16_t GetPaddingY() const =0
Get the vertical image padding.
virtual uint32_t GetBitsPerPixel() const =0
Returns how many bits are required to hold a pixel using the current buffer's pixel type.
virtual uint64_t GetReceptionTime() const =0
Get the buffer's reception timestamp.
Represents a block of GigE Vision or USB3 Vision data in memory.
Definition: PvBuffer.h:97
Image interface to a PvBuffer.
Definition: PvImage.h:183
virtual bool IsInterlacedEven() const =0
The image contained in the PvImage is an interlaced Even field.
virtual bool IsInterlacedOdd() const =0
The image contained in the PvImage is an interlaced Odd field.
virtual bool HasWatermark() const =0
Returns the watermark tag.
virtual bool IsEOFByLineCount() const =0
End of Frame by Line Count status bit.
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.
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.
virtual bool IsImageDropped() const =0
Image dropped status bit.
virtual bool IsDataOverrun() const =0
Data overrun status bit.
virtual bool IsFullLineMissing() const =0
If true, the grabber (on the device) was missing at least one line when the frame was grabbed.
virtual void SetEOFByLineCount(bool aValue=true)=0
Simulates the EOFByLineCount used by Pleora video interfaces.
virtual uint32_t GetEffectiveImageSize() const =0
Effective image size.
virtual uint32_t GetMaximumChunkLength() const =0
Returns the maximum chunk length possible for the currently allocated memory vs image attributes.
virtual void SetOffsetY(uint32_t aValue)=0
Sets the Offset X attribute of the image.
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...
virtual void ClearEOFStatus()=0
Set the EoFByLineCount and FullLineMissing Status of PvImage to the default value false.
virtual void SetOffsetX(uint32_t aValue)=0
Sets the Offset X attribute of the image.
virtual void SetFullLineMissing(bool aValue, uint32_t aLineNumber)=0
Simulates the FullLineMissing used by Pleora video interfaces.
virtual uint8_t * Detach()=0
Releases an attached memory buffer.
virtual void Free()=0
Frees (de-allocates) the buffer's internal memory.
virtual PvBuffer * GetBuffer()=0
Returns the PvBuffer this PvImage belongs to.
virtual uint32_t GetRequiredSize() const =0
Gets the size of buffer required to hold the acquired image.
Result information.
Definition: PvResult.h:30
String class.
Definition: PvString.h:26
Converts images from TRUESENSE(TM) to RGB.
Definition: PvTruesenseConverter.h:38

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