public class GIFImageLoader2 extends ImageLoaderImpl
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
GIFImageLoader2.LZWDecoder |
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
bgColor |
(package private) static int |
DEFAULT_FPS |
(package private) static byte[] |
FILE_SIG87 |
(package private) static byte[] |
FILE_SIG89 |
(package private) byte[][] |
globalPalette |
(package private) byte[] |
image |
(package private) int |
loopCount |
(package private) static byte[] |
NETSCAPE_SIG |
(package private) int |
screenH |
(package private) int |
screenW |
(package private) java.io.InputStream |
stream |
formatDescription, lastPercentDone, listeners| Constructor and Description |
|---|
GIFImageLoader2(java.io.InputStream input) |
| Modifier and Type | Method and Description |
|---|---|
private int[] |
computeInterlaceReIndex(int h) |
private void |
consumeAnExtension() |
private void |
decodeImage(byte[] image,
int w,
int h,
int[] interlace) |
private java.nio.ByteBuffer |
decodePalette(byte[] srcImage,
byte[][] palette,
int trnsIndex,
int left,
int top,
int w,
int h,
int disposalCode) |
void |
dispose()
Disposes of any resources (such as native libraries) held by this loader.
|
ImageFrame |
load(int imageIndex,
int width,
int height,
boolean preserveAspectRatio,
boolean smooth)
Loads the image at a given index in an image stream.
|
private void |
readAppExtension() |
private int |
readByte() |
private byte[] |
readBytes(byte[] data) |
private byte[] |
readBytes(byte[] data,
int offs,
int size) |
private int |
readControlCode() |
private void |
readGlobalHeader() |
private byte[][] |
readPalete(int size,
int trnsIndex) |
private int |
readShort() |
private void |
restoreToBackground(byte[] img,
int left,
int top,
int w,
int h) |
private void |
skipBytes(int n) |
private ImageMetadata |
updateMetadata(int w,
int h,
int delayTime) |
private int |
waitForImageFrame() |
addListener, emitWarning, getFormatDescription, removeListener, updateImageMetadata, updateImageProgressstatic final byte[] FILE_SIG87
static final byte[] FILE_SIG89
static final byte[] NETSCAPE_SIG
static final int DEFAULT_FPS
java.io.InputStream stream
int screenW
int screenH
int bgColor
byte[][] globalPalette
byte[] image
int loopCount
public GIFImageLoader2(java.io.InputStream input)
throws java.io.IOException
java.io.IOExceptionprivate void readGlobalHeader()
throws java.io.IOException
java.io.IOExceptionprivate byte[][] readPalete(int size,
int trnsIndex)
throws java.io.IOException
java.io.IOExceptionprivate void consumeAnExtension()
throws java.io.IOException
java.io.IOExceptionprivate void readAppExtension()
throws java.io.IOException
java.io.IOExceptionprivate int readControlCode()
throws java.io.IOException
java.io.IOExceptionprivate int waitForImageFrame()
throws java.io.IOException
java.io.IOExceptionprivate void decodeImage(byte[] image,
int w,
int h,
int[] interlace)
throws java.io.IOException
java.io.IOExceptionprivate int[] computeInterlaceReIndex(int h)
public ImageFrame load(int imageIndex, int width, int height, boolean preserveAspectRatio, boolean smooth) throws java.io.IOException
ImageLoadernull will be returned.imageIndex - the zero-relative index of the image to load.width - the desired image width. If non-positive,
an IllegalArgumentException will be thrown.height - the desired image height. If non-positive,
an IllegalArgumentException will be thrown.preserveAspectRatio - whether to preserve the width-to-height ratio
of the image.smooth - whether to use a smooth downscaling algorithm.null on error.java.io.IOExceptionprivate int readByte()
throws java.io.IOException
java.io.IOExceptionprivate int readShort()
throws java.io.IOException
java.io.IOExceptionprivate byte[] readBytes(byte[] data)
throws java.io.IOException
java.io.IOExceptionprivate byte[] readBytes(byte[] data,
int offs,
int size)
throws java.io.IOException
java.io.IOExceptionprivate void skipBytes(int n)
throws java.io.IOException
java.io.IOExceptionpublic void dispose()
ImageLoaderprivate void restoreToBackground(byte[] img,
int left,
int top,
int w,
int h)
private java.nio.ByteBuffer decodePalette(byte[] srcImage,
byte[][] palette,
int trnsIndex,
int left,
int top,
int w,
int h,
int disposalCode)
private ImageMetadata updateMetadata(int w, int h, int delayTime)