Skip to main content

Interpolate

Trait Interpolate 

Source
pub trait Interpolate {
    type Output;

    // Required methods
    fn interpolate_linear(&self, index: f64) -> Self::Output;
    fn interpolate_cubic(&self, index: f64) -> Self::Output;
    fn interpolate_nearest(&self, index: f64) -> Self::Output;
}
Expand description

Fractional-index reading with interpolation.

Required Associated Types§

Required Methods§

Source

fn interpolate_linear(&self, index: f64) -> Self::Output

Linear interpolation at fractional index. index in [0, len-1]; clamps to valid range.

Source

fn interpolate_cubic(&self, index: f64) -> Self::Output

Cubic Hermite interpolation at fractional index. Requires index in [1, len-2] for 4-point stencil; clamps.

Source

fn interpolate_nearest(&self, index: f64) -> Self::Output

Nearest-neighbor (round to nearest integer index).

Implementations on Foreign Types§

Source§

impl<T> Interpolate for [T]
where T: Transcendental + Copy,

Source§

type Output = T

Source§

fn interpolate_linear(&self, index: f64) -> T

Source§

fn interpolate_cubic(&self, index: f64) -> T

Source§

fn interpolate_nearest(&self, index: f64) -> T

Implementors§