JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
TextureData.java
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
3 * Copyright (c) 2010 JogAmp Community. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * - Redistribution of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * - Redistribution in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * Neither the name of Sun Microsystems, Inc. or the names of
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * This software is provided "AS IS," without a warranty of any kind. ALL
21 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
22 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
23 * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
24 * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
25 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
26 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
27 * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
28 * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
29 * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
30 * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
31 * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
32 *
33 * You acknowledge that this software is not designed or intended for use
34 * in the design, construction, operation or maintenance of any nuclear
35 * facility.
36 */
37
38package com.jogamp.opengl.util.texture;
39
40import java.nio.Buffer;
41
42import com.jogamp.opengl.GLProfile;
43
44import com.jogamp.common.nio.Buffers;
45import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
46
47/**
48 * Represents the data for an OpenGL texture. This is separated from
49 * the notion of a Texture to support things like streaming in of
50 * textures in a background thread without requiring an OpenGL context
51 * to be current on that thread.
52 *
53 * @author Chris Campbell
54 * @author Kenneth Russell
55 * @author Sven Gothel
56 */
57
58public class TextureData {
59 /** ColorSpace of pixel data. */
60 public static enum ColorSpace { RGB, YCbCr, YCCK, CMYK };
61
62 protected int width;
63 protected int height;
64 private int border;
66 protected int internalFormat; // perhaps inferred from pixelFormat?
67 protected boolean mipmap; // indicates whether mipmaps should be generated
68 // (ignored if mipmaps are supplied from the file)
69 private boolean dataIsCompressed;
70 protected boolean mustFlipVertically; // Must flip texture coordinates
71 // vertically to get OpenGL output
72 // to look correct
73 protected Buffer buffer; // the actual data...
74 private Buffer[] mipmapData; // ...or a series of mipmaps
75 private Flusher flusher;
76 protected int rowLength;
77 protected int alignment; // 1, 2, or 4 bytes
78 protected int estimatedMemorySize;
79
80 // These booleans are a concession to the AWTTextureData subclass
81 protected boolean haveEXTABGR;
82 protected boolean haveGL12;
85
86 // TODO: final, and set via ctor for 2.4.X
87 /* pp */ ImageType srcImageType;
88
89 /**
90 * Constructs a new TextureData object with the specified parameters
91 * and data contained in the given Buffer. The optional Flusher can
92 * be used to clean up native resources associated with this
93 * TextureData when processing is complete; for example, closing of
94 * memory-mapped files that might otherwise require a garbage
95 * collection to reclaim and close.
96 *
97 * @param glp the OpenGL Profile this texture data should be
98 * created for.
99 * @param internalFormat the OpenGL internal format for the
100 * resulting texture; must be specified, may
101 * not be 0
102 * @param width the width in pixels of the texture
103 * @param height the height in pixels of the texture
104 * @param border the number of pixels of border this texture
105 * data has (0 or 1)
106 * @param pixelFormat the OpenGL pixel format for the
107 * resulting texture; must be specified, may
108 * not be 0
109 * @param pixelType the OpenGL type of the pixels of the texture
110 * @param mipmap indicates whether mipmaps should be
111 * autogenerated (using GLU) for the resulting
112 * texture. Currently if mipmap is true then
113 * dataIsCompressed may not be true.
114 * @param dataIsCompressed indicates whether the texture data is in
115 * compressed form
116 * (e.g. GL_COMPRESSED_RGB_S3TC_DXT1_EXT)
117 * @param mustFlipVertically indicates whether the texture
118 * coordinates must be flipped vertically
119 * in order to properly display the
120 * texture
121 * @param buffer the buffer containing the texture data
122 * @param flusher optional flusher to perform cleanup tasks
123 * upon call to flush()
124 *
125 * @throws IllegalArgumentException if any parameters of the texture
126 * data were invalid, such as requesting mipmap generation for a
127 * compressed texture
128 */
129 public TextureData(final GLProfile glp,
130 final int internalFormat,
131 final int width,
132 final int height,
133 final int border,
134 final int pixelFormat,
135 final int pixelType,
136 final boolean mipmap,
137 final boolean dataIsCompressed,
138 final boolean mustFlipVertically,
139 final Buffer buffer,
140 final Flusher flusher) throws IllegalArgumentException {
141 this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
142 mipmap, dataIsCompressed, mustFlipVertically, buffer, flusher);
143 }
144
145 /**
146 * Constructs a new TextureData object with the specified parameters
147 * and data contained in the given Buffer. The optional Flusher can
148 * be used to clean up native resources associated with this
149 * TextureData when processing is complete; for example, closing of
150 * memory-mapped files that might otherwise require a garbage
151 * collection to reclaim and close.
152 *
153 * @param glp the OpenGL Profile this texture data should be
154 * created for.
155 * @param internalFormat the OpenGL internal format for the
156 * resulting texture; must be specified, may
157 * not be 0
158 * @param width the width in pixels of the texture
159 * @param height the height in pixels of the texture
160 * @param border the number of pixels of border this texture
161 * data has (0 or 1)
162 * @param pixelAttributes the OpenGL pixel format and type for the
163 * resulting texture; must be specified, may
164 * not be 0
165 * @param mipmap indicates whether mipmaps should be
166 * autogenerated (using GLU) for the resulting
167 * texture. Currently if mipmap is true then
168 * dataIsCompressed may not be true.
169 * @param dataIsCompressed indicates whether the texture data is in
170 * compressed form
171 * (e.g. GL_COMPRESSED_RGB_S3TC_DXT1_EXT)
172 * @param mustFlipVertically indicates whether the texture
173 * coordinates must be flipped vertically
174 * in order to properly display the
175 * texture
176 * @param buffer the buffer containing the texture data
177 * @param flusher optional flusher to perform cleanup tasks
178 * upon call to flush()
179 *
180 * @throws IllegalArgumentException if any parameters of the texture
181 * data were invalid, such as requesting mipmap generation for a
182 * compressed texture
183 */
184 public TextureData(final GLProfile glp,
185 final int internalFormat,
186 final int width,
187 final int height,
188 final int border,
190 final boolean mipmap,
191 final boolean dataIsCompressed,
192 final boolean mustFlipVertically,
193 final Buffer buffer,
194 final Flusher flusher) throws IllegalArgumentException {
195 if (mipmap && dataIsCompressed) {
196 throw new IllegalArgumentException("Can not generate mipmaps for compressed textures");
197 }
198
199 this.glProfile = glp;
200 this.width = width;
201 this.height = height;
202 this.border = border;
203 this.pixelAttributes = pixelAttributes;
204 this.internalFormat = internalFormat;
205 this.mipmap = mipmap;
206 this.dataIsCompressed = dataIsCompressed;
207 this.mustFlipVertically = mustFlipVertically;
208 this.buffer = buffer;
209 this.flusher = flusher;
210 alignment = 1; // FIXME: is this correct enough in all situations?
212 }
213
214 /**
215 * Constructs a new TextureData object with the specified parameters
216 * and data for multiple mipmap levels contained in the given array
217 * of Buffers. The optional Flusher can be used to clean up native
218 * resources associated with this TextureData when processing is
219 * complete; for example, closing of memory-mapped files that might
220 * otherwise require a garbage collection to reclaim and close.
221 *
222 * @param glp the OpenGL Profile this texture data should be
223 * created for.
224 * @param internalFormat the OpenGL internal format for the
225 * resulting texture; must be specified, may
226 * not be 0
227 * @param width the width in pixels of the topmost mipmap
228 * level of the texture
229 * @param height the height in pixels of the topmost mipmap
230 * level of the texture
231 * @param border the number of pixels of border this texture
232 * data has (0 or 1)
233 * @param pixelFormat the OpenGL pixel format for the
234 * resulting texture; must be specified, may
235 * not be 0
236 * @param pixelType the OpenGL type of the pixels of the texture
237 * @param dataIsCompressed indicates whether the texture data is in
238 * compressed form
239 * (e.g. GL_COMPRESSED_RGB_S3TC_DXT1_EXT)
240 * @param mustFlipVertically indicates whether the texture
241 * coordinates must be flipped vertically
242 * in order to properly display the
243 * texture
244 * @param mipmapData the buffers containing all mipmap levels
245 * of the texture's data
246 * @param flusher optional flusher to perform cleanup tasks
247 * upon call to flush()
248 *
249 * @throws IllegalArgumentException if any parameters of the texture
250 * data were invalid, such as requesting mipmap generation for a
251 * compressed texture
252 */
253 public TextureData(final GLProfile glp,
254 final int internalFormat,
255 final int width,
256 final int height,
257 final int border,
258 final int pixelFormat,
259 final int pixelType,
260 final boolean dataIsCompressed,
261 final boolean mustFlipVertically,
262 final Buffer[] mipmapData,
263 final Flusher flusher) throws IllegalArgumentException {
264 this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
265 dataIsCompressed, mustFlipVertically, mipmapData, flusher);
266 }
267
268 /**
269 * Constructs a new TextureData object with the specified parameters
270 * and data for multiple mipmap levels contained in the given array
271 * of Buffers. The optional Flusher can be used to clean up native
272 * resources associated with this TextureData when processing is
273 * complete; for example, closing of memory-mapped files that might
274 * otherwise require a garbage collection to reclaim and close.
275 *
276 * @param glp the OpenGL Profile this texture data should be
277 * created for.
278 * @param internalFormat the OpenGL internal format for the
279 * resulting texture; must be specified, may
280 * not be 0
281 * @param width the width in pixels of the topmost mipmap
282 * level of the texture
283 * @param height the height in pixels of the topmost mipmap
284 * level of the texture
285 * @param border the number of pixels of border this texture
286 * data has (0 or 1)
287 * @param pixelAttributes the OpenGL pixel format and type for the
288 * resulting texture; must be specified, may
289 * not be 0
290 * @param dataIsCompressed indicates whether the texture data is in
291 * compressed form
292 * (e.g. GL_COMPRESSED_RGB_S3TC_DXT1_EXT)
293 * @param mustFlipVertically indicates whether the texture
294 * coordinates must be flipped vertically
295 * in order to properly display the
296 * texture
297 * @param mipmapData the buffers containing all mipmap levels
298 * of the texture's data
299 * @param flusher optional flusher to perform cleanup tasks
300 * upon call to flush()
301 *
302 * @throws IllegalArgumentException if any parameters of the texture
303 * data were invalid, such as requesting mipmap generation for a
304 * compressed texture
305 */
306 public TextureData(final GLProfile glp,
307 final int internalFormat,
308 final int width,
309 final int height,
310 final int border,
312 final boolean dataIsCompressed,
313 final boolean mustFlipVertically,
314 final Buffer[] mipmapData,
315 final Flusher flusher) throws IllegalArgumentException {
316 this.glProfile = glp;
317 this.width = width;
318 this.height = height;
319 this.border = border;
320 this.pixelAttributes = pixelAttributes;
321 this.internalFormat = internalFormat;
322 this.dataIsCompressed = dataIsCompressed;
323 this.mustFlipVertically = mustFlipVertically;
324 this.mipmapData = mipmapData.clone();
325 this.flusher = flusher;
326 alignment = 1; // FIXME: is this correct enough in all situations?
327 for (int i = 0; i < mipmapData.length; i++) {
329 }
330 }
331
332 /**
333 * Returns the color space of the pixel data.
334 * @see #setColorSpace(ColorSpace)
335 */
336 public ColorSpace getColorSpace() { return pixelCS; }
337
338 /**
339 * Set the color space of the pixel data, which defaults to {@link ColorSpace#RGB}.
340 * @see #getColorSpace()
341 */
342 public void setColorSpace(final ColorSpace cs) { pixelCS = cs; }
343
344 /** Used only by subclasses */
345 protected TextureData(final GLProfile glp) { this.glProfile = glp; this.pixelAttributes = GLPixelAttributes.UNDEF; }
346
347 /**
348 * Returns the source {@link ImageType} if applicable and known, otherwise {@code null}.
349 * @since 2.3.2
350 */
352 return srcImageType;
353 }
354
355 /** Returns the width in pixels of the texture data. */
356 public int getWidth() { return width; }
357 /** Returns the height in pixels of the texture data. */
358 public int getHeight() { return height; }
359 /** Returns the border in pixels of the texture data. */
360 public int getBorder() {
361 return border;
362 }
363 /** Returns the intended OpenGL {@link GLPixelAttributes} of the texture data, i.e. format and type. */
365 return pixelAttributes;
366 }
367 /** Returns the intended OpenGL pixel format of the texture data using {@link #getPixelAttributes()}. */
368 public int getPixelFormat() {
369 return pixelAttributes.format;
370 }
371 /** Returns the intended OpenGL pixel type of the texture data using {@link #getPixelAttributes()}. */
372 public int getPixelType() {
373 return pixelAttributes.type;
374 }
375 /** Returns the intended OpenGL internal format of the texture data. */
376 public int getInternalFormat() {
377 return internalFormat;
378 }
379 /** Returns whether mipmaps should be generated for the texture data. */
380 public boolean getMipmap() {
381 return mipmap;
382 }
383 /** Indicates whether the texture data is in compressed form. */
384 public boolean isDataCompressed() {
385 return dataIsCompressed;
386 }
387 /** Indicates whether the texture coordinates must be flipped
388 vertically for proper display. */
389 public boolean getMustFlipVertically() {
390 return mustFlipVertically;
391 }
392 /** Returns the texture data, or null if it is specified as a set of mipmaps. */
393 public Buffer getBuffer() {
394 return buffer;
395 }
396 /** Returns all mipmap levels for the texture data, or null if it is
397 specified as a single image. */
398 public Buffer[] getMipmapData() {
399 return mipmapData;
400 }
401 /** Returns the required byte alignment for the texture data. */
402 public int getAlignment() {
403 return alignment;
404 }
405 /** Returns the row length needed for correct GL_UNPACK_ROW_LENGTH
406 specification. This is currently only supported for
407 non-mipmapped, non-compressed textures. */
408 public int getRowLength() {
409 return rowLength;
410 }
411
412 /** Sets the width in pixels of the texture data. */
413 public void setWidth(final int width) { this.width = width; }
414 /** Sets the height in pixels of the texture data. */
415 public void setHeight(final int height) { this.height = height; }
416 /** Sets the border in pixels of the texture data. */
417 public void setBorder(final int border) { this.border = border; }
418 /** Sets the intended OpenGL pixel format of the texture data. */
419 public void setPixelAttributes(final GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }
420 /**
421 * Sets the intended OpenGL pixel format component of {@link GLPixelAttributes} of the texture data.
422 * <p>
423 * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
424 * </p>
425 */
426 public void setPixelFormat(final int pixelFormat) {
427 if( pixelAttributes.format != pixelFormat ) {
429 }
430 }
431 /**
432 * Sets the intended OpenGL pixel type component of {@link GLPixelAttributes} of the texture data.
433 * <p>
434 * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
435 * </p>
436 */
437 public void setPixelType(final int pixelType) {
438 if( pixelAttributes.type != pixelType) {
440 }
441 }
442 /** Sets the intended OpenGL internal format of the texture data. */
443 public void setInternalFormat(final int internalFormat) { this.internalFormat = internalFormat; }
444 /** Sets whether mipmaps should be generated for the texture data. */
445 public void setMipmap(final boolean mipmap) { this.mipmap = mipmap; }
446 /** Sets whether the texture data is in compressed form. */
447 public void setIsDataCompressed(final boolean compressed) { this.dataIsCompressed = compressed; }
448 /** Sets whether the texture coordinates must be flipped vertically
449 for proper display. */
450 public void setMustFlipVertically(final boolean mustFlipVertically) { this.mustFlipVertically = mustFlipVertically; }
451 /** Sets the texture data. */
452 public void setBuffer(final Buffer buffer) {
453 this.buffer = buffer;
455 }
456 /** Sets the required byte alignment for the texture data. */
457 public void setAlignment(final int alignment) { this.alignment = alignment; }
458 /** Sets the row length needed for correct GL_UNPACK_ROW_LENGTH
459 specification. This is currently only supported for
460 non-mipmapped, non-compressed textures. */
461 public void setRowLength(final int rowLength) { this.rowLength = rowLength; }
462 /** Indicates to this TextureData whether the GL_EXT_abgr extension
463 is available. Used for optimization along some code paths to
464 avoid data copies. */
465 public void setHaveEXTABGR(final boolean haveEXTABGR) {
466 this.haveEXTABGR = haveEXTABGR;
467 }
468 /** Indicates to this TextureData whether OpenGL version 1.2 is
469 available. If not, falls back to relatively inefficient code
470 paths for several input data types (several kinds of packed
471 pixel formats, in particular). */
472 public void setHaveGL12(final boolean haveGL12) {
473 this.haveGL12 = haveGL12;
474 }
475
476 /** Returns the GLProfile this texture data is intended and created for. */
477 public GLProfile getGLProfile() { return glProfile; }
478
479 /** Returns an estimate of the amount of memory in bytes this
480 TextureData will consume once uploaded to the graphics card. It
481 should only be treated as an estimate; most applications should
482 not need to query this but instead let the OpenGL implementation
483 page textures in and out as necessary. */
485 return estimatedMemorySize;
486 }
487
488 /** Flushes resources associated with this TextureData by calling
489 Flusher.flush(). */
490 public void flush() {
491 if (flusher != null) {
492 flusher.flush();
493 flusher = null;
494 }
495 }
496
497 /** Calls flush()
498 * @see #flush()
499 */
500 public void destroy() {
501 flush();
502 }
503
504 /** Defines a callback mechanism to allow the user to explicitly
505 deallocate native resources (memory-mapped files, etc.)
506 associated with a particular TextureData. */
507 public static interface Flusher {
508 /** Flushes any native resources associated with this
509 TextureData. */
510 public void flush();
511 }
512
513 @Override
514 public String toString() {
515 final String optImageType = null != srcImageType ? ", "+srcImageType : "";
516 return "TextureData["+width+"x"+height+", y-flip "+mustFlipVertically+", internFormat 0x"+Integer.toHexString(internalFormat)+", "+
517 pixelAttributes+", border "+border+", estSize "+estimatedMemorySize+", alignment "+alignment+", rowlen "+rowLength+optImageType;
518 }
519
520 //----------------------------------------------------------------------
521 // Internals only below this point
522 //
523
524 protected static int estimatedMemorySize(final Buffer buffer) {
525 if (buffer == null) {
526 return 0;
527 }
528 return buffer.capacity() * Buffers.sizeOfBufferElem(buffer);
529 }
530}
Specifies the the OpenGL profile.
Definition: GLProfile.java:77
final int format
The OpenGL pixel data format.
static final GLPixelAttributes UNDEF
Undefined instance of GLPixelAttributes, having componentCount:=0, format:=0 and type:= 0.
Image type classification.
Definition: ImageType.java:42
Represents the data for an OpenGL texture.
void setHeight(final int height)
Sets the height in pixels of the texture data.
void setBuffer(final Buffer buffer)
Sets the texture data.
void setPixelAttributes(final GLPixelAttributes pixelAttributes)
Sets the intended OpenGL pixel format of the texture data.
void setPixelFormat(final int pixelFormat)
Sets the intended OpenGL pixel format component of GLPixelAttributes of the texture data.
void setColorSpace(final ColorSpace cs)
Set the color space of the pixel data, which defaults to ColorSpace#RGB.
static int estimatedMemorySize(final Buffer buffer)
void setAlignment(final int alignment)
Sets the required byte alignment for the texture data.
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)
Constructs a new TextureData object with the specified parameters and data for multiple mipmap levels...
ColorSpace getColorSpace()
Returns the color space of the pixel data.
Buffer[] getMipmapData()
Returns all mipmap levels for the texture data, or null if it is specified as a single image.
int getEstimatedMemorySize()
Returns an estimate of the amount of memory in bytes this TextureData will consume once uploaded to t...
void setRowLength(final int rowLength)
Sets the row length needed for correct GL_UNPACK_ROW_LENGTH specification.
void setMipmap(final boolean mipmap)
Sets whether mipmaps should be generated for the texture data.
TextureData(final GLProfile glp)
Used only by subclasses.
void setPixelType(final int pixelType)
Sets the intended OpenGL pixel type component of GLPixelAttributes of the texture data.
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)
Constructs a new TextureData object with the specified parameters and data for multiple mipmap levels...
int getPixelType()
Returns the intended OpenGL pixel type of the texture data using getPixelAttributes().
GLProfile getGLProfile()
Returns the GLProfile this texture data is intended and created for.
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)
Constructs a new TextureData object with the specified parameters and data contained in the given Buf...
GLPixelAttributes getPixelAttributes()
Returns the intended OpenGL GLPixelAttributes of the texture data, i.e.
Buffer getBuffer()
Returns the texture data, or null if it is specified as a set of mipmaps.
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)
Constructs a new TextureData object with the specified parameters and data contained in the given Buf...
int getAlignment()
Returns the required byte alignment for the texture data.
void setInternalFormat(final int internalFormat)
Sets the intended OpenGL internal format of the texture data.
final ImageType getSourceImageType()
Returns the source ImageType if applicable and known, otherwise null.
int getInternalFormat()
Returns the intended OpenGL internal format of the texture data.
void setWidth(final int width)
Sets the width in pixels of the texture data.
boolean getMustFlipVertically()
Indicates whether the texture coordinates must be flipped vertically for proper display.
void setBorder(final int border)
Sets the border in pixels of the texture data.
void setMustFlipVertically(final boolean mustFlipVertically)
Sets whether the texture coordinates must be flipped vertically for proper display.
void flush()
Flushes resources associated with this TextureData by calling Flusher.flush().
int getHeight()
Returns the height in pixels of the texture data.
int getPixelFormat()
Returns the intended OpenGL pixel format of the texture data using getPixelAttributes().
int getRowLength()
Returns the row length needed for correct GL_UNPACK_ROW_LENGTH specification.
void setHaveGL12(final boolean haveGL12)
Indicates to this TextureData whether OpenGL version 1.2 is available.
boolean isDataCompressed()
Indicates whether the texture data is in compressed form.
int getWidth()
Returns the width in pixels of the texture data.
boolean getMipmap()
Returns whether mipmaps should be generated for the texture data.
void setIsDataCompressed(final boolean compressed)
Sets whether the texture data is in compressed form.
int getBorder()
Returns the border in pixels of the texture data.
void setHaveEXTABGR(final boolean haveEXTABGR)
Indicates to this TextureData whether the GL_EXT_abgr extension is available.
Defines a callback mechanism to allow the user to explicitly deallocate native resources (memory-mapp...
void flush()
Flushes any native resources associated with this TextureData.