/// Read an image into the decoder.
///
/// Note that you must call quirc_end() if the function returns
/// successfully (0).
Read an image into the decoder.
Note that you must call quirc_end() if the function returns
successfully (0).
Read an image into the decoder . Note that you must call quirc_end () if the function returns successfully ( 0 ) .
pub fn load_image(path: &Path) -> (u32, u32, Vec<u8>) {
    let img = image::open(path).unwrap().grayscale().to_luma();
    let (width, height) = img.dimensions();
    let img_bytes = img.into_raw();
    assert_eq!(img_bytes.len(), width as usize * height as usize);
    (width, height, img_bytes)
}
pub fn load_image ( path : & Path ) -> ( u32 , u32 , Vec < u8 > ) { let img = image :: open ( path ) . unwrap ( ) . grayscale ( ) . to_luma ( ) ; let ( width , height ) = img . dimensions ( ) ; let img_bytes = img . into_raw ( ) ; assert_eq ! ( img_bytes len ( ) width as usize height as usize ) ; ( width , height , img_bytes ) }
Read an image into the decoder.
Read an image into the decoder .
path
&Path