Package javajs.img
Class GifEncoder
java.lang.Object
javajs.img.ImageEncoder
javajs.img.GifEncoder
- All Implemented Interfaces:
GenericImageEncoder
GifEncoder extensively adapted for Jmol by Bob Hanson
Color quantization roughly follows the GIMP method
"dither Floyd-Steinberg (normal)" but with some twists. (For example, we
exclude the background color.)
Note that although GIMP code annotation refers to "median-cut", it is really
using MEAN-cut. That is what I use here as well.
-- commented code allows visualization of the color space using Jmol. Very
enlightening!
-- much simplified interface with ImageEncoder
-- uses simple Hashtable with Integer() to catalog colors
-- allows progressive production of animated GIF via Jmol CAPTURE command
-- uses general purpose javajs.util.OutputChannel for byte-handling options
such as posting to a server, writing to disk, and retrieving bytes.
-- allows JavaScript port
-- Bob Hanson, first try: 24 Sep 2013; final coding: 9 Nov 2014
- Author:
- Bob Hanson hansonr@stolaf.edu
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class javajs.img.ImageEncoder
createImage, putByte, putString
-
Constructor Details
-
GifEncoder
public GifEncoder()
-
-
Method Details
-
setParams
we allow for animated GIF by being able to re-enter the code with different parameters held in params- Specified by:
setParams
in classImageEncoder
-
generate
- Specified by:
generate
in classImageEncoder
- Throws:
IOException
-
close
protected void close()- Overrides:
close
in classImageEncoder
-
toLABnorm
-
toRGB
-
rgbToXyz
-
xyzToRgb
-
xyzToLab
-
labToXyz
-
flushBytes
protected void flushBytes()
-