4#ifdef USE_LVGL_ANIMATION
32 if (value > 1.0f - this->moving_length_) {
95 float sqr = value * value;
96 sqr = sqr / (2.0f * (sqr - value) + 1.0f);
97 return this->
slope_ * sqr + (1.0 - this->
slope_) * value;
108 const float sqr = value * value;
109 return this->
slope_ * sqr + (1.0f - this->
slope_) * value;
120 const float inv = 1.0f - value;
121 const float sqr = 1.0f - inv * inv;
122 return this->
slope_ * sqr + (1.0f - this->
slope_) * value;
134 std::copy(from.begin(), from.end(), this->from_);
135 std::copy(to.begin(), to.end(), this->to_);
155 if constexpr (AUTO_START)
180 for (
auto *timing : this->
timings_) {
182 progress =
clamp_at_most(timing->map_progress(progress), 1.0f);
184 lv_coord_t data[DATA_SIZE];
185 for (
size_t i = 0; i != DATA_SIZE; i++) {
186 data[i] =
static_cast<lv_coord_t
>(
217 for (
size_t i = 0; i != DATA_SIZE; i++) {
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]
LvAnimationTimingEaseIn(float slope)
float map_progress(float value) override
LvAnimationTimingEaseInOut(float slope)
float map_progress(float value) override
LvAnimationTimingEaseOut(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.
T clamp_at_most(T value, U max)
uint32_t IRAM_ATTR HOT millis()