pub fn warp_with<P, F>(
image: &Image<P>,
mapping: F,
interpolation: Interpolation,
default: P,
) -> Image<P>
Expand description
Warps an image using the provided function to define the pre-image of each output pixel.
ยงExamples
Applying a wave pattern.
use image::{ImageBuffer, Luma};
use imageproc::utils::gray_bench_image;
use imageproc::geometric_transformations::*;
let image = gray_bench_image(300, 300);
let warped = warp_with(
&image,
|x, y| (x, y + (x / 30.0).sin()),
Interpolation::Nearest,
Luma([0u8])
);