com.sun.opengl.util.texture.awt
Class AWTTextureIO

java.lang.Object
  extended by com.sun.opengl.util.texture.TextureIO
      extended by com.sun.opengl.util.texture.awt.AWTTextureIO

public class AWTTextureIO
extends TextureIO


Field Summary
 
Fields inherited from class com.sun.opengl.util.texture.TextureIO
DDS, GIF, JPG, PNG, SGI, SGI_RGB, TGA, TIFF
 
Constructor Summary
AWTTextureIO()
           
 
Method Summary
static Texture newTexture(BufferedImage image, boolean mipmap)
          Creates an OpenGL texture object from the specified BufferedImage using the current OpenGL context.
static TextureData newTextureData(BufferedImage image, boolean mipmap)
          Creates a TextureData from the given BufferedImage.
static TextureData newTextureData(BufferedImage image, int internalFormat, int pixelFormat, boolean mipmap)
          Creates a TextureData from the given BufferedImage, using the specified OpenGL internal format and pixel format for the texture which will eventually result.
 
Methods inherited from class com.sun.opengl.util.texture.TextureIO
addTextureProvider, addTextureWriter, isTexRectEnabled, newTexture, newTexture, newTexture, newTexture, newTexture, newTexture, newTextureData, newTextureData, newTextureData, newTextureData, newTextureData, newTextureData, setTexRectEnabled, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWTTextureIO

public AWTTextureIO()
Method Detail

newTextureData

public static TextureData newTextureData(BufferedImage image,
                                         boolean mipmap)
Creates a TextureData from the given BufferedImage. Does no OpenGL work.

Parameters:
image - the BufferedImage containing the texture data
mipmap - whether mipmaps should be produced for this texture by autogenerating them
Returns:
the texture data from the image

newTextureData

public static TextureData newTextureData(BufferedImage image,
                                         int internalFormat,
                                         int pixelFormat,
                                         boolean mipmap)
                                  throws IllegalArgumentException
Creates a TextureData from the given BufferedImage, using the specified OpenGL internal format and pixel format for the texture which will eventually result. The internalFormat and pixelFormat must be specified and may not be zero; to use default values, use the variant of this method which does not take these arguments. Does no OpenGL work.

Parameters:
image - the BufferedImage containing the texture data
internalFormat - the OpenGL internal format of the texture which will eventually result from the TextureData
pixelFormat - the OpenGL pixel format of the texture which will eventually result from the TextureData
mipmap - whether mipmaps should be produced for this texture either by autogenerating them or reading them from the file. Some file formats support multiple mipmaps in a single file in which case those mipmaps will be used rather than generating them.
Returns:
the texture data from the image
Throws:
IllegalArgumentException - if either internalFormat or pixelFormat was 0

newTexture

public static Texture newTexture(BufferedImage image,
                                 boolean mipmap)
                          throws GLException
Creates an OpenGL texture object from the specified BufferedImage using the current OpenGL context.

Parameters:
image - the BufferedImage from which to read the texture data
mipmap - whether mipmaps should be produced for this texture by autogenerating them
Throws:
GLException - if no OpenGL context is current or if an OpenGL error occurred


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.