Top Description Inners Methods
com.jogamp.opengl.util.texture.spi

public Interface TextureProvider

Known Direct Implementers
com.jogamp.opengl.util.texture.spi.awt.IIOTextureProvider, com.jogamp.opengl.util.texture.TextureIO.StreamBasedTextureProvider
Imports
java.io.*, java.net.*, com.jogamp.opengl.GLProfile, com.jogamp.opengl.util.texture.*

Plug-in interface to TextureIO to support reading OpenGL textures from new file formats. For all methods, either internalFormat or pixelFormat may be 0 in which case they must be inferred as e.g. RGB or RGBA depending on the file contents.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
TextureProvider.SupportsImageTypes

Optional additional interface for TextureProvider implementation exposing the supported ImageTypes.

Method Summary

Modifier and TypeMethod and Description
public TextureData
newTextureData(GLProfile
the OpenGL Profile this texture data should be created for.
glp
,
File
the file from which to read the texture data
file
,
int
the OpenGL internal format to be used for the texture, or 0 if it should be inferred from the file's contents
internalFormat
,
int
the OpenGL pixel format to be used for the texture, or 0 if it should be inferred from the file's contents
pixelFormat
,
boolean
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.
mipmap
,
String
the file suffix to be used as a hint to the provider to more quickly decide whether it can handle the file, or null if the provider should infer the type from the file's contents
fileSuffix
)

Deprecated Use {@link #newTextureData(GLProfile, InputStream, int, int, boolean, String)
Produces a TextureData object from a file, or returns null if the file format was not supported by this TextureProvider.
public TextureData
newTextureData(GLProfile
the OpenGL Profile this texture data should be created for.
glp
,
InputStream
the stream from which to read the texture data
stream
,
int
the OpenGL internal format to be used for the texture, or 0 if it should be inferred from the file's contents
internalFormat
,
int
the OpenGL pixel format to be used for the texture, or 0 if it should be inferred from the file's contents
pixelFormat
,
boolean
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.
mipmap
,
String
the file suffix to be used as a hint to the provider to more quickly decide whether it can handle the file, or null if the provider should infer the type from the file's contents
fileSuffix
)

Produces a TextureData object from a stream, or returns null if the file format was not supported by this TextureProvider.

public TextureData
newTextureData(GLProfile
the OpenGL Profile this texture data should be created for.
glp
,
URL
the URL from which to read the texture data
url
,
int
the OpenGL internal format to be used for the texture, or 0 if it should be inferred from the file's contents
internalFormat
,
int
the OpenGL pixel format to be used for the texture, or 0 if it should be inferred from the file's contents
pixelFormat
,
boolean
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.
mipmap
,
String
the file suffix to be used as a hint to the provider to more quickly decide whether it can handle the file, or null if the provider should infer the type from the file's contents
fileSuffix
)

Deprecated Use {@link #newTextureData(GLProfile, InputStream, int, int, boolean, String)
Produces a TextureData object from a URL, or returns null if the file format was not supported by this TextureProvider.

Method Detail

newTextureDataback to summary
public TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, String fileSuffix) throws IOException

Deprecated

Use {@link #newTextureData(GLProfile, InputStream, int, int, boolean, String)

Produces a TextureData object from a file, or returns null if the file format was not supported by this TextureProvider. Does not do any OpenGL-related work. The resulting TextureData can be converted into an OpenGL texture in a later step.

Parameters
glp:GLProfile

the OpenGL Profile this texture data should be created for.

file:File

the file from which to read the texture data

internalFormat:int

the OpenGL internal format to be used for the texture, or 0 if it should be inferred from the file's contents

pixelFormat:int

the OpenGL pixel format to be used for the texture, or 0 if it should be inferred from the file's contents

mipmap:boolean

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.

fileSuffix:String

the file suffix to be used as a hint to the provider to more quickly decide whether it can handle the file, or null if the provider should infer the type from the file's contents

Exceptions
IOException:
if an error occurred while reading the file
newTextureDataback to summary
public TextureData newTextureData(GLProfile glp, InputStream stream, int internalFormat, int pixelFormat, boolean mipmap, String fileSuffix) throws IOException

Produces a TextureData object from a stream, or returns null if the file format was not supported by this TextureProvider. Does not do any OpenGL-related work. The resulting TextureData can be converted into an OpenGL texture in a later step.

Parameters
glp:GLProfile

the OpenGL Profile this texture data should be created for.

stream:InputStream

the stream from which to read the texture data

internalFormat:int

the OpenGL internal format to be used for the texture, or 0 if it should be inferred from the file's contents

pixelFormat:int

the OpenGL pixel format to be used for the texture, or 0 if it should be inferred from the file's contents

mipmap:boolean

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.

fileSuffix:String

the file suffix to be used as a hint to the provider to more quickly decide whether it can handle the file, or null if the provider should infer the type from the file's contents

Exceptions
IOException:
if an error occurred while reading the stream
newTextureDataback to summary
public TextureData newTextureData(GLProfile glp, URL url, int internalFormat, int pixelFormat, boolean mipmap, String fileSuffix) throws IOException

Deprecated

Use {@link #newTextureData(GLProfile, InputStream, int, int, boolean, String)

Produces a TextureData object from a URL, or returns null if the file format was not supported by this TextureProvider. Does not do any OpenGL-related work. The resulting TextureData can be converted into an OpenGL texture in a later step.

Parameters
glp:GLProfile

the OpenGL Profile this texture data should be created for.

url:URL

the URL from which to read the texture data

internalFormat:int

the OpenGL internal format to be used for the texture, or 0 if it should be inferred from the file's contents

pixelFormat:int

the OpenGL pixel format to be used for the texture, or 0 if it should be inferred from the file's contents

mipmap:boolean

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.

fileSuffix:String

the file suffix to be used as a hint to the provider to more quickly decide whether it can handle the file, or null if the provider should infer the type from the file's contents

Exceptions
IOException:
if an error occurred while reading the URL
com.jogamp.opengl.util.texture.spi back to summary

public Interface TextureProvider.SupportsImageTypes

Known Direct Implementers
com.jogamp.opengl.util.texture.TextureIO.StreamBasedTextureProvider

Optional additional interface for TextureProvider implementation exposing the supported ImageTypes.

Use case: Mapping of ImageTypes to TextureProvider.

Method Summary

Modifier and TypeMethod and Description
public ImageType[]
getImageTypes()

Returns the supported ImageTypes.

Method Detail

getImageTypesback to summary
public ImageType[] getImageTypes()

Returns the supported ImageTypes.