C# Class ScreenToGif.ImageUtil.GifDecoder

Gif Reader Class
Datei anzeigen Open project: dbremner/ScreenToGif Class Usage Examples

Public Methods

Method Description
GetDelay ( int index ) : int

Gets display duration for specified frame.

GetFrame ( int n ) : Image

Gets the image contents of frame n.

GetFrameCount ( ) : int

Gets the number of frames read from file.

GetFrameSize ( ) : Size

Gets image size.

GetImage ( ) : Image

Gets the first (or only) image read.

GetLoopCount ( ) : int

Gets the "Netscape" iteration count, if any. A count of 0 means repeat indefinitiely.

Read ( Stream inStream ) : int

Reads GIF image from stream.

Read ( String name ) : int

Reads GIF file from specified file/URL source (URL assumed if name contains ":/" or "file:")

Protected Methods

Method Description
DecodeImageData ( ) : void

Decodes LZW image data into pixel array. Adapted from John Cristy's ImageMagick.

Error ( ) : bool

The read state.

Init ( ) : void

Initializes or re-initializes reader.

Read ( ) : int

Reads a single byte from the input stream.

ReadBlock ( ) : int

Reads next variable length block from input.

ReadContents ( ) : void

Main file parser. Reads GIF content blocks.

ReadGraphicControlExt ( ) : void

Reads Graphics Control Extension values.

ReadHeader ( ) : void

Reads GIF file header information.

ReadImage ( ) : void

Reads next frame image.

ReadLsd ( ) : void

Reads Logical Screen Descriptor

ReadNetscapeExt ( ) : void

Reads Netscape extenstion to obtain iteration count.

ReadShort ( ) : int

Reads next 16-bit value, LSB first.

ResetFrame ( ) : void

Resets frame state for reading next image.

Skip ( ) : void

Skips variable length blocks up to and including next zero length block.

Private Methods

Method Description
GetPixels ( Bitmap bitmap ) : int[]

Creates new frame image from current data (and previous frames as specified by their disposition codes).

ReadColorTable ( int numberColors ) : int[]

Reads color table as 256 RGB integer values

SetPixels ( ) : void
SetPixels ( int pixels ) : void

Method Details

DecodeImageData() protected method

Decodes LZW image data into pixel array. Adapted from John Cristy's ImageMagick.
protected DecodeImageData ( ) : void
return void

Error() protected method

The read state.
protected Error ( ) : bool
return bool

GetDelay() public method

Gets display duration for specified frame.
public GetDelay ( int index ) : int
index int Int index of frame.
return int

GetFrame() public method

Gets the image contents of frame n.
public GetFrame ( int n ) : Image
n int
return Image

GetFrameCount() public method

Gets the number of frames read from file.
public GetFrameCount ( ) : int
return int

GetFrameSize() public method

Gets image size.
public GetFrameSize ( ) : Size
return System.Drawing.Size

GetImage() public method

Gets the first (or only) image read.
public GetImage ( ) : Image
return Image

GetLoopCount() public method

Gets the "Netscape" iteration count, if any. A count of 0 means repeat indefinitiely.
public GetLoopCount ( ) : int
return int

Init() protected method

Initializes or re-initializes reader.
protected Init ( ) : void
return void

Read() protected method

Reads a single byte from the input stream.
protected Read ( ) : int
return int

Read() public method

Reads GIF image from stream.
public Read ( Stream inStream ) : int
inStream Stream BufferedInputStream containing GIF file.
return int

Read() public method

Reads GIF file from specified file/URL source (URL assumed if name contains ":/" or "file:")
public Read ( String name ) : int
name String String containing source.
return int

ReadBlock() protected method

Reads next variable length block from input.
protected ReadBlock ( ) : int
return int

ReadContents() protected method

Main file parser. Reads GIF content blocks.
protected ReadContents ( ) : void
return void

ReadGraphicControlExt() protected method

Reads Graphics Control Extension values.
protected ReadGraphicControlExt ( ) : void
return void

ReadHeader() protected method

Reads GIF file header information.
protected ReadHeader ( ) : void
return void

ReadImage() protected method

Reads next frame image.
protected ReadImage ( ) : void
return void

ReadLsd() protected method

Reads Logical Screen Descriptor
protected ReadLsd ( ) : void
return void

ReadNetscapeExt() protected method

Reads Netscape extenstion to obtain iteration count.
protected ReadNetscapeExt ( ) : void
return void

ReadShort() protected method

Reads next 16-bit value, LSB first.
protected ReadShort ( ) : int
return int

ResetFrame() protected method

Resets frame state for reading next image.
protected ResetFrame ( ) : void
return void

Skip() protected method

Skips variable length blocks up to and including next zero length block.
protected Skip ( ) : void
return void