FreeHEP API
Version current

org.freehep.graphicsio.ppm
Class ImageEncoder

java.lang.Object
  extended byorg.freehep.graphicsio.ppm.ImageEncoder
All Implemented Interfaces:
ImageConsumer
Direct Known Subclasses:
PPMEncoder

public abstract class ImageEncoder
extends Object
implements ImageConsumer

Source Code:
ImageEncoder.java

Field Summary
protected  DataOutput out
           
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
Constructor Summary
ImageEncoder(Image img, DataOutput dos)
           
ImageEncoder(ImageProducer producer, DataOutput dos)
           
 
Method Summary
 void encode()
           
protected abstract  void encodeDone()
           
protected abstract  void encodePixels(int x, int y, int w, int h, int[] rgbPixels, int off, int scansize)
           
protected abstract  void encodeStart(int w, int h)
           
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected DataOutput out
Constructor Detail

ImageEncoder

public ImageEncoder(Image img,
                    DataOutput dos)
             throws IOException

ImageEncoder

public ImageEncoder(ImageProducer producer,
                    DataOutput dos)
             throws IOException
Method Detail

encodeStart

protected abstract void encodeStart(int w,
                                    int h)
                             throws IOException
Throws:
IOException

encodePixels

protected abstract void encodePixels(int x,
                                     int y,
                                     int w,
                                     int h,
                                     int[] rgbPixels,
                                     int off,
                                     int scansize)
                              throws IOException
Throws:
IOException

encodeDone

protected abstract void encodeDone()
                            throws IOException
Throws:
IOException

encode

public void encode()
            throws IOException
Throws:
IOException

setDimensions

public void setDimensions(int width,
                          int height)
Specified by:
setDimensions in interface ImageConsumer

setProperties

public void setProperties(Hashtable props)
Specified by:
setProperties in interface ImageConsumer

setColorModel

public void setColorModel(ColorModel model)
Specified by:
setColorModel in interface ImageConsumer

setHints

public void setHints(int hintflags)
Specified by:
setHints in interface ImageConsumer

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      ColorModel model,
                      byte[] pixels,
                      int off,
                      int scansize)
Specified by:
setPixels in interface ImageConsumer

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      ColorModel model,
                      int[] pixels,
                      int off,
                      int scansize)
Specified by:
setPixels in interface ImageConsumer

imageComplete

public void imageComplete(int status)
Specified by:
imageComplete in interface ImageConsumer

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.