hi_vpss_crop_info

Description

Defines the cropping information.

Prototype

typedef struct {
    hi_bool     enable;
    hi_coord    crop_mode;
    hi_rect     crop_rect;    
}hi_vpss_crop_info;

Members

Member

Description

enable

Whether to enable cropping.

The options are as follows:

  • HI_FALSE: disabled.
  • HI_TRUE: enabled.

crop_mode

The start point coordinate mode of the cropped region.

crop_rect

Crops a rectangle area.

  • When crop_mode is set to relative coordinates, the value range of the coordinates of the cropped region is [0, 999], and the value range of the width and height of the cropped region is [1, 1000].
  • The size of the cropped region cannot be less than the minimum input resolution or greater than the maximum input resolution supported by the VPSS. If the cropping width is greater than the width of the input picture, the cropping output width is adjusted to the width of the input picture. If the cropping height is greater than the height of the input picture, the cropping output height is adjusted to the height of the input picture. The start point of the cropped region does not support negative coordinates. The right boundary of the cropped region cannot exceed the maximum input width supported by the VPSS, and the lower boundary of the cropped region cannot exceed the maximum input height supported by the VPSS.
  • If the cropping region exceeds the image range, move the cropping coordinates towards the origin to ensure that the width and height of the cropped region are the same as the configured parameters.
  • In relative coordinate mode:
    • The formula for calculating the horizontal coordinate is as follows: X = crop_rect.x x actual picture width/1000. After the calculation is complete, rounding and alignment are performed. This formula also applies to vertical coordinate calculation.
    • The region width is calculated as follows: Width = crop_rect.width x actual picture width/1000. After the calculation is complete, rounding and alignment are performed. This formula also applies to the region height.
    • If the width and height of the cropped region are less than the minimum resolution supported by the VPSS after calculation, the width and height of the cropped output region are adjusted to the width and height of the input picture, and a code indicating success is returned.
  • In absolute coordinate mode:
    • If the cropped width and height are less than the minimum input resolution supported by the VPSS, the cropping setting does not take effect and an error code indicating failure is returned.
    • If the cropped width and height are greater than the maximum input resolution supported by the VPSS, the cropping setting does not take effect and an error code indicating failure is returned.
    • If the sum of the coordinates of the cropped region and the cropped width and height exceeds the maximum input resolution supported by the VPSS, the cropping setting does not take effect and an error code indicating failure is returned.