|
|||||||||
| 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.RenderedOp
A node in a rendered imaging chain. A RenderedOp
stores an operation name (as a String), a
ParameterBlock containing sources and miscellaneous
parameters, and a RenderingHints containing rendering
hints. A set of nodes may be joined together via the source
Vectors within their ParameterBlocks to
form a directed acyclic graph (DAG). The topology i.e.,
connectivity of the graph may be altered by changing the
ParameterBlocks; the operation name, parameters, and
rendering hints may also be changed.
Such chains are useful as arguments to a
RemoteImage; they convey the structure of an imaging
chain in a compact representation and at a suitably high level of
abstraction to allow the server some leeway in materializing the
results.
When any RenderedImage method is called on a
RenderedOp, (any of getWidth(),
getHeight(), getMinX(),
getMinY(), getNumXTiles(),
getNumYTiles(), getMinTileX(),
getMinTileY(), getTileWidth(),
getTileHeight(), getTileGridXOffset(),
getTileGridYOffset(),getTile(),
getData(), copyData(),
getColorModel(), getSampleModel(),
or getProperty() with a synthesized property name),
the RenderedOp is implicitly rendered and becomes
"frozen." Its operation name, ParameterBlock,
and rendering hints may no longer be changed.
Furthermore, when some of the methods from PlanarImage
are called, such as "get" and "set" methods on its source objects,
the RenderedOp is implictly rendered and becomes "frozen."
Serialization of a "frozen" node has the effect of "thawing" it;
in other words, the instance variable holding the reference to the
rendering of the node is transient and is not placed into the
serialized byte stream. This allows working chains to be passed to
a remote server using remote method invocation (RMI).
Note that RenderedOp nodes used to instantiate
operations which have a corresponding OperationDescriptor
the isImmediate() method of which returns
true are rendered upon deserialization.
A node may be rendered explicitly by means of the
createInstance() method. This method returns a
PlanarImage rendering without freezing the node. This
allows a chain to be manipulated dynamically and rendered multiple
times.
The translation between RenderedOp chains and
OpImage chains makes use of two levels of indirection
provided by the OperationRegistry and
RenderedImageFactory (RIF) facilities. First, the
local OperationRegistry is used to map the operation
name into a RIF. This RIF then constructs one or more
OpImages to do the actual work (or returns a
RenderedImage by other means). The local
OperationRegistry is used in order to take advantage
of RIFs that are known to a server without having to burden the
client.
RenderedOp represents a single
PlanarImage; its companion class,
CollectionOp represents CollectionImage
nodes.
The RenderedOp synthesizes several poperty values,
which may not be removed. These are: image_width,
image_height, image_min_x_coord, and
image_min_y_coord.
CollectionOp, Serialized Form| Field Summary | |
protected PlanarImage |
theImage
The rendering of the current image, not preserved over RMI. |
protected PropertySource |
thePropertySource
The PropertySource containing the combined properties
of all of the node's sources. |
| Fields inherited from class javax.media.jai.PlanarImage |
colorModel,
height,
minX,
minY,
sampleModel,
snapshot,
source0,
source1,
sources,
tileGridXOffset,
tileGridYOffset,
tileHeight,
tileWidth,
width |
| Constructor Summary | |
RenderedOp(OperationRegistry registry,
java.lang.String opName,
java.awt.image.renderable.ParameterBlock pb,
java.awt.RenderingHints hints)
Constructs a RenderedOp that will be used to
instantiate a particular rendered operation from a given
operation registry, an operation name, a ParameterBlock,
and a set of rendering hints. |
|
RenderedOp(java.lang.String opName,
java.awt.image.renderable.ParameterBlock pb,
java.awt.RenderingHints hints)
Constructs a RenderedOp that will be used to
instantiate a particular rendered operation from a given
operation registry, an operation name, a ParameterBlock,
and a set of rendering hints. |
|
| Method Summary | |
void |
addNodeSource(java.lang.Object source)
Adds a source to the ParameterBlock of this node. |
void |
addPropertyGenerator(PropertyGenerator pg)
Adds a PropertyGenerator to the node. |
void |
addSink(PlanarImage sink)
Renders the node if it has not already been rendered, and adds a PlanarImage sink to the list of sinks
of the rendered image. |
void |
addSource(PlanarImage source)
Renders the node if it has not already been rendered, and adds a PlanarImage source to the list of sources
of the rendered image. |
java.awt.image.WritableRaster |
copyData()
Renders the node if it has not already been rendered, and copies and returns the entire rendered image into a single raster. |
java.awt.image.WritableRaster |
copyData(java.awt.image.WritableRaster raster)
Renders the node if it has not already been rendered, and copies a specified rectangle of the rendered image into the given WritableRaster. |
PlanarImage |
createInstance()
Instantiate a PlanarImage that computes the result
of this RenderedOp. |
byte |
getByteParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a byte. |
char |
getCharParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a char. |
java.awt.image.ColorModel |
getColorModel()
Renders the node if it has not already been rendered, and returns the ColorModel of the rendered image. |
java.awt.image.Raster |
getData()
Renders the node if it has not already been rendered, and returns the entire rendered image as a Raster. |
java.awt.image.Raster |
getData(java.awt.Rectangle rect)
Renders the node if it has not already been rendered, and returns a specified rectangular region of the rendered image as a Raster. |
double |
getDoubleParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a double. |
float |
getFloatParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a float. |
int |
getHeight()
Renders the node if it has not already been rendered, and returns the height of the rendered image. |
int |
getIntParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as an int. |
long |
getLongParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a long. |
int |
getMaxX()
Renders the node if it has not already been rendered, and returns the X coordinate of the column immediately to the right of the rightmost column of the rendered image. |
int |
getMaxY()
Renders the node if it has not already been rendered, and returns the Y coordinate of the row immediately below the bottom row of the rendered image. |
int |
getMinX()
Renders the node if it has not already been rendered, and returns the X coordinate of the leftmost column of the rendered image. |
int |
getMinY()
Renders the node if it has not already been rendered, and returns the X coordinate of the uppermost row of the rendered image. |
java.lang.Object |
getNodeSource(int index)
|
int |
getNumParameters()
Returns the number of parameters stored in the ParameterBlock of this node. |
int |
getNumSources()
Returns the number of sources stored in the ParameterBlock of this node. |
java.lang.Object |
getObjectParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as an Object. |
java.lang.String |
getOperationName()
Returns the name of the operation this node represents as a String. |
java.awt.image.renderable.ParameterBlock |
getParameterBlock()
Returns the ParameterBlock of this node. |
java.util.Vector |
getParameters()
Returns the parameters stored in the ParameterBlock of this node. |
java.lang.Object |
getProperty(java.lang.String name)
Returns the property associated with the specified property name, or java.awt.Image.UndefinedProperty if the specified
property is not set on the image. |
java.lang.String[] |
getPropertyNames()
Returns the names of properties available from this node. |
OperationRegistry |
getRegistry()
Returns the OperationRegistry that is used
by this node. |
PlanarImage |
getRendering()
Returns the PlanarImage rendering associated with this
RenderedOp node. |
java.awt.RenderingHints |
getRenderingHints()
Returns the RenderingHints of this node. |
java.awt.image.SampleModel |
getSampleModel()
Renders the node if it has not already been rendered, and returns the SampleModel of the rendered image. |
short |
getShortParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a short. |
java.util.Vector |
getSinks()
Renders the node if it has not already been rendered, and returns a Vector containing the currently available
PlanarImage sinks of the rendered image, or
null if no sinks are present. |
PlanarImage |
getSource(int index)
Renders the node if it has not already been rendered, and returns the specified PlanarImage source of
the rendered image. |
java.util.Vector |
getSources()
Returns the sources stored in the ParameterBlock of this node. |
java.awt.image.Raster |
getTile(int tileX,
int tileY)
Renders the node if it has not already been rendered, and returns the specified tile of the rendered image. |
int |
getTileGridXOffset()
Renders the node if it has not already been rendered, and returns the tile grid X offset of the rendered image. |
int |
getTileGridYOffset()
Renders the node if it has not already been rendered, and returns the tile grid Y offset of the rendered image. |
int |
getTileHeight()
Renders the node if it has not already been rendered, and returns the tile height of the rendered image. |
java.awt.image.Raster[] |
getTiles(java.awt.Point[] tileIndices)
Renders the node if it has not already been rendered, and returns the tiles indicated by the tileIndices
of the rendered image as an array of Rasters. |
int |
getTileWidth()
Renders the node if it has not already been rendered, and returns the tile width of the rendered image. |
int |
getWidth()
Renders the node if it has not already been rendered, and returns the width of the rendered image. |
void |
prefetchTiles(java.awt.Point[] tileIndices)
Renders the node if it has not already been rendered. |
boolean |
removeSink(PlanarImage sink)
Renders the node if it has not already been rendered, and removes a PlanarImage sink from the list of sinks
of the rendered image. |
boolean |
removeSource(PlanarImage source)
Renders the node if it has not already been rendered, and removes a PlanarImage source from the list
of sources of the rendered image. |
void |
removeSources()
Removes all the sources stored in the ParameterBlock of this node. |
void |
setNodeSource(java.lang.Object source,
int index)
Sets the specified source stored in the ParameterBlock
of this node to a new source object. |
void |
setOperationName(java.lang.String opName)
Sets the name of the operation this node represents. |
void |
setParameter(byte param,
int index)
Sets one of the node's parameters to a byte. |
void |
setParameter(char param,
int index)
Sets one of the node's parameters to a char. |
void |
setParameter(double param,
int index)
Sets one of the node's parameters to a double. |
void |
setParameter(float param,
int index)
Sets one of the node's parameters to a float. |
void |
setParameter(int param,
int index)
Sets one of the node's parameters to an int. |
void |
setParameter(long param,
int index)
Sets one of the node's parameters to a long. |
void |
setParameter(java.lang.Object param,
int index)
Sets one of the node's parameters to an Object. |
void |
setParameter(short param,
int index)
Sets one of the node's parameters to a short. |
void |
setParameterBlock(java.awt.image.renderable.ParameterBlock pb)
Sets the ParameterBlock of this node. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Sets a local property on a node. |
void |
setRegistry(OperationRegistry registry)
Sets the OperationRegistry that is used by
this node. |
void |
setRenderingHints(java.awt.RenderingHints hints)
Sets the RenderingHints of this node. |
void |
setSource(PlanarImage source,
int index)
Renders the node if it has not already been rendered, and sets the specified source of the rendered image to the supplied PlanarImage. |
void |
setSources(java.util.List sourceList)
Replaces the sources in the ParameterBlock of this node
with a new list of sources. |
void |
suppressProperty(java.lang.String name)
Removes a named property from the property environment of this node. |
| Methods inherited from class javax.media.jai.PlanarImage |
copyExtendedData,
createColorModel,
createSnapshot,
dispose,
finalize,
getAsBufferedImage,
getAsBufferedImage,
getBounds,
getExtendedData,
getGraphics,
getMaxTileX,
getMaxTileY,
getMinTileX,
getMinTileY,
getNumXTiles,
getNumYTiles,
getProperties,
getPropertyNames,
getSplits,
getTileRect,
removeSinks,
setImageParameters,
setImageParameters,
setProperties,
tileXToX,
tileXToX,
tileYToY,
tileYToY,
wrapRenderedImage,
XToTileX,
XToTileX,
YToTileY,
YToTileY |
| Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected transient PlanarImage theImage
protected transient PropertySource thePropertySource
PropertySource containing the combined properties
of all of the node's sources.| Constructor Detail |
public RenderedOp(OperationRegistry registry,
java.lang.String opName,
java.awt.image.renderable.ParameterBlock pb,
java.awt.RenderingHints hints)
RenderedOp that will be used to
instantiate a particular rendered operation from a given
operation registry, an operation name, a ParameterBlock,
and a set of rendering hints. All input parameters are saved
by reference.registry - The OperationRegistry to be used for
instantiation. if null, the default registry
is used.opName - The operation name.pb - The sources and other parameters. If null,
it is assumed that this node has no sources and parameters.hints - The rendering hints. If null, it is assumed
that no hints are associated with the rendering.opName is null.
public RenderedOp(java.lang.String opName,
java.awt.image.renderable.ParameterBlock pb,
java.awt.RenderingHints hints)
RenderedOp that will be used to
instantiate a particular rendered operation from a given
operation registry, an operation name, a ParameterBlock,
and a set of rendering hints. The default operation registry
is used. All input parameters are saved by reference.opName - The operation name.pb - The sources and other parameters. If null,
it is assumed that this node has no sources and parameters.hints - The rendering hints. If null, it is assumed
that no hints are associated with the rendering.opName is null.| Method Detail |
public OperationRegistry getRegistry()
OperationRegistry that is used
by this node. If the registry had not been set, the default
registry is returned.public void setRegistry(OperationRegistry registry)
OperationRegistry that is used by
this node. If the specified registry is null, the
default registry is used. If this node has been rendered and
frozen, this method has no effect.
The parameter is saved by reference.registry - The new OperationRegistry to be set;
it may be null.public java.lang.String getOperationName()
String.public void setOperationName(java.lang.String opName)
opName - The new operation name to be set.opName is null.public java.awt.image.renderable.ParameterBlock getParameterBlock()
ParameterBlock of this node.public void setParameterBlock(java.awt.image.renderable.ParameterBlock pb)
ParameterBlock of this node. If this node
has been rendered and frozen, this method has no effect.
If the speicifed new ParameterBlock is null,
it is assumed that this node has no input sources and parameters.
The parameter is saved by reference.
This method does not validate the content of the supplied
ParameterBlock. The caller should ensure that
the sources and parameters in the ParameterBlock
are suitable for the operation this node represents; otherwise
some form of error or exception may occur at the time of rendering.
pb - The new ParameterBlock to be set;
it may be null.public java.awt.RenderingHints getRenderingHints()
RenderingHints of this node.
It may be null.public void setRenderingHints(java.awt.RenderingHints hints)
RenderingHints of this node. If this node
has been rendered and frozen, this method has no effect.
The parameter is saved by reference.hints - The new RenderingHints to be set;
it may be null.public PlanarImage createInstance()
PlanarImage that computes the result
of this RenderedOp. The default
OperationRegistry is used to translate operation
names into actual OpImages.
During this method, all the sources supplied in the
ParameterBlock are checked. If any of the sources
is a RenderedOp, a rendering of that source is
created. This propagates all the way up to the top of the op
chain. If any of the sources is a Collection,
then the collection is passed to the operation as-is. If there
is a RenderedOp anywhere in the collection, it is
up to the individual operation to create the rendering for that
RenderedOp.
This method does not validate the sources and parameters
stored in the ParameterBlock against the specification
of the operation this node represents. It is the responsibility
of the caller to ensure that the data in the
ParameterBlock are suitable for this operation.
Otherwise, some kind of exception or error will occure.
PlanarImage.public PlanarImage getRendering()
PlanarImage rendering associated with this
RenderedOp node.
This method does not validate the sources and parameters
stored in the ParameterBlock against the specification
of the operation this node represents. It is the caller's
responsibility to ensure that the data in the
ParameterBlock are suitable for this operation.
Otherwise, an exception or error will occur.
public java.lang.String[] getPropertyNames()
Strings containing valid
property names.public java.lang.Object getProperty(java.lang.String name)
java.awt.Image.UndefinedProperty if the specified
property is not set on the image.name - A String naming the property.name is null.
public void setProperty(java.lang.String name,
java.lang.Object value)
Properties may be set on a RenderedOp node
only prior to the creation of a rendering at that node. In
general this means that setProperty() should be
called only immediately after construction of a node.
If the node is serialized then serializable properties will also be serialized but non-serializable properties will be lost.
name - A String representing the property name.value - The property's value, as an Object.RuntimeException - if method is called on a
rendered node.RuntimeException - if name
conflicts with Synthetic property.IllegalArgumentException - if
name is null.IllegalArgumentException - if
value is null.public void addPropertyGenerator(PropertyGenerator pg)
PropertyGenerator to the node. The property values
emitted by this property generator override any previous
definitions.pg - A PropertyGenerator to be added to this node's
property environment.IllegalArgumentException - if
pg is null.public void suppressProperty(java.lang.String name)
getProperty(name) will
return null, and name will not appear on the list of properties
emitted by getPropertyNames().name - A String naming the property to be suppressed.IllegalArgumentException - if
name is null.RuntimeException - if name
conflicts with Synthetic property.public int getNumSources()
ParameterBlock of this node.
This may differ from the number of sources of the rendered image.public java.util.Vector getSources()
ParameterBlock of this node.
This may differ from the source vector of the rendered image.public java.lang.Object getNodeSource(int index)
public void addNodeSource(java.lang.Object source)
ParameterBlock of this node.
If this node has been rendered, this method has no effect.source - The source to be added to the
ParameterBlockpublic void setSources(java.util.List sourceList)
ParameterBlock of this node
with a new list of sources.
If this node has been rendered, this method has no effect.sourceList - A List of sources.sourceList is null.
public void setNodeSource(java.lang.Object source,
int index)
ParameterBlock
of this node to a new source object.
If this node has been rendered, this method has no effect.source - The Source to be set.index - The Index at which it is to be set.source is null.index is invalid.public void removeSources()
ParameterBlock of this node.
If this node has been rendered, this method has no effect.public int getNumParameters()
ParameterBlock of this node.public java.util.Vector getParameters()
ParameterBlock of this node.public byte getByteParameter(int index)
ParameterBlock of this node as a byte.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.ArrayIndexOutOfBoundsException - if
index is invalid.public char getCharParameter(int index)
ParameterBlock of this node as a char.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.ArrayIndexOutOfBoundsException - if
index is invalid.public short getShortParameter(int index)
ParameterBlock of this node as a short.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.ArrayIndexOutOfBoundsException - if
index is invalid.public int getIntParameter(int index)
ParameterBlock of this node as an int.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.ArrayIndexOutOfBoundsException - if
index is invalid.public long getLongParameter(int index)
ParameterBlock of this node as a long.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.ArrayIndexOutOfBoundsException - if
index is invalid.public float getFloatParameter(int index)
ParameterBlock of this node as a float.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.ArrayIndexOutOfBoundsException - if
index is invalid.public double getDoubleParameter(int index)
ParameterBlock of this node as a double.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.ArrayIndexOutOfBoundsException - if
index is invalid.public java.lang.Object getObjectParameter(int index)
ParameterBlock of this node as an Object.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.ArrayIndexOutOfBoundsException - if
index is invalid.
public void setParameter(byte param,
int index)
byte.
If the node has been rendered, this has no effect.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as a byte.index - The index of the parameter.
public void setParameter(char param,
int index)
char.
If the node has been rendered, this has no effect.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as a char.index - The index of the parameter.
public void setParameter(short param,
int index)
short.
If the node has been rendered, this has no effect.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as a short.index - The index of the parameter.
public void setParameter(int param,
int index)
int.
If the node has been rendered, this has no effect.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as an int.index - The index of the parameter.
public void setParameter(long param,
int index)
long.
If the node has been rendered, this has no effect.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as a long.index - The index of the parameter.
public void setParameter(float param,
int index)
float.
If the node has been rendered, this has no effect.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as a float.index - The index of the parameter.
public void setParameter(double param,
int index)
double.
If the node has been rendered, this has no effect.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as a double.index - The index of the parameter.
public void setParameter(java.lang.Object param,
int index)
Object.
If the node has been rendered, this has no effect.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as an Object.index - The index of the parameter.public int getMinX()
public int getMaxX()
public int getMinY()
public int getMaxY()
public int getWidth()
public int getHeight()
public int getTileWidth()
public int getTileHeight()
public int getTileGridXOffset()
public int getTileGridYOffset()
public java.awt.image.SampleModel getSampleModel()
SampleModel of the rendered image.public java.awt.image.ColorModel getColorModel()
ColorModel of the rendered image.
public java.awt.image.Raster getTile(int tileX,
int tileY)
tileX - The X index of the tile.tileY - The Y index of the tile.Raster.public java.awt.image.Raster[] getTiles(java.awt.Point[] tileIndices)
tileIndices
of the rendered image as an array of Rasters.tileIndices - An array of Points representing TileIndices.public void prefetchTiles(java.awt.Point[] tileIndices)
tileIndices - A list of tileIndices indicating which tiles
to prefetch.public java.awt.image.Raster getData()
Raster.public java.awt.image.Raster getData(java.awt.Rectangle rect)
Raster.public java.awt.image.WritableRaster copyData()
public java.awt.image.WritableRaster copyData(java.awt.image.WritableRaster raster)
WritableRaster.raster - A WritableRaster to be filled with image data.WritableRaster.public PlanarImage getSource(int index)
PlanarImage source of
the rendered image. If there is no source corresponding to
the specified index, this method will throw an
ArrayIndexOutOfBoundsException.
The source returned may differ from the source stored in
the ParameterBlock of this node.index - The index of the desired source.PlanarImage source.public void addSource(PlanarImage source)
PlanarImage source to the list of sources
of the rendered image.source - A PlanarImage to be added as a
source.IllegalArgumentException - if
source is null.public boolean removeSource(PlanarImage source)
PlanarImage source from the list
of sources of the rendered image.source - A PlanarImage to be removed.true if the element was present, false
otherwise.IllegalArgumentException - if
source is null.
public void setSource(PlanarImage source,
int index)
PlanarImage.
An ArrayIndexOutOfBoundsException may be thrown if
an invalid index is suppliedsource - The source, as a PlanarImage.index - The index of the source.public java.util.Vector getSinks()
Vector containing the currently available
PlanarImage sinks of the rendered image, or
null if no sinks are present.public void addSink(PlanarImage sink)
PlanarImage sink to the list of sinks
of the rendered image.IllegalArgumentException - if
sink is null.public boolean removeSink(PlanarImage sink)
PlanarImage sink from the list of sinks
of the rendered image.IllegalArgumentException - if
sink is null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||