acldvppJpegGetImageInfoV2

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

x

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

√

Atlas inference products

√

Atlas training products

√

Function

Reads the width, height, color channel count, and format of a JPEG image from the buffer that stores the JPEG image data.

This API checks whether the image format supports decoding. For an unsupported stream, the API returns the error code ACL_ERROR_UNSUPPORTED_JPEG. For details, see aclError.

Prototype

1
2
3
4
5
6
aclError acldvppJpegGetImageInfoV2(const void *data,
uint32_t size,
uint32_t *width,
uint32_t *height,
int32_t *components,
acldvppJpegFormat *format)

Parameters

Parameter

Input/Output

Description

data

Input

Pointer to the address of the buffer that stores the JPEG image.

size

Input

Buffer size in bytes.

width

Output

Pointer to the image width.

height

Output

Pointer to the image height.

components

Output

Pointer to the number of color channels.

format

Output

Pointer to the source format. For details, see acldvppJpegFormat.

Returns

0: The information is obtained successfully. Other values: The information fails to be obtained. For details, see aclError.