javax.media.jai
Class JAI

java.lang.Object
  extended byjavax.media.jai.JAI

public final class JAI
extends Object

A convenience class for instantiating operations.

This class allows programmers to use the syntax:

 import javax.media.jai.JAI;
 RenderedOp im = JAI.create("convolve", paramBlock, renderHints);
 
to create new images or collections by applying operators. The create() method returns a RenderedOp encapsulating the operation name, parameter block, and rendering hints. Additionally, it performs validity checking on the operation parameters. Programmers may also refer to JAI.createCollection("opname", paramBlock, renderHints), JAI.createRenderable("opname", paramBlock, renderHints), and JAI.createRenderableCollection("opname", paramBlock, renderHints).

If the OperationDescriptor associated with the named operation returns true from its isImmediate() method, the JAI.createNS() method will ask the RenderedOp it constructs to render itself immediately. If this rendering is null, createNS() will itself return null rather than returning an instance of RenderedOp as it normally does.

It is possible to create new instances of theJAIclass in order to control each instance's registry, tile cache, and tile scheduler individually. Most users will want to use only the static methods of this class, which perform all operations on a default instance, which in turn makes use of a default registry. To create a new image or collection on a non-default JAI instance, the createNS() and createCollectionNS (NS being short for "non-static") methods are used.

The JAI class contains convenience methods for a number of common argument list formats. These methods perform the work of constructing a ParameterBlock automatically. The convenience methods are available only in static form and make use of the default instance. When operating with a specific instance, the general, non-static functions createNS() and createCollectionNS() should be used. All of the convenience methods operate by calling createNS() on the default JAI instance, and thus inherit the semantics of that method with regard to immediate rendering.

The registry being used by a particular instance may be retrieved or set using the getOperationRegistry() and setOperationRegistry() methods, respectively. Only advanced users should attempt to set the registry. The tile cache and tile scheduler being used by a particular instance may likewise be set or retrieved using the methods setTileCache(), setTileScheduler(), getTileCache(), or getTileScheduler().

Each instance of JAI contains a set of rendering hints which will be used for all image or collection creations. These hints are merged with any hints supplied to the create method; directly supplied hints take precedence over the common hints. When a new JAI instance is constructed, its hints are initialized to a copy of the hints associated with the default instance. When the default instance is constructed, hints for the default registry, tile cache, and tile scheduler are added to the set of common rendering hints. Similarly, invoking setOperationRegistry(), setTileCache(), or setTileScheduler() on a JAI instance will cause the respective entity to be added to the common rendering hints. The hints associated with any instance, including the default instance, may be manipulated using the getRenderingHints(), setRenderingHints(), and clearRenderingHints() methods.

An ImagingListener will reside in each instance of JAI. It can be used to listen to (and process) the exceptional situations that occur in the operations and JAI. A default ImagingListener is initially registered which re-throws RuntimeExceptions and prints the error message and the stack trace of other types to System.err. To override this default behavior an instance of an alternate ImagingListener implementation should be registered using setImagingListener(javax.media.jai.util.ImagingListener).

An ImagingListener also can be attached to a node as a rendering hint, which maps the key KEY_IMAGING_LISTENER. The Throwables which arise in the creation and the rendering of this node will be sent to this ImagingListener (note that those thrown at the top levels such as node creation failure will be handled by the listener registered to the JAI instead.) The default value for this hint will be the one registered to the instance of JAI.

See Also:
OperationRegistry, RenderingHints, TileScheduler, TileCache, ImagingListener

Field Summary
static RenderingHints.Key KEY_BORDER_EXTENDER
          Key for BorderExtender object values.
static RenderingHints.Key KEY_CACHED_TILE_RECYCLING_ENABLED
          Key for Boolean object values which specify whether automatic recycling of application-visible tiles should occur.
static RenderingHints.Key KEY_COLOR_MODEL_FACTORY
          Key for ColorModelFactory object values.
static RenderingHints.Key KEY_DEFAULT_COLOR_MODEL_ENABLED
          Key for enabling default ColorModel initialization when a valid ColorModel may not be derived by inheritance.
static RenderingHints.Key KEY_DEFAULT_COLOR_MODEL_METHOD
          Key for specifying a method to be used as for default ColorModel initialization.
static RenderingHints.Key KEY_DEFAULT_RENDERING_SIZE
          Key for the dimensions of a RenderedImage created by invoking createDefaultRendering() on a node of type RenderableOp in a renderable processing chain.
static RenderingHints.Key KEY_IMAGE_LAYOUT
          Key for ImageLayout object values.
static RenderingHints.Key KEY_IMAGING_LISTENER
          Key for the ImagingListener registered to a rendering node.
static RenderingHints.Key KEY_INTERPOLATION
          Key for Interpolation object values.
static RenderingHints.Key KEY_NEGOTIATION_PREFERENCES
          Key for the negotiation preferences to be used to negotiate capabilities to be used in the remote communication.
static RenderingHints.Key KEY_NUM_RETRIES
          Key for the number of retries to be used for dealing with network errors during remote imaging.
static RenderingHints.Key KEY_OPERATION_BOUND
          Key for Integer object values representing whether the operation is compute, network, or I/O bound.
static RenderingHints.Key KEY_OPERATION_REGISTRY
          Key for OperationRegistry object values.
static RenderingHints.Key KEY_REPLACE_INDEX_COLOR_MODEL
          Key for enabling changing of destination image's ColorModel to a ComponentColorModel, when the source image has an IndexColorModel.
static RenderingHints.Key KEY_RETRY_INTERVAL
          Key for the retry interval value to be used for dealing with network errors during remote imaging.
static RenderingHints.Key KEY_SERIALIZE_DEEP_COPY
          Key for specifying whether a deep copy of the image data should be used when serializing images.
static RenderingHints.Key KEY_TILE_CACHE
          Key for TileCache object values.
static RenderingHints.Key KEY_TILE_CACHE_METRIC
          Key for Tile ordering metric.
static RenderingHints.Key KEY_TILE_CODEC_FORMAT
          Key for specifying the default format to be used for tile serialization via TileCodecs.
static RenderingHints.Key KEY_TILE_DECODING_PARAM
          Key for specifying the default decoding parameters to be used for tile serialization via TileCodecs.
static RenderingHints.Key KEY_TILE_ENCODING_PARAM
          Key for specifying the default encoding parameters to be used for tile serialization via TileCodecs.
static RenderingHints.Key KEY_TILE_FACTORY
          Key for TileFactory object values.
static RenderingHints.Key KEY_TILE_RECYCLER
          Key for TileRecycler object values.
static RenderingHints.Key KEY_TILE_SCHEDULER
          Key for TileScheduler object values.
