|
ZenitUI
Retained-mode C++20 UI framework
|
Property transitions, @keyframes, imperative animations, and post-processing filters. More...
Namespaces | |
| namespace | ZenitUI::Anim |
| Internal helpers; called from AnimationPlayer and from Layout::draw. | |
Classes | |
| struct | ZenitUI::AnimationPlayer |
| Per-node animation state and operations. More... | |
| class | ZenitUI::UIAnimation |
| A time-parameterised sequence of per-property tracks. More... | |
| struct | ZenitUI::AnimState |
| Playback state for one UIAnimation on one node. More... | |
| struct | ZenitUI::Keyframe |
| One keyframe of a CSS animation: a normalized time and a sparse style delta. More... | |
| struct | ZenitUI::KeyframeAnimation |
| A named list of keyframes, keyed by name in Theme::keyframes. More... | |
| struct | ZenitUI::ActiveCssAnimation |
| Playback state for one CSS animation on one node. More... | |
| struct | ZenitUI::FilterParam |
| One uniform exposed by a filter shader. More... | |
| struct | ZenitUI::FilterContext |
| Per-invocation state passed to applyFilter and to custom filters. More... | |
| struct | ZenitUI::FilterDef |
| Complete description of one filter. More... | |
| class | ZenitUI::FilterRegistry |
| Per-context map from CSS filter name to FilterDef. More... | |
Typedefs | |
| using | ZenitUI::FilterCustomFn = std::function<void(const FilterContext &)> |
| Callback signature for FilterPattern::Custom filters. | |
Enumerations | |
| enum class | ZenitUI::TransitionFunction { Linear , EaseInQuad , EaseOutQuad , EaseInOutQuad , EaseInCubic , EaseOutCubic , EaseInOutCubic , EaseInBack , EaseOutBack , EaseOutElastic , EaseOutBounce } |
| Timing function applied between two keyframe values. More... | |
| enum class | ZenitUI::FilterPattern { FilterPattern::SinglePass , FilterPattern::Separable , FilterPattern::Silhouette , FilterPattern::Custom } |
| Execution pattern for a filter definition. More... | |
| enum class | ZenitUI::FilterParamType { Float , Vec2 , Vec3 , Vec4 , Color } |
| Type of a filter parameter. | |
Functions | |
| float | ZenitUI::sampleActive (const ActiveCssAnimation &a, bool &finished) |
| Sample the given CSS animation's local time without touching the cache. | |
| float | ZenitUI::sampleActiveCached (const ActiveCssAnimation &a, bool &finished) |
| Cached wrapper around sampleActive. | |
| Style | ZenitUI::evaluateKeyframes (const KeyframeAnimation &anim, float localT, TransitionFunction ease) |
Interpolate a KeyframeAnimation at local time localT. | |
| float | ZenitUI::getRatio (float t, TransitionFunction fn) |
Map a normalized time t in [0, 1] through the given easing. | |
| bool | ZenitUI::parseEasing (std::string_view name, TransitionFunction &out) |
| Parse an easing name (CSS-like) into a TransitionFunction. | |
| void | ZenitUI::applyFilter (const FilterDef &def, const FilterContext &ctx) |
| Execute one filter against the given context. | |
Property transitions, @keyframes, imperative animations, and post-processing filters.
Key concepts:
Live examples: 11_animations · 12_effects_canvas
|
strong |
|
strong |
Timing function applied between two keyframe values.
The set matches the subset of the CSS cubic-bezier() presets that ZenitUI supports out of the box. Custom cubic-bezier curves are not exposed; use the closest preset or a Custom filter for arbitrary motion.
| void ZenitUI::applyFilter | ( | const FilterDef & | def, |
| const FilterContext & | ctx ) |
Execute one filter against the given context.
| def | Filter definition to execute. |
| ctx | Invocation context providing renderer, targets, and UIContext. |
|
inline |
Interpolate a KeyframeAnimation at local time localT.
Finds the two keyframes bracketing localT, computes the local sub-progress, applies easing, then lerps every property present in both bracketing keyframes. Properties present in only one side are taken from that side directly.
|
inline |
Map a normalized time t in [0, 1] through the given easing.
| t | Progress, clamped to [0, 1] by the function. |
| fn | Easing curve to apply. |
|
inline |
Parse an easing name (CSS-like) into a TransitionFunction.
Case-insensitive; separators -, _ and space are ignored, so "ease-in-out-quad", "EaseInOutQuad" and "ease in out quad" all parse to TransitionFunction::EaseInOutQuad.
| name | Input string view. | |
| [out] | out | Set on success. |
|
inline |
Sample the given CSS animation's local time without touching the cache.
Combines elapsed, delay, duration, iterations, alternate into a normalized [0, 1] progress value. Also reports whether this is the final frame of the animation via finished.
| a | Active animation. | |
| [out] | finished | Set to true on the last sample. |