AnimatedData

Enum AnimatedData 

Source
pub enum AnimatedData {
Show 14 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>),
}
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.

Implementations§

Source§

impl AnimatedData

Source

pub fn times(&self) -> SmallVec<[Time; 10]>

Get all time samples from this animated data.

Source§

impl AnimatedData

Source

pub fn insert_boolean(&mut self, time: Time, value: Boolean) -> Result<()>

Source

pub fn insert_integer(&mut self, time: Time, value: Integer) -> Result<()>

Source

pub fn insert_real(&mut self, time: Time, value: Real) -> Result<()>

Source

pub fn insert_string(&mut self, time: Time, value: String) -> Result<()>

Source

pub fn insert_color(&mut self, time: Time, value: Color) -> Result<()>

Source§

impl AnimatedData

Source

pub fn insert_vector2(&mut self, time: Time, value: Vector2) -> Result<()>

Source§

impl AnimatedData

Source

pub fn insert_matrix3(&mut self, time: Time, value: Matrix3) -> Result<()>

Source§

impl AnimatedData

Source

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.

Source

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.

Source

pub fn sample_at(&self, time: Time) -> Option<Data>

Source

pub fn interpolate(&self, time: Time) -> Data

Source§

impl AnimatedData

Source

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

Source§

fn len(&self) -> usize

Returns the number of time samples.

Source§

fn is_empty(&self) -> bool

Returns true if there are no time samples.

Source§

fn is_animated(&self) -> bool

Returns true if there is more than one time sample.

Source§

impl Clone for AnimatedData

Source§

fn clone(&self) -> AnimatedData

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl DataTypeOps for AnimatedData

Source§

fn data_type(&self) -> DataType

Returns the DataType variant for this value.
Source§

fn type_name(&self) -> &'static str

Returns a string name for this data type.
Source§

impl Debug for AnimatedData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<(Tick, Data)> for AnimatedData

Source§

fn from((time, data): (Time, Data)) -> Self

Converts to this type from the input type.
Source§

impl From<(Tick, Value)> for AnimatedData

Source§

fn from((time, value): (Time, Value)) -> Self

Converts to this type from the input type.
Source§

impl From<TimeDataMap<Boolean>> for AnimatedData

Source§

fn from(v: TimeDataMap<Boolean>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<BooleanVec>> for AnimatedData

Source§

fn from(v: TimeDataMap<BooleanVec>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<Color>> for AnimatedData

Source§

fn from(v: TimeDataMap<Color>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<ColorVec>> for AnimatedData

Source§

fn from(v: TimeDataMap<ColorVec>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<Integer>> for AnimatedData

Source§

fn from(v: TimeDataMap<Integer>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<IntegerVec>> for AnimatedData

Source§

fn from(v: TimeDataMap<IntegerVec>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<Matrix3>> for AnimatedData

Available on crate feature matrix3 only.
Source§

fn from(v: TimeDataMap<Matrix3>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<Matrix3Vec>> for AnimatedData

Available on crate features matrix3 and vec_variants only.
Source§

fn from(v: TimeDataMap<Matrix3Vec>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<Real>> for AnimatedData

Source§

fn from(v: TimeDataMap<Real>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<RealVec>> for AnimatedData

Source§

fn from(v: TimeDataMap<RealVec>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<String>> for AnimatedData

Source§

fn from(v: TimeDataMap<String>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<StringVec>> for AnimatedData

Source§

fn from(v: TimeDataMap<StringVec>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<Vector2>> for AnimatedData

Available on crate feature vector2 only.
Source§

fn from(v: TimeDataMap<Vector2>) -> AnimatedData

Converts to this type from the input type.
Source§

impl From<TimeDataMap<Vector2Vec>> for AnimatedData

Available on crate features vector2 and vec_variants only.
Source§

fn from(v: TimeDataMap<Vector2Vec>) -> AnimatedData

Converts to this type from the input type.
Source§

impl Hash for AnimatedData

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for AnimatedData

Source§

fn eq(&self, other: &AnimatedData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Sample<Color> for AnimatedData

Source§

fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Color, SampleWeight)>>

Generate samples across the shutter interval. Read more
Source§

impl Sample<Integer> for AnimatedData

Source§

fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Integer, SampleWeight)>>

Generate samples across the shutter interval. Read more
Source§

impl Sample<Matrix3> for AnimatedData

Available on crate feature matrix3 only.
Source§

fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Matrix3, SampleWeight)>>

Generate samples across the shutter interval. Read more
Source§

impl Sample<Real> for AnimatedData

Source§

fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Real, SampleWeight)>>

Generate samples across the shutter interval. Read more
Source§

impl Sample<Vector2> for AnimatedData

Available on crate feature vector2 only.
Source§

fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Vector2, SampleWeight)>>

Generate samples across the shutter interval. Read more
Source§

impl TryInto<TimeDataMap<Boolean>> for AnimatedData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<Boolean>, <Self as TryInto<TimeDataMap<Boolean>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<BooleanVec>> for AnimatedData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<BooleanVec>, <Self as TryInto<TimeDataMap<BooleanVec>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<Color>> for AnimatedData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<Color>, <Self as TryInto<TimeDataMap<Color>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<ColorVec>> for AnimatedData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<ColorVec>, <Self as TryInto<TimeDataMap<ColorVec>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<Integer>> for AnimatedData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<Integer>, <Self as TryInto<TimeDataMap<Integer>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<IntegerVec>> for AnimatedData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<IntegerVec>, <Self as TryInto<TimeDataMap<IntegerVec>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<Matrix3>> for AnimatedData

Available on crate feature matrix3 only.
Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<Matrix3>, <Self as TryInto<TimeDataMap<Matrix3>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<Matrix3Vec>> for AnimatedData

Available on crate features matrix3 and vec_variants only.
Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<Matrix3Vec>, <Self as TryInto<TimeDataMap<Matrix3Vec>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<Real>> for AnimatedData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<Real>, <Self as TryInto<TimeDataMap<Real>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<RealVec>> for AnimatedData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<RealVec>, <Self as TryInto<TimeDataMap<RealVec>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<String>> for AnimatedData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<String>, <Self as TryInto<TimeDataMap<String>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<StringVec>> for AnimatedData

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<StringVec>, <Self as TryInto<TimeDataMap<StringVec>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<Vector2>> for AnimatedData

Available on crate feature vector2 only.
Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<Vector2>, <Self as TryInto<TimeDataMap<Vector2>>>::Error>

Performs the conversion.
Source§

impl TryInto<TimeDataMap<Vector2Vec>> for AnimatedData

Available on crate features vector2 and vec_variants only.
Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<TimeDataMap<Vector2Vec>, <Self as TryInto<TimeDataMap<Vector2Vec>>>::Error>

Performs the conversion.
Source§

impl Eq for AnimatedData

Source§

impl StructuralPartialEq for AnimatedData

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,