static RenderingHints.Key KEY_TRANSFORM_ON_COLORMAP
          Key that indicates whether the ColormapOpImages do the transform on the color map or on the pixels when the source image and destination images are all color-indexed.
 
Constructor Summary
JAI()
          Returns a new instance of theJAIclass.
 
Method Summary
 void clearRenderingHints()
          Clears the RenderingHints associated with this JAI instance.
static RenderedOp create(String opName, Collection srcCol)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, int param1, int param2, Object param3)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, Object param)
          Creates a RenderedOp that takes 1 Object parameter.
static RenderedOp create(String opName, Object param1, int param2)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, Object param1, int param2, Object param3, int param4)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, Object param1, Object param2)
          Creates a RenderedOp that takes 2 Object parameters.
static RenderedOp create(String opName, Object param1, Object param2, Object param3)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, Object param1, Object param2, Object param3, Object param4)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, ParameterBlock args)
          Creates a RenderedOp with null rendering hints.
static RenderedOp create(String opName, ParameterBlock args, RenderingHints hints)
          Creates a RenderedOp which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock, and applying the specified hints to the destination.
static RenderedOp create(String opName, RenderedImage src)
          Creates a RenderedOp that takes 1 RenderedImage source.
static RenderedOp create(String opName, RenderedImage src, float param1, float param2, float param3, float param4, Object param5)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, float param1, float param2, float param3, Object param4)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, float param1, float param2, Object param3)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, float param1, int param2, float param3, float param4, Object param5)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, int param)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, int param1, int param2, int param3, int param4)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, int param1, int param2, int param3, int param4, int param5, Object param6)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, Object param)
          Creates a RenderedOp that takes 1 RenderedImage source and 1 Object parameter.
static RenderedOp create(String opName, RenderedImage src, Object param1, float param2)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, Object param1, int param2, int param3)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, Object param1, Object param2)
          Creates a RenderedOp that takes 1 RenderedImage source and 2 Object parameters.
static RenderedOp create(String opName, RenderedImage src, Object param1, Object param2, int param3, int param4)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, Object param1, Object param2, Object param3)
          Creates a RenderedOp that takes 1 RenderedImage source and 3 Object parameters.
static RenderedOp create(String opName, RenderedImage src, Object param1, Object param2, Object param3, Object param4)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, Object param1, Object param2, Object param3, Object param4, Object param5)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src, Object param1, Object param2, Object param3, Object param4, Object param5, Object param6)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static RenderedOp create(String opName, RenderedImage src1, RenderedImage src2)
          Creates a RenderedOp that takes 2 RenderedImage sources.
static RenderedOp create(String opName, RenderedImage src1, RenderedImage src2, Object param1, Object param2, Object param3, Object param4)
          Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).
static Collection createCollection(String opName, ParameterBlock args)
          Creates a Collection with null rendering hints.
static Collection createCollection(String opName, ParameterBlock args, RenderingHints hints)
          Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock, and applying the specified hints to the destination.
 Collection createCollectionNS(String opName, ParameterBlock args, RenderingHints hints)
          Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock, and applying the specified hints to the destination.
 RenderedOp createNS(String opName, ParameterBlock args, RenderingHints hints)
          Creates a RenderedOp which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock, and applying the specified hints to the destination.
static RenderableOp createRenderable(String opName, ParameterBlock args)
          Creates a RenderableOp that represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock.
static RenderableOp createRenderable(String opName, ParameterBlock args, RenderingHints hints)
          Creates a RenderableOp that represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock.
static Collection createRenderableCollection(String opName, ParameterBlock args)
          Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock.
static Collection createRenderableCollection(String opName, ParameterBlock args, RenderingHints hints)
          Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock.
 Collection createRenderableCollectionNS(String opName, ParameterBlock args)
          Deprecated. as of JAI 1.1 in favor of createRenderableCollectionNS(String,ParameterBlock,RenderingHints).
 Collection createRenderableCollectionNS(String opName, ParameterBlock args, RenderingHints hints)
          Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock.
 RenderableOp createRenderableNS(String opName, ParameterBlock args)
          Deprecated. as of JAI 1.1 in favor of createRenderableNS(String,ParameterBlock,RenderingHints).
 RenderableOp createRenderableNS(String opName, ParameterBlock args, RenderingHints hints)
          Creates a RenderableOp that represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock.
static TileCache createTileCache()
          Constructs a TileCache with the default memory capacity in bytes.
static TileCache createTileCache(int tileCapacity, long memCapacity)
          Deprecated. as of JAI 1.1 Refer to createTileCache(long memCapacity).
static TileCache createTileCache(long memCapacity)
          Constructs a TileCache with the given memory capacity in bytes.
static TileScheduler createTileScheduler()
          Constructs a TileScheduler with the default parallelism and priorities.
static void disableDefaultTileCache()
          Disable use of default tile cache.
static void enableDefaultTileCache()
          Enable use of default tile cache.
static String getBuildVersion()
          Returns JAI version information as a String
static JAI getDefaultInstance()
          Returns the defaultJAIinstance.
static Dimension getDefaultRenderingSize()
          Retrieves a copy of the default rendering size.
static Dimension getDefaultTileSize()
          Retrieves the clone of the default tile dimensions.
 ImagingListener getImagingListener()
          Gets the ImagingListener object from this JAI.
 OperationRegistry getOperationRegistry()
          Returns theOperationRegistry being used by thisJAIinstance.
 Object getRenderingHint(RenderingHints.Key key)
          Returns the hint value associated with a given key in this JAI instance, or null if no value is associated with the given key.
 RenderingHints getRenderingHints()
          Returns the RenderingHints associated with this JAI instance.
 TileCache getTileCache()
          Returns the TileCache being used by thisJAIinstance.
 TileScheduler getTileScheduler()
          Returns the TileScheduler being used by thisJAIinstance.
 void removeRenderingHint(RenderingHints.Key key)
          Removes the hint value associated with a given key in this JAI instance.
static void setDefaultRenderingSize(Dimension defaultSize)
          Sets the default size of the rendering created by invoking createDefaultRendering() on a RenderableOp.
static void setDefaultTileSize(Dimension tileDimensions)
          Sets the default tile dimensions to the clone of the provided parameter.
 void setImagingListener(ImagingListener listener)
          Sets an ImagingListener object on this JAI.
 void setOperationRegistry(OperationRegistry operationRegistry)
          Sets theOperationRegistry to be used by thisJAIinstance.
 void setRenderingHint(RenderingHints.Key key, Object value)
          Sets the hint value associated with a given key in this JAI instance.
 void setRenderingHints(RenderingHints hints)
          Sets the RenderingHints associated with this JAI instance.
 void setTileCache(TileCache tileCache)
          Sets the TileCache to be used by thisJAI instance.
 void setTileScheduler(TileScheduler tileScheduler)
          Sets the TileScheduler to be used by thisJAI instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_IMAGE_LAYOUT

