IPixelPyramid

Description

interface Tinman.Terrain.Pyramids.IPixelPyramid

Base interface for classes that represent a tile pyramid of color buffers (see ColorBuffer).

Public / Methods

Cache

2 overloads


[OwnerReturn] [OwnerThis]
public method Cache1 → ()

returns → IPixelPyramid

The cached map pyramid.

Wraps this pixel pyramid in a memory cache.

The built-in pixel pyramid operations already make use of the Cache1 method where applicable, so client code usually does not need to call it.

If the Cache1 method has already been called on this object, the method silently returns this.


[OwnerReturn] [OwnerThis]
public method Cache2 → (2)

cache in : PyramidFileCache

[not-null]
The cache to use.

pyramidId in : int32

[0..1023]
Persistent unique identifier of the pixel pyramid being cached.

returns → IPixelPyramid

The cached map pyramid.

Wraps this pixel pyramid in a file cache.

Compute​Gsd


public method ComputeGsd → (3)

level in : int32

The pyramid level.

in : int32

The pyramid tile X-coordinate.

in : int32

The pyramid tile Y-coordinate.

returns → RangeD

The ground sample distance range, in metres.

Computes the ground sample distance of the given pyramid tile.

Set​Tile​Data


[ThreadSafe]
public method SetTileData → (7)

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.

data in : ColorBuffer

The input buffer to use or null to empty the tile. If the input buffer contains zero pixel samples everywhere, the method behaves as if null had been passed to the data in parameter.

dataX opt : int32 = 0

[>=0]
X-coordinate of top-left corner of input rectangle.

dataY opt : int32 = 0

[>=0]
Y-coordinate of top-left corner of input rectangle.

Sets the data content of the given map tile.

If data in is not null, the content of the given map tile will be updated with the specified data in. If the map tile does not exist, it will be created as empty (see TileDataResult.Empty), before being updated. Also, all non-existent ancestors of the map tile will be created as empty tiles (see TileDataResult.Empty).

If data in is null, the map tile will be emptied (see TileDataResult.Empty). If the map tile is a leaf (i.e. it does not have any existing child tiles), it will be removed (see TileDataResult.Void). All empty map tiles that become a leaf because of this removal will also be removed recursively.

IOException

If an I/O error has occurred while setting the data content.

Slice


[OwnerReturn] [OwnerThis]
public method Slice → (2)

levels in : RangeI

The range of pyramid levels to include in the returned pixel pyramid. Pyramid tiles in levels smaller than RangeI.Start will be TileDataResult.Empty, tiles in levels greater than RangeI.Last will be TileDataResult.Void.

gsd in : RangeD

The range of ground sample distance values to include in the returned pixel pyramid (see ComputeGsd).

returns → IPixelPyramid

The sliced map pyramid.

Slices this pixel pyramid by the given level range and/or ground sample distance range.

To​Full​Size


[OwnerReturn] [OwnerThis]
public method ToFullSize → (1)

fullSize in : int32

[pow2]
The new full size (i.e. size of bottommost level).

returns → IPixelPyramid

The resulting pixel pyramid.

Changes the level count resp. full size of this pixel pyramid.

To​Tile​Pad


[OwnerReturn] [OwnerThis]
public method ToTilePad → (1)

tilePad in : int32

[>=0]
The new tile padding value.

returns → IPixelPyramid

The resulting pixel pyramid.

Changes the tile padding of this pixel pyramid.

To​Tile​Size


[OwnerReturn] [OwnerThis]
public method ToTileSize → (1)

tileSize in : int32

[pow2]
The new tile size.

returns → IPixelPyramid

The resulting pixel pyramid.

Changes the tile size of this pixel pyramid.

Extensions

Combine


[OwnerReturn] [OwnerThis]
public static method Combine → (4)

other in : IPixelPyramid own

[not-null]
The other pixel pyramid (second).

colorOp opt : ColorOp = ColorOp.Blend

The color operation to apply.

combineOp opt : CombineOp = CombineOp.Union

The combine operation to apply.

scale opt : int32 = 0

Determines whether the first resp. second pyramid will be scaled up to the full size of the resulting pyramid, if necessary (see IPixelPyramid.ToFullSize):

  • < 0
    The first pyramid will be used as is, i.e. it will return TileDataResult.Void for non-existing levels.
    The second pyramid will be scaled up to the full size of the resulting pyramid, if necessary.

  • = 0
    The first pyramid will be scaled up to the full size of the resulting pyramid, if necessary.
    The second pyramid will be scaled up to the full size of the resulting pyramid, if necessary.

  • > 0
    The first pyramid will be scaled up to the full size of the resulting pyramid, if necessary.
    The second pyramid will be used as is, i.e. it will return TileDataResult.Void for non-existing levels.

returns → IPixelPyramid

The resulting pixel pyramid.

Combines this pyramid (first) with the given one (second), according to the given color and combine operation (see ColorOp, CombineOp).

If the given combine operation (see combineOp opt) has yielded a result of TileDataResult.Ok, the tile data buffers of the first and second pyramids are combined by applying the specified color operation (see colorOp opt); existing tiles of second will overwrite existing tiles of first.

The resulting pixel pyramid will have the maximum tile size, maximum full size and maximum tile pad as of the first and second pyramids (see IPyramidBase.TileSize, IPyramidBase.FullSize and IPyramidBase.TilePad).

Copy​Tiles


[OwnerReturn]
public static method CopyTiles → (4)

target opt : IPixelPyramid = null

The target pixel pyramid or null to just visit the tiles in this pyramid. Defaults to null

