/** * LAS (ASPRS LAS 1.0–1.4) reader. * * Phase 1 covers Point Data Record Formats 0/1/2/3 — the legacy compact * formats that account for ~99% of files in the wild. Formats 6–10 * (LAS 1.4 extended) decode similarly but use 64-bit point counts and a * 30-byte base record; we add them here without forking a separate file. * * Coordinates: stored as int32 with per-axis scale + offset. Real units * are `(raw * scale) + offset` per axis. Bounding box is read directly * from the header. * * RGB: present in formats 2, 3, 5, 7, 8, 10. Channels are u16 (0..65535). * Many real-world files store 8-bit values in the low byte and leave the * high byte at 0 — the spec calls this out as "scaled to 16-bit" but * lots of converters get it wrong. We auto-detect by checking the max * channel value across the whole file and rescale on the fly when needed. */ import type { DecodedPointChunk, PointCloudBBox } from '../types.js'; /** Public-Header Block (PHB) fields we use. */ export interface LasHeader { versionMajor: number; versionMinor: number; headerSize: number; /** Byte offset to the first Point Data Record. */ pointDataOffset: number; numberOfVlrs: number; pointDataFormatId: number; /** Bytes per point record (header value, may be larger than the spec * baseline if the producer added Extra Bytes). */ pointRecordLength: number; pointCount: number; scale: [number, number, number]; offset: [number, number, number]; bbox: PointCloudBBox; hasGpsTime: boolean; hasRgb: boolean; } export declare function parseLasHeader(buffer: ArrayBuffer | Uint8Array): LasHeader; /** * Decode `count` consecutive point records into a chunk. * * `bytes` is the slice of the full file starting AT the first point we * want to decode (not at the file's pointDataOffset). Caller is expected * to have advanced past the header / VLRs. * * `stride` should equal `header.pointRecordLength`. We honour any extra * bytes the producer tacked on by skipping them. */ export declare function decodeLasPoints(bytes: Uint8Array, header: LasHeader, count: number, stride?: number, rgbScale?: number): DecodedPointChunk; /** Sample up to `samples` RGB triples; return the max channel value seen. * Used to detect "8-bit RGB stuffed into low byte of u16" producers. */ export declare function sampleMaxRgbChannel(bytes: Uint8Array, header: LasHeader, samples?: number): number; //# sourceMappingURL=las.d.ts.map