Skip to main content

Module curve

Module curve 

Source
Expand description

Animation curves.

Every axis of every icon animation is driven by a value in [0, 1] produced by an AnimationCurve. The engine linearly maps this value from the origin to the target coordinate, so overshoot curves (values outside [0, 1]) are permitted.

Two concrete implementations share the trait:

Keyframe curves can also be built by sampling a user-supplied function at spec-build time via KeyframeCurve::from_curve_fn or KeyframeCurve::from_motion_fn. The callable is invoked only during construction; the resulting curve is pure data and the tick loop never calls back into user code.

Structs§

Keyframe
One entry in a KeyframeCurve.
KeyframeCurve
A sorted, validated list of (t, v) pairs plus an interpolation mode.
MotionContext
Movement metadata handed to motion-aware curve samplers.

Enums§

BuiltinEasing
Closed-form easing functions.
Curve
The public curve type used inside every crate::IconAnimationSpec.
KeyframeInterp
How adjacent keyframes are interpolated.

Constants§

MAX_SAMPLES
Maximum permissible sample count for a function-generated curve.
MIN_SAMPLES
Minimum permissible sample count for a function-generated curve.
VALUE_CLAMP
Absolute clamp applied to every sampled value in KeyframeCurve::from_curve_fn / KeyframeCurve::from_motion_fn.

Traits§

AnimationCurve
Trait implemented by every curve variant.