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]
fn open(filename: &Path) -> FlicResult<Self>
fn frame(&self) -> u16
Get the next frame number.
fn frame_count(&self) -> u16
Get the frame count, not including the ring frame.
fn width(&self) -> u16
Get the FLIC width.
fn height(&self) -> u16
Get the FLIC height.
fn speed_msec(&self) -> u32
Number of milliseconds to delay between each frame during playback.
fn speed_jiffies(&self) -> u16
Number of jiffies to delay between each frame during playback. A jiffy is 1/70 of a second.
fn creator(&self) -> u32
Get the FLIC creator.
fn creation_time(&self) -> u32
Get the FLIC creation time.
fn updater(&self) -> u32
Get the most recent updater.
fn update_time(&self) -> u32
Get the most recent update time.
fn aspect_x(&self) -> u16
Get the x-axis aspect ratio.
fn aspect_y(&self) -> u16
Get the y-axis aspect ratio.
fn read_postage_stamp<'a>(
&mut self,
dst: &'a mut RasterMut<'a>
) -> FlicResult<()>
&mut self,
dst: &'a mut RasterMut<'a>
) -> FlicResult<()>
Decode the postage stamp.
fn read_next_frame(
&mut self,
dst: &mut RasterMut
) -> FlicResult<FlicPlaybackResult>
&mut self,
dst: &mut RasterMut
) -> FlicResult<FlicPlaybackResult>
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); }