1 /** 2 * @file lv_draw_sw_dither.h 3 * 4 */ 5 6 #ifndef LV_DRAW_SW_DITHER_H 7 #define LV_DRAW_SW_DITHER_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 #include "../../core/lv_obj_pos.h" 17 18 /********************* 19 * DEFINES 20 *********************/ 21 #if LV_COLOR_DEPTH < 32 && LV_DITHER_GRADIENT == 1 22 #define _DITHER_GRADIENT 1 23 #else 24 #define _DITHER_GRADIENT 0 25 #endif 26 27 /********************** 28 * TYPEDEFS 29 **********************/ 30 #if _DITHER_GRADIENT 31 /*A signed error color component*/ 32 typedef struct { 33 int8_t r, g, b; 34 } lv_scolor24_t; 35 36 struct _lv_gradient_cache_t; 37 typedef void (*lv_dither_func_t)(struct _lv_gradient_cache_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w); 38 39 #endif 40 41 /********************** 42 * PROTOTYPES 43 **********************/ 44 #if LV_DRAW_COMPLEX 45 #if _DITHER_GRADIENT 46 void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_none(struct _lv_gradient_cache_t * grad, lv_coord_t x, lv_coord_t y, 47 lv_coord_t w); 48 49 void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_ordered_hor(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, 50 const lv_coord_t y, const lv_coord_t w); 51 void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_ordered_ver(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, 52 const lv_coord_t y, const lv_coord_t w); 53 54 #if LV_DITHER_ERROR_DIFFUSION == 1 55 void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_err_diff_hor(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, 56 const lv_coord_t y, const lv_coord_t w); 57 void /* LV_ATTRIBUTE_FAST_MEM */ lv_dither_err_diff_ver(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, 58 const lv_coord_t y, const lv_coord_t w); 59 #endif /* LV_DITHER_ERROR_DIFFUSION */ 60 61 #endif /* _DITHER_GRADIENT */ 62 #endif 63 64 #ifdef __cplusplus 65 } /*extern "C"*/ 66 #endif 67 68 #endif 69