public final class TextureEtc1
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 |
|---|
TextureEtc1(int width,
int height,
int numTextures,
int numLevels,
byte[] pixels) |
| Modifier and Type | Method and Description |
|---|---|
TextureEtc1 |
clone() |
protected void |
decodeTile(int[] dst,
byte[] tile,
int w,
int h,
int levelWidth,
int levelHeight) |
static void |
encodeBlock(byte[] buffer,
int bufferOffset,
int[] in) |
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) |
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) |
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 TextureEtc1(int width,
int height,
int numTextures,
int numLevels,
byte[] pixels)
public TextureEtc1 clone()
public int getInternalFormat(IGL gl, int channelBits)
channelBits - number of channel bits.
public final Dds.DdsFormat getDdsFormat()
Dds.DdsFormatpublic final Dds.DdsSwizzling getDdsSwizzling()
Dds.DdsSwizzlingprotected int getColor(byte[] tile,
int col,
int row)
public void flip(boolean flipWidth,
boolean flipHeight)
protected void swapTileRGB(byte[] tile,
int offset)
protected void swapTileA(byte[] tile,
int offset)
protected void decodeTile(int[] dst,
byte[] tile,
int w,
int h,
int levelWidth,
int levelHeight)
public static void encodeBlock(byte[] buffer,
int bufferOffset,
int[] in)
public 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 boolean hasAlpha()
public 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 final void uncompress(ITexture dst, int dstSubTexture, int dstLevel, int srcSubTexture, int srcLevel)
uncompress in interface ITextureCompressedpublic 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