APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.graphics.glutils

public Class KTXTextureData

extends Object
implements TextureData, CubemapData
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.graphics.CubemapData, com.badlogic.gdx.graphics.TextureData
Imports
java.io.BufferedInputStream, .DataInputStream, java.nio.Buffer, .ByteBuffer, .ByteOrder, .IntBuffer, java.util.zip.GZIPInputStream, com.badlogic.gdx.Gdx, com.badlogic.gdx.files.FileHandle, com.badlogic.gdx.graphics.Cubemap, .CubemapData, .GL20, .Pixmap, .Pixmap.Format, .Texture, .TextureData, com.badlogic.gdx.graphics.glutils.ETC1.ETC1Data, com.badlogic.gdx.utils.BufferUtils, .GdxRuntimeException, .StreamUtils

A KTXTextureData holds the data from a KTX (or zipped KTX file, aka ZKTX). That is to say an OpenGL ready texture data. The KTX file format is just a thin wrapper around OpenGL textures and therefore is compatible with most OpenGL texture capabilities like texture compression, cubemapping, mipmapping, etc. For example, KTXTextureData can be used for Texture or Cubemap.
Author
Vincent Bousquet

Field Summary

Modifier and TypeField and Description
private ByteBuffer
private FileHandle
private static final int
private static final int
private static final int
private static final int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private int
private boolean

Constructor Summary

AccessConstructor and Description
public
KTXTextureData(FileHandle file, boolean genMipMaps)

Method Summary

Modifier and TypeMethod and Description
public void
consumeCubemapData()

Implements com.badlogic.gdx.graphics.CubemapData.consumeCubemapData.

Uploads the pixel data for the 6 faces of the cube to the OpenGL ES texture.

public void
consumeCustomData(int target)

Implements com.badlogic.gdx.graphics.TextureData.consumeCustomData.

Uploads the pixel data to the OpenGL ES texture.

public Pixmap
consumePixmap()

Implements com.badlogic.gdx.graphics.TextureData.consumePixmap.

Returns the Pixmap for upload by Texture.

public boolean
public void
public ByteBuffer
getData(int requestedLevel, int requestedFace)

public Pixmap.Format
public int
public int
public int
public int
public TextureData.TextureDataType
public int
public boolean
public boolean
public void
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

compressedDataback to summary
private ByteBuffer compressedData
fileback to summary
private FileHandle file
GL_TEXTURE_1Dback to summary
private static final int GL_TEXTURE_1D
GL_TEXTURE_1D_ARRAY_EXTback to summary
private static final int GL_TEXTURE_1D_ARRAY_EXT
GL_TEXTURE_2D_ARRAY_EXTback to summary
private static final int GL_TEXTURE_2D_ARRAY_EXT
GL_TEXTURE_3Dback to summary
private static final int GL_TEXTURE_3D
glBaseInternalFormatback to summary
private int glBaseInternalFormat
glFormatback to summary
private int glFormat
glInternalFormatback to summary
private int glInternalFormat
glTypeback to summary
private int glType
glTypeSizeback to summary
private int glTypeSize
imagePosback to summary
private int imagePos
numberOfArrayElementsback to summary
private int numberOfArrayElements
numberOfFacesback to summary
private int numberOfFaces
numberOfMipmapLevelsback to summary
private int numberOfMipmapLevels
pixelDepthback to summary
private int pixelDepth
pixelHeightback to summary
private int pixelHeight
pixelWidthback to summary
private int pixelWidth
useMipMapsback to summary
private boolean useMipMaps

Constructor Detail

KTXTextureDataback to summary
public KTXTextureData(FileHandle file, boolean genMipMaps)

Method Detail

consumeCubemapDataback to summary
public void consumeCubemapData()

Implements com.badlogic.gdx.graphics.CubemapData.consumeCubemapData.

Doc from com.badlogic.gdx.graphics.CubemapData.consumeCubemapData.

Uploads the pixel data for the 6 faces of the cube to the OpenGL ES texture. The caller must bind an OpenGL ES texture. A call to prepare() must preceed a call to this method. Any internal data structures created in prepare() should be disposed of here.

Annotations
@Override
consumeCustomDataback to summary
public void consumeCustomData(int target)

Implements com.badlogic.gdx.graphics.TextureData.consumeCustomData.

Doc from com.badlogic.gdx.graphics.TextureData.consumeCustomData.

Uploads the pixel data to the OpenGL ES texture. The caller must bind an OpenGL ES texture. A call to prepare() must preceed a call to this method. Any internal data structures created in prepare() should be disposed of here.

Annotations
@Override
consumePixmapback to summary
public Pixmap consumePixmap()

Implements com.badlogic.gdx.graphics.TextureData.consumePixmap.

Doc from com.badlogic.gdx.graphics.TextureData.consumePixmap.

Returns the Pixmap for upload by Texture. A call to prepare() must precede a call to this method. Any internal data structures created in prepare() should be disposed of here.

Annotations
@Override
disposePixmapback to summary
public boolean disposePixmap()

Implements com.badlogic.gdx.graphics.TextureData.disposePixmap.

Annotations
@Override
disposePreparedDataback to summary
public void disposePreparedData()
getDataback to summary
public ByteBuffer getData(int requestedLevel, int requestedFace)
getFormatback to summary
public Pixmap.Format getFormat()

Implements com.badlogic.gdx.graphics.TextureData.getFormat.

Annotations
@Override
getGlInternalFormatback to summary
public int getGlInternalFormat()
getHeightback to summary
public int getHeight()

Implements com.badlogic.gdx.graphics.TextureData.getHeight, com.badlogic.gdx.graphics.CubemapData.getHeight.

Annotations
@Override
getNumberOfFacesback to summary
public int getNumberOfFaces()
getNumberOfMipMapLevelsback to summary
public int getNumberOfMipMapLevels()
getTypeback to summary
public TextureData.TextureDataType getType()

Implements com.badlogic.gdx.graphics.TextureData.getType.

Annotations
@Override
getWidthback to summary
public int getWidth()

Implements com.badlogic.gdx.graphics.TextureData.getWidth, com.badlogic.gdx.graphics.CubemapData.getWidth.

Annotations
@Override
isManagedback to summary
public boolean isManaged()

Implements com.badlogic.gdx.graphics.TextureData.isManaged, com.badlogic.gdx.graphics.CubemapData.isManaged.

Annotations
@Override
isPreparedback to summary
public boolean isPrepared()

Implements com.badlogic.gdx.graphics.TextureData.isPrepared, com.badlogic.gdx.graphics.CubemapData.isPrepared.

Annotations
@Override
prepareback to summary
public void prepare()

Implements com.badlogic.gdx.graphics.TextureData.prepare, com.badlogic.gdx.graphics.CubemapData.prepare.

Doc from com.badlogic.gdx.graphics.TextureData.prepare.

Prepares the TextureData for a call to consumePixmap() or consumeCustomData(int). This method can be called from a non OpenGL thread and should thus not interact with OpenGL.

Annotations
@Override
useMipMapsback to summary
public boolean useMipMaps()

Implements com.badlogic.gdx.graphics.TextureData.useMipMaps.

Annotations
@Override