public final class TextureDXT3
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected TextureID.AlphaMode |
alphaChannelMode |
protected int |
blockSize
Block size in octets
|
protected int |
height
Height of the picture
|
protected int |
numChannels
Number of channels
|
protected int |
numLevels
Number of levels
|
protected int |
numTextures
Number of textures
|
protected byte[] |
pixels
Raw pixel data
|
protected TextureID.RgbMode |
rgbChannelMode |
protected int |
width
Width of the picture
|
| Constructor and Description |
|---|
TextureDXT3(int width,
int height,
int numTextures,
int numLevels,
byte[] data) |
| Modifier and Type | Method and Description |
|---|---|
TextureDXT3 |
clone() |
protected void |
decodeTile(int[] dst,
byte[] tile,
int w,
int h,
int levelWidth,
int levelHeight) |
void |
flip(boolean flipWidth,
boolean flipHeight) |
TextureID.AlphaMode |
getAlphaMode(int threshold) |
byte |
getChannel(int texture,
int level,
int channel,
int x,
int y,
int z)
Get the color channel / component of the texel at (col, line)
|
protected int |
getColor(byte[] tile,
int col,
int row) |
int |
getColor(int texture,
int level,
int x,
int y,
int z)
Get the color of the texel at (col, line)
|
int |
getDataType() |
Dds.DdsFormat |
getDdsFormat() |
Dds.DdsSwizzling |
getDdsSwizzling() |
int |
getDepth() |
int |
getFormat() |
int |
getHeight() |
int |
getInternalFormat(IGL gl,
int channelBits) |
int |
getLevelDepth(int level) |
int |
getLevelHeight(int level) |
int |
getLevelWidth(int level) |
int |
getNumChannels() |
int |
getNumLevels()
Number of mipmap levels
|
int |
getNumTextures()
All internal texture have the same format, size, number of channels, ...
|
int |
getOffsetInBytes(int texture,
int level) |
byte[] |
getRaw() |
void |
getRaw(int texture,
int level,
byte[] dst) |
void |
getRaw(int texture,
int level,
java.nio.ByteBuffer dst)
Buffer data for the mipmap level.
|
TextureID.RgbMode |
getRgbMode(int threshold) |
int |
getSizeInBytes(int level) |
protected int |
getTileTexelA(byte[] tile,
int offset,
int col,
int row) |
int |
getWidth() |
boolean |
hasAlpha() |
void |
setChannel(int texture,
int level,
int channel,
int x,
int y,
int z,
byte value)
Set the color channel / component of the texel at (col, line)
|
void |
setChannelMode(TextureID.RgbMode rgbChannelMode,
TextureID.AlphaMode alphaChannelMode) |
void |
setColor(int texture,
int level,
int x,
int y,
int z,
int color)
Set the color of the texel at (col, line)
|
protected void |
swapTileA(byte[] tile,
int offset) |
protected void |
swapTileRGB(byte[] tile,
int offset)
DXT1 block:
color0 [bb bb bb bb]
[bb bb bb bb] 16 bits / 2 octets
color1 [bb bb bb bb]
[bb bb bb bb] 16 bits / 2 octets
row0 [bb|bb|bb|bb] 8 bits / 1 octets
row1 [bb|bb|bb|bb] 8 bits / 1 octets
row2 [bb|bb|bb|bb] 8 bits / 1 octets
row3 [bb|bb|bb|bb] 8 bits / 1 octets
|
void |
uncompress(ITexture dst,
int dstSubTexture,
int dstLevel,
int srcSubTexture,
int srcLevel) |
protected final int width
protected final int height
protected final int numChannels
protected final int numLevels
protected final int numTextures
protected final int blockSize
protected final byte[] pixels
protected TextureID.RgbMode rgbChannelMode
protected TextureID.AlphaMode alphaChannelMode
public TextureDXT3(int width,
int height,
int numTextures,
int numLevels,
byte[] data)
public final TextureDXT3 clone()
protected final int getTileTexelA(byte[] tile,
int offset,
int col,
int row)
protected final void swapTileA(byte[] tile,
int offset)
public final int getInternalFormat(IGL gl, int channelBits)
channelBits - number of channel bits.
public final boolean hasAlpha()
public final Dds.DdsFormat getDdsFormat()
Dds.DdsFormatprotected final void swapTileRGB(byte[] tile,
int offset)
protected final int getColor(byte[] tile,
int col,
int row)
public final Dds.DdsSwizzling getDdsSwizzling()
Dds.DdsSwizzlingpublic final int getNumTextures()
ITexturegetNumTextures in interface ITexturepublic final int getNumChannels()
getNumChannels in interface ITexturepublic final int getWidth()
public final int getHeight()
public final int getDepth()
public final int getNumLevels()
getNumLevels in interface ITexturepublic final int getOffsetInBytes(int texture,
int level)
getOffsetInBytes in interface ITexturepublic final int getSizeInBytes(int level)
getSizeInBytes in interface ITextureITexture.getRaw(int, int, ByteBuffer)public final int getLevelWidth(int level)
getLevelWidth in interface ITexturepublic final int getLevelHeight(int level)
getLevelHeight in interface ITexturepublic final int getLevelDepth(int level)
getLevelDepth in interface ITexturepublic final void getRaw(int texture,
int level,
java.nio.ByteBuffer dst)
getRaw in interface ITexturetexture - sub texture index to retrieve datadst - ByteBuffer with at least ITexture.getSizeInBytes(int) remaining bytes. Position is not modifiedpublic final void getRaw(int texture,
int level,
byte[] dst)
getRaw in interface ITexturetexture - sub texture index to retrieve datadst - destination array with at least ITexture.getSizeInBytes(int) remaining bytes. Position is not modifiedpublic void flip(boolean flipWidth,
boolean flipHeight)
public final void uncompress(ITexture dst, int dstSubTexture, int dstLevel, int srcSubTexture, int srcLevel)
uncompress in interface ITextureCompressedprotected void decodeTile(int[] dst,
byte[] tile,
int w,
int h,
int levelWidth,
int levelHeight)
public final int getDataType()
getDataType in interface ITextureITexture.getRaw()public int getColor(int texture,
int level,
int x,
int y,
int z)
ITexturegetColor in interface ITexturetexture - index of the texture in the range [0;ITexture.getNumTextures()[ (usually 0)x - column coordinates of the pixel. Left is 0, right is ITexture.getWidth() - 1.y - line coordinates of the pixel. Bottom is 0, top is ITexture.getHeight() - 1.z - depth coordinates of the pixel. Front is 0, Back is ITexture.getDepth() - 1.public final byte getChannel(int texture,
int level,
int channel,
int x,
int y,
int z)
ITexturegetChannel in interface ITexturetexture - index of the texture in the range [0;ITexture.getNumTextures()[ (usually 0)channel - index of the channel to get, in the range [0; ITexture.getNumChannels()[x - column coordinates of the pixel. Left is 0, right is ITexture.getWidth() - 1.y - line coordinates of the pixel. Bottom is 0, top is ITexture.getHeight() - 1.z - depth coordinates of the pixel. Front is 0, Back is ITexture.getDepth() - 1.public final int getFormat()
getFormat in interface ITextureITexture.getRaw().IGL.glTexImage2D(int, int, int, int, int, int, int, int, java.nio.ByteBuffer) or IGL.glCompressedTexImage2D(int, int, int, int, int, int, int, java.nio.ByteBuffer)public final void setColor(int texture,
int level,
int x,
int y,
int z,
int color)
ITexturesetColor in interface ITexturetexture - index of the texture in the range [0;ITexture.getNumTextures()[ (usually 0)x - column coordinates of the pixel. Left is 0, right is ITexture.getWidth() - 1.y - line coordinates of the pixel. Bottom is 0, top is ITexture.getHeight() - 1.z - depth coordinates of the pixel. Front is 0, Back is ITexture.getDepth() - 1.public final void setChannel(int texture,
int level,
int channel,
int x,
int y,
int z,
byte value)
ITexturesetChannel in interface ITexturetexture - index of the texture in the range [0;ITexture.getNumTextures()[ (usually 0)channel - index of the channel to set, in the range [0; ITexture.getNumChannels()[x - column coordinates of the pixel. Left is 0, right is ITexture.getWidth() - 1.y - line coordinates of the pixel. Bottom is 0, top is ITexture.getHeight() - 1.z - depth coordinates of the pixel. Front is 0, Back is ITexture.getDepth() - 1.public final TextureID.RgbMode getRgbMode(int threshold)
getRgbMode in interface ITexturepublic final TextureID.AlphaMode getAlphaMode(int threshold)
getAlphaMode in interface ITexturepublic final void setChannelMode(TextureID.RgbMode rgbChannelMode, TextureID.AlphaMode alphaChannelMode)
setChannelMode in interface ITexturergbChannelMode - rgb channel mode flagalphaChannelMode - alpha channel mode flagBonzai Engine 1.4.1-20200831 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2019 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com