/** * Sets the depth image used to copy pixels to/from a Canvas3D. * This is used when the type is RASTER_DEPTH or RASTER_COLOR_DEPTH. * @param depthImage the DepthComponent object containing the * depth (z-buffer) data */ final void setDepthComponent(DepthComponent depthComponent) { geomLock.getLock(); if (this.source.isLive()) { if (this.depthComponent != null) { this.depthComponent.clearLive(refCount); } if (depthComponent != null) { ((DepthComponentRetained)depthComponent.retained).setLive(inBackgroundGroup, refCount); } } if (depthComponent == null) { this.depthComponent = null; } else { this.depthComponent = (DepthComponentRetained)depthComponent.retained; } geomLock.unLock(); }
@Override void clearLive(int refCount) { super.clearLive(refCount); if (texture != null) texture.clearLive(refCount); if (depthComponent != null) depthComponent.clearLive(refCount); } /*
/** * Retrieves the height of this depth component object. * @return the height of the array of depth values * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public int getHeight() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_SIZE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("DepthComponent0")); return ((DepthComponentRetained)this.retained).getHeight(); }
/** * Retrieves the width of this depth component object. * @return the width of the array of depth values * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public int getWidth() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_SIZE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("DepthComponent0")); return ((DepthComponentRetained)this.retained).getWidth(); }
@Override void setLive(boolean inBackgroundGroup, int refCount) { super.doSetLive(inBackgroundGroup, refCount); if (texture != null) { texture.setLive(inBackgroundGroup, refCount); } if (depthComponent != null) { depthComponent.setLive(inBackgroundGroup, refCount); } isEditable = source.getCapability(Raster.ALLOW_OFFSET_WRITE) || source.getCapability(Raster.ALLOW_POSITION_WRITE) || ((type & Raster.RASTER_COLOR) != 0 && source.getCapability(Raster.ALLOW_IMAGE_WRITE)) || ((type & Raster.RASTER_DEPTH) != 0 && source.getCapability( Raster.ALLOW_DEPTH_COMPONENT_WRITE)) || source.getCapability( Raster.ALLOW_SIZE_WRITE); super.markAsLive(); }