/** * DEM tiles (Terrarium or Mapbox RGB encoding, web-mercator tiles), decoded by the engine itself: Cesium's terrain * comes from the same tiles MapLibre draws (no Cesium Ion, self-hostable like the basemap, §25), and heights are * sampled anywhere, not only where the map happens to have tiles loaded. */ import type { TerrainConfig } from '../core/types.js'; /** Heights (metres) packed in one pixel's colour. */ export declare function decodeHeight(r: number, g: number, b: number, encoding: TerrainConfig['encoding']): number; /** * A `size`×`size` RGBA tile resampled to an `out`×`out` heightmap (edges included, as Cesium expects), row by row * from north to south. */ export declare function heightsFromTile(rgba: Uint8ClampedArray | Uint8Array, size: number, out: number, encoding: TerrainConfig['encoding']): Float32Array; /** Fetches a DEM tile and decodes it to an `out`×`out` heightmap. Undefined when the tile is missing. */ export declare function loadHeights(url: string, out: number, encoding: TerrainConfig['encoding']): Promise; /** Where a point falls in the web-mercator tile grid at zoom `z`: tile x/y and the fraction (0…1) inside it. */ export declare function tilePoint(longitude: number, latitude: number, z: number): { x: number; y: number; fx: number; fy: number; }; /** Height at a fraction inside a decoded `size`×`size` tile, between its four nearest pixels. */ export declare function heightAt(heights: Float32Array, size: number, fx: number, fy: number): number; /** * True heights (metres, no exaggeration) from the DEM tiles at one detail level, anywhere on Earth. Tiles are * fetched once per batch and kept (a small cache, oldest dropped). A missing or failed tile gives null: unknown, * never sea level. */ export declare class DemSampler { private readonly terrain; private readonly zoom; private readonly maxTiles; private readonly load; private readonly tiles; constructor(terrain: TerrainConfig, zoom?: number, maxTiles?: number, load?: (url: string) => Promise<{ rgba: Uint8ClampedArray | Uint8Array; size: number; } | undefined>); /** Tiles are shared between calls, so a caller's cancel is checked by the caller, not passed to the fetch. */ sample(positions: Array<{ longitude: number; latitude: number; }>): Promise>; private tile; } /** The tile URL for x/y/z. */ export declare const tileUrl: (template: string, x: number, y: number, z: number) => string;