Acme.JPM.Encoders
Class ImageEncoder
java.lang.Object
|
+--Acme.JPM.Encoders.ImageEncoder
- All Implemented Interfaces:
- java.awt.image.ImageConsumer
- Direct Known Subclasses:
- GifEncoder, JpegEncoder, PpmEncoder
- public abstract class ImageEncoder
- extends java.lang.Object
- implements java.awt.image.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.
Fetch
the software.
Fetch the entire Acme
package.
- See Also:
GifEncoder
,
PpmEncoder
,
Acme.JPM.Decoders.ImageDecoder
Field Summary |
protected java.io.OutputStream |
out
|
Fields inherited from interface java.awt.image.ImageConsumer |
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT |
Constructor Summary |
ImageEncoder(java.awt.Image img,
java.io.OutputStream out)
|
ImageEncoder(java.awt.image.ImageProducer producer,
java.io.OutputStream out)
|
Method Summary |
void |
encode()
|
void |
imageComplete(int status)
|
void |
setColorModel(java.awt.image.ColorModel model)
|
void |
setDimensions(int width,
int height)
|
void |
setHints(int hintflags)
|
void |
setPixels(int x,
int y,
int w,
int h,
java.awt.image.ColorModel model,
byte[] pixels,
int off,
int scansize)
|
void |
setPixels(int x,
int y,
int w,
int h,
java.awt.image.ColorModel model,
int[] pixels,
int off,
int scansize)
|
void |
setProperties(java.util.Hashtable props)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
out
protected java.io.OutputStream out
ImageEncoder
public ImageEncoder(java.awt.Image img,
java.io.OutputStream out)
throws java.io.IOException
ImageEncoder
public ImageEncoder(java.awt.image.ImageProducer producer,
java.io.OutputStream out)
throws java.io.IOException
encode
public void encode()
throws java.io.IOException
java.io.IOException
setDimensions
public void setDimensions(int width,
int height)
- Specified by:
setDimensions
in interface java.awt.image.ImageConsumer
setProperties
public void setProperties(java.util.Hashtable props)
- Specified by:
setProperties
in interface java.awt.image.ImageConsumer
setColorModel
public void setColorModel(java.awt.image.ColorModel model)
- Specified by:
setColorModel
in interface java.awt.image.ImageConsumer
setHints
public void setHints(int hintflags)
- Specified by:
setHints
in interface java.awt.image.ImageConsumer
setPixels
public void setPixels(int x,
int y,
int w,
int h,
java.awt.image.ColorModel model,
byte[] pixels,
int off,
int scansize)
- Specified by:
setPixels
in interface java.awt.image.ImageConsumer
setPixels
public void setPixels(int x,
int y,
int w,
int h,
java.awt.image.ColorModel model,
int[] pixels,
int off,
int scansize)
- Specified by:
setPixels
in interface java.awt.image.ImageConsumer
imageComplete
public void imageComplete(int status)
- Specified by:
imageComplete
in interface java.awt.image.ImageConsumer
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details