javax.media.j3d
Class ImageComponent3D

java.lang.Object
  |
  +--javax.media.j3d.SceneGraphObject
        |
        +--javax.media.j3d.NodeComponent
              |
              +--javax.media.j3d.ImageComponent
                    |
                    +--javax.media.j3d.ImageComponent3D

public class ImageComponent3D
extends ImageComponent

This class defines a 3D array of pixels. This is used for texture images.


Fields inherited from class javax.media.j3d.ImageComponent
ALLOW_FORMAT_READ, ALLOW_IMAGE_READ, ALLOW_SIZE_READ, FORMAT_CHANNEL8, FORMAT_LUM4_ALPHA4, FORMAT_LUM8_ALPHA8, FORMAT_R3_G3_B2, FORMAT_RGB, FORMAT_RGB4, FORMAT_RGB5, FORMAT_RGB5_A1, FORMAT_RGB8, FORMAT_RGBA, FORMAT_RGBA4, FORMAT_RGBA8
 
Constructor Summary
ImageComponent3D(int format, java.awt.image.BufferedImage[] images)
          Constructs an 3D image component object using the specified format, and the BufferedImage array.
ImageComponent3D(int format, int width, int height, int depth)
          Constructs an 3D image component object using the specified format, width, height and depth.
 
Method Summary
 NodeComponent cloneNodeComponent()
          Creates a new ImageComponent3D object.
 void duplicateNodeComponent(NodeComponent originalNodeComponent)
          Copies the information found in originalNodeComponent to the current node.
 int getDepth()
          Retrieves the depth of this 3D image component object.
 java.awt.image.BufferedImage[] getImage()
          Retrieves a copy of the images in this ImageComponent3D object.
 java.awt.image.BufferedImage getImage(int index)
          Retrieves a copy of one of the images in this ImageComponent3D object.
 void set(java.awt.image.BufferedImage[] images)
          Copies the specified array of BufferedImage objects to this 3D image component object.
 void set(int index, java.awt.image.BufferedImage image)
          Copies the specified BufferedImage to this 3D image component object at the specified index.
 
Methods inherited from class javax.media.j3d.ImageComponent
getFormat, getHeight, getWidth
 
Methods inherited from class javax.media.j3d.NodeComponent
getDuplicateOnCloneTree, setDuplicateOnCloneTree
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, duplicateSceneGraphObject, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageComponent3D

public ImageComponent3D(int format,
                        int width,
                        int height,
                        int depth)
Constructs an 3D image component object using the specified format, width, height and depth.
Parameters:
format - the image component format, one of: FORMAT_RGB, FORMAT_RGBA, etc.
width - the number of columns of pixels in this image component object
height - the number of rows of pixels in this image component object
depth - the number of 2D slices in this image component object
Throws:
java.lang.IllegalArgumentException - if format is invalid or width/height are non-positive.

ImageComponent3D

public ImageComponent3D(int format,
                        java.awt.image.BufferedImage[] images)
Constructs an 3D image component object using the specified format, and the BufferedImage array.
Parameters:
format - the image component format, one of: FORMAT_RGB, , FORMAT_RGBA etc.
image - an array of BufferedImage
Throws:
java.lang.IllegalArgumentException - if format is invalid or width/height are non-positive.
Method Detail

getDepth

public final int getDepth()
Retrieves the depth of this 3D image component object.
Returns:
the format of this 3D image component object
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

set

public final void set(java.awt.image.BufferedImage[] images)
Copies the specified array of BufferedImage objects to this 3D image component object.
Parameters:
images - array of BufferedImage objects containing the image. The format and size must be the same as the current format in the image component.
Throws:
RestrictedAccessException - if the method is called when this object is part of live or compiled scene graph.

set

public final void set(int index,
                      java.awt.image.BufferedImage image)
Copies the specified BufferedImage to this 3D image component object at the specified index.
Parameters:
index - the image index
images - BufferedImage object containing the image. The format and size must be the same as the current format in this ImageComponent3D object. The index must not exceed the depth of this ImageComponent3D object.
Throws:
RestrictedAccessException - if the method is called when this object is part of live or compiled scene graph.

getImage

public final java.awt.image.BufferedImage[] getImage()
Retrieves a copy of the images in this ImageComponent3D object.
Returns:
a new array of new BufferedImage objects created from the images in this ImageComponent3D object
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

getImage

public final java.awt.image.BufferedImage getImage(int index)
Retrieves a copy of one of the images in this ImageComponent3D object.
Parameters:
index - the index of the image to retrieve
Returns:
a new BufferedImage objects created from the image at the specified index in this ImageComponent3D object
Throws:
CapabilityNotSetException - if appropriate capability is not set and this object is part of live or compiled scene graph

cloneNodeComponent

public NodeComponent cloneNodeComponent()
Creates a new ImageComponent3D object. Called from a Leaf node's duplicateNode method.
Overrides:
cloneNodeComponent in class NodeComponent
Returns:
a duplicate of the ImageComponent3D object.
See Also:
Node.duplicateNode(javax.media.j3d.Node, boolean), Node.cloneTree(), NodeComponent.setDuplicateOnCloneTree(boolean)

duplicateNodeComponent

public void duplicateNodeComponent(NodeComponent originalNodeComponent)
Copies the information found in originalNodeComponent to the current node. This routine is called as part of the cloneNodeComponent operation.
Overrides:
duplicateNodeComponent in class NodeComponent
Parameters:
originalNodeComponent - the node to duplicate.
See Also:
Node.cloneTree(), Node.cloneNode(boolean), Node.duplicateNode(javax.media.j3d.Node, boolean), NodeComponent.setDuplicateOnCloneTree(boolean)