Class GifImageHelper


  • public final class GifImageHelper
    extends java.lang.Object
    • Constructor Detail

      • GifImageHelper

        public GifImageHelper()
    • 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 - GifImage
        lastFrameNumber - 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
      • 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