Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

Animation Class Reference

#include <animation.h>

Inheritance diagram for Animation:

LoopingFrames RollCount List of all members.

Detailed Description

This is an abstract data type describing an animation.

An animation is defined as a finite or infinite sequence of Bitmaps. It can be a full motion video, 3 simple frames in a loop, a realtime mathematically generated fractal zoomer, or anything else that spits out a bitmap every time next() is called.

An Animation subclass must implement getframe(). The Animation class will guarantee that all returned frames are the same size, unless told otherwise with same_size(). The Animation class also has automatic memory management if the child class desires it, this is selected by overriding autofree().


Public Member Functions

virtual const Bitmapnext (int skip=0)
 This function should return a Bitmap object every time it's called.

virtual const Bitmappeek (int skip=0)
 Works like next(), except that it will keep returning the same frame, and a subsequent call to next() will also return this frame.

virtual int w ()
 Width of the bitmaps returned by next().

virtual int h ()
 Height of the bitmaps returned by next().

virtual int same_size (int set=-1)
 Get or set a boolean value determining whether all returned bitmaps are cropped to the same size as the first one.


Protected Member Functions

virtual Bitmapgetframe (int skip=0)=0
virtual int autofree ()

Protected Attributes

const Bitmap_nextframe
const Bitmap_lastframe
int _same_size
int _firstw
int _firsth


Member Function Documentation

const Bitmap * Animation::next int  skip = 0  )  [virtual]
 

This function should return a Bitmap object every time it's called.

If there are no more frames in the animation it should return NULL. Each bitmap returned should have the same width and height as all the others.

The caller must not free the returned pointer. It will be invalid after the next call to next().

Parameters:
skip If the caller wants to skip ahead in the animation it should set this to a number above 0 (the number of frames that should be skipped).

const Bitmap * Animation::peek int  skip = 0  )  [virtual]
 

Works like next(), except that it will keep returning the same frame, and a subsequent call to next() will also return this frame.

int Animation::same_size int  set = -1  )  [virtual]
 

Get or set a boolean value determining whether all returned bitmaps are cropped to the same size as the first one.


The documentation for this class was generated from the following files:
Generated on Sun Oct 19 17:34:47 2003 for rve by doxygen 1.3.3