pub enum AnimatedData {
Show 16 variants
Boolean(TimeDataMap<Boolean>),
Integer(TimeDataMap<Integer>),
Real(TimeDataMap<Real>),
String(TimeDataMap<String>),
Color(TimeDataMap<Color>),
Vector2(TimeDataMap<Vector2>),
Matrix3(TimeDataMap<Matrix3>),
BooleanVec(TimeDataMap<BooleanVec>),
IntegerVec(TimeDataMap<IntegerVec>),
RealVec(TimeDataMap<RealVec>),
ColorVec(TimeDataMap<ColorVec>),
StringVec(TimeDataMap<StringVec>),
Vector2Vec(TimeDataMap<Vector2Vec>),
Matrix3Vec(TimeDataMap<Matrix3Vec>),
RealCurve(TimeDataMap<RealCurve>),
ColorCurve(TimeDataMap<ColorCurve>),
}Expand description
Time-indexed data with interpolation support.
AnimatedData enum stores a collection of time-value pairs for a
specific data type and provides interpolation between keyframes. Each
variant contains a TimeDataMap for the corresponding data type.
Variants§
Boolean(TimeDataMap<Boolean>)
Animated boolean values.
Integer(TimeDataMap<Integer>)
Animated integer values.
Real(TimeDataMap<Real>)
Animated real values.
String(TimeDataMap<String>)
Animated string values.
Color(TimeDataMap<Color>)
Animated color values.
Vector2(TimeDataMap<Vector2>)
Animated 2D vectors.
Matrix3(TimeDataMap<Matrix3>)
Animated transformation matrices.
BooleanVec(TimeDataMap<BooleanVec>)
Animated boolean vectors.
IntegerVec(TimeDataMap<IntegerVec>)
Animated integer vectors.
RealVec(TimeDataMap<RealVec>)
Animated real vectors.
ColorVec(TimeDataMap<ColorVec>)
Animated color vectors.
StringVec(TimeDataMap<StringVec>)
Animated string vectors.
Vector2Vec(TimeDataMap<Vector2Vec>)
Animated 2D vector arrays.
Matrix3Vec(TimeDataMap<Matrix3Vec>)
Animated matrix arrays.
RealCurve(TimeDataMap<RealCurve>)
Animated real curve.
ColorCurve(TimeDataMap<ColorCurve>)
Animated color curve.
Implementations§
Source§impl AnimatedData
impl AnimatedData
Source§impl AnimatedData
impl AnimatedData
pub fn insert_boolean(&mut self, time: Time, value: Boolean) -> Result<()>
pub fn insert_integer(&mut self, time: Time, value: Integer) -> Result<()>
pub fn insert_real(&mut self, time: Time, value: Real) -> Result<()>
pub fn insert_string(&mut self, time: Time, value: String) -> Result<()>
pub fn insert_color(&mut self, time: Time, value: Color) -> Result<()>
Source§impl AnimatedData
impl AnimatedData
Source§impl AnimatedData
impl AnimatedData
Source§impl AnimatedData
impl AnimatedData
Sourcepub fn try_insert(&mut self, time: Time, value: Data) -> Result<()>
pub fn try_insert(&mut self, time: Time, value: Data) -> Result<()>
Generic insert method that takes Data and matches the type to the
AnimatedData variant.
Sourcepub fn remove_at(&mut self, time: &Time) -> Option<Data>
pub fn remove_at(&mut self, time: &Time) -> Option<Data>
Remove a sample at the given time.
Returns the removed value as Data if it existed. Returns None
if the key was not found or if it was the last sample (the non-empty
invariant prevents removing it). Use
Value::remove_or_make_uniform
to degrade to uniform instead.
pub fn sample_at(&self, time: Time) -> Option<Data>
pub fn interpolate(&self, time: Time) -> Data
Source§impl AnimatedData
impl AnimatedData
Sourcepub fn hash_with_shutter<H: Hasher>(&self, state: &mut H, shutter: &Shutter)
pub fn hash_with_shutter<H: Hasher>(&self, state: &mut H, shutter: &Shutter)
Hash the animated data with shutter context for better cache coherency.
Samples the animation at standardized points within the shutter range and hashes the interpolated values. If all samples are identical, only one value is hashed for efficiency.
Trait Implementations§
Source§impl AnimatedDataOps for AnimatedData
impl AnimatedDataOps for AnimatedData
Source§impl AnimatedDataSystem for AnimatedData
impl AnimatedDataSystem for AnimatedData
Source§fn keyframe_count(&self) -> usize
fn keyframe_count(&self) -> usize
Source§fn is_keyframes_empty(&self) -> bool
fn is_keyframes_empty(&self) -> bool
true if there are no keyframes.Source§fn has_animation(&self) -> bool
fn has_animation(&self) -> bool
true if there is more than one keyframe. Read moreSource§fn interpolate(&self, time: Time) -> Data
fn interpolate(&self, time: Time) -> Data
Source§fn sample_at(&self, time: Time) -> Option<Data>
fn sample_at(&self, time: Time) -> Option<Data>
None if no keyframe exists.Source§fn try_insert(&mut self, time: Time, value: Data) -> Result<()>
fn try_insert(&mut self, time: Time, value: Data) -> Result<()>
Source§fn remove_at(&mut self, time: &Time) -> Option<Data>
fn remove_at(&mut self, time: &Time) -> Option<Data>
Source§fn discriminant(&self) -> DataType
fn discriminant(&self) -> DataType
Source§fn from_single(time: Time, value: Data) -> Self
fn from_single(time: Time, value: Data) -> Self
Source§fn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
Source§impl Clone for AnimatedData
impl Clone for AnimatedData
Source§fn clone(&self) -> AnimatedData
fn clone(&self) -> AnimatedData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl DataTypeOps for AnimatedData
impl DataTypeOps for AnimatedData
Source§impl Debug for AnimatedData
impl Debug for AnimatedData
Source§impl From<KeyDataMap<Tick, Boolean>> for AnimatedData
impl From<KeyDataMap<Tick, Boolean>> for AnimatedData
Source§fn from(v: TimeDataMap<Boolean>) -> AnimatedData
fn from(v: TimeDataMap<Boolean>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, BooleanVec>> for AnimatedData
impl From<KeyDataMap<Tick, BooleanVec>> for AnimatedData
Source§fn from(v: TimeDataMap<BooleanVec>) -> AnimatedData
fn from(v: TimeDataMap<BooleanVec>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, Color>> for AnimatedData
impl From<KeyDataMap<Tick, Color>> for AnimatedData
Source§fn from(v: TimeDataMap<Color>) -> AnimatedData
fn from(v: TimeDataMap<Color>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, ColorCurve>> for AnimatedData
Available on crate feature curves only.
impl From<KeyDataMap<Tick, ColorCurve>> for AnimatedData
curves only.Source§fn from(v: TimeDataMap<ColorCurve>) -> AnimatedData
fn from(v: TimeDataMap<ColorCurve>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, ColorVec>> for AnimatedData
impl From<KeyDataMap<Tick, ColorVec>> for AnimatedData
Source§fn from(v: TimeDataMap<ColorVec>) -> AnimatedData
fn from(v: TimeDataMap<ColorVec>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, Integer>> for AnimatedData
impl From<KeyDataMap<Tick, Integer>> for AnimatedData
Source§fn from(v: TimeDataMap<Integer>) -> AnimatedData
fn from(v: TimeDataMap<Integer>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, IntegerVec>> for AnimatedData
impl From<KeyDataMap<Tick, IntegerVec>> for AnimatedData
Source§fn from(v: TimeDataMap<IntegerVec>) -> AnimatedData
fn from(v: TimeDataMap<IntegerVec>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, Matrix3>> for AnimatedData
Available on crate feature matrix3 only.
impl From<KeyDataMap<Tick, Matrix3>> for AnimatedData
matrix3 only.Source§fn from(v: TimeDataMap<Matrix3>) -> AnimatedData
fn from(v: TimeDataMap<Matrix3>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, Matrix3Vec>> for AnimatedData
Available on crate features matrix3 and vec_variants only.
impl From<KeyDataMap<Tick, Matrix3Vec>> for AnimatedData
matrix3 and vec_variants only.Source§fn from(v: TimeDataMap<Matrix3Vec>) -> AnimatedData
fn from(v: TimeDataMap<Matrix3Vec>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, Real>> for AnimatedData
impl From<KeyDataMap<Tick, Real>> for AnimatedData
Source§fn from(v: TimeDataMap<Real>) -> AnimatedData
fn from(v: TimeDataMap<Real>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, RealCurve>> for AnimatedData
Available on crate feature curves only.
impl From<KeyDataMap<Tick, RealCurve>> for AnimatedData
curves only.Source§fn from(v: TimeDataMap<RealCurve>) -> AnimatedData
fn from(v: TimeDataMap<RealCurve>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, RealVec>> for AnimatedData
impl From<KeyDataMap<Tick, RealVec>> for AnimatedData
Source§fn from(v: TimeDataMap<RealVec>) -> AnimatedData
fn from(v: TimeDataMap<RealVec>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, String>> for AnimatedData
impl From<KeyDataMap<Tick, String>> for AnimatedData
Source§fn from(v: TimeDataMap<String>) -> AnimatedData
fn from(v: TimeDataMap<String>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, StringVec>> for AnimatedData
impl From<KeyDataMap<Tick, StringVec>> for AnimatedData
Source§fn from(v: TimeDataMap<StringVec>) -> AnimatedData
fn from(v: TimeDataMap<StringVec>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, Vector2>> for AnimatedData
Available on crate feature vector2 only.
impl From<KeyDataMap<Tick, Vector2>> for AnimatedData
vector2 only.Source§fn from(v: TimeDataMap<Vector2>) -> AnimatedData
fn from(v: TimeDataMap<Vector2>) -> AnimatedData
Source§impl From<KeyDataMap<Tick, Vector2Vec>> for AnimatedData
Available on crate features vector2 and vec_variants only.
impl From<KeyDataMap<Tick, Vector2Vec>> for AnimatedData
vector2 and vec_variants only.Source§fn from(v: TimeDataMap<Vector2Vec>) -> AnimatedData
fn from(v: TimeDataMap<Vector2Vec>) -> AnimatedData
Source§impl Hash for AnimatedData
impl Hash for AnimatedData
Source§impl PartialEq for AnimatedData
impl PartialEq for AnimatedData
Source§impl Sample<Color> for AnimatedData
impl Sample<Color> for AnimatedData
Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Color, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Color, SampleWeight)>>
Source§impl Sample<Integer> for AnimatedData
impl Sample<Integer> for AnimatedData
Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Integer, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Integer, SampleWeight)>>
Source§impl Sample<Matrix3> for AnimatedData
Available on crate feature matrix3 only.
impl Sample<Matrix3> for AnimatedData
matrix3 only.Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Matrix3, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Matrix3, SampleWeight)>>
Source§impl Sample<Real> for AnimatedData
impl Sample<Real> for AnimatedData
Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Real, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Real, SampleWeight)>>
Source§impl Sample<Vector2> for AnimatedData
Available on crate feature vector2 only.
impl Sample<Vector2> for AnimatedData
vector2 only.Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Vector2, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Vector2, SampleWeight)>>
Source§impl TryInto<KeyDataMap<Tick, Boolean>> for AnimatedData
impl TryInto<KeyDataMap<Tick, Boolean>> for AnimatedData
Source§impl TryInto<KeyDataMap<Tick, BooleanVec>> for AnimatedData
impl TryInto<KeyDataMap<Tick, BooleanVec>> for AnimatedData
Source§fn try_into(
self,
) -> Result<TimeDataMap<BooleanVec>, <Self as TryInto<TimeDataMap<BooleanVec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<BooleanVec>, <Self as TryInto<TimeDataMap<BooleanVec>>>::Error>
Source§impl TryInto<KeyDataMap<Tick, Color>> for AnimatedData
impl TryInto<KeyDataMap<Tick, Color>> for AnimatedData
Source§impl TryInto<KeyDataMap<Tick, ColorCurve>> for AnimatedData
Available on crate feature curves only.
impl TryInto<KeyDataMap<Tick, ColorCurve>> for AnimatedData
curves only.Source§fn try_into(
self,
) -> Result<TimeDataMap<ColorCurve>, <Self as TryInto<TimeDataMap<ColorCurve>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<ColorCurve>, <Self as TryInto<TimeDataMap<ColorCurve>>>::Error>
Source§impl TryInto<KeyDataMap<Tick, ColorVec>> for AnimatedData
impl TryInto<KeyDataMap<Tick, ColorVec>> for AnimatedData
Source§impl TryInto<KeyDataMap<Tick, Integer>> for AnimatedData
impl TryInto<KeyDataMap<Tick, Integer>> for AnimatedData
Source§impl TryInto<KeyDataMap<Tick, IntegerVec>> for AnimatedData
impl TryInto<KeyDataMap<Tick, IntegerVec>> for AnimatedData
Source§fn try_into(
self,
) -> Result<TimeDataMap<IntegerVec>, <Self as TryInto<TimeDataMap<IntegerVec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<IntegerVec>, <Self as TryInto<TimeDataMap<IntegerVec>>>::Error>
Source§impl TryInto<KeyDataMap<Tick, Matrix3>> for AnimatedData
Available on crate feature matrix3 only.
impl TryInto<KeyDataMap<Tick, Matrix3>> for AnimatedData
matrix3 only.Source§impl TryInto<KeyDataMap<Tick, Matrix3Vec>> for AnimatedData
Available on crate features matrix3 and vec_variants only.
impl TryInto<KeyDataMap<Tick, Matrix3Vec>> for AnimatedData
matrix3 and vec_variants only.Source§fn try_into(
self,
) -> Result<TimeDataMap<Matrix3Vec>, <Self as TryInto<TimeDataMap<Matrix3Vec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<Matrix3Vec>, <Self as TryInto<TimeDataMap<Matrix3Vec>>>::Error>
Source§impl TryInto<KeyDataMap<Tick, Real>> for AnimatedData
impl TryInto<KeyDataMap<Tick, Real>> for AnimatedData
Source§impl TryInto<KeyDataMap<Tick, RealCurve>> for AnimatedData
Available on crate feature curves only.
impl TryInto<KeyDataMap<Tick, RealCurve>> for AnimatedData
curves only.Source§impl TryInto<KeyDataMap<Tick, RealVec>> for AnimatedData
impl TryInto<KeyDataMap<Tick, RealVec>> for AnimatedData
Source§impl TryInto<KeyDataMap<Tick, String>> for AnimatedData
impl TryInto<KeyDataMap<Tick, String>> for AnimatedData
Source§impl TryInto<KeyDataMap<Tick, StringVec>> for AnimatedData
impl TryInto<KeyDataMap<Tick, StringVec>> for AnimatedData
Source§impl TryInto<KeyDataMap<Tick, Vector2>> for AnimatedData
Available on crate feature vector2 only.
impl TryInto<KeyDataMap<Tick, Vector2>> for AnimatedData
vector2 only.Source§impl TryInto<KeyDataMap<Tick, Vector2Vec>> for AnimatedData
Available on crate features vector2 and vec_variants only.
impl TryInto<KeyDataMap<Tick, Vector2Vec>> for AnimatedData
vector2 and vec_variants only.Source§fn try_into(
self,
) -> Result<TimeDataMap<Vector2Vec>, <Self as TryInto<TimeDataMap<Vector2Vec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<Vector2Vec>, <Self as TryInto<TimeDataMap<Vector2Vec>>>::Error>
impl Eq for AnimatedData
impl StructuralPartialEq for AnimatedData
Auto Trait Implementations§
impl Freeze for AnimatedData
impl RefUnwindSafe for AnimatedData
impl Send for AnimatedData
impl Sync for AnimatedData
impl Unpin for AnimatedData
impl UnsafeUnpin for AnimatedData
impl UnwindSafe for AnimatedData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more