ConvertImageFormat#
Functions#
- NVCVStatus pvaConvertImageFormatCreate(NVCVOperatorHandle *handle, NVCVImageRequirements const *const inImageRequirements, NVCVImageRequirements const *const outImageRequirements)
Constructs an instance of the ConvertImageFormat operator.
- NVCVStatus pvaConvertImageFormatSubmit(NVCVOperatorHandle handle, cupvaStream_t stream, NVCVImageHandle const in, NVCVImageHandle out)
Executes the ConvertImageFormat operation on images.
Functions#
- NVCVStatus pvaConvertImageFormatCreate(
- NVCVOperatorHandle *handle,
- NVCVImageRequirements const *const inImageRequirements,
- NVCVImageRequirements const *const outImageRequirements,
Constructs an instance of the ConvertImageFormat operator.
Input: This structure must be filled by using nvcvImageCalcRequirementsPva().
Output: This structure must be filled by using nvcvImageCalcRequirementsPva().
Input/Output Dependency:
Property
Input == Output
Width
Yes
Height
Yes
Image format
No
The supported combinations of input and output image formats for conversion are shown in the following table. Rows represent the input image format and columns represent the output image format.
in/out
NV12
YUYV
UYVY
VYUY
YUV8p
BGR8
RGB8
BGRA8
BGR8p
RGB8p
NV12
-
-
-
-
-
yes
yes
-
yes
yes
YUYV
yes
-
-
-
-
yes
yes
-
yes
yes
UYVY
yes
-
-
-
-
yes
yes
-
yes
yes
VYUY
yes
-
-
-
-
yes
yes
-
yes
yes
YUV8p
yes
yes
yes
yes
-
-
-
-
-
-
BGR8
yes
yes
yes
yes
-
-
-
-
-
-
RGB8
yes
yes
yes
yes
-
-
-
yes
-
-
BGRA8
-
-
-
-
-
-
-
-
-
-
BGR8p
yes
yes
yes
yes
-
-
-
-
-
-
RGB8p
yes
yes
yes
yes
-
-
-
-
-
-
- Parameters:
handle – [out] Where the operator instance handle will be written to.
Must not be NULL.
inImageRequirements – [in] Pointer to the NVCVImageRequirements structure which contains input image width, height and format information.
outImageRequirements – [in] Pointer to the NVCVImageRequirements structure which contains output image width, height and format information.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Handle is null or some parameter is outside valid range.
NVCV_ERROR_OUT_OF_MEMORY – Not enough memory to create the operator.
NVCV_ERROR_INVALID_IMAGE_FORMAT – Image format is invalid.
NVCV_SUCCESS – Operation executed successfully.
- NVCVStatus pvaConvertImageFormatSubmit(
- NVCVOperatorHandle handle,
- cupvaStream_t stream,
- NVCVImageHandle const in,
- NVCVImageHandle out,
Executes the ConvertImageFormat operation on images.
- Parameters:
handle – [in] Handle to the operator.
Must not be NULL.
stream – [in] Handle to a valid CUPVA stream.
in – [in] Input image handle.
out – [out] Output image handle.
- Return values:
NVCV_ERROR_INVALID_ARGUMENT – Handle is null.
NVCV_ERROR_INTERNAL – Internal error in the operator, invalid types passed in.
NVCV_SUCCESS – Operation executed successfully.