ConvertFormat

Function Usage

CSC API of the ImageProcessor class. The Image memory allocated by this API does not need to be managed or destroyed by users. Only Atlas inference product and Atlas 800I A2 inference product support this API.

For details, see CSC.

Prototype

1
APP_ERROR ImageProcessor::ConvertFormat(const Image& inputImage, const ImageFormat  outputFormat, Image& outputImage);

Parameters

Parameter

Input/Output

Description

inputImage

Input

Image class before conversion.

The Image class obtained by the Decode API and other VPC APIs can be directly used as inputs.

  • Supported input formats of the Image class: YUV_SP_420, YVU_SP_420, RGB_888, and BGR_888.
  • The original input size range of the Image class is [32 x 6, 4096 x 4096].

outputFormat

Input

Supported CSC output formats: YUV_SP_420, YVU_SP_420, RGB_888, and BGR_888.

  • The output width of the Image class is a multiple of 16, and its output height is a multiple of 2. So the size range is [32 x 6, 4096 x 4096].
  • The output width and height of the Image class must be the same as the input Image class.
  • Ensure that the formats before and after the conversion are different.

outputImage

Output

Output image after conversion.

Response Parameters

Data Structure

Description

APP_ERROR

For details about the returned error codes, see APP_ERROR Description.