Expand description
A time-based data mapping library for animation and interpolation.
This crate provides types for storing and manipulating data that changes over time. It supports both uniform (static) and animated (time-varying) values with automatic interpolation between keyframes.
§Core Types
Value: A value that can be either uniform or animated over time.Data: A variant enum containing all supported data types.AnimatedData: Time-indexed data with interpolation support.TimeDataMap: A mapping from time to data values.TokenValueMap: A collection of named values indexed by tokens.
§Data Types
The library supports scalar types (Boolean, Integer, Real,
String), vector types (Vector2, [Vector3], Color,
Matrix3), and collections of these types (BooleanVec,
IntegerVec, etc.).
§Motion Blur Sampling
Use the Sample trait with a Shutter to generate motion blur samples
for animated values during rendering.
§Interpolation (Optional Feature)
When the interpolation feature is enabled, TimeDataMap supports
advanced interpolation modes including bezier curves with tangent control.
This enables integration with professional animation systems like Dopamine.
§Examples
use frame_tick::Tick;
use token_value_map::*;
// Create a uniform value.
let uniform = Value::uniform(42.0);
// Create an animated value.
let animated =
Value::animated(vec![(Tick::new(0), 0.0), (Tick::new(10), 10.0)])
.unwrap();
// Sample at a specific time.
let interpolated = animated.interpolate(Tick::new(5));Modules§
- math
- Math backend implementations.
Macros§
- define_
data_ types - Define a custom data type system with full interpolation support.
Structs§
- Boolean
- A boolean value wrapper.
- Boolean
Vec - A vector of boolean values.
- Color
- A 4-component RGBA color value.
- Color
Vec - A vector of color values.
- Generic
Token Value Map - A collection of named values indexed by string tokens.
- Integer
- A 64-bit signed integer wrapper.
- Integer
Vec - A vector of integer values.
- Matrix3
- A 3×3 transformation matrix.
- Matrix3
Vec - A vector of transformation matrices.
- Real
- A 64-bit floating-point number wrapper.
- RealVec
- A vector of real values.
- Shutter
- Shutter timing for motion blur sampling.
- String
- A UTF-8 string wrapper.
- String
Vec - A vector of string values.
- Time
Data Map - A mapping from time to data values with interpolation support.
- Token
- A string token used as a key in
TokenValueMapandGenericTokenValueMap. - Token
Value Map - A collection of named values indexed by string tokens.
- Vector2
- A 2D vector.
- Vector2
Vec - A vector of 2D vectors.
Enums§
- Animated
Data - Time-indexed data with interpolation support.
- Data
- A variant
enumcontaining all supported data types. - Data
Type - Error
- Error type for token-value-map operations.
- Generic
Value - A value that can be either uniform or animated over time.
- Value
- A value that can be either uniform or animated over time.
Traits§
- Animated
Data Ops - Common operations
traitfor animated data types. - Animated
Data System - Animated data container for a
DataSystem. - Data
System - A complete data type system.
- Data
Type Ops - Trait for getting data type information.
- Interpolatable
- Marker trait for types that support time-based interpolation.
- Sample
traitfor generating motion blur samples with shutter timing.- Time
Data MapControl - Control operations
traitfor time data maps. - ToF32
- Trait for converting data types to f32 for curve editing.
Type Aliases§
- Result
- Result type alias using the crate’s
Errortype. - Sample
Weight - Weight value for motion blur sampling.
- Time
- A time value represented as a fixed-point
Tick.