Class PvImage
Image interface to a PvBuffer.
Implements
Inherited Members
Namespace: eBUSDotNet
Assembly: eBUSDotNet.dll
Syntax
public class PvImage : IPvImage, IDisposable
Remarks
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.
<h2 id="accessing">Accessing image specific data</h2>
<b>To determinate the payload type and access image specific data:</b>
- Retrieve the #PvPayloadType using #PvBuffer::GetPayloadType
- If PvPayloadType is PvPayloadTypeImage, retrieve #PvImage pointer from your PvBuffer
- Access image specific data through the #PvImage pointer, like PvImage::GetWidth, #PvImage::GetHeight, etc.
- There is no need to release or delete the PvImage pointer. It is valid as long as the PvBuffer exists.
Properties
View SourceEffectiveImageSize
Effective image size of PvImage.
Declaration
public uint EffectiveImageSize { get; }
Property Value
| Type | Description |
|---|---|
| uint |
IsDataOverrun
Indicates whether data overrun occurred in PvImage.
Declaration
public bool IsDataOverrun { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsEOFByLineCount
Indicates whether EOF by line count in PvImage.
Declaration
public bool IsEOFByLineCount { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
IsFullLineMissing
Indicates whether full line is missing in PvImage.
Declaration
public bool IsFullLineMissing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsImageDropped
Indicates whether PvImage is dropped.
Declaration
public bool IsImageDropped { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsInterlacedEven
Indicates whether PvImage is interlaced even.
Declaration
public bool IsInterlacedEven { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsInterlacedOdd
Indicates whether PvImage is interlaced odd.
Declaration
public bool IsInterlacedOdd { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsPartialLineMissing
Indicates whether partial line is missing in PvImage.
Declaration
public bool IsPartialLineMissing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
MaximumChunkLength
Maximum chunk length of PvImage.
Declaration
public uint MaximumChunkLength { get; }
Property Value
| Type | Description |
|---|---|
| uint |
OffsetX
Offset X of PvImage.
Declaration
public uint OffsetX { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
OffsetY
Offset Y of PvImage.
Declaration
public uint OffsetY { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
RequiredSize
Gets the size of buffer required to hold the acquired image.
Declaration
public uint RequiredSize { get; }
Property Value
| Type | Description |
|---|---|
| uint |
Remarks
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 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.
Methods
View SourceAlloc(uint, uint, PvPixelType)
Allocates memory for this #PvImage.
Declaration
public PvResult Alloc(uint aSizeX, uint aSizeY, PvPixelType aPixelType)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | aSizeX | The width of the image, in pixels. See #GetWidth. |
| uint | aSizeY | The height of the image, in pixels. See #GetHeight. |
| PvPixelType | aPixelType | The GEV pixel type from which the pixel depth is extracted. For supported pixel types, see PvPixelType.h. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Alloc(uint, uint, PvPixelType, ushort)
Allocates memory for this #PvImage.
Declaration
public PvResult Alloc(uint aSizeX, uint aSizeY, PvPixelType aPixelType, ushort aPaddingX)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | aSizeX | The width of the image, in pixels. See #GetWidth. |
| uint | aSizeY | The height of the image, in pixels. See #GetHeight. |
| PvPixelType | aPixelType | The GEV pixel type from which the pixel depth is extracted. For supported pixel types, see PvPixelType.h. |
| ushort | aPaddingX | The horizontal padding of the image, in pixels. See #GetPaddingX. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Alloc(uint, uint, PvPixelType, ushort, ushort)
Allocates memory for this #PvImage.
Declaration
public PvResult Alloc(uint aSizeX, uint aSizeY, PvPixelType aPixelType, ushort aPaddingX, ushort aPaddingY)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | aSizeX | The width of the image, in pixels. See #GetWidth. |
| uint | aSizeY | The height of the image, in pixels. See #GetHeight. |
| PvPixelType | aPixelType | The GEV pixel type from which the pixel depth is extracted. For supported pixel types, see PvPixelType.h. |
| ushort | aPaddingX | The horizontal padding of the image, in pixels. See #GetPaddingX. |
| ushort | aPaddingY | The vertical padding of the image, in pixels. See #GetPaddingY. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Alloc(uint, uint, PvPixelType, ushort, ushort, uint)
Allocates memory for this #PvImage.
Declaration
public PvResult Alloc(uint aSizeX, uint aSizeY, PvPixelType aPixelType, ushort aPaddingX, ushort aPaddingY, uint aMaximumChunkLength)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | aSizeX | The width of the image, in pixels. See #GetWidth. |
| uint | aSizeY | The height of the image, in pixels. See #GetHeight. |
| PvPixelType | aPixelType | The GEV pixel type from which the pixel depth is extracted. For supported pixel types, see PvPixelType.h. |
| ushort | aPaddingX | The horizontal padding of the image, in pixels. See #GetPaddingX. |
| ushort | aPaddingY | The vertical padding of the image, in pixels. See #GetPaddingY. |
| uint | aMaximumChunkLength | The chunk size in bytes. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Attach(byte*, uint, uint, PvPixelType)
Attach this PvImage to an external memory buffer.
Declaration
public PvResult Attach(byte* aRawBuffer, uint aSizeX, uint aSizeY, PvPixelType aPixelType)
Parameters
| Type | Name | Description |
|---|---|---|
| byte* | aRawBuffer | A pointer to the buffer. |
| uint | aSizeX | The width of the image, in pixels. |
| uint | aSizeY | The height of the image, in pixels. |
| PvPixelType | aPixelType | The GEV pixel type from which the pixel depth is extracted. |
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK on success, PV_INVALID_PARAMETER if parameters are invalid. |
Attach(byte*, uint, uint, PvPixelType, ushort)
Attach this PvImage to an external memory buffer.
Declaration
public PvResult Attach(byte* aRawBuffer, uint aSizeX, uint aSizeY, PvPixelType aPixelType, ushort aPaddingX)
Parameters
| Type | Name | Description |
|---|---|---|
| byte* | aRawBuffer | A pointer to the buffer. |
| uint | aSizeX | The width of the image, in pixels. |
| uint | aSizeY | The height of the image, in pixels. |
| PvPixelType | aPixelType | The GEV pixel type from which the pixel depth is extracted. |
| ushort | aPaddingX | The horizontal padding of the image, in bytes. |
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK on success, PV_INVALID_PARAMETER if parameters are invalid. |
Attach(byte*, uint, uint, PvPixelType, ushort, ushort)
Attach this PvImage to an external memory buffer.
Declaration
public PvResult Attach(byte* aRawBuffer, uint aSizeX, uint aSizeY, PvPixelType aPixelType, ushort aPaddingX, ushort aPaddingY)
Parameters
| Type | Name | Description |
|---|---|---|
| byte* | aRawBuffer | A pointer to the buffer. |
| uint | aSizeX | The width of the image, in pixels. |
| uint | aSizeY | The height of the image, in pixels. |
| PvPixelType | aPixelType | The GEV pixel type from which the pixel depth is extracted. |
| ushort | aPaddingX | The horizontal padding of the image, in bytes. |
| ushort | aPaddingY | The vertical padding of the image, in bytes. |
Returns
| Type | Description |
|---|---|
| PvResult | PV_OK on success, PV_INVALID_PARAMETER if parameters are invalid. |
Attach(byte[], uint, uint, PvPixelType)
Attach this #PvImage to an external memory buffer.
Declaration
public PvResult Attach(byte[] aRawBuffer, uint aSizeX, uint aSizeY, PvPixelType aPixelType)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | aRawBuffer | A pointer to the buffer. |
| uint | aSizeX | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| uint | aSizeY | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| PvPixelType | aPixelType | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Attach(byte[], uint, uint, PvPixelType, ushort)
Attach this #PvImage to an external memory buffer.
Declaration
public PvResult Attach(byte[] aRawBuffer, uint aSizeX, uint aSizeY, PvPixelType aPixelType, ushort aPaddingX)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | aRawBuffer | A pointer to the buffer. |
| uint | aSizeX | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| uint | aSizeY | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| PvPixelType | aPixelType | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| ushort | aPaddingX | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Attach(byte[], uint, uint, PvPixelType, ushort, ushort)
Attach this #PvImage to an external memory buffer.
Declaration
public PvResult Attach(byte[] aRawBuffer, uint aSizeX, uint aSizeY, PvPixelType aPixelType, ushort aPaddingX, ushort aPaddingY)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | aRawBuffer | A pointer to the buffer. |
| uint | aSizeX | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| uint | aSizeY | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| PvPixelType | aPixelType | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| ushort | aPaddingX | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| ushort | aPaddingY | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Attach(byte[], uint, uint, PvPixelType, ushort, ushort, uint)
Attach this #PvImage to an external memory buffer.
Declaration
public PvResult Attach(byte[] aRawBuffer, uint aSizeX, uint aSizeY, PvPixelType aPixelType, ushort aPaddingX, ushort aPaddingY, uint aMaximumChunkLength)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | aRawBuffer | A pointer to the buffer. |
| uint | aSizeX | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| uint | aSizeY | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| PvPixelType | aPixelType | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| ushort | aPaddingX | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| ushort | aPaddingY | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
| uint | aMaximumChunkLength | See #Alloc(uint32_t,uint32_t,PvPixelType,uint16_t,uint16_t,uint32_t). |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
ClearEOFStatus()
Set the EoFByLineCount and FullLineMissing Status of PvImage to the default value false.
Declaration
public virtual void ClearEOFStatus()
Detach()
Releases an attached memory buffer.
Declaration
public virtual byte* Detach()
Returns
| Type | Description |
|---|---|
| byte* | The buffer's location in memory. |
See Also
View SourceDispose(bool)
Dispose.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
Overrides
View SourceFree()
Frees (de-allocates) the buffer's internal memory.
Declaration
public virtual void Free()
See Also
View SourceGetBuffer()
Returns the PvBuffer this PvImage belongs to.
Declaration
public virtual PvBuffer GetBuffer()
Returns
| Type | Description |
|---|---|
| PvBuffer | Pointer to a PvBuffer. |
HasWatermark()
Returns the watermark tag.
Declaration
public virtual bool HasWatermark()
Returns
| Type | Description |
|---|---|
| bool | The watermark tag. |
IsAllocated()
Checks whether the image buffer has been allocated internally.
Declaration
public bool IsAllocated()
Returns
| Type | Description |
|---|---|
| bool | True if the image buffer was allocated using Alloc, false otherwise. |
IsAttached()
Checks whether the image is attached to an external buffer.
Declaration
public bool IsAttached()
Returns
| Type | Description |
|---|---|
| bool | True if the image is attached to an external buffer using Attach, false otherwise. |
SetFullLineMissing(bool, uint)
Simulates the FullLineMissing used by Pleora video interfaces.
Declaration
public virtual void SetFullLineMissing(bool aValue, uint aLineNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | aValue | True to enable, false to disable |
| uint | aLineNumber | The Actual line number in the image. |