Struct flic::flic::FlicFile [] [src]

pub struct FlicFile { /* fields omitted */ }

FLIC animation, with a File handle.

Opens and holds onto the file handle until it is dropped.

Methods

impl FlicFile
[src]

Open a FLIC file.

Examples

use std::path::Path;

flic::FlicFile::open(Path::new("ex.fli"));

Get the next frame number.

Get the frame count, not including the ring frame.

Get the FLIC width.

Get the FLIC height.

Number of milliseconds to delay between each frame during playback.

Number of jiffies to delay between each frame during playback. A jiffy is 1/70 of a second.

Get the FLIC creator.

Get the FLIC creation time.

Get the most recent updater.

Get the most recent update time.

Get the x-axis aspect ratio.

Get the y-axis aspect ratio.

Decode the postage stamp.

Decode the next frame in the FLIC.

The raster buffer must contain the previous frame. The FLIC file will loop when it reaches the last frame.

Returns a record indicating what was processed.

Examples

use std::path::Path;

if let Ok(ref mut flic) = flic::FlicFile::open(Path::new("ex.fli")) {
    const SCREEN_W: usize = 320;
    const SCREEN_H: usize = 200;
    const NUM_COLS: usize = 256;
    let mut buf = [0; SCREEN_W * SCREEN_H];
    let mut pal = [0; 3 * NUM_COLS];
    let mut raster = flic::RasterMut::new(SCREEN_W, SCREEN_H, &mut buf, &mut pal);

    let res = flic.read_next_frame(&mut raster);
}