1 /** 2 * @file lv_circ.h 3 * 4 */ 5 6 #ifndef LV_CIRC_H 7 #define LV_CIRC_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 #include <stddef.h> 17 #include "lv_area.h" 18 19 /********************* 20 * DEFINES 21 *********************/ 22 #define LV_CIRC_OCT1_X(p) (p.x) 23 #define LV_CIRC_OCT1_Y(p) (p.y) 24 #define LV_CIRC_OCT2_X(p) (p.y) 25 #define LV_CIRC_OCT2_Y(p) (p.x) 26 #define LV_CIRC_OCT3_X(p) (-p.y) 27 #define LV_CIRC_OCT3_Y(p) (p.x) 28 #define LV_CIRC_OCT4_X(p) (-p.x) 29 #define LV_CIRC_OCT4_Y(p) (p.y) 30 #define LV_CIRC_OCT5_X(p) (-p.x) 31 #define LV_CIRC_OCT5_Y(p) (-p.y) 32 #define LV_CIRC_OCT6_X(p) (-p.y) 33 #define LV_CIRC_OCT6_Y(p) (-p.x) 34 #define LV_CIRC_OCT7_X(p) (p.y) 35 #define LV_CIRC_OCT7_Y(p) (-p.x) 36 #define LV_CIRC_OCT8_X(p) (p.x) 37 #define LV_CIRC_OCT8_Y(p) (-p.y) 38 39 /********************** 40 * TYPEDEFS 41 **********************/ 42 43 /********************** 44 * GLOBAL PROTOTYPES 45 **********************/ 46 47 /** 48 * Initialize the circle drawing 49 * @param c pointer to a point. The coordinates will be calculated here 50 * @param tmp point to a variable. It will store temporary data 51 * @param radius radius of the circle 52 */ 53 void lv_circ_init(lv_point_t * c, lv_coord_t * tmp, lv_coord_t radius); 54 55 /** 56 * Test the circle drawing is ready or not 57 * @param c same as in circ_init 58 * @return true if the circle is not ready yet 59 */ 60 bool lv_circ_cont(lv_point_t * c); 61 62 /** 63 * Get the next point from the circle 64 * @param c same as in circ_init. The next point stored here. 65 * @param tmp same as in circ_init. 66 */ 67 void lv_circ_next(lv_point_t * c, lv_coord_t * tmp); 68 69 /********************** 70 * MACROS 71 **********************/ 72 73 #ifdef __cplusplus 74 } /* extern "C" */ 75 #endif 76 77 #endif 78