public static RenderingHints.Key KEY_IMAGE_LAYOUT
Key for ImageLayout object values. The common RenderingHints do not contain a default hint corresponding to this key.


KEY_INTERPOLATION

public static RenderingHints.Key KEY_INTERPOLATION
Key for Interpolation object values. The common RenderingHints do not contain a default hint corresponding to this key.

See Also:
MultiResolutionRenderableImage.createScaledRendering(int, int, java.awt.RenderingHints), MultiResolutionRenderableImage.createRendering(java.awt.image.renderable.RenderContext)

KEY_OPERATION_REGISTRY

public static RenderingHints.Key KEY_OPERATION_REGISTRY
Key for OperationRegistry object values. The common RenderingHints by default contain a hint corresponding to this key the value of which is equal to the value returned by getOperationRegistry(). The hint is automatically set by setOperationRegistry().


KEY_OPERATION_BOUND

public static RenderingHints.Key KEY_OPERATION_BOUND
Key for Integer object values representing whether the operation is compute, network, or I/O bound. The values come from the constants OpImage.OP_COMPUTE_BOUND, OpImage.OP_IO_BOUND, and OpImage.OP_NETWORK_BOUND. The common RenderingHints do not contain a default hint corresponding to this key.


KEY_BORDER_EXTENDER

public static RenderingHints.Key KEY_BORDER_EXTENDER
Key for BorderExtender object values. The common RenderingHints do not contain a default hint corresponding to this key.


KEY_TILE_CACHE

public static RenderingHints.Key KEY_TILE_CACHE
Key for TileCache object values. The common RenderingHints by default contain a hint corresponding to this key the value of which is equal to the value returned by getTileCache(). The hint is automatically set by setTileCache().

See Also:
createTileCache(long), createTileCache(), OpImage.OpImage(java.util.Vector, javax.media.jai.ImageLayout, java.util.Map, boolean)

KEY_TILE_CACHE_METRIC

public static RenderingHints.Key KEY_TILE_CACHE_METRIC
Key for Tile ordering metric. The common RenderingHints do not contain a default hint corresponding to this key.

Since:
JAI 1.1
See Also:
OpImage.OpImage(java.util.Vector, javax.media.jai.ImageLayout, java.util.Map, boolean), TileCache

KEY_TILE_SCHEDULER

public static RenderingHints.Key KEY_TILE_SCHEDULER
Key for TileScheduler object values. The common RenderingHints by default contain a hint corresponding to this key the value of which is equal to the value returned by getTileScheduler(). The hint is automatically set by setTileScheduler().

Since:
JAI 1.1
See Also:
OpImage.OpImage(java.util.Vector, javax.media.jai.ImageLayout, java.util.Map, boolean)

KEY_DEFAULT_COLOR_MODEL_ENABLED

public static RenderingHints.Key KEY_DEFAULT_COLOR_MODEL_ENABLED
Key for enabling default ColorModel initialization when a valid ColorModel may not be derived by inheritance. The corresponding object must be a Boolean. The common RenderingHints do not contain a default hint corresponding to this key which is equivalent to its being set to TRUE.

Since:
JAI 1.1
See Also:
OpImage.OpImage(java.util.Vector, javax.media.jai.ImageLayout, java.util.Map, boolean)

KEY_DEFAULT_COLOR_MODEL_METHOD

public static RenderingHints.Key KEY_DEFAULT_COLOR_MODEL_METHOD
Key for specifying a method to be used as for default ColorModel initialization. The corresponding object must be a java.lang.reflect.Method which is static and accepts a single SampleModel parameter and returns a ColorModel or null. The common RenderingHints do not contain a default hint corresponding to this key which is equivalent to its being set to the Method corresponding to PlanarImage.createColorModel(SampleModel).

Since:
JAI 1.1
See Also:
OpImage.OpImage(java.util.Vector, javax.media.jai.ImageLayout, java.util.Map, boolean)

KEY_DEFAULT_RENDERING_SIZE

public static final RenderingHints.Key KEY_DEFAULT_RENDERING_SIZE
Key for the dimensions of a RenderedImage created by invoking createDefaultRendering() on a node of type RenderableOp in a renderable processing chain. The type of the associated value is java.awt.Dimension.

Since:
JAI 1.1
See Also:
RenderableOp.createDefaultRendering()

KEY_COLOR_MODEL_FACTORY

public static RenderingHints.Key KEY_COLOR_MODEL_FACTORY
Key for ColorModelFactory object values. The common RenderingHints do not contain a default hint corresponding to this key.

Since:
JAI 1.1.2
See Also:
OpImage.OpImage(java.util.Vector, javax.media.jai.ImageLayout, java.util.Map, boolean)

KEY_REPLACE_INDEX_COLOR_MODEL

public static RenderingHints.Key KEY_REPLACE_INDEX_COLOR_MODEL
Key for enabling changing of destination image's ColorModel to a ComponentColorModel, when the source image has an IndexColorModel. The corresponding object must be a Boolean. If the source image has an IndexColorModel, and the user or the operation itself does not set the ColorModel of the destination image, the destination image's ColorModel would be copied from the source and would therefore also be an IndexColorModel. A Boolean.TRUE value set for this key causes the destination image's ColorModel to be changed to a ComponentColorModel. The advantage of changing the destination's ColorModel comes in the usage of RasterAccessor. When a RasterAccessor is created using this source and destination pair, the source IndexColorModel will be automatically expanded, allowing operations that depend on the pixel value (as opposed to the index into the ColorModel) to function correctly. Note that the JAI provided dithering operations (errordiffusion, ordereddither) along with the color quantization operator, colorquantizer can be used for the inverse operation, i.e. converting from an RGB image to an indexed image. The common RenderingHints do not contain a default hint corresponding to this key which is equivalent to its being set to FALSE. Certain operators, however, change the default for themselves to Boolean.TRUE.

Since:
JAI 1.1.2
See Also:
OpImage.OpImage(java.util.Vector, javax.media.jai.ImageLayout, java.util.Map, boolean), RasterAccessor, ColorQuantizerDescriptor

KEY_TILE_FACTORY

public static RenderingHints.Key KEY_TILE_FACTORY
Key for TileFactory object values. The common RenderingHints contain a RecyclingTileFactory-valued hint corresponding to this key. The value is the same as that to which KEY_TILE_RECYCLER is initially mapped.

