| com.sun.media.jai.rmi.RMIImage
RMIImage | public interface RMIImage 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 setSource() 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 RMIImage, do the following:
RMIImage 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
RMIImageImpl 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 See Also: RemoteImage since: EA3 |
Method Summary | |
RasterProxy | copyData(Long id, Rectangle bounds) Returns the same result as getData(Rectangle) would for the
same rectangular region. | void | dispose(Long id) Disposes of any resouces allocated to the client object with
the specified ID. | ColorModelProxy | getColorModel(Long id) Returns the ColorModel associated with this image. | RasterProxy | getData(Long id) Returns the entire image as a single Raster. | RasterProxy | 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 RMIImage. | 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 RMIImage. | int | getMinY(Long id) Returns the minimum Y coordinate of the RMIImage. | int | getNumXTiles(Long id) Returns the number of tiles across the image. | int | getNumYTiles(Long id) Returns the number of tiles down the image. | 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). | Long | getRemoteID() Returns the identifier of the remote image. | SampleModelProxy | getSampleModel(Long id) Returns the SampleModel associated with this image. | Vector | getSources(Long id) Returns a vector of RenderedImages that are the sources of
image data for this RMIImage. | RasterProxy | 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 RMIImage. | void | setSource(Long id, RenderedImage source) Sets the source of the image on the server side. | void | setSource(Long id, RenderedOp source) Sets the source to a RenderedOp (i.e., an imaging DAG). | void | setSource(Long id, RenderableOp source, RenderContextProxy renderContextProxy) Sets the source to a RenderableOp defined by a renderable imaging
DAG and a rendering context. |
RMI_IMAGE_SERVER_NAME | final public static String RMI_IMAGE_SERVER_NAME(Code) | | The name to which the remote image server should be bound.
|
dispose | void dispose(Long id) throws RemoteException(Code) | | Disposes of any resouces allocated to the client object with
the specified ID.
|
getData | RasterProxy 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 RasterProxy containing a copy of the desired data. |
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.
|
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. |
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.
|
getSources | Vector getSources(Long id) throws RemoteException(Code) | | Returns a vector of RenderedImages that are the sources of
image data for this RMIImage. Note that this method
will often return an empty vector.
|
getTile | RasterProxy 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.
|
setSource | void setSource(Long id, RenderedImage source) throws RemoteException(Code) | | Sets the source of the image on the server side. This source
should ideally be a lightweight reference to an image available
locally on the server or over a further network link (for
example, an IIPOpImage that contains a URL but not actual image
data).
Although it is legal to use any RenderedImage, one should be
aware that a deep copy might be made and transmitted to the server.
Parameters: id - An ID for the source which must be unique across all clients. Parameters: source - a RenderedImage source. |
setSource | void setSource(Long id, RenderedOp source) throws RemoteException(Code) | | Sets the source to a RenderedOp (i.e., an imaging DAG).
This DAG will be copied over to the server where it will be
transformed into an OpImage chain using the server's local
OperationRegistry and available RenderedImageFactory objects.
Parameters: id - An ID for the source which must be unique across all clients. Parameters: source - a RenderedOp source. |
setSource | void setSource(Long id, RenderableOp source, RenderContextProxy renderContextProxy) throws RemoteException(Code) | | Sets the source to a RenderableOp defined by a renderable imaging
DAG and a rendering context. The entire RenderableImage
DAG will be copied over to the server.
|
|
|