acl.himpi.sys_get_image_align_info

C Prototype

hi_s32 hi_mpi_sys_get_image_align_info(const hi_module_type mod_type[], const hi_u32 mod_num, const hi_img_base_info *img_base_info, hi_img_align_info *img_align_info)

Python Function

img_align_info, ret = acl.himpi.sys_get_image_align_info(mod_type, mod_num, img_base_info)

Function Usage

Calculates the aligned width and height and the buffer size for storing image data based on the module and image width and height.

The Atlas 200/300/500 Inference Product does not support this API.

The Atlas Training Series Product does not support this API.

Input Description

mod_type: list, module type list. The module type is an integer constant. For details, see hi_module_type.

  • If there is only one module in the array, the system computes the alignment value of the module.
  • If there are multiple modules in the array, the system computes the maximum alignment value among the modules.
  • If the module type is set to HI_MOD_ALL, the system selects the maximum alignment value from all modules for compute. This simplifies the understanding of the alignment differences between modules and is easy to operate, but may occupy a large amount of memory.

mod_num: int, length of the module type array.

img_base_info: dict, image basic information dictionary. For details, see hi_img_base_info.

Return Value

img_align_info: dict, dictionary of the image alignment information and memory size. For details, see hi_img_align_info.

ret: int, error code.

Restrictions

  • The width and height of the image cannot be less than the minimum width and height or exceed the maximum width and height of the module. The image format must be supported by the module.
  • For details about the image formats and alignment requirements supported by each module, see the restrictions in VPC APIs, VDEC/JPEGD APIs, VENC/JPEGE APIs, and PNGD APIs. The HI_PIXEL_FORMAT_UNKNOWN image format is not supported.