Class TGif (unit GifFormat)

Inherits from

TObject

This is the actual gif object

Constructors


constructor Create;

--------------------------------------------------------------------------- } { TGif


Functions

destructor Destroy;


procedure CreateBitHeader(Stream:TStream);

create line of bitmap data

while


procedure CreateLine;

reads data subblock from stream

all colors are important


procedure Decode(Stream:TStream);

takes gif header information and converts it to BMP

mask off the right number of bits


procedure Error(ErrCode: integer);

returns the next available code

Decode the GIF


procedure InitCompressionStream(Stream:TStream);

guess what this is for!

check for stream error


procedure LoadFromStream(Stream: TStream);


function NextCode(Stream:TStream): word;

parse memory/file

reset bytes left


procedure ParseMem(Stream:TStream);

image data} {Member Functions

Raise exception with message


procedure ReadSubBlock(Stream:TStream);

initializes info for decode

Clear other variables


procedure SaveToStream(Stream: TStream);

Prepare for next line

Properties

Events

Variables

BitsLeft : Integer;

number of entries in color table

BmHeader : TBitmapInfoHeader;

interlace pass number

BmpStream : TMemoryStream;

memory stream for gif file

BytesLeft : Integer;

bits left in byte

ClearCode : Integer;

current size of code in bits

CurrByte : Byte;

index to next byte in datablock array

CurrCodeSize : Integer;

bytes left in block

CurrentY : Integer;

array for buffer line output

DecodeStack : array[0..MAXCODES] of byte;

current byte

EndingCode : Integer;

clear code value

GifStream : TMemoryStream;


GlobalColorTable : TColorTable;

gif screen descriptor

Header : THeader;

memory stream for bitmap data

HighCode : Word;

highest slot position for current code size

ImageData : TDataSubBlock;

minimum size of LZW codes in bits

ImageDescriptor : TImageDescriptor;

local color table

ImageLines : TList;

file header for bitmap file

Interlaced : boolean;

true if local colors in use

InterlacePass : byte;

current screen locations

LineBuffer : GraphicLine;

array for code suffixes

LocalColorTable : TColorTable;

global color table

LogicalScreen : TLogicalScreenDescriptor;

gif file header

LZWCodeSize : Byte;

true if image is interlaced

NextByte : Integer;

highest code that does not require decoding

Prefix : array[0..MAXCODES] of integer;

stack for decoded codes

Slot : Word;

ending code value

Suffix : array[0..MAXCODES] of integer;

array for code prefixes

TableSize : Word;

variable to store incoming gif data

TopSlot : Word;

position that next new code is to be added

UseLocalColors : boolean;

image descriptor


Constructors


constructor Create;

--------------------------------------------------------------------------- } { TGif


Functions


destructor Destroy;


procedure CreateBitHeader(Stream:TStream);

create line of bitmap data

while


procedure CreateLine;

reads data subblock from stream

all colors are important


procedure Decode(Stream:TStream);

takes gif header information and converts it to BMP

mask off the right number of bits


procedure Error(ErrCode: integer);

returns the next available code

Decode the GIF


procedure InitCompressionStream(Stream:TStream);

guess what this is for!

check for stream error


procedure LoadFromStream(Stream: TStream);


function NextCode(Stream:TStream): word;

parse memory/file

reset bytes left


procedure ParseMem(Stream:TStream);

image data} {Member Functions

Raise exception with message


procedure ReadSubBlock(Stream:TStream);

initializes info for decode

Clear other variables


procedure SaveToStream(Stream: TStream);

Prepare for next line


Properties


Events


Variables


BitsLeft : Integer;

number of entries in color table


BmHeader : TBitmapInfoHeader;

interlace pass number


BmpStream : TMemoryStream;

memory stream for gif file


BytesLeft : Integer;

bits left in byte


ClearCode : Integer;

current size of code in bits


CurrByte : Byte;

index to next byte in datablock array


CurrCodeSize : Integer;

bytes left in block


CurrentY : Integer;

array for buffer line output


DecodeStack : array[0..MAXCODES] of byte;

current byte


EndingCode : Integer;

clear code value


GifStream : TMemoryStream;


GlobalColorTable : TColorTable;

gif screen descriptor


Header : THeader;

memory stream for bitmap data


HighCode : Word;

highest slot position for current code size


ImageData : TDataSubBlock;

minimum size of LZW codes in bits


ImageDescriptor : TImageDescriptor;

local color table


ImageLines : TList;

file header for bitmap file


Interlaced : boolean;

true if local colors in use


InterlacePass : byte;

current screen locations


LineBuffer : GraphicLine;

array for code suffixes


LocalColorTable : TColorTable;

global color table


LogicalScreen : TLogicalScreenDescriptor;

gif file header


LZWCodeSize : Byte;

true if image is interlaced


NextByte : Integer;

highest code that does not require decoding


Prefix : array[0..MAXCODES] of integer;

stack for decoded codes


Slot : Word;

ending code value


Suffix : array[0..MAXCODES] of integer;

array for code prefixes


TableSize : Word;

variable to store incoming gif data


TopSlot : Word;

position that next new code is to be added


UseLocalColors : boolean;

image descriptor