1 /**
2  * @file lv_draw_line.h
3  *
4  */
5 
6 #ifndef LV_DRAW_LINE_H
7 #define LV_DRAW_LINE_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 #include "../lv_conf_internal.h"
17 #include "../misc/lv_color.h"
18 #include "../misc/lv_area.h"
19 #include "../misc/lv_style.h"
20 
21 /*********************
22  *      DEFINES
23  *********************/
24 
25 /**********************
26  *      TYPEDEFS
27  **********************/
28 typedef struct {
29     lv_draw_dsc_base_t base;
30 
31     lv_point_precise_t p1;
32     lv_point_precise_t p2;
33     lv_color_t color;
34     int32_t width;
35     int32_t dash_width;
36     int32_t dash_gap;
37     lv_opa_t opa;
38     lv_blend_mode_t blend_mode  : 3;
39     uint8_t round_start : 1;
40     uint8_t round_end   : 1;
41     uint8_t raw_end     : 1;    /**< Do not bother with perpendicular line ending if it's not visible for any reason */
42 } lv_draw_line_dsc_t;
43 
44 /**********************
45  * GLOBAL PROTOTYPES
46  **********************/
47 
48 /**
49  * Initialize a line draw descriptor
50  * @param dsc       pointer to a draw descriptor
51  */
52 void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc);
53 
54 /**
55  * Try to get a line draw descriptor from a draw task.
56  * @param task      draw task
57  * @return          the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_LINE
58  */
59 lv_draw_line_dsc_t * lv_draw_task_get_line_dsc(lv_draw_task_t * task);
60 
61 /**
62  * Create a line draw task
63  * @param layer     pointer to a layer
64  * @param dsc       pointer to an initialized `lv_draw_line_dsc_t` variable
65  */
66 void lv_draw_line(lv_layer_t * layer, const lv_draw_line_dsc_t * dsc);
67 
68 /**********************
69  *      MACROS
70  **********************/
71 
72 #ifdef __cplusplus
73 } /*extern "C"*/
74 #endif
75 
76 #endif /*LV_DRAW_LINE_H*/
77