Crate gif_dispose [] [src]

Implements GIF disposal method for the gif crate.

The gif crate only exposes raw frame data that is not sufficient to render GIFs properly. GIF requires special composing of frames which, as this crate shows, is non-trivial.

Be careful when using this code, it's not being tested!
let file = File::open("example.gif")?;
let mut decoder = Decoder::new(file);

// Important:
decoder.set(gif::ColorOutput::Indexed);

let mut reader = decoder.read_info()?;

let mut screen = Screen::new_reader(&reader);
while let Some(frame) = reader.read_next_frame()? {
    screen.blit(&frame)?;
    screen.pixels // that's the frame now
}

Structs

Screen

Combined GIF frames forming a "virtual screen"

Enums

Error

Type Definitions

RGB8

8-bit RGB. The colorspace is techincally undefined, but generally sRGB is assumed.

RGBA8

Alpha is last. The crate doesn't impose which value represents transparency, but usually it's 0 = transparent, 255 = opaque.