encode

fun encode(buffer: ElevationTileBuffer, isFloat: Boolean, tileWidth: Int, tileHeight: Int): ElevationStorageCodec.Encoded

Encode a tile buffer for storage. Dispatches on buffer type and isFloat:

sourceisFloatoutput
ShortBufferfalseTIFF-Uint16 codes (scale=1, offset=0)
ShortBuffertrueTIFF-Float32 (widened, lossless)
FloatBuffertrueTIFF-Float32 (lossless)
FloatBufferfalseTIFF-Uint16 with (scale, offset) packed from the FloatBuffer's value range — preserves up to ~range/65535 per pixel; no ShortArray intermediate