Heightmap.Import

Description

Name

class Tinman.Heightmap.Import

Derived from

Operation

Imports pixel data into a dataset.

Pixel data will not be resampled or reprojected. Only pixel values will be scaled and/or translated if necessary, i.e. raw pixel values (see Image.Range) are mapped to terrain-space elevation values (see Vertical.Range).

If topLeft is undefined, this method uses geo-referencing information present in image and this dataset. The pixels of image will be imported and written to the geo-referenced dataset region.

If topLeft is defined, this method ignores geo-referencing information present in image and/or this dataset. The pixels of image will be imported and written to a dataset region denoted by topLeft and transform.

A-------B
|       |    input image: W x H pixels
D-------C

First, the given transform is applied to the input image, using the center of its map raster as the center of transformation. This figure shows the transformed image for Tinman.Transform.Diagonal:

A----D
|    |
|    |      transformed input image: W' x H' pixels
|    |
B----C

Then, the top-left pixel of the transformed input image (here A) is tied to the given cubemap face coordinates (see topLeft) and the pixels of the transformed image are imported into the cubemap face, where to X-axis resp. Y-axis of the transformed input image correspond to the cubemap face X-axis resp. Y-axis.

Fields / Required

image

Type

Image

Constraint

# != null

The pixel data to import.


dataset

Type

Heightmap

Constraint

# != null

The target dataset.

Fields / Optional

validate

Type

bool

Default

true

Validate image data before processing?


topLeft

Type

Coords

Default

{Coords: 0, 0, None}

Cubemap face coordinates of top-left pixel of transformed input image.


transform

Type

Tinman.Transform

Default

Tinman.Transform.None

Transform to apply to input image.


materials

Type

Vec4

Default

{Vec4: 0, 1, 2, 3}

The material IDs to associate with the red-, green-, blue- and alpha channels of the imported image pixels. This is only relevant when importing pixel data into the Heightmap.Layer.Material layer.