|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
Represents the data for an OpenGL texture. More...
Classes | |
| enum | ColorSpace |
| ColorSpace of pixel data. More... | |
| interface | Flusher |
| Defines a callback mechanism to allow the user to explicitly deallocate native resources (memory-mapped files, etc.) associated with a particular TextureData. More... | |
Public Member Functions | |
| TextureData (final GLProfile glp, final int internalFormat, final int width, final int height, final int border, final int pixelFormat, final int pixelType, final boolean mipmap, final boolean dataIsCompressed, final boolean mustFlipVertically, final Buffer buffer, final Flusher flusher) throws IllegalArgumentException | |
| Constructs a new TextureData object with the specified parameters and data contained in the given Buffer. More... | |
| TextureData (final GLProfile glp, final int internalFormat, final int width, final int height, final int border, final GLPixelAttributes pixelAttributes, final boolean mipmap, final boolean dataIsCompressed, final boolean mustFlipVertically, final Buffer buffer, final Flusher flusher) throws IllegalArgumentException | |
| Constructs a new TextureData object with the specified parameters and data contained in the given Buffer. More... | |
| TextureData (final GLProfile glp, final int internalFormat, final int width, final int height, final int border, final int pixelFormat, final int pixelType, final boolean dataIsCompressed, final boolean mustFlipVertically, final Buffer[] mipmapData, final Flusher flusher) throws IllegalArgumentException | |
| Constructs a new TextureData object with the specified parameters and data for multiple mipmap levels contained in the given array of Buffers. More... | |
| TextureData (final GLProfile glp, final int internalFormat, final int width, final int height, final int border, final GLPixelAttributes pixelAttributes, final boolean dataIsCompressed, final boolean mustFlipVertically, final Buffer[] mipmapData, final Flusher flusher) throws IllegalArgumentException | |
| Constructs a new TextureData object with the specified parameters and data for multiple mipmap levels contained in the given array of Buffers. More... | |
| ColorSpace | getColorSpace () |
| Returns the color space of the pixel data. More... | |
| void | setColorSpace (final ColorSpace cs) |
Set the color space of the pixel data, which defaults to ColorSpace#RGB. More... | |
| final ImageType | getSourceImageType () |
Returns the source ImageType if applicable and known, otherwise null. More... | |
| int | getWidth () |
| Returns the width in pixels of the texture data. More... | |
| int | getHeight () |
| Returns the height in pixels of the texture data. More... | |
| int | getBorder () |
| Returns the border in pixels of the texture data. More... | |
| GLPixelAttributes | getPixelAttributes () |
Returns the intended OpenGL GLPixelAttributes of the texture data, i.e. More... | |
| int | getPixelFormat () |
Returns the intended OpenGL pixel format of the texture data using getPixelAttributes(). More... | |
| int | getPixelType () |
Returns the intended OpenGL pixel type of the texture data using getPixelAttributes(). More... | |
| int | getInternalFormat () |
| Returns the intended OpenGL internal format of the texture data. More... | |
| boolean | getMipmap () |
| Returns whether mipmaps should be generated for the texture data. More... | |
| boolean | isDataCompressed () |
| Indicates whether the texture data is in compressed form. More... | |
| boolean | getMustFlipVertically () |
| Indicates whether the texture coordinates must be flipped vertically for proper display. More... | |
| Buffer | getBuffer () |
| Returns the texture data, or null if it is specified as a set of mipmaps. More... | |
| Buffer[] | getMipmapData () |
| Returns all mipmap levels for the texture data, or null if it is specified as a single image. More... | |
| int | getAlignment () |
| Returns the required byte alignment for the texture data. More... | |
| int | getRowLength () |
| Returns the row length needed for correct GL_UNPACK_ROW_LENGTH specification. More... | |
| void | setWidth (final int width) |
| Sets the width in pixels of the texture data. More... | |
| void | setHeight (final int height) |
| Sets the height in pixels of the texture data. More... | |
| void | setBorder (final int border) |
| Sets the border in pixels of the texture data. More... | |
| void | setPixelAttributes (final GLPixelAttributes pixelAttributes) |
| Sets the intended OpenGL pixel format of the texture data. More... | |
| void | setPixelFormat (final int pixelFormat) |
Sets the intended OpenGL pixel format component of GLPixelAttributes of the texture data. More... | |
| void | setPixelType (final int pixelType) |
Sets the intended OpenGL pixel type component of GLPixelAttributes of the texture data. More... | |
| void | setInternalFormat (final int internalFormat) |
| Sets the intended OpenGL internal format of the texture data. More... | |
| void | setMipmap (final boolean mipmap) |
| Sets whether mipmaps should be generated for the texture data. More... | |
| void | setIsDataCompressed (final boolean compressed) |
| Sets whether the texture data is in compressed form. More... | |
| void | setMustFlipVertically (final boolean mustFlipVertically) |
| Sets whether the texture coordinates must be flipped vertically for proper display. More... | |
| void | setBuffer (final Buffer buffer) |
| Sets the texture data. More... | |
| void | setAlignment (final int alignment) |
| Sets the required byte alignment for the texture data. More... | |
| void | setRowLength (final int rowLength) |
| Sets the row length needed for correct GL_UNPACK_ROW_LENGTH specification. More... | |
| void | setHaveEXTABGR (final boolean haveEXTABGR) |
| Indicates to this TextureData whether the GL_EXT_abgr extension is available. More... | |
| void | setHaveGL12 (final boolean haveGL12) |
| Indicates to this TextureData whether OpenGL version 1.2 is available. More... | |
| GLProfile | getGLProfile () |
| Returns the GLProfile this texture data is intended and created for. More... | |
| int | getEstimatedMemorySize () |
| Returns an estimate of the amount of memory in bytes this TextureData will consume once uploaded to the graphics card. More... | |
| void | flush () |
| Flushes resources associated with this TextureData by calling Flusher.flush(). More... | |
| void | destroy () |
| Calls flush() More... | |
| String | toString () |
Protected Member Functions | |
| TextureData (final GLProfile glp) | |
| Used only by subclasses. More... | |
Static Protected Member Functions | |
| static int | estimatedMemorySize (final Buffer buffer) |
Protected Attributes | |
| int | width |
| int | height |
| GLPixelAttributes | pixelAttributes |
| int | internalFormat |
| boolean | mipmap |
| boolean | mustFlipVertically |
| Buffer | buffer |
| int | rowLength |
| int | alignment |
| int | estimatedMemorySize |
| boolean | haveEXTABGR |
| boolean | haveGL12 |
| GLProfile | glProfile |
| ColorSpace | pixelCS = ColorSpace.RGB |
Represents the data for an OpenGL texture.
This is separated from the notion of a Texture to support things like streaming in of textures in a background thread without requiring an OpenGL context to be current on that thread.
Definition at line 58 of file TextureData.java.
| com.jogamp.opengl.util.texture.TextureData.TextureData | ( | final GLProfile | glp, |
| final int | internalFormat, | ||
| final int | width, | ||
| final int | height, | ||
| final int | border, | ||
| final int | pixelFormat, | ||
| final int | pixelType, | ||
| final boolean | mipmap, | ||
| final boolean | dataIsCompressed, | ||
| final boolean | mustFlipVertically, | ||
| final Buffer | buffer, | ||
| final Flusher | flusher | ||
| ) | throws IllegalArgumentException |
Constructs a new TextureData object with the specified parameters and data contained in the given Buffer.
The optional Flusher can be used to clean up native resources associated with this TextureData when processing is complete; for example, closing of memory-mapped files that might otherwise require a garbage collection to reclaim and close.
| glp | the OpenGL Profile this texture data should be created for. |
| internalFormat | the OpenGL internal format for the resulting texture; must be specified, may not be 0 |
| width | the width in pixels of the texture |
| height | the height in pixels of the texture |
| border | the number of pixels of border this texture data has (0 or 1) |
| pixelFormat | the OpenGL pixel format for the resulting texture; must be specified, may not be 0 |
| pixelType | the OpenGL type of the pixels of the texture |
| mipmap | indicates whether mipmaps should be autogenerated (using GLU) for the resulting texture. Currently if mipmap is true then dataIsCompressed may not be true. |
| dataIsCompressed | indicates whether the texture data is in compressed form (e.g. GL_COMPRESSED_RGB_S3TC_DXT1_EXT) |
| mustFlipVertically | indicates whether the texture coordinates must be flipped vertically in order to properly display the texture |
| buffer | the buffer containing the texture data |
| flusher | optional flusher to perform cleanup tasks upon call to flush() |
| IllegalArgumentException | if any parameters of the texture data were invalid, such as requesting mipmap generation for a compressed texture |
Definition at line 129 of file TextureData.java.
| com.jogamp.opengl.util.texture.TextureData.TextureData | ( | final GLProfile | glp, |
| final int | internalFormat, | ||
| final int | width, | ||
| final int | height, | ||
| final int | border, | ||
| final GLPixelAttributes | pixelAttributes, | ||
| final boolean | mipmap, | ||
| final boolean | dataIsCompressed, | ||
| final boolean | mustFlipVertically, | ||
| final Buffer | buffer, | ||
| final Flusher | flusher | ||
| ) | throws IllegalArgumentException |
Constructs a new TextureData object with the specified parameters and data contained in the given Buffer.
The optional Flusher can be used to clean up native resources associated with this TextureData when processing is complete; for example, closing of memory-mapped files that might otherwise require a garbage collection to reclaim and close.
| glp | the OpenGL Profile this texture data should be created for. |
| internalFormat | the OpenGL internal format for the resulting texture; must be specified, may not be 0 |
| width | the width in pixels of the texture |
| height | the height in pixels of the texture |
| border | the number of pixels of border this texture data has (0 or 1) |
| pixelAttributes | the OpenGL pixel format and type for the resulting texture; must be specified, may not be 0 |
| mipmap | indicates whether mipmaps should be autogenerated (using GLU) for the resulting texture. Currently if mipmap is true then dataIsCompressed may not be true. |
| dataIsCompressed | indicates whether the texture data is in compressed form (e.g. GL_COMPRESSED_RGB_S3TC_DXT1_EXT) |
| mustFlipVertically | indicates whether the texture coordinates must be flipped vertically in order to properly display the texture |
| buffer | the buffer containing the texture data |
| flusher | optional flusher to perform cleanup tasks upon call to flush() |
| IllegalArgumentException | if any parameters of the texture data were invalid, such as requesting mipmap generation for a compressed texture |
Definition at line 184 of file TextureData.java.
| com.jogamp.opengl.util.texture.TextureData.TextureData | ( | final GLProfile | glp, |
| final int | internalFormat, | ||
| final int | width, | ||
| final int | height, | ||
| final int | border, | ||
| final int | pixelFormat, | ||
| final int | pixelType, | ||
| final boolean | dataIsCompressed, | ||
| final boolean | mustFlipVertically, | ||
| final Buffer[] | mipmapData, | ||
| final Flusher | flusher | ||
| ) | throws IllegalArgumentException |
Constructs a new TextureData object with the specified parameters and data for multiple mipmap levels contained in the given array of Buffers.
The optional Flusher can be used to clean up native resources associated with this TextureData when processing is complete; for example, closing of memory-mapped files that might otherwise require a garbage collection to reclaim and close.
| glp | the OpenGL Profile this texture data should be created for. |
| internalFormat | the OpenGL internal format for the resulting texture; must be specified, may not be 0 |
| width | the width in pixels of the topmost mipmap level of the texture |
| height | the height in pixels of the topmost mipmap level of the texture |
| border | the number of pixels of border this texture data has (0 or 1) |
| pixelFormat | the OpenGL pixel format for the resulting texture; must be specified, may not be 0 |
| pixelType | the OpenGL type of the pixels of the texture |
| dataIsCompressed | indicates whether the texture data is in compressed form (e.g. GL_COMPRESSED_RGB_S3TC_DXT1_EXT) |
| mustFlipVertically | indicates whether the texture coordinates must be flipped vertically in order to properly display the texture |
| mipmapData | the buffers containing all mipmap levels of the texture's data |
| flusher | optional flusher to perform cleanup tasks upon call to flush() |
| IllegalArgumentException | if any parameters of the texture data were invalid, such as requesting mipmap generation for a compressed texture |
Definition at line 253 of file TextureData.java.
| com.jogamp.opengl.util.texture.TextureData.TextureData | ( | final GLProfile | glp, |
| final int | internalFormat, | ||
| final int | width, | ||
| final int | height, | ||
| final int | border, | ||
| final GLPixelAttributes | pixelAttributes, | ||
| final boolean | dataIsCompressed, | ||
| final boolean | mustFlipVertically, | ||
| final Buffer[] | mipmapData, | ||
| final Flusher | flusher | ||
| ) | throws IllegalArgumentException |
Constructs a new TextureData object with the specified parameters and data for multiple mipmap levels contained in the given array of Buffers.
The optional Flusher can be used to clean up native resources associated with this TextureData when processing is complete; for example, closing of memory-mapped files that might otherwise require a garbage collection to reclaim and close.
| glp | the OpenGL Profile this texture data should be created for. |
| internalFormat | the OpenGL internal format for the resulting texture; must be specified, may not be 0 |
| width | the width in pixels of the topmost mipmap level of the texture |
| height | the height in pixels of the topmost mipmap level of the texture |
| border | the number of pixels of border this texture data has (0 or 1) |
| pixelAttributes | the OpenGL pixel format and type for the resulting texture; must be specified, may not be 0 |
| dataIsCompressed | indicates whether the texture data is in compressed form (e.g. GL_COMPRESSED_RGB_S3TC_DXT1_EXT) |
| mustFlipVertically | indicates whether the texture coordinates must be flipped vertically in order to properly display the texture |
| mipmapData | the buffers containing all mipmap levels of the texture's data |
| flusher | optional flusher to perform cleanup tasks upon call to flush() |
| IllegalArgumentException | if any parameters of the texture data were invalid, such as requesting mipmap generation for a compressed texture |
Definition at line 306 of file TextureData.java.
|
protected |
Used only by subclasses.
Definition at line 345 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.destroy | ( | ) |
Calls flush()
Definition at line 500 of file TextureData.java.
|
staticprotected |
Definition at line 524 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.flush | ( | ) |
Flushes resources associated with this TextureData by calling Flusher.flush().
Definition at line 490 of file TextureData.java.
| int com.jogamp.opengl.util.texture.TextureData.getAlignment | ( | ) |
Returns the required byte alignment for the texture data.
Definition at line 402 of file TextureData.java.
| int com.jogamp.opengl.util.texture.TextureData.getBorder | ( | ) |
Returns the border in pixels of the texture data.
Definition at line 360 of file TextureData.java.
| Buffer com.jogamp.opengl.util.texture.TextureData.getBuffer | ( | ) |
Returns the texture data, or null if it is specified as a set of mipmaps.
Reimplemented in com.jogamp.opengl.util.texture.awt.AWTTextureData.
Definition at line 393 of file TextureData.java.
| ColorSpace com.jogamp.opengl.util.texture.TextureData.getColorSpace | ( | ) |
Returns the color space of the pixel data.
Definition at line 336 of file TextureData.java.
| int com.jogamp.opengl.util.texture.TextureData.getEstimatedMemorySize | ( | ) |
Returns an estimate of the amount of memory in bytes this TextureData will consume once uploaded to the graphics card.
It should only be treated as an estimate; most applications should not need to query this but instead let the OpenGL implementation page textures in and out as necessary.
Definition at line 484 of file TextureData.java.
| GLProfile com.jogamp.opengl.util.texture.TextureData.getGLProfile | ( | ) |
Returns the GLProfile this texture data is intended and created for.
Definition at line 477 of file TextureData.java.
| int com.jogamp.opengl.util.texture.TextureData.getHeight | ( | ) |
Returns the height in pixels of the texture data.
Definition at line 358 of file TextureData.java.
| int com.jogamp.opengl.util.texture.TextureData.getInternalFormat | ( | ) |
Returns the intended OpenGL internal format of the texture data.
Definition at line 376 of file TextureData.java.
| boolean com.jogamp.opengl.util.texture.TextureData.getMipmap | ( | ) |
Returns whether mipmaps should be generated for the texture data.
Definition at line 380 of file TextureData.java.
| Buffer[] com.jogamp.opengl.util.texture.TextureData.getMipmapData | ( | ) |
Returns all mipmap levels for the texture data, or null if it is specified as a single image.
Definition at line 398 of file TextureData.java.
| boolean com.jogamp.opengl.util.texture.TextureData.getMustFlipVertically | ( | ) |
Indicates whether the texture coordinates must be flipped vertically for proper display.
Definition at line 389 of file TextureData.java.
| GLPixelAttributes com.jogamp.opengl.util.texture.TextureData.getPixelAttributes | ( | ) |
Returns the intended OpenGL GLPixelAttributes of the texture data, i.e.
format and type.
Reimplemented in com.jogamp.opengl.util.texture.awt.AWTTextureData.
Definition at line 364 of file TextureData.java.
| int com.jogamp.opengl.util.texture.TextureData.getPixelFormat | ( | ) |
Returns the intended OpenGL pixel format of the texture data using getPixelAttributes().
Reimplemented in com.jogamp.opengl.util.texture.awt.AWTTextureData.
Definition at line 368 of file TextureData.java.
| int com.jogamp.opengl.util.texture.TextureData.getPixelType | ( | ) |
Returns the intended OpenGL pixel type of the texture data using getPixelAttributes().
Reimplemented in com.jogamp.opengl.util.texture.awt.AWTTextureData.
Definition at line 372 of file TextureData.java.
| int com.jogamp.opengl.util.texture.TextureData.getRowLength | ( | ) |
Returns the row length needed for correct GL_UNPACK_ROW_LENGTH specification.
This is currently only supported for non-mipmapped, non-compressed textures.
Definition at line 408 of file TextureData.java.
| final ImageType com.jogamp.opengl.util.texture.TextureData.getSourceImageType | ( | ) |
Returns the source ImageType if applicable and known, otherwise null.
Definition at line 351 of file TextureData.java.
| int com.jogamp.opengl.util.texture.TextureData.getWidth | ( | ) |
Returns the width in pixels of the texture data.
Definition at line 356 of file TextureData.java.
| boolean com.jogamp.opengl.util.texture.TextureData.isDataCompressed | ( | ) |
Indicates whether the texture data is in compressed form.
Definition at line 384 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setAlignment | ( | final int | alignment | ) |
Sets the required byte alignment for the texture data.
Definition at line 457 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setBorder | ( | final int | border | ) |
Sets the border in pixels of the texture data.
Definition at line 417 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setBuffer | ( | final Buffer | buffer | ) |
Sets the texture data.
Definition at line 452 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setColorSpace | ( | final ColorSpace | cs | ) |
Set the color space of the pixel data, which defaults to ColorSpace#RGB.
Definition at line 342 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setHaveEXTABGR | ( | final boolean | haveEXTABGR | ) |
Indicates to this TextureData whether the GL_EXT_abgr extension is available.
Used for optimization along some code paths to avoid data copies.
Definition at line 465 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setHaveGL12 | ( | final boolean | haveGL12 | ) |
Indicates to this TextureData whether OpenGL version 1.2 is available.
If not, falls back to relatively inefficient code paths for several input data types (several kinds of packed pixel formats, in particular).
Definition at line 472 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setHeight | ( | final int | height | ) |
Sets the height in pixels of the texture data.
Definition at line 415 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setInternalFormat | ( | final int | internalFormat | ) |
Sets the intended OpenGL internal format of the texture data.
Definition at line 443 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setIsDataCompressed | ( | final boolean | compressed | ) |
Sets whether the texture data is in compressed form.
Definition at line 447 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setMipmap | ( | final boolean | mipmap | ) |
Sets whether mipmaps should be generated for the texture data.
Definition at line 445 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setMustFlipVertically | ( | final boolean | mustFlipVertically | ) |
Sets whether the texture coordinates must be flipped vertically for proper display.
Definition at line 450 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setPixelAttributes | ( | final GLPixelAttributes | pixelAttributes | ) |
Sets the intended OpenGL pixel format of the texture data.
Definition at line 419 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setPixelFormat | ( | final int | pixelFormat | ) |
Sets the intended OpenGL pixel format component of GLPixelAttributes of the texture data.
Use setPixelAttributes(GLPixelAttributes), if setting format and type.
Definition at line 426 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setPixelType | ( | final int | pixelType | ) |
Sets the intended OpenGL pixel type component of GLPixelAttributes of the texture data.
Use setPixelAttributes(GLPixelAttributes), if setting format and type.
Definition at line 437 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setRowLength | ( | final int | rowLength | ) |
Sets the row length needed for correct GL_UNPACK_ROW_LENGTH specification.
This is currently only supported for non-mipmapped, non-compressed textures.
Definition at line 461 of file TextureData.java.
| void com.jogamp.opengl.util.texture.TextureData.setWidth | ( | final int | width | ) |
Sets the width in pixels of the texture data.
Definition at line 413 of file TextureData.java.
| String com.jogamp.opengl.util.texture.TextureData.toString | ( | ) |
Definition at line 514 of file TextureData.java.
|
protected |
Definition at line 77 of file TextureData.java.
|
protected |
Definition at line 73 of file TextureData.java.
|
protected |
Definition at line 78 of file TextureData.java.
|
protected |
Definition at line 83 of file TextureData.java.
|
protected |
Definition at line 81 of file TextureData.java.
|
protected |
Definition at line 82 of file TextureData.java.
|
protected |
Definition at line 63 of file TextureData.java.
|
protected |
Definition at line 66 of file TextureData.java.
|
protected |
Definition at line 67 of file TextureData.java.
|
protected |
Definition at line 70 of file TextureData.java.
|
protected |
Definition at line 65 of file TextureData.java.
|
protected |
Definition at line 84 of file TextureData.java.
|
protected |
Definition at line 76 of file TextureData.java.
|
protected |
Definition at line 62 of file TextureData.java.