Struct image::codecs::png::PngDecoder[][src]

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

PNG decoder

Implementations

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

pub fn new(r: R) -> ImageResult<PngDecoder<R>>[src]

Creates a new decoder that decodes from the stream r

pub fn apng(self) -> ApngDecoder<R>[src]

Turn this into an iterator over the animation frames.

Reading the complete animation requires more memory than reading the data from the IDAT frame–multiple frame buffers need to be reserved at the same time. We further do not support compositing 16-bit colors. In any case this would be lossy as the interface of animation decoders does not support 16-bit colors.

If something is not supported or a limit is violated then the decoding step that requires them will fail and an error will be returned instead of the frame. No further frames will be returned.

pub fn is_apng(&self) -> bool[src]

Returns if the image contains an animation.

Note that the file itself decides if the default image is considered to be part of the animation. When it is not the common interpretation is to use it as a thumbnail.

If a non-animated image is converted into an ApngDecoder then its iterator is empty.

Trait Implementations

impl<'a, R: 'a + Read> ImageDecoder<'a> for PngDecoder<R>[src]

type Reader = PngReader<R>

The type of reader produced by into_reader.

Auto Trait Implementations

impl<R> RefUnwindSafe for PngDecoder<R> where
    R: RefUnwindSafe

impl<R> Send for PngDecoder<R> where
    R: Send

impl<R> Sync for PngDecoder<R> where
    R: Sync

impl<R> Unpin for PngDecoder<R> where
    R: Unpin

impl<R> UnwindSafe for PngDecoder<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> Pointable for T[src]

type Init = T

The type for initializers.

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.