/** * PTS / XYZ ASCII point reader. * * Both formats are line-oriented plain-text scans. They differ only * in the optional first-line point count (PTS may have one; XYZ * never does) and in convention rather than syntax. * * Supported per-line layouts (auto-detected from column count of the * first data line): * 3 cols → X Y Z * 4 cols → X Y Z I (intensity, normalised 0..1 or 0..255) * 6 cols → X Y Z R G B (RGB 0..255) * 7 cols → X Y Z I R G B (PTS standard layout) * 9 cols → X Y Z I R G B Nx Ny Nz (normals dropped) * * Lines starting with `#`, `//`, or blank are skipped (comment * support is non-standard but common in field exports). * * The reader is intentionally tolerant: any column count outside the * known set falls through to "X Y Z plus discarded extras" so a file * with weird custom columns still loads. */ import type { DecodedPointChunk } from '../types.js'; export type AsciiPointsFormat = 'pts' | 'xyz'; export interface AsciiPointsLayout { /** Number of whitespace-separated columns per data line. */ columns: number; /** True if the first non-comment line is a single-integer point count. */ hasHeaderCount: boolean; /** Resolved per-column meaning for the auto-detected layout. */ fields: AsciiPointsField[]; } export type AsciiPointsField = 'x' | 'y' | 'z' | 'i' | 'r' | 'g' | 'b' | 'skip'; /** * Probe the first ~16 KB to decide format + column layout. * * Looks at the first non-blank/non-comment line: * - If it's a single integer, treat as a header point count (PTS). * - Otherwise the column count of that line determines the layout. * * Returns null when the buffer doesn't look like ASCII point data * (e.g. binary content, non-numeric tokens). Caller can then surface * a clear "not a point cloud" error. */ export declare function probeAsciiPointsLayout(buffer: Uint8Array, format: AsciiPointsFormat): AsciiPointsLayout | null; /** * Decode an entire ASCII point file into a single `DecodedPointChunk`. * * For multi-gigabyte scans the streaming source (`AsciiPointsStreamingSource`) * should be preferred — this path materialises everything in memory. * * Per-channel handling: * - Intensity: if any value > 1.0, treat the column as 0..255 and * scale to u16. Otherwise treat as 0..1 and scale to u16. Mixed * ranges within one file are uncommon; we make the call once. * - RGB: if any channel > 1.0, treat the columns as 0..255. Else 0..1. */ export declare function decodeAsciiPoints(bytes: Uint8Array, format: AsciiPointsFormat): DecodedPointChunk; /** Same as `decodeAsciiPoints` but takes pre-decoded text. */ export declare function decodeAsciiPointsFromText(text: string, layout: AsciiPointsLayout): DecodedPointChunk; //# sourceMappingURL=ascii-points.d.ts.map