Class GIFFileFormat


public final class GIFFileFormat extends FileFormat.StaticImageFileFormat
  • Field Details

    • signature

      String signature
    • screenWidth

      int screenWidth
    • screenHeight

      int screenHeight
    • backgroundPixel

      int backgroundPixel
    • bitsPerPixel

      int bitsPerPixel
    • defaultDepth

      int defaultDepth
    • disposalMethod

      int disposalMethod
    • delayTime

      int delayTime
    • transparentPixel

      int transparentPixel
    • repeatCount

      int repeatCount
    • GIF_APPLICATION_EXTENSION_BLOCK_ID

      static final int GIF_APPLICATION_EXTENSION_BLOCK_ID
      See Also:
    • GIF_GRAPHICS_CONTROL_BLOCK_ID

      static final int GIF_GRAPHICS_CONTROL_BLOCK_ID
      See Also:
    • GIF_PLAIN_TEXT_BLOCK_ID

      static final int GIF_PLAIN_TEXT_BLOCK_ID
      See Also:
    • GIF_COMMENT_BLOCK_ID

      static final int GIF_COMMENT_BLOCK_ID
      See Also:
    • GIF_EXTENSION_BLOCK_ID

      static final int GIF_EXTENSION_BLOCK_ID
      See Also:
    • GIF_IMAGE_BLOCK_ID

      static final int GIF_IMAGE_BLOCK_ID
      See Also:
    • GIF_TRAILER_ID

      static final int GIF_TRAILER_ID
      See Also:
    • GIF89a

      static final byte[] GIF89a
    • NETSCAPE2_0

      static final byte[] NETSCAPE2_0
  • Constructor Details

    • GIFFileFormat

      public GIFFileFormat()
  • Method Details

    • grayRamp

      static PaletteData grayRamp(int numGrays)
      Answer a palette containing numGrays shades of gray, ranging from black to white.
    • isFileFormat

      boolean isFileFormat(LEDataInputStream stream) throws IOException
      Description copied from class: FileFormat
      Return whether or not the specified input stream represents a supported file format.
      Specified by:
      isFileFormat in class FileFormat
      Throws:
      IOException
    • loadFromByteStream

      ImageData[] loadFromByteStream()
      Load the GIF image(s) stored in the input stream. Return an array of ImageData representing the image(s).
      Specified by:
      loadFromByteStream in class FileFormat.StaticImageFileFormat
    • readID

      int readID()
      Read and return the next block or extension identifier from the file.
    • readExtension

      byte[] readExtension()
      Read a control extension. Return the extension block data.
    • readCommentExtension

      byte[] readCommentExtension()
      We have just read the Comment extension identifier from the input stream. Read in the rest of the comment and return it. GIF comment blocks are variable size.
    • readPlainTextExtension

      byte[] readPlainTextExtension()
      We have just read the PlainText extension identifier from the input stream. Read in the plain text info and text, and return the text. GIF plain text blocks are variable size.
    • readGraphicsControlExtension

      byte[] readGraphicsControlExtension()
      We have just read the GraphicsControl extension identifier from the input stream. Read in the control information, store it, and return it.
    • readApplicationExtension

      byte[] readApplicationExtension()
      We have just read the Application extension identifier from the input stream. Read in the rest of the extension, look for and store 'number of repeats', and return the data.
    • readImageBlock

      ImageData readImageBlock(PaletteData defaultPalette)
      Return a DeviceIndependentImage representing the image block at the current position in the input stream. Throw an error if an error occurs.
    • readPalette

      PaletteData readPalette(int numColors)
      Read a palette from the input stream.
    • unloadIntoByteStream

      void unloadIntoByteStream(ImageLoader loader)
      Specified by:
      unloadIntoByteStream in class FileFormat
    • writeGraphicsControlBlock

      void writeGraphicsControlBlock(ImageData image)
      Write out a GraphicsControlBlock to describe the specified device independent image.
    • writePalette

      void writePalette(PaletteData palette, int depth)
      Write the specified palette to the output stream.