|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.renderer.Texture
public abstract class Texture
An OpenGL texture object.
| Field Summary | |
|---|---|
protected Color4f |
_borderColor
The border color. |
protected int[] |
_bytes
The number of bytes occupied by each mipmap level. |
protected int |
_compareFunc
The texture compare function. |
protected int |
_compareMode
The texture compare mode. |
protected int |
_depthMode
The depth texture mode. |
protected int |
_format
The format of the texture. |
protected boolean |
_generateMipmaps
Whether or not mipmaps should be automatically generated. |
protected int |
_id
The OpenGL identifier for this texture. |
protected int |
_magFilter
The current magnification filter. |
protected float |
_maxAnisotropy
The maximum degree of anisotropy. |
protected int |
_minFilter
The current minification filter. |
protected Renderer |
_renderer
The renderer responsible for this texture. |
protected int |
_target
The texture target. |
protected static FloatBuffer |
_vbuf
A buffer for floating point values. |
protected int |
_wrapR
The r texture wrap mode. |
protected int |
_wrapS
The s texture wrap mode. |
protected int |
_wrapT
The t texture wrap mode. |
protected static int[] |
COMPRESSED_FORMATS
Compressed internal formats for one, two, three, or four color components. |
protected static int[] |
FORMATS
Formats corresponding to one, two, three, or four color components. |
| Constructor Summary | |
|---|---|
protected |
Texture()
Creates an invalid texture (used by the renderer to force reapplication). |
|
Texture(Renderer renderer,
int target)
Creates a new texture for the specified renderer. |
| Method Summary | |
|---|---|
void |
delete()
Deletes this texture, rendering it unusable. |
protected void |
finalize()
|
void |
generateMipmap()
Generates a set of mipmaps for this texture. |
protected static ByteBuffer |
getData(BufferedImage image,
boolean premultiply,
int width,
int height,
boolean rescale)
Converts (and resizes) an image into a buffer of data to be passed to OpenGL. |
int |
getDepth()
Returns the depth of the texture. |
int |
getFormat()
Returns the format of this texture. |
protected static int |
getFormat(BufferedImage image)
Returns the format of the data to be returned by getData(java.awt.image.BufferedImage, boolean, int, int, boolean) for the specified image. |
abstract int |
getHeight()
Returns the height of the texture. |
int |
getId()
Returns this texture's OpenGL identifier. |
protected static int |
getInternalFormat(BufferedImage image,
boolean compress)
Returns the internal format to use for the given image with optional compression. |
int |
getTarget()
Returns the texture's target. |
protected int |
getTotalBytes()
Returns the total number of bytes in the texture. |
abstract int |
getWidth()
Returns the width of the texture. |
protected static BufferedImage |
halveImage(BufferedImage image)
Scales the provided image in half by each dimension for use as a mipmap. |
boolean |
hasAlpha()
Checks whether this texture has an alpha channel. |
boolean |
isDepth()
Determines whether this is a depth texture. |
void |
setBorderColor(Color4f borderColor)
Sets the border color. |
protected void |
setBytes(int level,
int bytes)
Sets the number of bytes occupied by the specified mipmap level. |
void |
setCompare(int mode,
int func)
Convenience method to set both compare parameters at once. |
void |
setCompareFunc(int compareFunc)
Sets the texture compare function. |
void |
setCompareMode(int compareMode)
Sets the texture compare mode. |
void |
setDepthMode(int depthMode)
Sets the depth texture mode. |
void |
setFilters(int min,
int mag)
Convenience method to set both the filters at once. |
void |
setGenerateMipmaps(boolean generate)
Sets whether or not to generate mipmaps automatically. |
void |
setMagFilter(int magFilter)
Sets the texture magnification filter. |
void |
setMaxAnisotropy(float maxAnisotropy)
Sets the texture maximum anisotropy. |
void |
setMinFilter(int minFilter)
Sets the texture minification filter. |
protected void |
setMipmapBytes(int bytes,
int... dimensions)
Sets the number of bytes occupied by all mipmap levels. |
void |
setWrap(int s,
int t)
Convenience method to set the s and t wrap modes at once. |
void |
setWrap(int s,
int t,
int r)
Convenience method to set all the wrap modes at once. |
void |
setWrapR(int wrap)
Sets the r texture wrap mode. |
void |
setWrapS(int wrap)
Sets the s texture wrap mode. |
void |
setWrapT(int wrap)
Sets the t texture wrap mode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Renderer _renderer
protected int _id
protected int _target
protected int _format
protected int _minFilter
protected int _magFilter
protected float _maxAnisotropy
protected int _wrapS
protected int _wrapT
protected int _wrapR
protected Color4f _borderColor
protected boolean _generateMipmaps
protected int _compareMode
protected int _compareFunc
protected int _depthMode
protected int[] _bytes
protected static FloatBuffer _vbuf
protected static final int[] FORMATS
protected static final int[] COMPRESSED_FORMATS
| Constructor Detail |
|---|
public Texture(Renderer renderer,
int target)
protected Texture()
| Method Detail |
|---|
public final int getId()
public final int getTarget()
public int getFormat()
public boolean hasAlpha()
public boolean isDepth()
public abstract int getWidth()
public abstract int getHeight()
public int getDepth()
public void setFilters(int min,
int mag)
public void setMinFilter(int minFilter)
public void setMagFilter(int magFilter)
public void setMaxAnisotropy(float maxAnisotropy)
public void setWrap(int s,
int t)
public void setWrap(int s,
int t,
int r)
public void setWrapS(int wrap)
public void setWrapT(int wrap)
public void setWrapR(int wrap)
public void setBorderColor(Color4f borderColor)
public void setGenerateMipmaps(boolean generate)
public void setCompare(int mode,
int func)
public void setCompareMode(int compareMode)
public void setCompareFunc(int compareFunc)
public void setDepthMode(int depthMode)
public void generateMipmap()
public void delete()
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
protected void setMipmapBytes(int bytes,
int... dimensions)
protected void setBytes(int level,
int bytes)
protected int getTotalBytes()
protected static int getFormat(BufferedImage image)
getData(java.awt.image.BufferedImage, boolean, int, int, boolean) for the specified image.
protected static int getInternalFormat(BufferedImage image,
boolean compress)
protected static BufferedImage halveImage(BufferedImage image)
protected static ByteBuffer getData(BufferedImage image,
boolean premultiply,
int width,
int height,
boolean rescale)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||