public abstract class AbstractRed extends java.lang.Object implements CachableRed
Modifier and Type | Field and Description |
---|---|
protected java.awt.Rectangle |
bounds |
protected java.awt.image.ColorModel |
cm |
protected int |
minTileX |
protected int |
minTileY |
protected int |
numXTiles |
protected int |
numYTiles |
protected java.util.Map |
props |
protected java.awt.image.SampleModel |
sm |
protected java.util.Vector |
srcs |
protected int |
tileGridXOff |
protected int |
tileGridYOff |
protected int |
tileHeight |
protected int |
tileWidth |
Modifier | Constructor and Description |
---|---|
protected |
AbstractRed()
void constructor.
|
protected |
AbstractRed(CachableRed src,
java.util.Map props)
Construct an Abstract RenderedImage from a source image and
props (may be null).
|
protected |
AbstractRed(CachableRed src,
java.awt.Rectangle bounds,
java.awt.image.ColorModel cm,
java.awt.image.SampleModel sm,
int tileGridXOff,
int tileGridYOff,
java.util.Map props)
Construct an Abstract Rable from a bounds rect and props
(may be null).
|
protected |
AbstractRed(CachableRed src,
java.awt.Rectangle bounds,
java.awt.image.ColorModel cm,
java.awt.image.SampleModel sm,
java.util.Map props)
Construct an Abstract RenderedImage from a source image, bounds
rect and props (may be null).
|
protected |
AbstractRed(CachableRed src,
java.awt.Rectangle bounds,
java.util.Map props)
Construct an Abstract RenderedImage from a source image, bounds
rect and props (may be null).
|
protected |
AbstractRed(java.util.List srcs,
java.awt.Rectangle bounds,
java.awt.image.ColorModel cm,
java.awt.image.SampleModel sm,
int tileGridXOff,
int tileGridYOff,
java.util.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 |
AbstractRed(java.util.List srcs,
java.awt.Rectangle bounds,
java.awt.image.ColorModel cm,
java.awt.image.SampleModel sm,
java.util.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(java.util.List srcs,
java.awt.Rectangle bounds,
java.util.Map props)
Construct an Abstract Rable from a List of sources a bounds rect
and props (may be null).
|
protected |
AbstractRed(java.awt.Rectangle bounds,
java.util.Map props)
Construct an Abstract RenderedImage from a bounds rect and props
(may be null).
|
Modifier and Type | Method and Description |
---|---|
static void |
copyBand(java.awt.image.Raster src,
int srcBand,
java.awt.image.WritableRaster dst,
int dstBand) |
void |
copyToRaster(java.awt.image.WritableRaster wr)
Copies data from this images tile grid into wr.
|
java.awt.Rectangle |
getBounds()
Returns the bounds of the current image.
|
java.awt.image.ColorModel |
getColorModel() |
java.awt.image.Raster |
getData() |
java.awt.image.Raster |
getData(java.awt.Rectangle rect) |
java.awt.Shape |
getDependencyRegion(int srcIndex,
java.awt.Rectangle outputRgn)
Returns the region of input data is is required to generate
outputRgn.
|
java.awt.Shape |
getDirtyRegion(int srcIndex,
java.awt.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() |
java.lang.Object |
getProperty(java.lang.String name) |
java.lang.String[] |
getPropertyNames() |
java.awt.image.SampleModel |
getSampleModel() |
java.util.Vector |
getSources() |
java.awt.image.Raster |
getTile(int tileX,
int tileY) |
int |
getTileGridXOffset() |
int |
getTileGridYOffset() |
int |
getTileHeight() |
int |
getTileWidth() |
int |
getWidth() |
int |
getXTile(int xloc)
Returns the x index of tile under xloc.
|
int |
getYTile(int yloc)
Returns the y index of tile under yloc.
|
protected void |
init(CachableRed src,
java.awt.Rectangle bounds,
java.awt.image.ColorModel cm,
java.awt.image.SampleModel sm,
int tileGridXOff,
int tileGridYOff,
java.util.Map props)
This is one of two basic init function (this is for single
source rendereds).
|
protected void |
init(java.util.List srcs,
java.awt.Rectangle bounds,
java.awt.image.ColorModel cm,
java.awt.image.SampleModel sm,
int tileGridXOff,
int tileGridYOff,
java.util.Map props)
This is the basic init function.
|
java.awt.image.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.
|
protected java.awt.Rectangle bounds
protected java.util.Vector srcs
protected java.util.Map props
protected java.awt.image.SampleModel sm
protected java.awt.image.ColorModel cm
protected int tileGridXOff
protected int tileGridYOff
protected int tileWidth
protected int tileHeight
protected int minTileX
protected int minTileY
protected int numXTiles
protected int numYTiles
protected AbstractRed()
protected AbstractRed(java.awt.Rectangle bounds, java.util.Map props)
bounds
- this defines the extent of the rable in the
user coordinate system.props
- this initializes the props Map (may be null)protected AbstractRed(CachableRed src, java.util.Map props)
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.protected AbstractRed(CachableRed src, java.awt.Rectangle bounds, java.util.Map props)
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.protected AbstractRed(CachableRed src, java.awt.Rectangle bounds, java.awt.image.ColorModel cm, java.awt.image.SampleModel sm, java.util.Map props)
src
- if not null, will be the first (and only) member
of the srcs Vector. Also if it is not null it provides the
tile grid offsets, otherwise they are zero.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.protected AbstractRed(CachableRed src, java.awt.Rectangle bounds, java.awt.image.ColorModel cm, java.awt.image.SampleModel sm, int tileGridXOff, int tileGridYOff, java.util.Map props)
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.protected AbstractRed(java.util.List srcs, java.awt.Rectangle bounds, java.util.Map props)
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.protected AbstractRed(java.util.List srcs, java.awt.Rectangle bounds, java.awt.image.ColorModel cm, java.awt.image.SampleModel sm, java.util.Map props)
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.protected AbstractRed(java.util.List srcs, java.awt.Rectangle bounds, java.awt.image.ColorModel cm, java.awt.image.SampleModel sm, int tileGridXOff, int tileGridYOff, java.util.Map props)
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.protected void init(CachableRed src, java.awt.Rectangle bounds, java.awt.image.ColorModel cm, java.awt.image.SampleModel sm, int tileGridXOff, int tileGridYOff, java.util.Map props)
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.protected void init(java.util.List srcs, java.awt.Rectangle bounds, java.awt.image.ColorModel cm, java.awt.image.SampleModel sm, int tileGridXOff, int tileGridYOff, java.util.Map props)
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.protected void updateTileGridInfo()
public java.awt.Rectangle getBounds()
CachableRed
getBounds
in interface CachableRed
public java.util.Vector getSources()
getSources
in interface java.awt.image.RenderedImage
public java.awt.image.ColorModel getColorModel()
getColorModel
in interface java.awt.image.RenderedImage
public java.awt.image.SampleModel getSampleModel()
getSampleModel
in interface java.awt.image.RenderedImage
public int getMinX()
getMinX
in interface java.awt.image.RenderedImage
public int getMinY()
getMinY
in interface java.awt.image.RenderedImage
public int getWidth()
getWidth
in interface java.awt.image.RenderedImage
public int getHeight()
getHeight
in interface java.awt.image.RenderedImage
public int getTileWidth()
getTileWidth
in interface java.awt.image.RenderedImage
public int getTileHeight()
getTileHeight
in interface java.awt.image.RenderedImage
public int getTileGridXOffset()
getTileGridXOffset
in interface java.awt.image.RenderedImage
public int getTileGridYOffset()
getTileGridYOffset
in interface java.awt.image.RenderedImage
public int getMinTileX()
getMinTileX
in interface java.awt.image.RenderedImage
public int getMinTileY()
getMinTileY
in interface java.awt.image.RenderedImage
public int getNumXTiles()
getNumXTiles
in interface java.awt.image.RenderedImage
public int getNumYTiles()
getNumYTiles
in interface java.awt.image.RenderedImage
public java.lang.Object getProperty(java.lang.String name)
getProperty
in interface java.awt.image.RenderedImage
public java.lang.String[] getPropertyNames()
getPropertyNames
in interface java.awt.image.RenderedImage
public java.awt.Shape getDependencyRegion(int srcIndex, java.awt.Rectangle outputRgn)
CachableRed
getDependencyRegion
in interface CachableRed
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.public java.awt.Shape getDirtyRegion(int srcIndex, java.awt.Rectangle inputRgn)
CachableRed
getDirtyRegion
in interface CachableRed
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.public java.awt.image.Raster getTile(int tileX, int tileY)
getTile
in interface java.awt.image.RenderedImage
public java.awt.image.Raster getData()
getData
in interface java.awt.image.RenderedImage
public java.awt.image.Raster getData(java.awt.Rectangle rect)
getData
in interface java.awt.image.RenderedImage
public final int getXTile(int xloc)
xloc
- the x location (in pixels) to get tile for.public final int getYTile(int yloc)
yloc
- the y location (in pixels) to get tile for.public void copyToRaster(java.awt.image.WritableRaster wr)
wr
- Raster to fill with image data.public java.awt.image.WritableRaster makeTile(int tileX, int tileY)
tileX
- The x index of the tile to be builttileY
- The y index of the tile to be builtjava.lang.IndexOutOfBoundsException
- if the requested tile index
falles outside of the bounds of the tile grid for the image.public static void copyBand(java.awt.image.Raster src, int srcBand, java.awt.image.WritableRaster dst, int dstBand)
Copyright © 2022 Apache Software Foundation. All Rights Reserved.