1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

add arc drawing

This commit is contained in:
Gabor Kiss-Vamosi 2019-08-28 09:46:56 +02:00
parent 63935d283d
commit 3d72e3915b
5 changed files with 181 additions and 280 deletions

View File

@ -7,7 +7,7 @@
* INCLUDES * INCLUDES
*********************/ *********************/
#include "lv_draw_arc.h" #include "lv_draw_arc.h"
#include "../lv_misc/lv_math.h" #include "lv_mask.h"
/********************* /*********************
* DEFINES * DEFINES
@ -20,13 +20,6 @@
/********************** /**********************
* STATIC PROTOTYPES * STATIC PROTOTYPES
**********************/ **********************/
static uint16_t fast_atan2(int x, int y);
static void ver_line(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_coord_t len, lv_color_t color,
lv_opa_t opa);
static void hor_line(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_coord_t len, lv_color_t color,
lv_opa_t opa);
static bool deg_test_norm(uint16_t deg, uint16_t start, uint16_t end);
static bool deg_test_inv(uint16_t deg, uint16_t start, uint16_t end);
/********************** /**********************
* STATIC VARIABLES * STATIC VARIABLES
@ -51,221 +44,41 @@ static bool deg_test_inv(uint16_t deg, uint16_t start, uint16_t end);
* @param style style of the arc (`body.thickness`, `body.main_color`, `body.opa` is used) * @param style style of the arc (`body.thickness`, `body.main_color`, `body.opa` is used)
* @param opa_scale scale down all opacities by the factor * @param opa_scale scale down all opacities by the factor
*/ */
void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, const lv_area_t * mask, void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, const lv_area_t * clip_area,
uint16_t start_angle, uint16_t end_angle, const lv_style_t * style, lv_opa_t opa_scale) uint16_t start_angle, uint16_t end_angle, const lv_style_t * style, lv_opa_t opa_scale)
{ {
lv_coord_t thickness = style->line.width;
if(thickness > radius) thickness = radius;
lv_coord_t r_out = radius; lv_style_t circle_style;
lv_coord_t r_in = r_out - thickness; lv_style_copy(&circle_style, style);
int16_t deg_base; circle_style.body.radius = LV_RADIUS_CIRCLE;
int16_t deg; circle_style.body.opa = LV_OPA_TRANSP;
lv_coord_t x_start[4]; circle_style.body.border.width = style->line.width;
lv_coord_t x_end[4]; circle_style.body.border.color = style->line.color;
lv_color_t color = style->line.color;
lv_opa_t opa = opa_scale == LV_OPA_COVER ? style->body.opa : (uint16_t)((uint16_t)style->body.opa * opa_scale) >> 8;
bool (*deg_test)(uint16_t, uint16_t, uint16_t); lv_mask_param_t mask_angle_param;
if(start_angle <= end_angle) lv_mask_angle_init(&mask_angle_param, center_x, center_y, start_angle, end_angle);
deg_test = deg_test_norm;
else
deg_test = deg_test_inv;
if(deg_test(270, start_angle, end_angle)) int16_t mask_angle_id = lv_mask_add(lv_mask_angle, &mask_angle_param, NULL);
hor_line(center_x - r_out + 1, center_y, mask, thickness - 1, color, opa); /*Left Middle*/
if(deg_test(90, start_angle, end_angle))
hor_line(center_x + r_in, center_y, mask, thickness - 1, color, opa); /*Right Middle*/
if(deg_test(180, start_angle, end_angle))
ver_line(center_x, center_y - r_out + 1, mask, thickness - 1, color, opa); /*Top Middle*/
if(deg_test(0, start_angle, end_angle))
ver_line(center_x, center_y + r_in, mask, thickness - 1, color, opa); /*Bottom middle*/
uint32_t r_out_sqr = r_out * r_out;
uint32_t r_in_sqr = r_in * r_in;
int16_t xi;
int16_t yi;
for(yi = -r_out; yi < 0; yi++) {
x_start[0] = LV_COORD_MIN;
x_start[1] = LV_COORD_MIN;
x_start[2] = LV_COORD_MIN;
x_start[3] = LV_COORD_MIN;
x_end[0] = LV_COORD_MIN;
x_end[1] = LV_COORD_MIN;
x_end[2] = LV_COORD_MIN;
x_end[3] = LV_COORD_MIN;
for(xi = -r_out; xi < 0; xi++) {
uint32_t r_act_sqr = xi * xi + yi * yi; printf("s:%d, e:%d\n", start_angle, end_angle);
if(r_act_sqr > r_out_sqr) continue;
deg_base = fast_atan2(xi, yi) - 180;
deg = 180 + deg_base; lv_area_t area;
if(deg_test(deg, start_angle, end_angle)) { area.x1 = center_x - radius;
if(x_start[0] == LV_COORD_MIN) x_start[0] = xi; area.y1 = center_y - radius;
} else if(x_start[0] != LV_COORD_MIN && x_end[0] == LV_COORD_MIN) { area.x2 = center_x + radius;
x_end[0] = xi - 1; area.y2 = center_y + radius;
lv_draw_rect(&area, clip_area, &circle_style, LV_OPA_COVER);
lv_mask_remove_id(mask_angle_id);
} }
deg = 360 - deg_base;
if(deg_test(deg, start_angle, end_angle)) {
if(x_start[1] == LV_COORD_MIN) x_start[1] = xi;
} else if(x_start[1] != LV_COORD_MIN && x_end[1] == LV_COORD_MIN) {
x_end[1] = xi - 1;
}
deg = 180 - deg_base;
if(deg_test(deg, start_angle, end_angle)) {
if(x_start[2] == LV_COORD_MIN) x_start[2] = xi;
} else if(x_start[2] != LV_COORD_MIN && x_end[2] == LV_COORD_MIN) {
x_end[2] = xi - 1;
}
deg = deg_base;
if(deg_test(deg, start_angle, end_angle)) {
if(x_start[3] == LV_COORD_MIN) x_start[3] = xi;
} else if(x_start[3] != LV_COORD_MIN && x_end[3] == LV_COORD_MIN) {
x_end[3] = xi - 1;
}
if(r_act_sqr < r_in_sqr)
break; /*No need to continue the iteration in x once we found the inner edge of the
arc*/
}
if(x_start[0] != LV_COORD_MIN) {
if(x_end[0] == LV_COORD_MIN) x_end[0] = xi - 1;
hor_line(center_x + x_start[0], center_y + yi, mask, x_end[0] - x_start[0], color, opa);
}
if(x_start[1] != LV_COORD_MIN) {
if(x_end[1] == LV_COORD_MIN) x_end[1] = xi - 1;
hor_line(center_x + x_start[1], center_y - yi, mask, x_end[1] - x_start[1], color, opa);
}
if(x_start[2] != LV_COORD_MIN) {
if(x_end[2] == LV_COORD_MIN) x_end[2] = xi - 1;
hor_line(center_x - x_end[2], center_y + yi, mask, LV_MATH_ABS(x_end[2] - x_start[2]), color, opa);
}
if(x_start[3] != LV_COORD_MIN) {
if(x_end[3] == LV_COORD_MIN) x_end[3] = xi - 1;
hor_line(center_x - x_end[3], center_y - yi, mask, LV_MATH_ABS(x_end[3] - x_start[3]), color, opa);
}
#if LV_ANTIALIAS
/*TODO*/
#endif
}
}
static uint16_t fast_atan2(int x, int y)
{
// Fast XY vector to integer degree algorithm - Jan 2011 www.RomanBlack.com
// Converts any XY values including 0 to a degree value that should be
// within +/- 1 degree of the accurate value without needing
// large slow trig functions like ArcTan() or ArcCos().
// NOTE! at least one of the X or Y values must be non-zero!
// This is the full version, for all 4 quadrants and will generate
// the angle in integer degrees from 0-360.
// Any values of X and Y are usable including negative values provided
// they are between -1456 and 1456 so the 16bit multiply does not overflow.
unsigned char negflag;
unsigned char tempdegree;
unsigned char comp;
unsigned int degree; /*this will hold the result*/
unsigned int ux;
unsigned int uy;
/*Save the sign flags then remove signs and get XY as unsigned ints*/
negflag = 0;
if(x < 0) {
negflag += 0x01; /*x flag bit*/
x = (0 - x); /*is now +*/
}
ux = x; /*copy to unsigned var before multiply*/
if(y < 0) {
negflag += 0x02; /*y flag bit*/
y = (0 - y); /*is now +*/
}
uy = y; /*copy to unsigned var before multiply*/
/*1. Calc the scaled "degrees"*/
if(ux > uy) {
degree = (uy * 45) / ux; /*degree result will be 0-45 range*/
negflag += 0x10; /*octant flag bit*/
} else {
degree = (ux * 45) / uy; /*degree result will be 0-45 range*/
}
/*2. Compensate for the 4 degree error curve*/
comp = 0;
tempdegree = degree; /*use an unsigned char for speed!*/
if(tempdegree > 22) { /*if top half of range*/
if(tempdegree <= 44) comp++;
if(tempdegree <= 41) comp++;
if(tempdegree <= 37) comp++;
if(tempdegree <= 32) comp++; /*max is 4 degrees compensated*/
} else { /*else is lower half of range*/
if(tempdegree >= 2) comp++;
if(tempdegree >= 6) comp++;
if(tempdegree >= 10) comp++;
if(tempdegree >= 15) comp++; /*max is 4 degrees compensated*/
}
degree += comp; /*degree is now accurate to +/- 1 degree!*/
/*Invert degree if it was X>Y octant, makes 0-45 into 90-45*/
if(negflag & 0x10) degree = (90 - degree);
/*3. Degree is now 0-90 range for this quadrant,*/
/*need to invert it for whichever quadrant it was in*/
if(negflag & 0x02) { /*if -Y*/
if(negflag & 0x01) /*if -Y -X*/
degree = (180 + degree);
else /*else is -Y +X*/
degree = (180 - degree);
} else { /*else is +Y*/
if(negflag & 0x01) /*if +Y -X*/
degree = (360 - degree);
}
return degree;
}
/********************** /**********************
* STATIC FUNCTIONS * STATIC FUNCTIONS
**********************/ **********************/
static void ver_line(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_coord_t len, lv_color_t color, lv_opa_t opa)
{
lv_area_t area;
lv_area_set(&area, x, y, x, y + len);
lv_draw_fill(&area, mask, color, opa);
}
static void hor_line(lv_coord_t x, lv_coord_t y, const lv_area_t * mask, lv_coord_t len, lv_color_t color, lv_opa_t opa)
{
lv_area_t area;
lv_area_set(&area, x, y, x + len, y);
lv_draw_fill(&area, mask, color, opa);
}
static bool deg_test_norm(uint16_t deg, uint16_t start, uint16_t end)
{
if(deg >= start && deg <= end)
return true;
else
return false;
}
static bool deg_test_inv(uint16_t deg, uint16_t start, uint16_t end)
{
if(deg >= start || deg <= end) {
return true;
} else
return false;
}

