IPyramidBase

Description

interface Tinman.Terrain.Pyramids.IPyramidBase

Derived from

IMapEntity

Extended by

IPyramid
PyramidBase abstract

Non-generic base interface for classes that represent a pyramid of tile data.

A tile pyramid is organized as a cubemap, where each cubemap face defines as quad-tree. The quad-tree nodes each hold a single data tile. The data type of tiles is defined by the TData parameter of the IPyramid interface.

The topmost level (level index 0) contains only a single data tile:
+---------------+
|               |
|               |       +---> tileX
|               |       |
|               |       |
|               |       V
|               |       tileY
|               |
+---------------+

According to quad-tree semantics, each data tile is split into four children:
+-------+-------+
|       |       |
|       |       |       +---> tileX
|       |       |       |
+-------+-------+       |
|       |       |       V
|       |       |       tileY
|       |       |
+-------+-------+

This is done until the bottommost level (level count, minus one) is reached:
+---+---+---+---+
|   |   |   |   |
+---+---+---+---+       +---> tileX
|   |   |   |   |       |
+---+---+---+---+       |
|   |   |   |   |       V
+---+---+---+---+       tileY
|   |   |   |   |
+---+---+---+---+

Tile pyramids can be sparse, i.e. some tiles can be void (see TileDataResult.Void). The pyramid flags (see Flags, PyramidFlags.Opaque) define how void tiles shall be handled during rendering.

+-------+-------+    +---+---+---+---+
|       |       |    |   |   |   | X |
|       |       |    +---+---+---+---+
|       |       |    |   |   |   |   |
+-------+-------+    +---+---+---+---+    X := void tiles
|       |       |    | X | X |   |   |
|   X   |       |    +---+---+---+---+
|       |       |    | X | X |   |   |
+-------+-------+    +---+---+---+---+

Tile pyramids come in two flavours:

The geo-reference raster of a pyramid (IGeorefInfo.Georef and IMapInfo.Map) always spans the maximum possible pyramid level (see MappingUtil.MaxSize), independent of the actual pyramid size (see FullSize), assuming a tile pad of zero (see TilePad):

(0|0) : raster coordinates of top-left corner of top-left tile, on any level.
(m|m) : raster coordinates of bottom-right corner of bottom-right tile, on any level.

where m is MappingUtil.MaxSize. This means that the geo-reference raster has PixelCoverage.PixelIsPoint semantics.

Public / Methods

Clear​Caches


[ThreadSafe]
public method ClearCaches → (1)

flags in : ClearCacheFlags

The clear flags.

Clears all cached content for this pyramid.

Has​Tile​Data

3 overloads


public method HasTileData1 → (1)

region opt : MapRegion = null

The output region. If null, a new MapRegion will be created with MapRegion.For1, passing this.

returns → MapRegion

The MapRegion that contains the collected data regions.

Collects the regions on the bottom-most level where data content is available.


[ThreadSafe]
public method HasTileData2 → (1)

coords in : PyramidCoords

The pyramid tile coords.

returns → bool

true if data for the given map tile exists,
false if no data exists or an error has occurred while checking.

Checks if there is any data content available for the given map tile (i.e. TileDataResult.Ok).


[ThreadSafe]
public method HasTileData3 → (4)

face in : CubemapFace

Cubemap face of map tile. Set to CubemapFace.NegZ for unprojected map pyramids.

level in : int32

[>=0]
The pyramid level.

in : int32

Cubemap face X-coordinate of map tile in level.

in : int32

Cubemap face Y-coordinate of map tile in level.

returns → bool

true if data for the given map tile exists,
false if no data exists or an error has occurred while checking.

Checks if there is any data content available for the given map tile (i.e. TileDataResult.Ok).

Public / Attributes

Flags


[Constant]
public attribute Flags → (get)

value : PyramidFlags

The pyramid flags.

Additional behaviour flags of the pyramid.

Format​Hint


[Constant]
public attribute FormatHint → (get)

value : PixelFormat

The pixel format hint, see PixelPyramidBuilder.FormatHint.

The pixel format hint of this pixel pyramid.

