com.jogamp.opengl.util.texture.awt

## Class AWTTextureIO

- java.lang.Object
- - com.jogamp.opengl.util.texture.TextureIO
  - - com.jogamp.opengl.util.texture.awt.AWTTextureIO

-     public class AWTTextureIO
      extends TextureIO

- - ### Field Summary

    - ### Fields inherited from class com.jogamp.opengl.util.texture.TextureIO

      `DDS, GIF, JPG, PAM, PNG, PPM, SGI, SGI_RGB, TGA, TIFF`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AWTTextureIO()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Texture` | `newTexture(GLProfile glp, BufferedImage image, boolean mipmap)` Creates an OpenGL texture object from the specified BufferedImage using the current OpenGL context.
    `static TextureData` | `newTextureData(GLProfile glp, BufferedImage image, boolean mipmap)` Creates a TextureData from the given BufferedImage.
    `static TextureData` | `newTextureData(GLProfile glp, 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.jogamp.opengl.util.texture.TextureIO

      `addTextureProvider, addTextureWriter, isTexRectEnabled, newTexture, newTexture, newTexture, newTexture, newTexture, newTexture, newTextureData, newTextureData, newTextureData, newTextureData, newTextureData, newTextureData, setTexRectEnabled, write, write`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AWTTextureIO

          public AWTTextureIO()

  - ### Method Detail

    - #### newTextureData

          public static TextureData newTextureData(GLProfile glp,
                                   BufferedImage image,
                                   boolean mipmap)

      Creates a TextureData from the given BufferedImage. Does no OpenGL work. We assume a desktop GLProfile GL2GL3, otherwise use the other factory.
      Parameters:
        `glp` - the OpenGL Profile this texture data should be created for.
        `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
      See Also:
        `newTextureData(GLProfile, BufferedImage, boolean)`

    - #### newTextureData

          public static TextureData newTextureData(GLProfile glp,
                                   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:
        `glp` - the OpenGL Profile this texture data should be created for.
        `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(GLProfile glp,
                           BufferedImage image,
                           boolean mipmap)
                                    throws GLException

      Creates an OpenGL texture object from the specified BufferedImage using the current OpenGL context.
      Parameters:
        `glp` - the OpenGL Profile this texture data should be created for.
        `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 2010 JogAmp Community.