feat(draw): add gradient dithering support (#2872)
* Add dithering to gradients * Add support for 8x8 matrix for ordered dithering * Fix CI errors * Try error diffusion on vertical gradient too * Vertical error diffusion dithering * Add support for runtime based dithering mode selection (from none, ordered, error diffusion). * Reduce the binary size of the code by sharing the dithering table when appropriate. * Fix CI * Fix CI * Review corrections * Fix union mapping * Revert bg_color changes * Fix for keeping bg_color in the API. * Fix after review * Add support for setting multiple stops per gradient in the style API * Let's make an example Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
@@ -232,6 +232,22 @@ void lv_style_set_bg_grad_stop(lv_style_t * style, lv_coord_t value)
|
||||
lv_style_set_prop(style, LV_STYLE_BG_GRAD_STOP, v);
|
||||
}
|
||||
|
||||
void lv_style_set_bg_gradient(lv_style_t * style, const lv_gradient_t * value)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.ptr = value
|
||||
};
|
||||
lv_style_set_prop(style, LV_STYLE_BG_GRADIENT, v);
|
||||
}
|
||||
|
||||
void lv_style_set_bg_dither_mode(lv_style_t * style, lv_dither_mode_t value)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
.num = (int32_t)value
|
||||
};
|
||||
lv_style_set_prop(style, LV_STYLE_BG_DITHER_MODE, v);
|
||||
}
|
||||
|
||||
void lv_style_set_bg_img_src(lv_style_t * style, const void * value)
|
||||
{
|
||||
lv_style_value_t v = {
|
||||
|
||||
Reference in New Issue
Block a user