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