Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class Texture

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.NodeComponent
          extended by org.j3d.aviatrix3d.Texture
All Implemented Interfaces:
java.lang.Comparable, DeletableRenderable, ObjectRenderable, Renderable, TransparentObjectRenderable, TransparentRenderable
Direct Known Subclasses:
MRTTexture2D, OffscreenTexture2D, Texture1D, Texture2D, Texture3D, TextureCubicEnvironmentMap

public abstract class Texture
extends NodeComponent
implements DeletableRenderable, TransparentObjectRenderable

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

Version:
$Revision: 1.43 $
Author:
Justin Couch, Alan Hudson

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

MODE_BASE_LEVEL

public static final int MODE_BASE_LEVEL
MipMapMode constants - No Mip Map

See Also:
Constant Field Values

MODE_MIPMAP

public static final int MODE_MIPMAP
MipMapMode constants - Use Mip Maps

See Also:
Constant Field Values

GENERATE_MIPMAP

public static final int GENERATE_MIPMAP
GenerateMipMap constants - Use Mip Maps

See Also:
Constant Field Values

GENERATE_MIPMAP_HINT

public static final int GENERATE_MIPMAP_HINT
GenerateMipMap Quality Hint

See Also:
Constant Field Values

GENERATE_MIPMAP_DONT_CARE

public static final int GENERATE_MIPMAP_DONT_CARE
Set the mipmap generation to the don't care option

See Also:
Constant Field Values

GENERATE_MIPMAP_FASTEST

public static final int GENERATE_MIPMAP_FASTEST
Set the mipmap generation to the fastest option

See Also:
Constant Field Values

GENERATE_MIPMAP_NICEST

public static final int GENERATE_MIPMAP_NICEST
Set the mipmap generation to the highest quality option

See Also:
Constant Field Values

BM_WRAP

public static final int BM_WRAP
Boundary mode to repeat textures

See Also:
Constant Field Values

BM_CLAMP

public static final int BM_CLAMP
Boundary mode to clamp textures

See Also:
Constant Field Values

BM_CLAMP_TO_EDGE

public static final int BM_CLAMP_TO_EDGE
Boundary mode to clamp the texture edge value without border

See Also:
Constant Field Values

BM_CLAMP_TO_BOUNDARY

public static final int BM_CLAMP_TO_BOUNDARY
Boundary mode to clamp the texture border colour

See Also:
Constant Field Values

BM_MIRRORED_REPEAT

public static final int BM_MIRRORED_REPEAT
Boundary mode to use a mirror-repeat strategy

See Also:
Constant Field Values

MAGFILTER_FASTEST

public static final int MAGFILTER_FASTEST
Set the maginification filter to the fastest option

See Also:
Constant Field Values

MAGFILTER_NICEST

public static final int MAGFILTER_NICEST
Set the maginification filter to the highest quality option

See Also:
Constant Field Values

MAGFILTER_BASE_LEVEL_POINT

public static final int MAGFILTER_BASE_LEVEL_POINT
Set the magnification filter to filtering using GL_NEAREST

See Also:
Constant Field Values

MAGFILTER_BASE_LEVEL_LINEAR

public static final int MAGFILTER_BASE_LEVEL_LINEAR
Set the maginification filter to linear filtering

See Also:
Constant Field Values

MAGFILTER_LINEAR_DETAIL

public static final int MAGFILTER_LINEAR_DETAIL
Set the maginfication filter to use the detail texture option

See Also:
Constant Field Values

MAGFILTER_LINEAR_DETAIL_RGB

public static final int MAGFILTER_LINEAR_DETAIL_RGB
Set the maginfication filter to use the detail texture's RGB values

See Also:
Constant Field Values

MAGFILTER_LINEAR_DETAIL_ALPHA

public static final int MAGFILTER_LINEAR_DETAIL_ALPHA
Set the maginfication filter to use the detail texture's alpha values

See Also:
Constant Field Values

MINFILTER_FASTEST

public static final int MINFILTER_FASTEST
Set the minification filter to the fastest option

See Also:
Constant Field Values

MINFILTER_NICEST

public static final int MINFILTER_NICEST
Set the mininification filter to the highest quality option

See Also:
Constant Field Values

MINFILTER_BASE_LEVEL_POINT

public static final int MINFILTER_BASE_LEVEL_POINT
Set the mininification filter to filtering using GL_NEAREST

See Also:
Constant Field Values

MINFILTER_BASE_LEVEL_LINEAR

public static final int MINFILTER_BASE_LEVEL_LINEAR
Set the mininification filter to linear filtering

See Also:
Constant Field Values

MINFILTER_MULTI_LEVEL_POINT

public static final int MINFILTER_MULTI_LEVEL_POINT
Set the mininification filter to base point-base filtering

See Also:
Constant Field Values

MINFILTER_MULTI_LEVEL_LINEAR

public static final int MINFILTER_MULTI_LEVEL_LINEAR
Set the mininification filter to linear filtering

See Also:
Constant Field Values

ANISOTROPIC_MODE_NONE

public static final int ANISOTROPIC_MODE_NONE
Disable anisotropic filtering

See Also:
Constant Field Values

ANISOTROPIC_MODE_SINGLE

public static final int ANISOTROPIC_MODE_SINGLE
Enable anisotropic filtering

See Also:
Constant Field Values

FORMAT_ALPHA

public static final int FORMAT_ALPHA
Interpret the texture format as alpha only

See Also:
Constant Field Values

FORMAT_INTENSITY

public static final int FORMAT_INTENSITY
Interpret the texture format as intensity only

See Also:
Constant Field Values

FORMAT_LUMINANCE

public static final int FORMAT_LUMINANCE
Interpret the texture format as luminance only

See Also:
Constant Field Values

FORMAT_INTENSITY_ALPHA

public static final int FORMAT_INTENSITY_ALPHA
Deprecated. This is badly named and is actually setting GL_LUMINANCE_ALPHA. Use FORMAT_LUMINANCE_ALPHA
Interpret the texture format as intensity-alpha.

See Also:
Constant Field Values

FORMAT_LUMINANCE_ALPHA

public static final int FORMAT_LUMINANCE_ALPHA
Interpret the texture format as GL_LUMINANCE_ALPHA

See Also:
Constant Field Values

FORMAT_RGB

public static final int FORMAT_RGB
Interpret the texture format as RGB

See Also:
Constant Field Values

FORMAT_RGBA

public static final int FORMAT_RGBA
Interpret the texture format as RGBA

See Also:
Constant Field Values

FORMAT_DEPTH_COMPONENT

public static final int FORMAT_DEPTH_COMPONENT
Interpret the texture format as a depth component texture

See Also:
Constant Field Values

COMPARE_MODE_NONE

public static final int COMPARE_MODE_NONE
The texture comparison mode is set to GL_NONE

See Also:
Constant Field Values

COMPARE_MODE_R2TEX

public static final int COMPARE_MODE_R2TEX
The texture comparison mode is set to GL_COMPARE_R_TO_TEXTURE

See Also:
Constant Field Values

COMPARE_FUNCTION_LEQUAL

public static final int COMPARE_FUNCTION_LEQUAL
The texture comparision function is less than or equal

See Also:
Constant Field Values

COMPARE_FUNCTION_GEQUAL

public static final int COMPARE_FUNCTION_GEQUAL
The texture comparision function is greater than or equal

See Also:
Constant Field Values

UPDATE_BUFFER_ALL

public static final int UPDATE_BUFFER_ALL
All sub image updates should be buffered until the next chance to update. Best for when you are only updating small sections of the screen.

See Also:
Constant Field Values

UPDATE_BUFFER_LAST

public static final int UPDATE_BUFFER_LAST
Each update should discard any previous updates recieved. Best used when you know you'll only be updating one area, overwritting any earlier updates - For example video texturing.

See Also:
Constant Field Values

UPDATE_DISCARD_OVERWRITES

public static final int UPDATE_DISCARD_OVERWRITES
Each update should check to see whether the area of this update overlaps completely that of any other buffered updates. Useful if you're doing scattered region updates where some parts may overlap but others don't.

See Also:
Constant Field Values

sources

protected TextureSource[] sources
The sources defined for this texture.


numSources

protected int numSources
The number of valid items in the image array


anisotropicMode

protected int anisotropicMode
The Anisotropic Filtering Mode


anisotropicDegree

protected float anisotropicDegree
The Anisotropic Filtering Degree


magFilter

protected int magFilter
The magnification filter


minFilter

protected int minFilter
The minification filter


boundaryModeS

protected int boundaryModeS
The boundary mode S value


mipMapMode

protected int mipMapMode
The mipMapMode


generateMipMap

protected int generateMipMap
Should we generate mip maps


generateMipMapHint

protected int generateMipMapHint
The quality hint for generateMipMap


width

protected int width
The width of the main texture.


format

protected int format
The pixel format of the main texture image.


borderColor

protected float[] borderColor
The border colour, if set for the texture. If not set, is null.


imageChanged

protected GLStateMap imageChanged
State map indicating sources have changed


stateChanged

protected GLStateMap stateChanged
Flag to say that the display lists must be cleared and regenerated because some state changed


priority

protected float priority
The priority of this texture, if set. A value of -1 if not set.


depthComponentMode

protected int depthComponentMode
The submode if the texture type is GL_DEPTH_COMPONENT


compareMode

protected int compareMode
Texture comparison mode. Only for depth-component textures.


compareFunction

protected int compareFunction
The texture comparison function. Only for depth-component textures.


textureType

protected final int textureType
The GL type of the texture.


textureIdMap

protected java.util.HashMap<javax.media.opengl.GL,java.lang.Integer> textureIdMap
The mapping of GL context to OpenGL texture ID


updateStrategy

protected int updateStrategy
The update strategy to use for sub-image updates. Defaults to keep latest.


updateManagers

protected TextureUpdateStateManager[] updateManagers
Managers used to process updates from the component sub-image updates.

Constructor Detail

Texture

protected Texture(int type)
Constructs a texture with default values. The mipmap mode is set to MODE_BASE_LEVEL. The update list is started at size 1, since the update mode defaults to only keeping the last value.

Parameters:
type - One of the texture type constants

Texture

protected Texture(int type,
                  int numImg)
Constructs a texture with default values. The mipmap mode is set to MODE_BASE_LEVEL. The update list is started at size 1, since the update mode defaults to only keeping the last value.

Parameters:
type - One of the texture type constants
numImg - The number of sources to preload the internals with
Method Detail

setLive

protected void setLive(boolean state)
Notification that this object is live now.

Overrides:
setLive in class SceneGraphObject
Parameters:
state - true if this should be marked as live now

setUpdateHandler

protected void setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. It will notify all its children of the value. A null value will clear the current handler.

Overrides:
setUpdateHandler in class SceneGraphObject
Parameters:
handler - The instance to use as a handler

hasTransparency

public boolean hasTransparency()
Ask the texture if it has any transparency values. The implementation should determine this from it's internal set of state, such as looking at the texture formats etc to see if they include an alpha channel

Specified by:
hasTransparency in interface TransparentRenderable
Returns:
true if any form of non-opaque rendering is defined

cleanup

public void cleanup(javax.media.opengl.GL gl)
Cleanup the object now for the given GL context.

Specified by:
cleanup in interface DeletableRenderable
Parameters:
gl - The gl context to draw with

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Derived instances should override this to add texture-specific extensions.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The object to be compared
Returns:
-1, 0 or 1 depending on order
Throws:
java.lang.ClassCastException - The specified object's type prevents it from being compared to this Object

equals

public boolean equals(java.lang.Object o)
Compare this object for equality to the given object.

Specified by:
equals in interface Renderable
Overrides:
equals in class java.lang.Object
Parameters:
o - The object to be compared
Returns:
True if these represent the same values

setSources

public void setSources(int mipMapMode,
                       int format,
                       TextureSource[] texSources,
                       int num)
                throws InvalidWriteTimingException
Set a new collection of sources for this texture to use.

Parameters:
mipMapMode - Flag stating the type of texture mode to use
format - Image format to use for grayscale sources
texSources - The source data to use, single for base level
num - The valid number of sources to use from the array
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getTextureType

public int getTextureType()
Get the texture type. This returns one of the GL constant types that represent the texture type - 1D, 2D, etc.

Returns:
The type constant of this texture

getFormat

public int getFormat()
Get the format for this texture.

Returns:
The format.

getWidth

public int getWidth()
Get the width of the texture in pixels. If no image is set, this returns -1.

Returns:
a number >= -1

setAnisotropicFilterMode

public void setAnisotropicFilterMode(int mode)
                              throws InvalidWriteTimingException
Set the aniostropic filtering mode.

Parameters:
mode - The new mode.
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getAnisotropicFilterMode

public int getAnisotropicFilterMode()
Get the current aniostropic filtering mode.

Returns:
The current mode.

setAnisotropicFilterDegree

public void setAnisotropicFilterDegree(float degree)
                                throws InvalidWriteTimingException
Set the anisotropic filtering degree. Values greater then the hardware supports will be clamped.

Parameters:
degree - The filtering degree. 1.0 is the default.
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getAnisotropicFilterDegree

public float getAnisotropicFilterDegree()
Get the current anisotropic filtering degree. The value returned will be the clamped maximum for the hardware support.

Returns:
The filtering degree. 1.0 is the default.

setGenerateMipMap

public void setGenerateMipMap(boolean generate)
                       throws InvalidWriteTimingException
Set the generateMipMap state. This will only effect new texture changes.

Parameters:
generate - Whether to generate mip maps
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getGenerateMipMap

public boolean getGenerateMipMap()
Get the current generateMipMap state.

Returns:
The generateMipMap state. The default is false.

setGenerateMipMapHint

public void setGenerateMipMapHint(int hint)
                           throws InvalidWriteTimingException
Set the generateMipMapHint value. This will only effect new texture changes.

Parameters:
hint - Hint on the quality of automatic mipmap generation
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getGenerateMipMapHint

public int getGenerateMipMapHint()
Get the current generateMipMapHint value.

Returns:
The generateMipMapHint value.

setMagFilter

public void setMagFilter(int mode)
                  throws InvalidWriteTimingException
Set the magnification filtering mode.

Parameters:
mode - The new mode.
Throws:
InvalidWriteTimingException

getMagFilter

public int getMagFilter()
Get the magnification filtering mode.

Returns:
The current mode.

setMinFilter

public void setMinFilter(int mode)
                  throws InvalidWriteTimingException
Set the magnification filtering mode.

Parameters:
mode - The new mode.
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getMinFilter

public int getMinFilter()
Get the minification filtering mode.

Returns:
The current mode.

setBoundaryModeS

public void setBoundaryModeS(int mode)
                      throws InvalidWriteTimingException
Set the boundary handling for the S parameter.

Parameters:
mode - The new mode.
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getBoundaryModeS

public int getBoundaryModeS()
Get the current boundary handling for the S parameter.

Returns:
The current mode.

setBorderColor

public void setBorderColor(float[] col)
                    throws InvalidWriteTimingException
Set the border color to the new value for the front-face and combined values.

Parameters:
col - The new colour to use
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getBorderColor

public void getBorderColor(float[] col)
Get the current value of the border color for the texture, if set. The array should be at least length 3 or 4. If not set, the array is set to 0, 0, 0, 0.

Parameters:
col - The array to copy the values into.

setDepthFormat

public void setDepthFormat(int format)
                    throws InvalidWriteTimingException
Set the format for the depth texture to be applied to an object. This is only used when the primary format is a depth component texture.

Parameters:
format - One of luminance, intensity or alpha settings
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getDepthFormat

public int getDepthFormat()
Get the format for the depth texture .

Returns:
One of luminance, intensity or alpha settings

setCompareMode

public void setCompareMode(int mode)
                    throws InvalidWriteTimingException
Set the texture comparison mode. This is only used when the texture is a depth component texture.

Parameters:
mode - One of COMPARE_MODE_NONE or COMPARE_MODE_R2TEX
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getCompareMode

public int getCompareMode()
Get the current texture comparison mode.

Returns:
One of COMPARE_MODE_NONE or COMPARE_MODE_R2TEX

setCompareFunction

public void setCompareFunction(int func)
                        throws InvalidWriteTimingException
Set the texture comparison function. This is only used when the texture is a depth component texture.

Parameters:
func - One of COMPARE_MODE_NONE or COMPARE_MODE_R2TEX
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getCompareFunction

public int getCompareFunction()
Get the current texture comparison functoin.

Returns:
One of COMPARE_MODE_NONE or COMPARE_MODE_R2TEX

setUpdateStrategy

public void setUpdateStrategy(int strategy)
                       throws InvalidWriteTimingException
Set the update strategy in use for working with sub image updates of the components.

Parameters:
strategy - one of the UPDATE_ identifiers
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getUpdateStrategy

public int getUpdateStrategy()
Get the current update strategy in use.

Returns:
The current strategy type constant of UPDATE_.

setPriority

public void setPriority(float pri)
                 throws InvalidWriteTimingException,
                        java.lang.IllegalArgumentException
Set the texture priority value. Priorities range from 0.0 to 1.0. The default value if no priority is to be assigned is -1.

Parameters:
pri - A value between 0 and 1 or -1
Throws:
java.lang.IllegalArgumentException - The priority is outside the range
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

getPriority

public float getPriority()
Get the currently set priority value for the texture. This will be a value between 0 and 1 or -1 if no priority is to be explicitly assigned.

Returns:
The current priority setting

compareTo

public int compareTo(Texture tex)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Derived instances should override this to add texture-specific extensions.

Parameters:
tex - The texture instance to be compared
Returns:
-1, 0 or 1 depending on order

equals

public boolean equals(Texture tex)
Compares this object with the specified object to check for equivalence.

Parameters:
tex - The texture instance to be compared
Returns:
true if the objects represent identical values

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org