| java.lang.Object org.apache.xmlgraphics.image.rendered.AbstractRed
All known Subclasses: org.apache.xmlgraphics.image.codec.tiff.TIFFImage, org.apache.xmlgraphics.image.rendered.Any2LsRGBRed, org.apache.xmlgraphics.image.rendered.Any2sRGBRed, org.apache.xmlgraphics.image.codec.png.PNGRed, org.apache.xmlgraphics.image.rendered.FormatRed, org.apache.xmlgraphics.image.rendered.BufferedImageCachableRed,
AbstractRed | abstract public class AbstractRed implements CachableRed(Code) | | 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.
author: Thomas DeWeese version: $Id: AbstractRed.java 496559 2007-01-16 01:10:29Z cam $ |
Constructor Summary | |
protected | AbstractRed() void constructor. | protected | AbstractRed(Rectangle bounds, Map props) Construct an Abstract RenderedImage from a bounds rect and props
(may be null). | protected | AbstractRed(CachableRed src, Map props) Construct an Abstract RenderedImage from a source image and
props (may be null).
Parameters: src - will be the first (and only) member of the srcsVector. | protected | AbstractRed(CachableRed src, Rectangle bounds, 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 srcsVector. | protected | AbstractRed(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 - if not null, will be the first (and only) memberof the srcs Vector. | protected | AbstractRed(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 | AbstractRed(List srcs, Rectangle bounds, Map props) 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. | protected | AbstractRed(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 | AbstractRed(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). |
Method Summary | |
public static void | copyBand(Raster src, int srcBand, WritableRaster dst, int dstBand) | public void | copyToRaster(WritableRaster wr) Copies data from this images tile grid into wr. | public Rectangle | getBounds() | public ColorModel | getColorModel() | public Raster | getData() | public Raster | getData(Rectangle rect) | public Shape | getDependencyRegion(int srcIndex, Rectangle outputRgn) | public Shape | getDirtyRegion(int srcIndex, Rectangle inputRgn) | public int | getHeight() | public int | getMinTileX() | public int | getMinTileY() | public int | getMinX() | public int | getMinY() | public int | getNumXTiles() | public int | getNumYTiles() | public Object | getProperty(String name) | public String[] | getPropertyNames() | public SampleModel | getSampleModel() | public Vector | getSources() | public Raster | getTile(int tileX, int tileY) | public int | getTileGridXOffset() | public int | getTileGridYOffset() | public int | getTileHeight() | public int | getTileWidth() | public int | getWidth() | final public int | getXTile(int xloc) Returns the x index of tile under xloc.
Parameters: xloc - the x location (in pixels) to get tile for. | final public int | getYTile(int yloc) Returns the y index of tile under yloc.
Parameters: yloc - the y location (in pixels) to get tile for. | 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.
Parameters: src - The source for the filter Parameters: bounds - The bounds of the image Parameters: cm - The ColorModel to use. | 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.
Parameters: srcs - The list of sources Parameters: bounds - The bounds of the image Parameters: cm - The ColorModel to use. | public WritableRaster | makeTile(int tileX, int tileY) This is a helper function that will create the tile requested
Including properly subsetting the bounds of the tile to the
bounds of the current image. | protected void | updateTileGridInfo() This function computes all the basic information about the tile
grid based on the data stored in sm, and tileGridX/YOff. |
minTileXminTileY | protected int minTileXminTileY(Code) | | |
numXTilesnumYTiles | protected int numXTilesnumYTiles(Code) | | |
sm | protected SampleModel sm(Code) | | |
tileGridXOfftileGridYOff | protected int tileGridXOfftileGridYOff(Code) | | |
tileWidthtileHeight | protected int tileWidthtileHeight(Code) | | |
AbstractRed | protected AbstractRed()(Code) | | 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.
|
AbstractRed | protected AbstractRed(Rectangle bounds, Map props)(Code) | | 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 theuser coordinate system. Parameters: props - this initializes the props Map (may be null) |
AbstractRed | protected AbstractRed(CachableRed src, Map props)(Code) | | Construct an Abstract RenderedImage from a source image and
props (may be null).
Parameters: src - will be the first (and only) member of the srcsVector. Src is also used to set the bounds, ColorModel,SampleModel, and tile grid offsets. Parameters: props - this initializes the props Map. |
AbstractRed | protected AbstractRed(CachableRed src, Rectangle bounds, Map props)(Code) | | 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 srcsVector. Src is also used to set the ColorModel, SampleModel,and tile grid offsets. Parameters: bounds - The bounds of this image. Parameters: props - this initializes the props Map. |
AbstractRed | protected AbstractRed(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, Map props)(Code) | | Construct an Abstract RenderedImage from a source image, bounds
rect and props (may be null).
Parameters: src - if not null, will be the first (and only) memberof the srcs Vector. Also if it is not null it provides thetile grid offsets, otherwise they are zero. Parameters: bounds - The bounds of this image. Parameters: cm - The ColorModel to use. If null it will default toComponentColorModel. Parameters: sm - The sample model to use. If null it will constructa sample model the matches the given/generated ColorModel and isthe size of bounds. Parameters: props - this initializes the props Map. |
AbstractRed | protected AbstractRed(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props)(Code) | | 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 srcsVector. Src is also used to set the ColorModel, SampleModel,and tile grid offsets. Parameters: bounds - this defines the extent of the rable in theuser coordinate system. Parameters: cm - The ColorModel to use. If null it will default toComponentColorModel. Parameters: sm - The sample model to use. If null it will constructa sample model the matches the given/generated ColorModel and isthe size of bounds. Parameters: tileGridXOff - The x location of tile 0,0. Parameters: tileGridYOff - The y location of tile 0,0. Parameters: props - this initializes the props Map. |
AbstractRed | protected AbstractRed(List srcs, Rectangle bounds, Map props)(Code) | | 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. Allthe members of srcs must be CachableRed otherwise an errorwill be thrown. Parameters: bounds - this defines the extent of the rendered in pixels Parameters: props - this initializes the props Map. |
AbstractRed | protected AbstractRed(List srcs, Rectangle bounds, ColorModel cm, SampleModel sm, Map props)(Code) | | 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. Allthe members of srcs must be CachableRed otherwise an errorwill be thrown. Parameters: bounds - this defines the extent of the rendered in pixels Parameters: cm - The ColorModel to use. If null it will default toComponentColorModel. Parameters: sm - The sample model to use. If null it will constructa sample model the matches the given/generated ColorModel and isthe size of bounds. Parameters: props - this initializes the props Map. |
AbstractRed | protected AbstractRed(List srcs, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props)(Code) | | 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. Allthe members of srcs must be CachableRed otherwise an errorwill be thrown. Parameters: bounds - this defines the extent of the rable in theuser coordinate system. Parameters: cm - The ColorModel to use. If null it will default toComponentColorModel. Parameters: sm - The sample model to use. If null it will constructa sample model the matches the given/generated ColorModel and isthe size of bounds. Parameters: tileGridXOff - The x location of tile 0,0. Parameters: tileGridYOff - The y location of tile 0,0. Parameters: props - this initializes the props Map. |
copyBand | public static void copyBand(Raster src, int srcBand, WritableRaster dst, int dstBand)(Code) | | |
copyToRaster | public void copyToRaster(WritableRaster wr)(Code) | | 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.
Parameters: wr - Raster to fill with image data. |
getData | public Raster getData()(Code) | | |
getHeight | public int getHeight()(Code) | | |
getMinTileX | public int getMinTileX()(Code) | | |
getMinTileY | public int getMinTileY()(Code) | | |
getMinX | public int getMinX()(Code) | | |
getMinY | public int getMinY()(Code) | | |
getNumXTiles | public int getNumXTiles()(Code) | | |
getNumYTiles | public int getNumYTiles()(Code) | | |
getSampleModel | public SampleModel getSampleModel()(Code) | | |
getTile | public Raster getTile(int tileX, int tileY)(Code) | | |
getTileGridXOffset | public int getTileGridXOffset()(Code) | | |
getTileGridYOffset | public int getTileGridYOffset()(Code) | | |
getTileHeight | public int getTileHeight()(Code) | | |
getTileWidth | public int getTileWidth()(Code) | | |
getWidth | public int getWidth()(Code) | | |
getXTile | final public int getXTile(int xloc)(Code) | | Returns the x index of tile under xloc.
Parameters: xloc - the x location (in pixels) to get tile for. The tile index under xloc (may be outside tile grid). |
getYTile | final public int getYTile(int yloc)(Code) | | Returns the y index of tile under yloc.
Parameters: yloc - the y location (in pixels) to get tile for. The tile index under yloc (may be outside tile grid). |
init | protected void init(CachableRed src, Rectangle bounds, ColorModel cm, SampleModel sm, int tileGridXOff, int tileGridYOff, Map props)(Code) | | 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 filter Parameters: bounds - The bounds of the image Parameters: cm - The ColorModel to use. If null it defaults toComponentColorModel/ src's ColorModel. Parameters: sm - The Sample modle to use. If this is null it willuse the src's sample model if that is null it willconstruct a sample model that matches the ColorModeland is the size of the whole image. Parameters: tileGridXOff - The x location of tile 0,0. Parameters: tileGridYOff - The y location of tile 0,0. Parameters: 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)(Code) | | 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.
Parameters: srcs - The list of sources Parameters: bounds - The bounds of the image Parameters: cm - The ColorModel to use. If null it defaults toComponentColorModel. Parameters: sm - The Sample modle to use. If this is null it willconstruct a sample model that matches the ColorModeland is the size of the whole image. Parameters: tileGridXOff - The x location of tile 0,0. Parameters: tileGridYOff - The y location of tile 0,0. Parameters: props - Any properties you want to associate with the image. |
makeTile | public WritableRaster makeTile(int tileX, int tileY)(Code) | | This is a helper function that will create the tile requested
Including properly subsetting the bounds of the tile to the
bounds of the current image.
Parameters: tileX - The x index of the tile to be built Parameters: tileY - The y index of the tile to be built The tile requested exception: IndexOutOfBoundsException - if the requested tile indexfalles outside of the bounds of the tile grid for the image. |
updateTileGridInfo | protected void updateTileGridInfo()(Code) | | This function computes all the basic information about the tile
grid based on the data stored in sm, and tileGridX/YOff.
It is responsible for updating tileWidth, tileHeight,
minTileX/Y, and numX/YTiles.
|
|
|