fn read_image(path: &str) -> Vec<u32> {
    let img = image::open(path).expect(&format!("Couldn't open {}", path));
    img.pixels().map(|(_, _, p)| {
        let rgba = p.to_rgba();
        let mut r: u32 = rgba.data[3] as u32;
        for i in 0..3 {
            r <<= 8;
            r |= rgba.data[i] as u32;
        }
        r
    }).collect()
}
/// Reads an image from a path into a buffer.
/// Panics if the image can't be read for any reason.
Reads an image from a path into a buffer.
Panics if the image can't be read for any reason.
Reads an image from a path into a buffer . Panics if the image can ' t be read for any reason .
fn read_image(path: &str) -> Vec<u32> {
    let img = image::open(path).expect(&format!("Couldn't open {}", path));
    img.pixels().map(|(_, _, p)| {
        let rgba = p.to_rgba();
        let mut r: u32 = rgba.data[3] as u32;
        for i in 0..3 {
            r <<= 8;
            r |= rgba.data[i] as u32;
        }
        r
    }).collect()
}
fn read_image ( path : & str ) -> Vec < u32 > { let img = image :: open ( path ) . expect ( & format ! ( " " path ) ) ; img . pixels ( ) . map ( | ( _ , _ , p ) | { let rgba = p . to_rgba ( ) ; let mut r : u32 = rgba . data [ 3 ] as u32 ; for i in 0 .. 3 { r <<= 8 ; r |= rgba . data [ i ] as u32 ; } r } ) . collect ( ) }
Reads an image from a path into a buffer.
Reads an image from a path into a buffer .
path
&str
path
&str