Structures
In version 1.0, there's only one structure: GIF_INFO. It is used by every function in the GIFLIB. You should have one structure for each GIF you decode.
struc TGifInfo {
.GIFVersion rb 3
.dwLSWidth dd ?
.dwLSHeight dd ?
.lpColorTable dd ?
.ColorCount dd ?
.dwImageWidth dd ?
.dwImageHeight dd ?
.lpImageData dd ?
.dwImageFormat dd ?
.lpGIFData dd ?
.dwGIFDataSize dd ?
; INTERNAL DATA
.lpLZWTable dd ?
.dwLZWTableSize dd ?
.dwLZWTableCount dd ?
.fGlobalCTable db ?
.dbGCTableSize db ?
.fLocalCTable db ?
.dbLCTableSize db ?
.lpGIFImage dd ?
.lpCurrentByte dd ?
.dbBitsAvailable db ?
.dbCurBitSize db ?
.dbInitBitSize db ?
.lpLastEOSB dd ?
.dwLZWClear dd ?
.CurrentBits dd ?
.IsFirstCode db ?
.PixelCounter dd ?
}
| GIFVersion | These are the second 3 bytes of the file, that indicate the version number of the GIF File, like "87a" or "89a". |
| dwLSWidth | Logical screen width (see GIF format) |
| dwLSHeight | Logical screen height (see GIF format) |
| lpColorTable | Pointer to the GIF color table (RR GG BB RR GG BB format) |
| ColorCount | Number of colors in the GIF |
| dwImageWidth | Actual image width (use this one to get the image dimensions) |
| dwImageHeight | Actual image height (use this one to get the image dimensions) |
| lpImageData |
Output buffer
for decoded data (in the format specified by dwImageFormat). |
| dwImageFormat | Specifies the image format (IMAGEFORMAT_XXXX constants). You can use a format that has a higher maximum number of colors than the original GIF, but lower is not supported (256 color output from a 16 color gif is allowed, 16 color output from a 256 color gif is NOT). |
| lpGIFData | Points to the actual GIF data (in the GIF file format). |
| dwGIFDataSize | Size of the data pointed to by lpGIFData |
| InternalData | Data that is used internally by GIFLIB. |