## javax.media.jai
Class OpImage

    java.lang.Object
      |
      +--javax.media.jai.PlanarImage
            |
            +--javax.media.jai.OpImage

All Implemented Interfaces:
  ImageJAI, PropertyChangeEmitter, PropertySource, java.awt.image.RenderedImage, WritablePropertySource

Direct Known Subclasses:
  AreaOpImage, GeometricOpImage, PointOpImage, SourcelessOpImage, StatisticsOpImage, UntiledOpImage

public abstract class OpImage
extends PlanarImage

This is the base class for all image operations. It provides a home for information and functionalities common to all the op-image classes, and implements various utility methods that may be useful to a specific operation. Image operations may be divided into different categories based on their characteristics. A subclass, extending `OpImage`, represents a category and implements methods unique and common to those operations. Each individual operator should extend the subclass that represents the specific category that operator belongs to.

The layout variables of an `OpImage` is inherited from the `PlanarImage` superclass. The layout should be set when the `OpImage` is constructed. Each subclass must set the appropriate layout variables and supply them via the `ImageLayout` argument at construction time. This class simply modifies these settings as described in the `OpImage` constructor comments before forwarding the layout to the `PlanarImage` constructor. If a subclass needs to modify any of the layout settings subsequent to invoking its superclass constructors it should use the `setImageLayout()` method defined in `PlanarImage` in preference to setting the layout variables directly.

A `RenderedImage`'s pixel data type and number of bands are defined by its `SampleModel`, while the `ColorModel` translates the pixel data into color/alpha components in the specific `ColorSpace` that is associated with the `ColorModel`.

By default, the operators provided by Java Advanced Imaging (JAI) operate on the image's pixel data only. That is, the computations are performed on the data described by the image's `SampleModel`. No color translation is performed prior to the actual computation by the operator, regardless of the type of the `ColorModel` an image has. If a user intends to have an operation performed on the color data, he must perform the color translation explicitly prior to invoking the operation.

There are those operators that specifically deal with the color/alpha data of an image. Such an operator must state its behavior in its `OperationDescriptor` explicitly and explain its intended usage of the image's color/alpha component data. In such cases, the image's `ColorModel` as well as the associated `ColorSpace` should be considered.

The tile cache and scheduler are handled by this class. JAI provides a default implementation for `TileCache` and `TileScheduler`. However, they may be overriden by each application. An `OpImage` may share a common cache with other `OpImage`s, or it may have a private cache of its own. To override an existing cache, use the `setTileCache` method; an input argument of `null` indicates that this image should not have a tile cache.

The `getTile` method may be used to request a tile of the image. The default implementation of this method in this class first checks whether the requested tile is in the tile cache, and if not, uses the default `TileScheduler` to schedule the tile for computation. Once the tile has been computed, it is added to the cache and returned as a `Raster`.

The JAI tile scheduler assumes that when a request is made to schedule a tile for computation via the `scheduleTile` method, that tile is not currently in the cache. To avoid a cycle, it calls `OpImage.computeTile` for the actual tile computation.

The default implementation of the `computeTile` method in this class first creates a new `Raster` to represent the requested tile, then calls one of the two `computeRect` methods to compute the actual pixel values and store the result in the `DataBuffer` of the `Raster`.

Two variants of the `computeRect` method exist.

The first (with input arguments `Raster[]`, `WritableRaster`, and `Rectangle`) is used when the `OpImage` is constructed with the `cobbleSources` argument set to `true`. This indicates that the source data must be cobbled into a single `Raster` and that all the necessary source data are provided in order to compute the rectangular region of the destination image. The source `Raster` array contains one entry for each source image.

The second (with input arguments `PlanarImage[]`, `WritableRaster`, and `Rectangle`) is used when the `OpImage` is constructed with the `cobbleSources` argument set to `false`. This indicates that the source data are not cobbled into a single `Raster`; instead an array of `PlanarImage`s, one for each source, supply the source data and each image is responsible for performing its own data accesses. This variant is generally useful if iterators are to be used for the underlying implementation of accessing the image data.

