Type Alias image::codecs::gif::Encoder

source ·
pub type Encoder<W> = GifEncoder<W>;
👎Deprecated: Use GifEncoder instead
Expand description

GIF encoder

An alias of GifEncoder.

TODO: remove

Aliased Type§

struct Encoder<W> { /* private fields */ }

Implementations

source§

impl<W: Write> GifEncoder<W>

source

pub fn new(w: W) -> GifEncoder<W>

Creates a new GIF encoder.

source

pub fn new_with_speed(w: W, speed: i32) -> GifEncoder<W>

Create a new GIF encoder, and has the speed parameter speed. See Frame::from_rgba_speed for more information.

source

pub fn set_repeat(&mut self, repeat: Repeat) -> ImageResult<()>

Set the repeat behaviour of the encoded GIF

source

pub fn encode( &mut self, data: &[u8], width: u32, height: u32, color: ColorType, ) -> ImageResult<()>

Encode a single image.

source

pub fn encode_frame(&mut self, img_frame: Frame) -> ImageResult<()>

Encode one frame of animation.

source

pub fn encode_frames<F>(&mut self, frames: F) -> ImageResult<()>
where F: IntoIterator<Item = Frame>,

Encodes Frames. Consider using try_encode_frames instead to encode an animation::Frames like iterator.

source

pub fn try_encode_frames<F>(&mut self, frames: F) -> ImageResult<()>
where F: IntoIterator<Item = ImageResult<Frame>>,

Try to encode a collection of ImageResult<animation::Frame> objects. Use this function to encode an animation::Frames like iterator. Whenever an Err item is encountered, that value is returned without further actions.