|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
A reader and writer for DirectDraw Surface (.dds) files, which are used to describe textures. More...
Classes | |
| class | Header |
| class | ImageInfo |
| Simple class describing images and data; does not encapsulate image format information. More... | |
Public Member Functions | |
| void | close () |
| Closes open files and resources associated with the open DDSImage. More... | |
| void | write (final String filename) throws IOException |
| Writes this DDSImage to the specified file name. More... | |
| void | write (final File file) throws IOException |
| Writes this DDSImage to the specified file name. More... | |
| boolean | isSurfaceDescFlagSet (final int flag) |
| Test for presence/absence of surface description flags (DDSD_*) More... | |
| boolean | isPixelFormatFlagSet (final int flag) |
| Test for presence/absence of pixel format flags (DDPF_*) More... | |
| int | getPixelFormat () |
| Gets the pixel format of this texture (D3DFMT_*) based on some heuristics. More... | |
| boolean | isCubemap () |
| Indicates whether this texture is cubemap. More... | |
| boolean | isCubemapSidePresent (final int side) |
| Indicates whethe this cubemap side present. More... | |
| boolean | isCompressed () |
| Indicates whether this texture is compressed. More... | |
| int | getCompressionFormat () |
| If this surface is compressed, returns the kind of compression used (DXT1..DXT5). More... | |
| int | getWidth () |
| Width of the texture (or the top-most mipmap if mipmaps are present) More... | |
| int | getHeight () |
| Height of the texture (or the top-most mipmap if mipmaps are present) More... | |
| int | getDepth () |
| Total number of bits per pixel. More... | |
| int | getNumMipMaps () |
| Number of mip maps in the texture. More... | |
| ImageInfo | getMipMap (final int map) |
| Gets the ith mipmap data (0..getNumMipMaps() - 1) More... | |
| ImageInfo | getMipMap (final int side, final int map) |
| Gets the ith mipmap data (0..getNumMipMaps() - 1) More... | |
| ImageInfo[] | getAllMipMaps () |
| Returns an array of ImageInfos corresponding to all mipmap levels of this DDS file. More... | |
| ImageInfo[] | getAllMipMaps (final int side) |
| Returns an array of ImageInfos corresponding to all mipmap levels of this DDS file. More... | |
| void | debugPrint () |
Static Public Member Functions | |
| static DDSImage | read (final String filename) throws IOException |
| Reads a DirectDraw surface from the specified file name, returning the resulting DDSImage. More... | |
| static DDSImage | read (final File file) throws IOException |
| Reads a DirectDraw surface from the specified file, returning the resulting DDSImage. More... | |
| static DDSImage | read (final ByteBuffer buf) throws IOException |
| Reads a DirectDraw surface from the specified ByteBuffer, returning the resulting DDSImage. More... | |
| static DDSImage | createFromData (final int d3dFormat, final int width, final int height, final ByteBuffer[] mipmapData) throws IllegalArgumentException |
| Creates a new DDSImage from data supplied by the user. More... | |
| static String | getCompressionFormatName (int compressionFormat) |
| Converts e.g. More... | |
| static ByteBuffer | allocateBlankBuffer (final int width, final int height, final int openGLInternalFormat) |
| Allocates a temporary, empty ByteBuffer suitable for use in a call to glCompressedTexImage2D. More... | |
Static Public Attributes | |
| static final int | DDSD_CAPS = 0x00000001 |
| static final int | DDSD_HEIGHT = 0x00000002 |
| static final int | DDSD_WIDTH = 0x00000004 |
| static final int | DDSD_PITCH = 0x00000008 |
| static final int | DDSD_BACKBUFFERCOUNT = 0x00000020 |
| static final int | DDSD_ZBUFFERBITDEPTH = 0x00000040 |
| static final int | DDSD_ALPHABITDEPTH = 0x00000080 |
| static final int | DDSD_LPSURFACE = 0x00000800 |
| static final int | DDSD_PIXELFORMAT = 0x00001000 |
| static final int | DDSD_MIPMAPCOUNT = 0x00020000 |
| static final int | DDSD_LINEARSIZE = 0x00080000 |
| static final int | DDSD_DEPTH = 0x00800000 |
| static final int | DDPF_ALPHAPIXELS = 0x00000001 |
| static final int | DDPF_ALPHA = 0x00000002 |
| static final int | DDPF_FOURCC = 0x00000004 |
| static final int | DDPF_PALETTEINDEXED4 = 0x00000008 |
| static final int | DDPF_PALETTEINDEXEDTO8 = 0x00000010 |
| static final int | DDPF_PALETTEINDEXED8 = 0x00000020 |
| static final int | DDPF_RGB = 0x00000040 |
| static final int | DDPF_COMPRESSED = 0x00000080 |
| static final int | DDPF_RGBTOYUV = 0x00000100 |
| static final int | DDPF_YUV = 0x00000200 |
| static final int | DDPF_ZBUFFER = 0x00000400 |
| static final int | DDPF_PALETTEINDEXED1 = 0x00000800 |
| static final int | DDPF_PALETTEINDEXED2 = 0x00001000 |
| static final int | DDPF_ZPIXELS = 0x00002000 |
| static final int | DDSCAPS_TEXTURE = 0x00001000 |
| static final int | DDSCAPS_MIPMAP = 0x00400000 |
| static final int | DDSCAPS_COMPLEX = 0x00000008 |
| static final int | DDSCAPS2_CUBEMAP = 0x00000200 |
| static final int | DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400 |
| static final int | DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800 |
| static final int | DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000 |
| static final int | DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000 |
| static final int | DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000 |
| static final int | DDSCAPS2_CUBEMAP_NEGATIVEZ = 0x00008000 |
| static final int | D3DFMT_UNKNOWN = 0 |
| static final int | D3DFMT_R8G8B8 = 20 |
| static final int | D3DFMT_A8R8G8B8 = 21 |
| static final int | D3DFMT_X8R8G8B8 = 22 |
| static final int | D3DFMT_DXT1 = 0x31545844 |
| static final int | D3DFMT_DXT2 = 0x32545844 |
| static final int | D3DFMT_DXT3 = 0x33545844 |
| static final int | D3DFMT_DXT4 = 0x34545844 |
| static final int | D3DFMT_DXT5 = 0x35545844 |
A reader and writer for DirectDraw Surface (.dds) files, which are used to describe textures.
These files can contain multiple mipmap levels in one file. This class is currently minimal and does not support all of the possible file formats.
Definition at line 63 of file DDSImage.java.
|
static |
Allocates a temporary, empty ByteBuffer suitable for use in a call to glCompressedTexImage2D.
This is used by the Texture class to expand non-power-of-two DDS compressed textures to power-of-two sizes on hardware not supporting OpenGL 2.0 and the NPOT texture extension. The specified OpenGL internal format must be one of GL_COMPRESSED_RGB_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, or GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.
Definition at line 464 of file DDSImage.java.
| void com.jogamp.opengl.util.texture.spi.DDSImage.close | ( | ) |
Closes open files and resources associated with the open DDSImage.
No other methods may be called on this object once this is called.
Definition at line 199 of file DDSImage.java.
|
static |
Creates a new DDSImage from data supplied by the user.
The resulting DDSImage can be written to disk using the write() method.
| d3dFormat | the D3DFMT_ constant describing the data; it is assumed that it is packed tightly |
| width | the width in pixels of the topmost mipmap image |
| height | the height in pixels of the topmost mipmap image |
| mipmapData | the data for each mipmap level of the resulting DDSImage; either only one mipmap level should be specified, or they all must be |
| IllegalArgumentException | if the data does not match the specified arguments |
Definition at line 231 of file DDSImage.java.
| void com.jogamp.opengl.util.texture.spi.DDSImage.debugPrint | ( | ) |
| ImageInfo[] com.jogamp.opengl.util.texture.spi.DDSImage.getAllMipMaps | ( | ) |
Returns an array of ImageInfos corresponding to all mipmap levels of this DDS file.
Definition at line 417 of file DDSImage.java.
| ImageInfo[] com.jogamp.opengl.util.texture.spi.DDSImage.getAllMipMaps | ( | final int | side | ) |
Returns an array of ImageInfos corresponding to all mipmap levels of this DDS file.
| side | Cubemap side or 0 for 2D texture |
Definition at line 427 of file DDSImage.java.
| int com.jogamp.opengl.util.texture.spi.DDSImage.getCompressionFormat | ( | ) |
If this surface is compressed, returns the kind of compression used (DXT1..DXT5).
Definition at line 341 of file DDSImage.java.
|
static |
Converts e.g.
DXT1 compression format constant (see getCompressionFormat) into "DXT1".
| compressionFormat | Compression format constant |
Definition at line 444 of file DDSImage.java.
| int com.jogamp.opengl.util.texture.spi.DDSImage.getDepth | ( | ) |
Total number of bits per pixel.
Only valid if DDPF_RGB is present. For A8R8G8B8, would be 32.
Definition at line 359 of file DDSImage.java.
| int com.jogamp.opengl.util.texture.spi.DDSImage.getHeight | ( | ) |
Height of the texture (or the top-most mipmap if mipmaps are present)
Definition at line 353 of file DDSImage.java.
| ImageInfo com.jogamp.opengl.util.texture.spi.DDSImage.getMipMap | ( | final int | map | ) |
Gets the ith mipmap data (0..getNumMipMaps() - 1)
| map | Mipmap index |
Definition at line 375 of file DDSImage.java.
| ImageInfo com.jogamp.opengl.util.texture.spi.DDSImage.getMipMap | ( | final int | side, |
| final int | map | ||
| ) |
Gets the ith mipmap data (0..getNumMipMaps() - 1)
| side | Cubemap side or 0 for 2D texture |
| map | Mipmap index |
Definition at line 385 of file DDSImage.java.
| int com.jogamp.opengl.util.texture.spi.DDSImage.getNumMipMaps | ( | ) |
Number of mip maps in the texture.
Definition at line 364 of file DDSImage.java.
| int com.jogamp.opengl.util.texture.spi.DDSImage.getPixelFormat | ( | ) |
Gets the pixel format of this texture (D3DFMT_*) based on some heuristics.
Returns D3DFMT_UNKNOWN if could not recognize the pixel format.
Definition at line 287 of file DDSImage.java.
| int com.jogamp.opengl.util.texture.spi.DDSImage.getWidth | ( | ) |
Width of the texture (or the top-most mipmap if mipmaps are present)
Definition at line 347 of file DDSImage.java.
| boolean com.jogamp.opengl.util.texture.spi.DDSImage.isCompressed | ( | ) |
Indicates whether this texture is compressed.
Definition at line 335 of file DDSImage.java.
| boolean com.jogamp.opengl.util.texture.spi.DDSImage.isCubemap | ( | ) |
Indicates whether this texture is cubemap.
Definition at line 321 of file DDSImage.java.
| boolean com.jogamp.opengl.util.texture.spi.DDSImage.isCubemapSidePresent | ( | final int | side | ) |
Indicates whethe this cubemap side present.
| side | Side to test |
Definition at line 330 of file DDSImage.java.
| boolean com.jogamp.opengl.util.texture.spi.DDSImage.isPixelFormatFlagSet | ( | final int | flag | ) |
Test for presence/absence of pixel format flags (DDPF_*)
Definition at line 280 of file DDSImage.java.
| boolean com.jogamp.opengl.util.texture.spi.DDSImage.isSurfaceDescFlagSet | ( | final int | flag | ) |
Test for presence/absence of surface description flags (DDSD_*)
| flag | DDSD_* flags set to test |
Definition at line 275 of file DDSImage.java.
|
static |
Reads a DirectDraw surface from the specified ByteBuffer, returning the resulting DDSImage.
| buf | Input data |
| java.io.IOException | if an I/O exception occurred |
Definition at line 190 of file DDSImage.java.
|
static |
Reads a DirectDraw surface from the specified file, returning the resulting DDSImage.
| file | File object |
| java.io.IOException | if an I/O exception occurred |
Definition at line 177 of file DDSImage.java.
|
static |
Reads a DirectDraw surface from the specified file name, returning the resulting DDSImage.
| filename | File name |
| java.io.IOException | if an I/O exception occurred |
Definition at line 166 of file DDSImage.java.
| void com.jogamp.opengl.util.texture.spi.DDSImage.write | ( | final File | file | ) | throws IOException |
Writes this DDSImage to the specified file name.
| file | File object to write to |
| java.io.IOException | if an I/O exception occurred |
Definition at line 254 of file DDSImage.java.
| void com.jogamp.opengl.util.texture.spi.DDSImage.write | ( | final String | filename | ) | throws IOException |
Writes this DDSImage to the specified file name.
| filename | File name to write to |
| java.io.IOException | if an I/O exception occurred |
Definition at line 245 of file DDSImage.java.
|
static |
Definition at line 150 of file DDSImage.java.
|
static |
Definition at line 153 of file DDSImage.java.
|
static |
Definition at line 154 of file DDSImage.java.
|
static |
Definition at line 155 of file DDSImage.java.
|
static |
Definition at line 156 of file DDSImage.java.
|
static |
Definition at line 157 of file DDSImage.java.
|
static |
Definition at line 149 of file DDSImage.java.
|
static |
Definition at line 148 of file DDSImage.java.
|
static |
Definition at line 151 of file DDSImage.java.
|
static |
Definition at line 114 of file DDSImage.java.
|
static |
Definition at line 113 of file DDSImage.java.
|
static |
Definition at line 121 of file DDSImage.java.
|
static |
Definition at line 115 of file DDSImage.java.
|
static |
Definition at line 129 of file DDSImage.java.
|
static |
Definition at line 130 of file DDSImage.java.
|
static |
Definition at line 116 of file DDSImage.java.
|
static |
Definition at line 119 of file DDSImage.java.
|
static |
Definition at line 117 of file DDSImage.java.
|
static |
Definition at line 120 of file DDSImage.java.
|
static |
Definition at line 123 of file DDSImage.java.
|
static |
Definition at line 127 of file DDSImage.java.
|
static |
Definition at line 128 of file DDSImage.java.
|
static |
Definition at line 131 of file DDSImage.java.
|
static |
Definition at line 139 of file DDSImage.java.
|
static |
Definition at line 141 of file DDSImage.java.
|
static |
Definition at line 143 of file DDSImage.java.
|
static |
Definition at line 145 of file DDSImage.java.
|
static |
Definition at line 140 of file DDSImage.java.
|
static |
Definition at line 142 of file DDSImage.java.
|
static |
Definition at line 144 of file DDSImage.java.
|
static |
Definition at line 136 of file DDSImage.java.
|
static |
Definition at line 135 of file DDSImage.java.
|
static |
Definition at line 134 of file DDSImage.java.
|
static |
Definition at line 106 of file DDSImage.java.
|
static |
Definition at line 104 of file DDSImage.java.
|
static |
Definition at line 100 of file DDSImage.java.
|
static |
Definition at line 111 of file DDSImage.java.
|
static |
Definition at line 101 of file DDSImage.java.
|
static |
Definition at line 110 of file DDSImage.java.
|
static |
Definition at line 107 of file DDSImage.java.
|
static |
Definition at line 109 of file DDSImage.java.
|
static |
Definition at line 103 of file DDSImage.java.
|
static |
Definition at line 108 of file DDSImage.java.
|
static |
Definition at line 102 of file DDSImage.java.
|
static |
Definition at line 105 of file DDSImage.java.