[−][src]Function imageproc::pixelops::interpolate
pub fn interpolate<P: Pixel>(left: P, right: P, left_weight: f32) -> P where
P::Subpixel: ValueInto<f32> + Clamp<f32>,
Equivalent to weighted_sum(left, right, left_weight, 1 - left_weight)
.
Examples
use image::Rgb; use imageproc::pixelops::interpolate; let left = Rgb([10u8, 20u8, 30u8]); let right = Rgb([100u8, 80u8, 60u8]); let sum = interpolate(left, right, 0.7); assert_eq!(sum, Rgb([37, 38, 39]));