CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
cdc::ui::anim Namespace Reference

Classes

struct  Completion
class  AnimTarget
 Interface the animator drives; implemented by CanvasView on its elements. More...
struct  TweenConfig
 Tween start configuration (mirrors host_anim_t plus the blink shorthand). More...
class  CanvasAnimator
 Fixed-slot tween engine animating element offsets (plus a blink convenience that toggles visibility). More...
class  SpriteStore
 Fixed-slot store for multi-frame 1-bpp sprites with host-driven playback. Pixel data lives in an injected arena (PSRAM, owner-held). More...

Enumerations

enum  : uint8_t {
  EASE_LINEAR = 0 , EASE_QUAD_IN = 1 , EASE_QUAD_OUT = 2 , EASE_QUAD_IN_OUT = 3 ,
  EASE_CUBIC_IN = 4 , EASE_CUBIC_OUT = 5 , EASE_CUBIC_IN_OUT = 6 , EASE_OVERSHOOT = 7 ,
  EASE_BOUNCE = 8 , EASE_STEP = 9 , EASE_ELASTIC = 10 , EASE_COUNT = 11
}
 Easing curves. Values mirror the HOST_EASE_* ids in host_api.h. More...
enum  : uint8_t { FLAG_FROM_CURRENT = 0x01 , FLAG_YOYO = 0x02 , FLAG_HIDE_DONE = 0x04 , FLAG_SHOW_START = 0x08 }
 Tween flags. Values mirror the HOST_ANIM_FLAG_* ids in host_api.h. More...
enum  : int8_t { STATE_DELAYED = 0 , STATE_RUNNING = 1 , STATE_PAUSED = 2 }
 Tween/playback states as reported by CanvasAnimator::state(). More...
enum  : uint8_t { SPRITE_ONCE = 0 , SPRITE_LOOP = 1 , SPRITE_PING_PONG = 2 }
 Sprite playback modes. Values mirror the HOST_SPRITE_* ids in host_api.h. More...
enum  : uint8_t { SPRITE_FLAG_OPAQUE = 0x01 , SPRITE_FLAG_FLIP_H = 0x02 , SPRITE_FLAG_FLIP_V = 0x04 , SPRITE_FLAG_ROT_90 = 0x08 }
 Sprite flags. Values mirror the HOST_SPRITE_FLAG_* ids in host_api.h. More...

Functions

int32_t ease (uint8_t curve, int32_t t)
 Apply an easing curve to a normalized 8.8 fixed-point time.

Variables

constexpr uint16_t REPEAT_FOREVER = 0xFFFF
 Repeat-forever sentinel shared by tweens and sprite playback.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : uint8_t

Sprite flags. Values mirror the HOST_SPRITE_FLAG_* ids in host_api.h.

Enumerator
SPRITE_FLAG_OPAQUE 

Unset data bits paint white.

SPRITE_FLAG_FLIP_H 
SPRITE_FLAG_FLIP_V 
SPRITE_FLAG_ROT_90 

Rotate 90 deg clockwise (before flips).

Definition at line 58 of file CanvasAnim.h.

◆ anonymous enum

anonymous enum : uint8_t

Tween flags. Values mirror the HOST_ANIM_FLAG_* ids in host_api.h.

Enumerator
FLAG_FROM_CURRENT 

Ignore from_x/y, start at the live offset.

FLAG_YOYO 

Each repeat run alternates direction.

FLAG_HIDE_DONE 

Hide the element on completion.

FLAG_SHOW_START 

Show the element when the delay elapses.

Definition at line 36 of file CanvasAnim.h.

◆ anonymous enum

anonymous enum : int8_t

Tween/playback states as reported by CanvasAnimator::state().

Enumerator
STATE_DELAYED 
STATE_RUNNING 
STATE_PAUSED 

Definition at line 44 of file CanvasAnim.h.

◆ anonymous enum

anonymous enum : uint8_t

Easing curves. Values mirror the HOST_EASE_* ids in host_api.h.

Enumerator
EASE_LINEAR 
EASE_QUAD_IN 
EASE_QUAD_OUT 
EASE_QUAD_IN_OUT 
EASE_CUBIC_IN 
EASE_CUBIC_OUT 
EASE_CUBIC_IN_OUT 
EASE_OVERSHOOT 
EASE_BOUNCE 
EASE_STEP 
EASE_ELASTIC 
EASE_COUNT 

Definition at line 20 of file CanvasAnim.h.

◆ anonymous enum

anonymous enum : uint8_t

Sprite playback modes. Values mirror the HOST_SPRITE_* ids in host_api.h.

Enumerator
SPRITE_ONCE 

Play to the last frame and hold it.

SPRITE_LOOP 
SPRITE_PING_PONG 

Definition at line 51 of file CanvasAnim.h.

Function Documentation

◆ ease()

int32_t cdc::ui::anim::ease ( uint8_t curve,
int32_t t )

Apply an easing curve to a normalized 8.8 fixed-point time.

Parameters
curveOne of the EASE_* ids (out of range falls back to linear).
tNormalized time 0..256.
Returns
Eased progress in 8.8 (0..256; OVERSHOOT exceeds 256 mid-curve).

Definition at line 67 of file CanvasAnim.cpp.

References curve, EASE_BOUNCE, EASE_CUBIC_IN, EASE_CUBIC_IN_OUT, EASE_CUBIC_OUT, EASE_ELASTIC, EASE_LINEAR, EASE_OVERSHOOT, EASE_QUAD_IN, EASE_QUAD_IN_OUT, EASE_QUAD_OUT, and EASE_STEP.

Variable Documentation

◆ REPEAT_FOREVER

uint16_t cdc::ui::anim::REPEAT_FOREVER = 0xFFFF
constexpr

Repeat-forever sentinel shared by tweens and sprite playback.

Definition at line 66 of file CanvasAnim.h.

Referenced by cdc::ui::anim::SpriteStore::advance(), cdc::ui::anim::CanvasAnimator::blink(), and cdc::ui::anim::SpriteStore::scroll().