import { type HeightGrid } from './grid'; import type { TerrainResample } from './tile'; export type TerrainImportFormat = 'png16' | 'r16' | 'f32'; export interface ImportTerrainOptions { format?: TerrainImportFormat | 'auto'; /** How a coarser posting reaches the authoring grid. Default `cubic`; bilinear creases along every source row and column. */ resample?: TerrainResample; /** The SOURCE posting in metres, which the resampler reads the file at. */ metresPerSample: number; /** The AUTHORING grid's spacing, one of `TERRAIN_SAMPLE_SPACINGS`; default 1. */ outputMetresPerSample?: number; /** Metres the darkest and brightest sample stand for. Required for png16 and r16; f32 already holds metres. */ heightRange?: [number, number]; /** Added to every decoded height: how a source whose sea level reads 507 m lands on 0. */ heightOffset?: number; /** Samples per row. Required for raw R16 and f32 unless the file is square; ignored for PNG. */ samples?: number; tilesX?: number; tilesZ?: number; /** World metres of sample (0, 0); omitted, the grid is centred on the origin. */ originX?: number; originZ?: number; } /** A heightmap already decoded into ABSOLUTE metres: what a bundle reader hands over instead of writing a temp file. */ export interface TerrainSampleSource { /** Samples per row; `heights` is row-major with X the fastest axis. */ samples: number; heights: Float32Array; /** What the provenance names where a file path would stand. */ label?: string; } /** `importTerrain`'s options minus the three only a file needs: the samples are already decoded metres. */ export type ImportTerrainSamplesOptions = Omit; /** * Reads a heightmap into the authoring grid, resampling through every source sample and centring the source on the * target: a source that is not a whole number of tiles is cropped symmetrically rather than stretched. */ export declare function importTerrain(file: string, options: ImportTerrainOptions): Promise; /** The same import off samples already in memory: one resampler, one provenance shape, no file on disk. */ export declare function importTerrainSamples(source: TerrainSampleSource, options: ImportTerrainSamplesOptions): HeightGrid;