View File

@ -393,7 +393,6 @@ void lv_draw_letter(const lv_point_t * pos_p, const lv_area_t * clip_area, const
mask_p = 0; mask_p = 0;
} }
col_bit += ((g.box_w - col_end) + col_start) * g.bpp; col_bit += ((g.box_w - col_end) + col_start) * g.bpp;
map_p += (col_bit >> 3); map_p += (col_bit >> 3);
@ -424,8 +423,6 @@ void lv_draw_letter(const lv_point_t * pos_p, const lv_area_t * clip_area, const
void lv_draw_map(const lv_area_t * map_area, const lv_area_t * clip_area, const uint8_t * map_p, lv_opa_t opa, void lv_draw_map(const lv_area_t * map_area, const lv_area_t * clip_area, const uint8_t * map_p, lv_opa_t opa,
bool chroma_key, bool alpha_byte, lv_color_t recolor, lv_opa_t recolor_opa) bool chroma_key, bool alpha_byte, lv_color_t recolor, lv_opa_t recolor_opa)
{ {
if(opa < LV_OPA_MIN) return; if(opa < LV_OPA_MIN) return;
if(opa > LV_OPA_MAX) opa = LV_OPA_COVER; if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;

View File

@ -249,7 +249,13 @@ lv_mask_res_t lv_mask_line(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs
} }
} }
else { else {
return LV_MASK_RES_FULL_TRANSP; if(abs_x + len < 0) return LV_MASK_RES_FULL_TRANSP;
else {
int32_t k = - abs_x;
if(k < 0) k = 0;
if(k >= 0 && k < len) memset(&mask_buf[00], 0x00,k);
return LV_MASK_RES_CHANGED;
}
} }
} }
} }
@ -272,14 +278,17 @@ void lv_mask_angle_init(lv_mask_param_t * param, lv_coord_t origo_x, lv_coord_t
lv_line_mask_side_t start_side; lv_line_mask_side_t start_side;
lv_line_mask_side_t end_side; lv_line_mask_side_t end_side;
p->delta_deg = LV_MATH_ABS(start_angle - end_angle); if(end_angle < start_angle) {
p->delta_deg = 360 - start_angle + end_angle;
} else {
p->delta_deg = LV_MATH_ABS(end_angle - start_angle);
}
p->start_angle = start_angle; p->start_angle = start_angle;
p->end_angle = end_angle; p->end_angle = end_angle;
p->origo.x = origo_x; p->origo.x = origo_x;
p->origo.y = origo_y; p->origo.y = origo_y;
/*The most simple case the, */
if(p->delta_deg <= 180) {
if(start_angle > 0 && start_angle < 180) { if(start_angle > 0 && start_angle < 180) {
start_side = LV_LINE_MASK_SIDE_LEFT; start_side = LV_LINE_MASK_SIDE_LEFT;
} }
@ -293,7 +302,6 @@ void lv_mask_angle_init(lv_mask_param_t * param, lv_coord_t origo_x, lv_coord_t
else if(end_angle > 180 && end_angle < 360) { else if(end_angle > 180 && end_angle < 360) {
end_side = LV_LINE_MASK_SIDE_LEFT; end_side = LV_LINE_MASK_SIDE_LEFT;
} }
}
lv_mask_line_angle_init((lv_mask_param_t*)&p->start_line, origo_x, origo_y, start_angle, start_side); lv_mask_line_angle_init((lv_mask_param_t*)&p->start_line, origo_x, origo_y, start_angle, start_side);
lv_mask_line_angle_init((lv_mask_param_t*)&p->end_line, origo_x, origo_y, end_angle, end_side); lv_mask_line_angle_init((lv_mask_param_t*)&p->end_line, origo_x, origo_y, end_angle, end_side);
@ -302,21 +310,18 @@ void lv_mask_angle_init(lv_mask_param_t * param, lv_coord_t origo_x, lv_coord_t
lv_mask_res_t lv_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_coord_t len, lv_mask_param_t * param) lv_mask_res_t lv_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y, lv_coord_t len, lv_mask_param_t * param)
{ {
lv_mask_angle_param_t * p = &param->line; lv_mask_angle_param_t * p = &param->angle;
// if(p->delta_deg <= 180) {
// if((p->start_angle <= 180 && abs_y >= p->origo.y) ||
// (p->start_angle >= 180 && abs_y <= p->origo.y)) {
// }
if(abs_y < p->origo.y) {
// memset(mask_buf, 0x00, len);
return LV_MASK_RES_FULL_COVER;
}
lv_coord_t rel_y = abs_y - p->origo.y; lv_coord_t rel_y = abs_y - p->origo.y;
lv_coord_t rel_x = abs_x - p->origo.x; lv_coord_t rel_x = abs_x - p->origo.x;
if(p->start_angle < 180 && p->end_angle < 180 && p->start_angle != 0 && p->end_angle != 0 && p->start_angle > p->end_angle) {
if(abs_y < p->origo.y) {
return LV_MASK_RES_FULL_COVER;
}
/*Start angle mask can work only from the end of end angle mask */ /*Start angle mask can work only from the end of end angle mask */
lv_coord_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10; lv_coord_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10;
lv_coord_t start_angle_last= ((rel_y+1) * p->start_line.xy_steep) >> 10; lv_coord_t start_angle_last= ((rel_y+1) * p->start_line.xy_steep) >> 10;
@ -344,6 +349,91 @@ lv_mask_res_t lv_mask_angle(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t ab
if(res1 == res2) return res1; if(res1 == res2) return res1;
else return LV_MASK_RES_CHANGED; else return LV_MASK_RES_CHANGED;
} }
else if(p->start_angle > 180 && p->end_angle > 180 && p->start_angle > p->end_angle) {
if(abs_y > p->origo.y) {
return LV_MASK_RES_FULL_COVER;
}
/*Start angle mask can work only from the end of end angle mask */
lv_coord_t end_angle_first = (rel_y * p->end_line.xy_steep) >> 10;
lv_coord_t start_angle_last= ((rel_y+1) * p->start_line.xy_steep) >> 10;
/*Do not let the line end cross the origo else it will affect the opposite part*/
if(p->start_angle > 270 && p->start_angle <= 359 && start_angle_last < 0) start_angle_last = 0;
else if(p->start_angle > 0 && p->start_angle <= 90 && start_angle_last < 0) start_angle_last = 0;
else if(p->start_angle > 90 && p->start_angle < 270 && start_angle_last > 0) start_angle_last = 0;
if(p->end_angle > 270 && p->end_angle <= 359 && start_angle_last < 0) start_angle_last = 0;
else if(p->end_angle > 0 && p->end_angle <= 90 && start_angle_last < 0) start_angle_last = 0;
else if(p->end_angle > 90 && p->end_angle < 270 && start_angle_last > 0) start_angle_last = 0;
int32_t dist = (end_angle_first - start_angle_last) >> 1;
lv_mask_res_t res1 = LV_MASK_RES_FULL_COVER;
lv_mask_res_t res2 = LV_MASK_RES_FULL_COVER;
int32_t tmp = start_angle_last + dist - rel_x;
if(tmp > len) tmp = len;
if(tmp > 0) {
res1 = lv_mask_line(&mask_buf[0], abs_x, abs_y, tmp, (lv_mask_param_t*)&p->end_line);
if(res1 == LV_MASK_RES_FULL_TRANSP) {
memset(&mask_buf[0], 0x00, tmp);
}
}
if(tmp > len) tmp = len;
if(tmp < 0) tmp = 0;
res2 = lv_mask_line(&mask_buf[tmp], abs_x+tmp, abs_y, len-tmp, (lv_mask_param_t*)&p->start_line);
if(res2 == LV_MASK_RES_FULL_TRANSP) {
memset(&mask_buf[tmp], 0x00, len-tmp);
}
if(res1 == res2) return res1;
else return LV_MASK_RES_CHANGED;
}
else {
lv_mask_res_t res1 = LV_MASK_RES_FULL_COVER;
lv_mask_res_t res2 = LV_MASK_RES_FULL_COVER;
if(p->start_angle == 180) {
if(abs_y < p->origo.y) res1 = LV_MASK_RES_FULL_COVER;
else res1 = LV_MASK_RES_UNKNOWN;
}
else if(p->start_angle == 0) {
if(abs_y < p->origo.y) res1 = LV_MASK_RES_UNKNOWN;
else res1 = LV_MASK_RES_FULL_COVER;
}
else if((p->start_angle < 180 && abs_y < p->origo.y) ||
(p->start_angle > 180 && abs_y >= p->origo.y)) {
res1 = LV_MASK_RES_UNKNOWN;
}
else {
res1 = lv_mask_line(mask_buf, abs_x, abs_y, len, (lv_mask_param_t*)&p->start_line);
}
if(p->end_angle == 180) {
if(abs_y < p->origo.y) res2 = LV_MASK_RES_UNKNOWN;
else res2 = LV_MASK_RES_FULL_COVER;
}
else if(p->end_angle == 0) {
if(abs_y < p->origo.y) res2 = LV_MASK_RES_FULL_COVER;
else res2 = LV_MASK_RES_UNKNOWN;
}
else if((p->end_angle < 180 && abs_y < p->origo.y) ||
(p->end_angle > 180 && abs_y >= p->origo.y)) {
res2 = LV_MASK_RES_UNKNOWN;
}
else {
res2 = lv_mask_line(mask_buf, abs_x, abs_y, len, (lv_mask_param_t*)&p->end_line);
}
if(res1 == LV_MASK_RES_FULL_TRANSP || res2 == LV_MASK_RES_FULL_TRANSP) return LV_MASK_RES_FULL_TRANSP;
else if(res1 == LV_MASK_RES_UNKNOWN && res2 == LV_MASK_RES_UNKNOWN) return LV_MASK_RES_FULL_TRANSP;
else if(res1 == LV_MASK_RES_FULL_COVER && res2 == LV_MASK_RES_FULL_COVER) return LV_MASK_RES_FULL_COVER;
else return LV_MASK_RES_CHANGED;
}
}
void lv_mask_radius_init(lv_mask_param_t * param, const lv_area_t * rect, lv_coord_t radius, bool inv) void lv_mask_radius_init(lv_mask_param_t * param, const lv_area_t * rect, lv_coord_t radius, bool inv)
{ {

View File

@ -27,9 +27,10 @@ extern "C" {
**********************/ **********************/
enum { enum {
LV_MASK_RES_FULL_COVER,
LV_MASK_RES_FULL_TRANSP, LV_MASK_RES_FULL_TRANSP,
LV_MASK_RES_FULL_COVER,
LV_MASK_RES_CHANGED, LV_MASK_RES_CHANGED,
LV_MASK_RES_UNKNOWN
}; };
typedef uint8_t lv_mask_res_t; typedef uint8_t lv_mask_res_t;

View File

@ -181,11 +181,11 @@ void lv_preload_set_type(lv_obj_t * preload, lv_preload_type_t type)
a.var = preload; a.var = preload;
if(ext->anim_dir == LV_PRELOAD_DIR_FORWARD) { if(ext->anim_dir == LV_PRELOAD_DIR_FORWARD) {
/* Clockwise */ /* Clockwise */
a.start = 360;
a.end = 0;
} else {
a.start = 0; a.start = 0;
a.end = 360; a.end = 360;
} else {
a.start = 360;
a.end = 0;
} }
a.exec_cb = (lv_anim_exec_xcb_t)lv_preload_spinner_anim; a.exec_cb = (lv_anim_exec_xcb_t)lv_preload_spinner_anim;
a.path_cb = lv_anim_path_ease_in_out; a.path_cb = lv_anim_path_ease_in_out;
@ -202,11 +202,11 @@ void lv_preload_set_type(lv_obj_t * preload, lv_preload_type_t type)
b.var = preload; b.var = preload;
if(ext->anim_dir == LV_PRELOAD_DIR_FORWARD) { if(ext->anim_dir == LV_PRELOAD_DIR_FORWARD) {
/* Clockwise */ /* Clockwise */
b.start = 360 - ext->arc_length;
b.end = ext->arc_length;
} else {
b.start = ext->arc_length; b.start = ext->arc_length;
b.end = 360 - ext->arc_length; b.end = 360 - ext->arc_length;
} else {
b.start = 360 - ext->arc_length;
b.end = ext->arc_length;
} }
b.exec_cb = (lv_anim_exec_xcb_t)lv_preload_set_arc_length; b.exec_cb = (lv_anim_exec_xcb_t)lv_preload_set_arc_length;
b.path_cb = lv_anim_path_ease_in_out; b.path_cb = lv_anim_path_ease_in_out;
@ -227,11 +227,11 @@ void lv_preload_set_type(lv_obj_t * preload, lv_preload_type_t type)
a.var = preload; a.var = preload;
if(ext->anim_dir == LV_PRELOAD_DIR_FORWARD) { if(ext->anim_dir == LV_PRELOAD_DIR_FORWARD) {
/* Clockwise */ /* Clockwise */
a.start = 360;
a.end = 0;
} else {
a.start = 0; a.start = 0;
a.end = 360; a.end = 360;
} else {
a.start = 360;
a.end = 0;
} }
a.exec_cb = (lv_anim_exec_xcb_t)lv_preload_spinner_anim; a.exec_cb = (lv_anim_exec_xcb_t)lv_preload_spinner_anim;
a.path_cb = lv_anim_path_ease_in_out; a.path_cb = lv_anim_path_ease_in_out;