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