javax.media.j3d
Class ImageComponent3DRetained
java.lang.Object
javax.media.j3d.IndexedObject
javax.media.j3d.SceneGraphObjectRetained
javax.media.j3d.NodeComponentRetained
javax.media.j3d.ImageComponentRetained
javax.media.j3d.ImageComponent3DRetained
- All Implemented Interfaces:
- java.lang.Cloneable
class ImageComponent3DRetained
- extends ImageComponentRetained
This class defines a 3D array of pixels.
This is used for texture images.
Fields inherited from class javax.media.j3d.ImageComponentRetained |
abgrSupported, byReference, depth, evaluateExtLock, geomLock, height, IMAGE_CHANGED, IMAGE_DATA_TYPE_BYTE_ARRAY, IMAGE_DATA_TYPE_BYTE_BUFFER, IMAGE_DATA_TYPE_INT_ARRAY, IMAGE_DATA_TYPE_INT_BUFFER, IMAGE_SIZE_512X512, imageData, imageTypeIsSupported, npotSupported, numXTiles, numYTiles, SUBIMAGE_CHANGED, tileh, tilew, TYPE_BYTE_ABGR, TYPE_BYTE_BGR, TYPE_BYTE_GRAY, TYPE_BYTE_LA, TYPE_BYTE_RGB, TYPE_BYTE_RGBA, TYPE_INT_ARGB, TYPE_INT_BGR, TYPE_INT_RGB, TYPE_USHORT_GRAY, userList, width, yUp |
Method Summary |
(package private) int |
getDepth()
Retrieves the depth of this 3D image component object. |
(package private) java.awt.image.BufferedImage[] |
getImage()
Retrieves a copy of the images in this ImageComponent3D object. |
(package private) java.awt.image.RenderedImage |
getImage(int index)
Retrieves a copy of one of the images in this ImageComponent3D object. |
(package private) java.awt.image.RenderedImage[] |
getRenderedImage()
Retrieves a copy of the images in this ImageComponent3D object. |
(package private) void |
set(int index,
java.awt.image.BufferedImage image)
Copies the specified BufferedImage to this 3D image component
object at the specified index. |
(package private) void |
set(int index,
java.awt.image.RenderedImage image)
Copies the specified BufferedImage to this 3D image component
object at the specified index. |
(package private) void |
setDepth(int depth)
|
(package private) void |
setSubImage(int index,
java.awt.image.RenderedImage image,
int width,
int height,
int srcX,
int srcY,
int dstX,
int dstY)
|
(package private) void |
updateData(ImageComponent3D.Updater updater,
int index,
int x,
int y,
int width,
int height)
Update data. |
Methods inherited from class javax.media.j3d.ImageComponentRetained |
addUser, convertImageDataFromABGRToRGBA, copyImageByBlock, copyImageLineByLine, copySupportedImageToImageData, copySupportedImageToImageData, copyToRefImage, copyToRefImageWithFormatConversion, copyUnsupportedImageToImageData, copyUnsupportedImageToImageData, copyUnsupportedImageToImageData, copyUnsupportedNioImageToImageData, createBlankImageData, createNioImageBufferDataObject, createRenderedImageDataObject, createRenderedImageDataObject, evaluateExtABGR, evaluateExtensions, evaluateExtNonPowerOfTwo, evaluateImageType, getDataElementBuffer, getFormat, getHeight, getImageClass, getImageData, getImageDataTypeIntValue, getImageFormatType, getImageFormatTypeIntValue, getImageType, getNumberOfComponents, getRefImage, getUnitsPerPixel, getUsedByOffScreen, getWidth, handleFrequencyChange, is3ByteRGB, is4ByteRGBA, isByReference, isImageTypeSupported, isImageTypeSupported, isImageTypeSupported, isSubImageTypeEqual, isYUp, processParams, removeUser, sendMessage, setByReference, setEnforceNonPowerOfTwoSupport, setFormat, setImageClass, setImageClass, setImageFormatType, setLive, setNumberOfComponents, setRefImage, setUnitsPerPixel, setUsedByOffScreen, setYUp, updateMirrorObject, useBilinearFilter |
Methods inherited from class javax.media.j3d.NodeComponentRetained |
addAMirrorUser, addUser, clearLive, clone, copyMirrorUsers, createMirrorObject, decRefCnt, doSetLive, getDuplicateOnCloneTree, getInImmCtx, incRefCnt, initMirrorObject, notifyUsers, removeAMirrorUser, removeMirrorUsers, removeUser, set, setDuplicateOnCloneTree, setFrequencyChangeMask, setInImmCtx |
Methods inherited from class javax.media.j3d.SceneGraphObjectRetained |
clearLive, clearLive, compile, doSetLive, doSetLive, getSource, getVirtualUniverse, isInSetLive, isStatic, markAsLive, merge, mergeTransform, setCompiled, setLive, setLive, setSource, traverse |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ImageComponent3DRetained
ImageComponent3DRetained()
setDepth
void setDepth(int depth)
getDepth
int getDepth()
- Retrieves the depth of this 3D image component object.
- Returns:
- the format of this 3D image component object
set
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 indeximages
- 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.
set
void set(int index,
java.awt.image.RenderedImage image)
- Copies the specified BufferedImage to this 3D image component
object at the specified index.
- Parameters:
index
- the image indeximages
- 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.
void set(int index, NioImageBuffer nioImage) {
int width = nioImage.getWidth();
int height = nioImage.getHeight();
if (!byReference) {
throw new IllegalArgumentException(J3dI18N.getString("Need_New_Message_XXXXXImageComponent2D7"));
}
if (!yUp) {
throw new IllegalArgumentException(J3dI18N.getString("Need_New_Message_XXXXXImageComponent2D8"));
}
if (width != this.width) {
throw new IllegalArgumentException(J3dI18N.getString("ImageComponent3D2"));
}
if (height != this.height) {
throw new IllegalArgumentException(J3dI18N.getString("ImageComponent3D4"));
}
geomLock.getLock();
setImageClass(nioImage);
// This is a byRef image.
setRefImage(nioImage,0);
if(imageData == null) {
// Only do this once, on the first image
// Reset this flag to true, incase it was set to false due to
// the previous image type.
abgrSupported = true;
imageTypeIsSupported = isImageTypeSupported(nioImage);
// TODO : Need to handle null ....
imageData = createNioImageBufferDataObject(null);
}
else {
//if(getImageType() != evaluateImageType(image)) {
// TODO need to throw illegal state exception
//}
}
if (imageTypeIsSupported) {
// TODO : Need to handle this ..... case ....
// copySupportedImageToImageData(image, index, imageData);
} else {
// System.err.println("Image format is unsupported -- illogical case");
throw new AssertionError();
}
geomLock.unLock();
if (source.isLive()) {
// send a IMAGE_CHANGED message in order to
// notify all the users of the change
sendMessage(IMAGE_CHANGED, null);
}
}
getRenderedImage
java.awt.image.RenderedImage[] getRenderedImage()
- 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
getImage
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
getImage
java.awt.image.RenderedImage 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
updateData
void updateData(ImageComponent3D.Updater updater,
int index,
int x,
int y,
int width,
int height)
- Update data.
x and y specifies the x & y offset of the image data in
ImageComponent. It assumes that the origin is (0, 0).
setSubImage
void setSubImage(int index,
java.awt.image.RenderedImage image,
int width,
int height,
int srcX,
int srcY,
int dstX,
int dstY)
Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.