1 /**
2  * @file lv_draw_arc.h
3  *
4  */
5 
6 #ifndef LV_DRAW_ARC_H
7 #define LV_DRAW_ARC_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_color_t color;
30     lv_coord_t width;
31     uint16_t start_angle;
32     uint16_t end_angle;
33     const void * img_src;
34     lv_opa_t opa;
35     lv_blend_mode_t blend_mode  : 2;
36     uint8_t rounded : 1;
37 } lv_draw_arc_dsc_t;
38 
39 struct _lv_draw_ctx_t;
40 
41 /**********************
42  * GLOBAL PROTOTYPES
43  **********************/
44 
45 void lv_draw_arc_dsc_init(lv_draw_arc_dsc_t * dsc);
46 
47 /**
48  * Draw an arc. (Can draw pie too with great thickness.)
49  * @param center_x      the x coordinate of the center of the arc
50  * @param center_y      the y coordinate of the center of the arc
51  * @param radius        the radius of the arc
52  * @param mask          the arc will be drawn only in this mask
53  * @param start_angle   the start angle of the arc (0 deg on the bottom, 90 deg on the right)
54  * @param end_angle     the end angle of the arc
55  * @param clip_area     the arc will be drawn only in this area
56  * @param dsc           pointer to an initialized `lv_draw_line_dsc_t` variable
57  */
58 void lv_draw_arc(struct _lv_draw_ctx_t * draw_ctx, const lv_draw_arc_dsc_t * dsc, const lv_point_t * center,
59                  uint16_t radius,  uint16_t start_angle, uint16_t end_angle);
60 
61 /**
62  * Get an area the should be invalidated when the arcs angle changed between start_angle and end_ange
63  * @param x             the x coordinate of the center of the arc
64  * @param y             the y coordinate of the center of the arc
65  * @param radius        the radius of the arc
66  * @param start_angle   the start angle of the arc (0 deg on the bottom, 90 deg on the right)
67  * @param end_angle     the end angle of the arc
68  * @param w             width of the arc
69  * @param rounded       true: the arc is rounded
70  * @param area          store the area to invalidate here
71  */
72 void lv_draw_arc_get_area(lv_coord_t x, lv_coord_t y, uint16_t radius,  uint16_t start_angle, uint16_t end_angle,
73                           lv_coord_t w, bool rounded, lv_area_t * area);
74 
75 /**********************
76  *      MACROS
77  **********************/
78 
79 #ifdef __cplusplus
80 } /*extern "C"*/
81 #endif
82 
83 #endif /*LV_DRAW_ARC_H*/
84