#include <animation.h>
Inheritance diagram for 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 Bitmap * | next (int skip=0) |
This function should return a Bitmap object every time it's called. | |
virtual const Bitmap * | peek (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 Bitmap * | getframe (int skip=0)=0 |
virtual int | autofree () |
Protected Attributes | |
const Bitmap * | _nextframe |
const Bitmap * | _lastframe |
int | _same_size |
int | _firstw |
int | _firsth |
|
This function should return a 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
|
|
Works like
|
|
Get or set a boolean value determining whether all returned bitmaps are cropped to the same size as the first one.
|