|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | 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.ImageComponent2D
This class defines a 2D image component. This is used for texture images, background images and raster components of Shape3D nodes. Prior to Java 3D 1.2, only BufferedImage objects could be used as the input to an ImageComponent2D object. As of Java 3D 1.2, an ImageComponent2D accepts any RenderedImage object (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;
ImageComponent2D ic;
// Set the image to the specified BufferedImage
ic.set(bi);
// Set the image to the specified RenderedImage
ic.set(ri);
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 | |
ImageComponent2D(int format,
java.awt.image.BufferedImage image)
Constructs a 2D image component object using the specified format and BufferedImage. |
|
ImageComponent2D(int format,
java.awt.image.BufferedImage image,
boolean byReference,
boolean yUp)
Constructs a 2D image component object using the specified format, BufferedImage, byReference flag, and yUp flag. |
|
ImageComponent2D(int format,
int width,
int height)
Constructs a 2D image component object using the specified format, width, and height, and a null image. |
|
ImageComponent2D(int format,
int width,
int height,
boolean byReference,
boolean yUp)
Constructs a 2D image component object using the specified format, width, height, byReference flag, and yUp flag, and a null image. |
|
ImageComponent2D(int format,
java.awt.image.RenderedImage image)
Constructs a 2D image component object using the specified format and RenderedImage. |
|
ImageComponent2D(int format,
java.awt.image.RenderedImage image,
boolean byReference,
boolean yUp)
Constructs a 2D image component object using the specified format, RenderedImage, byReference flag, and yUp flag. |
Method Summary | |
NodeComponent |
cloneNodeComponent()
Deprecated. replaced with cloneNodeComponent(boolean forceDuplicate) |
java.awt.image.BufferedImage |
getImage()
Retrieves the image from this ImageComponent2D object. |
java.awt.image.RenderedImage |
getRenderedImage()
Retrieves the image from this ImageComponent2D object. |
void |
set(java.awt.image.BufferedImage image)
Sets this image component to the specified BufferedImage object. |
void |
set(java.awt.image.RenderedImage image)
Sets this image component to the specified RenderedImage object. |
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,
duplicateSceneGraphObject,
getCapability,
getUserData,
isCompiled,
isLive,
setCapability,
setUserData,
updateNodeReferences |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ImageComponent2D(int format, int width, int height)
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
objectpublic ImageComponent2D(int format, java.awt.image.BufferedImage image)
format
- the image component format, one of: FORMAT_RGB,
FORMAT_RGBA, etc.image
- the BufferedImage used to create this 2D image component.public ImageComponent2D(int format, java.awt.image.RenderedImage image)
format
- the image component format, one of: FORMAT_RGB,
FORMAT_RGBA, etc.image
- the RenderedImage used to create this 2D image componentpublic ImageComponent2D(int format, int width, int height, 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
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.public ImageComponent2D(int format, java.awt.image.BufferedImage image, boolean byReference, boolean yUp)
format
- the image component format, one of: FORMAT_RGB,
FORMAT_RGBA, etc.image
- the BufferedImage used to create this 2D image componentbyReference
- a flag that indicates whether the data is copied
into this image component object or is accessed by referenceyUp
- 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.public ImageComponent2D(int format, java.awt.image.RenderedImage image, boolean byReference, boolean yUp)
format
- the image component format, one of: FORMAT_RGB,
FORMAT_RGBA, etc.image
- the RenderedImage used to create this 2D image componentbyReference
- 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.Method Detail |
public void set(java.awt.image.BufferedImage image)
image
- BufferedImage object containing the image.
The format and size must be the same as the current format in this
ImageComponent2D object.public void set(java.awt.image.RenderedImage image)
image
- RenderedImage object containing the image.
The format and size must be the same as the current format in this
ImageComponent2D object.public java.awt.image.BufferedImage getImage()
public java.awt.image.RenderedImage getRenderedImage()
public NodeComponent cloneNodeComponent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |