/** * Retrieves the data access mode for this ImageComponent object. * * @return <code>true</code> if the data access mode for this * ImageComponent object is by-reference; * <code>false</code> if the data access mode is by-copying. * * @since Java 3D 1.2 */ public boolean isByReference() { return ((ImageComponentRetained)this.retained).isByReference(); }
void decTextureBinRefCount(TextureBin tb) { ImageComponentRetained image; setTextureBinRefCount(tb, getTextureBinRefCount(tb) - 1); // remove any modifiable images from RenderBin nodeComponentList for (int j = 0; j < numFaces; j++) { for (int i = 0; i < maxLevels; i++) { image = images[j][i]; if (image != null && (image.isByReference() || (image.source != null && image.source.getCapability( ImageComponent.ALLOW_IMAGE_WRITE)))) { tb.renderBin.removeNodeComponent(image); } } } }
void incTextureBinRefCount(TextureBin tb) { ImageComponentRetained image; setTextureBinRefCount(tb, getTextureBinRefCount(tb) + 1); // check to see if there is any modifiable images, // if yes, add those images to nodeComponentList in RenderBin // so that RenderBin can acquire a lock before rendering // to prevent updating of image data while rendering for (int j = 0; j < numFaces; j++) { for (int i = 0; i < maxLevels; i++) { image = images[j][i]; // it is possible that image.source == null because // the mipmap could have been created by the library, and // hence don't have source and therefore they are // guaranteed not modifiable if (image != null && (image.isByReference() || (image.source != null && image.source.getCapability( ImageComponent.ALLOW_IMAGE_WRITE)))) { tb.renderBin.addNodeComponent(image); } } } }
final void setImage(int level, int face, ImageComponent image) { initImage(level, face, image); Object arg[] = new Object[3]; arg[0] = new Integer(level); arg[1] = image; arg[2] = new Integer(face); sendMessage(IMAGE_CHANGED, arg); // If the user has set enable to true, then if the image is null // turn off texture enable if (userSpecifiedEnable) { enable = userSpecifiedEnable; if (image != null && level < maxLevels) { ImageComponentRetained img= (ImageComponentRetained)image.retained; if (img.isByReference()) { if (img.getRefImage(0) == null) { enable = false; } } else { if (img.getImageData(isUseAsRaster()).get() == null) { enable = false; } } if (!enable) sendMessage(ENABLE_CHANGED, Boolean.FALSE); } } }
final void setImage(int level, ImageComponent image) { initImage(level, image); Object arg[] = new Object[3]; arg[0] = new Integer(level); arg[1] = image; arg[2] = new Integer(0); sendMessage(IMAGE_CHANGED, arg); // If the user has set enable to true, then if the image is null // turn off texture enable if (userSpecifiedEnable) { enable = userSpecifiedEnable; if (image != null && level >= baseLevel && level <= maximumLevel) { ImageComponentRetained img= (ImageComponentRetained)image.retained; if (img.isByReference()) { if (img.getRefImage(0) == null) { enable = false; } } else { if (img.getImageData(isUseAsRaster()).get() == null) { enable = false; } } if (!enable) sendMessage(ENABLE_CHANGED, Boolean.FALSE); } } }
ImageComponentRetained img= (ImageComponentRetained)images[i].retained; if (img.isByReference()) { if (img.getRefImage(0) == null) { enable = false;
if (images[i] != null) { ImageComponentRetained img= (ImageComponentRetained)images[i].retained; if (img.isByReference()) { if (img.getRefImage(0) == null) { enable = false;
if (nc.isByReference()) { nc.geomLock.getLock(); for (j = 0; j <canvases.length; j++) { if (nc.isByReference()) { nc.geomLock.getLock(); for (j = 0; j <canvases.length; j++) {
/** * Enables or disables texture mapping for this * appearance component object and sends a * message notifying the interested structures of the change. * @param state true or false to enable or disable texture mapping */ final void setEnable(boolean state) { initEnable(state); if (state == enable) { // if enable flag is same as user specified one // this is only possible when enable is false // because one of the images is null and user specifies false return; } enable = state; for (int j = 0; j < numFaces && enable; j++) { for (int i = baseLevel; i <= maximumLevel && enable; i++) { if (images[j][i].isByReference()) { if (images[j][i].getRefImage(0) == null) { enable = false; } } else { if (images[j][i].getImageData(isUseAsRaster()).get() == null) { enable = false; } } } } sendMessage(ENABLE_CHANGED, (enable ? Boolean.TRUE: Boolean.FALSE)); }
if (imageData == null && !isByReference()) { return;
for (int j = 0; j < numFaces && enable; j++) { for (int i = baseLevel; i <= maximumLevel && enable; i++){ if (images[j][i].isByReference()) { if (images[j][i].getRefImage(0) == null) { enable = false;