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 classGifImageHelper.GifParameters
-
Field Summary
Fields Modifier and Type Field Description (package private) static intMAX_STACK_SIZE
-
Constructor Summary
Constructors Constructor Description GifImageHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static booleandecodeImageData(GifImageHelper.GifParameters gif)private static intnewBpc(int bpc)private static voidprocess(java.io.InputStream stream, GifImageHelper.GifParameters gif, int lastFrameNumber)static voidprocessImage(GifImageData image)Reads image source and fills GifImage object with parameters (frames, width, height)static voidprocessImage(GifImageData image, int lastFrameNumber)Reads image source and fills GifImage object with parameters (frames, width, height)private static intreadBlock(GifImageHelper.GifParameters gif)Reads next variable length block from input.private static byte[]readColorTable(int bpc, GifImageHelper.GifParameters gif)private static voidreadContents(GifImageHelper.GifParameters gif, int lastFrameNumber)private static voidreadFrame(GifImageHelper.GifParameters gif)Reads next frame imageprivate static voidreadGraphicControlExt(GifImageHelper.GifParameters gif)Reads Graphics Control Extension valuesprivate static voidreadHeader(GifImageHelper.GifParameters gif)Reads GIF file header information.private static voidreadLSD(GifImageHelper.GifParameters gif)Reads Logical Screen Descriptorprivate static intreadShort(GifImageHelper.GifParameters gif)Reads next 16-bit value, LSB firstprivate static voidsetPixel(int x, int y, int v, GifImageHelper.GifParameters gif)private static voidskip(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
-
-