pub fn new(format: PixelFormat, width: u32, height: u32) -> Image {
        let data_bits = format.bits_per_pixel() * width * height;
        let data_bytes = ((data_bits + 7) / 8) as usize;
        Image {
            format: format,
            width: width,
            height: height,
            data: vec![0u8; data_bytes].into_boxed_slice(),
        }
    }
/// Creates a new image with all pixel data set to zero.
Creates a new image with all pixel data set to zero.
Creates a new image with all pixel data set to zero .
pub fn new(format: PixelFormat, width: u32, height: u32) -> Image {
        let data_bits = format.bits_per_pixel() * width * height;
        let data_bytes = ((data_bits + 7) / 8) as usize;
        Image {
            format: format,
            width: width,
            height: height,
            data: vec![0u8; data_bytes].into_boxed_slice(),
        }
    }
pub fn new ( format : PixelFormat , width : u32 , height : u32 ) -> Image { let data_bits = format . bits_per_pixel ( ) * width * height ; let data_bytes = ( ( data_bits + 7 ) / 8 ) as usize ; Image { format : format , width : width , height : height , data : vec ! [ 0u8 data_bytes ] . into_boxed_slice ( ) , } }
Creates a new image with all pixel data set to zero.
Creates a new image with all pixel data set to zero .
format
PixelFormat
width
u32
height
u32
format
PixelFormat
width
u32
height
u32