[−][src]Function imageproc::map::as_red_channel
pub fn as_red_channel<I, C>(image: &I) -> Image<Rgb<C>> where
I: GenericImage<Pixel = Luma<C>>,
C: Primitive + 'static,
Creates an RGB image by embedding a grayscale image in its red channel.
Examples
use image::Luma; use imageproc::map::as_red_channel; let image = gray_image!( 1, 2; 3, 4); let expected = rgb_image!( [1, 0, 0], [2, 0, 0]; [3, 0, 0], [4, 0, 0]); let actual = as_red_channel(&image); assert_pixels_eq!(actual, expected);