public class GifImage extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
bgColor |
protected int |
bgIndex |
protected byte[] |
block |
protected int |
blockSize |
protected int |
delay |
protected int |
dispose |
protected ArrayList |
frames |
protected byte[] |
fromData |
protected URL |
fromUrl |
protected boolean |
gctFlag |
protected int |
height |
protected int |
ih |
protected DataInputStream |
in |
protected boolean |
interlace |
protected int |
iw |
protected int |
ix |
protected int |
iy |
protected boolean |
lctFlag |
protected int |
lctSize |
protected int |
m_bpc |
protected byte[] |
m_curr_table |
protected int |
m_gbpc |
protected byte[] |
m_global_table |
protected int |
m_line_stride |
protected byte[] |
m_local_table |
protected byte[] |
m_out |
protected static int |
MaxStackSize |
protected int |
pixelAspect |
protected byte[] |
pixels |
protected byte[] |
pixelStack |
protected short[] |
prefix |
protected byte[] |
suffix |
protected int |
transIndex |
protected boolean |
transparency |
protected int |
width |
Constructor and Description |
---|
GifImage(byte[] data)
Reads gif images from a byte array.
|
GifImage(InputStream is)
Reads gif images from a stream.
|
GifImage(String file)
Reads gif images from a file.
|
GifImage(URL url)
Reads gif images from an URL.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
decodeImageData() |
int |
getFrameCount()
Gets the number of frames the gif has.
|
int[] |
getFramePosition(int frame)
Gets the [x,y] position of the frame in reference to the logical screen.
|
Image |
getImage(int frame)
Gets the image from a frame.
|
int[] |
getLogicalScreen()
Gets the logical screen.
|
protected static int |
newBpc(int bpc) |
protected int |
readBlock()
Reads next variable length block from input.
|
protected byte[] |
readColorTable(int bpc) |
protected void |
readContents() |
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 int |
readShort()
Reads next 16-bit value, LSB first
|
protected void |
resetFrame()
Resets frame state for reading next image.
|
protected void |
setPixel(int x, int y, int v) |
protected void |
skip()
Skips variable length blocks up to and including next zero length block.
|
protected DataInputStream in
protected int width
protected int height
protected boolean gctFlag
protected int bgIndex
protected int bgColor
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 byte[] block
protected int blockSize
protected int dispose
protected boolean transparency
protected int delay
protected int transIndex
protected static final int MaxStackSize
protected short[] prefix
protected byte[] suffix
protected byte[] pixelStack
protected byte[] pixels
protected byte[] m_out
protected int m_bpc
protected int m_gbpc
protected byte[] m_global_table
protected byte[] m_local_table
protected byte[] m_curr_table
protected int m_line_stride
protected byte[] fromData
protected URL fromUrl
protected ArrayListframes
public GifImage(URL url) throws IOException
url
- the URL
IOException
- on error
public GifImage(String file) throws IOException
file
- the file
IOException
- on error
public GifImage(byte[] data) throws IOException
data
- the byte array
IOException
- on error
public GifImage(InputStream is) throws IOException
is
- the stream
IOException
- on error
public int getFrameCount()
public Image getImage(int frame)
frame
- the frame to get the image from
public int[] getFramePosition(int frame)
frame
- the frame
public int[] getLogicalScreen()
protected void readHeader() throws IOException
IOException
protected void readLSD() throws IOException
IOException
protected int readShort() throws IOException
IOException
protected int readBlock() throws IOException
IOException
protected byte[] readColorTable(int bpc) throws IOException
IOException
protected static int newBpc(int bpc)
protected void readContents() throws IOException
IOException
protected void readImage() throws IOException
IOException
protected boolean decodeImageData() throws IOException
IOException
protected void setPixel(int x, int y, int v)
protected void resetFrame()
protected void readGraphicControlExt() throws IOException
IOException
protected void skip() throws IOException
IOException
Copyright © 1998–2018. All rights reserved.