Skip to main content

sample_linear

Function sample_linear 

Source
pub fn sample_linear(img: &RgbaImage, x: f64, y: f64) -> Pixer
Expand description

Bilinear interpolation with alpha-weighted averaging.

Coordinates remain f64 for sub-pixel accuracy (the heavy lifting is the per-pixel color blend, which is performed in f32 for throughput). The f64 geometry inputs are down-cast to f32 when constructing the returned Pixer.