pub fn load<R: Read + Seek>(mut rdr: R) -> Result<Xcf, Error> {
        let header = XcfHeader::parse(&mut rdr)?;

        let mut layers = Vec::new();
        loop {
            let layer_pointer = rdr.read_u32::<BigEndian>()?;
            if layer_pointer == 0 {
                break;
            }
            let current_pos = rdr.seek(SeekFrom::Current(0))?;
            rdr.seek(SeekFrom::Start(layer_pointer as u64))?;
            layers.push( Layer::parse(&mut rdr)? );
            rdr.seek(SeekFrom::Start(current_pos))?;
        }

        // TODO: Read channels

        Ok(Xcf {
            header, layers,
        })
    }
/// Read an XCF file from a Reader.
Read an XCF file from a Reader.
Read an XCF file from a Reader .
pub fn load<R: Read + Seek>(mut rdr: R) -> Result<Xcf, Error> {
        let header = XcfHeader::parse(&mut rdr)?;
        let mut layers = Vec::new();
        loop {
            let layer_pointer = rdr.read_u32::<BigEndian>()?;
            if layer_pointer == 0 {
                break;
            }
            let current_pos = rdr.seek(SeekFrom::Current(0))?;
            rdr.seek(SeekFrom::Start(layer_pointer as u64))?;
            layers.push( Layer::parse(&mut rdr)? );
            rdr.seek(SeekFrom::Start(current_pos))?;
        }
        // TODO: Read channels
        Ok(Xcf {
            header, layers,
        })
    }
pub fn load < R : Read + Seek > ( mut rdr : R ) -> Result < Xcf , Error > { let header = XcfHeader :: parse ( & mut rdr ) ? ; let mut layers = Vec :: new ( ) ; loop { let layer_pointer = rdr . read_u32 :: < BigEndian > ( ) ? ; if layer_pointer == 0 { break ; } let current_pos = rdr . seek ( SeekFrom :: Current ( 0 ) ) ? ; rdr . seek ( SeekFrom :: Start ( layer_pointer as u64 ) ) ? ; layers . push ( Layer :: parse ( & mut rdr ) ? ) ; rdr . seek ( SeekFrom :: Start ( current_pos ) ) ? ; } // TODO: Read channels Ok ( Xcf { header , layers , } ) }
Read an XCF file from a Reader.
Read an XCF file from a Reader .
rdr
R
rdr
R