|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Fixed-slot tween engine animating element offsets (plus a blink convenience that toggles visibility). More...
#include <CanvasAnim.h>
Public Member Functions | |
| uint32_t | start (const TweenConfig &cfg, uint32_t nowMs) |
| Start an offset tween. A FROM_CURRENT start captures the live offset lazily on the first advance() after the delay elapses. | |
| uint32_t | blink (uint32_t elemId, uint16_t periodMs, uint16_t count, uint32_t doneActionId, uint32_t nowMs) |
| Start a visibility blink: count on/off cycles of periodMs per phase, ending visible. Occupies one tween slot. | |
| bool | cancel (uint32_t handle) |
| Cancel a tween and its chain (handle 0 = all). No completion fires. | |
| void | cancelForElem (uint32_t elemId) |
| Silently cancel every tween bound to an element (element was removed). | |
| bool | pause (uint32_t handle, bool paused, uint32_t nowMs) |
| int8_t | state (uint32_t handle) const |
| uint8_t | activeCount () const |
| Number of live slots (delayed, chained, running or paused). | |
| void | shiftTime (uint32_t deltaMs) |
| Shift every time base forward (view was paused for deltaMs). | |
| void | reset () |
| Drop all slots without firing completions (teardown). | |
| bool | advance (uint32_t nowMs, AnimTarget &target, Completion *done, uint8_t doneCap, uint8_t *doneCount) |
| Advance all tweens to nowMs, applying offsets/visibility. | |
Static Public Attributes | |
| static constexpr uint8_t | MAX_TWEENS = 16 |
| static constexpr uint16_t | MAX_DURATION_MS = 60000 |
Fixed-slot tween engine animating element offsets (plus a blink convenience that toggles visibility).
Handles are host-assigned, non-zero and unique until the slot is recycled after completion/cancel. Chained tweens (startAfter) wait for their predecessor; cancelling a predecessor silently cancels its whole chain.
Definition at line 117 of file CanvasAnim.h.
| uint8_t cdc::ui::anim::CanvasAnimator::activeCount | ( | ) | const |
Number of live slots (delayed, chained, running or paused).
Definition at line 225 of file CanvasAnim.cpp.
| bool cdc::ui::anim::CanvasAnimator::advance | ( | uint32_t | nowMs, |
| AnimTarget & | target, | ||
| Completion * | done, | ||
| uint8_t | doneCap, | ||
| uint8_t * | doneCount ) |
Advance all tweens to nowMs, applying offsets/visibility.
| done | Out array for finished tweens (completions with a doneActionId only). |
| doneCap | Capacity of done. |
| doneCount | Out: number of entries written. |
Definition at line 342 of file CanvasAnim.cpp.
| uint32_t cdc::ui::anim::CanvasAnimator::blink | ( | uint32_t | elemId, |
| uint16_t | periodMs, | ||
| uint16_t | count, | ||
| uint32_t | doneActionId, | ||
| uint32_t | nowMs ) |
Start a visibility blink: count on/off cycles of periodMs per phase, ending visible. Occupies one tween slot.
Definition at line 148 of file CanvasAnim.cpp.
References cdc::ui::anim::REPEAT_FOREVER.
| bool cdc::ui::anim::CanvasAnimator::cancel | ( | uint32_t | handle | ) |
Cancel a tween and its chain (handle 0 = all). No completion fires.
Definition at line 177 of file CanvasAnim.cpp.
| void cdc::ui::anim::CanvasAnimator::cancelForElem | ( | uint32_t | elemId | ) |
Silently cancel every tween bound to an element (element was removed).
Definition at line 193 of file CanvasAnim.cpp.
| bool cdc::ui::anim::CanvasAnimator::pause | ( | uint32_t | handle, |
| bool | paused, | ||
| uint32_t | nowMs ) |
Definition at line 203 of file CanvasAnim.cpp.
| void cdc::ui::anim::CanvasAnimator::reset | ( | ) |
Drop all slots without firing completions (teardown).
Definition at line 241 of file CanvasAnim.cpp.
| void cdc::ui::anim::CanvasAnimator::shiftTime | ( | uint32_t | deltaMs | ) |
Shift every time base forward (view was paused for deltaMs).
Definition at line 233 of file CanvasAnim.cpp.
| uint32_t cdc::ui::anim::CanvasAnimator::start | ( | const TweenConfig & | cfg, |
| uint32_t | nowMs ) |
Start an offset tween. A FROM_CURRENT start captures the live offset lazily on the first advance() after the delay elapses.
Definition at line 117 of file CanvasAnim.cpp.
References cdc::ui::anim::TweenConfig::delayMs, cdc::ui::anim::TweenConfig::doneActionId, cdc::ui::anim::TweenConfig::durationMs, cdc::ui::anim::EASE_COUNT, cdc::ui::anim::TweenConfig::easing, cdc::ui::anim::TweenConfig::elemId, cdc::ui::anim::TweenConfig::flags, cdc::ui::anim::TweenConfig::fromX, cdc::ui::anim::TweenConfig::fromY, MAX_DURATION_MS, cdc::ui::anim::TweenConfig::repeat, cdc::ui::anim::TweenConfig::startAfter, cdc::ui::anim::TweenConfig::toX, and cdc::ui::anim::TweenConfig::toY.
| int8_t cdc::ui::anim::CanvasAnimator::state | ( | uint32_t | handle | ) | const |
Definition at line 217 of file CanvasAnim.cpp.
References cdc::ui::anim::STATE_DELAYED, cdc::ui::anim::STATE_PAUSED, and cdc::ui::anim::STATE_RUNNING.
|
staticconstexpr |
Definition at line 120 of file CanvasAnim.h.
Referenced by start().
|
staticconstexpr |
Definition at line 119 of file CanvasAnim.h.