import type { ElevationConverter } from '../../index.js'; /** The Resultant mesh created from elevation data */ export interface TerrainMesh { /** The size of the elevation grid */ gridSize: number; /** The complete elevation grid */ terrain: number[]; /** The vertices of the mesh to be rendered */ vertices: number[]; /** The triangles of the mesh to be rendered */ triangles: number[]; } /** * # Build Terrain Mesh * * ## Description * * Builds a triangular mesh from elevation data. Useful for rendering elevation data as a 3D model. * * This is a port of the [martini](https://github.com/mapbox/martini) codebase to be compatible with this library. * * NOTE: Defaults to the Mapbox elevation data converter `convertMapboxElevationData`. However, * to use the Terrarium elevation data converter, use `convertTerrariumElevationData`. * * NOTE: This algorithm is limited to a GRID, meaning both the width and height must be equal and a power of 2. * * ## Examples * * ```ts * import { buildTerrainMesh } from 'gis-tools-ts'; * // If using Terrarium elevation data: * // import { convertTerrariumElevationData } from 'gis-tools-ts'; * * const elevationImage = await Bun.file(`${__dirname}/fixtures/fuji.png`).arrayBuffer(); * const { terrain, vertices, triangles } = await buildTerrainMesh(elevationImage, 500, undefined, false); * ``` * * ## Links * - * * @param image - the raw RGB(A) image data * @param maxError - The maximum error allowed in the mesh in meters * @param elevationConverter - the conversion function to convert the pixels to elevation * @param tmsStyle - if true, the y position will be inverted * @returns the terrain mesh. The elevation values. */ export declare function buildTerrainMesh(image: ArrayBufferLike | Uint8Array | Uint8ClampedArray | Buffer | ImageData, maxError?: number, elevationConverter?: ElevationConverter, tmsStyle?: boolean): Promise; //# sourceMappingURL=mesh.d.ts.map