public class GifDecoder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int[] |
act |
protected int |
bgColor |
protected int |
bgIndex |
protected byte[] |
block |
protected int |
blockSize |
protected int |
delay |
protected int |
dispose |
protected int |
frameCount |
protected java.util.Vector<com.holidaystudios.tools.GifDecoder.GifFrame> |
frames |
protected int[] |
gct |
protected boolean |
gctFlag |
protected int |
gctSize |
protected int |
height |
protected int |
ih |
protected com.holidaystudios.tools.GifDecoder.DixieMap |
image |
protected java.io.InputStream |
in |
protected boolean |
interlace |
protected int |
iw |
protected int |
ix |
protected int |
iy |
protected int |
lastBgColor |
protected int |
lastDispose |
protected com.holidaystudios.tools.GifDecoder.DixieMap |
lastPixmap |
protected int[] |
lct |
protected boolean |
lctFlag |
protected int |
lctSize |
protected int |
loopCount |
protected int |
lrh |
protected int |
lrw |
protected int |
lrx |
protected int |
lry |
protected static int |
MAX_STACK_SIZE
max decoder pixel stack size
|
protected int |
pixelAspect |
protected byte[] |
pixels |
protected byte[] |
pixelStack |
protected short[] |
prefix |
protected int |
status |
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.
|
protected byte[] |
suffix |
protected int |
transIndex |
protected boolean |
transparency |
protected int |
width |
Constructor and Description |
---|
GifDecoder() |
Modifier and Type | Method and Description |
---|---|
protected void |
decodeBitmapData()
Decodes LZW image data into pixel array.
|
protected boolean |
err()
Returns true if an error was encountered during reading/decoding
|
com.badlogic.gdx.graphics.g2d.Animation<com.badlogic.gdx.graphics.g2d.TextureRegion> |
getAnimation(com.badlogic.gdx.graphics.g2d.Animation.PlayMode playMode) |
int |
getDelay(int n)
Gets display duration for specified frame.
|
com.holidaystudios.tools.GifDecoder.DixieMap |
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.
|
com.badlogic.gdx.graphics.Pixmap |
getPixmap()
Gets the first (or only) image read.
|
protected void |
init()
Initializes or re-initializes reader
|
static com.badlogic.gdx.graphics.g2d.Animation<com.badlogic.gdx.graphics.g2d.TextureRegion> |
loadGIFAnimation(com.badlogic.gdx.graphics.g2d.Animation.PlayMode playMode,
java.io.InputStream is) |
void |
prepAnimation() |
protected int |
read()
Reads a single byte from the input stream.
|
int |
read(java.io.InputStream is)
Reads GIF image from stream
|
protected void |
readBitmap()
Reads next frame image
|
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 |
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.
|
public static final int STATUS_OK
public static final int STATUS_FORMAT_ERROR
public static final int STATUS_OPEN_ERROR
protected static final int MAX_STACK_SIZE
protected java.io.InputStream in
protected int status
protected int width
protected int height
protected boolean gctFlag
protected int gctSize
protected int loopCount
protected int[] gct
protected int[] lct
protected int[] act
protected int bgIndex
protected int bgColor
protected int lastBgColor
protected int pixelAspect
protected boolean lctFlag
protected boolean interlace
protected int lctSize
protected int ix
protected int iy
protected int iw
protected int ih
protected int lrx
protected int lry
protected int lrw
protected int lrh
protected com.holidaystudios.tools.GifDecoder.DixieMap image
protected com.holidaystudios.tools.GifDecoder.DixieMap lastPixmap
protected byte[] block
protected int blockSize
protected int dispose
protected int lastDispose
protected boolean transparency
protected int delay
protected int transIndex
protected short[] prefix
protected byte[] suffix
protected byte[] pixelStack
protected byte[] pixels
protected java.util.Vector<com.holidaystudios.tools.GifDecoder.GifFrame> frames
protected int frameCount
public static com.badlogic.gdx.graphics.g2d.Animation<com.badlogic.gdx.graphics.g2d.TextureRegion> loadGIFAnimation(com.badlogic.gdx.graphics.g2d.Animation.PlayMode playMode, java.io.InputStream is)
public int getDelay(int n)
n
- int index of framepublic int getFrameCount()
public com.badlogic.gdx.graphics.Pixmap getPixmap()
public int getLoopCount()
protected void setPixels()
public com.holidaystudios.tools.GifDecoder.DixieMap getFrame(int n)
public int read(java.io.InputStream is)
is
- containing GIF file.protected void decodeBitmapData()
protected boolean err()
protected void init()
protected int read()
protected int readBlock()
protected int[] readColorTable(int ncolors)
ncolors
- int number of colors to readprotected void readContents()
protected void readGraphicControlExt()
protected void readHeader()
protected void readBitmap()
protected void readLSD()
protected void readNetscapeExt()
protected int readShort()
protected void resetFrame()
protected void skip()
public void prepAnimation()
public com.badlogic.gdx.graphics.g2d.Animation<com.badlogic.gdx.graphics.g2d.TextureRegion> getAnimation(com.badlogic.gdx.graphics.g2d.Animation.PlayMode playMode)