lv_draw_rect.h
API reference for lv_draw_rect.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)| Name | Type | Description |
|---|---|---|
task | lv_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)| Name | Type | Description |
|---|---|---|
task | lv_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)| Name | Type | Description |
|---|---|---|
task | lv_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
lv_draw_rect_dsc_init
Initialize a rectangle draw descriptor.
void lv_draw_rect_dsc_init(lv_draw_rect_dsc_t *dsc)| Name | Type | Description |
|---|---|---|
dsc | lv_draw_rect_dsc_t * | pointer to a draw descriptor |
lv_draw_fill_dsc_init
Initialize a fill draw descriptor.
void lv_draw_fill_dsc_init(lv_draw_fill_dsc_t *dsc)| Name | Type | Description |
|---|---|---|
dsc | lv_draw_fill_dsc_t * | pointer to a draw descriptor |
lv_draw_fill
Fill an area
void lv_draw_fill(lv_layer_t *layer, const lv_draw_fill_dsc_t *dsc, const lv_area_t *coords)| Name | Type | Description |
|---|---|---|
layer | lv_layer_t * | pointer to a layer |
dsc | const lv_draw_fill_dsc_t * | pointer to an initialized draw descriptor variable |
coords | const lv_area_t * | the coordinates of the rectangle |
lv_draw_border_dsc_init
Initialize a border draw descriptor.
void lv_draw_border_dsc_init(lv_draw_border_dsc_t *dsc)| Name | Type | Description |
|---|---|---|
dsc | lv_draw_border_dsc_t * | pointer to a draw descriptor |
lv_draw_border
Draw a border
void lv_draw_border(lv_layer_t *layer, const lv_draw_border_dsc_t *dsc, const lv_area_t *coords)| Name | Type | Description |
|---|---|---|
layer | lv_layer_t * | pointer to a layer |
dsc | const lv_draw_border_dsc_t * | pointer to an initialized draw descriptor variable |
coords | const lv_area_t * | the coordinates of the rectangle |
lv_draw_box_shadow_dsc_init
Initialize a box shadow draw descriptor.
void lv_draw_box_shadow_dsc_init(lv_draw_box_shadow_dsc_t *dsc)| Name | Type | Description |
|---|---|---|
dsc | lv_draw_box_shadow_dsc_t * | pointer to a draw descriptor |
lv_draw_box_shadow
Draw a box shadow
void lv_draw_box_shadow(lv_layer_t *layer, const lv_draw_box_shadow_dsc_t *dsc, const lv_area_t *coords)| Name | Type | Description |
|---|---|---|
layer | lv_layer_t * | pointer to a layer |
dsc | const lv_draw_box_shadow_dsc_t * | pointer to an initialized draw descriptor variable |
coords | const lv_area_t * | the coordinates of the rectangle |
lv_draw_rect
The rectangle is a wrapper for fill, border, bg. image and box shadow. Internally fill, border, image and box shadow draw tasks will be created.
void lv_draw_rect(lv_layer_t *layer, const lv_draw_rect_dsc_t *dsc, const lv_area_t *coords)| Name | Type | Description |
|---|---|---|
layer | lv_layer_t * | pointer to a layer |
dsc | const lv_draw_rect_dsc_t * | pointer to an initialized draw descriptor variable |
coords | const lv_area_t * | the coordinates of the rectangle |
Structs
lv_draw_rect_dsc_t
| Member | Type | Description |
|---|---|---|
base | lv_draw_dsc_base_t | |
radius | int32_t | |
bg_image_src | const void * | |
bg_image_symbol_font | const void * | |
bg_image_recolor | lv_color_t | |
bg_image_opa | lv_opa_t | |
bg_image_recolor_opa | lv_opa_t | |
bg_image_tiled | uint8_t | |
bg_opa | lv_opa_t | |
border_opa | lv_opa_t | |
outline_opa | lv_opa_t | |
shadow_opa | lv_opa_t | |
bg_color | lv_color_t | First element of a gradient is a color, so it maps well here |
bg_grad | lv_grad_dsc_t | |
bg_image_colorkey | const lv_image_colorkey_t * | |
border_color | lv_color_t | |
border_width | int32_t | |
border_side | lv_border_side_t | |
border_post | uint8_t | |
outline_color | lv_color_t | |
outline_width | int32_t | |
outline_pad | int32_t | |
shadow_color | lv_color_t | |
shadow_width | int32_t | |
shadow_offset_x | int32_t | |
shadow_offset_y | int32_t | |
shadow_spread | int32_t |
Used by 3 functions
lv_obj_init_draw_rect_dsc— paramdraw_dsclv_draw_rect_dsc_init— paramdsclv_draw_rect— paramdsc
lv_draw_fill_dsc_t
| Member | Type | Description |
|---|---|---|
base | lv_draw_dsc_base_t | |
radius | int32_t | Radius, LV_RADIUS_CIRCLE for max. radius |
opa | lv_opa_t | Opacity in 0...255 range. LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well |
color | lv_color_t | The color of the rectangle. If the gradient is set (grad.dir!=LV_GRAD_DIR_NONE) it's ignored. |
grad | lv_grad_dsc_t | Describe a gradient. If grad.dir is not LV_GRAD_DIR_NONE color will be ignored |
Used by 10 functions
lv_draw_fill_dsc_init— paramdsclv_draw_fill— paramdsclv_draw_ppa_fill— paramdsclv_draw_eve_fill— paramdsclv_draw_nanovg_fill— paramdsclv_draw_nema_gfx_fill— paramdsclv_draw_dave2d_fill— paramdsclv_draw_sdl_fill— paramdsclv_draw_sw_fill— paramdsclv_draw_vg_lite_fill— paramdsc
lv_draw_border_dsc_t
| Member | Type | Description |
|---|---|---|
base | lv_draw_dsc_base_t | |
radius | int32_t | Radius, LV_RADIUS_CIRCLE for max. radius |
color | lv_color_t | The color of the border. |
width | int32_t | The width of the border in pixels |
opa | lv_opa_t | Opacity in 0...255 range. LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well |
side | lv_border_side_t | LV_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_border_dsc_init— paramdsclv_draw_border— paramdsclv_draw_eve_border— paramdsclv_draw_nanovg_border— paramdsclv_draw_nema_gfx_border— paramdsclv_draw_dave2d_border— paramdsclv_draw_sdl_border— paramdsclv_draw_sw_border— paramdsclv_draw_vg_lite_border— paramdsc
lv_draw_box_shadow_dsc_t
| Member | Type | Description |
|---|---|---|
base | lv_draw_dsc_base_t | |
radius | int32_t | Radius, LV_RADIUS_CIRCLE for max. radius |
color | lv_color_t | Color of shadow |
width | int32_t | Width of the shadow. (radius of the blur) |
spread | int32_t | Make the rectangle larger with this value in all directions. Can be negative too. |
ofs_x | int32_t | Offset the rectangle horizontally. |
ofs_y | int32_t | Offset the rectangle vertically. |
opa | lv_opa_t | Opacity in 0...255 range. LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well |
bg_cover | uint8_t | Set 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— paramdsclv_draw_box_shadow— paramdsclv_draw_nanovg_box_shadow— paramdsclv_draw_dave2d_box_shadow— paramdsclv_draw_sdl_box_shadow— paramdsclv_draw_sw_box_shadow— paramdsclv_draw_vg_lite_box_shadow— paramdsc
Macros
LV_RADIUS_CIRCLE
#define LV_RADIUS_CIRCLE 0x7FFFA very big radius to always draw as circle
Dependencies
Indirect dependencies
lv_anim.hlv_assert.hlv_bidi.hlv_color_op.hlv_conf_internal.hlv_draw_buf.hlv_event.hlv_ext_data.hlv_flex.hlv_font.hlv_grad.hlv_grid.hlv_image_dsc.hlv_layout.hlv_log.hlv_math.hlv_matrix.hlv_mem.hlv_palette.hlv_profiler.hlv_profiler_builtin.hlv_sprintf.hlv_string.hlv_style_gen.hlv_symbol_def.hlv_text.hlv_types.h
Last updated on