|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.j3d.SceneGraphObject
javax.media.j3d.NodeComponent
javax.media.j3d.TransparencyAttributes
public class TransparencyAttributes
The TransparencyAttributes object defines all attributes affecting transparency of the object. The transparency attributes are:
alphasrc*src +
(1-alphasrc)*dst
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)
.
f = 0
f = 1
f =
alphasrc
f =
1 - alphasrc
f =
colordst
f =
1 - colordst
f =
colorsrc
f =
1 - colorsrc
Field Summary | |
---|---|
static int |
ALLOW_BLEND_FUNCTION_READ
Specifies that this TransparencyAttributes object allows reading its blend function. |
static int |
ALLOW_BLEND_FUNCTION_WRITE
Specifies that this TransparencyAttributes object allows writing its blend function. |
static int |
ALLOW_MODE_READ
Specifies that this TransparencyAttributes object allows reading its transparency mode component information. |
static int |
ALLOW_MODE_WRITE
Specifies that this TransparencyAttributes object allows writing its transparency mode component information. |
static int |
ALLOW_VALUE_READ
Specifies that this TransparencyAttributes object allows reading its transparency value. |
static int |
ALLOW_VALUE_WRITE
Specifies that this TransparencyAttributes object allows writing its transparency value. |
(package private) static int |
BLEND_CONSTANT_COLOR
|
static int |
BLEND_DST_COLOR
Blend function: f = colordst . |
static int |
BLEND_ONE
Blend function: f = 1 . |
static int |
BLEND_ONE_MINUS_DST_COLOR
Blend function: f = 1-colordst . |
static int |
BLEND_ONE_MINUS_SRC_ALPHA
Blend function: f = 1-alphasrc . |
static int |
BLEND_ONE_MINUS_SRC_COLOR
Blend function: f = 1-colorsrc . |
static int |
BLEND_SRC_ALPHA
Blend function: f = alphasrc . |
static int |
BLEND_SRC_COLOR
Blend function: f = colorsrc . |
static int |
BLEND_ZERO
Blend function: f = 0 . |
static int |
BLENDED
Use alpha blended transparency. |
static int |
FASTEST
Use the fastest available method for transparency. |
(package private) static int |
MAX_BLEND_FUNC_TABLE_SIZE
|
static int |
NICEST
Use the nicest available method for transparency. |
static int |
NONE
No transparency, opaque object. |
private static int[] |
readCapabilities
|
static int |
SCREEN_DOOR
Use screen-door transparency. |
Fields inherited from class javax.media.j3d.NodeComponent |
---|
forceDuplicate |
Fields inherited from class javax.media.j3d.SceneGraphObject |
---|
nodeHashtable, retained |
Constructor Summary | |
---|---|
TransparencyAttributes()
Constructs a TransparencyAttributes object with default parameters. |
|
TransparencyAttributes(int tMode,
float tVal)
Construct TransparencyAttributes object with specified values. |
|
TransparencyAttributes(int tMode,
float tVal,
int srcBlendFunction,
int dstBlendFunction)
Construct TransparencyAttributes object with specified values. |
Method Summary | |
---|---|
NodeComponent |
cloneNodeComponent()
Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate) |
(package private) void |
createRetained()
Creates a retained mode TransparencyAttributesRetained object that this TransparencyAttributes component object will point to. |
(package private) void |
duplicateAttributes(NodeComponent originalNodeComponent,
boolean forceDuplicate)
Copies all node information from originalNodeComponent into
the current node. |
int |
getDstBlendFunction()
Gets the destination blend function for this TransparencyAttributes object. |
int |
getSrcBlendFunction()
Gets the source blend function for this TransparencyAttributes object. |
float |
getTransparency()
Retrieves this appearance's transparency. |
int |
getTransparencyMode()
Gets the transparency mode for this appearance component object. |
void |
setDstBlendFunction(int blendFunction)
Sets the destination blend function used in blended transparency and antialiasing operations. |
void |
setSrcBlendFunction(int blendFunction)
Sets the source blend function used in blended transparency and antialiasing operations. |
void |
setTransparency(float transparency)
Sets this appearance's transparency. |
void |
setTransparencyMode(int transparencyMode)
Sets the transparency mode for this appearance component object. |
Methods inherited from class javax.media.j3d.NodeComponent |
---|
checkDuplicateNodeComponent, cloneNodeComponent, duplicateChild, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree, validateImageIllegalSharing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ALLOW_MODE_READ
public static final int ALLOW_MODE_WRITE
public static final int ALLOW_VALUE_READ
public static final int ALLOW_VALUE_WRITE
public static final int ALLOW_BLEND_FUNCTION_READ
public static final int ALLOW_BLEND_FUNCTION_WRITE
public static final int FASTEST
setTransparencyMode(int)
,
Constant Field Valuespublic static final int NICEST
setTransparencyMode(int)
,
Constant Field Valuespublic static final int BLENDED
alphasrc*src +
(1-alphasrc)*dst
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)
.
setTransparencyMode(int)
,
setSrcBlendFunction(int)
,
setDstBlendFunction(int)
,
Constant Field Valuespublic static final int SCREEN_DOOR
setTransparencyMode(int)
,
Constant Field Valuespublic static final int NONE
setTransparencyMode(int)
,
Constant Field Valuespublic static final int BLEND_ZERO
f = 0
.
setSrcBlendFunction(int)
,
setDstBlendFunction(int)
,
Constant Field Valuespublic static final int BLEND_ONE
f = 1
.
setSrcBlendFunction(int)
,
setDstBlendFunction(int)
,
Constant Field Valuespublic static final int BLEND_SRC_ALPHA
f = alphasrc
.
setSrcBlendFunction(int)
,
setDstBlendFunction(int)
,
Constant Field Valuespublic static final int BLEND_ONE_MINUS_SRC_ALPHA
f = 1-alphasrc
.
setSrcBlendFunction(int)
,
setDstBlendFunction(int)
,
Constant Field Valuespublic static final int BLEND_DST_COLOR
f = colordst
.
Note that this function may only be used as a source blend function.
setSrcBlendFunction(int)
,
Constant Field Valuespublic static final int BLEND_ONE_MINUS_DST_COLOR
f = 1-colordst
.
Note that this function may only be used as a source blend function.
setSrcBlendFunction(int)
,
Constant Field Valuespublic static final int BLEND_SRC_COLOR
f = colorsrc
.
Note that this function may only be used as a destination blend function.
setDstBlendFunction(int)
,
Constant Field Valuespublic static final int BLEND_ONE_MINUS_SRC_COLOR
f = 1-colorsrc
.
Note that this function may only be used as a destination blend function.
setDstBlendFunction(int)
,
Constant Field Valuesstatic final int BLEND_CONSTANT_COLOR
static final int MAX_BLEND_FUNC_TABLE_SIZE
private static final int[] readCapabilities
Constructor Detail |
---|
public TransparencyAttributes()
NONE
BLEND_SRC_ALPHA
BLEND_ONE_MINUS_SRC_ALPHA
public TransparencyAttributes(int tMode, float tVal)
tMode
- the transparency modetVal
- the transparency value
java.lang.IllegalArgumentException
- if
tMode
is a value other than
NONE
, FASTEST
, NICEST
,
SCREEN_DOOR
, or BLENDED
public TransparencyAttributes(int tMode, float tVal, int srcBlendFunction, int dstBlendFunction)
tMode
- the transparency modetVal
- the transparency valuesrcBlendFunction
- the blend function to be used for the source
color, one of BLEND_ZERO
, BLEND_ONE
,
BLEND_SRC_ALPHA
, BLEND_ONE_MINUS_SRC_ALPHA
,
BLEND_DST_COLOR
, or BLEND_ONE_MINUS_DST_COLOR
.dstBlendFunction
- the blend function to be used for the
destination
color, one of BLEND_ZERO
, BLEND_ONE
,
BLEND_SRC_ALPHA
, BLEND_ONE_MINUS_SRC_ALPHA
,
BLEND_SRC_COLOR
, or BLEND_ONE_MINUS_SRC_COLOR
.
java.lang.IllegalArgumentException
- if
tMode
is a value other than
NONE
, FASTEST
, NICEST
,
SCREEN_DOOR
, or BLENDED
java.lang.IllegalArgumentException
- if
srcBlendFunction
or dstBlendFunction
is a value other than one of the supported functions listed above.Method Detail |
---|
public void setTransparencyMode(int transparencyMode)
transparencyMode
- the transparency mode to be used, one of
NONE
, FASTEST
, NICEST
,
SCREEN_DOOR
, or BLENDED
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
java.lang.IllegalArgumentException
- if
transparencyMode
is a value other than
NONE
, FASTEST
, NICEST
,
SCREEN_DOOR
, or BLENDED
public int getTransparencyMode()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setTransparency(float transparency)
transparency
- the appearance's transparency
in the range [0.0, 1.0] with 0.0 being
fully opaque and 1.0 being fully transparent
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic float getTransparency()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setSrcBlendFunction(int blendFunction)
BLEND_SRC_ALPHA
.
blendFunction
- the blend function to be used for the source
color, one of BLEND_ZERO
, BLEND_ONE
,
BLEND_SRC_ALPHA
, BLEND_ONE_MINUS_SRC_ALPHA
,
BLEND_DST_COLOR
, or BLEND_ONE_MINUS_DST_COLOR
.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
java.lang.IllegalArgumentException
- if blendFunction
is a value other than one of the supported functions listed above.public int getSrcBlendFunction()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setDstBlendFunction(int blendFunction)
BLEND_ONE_MINUS_SRC_ALPHA
.
blendFunction
- the blend function to be used for the destination
color, one of BLEND_ZERO
, BLEND_ONE
,
BLEND_SRC_ALPHA
, BLEND_ONE_MINUS_SRC_ALPHA
,
BLEND_SRC_COLOR
, or BLEND_ONE_MINUS_SRC_COLOR
.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
java.lang.IllegalArgumentException
- if blendFunction
is a value other than one of the supported functions listed above.public int getDstBlendFunction()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphvoid createRetained()
createRetained
in class NodeComponent
public NodeComponent cloneNodeComponent()
cloneNodeComponent
in class NodeComponent
void duplicateAttributes(NodeComponent originalNodeComponent, boolean forceDuplicate)
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).
duplicateAttributes
in class NodeComponent
originalNodeComponent
- the original node to duplicate.forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.Node.cloneTree()
,
NodeComponent.setDuplicateOnCloneTree(boolean)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |