1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// image_formats::image
// by Desmond Germans, 2019
#[derive(Default)]
pub struct ImageBuffer {
pub width: usize,
pub height: usize,
pub data: Vec<u32>,
}
impl ImageBuffer {
pub fn new(width: usize,height: usize) -> ImageBuffer {
ImageBuffer {
width: width,
height: height,
data: vec![0; width * height],
}
}
}