| java.lang.Object javax.media.jai.PlanarImage javax.media.jai.RemoteImage
RemoteImage | public class RemoteImage extends PlanarImage (Code) | | A sub-class of PlanarImage which represents an image on a
remote server machine.
The image may be constructed from a RenderedImage or from
an imaging chain in either the rendered or renderable mode. Network errors
(detected via throws of RemoteException s) are dealt with through retries;
when the limit of retries is exceeded, a null Raster may be returned.
The default number of retries is set to 5 and the default timeout is set
to 1 second.
Note that the registry of the server will be used. In particular if
an OperationRegistry was present in the
RenderingHints used to construct a RenderedOp
or RenderableOp it will not be serialized and transmitted
to the server.
Image layout attributes, once requested, are cached locally for speed.
|
Constructor Summary | |
public | RemoteImage(String serverName, RenderedImage source) Constructs a RemoteImage from a RenderedImage .
The RenderedImage source should ideally be a lightweight
reference to an image available locally on the server or over a
further network link.
Although it is legal to use any RenderedImage , one should be
aware that this will require copying of the image data via transmission
over a network link.
The name of the server must be supplied in the form appropriate to
the implementation. | public | RemoteImage(String serverName, RenderedOp source) Constructs a RemoteImage from a RenderedOp ,
i.e., an imaging directed acyclic graph (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.
The name of the server must be supplied in the form appropriate to
the implementation. | public | RemoteImage(String serverName, RenderableOp source, RenderContext renderContext) Constructs a RemoteImage from a RenderableOp
and RenderContext .
The entire RenderableOp DAG will be copied over to the server.
The name of the server must be supplied in the form appropriate to
the implementation. |
Method Summary | |
public WritableRaster | copyData(WritableRaster raster) Returns an arbitrary rectangular region of the RemoteImage
in a user-supplied WritableRaster . | protected void | finalize() Disposes of any resources allocated for remote operation. | public ColorModel | getColorModel() Returns the ColorModel associated with this image. | public Raster | getData() Returns the image as one large tile. | public Raster | getData(Rectangle rect) Returns an arbitrary rectangular region of the RemoteImage . | public int | getHeight() Returns the height of the RemoteImage in pixels. | public int | getMaxX() Returns the X coordinate of the column immediately to the right
of the rightmost column of the image. | public int | getMaxY() Returns the Y coordinate of the row immediately below the
bottom row of the image. | public int | getMinX() Returns the X coordinate of the leftmost column of the image. | public int | getMinY() Returns the Y coordinate of the uppermost row of the image. | public int | getNumRetries() Gets the number of retries. | public Object | getProperty(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: name - the name of the property to get, as a String. | public String[] | getPropertyNames() Returns a list of names recognized by getProperty. | public SampleModel | getSampleModel() Returns the SampleModel associated with this image. | public Vector | getSources() Returns a vector of RenderedImage s that are the sources of
image data for this RenderedImage . | public Raster | getTile(int x, int y) Returns tile (x, y). | public int | getTileGridXOffset() Returns the X offset of the tile grid. | public int | getTileGridYOffset() Returns the Y offset of the tile grid. | public int | getTileHeight() Returns the height of a tile in pixels. | public int | getTileWidth() Returns the width of a tile in pixels. | public int | getTimeout() Gets the amount of time between retries. | public int | getWidth() Returns the width of the RemoteImage in pixels. | protected void | requestField(int fieldIndex, int retries, int timeout) Cause an instance variable of the remote object to be cached
locally, retrying a given number of times with a given timeout.
Parameters: fieldIndex - the index of the desired field. Parameters: retries - the maximum number of retries; must be positive. Parameters: timeout - the timeout interval between retries, in milliseconds;must be positive. | protected void | requestField(int fieldIndex) Causes an instance variable of the remote object to be cached
locally, retrying with a default/user specified timeout.
Parameters: fieldIndex - the index of the desired field. | public void | setNumRetries(int numRetries) Set the number of retries.
Parameters: numRetries - The number of retries. | public void | setTimeout(int timeout) Set the amount of time between retries.
Parameters: timeout - The time interval between retries (milliseconds). |
DEFAULT_NUM_RETRIES | final static int DEFAULT_NUM_RETRIES(Code) | | The default number of retries.
|
DEFAULT_TIMEOUT | final static int DEFAULT_TIMEOUT(Code) | | The amount of time to wait between retries.
|
NUM_VARS | final static int NUM_VARS(Code) | | Index of local variable.
|
VAR_COLOR_MODEL | final static int VAR_COLOR_MODEL(Code) | | Index of local variable.
|
VAR_HEIGHT | final static int VAR_HEIGHT(Code) | | Index of local variable.
|
VAR_MIN_X | final static int VAR_MIN_X(Code) | | Index of local variable.
|
VAR_MIN_Y | final static int VAR_MIN_Y(Code) | | Index of local variable.
|
VAR_SAMPLE_MODEL | final static int VAR_SAMPLE_MODEL(Code) | | Index of local variable.
|
VAR_SOURCES | final static int VAR_SOURCES(Code) | | Index of local variable.
|
VAR_TILE_GRID_X_OFFSET | final static int VAR_TILE_GRID_X_OFFSET(Code) | | Index of local variable.
|
VAR_TILE_GRID_Y_OFFSET | final static int VAR_TILE_GRID_Y_OFFSET(Code) | | Index of local variable.
|
VAR_TILE_HEIGHT | final static int VAR_TILE_HEIGHT(Code) | | Index of local variable.
|
VAR_TILE_WIDTH | final static int VAR_TILE_WIDTH(Code) | | Index of local variable.
|
VAR_WIDTH | final static int VAR_WIDTH(Code) | | Index of local variable.
|
fieldValid | protected boolean[] fieldValid(Code) | | Valid bits for locally cached variables.
|
numRetries | protected int numRetries(Code) | | The number of retries.
|
propertyNames | protected String[] propertyNames(Code) | | Locally cached version of properties.
|
remoteImage | protected RMIImage remoteImage(Code) | | The RMIImage our data will come from.
|
timeout | protected int timeout(Code) | | The amount of time between retries (milliseconds).
|
RemoteImage | public RemoteImage(String serverName, RenderedImage source)(Code) | | Constructs a RemoteImage from a RenderedImage .
The RenderedImage source should ideally be a lightweight
reference to an image available locally on the server or over a
further network link.
Although it is legal to use any RenderedImage , one should be
aware that this will require copying of the image data via transmission
over a network link.
The name of the server must be supplied in the form appropriate to
the implementation. In the reference port of JAI, RMI is used to
implement remote imaging so that the server name must be supplied in
the format
host:port
where the port number is optional and may be supplied only if
the host name is supplied. If this parameter is null the default
is to search for the RMIImage service on the local host at the
default rmiregistry port (1099).
Parameters: serverName - The name of the server in the appropriate format. Parameters: source - A RenderedImage source which must not be null . throws: IllegalArgumentException - if source isnull . |
RemoteImage | public RemoteImage(String serverName, RenderedOp source)(Code) | | Constructs a RemoteImage from a RenderedOp ,
i.e., an imaging directed acyclic graph (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.
The name of the server must be supplied in the form appropriate to
the implementation. In the reference port of JAI, RMI is used to
implement remote imaging so that the server name must be supplied in
the format
host:port
where the port number is optional and may be supplied only if
the host name is supplied. If this parameter is null the default
is to search for the RMIImage service on the local host at the
default rmiregistry port (1099).
Note that the properties of the RemoteImage will be
those of the RenderedOp node and not of its rendering.
Parameters: serverName - The name of the server in the appropriate format. Parameters: source - A RenderedOp source which must not be null . throws: IllegalArgumentException - if source isnull . |
RemoteImage | public RemoteImage(String serverName, RenderableOp source, RenderContext renderContext)(Code) | | Constructs a RemoteImage from a RenderableOp
and RenderContext .
The entire RenderableOp DAG will be copied over to the server.
The name of the server must be supplied in the form appropriate to
the implementation. In the reference port of JAI, RMI is used to
implement remote imaging so that the server name must be supplied in
the format
host:port
where the port number is optional and may be supplied only if
the host name is supplied. If this parameter is null the default
is to search for the RMIImage service on the local host at the
default rmiregistry port (1099).
Note that the properties of the RemoteImage will be
those of the RenderableOp node and not of its rendering.
Parameters: serverName - The name of the server in the appropriate format. Parameters: source - A RenderableOp source which must not be null . Parameters: renderContext - The rendering context which may be null . throws: IllegalArgumentException - if source isnull . |
copyData | public WritableRaster copyData(WritableRaster raster)(Code) | | Returns an arbitrary rectangular region of the RemoteImage
in a user-supplied WritableRaster .
The rectangular region is the entire image if the argument is
null or the intersection of the argument bounds with the image
bounds if the region is non-null .
If the argument is non-null but has bounds which have an empty
intersection with the image bounds the return value will be null .
The return value may also be null if the argument is non-null but
is incompatible with the Raster returned from the remote image.
|
finalize | protected void finalize()(Code) | | Disposes of any resources allocated for remote operation.
|
getColorModel | public ColorModel getColorModel()(Code) | | Returns the ColorModel associated with this image.
|
getData | public Raster getData()(Code) | | Returns the image as one large tile.
|
getData | public Raster getData(Rectangle rect)(Code) | | Returns an arbitrary rectangular region of the RemoteImage .
The rect parameter may be
null , in which case the entire image data is
returned in the Raster .
If rect is non-null but does
not intersect the image bounds at all, an
IllegalArgumentException will be thrown.
Parameters: rect - The Rectangle of interest. |
getHeight | public int getHeight()(Code) | | Returns the height of the RemoteImage in pixels.
|
getMaxX | public int getMaxX()(Code) | | Returns the X coordinate of the column immediately to the right
of the rightmost column of the image.
|
getMaxY | public int getMaxY()(Code) | | Returns the Y coordinate of the row immediately below the
bottom row of the image.
|
getMinX | public int getMinX()(Code) | | Returns the X coordinate of the leftmost column of the image.
|
getMinY | public int getMinY()(Code) | | Returns the Y coordinate of the uppermost row of the image.
|
getNumRetries | public int getNumRetries()(Code) | | Gets the number of retries.
|
getProperty | public Object getProperty(String name)(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: name - the name of the property to get, as a String. a reference to the property Object , or the valuejava.awt.Image.UndefinedProperty. exception: IllegalArgumentException - if propertyName is null . |
getPropertyNames | public String[] getPropertyNames()(Code) | | Returns a list of names recognized by getProperty.
|
getSampleModel | public SampleModel getSampleModel()(Code) | | Returns the SampleModel associated with this image.
|
getSources | public Vector getSources()(Code) | | Returns a vector of RenderedImage s that are the sources of
image data for this RenderedImage . Note that this method
will often return null .
|
getTile | public Raster getTile(int x, int y)(Code) | | Returns tile (x, y). Note that x and y are indexes into the
tile array not pixel locations. The Raster that is returned
is a copy.
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 |
getTileGridXOffset | public int getTileGridXOffset()(Code) | | Returns the X offset of the tile grid.
|
getTileGridYOffset | public int getTileGridYOffset()(Code) | | Returns the Y offset of the tile grid.
|
getTileHeight | public int getTileHeight()(Code) | | Returns the height of a tile in pixels.
|
getTileWidth | public int getTileWidth()(Code) | | Returns the width of a tile in pixels.
|
getTimeout | public int getTimeout()(Code) | | Gets the amount of time between retries.
|
getWidth | public int getWidth()(Code) | | Returns the width of the RemoteImage in pixels.
|
requestField | protected void requestField(int fieldIndex, int retries, int timeout)(Code) | | Cause an instance variable of the remote object to be cached
locally, retrying a given number of times with a given timeout.
Parameters: fieldIndex - the index of the desired field. Parameters: retries - the maximum number of retries; must be positive. Parameters: timeout - the timeout interval between retries, in milliseconds;must be positive. ArrayIndexOutOfBoundsException if fieldIndexis negative or >= NUM_VARS. IllegalArgumentException if retries or timeoutis non-positive. |
requestField | protected void requestField(int fieldIndex)(Code) | | Causes an instance variable of the remote object to be cached
locally, retrying with a default/user specified timeout.
Parameters: fieldIndex - the index of the desired field. ArrayIndexOutOfBoundsException if fieldIndexis negative or >= NUM_VARS. |
setNumRetries | public void setNumRetries(int numRetries)(Code) | | Set the number of retries.
Parameters: numRetries - The number of retries. If this is non-positive thenumber of retries is not changed. |
setTimeout | public void setTimeout(int timeout)(Code) | | Set the amount of time between retries.
Parameters: timeout - The time interval between retries (milliseconds). Ifthis is non-positive the time interval is not changed. |
Methods inherited from javax.media.jai.PlanarImage | public static int XToTileX(int x, int tileGridXOffset, int tileWidth)(Code)(Java Doc) public int XToTileX(int x)(Code)(Java Doc) public static int YToTileY(int y, int tileGridYOffset, int tileHeight)(Code)(Java Doc) public int YToTileY(int y)(Code)(Java Doc) public void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public synchronized boolean addSink(Object sink)(Code)(Java Doc) protected void addSink(PlanarImage sink)(Code)(Java Doc) protected void addSource(Object source)(Code)(Java Doc) public synchronized void addTileComputationListener(TileComputationListener listener)(Code)(Java Doc) public void cancelTiles(TileRequest request, Point[] tileIndices)(Code)(Java Doc) public WritableRaster copyData()(Code)(Java Doc) public WritableRaster copyData(WritableRaster raster)(Code)(Java Doc) public void copyExtendedData(WritableRaster dest, BorderExtender extender)(Code)(Java Doc) public static ColorModel createColorModel(SampleModel sm)(Code)(Java Doc) public PlanarImage createSnapshot()(Code)(Java Doc) final protected WritableRaster createWritableRaster(SampleModel sampleModel, Point location)(Code)(Java Doc) public synchronized void dispose()(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public BufferedImage getAsBufferedImage(Rectangle rect, ColorModel cm)(Code)(Java Doc) public BufferedImage getAsBufferedImage()(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) public ColorModel getColorModel()(Code)(Java Doc) public Raster getData()(Code)(Java Doc) public Raster getData(Rectangle region)(Code)(Java Doc) public static ColorModel getDefaultColorModel(int dataType, int numBands)(Code)(Java Doc) public Raster getExtendedData(Rectangle region, BorderExtender extender)(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public Object getImageID()(Code)(Java Doc) public int getMaxTileX()(Code)(Java Doc) public int getMaxTileY()(Code)(Java Doc) public int getMaxX()(Code)(Java Doc) public int getMaxY()(Code)(Java Doc) public int getMinTileX()(Code)(Java Doc) public int getMinTileY()(Code)(Java Doc) public int getMinX()(Code)(Java Doc) public int getMinY()(Code)(Java Doc) public int getNumBands()(Code)(Java Doc) public int getNumSources()(Code)(Java Doc) public int getNumXTiles()(Code)(Java Doc) public int getNumYTiles()(Code)(Java Doc) protected Hashtable getProperties()(Code)(Java Doc) public Object getProperty(String name)(Code)(Java Doc) public Class getPropertyClass(String name)(Code)(Java Doc) public String[] getPropertyNames()(Code)(Java Doc) public String[] getPropertyNames(String prefix)(Code)(Java Doc) public SampleModel getSampleModel()(Code)(Java Doc) public Vector getSinks()(Code)(Java Doc) public PlanarImage getSource(int index)(Code)(Java Doc) public PlanarImage getSourceImage(int index)(Code)(Java Doc) public Object getSourceObject(int index)(Code)(Java Doc) public Vector getSources()(Code)(Java Doc) public void getSplits(IntegerSequence xSplits, IntegerSequence ySplits, Rectangle rect)(Code)(Java Doc) abstract public Raster getTile(int tileX, int tileY)(Code)(Java Doc) public TileComputationListener[] getTileComputationListeners()(Code)(Java Doc) public TileFactory getTileFactory()(Code)(Java Doc) public int getTileGridXOffset()(Code)(Java Doc) public int getTileGridYOffset()(Code)(Java Doc) public int getTileHeight()(Code)(Java Doc) public Point[] getTileIndices(Rectangle region)(Code)(Java Doc) public Rectangle getTileRect(int tileX, int tileY)(Code)(Java Doc) public int getTileWidth()(Code)(Java Doc) public Raster[] getTiles(Point[] tileIndices)(Code)(Java Doc) public Raster[] getTiles()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public boolean overlapsMultipleTiles(Rectangle rect)(Code)(Java Doc) public void prefetchTiles(Point[] tileIndices)(Code)(Java Doc) public TileRequest queueTiles(Point[] tileIndices)(Code)(Java Doc) public void removeProperty(String name)(Code)(Java Doc) public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public synchronized boolean removeSink(Object sink)(Code)(Java Doc) protected boolean removeSink(PlanarImage sink)(Code)(Java Doc) public void removeSinks()(Code)(Java Doc) protected boolean removeSource(Object source)(Code)(Java Doc) protected void removeSources()(Code)(Java Doc) public synchronized void removeTileComputationListener(TileComputationListener listener)(Code)(Java Doc) protected void setImageLayout(ImageLayout layout)(Code)(Java Doc) protected void setProperties(Hashtable properties)(Code)(Java Doc) public void setProperty(String name, Object value)(Code)(Java Doc) protected void setSource(Object source, int index)(Code)(Java Doc) protected void setSources(List sourceList)(Code)(Java Doc) public static int tileXToX(int tx, int tileGridXOffset, int tileWidth)(Code)(Java Doc) public int tileXToX(int tx)(Code)(Java Doc) public static int tileYToY(int ty, int tileGridYOffset, int tileHeight)(Code)(Java Doc) public int tileYToY(int ty)(Code)(Java Doc) public String toString()(Code)(Java Doc) public static PlanarImage wrapRenderedImage(RenderedImage image)(Code)(Java Doc)
|
|
|