c

doodle.java2d.effect

GifEncoder

class GifEncoder extends AnyRef

Class AnimatedGifEncoder - Encodes a GIF file consisting of one or more frames.

 Example:
    AnimatedGifEncoder e = new AnimatedGifEncoder();
    e.start(outputFileName);
    e.setDelay(1000);   // 1 frame per sec
    e.addFrame(image1);
    e.addFrame(image2);
    e.finish();

No copyright asserted on the source code of this class. May be used for any purpose, however, refer to the Unisys LZW patent for restrictions on use of the associated LZWEncoder class. Please forward any corrections to kweiner@fmsware.com.

Version

1.03 November 2003

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GifEncoder
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new GifEncoder()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addFrame(im: BufferedImage): Boolean

    Adds next GIF frame.

    Adds next GIF frame. The frame is not written immediately, but is actually deferred until the next frame is received so that timing data can be inserted. Invoking finish() flushes all frames. If setSize was not invoked, the size of the first image is used for all subsequent frames.

    im

    BufferedImage containing frame to write.

    returns

    true if successful.

  5. def analyzePixels(): Unit

    Analyzes image colors and creates color map.

    Analyzes image colors and creates color map.

    Attributes
    protected[effect]
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clearPalette(): Unit

    Clears the color palette so it will be learned from each frame's pixel

  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def findClosest(c: Color): Int

    Returns index of palette color closest to c

    Returns index of palette color closest to c

    Attributes
    protected[effect]
  12. def finish(): Boolean

    Flushes any pending data and closes output file.

    Flushes any pending data and closes output file. If writing to an OutputStream, the stream is not closed.

  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. def getImagePixels(): Unit

    Extracts image pixels into byte array "pixels"

    Extracts image pixels into byte array "pixels"

    Attributes
    protected[effect]
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. def setDelay(ms: Int): Unit

    Sets the delay time between each frame, or changes it for subsequent frames (applies to last frame added).

    Sets the delay time between each frame, or changes it for subsequent frames (applies to last frame added).

    ms

    int delay time in milliseconds

  21. def setDispose(code: Int): Unit

    Sets the GIF frame disposal code for the last added frame and any subsequent frames.

    Sets the GIF frame disposal code for the last added frame and any subsequent frames. Default is 0 if no transparent color has been set, otherwise 2.

    code

    int disposal code.

  22. def setFrameRate(fps: Float): Unit

    Sets frame rate in frames per second.

    Sets frame rate in frames per second. Equivalent to setDelay(1000/fps).

    fps

    float frame rate (frames per second)

  23. def setQuality(quality: Int): Unit

    Sets quality of color quantization (conversion of images to the maximum 256 colors allowed by the GIF specification).

    Sets quality of color quantization (conversion of images to the maximum 256 colors allowed by the GIF specification). Lower values (minimum = 1) produce better colors, but slow processing significantly. 10 is the default, and produces good color mapping at reasonable speeds. Values greater than 20 do not yield significant improvements in speed.

    quality

    int greater than 0.

  24. def setRepeat(iter: Int): Unit

    Sets the number of times the set of GIF frames should be played.

    Sets the number of times the set of GIF frames should be played. Default is 1; 0 means play indefinitely. Must be invoked before the first image is added.

    iter

    int number of iterations.

  25. def setSize(w: Int, h: Int): Unit

    Sets the GIF frame size.

    Sets the GIF frame size. The default size is the size of the first frame added if this method is not invoked.

    w

    int frame width.

    h

    int frame width.

  26. def setTransparent(c: Color): Unit

    Sets the transparent color for the last added frame and any subsequent frames.

    Sets the transparent color for the last added frame and any subsequent frames. Since all colors are subject to modification in the quantization process, the color in the final palette for each frame closest to the given color becomes the transparent color for that frame. May be set to null to indicate no transparent color.

    c

    Color to be treated as transparent on display.

  27. def start(file: String): Boolean

    Initiates writing of a GIF file with the specified name.

    Initiates writing of a GIF file with the specified name.

    file

    String containing output file name.

    returns

    false if open or initial write failed.

  28. def start(os: OutputStream): Boolean

    Initiates GIF file creation on the given stream.

    Initiates GIF file creation on the given stream. The stream is not closed automatically.

    os

    OutputStream on which GIF images are written.

    returns

    false if initial write failed.

  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. def writeGraphicCtrlExt(): Unit

    Writes Graphic Control Extension

    Writes Graphic Control Extension

    Attributes
    protected[effect]
  35. def writeImageDesc(): Unit

    Writes Image Descriptor

    Writes Image Descriptor

    Attributes
    protected[effect]
  36. def writeLSD(): Unit

    Writes Logical Screen Descriptor

    Writes Logical Screen Descriptor

    Attributes
    protected[effect]
  37. def writeNetscapeExt(): Unit

    Writes Netscape application extension to define repeat count.

    Writes Netscape application extension to define repeat count.

    Attributes
    protected[effect]
  38. def writePalette(): Unit

    Writes color table

    Writes color table

    Attributes
    protected[effect]
  39. def writePixels(): Unit

    Encodes and writes pixel data

    Encodes and writes pixel data

    Attributes
    protected[effect]
  40. def writeShort(value: Int): Unit

    Write 16-bit value to output stream, LSB first

    Write 16-bit value to output stream, LSB first

    Attributes
    protected[effect]
  41. def writeString(s: String): Unit

    Writes string to output stream

    Writes string to output stream

    Attributes
    protected[effect]

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from AnyRef

Inherited from Any

Ungrouped