Since:
JAI 1.1.2
See Also:
PlanarImage.PlanarImage(ImageLayout,Vector,Map), OpImage.OpImage(Vector,ImageLayout,Map,boolean)

KEY_TILE_RECYCLER

public static RenderingHints.Key KEY_TILE_RECYCLER
Key for TileRecycler object values. The common RenderingHints contain a RecyclingTileFactory-valued hint corresponding to this key. The value is the same as that to which KEY_TILE_FACTORY is initially mapped.

Since:
JAI 1.1.2
See Also:
OpImage.OpImage(Vector,ImageLayout,Map,boolean)

KEY_CACHED_TILE_RECYCLING_ENABLED

public static RenderingHints.Key KEY_CACHED_TILE_RECYCLING_ENABLED
Key for Boolean object values which specify whether automatic recycling of application-visible tiles should occur. The common RenderingHints contain a FALSE-valued hint corresponding to this key.

Since:
JAI 1.1.2
See Also:
OpImage.OpImage(Vector,ImageLayout,Map,boolean)

KEY_SERIALIZE_DEEP_COPY

public static RenderingHints.Key KEY_SERIALIZE_DEEP_COPY
Key for specifying whether a deep copy of the image data should be used when serializing images. The corresponding object must be a Boolean. The common RenderingHints do not contain a default hint corresponding to this key.

Since:
JAI 1.1

KEY_TILE_CODEC_FORMAT

public static RenderingHints.Key KEY_TILE_CODEC_FORMAT
Key for specifying the default format to be used for tile serialization via TileCodecs. The corresponding object must be a String. The common RenderingHints do not contain a default hint corresponding to this key.

Since:
JAI 1.1

KEY_TILE_ENCODING_PARAM

public static RenderingHints.Key KEY_TILE_ENCODING_PARAM
Key for specifying the default encoding parameters to be used for tile serialization via TileCodecs. The corresponding object must be a TileCodecParameterList. The common RenderingHints do not contain a default hint corresponding to this key.

Since:
JAI 1.1

KEY_TILE_DECODING_PARAM

public static RenderingHints.Key KEY_TILE_DECODING_PARAM
Key for specifying the default decoding parameters to be used for tile serialization via TileCodecs. The corresponding object must be a TileCodecParameterList. The common RenderingHints do not contain a default hint corresponding to this key.

Since:
JAI 1.1

KEY_RETRY_INTERVAL

public static RenderingHints.Key KEY_RETRY_INTERVAL
Key for the retry interval value to be used for dealing with network errors during remote imaging. The corresponding object must be an Integer. The common RenderingHints do not contain a default hint corresponding to this key.

Since:
JAI 1.1
See Also:
RemoteJAI

KEY_NUM_RETRIES

public static RenderingHints.Key KEY_NUM_RETRIES
Key for the number of retries to be used for dealing with network errors during remote imaging. The corresponding object must be an Integer. The common RenderingHints do not contain a default hint corresponding to this key.

Since:
JAI 1.1
See Also:
RemoteJAI

KEY_NEGOTIATION_PREFERENCES

public static RenderingHints.Key KEY_NEGOTIATION_PREFERENCES
Key for the negotiation preferences to be used to negotiate capabilities to be used in the remote communication. The corresponding object must be a NegotiableCapabilitySet. The common RenderingHints do not contain a default hint corresponding to this key.

Since:
JAI 1.1
See Also:
RemoteJAI

KEY_TRANSFORM_ON_COLORMAP

public static RenderingHints.Key KEY_TRANSFORM_ON_COLORMAP
Key that indicates whether the ColormapOpImages do the transform on the color map or on the pixels when the source image and destination images are all color-indexed. The corresponding object must be a Boolean. The common RenderingHints do not contain a default hint corresponding to this key. The default behavior is equivalent to setting a hint with a value of Boolean.TRUE.

Since:
JAI 1.1.2

KEY_IMAGING_LISTENER

public static RenderingHints.Key KEY_IMAGING_LISTENER
Key for the ImagingListener registered to a rendering node. The default mapping of this key in each JAI instance rethrows RuntimeExceptions and prints the error message and stack trace of other exceptions to System.err.

Since:
JAI 1.1.2
Constructor Detail

JAI

public JAI()
Returns a new instance of theJAIclass. The OperationRegistry, TileScheduler, and TileCache will initially be references to those of the default instance. The rendering hints will be set to a clone of those of the default instance.

Method Detail

getBuildVersion

public static final String getBuildVersion()
Returns JAI version information as a String

Since:
JAI 1.1

disableDefaultTileCache

public static final void disableDefaultTileCache()
Disable use of default tile cache. Tiles are not stored.

Since:
JAI 1.1

enableDefaultTileCache

public static final void enableDefaultTileCache()
Enable use of default tile cache. Tiles are stored.

Since:
JAI 1.1

setDefaultTileSize

public static final void setDefaultTileSize(Dimension tileDimensions)
Sets the default tile dimensions to the clone of the provided parameter. If null there are no default dimensions.

Parameters:
tileDimensions - The default tile dimensions or null.
Throws:
IllegalArgumentException - if tileDimensions is non-null and has non-positive width or height.
Since:
JAI 1.1

getDefaultTileSize

public static final Dimension getDefaultTileSize()
Retrieves the clone of the default tile dimensions. If null there are no default dimensions set.

Returns:
The default tile dimensions or null.
Since:
JAI 1.1

setDefaultRenderingSize

public static final void setDefaultRenderingSize(Dimension defaultSize)
Sets the default size of the rendering created by invoking createDefaultRendering() on a RenderableOp. This default size may be overruled by setting a hint with key KEY_DEFAULT_RENDERING_SIZE on the node. If null there are no default dimensions. Either dimension may be non-positive in which case the other dimension and the renderable aspect ratio will be used to compute the rendered image size. The intial value of this setting is
 new Dimension(0, 512)
 
which produces a default rendering of height 512 and width 512*aspect_ratio.

Parameters:
defaultSize - The default rendering size or null.
Throws:
IllegalArgumentException - if defaultSize is non-null and both the width and height are non-positive.
Since:
JAI 1.1

getDefaultRenderingSize

public static final Dimension getDefaultRenderingSize()
Retrieves a copy of the default rendering size. If null there is no default size set.

Returns:
The default rendering size or null.
Since:
JAI 1.1

getDefaultInstance

public static JAI getDefaultInstance()
Returns the defaultJAIinstance. This instance is used by all of the static methods of this class. It uses the default OperationRegistry and, in the Sun Microsystems, Inc. implementation, the Sun implementations of TileCache and TileScheduler. The RenderingHints will contain hints only for these three entities.

