Class AbstractTiledRed
java.lang.Object
org.apache.batik.ext.awt.image.rendered.AbstractRed
org.apache.batik.ext.awt.image.rendered.AbstractTiledRed
- All Implemented Interfaces:
RenderedImage
,CachableRed
,TileGenerator
- Direct Known Subclasses:
SpecularLightingRed
,TileCacheRed
This is an abstract base class that takes care of most of the
normal issues surrounding the implementation of the CachableRed
(RenderedImage) interface. It tries to make no assumptions about
the subclass implementation.
-
Field Summary
Fields inherited from class org.apache.batik.ext.awt.image.rendered.AbstractRed
bounds, cm, minTileX, minTileY, numXTiles, numYTiles, props, sm, srcs, tileGridXOff, tileGridYOff, tileHeight, tileWidth
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
void constructor.protected
AbstractTiledRed
(Rectangle bounds, Map props) Construct an Abstract RenderedImage from a bounds rect and props (may be null).protected
AbstractTiledRed
(List srcs, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props) Construct an Abstract RenderedImage from a bounds rect, ColorModel (may be null), SampleModel (may be null), tile grid offsets and props (may be null).protected
AbstractTiledRed
(List srcs, Rectangle bounds, ColorModel cm, SampleModel sm, Map props) Construct an Abstract RenderedImage from a bounds rect, ColorModel (may be null), SampleModel (may be null) and props (may be null).protected
AbstractTiledRed
(List srcs, Rectangle bounds, Map props) Construct an Abstract Rable from a List of sources a bounds rect and props (may be null).protected
AbstractTiledRed
(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props) Construct an Abstract Rable from a bounds rect and props (may be null).protected
AbstractTiledRed
(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, Map props) Construct an Abstract RenderedImage from a source image, bounds rect and props (may be null).protected
AbstractTiledRed
(CachableRed src, Rectangle bounds, Map props) Construct an Abstract RenderedImage from a source image, bounds rect and props (may be null).protected
AbstractTiledRed
(CachableRed src, Map props) Construct an Abstract RenderedImage from a source image and props (may be null). -
Method Summary
Modifier and TypeMethodDescriptionvoid
Copies data from this images tile grid into wr.void
protected TileStore
protected void
drawBlock
(TileBlock block, WritableRaster wr) protected void
drawBlockAndCopy
(TileBlock[] blocks, WritableRaster wr) protected void
drawBlockInPlace
(TileBlock[] blocks, WritableRaster wr) abstract void
genTile
(int x, int y) static int
getTile
(int x, int y) protected void
init
(List srcs, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props) This is the basic init function.protected void
init
(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props) This is one of two basic init function (this is for single source rendereds).protected void
init
(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, TileStore tiles, Map props) This is one of two basic init function (this is for single source rendereds).void
protected void
setTileStore
(TileStore tiles) Methods inherited from class org.apache.batik.ext.awt.image.rendered.AbstractRed
copyBand, getBounds, getColorModel, getData, getDependencyRegion, getDirtyRegion, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getProperty, getPropertyNames, getSampleModel, getSources, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth, getXTile, getYTile, makeTile, updateTileGridInfo
-
Constructor Details
-
AbstractTiledRed
protected AbstractTiledRed()void constructor. The subclass must call one of the flavors of init before the object becomes usable. This is useful when the proper parameters to the init method need to be computed in the subclasses constructor. -
AbstractTiledRed
Construct an Abstract RenderedImage from a bounds rect and props (may be null). The srcs Vector will be empty.- Parameters:
bounds
- this defines the extent of the rable in the user coordinate system.props
- this initializes the props Map (may be null)
-
AbstractTiledRed
Construct an Abstract RenderedImage from a source image and props (may be null).- Parameters:
src
- will be the first (and only) member of the srcs Vector. Src is also used to set the bounds, ColorModel, SampleModel, and tile grid offsets.props
- this initializes the props Map.
-
AbstractTiledRed
Construct an Abstract RenderedImage from a source image, bounds rect and props (may be null).- Parameters:
src
- will be the first (and only) member of the srcs Vector. Src is also used to set the ColorModel, SampleModel, and tile grid offsets.bounds
- The bounds of this image.props
- this initializes the props Map.
-
AbstractTiledRed
protected AbstractTiledRed(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, Map props) Construct an Abstract RenderedImage from a source image, bounds rect and props (may be null).- Parameters:
src
- will be the first (and only) member of the srcs Vector. Src is also used to set the ColorModel, SampleModel, and tile grid offsets.bounds
- The bounds of this image.cm
- The ColorModel to use. If null it will default to ComponentColorModel.sm
- The sample model to use. If null it will construct a sample model the matches the given/generated ColorModel and is the size of bounds.props
- this initializes the props Map.
-
AbstractTiledRed
protected AbstractTiledRed(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props) Construct an Abstract Rable from a bounds rect and props (may be null). The srcs Vector will be empty.- Parameters:
src
- will be the first (and only) member of the srcs Vector. Src is also used to set the ColorModel, SampleModel, and tile grid offsets.bounds
- this defines the extent of the rable in the user coordinate system.cm
- The ColorModel to use. If null it will default to ComponentColorModel.sm
- The sample model to use. If null it will construct a sample model the matches the given/generated ColorModel and is the size of bounds.tileGridXOff
- The x location of tile 0,0.tileGridYOff
- The y location of tile 0,0.props
- this initializes the props Map.
-
AbstractTiledRed
Construct an Abstract Rable from a List of sources a bounds rect and props (may be null).- Parameters:
srcs
- This is used to initialize the srcs Vector. All the members of srcs must be CachableRed otherwise an error will be thrown.bounds
- this defines the extent of the rendered in pixelsprops
- this initializes the props Map.
-
AbstractTiledRed
Construct an Abstract RenderedImage from a bounds rect, ColorModel (may be null), SampleModel (may be null) and props (may be null). The srcs Vector will be empty.- Parameters:
srcs
- This is used to initialize the srcs Vector. All the members of srcs must be CachableRed otherwise an error will be thrown.bounds
- this defines the extent of the rendered in pixelscm
- The ColorModel to use. If null it will default to ComponentColorModel.sm
- The sample model to use. If null it will construct a sample model the matches the given/generated ColorModel and is the size of bounds.props
- this initializes the props Map.
-
AbstractTiledRed
protected AbstractTiledRed(List srcs, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props) Construct an Abstract RenderedImage from a bounds rect, ColorModel (may be null), SampleModel (may be null), tile grid offsets and props (may be null). The srcs Vector will be empty.- Parameters:
srcs
- This is used to initialize the srcs Vector. All the members of srcs must be CachableRed otherwise an error will be thrown.bounds
- this defines the extent of the rable in the user coordinate system.cm
- The ColorModel to use. If null it will default to ComponentColorModel.sm
- The sample model to use. If null it will construct a sample model the matches the given/generated ColorModel and is the size of bounds.tileGridXOff
- The x location of tile 0,0.tileGridYOff
- The y location of tile 0,0.props
- this initializes the props Map.
-
-
Method Details
-
getDefaultTileSize
public static int getDefaultTileSize() -
init
protected void init(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props) This is one of two basic init function (this is for single source rendereds). It is provided so subclasses can compute various values before initializing all the state in the base class. You really should call this method before returning from your subclass constructor.- Overrides:
init
in classAbstractRed
- Parameters:
src
- The source for the filterbounds
- The bounds of the imagecm
- The ColorModel to use. If null it defaults to ComponentColorModel/ src's ColorModel.sm
- The Sample modle to use. If this is null it will use the src's sample model if that is null it will construct a sample model that matches the ColorModel and is the size of the whole image.tileGridXOff
- The x location of tile 0,0.tileGridYOff
- The y location of tile 0,0.props
- Any properties you want to associate with the image.
-
init
protected void init(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, TileStore tiles, Map props) This is one of two basic init function (this is for single source rendereds). It is provided so subclasses can compute various values before initializing all the state in the base class. You really should call this method before returning from your subclass constructor.- Parameters:
src
- The source for the filterbounds
- The bounds of the imagecm
- The ColorModel to use. If null it defaults to ComponentColorModel/ src's ColorModel.sm
- The Sample modle to use. If this is null it will use the src's sample model if that is null it will construct a sample model that matches the ColorModel and is the size of the whole image.tileGridXOff
- The x location of tile 0,0.tileGridYOff
- The y location of tile 0,0.tiles
- The tileStore to use (or null).props
- Any properties you want to associate with the image.
-
init
protected void init(List srcs, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props) This is the basic init function. It is provided so subclasses can compute various values before initializing all the state in the base class. You really should call this method before returning from your subclass constructor.- Overrides:
init
in classAbstractRed
- Parameters:
srcs
- The list of sourcesbounds
- The bounds of the imagecm
- The ColorModel to use. If null it defaults to ComponentColorModel.sm
- The Sample modle to use. If this is null it will construct a sample model that matches the ColorModel and is the size of the whole image.tileGridXOff
- The x location of tile 0,0.tileGridYOff
- The y location of tile 0,0.props
- Any properties you want to associate with the image.
-
getTileStore
-
setTileStore
-
createTileStore
-
copyData
- Specified by:
copyData
in interfaceRenderedImage
-
getData
- Specified by:
getData
in interfaceRenderedImage
- Overrides:
getData
in classAbstractRed
-
getTile
- Specified by:
getTile
in interfaceRenderedImage
- Overrides:
getTile
in classAbstractRed
-
genTile
- Specified by:
genTile
in interfaceTileGenerator
-
genRect
-
setTile
-
copyToRasterByBlocks
-
copyToRaster
Copies data from this images tile grid into wr. wr may extend outside the bounds of this image in which case the data in wr outside the bounds will not be touched.- Overrides:
copyToRaster
in classAbstractRed
- Parameters:
wr
- Raster to fill with image data.
-
drawBlock
-
drawBlockAndCopy
-
drawBlockInPlace
-