Unit GifDecl

Classes

EGifException - TDecodeRecord
TByteBuffer - TExtensionList
TCodeTable - TByteBuffer
TEncodedBytes - TCodeTable
TExtension - TExtensionRecord
TExtensionList - TExtension } { declared as class to make storage in a TList possible

Functions

CheckType - TEncodedBytes

TEncodedBytes.
NextLineNo - Finds out whether the file is a gif or bmp (or unknown) file

CheckType

Types

TApplicationExtension
TDecodeRecord
TDisposalMethod
TExtensionRecord
TExtensionType
TGifHeader
TGraphicControlExtension
TGraphicFileType
TImageDescriptor
TLogicalScreenDescriptor
TPlainTextExtension

Constants

CodeMask
CodeTableSize
ExtensionIntroducer
idColorTableSize
idInterlaced
idLocalColorTable
idReserved
idSort
ImageSeparator
lsdColorResolution
lsdColorTableSize
lsdGlobalColorTable
lsdSort
Trailer

Variables


Functions


function CheckType(Filename: String): TGraphicFileType;

TEncodedBytes

TEncodedBytes.Finish } (***** end of methods of TEncodedBytes


function NextLineNo(LineNo, ImageHeight: Integer; var InterlacePass: Integer): Integer;

Finds out whether the file is a gif or bmp (or unknown) file

CheckType


Types


TApplicationExtension = record
BlockSize : Byte;
ApplicationIdentifier : array[1..8] of Byte;
AppAuthenticationCode : array[1..3] of Byte;
AppData : TStringList;
end;
TPlainTextExtension
TDecodeRecord = record
BitsLeft : Integer;
CurrByte : Longint;
CurrentY : Integer;
InterlacePass : Integer;
LZWCodeSize : Byte;
CurrCodeSize : Integer;
ClearCode : Integer;
EndingCode : Integer;
HighCode : Word;
end;
Who knows JPG and others will be available some day
TDisposalMethod = (dmNone, dmNotDispose, dmRestoreBackgroundColor,
                     dmRestorePrevious, dm4, dm5, dm6, dm7);

TExtensionRecord = record
end;
TApplicationExtension
TExtensionType = (etGCE, etPTE, etAPPE, etCE);
TImageDescriptor
TGifHeader = record
Signature : array[0..2] of char;
Version : array[0..2] of char;
end;

TGraphicControlExtension = record
BlockSize : byte;
PackedFields : Byte;
DelayTime : Word;
TransparentColorIndex : Byte;
Terminator : Byte;
end;

TGraphicFileType = (BMP, GIF, unknown);
bit masks for use with Next code
TImageDescriptor = record
ImageLeftPos : word;
ImageTopPos : word;
ImageWidth : word;
ImageHeight : word;
PackedFields : byte;
end;
TLogicalScreenDescriptor
TLogicalScreenDescriptor = record
ScreenWidth : word;
ScreenHeight : word;
PackedFields : byte;
BackGroundColorIndex : byte;
AspectRatio : byte;
end;
TGifHeader
TPlainTextExtension = record
BlockSize : byte;
Left : Word;
Top : Word;
Width : Word;
Height : Word;
CellWidth : Byte;
CellHeight : Byte;
TextFGColorIndex : Byte;
TextBGColorIndex : Byte;
PlainTextData : TStringList;
end;
TGraphicControlExtension

Constants

CodeMask = ( { bit masks for use with Next code } 0, $0001, $0003, $0007, $000F, $001F, $003F, $007F, $00FF, $01FF, $03FF, $07FF, $0FFF)

CodeTableSize = 4096

size of global color table - 3 bits } { Actual size = 2^value+1 - value is 3 bits

ExtensionIntroducer = Ord('!')

size of color table as above

idColorTableSize = $07

reserved - must be set to $00

idInterlaced = $40

set if a local color table follows

idLocalColorTable = $80

image descriptor bit masks

idReserved = $0C

set if color table is sorted

idSort = $20

set if image is interlaced

ImageSeparator = Ord(',')

lsdColorResolution = $70

set if global color table follows L.S.D.

lsdColorTableSize = $07

set if global color table is sorted - 1 bit

lsdGlobalColorTable = $80

indicates the end of the GIF data stream } { logical screen descriptor packed field masks

lsdSort = $08

Color resolution - 3 bits

Trailer = Ord(';')


Variables