pub struct Reader<R: Read> { /* private fields */ }
Expand description
PNG reader (mostly high-level interface)
Provides a high level that iterates over lines or whole images.
Implementations§
Source§impl<R: Read> Reader<R>
impl<R: Read> Reader<R>
pub fn info(&self) -> &Info
Sourcepub fn next_frame(&mut self, buf: &mut [u8]) -> Result<(), DecodingError>
pub fn next_frame(&mut self, buf: &mut [u8]) -> Result<(), DecodingError>
Decodes the next frame into buf
Sourcepub fn next_row(&mut self) -> Result<Option<&[u8]>, DecodingError>
pub fn next_row(&mut self) -> Result<Option<&[u8]>, DecodingError>
Returns the next processed row of the image
Sourcepub fn next_interlaced_row(
&mut self,
) -> Result<Option<(&[u8], Option<(u8, u32, u32)>)>, DecodingError>
pub fn next_interlaced_row( &mut self, ) -> Result<Option<(&[u8], Option<(u8, u32, u32)>)>, DecodingError>
Returns the next processed row of the image
Sourcepub fn output_color_type(&mut self) -> (ColorType, BitDepth)
pub fn output_color_type(&mut self) -> (ColorType, BitDepth)
Returns the color type and the number of bits per sample
of the data returned by Reader::next_row
and Reader::frames`.
Sourcepub fn output_buffer_size(&self) -> usize
pub fn output_buffer_size(&self) -> usize
Returns the number of bytes required to hold a deinterlaced image frame that is decoded using the given input transformations.
Sourcepub fn output_line_size(&self, width: u32) -> usize
pub fn output_line_size(&self, width: u32) -> usize
Returns the number of bytes required to hold a deinterlaced row.
Auto Trait Implementations§
impl<R> Freeze for Reader<R>where
R: Freeze,
impl<R> RefUnwindSafe for Reader<R>where
R: RefUnwindSafe,
impl<R> Send for Reader<R>where
R: Send,
impl<R> Sync for Reader<R>where
R: Sync,
impl<R> Unpin for Reader<R>where
R: Unpin,
impl<R> UnwindSafe for Reader<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more