Expand description
Motion path interpolation for keyframe animations
This module provides bezier curve interpolation and easing functions for smooth motion in animations. It supports:
- Linear interpolation
- Standard easing functions (ease-in, ease-out, ease-in-out)
- Cubic bezier interpolation with control points
- CSS steps() timing function
- Automatic arc path fitting
§Example
ⓘ
use pixelsrc::motion::{Interpolation, interpolate, Point2D};
// Linear interpolation between two points
let start = Point2D { x: 0.0, y: 0.0 };
let end = Point2D { x: 100.0, y: 50.0 };
let mid = interpolate_point(&start, &end, 0.5, Interpolation::Linear);
assert_eq!(mid.x, 50.0);
assert_eq!(mid.y, 25.0);Structs§
- Control
Point - Control point for bezier curves
- Point2D
- A 2D point for motion path calculations
Enums§
- Interpolation
- Interpolation method for keyframe animation
- Motion
Path - Motion path type for position interpolation
- Step
Position - Step position for CSS steps() timing function.
- Timing
Function Error - Error type for timing function parsing Error type for timing function parsing failures
Functions§
- ease
- Apply easing to a normalized time value (0.0 to 1.0)
- generate_
motion_ frames - Generate intermediate frames for a keyframe animation
- interpolate_
path - Interpolate along a motion path
- interpolate_
point - Interpolate between two points with easing
- interpolate_
value - Interpolate a single value between keyframes
- parse_
interpolation - Parse interpolation mode from string
- parse_
motion_ path - Parse motion path from string
- parse_
timing_ function - Parse a CSS timing function string.