I am working on drawing lines on an imagebuffer using the imageproc crate. Drawing a line requires the trait bound “GenericImage” from the image crate, which makes sense.
I am using an
ImageBuffer<Rgb<u8>, Vec<u8>>, which satisfies the where clause in the docs, so
GenericImage should be implemented. But I think I am misunderstanding, because I am getting the error:
draw_line_segment(&rendered_strokes_buffer, (stroke.start.x as f32, stroke.start.y as f32), (stroke.end.x as f32, stroke.end.y as f32), stroke.color); | ^^^^^^^^^^^^^^^^^ the trait `image::image::GenericImage` is not implemented for `image::ImageBuffer<image::Rgb<u8>, std::vec::Vec<u8>>`
How would I implement this trait? I saw someone recommend trying to “re-borrow”, via
&*, but it didn’t work and I don’t really understand that approach anyway.
Thanks for reading!