public class TextureUtils
extends java.lang.Object
| Constructor and Description |
|---|
TextureUtils() |
| Modifier and Type | Method and Description |
|---|---|
static ITexture |
addAlphaChannel(ITexture src) |
static void |
alphaChannelToAlphaTest(ITexture texture) |
static TextureByte |
clip(TextureByte texture,
Area area)
Note: the clipping is performed on the first level, the other levels being discarded
|
static ITexture |
copy(ITexture texture)
Copy the
src texture into the best representing uncompressed format. |
static ITexture |
copy(ITexture dst,
int dstSubTexture,
int dstLevel,
ITexture src,
int srcSubTexture,
int srcLevel) |
static ITexture |
copy(ITexture dst,
ITexture src)
Convert the src texture into the dst texture.
|
static ITexture |
copyRegion(ITexture dst,
Area dstArea,
int dstSubTexture,
int dstLevel,
ITexture src,
Area srcArea,
int srcSubTexture,
int srcLevel) |
static ITexture |
copyRegion(ITexture dst,
Area dstArea,
int dstLevel,
ITexture src,
Area srcArea,
int level) |
static void |
copyRToA(ITexture dst,
ITexture src) |
static TextureByte |
createsAlphaLayer(ITexture src,
int transparentColor)
Transparency effect ("Alpha layer")
Make a color full transparent. |
static TextureByte |
createsMaskEffect(ITexture mask,
ITexture texture)
Mask effect
This effect use two pictures. |
static ITexture |
cubemap(ITexture[] src) |
static void |
fill(ITexture texture,
int channel,
byte color)
Fill a channel with the specified color byte
|
static ITexture |
generateMipmap(ITexture src)
Generate mipmap levels.
|
static Dds.DdsFormat |
getFormat(ITexture texture) |
static int |
getMaximumMipmapLevels(ITexture texture) |
static Dds.DdsSwizzling |
getSwizzling(ITexture texture) |
static boolean |
isValidSwizzling(Dds.DdsFormat ddsFormat,
Dds.DdsSwizzling ddsSwizzling) |
static ITexture |
reduce(ITexture src,
int numChannels,
boolean alphaRemoved)
Reduce number of channels into a new (non compressed) texture
|
static ITexture |
resize(ITexture src,
int dstWidth,
int dstHeight,
int dstDepth)
Resize a texture
|
static ITexture |
resize(ITexture src,
int subTexture,
int level,
int dstWidth,
int dstHeight,
int dstDepth)
Resize a texture
|
static ITexture |
resize(ITexture dst,
int dstSubTexture,
int dstLevel,
ITexture src,
int srcSubTexture,
int srcLevel) |
static ITexture |
resizeNoCopy(ITexture texture,
int width,
int height,
int depth)
identical to
resize(ITexture, int, int, int) except that if no resizing is needed, it return the input texture |
static ITexture |
uncompress(ITextureCompressed compressedTexture,
int srcSubTexture,
int srcLevel)
Uncompress a texture
|
public static final ITexture uncompress(ITextureCompressed compressedTexture, int srcSubTexture, int srcLevel)
compressedTexture - srcSubTexture - sub texture to uncompresssrcLevel - mipmap level if to uncompress, in range of [0;ITexture.getNumLevels()[public static final Dds.DdsFormat getFormat(ITexture texture)
texture - Dds.DdsFormat of the input texturepublic static final Dds.DdsSwizzling getSwizzling(ITexture texture) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static final boolean isValidSwizzling(Dds.DdsFormat ddsFormat, Dds.DdsSwizzling ddsSwizzling) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic static final ITexture copy(ITexture texture)
src texture into the best representing uncompressed format.texture - source texture to copypublic static final ITexture copy(ITexture dst, ITexture src)
src - source texture to convert to dstdst - destination texture to contains the source texture convertedjava.lang.IllegalArgumentException - if source and destination size did not matchpublic static final ITexture copy(ITexture dst, int dstSubTexture, int dstLevel, ITexture src, int srcSubTexture, int srcLevel)
public static final ITexture copyRegion(ITexture dst, Area dstArea, int dstLevel, ITexture src, Area srcArea, int level)
public static final ITexture copyRegion(ITexture dst, Area dstArea, int dstSubTexture, int dstLevel, ITexture src, Area srcArea, int srcSubTexture, int srcLevel)
public static final TextureByte clip(TextureByte texture, Area area)
texture - source texturearea - clipping areapublic static final ITexture generateMipmap(ITexture src)
src - source ITexture to generate mipmap levelsITexture with all mipmap levels, or src if ITextureCompressed or if mipmap was already computedpublic static final int getMaximumMipmapLevels(ITexture texture)
public static final void copyRToA(ITexture dst, ITexture src)
src - source texturedst - destination texture (can be source)java.lang.IllegalArgumentException - if destination texture don't have alpha channel, or source and destination size did not matchpublic static final void fill(ITexture texture, int channel, byte color)
public static final ITexture resizeNoCopy(ITexture texture, int width, int height, int depth)
resize(ITexture, int, int, int) except that if no resizing is needed, it return the input texturepublic static final ITexture resize(ITexture src, int dstWidth, int dstHeight, int dstDepth)
src - texture to resizedstWidth - resized widthdstHeight - resized heightpublic static final ITexture resize(ITexture src, int subTexture, int level, int dstWidth, int dstHeight, int dstDepth)
src - texture to resizedstWidth - resized widthdstHeight - resized heightpublic static final ITexture resize(ITexture dst, int dstSubTexture, int dstLevel, ITexture src, int srcSubTexture, int srcLevel)
public static final ITexture reduce(ITexture src, int numChannels, boolean alphaRemoved)
public static final ITexture cubemap(ITexture[] src)
public static final ITexture addAlphaChannel(ITexture src)
public static final void alphaChannelToAlphaTest(ITexture texture)
public static final TextureByte createsMaskEffect(ITexture mask, ITexture texture)
mask - picture object that represents the masktexture - picture object that represents the textureTextureByte containing the mask effect resultpublic static final TextureByte createsAlphaLayer(ITexture src, int transparentColor)
src - picture object to add transparencytransparentColor - rgb color in format0x00BBGGRR.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