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 /********************* 20 * DEFINES 21 *********************/ 22 #if LV_COLOR_DEPTH < 32 && LV_DITHER_GRADIENT == 1 23 #define _DITHER_GRADIENT 1 24 #else 25 #define _DITHER_GRADIENT 0 26 #endif 27 28 /********************** 29 * TYPEDEFS 30 **********************/ 31 #if _DITHER_GRADIENT 32 /*A signed error color component*/ 33 typedef struct { 34 int8_t r, g, b; 35 } lv_scolor24_t; 36 37 struct _lv_gradient_cache_t; 38 typedef void (*lv_dither_func_t)(struct _lv_gradient_cache_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w); 39 40 #endif 41 42 43 /********************** 44 * PROTOTYPES 45 **********************/ 46 #if LV_DRAW_COMPLEX 47 #if _DITHER_GRADIENT 48 LV_ATTRIBUTE_FAST_MEM void lv_dither_none(struct _lv_gradient_cache_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w); 49 50 LV_ATTRIBUTE_FAST_MEM void lv_dither_ordered_hor(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, 51 const lv_coord_t y, const lv_coord_t w); 52 LV_ATTRIBUTE_FAST_MEM void lv_dither_ordered_ver(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, 53 const lv_coord_t y, const lv_coord_t w); 54 55 #if LV_DITHER_ERROR_DIFFUSION == 1 56 LV_ATTRIBUTE_FAST_MEM void lv_dither_err_diff_hor(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, 57 const lv_coord_t y, const lv_coord_t w); 58 LV_ATTRIBUTE_FAST_MEM void lv_dither_err_diff_ver(struct _lv_gradient_cache_t * grad, const lv_coord_t xs, 59 const lv_coord_t y, const lv_coord_t w); 60 #endif /* LV_DITHER_ERROR_DIFFUSION */ 61 62 #endif /* _DITHER_GRADIENT */ 63 #endif 64 65 66 #ifdef __cplusplus 67 } /*extern "C"*/ 68 #endif 69 70 #endif 71