Class GifSequenceWriter

java.lang.Object
application.model.GifSequenceWriter

public class GifSequenceWriter
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected javax.imageio.ImageWriter gifWriter  
    protected javax.imageio.metadata.IIOMetadata imageMetaData  
    protected javax.imageio.ImageWriteParam imageWriteParam  
  • Constructor Summary

    Constructors 
    Constructor Description
    GifSequenceWriter​(javax.imageio.stream.ImageOutputStream outputStream, int imageType, int timeBetweenFramesMS, boolean loopContinuously)
    Creates a new GifSequenceWriter
  • Method Summary

    Modifier and Type Method Description
    void close()
    Close this GifSequenceWriter object.
    void writeToSequence​(java.awt.image.RenderedImage img)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • gifWriter

      protected javax.imageio.ImageWriter gifWriter
    • imageWriteParam

      protected javax.imageio.ImageWriteParam imageWriteParam
    • imageMetaData

      protected javax.imageio.metadata.IIOMetadata imageMetaData
  • Constructor Details

    • GifSequenceWriter

      public GifSequenceWriter​(javax.imageio.stream.ImageOutputStream outputStream, int imageType, int timeBetweenFramesMS, boolean loopContinuously) throws java.io.IOException
      Creates a new GifSequenceWriter
      Parameters:
      outputStream - the ImageOutputStream to be written to
      imageType - one of the imageTypes specified in BufferedImage
      timeBetweenFramesMS - the time between frames in miliseconds
      loopContinuously - wether the gif should loop repeatedly
      Throws:
      javax.imageio.IIOException - if no gif ImageWriters are found
      java.io.IOException
  • Method Details

    • writeToSequence

      public void writeToSequence​(java.awt.image.RenderedImage img) throws java.io.IOException
      Throws:
      java.io.IOException
    • close

      public void close() throws java.io.IOException
      Close this GifSequenceWriter object. This does not close the underlying stream, just finishes off the GIF.
      Throws:
      java.io.IOException - Thrown when IOException is thrown