The two `computeRect` methods are not abstract because normally only one needs to be implemented by the subclass depending on the `cobbleSources` value. The default implementation of these two methods in this class throws a `RuntimeException`.

Every operator who follows the above default implementation must supply an overridden version of at least one of the `computeRect` method variants, and specify which one is to be called via the `cobbleSources` argument of the constructor, or an exception will be thrown at run time.

If a subclass overrides `getTile` not to call `computeTile`, does not use the JAI implementation of `TileScheduler`, overrides `computeTile` not to call `computeRect`, or does not follow the above default implementation in any way, then it may need to handle issues such as tile caching, multi-threading, and etc. by itself and may not need to override some of the methods described above. In some cases, some of the methods or variables are even irrelevant. However, subclasses should be careful when not following the default path for computing a tile. Most importantly, when a subclass overrides `getTile`, it should also override `computeTile`.

To request multiple tiles at a time, it is preferable to call the `getTiles` method with a complete list of the requested tiles' indices, than to call `getTile` once per tile. The implementation of `getTiles` in this class is optimized using multi-threading so that multiple tiles are computed simultaneously.

See Also:
  `PlanarImage`, `AreaOpImage`, `GeometricOpImage`, `PointOpImage`, `StatisticsOpImage`, `SourcelessOpImage`

Field Summary
`protected TileCache` `cache` The cache object used to cache this image's tiles.
`protected boolean` `cobbleSources` Indicates which one of the two `computeRect` variants should be called by the `computeTile` method.
`static int` `OP_COMPUTE_BOUND` A constant indicating that an operation is likely to spend its time mainly performing computation.
`static int` `OP_IO_BOUND` A constant indicating that an operation is likely to spend its time mainly performing local I/O.
`static int` `OP_NETWORK_BOUND` A constant indicating that an operation is likely to spend its time mainly performing network I/O.
`protected java.lang.Object` `tileCacheMetric` Metric used to produce an ordered list of tiles.

Fields inherited from class javax.media.jai.PlanarImage
`colorModel, eventManager, height, minX, minY, properties, sampleModel, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, width`

Constructor Summary
`OpImage(java.util.Vector sources, ImageLayout layout, java.util.Map configuration, boolean cobbleSources)` Constructor.

