Class TGif (unit GifCode) |
Inherits from
TObject
constructor Create;
- Takes the gif header information and converts it to BMP
------------------------------------------------------------------------------} { TGif
procedure ConvertfromMem(AMemStream: TMemoryStream; ABmpName: string);
------------------------------------------------------------------------------
procedure Decode;
------------------------------------------------------------------------------
destructor Destroy;
------------------------------------------------------------------------------
procedure GifConvert(AGifName: string);
------------------------------------------------------------------------------
procedure GifToBmp(AGifName, ABmpName: string);
------------------------------------------------------------------------------
procedure WriteBitmapToFile(ABMPName: string);
------------------------------------------------------------------------------
procedure WriteBitmapToStream;
------------------------------------------------------------------------------
procedure CreateBitHeader;
------------------------------------------------------------------------------
procedure CreateLine;
reads a data subblock from the stream ------------------------------------------------------------------------------} {fills in Line list with current line
procedure Error(ErrCode: integer);
returns the next available code ------------------------------------------------------------------------------} {Raise exception with a message
procedure InitCompressionStream;
------------------------------------------------------------------------------
function NextCode: word;
------------------------------------------------------------------------------
procedure ParseMem;
Member Functions------------------------------------------------------------------------------
procedure ReadSubBlock;
initializes info for decode ------------------------------------------------------------------------------
BadCodeCount : word;
bits left in byte - bytes left in block
BitsLeft : integer;
number of entrys in the color table
BmHeader : TBitmapInfoHeader;
interlace pass number } {Conversion Routine Vars
BmpStream : TMemoryStream;
Image data
BytesLeft : integer;
ClearCode : integer;
Current size of code in bits
CurrByte : byte;
the index to the next byte in the datablock array
CurrCodeSize : integer;
bad code counter
CurrentX : integer;
array for buffer line output
CurrentY : integer;
DecodeStack : array[0..MAXCODES] of byte;
the current byte
EndingCode : integer;
Clear code value
GifStream : TMemoryStream;
GlobalColorTable : TColorTable;
gif screen descriptor
Header : THeader;
the file stream for the gif file
HighCode : word;
highest slot position for the current code size
ImageData : TDataSubBlock;
minimum size of the 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;
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 the decoded codes
Slot : word;
ending code value
Status : word;
current screen locations
Suffix : array[0..MAXCODES] of integer;
array for code prefixes
TableSize : word;
variable to store incoming gif data
TopSlot : word;
position that the next new code is to be added
UseLocalColors : boolean;
image descriptor
constructor Create;
Takes the gif header information and converts it to BMP
------------------------------------------------------------------------------} { TGif
procedure ConvertfromMem(AMemStream: TMemoryStream; ABmpName: string);
------------------------------------------------------------------------------
procedure Decode;
------------------------------------------------------------------------------
destructor Destroy;
------------------------------------------------------------------------------
procedure GifConvert(AGifName: string);
------------------------------------------------------------------------------
procedure GifToBmp(AGifName, ABmpName: string);
------------------------------------------------------------------------------
procedure WriteBitmapToFile(ABMPName: string);
------------------------------------------------------------------------------
procedure WriteBitmapToStream;
------------------------------------------------------------------------------
procedure CreateBitHeader;
------------------------------------------------------------------------------
procedure CreateLine;
reads a data subblock from the stream
------------------------------------------------------------------------------} {fills in Line list with current line
procedure Error(ErrCode: integer);
returns the next available code
------------------------------------------------------------------------------} {Raise exception with a message
procedure InitCompressionStream;
------------------------------------------------------------------------------
function NextCode: word;
------------------------------------------------------------------------------
procedure ParseMem;
Member Functions
------------------------------------------------------------------------------
procedure ReadSubBlock;
initializes info for decode
------------------------------------------------------------------------------
BadCodeCount : word;
bits left in byte - bytes left in block
BitsLeft : integer;
number of entrys in the color table
BmHeader : TBitmapInfoHeader;
interlace pass number } {Conversion Routine Vars
BmpStream : TMemoryStream;
Image data
BytesLeft : integer;
ClearCode : integer;
Current size of code in bits
CurrByte : byte;
the index to the next byte in the datablock array
CurrCodeSize : integer;
bad code counter
CurrentX : integer;
array for buffer line output
CurrentY : integer;
DecodeStack : array[0..MAXCODES] of byte;
the current byte
EndingCode : integer;
Clear code value
GifStream : TMemoryStream;
GlobalColorTable : TColorTable;
gif screen descriptor
Header : THeader;
the file stream for the gif file
HighCode : word;
highest slot position for the current code size
ImageData : TDataSubBlock;
minimum size of the 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;
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 the decoded codes
Slot : word;
ending code value
Status : word;
current screen locations
Suffix : array[0..MAXCODES] of integer;
array for code prefixes
TableSize : word;
variable to store incoming gif data
TopSlot : word;
position that the next new code is to be added
UseLocalColors : boolean;
image descriptor