All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.media.j3d.Texture

java.lang.Object
   |
   +----java.media.j3d.SceneGraphObject
           |
           +----java.media.j3d.NodeComponent
                   |
                   +----java.media.j3d.Texture

public abstract class Texture
extends NodeComponent
The Texture object is a component object of an Appearance object that defines the texture properties used when texture mapping is enabled. Texture object is an abstract class and all texture objects must be created as either a Texture2D object or a Texture3D object.


Variable Index

 o ALPHA
Specifies Texture contains only Alpha values.
 o BASE_LEVEL
Indicates that Texture object only has one level.
 o BASE_LEVEL_LINEAR
Performs bilinear interpolation on the four nearest texels in level 0 texture map.
 o BASE_LEVEL_POINT
Select the nearest texel in level 0 texture map.
 o CLAMP
Clamps texture coordinates to be in the range [0, 1].
 o FASTEST
Uses the fastest available method for processing geometry.
 o INTENSITY
Specifies Texture contains only Intensity values.
 o LUMINANCE
Specifies Texture contains only luminance values.
 o LUMINANCE_ALPHA
Specifies Texture contains Luminance and Alpha values.
 o MULTI_LEVEL_LINEAR
Performs tri-linear interpolation of texels between four texels each from two nearest mipmap levels.
 o MULTI_LEVEL_MIPMAP
