com.hermetica.util3d
Class PPMWriter

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

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

This class acts as an ImageConsumer that writes out data pumped into it to a file in the Portable Pixmap Format ( PPM ). This class is primarily used in conjunction with the image production capabilities of GLDrawable / GLComponent classes allowing developers to dump frame-by-frame copies of OpenGL framebuffers simply.

Version:
$Id: PPMWriter.java,v 1.2 1998/06/01 18:00:40 descarte Exp descarte $
Author:
Alligator Descartes

Field Summary
static int IMAGENUMBER
          Unique image number.
 
Constructor Summary
PPMWriter(java.awt.image.ImageProducer producer)
          Default constructor that'll create files with ``ppmwriter'' prefix
PPMWriter(java.awt.image.ImageProducer producer, java.lang.String prefix)
          Constructor that sets the prefix for output files' names to the given string
 
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
 
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

PPMWriter

public PPMWriter(java.awt.image.ImageProducer producer)
Default constructor that'll create files with ``ppmwriter'' prefix

PPMWriter

public PPMWriter(java.awt.image.ImageProducer producer,
                 java.lang.String prefix)
Constructor that sets the prefix for output files' names to the given string
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