Unless otherwise changed through a setOperationRegistry the OperationRegistry used by the default instance is thread-safe.


getOperationRegistry

public OperationRegistry getOperationRegistry()
Returns theOperationRegistry being used by thisJAIinstance.

Unless otherwise changed through a setOperationRegistry the OperationRegistry returned by getDefaultInstance().getOperationRegistry() is thread-safe.


setOperationRegistry

public void setOperationRegistry(OperationRegistry operationRegistry)
Sets theOperationRegistry to be used by thisJAIinstance.

Throws:
IllegalArgumentException - if operationRegistry is null.

getTileScheduler

public TileScheduler getTileScheduler()
Returns the TileScheduler being used by thisJAIinstance.


setTileScheduler

public void setTileScheduler(TileScheduler tileScheduler)
Sets the TileScheduler to be used by thisJAI instance. The tileScheduler parameter will be added to the RenderingHints of this JAI instance.

Throws:
IllegalArgumentException - if tileScheduler is null.

getTileCache

public TileCache getTileCache()
Returns the TileCache being used by thisJAIinstance.


setTileCache

public void setTileCache(TileCache tileCache)
Sets the TileCache to be used by thisJAI instance. The tileCache parameter will be added to the RenderingHints of this JAI instance.

Throws:
IllegalArgumentException - if tileCache is null.

createTileCache

public static TileCache createTileCache(int tileCapacity,
                                        long memCapacity)
Deprecated. as of JAI 1.1 Refer to createTileCache(long memCapacity).

The default implementation constructs a TileCache with the given memory capacity in bytes. Users may supply an instance of TileCache to an operation by supplying a RenderingHint with a JAI.KEY_TILE_CACHE key and the desired TileCache instance as its value. Note that the absence of a tile cache hint will result in the use of the TileCache belonging to the defaultJAIinstance. To force an operation not to perform caching, a TileCache instance with a tile capacity of 0 may be used. An exception will be thrown if memCapacity is negative. Attempting to set either value larger than the JVM size may result in an OutOfMemory exception.


createTileCache

public static TileCache createTileCache(long memCapacity)
Constructs a TileCache with the given memory capacity in bytes. Users may supply an instance of TileCache to an operation by supplying a RenderingHint with a JAI.KEY_TILE_CACHE key and the desired TileCache instance as its value. Note that the absence of a tile cache hint will result in the use of the TileCache belonging to the defaultJAIinstance. To force an operation not to perform caching, a TileCache instance with a tile capacity of 0 may be used. An exception will be thrown if memCapacity is negative. Attempting to set either value larger than the JVM size may result in an OutOfMemory exception.

Since:
JAI 1.1

createTileCache

public static TileCache createTileCache()
Constructs a TileCache with the default memory capacity in bytes. Users may supply an instance of TileCache to an operation by supplying a RenderingHint with a JAI.KEY_TILE_CACHE key and the desired TileCache instance as its value. Note that the absence of a tile cache hint will result in the use of the TileCache belonging to the defaultJAIinstance. To force an operation not to perform caching, a TileCache instance with a tile capacity of 0 may be used.


createTileScheduler

public static TileScheduler createTileScheduler()
Constructs a TileScheduler with the default parallelism and priorities.

In the Sun Microsystems reference implementation of TileScheduler the default parallelism is 2, default priority is THREAD.NORM_PRIORITY, default prefetch parallelism is 1, and default prefetch priority is THREAD.MIN_PRIORITY.

Since:
JAI 1.1

create

public static RenderedOp create(String opName,
                                ParameterBlock args,
                                RenderingHints hints)
Creates a RenderedOp which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock, and applying the specified hints to the destination. This method should only be used when the final result returned is a single RenderedImage.

The defaultJAIinstance is used as the source of the registry and tile scheduler; that is, this method is equivalent to getDefaultInstance().createNS(opName, args, hints). The functionality of this method is the same as its corresponding non-static method createNS().

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
hints - The hints for the operation.
Returns:
A RenderedOp that represents the named operation, or null if the specified operation is in the "immediate" mode and the rendering of the PlanarImage failed.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the default operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the default operation registry does not support rendered image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.RenderedImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.

createNS

public RenderedOp createNS(String opName,
                           ParameterBlock args,
                           RenderingHints hints)
Creates a RenderedOp which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock, and applying the specified hints to the destination. This method should only be used when the final result returned is a single RenderedImage. However, the source(s) supplied may be a collection of rendered images or a collection of collections that at the very basic level include rendered images.

The supplied operation name is validated against the operation registry. The source(s) and/or parameter(s) in the ParameterBlock are validated against the named operation's descriptor, both in their numbers and types. Additional restrictions placed on the sources and parameters by an individual operation are also validated by calling its OperationDescriptor.validateArguments() method.

JAIallows a parameter to have a null input value, if that particular parameter has a default value specified in its operation's descriptor. In this case, the default value will replace the null input.

JAIalso allows unspecified tailing parameters, if these parameters have default values specified in the operation's descriptor. However, if a parameter, which has a default value, is followed by one or more parameters that have no default values, this parameter must be specified in the ParameterBlock, even if it only has a value of code>null.

The rendering hints associated with this instance of JAI are overlaid with the hints passed to this method. That is, the set of keys will be the union of the keys from the instance's hints and the hints parameter. If the same key exists in both places, the value from the hints parameter will be used.

This version of create is non-static; it may be used with a specific instance of theJAIclass. All of the static create() methods ultimately call this method, thus inheriting this method's error handling.

Since this method performs parameter checking, it may not be suitable for creating RenderedOp nodes meant to be passed to another host using the RemoteImage interface. For example, it might be necessary to refer to a file that is present only on the remote host. In such cases, it is possible to instantiate a RenderedOp directly, avoiding all checks.

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
hints - The hints for the operation.
Returns:
A RenderedOp that represents the named operation, or null if the specified operation is in the "immediate" mode and the rendering of the PlanarImage failed.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the current operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the current operation registry does not support rendered image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.RenderedImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.

createCollection

public static Collection createCollection(String opName,
                                          ParameterBlock args,
                                          RenderingHints hints)
Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock, and applying the specified hints to the destination. This method should only be used when the final result returned is a Collection. (This includes javax.media.jai.CollectionOps.)

The defaultJAIinstance is used as the source of the registry and tile scheduler; that is, this method is equivalent to getDefaultInstance().createCollectionNS(opName, args, hints). The functionality of this method is the same as its corresponding non-static method createCollectionNS().

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
hints - The hints for the operation.
Returns:
A Collection that represents the named operation, or null if the specified operation is in the "immediate" mode and the rendering of the PlanarImage failed.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the default operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the default operation registry does not support rendered image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.RenderedImage or a javax.media.jai.CollectionImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.

