1 /** 2 * @file lv_draw_triangle.h 3 * 4 */ 5 6 #ifndef LV_DRAW_TRIANGLE_H 7 #define LV_DRAW_TRIANGLE_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 #include "lv_draw_rect.h" 17 18 /********************* 19 * DEFINES 20 *********************/ 21 22 /********************** 23 * TYPEDEFS 24 **********************/ 25 typedef struct { 26 lv_draw_dsc_base_t base; 27 28 lv_opa_t bg_opa; 29 lv_color_t bg_color; 30 lv_grad_dsc_t bg_grad; 31 32 lv_point_precise_t p[3]; 33 } lv_draw_triangle_dsc_t; 34 35 /********************** 36 * GLOBAL PROTOTYPES 37 **********************/ 38 39 /** 40 * Initialize a triangle draw descriptor 41 * @param draw_dsc pointer to a draw descriptor 42 */ 43 void lv_draw_triangle_dsc_init(lv_draw_triangle_dsc_t * draw_dsc); 44 45 /** 46 * Try to get a triangle draw descriptor from a draw task. 47 * @param task draw task 48 * @return the task's draw descriptor or NULL if the task is not of type LV_DRAW_TASK_TYPE_TRIANGLE 49 */ 50 lv_draw_triangle_dsc_t * lv_draw_task_get_triangle_dsc(lv_draw_task_t * task); 51 52 /** 53 * Create a triangle draw task 54 * @param layer pointer to a layer 55 * @param draw_dsc pointer to an initialized `lv_draw_triangle_dsc_t` object 56 */ 57 void lv_draw_triangle(lv_layer_t * layer, const lv_draw_triangle_dsc_t * draw_dsc); 58 59 /********************** 60 * MACROS 61 **********************/ 62 63 #ifdef __cplusplus 64 } /*extern "C"*/ 65 #endif 66 67 #endif /*LV_DRAW_TRIANGLE_H*/ 68