pub fn from_file<P: AsRef<Path>>(path: P) -> Result<RawImageData, TextureError> {
        let path = path.as_ref();

        // Open file
        let file = match File::open(path) {
            Ok(file) => file,
            Err(err) => return Err(TextureError { 
                source: Some(path.to_string_lossy().into()),
                error: err 
            }),
        };

        let decoder = png::Decoder::new(file);

        RawImageData::from_decoder(decoder, path.to_string_lossy().into())
    }
/// Does not invoke any OpenGL functions, and can thus be called from any thread.
Does not invoke any OpenGL functions, and can thus be called from any thread.
Does not invoke any OpenGL functions and can thus be called from any thread .
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<RawImageData, TextureError> {
        let path = path.as_ref();
        // Open file
        let file = match File::open(path) {
            Ok(file) => file,
            Err(err) => return Err(TextureError { 
                source: Some(path.to_string_lossy().into()),
                error: err 
            }),
        };
        let decoder = png::Decoder::new(file);
        RawImageData::from_decoder(decoder, path.to_string_lossy().into())
    }
pub fn from_file < P : AsRef < Path > > ( path : P ) -> Result < RawImageData , TextureError > { let path = path . as_ref ( ) ; // Open file let file = match File :: open ( path ) { Ok ( file ) => file , Err ( err ) => return Err ( TextureError { source : Some ( path . to_string_lossy ( ) . into ( ) ) , error : err } ) , } ; let decoder = png :: Decoder :: new ( file ) ; RawImageData :: from_decoder ( decoder , path . to_string_lossy ( ) . into ( ) ) }
Does not invoke any OpenGL functions, and can thus be called from any thread.
Does not invoke any OpenGL functions and can thus be called from any thread .
path
P
path
P