|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.NodeComponent org.j3d.aviatrix3d.Texture
public abstract class Texture
Describes the basic textured appearance of an object.
This is the base class for all texture objects used in Aviatrix3D. It does not provide any functional capabilities, just a collection of the common constants and state. It provides abilities based on the minimal setup for a 1-dimensional texture. For settings for addtional dimensions (T and R) please visit the appropriate derived class.
All textures default to the following setup during the constructor call:
Internationalisation Resource Names
Field Summary | |
---|---|
static int |
ANISOTROPIC_MODE_NONE
Disable anisotropic filtering |
static int |
ANISOTROPIC_MODE_SINGLE
Enable anisotropic filtering |
protected float |
anisotropicDegree
The Anisotropic Filtering Degree |
protected int |
anisotropicMode
The Anisotropic Filtering Mode |
static int |
BM_CLAMP
Boundary mode to clamp textures |
static int |
BM_CLAMP_TO_BOUNDARY
Boundary mode to clamp the texture border colour |
static int |
BM_CLAMP_TO_EDGE
Boundary mode to clamp the texture edge value without border |
static int |
BM_MIRRORED_REPEAT
Boundary mode to use a mirror-repeat strategy |
static int |
BM_WRAP
Boundary mode to repeat textures |
protected float[] |
borderColor
The border colour, if set for the texture. |
protected int |
boundaryModeS
The boundary mode S value |
static int |
COMPARE_FUNCTION_GEQUAL
The texture comparision function is greater than or equal |
static int |
COMPARE_FUNCTION_LEQUAL
The texture comparision function is less than or equal |
static int |
COMPARE_MODE_NONE
The texture comparison mode is set to GL_NONE |
static int |
COMPARE_MODE_R2TEX
The texture comparison mode is set to GL_COMPARE_R_TO_TEXTURE |
protected int |
compareFunction
The texture comparison function. |
protected int |
compareMode
Texture comparison mode. |
protected int |
depthComponentMode
The submode if the texture type is GL_DEPTH_COMPONENT |
protected int |
format
The pixel format of the main texture image. |
static int |
FORMAT_ALPHA
Interpret the texture format as alpha only |
static int |
FORMAT_DEPTH_COMPONENT
Interpret the texture format as a depth component texture |
static int |
FORMAT_INTENSITY
Interpret the texture format as intensity only |
static int |
FORMAT_INTENSITY_ALPHA
Deprecated. This is badly named and is actually setting GL_LUMINANCE_ALPHA. Use FORMAT_LUMINANCE_ALPHA |
static int |
FORMAT_LUMINANCE
Interpret the texture format as luminance only |
static int |
FORMAT_LUMINANCE_ALPHA
Interpret the texture format as GL_LUMINANCE_ALPHA |
static int |
FORMAT_RGB
Interpret the texture format as RGB |
static int |
FORMAT_RGBA
Interpret the texture format as RGBA |
static int |
GENERATE_MIPMAP
GenerateMipMap constants - Use Mip Maps |
static int |
GENERATE_MIPMAP_DONT_CARE
Set the mipmap generation to the don't care option |
static int |
GENERATE_MIPMAP_FASTEST
Set the mipmap generation to the fastest option |
static int |
GENERATE_MIPMAP_HINT
GenerateMipMap Quality Hint |
static int |
GENERATE_MIPMAP_NICEST
Set the mipmap generation to the highest quality option |
protected int |
generateMipMap
Should we generate mip maps |
protected int |
generateMipMapHint
The quality hint for generateMipMap |
protected GLStateMap |
imageChanged
State map indicating sources have changed |
protected int |
magFilter
The magnification filter |
static int |
MAGFILTER_BASE_LEVEL_LINEAR
Set the maginification filter to linear filtering |
static int |
MAGFILTER_BASE_LEVEL_POINT
Set the magnification filter to filtering using GL_NEAREST |
static int |
MAGFILTER_FASTEST
Set the maginification filter to the fastest option |
static int |
MAGFILTER_LINEAR_DETAIL
Set the maginfication filter to use the detail texture option |
static int |
MAGFILTER_LINEAR_DETAIL_ALPHA
Set the maginfication filter to use the detail texture's alpha values |
static int |
MAGFILTER_LINEAR_DETAIL_RGB
Set the maginfication filter to use the detail texture's RGB values |
static int |
MAGFILTER_NICEST
Set the maginification filter to the highest quality option |
protected int |
minFilter
The minification filter |
static int |
MINFILTER_BASE_LEVEL_LINEAR
Set the mininification filter to linear filtering |
static int |
MINFILTER_BASE_LEVEL_POINT
Set the mininification filter to filtering using GL_NEAREST |
static int |
MINFILTER_FASTEST
Set the minification filter to the fastest option |
static int |
MINFILTER_MULTI_LEVEL_LINEAR
Set the mininification filter to linear filtering |
static int |
MINFILTER_MULTI_LEVEL_POINT
Set the mininification filter to base point-base filtering |
static int |
MINFILTER_NICEST
Set the mininification filter to the highest quality option |
protected int |
mipMapMode
The mipMapMode |
static int |
MODE_BASE_LEVEL
MipMapMode constants - No Mip Map |
static int |
MODE_MIPMAP
MipMapMode constants - Use Mip Maps |
protected int |
numSources
The number of valid items in the image array |
protected float |
priority
The priority of this texture, if set. |
protected TextureSource[] |
sources
The sources defined for this texture. |
protected GLStateMap |
stateChanged
Flag to say that the display lists must be cleared and regenerated because some state changed |
protected java.util.HashMap<javax.media.opengl.GL,java.lang.Integer> |
textureIdMap
The mapping of GL context to OpenGL texture ID |
protected int |
textureType
The GL type of the texture. |
static int |
UPDATE_BUFFER_ALL
All sub image updates should be buffered until the next chance to update. |
static int |
UPDATE_BUFFER_LAST
Each update should discard any previous updates recieved. |
static int |
UPDATE_DISCARD_OVERWRITES
Each update should check to see whether the area of this update overlaps completely that of any other buffered updates. |
protected TextureUpdateStateManager[] |
updateManagers
Managers used to process updates from the component sub-image updates. |
protected int |
updateStrategy
The update strategy to use for sub-image updates. |
protected int |
width
The width of the main texture. |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
lastParent, liveCount, parentList |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Constructor Summary | |
---|---|
protected |
Texture(int type)
Constructs a texture with default values. |
protected |
Texture(int type,
int numImg)
Constructs a texture with default values. |
Method Summary | |
---|---|
void |
cleanup(javax.media.opengl.GL gl)
Cleanup the object now for the given GL context. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
int |
compareTo(Texture tex)
Compares this object with the specified object for order. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
boolean |
equals(Texture tex)
Compares this object with the specified object to check for equivalence. |
float |
getAnisotropicFilterDegree()
Get the current anisotropic filtering degree. |
int |
getAnisotropicFilterMode()
Get the current aniostropic filtering mode. |
void |
getBorderColor(float[] col)
Get the current value of the border color for the texture, if set. |
int |
getBoundaryModeS()
Get the current boundary handling for the S parameter. |
int |
getCompareFunction()
Get the current texture comparison functoin. |
int |
getCompareMode()
Get the current texture comparison mode. |
int |
getDepthFormat()
Get the format for the depth texture . |
int |
getFormat()
Get the format for this texture. |
boolean |
getGenerateMipMap()
Get the current generateMipMap state. |
int |
getGenerateMipMapHint()
Get the current generateMipMapHint value. |
int |
getMagFilter()
Get the magnification filtering mode. |
int |
getMinFilter()
Get the minification filtering mode. |
float |
getPriority()
Get the currently set priority value for the texture. |
int |
getTextureType()
Get the texture type. |
int |
getUpdateStrategy()
Get the current update strategy in use. |
int |
getWidth()
Get the width of the texture in pixels. |
boolean |
hasTransparency()
Ask the texture if it has any transparency values. |
void |
setAnisotropicFilterDegree(float degree)
Set the anisotropic filtering degree. |
void |
setAnisotropicFilterMode(int mode)
Set the aniostropic filtering mode. |
void |
setBorderColor(float[] col)
Set the border color to the new value for the front-face and combined values. |
void |
setBoundaryModeS(int mode)
Set the boundary handling for the S parameter. |
void |
setCompareFunction(int func)
Set the texture comparison function. |
void |
setCompareMode(int mode)
Set the texture comparison mode. |
void |
setDepthFormat(int format)
Set the format for the depth texture to be applied to an object. |
void |
setGenerateMipMap(boolean generate)
Set the generateMipMap state. |
void |
setGenerateMipMapHint(int hint)
Set the generateMipMapHint value. |
protected void |
setLive(boolean state)
Notification that this object is live now. |
void |
setMagFilter(int mode)
Set the magnification filtering mode. |
void |
setMinFilter(int mode)
Set the magnification filtering mode. |
void |
setPriority(float pri)
Set the texture priority value. |
void |
setSources(int mipMapMode,
int format,
TextureSource[] texSources,
int num)
Set a new collection of sources for this texture to use. |
protected void |
setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. |
void |
setUpdateStrategy(int strategy)
Set the update strategy in use for working with sub image updates of the components. |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
---|
addParent, getParents, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.j3d.aviatrix3d.rendering.ObjectRenderable |
---|
postRender, render |
Field Detail |
---|
public static final int MODE_BASE_LEVEL
public static final int MODE_MIPMAP
public static final int GENERATE_MIPMAP
public static final int GENERATE_MIPMAP_HINT
public static final int GENERATE_MIPMAP_DONT_CARE
public static final int GENERATE_MIPMAP_FASTEST
public static final int GENERATE_MIPMAP_NICEST
public static final int BM_WRAP
public static final int BM_CLAMP
public static final int BM_CLAMP_TO_EDGE
public static final int BM_CLAMP_TO_BOUNDARY
public static final int BM_MIRRORED_REPEAT
public static final int MAGFILTER_FASTEST
public static final int MAGFILTER_NICEST
public static final int MAGFILTER_BASE_LEVEL_POINT
public static final int MAGFILTER_BASE_LEVEL_LINEAR
public static final int MAGFILTER_LINEAR_DETAIL
public static final int MAGFILTER_LINEAR_DETAIL_RGB
public static final int MAGFILTER_LINEAR_DETAIL_ALPHA
public static final int MINFILTER_FASTEST
public static final int MINFILTER_NICEST
public static final int MINFILTER_BASE_LEVEL_POINT
public static final int MINFILTER_BASE_LEVEL_LINEAR
public static final int MINFILTER_MULTI_LEVEL_POINT
public static final int MINFILTER_MULTI_LEVEL_LINEAR
public static final int ANISOTROPIC_MODE_NONE
public static final int ANISOTROPIC_MODE_SINGLE
public static final int FORMAT_ALPHA
public static final int FORMAT_INTENSITY
public static final int FORMAT_LUMINANCE
public static final int FORMAT_INTENSITY_ALPHA
public static final int FORMAT_LUMINANCE_ALPHA
public static final int FORMAT_RGB
public static final int FORMAT_RGBA
public static final int FORMAT_DEPTH_COMPONENT
public static final int COMPARE_MODE_NONE
public static final int COMPARE_MODE_R2TEX
public static final int COMPARE_FUNCTION_LEQUAL
public static final int COMPARE_FUNCTION_GEQUAL
public static final int UPDATE_BUFFER_ALL
public static final int UPDATE_BUFFER_LAST
public static final int UPDATE_DISCARD_OVERWRITES
protected TextureSource[] sources
protected int numSources
protected int anisotropicMode
protected float anisotropicDegree
protected int magFilter
protected int minFilter
protected int boundaryModeS
protected int mipMapMode
protected int generateMipMap
protected int generateMipMapHint
protected int width
protected int format
protected float[] borderColor
protected GLStateMap imageChanged
protected GLStateMap stateChanged
protected float priority
protected int depthComponentMode
protected int compareMode
protected int compareFunction
protected final int textureType
protected java.util.HashMap<javax.media.opengl.GL,java.lang.Integer> textureIdMap
protected int updateStrategy
protected TextureUpdateStateManager[] updateManagers
Constructor Detail |
---|
protected Texture(int type)
type
- One of the texture type constantsprotected Texture(int type, int numImg)
type
- One of the texture type constantsnumImg
- The number of sources to preload the internals withMethod Detail |
---|
protected void setLive(boolean state)
setLive
in class SceneGraphObject
state
- true if this should be marked as live nowprotected void setUpdateHandler(NodeUpdateHandler handler)
setUpdateHandler
in class SceneGraphObject
handler
- The instance to use as a handlerpublic boolean hasTransparency()
hasTransparency
in interface TransparentRenderable
public void cleanup(javax.media.opengl.GL gl)
cleanup
in interface DeletableRenderable
gl
- The gl context to draw withpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
o
- The object to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public void setSources(int mipMapMode, int format, TextureSource[] texSources, int num) throws InvalidWriteTimingException
mipMapMode
- Flag stating the type of texture mode to useformat
- Image format to use for grayscale sourcestexSources
- The source data to use, single for base levelnum
- The valid number of sources to use from the array
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getTextureType()
public int getFormat()
public int getWidth()
public void setAnisotropicFilterMode(int mode) throws InvalidWriteTimingException
mode
- The new mode.
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getAnisotropicFilterMode()
public void setAnisotropicFilterDegree(float degree) throws InvalidWriteTimingException
degree
- The filtering degree. 1.0 is the default.
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic float getAnisotropicFilterDegree()
public void setGenerateMipMap(boolean generate) throws InvalidWriteTimingException
generate
- Whether to generate mip maps
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean getGenerateMipMap()
public void setGenerateMipMapHint(int hint) throws InvalidWriteTimingException
hint
- Hint on the quality of automatic mipmap generation
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getGenerateMipMapHint()
public void setMagFilter(int mode) throws InvalidWriteTimingException
mode
- The new mode.
InvalidWriteTimingException
public int getMagFilter()
public void setMinFilter(int mode) throws InvalidWriteTimingException
mode
- The new mode.
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getMinFilter()
public void setBoundaryModeS(int mode) throws InvalidWriteTimingException
mode
- The new mode.
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getBoundaryModeS()
public void setBorderColor(float[] col) throws InvalidWriteTimingException
col
- The new colour to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void getBorderColor(float[] col)
col
- The array to copy the values into.public void setDepthFormat(int format) throws InvalidWriteTimingException
format
- One of luminance, intensity or alpha settings
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getDepthFormat()
public void setCompareMode(int mode) throws InvalidWriteTimingException
mode
- One of COMPARE_MODE_NONE or COMPARE_MODE_R2TEX
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getCompareMode()
public void setCompareFunction(int func) throws InvalidWriteTimingException
func
- One of COMPARE_MODE_NONE or COMPARE_MODE_R2TEX
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getCompareFunction()
public void setUpdateStrategy(int strategy) throws InvalidWriteTimingException
strategy
- one of the UPDATE_ identifiers
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int getUpdateStrategy()
public void setPriority(float pri) throws InvalidWriteTimingException, java.lang.IllegalArgumentException
pri
- A value between 0 and 1 or -1
java.lang.IllegalArgumentException
- The priority is outside the range
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic float getPriority()
public int compareTo(Texture tex)
tex
- The texture instance to be compared
public boolean equals(Texture tex)
tex
- The texture instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |