[][src]Struct png::Reader

pub struct Reader<R: Read> { /* fields omitted */ }

PNG reader (mostly high-level interface)

Provides a high level that iterates over lines or whole images.

Implementations

impl<R: Read> Reader<R>[src]

pub fn info(&self) -> &Info[src]

Get information on the image.

The structure will change as new frames of an animated image are decoded.

pub fn next_frame(&mut self, buf: &mut [u8]) -> Result<(), DecodingError>[src]

Decodes the next frame into buf.

Note that this decodes raw subframes that need to be mixed according to blend-op and dispose-op by the caller.

The caller must always provide a buffer large enough to hold a complete frame (the APNG specification restricts subframes to the dimensions given in the image header). The region that has been written be checked afterwards by calling info after a successful call and inspecting the frame_control data. This requirement may be lifted in a later version of png.

Output lines will be written in row-major, packed matrix with width and height of the read frame (or subframe), all samples are in big endian byte order where this matters.

pub fn next_row(&mut self) -> Result<Option<&[u8]>, DecodingError>[src]

Returns the next processed row of the image

pub fn next_interlaced_row(
    &mut self
) -> Result<Option<(&[u8], Option<(u8, u32, u32)>)>, DecodingError>
[src]

Returns the next processed row of the image

pub fn output_color_type(&mut self) -> (ColorType, BitDepth)[src]

Returns the color type and the number of bits per sample of the data returned by Reader::next_row and Reader::frames`.

pub fn output_buffer_size(&self) -> usize[src]

Returns the number of bytes required to hold a deinterlaced image frame that is decoded using the given input transformations.

pub fn output_line_size(&self, width: u32) -> usize[src]

Returns the number of bytes required to hold a deinterlaced row.

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.