createCollectionNS

public Collection createCollectionNS(String opName,
                                     ParameterBlock args,
                                     RenderingHints hints)
Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock, and applying the specified hints to the destination. This method should only be used when the final result returned is a Collection. (This includes javax.media.jai.CollectionOps.) The source(s) supplied may be a collection of rendered images or a collection of collections that at the very basic level include rendered images. The source(s) supplied are unwrapped to create a single collection that contains RenderedOps and collections as many as the size of the smallest collection supplied in the sources. The nth collection is created using all supplied rendered images and the nth element of each of the collections supplied in the source.

The supplied operation name is validated against the operation registry. The source(s) and/or parameter(s) in the ParameterBlock are val>idated against the named operation's descriptor, both in their numbers and types. Additional restrictions placed on the sources and parameters by an individual operation are also validated by calling its OperationDescriptor.validateArguments() method.

JAIallows a parameter to have a null input value, if that particular parameter has a default value specified in its operation's descriptor. In this case, the default value will replace the null input.

JAIalso allows unspecified tailing parameters, if these parameters have default values specified in the operation's descriptor. However, if a parameter, which has a default value, is followed by one or more parameters that have no default values, this parameter must be specified in the ParameterBlock, even if it only has a value of code>null.

The rendering hints associated with this instance of JAI are overlaid with the hints passed to this method. That is, the set of keys will be the union of the keys from the instance's hints and the hints parameter. If the same key exists in both places, the value from the hints parameter will be used.

This version of createCollection is non-static; it may be used with a specific instance of the JAI class.

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
hints - The hints for the operation.
Returns:
A Collection that represents the named operation, or null if the specified operation is in the "immediate" mode and the rendering of the PlanarImage failed.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the current operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the current operation registry does not support rendered image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.RenderedImage or a javax.media.jai.CollectionImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.

create

public static RenderedOp create(String opName,
                                ParameterBlock args)
Creates a RenderedOp with null rendering hints.

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.

create

public static RenderedOp create(String opName,
                                Object param)
Creates a RenderedOp that takes 1 Object parameter.

Parameters:
opName - The name of the operation.
param - The Object parameter.

create

public static RenderedOp create(String opName,
                                Object param1,
                                Object param2)
Creates a RenderedOp that takes 2 Object parameters.

Parameters:
opName - The name of the operation.
param1 - The first Object parameter.
param2 - The second Object parameter.

create

public static RenderedOp create(String opName,
                                Object param1,
                                int param2)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 Object parameter and 1 int parameter

Parameters:
opName - The name of the operation.
param1 - The Object parameter.
param2 - The int parameter.

create

public static RenderedOp create(String opName,
                                Object param1,
                                Object param2,
                                Object param3)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 3 Object parameters.

Parameters:
opName - The name of the operation.
param1 - The first Object parameter.
param2 - The second Object parameter.
param3 - The third Object parameter.

create

public static RenderedOp create(String opName,
                                int param1,
                                int param2,
                                Object param3)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 2 int parameters and one Object parameter

Parameters:
opName - The name of the operation.
param1 - The first int parameter.
param2 - The second int parameter.
param3 - The Object parameter.

create

public static RenderedOp create(String opName,
                                Object param1,
                                Object param2,
                                Object param3,
                                Object param4)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 4 Object parameters.

Parameters:
opName - The name of the operation.
param1 - The first Object parameter.
param2 - The second Object parameter.
param3 - The third Object parameter.
param4 - The fourth Object parameter.

create

public static RenderedOp create(String opName,
                                Object param1,
                                int param2,
                                Object param3,
                                int param4)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 2 Object and 2 int parameters.

Parameters:
opName - The name of the operation.
param1 - The first Object parameter.
param2 - The first int parameter.
param3 - The second Object parameter.
param4 - The second int parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src)
Creates a RenderedOp that takes 1 RenderedImage source.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.

create

public static RenderedOp create(String opName,
                                Collection srcCol)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 Collection source.

Parameters:
opName - The name of the operation.
srcCol - The Collection src parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                Object param)
Creates a RenderedOp that takes 1 RenderedImage source and 1 Object parameter.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param - The Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                int param)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source and 1 int parameter.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param - The int parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                Object param1,
                                Object param2)
Creates a RenderedOp that takes 1 RenderedImage source and 2 Object parameters.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first object parameter.
param2 - The second Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                Object param1,
                                float param2)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source, 1 Object and 1 float parameter.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The Object parameter.
param2 - The float parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                Object param1,
                                Object param2,
                                Object param3)
Creates a RenderedOp that takes 1 RenderedImage source and 3 Object parameters.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first Object parameter.
param2 - The second Object parameter.
param3 - The third Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                Object param1,
                                int param2,
                                int param3)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source, 1 Object and 2 int parameters.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The Object parameter.
param2 - The first int parameter.
param3 - The second int parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                float param1,
                                float param2,
                                Object param3)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source, 2 float and 1 Object parameters.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first float parameter.
param2 - The second float parameter.
param3 - The Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                Object param1,
                                Object param2,
                                Object param3,
                                Object param4)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source and 4 Object parameters.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first Object parameter.
param2 - The second Object parameter.
param3 - The third Object parameter.
param4 - The fourth Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                Object param1,
                                Object param2,
                                int param3,
                                int param4)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source and 2 Object parameters and 2 int parameters

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first Object parameter.
param2 - The second Object parameter.
param3 - The first int parameter.
param4 - The second int parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                int param1,
                                int param2,
                                int param3,
                                int param4)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source and 4 int parameters.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first int parameter.
param2 - The second int parameter.
param3 - The third int parameter.
param4 - The fourth int parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                float param1,
                                float param2,
                                float param3,
                                Object param4)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source, 3 float and 1 Object parameters.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first float parameter.
param2 - The second float parameter.
param3 - The third float parameter.
param4 - The Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                Object param1,
                                Object param2,
                                Object param3,
                                Object param4,
                                Object param5)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source and 5 Object parameters.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first Object parameter.
param2 - The second Object parameter.
param3 - The third Object parameter.
param4 - The fourth Object parameter.
param5 - The fifth Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                float param1,
                                float param2,
                                float param3,
                                float param4,
                                Object param5)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source, 4 float parameters and one Object parameter.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first float parameter.
param2 - The second float parameter.
param3 - The third float parameter.
param4 - The fourth float parameter.
param5 - The Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                float param1,
                                int param2,
                                float param3,
                                float param4,
                                Object param5)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source, 3 float parameters, 1 int parameter and 1 Object parameter.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first float parameter.