Indicates that this Texture object has multiple images- one for each mipmap level(i.e.
 o MULTI_LEVEL_POINT
Selects the nearest texel in the nearest mipmap.
 o NICEST
Uses the nicest available method for processing geometry.
 o RGB
Specifies Texture contains Red, Green and Blue color values.
 o RGBA
Specifies Texture contains Red, Green, Blue color values and Alpha value.
 o WRAP
Repeats the texture by wrapping texture coordinates that are outside the range [0,1].

Constructor Index

 o Texture()
Constructs a texture object using default values.
 o Texture(int, int, int, int)
Constructs an empty Texture object with specified mipmapMode format, width and height.

Method Index

 o finalize()
 o getBoundaryColor(Color4f)
Retrieves the texture boundary color for this texture object.
 o getBoundaryModeS()
Retrieves the boundary mode for the S coordinate.
 o getBoundaryModeT()
Retrieves the boundary mode for the T coordinate.
 o getEnable()
Retrieves the state of the texture enable flag.
 o getImage(int)
Gets a specified mipmap level.
 o getMagFilter()
Retrieves the magnification filter.
 o getMinFilter()
Retrieves the minification filter.
 o getMipMapMode()
Retrieves current mipmap mode.
 o setBoundaryColor(Color4f)
Sets the texture boundary color for this texture object.
 o setBoundaryColor(float, float, float, float)
Sets the texture boundary color for this texture object.
 o setBoundaryModeS(int)
Sets the boundary mode for the S coordinate in this texture object.
 o setBoundaryModeT(int)
Sets the boundary mode for the T coordinate in this texture object.
 o setEnable(boolean)
Enables or disables texture mapping for this appearance component object.
 o setImage(int, PixelArray)
Sets a specified mipmap level.
 o setMagFilter(int)
Sets the magnification filter function.
 o setMinFilter(int)
Sets the minification filter function.
 o setMipMapMode(int)
Sets mipmap mode for texture mapping for this texture object.

Variables

 o FASTEST
 public static final int FASTEST
Uses the fastest available method for processing geometry. This value can be used as a parameter to setMinFilter and setMagFilter.

 o NICEST
 public static final int NICEST
Uses the nicest available method for processing geometry. This value can be used as a parameter to setMinFilter and setMagFilter.

 o BASE_LEVEL_POINT
 public static final int BASE_LEVEL_POINT
Select the nearest texel in level 0 texture map. Maps to NEAREST

 o BASE_LEVEL_LINEAR
 public static final int BASE_LEVEL_LINEAR
Performs bilinear interpolation on the four nearest texels in level 0 texture map. Maps to LINEAR.

 o MULTI_LEVEL_POINT
 public static final int MULTI_LEVEL_POINT
Selects the nearest texel in the nearest mipmap. Maps to NEAREST_MIPMAP_NEAREST.

 o MULTI_LEVEL_LINEAR
 public static final int MULTI_LEVEL_LINEAR
Performs tri-linear interpolation of texels between four texels each from two nearest mipmap levels. Maps to LINEAR_MIPMAP_LINEAR, but an implementation can fall back to LINEAR_MIPMAP_NEAREST or NEAREST_MIPMAP_LINEAR.

 o CLAMP
 public static final int CLAMP
Clamps texture coordinates to be in the range [0, 1]. A constant boundary color is used for U,V values that fall outside this range.

 o WRAP
 public static final int WRAP
Repeats the texture by wrapping texture coordinates that are outside the range [0,1]. Only the fractional portion of the texture coordinates is used; the integer portion is discarded.

 o BASE_LEVEL
 public static final int BASE_LEVEL
Indicates that Texture object only has one level. If multiple levels are needed, they will be implicitely computed.

 o MULTI_LEVEL_MIPMAP
 public static final int MULTI_LEVEL_MIPMAP
Indicates that this Texture object has multiple images- one for each mipmap level(i.e. log2(max(Width,Height)) + 1 seperate images.

 o INTENSITY
 public static final int INTENSITY
Specifies Texture contains only Intensity values.

 o LUMINANCE
 public static final int LUMINANCE
Specifies Texture contains only luminance values.

 o ALPHA
 public static final int ALPHA
Specifies Texture contains only Alpha values.

 o LUMINANCE_ALPHA
 public static final int LUMINANCE_ALPHA
Specifies Texture contains Luminance and Alpha values.

 o RGB
 public static final int RGB
Specifies Texture contains Red, Green and Blue color values.

 o RGBA
 public static final int RGBA
Specifies Texture contains Red, Green, Blue color values and Alpha value.

Constructors

 o Texture
 public Texture()
Constructs a texture object using default values. Texture mapping is enabled by default.

 o Texture
 public Texture(int mipmapMode,
                int format,
                int width,
                int height)
Constructs an empty Texture object with specified mipmapMode format, width and height. Image at level 0 must be set by the application using 'setImage' method. If mipmapMode is set to MULTI_LEVEL_MIPMAP, images for ALL levels must be set.

Parameters:
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.
Throws: IllegalArgumentException
if width or height are NOT power of 2 OR invalid format/mipmapMode is specified.

Methods

 o setBoundaryModeS
 public final void setBoundaryModeS(int boundaryModeS)
Sets the boundary mode for the S coordinate in this texture object.

Parameters:
boundaryModeS - the boundary mode for the S coordinate, one of: CLAMP or WRAP.
Throws: RestrictedAccessException
if the method is called when this object is part of live or compiled scene graph.
 o getBoundaryModeS
 public final int getBoundaryModeS()
Retrieves the boundary mode for the S coordinate.

Returns:
the current boundary mode for the S coordinate.
Throws: RestrictedAccessException
if the method is called when this object is part of live or compiled scene graph.
 o setBoundaryModeT
 public final void setBoundaryModeT(int boundaryModeT)
Sets the boundary mode for the T coordinate in this texture object.

Parameters:
boundaryModeT - the boundary mode for the T coordinate, one of: CLAMP or WRAP.
Throws: RestrictedAccessException
if the method is called when this object is part of live or compiled scene graph.
 o getBoundaryModeT
 public final int getBoundaryModeT()
Retrieves the boundary mode for the T coordinate.

Returns:
the current boundary mode for the T coordinate.
Throws: RestrictedAccessException
if the method is called when this object is part of live or compiled scene graph.
 o setMinFilter
 public final void setMinFilter(int minFilter)
Sets the minification filter function. This function is used when the pixel being rendered maps to an area greater than one texel.

Parameters:
minFilter - the minification filter, one of: FASTEST, NICEST, BASE_LEVEL_POINT, BASE_LEVEL_LINEAR, MULTI_LEVEL_POINT, MULTI_LEVEL_LINEAR.
Throws: RestrictedAccessException
if the method is called when this object is part of live or compiled scene graph.
 o getMinFilter
 public final int getMinFilter()
Retrieves the minification filter.

Returns:
the current minification filter function.
Throws: RestrictedAccessException
if the method is called when this object is part of live or compiled scene graph.
 o setMagFilter
 public final void setMagFilter(int magFilter)
Sets the magnification filter function. This function is used when the pixel being rendered maps to an area less than or equal to one texel.

Parameters:
magFilter - the magnification filter, one of: FASTEST, NICEST, BASE_LEVEL_POINT, or BASE_LEVEL_LINEAR.
Throws: RestrictedAccessException
if the method is called when this object is part of live or compiled scene graph.
 o getMagFilter
 public final int getMagFilter()
Retrieves the magnification filter.

Returns:
the current magnification filter function.
Throws: RestrictedAccessException
if the method is called when this object is part of live or compiled scene graph.
 o setImage
 public final void setImage(int level,
                            PixelArray image)
Sets a specified mipmap level.

Parameters:
level - mipmap level to set: 0 is the base level
image - pixel array object containing the texture image
Throws: RestrictedAccessException
if the method is called when this object is part of live or compiled scene graph.
 o getImage
 public final PixelArray getImage(int level)
Gets a specified mipmap level.

Parameters:
level - mipmap level to get: 0 is the base level
Returns:
the pixel array object containing the texture image
Throws: RestrictedAccessException
if the method is called when this object is part of live or compiled scene graph.
 o setMipMapMode
 public final void setMipMapMode(int mipmapMode)
Sets mipmap mode for texture mapping for this texture object.

Parameters:
mipMapMode - the new mipmap mode for this object. One of: BASE_LEVEL or MULTI_LEVEL_MIPMAP.
Throws: RestrictedAccessException
if the method is called
 o getMipMapMode
 public final int getMipMapMode()
Retrieves current mipmap mode.

Returns:
current mipmap mode of this texture object.
Throws: RestrictedAccessException
if the method is called
 o setEnable
 public final void setEnable(boolean state)
Enables or disables texture mapping for this appearance component object.

Parameters:
state - true or false to enable or disable texture mapping
 o getEnable
 public final boolean getEnable()
Retrieves the state of the texture enable flag.

Returns:
true if texture mapping is enabled, false if texture mapping is disabled
 o setBoundaryColor
 public final void setBoundaryColor(Color4f boundaryColor)
Sets the texture boundary color for this texture object. The texture boundary color is used when boundaryModeS or boundaryModeT is set to CLAMP.

Parameters:
boundaryColor - the new texture boundary color.
 o setBoundaryColor
 public final void setBoundaryColor(float r,
                                    float g,
                                    float b,
                                    float a)
Sets the texture boundary color for this texture object. The texture boundary color is used when boundaryModeS or boundaryModeT is set to CLAMP.

Parameters:
r - the red component of the color.
g - the green component of the color.
b - the blue component of the color.
a - the alpha component of the color.
 o getBoundaryColor
 public final void getBoundaryColor(Color4f boundaryColor)
Retrieves the texture boundary color for this texture object.

Parameters:
boundaryColor - the vector that will receive the current texture boundary color.
 o finalize
 protected void finalize()
Overrides:
finalize in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index