public class Tiling extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_TILE_SIZE
Subdivide tiles for parallelization until they have this size approximately
|
static int |
MIN_ACCUMULATE_FORK_SIZE
If per-source render tasks in AccumulateProjector contain less target
pixels than this, do not fork them but run sequentially inline.
|
static int |
MIN_TILE_SIZE
Do not subdivide tiles below (or equal to) this size
|
| Constructor and Description |
|---|
Tiling() |
| Modifier and Type | Method and Description |
|---|---|
static List<bdv.viewer.render.Tile> |
findTiles(bdv.viewer.render.VisibleSourcesOnScreenBounds onScreenBounds)
Compute a list of
Tiles that split the render area. |
static List<bdv.viewer.render.Tile> |
splitForRendering(List<bdv.viewer.render.Tile> tiles)
For concurrent rendering, further split tiles until all tiles are below
MAX_TILE_SIZE.
|
public static int MIN_TILE_SIZE
public static int MAX_TILE_SIZE
public static int MIN_ACCUMULATE_FORK_SIZE
public static List<bdv.viewer.render.Tile> findTiles(bdv.viewer.render.VisibleSourcesOnScreenBounds onScreenBounds)
Tiles that split the render area.
The algorithm for splitting is roughly as follows (but may change in the future).
Recursively split each tile as follows:
Find a preferred splitting direction as the dimension in which the tile is larger.
Try to split along the preferred direction: (assume X)
create int[] splitCandidates, order, make unique, and clip to tile bounds in X
if candidates not empty, select the middle element as the new clip bound
create two new TileSplits:
lowerSplit with bounds
lowerSplit.minX = tile.minX
lowerSplit.maxX = bound - 1
upperSplit with bounds
upperSplit.minX = bound
upperSplit.maxX = tile.maxX
for each source:
if (source.maxX < bound)
add to lowerSplit
else if (source.minX >= bound
add to upperSplit
else
add to both lowerSplit and upperSplit
recursively call split(lowerSplit) and split(upperSplit)
merge the resulting TileSplit lists and return
Tf candidates is empty, try splitting along the other direction (same steps as above)
Tf candidates for the second direction are also empty, return singleton list with the unsplit tile.
public static List<bdv.viewer.render.Tile> splitForRendering(List<bdv.viewer.render.Tile> tiles)
tiles - list of tiles split along source boundsCopyright © 2012–2022 BigDataViewer. All rights reserved.