com.sun.opengl.util
Class TGAWriter
Utility class which helps take fast screenshots of OpenGL rendering
results into Targa-format files. Used by the
Screenshot
class; can also be used
in conjunction with the
TileRenderer
class.
void | close()
|
ByteBuffer | getImageData() - Returns the ByteBuffer corresponding to the data for the image.
|
void | open(File file, int width, int height, boolean alpha) - Opens the specified Targa file for writing, overwriting any
existing file, and sets up the header of the file expecting the
data to be filled in before closing it.
|
TGAWriter
public TGAWriter()
Constructor for the TGAWriter.
close
public void close()
throws IOException
getImageData
public ByteBuffer getImageData()
Returns the ByteBuffer corresponding to the data for the image.
This must be filled in with data in either BGR or BGRA format
depending on whether an alpha channel was specified during
open().
open
public void open(File file,
int width,
int height,
boolean alpha)
throws IOException
Opens the specified Targa file for writing, overwriting any
existing file, and sets up the header of the file expecting the
data to be filled in before closing it.
file
- the file to write containing the screenshotwidth
- the width of the current drawableheight
- the height of the current drawablealpha
- whether the alpha channel should be saved. If true,
requires GL_EXT_abgr extension to be present.
Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.