lv_draw_rect.h

API reference for lv_draw_rect.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_draw_rect_private.h

Functions

lv_draw_task_get_fill_dsc

Try to get a fill draw descriptor from a draw task.

 
lv_draw_fill_dsc_t * lv_draw_task_get_fill_dsc(lv_draw_task_t *task)
Parameters
NameTypeDescription
tasklv_draw_task_t *draw task

Returns: lv_draw_fill_dsc_t * — the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_FILL

lv_draw_task_get_border_dsc

Try to get a border draw descriptor from a draw task.

 
lv_draw_border_dsc_t * lv_draw_task_get_border_dsc(lv_draw_task_t *task)
Parameters
NameTypeDescription
tasklv_draw_task_t *draw task

Returns: lv_draw_border_dsc_t * — the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_BORDER

lv_draw_task_get_box_shadow_dsc

Try to get a box shadow draw descriptor from a draw task.

 
lv_draw_box_shadow_dsc_t * lv_draw_task_get_box_shadow_dsc(lv_draw_task_t *task)
Parameters
NameTypeDescription
tasklv_draw_task_t *draw task

Returns: lv_draw_box_shadow_dsc_t * — the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_BOX_SHADOW

Structs

struct

lv_draw_rect_dsc_t

MemberTypeDescription
baselv_draw_dsc_base_t
radiusint32_t
bg_image_srcconst void *
bg_image_symbol_fontconst void *
bg_image_recolorlv_color_t
bg_image_opalv_opa_t
bg_image_recolor_opalv_opa_t
bg_image_tileduint8_t
bg_opalv_opa_t
border_opalv_opa_t
outline_opalv_opa_t
shadow_opalv_opa_t
bg_colorlv_color_tFirst element of a gradient is a color, so it maps well here
bg_gradlv_grad_dsc_t
bg_image_colorkeyconst lv_image_colorkey_t *
border_colorlv_color_t
border_widthint32_t
border_sidelv_border_side_t
border_postuint8_t
outline_colorlv_color_t
outline_widthint32_t
outline_padint32_t
shadow_colorlv_color_t
shadow_widthint32_t
shadow_offset_xint32_t
shadow_offset_yint32_t
shadow_spreadint32_t
Used by 3 functions
  • lv_obj_init_draw_rect_dsc — param draw_dsc
  • lv_draw_rect_dsc_init — param dsc
  • lv_draw_rect — param dsc
struct

lv_draw_fill_dsc_t

MemberTypeDescription
baselv_draw_dsc_base_t
radiusint32_tRadius, LV_RADIUS_CIRCLE for max. radius
opalv_opa_tOpacity in 0...255 range. LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well
colorlv_color_tThe color of the rectangle. If the gradient is set (grad.dir!=LV_GRAD_DIR_NONE) it's ignored.
gradlv_grad_dsc_tDescribe a gradient. If grad.dir is not LV_GRAD_DIR_NONE color will be ignored
Used by 10 functions
  • lv_draw_ppa_fill — param dsc
  • lv_draw_eve_fill — param dsc
  • lv_draw_fill_dsc_init — param dsc
  • lv_draw_fill — param dsc
  • lv_draw_nanovg_fill — param dsc
  • lv_draw_nema_gfx_fill — param dsc
  • lv_draw_dave2d_fill — param dsc
  • lv_draw_sdl_fill — param dsc
  • lv_draw_sw_fill — param dsc
  • lv_draw_vg_lite_fill — param dsc
struct

lv_draw_border_dsc_t

MemberTypeDescription
baselv_draw_dsc_base_t
radiusint32_tRadius, LV_RADIUS_CIRCLE for max. radius
colorlv_color_tThe color of the border.
widthint32_tThe width of the border in pixels
opalv_opa_tOpacity in 0...255 range. LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well
sidelv_border_side_tLV_BORDER_SIDE_NONE/LEFT/RIGHT/TOP/BOTTOM/FULL. LV_BORDER_SIDE_INTERNAL is an information for upper layers and shouldn't be used here.
Used by 9 functions
  • lv_draw_eve_border — param dsc
  • lv_draw_border_dsc_init — param dsc
  • lv_draw_border — param dsc
  • lv_draw_nanovg_border — param dsc
  • lv_draw_nema_gfx_border — param dsc
  • lv_draw_dave2d_border — param dsc
  • lv_draw_sdl_border — param dsc
  • lv_draw_sw_border — param dsc
  • lv_draw_vg_lite_border — param dsc
struct

lv_draw_box_shadow_dsc_t

MemberTypeDescription
baselv_draw_dsc_base_t
radiusint32_tRadius, LV_RADIUS_CIRCLE for max. radius
colorlv_color_tColor of shadow
widthint32_tWidth of the shadow. (radius of the blur)
spreadint32_tMake the rectangle larger with this value in all directions. Can be negative too.
ofs_xint32_tOffset the rectangle horizontally.
ofs_yint32_tOffset the rectangle vertically.
opalv_opa_tOpacity in 0...255 range. LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well
bg_coveruint8_tSet bg_cover to 1 if the background will cover the shadow. It's a hint to the renderer about it might skip some masking.
Used by 7 functions
  • lv_draw_box_shadow_dsc_init — param dsc
  • lv_draw_box_shadow — param dsc
  • lv_draw_nanovg_box_shadow — param dsc
  • lv_draw_dave2d_box_shadow — param dsc
  • lv_draw_sdl_box_shadow — param dsc
  • lv_draw_sw_box_shadow — param dsc
  • lv_draw_vg_lite_box_shadow — param dsc

Macros

LV_RADIUS_CIRCLE

 
#define LV_RADIUS_CIRCLE 0x7FFF

A very big radius to always draw as circle

Dependencies

How is this guide?

Last updated on

On this page