pub fn map_subpixels<I, P, F, S>(image: &I, f: F) -> Image<ChannelMap<P, S>>
Expand description
Applies f
to each subpixel of the input image.
ยงExamples
use imageproc::map::map_subpixels;
let image = gray_image!(
1, 2;
3, 4);
let scaled = gray_image!(type: i16,
-2, -4;
-6, -8);
assert_pixels_eq!(
map_subpixels(&image, |x| -2 * (x as i16)),
scaled);