sys_get_image_align_info

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

x

Atlas inference products

Atlas 200I/500 A2 inference products

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.

Prototype

  • C Prototype
    1
    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
    1
    img_align_info, ret = acl.himpi.sys_get_image_align_info(mod_type, mod_num, img_base_info)
    

Parameter Description

Parameter

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 Description

Return Value

Description

img_align_info

Dict, dictionary of the image alignment information and memory size. For details, see hi_img_align_info.

ret

Int, error code.

0: success.

Other values: failures. For details, see Common Return Codes.

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.