| java.lang.Object javax.media.jai.PlanarImage javax.media.jai.OpImage javax.media.jai.AreaOpImage
All known Subclasses: com.sun.media.jai.opimage.DilateOpImage, com.sun.media.jai.mlib.MlibMinFilterOpImage, com.sun.media.jai.mlib.MlibSeparableConvolveOpImage, com.sun.media.jai.opimage.GradientOpImage, com.sun.media.jai.mlib.MlibDilate3SquareOpImage, com.sun.media.jai.mlib.MlibErode3SquareOpImage, com.sun.media.jai.opimage.ErodeBinaryOpImage, com.sun.media.jai.mlib.MlibErode3PlusOpImage, com.sun.media.jai.mlib.MlibDilate3PlusOpImage, com.sun.media.jai.opimage.ConvolveOpImage, com.sun.media.jai.opimage.MaxFilterOpImage, com.sun.media.jai.mlib.MlibSobelOpImage, com.sun.media.jai.opimage.ErodeOpImage, com.sun.media.jai.mlib.MlibGradientOpImage, com.sun.media.jai.opimage.SeparableConvolveOpImage, com.sun.media.jai.mlib.MlibConvolveOpImage, com.sun.media.jai.mlib.MlibMaxFilterOpImage, com.sun.media.jai.opimage.DilateBinaryOpImage, com.sun.media.jai.opimage.MinFilterOpImage, com.sun.media.jai.mlib.MlibMedianFilterOpImage, com.sun.media.jai.opimage.MedianFilterOpImage, com.sun.media.jai.mlib.MlibConvolveNxNOpImage, com.sun.media.jai.opimage.Convolve3x3OpImage,
AreaOpImage | abstract public class AreaOpImage extends OpImage (Code) | | An abstract base class for image operators that require only a
fixed rectangular source region around a source pixel in order to
compute each destination pixel.
The source and the destination images will occupy the same
region of the plane. A given destination pixel (x, y) may be
computed from the neighborhood of source pixels beginning at (x -
leftPadding, y - topPadding) and extending to (x + rightPadding, y
+ bottomPadding) inclusive.
Since this operator needs a region around the source pixel in
order to compute the destination pixel, the border destination pixels
cannot be computed without any source extension. The source extension
can be specified by supplying a BorderExtender that will define the
pixel values of the source outside the actual source area.
If no extension is specified, the destination samples that
cannot be computed will be written in the destination as zero. If
the source image begins at pixel (minX, minY) and has width w and
height h, the result of performing an area operation will be an
image beginning at minX, minY, and having a width of w and a height
of h, with the area being computed and written starting at (minX +
leftPadding, minY + topPadding) and having width Math.max(w -
leftPadding - rightPadding, 0) and height Math.max(h - topPadding
- bottomPadding, 0).
A RenderingHints for
JAI.KEY_REPLACE_INDEX_COLOR_MODEL with the value of
Boolean.TRUE will automatically be added to the given
configuration and passed up to the superclass constructor
so that area operations are performed on the pixel values instead
of being performed on the indices into the color map for those
operations whose source(s) have an IndexColorModel .
This addition will only take place if a value for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL has not already been
provided by the user. Note that the configuration Map
is cloned before the new hint is added to it. Regarding the value
for the JAI.KEY_REPLACE_INDEX_COLOR_MODEL
RenderingHints , the operator itself can be smart
based on the parameters, i.e. while the default value for
the JAI.KEY_REPLACE_INDEX_COLOR_MODEL is
Boolean.TRUE for operations that extend this class,
in some cases the operator could set the default.
See Also: BorderExtender |
Field Summary | |
protected int | bottomPadding The number of source pixels needed below the central pixel. | protected BorderExtender | extender The BorderExtender, may be null. | protected int | leftPadding The number of source pixels needed to the left of the central pixel. | protected int | rightPadding The number of source pixels needed to the right of the central pixel. | protected int | topPadding The number of source pixels needed above the central pixel. |
Constructor Summary | |
public | AreaOpImage(RenderedImage source, ImageLayout layout, Map configuration, boolean cobbleSources, BorderExtender extender, int leftPadding, int rightPadding, int topPadding, int bottomPadding) Constructs an AreaOpImage . |
Method Summary | |
public Raster | computeTile(int tileX, int tileY) Computes a tile. | public BorderExtender | getBorderExtender() Retrieve the BorderExtender object associated with
this class instance. | public int | getBottomPadding() Returns the number of pixels needed below the central pixel. | public int | getLeftPadding() Returns the number of pixels needed to the left of the central pixel. | public int | getRightPadding() Returns the number of pixels needed to the right of the central pixel. | public int | getTopPadding() Returns the number of pixels needed above the central pixel. | public Rectangle | mapDestRect(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. | public Rectangle | mapSourceRect(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. |
bottomPadding | protected int bottomPadding(Code) | | The number of source pixels needed below the central pixel.
|
leftPadding | protected int leftPadding(Code) | | The number of source pixels needed to the left of the central pixel.
|
rightPadding | protected int rightPadding(Code) | | The number of source pixels needed to the right of the central pixel.
|
topPadding | protected int topPadding(Code) | | The number of source pixels needed above the central pixel.
|
AreaOpImage | public AreaOpImage(RenderedImage source, ImageLayout layout, Map configuration, boolean cobbleSources, BorderExtender extender, int leftPadding, int rightPadding, int topPadding, int bottomPadding)(Code) | | Constructs an AreaOpImage . The layout variables
are set in the standard way by the OpImage constructor.
Additional control over the image bounds, tile grid layout,
SampleModel , and ColorModel may be
obtained by specifying an ImageLayout parameter.
If the image bounds are specified but do not overlap the source
bounds then an IllegalArgumentException will be thrown.
This parameter will be passed to the superclass constructor
unchanged.
A RenderingHints for
JAI.KEY_REPLACE_INDEX_COLOR_MODEL with the value of
Boolean.TRUE will automatically be added to the given
configuration and passed up to the superclass constructor
so that area operations are performed on the pixel values instead
of being performed on the indices into the color map for those
operations whose source(s) have an IndexColorModel .
This addition will only take place if a value for the
JAI.KEY_REPLACE_INDEX_COLOR_MODEL has not already been
provided by the user. Note that the configuration Map
is cloned before the new hint is added to it.
Parameters: source - A RenderedImage . Parameters: layout - An ImageLayout containing the sourcedimensions before padding, and optionally containing thetile grid layout, SampleModel , andColorModel . Parameters: configuration - Configurable attributes of the image includingconfiguration variables indexed byRenderingHints.Key s and image properties indexedby String s or CaselessStringKey s.This is simply forwarded to the superclass constructor. Parameters: cobbleSources - A boolean indicating whethercomputeRect() expects contiguous sources. Parameters: extender - A BorderExtender, or null. Parameters: leftPadding - The desired left padding. Parameters: rightPadding - The desired right padding. Parameters: topPadding - The desired top padding. Parameters: bottomPadding - The desired bottom padding. throws: IllegalArgumentException - if source is null . throws: IllegalArgumentException - if the user-specified bounds dointersect the source bounds. since: JAI 1.1 |
computeTile | public Raster computeTile(int tileX, int tileY)(Code) | | Computes a tile. If source cobbling was requested at
construction time, the source tile boundaries are overlayed
onto the destination, cobbling is performed for areas that
intersect multiple source tiles, and
computeRect(Raster[], WritableRaster, Rectangle)
is called for each of the resulting regions. Otherwise,
computeRect(PlanarImage[], WritableRaster,
Rectangle) is called once to compute the entire active
area of the tile.
The image bounds may be larger than the bounds of the
source image. In this case, samples for which there are no
no corresponding sources are set to zero.
Parameters: tileX - The X index of the tile. Parameters: tileY - The Y index of the tile. The tile as a Raster . |
getBorderExtender | public BorderExtender getBorderExtender()(Code) | | Retrieve the BorderExtender object associated with
this class instance. The object is returned by reference.
The associated BorderExtender objector null . since: JAI 1.1 |
getBottomPadding | public int getBottomPadding()(Code) | | Returns the number of pixels needed below the central pixel.
The bottom padding factor. |
getLeftPadding | public int getLeftPadding()(Code) | | Returns the number of pixels needed to the left of the central pixel.
The left padding factor. |
getRightPadding | public int getRightPadding()(Code) | | Returns the number of pixels needed to the right of the central pixel.
The right padding factor. |
getTopPadding | public int getTopPadding()(Code) | | Returns the number of pixels needed above the central pixel.
The top padding factor. |
mapDestRect | public Rectangle mapDestRect(Rectangle destRect, int sourceIndex)(Code) | | 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. The resulting Rectangle
is not clipped to the source image bounds.
Parameters: destRect - the Rectangle in destination coordinates. Parameters: sourceIndex - the index of the source image. a Rectangle indicating the required source region. throws: IllegalArgumentException - if sourceIndex isnegative or greater than the index of the last source. throws: IllegalArgumentException - if destRect isnull . |
mapSourceRect | public Rectangle mapSourceRect(Rectangle sourceRect, int sourceIndex)(Code) | | Returns a conservative estimate of the destination region that
can potentially be affected by the pixels of a rectangle of a
given source. The resulting Rectangle is not
clipped to the destination image bounds.
Parameters: sourceRect - the Rectangle in source coordinates. Parameters: sourceIndex - the index of the source image. a Rectangle indicating the potentially affecteddestination region, or null if the region isunknown. throws: IllegalArgumentException - if sourceIndex isnegative or greater than the index of the last source. throws: IllegalArgumentException - if sourceRect isnull . |
Methods inherited from javax.media.jai.OpImage | protected void addTileToCache(int tileX, int tileY, Raster tile)(Code)(Java Doc) public void cancelTiles(TileRequest request, Point[] tileIndices)(Code)(Java Doc) static Vector checkSourceVector(Vector sources, boolean checkElements)(Code)(Java Doc) protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)(Code)(Java Doc) protected void computeRect(PlanarImage[] sources, WritableRaster dest, Rectangle destRect)(Code)(Java Doc) public Raster computeTile(int tileX, int tileY)(Code)(Java Doc) public boolean computesUniqueTiles()(Code)(Java Doc) final protected WritableRaster createTile(int tileX, int tileY)(Code)(Java Doc) public synchronized void dispose()(Code)(Java Doc) public static int getExpandedNumBands(SampleModel sampleModel, ColorModel colorModel)(Code)(Java Doc) protected synchronized RasterFormatTag[] getFormatTags()(Code)(Java Doc) public int getOperationComputeType()(Code)(Java Doc) public Raster getTile(int tileX, int tileY)(Code)(Java Doc) public TileCache getTileCache()(Code)(Java Doc) public Object getTileCacheMetric()(Code)(Java Doc) public Point[] getTileDependencies(int tileX, int tileY, int sourceIndex)(Code)(Java Doc) protected Raster getTileFromCache(int tileX, int tileY)(Code)(Java Doc) public TileRecycler getTileRecycler()(Code)(Java Doc) public Raster[] getTiles(Point[] tileIndices)(Code)(Java Doc) public boolean hasExtender(int sourceIndex)(Code)(Java Doc) public Point2D mapDestPoint(Point2D destPt, int sourceIndex)(Code)(Java Doc) abstract public Rectangle mapDestRect(Rectangle destRect, int sourceIndex)(Code)(Java Doc) public Point2D mapSourcePoint(Point2D sourcePt, int sourceIndex)(Code)(Java Doc) abstract public Rectangle mapSourceRect(Rectangle sourceRect, int sourceIndex)(Code)(Java Doc) public void prefetchTiles(Point[] tileIndices)(Code)(Java Doc) public TileRequest queueTiles(Point[] tileIndices)(Code)(Java Doc) protected void recycleTile(Raster tile)(Code)(Java Doc) public void setTileCache(TileCache cache)(Code)(Java Doc) protected static Vector vectorize(RenderedImage image)(Code)(Java Doc) protected static Vector vectorize(RenderedImage image1, RenderedImage image2)(Code)(Java Doc) protected static Vector vectorize(RenderedImage image1, RenderedImage image2, RenderedImage image3)(Code)(Java Doc)
|
Methods inherited from javax.media.jai.PlanarImage | public static int XToTileX(int x, int tileGridXOffset, int tileWidth)(Code)(Java Doc) public int XToTileX(int x)(Code)(Java Doc) public static int YToTileY(int y, int tileGridYOffset, int tileHeight)(Code)(Java Doc) public int YToTileY(int y)(Code)(Java Doc) public void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public synchronized boolean addSink(Object sink)(Code)(Java Doc) protected void addSink(PlanarImage sink)(Code)(Java Doc) protected void addSource(Object source)(Code)(Java Doc) public synchronized void addTileComputationListener(TileComputationListener listener)(Code)(Java Doc) public void cancelTiles(TileRequest request, Point[] tileIndices)(Code)(Java Doc) public WritableRaster copyData()(Code)(Java Doc) public WritableRaster copyData(WritableRaster raster)(Code)(Java Doc) public void copyExtendedData(WritableRaster dest, BorderExtender extender)(Code)(Java Doc) public static ColorModel createColorModel(SampleModel sm)(Code)(Java Doc) public PlanarImage createSnapshot()(Code)(Java Doc) final protected WritableRaster createWritableRaster(SampleModel sampleModel, Point location)(Code)(Java Doc) public synchronized void dispose()(Code)(Java Doc) protected void finalize() throws Throwable(Code)(Java Doc) public BufferedImage getAsBufferedImage(Rectangle rect, ColorModel cm)(Code)(Java Doc) public BufferedImage getAsBufferedImage()(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) public ColorModel getColorModel()(Code)(Java Doc) public Raster getData()(Code)(Java Doc) public Raster getData(Rectangle region)(Code)(Java Doc) public static ColorModel getDefaultColorModel(int dataType, int numBands)(Code)(Java Doc) public Raster getExtendedData(Rectangle region, BorderExtender extender)(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public Object getImageID()(Code)(Java Doc) public int getMaxTileX()(Code)(Java Doc) public int getMaxTileY()(Code)(Java Doc) public int getMaxX()(Code)(Java Doc) public int getMaxY()(Code)(Java Doc) public int getMinTileX()(Code)(Java Doc) public int getMinTileY()(Code)(Java Doc) public int getMinX()(Code)(Java Doc) public int getMinY()(Code)(Java Doc) public int getNumBands()(Code)(Java Doc) public int getNumSources()(Code)(Java Doc) public int getNumXTiles()(Code)(Java Doc) public int getNumYTiles()(Code)(Java Doc) protected Hashtable getProperties()(Code)(Java Doc) public Object getProperty(String name)(Code)(Java Doc) public Class getPropertyClass(String name)(Code)(Java Doc) public String[] getPropertyNames()(Code)(Java Doc) public String[] getPropertyNames(String prefix)(Code)(Java Doc) public SampleModel getSampleModel()(Code)(Java Doc) public Vector getSinks()(Code)(Java Doc) public PlanarImage getSource(int index)(Code)(Java Doc) public PlanarImage getSourceImage(int index)(Code)(Java Doc) public Object getSourceObject(int index)(Code)(Java Doc) public Vector getSources()(Code)(Java Doc) public void getSplits(IntegerSequence xSplits, IntegerSequence ySplits, Rectangle rect)(Code)(Java Doc) abstract public Raster getTile(int tileX, int tileY)(Code)(Java Doc) public TileComputationListener[] getTileComputationListeners()(Code)(Java Doc) public TileFactory getTileFactory()(Code)(Java Doc) public int getTileGridXOffset()(Code)(Java Doc) public int getTileGridYOffset()(Code)(Java Doc) public int getTileHeight()(Code)(Java Doc) public Point[] getTileIndices(Rectangle region)(Code)(Java Doc) public Rectangle getTileRect(int tileX, int tileY)(Code)(Java Doc) public int getTileWidth()(Code)(Java Doc) public Raster[] getTiles(Point[] tileIndices)(Code)(Java Doc) public Raster[] getTiles()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public boolean overlapsMultipleTiles(Rectangle rect)(Code)(Java Doc) public void prefetchTiles(Point[] tileIndices)(Code)(Java Doc) public TileRequest queueTiles(Point[] tileIndices)(Code)(Java Doc) public void removeProperty(String name)(Code)(Java Doc) public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc) public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc) public synchronized boolean removeSink(Object sink)(Code)(Java Doc) protected boolean removeSink(PlanarImage sink)(Code)(Java Doc) public void removeSinks()(Code)(Java Doc) protected boolean removeSource(Object source)(Code)(Java Doc) protected void removeSources()(Code)(Java Doc) public synchronized void removeTileComputationListener(TileComputationListener listener)(Code)(Java Doc) protected void setImageLayout(ImageLayout layout)(Code)(Java Doc) protected void setProperties(Hashtable properties)(Code)(Java Doc) public void setProperty(String name, Object value)(Code)(Java Doc) protected void setSource(Object source, int index)(Code)(Java Doc) protected void setSources(List sourceList)(Code)(Java Doc) public static int tileXToX(int tx, int tileGridXOffset, int tileWidth)(Code)(Java Doc) public int tileXToX(int tx)(Code)(Java Doc) public static int tileYToY(int ty, int tileGridYOffset, int tileHeight)(Code)(Java Doc) public int tileYToY(int ty)(Code)(Java Doc) public String toString()(Code)(Java Doc) public static PlanarImage wrapRenderedImage(RenderedImage image)(Code)(Java Doc)
|
|
|