[][src]Function imageproc::map::map_colors2

pub fn map_colors2<I, J, P, Q, R, F>(image1: &I, image2: &J, f: F) -> Image<R> where
    I: GenericImage<Pixel = P>,
    J: GenericImage<Pixel = Q>,
    P: Pixel,
    Q: Pixel,
    R: Pixel + 'static,
    F: Fn(P, Q) -> R, 

Applies f to the colors of the pixels in the input images.

Requires image1 and image2 to have the same dimensions.

Examples

use image::Luma;
use imageproc::map::map_colors2;

let image1 = gray_image!(
    1, 2,
    3, 4
);

let image2 = gray_image!(
    10, 20,
    30, 40
);

let sum = gray_image!(
    11, 22,
    33, 44
);

assert_pixels_eq!(
    map_colors2(&image1, &image2, |p, q| Luma([p[0] + q[0]])),
    sum
);