Decodes a single Mapbox Terrain-RGB pixel into metres above sea level.
height = -10000 + ((R * 256 * 256 + G * 256 + B) * 0.1)
Channel values are clamped to the 0–255 byte range, so callers may pass raw ImageData/Uint8ClampedArray samples directly.
ImageData
Uint8ClampedArray
Decodes a single Mapbox Terrain-RGB pixel into metres above sea level.
height = -10000 + ((R * 256 * 256 + G * 256 + B) * 0.1)Channel values are clamped to the 0–255 byte range, so callers may pass raw
ImageData/Uint8ClampedArraysamples directly.