|
resonance 1.0.1
|
Reader for GIF files. More...
#include <agiffile.h>


Public Member Functions | |
| AGifFile (FILE *pFile) | |
| Construct over an open file. | |
| virtual int | StartRead () |
| Slot 1. | |
| virtual int | ReadFrame (ABitmap &bitmap, int *pbEnd) |
| Slot 3. | |
| virtual int | Write (const ABitmap &bitmap) |
| Slot 5. | |
| Public Member Functions inherited from AGfxFile | |
| AGfxFile (FILE *pFile) | |
| Construct over an open file. | |
| virtual void | SetUnreadWord (int nWord) |
| Set mUnreadWord. | |
| virtual | ~AGfxFile () |
| Close the file. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from AGfxFile | |
| static AGfxFile * | Open (const char *pszPath, int *pnError, bool bRead) |
| Open an image file and construct the reader for its extension. | |
| static int | Write (const char *pszPath, const ABitmap &bitmap) |
| Write a bitmap to a file in the format its extension selects. | |
| Protected Attributes inherited from AGfxFile | |
| FILE * | mFile |
| ARect | mBounds |
| int | mDuration |
Reader for GIF files.
Its single public base is AGfxFile at offset zero. Its table at 0x0083fdd0 overrides slots 1, 3, 4, and 5, and the class does not add a member. AGfxFile::Open() allocates 0x18 bytes for it.
Every piece of decoding state lives in file-scope statics rather than in the object: the logical screen descriptor, the current image descriptor and graphic control block, the decoder tables, and a static APalette the global colour table is read into. A local colour table overwrites that palette. Two readers in use at once therefore share one state.
|
inlineexplicit |
|
virtual |
Slot 1.
Read the logical screen descriptor and the global colour table.
A signature that does not start GIF gives kAGfxFileBadFormat. The graphic control block is cleared. The version and the screen extent are read but not used.
Implements AGfxFile.
|
virtual |
Slot 3.
Read blocks up to and including the next image.
Extension blocks are consumed through ReadExtension(). An image produces an eight bit bitmap the size of its descriptor, with a new palette copied from the static palette, and sets mBounds to the image rectangle. A transparent colour from the last graphic control block is applied to the bitmap.
A block introducer of one is accepted when the next three bytes are 1, 0, and !, and an extension follows.
| bitmap | Receives the image. |
| pbEnd | Set to one at the trailer, and also for a negative introducer byte. |
Implements AGfxFile.
|
virtual |
Slot 5.
Writing is not implemented.
| bitmap | The bitmap, not read. |
Implements AGfxFile.