Class TileBlock
- java.lang.Object
-
- org.apache.batik.ext.awt.image.rendered.TileBlock
-
public class TileBlock extends java.lang.Object
This class is responsible for breaking up a block of tiles into a set of smaller requests that are as large as possible without rerequesting significant numbers of tiles that are already available.- Version:
- $Id: TileBlock.java 1831630 2018-05-15 12:56:55Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
benefit
(package private) int
h
(package private) int
occH
(package private) boolean[]
occupied
(package private) int
occW
(package private) int
occX
(package private) int
occY
(package private) int
w
(package private) int
xOff
(package private) int
yOff
-
Constructor Summary
Constructors Constructor Description TileBlock(int occX, int occY, int occW, int occH, boolean[] occupied, int xOff, int yOff, int w, int h)
Construct a tile block this represents a block of contigous tiles.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) int
getBenefit()
Return the number of new tiles computed.(package private) TileBlock[]
getBestSplit()
Returnes an optimized list of TileBlocks to generate that tries to minimize the work to benefit ratio, for the set of blocks defined by this block.(package private) int
getHeight()
Return the height of this block of tiles(package private) int
getWidth()
Return the width of this block of tiles(package private) int
getWork()
Return the approximate amount of work required to compute those tiles.(package private) static int
getWork(TileBlock[] blocks)
Returns the total amount of work for the array of tile blocks(package private) int
getXLoc()
Return the x location of this block of tiles(package private) int
getYLoc()
Return the y location of this block of tilesboolean
simplify()
TileBlock[]
splitOneGo()
java.lang.String
toString()
Really nice to string that outlines what tiles are filled and what region this block covers.
-
-
-
Constructor Detail
-
TileBlock
TileBlock(int occX, int occY, int occW, int occH, boolean[] occupied, int xOff, int yOff, int w, int h)
Construct a tile block this represents a block of contigous tiles.- Parameters:
xOff
- The x index of left edge of the tile block.yOff
- The y index of top edge of the tile block.w
- The number of tiles across in the blockh
- The number of tiles down the blockoccupied
- Which entries in the block are already computed.
-
-
Method Detail
-
toString
public java.lang.String toString()
Really nice to string that outlines what tiles are filled and what region this block covers. Really useful for debugging the TileBlock stuff.- Overrides:
toString
in classjava.lang.Object
-
getXLoc
int getXLoc()
Return the x location of this block of tiles
-
getYLoc
int getYLoc()
Return the y location of this block of tiles
-
getWidth
int getWidth()
Return the width of this block of tiles
-
getHeight
int getHeight()
Return the height of this block of tiles
-
getBenefit
int getBenefit()
Return the number of new tiles computed.
-
getWork
int getWork()
Return the approximate amount of work required to compute those tiles.
-
getWork
static int getWork(TileBlock[] blocks)
Returns the total amount of work for the array of tile blocks
-
getBestSplit
TileBlock[] getBestSplit()
Returnes an optimized list of TileBlocks to generate that tries to minimize the work to benefit ratio, for the set of blocks defined by this block.
-
splitOneGo
public TileBlock[] splitOneGo()
-
simplify
public boolean simplify()
-
-