Package com.itextpdf.io.image
Class GifImageHelper
- java.lang.Object
-
- com.itextpdf.io.image.GifImageHelper
-
public final class GifImageHelper extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
GifImageHelper.GifParameters
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
MAX_STACK_SIZE
-
Constructor Summary
Constructors Constructor Description GifImageHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static boolean
decodeImageData(GifImageHelper.GifParameters gif)
private static int
newBpc(int bpc)
private static void
process(java.io.InputStream stream, GifImageHelper.GifParameters gif, int lastFrameNumber)
static void
processImage(GifImageData image)
Reads image source and fills GifImage object with parameters (frames, width, height)static void
processImage(GifImageData image, int lastFrameNumber)
Reads image source and fills GifImage object with parameters (frames, width, height)private static int
readBlock(GifImageHelper.GifParameters gif)
Reads next variable length block from input.private static byte[]
readColorTable(int bpc, GifImageHelper.GifParameters gif)
private static void
readContents(GifImageHelper.GifParameters gif, int lastFrameNumber)
private static void
readFrame(GifImageHelper.GifParameters gif)
Reads next frame imageprivate static void
readGraphicControlExt(GifImageHelper.GifParameters gif)
Reads Graphics Control Extension valuesprivate static void
readHeader(GifImageHelper.GifParameters gif)
Reads GIF file header information.private static void
readLSD(GifImageHelper.GifParameters gif)
Reads Logical Screen Descriptorprivate static int
readShort(GifImageHelper.GifParameters gif)
Reads next 16-bit value, LSB firstprivate static void
setPixel(int x, int y, int v, GifImageHelper.GifParameters gif)
private static void
skip(GifImageHelper.GifParameters gif)
Skips variable length blocks up to and including next zero length block.
-
-
-
Field Detail
-
MAX_STACK_SIZE
static final int MAX_STACK_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
processImage
public static void processImage(GifImageData image)
Reads image source and fills GifImage object with parameters (frames, width, height)- Parameters:
image
- GifImage
-
processImage
public static void processImage(GifImageData image, int lastFrameNumber)
Reads image source and fills GifImage object with parameters (frames, width, height)- Parameters:
image
- GifImagelastFrameNumber
- the last frame of the gif image should be read
-
process
private static void process(java.io.InputStream stream, GifImageHelper.GifParameters gif, int lastFrameNumber) throws java.io.IOException
- Throws:
java.io.IOException
-
readHeader
private static void readHeader(GifImageHelper.GifParameters gif) throws java.io.IOException
Reads GIF file header information.- Throws:
java.io.IOException
-
readLSD
private static void readLSD(GifImageHelper.GifParameters gif) throws java.io.IOException
Reads Logical Screen Descriptor- Throws:
java.io.IOException
-
readShort
private static int readShort(GifImageHelper.GifParameters gif) throws java.io.IOException
Reads next 16-bit value, LSB first- Throws:
java.io.IOException
-
readBlock
private static int readBlock(GifImageHelper.GifParameters gif) throws java.io.IOException
Reads next variable length block from input.- Returns:
- number of bytes stored in "buffer"
- Throws:
java.io.IOException
-
readColorTable
private static byte[] readColorTable(int bpc, GifImageHelper.GifParameters gif) throws java.io.IOException
- Throws:
java.io.IOException
-
newBpc
private static int newBpc(int bpc)
-
readContents
private static void readContents(GifImageHelper.GifParameters gif, int lastFrameNumber) throws java.io.IOException
- Throws:
java.io.IOException
-
readFrame
private static void readFrame(GifImageHelper.GifParameters gif) throws java.io.IOException
Reads next frame image- Throws:
java.io.IOException
-
decodeImageData
private static boolean decodeImageData(GifImageHelper.GifParameters gif) throws java.io.IOException
- Throws:
java.io.IOException
-
setPixel
private static void setPixel(int x, int y, int v, GifImageHelper.GifParameters gif)
-
readGraphicControlExt
private static void readGraphicControlExt(GifImageHelper.GifParameters gif) throws java.io.IOException
Reads Graphics Control Extension values- Throws:
java.io.IOException
-
skip
private static void skip(GifImageHelper.GifParameters gif) throws java.io.IOException
Skips variable length blocks up to and including next zero length block.- Throws:
java.io.IOException
-
-