mikroSDK Reference Manual
lv_draw_sw_gradient.h
Go to the documentation of this file.
1
6#ifndef LV_DRAW_SW_GRADIENT_H
7#define LV_DRAW_SW_GRADIENT_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
16#include "../../misc/lv_color.h"
17#include "../../misc/lv_style.h"
18#include "lv_draw_sw_dither.h"
19
20/*********************
21 * DEFINES
22 *********************/
23#if LV_GRADIENT_MAX_STOPS < 2
24#error LVGL needs at least 2 stops for gradients. Please increase the LV_GRADIENT_MAX_STOPS
25#endif
26
27
28/**********************
29 * TYPEDEFS
30 **********************/
31#if _DITHER_GRADIENT
32typedef lv_color32_t lv_grad_color_t;
33#else
34typedef lv_color_t lv_grad_color_t;
35#endif
36
40typedef struct _lv_gradient_cache_t {
41 uint32_t key;
43 uint32_t life : 30;
45 uint32_t filled : 1;
46 uint32_t not_cached: 1;
47 lv_color_t * map;
49 lv_coord_t alloc_size;
50 lv_coord_t size;
51#if _DITHER_GRADIENT
52 lv_color32_t * hmap;
54#if LV_DITHER_ERROR_DIFFUSION == 1
55 lv_scolor24_t * error_acc;
57 lv_coord_t w;
58#endif
59#endif
61
62
63/**********************
64 * PROTOTYPES
65 **********************/
72LV_ATTRIBUTE_FAST_MEM lv_grad_color_t lv_gradient_calculate(const lv_grad_dsc_t * dsc, lv_coord_t range,
73 lv_coord_t frac);
74
79void lv_gradient_set_cache_size(size_t max_bytes);
80
83
85lv_grad_t * lv_gradient_get(const lv_grad_dsc_t * gradient, lv_coord_t w, lv_coord_t h);
86
92
93#ifdef __cplusplus
94} /*extern "C"*/
95#endif
96
97#endif /*LV_DRAW_GRADIENT_H*/
void lv_gradient_free_cache(void)
struct _lv_gradient_cache_t lv_grad_t
lv_grad_t * lv_gradient_get(const lv_grad_dsc_t *gradient, lv_coord_t w, lv_coord_t h)
void lv_gradient_cleanup(lv_grad_t *grad)
LV_ATTRIBUTE_FAST_MEM lv_grad_color_t lv_gradient_calculate(const lv_grad_dsc_t *dsc, lv_coord_t range, lv_coord_t frac)
void lv_gradient_set_cache_size(size_t max_bytes)
Definition lv_draw_sw_gradient.h:40
lv_color_t * map
Definition lv_draw_sw_gradient.h:47
lv_coord_t size
Definition lv_draw_sw_gradient.h:50
lv_coord_t alloc_size
Definition lv_draw_sw_gradient.h:49
uint32_t life
Definition lv_draw_sw_gradient.h:43
uint32_t filled
Definition lv_draw_sw_gradient.h:45
uint32_t key
Definition lv_draw_sw_gradient.h:41
uint32_t not_cached
Definition lv_draw_sw_gradient.h:46
Definition lv_style.h:155
Definition lv_color.h:224