4#ifdef USE_LVGL_ANIMATION
31 if (value > 1.0f - this->moving_length_) {
94 float sqr = value * value;
95 sqr = sqr / (2.0f * (sqr - value) + 1.0f);
96 return this->
slope_ * sqr + (1.0 - this->
slope_) * value;
108 std::copy(from.begin(), from.end(), this->from_);
109 std::copy(to.begin(), to.end(), this->to_);
118 for (
size_t i = 0; i != DATA_SIZE; i++) {
138 if constexpr (AUTO_START)
146 float progress =
static_cast<float>(elapsed) /
static_cast<float>(this->
duration_);
156 if (progress >= 1.0f) {
167 for (
auto *timing : this->
timings_) {
168 progress = timing->map_progress(progress);
170 lv_coord_t data[DATA_SIZE];
171 for (
size_t i = 0; i != DATA_SIZE; i++) {
172 data[i] =
static_cast<lv_coord_t
>(
Primary TemplatableValue: stores either a constant value or a function pointer.
void add_timing(LvAnimationTiming *timing)
lv_coord_t data_to_[DATA_SIZE]
void(*const update_callback_)(const lv_coord_t *data)
LazyCallbackManager< void()> start_callback_
LazyCallbackManager< void()> stop_callback_
std::vector< LvAnimationTiming * > timings_
void set_duration(uint32_t duration)
TemplatableValue< lv_coord_t > to_[DATA_SIZE]
LvAnimation(void(*update_callback)(const lv_coord_t *data), std::vector< TemplatableValue< lv_coord_t > > from, std::vector< TemplatableValue< lv_coord_t > > to)
lv_coord_t data_from_[DATA_SIZE]
void set_start_delay(uint32_t start_delay)
float get_setup_priority() const override
void add_on_start_callback(F &&callback)
void add_on_stop_callback(F &&callback)
TemplatableValue< lv_coord_t > from_[DATA_SIZE]
LvAnimationTimingEaseInOut(float slope)
float map_progress(float value) override
LvAnimationTimingGravity(float acceleration, float bounce)
float map_progress(float value) override
float calc_end_time_() const
float calc_pos_(float value) const
float calc_speed_(float value) const
virtual float map_progress(float value)=0
LvAnimationTimingRoundTrip(float pause)
float map_progress(float value) override
constexpr float PROCESSOR
For components that use data from sensors like displays.
uint32_t IRAM_ATTR HOT millis()