1 /** 2 * @file lv_draw.h 3 * 4 */ 5 6 #ifndef LV_DRAW_H 7 #define LV_DRAW_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 #ifdef LV_CONF_INCLUDE_SIMPLE 17 #include "lv_conf.h" 18 #else 19 #include "../../lv_conf.h" 20 #endif 21 22 #include "../lv_core/lv_style.h" 23 #include "../lv_misc/lv_txt.h" 24 #include "lv_img_decoder.h" 25 26 /********************* 27 * DEFINES 28 *********************/ 29 30 /********************** 31 * TYPEDEFS 32 **********************/ 33 34 /********************** 35 * GLOBAL PROTOTYPES 36 **********************/ 37 38 /** 39 * Give a buffer with the given to use during drawing. 40 * Be careful to not use the buffer while other processes are using it. 41 * @param size the required size 42 */ 43 void * lv_draw_get_buf(uint32_t size); 44 45 /** 46 * Free the draw buffer 47 */ 48 void lv_draw_free_buf(void); 49 50 #if LV_ANTIALIAS 51 52 /** 53 * Get the opacity of a pixel based it's position in a line segment 54 * @param seg segment length 55 * @param px_id position of of a pixel which opacity should be get [0..seg-1] 56 * @param base_opa the base opacity 57 * @return the opacity of the given pixel 58 */ 59 lv_opa_t lv_draw_aa_get_opa(lv_coord_t seg, lv_coord_t px_id, lv_opa_t base_opa); 60 61 /** 62 * Add a vertical anti-aliasing segment (pixels with decreasing opacity) 63 * @param x start point x coordinate 64 * @param y start point y coordinate 65 * @param length length of segment (negative value to start from 0 opacity) 66 * @param mask draw only in this area 67 * @param color color of pixels 68 * @param opa maximum opacity 69 */ 70 void lv_draw_aa_ver_seg(lv_coord_t x, lv_coord_t y, lv_coord_t length, const lv_area_t * mask, lv_color_t color, 71 lv_opa_t opa); 72 73 /** 74 * Add a horizontal anti-aliasing segment (pixels with decreasing opacity) 75 * @param x start point x coordinate 76 * @param y start point y coordinate 77 * @param length length of segment (negative value to start from 0 opacity) 78 * @param mask draw only in this area 79 * @param color color of pixels 80 * @param opa maximum opacity 81 */ 82 void lv_draw_aa_hor_seg(lv_coord_t x, lv_coord_t y, lv_coord_t length, const lv_area_t * mask, lv_color_t color, 83 lv_opa_t opa); 84 #endif 85 86 /********************** 87 * GLOBAL VARIABLES 88 **********************/ 89 90 /********************** 91 * MACROS 92 **********************/ 93 94 /********************** 95 * POST INCLUDES 96 *********************/ 97 #include "lv_draw_basic.h" 98 #include "lv_draw_rect.h" 99 #include "lv_draw_label.h" 100 #include "lv_draw_img.h" 101 #include "lv_draw_line.h" 102 #include "lv_draw_triangle.h" 103 #include "lv_draw_arc.h" 104 105 #ifdef __cplusplus 106 } /* extern "C" */ 107 #endif 108 109 #endif /*LV_DRAW_H*/ 110