Method Summary
`protected void` `addTileToCache(int tileX, int tileY, java.awt.image.Raster tile)` Adds a tile to the tile cache.
`void` `cancelTiles(java.awt.Point[] tileIndices)` Issue an advisory cancellation request to nullify processing of the indicated tiles via the TileScheduler for this image.
`protected void` `computeRect(PlanarImage[] sources, java.awt.image.WritableRaster dest, java.awt.Rectangle destRect)` Computes a rectangle of output, given `PlanarImage` sources.
`protected void` `computeRect(java.awt.image.Raster[] sources, java.awt.image.WritableRaster dest, java.awt.Rectangle destRect)` Computes a rectangle of output, given `Raster` sources.
`boolean` `computesUniqueTiles()` Returns `true` if the `OpImage` returns an unique `Raster` object every time `computeTile` is called.
`java.awt.image.Raster` `computeTile(int tileX, int tileY)` Computes the image data of a tile.
`protected void` `finalize()` Uncaches all the tiles when this image is garbage collected.
`static int` `getExpandedNumBands(java.awt.image.SampleModel sampleModel, java.awt.image.ColorModel colorModel)` Deprecated. as of 1.1.
`protected RasterFormatTag[]` `getFormatTags()` Returns the image's format tags to be used with a `RasterAccessor`.
`int` `getOperationComputeType()` Returns one of `OP_COMPUTE_BOUND`, `OP_IO_BOUND`, or `OP_NETWORK_BOUND` to indicate how the operation is likely to spend its time.
`java.awt.image.Raster` `getTile(int tileX, int tileY)` Returns a tile of this image as a `Raster`.
`TileCache` `getTileCache()` Returns the tile cache object of this image by reference.
`java.lang.Object` `getTileCacheMetric()` Returns the `tileCacheMetric` instance variable by reference.
`java.awt.Point[]` `getTileDependencies(int tileX, int tileY, int sourceIndex)` Returns a list of indices of the tiles of a given source image that may be required in order to compute a given tile.
`protected java.awt.image.Raster` `getTileFromCache(int tileX, int tileY)` Retrieves a tile from the tile cache.
`java.awt.image.Raster[]` `getTiles(java.awt.Point[] tileIndices)` Computes the tiles indicated by the given tile indices.
`boolean` `hasExtender(int sourceIndex)` Deprecated. as of 1.1.
`abstract java.awt.Rectangle` `mapDestRect(java.awt.Rectangle destRect, int sourceIndex)` Returns a conservative estimate of the region of a specified source that is required in order to compute the pixels of a given destination rectangle.
`abstract java.awt.Rectangle` `mapSourceRect(java.awt.Rectangle sourceRect, int sourceIndex)` Returns a conservative estimate of the destination region that can potentially be affected by the pixels of a rectangle of a given source.
`void` `prefetchTiles(java.awt.Point[] tileIndices)` Hints that the given tiles might be needed in the near future.
`void` `queueTiles(java.awt.Point[] tileIndices)` Queues a list of tiles for computation.
`void` `setTileCache(TileCache cache)` Sets the tile cache object of this image.
`protected static java.util.Vector` `vectorize(java.awt.image.RenderedImage image)` Stores a `RenderedImage` in a `Vector`.
`protected static java.util.Vector` `vectorize(java.awt.image.RenderedImage image1, java.awt.image.RenderedImage image2)` Stores two `RenderedImage`s in a `Vector`.
`protected static java.util.Vector` `vectorize(java.awt.image.RenderedImage image1, java.awt.image.RenderedImage image2, java.awt.image.RenderedImage image3)` Stores three `RenderedImage`s in a `Vector`.

Methods inherited from class javax.media.jai.PlanarImage

`addPropertyChangeListener, addPropertyChangeListener, addSink, addSink, addSource, addTileComputationListener, copyData, copyData, copyExtendedData, createColorModel, createSnapshot, dispose, getAsBufferedImage, getAsBufferedImage, getBounds, getColorModel, getData, getData, getDefaultColorModel, getExtendedData, getGraphics, getHeight, getMaxTileX, getMaxTileY, getMaxX, getMaxY, getMinTileX, getMinTileY, getMinX, getMinY, getNumBands, getNumSources, getNumXTiles, getNumYTiles, getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNames, getSampleModel, getSinks, getSource, getSourceImage, getSourceObject, getSources, getSplits, getTileComputationListeners, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileIndices, getTileRect, getTiles, getTileWidth, getWidth, removeProperty, removePropertyChangeListener, removePropertyChangeListener, removeSink, removeSink, removeSinks, removeSource, removeSources, removeTileComputationListener, setImageLayout, setProperties, setProperty, setSource, setSources, tileXToX, tileXToX, tileYToY, tileYToY, toString, wrapRenderedImage, XToTileX, XToTileX, YToTileY, YToTileY`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### OP_COMPUTE_BOUND

    public static final int OP_COMPUTE_BOUND

  A constant indicating that an operation is likely to spend its time mainly performing computation.

### OP_IO_BOUND

    public static final int OP_IO_BOUND

  A constant indicating that an operation is likely to spend its time mainly performing local I/O.

### OP_NETWORK_BOUND

    public static final int OP_NETWORK_BOUND

  A constant indicating that an operation is likely to spend its time mainly performing network I/O.

### cache

    protected transient TileCache cache

  The cache object used to cache this image's tiles. It may refer to a common cache shared by many `OpImage`s or a private cache for this image only. If it is `null`, it indicates that this image does not have a tile cache.

### tileCacheMetric

    protected java.lang.Object tileCacheMetric

  Metric used to produce an ordered list of tiles. This determines which tiles are removed from the cache first if a memory control operation is required.

### cobbleSources

    protected boolean cobbleSources

  Indicates which one of the two `computeRect` variants should be called by the `computeTile` method. If it is `true`, `computeRect` expects contiguous sources.

