|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.PlanarImage | +--javax.media.jai.RemoteImage
javax.media.jai.remote.RemoteJAI
.
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.
Field Summary | |
protected boolean[] |
fieldValid
Deprecated. Valid bits for locally cached variables. |
protected int |
numRetries
Deprecated. The number of retries. |
protected String[] |
propertyNames
Deprecated. Locally cached version of properties. |
protected com.sun.media.jai.rmi.RMIImage |
remoteImage
Deprecated. The RMIImage our data will come from. |
protected int |
timeout
Deprecated. The amount of time between retries (milliseconds). |
Fields inherited from class javax.media.jai.PlanarImage |
colorModel,
eventManager,
height,
minX,
minY,
properties,
sampleModel,
tileGridXOffset,
tileGridYOffset,
tileHeight,
tileWidth,
width |
Constructor Summary | |
RemoteImage(String serverName,
RenderableOp source,
RenderContext renderContext)
Deprecated. Constructs a RemoteImage from a RenderableOp
and RenderContext . |
|
RemoteImage(String serverName,
RenderedImage source)
Deprecated. Constructs a RemoteImage from a RenderedImage . |
|
RemoteImage(String serverName,
RenderedOp source)
Deprecated. Constructs a RemoteImage from a RenderedOp ,
i.e., an imaging directed acyclic graph (DAG). |
Method Summary | |
WritableRaster |
copyData(WritableRaster raster)
Deprecated. Returns an arbitrary rectangular region of the RemoteImage
in a user-supplied WritableRaster . |
protected void |
finalize()
Deprecated. Disposes of any resources allocated for remote operation. |
ColorModel |
getColorModel()
Deprecated. Returns the ColorModel associated with this image. |
Raster |
getData()
Deprecated. Returns the image as one large tile. |
Raster |
getData(Rectangle rect)
Deprecated. Returns an arbitrary rectangular region of the RemoteImage . |
int |
getHeight()
Deprecated. Returns the height of the RemoteImage in pixels. |
int |
getMaxX()
Deprecated. Returns the X coordinate of the column immediately to the right of the rightmost column of the image. |
int |
getMaxY()
Deprecated. Returns the Y coordinate of the row immediately below the bottom row of the image. |
int |
getMinX()
Deprecated. Returns the X coordinate of the leftmost column of the image. |
int |
getMinY()
Deprecated. Returns the Y coordinate of the uppermost row of the image. |
int |
getNumRetries()
Deprecated. Gets the number of retries. |
Object |
getProperty(String name)
Deprecated. Gets a property from the property set of this image. |
String[] |
getPropertyNames()
Deprecated. Returns a list of names recognized by getProperty. |
SampleModel |
getSampleModel()
Deprecated. Returns the SampleModel associated with this image. |
Vector |
getSources()
Deprecated. Returns a vector of RenderedImage s that are the sources of
image data for this RenderedImage . |
Raster |
getTile(int x,
int y)
Deprecated. Returns tile (x, y). |
int |
getTileGridXOffset()
Deprecated. Returns the X offset of the tile grid. |
int |
getTileGridYOffset()
Deprecated. Returns the Y offset of the tile grid. |
int |
getTileHeight()
Deprecated. Returns the height of a tile in pixels. |
int |
getTileWidth()
Deprecated. Returns the width of a tile in pixels. |
int |
getTimeout()
Deprecated. Gets the amount of time between retries. |
int |
getWidth()
Deprecated. Returns the width of the RemoteImage in pixels. |
protected void |
requestField(int fieldIndex)
Deprecated. Causes an instance variable of the remote object to be cached locally, retrying with a default/user specified timeout. |
protected void |
requestField(int fieldIndex,
int retries,
int timeout)
Deprecated. Cause an instance variable of the remote object to be cached locally, retrying a given number of times with a given timeout. |
void |
setNumRetries(int numRetries)
Deprecated. Set the number of retries. |
void |
setTimeout(int timeout)
Deprecated. Set the amount of time between retries. |
Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected com.sun.media.jai.rmi.RMIImage remoteImage
protected boolean[] fieldValid
protected String[] propertyNames
protected int timeout
protected int numRetries
Constructor Detail |
public RemoteImage(String serverName, RenderedImage source)
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:portwhere 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).serverName
- The name of the server in the appropriate format.source
- A RenderedImage
source which must not be null
.source
is
null
.public RemoteImage(String serverName, RenderedOp source)
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:portwhere 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.
serverName
- The name of the server in the appropriate format.source
- A RenderedOp
source which must not be null
.source
is
null
.public RemoteImage(String serverName, RenderableOp source, RenderContext renderContext)
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:portwhere 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.
serverName
- The name of the server in the appropriate format.source
- A RenderableOp
source which must not be null
.renderContext
- The rendering context which may be null
.source
is
null
.Method Detail |
protected void finalize()
Throwable
- if an error occurs in the
garbage collector.public void setTimeout(int timeout)
timeout
- The time interval between retries (milliseconds). If
this is non-positive the time interval is not changed.public int getTimeout()
public void setNumRetries(int numRetries)
numRetries
- The number of retries. If this is non-positive the
number of retries is not changed.public int getNumRetries()
protected void requestField(int fieldIndex, int retries, int timeout)
fieldIndex
- the index of the desired field.retries
- the maximum number of retries; must be positive.timeout
- the timeout interval between retries, in milliseconds;
must be positive.ArrayIndexOutOfBoundsException
- if fieldIndex
is negative or >= NUM_VARS.IllegalArgumentException
- if retries or timeout
is non-positive.protected void requestField(int fieldIndex)
fieldIndex
- the index of the desired field.ArrayIndexOutOfBoundsException
- if fieldIndex
is negative or >= NUM_VARS.public int getMinX()
public int getMaxX()
public int getMinY()
public int getMaxY()
public int getWidth()
RemoteImage
in pixels.public int getHeight()
RemoteImage
in pixels.public int getTileWidth()
public int getTileHeight()
public int getTileGridXOffset()
public int getTileGridYOffset()
public SampleModel getSampleModel()
SampleModel
associated with this image.public ColorModel getColorModel()
ColorModel
associated with this image.public Vector getSources()
RenderedImage
s that are the sources of
image data for this RenderedImage
. Note that this method
will often return null
.public Object getProperty(String name)
name
- the name of the property to get, as a String.Object
, or the value
java.awt.Image.UndefinedProperty.propertyName
is null
.public String[] getPropertyNames()
String
s containing valid
property names or null
.public Raster getTile(int x, int y)
Raster
that is returned
is a copy.x
- the X index of the requested tile in the tile arrayy
- the Y index of the requested tile in the tile arraypublic Raster getData()
Raster
containing the entire image data.Raster
.public Raster getData(Rectangle rect)
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.
rect
- The Rectangle
of interest.public WritableRaster copyData(WritableRaster raster)
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.raster
- A WritableRaster
to hold the copied
pixel data of this image.WritableRaster
,
or to a new WritableRaster
if the supplied
one was null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |