IHeightmapFormat
Description
- Derived from
-
IHeightmapLayers
ISerializable
IEquatable<IHeightmapFormat>
IConfigurable - Extended by
-
HeightmapFormat abstract
Base interface for classes that convert heightmap samples to byte sequences and vice versa.
Public / Methods
Collect
Converts this heightmap format to a list of atomic IHeightmapFormat components (i.e. format components that provide a single heightmap layer).
DatasetToHeightmap
Converts the given bytes into heightmap samples.
This method will read a chunked array of bytes from the given buffer:
Source (chunked array, multiple samples per byte): +---+---+---+---+---+---+---+---+---+---+---+---+---+ | 0 | 1 |...| 2 | 3 | 4 |...| 5 |...| 6 | 7 |...| 8 | +---+---+---+---+---+---+---+---+---+---+---+---+---+ \_____________/ \_____________/ \_____________/ Samples 0-N Sample 0-N Samples 0-N Byte 0 Byte 1 Byte M Target (interleaved array, multiple bytes per sample): +---+---+---+---+---+---+---+---+---+---+---+---+---+ | 0 | 3 |...| 6 | 1 | 4 |...| 7 |...| 2 | 5 |...| 8 | +---+---+---+---+---+---+---+---+---+---+---+---+---+ \_____________/ \_____________/ \_____________/ Sample 0 Sample 1 Sample N Bytes 0-M Bytes 0-M Bytes 0-M
Running through the samples of the given heightmap region in in packed row-major order for each value byte will yield the source array. The elements of the target array will be written to the given buffer in.
HeightmapToDataset
Converts the given heightmap samples into bytes.
This method will write a chunked array of bytes to the given buffer:
Source (interleaved array, multiple bytes per sample): +---+---+---+---+---+---+---+---+---+---+---+---+---+ | 0 | 1 |...| 2 | 3 | 4 |...| 5 |...| 6 | 7 |...| 8 | +---+---+---+---+---+---+---+---+---+---+---+---+---+ \_____________/ \_____________/ \_____________/ Sample 0 Sample 1 Sample N Bytes 0-M Bytes 0-M Bytes 0-M Target (chunked array, multiple samples per channel): +---+---+---+---+---+---+---+---+---+---+---+---+---+ | 0 | 3 |...| 6 | 1 | 4 |...| 7 |...| 2 | 5 |...| 8 | +---+---+---+---+---+---+---+---+---+---+---+---+---+ \_____________/ \_____________/ \_____________/ Samples 0-N Samples 0-N Samples 0-N Channel 0 Channel 1 Channel M
Running through the samples of the given heightmap region in in packed row-major order will yield the source array. The elements of the target array will be written to the given buffer in.