Class PvBufferConverter
Used to convert a #PvBuffer to another pixel type.
Implements
Inherited Members
Namespace: eBUSDotNetReceive
Assembly: eBUSDotNetReceive.dll
Syntax
public class PvBufferConverter : IDisposable
Remarks
To change an image's format:
- Acquire an image. See PvStream::RetrieveBuffer.
- Create an image-format converter (PvBufferConverter object). Use PvBufferConverter::PvBufferConverter.
- Test if you can convert your image to your preferred pixel type. Use IsConversionSupported.
For your source pixel type, use PvImage::GetPixelType; for your destination, select an enumeration from
PvPixelType.h.
- Create a destination buffer. See PvBuffer (you define the destination image's pixel type during this step).
- Optionally, configure options like Bayer filtering and BiColor filtering, use SetBayerFilter, SetBiColorFilter.
- Convert the image to the new pixel type. Use Convert.
Consult the #PvPixelType documentation in order to find which pixel types are supported as conversion destinations.
Constructors
View SourcePvBufferConverter()
Constructor.
Declaration
public PvBufferConverter()
PvBufferConverter(int)
Constructor.
Declaration
public PvBufferConverter(int aMaxNumberOfThreads)
Parameters
| Type | Name | Description |
|---|---|---|
| int | aMaxNumberOfThreads | Maximum number of threads the buffer converter is allowed to use in order to speed up conversion. If 0 or smaller than 0, one thread per processor is assumed. Threads have no specific processor affinity. |
Fields
View SourceswigCMemOwn
Determines who is responsible for deleting the underlying C++ object.
Declaration
protected bool swigCMemOwn
Field Value
| Type | Description |
|---|---|
| bool |
Properties
View SourceBayerFilter
Gets or sets the optional Bayer filtering for this converter.
Declaration
public PvBayerFilterType BayerFilter { get; set; }
Property Value
| Type | Description |
|---|---|
| PvBayerFilterType |
ConversionThreadsPriority
Gets or sets the priority of the threads doing the conversion.
Declaration
public int ConversionThreadsPriority { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
View SourceConvert(IPvImage, ref PvBuffer)
Convert a buffer from one format to another.
Declaration
public PvResult Convert(IPvImage aSource, ref PvBuffer aDestination)
Parameters
| Type | Name | Description |
|---|---|---|
| IPvImage | aSource | The original image. |
| PvBuffer | aDestination | The new image/buffer. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Convert(IPvImage, ref PvBuffer, bool)
Convert a buffer from one format to another.
Declaration
public PvResult Convert(IPvImage aSource, ref PvBuffer aDestination, bool aReallocIfNeeded)
Parameters
| Type | Name | Description |
|---|---|---|
| IPvImage | aSource | The original image. |
| PvBuffer | aDestination | The new image/buffer. |
| bool | aReallocIfNeeded | Depending on the conversion, the memory footprint of the new image may be greater than aDestination current size. By setting this parameter to true, the buffer is re-allocated if aDestination is too small. If aDestination memory buffer is not owned by the #PvBuffer and is too small, #Convert fails. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Convert(IPvImage, ref PvBuffer, bool, bool)
Convert a buffer from one format to another.
Declaration
public PvResult Convert(IPvImage aSource, ref PvBuffer aDestination, bool aReallocIfNeeded, bool aFlipY)
Parameters
| Type | Name | Description |
|---|---|---|
| IPvImage | aSource | The original image. |
| PvBuffer | aDestination | The new image/buffer. |
| bool | aReallocIfNeeded | Depending on the conversion, the memory footprint of the new image may be greater than aDestination current size. By setting this parameter to true, the buffer is re-allocated if aDestination is too small. If aDestination memory buffer is not owned by the #PvBuffer and is too small, #Convert fails. |
| bool | aFlipY | When performing the conversion, flips the image on its Y axis. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Convert(PvBuffer, ref PvBuffer)
Convert a buffer from one format to another.
Declaration
public PvResult Convert(PvBuffer aSource, ref PvBuffer aDestination)
Parameters
| Type | Name | Description |
|---|---|---|
| PvBuffer | aSource | The original image/buffer. |
| PvBuffer | aDestination | The new image/buffer. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Convert(PvBuffer, ref PvBuffer, bool)
Convert a buffer from one format to another.
Declaration
public PvResult Convert(PvBuffer aSource, ref PvBuffer aDestination, bool aReallocIfNeeded)
Parameters
| Type | Name | Description |
|---|---|---|
| PvBuffer | aSource | The original image/buffer. |
| PvBuffer | aDestination | The new image/buffer. |
| bool | aReallocIfNeeded | Depending on the conversion, the memory footprint of the new image may be greater than aDestination current size. By setting this parameter to true, the buffer is re-allocated if aDestination is too small. If aDestination memory buffer is not owned by the #PvBuffer and is too small, #Convert fails. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Convert(PvBuffer, ref PvBuffer, bool, bool)
Convert a buffer from one format to another.
Declaration
public PvResult Convert(PvBuffer aSource, ref PvBuffer aDestination, bool aReallocIfNeeded, bool aFlipY)
Parameters
| Type | Name | Description |
|---|---|---|
| PvBuffer | aSource | The original image/buffer. |
| PvBuffer | aDestination | The new image/buffer. |
| bool | aReallocIfNeeded | Depending on the conversion, the memory footprint of the new image may be greater than aDestination current size. By setting this parameter to true, the buffer is re-allocated if aDestination is too small. If aDestination memory buffer is not owned by the #PvBuffer and is too small, #Convert fails. |
| bool | aFlipY | When performing the conversion, flips the image on its Y axis. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
Dispose()
Dispose.
Declaration
public void Dispose()
Dispose(bool)
Dispose
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing |
~PvBufferConverter()
Destructor.
Declaration
protected ~PvBufferConverter()
GetBiColorFilter()
Retrieves current optional BiColor filtering.
Declaration
public PvBiColorFilterType GetBiColorFilter()
Returns
| Type | Description |
|---|---|
| PvBiColorFilterType | The BiColor filter's type; a #PvBiColorFilterType enumeration. |
IsConversionSupported(PvPixelType, PvPixelType)
Test if a pixel type can be converted to another type.
Declaration
public static bool IsConversionSupported(PvPixelType aSource, PvPixelType aDestination)
Parameters
| Type | Name | Description |
|---|---|---|
| PvPixelType | aSource | The original pixel type. For available pixel types, see PvPixelType.h. |
| PvPixelType | aDestination | The new pixel type. See aSource. |
Returns
| Type | Description |
|---|---|
| bool | True if #Convert has an available conversion algorithm; otherwise, false. |
ResetRGBFilter()
Resets the RGB filter used for conversion (if any)
Declaration
public PvResult ResetRGBFilter()
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
SetBiColorFilter(PvBiColorFilterType)
Set the optional BiColor filtering for this converter.
Declaration
public PvResult SetBiColorFilter(PvBiColorFilterType aFilter)
Parameters
| Type | Name | Description |
|---|---|---|
| PvBiColorFilterType | aFilter | The new filter settings; a #PvBiColorFilterType enumeration. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|
SetRGBFilter(PvBufferConverterRGBFilter)
Assigns a RGB filter to be used during conversion
Declaration
public PvResult SetRGBFilter(PvBufferConverterRGBFilter aFilter)
Parameters
| Type | Name | Description |
|---|---|---|
| PvBufferConverterRGBFilter | aFilter | The RGB filter to be used during conversion. |
Returns
| Type | Description |
|---|---|
| PvResult | Includes:
|