Converts the image contents to the desired format, with optional scaling and offset. More...
Enumerations | |
enum | VPIConversionPolicy |
Policy used when converting between image types. More... | |
Functions | |
VPIStatus | vpiSubmitConvertImageFormat (VPIStream stream, VPIBackend backend, VPIImage input, VPIImage output, VPIConversionPolicy convPolicy, float scale, float offset) |
Converts the image contents to the desired format, with optional scaling and offset. More... | |
Converts the image contents to the desired format, with optional scaling and offset.
enum VPIConversionPolicy |
#include <vpi/Types.h>
Policy used when converting between image types.
VPIStatus vpiSubmitConvertImageFormat | ( | VPIStream | stream, |
VPIBackend | backend, | ||
VPIImage | input, | ||
VPIImage | output, | ||
VPIConversionPolicy | convPolicy, | ||
float | scale, | ||
float | offset | ||
) |
#include <vpi/algo/ConvertImageFormat.h>
Converts the image contents to the desired format, with optional scaling and offset.
The input and output types are inferred from the corresponding images passed as parameters. When scaling and offset are fractional, input is converted to 32-bit floating point prior conversion takes place. The formula that relates input and output pixels is:
\[ out(x,y) = clamp_{[\mathsf{min_{out}},\mathsf{max_{out}}]}(in(x,y)*\alpha + \beta) \]
where:
float to integer conversion does returns the nearest integer number, rounding halfway cases away from zero.
[in] | stream | A stream handle where the operation will be queued into. |
[in] | backend | The backend that will execute the algorithm. |
[in] | input | Input image to be converted. |
[out] | output | Output image where result will be written to, with the desired type. |
[in] | convPolicy | Conversion policy to be used. |
[in] | scale | Scaling factor. Pass 1 for no scaling. |
[in] | offset | Offset factor. Pass 0 for no offset. |