Used to convert a PvBuffer to another pixel type. More...
#include <PvCudaBufferConverter.h>
Public Member Functions | |
| PvCudaBufferConverter () | |
| Constructor. | |
| virtual | ~PvCudaBufferConverter () |
| Destructor. | |
| PvCudaBayerFilterType | GetCudaBayerFilter () const |
| Retrieves current optional Bayer filtering. | |
| PvResult | SetCudaBayerFilter (PvCudaBayerFilterType aFilter) |
| Set the optional Bayer filtering for this converter. | |
| PvResult | Convert (const PvBuffer *aSource, PvBuffer *aDestination, bool aEnableCudaUVM) |
| Convert a PvBuffer from one format to another, with another PvBuffer to store the output. | |
| PvResult | Convert (const PvBuffer *aSource, PvCudaBuffer *aCudaDestination, bool aEnableCudaUVM) |
| Convert a PvBuffer from one format to another, with another PvBuffer to store the output. | |
Static Public Member Functions | |
| static bool | IsConversionSupported (PvPixelType aSource, PvPixelType aDestination) |
| Test if a pixel type can be converted to another type. | |
Used to convert a PvBuffer to another pixel type.
To change an image's format:
- Acquire an image. See #PvStream::RetrieveBuffer.
- Create an image-format converter (#PvCudaBufferConverter object). Use
#PvCudaBufferConverter::PvCudaBufferConverter.
- Test if you can convert your image to your preferred pixel type. Use
#PvCudaBufferConverter::IsConversionSupported.
For your source pixel type, use #PvImage::GetPixelType; for your destination, select an
enumeration from PvPixelType.h.
- Create a destination PvBuffer if your later task need to be done on CPU side, or
PvCudaBuffer if on GPU side.
See #PvBuffer and #PvCudaBuffer (you define the destination image's pixel type during
this step).
- Optionally, configure options like Bayer filtering, use #SetCudaBayerFilter.
- 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.
| PvResult PvCudaBufferConverter::Convert | ( | const PvBuffer * | aSource, |
| PvBuffer * | aDestination, | ||
| bool | aEnableCudaUVM | ||
| ) |
| PvResult PvCudaBufferConverter::Convert | ( | const PvBuffer * | aSource, |
| PvCudaBuffer * | aCudaDestination, | ||
| bool | aEnableCudaUVM | ||
| ) |
Convert a PvBuffer from one format to another, with another PvBuffer to store the output.
| [in] | aSource | The original PvBuffer. |
| [out] | aCudaDestination | The new PvCudaBuffer. |
| [in] | aEnableCudaUVM | Allow allocating CUDA UVM for conversion. |
| PvCudaBayerFilterType PvCudaBufferConverter::GetCudaBayerFilter | ( | ) | const |
Retrieves current optional Bayer filtering.
See #SetBayerFilter
|
static |
Test if a pixel type can be converted to another type.
Converting from one pixel type to another isn't a trivial mathematical calculation - all conversions require specialized, dedicated algorithms.
The IsConversionSupported method tests if the Convert method has an available conversion algorithm.
| [in] | aSource | The original pixel type. For available pixel types, see PvPixelType.h. |
| [in] | aDestination | The new pixel type. See aSource. |
| PvResult PvCudaBufferConverter::SetCudaBayerFilter | ( | PvCudaBayerFilterType | aFilter | ) |
Set the optional Bayer filtering for this converter.
Of course, only applies if the Convert method uses a PvBuffer having a Bayer pixel type. Simply ignored otherwise.
| [in] | aFilter | The new filter settings; a PvCudaBayerFilterType enumeration. |
Copyright (c) 2002-2026 Pleora Technologies Inc.
www.pleora.com