Used to convert a PvBuffer to another pixel type. More...
Public Member Functions | |
PvBufferConverter (int32_t aMaxNumberOfThreads=-1) | |
Constructor. More... | |
virtual | ~PvBufferConverter () |
Destructor. | |
PvResult | Convert (const PvBuffer *aSource, PvBuffer *aDestination, bool aReallocIfNeeded=true, bool aFlipY=false) |
Convert a buffer from one format to another. More... | |
PvResult | Convert (const IPvImage *aSource, PvBuffer *aDestination, bool aReallocIfNeeded=true, bool aFlipY=false) |
Convert a buffer from one format to another. More... | |
PvBayerFilterType | GetBayerFilter () const |
Retrieves current optional Bayer filtering. More... | |
PvResult | SetBayerFilter (PvBayerFilterType aFilter) |
Set the optional Bayer filtering for this converter. More... | |
PvResult | ResetRGBFilter () |
Resets the RGB filter used for conversion (if any) More... | |
PvResult | SetRGBFilter (PvBufferConverterRGBFilter &aFilter) |
Assigns a RGB filter to be used during conversion. More... | |
uint32_t | GetConversionThreadsPriority () const |
Get the priority of the threads doing the conversion in background. More... | |
PvResult | SetConversionThreadsPriority (uint32_t aPriority) |
Set the priority of the threads doing the conversion. More... | |
Static Public Member Functions | |
static bool | IsConversionSupported (PvPixelType aSource, PvPixelType aDestination) |
Test if a pixel type can be converted to another type. More... | |
Used to convert a PvBuffer to another pixel type.
To change an image's format:
Consult the PvPixelType documentation in order to find which pixel types are supported as conversion destinations.
PvBufferConverter::PvBufferConverter | ( | int32_t | aMaxNumberOfThreads = -1 | ) |
Constructor.
[in] | 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. |
PvResult PvBufferConverter::Convert | ( | const PvBuffer * | aSource, |
PvBuffer * | aDestination, | ||
bool | aReallocIfNeeded = true , |
||
bool | aFlipY = false |
||
) |
Convert a buffer from one format to another.
[in] | aSource | The original image/buffer. |
[out] | aDestination | The new image/buffer. |
[in] | 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. |
[in] | aFlipY | When performing the conversion, flips the image on its Y axis. |
PvResult PvBufferConverter::Convert | ( | const IPvImage * | aSource, |
PvBuffer * | aDestination, | ||
bool | aReallocIfNeeded = true , |
||
bool | aFlipY = false |
||
) |
Convert a buffer from one format to another.
[in] | aSource | The original image. |
[out] | aDestination | The new image/buffer. |
[in] | 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. |
[in] | aFlipY | When performing the conversion, flips the image on its Y axis. |
PvBayerFilterType PvBufferConverter::GetBayerFilter | ( | ) | const |
Retrieves current optional Bayer filtering.
See SetBayerFilter
uint32_t PvBufferConverter::GetConversionThreadsPriority | ( | ) | const |
Get the priority of the threads doing the conversion in background.
See SetConversionThreadsPriority for details about the meaning of the values returned
|
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 PvBufferConverter::ResetRGBFilter | ( | ) |
Resets the RGB filter used for conversion (if any)
PvResult PvBufferConverter::SetBayerFilter | ( | PvBayerFilterType | 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 PvBayerFilterType enumeration. |
PvResult PvBufferConverter::SetConversionThreadsPriority | ( | uint32_t | aPriority | ) |
Set the priority of the threads doing the conversion.
By default one conversion thread is created for each processing core of the system. We only allow setting priority for the threads of one converter object as a group.
If you change the thread priorities, it may alterate the stability of the system. For this reason, if you report a bug to Pleora, ensure to clearly mention that you change threads priorities.
See GetConversionThreadsPriority
[in] | aPriority | See PvPipeline::SetBufferHandlingThreadPriority for description of the supported values |
PvResult PvBufferConverter::SetRGBFilter | ( | PvBufferConverterRGBFilter & | aFilter | ) |
Assigns a RGB filter to be used during conversion.
[in] | aFilter | The RGB filter to be used during conversion. |
Copyright (c) 2002-2021 Pleora Technologies Inc.
www.pleora.com