Class GifImageHelper
java.lang.Object
com.itextpdf.io.image.GifImageHelper
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanprivate static intnewBpc(int bpc) private static voidprocess(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 intReads 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 voidReads next frame imageprivate static voidReads Graphics Control Extension valuesprivate static voidReads GIF file header information.private static voidReads Logical Screen Descriptorprivate static intReads next 16-bit value, LSB firstprivate static voidsetPixel(int x, int y, int v, GifImageHelper.GifParameters gif) private static voidSkips variable length blocks up to and including next zero length block.
-
Field Details
-
MAX_STACK_SIZE
static final int MAX_STACK_SIZE- See Also:
-
-
Constructor Details
-
GifImageHelper
public GifImageHelper()
-
-
Method Details
-
processImage
Reads image source and fills GifImage object with parameters (frames, width, height)- Parameters:
image- GifImage
-
processImage
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(InputStream stream, GifImageHelper.GifParameters gif, int lastFrameNumber) throws IOException - Throws:
IOException
-
readHeader
Reads GIF file header information.- Throws:
IOException
-
readLSD
Reads Logical Screen Descriptor- Throws:
IOException
-
readShort
Reads next 16-bit value, LSB first- Throws:
IOException
-
readBlock
Reads next variable length block from input.- Returns:
- number of bytes stored in "buffer"
- Throws:
IOException
-
readColorTable
- Throws:
IOException
-
newBpc
private static int newBpc(int bpc) -
readContents
private static void readContents(GifImageHelper.GifParameters gif, int lastFrameNumber) throws IOException - Throws:
IOException
-
readFrame
Reads next frame image- Throws:
IOException
-
decodeImageData
- Throws:
IOException
-
setPixel
-
readGraphicControlExt
Reads Graphics Control Extension values- Throws:
IOException
-
skip
Skips variable length blocks up to and including next zero length block.- Throws:
IOException
-