Package com.itextpdf.io.image
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 boolean
private static int
newBpc
(int bpc) private static void
process
(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
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
Reads next frame imageprivate static void
Reads Graphics Control Extension valuesprivate static void
Reads GIF file header information.private static void
Reads Logical Screen Descriptorprivate static int
Reads next 16-bit value, LSB firstprivate static void
setPixel
(int x, int y, int v, GifImageHelper.GifParameters gif) private static void
Skips 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
-