JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.util.texture.awt.AWTTextureIO Class Reference
Inheritance diagram for com.jogamp.opengl.util.texture.awt.AWTTextureIO:
Collaboration diagram for com.jogamp.opengl.util.texture.awt.AWTTextureIO:

Static Public Member Functions

static TextureData newTextureData (final GLProfile glp, final BufferedImage image, final boolean mipmap)
 Creates a TextureData from the given BufferedImage. More...
 
static TextureData newTextureData (final GLProfile glp, final BufferedImage image, final int internalFormat, final int pixelFormat, final 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. More...
 
static Texture newTexture (final GLProfile glp, final BufferedImage image, final boolean mipmap) throws GLException
 Creates an OpenGL texture object from the specified BufferedImage using the current OpenGL context. More...
 
- Static Public Member Functions inherited from com.jogamp.opengl.util.texture.TextureIO
static TextureData newTextureData (final GLProfile glp, final File file, final boolean mipmap, String fileSuffix) throws IOException
 Creates a TextureData from the given file. More...
 
static TextureData newTextureData (final GLProfile glp, final InputStream stream, final boolean mipmap, final String fileSuffix) throws IOException
 Creates a TextureData from the given stream. More...
 
static TextureData newTextureData (final GLProfile glp, final URL url, final boolean mipmap, String fileSuffix) throws IOException
 Creates a TextureData from the given URL. More...
 
static TextureData newTextureData (final GLProfile glp, final File file, final int internalFormat, final int pixelFormat, final boolean mipmap, String fileSuffix) throws IOException, IllegalArgumentException
 Creates a TextureData from the given file, using the specified OpenGL internal format and pixel format for the texture which will eventually result. More...
 
static TextureData newTextureData (final GLProfile glp, final InputStream stream, final int internalFormat, final int pixelFormat, final boolean mipmap, final String fileSuffix) throws IOException, IllegalArgumentException
 Creates a TextureData from the given stream, using the specified OpenGL internal format and pixel format for the texture which will eventually result. More...
 
static TextureData newTextureData (final GLProfile glp, final URL url, final int internalFormat, final int pixelFormat, final boolean mipmap, String fileSuffix) throws IOException, IllegalArgumentException
 Creates a TextureData from the given URL, using the specified OpenGL internal format and pixel format for the texture which will eventually result. More...
 
static Texture newTexture (final TextureData data) throws GLException, IllegalArgumentException
 Creates an OpenGL texture object from the specified TextureData using the current OpenGL context. More...
 
static Texture newTexture (final GL gl, final TextureData data) throws GLException, IllegalArgumentException
 Creates an OpenGL texture object from the specified TextureData using the given OpenGL context. More...
 
static Texture newTexture (final File file, final boolean mipmap) throws IOException, GLException
 Creates an OpenGL texture object from the specified file using the current OpenGL context. More...
 
static Texture newTexture (final InputStream stream, final boolean mipmap, final String fileSuffix) throws IOException, GLException
 Creates an OpenGL texture object from the specified stream using the current OpenGL context. More...
 
static Texture newTexture (final URL url, final boolean mipmap, String fileSuffix) throws IOException, GLException
 Creates an OpenGL texture object from the specified URL using the current OpenGL context. More...
 
static Texture newTexture (final int target)
 Creates an OpenGL texture object associated with the given OpenGL texture target. More...
 
static void write (final Texture texture, final File file) throws IOException, GLException
 Writes the given texture to a file. More...
 
static void write (final TextureData data, final File file) throws IOException, GLException
 
static void addTextureProvider (final TextureProvider provider)
 Adds a TextureProvider to support reading of a new file format. More...
 
static void addTextureWriter (final TextureWriter writer)
 Adds a TextureWriter to support writing of a new file format. More...
 
static void setTexRectEnabled (final boolean enabled)
 Toggles the use of the GL_ARB_texture_rectangle extension by the TextureIO classes. More...
 
static boolean isTexRectEnabled ()
 Indicates whether the GL_ARB_texture_rectangle extension is allowed to be used for non-power-of-two textures; see setTexRectEnabled. More...
 

Additional Inherited Members

- Static Public Attributes inherited from com.jogamp.opengl.util.texture.TextureIO
static final String DDS = ImageType.T_DDS
 Constant which can be used as a file suffix to indicate a DirectDraw Surface file, value {@value}. More...
 
static final String SGI = "sgi"
 Constant which can be used as a file suffix to indicate an SGI RGB file, value {@value}. More...
 
static final String SGI_RGB = ImageType.T_SGI_RGB
 Constant which can be used as a file suffix to indicate an SGI RGB file, value {@value}. More...
 
static final String GIF = ImageType.T_GIF
 Constant which can be used as a file suffix to indicate a GIF file, value {@value}. More...
 
static final String JPG = ImageType.T_JPG
 Constant which can be used as a file suffix to indicate a JPEG file, value {@value}. More...
 
static final String PNG = ImageType.T_PNG
 Constant which can be used as a file suffix to indicate a PNG file, value {@value}. More...
 
static final String TGA = ImageType.T_TGA
 Constant which can be used as a file suffix to indicate a Targa file, value {@value}. More...
 
static final String TIFF = ImageType.T_TIFF
 Constant which can be used as a file suffix to indicate a TIFF file, value {@value}. More...
 
static final String PAM = ImageType.T_PAM
 Constant which can be used as a file suffix to indicate a PAM file, NetPbm magic 7 - binary RGB and RGBA. More...
 
static final String PPM = ImageType.T_PPM
 Constant which can be used as a file suffix to indicate a PAM file, NetPbm magic 6 - binary RGB. More...
 

Detailed Description

Definition at line 47 of file AWTTextureIO.java.

Member Function Documentation

◆ newTexture()

static Texture com.jogamp.opengl.util.texture.awt.AWTTextureIO.newTexture ( final GLProfile  glp,
final BufferedImage  image,
final boolean  mipmap 
) throws GLException
static

Creates an OpenGL texture object from the specified BufferedImage using the current OpenGL context.

Parameters
glpthe OpenGL Profile this texture data should be created for.
imagethe BufferedImage from which to read the texture data
mipmapwhether mipmaps should be produced for this texture by autogenerating them
Exceptions
GLExceptionif no OpenGL context is current or if an OpenGL error occurred

Definition at line 115 of file AWTTextureIO.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newTextureData() [1/2]

static TextureData com.jogamp.opengl.util.texture.awt.AWTTextureIO.newTextureData ( final GLProfile  glp,
final BufferedImage  image,
final boolean  mipmap 
)
static

Creates a TextureData from the given BufferedImage.

Does no OpenGL work. We assume a desktop GLProfile GL2GL3, otherwise use the other factory.

Parameters
glpthe OpenGL Profile this texture data should be created for.
imagethe BufferedImage containing the texture data
mipmapwhether mipmaps should be produced for this texture by autogenerating them
Returns
the texture data from the image
See also
newTextureData(GLProfile, BufferedImage, boolean)

Definition at line 62 of file AWTTextureIO.java.

Here is the caller graph for this function:

◆ newTextureData() [2/2]

static TextureData com.jogamp.opengl.util.texture.awt.AWTTextureIO.newTextureData ( final GLProfile  glp,
final BufferedImage  image,
final int  internalFormat,
final int  pixelFormat,
final boolean  mipmap 
) throws IllegalArgumentException
static

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
glpthe OpenGL Profile this texture data should be created for.
imagethe BufferedImage containing the texture data
internalFormatthe OpenGL internal format of the texture which will eventually result from the TextureData
pixelFormatthe OpenGL pixel format of the texture which will eventually result from the TextureData
mipmapwhether 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
Exceptions
IllegalArgumentExceptionif either internalFormat or pixelFormat was 0

Definition at line 92 of file AWTTextureIO.java.


The documentation for this class was generated from the following file: