001: /*
002: * $RCSfile: RemoteRIF.java,v $
003: *
004: * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
005: *
006: * Use is subject to license terms.
007: *
008: * $Revision: 1.1 $
009: * $Date: 2005/02/11 04:57:52 $
010: * $State: Exp $
011: */package javax.media.jai.remote;
012:
013: import java.awt.RenderingHints;
014: import java.awt.image.RenderedImage;
015: import java.awt.image.renderable.ParameterBlock;
016: import javax.media.jai.OperationDescriptor;
017: import javax.media.jai.OperationNode;
018: import javax.media.jai.PropertyChangeEventJAI;
019:
020: /**
021: * The <code>RemoteRIF</code> interface is intended to be implemented by
022: * classes that wish to act as factories to produce different renderings
023: * remotely, for example by executing a series of remote operations on
024: * a set of sources, depending on a specific set of parameters, properties,
025: * and rendering hints.
026: *
027: * <p> All factories that produce renderings for operations remotely
028: * must implement <code>RemoteRIF</code>.
029: *
030: * <p> Classes that implement this interface must provide a
031: * constructor with no arguments.
032: *
033: * @since JAI 1.1
034: */
035: public interface RemoteRIF {
036:
037: /**
038: * Creates a <code>RemoteRenderedImage</code> representing the results
039: * of an imaging operation (or chain of operations) for a given
040: * <code>ParameterBlock</code> and <code>RenderingHints</code>. The
041: * <code>RemoteRIF</code> may also query any source images
042: * referenced by the <code>ParameterBlock</code> for their dimensions,
043: * <code>SampleModel</code>s, properties, etc., as necessary.
044: *
045: * <p> The <code>create()</code> method should return null if the
046: * <code>RemoteRIF</code> (representing the server) is not capable of
047: * producing output for the given set of source images and parameters.
048: * For example, if a server (represented by a <code>RemoteRIF</code>) is
049: * only capable of performing a 3x3 convolution on single-banded image
050: * data, and the source image has multiple bands or the convolution
051: * Kernel is 5x5, null should be returned.
052: *
053: * <p> Hints should be taken into account, but can be ignored.
054: * The created <code>RemoteRenderedImage</code> may have a property
055: * identified by the String HINTS_OBSERVED to indicate which
056: * <code>RenderingHints</code> were used to create the image. In addition
057: * any <code>RenderedImage</code>s that are obtained via the getSources()
058: * method on the created <code>RemoteRenderedImage</code> may have such
059: * a property.
060: *
061: * @param serverName A <code>String</code> specifying the name of the
062: * server to perform the remote operation on.
063: * @param operationName The <code>String</code> specifying the name of the
064: * operation to be performed remotely.
065: * @param paramBlock A <code>ParameterBlock</code> containing sources
066: * and parameters for the
067: * <code>RemoteRenderedImage</code> to be created.
068: * @param hints A <code>RenderingHints</code> object containing
069: * hints.
070: * @return A <code>RemoteRenderedImage</code> containing the desired
071: * output.
072: */
073: RemoteRenderedImage create(String serverName, String operationName,
074: ParameterBlock paramBlock, RenderingHints hints)
075: throws RemoteImagingException;
076:
077: /**
078: * Creates a <code>RemoteRenderedImage</code> representing the results
079: * of an imaging operation represented by the given
080: * <code>OperationNode</code>, whose given old rendering is updated
081: * according to the given <code>PropertyChangeEventJAI</code>. This
082: * factory method should be used to create a new rendering updated
083: * according to the changes reported by the given
084: * <code>PropertyChangeEventJAI</code>. The <code>RemoteRIF</code>
085: * can query the supplied <code>OperationNode</code> for
086: * references to the server name, operation name, parameter block,
087: * and rendering hints. If only a new rendering of the node is desired
088: * in order to handle the supplied <code>PropertyChangeEventJAI</code>,
089: * the rendering can be obtained by calling the default
090: * <code>create()</code> method, the arguments to which can be
091: * retrieved from the supplied <code>OperationNode</code>.
092: * The <code>RemoteRIF</code> may also query
093: * any source images referenced by the <code>ParameterBlock</code>
094: * for their dimensions, <code>SampleModel</code>s, properties, etc.,
095: * as necessary. The supplied <code>OperationNode</code> should
096: * not be edited during the creation of the new rendering, otherwise
097: * the <code>OperationNode</code> might have an inconsistent state.
098: *
099: * <p> The <code>create()</code> method can return null if the
100: * <code>RemoteRIF</code> (representing the server) is not capable of
101: * producing output for the given set of source images and parameters.
102: * For example, if a server (represented by a <code>RemoteRIF</code>) is
103: * only capable of performing a 3x3 convolution on single-banded image
104: * data, and the source image has multiple bands or the convolution
105: * Kernel is 5x5, null should be returned.
106: *
107: * <p> Hints should be taken into account, but can be ignored.
108: * The created <code>RemoteRenderedImage</code> may have a property
109: * identified by the String HINTS_OBSERVED to indicate which
110: * <code>RenderingHints</code> were used to create the image. In addition
111: * any <code>RenderedImage</code>s that are obtained via the getSources()
112: * method on the created <code>RemoteRenderedImage</code> may have such
113: * a property.
114: *
115: * @param oldRendering The old rendering of the imaging operation.
116: * @param node The <code>OperationNode</code> that represents the
117: * imaging operation.
118: * @param event An event that specifies the changes made to the
119: * imaging operation.
120: * @return A <code>RemoteRenderedImage</code> containing the desired
121: * output.
122: */
123: RemoteRenderedImage create(PlanarImageServerProxy oldRendering,
124: OperationNode node, PropertyChangeEventJAI event)
125: throws RemoteImagingException;
126:
127: /**
128: * Returns the set of capabilities supported by the client object.
129: */
130: NegotiableCapabilitySet getClientCapabilities();
131: }
|