|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.SceneGraphObject | +--javax.media.j3d.NodeComponent | +--javax.media.j3d.ImageComponent | +--javax.media.j3d.ImageComponent3D
This class defines a 3D image component. This is used for texture images. Prior to Java 3D 1.2, only BufferedImage objects could be used as the input to an ImageComponent3D object. As of Java 3D 1.2, an ImageComponent3D accepts an array of arbitrary RenderedImage objects (BufferedImage is an implementation of the RenderedImage interface). The methods that set/get a BufferedImage object are left in for compatibility. The new methods that set/get a RenderedImage are a superset of the old methods. In particular, the two set methods in the following example are equivalent:
BufferedImage bi;
RenderedImage ri = bi;
ImageComponent3D ic;
// Set image 0 to the specified BufferedImage
ic.set(0, bi);
// Set image 0 to the specified RenderedImage
ic.set(0, ri);
Nested Class Summary | |
static interface |
ImageComponent3D.Updater
The ImageComponent3D.Updater interface is used in updating image data that is accessed by reference from a live or compiled ImageComponent object. |
Field Summary |
Fields inherited from class javax.media.j3d.ImageComponent |
ALLOW_FORMAT_READ, ALLOW_IMAGE_READ, ALLOW_IMAGE_WRITE, 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 a 3D image component object using the specified format, and the BufferedImage array. |
|
ImageComponent3D(int format,
java.awt.image.BufferedImage[] images,
boolean byReference,
boolean yUp)
Constructs a 3D image component object using the specified format, BufferedImage array, byReference flag, and yUp flag. |
|
ImageComponent3D(int format,
int width,
int height,
int depth)
Constructs a 3D image component object using the specified format, width, height, and depth. |
|
ImageComponent3D(int format,
int width,
int height,
int depth,
boolean byReference,
boolean yUp)
Constructs a 3D image component object using the specified format, width, height, depth, byReference flag, and yUp flag. |
|
ImageComponent3D(int format,
java.awt.image.RenderedImage[] images)
Constructs a 3D image component object using the specified format, and the RenderedImage array. |
|
ImageComponent3D(int format,
java.awt.image.RenderedImage[] images,
boolean byReference,
boolean yUp)
Constructs a 3D image component object using the specified format, RenderedImage array, byReference flag, and yUp flag. |
Method Summary | |
NodeComponent |
cloneNodeComponent()
Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate) |
int |
getDepth()
Retrieves the depth of this 3D image component object. |
java.awt.image.BufferedImage[] |
getImage()
Retrieves the images from this ImageComponent3D object. |
java.awt.image.BufferedImage |
getImage(int index)
Retrieves one of the images from this ImageComponent3D object. |
java.awt.image.RenderedImage[] |
getRenderedImage()
Retrieves the images from this ImageComponent3D object. |
java.awt.image.RenderedImage |
getRenderedImage(int index)
Retrieves one of the images from this ImageComponent3D object. |
void |
set(java.awt.image.BufferedImage[] images)
Sets the array of images in this image component to the specified array of BufferedImage objects. |
void |
set(int index,
java.awt.image.BufferedImage image)
Sets this image component at the specified index to the specified BufferedImage object. |
void |
set(int index,
java.awt.image.RenderedImage image)
Sets this image component at the specified index to the specified RenderedImage object. |
void |
set(java.awt.image.RenderedImage[] images)
Sets the array of images in this image component to the specified array of RenderedImage objects. |
void |
setSubImage(int index,
java.awt.image.RenderedImage image,
int width,
int height,
int srcX,
int srcY,
int dstX,
int dstY)
Modifies a contiguous subregion of a particular slice of image of this ImageComponent3D object. |
void |
updateData(ImageComponent3D.Updater updater,
int index,
int x,
int y,
int width,
int height)
Updates a particular slice of image data that is accessed by reference. |
Methods inherited from class javax.media.j3d.ImageComponent |
getFormat, getHeight, getWidth, isByReference, isYUp, setYUp |
Methods inherited from class javax.media.j3d.NodeComponent |
cloneNodeComponent, duplicateNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData, updateNodeReferences |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ImageComponent3D(int format, int width, int height, int depth)
format
- the image component format, one of: FORMAT_RGB,
FORMAT_RGBA, etc.width
- the number of columns of pixels in this image component
objectheight
- the number of rows of pixels in this image component
objectdepth
- the number of 2D slices in this image component object
java.lang.IllegalArgumentException
- if format is invalid, or if
any of width, height, or depth are not positive.public ImageComponent3D(int format, java.awt.image.BufferedImage[] images)
format
- the image component format, one of: FORMAT_RGB,
FORMAT_RGBA etc.
java.lang.IllegalArgumentException
- if format is invalid, or if
the width or height of the first image are not positive.public ImageComponent3D(int format, java.awt.image.RenderedImage[] images)
format
- the image component format, one of: FORMAT_RGB,
FORMAT_RGBA etc.
java.lang.IllegalArgumentException
- if format is invalid, or if
the width or height of the first image are not positive.public ImageComponent3D(int format, int width, int height, int depth, boolean byReference, boolean yUp)
format
- the image component format, one of: FORMAT_RGB,
FORMAT_RGBA, etc.width
- the number of columns of pixels in this image component
objectheight
- the number of rows of pixels in this image component
objectdepth
- the number of 2D slices in this image component objectbyReference
- a flag that indicates whether the data is copied
into this image component object or is accessed by reference.yUp
- a flag that indicates the y-orientation of this image
component. If yUp is set to true, the origin of the image is
the lower left; otherwise, the origin of the image is the upper
left.
java.lang.IllegalArgumentException
- if format is invalid, or if
any of width, height, or depth are not positive.public ImageComponent3D(int format, java.awt.image.BufferedImage[] images, boolean byReference, boolean yUp)
format
- the image component format, one of: FORMAT_RGB,
FORMAT_RGBA etc.byReference
- a flag that indicates whether the data is copied
into this image component object or is accessed by reference.yUp
- a flag that indicates the y-orientation of this image
component. If yUp is set to true, the origin of the image is
the lower left; otherwise, the origin of the image is the upper
left.
java.lang.IllegalArgumentException
- if format is invalid, or if
the width or height of the first image are not positive.public ImageComponent3D(int format, java.awt.image.RenderedImage[] images, boolean byReference, boolean yUp)
format
- the image component format, one of: FORMAT_RGB,
FORMAT_RGBA etc.byReference
- a flag that indicates whether the data is copied
into this image component object or is accessed by reference.yUp
- a flag that indicates the y-orientation of this image
component. If yUp is set to true, the origin of the image is
the lower left; otherwise, the origin of the image is the upper
left.
java.lang.IllegalArgumentException
- if format is invalid, or if
the width or height of the first image are not positive.Method Detail |
public int getDepth()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void set(java.awt.image.BufferedImage[] images)
images
- array of BufferedImage objects containing the image.
The format and size must be the same as the current format in the
image component.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void set(java.awt.image.RenderedImage[] images)
images
- array of RenderedImage objects containing the image.
The format and size must be the same as the current format in the
image component.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void set(int index, java.awt.image.BufferedImage image)
index
- the image index
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void set(int index, java.awt.image.RenderedImage image)
index
- the image index
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic java.awt.image.BufferedImage[] getImage()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
java.lang.IllegalStateException
- if the data access mode is
by-reference and any image referenced by this ImageComponent3D
object is not an instance of BufferedImage.public java.awt.image.RenderedImage[] getRenderedImage()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic java.awt.image.BufferedImage getImage(int index)
index
- the index of the image to retrieve
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
java.lang.IllegalStateException
- if the data access mode is
by-reference and the image referenced by this ImageComponent3D
object at the specified index is not an instance of BufferedImage.public java.awt.image.RenderedImage getRenderedImage(int index)
index
- the index of the image to retrieve
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setSubImage(int index, java.awt.image.RenderedImage image, int width, int height, int srcX, int srcY, int dstX, int dstY)
index
- index of the image to be modified. The index must not
exceed the depth of the object.image
- RenderedImage object containing the subimage.width
- width of the subregion.height
- height of the subregion.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
java.lang.IllegalStateException
- if the data access mode is
BY_REFERENCE
.
java.lang.IllegalArgumentException
- if width
or
height
of
the subregion exceeds the dimension of the image in this object.public void updateData(ImageComponent3D.Updater updater, int index, int x, int y, int width, int height)
The data to be modified has to be within the boundary of the subregion specified by the offset (x, y) and the dimension (width*height). It is illegal to modify data outside this boundary. If any referenced data is modified outside the updateData method, or any data outside the specified boundary is modified, the results are undefined.
updater
- object whose updateData callback method will be
called to update the data referenced by this ImageComponent3D object.index
- index of the image to be modified. The index must
not exceed the depth of this object.width
- width of the subregion.height
- height of the subregion.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
java.lang.IllegalStateException
- if the data access mode is
BY_COPY
.
java.lang.IllegalArgumentException
- if width
or
height
of
the subregion exceeds the dimension of the image in this object.
java.lang.ArrayIndexOutOfBoundsException
- if index
> the
depth of this object.public NodeComponent cloneNodeComponent()
cloneNodeComponent
in class NodeComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |