current position:Home>【 LVGL 】 animation animation path way is introduced

【 LVGL 】 animation animation path way is introduced

2022-11-24 23:07:49Evenurs

1. Introduction

The path in anim animation can be regarded as a calculation method from the start value to the end value.Every time the callback function of the anim animation is executed, the current value will be calculated according to the algorithm of the path first, and then the current value will be passed to the callback function for use.

2. Description of the effect of each path

/***Divide the initial value and the end value evenly according to the frequency, each assignment increases evenly, and the slope k=1*/lv_anim_value_t lv_anim_path_linear(const lv_anim_path_t * path, const lv_anim_t * a);/***In the initial stage, each assignment gradually increases until it reaches the average speed except the initial stage, the slope k=0->1 in the initial stage, and k=1 in other stages*/lv_anim_value_t lv_anim_path_ease_in(const lv_anim_path_t * path, const lv_anim_t * a);/***In the end stage, each assignment gradually decreases until it reaches 0 speed, the slope k=1->0 in the end stage, and k=1 in other stages*/lv_anim_value_t lv_anim_path_ease_out(const lv_anim_path_t * path, const lv_anim_t * a);/*** Gradually accelerate at the beginning stage, gradually decelerate at the end stage, and keep a constant speed in the middle stage.It can be understood as a car accelerating from a standstill to braking to decelerate*/lv_anim_value_t lv_anim_path_ease_in_out(const lv_anim_path_t * path, const lv_anim_t * a);/***In the end phase will slightly exceed the end value, similar to inertial buffer*/lv_anim_value_t lv_anim_path_overshoot(const lv_anim_path_t * path, const lv_anim_t * a);/***The whole stage is the deceleration stage. When the forward direction decreases to 0, the reverse small part increases and repeats three times.It can be understood as the rebound movement of the ball*/lv_anim_value_t lv_anim_path_bounce(const lv_anim_path_t * path, const lv_anim_t * a);/*** It is stipulated that the whole stage is divided into several sections, and the value of the endpoint of the section is assigned each time*/lv_anim_value_t lv_anim_path_step(const lv_anim_path_t * path, const lv_anim_t * a);

copyright notice
author[Evenurs],Please bring the original link to reprint, thank you.
https://en.chowdera.com/2022/328/202211242305595842.html

Random recommended