| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.NodeComponent javax.media.j3d.TransparencyAttributes
TransparencyAttributes | public class TransparencyAttributes extends NodeComponent (Code) | | The TransparencyAttributes object defines all attributes affecting
transparency of the object. The transparency attributes are:
- Transparency mode - defines how transparency is applied to
this Appearance component object:
- FASTEST - uses the fastest available method for transparency.
- NICEST - uses the nicest available method for transparency.
- SCREEN_DOOR - uses screen-door transparency. This is done using
an on/off stipple pattern in which the percentage of transparent pixels
is approximately equal to the value specified by the transparency
parameter.
- BLENDED - uses alpha blended transparency. The blend equation is
specified by the srcBlendFunction and dstBlendFunction attributes.
The default equation is:
alphasrc*src +
(1-alphasrc)*dst
where alphasrc is
1-transparency .
When this mode is used with a Raster object or with a Geometry
that contains per-vertex colors with alpha, the alpha values in
the Raster's image or in the Geometry's per-vertex colors are
combined with the transparency value in this TransparencyAttributes
object to perform blending. In this case, the alpha value used for
blending at each pixel is:
alphasrc =
alphapix *
(1-transparency) .
- NONE - no transparency; opaque object.
- Transparency value - the amount of transparency to be applied to this
Appearance component object. The transparency values are in the
range [0.0, 1.0], with 0.0 being fully opaque and 1.0 being
fully transparent.
- Blend function - used in blended transparency and antialiasing
operations. The source function specifies the factor that is
multiplied by the source color. This value is added to the product
of the destination factor and the destination color. The default
source blend function is BLEND_SRC_ALPHA. The source blend function
is one of the following:
- BLEND_ZERO - the blend function is
f = 0
- BLEND_ONE - the blend function is
f = 1
- BLEND_SRC_ALPHA - the blend function is
f =
alphasrc
- BLEND_ONE_MINUS_SRC_ALPHA - the blend function is
f =
1 - alphasrc
- BLEND_DST_COLOR - the blend function is
f =
colordst
- BLEND_ONE_MINUS_DST_COLOR - the blend function is
f =
1 - colordst
- BLEND_SRC_COLOR - the blend function is
f =
colorsrc
- BLEND_ONE_MINUS_SRC_COLOR - the blend function is
f =
1 - colorsrc
|
Field Summary | |
final public static int | ALLOW_BLEND_FUNCTION_READ Specifies that this TransparencyAttributes object
allows reading its blend function. | final public static int | ALLOW_BLEND_FUNCTION_WRITE Specifies that this TransparencyAttributes object
allows writing its blend function. | final public static int | ALLOW_MODE_READ Specifies that this TransparencyAttributes object
allows reading its transparency mode component information. | final public static int | ALLOW_MODE_WRITE Specifies that this TransparencyAttributes object
allows writing its transparency mode component information. | final public static int | ALLOW_VALUE_READ Specifies that this TransparencyAttributes object
allows reading its transparency value. | final public static int | ALLOW_VALUE_WRITE Specifies that this TransparencyAttributes object
allows writing its transparency value. | final public static int | BLENDED Use alpha blended transparency. | final static int | BLEND_CONSTANT_COLOR | final public static int | BLEND_DST_COLOR Blend function:
f = colordst . | final public static int | BLEND_ONE Blend function: f = 1 . | final public static int | BLEND_ONE_MINUS_DST_COLOR Blend function:
f = 1-colordst . | final public static int | BLEND_ONE_MINUS_SRC_ALPHA Blend function:
f = 1-alphasrc . | final public static int | BLEND_ONE_MINUS_SRC_COLOR Blend function:
f = 1-colorsrc . | final public static int | BLEND_SRC_ALPHA Blend function:
f = alphasrc . | final public static int | BLEND_SRC_COLOR Blend function:
f = colorsrc . | final public static int | BLEND_ZERO Blend function: f = 0 . | final public static int | FASTEST Use the fastest available method for transparency. | final static int | MAX_BLEND_FUNC_TABLE_SIZE | final public static int | NICEST Use the nicest available method for transparency. | final public static int | NONE No transparency, opaque object. | final public static int | SCREEN_DOOR Use screen-door transparency. |
Constructor Summary | |
public | TransparencyAttributes() Constructs a TransparencyAttributes object with default parameters. | public | TransparencyAttributes(int tMode, float tVal) Construct TransparencyAttributes object with specified values. | public | TransparencyAttributes(int tMode, float tVal, int srcBlendFunction, int dstBlendFunction) Construct TransparencyAttributes object with specified values. |
Method Summary | |
public NodeComponent | cloneNodeComponent() | void | createRetained() Creates a retained mode TransparencyAttributesRetained object that this
TransparencyAttributes component object will point to. | void | duplicateAttributes(NodeComponent originalNodeComponent, boolean forceDuplicate) Copies all node information from originalNodeComponent into
the current node. | public int | getDstBlendFunction() Gets the destination blend function for this
TransparencyAttributes object. | public int | getSrcBlendFunction() Gets the source blend function for this
TransparencyAttributes object. | public float | getTransparency() Retrieves this appearance's transparency. | public int | getTransparencyMode() Gets the transparency mode for this
appearance component object. | public void | setDstBlendFunction(int blendFunction) Sets the destination blend function used in blended transparency
and antialiasing operations. | public void | setSrcBlendFunction(int blendFunction) Sets the source blend function used in blended transparency
and antialiasing operations. | public void | setTransparency(float transparency) Sets this appearance's transparency. | public void | setTransparencyMode(int transparencyMode) Sets the transparency mode for this
appearance component object. |
ALLOW_BLEND_FUNCTION_READ | final public static int ALLOW_BLEND_FUNCTION_READ(Code) | | Specifies that this TransparencyAttributes object
allows reading its blend function.
since: Java 3D 1.2 |
ALLOW_BLEND_FUNCTION_WRITE | final public static int ALLOW_BLEND_FUNCTION_WRITE(Code) | | Specifies that this TransparencyAttributes object
allows writing its blend function.
since: Java 3D 1.2 |
ALLOW_MODE_READ | final public static int ALLOW_MODE_READ(Code) | | Specifies that this TransparencyAttributes object
allows reading its transparency mode component information.
|
ALLOW_MODE_WRITE | final public static int ALLOW_MODE_WRITE(Code) | | Specifies that this TransparencyAttributes object
allows writing its transparency mode component information.
|
ALLOW_VALUE_READ | final public static int ALLOW_VALUE_READ(Code) | | Specifies that this TransparencyAttributes object
allows reading its transparency value.
|
ALLOW_VALUE_WRITE | final public static int ALLOW_VALUE_WRITE(Code) | | Specifies that this TransparencyAttributes object
allows writing its transparency value.
|
BLENDED | final public static int BLENDED(Code) | | Use alpha blended transparency. The blend equation is
specified by the srcBlendFunction and dstBlendFunction attributes.
The default equation is:
alphasrc*src +
(1-alphasrc)*dst
where alphasrc is
1-transparency .
When this mode is used with a Raster object or with a Geometry
that contains per-vertex colors with alpha, the alpha values in
the Raster's image or in the Geometry's per-vertex colors are
combined with the transparency value in this TransparencyAttributes
object to perform blending. In this case, the alpha value used for
blending at each pixel is:
alphasrc =
alphapix *
(1-transparency) .
See Also: TransparencyAttributes.setTransparencyMode See Also: TransparencyAttributes.setSrcBlendFunction See Also: TransparencyAttributes.setDstBlendFunction |
BLEND_CONSTANT_COLOR | final static int BLEND_CONSTANT_COLOR(Code) | | |
BLEND_ONE_MINUS_DST_COLOR | final public static int BLEND_ONE_MINUS_DST_COLOR(Code) | | Blend function:
f = 1-colordst .
Note that this function may only be used as a source
blend function.
See Also: TransparencyAttributes.setSrcBlendFunction since: Java 3D 1.4 |
BLEND_ONE_MINUS_SRC_COLOR | final public static int BLEND_ONE_MINUS_SRC_COLOR(Code) | | Blend function:
f = 1-colorsrc .
Note that this function may only be used as a destination
blend function.
See Also: TransparencyAttributes.setDstBlendFunction since: Java 3D 1.4 |
MAX_BLEND_FUNC_TABLE_SIZE | final static int MAX_BLEND_FUNC_TABLE_SIZE(Code) | | |
SCREEN_DOOR | final public static int SCREEN_DOOR(Code) | | Use screen-door transparency. This is done using an on/off stipple
pattern where the percentage of pixels that are transparent is
approximately equal to the value specified by the transparency
parameter.
See Also: TransparencyAttributes.setTransparencyMode |
TransparencyAttributes | public TransparencyAttributes()(Code) | | Constructs a TransparencyAttributes object with default parameters.
The default values are as follows:
transparency mode : NONE
transparency value : 0.0
source blend function : BLEND_SRC_ALPHA
destination blend function : BLEND_ONE_MINUS_SRC_ALPHA
|
TransparencyAttributes | public TransparencyAttributes(int tMode, float tVal)(Code) | | Construct TransparencyAttributes object with specified values.
Parameters: tMode - the transparency mode Parameters: tVal - the transparency value exception: IllegalArgumentException - iftMode is a value other thanNONE , FASTEST , NICEST , SCREEN_DOOR , or BLENDED |
TransparencyAttributes | public TransparencyAttributes(int tMode, float tVal, int srcBlendFunction, int dstBlendFunction)(Code) | | Construct TransparencyAttributes object with specified values.
Parameters: tMode - the transparency mode Parameters: tVal - the transparency value Parameters: srcBlendFunction - the blend function to be used for the sourcecolor, one of BLEND_ZERO , BLEND_ONE ,BLEND_SRC_ALPHA , BLEND_ONE_MINUS_SRC_ALPHA ,BLEND_DST_COLOR , or BLEND_ONE_MINUS_DST_COLOR . Parameters: dstBlendFunction - the blend function to be used for thedestinationcolor, one of BLEND_ZERO , BLEND_ONE ,BLEND_SRC_ALPHA , BLEND_ONE_MINUS_SRC_ALPHA ,BLEND_SRC_COLOR , or BLEND_ONE_MINUS_SRC_COLOR . exception: IllegalArgumentException - iftMode is a value other thanNONE , FASTEST , NICEST , SCREEN_DOOR , or BLENDED exception: IllegalArgumentException - ifsrcBlendFunction or dstBlendFunction is a value other than one of the supported functions listed above. since: Java 3D 1.2 |
createRetained | void createRetained()(Code) | | Creates a retained mode TransparencyAttributesRetained object that this
TransparencyAttributes component object will point to.
|
duplicateAttributes | void duplicateAttributes(NodeComponent originalNodeComponent, boolean forceDuplicate)(Code) | | Copies all node information from originalNodeComponent into
the current node. This method is called from the
duplicateNode method. This routine does
the actual duplication of all "local data" (any data defined in
this object).
Parameters: originalNodeComponent - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getDstBlendFunction | public int getDstBlendFunction()(Code) | | Gets the destination blend function for this
TransparencyAttributes object.
the destination blend function. exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
getSrcBlendFunction | public int getSrcBlendFunction()(Code) | | Gets the source blend function for this
TransparencyAttributes object.
the source blend function. exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph since: Java 3D 1.2 |
getTransparency | public float getTransparency()(Code) | | Retrieves this appearance's transparency.
the appearance's transparency exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
getTransparencyMode | public int getTransparencyMode()(Code) | | Gets the transparency mode for this
appearance component object.
transparencyMode the transparency mode exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph |
setDstBlendFunction | public void setDstBlendFunction(int blendFunction)(Code) | | Sets the destination blend function used in blended transparency
and antialiasing operations. The destination function specifies the
factor that is multiplied by the destination color; this value is
added to the product of the source factor and the
source color. The default destination blend function is
BLEND_ONE_MINUS_SRC_ALPHA .
Parameters: blendFunction - the blend function to be used for the destinationcolor, one of BLEND_ZERO , BLEND_ONE ,BLEND_SRC_ALPHA , BLEND_ONE_MINUS_SRC_ALPHA ,BLEND_SRC_COLOR , or BLEND_ONE_MINUS_SRC_COLOR . exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph exception: IllegalArgumentException - if blendFunction is a value other than one of the supported functions listed above. since: Java 3D 1.2 |
setSrcBlendFunction | public void setSrcBlendFunction(int blendFunction)(Code) | | Sets the source blend function used in blended transparency
and antialiasing operations. The source function specifies the
factor that is multiplied by the source color; this value is
added to the product of the destination factor and the
destination color. The default source blend function is
BLEND_SRC_ALPHA .
Parameters: blendFunction - the blend function to be used for the sourcecolor, one of BLEND_ZERO , BLEND_ONE ,BLEND_SRC_ALPHA , BLEND_ONE_MINUS_SRC_ALPHA ,BLEND_DST_COLOR , or BLEND_ONE_MINUS_DST_COLOR . exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph exception: IllegalArgumentException - if blendFunction is a value other than one of the supported functions listed above. since: Java 3D 1.2 |
setTransparency | public void setTransparency(float transparency)(Code) | | Sets this appearance's transparency.
Parameters: transparency - the appearance's transparencyin the range [0.0, 1.0] with 0.0 beingfully opaque and 1.0 being fully transparent exception: CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph |
setTransparencyMode | public void setTransparencyMode(int transparencyMode)(Code) | | Sets the transparency mode for this
appearance component object.
Parameters: transparencyMode - the transparency mode to be used, one ofNONE , FASTEST , NICEST , SCREEN_DOOR , or BLENDED exception: CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph exception: IllegalArgumentException - iftransparencyMode is a value other thanNONE , FASTEST , NICEST , SCREEN_DOOR , or BLENDED |
Fields inherited from javax.media.j3d.NodeComponent | boolean forceDuplicate(Code)(Java Doc)
|
|
|