| com.sun.media.jai.rmi.ImageServer
All known Subclasses: com.sun.media.jai.rmi.JAIRMIImageServer,
ImageServer | public interface ImageServer extends Remote(Code) | | An interface for server-side imaging. This interface attempts to
mimic the RenderedImage interface as much as possible. However, there
are several unavoidable differences:
- Additional setRenderedSource() and setRenderableSource methods
are provided to inform the server as to the source of image data for
this image. Sources may be set
either from a RenderedImage that is copied over to the server, or
from a graph of RenderedOp objects indicating an abstract
imaging chain to be instantiated using the server's
OperationRegistry.
- All methods throw RemoteException. This is a requirement of
any Remote interface.
- The getTile() method does not return a reference to a `live'
tile; instead it returns a client-side copy of the server image's
tile. The difference is moot since the server image is immutable.
To instantiate a ImageServer, do the following:
ImageServer im;
im = java.rmi.Naming.lookup("//host:1099/javax.media.jai.RemoteImageServer");
The hostname and port will of course depend on the local setup.
The host must be running an rmiregistry process and have a
RemoteImageServer listening at the desired port.
This call will result in the creation of a server-side
JAIRMIImageServer object and a client-side stub object.
The client stub serializes its method arguments and transfers
them to the server over a socket; the server serializes it return
values and returns them in the same manner.
This process implies that all arguments and return values must
be serializable. In the case of a RenderedImage source,
serializability is not guaranteed and must be considered on a
class-by-class basis. For RenderedOps, which are basically
simple nodes connected by ParameterBlocks, serializability will be
determined by the serializabiility of the ultimate
(non-RenderedOp) sources of the DAG and the serializability
of any ad-hoc Object parameters held in the ParameterBlocks.
The return values of the getData(), copyData(), and getTile()
methods are various kinds of Rasters; at present, Java2D does not
define serialization on Rasters. We will either need to add this
feature to Java2D or else coerce the server-side Rasters into a
serializable subclass form. In any case, we will want to
implement lossless (and possibly lossy) compression as part of
the serialization process wherever possible.
See Also: java.rmi.Remote See Also: java.rmi.RemoteException See Also: java.awt.image.RenderedImage |
Method Summary | |
SerializableState | copyData(Long id, Rectangle bounds) Returns the same result as getData(Rectangle) would for the
same rectangular region. | RenderedImage | createDefaultRendering(Long id) Returnd a RenderedImage instance of this image with a default
width and height in pixels. | void | createRenderableOp(Long id, String opName, ParameterBlock pb) Creates a RenderableOp on the server side with a parameter block
empty of sources. | void | createRenderedOp(Long id, String opName, ParameterBlock pb, SerializableState hints) Creates a RenderedOp on the server side with a parameter block
empty of sources. | RenderedImage | createRendering(Long id, SerializableState renderContextState) Creates a RenderedImage that represented a rendering of this image
using a given RenderContext. | RenderedImage | createScaledRendering(Long id, int w, int h, SerializableState hintsState) Creates a RenderedImage instance of this image with width w, and
height h in pixels. | void | dispose(Long id) Disposes of any resouces allocated to the client object with
the specified ID. | SerializableState | getBounds2D(Long nodeId, String operationName) | SerializableState | getColorModel(Long id) Returns the ColorModel associated with this image. | byte[] | getCompressedTile(Long id, int x, int y) Compresses tile (x, y) and returns the compressed tile's contents
as a byte array. | SerializableState | getData(Long id) Returns the entire image as a single Raster. | SerializableState | getData(Long id, Rectangle bounds) Returns an arbitrary rectangular region of the RenderedImage
in a Raster. | int | getHeight(Long id) Returns the height of the image on the ImageServer. | SerializableState | getInvalidRegion(Long id, ParameterBlock oldParamBlock, SerializableState oldHints, ParameterBlock newParamBlock, SerializableState newHints) Calculates the region over which two distinct renderings
of an operation may be expected to differ.
The class of the returned object will vary as a function of
the nature of the operation. | int | getMinTileX(Long id) Returns the index of the minimum tile in the X direction of the image. | int | getMinTileY(Long id) Returns the index of the minimum tile in the Y direction of the image. | int | getMinX(Long id) Returns the minimum X coordinate of the image on the ImageServer. | int | getMinY(Long id) Returns the minimum Y coordinate of the image on the ImageServer. | RenderedOp | getNode(Long id) Retrieve a node from the hashtable. | int | getNumXTiles(Long id) Returns the number of tiles across the image. | int | getNumYTiles(Long id) Returns the number of tiles down the image. | List | getOperationDescriptors() Gets the OperationDescriptor s of the operations
supported on this server. | Object | getProperty(Long id, String name) Gets a property from the property set of this image.
If the property name is not recognized, java.awt.Image.UndefinedProperty
will be returned.
Parameters: id - An ID for the source which must be unique across all clients. Parameters: name - the name of the property to get, as a String. | String[] | getPropertyNames(Long id) Returns a list of names recognized by getProperty(String). | String[] | getPropertyNames(String opName) Returns a list of names recognized by getProperty(). | Long | getRemoteID() Returns the identifier of the remote image. | float | getRenderableHeight(Long id) Gets the height (in user coordinate space) of the
RenderableImage stored against the given ID. | float | getRenderableMinX(Long id) Gets the minimum X coordinate of the rendering-independent image
stored against the given ID. | float | getRenderableMinY(Long id) Gets the minimum Y coordinate of the rendering-independent image
stored against the given ID. | float | getRenderableWidth(Long id) Gets the width (in user coordinate space) of the
RenderableImage stored against the given ID. | boolean | getRendering(Long id) | Long | getRendering(Long id, SerializableState rcs) Calls for rendering of a RenderableOp with the given SerializableState
which should be a RenderContextState. | SerializableState | getSampleModel(Long id) Returns the SampleModel associated with this image. | NegotiableCapabilitySet | getServerCapabilities() Returns the server's capabilities as a
NegotiableCapabilitySet . | String[] | getServerSupportedOperationNames() | SerializableState | getTile(Long id, int x, int y) Returns tile (x, y). | int | getTileGridXOffset(Long id) Returns the X offset of the tile grid relative to the origin. | int | getTileGridYOffset(Long id) Returns the Y offset of the tile grid relative to the origin. | int | getTileHeight(Long id) Returns the height of a tile in pixels. | int | getTileWidth(Long id) Returns the width of a tile in pixels. | int | getWidth(Long id) Returns the width of the image on the ImageServer. | Long | handleEvent(Long renderedOpID, String propName, Object oldValue, Object newValue) A method that handles a change in some critical parameter. | Long | handleEvent(Long renderedOpID, int srcIndex, SerializableState srcInvalidRegion, Object oldRendering) A method that handles a change in one of it's source's rendering,
i.e. | void | incrementRefCount(Long id) Increments the reference count for this id, i.e. | public boolean | isDynamic(String opName) | public boolean | isDynamic(Long id) | Rectangle | mapDestRect(Long id, Rectangle destRect, int sourceIndex) Returns a conservative estimate of the region of a specified
source that is required in order to compute the pixels of a
given destination rectangle. | SerializableState | mapRenderContext(int id, Long nodeId, String operationName, SerializableState rcs) | Rectangle | mapSourceRect(Long id, Rectangle sourceRect, int sourceIndex) Returns a conservative estimate of the destination region that
can potentially be affected by the pixels of a rectangle of a
given source. | void | setRenderableRMIServerProxyAsSource(Long id, Long sourceId, String serverName, String opName, int index) Sets the source of the operation refered to by the supplied
id to the RenderableRMIServerProxy
that exists on the supplied serverName under the
supplied sourceId . | void | setRenderableSource(Long id, Long sourceId, int index) | void | setRenderableSource(Long id, Long sourceId, String serverName, String opName, int index) | void | setRenderableSource(Long id, RenderableOp source, int index) Sets the source of the image as a RenderableOp on the server side. | void | setRenderableSource(Long id, SerializableRenderableImage source, int index) Sets the source of the image as a RenderableImage on the server side. | void | setRenderableSource(Long id, RenderedImage source, int index) | void | setRenderedSource(Long id, RenderedImage source, int index) | void | setRenderedSource(Long id, RenderedOp source, int index) | void | setRenderedSource(Long id, Long sourceId, int index) | void | setRenderedSource(Long id, Long sourceId, String serverName, String opName, int index) | void | setServerNegotiatedValues(Long id, NegotiableCapabilitySet negotiatedValues) Informs the server of the negotiated values that are the result of
a successful negotiation. |
createDefaultRendering | RenderedImage createDefaultRendering(Long id) throws RemoteException(Code) | | Returnd a RenderedImage instance of this image with a default
width and height in pixels. The RenderContext is built
automatically with an appropriate usr2dev transform and an area
of interest of the full image. The rendering hints are
empty. createDefaultRendering may make use of a stored
rendering for speed.
a RenderedImage containing the rendered data. |
createRenderableOp | void createRenderableOp(Long id, String opName, ParameterBlock pb) throws RemoteException(Code) | | Creates a RenderableOp on the server side with a parameter block
empty of sources. The sources are set by separate calls depending
upon the type and serializabilty of the source.
|
createRenderedOp | void createRenderedOp(Long id, String opName, ParameterBlock pb, SerializableState hints) throws RemoteException(Code) | | Creates a RenderedOp on the server side with a parameter block
empty of sources. The sources are set by separate calls depending
upon the type and serializabilty of the source.
|
createRendering | RenderedImage createRendering(Long id, SerializableState renderContextState) throws RemoteException(Code) | | Creates a RenderedImage that represented a rendering of this image
using a given RenderContext. This is the most general way to obtain a
rendering of a RenderableImage.
The created RenderedImage may have a property identified
by the String HINTS_OBSERVED to indicate which RenderingHints
(from the RenderContext) were used to create the image.
In addition any RenderedImages
that are obtained via the getSources() method on the created
RenderedImage may have such a property.
Parameters: renderContext - the RenderContext to use to produce the rendering. a RenderedImage containing the rendered data. |
createScaledRendering | RenderedImage createScaledRendering(Long id, int w, int h, SerializableState hintsState) throws RemoteException(Code) | | Creates a RenderedImage instance of this image with width w, and
height h in pixels. The RenderContext is built automatically
with an appropriate usr2dev transform and an area of interest
of the full image. All the rendering hints come from hints
passed in.
If w == 0, it will be taken to equal
Math.round(h*(getWidth()/getHeight())).
Similarly, if h == 0, it will be taken to equal
Math.round(w*(getHeight()/getWidth())). One of
w or h must be non-zero or else an IllegalArgumentException
will be thrown.
The created RenderedImage may have a property identified
by the String HINTS_OBSERVED to indicate which RenderingHints
were used to create the image. In addition any RenderedImages
that are obtained via the getSources() method on the created
RenderedImage may have such a property.
Parameters: w - the width of rendered image in pixels, or 0. Parameters: h - the height of rendered image in pixels, or 0. Parameters: hints - a RenderingHints object containg hints. a RenderedImage containing the rendered data. |
dispose | void dispose(Long id) throws RemoteException(Code) | | Disposes of any resouces allocated to the client object with
the specified ID.
|
getCompressedTile | byte[] getCompressedTile(Long id, int x, int y) throws RemoteException(Code) | | Compresses tile (x, y) and returns the compressed tile's contents
as a byte array. Note that x and y are indices into the
tile array, not pixel locations.
Parameters: id - An ID for the source which must be unique across all clients. Parameters: x - the x index of the requested tile in the tile array Parameters: y - the y index of the requested tile in the tile array a byte array containing the compressed tile contents. |
getData | SerializableState getData(Long id, Rectangle bounds) throws RemoteException(Code) | | Returns an arbitrary rectangular region of the RenderedImage
in a Raster. The rectangle of interest will be clipped against
the image bounds.
Parameters: id - An ID for the source which must be unique across all clients. Parameters: bounds - the region of the RenderedImage to be returned. a SerializableState containing a copy of the desired data. |
getInvalidRegion | SerializableState getInvalidRegion(Long id, ParameterBlock oldParamBlock, SerializableState oldHints, ParameterBlock newParamBlock, SerializableState newHints) throws RemoteException(Code) | | Calculates the region over which two distinct renderings
of an operation may be expected to differ.
The class of the returned object will vary as a function of
the nature of the operation. For rendered and renderable two-
dimensional images this should be an instance of a class which
implements java.awt.Shape .
The region over which the data of two renderings of thisoperation may be expected to be invalid or null if there is no common region of validity. |
getMinTileX | int getMinTileX(Long id) throws RemoteException(Code) | | Returns the index of the minimum tile in the X direction of the image.
|
getMinTileY | int getMinTileY(Long id) throws RemoteException(Code) | | Returns the index of the minimum tile in the Y direction of the image.
|
getOperationDescriptors | List getOperationDescriptors() throws RemoteException(Code) | | Gets the OperationDescriptor s of the operations
supported on this server.
|
getProperty | Object getProperty(Long id, String name) throws RemoteException(Code) | | Gets a property from the property set of this image.
If the property name is not recognized, java.awt.Image.UndefinedProperty
will be returned.
Parameters: id - An ID for the source which must be unique across all clients. Parameters: name - the name of the property to get, as a String. a reference to the property Object, or the valuejava.awt.Image.UndefinedProperty. |
getPropertyNames | String[] getPropertyNames(Long id) throws RemoteException(Code) | | Returns a list of names recognized by getProperty(String).
an array of Strings representing proeprty names. |
getPropertyNames | String[] getPropertyNames(String opName) throws RemoteException(Code) | | Returns a list of names recognized by getProperty().
an array of Strings representing property names. |
getRemoteID | Long getRemoteID() throws RemoteException(Code) | | Returns the identifier of the remote image. This method should be
called to return an identifier before any other methods are invoked.
The same ID must be used in all subsequent references to the remote
image.
|
getRenderableHeight | float getRenderableHeight(Long id) throws RemoteException(Code) | | Gets the height (in user coordinate space) of the
RenderableImage stored against the given ID.
the height of the renderable image in user coordinates. |
getRenderableMinX | float getRenderableMinX(Long id) throws RemoteException(Code) | | Gets the minimum X coordinate of the rendering-independent image
stored against the given ID.
the minimum X coordinate of the rendering-independent imagedata. |
getRenderableMinY | float getRenderableMinY(Long id) throws RemoteException(Code) | | Gets the minimum Y coordinate of the rendering-independent image
stored against the given ID.
the minimum X coordinate of the rendering-independent imagedata. |
getRenderableWidth | float getRenderableWidth(Long id) throws RemoteException(Code) | | Gets the width (in user coordinate space) of the
RenderableImage stored against the given ID.
the width of the renderable image in user coordinates. |
getRendering | boolean getRendering(Long id) throws RemoteException(Code) | | Calls for Rendering of the Op and returns true if the RenderedOp
could be rendered else false
|
getServerCapabilities | NegotiableCapabilitySet getServerCapabilities() throws RemoteException(Code) | | Returns the server's capabilities as a
NegotiableCapabilitySet . Currently the only capabilities
that are returned are those of TileCodecs.
|
getServerSupportedOperationNames | String[] getServerSupportedOperationNames() throws RemoteException(Code) | | Gets the operation names supported on the Server
|
getTile | SerializableState getTile(Long id, int x, int y) throws RemoteException(Code) | | Returns tile (x, y). Note that x and y are indices into the
tile array, not pixel locations. Unlike in the true RenderedImage
interface, the Raster that is returned should be considered a copy.
Parameters: id - An ID for the source which must be unique across all clients. Parameters: x - the x index of the requested tile in the tile array Parameters: y - the y index of the requested tile in the tile array a copy of the tile as a Raster. |
getTileGridXOffset | int getTileGridXOffset(Long id) throws RemoteException(Code) | | Returns the X offset of the tile grid relative to the origin.
|
getTileGridYOffset | int getTileGridYOffset(Long id) throws RemoteException(Code) | | Returns the Y offset of the tile grid relative to the origin.
|
handleEvent | Long handleEvent(Long renderedOpID, int srcIndex, SerializableState srcInvalidRegion, Object oldRendering) throws RemoteException(Code) | | A method that handles a change in one of it's source's rendering,
i.e. a change that would be signalled by RenderingChangeEvent.
|
incrementRefCount | void incrementRefCount(Long id) throws RemoteException(Code) | | Increments the reference count for this id, i.e. increments the
number of RMIServerProxy objects that currently reference this id.
|
isDynamic | public boolean isDynamic(String opName) throws RemoteException(Code) | | Returns true if successive renderings with the same
arguments may produce different results for this opName
false indicating that the rendering is static. |
isDynamic | public boolean isDynamic(Long id) throws RemoteException(Code) | | Returns true if successive renderings with the same
arguments may produce different results for this opName
false indicating that the rendering is static. |
mapDestRect | Rectangle mapDestRect(Long id, Rectangle destRect, int sourceIndex) throws RemoteException(Code) | | Returns a conservative estimate of the region of a specified
source that is required in order to compute the pixels of a
given destination rectangle.
Parameters: id - A Long identifying the node for whomthe source region needs to be calculated . Parameters: destRect - The Rectangle in destination coordinates. Parameters: sourceIndex - The index of the source image. A Rectangle indicating the required source region. |
mapSourceRect | Rectangle mapSourceRect(Long id, Rectangle sourceRect, int sourceIndex) throws RemoteException(Code) | | Returns a conservative estimate of the destination region that
can potentially be affected by the pixels of a rectangle of a
given source.
Parameters: id - A Long identifying the node for whomthe destination region needs to be calculated . Parameters: sourceRect - The Rectangle in source coordinates. Parameters: sourceIndex - The index of the source image. A Rectangle indicating the potentiallyaffected destination region, or null ifthe region is unknown. |
setRenderableRMIServerProxyAsSource | void setRenderableRMIServerProxyAsSource(Long id, Long sourceId, String serverName, String opName, int index) throws RemoteException(Code) | | Sets the source of the operation refered to by the supplied
id to the RenderableRMIServerProxy
that exists on the supplied serverName under the
supplied sourceId .
|
setRenderableSource | void setRenderableSource(Long id, Long sourceId, int index) throws RemoteException(Code) | | Sets the source of the image which is on the same
server
|
setRenderableSource | void setRenderableSource(Long id, RenderedImage source, int index) throws RemoteException(Code) | | Sets the source of the image as a RenderedImage on the server side
|
setRenderedSource | void setRenderedSource(Long id, RenderedImage source, int index) throws RemoteException(Code) | | Sets the source of the image as a RenderedImage on the server side
|
setRenderedSource | void setRenderedSource(Long id, Long sourceId, int index) throws RemoteException(Code) | | Sets the source of the image which is on the same
server
|
setServerNegotiatedValues | void setServerNegotiatedValues(Long id, NegotiableCapabilitySet negotiatedValues) throws RemoteException(Code) | | Informs the server of the negotiated values that are the result of
a successful negotiation.
Parameters: id - An ID for the node which must be unique across all clients. Parameters: negotiatedValues - The result of the negotiation. |
|
|