param2 - The int parameter.
param3 - The second float parameter.
param4 - The third float parameter.
param5 - The Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                Object param1,
                                Object param2,
                                Object param3,
                                Object param4,
                                Object param5,
                                Object param6)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source and 6 Object parameters.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first Object parameter.
param2 - The second Object parameter.
param3 - The third Object parameter.
param4 - The fourth Object parameter.
param5 - The fifth Object parameter.
param6 - The sixth Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src,
                                int param1,
                                int param2,
                                int param3,
                                int param4,
                                int param5,
                                Object param6)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 1 RenderedImage source, 5 int parameters and 1 Object parameter.

Parameters:
opName - The name of the operation.
src - The RenderedImage src parameter.
param1 - The first int parameter.
param2 - The second int parameter.
param3 - The third int parameter.
param4 - The fourth int parameter.
param5 - The fifth int parameter.
param6 - The Object parameter.

create

public static RenderedOp create(String opName,
                                RenderedImage src1,
                                RenderedImage src2)
Creates a RenderedOp that takes 2 RenderedImage sources.

Parameters:
opName - The name of the operation.
src1 - The first RenderedImage src.
src2 - The second RenderedImage src.

create

public static RenderedOp create(String opName,
                                RenderedImage src1,
                                RenderedImage src2,
                                Object param1,
                                Object param2,
                                Object param3,
                                Object param4)
Deprecated. as of JAI 1.1. Instead use create(String,ParameterBlock).

Creates a RenderedOp that takes 2 RenderedImage sources and 4 Object parameters.

Parameters:
opName - The name of the operation.
src1 - The first RenderedImage src.
src2 - The second RenderedImage src.
param1 - The first Object parameter.
param2 - The second Object parameter.
param3 - The third Object parameter.
param4 - The fourth Object parameter.

createCollection

public static Collection createCollection(String opName,
                                          ParameterBlock args)
Creates a Collection with null rendering hints.

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.

createRenderable

public static RenderableOp createRenderable(String opName,
                                            ParameterBlock args,
                                            RenderingHints hints)
Creates a RenderableOp that represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock. This method should only be used when the final result returned is a single RenderdableImage.

The defaultJAIinstance is used as the source of the registry and tile scheduler; that is, this method is equivalent to getDefaultInstance().createRenderableNS(opName, args, hints). The functionality of this method is the same as its corresponding non-static method createRenderableNS().

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
hints - The hints for the operation.
Returns:
A RenderableOp that represents the named operation.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the default operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the default operation registry does not support renderable image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.renderable.RenderableImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.
Since:
JAI 1.1

createRenderable

public static RenderableOp createRenderable(String opName,
                                            ParameterBlock args)
Creates a RenderableOp that represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock. This method should only be used when the final result returned is a single RenderdableImage.

The defaultJAIinstance is used as the source of the registry and tile scheduler; that is, this method is equivalent to getDefaultInstance().createRenderableNS(opName, args, null). The functionality of this method is the same as its corresponding non-static method createRenderableNS().

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
Returns:
A RenderableOp that represents the named operation.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the default operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the default operation registry does not support renderable image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.renderable.RenderableImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.

createRenderableNS

public RenderableOp createRenderableNS(String opName,
                                       ParameterBlock args,
                                       RenderingHints hints)
Creates a RenderableOp that represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock. This method should only be used when the final result returned is a single RenderableImage. However, the source(s) supplied may be a collection of renderable images or a collection of collections that at the very basic level include renderable images.

The supplied operation name is validated against the operation registry. The source(s) and/or parameter(s) in the ParameterBlock are validated against the named operation's descriptor, both in their numbers and types. Additional restrictions placed on the sources and parameters by an individual operation are also validated by calling its OperationDescriptor.validateRenderableArguments() method.

JAIallows a parameter to have a null input value, if that particular parameter has a default value specified in its operation's descriptor. In this case, the default value will replace the null input.

JAIalso allows unspecified tailing parameters, if these parameters have default values specified in the operation's descriptor. However, if a parameter, which has a default value, is followed by one or more parameters that have no default values, this parameter must be specified in the ParameterBlock, even if it only has a value of code>null.

The rendering hints associated with this instance of JAI are overlaid with the hints passed to this method. That is, the set of keys will be the union of the keys from the instance's hints and the hints parameter. If the same key exists in both places, the value from the hints parameter will be used.

This version of the "createRenderable" is non-static; it may be used with a specific instance of theJAIclass.

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
hints - The hints for the operation.
Returns:
A RenderableOp that represents the named operation.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the current operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the current operation registry does not support renderable image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.renderable.RenderableImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.
Since:
JAI 1.1

createRenderableNS

public RenderableOp createRenderableNS(String opName,
                                       ParameterBlock args)
Deprecated. as of JAI 1.1 in favor of createRenderableNS(String,ParameterBlock,RenderingHints).

Creates a RenderableOp that represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock. This method should only be used when the final result returned is a single RenderableImage. However, the source(s) supplied may be a collection of renderable images or a collection of collections that at the very basic level include renderable images.

The supplied operation name is validated against the operation registry. The source(s) and/or parameter(s) in the ParameterBlock are validated against the named operation's descriptor, both in their numbers and types. Additional restrictions placed on the sources and parameters by an individual operation are also validated by calling its OperationDescriptor.validateRenderableArguments() method.

JAIallows a parameter to have a null input value, if that particular parameter has a default value specified in its operation's descriptor. In this case, the default value will replace the null input.

JAIalso allows unspecified tailing parameters, if these parameters have default values specified in the operation's descriptor. However, if a parameter, which has a default value, is followed by one or more parameters that have no default values, this parameter must be specified in the ParameterBlock, even if it only has a value of code>null.

The rendering hints associated with this instance of JAI are overlaid with the hints passed to this method. That is, the set of keys will be the union of the keys from the instance's hints and the hints parameter. If the same key exists in both places, the value from the hints parameter will be used.

This version of the "createRenderable" is non-static; it may be used with a specific instance of theJAIclass.

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
Returns:
A RenderableOp that represents the named operation.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the current operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the current operation registry does not support renderable image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.renderable.RenderableImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.
See Also:
createRenderableNS(String,ParameterBlock,RenderingHints)

createRenderableCollection

public static Collection createRenderableCollection(String opName,
                                                    ParameterBlock args,
                                                    RenderingHints hints)
Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock. This method should only be used when the final result returned is a Collection. (This includes javax.media.jai.CollectionOps.)