Full​Size


[Constant]
public attribute FullSize → (get)

value : int32

[pow2]
The pyramid size (width and height), in samples.

The size of the bottom-most pyramid level.

Levels


[Constant]
public attribute Levels → (get)

value : int32

[>=1]
The number of pyramid levels.

The number of pyramid levels.

On​Updated


[Constant]
public attribute OnUpdated → (get)

value : IEventGeneric<PyramidEventArgs>

[not-null]
The event object.

Event for listening to updates made to this pixel pyramid.

This event will be fired by the thread that performs the map update.

Tile​Pad


[Constant]
public attribute TilePad → (get)

value : int32

[>=0]
The pad width.

The pad width of this cube pyramid.

Tile padding is used to avoid color bleeding that will occur when texture samples are filtered at the edge of a pyramid tile (assuming tiles are stored in some kind of texture atlas). The tile pad width gives the number of safety pixels at the that are borrowed from neighbouring pyramid tiles:

      8x8 tile, with a pad of 2:

    0   1   2   3   4   5   6   7
  +---+---+---+---+---+---+---+---+
0 |###|###|###|###|###|###|###|###|
  +---+---+---+---+---+---+---+---+
1 |###|###|###|###|###|###|###|###|
  +---+--(X)--+---+---+--(X)--+---+
2 |###|###|   |   |   |   |###|###|
  +---+---+---+---+---+---+---+---+
3 |###|###|   |   |   |   |###|###|
  +---+---+---+---+---+---+---+---+
4 |###|###|   |   |   |   |###|###|
  +---+---+---+---+---+---+---+---+
5 |###|###|   |   |   |   |###|###|
  +---+--(X)--+---+---+--(X)--+---+
6 |###|###|###|###|###|###|###|###|
  +---+---+---+---+---+---+---+---+
7 |###|###|###|###|###|###|###|###|
  +---+---+---+---+---+---+---+---+

The point coordinates marked with (X) will be mapped to the corner vertices of each terrain mesh sector. Only the effective region of a padded tile (i.e. the square surrounded by (X)) contains actual data. The padded pixels are sampled from neighbouring source tiles and carry redundant information.

Tile​Size


[Constant]
public attribute TileSize → (get)

value : int32

[pow2]
The tile size.

The size of a single map tile, in pixels.

Extensions

Level​Georef


public static method LevelGeoref → (1)

level opt : int32 = -1

The pyramid level. If negative, the pyramid level count (see IPyramidBase.Levels) will be added.

returns → IGeorefInfo

The geo-reference for level opt or null if IGeorefInfo.Georef of this is null.

Returns a geo-reference for the given pyramid level.

Level​Map


public static method LevelMap → (1)

level opt : int32 = -1

The pyramid level. If negative, the pyramid level count (see IPyramidBase.Levels) will be added.

returns → MapInfo

The map info for level opt.

Returns the map info for the given pyramid level.

Level​Raster


public static method LevelRaster → (1)

level opt : int32 = -1

The pyramid level. If negative, the pyramid level count (see IPyramidBase.Levels) will be added.

returns → Raster

The geo-reference raster for level opt or null if IGeorefInfo.Georef is null.

Returns a geo-reference raster that spans the given pyramid level.

Level​Size


public static method LevelSize → (1)

level opt : int32 = -1

The pyramid level. If negative, the pyramid level count (see IPyramidBase.Levels) will be added.

returns → int32

The full size of the pyramid level.

Returns the size of the given pyramid level.

Valid​Coords

2 overloads


public static method ValidCoords1 → (1)

coords in : PyramidCoords

The pyramid coordinates.

returns → bool

true if the pyramid coordinates are valid, false if not.

Checks if the given pyramid coordinates are valid for this IPyramid object.


public static method ValidCoords2 → (4)

face in : CubemapFace

The cubemap face.

level in : int32

The pyramid level.

in : int32

X-coordinate of pyramid tile.

in : int32

Y-coordinate of pyramid tile.

returns → bool

true if the pyramid coordinates are valid, false if not.

Checks if the given pyramid coordinates are valid for this IPyramidBase object.