Constructor Detail

### OpImage

    public OpImage(java.util.Vector sources,
                   ImageLayout layout,
                   java.util.Map configuration,
                   boolean cobbleSources)

  Constructor.

  The image's layout is encapsulated in the `layout` argument. The variables of the image layout which are not set in the `layout` parameter are copied from the first source if sources are available. In the case of the `ColorModel`, the copy is performed if and only if the `ColorModel` is compatible with the destination `SampleModel`.

  If either of the tile dimensions are not set in the layout parameter and there is a global default tile setting (`JAI.getDefaultTileSize()` returns non-`null`) then reset each tile dimension independently if the image would be untiled in that dimension with size at least double that of the respective tile dimension.

  The `sources` contains a list of immediate source images of this image. All sources must be `RenderedImage`s and may not be `null`. If this image has no source this argument should be `null`. This parameter is forwarded unmodified to the `PlanarImage` constructor.

  The `configuration` contains a mapping of configuration variables and image properties. Entries which have keys of type `RenderingHints.Key` are taken to be configuration variables. Entries with a key which is either a `String` or a `CaselessStringKey` are interpreted as image properties. This parameter is forwarded unmodified to the `PlanarImage` constructor.

  This image class recognizes the configuration variables referenced by the following keys:

  - `JAI.KEY_TILE_CACHE`: specifies the `TileCache` in which to store the image tiles; if this key is not supplied no tile caching will be performed.
  - `JAI.KEY_TILE_CACHE_METRIC`: establishes an ordering of tiles stored in the tile cache. This ordering is used to determine which tiles will be removed first, if a condition causes tiles to be removed from the cache.
  - `JAI.KEY_TILE_SCHEDULER`: specifies the `TileScheduler` to use to schedule tile computation; if this key is not supplied the default scheduler will be used.
  - `JAI.KEY_DEFAULT_COLOR_MODEL_ENABLED`: specifies whether a default `ColorModel` will be derived if none is specified and one cannot be inherited from the first source; if this key is not supplied a default `ColorModel` will be computed if necessary.
  - `JAI.KEY_DEFAULT_COLOR_MODEL_METHOD`: specifies the method to be used to compute the default `ColorModel`; if this key is not supplied and a default `ColorModel` is required, `PlanarImage.createColorModel()` will be used to compute it.

  The `cobbleSources` indicates which one of the two variants of the `computeRect` method should be called. If a subclass does not follow the default tile computation scheme, then this argument may be irrelevant.

  Parameters:
    `layout` - The layout of this image.
    `sources` - The immediate sources of this image.
    `configuration` - Configurable attributes of the image including configuration variables indexed by `RenderingHints.Key`s and image properties indexed by `String`s or `CaselessStringKey`s. This parameter may be `null`.
    `cobbleSources` - Indicates which variant of the `computeRect` method should be called.
  Throws:
    `java.lang.IllegalArgumentException` - If any object in `sources` is `null`.
    `ClassCastException` - If any object in `sources` is not a `RenderedImage`.
    `java.lang.RuntimeException` - If default `ColorModel` setting is enabled via a hint in the configuration `Map` and the supplied `Method` does not conform to the requirements stated in the `JAI` class for the hint key `KEY_DEFAULT_COLOR_MODEL_METHOD`.

Method Detail

### vectorize

    protected static java.util.Vector vectorize(java.awt.image.RenderedImage image)

  Stores a `RenderedImage` in a `Vector`.
  Parameters:
    `image` - The image to be stored in the `Vector`.
  Returns:
    A `Vector` containing the image.

### vectorize

    protected static java.util.Vector vectorize(java.awt.image.RenderedImage image1,
                                                java.awt.image.RenderedImage image2)

  Stores two `RenderedImage`s in a `Vector`.
  Parameters:
    `image1` - The first image to be stored in the `Vector`.
    `image2` - The second image to be stored in the `Vector`.
  Returns:
    A `Vector` containing the images.

