com.lowagie.text.pdf.codec
public class GifImage extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
GifImage.GifFrame |
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 java.util.ArrayList |
frames |
protected byte[] |
fromData |
protected java.net.URL |
fromUrl |
protected boolean |
gctFlag |
protected int |
height |
protected int |
ih |
protected java.io.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(java.io.InputStream is)
Reads gif images from a stream.
|
GifImage(java.lang.String file)
Reads gif images from a file.
|
GifImage(java.net.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) |
(package private) void |
process(java.io.InputStream is) |
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 java.io.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 java.net.URL fromUrl
protected java.util.ArrayList frames
public GifImage(java.net.URL url) throws java.io.IOException
url
- the URLjava.io.IOException
- on errorpublic GifImage(java.lang.String file) throws java.io.IOException
file
- the filejava.io.IOException
- on errorpublic GifImage(byte[] data) throws java.io.IOException
data
- the byte arrayjava.io.IOException
- on errorpublic GifImage(java.io.InputStream is) throws java.io.IOException
is
- the streamjava.io.IOException
- on errorpublic int getFrameCount()
public Image getImage(int frame)
frame
- the frame to get the image frompublic int[] getFramePosition(int frame)
frame
- the framepublic int[] getLogicalScreen()
void process(java.io.InputStream is) throws java.io.IOException
java.io.IOException
protected void readHeader() throws java.io.IOException
java.io.IOException
protected void readLSD() throws java.io.IOException
java.io.IOException
protected int readShort() throws java.io.IOException
java.io.IOException
protected int readBlock() throws java.io.IOException
java.io.IOException
protected byte[] readColorTable(int bpc) throws java.io.IOException
java.io.IOException
protected static int newBpc(int bpc)
protected void readContents() throws java.io.IOException
java.io.IOException
protected void readImage() throws java.io.IOException
java.io.IOException
protected boolean decodeImageData() throws java.io.IOException
java.io.IOException
protected void setPixel(int x, int y, int v)
protected void resetFrame()
protected void readGraphicControlExt() throws java.io.IOException
java.io.IOException
protected void skip() throws java.io.IOException
java.io.IOException