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, cudaStream_t stream, NVCVImageHandle const in, NVCVImageHandle out)
Submits the ConvertImageFormat operator to a CUDA stream.
- NVCVStatus pvaConvertImageFormatSubmit(NVCVOperatorHandle handle, cupvaStream_t stream, NVCVImageHandle const in, NVCVImageHandle out)
Submits the ConvertImageFormat operator to a cuPVA stream.
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
NV12_ER
YUYV
UYVY
VYUY
YUV8p
BGR8
RGB8
BGRA8
RGBA8
BGR8p
RGB8p
NV12
-
-
-
-
-
-
yes
yes
-
-
yes
yes
NV12_ER
-
-
-
-
-
-
yes
yes
-
yes
-
-
YUYV
yes
yes
-
-
-
-
yes
yes
-
-
yes
yes
UYVY
yes
yes
-
-
-
-
yes
yes
-
-
yes
yes
VYUY
yes
yes
-
-
-
-
yes
yes
-
-
yes
yes
YUV8p
yes
yes
yes
yes
yes
-
-
-
-
-
-
-
BGR8
yes
-
yes
yes
yes
-
-
-
yes
-
-
-
RGB8
yes
-
yes
yes
yes
-
-
-
-
yes
-
-
BGRA8
-
-
-
-
-
-
yes
-
-
-
-
-
RGBA8
-
-
-
-
-
-
-
yes
-
-
-
-
BGR8p
yes
-
yes
yes
yes
-
-
-
-
-
-
-
RGB8p
yes
-
yes
yes
yes
-
-
-
-
-
-
-
NOTES:
NV12_ERis the BT.601 full-range (0-255 luma, 0-255 chroma) variant of NV12. Exposed paths: YUV → NV12_ER (chroma resample) and NV12_ER → RGB8 / BGR8 / RGBA8 (full-range YUV→RGB, no Y-16 offset). The reverse RGB/BGR → NV12_ER and the planar NV12_ER → RGB8p/BGR8p paths are still pending and tracked as a follow-up.For RGBA8 / BGRA8 output, alpha is set to 255 in every pixel.
RGBA8 -> RGB8andBGRA8 -> BGR8are single-pass (the alpha lane is dropped).Single-pass studio-range
NV12 -> RGBA8is not yet supported; chainNV12 -> RGB8 -> RGBA8(the full-rangeNV12_ER -> RGBA8path is direct).
- 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,
- cudaStream_t stream,
- NVCVImageHandle const in,
- NVCVImageHandle out,
Submits the ConvertImageFormat operator to a CUDA stream.
Note
CUDA stream support requirements:
PVA SDK 2.7.0 or later
Jetpack 7 or later
DriveOS 7 or later
x86 Emulator is not supported
- Parameters:
handle – [in] Handle to the operator.
stream – [in] Handle to a valid CUDA 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.
- NVCVStatus pvaConvertImageFormatSubmit(
- NVCVOperatorHandle handle,
- cupvaStream_t stream,
- NVCVImageHandle const in,
- NVCVImageHandle out,
Submits the ConvertImageFormat operator to a cuPVA stream.
- 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.