| Constructor and Description |
|---|
TextureByte(int numChannels,
int width,
int height,
int depth) |
TextureByte(int numChannels,
int width,
int height,
int depth,
boolean hasAlpha,
int numTextures,
int numLevels) |
TextureByte(int numChannels,
int width,
int height,
int depth,
boolean hasAlpha,
int numTextures,
int numLevels,
byte[] raw) |
TextureByte(int numChannels,
int width,
int height,
int depth,
byte[] raw) |
| Modifier and Type | Method and Description |
|---|---|
TextureByte |
clone() |
static void |
divideByTwoUnsafe(TextureByte dst,
int dstSubTexture,
int dstLevel,
TextureByte src,
int srcSubTexture,
int srcLevel)
Resize a texture by 2.
|
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 RGB value of the pixel (col, row) color.
|
int |
getColor(int texture,
int level,
int x,
int y,
int z)
Get the color of the pixel at (col, row).
|
int |
getDataType() |
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) |
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 rgba color of the pixel (col, row).
|
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)
|
static int |
size(int numChannels,
int width,
int height,
int depth,
int numTextures,
int numLevels) |
public TextureByte(int numChannels,
int width,
int height,
int depth)
public TextureByte(int numChannels,
int width,
int height,
int depth,
boolean hasAlpha,
int numTextures,
int numLevels)
public TextureByte(int numChannels,
int width,
int height,
int depth,
byte[] raw)
public TextureByte(int numChannels,
int width,
int height,
int depth,
boolean hasAlpha,
int numTextures,
int numLevels,
byte[] raw)
numChannels - number of channels per colorwidth - width of the textureheight - height of the texturedepth - depth of the texture (1 for 2D texture, > 2 for 3D textures)hasAlpha - ignored if number of channels is not 1numTextures - number of internal texturesraw - array representation of the picturepublic static final int size(int numChannels,
int width,
int height,
int depth,
int numTextures,
int numLevels)
public final TextureByte clone()
public final void setChannel(int texture,
int level,
int channel,
int x,
int y,
int z,
byte value)
setChannel in interface ITexturevalue - red channel of the pixel's colorx - col coordinates of the pixel (0 is the first left col)y - row coordinates of the pixel (o is the first bottom row)texture - 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()[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)
getChannel in interface ITexturex - col coordinates of the pixel (0 is the first left col)y - row coordinates of the pixel (o is the first bottom row)texture - 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()[z - depth coordinates of the pixel. Front is 0, Back is ITexture.getDepth() - 1.public final int getColor(int texture,
int level,
int x,
int y,
int z)
getColor in interface ITexturex - col coordinates of the pixel (0 is the first left col)y - row coordinates of the pixel (o is the first bottom row)texture - index of the texture in the range [0;ITexture.getNumTextures()[ (usually 0)z - depth coordinates of the pixel. Front is 0, Back is ITexture.getDepth() - 1.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 flip(boolean flipWidth,
boolean flipHeight)
public final int getDataType()
getDataType in interface ITextureITexture.getRaw()public 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 int getInternalFormat(IGL gl, int channelBits)
getInternalFormat in interface ITexturechannelBits - number of channel bits.
public final int getSizeInBytes(int level)
getSizeInBytes in interface ITextureITexture.getRaw(int, int, ByteBuffer)public final int getOffsetInBytes(int texture_,
int level_)
getOffsetInBytes 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 int getWidth()
public final int getHeight()
public final int getDepth()
public final int getNumChannels()
getNumChannels in interface ITexturepublic final int getNumLevels()
ITexturegetNumLevels in interface ITexturepublic final int getNumTextures()
ITexturegetNumTextures in interface ITexturepublic final boolean hasAlpha()
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 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 flagpublic static final void divideByTwoUnsafe(TextureByte dst, int dstSubTexture, int dstLevel, TextureByte src, int srcSubTexture, int srcLevel)
TextureUtils.resize(ITexture, int, int, int)Bonzai Engine 1.3.4 11/12/2015 - A Java OpenGL engine and tools for Windows/Mac/Linux/Android
Copyright © 2007-2015 Jérôme Jouvie bonzaiengine.com contact@bonzaiengine.com