lv_draw_line.h
API reference for lv_draw_line.h
Summary
Functions
public/draw/lv_draw_line.h:95function
lv_draw_task_get_line_dsc
Try to get a line draw descriptor from a draw task.
lv_draw_line_dsc_t * lv_draw_task_get_line_dsc(lv_draw_task_t *task)| Name | Type | Description |
|---|---|---|
task | lv_draw_task_t * | draw task |
Returns: lv_draw_line_dsc_t * — the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_LINE
public/draw/lv_draw_line.h:88function
lv_draw_line_dsc_init
Initialize a line draw descriptor
void lv_draw_line_dsc_init(lv_draw_line_dsc_t *dsc)| Name | Type | Description |
|---|---|---|
dsc | lv_draw_line_dsc_t * | pointer to a draw descriptor |
public/draw/lv_draw_line.h:102function
lv_draw_line
Create a line draw task
void lv_draw_line(lv_layer_t *layer, const lv_draw_line_dsc_t *dsc)| Name | Type | Description |
|---|---|---|
layer | lv_layer_t * | pointer to a layer |
dsc | const lv_draw_line_dsc_t * | pointer to an initialized lv_draw_line_dsc_t variable |
public/draw/lv_draw_line.h:112function
lv_draw_line_iterate
A helper function to call a callback which draws a line between two points. This way it doesn't matter if p1, p2 or points were used as it calls the callback as needed.
void lv_draw_line_iterate(lv_draw_task_t *t, lv_draw_line_dsc_t *dsc, void(*draw_line_cb)(lv_draw_task_t *t, const lv_draw_line_dsc_t *dsc))| Name | Type | Description |
|---|---|---|
t | lv_draw_task_t * | draw task |
dsc | lv_draw_line_dsc_t * | pointer to a draw descriptor |
draw_line_cb | void(*)(lv_draw_task_t*t, constlv_draw_line_dsc_t *dsc) | a callback that draws a line between dsc->p1 and dsc->p2 |
Structs
struct
lv_draw_line_dsc_t
| Member | Type | Description |
|---|---|---|
base | lv_draw_dsc_base_t | |
p1 | lv_point_precise_t | The first point of the line. If LV_USE_FLOAT is enabled float number can be also used. Ignored if points are set |
p2 | lv_point_precise_t | The second point of the line. If LV_USE_FLOAT is enabled float number can be also used Ignored if points are set |
points | lv_point_precise_t * | Array of points to draw. If LV_USE_FLOAT is enabled, float numbers can also be used. |
point_cnt | int32_t | Number of points in the points |
color | lv_color_t | The color of the line |
width | int32_t | The width (thickness) of the line |
dash_width | int32_t | The length of a dash (0: don't dash) |
dash_gap | int32_t | The length of the gaps between dashes (0: don't dash) |
opa | lv_opa_t | Opacity of the line in 0...255 range. LV_OPA_TRANSP, LV_OPA_10, LV_OPA_20, .. LV_OPA_COVER can be used as well |
round_start | uint8_t | Make the line start rounded |
round_end | uint8_t | Make the line end rounded |
raw_end | uint8_t | 1: Do not bother with line ending (if it's not visible for any reason) |
Used by 12 functions
lv_obj_init_draw_line_dsc— paramdraw_dsclv_draw_line_dsc_init— paramdsclv_draw_line— paramdsclv_draw_line_iterate— paramdsclv_draw_line_iterate— paramdraw_line_cblv_draw_eve_line— paramdsclv_draw_nanovg_line— paramdsclv_draw_nema_gfx_line— paramdsclv_draw_dave2d_line— paramdsclv_draw_sdl_line— paramdsclv_draw_sw_line— paramdsclv_draw_vg_lite_line— paramdsc
Macros
LV_DRAW_LINE_POINT_NONE
#define LV_DRAW_LINE_POINT_NONE FLT_MAXDependencies
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