mode opt : int32 = 0

The copy mode (will be ignored if target opt is null):
0 : get all source tiles and always copy to target
1 : get and copy source tile only if target tile does not exist.
2 : get and copy source tile only if target tile already exists.

tiles opt : IBagConst<PyramidCoords> = null

The pyramid tiles to copy. If null, a breadth-first traversal of all tiles in this pyramid is performed.

error opt : ICollector<PyramidCoords> = null

Collector for pyramid tiles for which TileDataResult.Error has been received. If null, an error log message will be output in this case. The returned operation will access the collector only from a single thread.

returns → IOperation

The resulting background operation.

Processes the given pyramid tiles by getting the tile data for each one and optionally copies the tile data to the specified output pyramid.

The copy operation can be used to transfer tile data from one pyramid to another. Also, it may be used without target, for example to warm up a pyramid file cache.

Downsample


[OwnerReturn]
public static method Downsample → (1)

filter opt : DownsampleFilter = DownsampleFilter.Average

The downsample filter to use.

returns → IOperation

The resulting background operation.

Fills all TileDataResult.Empty tiles of this pyramid by downsampling the four child tiles.

Draw


[OwnerReturn] [OwnerThis]
public static method Draw → (2)

draw opt : DrawDelegate = null

The draw delegate method (see IPixelPyramidDraw.Draw).

userData opt : object = null

Optional user data object (see IPixelPyramidDraw.UserData).

returns → IPixelPyramidDraw

The resulting pixel pyramid.

Performs some user-defined drawing on the pyramid tile.

Encode​Pixels


[OwnerReturn] [OwnerThis]
public static method EncodePixels → (1)

format in : TextureFormat

[not-null]
The texture format to use for encoding.

returns → ITexelPyramid

The encoded texture pyramid.

Returns an encoded version of this pyramid to use for texturing.

Set​Tile​Data


[ThreadSafe]
public static method SetTileData → (4)

coords in : PyramidCoords

The pyramid tile coords.

data in : ColorBuffer

The input buffer to use or null to empty the tile. If the input buffer contains zero pixel samples everywhere, the method behaves as if null has been passed to the data in parameter.

dataX opt : int32 = 0

[>=0]
X-coordinate of top-left corner of input rectangle.

dataY opt : int32 = 0

[>=0]
Y-coordinate of top-left corner of input rectangle.

Sets the data content of the given map tile.

If data in is not null, the content of the given map tile will be updated with the specified data in. If the map tile does not exist, it will be created as empty (see TileDataResult.Empty), before being updated. Also, all non-existent ancestors of the map tile will be created as empty tiles (see TileDataResult.Empty).

If data in is null, the map tile will be emptied (see TileDataResult.Empty). If the map tile is a leaf (i.e. it does not have any existing child tiles), it will be removed (see TileDataResult.Void). All empty map tiles that become a leaf because of this removal will also be removed recursively.

IOException

If an I/O error has occurred while setting the data content.

Slice

2 overloads


[OwnerReturn] [OwnerThis]
public static method Slice1 → (1)

levels in : RangeI

The range of pyramid levels to include in the returned pixel pyramid. Pyramid tiles in levels smaller than RangeI.Start will be TileDataResult.Empty, tiles in levels greater than RangeI.Last will be TileDataResult.Void.

returns → IPixelPyramid

The sliced map pyramid.

Slices this pixel pyramid by the given level range.


[OwnerReturn] [OwnerThis]
public static method Slice2 → (1)

gsd in : RangeD

The range of ground sample distance values to include in the returned pixel pyramid (see IPixelPyramid.ComputeGsd).

returns → IPixelPyramid

The sliced map pyramid.

Slices this pixel pyramid by the given ground sample distance range.

To​Image

3 overloads


public static method ToImage1 → (1)

face opt : CubemapFace = CubemapFace.NegZ

The cubemap face.

returns → IImage

The created IImage object.

Reads a whole cubemap face of the bottom-most level of this pyramid as an image.

The returned IImage object will never throw IOExceptions or ValidatingExceptions.


public static method ToImage2 → (2)

level in : int32

[>=0]
The pyramid level.

face opt : CubemapFace = CubemapFace.NegZ

The cubemap face.

returns → IImage

The created IImage object.

Reads a whole cubemap face of a single level of this pyramid as an image.

The returned IImage object will never throw IOExceptions or ValidatingExceptions.


public static method ToImage3 → (2)

level in : int32

[>=0]
The pyramid level.

rect in : CubemapFaceRect

The rectangular region.

returns → IImage

The created IImage object.

Reads a rectangular region of a single level of this pyramid as an image.

The returned IImage object will never throw IOExceptions or ValidatingExceptions.

Unproject


[OwnerReturn] [OwnerThis]
public static method Unproject → (5)

tileSize opt : int32 = 256

[pow2]
The unprojected tile size, in pixels.

pad opt : int32 = 0

[>=0]
The padding width, in pixels (see IPyramidBase.TilePad).

allowMinify opt : bool = true

Allow unprojected tiles to be minified during projection?

allowMagnify opt : bool = true

Allow unprojected tiles to be magnified during projection?

levels opt : int32 = 0

[>=0]
Number of cube pyramid levels. If 0 the maximum level count will be inferred from this map pyramid and the given tile size.

returns → IPixelPyramid

The unprojected map pyramid.

Unprojects this map pyramid into a plain cubemap pyramid.

GeorefException

If the geo-reference of this pyramid cannot be unprojected to a plain cubemap geographic coordinate system.