fn next_raw_interlaced_row(&mut self) -> Result<Option<InterlacedRow<'_>>, DecodingError> {
        let _ = get_info!(self);
        let bpp = self.bpp;
        let (rowlen, passdata) = match self.next_pass() {
            Some((rowlen, passdata)) => (rowlen, passdata),
            None => return Ok(None),
        };
        loop {
            if self.current.len() - self.scan_start >= rowlen {
                let row = &mut self.current[self.scan_start..];
                let filter = match FilterType::from_u8(row[0]) {
                    None => {
                        self.scan_start += rowlen;
                        return Err(DecodingError::Format(
                            format!("invalid filter method ({})", row[0]).into(),
                        ));
                    }
                    Some(filter) => filter,
                };

                if let Err(message) =
                    unfilter(filter, bpp, &self.prev[1..rowlen], &mut row[1..rowlen])
                {
                    return Err(DecodingError::Format(borrow::Cow::Borrowed(message)));
                }

                self.prev[..rowlen].copy_from_slice(&row[..rowlen]);
                self.scan_start += rowlen;

                return Ok(Some(InterlacedRow {
                    data: &self.prev[1..rowlen],
                    interlace: passdata,
                }));
            } else {
                // Clear the current buffer before appending more data.
                if self.scan_start > 0 {
                    self.current.drain(..self.scan_start).for_each(drop);
                    self.scan_start = 0;
                }

                let val = self.decoder.decode_next(&mut self.current)?;
                match val {
                    Some(Decoded::ImageData) => {}
                    None => {
                        if !self.current.is_empty() {
                            return Err(DecodingError::Format("file truncated".into()));
                        } else {
                            return Ok(None);
                        }
                    }
                    _ => (),
                }
            }
        }
    }
/// Returns the next raw scanline of the image interlace pass.
/// The scanline is filtered against the previous scanline according to the specification.
Returns the next raw scanline of the image interlace pass.
The scanline is filtered against the previous scanline according to the specification.
Returns the next raw scanline of the image interlace pass . The scanline is filtered against the previous scanline according to the specification .
fn next_raw_interlaced_row(&mut self) -> Result<Option<InterlacedRow<'_>>, DecodingError> {
        let _ = get_info!(self);
        let bpp = self.bpp;
        let (rowlen, passdata) = match self.next_pass() {
            Some((rowlen, passdata)) => (rowlen, passdata),
            None => return Ok(None),
        };
        loop {
            if self.current.len() - self.scan_start >= rowlen {
                let row = &mut self.current[self.scan_start..];
                let filter = match FilterType::from_u8(row[0]) {
                    None => {
                        self.scan_start += rowlen;
                        return Err(DecodingError::Format(
                            format!("invalid filter method ({})", row[0]).into(),
                        ));
                    }
                    Some(filter) => filter,
                };
                if let Err(message) =
                    unfilter(filter, bpp, &self.prev[1..rowlen], &mut row[1..rowlen])
                {
                    return Err(DecodingError::Format(borrow::Cow::Borrowed(message)));
                }
                self.prev[..rowlen].copy_from_slice(&row[..rowlen]);
                self.scan_start += rowlen;
                return Ok(Some(InterlacedRow {
                    data: &self.prev[1..rowlen],
                    interlace: passdata,
                }));
            } else {
                // Clear the current buffer before appending more data.
                if self.scan_start > 0 {
                    self.current.drain(..self.scan_start).for_each(drop);
                    self.scan_start = 0;
                }
                let val = self.decoder.decode_next(&mut self.current)?;
                match val {
                    Some(Decoded::ImageData) => {}
                    None => {
                        if !self.current.is_empty() {
                            return Err(DecodingError::Format("file truncated".into()));
                        } else {
                            return Ok(None);
                        }
                    }
                    _ => (),
                }
            }
        }
    }
fn next_raw_interlaced_row ( & mut self ) -> Result < Option < InterlacedRow < ' _ > > , DecodingError > { let _ = get_info ! ( self ) ; let bpp = self . bpp ; let ( rowlen , passdata ) = match self . next_pass ( ) { Some ( ( rowlen , passdata ) ) => ( rowlen , passdata ) , None => return Ok ( None ) , } ; loop { if self . current . len ( ) - self . scan_start >= rowlen { let row = & mut self . current [ self . scan_start .. ] ; let filter = match FilterType :: from_u8 ( row [ 0 ] ) { None => { self . scan_start += rowlen ; return Err ( DecodingError :: Format ( format ! ( " " row [ 0 ] ) . into ( ) , ) ) ; } Some ( filter ) => filter , } ; if let Err ( message ) = unfilter ( filter , bpp , & self . prev [ 1 .. rowlen ] , & mut row [ 1 .. rowlen ] ) { return Err ( DecodingError :: Format ( borrow :: Cow :: Borrowed ( message ) ) ) ; } self . prev [ .. rowlen ] . copy_from_slice ( & row [ .. rowlen ] ) ; self . scan_start += rowlen ; return Ok ( Some ( InterlacedRow { data : & self . prev [ 1 .. rowlen ] , interlace : passdata , } ) ) ; } else { // Clear the current buffer before appending more data. if self . scan_start > 0 { self . current . drain ( .. self . scan_start ) . for_each ( drop ) ; self . scan_start = 0 ; } let val = self . decoder . decode_next ( & mut self . current ) ? ; match val { Some ( Decoded :: ImageData ) => { } None => { if ! self . current . is_empty ( ) { return Err ( DecodingError :: Format ( " " . into ( ) ) ) ; } else { return Ok ( None ) ; } } _ => ( ) , } } } }
Returns the next raw scanline of the image interlace pass.
Returns the next raw scanline of the image interlace pass .
&mut self
&mut self