Class TileBlock

java.lang.Object
org.apache.batik.ext.awt.image.rendered.TileBlock

public class TileBlock extends 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
     
    (package private) int
     
    (package private) int
     
    (package private) boolean[]
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
    (package private) int
     
  • 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

    Modifier and Type
    Method
    Description
    (package private) int
    Return the number of new tiles computed.
    (package private) TileBlock[]
    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
    Return the height of this block of tiles
    (package private) int
    Return the width of this block of tiles
    (package private) int
    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
    Return the x location of this block of tiles
    (package private) int
    Return the y location of this block of tiles
    boolean
     
     
    Really nice to string that outlines what tiles are filled and what region this block covers.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • occX

      int occX
    • occY

      int occY
    • occW

      int occW
    • occH

      int occH
    • xOff

      int xOff
    • yOff

      int yOff
    • w

      int w
    • h

      int h
    • benefit

      int benefit
    • occupied

      boolean[] occupied
  • Constructor Details

    • 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 block
      h - The number of tiles down the block
      occupied - Which entries in the block are already computed.
  • Method Details

    • toString

      public 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 class 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()