Package com.kheops.util.encoders
Class ImageEncoder
java.lang.Object
com.kheops.util.encoders.ImageEncoder
- All Implemented Interfaces:
ImageConsumer
Abstract class for writing out an image.
A framework for classes that encode and write out an image in a particular file format.
This provides a simplified rendition of the ImageConsumer interface. It always delivers the pixels as ints in the RGBdefault color model. It always provides them in top-down left-right order. If you want more flexibility you can always implement ImageConsumer directly.
- See Also:
-
Field Summary
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
-
Constructor Summary
ConstructorDescriptionImageEncoder
(ImageProducer producer, OutputStream out) ImageEncoder
(Image img, OutputStream out) -
Method Summary
Modifier and TypeMethodDescriptionvoid
encode()
void
imageComplete
(int status) void
setColorModel
(ColorModel model) void
setDimensions
(int width, int height) void
setHints
(int hintflags) void
setPixels
(int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize) void
setPixels
(int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize) void
setProperties
(Hashtable props)
-
Field Details
-
out
-
-
Constructor Details
-
ImageEncoder
- Throws:
IOException
-
ImageEncoder
- Throws:
IOException
-
-
Method Details
-
encode
- Throws:
IOException
-
setDimensions
public void setDimensions(int width, int height) - Specified by:
setDimensions
in interfaceImageConsumer
-
setProperties
- Specified by:
setProperties
in interfaceImageConsumer
-
setColorModel
- Specified by:
setColorModel
in interfaceImageConsumer
-
setHints
public void setHints(int hintflags) - Specified by:
setHints
in interfaceImageConsumer
-
setPixels
public void setPixels(int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize) - Specified by:
setPixels
in interfaceImageConsumer
-
setPixels
public void setPixels(int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize) - Specified by:
setPixels
in interfaceImageConsumer
-
imageComplete
public void imageComplete(int status) - Specified by:
imageComplete
in interfaceImageConsumer
-