DRAW OSD API

[中文]

Overview

API Reference

Header File

Functions

avdk_err_t bk_draw_osd_array(bk_draw_osd_ctlr_handle_t handle, osd_bg_info_t *bg_info, const blend_info_t *info)

draw osd array

Parameters
  • handle – osd controller handle

  • bg_info – osd background info

  • info – osd info

Returns

avdk_err_t

avdk_err_t bk_draw_osd_image(bk_draw_osd_ctlr_handle_t handle, osd_bg_info_t *bg_info, const blend_info_t *info)

draw osd image

draw osd image

Parameters
  • handle – osd controller handle

  • bg_info – osd background info

  • info – osd info

  • handle – osd controller handle

  • bg_info – osd background info

  • info – osd info

Returns

avdk_err_t

Returns

avdk_err_t

avdk_err_t bk_draw_osd_font(bk_draw_osd_ctlr_handle_t handle, osd_bg_info_t *bg_info, const blend_info_t *info)

draw osd font

Parameters
  • handle – osd controller handle

  • bg_info – osd background info

  • info – osd info

Returns

avdk_err_t

avdk_err_t bk_draw_osd_add_or_updata(bk_draw_osd_ctlr_handle_t handle, const char *name, const char *content)

add or updata osd info

Parameters
  • handle – osd controller handle

  • name – osd name

  • content – osd content

Returns

avdk_err_t

avdk_err_t bk_draw_osd_ioctl(bk_draw_osd_ctlr_handle_t handle, uint32_t ioctl_cmd, uint32_t param1, uint32_t param2, uint32_t param3)

osd controller ioctl

Parameters
  • handle – osd controller handle

  • ioctl_cmd – ioctl command

  • param1 – ioctl param1

  • param2 – ioctl param2

  • param3 – ioctl param3

Returns

avdk_err_t

avdk_err_t bk_draw_osd_delete(bk_draw_osd_ctlr_handle_t handle)

delete osd controller

Parameters

handle – osd controller handle

Returns

avdk_err_t

avdk_err_t bk_draw_osd_new(bk_draw_osd_ctlr_handle_t *handle, osd_ctlr_config_t *config)

create osd controller

Parameters
  • handle – osd controller handle

  • config – osd controller config

Returns

avdk_err_t

avdk_err_t bk_draw_osd_remove(bk_draw_osd_ctlr_handle_t handle, const char *name)

remove osd info

Parameters
  • handle – osd controller handle

  • name – osd name

Returns

avdk_err_t

API Typedefs

Header File

Structures

struct blend_image_t

Public Members

uint8_t format

data_format_t, should be ARGB8888

uint32_t data_len

ARGB8888 image size, should be: (xsize * ysize * 4) (no used)

const uint8_t *data

ARGB8888 image data

struct blend_font_t

Public Members

const gui_font_digit_struct *font_digit_type

character database

uint32_t color

font color value used by RGB565 date

struct bk_blend_t

Public Members

uint8_t version

version

blend_type_t blend_type

0: image, 1:font

const char name[MAX_BLEND_NAME_LEN]

image name like “wifi”,”clock”, “weather”

uint32_t width

icon width

uint32_t height

icon height

uint32_t icon_width

icon width

uint32_t icon_height

icon height

uint32_t bg_width

background window width

uint32_t bg_height

background window height

uint16_t xpos

icon x pos based on background window

uint16_t ypos

icon y pos based on background window

struct blend_info_t

Public Members

char name[MAX_BLEND_NAME_LEN]

name like “wifi”,”clock”, “weather”

const bk_blend_t *addr

the pointer, pointer to the struct

char content[MAX_BLEND_CONTENT_LEN]

content like “wifi0”, “12:00”,”v 1.0.0”

struct dynamic_array_t

Public Members

blend_info_t *entry

the pointer, pointer to the struct array

size_t size

the size of the struct array

size_t capacity

the capacity of the struct array

struct osd_ctlr_config_t

Public Members

const blend_info_t *blend_assets

the pointer, pointer to the struct all blend assetsarray

const blend_info_t *blend_info

the pointer, pointer to current blend info

bool draw_in_psram

true: use PSRAM, false: use SRAM

struct osd_bg_info_t

Public Members

frame_buffer_t *frame

the pointer, pointer to the struct frame buffer

uint16_t width

osd draw visible width

uint16_t height

osd draw visible height

struct bk_draw_osd_ctlr

Macros

MAX_BLEND_NAME_LEN
MAX_BLEND_CONTENT_LEN

Type Definitions

typedef struct bk_draw_osd_ctlr *bk_draw_osd_ctlr_handle_t
typedef struct bk_draw_osd_ctlr bk_draw_osd_ctlr_t

Enumerations

enum osd_ioctl_cmd_t

Values:

enumerator OSD_CTLR_CMD_SET_PSRAM_USAGE

set use psram

enumerator OSD_CTLR_CMD_GET_PSRAM_USAGE

get psram usage status

enumerator OSD_CTLR_CMD_GET_ALL_ASSETS

get all blend_info

enumerator OSD_CTLR_CMD_GET_DRAW_INFO

get current blend osd info

enum blend_type_t

Values:

enumerator BLEND_TYPE_IMAGE

image type

enumerator BLEND_TYPE_FONT

font type