hi_osd

Description

Defines the OSD parameters.

Prototype

typedef struct {
    hi_rect rect;
    hi_pixel_format pixel_format;
    hi_void* picture_address;
    hi_u32 stride;
    hi_u32 bg_alpha;
    hi_u32 fg_alpha;
    hi_osd_inverted_color osd_inverted_color;
} hi_osd;

Members

Member

Description

rect

OSD region coordinates.

pixel_format

OSD image format.

The format is as follows:

HI_PIXEL_FORMAT_ARGB_8888 = 14,    // ARGB8888
HI_PIXEL_FORMAT_ARGB_1555 = 33,    // ARGB1555 A: 1-bit R: 5-bit G: 5-bit B: 5-bit
HI_PIXEL_FORMAT_ARGB_4444 = 25,    // ARGB4444 A: 4-bit R: 4-bit G: 4-bit B: 4-bit
HI_PIXEL_FORMAT_ARGB_CLUT2 = 41,    // ARGB Color Lookup Table 2bit
HI_PIXEL_FORMAT_ARGB_CLUT4 = 42,     // ARGB Color Lookup Table 4bit

picture_address

OSD image address.

stride

OSD image stride.

  • For the HI_PIXEL_FORMAT_ARGB_8888 format, the stride value is four times of rect.width.
  • For the HI_PIXEL_FORMAT_ARGB_1555 or HI_PIXEL_FORMAT_ARGB_4444 format, the stride value is twice of rect.width.
  • For the HI_PIXEL_FORMAT_ARGB_CLUT2 format, the stride value is 1/4 of rect.width.
  • For the HI_PIXEL_FORMAT_ARGB_CLUT4 format, the stride value is half of rect.width.

bg_alpha

Background alpha.

Value range: [0, 255]

This parameter is mandatory only when the OSD image format is HI_PIXEL_FORMAT_ARGB_1555.

fg_alpha

Foreground alpha.

Value range: [0, 255]

This parameter is mandatory only when the OSD image format is HI_PIXEL_FORMAT_ARGB_1555.

osd_inverted_color

Color inversion type.