|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.alee.graphics.image.gif.GifDecoder
public class GifDecoder
Nested Class Summary | |
---|---|
static class |
GifDecoder.GifFrame
|
Field Summary | |
---|---|
static int |
STATUS_FORMAT_ERROR
File read status: Error decoding file (may be partially decoded) |
static int |
STATUS_OK
File read status: No errors. |
static int |
STATUS_OPEN_ERROR
File read status: Unable to open source. |
Constructor Summary | |
---|---|
GifDecoder()
|
Method Summary | |
---|---|
protected void |
decodeImageData()
Decodes LZW image data into pixel array. |
protected boolean |
err()
Returns true if an error was encountered during reading/decoding |
java.awt.image.BufferedImage |
getCurrentBufImg()
Gets the first (or only) image read. |
int |
getDelay(int n)
Gets display duration for specified frame. |
java.awt.image.BufferedImage |
getFrame(int n)
Gets the image contents of frame n. |
int |
getFrameCount()
Gets the number of frames read from file. |
int |
getLoopCount()
Gets the "Netscape" iteration count, if any. |
int |
getPixelAspect()
|
int |
getStatus()
Additional getters |
protected void |
init()
Initializes or re-initializes reader |
protected int |
read()
Reads a single byte from the input stream. |
int |
read(java.io.BufferedInputStream is)
|
int |
read(java.lang.String name)
Reads GIF file from specified source (file or URL string) |
protected int |
readBlock()
Reads next variable length block from input. |
protected int[] |
readColorTable(int ncolors)
Reads color table as 256 RGB integer values |
protected void |
readContents()
Main file parser. |
protected void |
readGraphicControlExt()
Reads Graphics Control Extension values |
protected void |
readHeader()
Reads GIF file header information. |
protected void |
readImage()
Reads next frame image |
protected void |
readLSD()
Reads Logical Screen Descriptor |
protected void |
readNetscapeExt()
Reads Netscape extenstion to obtain iteration count |
protected int |
readShort()
Reads next 16-bit value, LSB first |
protected void |
resetFrame()
Resets frame state for reading next image. |
protected void |
setPixels()
Creates new frame image from current data (and previous frames as specified by their disposition codes). |
protected void |
skip()
Skips variable length blocks up to and including next zero length block. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STATUS_OK
public static final int STATUS_FORMAT_ERROR
public static final int STATUS_OPEN_ERROR
Constructor Detail |
---|
public GifDecoder()
Method Detail |
---|
public int getPixelAspect()
public int getDelay(int n)
n
- int index of frame
public java.awt.image.BufferedImage getFrame(int n)
public int getFrameCount()
public java.awt.image.BufferedImage getCurrentBufImg()
public int getLoopCount()
public int read(java.io.BufferedInputStream is)
is
- An inputStream with gif animation
public int read(java.lang.String name)
name
- String containing source
protected void decodeImageData()
protected boolean err()
protected void init()
protected int read()
protected int readBlock()
protected int[] readColorTable(int ncolors)
ncolors
- int number of colors to read
protected void readContents()
protected void readGraphicControlExt()
protected void readHeader()
protected void readImage()
protected void readLSD()
protected void readNetscapeExt()
protected int readShort()
protected void resetFrame()
protected void setPixels()
protected void skip()
public int getStatus()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |