|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.media.j3d.SceneGraphObject
|
+--javax.media.j3d.NodeComponent
|
+--javax.media.j3d.Texture
|
+--javax.media.j3d.Texture2D
Texture2D is a subclass of Texture class. It extends Texture class by adding a constructor and a mutator method for setting a 2D texture image.
Each Texture2D object has the following properties:
Canvas3D.queryProperties()| Field Summary | |
static int |
ALLOW_DETAIL_TEXTURE_READ
Specifies that this Texture object allows reading its detail texture information (e.g., detail texture image, detail texture mode, detail texture function, detail texture function points count, detail texture level) |
static int |
DETAIL_ADD
Adds the detail texture image to the level 0 image of this texture object |
static int |
DETAIL_MODULATE
Modulates the detail texture image with the level 0 image of this texture object |
static int |
LINEAR_DETAIL
Performs linear sampling in both the base level texture image and the detail texture image, and combines the two texture values according to the detail texture mode. |
static int |
LINEAR_DETAIL_ALPHA
Performs linear detail for the alpha component only. |
static int |
LINEAR_DETAIL_RGB
Performs linear detail for the rgb components only. |
| Constructor Summary | |
Texture2D()
Constructs a texture object using default values. |
|
Texture2D(int mipMapMode,
int format,
int width,
int height)
Constructs an empty Texture2D object with specified mipmapMode format, width and height. |
|
Texture2D(int mipMapMode,
int format,
int width,
int height,
int boundaryWidth)
Constructs an empty Texture2D object with specified mipMapMode, format, width, height, and boundaryWidth. |
|
| Method Summary | |
NodeComponent |
cloneNodeComponent()
Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate) |
void |
duplicateNodeComponent(NodeComponent originalNodeComponent)
Deprecated. replaced with duplicateNodeComponent( NodeComponent originalNodeComponent, boolean forceDuplicate) |
ImageComponent2D |
getDetailImage()
Retrieves the detail texture image for this texture object. |
void |
getDetailTextureFunc(float[] lod,
float[] pts)
Copies the array of detail texture LOD function points into the specified arrays. |
void |
getDetailTextureFunc(Point2f[] pts)
Copies the array of detail texture LOD function points including the lod values and the corresponding function values into the specified array. |
int |
getDetailTextureFuncPointsCount()
Gets the number of points in the detail texture LOD function for this texture object. |
int |
getDetailTextureLevel()
Retrieves the detail texture level for this texture object. |
int |
getDetailTextureMode()
Retrieves the detail texture mode for this texture object. |
void |
setDetailImage(ImageComponent2D detailTexture)
Sets the detail texture image for this texture object. |
void |
setDetailTextureFunc(float[] lod,
float[] pts)
sets the detail texture LOD function for this texture object. |
void |
setDetailTextureFunc(Point2f[] pts)
sets the detail texture LOD function for this texture object. |
void |
setDetailTextureLevel(int level)
Sets the detail texture level for this texture object. |
void |
setDetailTextureMode(int mode)
Sets the detail texture mode for this texture object. |
void |
setMagFilter(int magFilter)
Sets the magnification filter function. |
| Methods inherited from class javax.media.j3d.NodeComponent |
cloneNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree |
| Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData, updateNodeReferences |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ALLOW_DETAIL_TEXTURE_READ
public static final int LINEAR_DETAIL
setMagFilter(int),
Constant Field Valuespublic static final int LINEAR_DETAIL_RGB
setMagFilter(int),
Constant Field Valuespublic static final int LINEAR_DETAIL_ALPHA
setMagFilter(int),
Constant Field Valuespublic static final int DETAIL_ADD
setDetailTextureMode(int),
Constant Field Valuespublic static final int DETAIL_MODULATE
setDetailTextureMode(int),
Constant Field Values| Constructor Detail |
public Texture2D()
Note that the default constructor creates a texture object with a width and height of 0 and is, therefore, not useful.
public Texture2D(int mipMapMode,
int format,
int width,
int height)
mipMapMode - type of mipmap for this Texture: One of
BASE_LEVEL, MULTI_LEVEL_MIPMAP.format - data format of Textures saved in this object.
One of INTENSITY, LUMINANCE, ALPHA, LUMINANCE_ALPHA, RGB, RGBA.width - width of image at level 0. Must be power of 2.height - height of image at level 0. Must be power of 2.
java.lang.IllegalArgumentException - if width or height are NOT
power of 2 OR invalid format/mipmapMode is specified.
public Texture2D(int mipMapMode,
int format,
int width,
int height,
int boundaryWidth)
mipMapMode is set to
BASE_LEVEL, then the image at level 0 must be set
by the application (using either the setImage or
setImages method). If mipMapMode is
set to MULTI_LEVEL_MIPMAP, then images for levels
Base Level through Maximum Level must be set.
mipMapMode - type of mipmap for this Texture: one of
BASE_LEVEL, MULTI_LEVEL_MIPMAPformat - data format of Textures saved in this object.
One of INTENSITY, LUMINANCE, ALPHA, LUMINANCE_ALPHA, RGB, RGBAwidth - width of image at level 0. Must be power of 2. This
does not include the width of the boundary.height - height of image at level 0. Must be power of 2. This
does not include the width of the boundary.boundaryWidth - width of the boundary.
java.lang.IllegalArgumentException - if width or height are not a
power of 2, if an invalid format or mipMapMode is specified, or
if the boundaryWidth < 0| Method Detail |
public void setMagFilter(int magFilter)
setMagFilter in class TexturemagFilter - the magnification filter, one of:
FASTEST, NICEST, BASE_LEVEL_POINT, BASE_LEVEL_LINEAR,
LINEAR_DETAIL, LINEAR_DETAIL_RGB, LINEAR_DETAIL_ALPHA,
LINEAR_SHARPEN, LINEAR_SHARPEN_RGB, LINEAR_SHARPEN_ALPHA, or FILTER4.
RestrictedAccessException - if the method is called
when this object is part of live or compiled scene graph.
java.lang.IllegalArgumentException - if minFilter
is a value other than FASTEST, NICEST,
BASE_LEVEL_POINT, BASE_LEVEL_LINEAR,
LINEAR_DETAIL, LINEAR_DETAIL_RGB,
LINEAR_DETAIL_ALPHA,
LINEAR_SHARPEN, LINEAR_SHARPEN_RGB,
LINEAR_SHARPEN_ALPHA, or
FILTER4.Canvas3D.queryProperties()public void setDetailImage(ImageComponent2D detailTexture)
detailTexture - ImageComponent2D object containing the
detail texture image.
RestrictedAccessException - if the method is called
when this object is part of live or compiled scene graph.Canvas3D.queryProperties()public ImageComponent2D getDetailImage()
CapabilityNotSetException - if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setDetailTextureMode(int mode)
mode - detail texture mode. One of: DETAIL_ADD or DETAIL_MODULATE
java.lang.IllegalArgumentException - if
mode is a value other than
DETAIL_ADD, or DETAIL_MODULATE
RestrictedAccessException - if the method is called
when this object is part of live or compiled scene graph.Canvas3D.queryProperties()public int getDetailTextureMode()
CapabilityNotSetException - if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setDetailTextureLevel(int level)
level - the detail texture level.
java.lang.IllegalArgumentException - if level < 0
RestrictedAccessException - if the method is called
when this object is part of live or compiled scene graph.Canvas3D.queryProperties()public int getDetailTextureLevel()
CapabilityNotSetException - if appropriate capability is
not set and this object is part of live or compiled scene graph
public void setDetailTextureFunc(float[] lod,
float[] pts)
lod - array containing the level-of-detail values.pts - array containing the function values for the corresponding
level-of-detail values.
java.lang.IllegalStateException - if the length of lod
does not match the length of pts
RestrictedAccessException - if the method is called
when this object is part of live or compiled scene graph.Canvas3D.queryProperties()public void setDetailTextureFunc(Point2f[] pts)
pts - array of Point2f containing the lod as well as the
corresponding function value.
RestrictedAccessException - if the method is called
when this object is part of live or compiled scene graph.Canvas3D.queryProperties()public int getDetailTextureFuncPointsCount()
CapabilityNotSetException - if appropriate capability is
not set and this object is part of live or compiled scene graph
public void getDetailTextureFunc(float[] lod,
float[] pts)
lod - the array to receive the level-of-detail values.pts - the array to receive the function values for the
corresponding level-of-detail values.
CapabilityNotSetException - if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void getDetailTextureFunc(Point2f[] pts)
pts - the array to receive the detail texture LOD function points
CapabilityNotSetException - if appropriate capability is
not set and this object is part of live or compiled scene graphpublic NodeComponent cloneNodeComponent()
cloneNodeComponent in class NodeComponentpublic void duplicateNodeComponent(NodeComponent originalNodeComponent)
duplicateNodeComponent in class NodeComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||