org.xith3d.scenegraph
Class TextureImage
java.lang.Object
org.xith3d.scenegraph.SceneGraphObject
org.xith3d.scenegraph.NodeComponent
org.xith3d.scenegraph.TextureImage
- All Implemented Interfaces:
- org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.jagatoo.loaders.textures.AbstractTextureImage
- Direct Known Subclasses:
- TextureImage2D, TextureImage3D
public abstract class TextureImage
- extends NodeComponent
- implements org.jagatoo.loaders.textures.AbstractTextureImage
TextureImage defines attributes that apply to one
mipmap-level of a Texture.
|
Constructor Summary |
TextureImage(org.jagatoo.opengl.enums.TextureImageFormat format,
int width,
int height,
int orgWidth,
int orgHeight)
Constructs a new TextureImage object. |
TextureImage(org.jagatoo.opengl.enums.TextureImageFormat format,
int width,
int height,
int orgWidth,
int orgHeight,
org.jagatoo.opengl.enums.TextureImageInternalFormat internalFormat)
|
| Methods inherited from class org.xith3d.scenegraph.SceneGraphObject |
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jagatoo.loaders.textures.AbstractTextureImage |
getDataBuffer, getPixelSize |
TextureImage
public TextureImage(org.jagatoo.opengl.enums.TextureImageFormat format,
int width,
int height,
int orgWidth,
int orgHeight,
org.jagatoo.opengl.enums.TextureImageInternalFormat internalFormat)
TextureImage
public TextureImage(org.jagatoo.opengl.enums.TextureImageFormat format,
int width,
int height,
int orgWidth,
int orgHeight)
- Constructs a new
TextureImage object.
setHasData
protected void setHasData(boolean hasData)
hasData
public final boolean hasData()
getFormat
public final org.jagatoo.opengl.enums.TextureImageFormat getFormat()
- Get the image format. This is the format in which the data is specified.
- Specified by:
getFormat in interface org.jagatoo.loaders.textures.AbstractTextureImage
hasAlpha
public final boolean hasAlpha()
- Returns:
- true if the
TextureImage contains explicit alpha data.
This does not count for compressed formats.
isCompressed
public final boolean isCompressed()
- Returns:
- true if the
TextureImage contains compressed data.
setInternalFormat
public final void setInternalFormat(org.jagatoo.opengl.enums.TextureImageInternalFormat internalFormat)
- Sets the desired internal format. Setting a internal format that is incompatible
is no error, this method ensures that the internal format is always compatible
with the data format.
- Parameters:
internalFormat -
getInternalFormat
public final org.jagatoo.opengl.enums.TextureImageInternalFormat getInternalFormat()
- Get the internal image format. This is a format hint for the graphic driver.
- Specified by:
getInternalFormat in interface org.jagatoo.loaders.textures.AbstractTextureImage
isInternalFormatCompressed
public final boolean isInternalFormatCompressed()
- Returns:
- true if the image should be stroed in compressed form on the graphics card.
setSize
protected void setSize(int width,
int height)
getSize
public final org.openmali.types.twodee.Sized2iRO getSize()
- Returns:
- the image's size.
getWidth
public final int getWidth()
- Specified by:
getWidth in interface org.jagatoo.loaders.textures.AbstractTextureImage
- Returns:
- the image's width.
getHeight
public final int getHeight()
- Specified by:
getHeight in interface org.jagatoo.loaders.textures.AbstractTextureImage
- Returns:
- the image's height.
setOriginalSize
protected void setOriginalSize(int orgWidth,
int orgHeight)
getOriginalSize
public org.openmali.types.twodee.Sized2iRO getOriginalSize()
- Returns:
- the image's original size (before scaling to powers of two).
getOriginalWidth
public int getOriginalWidth()
- Specified by:
getOriginalWidth in interface org.jagatoo.loaders.textures.AbstractTextureImage
- Returns:
- the image's original width (before scaling to powers of two).
getOriginalHeight
public int getOriginalHeight()
- Specified by:
getOriginalHeight in interface org.jagatoo.loaders.textures.AbstractTextureImage
- Returns:
- the image's original height (before scaling to powers of two).
calculateNeededImageSize
protected final int calculateNeededImageSize()
freeOpenGLResources
public void freeOpenGLResources(CanvasPeer canvasPeer)
- This method frees OpenGL resources (names) for all this NodeComponent and
all child-components.
- Specified by:
freeOpenGLResources in class NodeComponent