Struct repng::Encoder [] [src]

pub struct Encoder<W, F> { /* fields omitted */ }

The main object, which does all of the encoding work.


impl<W: Write, F> Encoder<W, F>


Finish encoding an image, writing any delayed data.


Write a chunk with the given type and data.

Important traits for &'a mut W

Get access to the writer that this was built with.

Be careful, because you can easily corrupt the image with this method.

impl<W: Write, F: Filter> Encoder<W, F>


Make a new encoder, which writes to a given sink, with a custom filter.

This method also immediately writes the PNG headers to the sink.


Feed zero or more rows to the encoder.

Rows are specified in top-to-bottom and left-to-right order.


This method panics if you try to write data that doesn't fit into a whole number of rows.


Reset the encoder to encode another image with the given options.

There's a good chance that, before calling this method, you'll want to call writer() to get a mutable reference to the writer, and swap that out with a different writer. This method also writes the headers of the new image to the sink.


This currently doesn't change the compression level!

Trait Implementations

Auto Trait Implementations

impl<W, F> Send for Encoder<W, F> where
    F: Send,
    W: Send

impl<W, F> Sync for Encoder<W, F> where
    F: Sync,
    W: Sync