### vectorize

    protected static java.util.Vector vectorize(java.awt.image.RenderedImage image1,
                                                java.awt.image.RenderedImage image2,
                                                java.awt.image.RenderedImage image3)

  Stores three `RenderedImage`s in a `Vector`.
  Parameters:
    `image1` - The first image to be stored in the `Vector`.
    `image2` - The second image to be stored in the `Vector`.
    `image3` - The third image to be stored in the `Vector`.
  Returns:
    A `Vector` containing the images.

### getTileCache

    public TileCache getTileCache()

  Returns the tile cache object of this image by reference. If this image does not have a tile cache, this method returns `null`.

### setTileCache

    public void setTileCache(TileCache cache)

  Sets the tile cache object of this image. A `null` input indicates that this image should have no tile cache and subsequently computed tiles will not be cached.

  The existing cache object is informed to release all the currently cached tiles of this image.

  Parameters:
    `cache` - A cache object to be used for caching this image's tiles, or `null` if no tile caching is desired.

### getTileFromCache

    protected java.awt.image.Raster getTileFromCache(int tileX,
                                                     int tileY)

  Retrieves a tile from the tile cache. If this image does not have a tile cache, or the requested tile is not currently in the cache, this method returns `null`.
  Parameters:
    `tileX` - The X index of the tile.
    `tileY` - The Y index of the tile.
  Returns:
    The requested tile as a `Raster` or `null`.

### addTileToCache

    protected void addTileToCache(int tileX,
                                  int tileY,
                                  java.awt.image.Raster tile)

  Adds a tile to the tile cache. If this image does not have a tile cache, this method does nothing.
  Parameters:
    `tileX` - The X index of the tile.
    `tileY` - The Y index of the tile.
    `tile` - The tile to be added to the cache.

### getTileCacheMetric

    public java.lang.Object getTileCacheMetric()

  Returns the `tileCacheMetric` instance variable by reference.

### getTile

    public java.awt.image.Raster getTile(int tileX,
                                         int tileY)

  Returns a tile of this image as a `Raster`. If the requested tile is completely outside of this image's bounds, this method returns `null`.

  This method attempts to retrieve the requested tile from the cache. If the tile is not currently in the cache, it schedules the tile for computation and adds it to the cache once the tile has been computed.

  If a subclass overrides this method, then it needs to handle tile caching and scheduling. It should also override `computeTile()` which may be invoked directly by the `TileScheduler`.

  Overrides:
    `getTile` in class `PlanarImage`
  Parameters:
    `tileX` - The X index of the tile.
    `tileY` - The Y index of the tile.

### computeTile

    public java.awt.image.Raster computeTile(int tileX,
                                             int tileY)

  Computes the image data of a tile.

  When a tile is requested via the `getTile` method and that tile is not in this image's tile cache, this method is invoked by the `TileScheduler` to compute the data of the new tile. Even though this method is marked `public`, it should not be called by the applications directly. Rather, it is meant to be called by the `TileScheduler` for the actual computation.

  The implementation of this method in this class assumes that the requested tile either intersects the image, or is within the image's bounds. It creates a new `Raster` to represent the requested tile, then calls one of the two variants of `computeRect` to calculate the pixels of the tile that are within the image's bounds. The value of `cobbleSources` determines which variant of `computeRect` is invoked, as described in the class comments.

  Subclasses may provide a more optimized implementation of this method. If they override this method not to call either variant of `computeRect`, then neither variant of `computeRect` needs to be implemented.

  Parameters:
    `tileX` - The X index of the tile.
    `tileY` - The Y index of the tile.

### computeRect

    protected void computeRect(java.awt.image.Raster[] sources,
                               java.awt.image.WritableRaster dest,
                               java.awt.Rectangle destRect)

  Computes a rectangle of output, given `Raster` sources. This method should be overridden by `OpImage` subclasses that make use of cobbled sources, as determined by the setting of the `cobbleSources` constructor argument to this class.

  The source `Raster`s are guaranteed to include at least the area specified by `mapDestRect(destRect)`. Only the specified destination region should be written.

  Since the subclasses of `OpImage` may choose between the cobbling and non-cobbling versions of `computeRect`, it is not possible to leave this method abstract in `OpImage`. Instead, a default implementation is provided that throws a `RuntimeException`.

  Parameters:
    `sources` - an array of source `Raster`s, one per source image.
    `dest` - a `WritableRaster` to be filled in.
    `destRect` - the `Rectangle` within the destination to be written.
  Throws:
    `java.lang.RuntimeException` - If this method is invoked on the subclass that sets `cobbleSources` to `true` but does not supply an implementation of this method.

### computeRect

    protected void computeRect(PlanarImage[] sources,
                               java.awt.image.WritableRaster dest,
                               java.awt.Rectangle destRect)

  Computes a rectangle of output, given `PlanarImage` sources. This method should be overridden by `OpImage` subclasses that do not require cobbled sources; typically they will instantiate iterators to perform source access, but they may access sources directly (via the `SampleModel`/`DataBuffer` interfaces) if they wish.

  Since the subclasses of `OpImage` may choose between the cobbling and non-cobbling versions of `computeRect`, it is not possible to leave this method abstract in `OpImage`. Instead, a default implementation is provided that throws a `RuntimeException`.

  Parameters:
    `sources` - an array of `PlanarImage` sources.
    `dest` - a `WritableRaster` to be filled in.
    `destRect` - the `Rectangle` within the destination to be written.
  Throws:
    `java.lang.RuntimeException` - If this method is invoked on the subclass that sets `cobbleSources` to `false` but does not supply an implementation of this method.

### getTileDependencies

    public java.awt.Point[] getTileDependencies(int tileX,
                                                int tileY,
                                                int sourceIndex)

  Returns a list of indices of the tiles of a given source image that may be required in order to compute a given tile. Ideally, only tiles that will be requested by means of calls to the source's `getTile()` method should be reported. The default implementation uses `mapDestRect()` to obtain a conservative estimate.

  If no dependencies exist, this method returns `null`.

  This method may be used by optimized implementations of JAI in order to predict future work and create an optimized schedule for performing it.

  A given `OpImage` may mix calls to `getTile()` with calls to other methods such as `getData()` and `copyData()` in order to avoid requesting entire tiles where only a small portion is needed. In such a case, this method may be overridden to provide a more accurate estimate of the set of `getTile()` calls that will actually be performed.

  Parameters:
    `tileX` - the X index of the tile.
    `tileY` - the Y index of the tile.
    `sourceIndex` - the index of the source image.
  Returns:
    An array of `Point`s indicating the source tile dependencies.
  Throws:
    `java.lang.IllegalArgumentException` - If `sourceIndex` is negative or greater than the index of the last source.

### getTiles

    public java.awt.image.Raster[] getTiles(java.awt.Point[] tileIndices)

  Computes the tiles indicated by the given tile indices. This call is preferable to a series of `getTile()` calls because certain implementations can make optimizations based on the knowledge that multiple tiles are being asked for at once.

  The implementation of this method in this class uses multiple threads to compute multiple tiles at a time.

  Overrides:
    `getTiles` in class `PlanarImage`
  Parameters:
    `tileIndices` - An array of `Point`s representing tile indices.
  Returns:
    An array of `Raster`s containing the tiles corresponding to the given tile indices.
  Throws:
    `java.lang.IllegalArgumentException` - If `tileIndices` is `null`.

### queueTiles

    public void queueTiles(java.awt.Point[] tileIndices)

  Queues a list of tiles for computation. Registered listeners will be notified after each tile has been computed or when the entire list of tiles has been computed depending on the value returned by `listener.isPerTileListener()`.
  Overrides:
    `queueTiles` in class `PlanarImage`
  Throws:
    `java.lang.IllegalArgumentException` - If `tileIndices` is `null`.

### cancelTiles

    public void cancelTiles(java.awt.Point[] tileIndices)

  Issue an advisory cancellation request to nullify processing of the indicated tiles via the TileScheduler for this image.
  Overrides:
    `cancelTiles` in class `PlanarImage`
  Throws:
    `java.lang.IllegalArgumentException` - If `tileIndices` is `null`.

### prefetchTiles

    public void prefetchTiles(java.awt.Point[] tileIndices)

  Hints that the given tiles might be needed in the near future. Some implementations may spawn one or more threads to compute the tiles, while others may ignore the hint.
  Overrides:
    `prefetchTiles` in class `PlanarImage`
  Parameters:
    `tileIndices` - A list of tile indices indicating which tiles to prefetch.
  Throws:
    `java.lang.IllegalArgumentException` - If `tileIndices` is `null`.

### mapSourceRect

    public abstract java.awt.Rectangle mapSourceRect(java.awt.Rectangle sourceRect,
                                                     int sourceIndex)

  Returns a conservative estimate of the destination region that can potentially be affected by the pixels of a rectangle of a given source.
  Parameters:
    `sourceRect` - The `Rectangle` in source coordinates.
    `sourceIndex` - The index of the source image.
  Returns:
    A `Rectangle` indicating the potentially affected destination region, or `null` if the region is unknown.
  Throws:
    `java.lang.IllegalArgumentException` - If the source index is negative or greater than that of the last source.
    `java.lang.IllegalArgumentException` - If `sourceRect` is `null`.

### mapDestRect

    public abstract java.awt.Rectangle mapDestRect(java.awt.Rectangle destRect,
                                                   int sourceIndex)

  Returns a conservative estimate of the region of a specified source that is required in order to compute the pixels of a given destination rectangle.
  Parameters:
    `destRect` - The `Rectangle` in destination coordinates.
    `sourceIndex` - The index of the source image.
  Returns:
    A `Rectangle` indicating the required source region.
  Throws:
    `java.lang.IllegalArgumentException` - If the source index is negative or greater than that of the last source.
    `java.lang.IllegalArgumentException` - If `destRect` is `null`.

### getOperationComputeType

    public int getOperationComputeType()

  Returns one of `OP_COMPUTE_BOUND`, `OP_IO_BOUND`, or `OP_NETWORK_BOUND` to indicate how the operation is likely to spend its time. The answer does not affect the output of the operation, but may allow a scheduler to parallelize the computation of multiple operations more effectively.

  The implementation of this method in this class returns `OP_COMPUTE_BOUND`.

### computesUniqueTiles

    public boolean computesUniqueTiles()

  Returns `true` if the `OpImage` returns an unique `Raster` object every time `computeTile` is called. `OpImage`s that internally cache `Raster`s and return them via `computeTile` should return `false` for this method.

  The implementation of this method in this class always returns `true`.

### finalize

    protected void finalize()
                     throws java.lang.Throwable

  Uncaches all the tiles when this image is garbage collected.
  Overrides:
    `finalize` in class `PlanarImage`
  Following copied from class: `javax.media.jai.PlanarImage`
  Throws:
    ``Throwable`` - if an error occurs in the garbage collector.

### hasExtender

    public boolean hasExtender(int sourceIndex)

  Deprecated. as of 1.1.

  Indicates whether the source with the given index has a `BorderExtender`. If the source index is out of bounds for the source vector of this `OpImage` then an `ArrayIndexOutOfBoundsException` may be thrown.
  Parameters:
    `sourceIndex` - The index of the source in question.
  Returns:
    `true` if the indicated source has an extender.

### getExpandedNumBands

    public static int getExpandedNumBands(java.awt.image.SampleModel sampleModel,
                                          java.awt.image.ColorModel colorModel)

  Deprecated. as of 1.1.

  Returns the effective number of bands of an image with a given `SampleModel` and `ColorModel`. Normally, this is given by `sampleModel.getNumBands()`, but for images with an `IndexColorModel` the effective number of bands is given by `colorModel.getNumComponents()`, since a single physical sample represents multiple color components.

### getFormatTags

    protected RasterFormatTag[] getFormatTags()

  Returns the image's format tags to be used with a `RasterAccessor`.

  This method will compute and cache the tags the first time it is called on a particular image. The image's `SampleModel` and `ColorModel` must be set to their final values before calling this method.