oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
ove::lvgl::Animation Class Reference

Fluent builder for LVGL animations (lv_anim_t). More...

#include <lvgl.hpp>

Public Member Functions

Animationtarget (void *var)
 Sets the target variable pointer (typically an lv_obj_t *).
 
Animationtarget (ObjectView obj)
 Sets the target as an LVGL object.
 
Animationvalues (int32_t from, int32_t to)
 Sets the start and end values.
 
Animationduration (uint32_t ms)
 Sets the animation duration in milliseconds.
 
Animationdelay (uint32_t ms)
 Sets the delay before the animation starts, in milliseconds.
 
Animationpath (lv_anim_path_cb_t cb)
 Sets the easing curve. Use lv_anim_path_linear, _ease_out, etc.
 
Animationrepeat_count (uint32_t count)
 Sets the repeat count; use LV_ANIM_REPEAT_INFINITE for endless.
 
Animationrepeat_delay (uint32_t ms)
 Sets the delay between repeats.
 
Animationplayback_duration (uint32_t ms)
 Sets the duration of the playback (reverse) phase.
 
Animationplayback_delay (uint32_t ms)
 Sets the delay before the playback phase.
 
Animationexec_cb (lv_anim_exec_xcb_t cb)
 Sets the exec callback invoked on every frame.
 
Animationready_cb (lv_anim_ready_cb_t cb)
 Sets the ready callback invoked when the animation finishes.
 
void start ()
 Starts the animation. LVGL copies the state into its internal list, so this Animation can be destructed after.
 

Static Public Member Functions

static bool stop (void *var, lv_anim_exec_xcb_t exec_cb)
 Stops any animations matching (var, exec_cb).
 
static uint32_t duration_for_speed (uint32_t speed)
 Computes the duration (ms) needed to animate at the given speed.
 

Detailed Description

Fluent builder for LVGL animations (lv_anim_t).

Configure an animation step by step, then call start() — LVGL copies the state into its internal animation list at that moment, so the Animation object can be destructed immediately after.

Stateless lambdas and plain function pointers work directly as exec and ready callbacks. For the most common cases see the animate_x, animate_y, animate_width, animate_opa helpers at namespace scope.

Note
Callbacks run from the LVGL task context while the LVGL lock is already held; do NOT re-acquire the lock inside them.

Member Function Documentation

◆ exec_cb()

Animation & ove::lvgl::Animation::exec_cb ( lv_anim_exec_xcb_t  cb)
inline

Sets the exec callback invoked on every frame.

Parameters
[in]cbFunction taking (void *var, int32_t value).

The documentation for this class was generated from the following file: