org.apache.batik.ext.awt.image.rendered
Class RenderedImageCachableRed

java.lang.Object
  extended by org.apache.batik.ext.awt.image.rendered.RenderedImageCachableRed
All Implemented Interfaces:
RenderedImage, CachableRed

public class RenderedImageCachableRed
extends Object
implements CachableRed

This implements CachableRed around a RenderedImage. You can use this to wrap a RenderedImage that you want to appear as a CachableRed. It essentially ignores the dependency and dirty region methods.


Constructor Summary
RenderedImageCachableRed(RenderedImage src)
           
 
Method Summary
 WritableRaster copyData(WritableRaster raster)
           
 Rectangle getBounds()
          Returns the bounds of the current image.
 ColorModel getColorModel()
           
 Raster getData()
           
 Raster getData(Rectangle rect)
           
 Shape getDependencyRegion(int srcIndex, Rectangle outputRgn)
          Returns the region of input data is is required to generate outputRgn.
 Shape getDirtyRegion(int srcIndex, Rectangle inputRgn)
          This calculates the region of output that is affected by a change in a region of input.
 int getHeight()
           
 int getMinTileX()
           
 int getMinTileY()
           
 int getMinX()
           
 int getMinY()
           
 int getNumXTiles()
           
 int getNumYTiles()
           
 Object getProperty(String name)
           
 String[] getPropertyNames()
           
 SampleModel getSampleModel()
           
 Vector getSources()
           
 Raster getTile(int tileX, int tileY)
           
 int getTileGridXOffset()
           
 int getTileGridYOffset()
           
 int getTileHeight()
           
 int getTileWidth()
           
 int getWidth()
           
static CachableRed wrap(RenderedImage ri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderedImageCachableRed

public RenderedImageCachableRed(RenderedImage src)
Method Detail

wrap

public static CachableRed wrap(RenderedImage ri)

getSources

public Vector getSources()
Specified by:
getSources in interface RenderedImage

getBounds

public Rectangle getBounds()
Description copied from interface: CachableRed
Returns the bounds of the current image. This should be 'in sync' with getMinX, getMinY, getWidth, getHeight

Specified by:
getBounds in interface CachableRed

getMinX

public int getMinX()
Specified by:
getMinX in interface RenderedImage

getMinY

public int getMinY()
Specified by:
getMinY in interface RenderedImage

getWidth

public int getWidth()
Specified by:
getWidth in interface RenderedImage

getHeight

public int getHeight()
Specified by:
getHeight in interface RenderedImage

getColorModel

public ColorModel getColorModel()
Specified by:
getColorModel in interface RenderedImage

getSampleModel

public SampleModel getSampleModel()
Specified by:
getSampleModel in interface RenderedImage

getMinTileX

public int getMinTileX()
Specified by:
getMinTileX in interface RenderedImage

getMinTileY

public int getMinTileY()
Specified by:
getMinTileY in interface RenderedImage

getNumXTiles

public int getNumXTiles()
Specified by:
getNumXTiles in interface RenderedImage

getNumYTiles

public int getNumYTiles()
Specified by:
getNumYTiles in interface RenderedImage

getTileGridXOffset

public int getTileGridXOffset()
Specified by:
getTileGridXOffset in interface RenderedImage

getTileGridYOffset

public int getTileGridYOffset()
Specified by:
getTileGridYOffset in interface RenderedImage

getTileWidth

public int getTileWidth()
Specified by:
getTileWidth in interface RenderedImage

getTileHeight

public int getTileHeight()
Specified by:
getTileHeight in interface RenderedImage

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface RenderedImage

getPropertyNames

public String[] getPropertyNames()
Specified by:
getPropertyNames in interface RenderedImage

getTile

public Raster getTile(int tileX,
                      int tileY)
Specified by:
getTile in interface RenderedImage

copyData

public WritableRaster copyData(WritableRaster raster)
Specified by:
copyData in interface RenderedImage

getData

public Raster getData()
Specified by:
getData in interface RenderedImage

getData

public Raster getData(Rectangle rect)
Specified by:
getData in interface RenderedImage

getDependencyRegion

public Shape getDependencyRegion(int srcIndex,
                                 Rectangle outputRgn)
Description copied from interface: CachableRed
Returns the region of input data is is required to generate outputRgn.

Specified by:
getDependencyRegion in interface CachableRed
Parameters:
srcIndex - The source to do the dependency calculation for.
outputRgn - The region of output you are interested in generating dependencies for. The is given in the output pixel coordiate system for this node.
Returns:
The region of input required. This is in the output pixel coordinate system for the source indicated by srcIndex.

getDirtyRegion

public Shape getDirtyRegion(int srcIndex,
                            Rectangle inputRgn)
Description copied from interface: CachableRed
This calculates the region of output that is affected by a change in a region of input.

Specified by:
getDirtyRegion in interface CachableRed
Parameters:
srcIndex - The input that inputRgn reflects changes in.
inputRgn - the region of input that has changed, used to calculate the returned shape. This is given in the pixel coordinate system of the source indicated by srcIndex.
Returns:
The region of output that would be invalid given a change to inputRgn of the source selected by srcIndex. this is in the output pixel coordinate system of this node.


Copyright © 2008 Apache Software Foundation. All Rights Reserved.