BenQ Mobile

javax.microedition.m3g
Class Texture2D

java.lang.Object
  extended byjavax.microedition.m3g.Object3D
      extended byjavax.microedition.m3g.Transformable
          extended byjavax.microedition.m3g.Texture2D

public class Texture2D
extends Transformable

An Appearance component encapsulating a two-dimensional texture image and a set of attributes specifying how the image is to be applied on submeshes. The attributes include wrapping, filtering, blending, and texture coordinate transformation.


Field Summary
static int FILTER_BASE_LEVEL
          A level filtering parameter to setFiltering that selects the base level image, even if mipmap levels exist.
static int FILTER_LINEAR
          A parameter to setFiltering that selects linear filtering.
static int FILTER_NEAREST
          A parameter to setFiltering that selects nearest neighbor filtering.
static int FUNC_ADD
          A parameter to setBlending, specifying that the texel color is to be added to the fragment color.
static int FUNC_BLEND
          A parameter to setBlending, specifying that the texture blend color is to be blended into the fragment color in proportion to the texel RGB values.
static int FUNC_DECAL
          A parameter to setBlending, specifying that the texel color is to be blended into the fragment color in proportion to the texel alpha.
static int FUNC_MODULATE
          A parameter to setBlending, specifying that the texel color and/or alpha are to be multiplied with the fragment color and alpha.
static int FUNC_REPLACE
          A parameter to setBlending, specifying that the texel color and/or alpha are to replace the fragment color and alpha.
static int WRAP_CLAMP
          A parameter to setWrapping, specifying that the texture image is to be repeated only once.
static int WRAP_REPEAT
          A parameter to setWrapping, specifying that the texture image is to be repeated indefinitely.
 
Constructor Summary
Texture2D(Image2D image)
          Constructs a new texture object with the given image, setting the texture attributes to their default values.
 
Method Summary
 int getBlendColor()
          Returns the current texture blend color for this Texture2D.
 int getBlending()
          Returns the current texture blend mode for this Texture2D.
 Image2D getImage()
          Retrieves the current base level (full size) texture image.
 int getWrappingS()
          Returns the current texture wrapping mode for the S texture coordinate.
 int getWrappingT()
          Returns the current texture wrapping mode for the T texture coordinate.
 void setBlendColor(int RGB)
          Sets the texture blend color for this Texture2D.
 void setBlending(int func)
          Selects the texture blend mode, or blend function, for this Texture2D.
 void setFiltering(int levelFilter, int imageFilter)
          Selects the filtering mode for this Texture2D.
 void setImage(Image2D image)
          Sets the given Image2D as the texture image of this Texture2D.
 void setWrapping(int wrapS, int wrapT)
          Sets the wrapping mode for the S and T texture coordinates.
 
Methods inherited from class javax.microedition.m3g.Transformable
getCompositeTransform, getOrientation, getScale, getTransform, getTranslation, postRotate, preRotate, scale, setOrientation, setScale, setTransform, setTranslation, translate
 
Methods inherited from class javax.microedition.m3g.Object3D
addAnimationTrack, animate, duplicate, find, getAnimationTrack, getAnimationTrackCount, getReferences, getUserID, getUserObject, removeAnimationTrack, setUserID, setUserObject
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILTER_BASE_LEVEL

public static final int FILTER_BASE_LEVEL
A level filtering parameter to setFiltering that selects the base level image, even if mipmap levels exist.

See Also:
Constant Field Values

FILTER_LINEAR

public static final int FILTER_LINEAR
A parameter to setFiltering that selects linear filtering.

See Also:
Constant Field Values

FILTER_NEAREST

public static final int FILTER_NEAREST
A parameter to setFiltering that selects nearest neighbor filtering.

See Also:
Constant Field Values

FUNC_ADD

public static final int FUNC_ADD
A parameter to setBlending, specifying that the texel color is to be added to the fragment color.

See Also:
Constant Field Values

FUNC_BLEND

public static final int FUNC_BLEND
A parameter to setBlending, specifying that the texture blend color is to be blended into the fragment color in proportion to the texel RGB values.

See Also:
Constant Field Values

FUNC_DECAL

public static final int FUNC_DECAL
A parameter to setBlending, specifying that the texel color is to be blended into the fragment color in proportion to the texel alpha.

See Also:
Constant Field Values

FUNC_MODULATE

public static final int FUNC_MODULATE
A parameter to setBlending, specifying that the texel color and/or alpha are to be multiplied with the fragment color and alpha.

See Also:
Constant Field Values

FUNC_REPLACE

public static final int FUNC_REPLACE
A parameter to setBlending, specifying that the texel color and/or alpha are to replace the fragment color and alpha.

See Also:
Constant Field Values

WRAP_CLAMP

public static final int WRAP_CLAMP
A parameter to setWrapping, specifying that the texture image is to be repeated only once.

See Also:
Constant Field Values

WRAP_REPEAT

public static final int WRAP_REPEAT
A parameter to setWrapping, specifying that the texture image is to be repeated indefinitely.

See Also:
Constant Field Values
Constructor Detail

Texture2D

public Texture2D(Image2D image)
Constructs a new texture object with the given image, setting the texture attributes to their default values.

Method Detail

setImage

public void setImage(Image2D image)
Sets the given Image2D as the texture image of this Texture2D.


getImage

public Image2D getImage()
Retrieves the current base level (full size) texture image.


setFiltering

public void setFiltering(int levelFilter,
                         int imageFilter)
Selects the filtering mode for this Texture2D.


setWrapping

public void setWrapping(int wrapS,
                        int wrapT)
Sets the wrapping mode for the S and T texture coordinates.


getWrappingS

public int getWrappingS()
Returns the current texture wrapping mode for the S texture coordinate.


getWrappingT

public int getWrappingT()
Returns the current texture wrapping mode for the T texture coordinate.


setBlending

public void setBlending(int func)
Selects the texture blend mode, or blend function, for this Texture2D.


getBlending

public int getBlending()
Returns the current texture blend mode for this Texture2D.


setBlendColor

public void setBlendColor(int RGB)
Sets the texture blend color for this Texture2D.


getBlendColor

public int getBlendColor()
Returns the current texture blend color for this Texture2D.


BenQ Mobile

Copyright © 2006 BenQ Mobile GmbH & Co. OHG or respective copyright owner.
All Rights Reserved.
BenQ Corp. is a trademark licensee of Siemens AG.


For further information about Mobility Toolkit (MTK) visit our Developer Portal.