pub type ImageMut<'a, Color> = Image<Color, &'a mut [Color]>;Expand description
A mutable, borrowed image backed by a mutable reference to a slice.
This type consists of a width, a height, and a pixel slice in row-major order.
The length of the pixel slice is guaranteed to match width * height and be less than or
equal to MAX_PIXELS.
See ImageBuf for an owned variant of an image and ImageRef for an immutable, borrowed image.
§Examples
Directly creating an ImageMut from a slice:
let (width, height) = (512, 512);
let mut pixels = vec![Srgb::new(0, 0, 0); (width * height) as usize];
let image = ImageMut::new(width, height, &mut pixels).unwrap();Converting a mutable reference to a RgbImage from the image crate
to an ImageMut:
let mut image = RgbImage::new(256, 256);
let image = ImageMut::try_from(&mut image)?;Aliased Type§
pub struct ImageMut<'a, Color> { /* private fields */ }