Functions | |
VPIStatus | vpiSubmitImageFormatConverter (VPIStream stream, 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.
VPIStatus vpiSubmitImageFormatConverter | ( | VPIStream | stream, |
VPIImage | input, | ||
VPIImage | output, | ||
VPIConversionPolicy | convPolicy, | ||
float | scale, | ||
float | offset | ||
) |
#include <vpi/algo/ImageFormatConverter.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_{[min_{out},max_{out}]}(in(x,y)*\alpha + \beta) \]
where:
float to integer conversion does returns the nearest integer number, rounding halfway cases away from zero.
stream | [in] a stream handle |
input | [in] input image |
output | [out] output image with the desied type |
convPolicy | [in] conversion policy to be used |
scale | [in] Scaling factor. Pass 1 for no scaling. |
offset | [in] Offset factor. Pass 0 for no offset. |