The draw_cross_mut function draws five pixels that look like a cross on an image.
use imageproc::{drawing, image};
fn main() {
let mut buf = image::ImageBuffer::new(100, 100);
drawing::draw_cross_mut(&mut buf, image::Rgb::from([128u8, 255u8, 64u8]), 50, 50);
buf.save("cross.png").unwrap();
}
cross.png:
To draw a cross on a copied image, we can use draw_cross.
➡️ Next: Drawing Cubic Bezier Curves
📘 Back: Table of contents