com.hermetica.util3d
Class EPSWriter

java.lang.Object
  |
  +--com.hermetica.util3d.EPSWriter

public class EPSWriter
extends java.lang.Object
implements java.awt.image.ImageConsumer

This class is an ImageConsumer that can be used to write out any ImageProducer's output in the form of Encapsulated PostScript. This class should be used in conjunction with the image production capabilities of GLComponent / GLDrawable components to produce high-quality PostScript output from OpenGL framebuffers.

Version:
$Id: EPSWriter.java,v 1.3 1998/06/01 18:00:19 descarte Exp descarte $
Author:
Alligator Descartes, Mark J. Kilgard

Field Summary
static int IMAGENUMBER
          Unique image number.
 
Constructor Summary
EPSWriter(java.awt.image.ImageProducer producer)
          Default constructor which will write files out with an ``epswriter'' prefix
EPSWriter(java.awt.image.ImageProducer producer, java.lang.String prefix)
          Constructor which specifies the prefix with which output files are created with
 
Method Summary
 void imageComplete(int status)
          Called when the image being transmitted is now complete
 void setColorModel(java.awt.image.ColorModel model)
          Sets the colour model being used by the image
 void setDimensions(int width, int height)
          Sets the dimensions of the image being consumed
 void setHints(int hints)
          Sets the hints as to pixel delivery order
 void setPixels(int x, int y, int width, int height, java.awt.image.ColorModel model, byte[] pixels, int offset, int scanSize)
          Pixel delivery
 void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int offset, int scanSize)
          Pixel delivery
 void setProperties(java.util.Hashtable props)
          Sets the properties of the image
 java.lang.String toHex(int number)
          Converts a number to a hexadecimal string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IMAGENUMBER

public static int IMAGENUMBER
Unique image number. Auto-incrememented after writes
Constructor Detail

EPSWriter

public EPSWriter(java.awt.image.ImageProducer producer)
Default constructor which will write files out with an ``epswriter'' prefix

EPSWriter

public EPSWriter(java.awt.image.ImageProducer producer,
                 java.lang.String prefix)
Constructor which specifies the prefix with which output files are created with
Method Detail

imageComplete

public void imageComplete(int status)
Called when the image being transmitted is now complete
Specified by:
imageComplete in interface java.awt.image.ImageConsumer

setColorModel

public void setColorModel(java.awt.image.ColorModel model)
Sets the colour model being used by the image
Specified by:
setColorModel in interface java.awt.image.ImageConsumer

setDimensions

public void setDimensions(int width,
                          int height)
Sets the dimensions of the image being consumed
Specified by:
setDimensions in interface java.awt.image.ImageConsumer

setHints

public void setHints(int hints)
Sets the hints as to pixel delivery order
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,
                      int[] pixels,
                      int offset,
                      int scanSize)
Pixel delivery
Specified by:
setPixels in interface java.awt.image.ImageConsumer

setPixels

public void setPixels(int x,
                      int y,
                      int width,
                      int height,
                      java.awt.image.ColorModel model,
                      byte[] pixels,
                      int offset,
                      int scanSize)
Pixel delivery
Specified by:
setPixels in interface java.awt.image.ImageConsumer

setProperties

public void setProperties(java.util.Hashtable props)
Sets the properties of the image
Specified by:
setProperties in interface java.awt.image.ImageConsumer

toHex

public java.lang.String toHex(int number)
Converts a number to a hexadecimal string