Skip to main content

Sample

Trait Sample 

Source
pub trait Sample<T> {
    // Required method
    fn sample(
        &self,
        shutter: &Shutter,
        samples: NonZeroU16,
    ) -> Result<Vec<(T, SampleWeight)>>;
}
Expand description

trait for generating motion blur samples with shutter timing.

The Sample trait generates multiple samples across a Shutter interval for motion blur rendering. Each sample includes the interpolated value and a weight based on the shutter opening at that time.

Required Methods§

Source

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

Generate samples across the shutter interval.

Returns a vector of value-weight pairs for the specified number of samples distributed across the shutter’s time range.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Sample<Color> for AnimatedData

Source§

impl Sample<Color> for TimeDataMap<Color>

Source§

impl Sample<Color> for Value

Source§

impl Sample<Integer> for AnimatedData

Source§

impl Sample<Integer> for TimeDataMap<Integer>

Source§

impl Sample<Integer> for Value

Source§

impl Sample<Matrix3> for AnimatedData

Available on crate feature matrix3 only.
Source§

impl Sample<Matrix3> for TimeDataMap<Matrix3>

Available on crate features builtin-types and matrix3 only.
Source§

impl Sample<Matrix3> for Value

Source§

impl Sample<Real> for AnimatedData

Source§

impl Sample<Real> for TimeDataMap<Real>

Source§

impl Sample<Real> for Value

Source§

impl Sample<Vector2> for AnimatedData

Available on crate feature vector2 only.
Source§

impl Sample<Vector2> for TimeDataMap<Vector2>

Source§

impl Sample<Vector2> for Value