The defaultJAIinstance is used as the source of the registry and tile scheduler; that is, this method is equivalent to getDefaultInstance().createRenderableCollectionNS(opName, args,hints). The functionality of this method is the same as its corresponding non-static method createRenderableCollectionNS().

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
hints - The hints for the operation.
Returns:
A Collection that represents the named operation.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the default operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the default operation registry does not support renderable image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.renderable.RenderableImage or a javax.media.jai.CollectionImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.
Since:
JAI 1.1

createRenderableCollection

public static Collection createRenderableCollection(String opName,
                                                    ParameterBlock args)
Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock. This method should only be used when the final result returned is a Collection. (This includes javax.media.jai.CollectionOps.)

The defaultJAIinstance is used as the source of the registry and tile scheduler; that is, this method is equivalent to getDefaultInstance().createRenderableCollectionNS(opName, args,null). The functionality of this method is the same as its corresponding non-static method createRenderableCollectionNS().

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
Returns:
A Collection that represents the named operation.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the default operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the default operation registry does not support renderable image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.renderable.RenderableImage or a javax.media.jai.CollectionImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.

createRenderableCollectionNS

public Collection createRenderableCollectionNS(String opName,
                                               ParameterBlock args)
Deprecated. as of JAI 1.1 in favor of createRenderableCollectionNS(String,ParameterBlock,RenderingHints).

Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock. This method should only be used when the final result returned is a Collection. (This includes javax.media.jai.CollectionOps.) The source(s) supplied may be a collection of renderable images or a collection of collections that at the very basic level include renderable images. The source(s) supplied are unwrapped to create a single collection that contains RenderableOps and collections as many as the size of the smallest collection supplied in the sources. The nth collection is created using all supplied renderable images and the nth element of each of the collections supplied in the source.

This method should be used to create a Collection in the renderable image mode.

The supplied operation name is validated against the operation registry. The source(s) and/or parameter(s) in the ParameterBlock are validated against the named operation's descriptor, both in their numbers and types. Additional restrictions placed on the sources and parameters by an individual operation are also validated by calling its OperationDescriptor.validateRenderableArguments() method.

JAIallows a parameter to have a null input value, if that particular parameter has a default value specified in its operation's descriptor. In this case, the default value will replace the null input.

JAIalso allows unspecified tailing parameters, if these parameters have default values specified in the operation's descriptor. However, if a parameter, which has a default value, is followed by one or more parameters that have no default values, this parameter must be specified in the ParameterBlock, even if it only has a value of code>null.

This version of createRenderableCollection is non-static; it may be used with a specific instance of the JAI class.

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
Returns:
A Collection that represents the named operation.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the current operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the current operation registry does not support renderable image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.renderable.RenderableImage or a javax.media.jai.CollectionImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.
See Also:
createRenderableCollectionNS(String,ParameterBlock,RenderingHints)

createRenderableCollectionNS

public Collection createRenderableCollectionNS(String opName,
                                               ParameterBlock args,
                                               RenderingHints hints)
Creates a Collection which represents the named operation, using the source(s) and/or parameter(s) specified in the ParameterBlock. This method should only be used when the final result returned is a Collection. (This includes javax.media.jai.CollectionOps.) The source(s) supplied may be a collection of renderable images or a collection of collections that at the very basic level include renderable images. The source(s) supplied are unwrapped to create a single collection that contains RenderableOps and collections as many as the size of the smallest collection supplied in the sources. The nth collection is created using all supplied renderable images and the nth element of each of the collections supplied in the source.

This method should be used to create a Collection in the renderable image mode.

The supplied operation name is validated against the operation registry. The source(s) and/or parameter(s) in the ParameterBlock are validated against the named operation's descriptor, both in their numbers and types. Additional restrictions placed on the sources and parameters by an individual operation are also validated by calling its OperationDescriptor.validateRenderableArguments() method.

JAIallows a parameter to have a null input value, if that particular parameter has a default value specified in its operation's descriptor. In this case, the default value will replace the null input.

JAIalso allows unspecified tailing parameters, if these parameters have default values specified in the operation's descriptor. However, if a parameter, which has a default value, is followed by one or more parameters that have no default values, this parameter must be specified in the ParameterBlock, even if it only has a value of code>null.

The rendering hints associated with this instance of JAI are overlaid with the hints passed to this method. That is, the set of keys will be the union of the keys from the instance's hints and the hints parameter. If the same key exists in both places, the value from the hints parameter will be used.

This version of createRenderableCollection is non-static; it may be used with a specific instance of the JAI class.

Parameters:
opName - The name of the operation.
args - The source(s) and/or parameter(s) for the operation.
hints - The hints for the operation.
Returns:
A Collection that represents the named operation.
Throws:
IllegalArgumentException - if opName is null.
IllegalArgumentException - if args is null.
IllegalArgumentException - if no OperationDescriptor is registered under the specified operation name in the current operation registry.
IllegalArgumentException - if the OperationDescriptor registered under the specified operation name in the current operation registry does not support renderable image mode.
IllegalArgumentException - if the specified operation does not produce a java.awt.image.renderable.RenderableImage or a javax.media.jai.CollectionImage.
IllegalArgumentException - if the specified operation is unable to handle the sources and parameters specified in args.
Since:
JAI 1.1

getRenderingHints

public RenderingHints getRenderingHints()
Returns the RenderingHints associated with this JAI instance. These rendering hints will be merged with any hints supplied as an argument to the createNS(), createRenderableNS(), or createCollectionNS() methods.


setRenderingHints

public void setRenderingHints(RenderingHints hints)
Sets the RenderingHints associated with this JAI instance. These rendering hints will be merged with any hints supplied as an argument to the createNS(), createRenderableNS(), or createCollectionNS() methods.

The hints argument must be non-null, otherwise a IllegalArgumentException will be thrown.


clearRenderingHints

public void clearRenderingHints()
Clears the RenderingHints associated with this JAI instance.


getRenderingHint

public Object getRenderingHint(RenderingHints.Key key)
Returns the hint value associated with a given key in this JAI instance, or null if no value is associated with the given key.

Throws:
IllegalArgumentException - if key is null.

setRenderingHint

public void setRenderingHint(RenderingHints.Key key,
                             Object value)
Sets the hint value associated with a given key in this JAI instance.

Throws:
IllegalArgumentException - if key is null.
IllegalArgumentException - if value is null.
IllegalArgumentException - if value is not of the correct type for the given hint.

removeRenderingHint

public void removeRenderingHint(RenderingHints.Key key)
Removes the hint value associated with a given key in this JAI instance.


setImagingListener

public void setImagingListener(ImagingListener listener)
Sets an ImagingListener object on this JAI.


getImagingListener

public ImagingListener getImagingListener()
Gets the ImagingListener object from this JAI.

Returns:
The ImagingListener object that currently resides in this JAI.