acl.himpi.png_get_image_info

C Prototype

hi_s32 hi_mpi_png_get_image_info(const hi_img_stream *png_stream, hi_img_info *img_info)

Python Function

img_info, ret = acl.himpi.png_get_image_info(png_stream)

Function Usage

Obtains the width, height, and source format of the input PNG image, the width stride and height stride of the output image, as well as the required buffer size based on the input stream.

The Atlas 200/300/500 Inference Product does not support this API in the current version.

The Atlas Training Series Product does not support this API in the current version.

Input Description

png_stream: dict, input stream information. For details, see hi_img_stream.

Return Value

img_info: dict, image information dictionary. For details, see hi_img_info.

ret: int, error code.

Restrictions

This API is provided to calculate the size of the buffer occupied by the decoded output image. Currently, only PNG images can be parsed. The obtained width_stride and height_stride must be rounded up to the nearest multiples of 128 and 16, respectively.