@margoengine/points 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +4 -0
  3. package/README.md +876 -2
  4. package/dist/attributes-DNc-1pdr.js +256 -0
  5. package/dist/attributes.d.ts +48 -0
  6. package/dist/clip.d.ts +55 -0
  7. package/dist/clip.js +122 -0
  8. package/dist/cloud-B4O_G-Df.js +545 -0
  9. package/dist/cloud.d.ts +155 -0
  10. package/dist/color.d.ts +1 -0
  11. package/dist/copc-write.d.ts +95 -0
  12. package/dist/copc-write.js +318 -0
  13. package/dist/copc.d.ts +55 -0
  14. package/dist/copc.js +127 -0
  15. package/dist/depth-video.d.ts +98 -0
  16. package/dist/depth-video.js +164 -0
  17. package/dist/e57.d.ts +163 -0
  18. package/dist/e57.js +624 -0
  19. package/dist/frame.d.ts +14 -0
  20. package/dist/index.d.ts +16 -0
  21. package/dist/index.js +1246 -0
  22. package/dist/las.d.ts +213 -0
  23. package/dist/las.js +500 -0
  24. package/dist/laz-encode-CHXgHra_.js +446 -0
  25. package/dist/laz-encode.d.ts +14 -0
  26. package/dist/laz-model-DCphHLqH.js +385 -0
  27. package/dist/laz-model.d.ts +47 -0
  28. package/dist/laz-write.d.ts +46 -0
  29. package/dist/laz-write.js +75 -0
  30. package/dist/laz.d.ts +50 -0
  31. package/dist/laz.js +645 -0
  32. package/dist/material.d.ts +167 -0
  33. package/dist/math.d.ts +103 -0
  34. package/dist/octree.d.ts +182 -0
  35. package/dist/octree.js +360 -0
  36. package/dist/pick.d.ts +76 -0
  37. package/dist/pick.js +192 -0
  38. package/dist/plugin.d.ts +235 -0
  39. package/dist/potree-las-RC8sjbYU.js +1 -0
  40. package/dist/potree-las.d.ts +1 -0
  41. package/dist/potree.d.ts +70 -0
  42. package/dist/potree.js +451 -0
  43. package/dist/range-BQuJAjUM.js +23 -0
  44. package/dist/range.d.ts +4 -0
  45. package/dist/screen-door-CALlYs39.js +7 -0
  46. package/dist/shaders-DCnbvb0-.js +282 -0
  47. package/dist/shaders.d.ts +52 -0
  48. package/dist/shared/fog.d.ts +33 -0
  49. package/dist/shared/pass.d.ts +53 -0
  50. package/dist/shared/selection-mask.d.ts +52 -0
  51. package/dist/shared/style-expression.d.ts +18 -0
  52. package/dist/sprites.d.ts +78 -0
  53. package/dist/storage-limit.d.ts +6 -0
  54. package/dist/style.d.ts +124 -0
  55. package/dist/style.js +709 -0
  56. package/dist/surfels.d.ts +95 -0
  57. package/dist/surfels.js +538 -0
  58. package/dist/survey-DToZwkJv.js +46 -0
  59. package/dist/survey.d.ts +10 -0
  60. package/dist/tier-BcFbLPVT.js +91 -0
  61. package/dist/tier.d.ts +6 -0
  62. package/package.json +102 -4
@@ -0,0 +1,385 @@
1
+ //#region src/laz-model.ts
2
+ var e = 16777216, t = class {
3
+ constructor() {
4
+ this.prob = 0, this.zeros = 0, this.total = 0, this.cycle = 0, this.until = 0, this.reset();
5
+ }
6
+ reset() {
7
+ this.zeros = 1, this.total = 2, this.prob = 4096, this.cycle = this.until = 4;
8
+ }
9
+ update() {
10
+ (this.total += this.cycle) > 8192 && (this.total = this.total + 1 >>> 1, this.zeros = this.zeros + 1 >>> 1, this.zeros === this.total && this.total++);
11
+ let e = Math.floor(2147483648 / this.total);
12
+ this.prob = Math.floor(this.zeros * e / 2 ** 18), this.cycle = Math.min(5 * this.cycle >>> 2, 64), this.until = this.cycle;
13
+ }
14
+ }, n = class {
15
+ constructor(e, t = !0) {
16
+ if (this.total = 0, this.cycle = 0, this.until = 0, this.symbols = e, this.last = e - 1, this.dist = new Uint32Array(e), this.counts = new Uint32Array(e), t && e > 16) {
17
+ let t = 3;
18
+ for (; e > 1 << t + 2;) t++;
19
+ this.tableSize = 1 << t, this.tableShift = 15 - t, this.table = new Uint32Array(this.tableSize + 2);
20
+ } else this.tableSize = 0, this.tableShift = 0;
21
+ this.reset();
22
+ }
23
+ reset() {
24
+ this.total = 0, this.cycle = this.symbols, this.counts.fill(1), this.update(), this.cycle = this.until = this.symbols + 6 >>> 1;
25
+ }
26
+ update() {
27
+ let { counts: e, dist: t, symbols: n } = this;
28
+ if ((this.total += this.cycle) > 32768) {
29
+ let t = 0;
30
+ for (let r = 0; r < n; r++) t += e[r] = e[r] + 1 >>> 1;
31
+ this.total = t;
32
+ }
33
+ let r = Math.floor(2147483648 / this.total), i = 2 ** 16, a = 0, o = this.table;
34
+ if (o) {
35
+ let s = 0;
36
+ for (let c = 0; c < n; c++) {
37
+ t[c] = Math.floor(r * a / i), a += e[c];
38
+ let n = t[c] >>> this.tableShift;
39
+ for (; s < n;) o[++s] = c - 1;
40
+ }
41
+ for (o[0] = 0; s <= this.tableSize;) o[++s] = n - 1;
42
+ } else for (let o = 0; o < n; o++) t[o] = Math.floor(r * a / i), a += e[o];
43
+ this.cycle = Math.min(5 * this.cycle >>> 2, n + 6 << 3), this.until = this.cycle;
44
+ }
45
+ }, r = class {
46
+ constructor() {
47
+ this.v = /* @__PURE__ */ new Int32Array(5), this.high = !0;
48
+ }
49
+ reset() {
50
+ this.v.fill(0), this.high = !0;
51
+ }
52
+ get() {
53
+ return this.v[2];
54
+ }
55
+ add(e) {
56
+ let t = this.v;
57
+ this.high ? e < t[2] ? (t[4] = t[3], t[3] = t[2], e < t[0] ? (t[2] = t[1], t[1] = t[0], t[0] = e) : e < t[1] ? (t[2] = t[1], t[1] = e) : t[2] = e) : (e < t[3] ? (t[4] = t[3], t[3] = e) : t[4] = e, this.high = !1) : t[2] < e ? (t[0] = t[1], t[1] = t[2], t[4] < e ? (t[2] = t[3], t[3] = t[4], t[4] = e) : t[3] < e ? (t[2] = t[3], t[3] = e) : t[2] = e) : (t[1] < e ? (t[0] = t[1], t[1] = e) : t[0] = e, this.high = !0);
58
+ }
59
+ }, i = (e) => Array.from({ length: e }, () => new r()), a = (e) => e <= 0 ? 0 : e >= 255 ? 255 : e, o = (e, t, r) => e[t] ??= new n(r), s = (e) => {
60
+ for (let t of e) t?.reset();
61
+ }, c = new Uint8Array([
62
+ 15,
63
+ 14,
64
+ 13,
65
+ 12,
66
+ 11,
67
+ 10,
68
+ 9,
69
+ 8,
70
+ 14,
71
+ 0,
72
+ 1,
73
+ 3,
74
+ 6,
75
+ 10,
76
+ 10,
77
+ 9,
78
+ 13,
79
+ 1,
80
+ 2,
81
+ 4,
82
+ 7,
83
+ 11,
84
+ 11,
85
+ 10,
86
+ 12,
87
+ 3,
88
+ 4,
89
+ 5,
90
+ 8,
91
+ 12,
92
+ 12,
93
+ 11,
94
+ 11,
95
+ 6,
96
+ 7,
97
+ 8,
98
+ 9,
99
+ 13,
100
+ 13,
101
+ 12,
102
+ 10,
103
+ 10,
104
+ 11,
105
+ 12,
106
+ 13,
107
+ 14,
108
+ 14,
109
+ 13,
110
+ 9,
111
+ 10,
112
+ 11,
113
+ 12,
114
+ 13,
115
+ 14,
116
+ 15,
117
+ 14,
118
+ 8,
119
+ 9,
120
+ 10,
121
+ 11,
122
+ 12,
123
+ 13,
124
+ 14,
125
+ 15
126
+ ]), l = (/* @__PURE__ */ new Uint8Array(64)).map((e, t) => Math.abs((t >> 3) - (t & 7))), u = new Uint8Array([
127
+ 0,
128
+ 1,
129
+ 2,
130
+ 3,
131
+ 4,
132
+ 5,
133
+ 3,
134
+ 4,
135
+ 4,
136
+ 5,
137
+ 5,
138
+ 5,
139
+ 5,
140
+ 5,
141
+ 5,
142
+ 5,
143
+ 1,
144
+ 0,
145
+ 1,
146
+ 3,
147
+ 4,
148
+ 5,
149
+ 3,
150
+ 4,
151
+ 4,
152
+ 5,
153
+ 5,
154
+ 5,
155
+ 5,
156
+ 5,
157
+ 5,
158
+ 5,
159
+ 2,
160
+ 1,
161
+ 2,
162
+ 4,
163
+ 5,
164
+ 3,
165
+ 4,
166
+ 4,
167
+ 5,
168
+ 5,
169
+ 5,
170
+ 5,
171
+ 5,
172
+ 5,
173
+ 5,
174
+ 5,
175
+ 3,
176
+ 3,
177
+ 4,
178
+ 5,
179
+ 4,
180
+ 5,
181
+ 4,
182
+ 4,
183
+ 5,
184
+ 5,
185
+ 5,
186
+ 5,
187
+ 5,
188
+ 5,
189
+ 5,
190
+ 5,
191
+ 4,
192
+ 3,
193
+ 4,
194
+ 4,
195
+ 5,
196
+ 5,
197
+ 4,
198
+ 4,
199
+ 5,
200
+ 5,
201
+ 5,
202
+ 5,
203
+ 5,
204
+ 5,
205
+ 5,
206
+ 5,
207
+ 5,
208
+ 3,
209
+ 4,
210
+ 4,
211
+ 4,
212
+ 5,
213
+ 4,
214
+ 4,
215
+ 5,
216
+ 5,
217
+ 5,
218
+ 5,
219
+ 5,
220
+ 5,
221
+ 5,
222
+ 5,
223
+ 3,
224
+ 3,
225
+ 4,
226
+ 4,
227
+ 4,
228
+ 4,
229
+ 5,
230
+ 4,
231
+ 5,
232
+ 5,
233
+ 5,
234
+ 5,
235
+ 5,
236
+ 5,
237
+ 5,
238
+ 5,
239
+ 4,
240
+ 3,
241
+ 4,
242
+ 4,
243
+ 4,
244
+ 4,
245
+ 4,
246
+ 5,
247
+ 5,
248
+ 5,
249
+ 5,
250
+ 5,
251
+ 5,
252
+ 5,
253
+ 5,
254
+ 5,
255
+ 4,
256
+ 3,
257
+ 4,
258
+ 4,
259
+ 4,
260
+ 4,
261
+ 4,
262
+ 4,
263
+ 5,
264
+ 5,
265
+ 5,
266
+ 5,
267
+ 5,
268
+ 5,
269
+ 5,
270
+ 5,
271
+ 5,
272
+ 3,
273
+ 4,
274
+ 4,
275
+ 4,
276
+ 4,
277
+ 4,
278
+ 4,
279
+ 4,
280
+ 5,
281
+ 5,
282
+ 5,
283
+ 5,
284
+ 5,
285
+ 5,
286
+ 5,
287
+ 5,
288
+ 3,
289
+ 4,
290
+ 4,
291
+ 4,
292
+ 4,
293
+ 4,
294
+ 4,
295
+ 4,
296
+ 4,
297
+ 5,
298
+ 5,
299
+ 5,
300
+ 5,
301
+ 5,
302
+ 5,
303
+ 5,
304
+ 3,
305
+ 4,
306
+ 4,
307
+ 4,
308
+ 4,
309
+ 4,
310
+ 4,
311
+ 4,
312
+ 4,
313
+ 4,
314
+ 5,
315
+ 5,
316
+ 5,
317
+ 5,
318
+ 5,
319
+ 5,
320
+ 3,
321
+ 4,
322
+ 4,
323
+ 4,
324
+ 4,
325
+ 4,
326
+ 4,
327
+ 4,
328
+ 4,
329
+ 4,
330
+ 4,
331
+ 5,
332
+ 5,
333
+ 5,
334
+ 5,
335
+ 5,
336
+ 3,
337
+ 4,
338
+ 4,
339
+ 4,
340
+ 4,
341
+ 4,
342
+ 4,
343
+ 4,
344
+ 4,
345
+ 4,
346
+ 4,
347
+ 4,
348
+ 5,
349
+ 5,
350
+ 5,
351
+ 5,
352
+ 3,
353
+ 4,
354
+ 4,
355
+ 4,
356
+ 4,
357
+ 4,
358
+ 4,
359
+ 4,
360
+ 4,
361
+ 4,
362
+ 4,
363
+ 4,
364
+ 4,
365
+ 5,
366
+ 5,
367
+ 5,
368
+ 3,
369
+ 4,
370
+ 4,
371
+ 4,
372
+ 4,
373
+ 4,
374
+ 4,
375
+ 4,
376
+ 4,
377
+ 4,
378
+ 4,
379
+ 4,
380
+ 4,
381
+ 4,
382
+ 5
383
+ ]), d = (/* @__PURE__ */ new Uint8Array(256)).map((e, t) => Math.min(Math.abs((t >> 4) - (t & 15)), 7));
384
+ //#endregion
385
+ export { u as a, a as c, s as d, c as i, o as l, l as n, e as o, d as r, n as s, t, i as u };
@@ -0,0 +1,47 @@
1
+ /** A coder renormalises when its interval's length falls below this. */
2
+ export declare const MIN_LENGTH = 16777216;
3
+ /** Probabilities take 13 bits for a bit model and 15 for a symbol model. */
4
+ export declare const BIT_SHIFT = 13, SYMBOL_SHIFT = 15;
5
+ /** An adaptive binary model. */
6
+ export declare class BitModel {
7
+ prob: number;
8
+ zeros: number;
9
+ total: number;
10
+ cycle: number;
11
+ until: number;
12
+ constructor();
13
+ reset(): void;
14
+ update(): void;
15
+ }
16
+ /** An adaptive model of `symbols` symbols, with a lookup table to start the search when there are more than 16. */
17
+ export declare class SymbolModel {
18
+ readonly symbols: number;
19
+ readonly last: number;
20
+ readonly dist: Uint32Array;
21
+ readonly counts: Uint32Array;
22
+ readonly table: Uint32Array | undefined;
23
+ readonly tableSize: number;
24
+ readonly tableShift: number;
25
+ total: number;
26
+ cycle: number;
27
+ until: number;
28
+ /** `search` builds the table a decoder starts its symbol search from. */
29
+ constructor(symbols: number, search?: boolean);
30
+ reset(): void;
31
+ update(): void;
32
+ }
33
+ export declare class Median5 {
34
+ private readonly v;
35
+ private high;
36
+ reset(): void;
37
+ get(): number;
38
+ add(x: number): void;
39
+ }
40
+ export declare const median5s: (n: number) => Median5[];
41
+ export declare const clampByte: (n: number) => number;
42
+ export declare const lazy: (models: (SymbolModel | undefined)[], i: number, symbols: number) => SymbolModel;
43
+ export declare const resetAll: (models: readonly (SymbolModel | undefined)[]) => void;
44
+ export declare const MAP10: Uint8Array<ArrayBuffer>;
45
+ export declare const LEVEL10: Uint8Array<ArrayBuffer>;
46
+ export declare const MAP14: Uint8Array<ArrayBuffer>;
47
+ export declare const LEVEL14: Uint8Array<ArrayBuffer>;
@@ -0,0 +1,46 @@
1
+ import { type LASWriteInput } from './las.js';
2
+ /** Options of {@link compressLAZ} and {@link writeLAZ}. */
3
+ export interface LazWriteOptions {
4
+ /** Points per chunk, 1 to 4,294,967,294. Default 50,000: a reader seeks to a chunk, and smaller chunks compress less. */
5
+ chunkSize?: number;
6
+ /** The point count of each chunk in turn, for variable chunks (as an octree's nodes have); they add up to every point. */
7
+ chunks?: readonly number[];
8
+ }
9
+ /**
10
+ * Compresses a LAS file to LAZ, losslessly: every point record, extra bytes included, decompresses byte for byte, and
11
+ * the header, variable length records and extended records are kept. The compressed points are the bytes LASzip writes
12
+ * for the same records and chunks.
13
+ *
14
+ * @param input An uncompressed LAS file, versions 1.0 to 1.5, point formats 0 to 10.
15
+ * @param options Points per chunk, or each chunk's count.
16
+ * @returns The LAZ file.
17
+ * @throws TypeError for bytes that are not an uncompressed LAS file or whose points or records are cut off.
18
+ * @throws RangeError for a bad chunk size or chunk counts.
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * import { compressLAZ } from '@margoengine/points/laz-write';
23
+ *
24
+ * const las = new Uint8Array(await (await fetch('/scans/site.las')).arrayBuffer());
25
+ * const laz = compressLAZ(las);
26
+ * console.log(laz.length / las.length);
27
+ * ```
28
+ */
29
+ export declare function compressLAZ(input: ArrayBuffer | Uint8Array, options?: LazWriteOptions): Uint8Array;
30
+ /**
31
+ * Writes points as LAZ: {@link writeLAS}'s file, compressed by {@link compressLAZ}.
32
+ *
33
+ * @param input World positions and any attributes of the point format, as `writeLAS` takes them.
34
+ * @param options Points per chunk, or each chunk's count.
35
+ * @returns The LAZ file.
36
+ * @throws RangeError for input `writeLAS` refuses and for bad chunk options.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * import { writeLAZ } from '@margoengine/points/laz-write';
41
+ *
42
+ * const laz = writeLAZ({ positions: [0, 0, 0, 1, 2, 3], wkt: 'GEOGCS["WGS 84"]' });
43
+ * console.log(laz.length);
44
+ * ```
45
+ */
46
+ export declare function writeLAZ(input: LASWriteInput, options?: LazWriteOptions): Uint8Array;
@@ -0,0 +1,75 @@
1
+ import { readLASHeader as e, writeLAS as t } from "./las.js";
2
+ import { i as n, n as r, r as i, t as a } from "./laz-encode-CHXgHra_.js";
3
+ //#region src/laz-write.ts
4
+ function o(e, t) {
5
+ let { chunks: n, chunkSize: r = 5e4 } = t;
6
+ if (n) {
7
+ if (t.chunkSize !== void 0) throw RangeError("Pass chunkSize or chunks, not both");
8
+ let r = 0;
9
+ for (let e of n) {
10
+ if (!Number.isInteger(e) || e < 1) throw RangeError("Every chunk needs a whole number of points, 1 or more");
11
+ r += e;
12
+ }
13
+ if (r !== e) throw RangeError(`chunks hold ${r} points; the file has ${e}`);
14
+ return [...n];
15
+ }
16
+ if (!Number.isInteger(r) || r < 1 || r >= 4294967295) throw RangeError("chunkSize must be a whole number from 1 to 4294967294");
17
+ let i = [];
18
+ for (let t = e; t > 0; t -= r) i.push(Math.min(r, t));
19
+ return i;
20
+ }
21
+ function s(t, s = {}) {
22
+ let c = t instanceof Uint8Array ? t : new Uint8Array(t), { header: l } = e(c);
23
+ if (c[104] & 192) throw TypeError("The file is already compressed; compressLAZ takes an uncompressed LAS file");
24
+ let u = new DataView(c.buffer, c.byteOffset, c.byteLength), { pointDataOffset: d, pointRecordLength: f, pointFormat: p, pointCount: m } = l, h = d + m * f, g = u.getUint16(94, !0), _ = l.versionMinor;
25
+ if (!Number.isSafeInteger(h) || h > c.length) throw TypeError(`The LAS file ends before its ${m} points of ${f} bytes; it is cut off`);
26
+ let v = [], y = g, b = 0;
27
+ for (let e = 0, t = u.getUint32(100, !0); e < t; e++) {
28
+ let e = y + 54 <= d ? 54 + u.getUint16(y + 20, !0) : Infinity;
29
+ if (y + e > d) throw TypeError("A variable length record runs into the points; the LAS file is damaged, so pass an intact one");
30
+ u.getUint16(y + 18, !0) !== 22204 && (v.push(c.subarray(y, y + e)), b++), y += e;
31
+ }
32
+ let x = i(p, f), S = o(m, s), C = n(x, s.chunks ? 4294967295 : s.chunkSize ?? 5e4), w = c.slice(0, g), T = c.subarray(y, d), E = [
33
+ w,
34
+ ...v,
35
+ C,
36
+ T
37
+ ], D = E.reduce((e, t) => e + t.length, 0), O = c.subarray(d, h), k = new DataView(O.buffer, O.byteOffset, O.byteLength), A = [], j = [], M = 0, N = 0;
38
+ for (let e of S) {
39
+ let t = 0;
40
+ for (let n of a(O, k, M * f, e, f, x)) {
41
+ let e = n.byteLength === n.buffer.byteLength ? n : n.slice();
42
+ A.push(e), t += e.length;
43
+ }
44
+ j.push(t), N += t, M += e;
45
+ }
46
+ let P = r(j, s.chunks ? S : void 0), F = D + 8 + N, I = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(8));
47
+ I.setBigInt64(0, BigInt(F), !0);
48
+ let L = F + P.reduce((e, t) => e + t.length, 0), R = new DataView(w.buffer), z = [];
49
+ if (_ >= 3 && g >= 235) {
50
+ let e = Number(u.getBigUint64(227, !0));
51
+ e && z.push([227, e]);
52
+ }
53
+ _ >= 4 && g >= 375 && u.getUint32(243, !0) && z.push([235, Number(u.getBigUint64(235, !0))]);
54
+ let B = c.length;
55
+ for (let [, e] of z) {
56
+ if (e < h || e > c.length) throw TypeError("The header places extended records outside the bytes after the points; the file is corrupt");
57
+ B = Math.min(B, e);
58
+ }
59
+ for (let [e, t] of z) R.setBigUint64(e, BigInt(L + t - B), !0);
60
+ R.setUint32(96, D, !0), R.setUint32(100, b + 1, !0), R.setUint8(104, p | 128);
61
+ let V = [
62
+ ...E,
63
+ new Uint8Array(I.buffer),
64
+ ...A,
65
+ ...P,
66
+ c.subarray(B)
67
+ ], H = new Uint8Array(V.reduce((e, t) => e + t.length, 0)), U = 0;
68
+ for (let e of V) H.set(e, U), U += e.length;
69
+ return H;
70
+ }
71
+ function c(e, n = {}) {
72
+ return s(t(e), n);
73
+ }
74
+ //#endregion
75
+ export { s as compressLAZ, c as writeLAZ };
package/dist/laz.d.ts ADDED
@@ -0,0 +1,50 @@
1
+ import type { LASHeader, LASRecord, LazDecoder } from './las.js';
2
+ /** One item of a LASzip record: a part of each point record and how it is compressed. */
3
+ export interface LazItem {
4
+ /** LASzip item type id: 0 BYTE, 6 POINT10, 7 GPSTIME11, 8 RGB12, 9 WAVEPACKET13, 10 POINT14, 11 RGB14, 12 RGBNIR14, 13 WAVEPACKET14, 14 BYTE14. */
5
+ readonly type: number;
6
+ /** The item's name, for messages (`POINT10`, `RGB14`, ...). */
7
+ readonly name: string;
8
+ /** Bytes of the point record the item covers. */
9
+ readonly size: number;
10
+ /** Compression version of the item. */
11
+ readonly version: number;
12
+ }
13
+ /** The LASzip record (user id `laszip encoded`, record id 22204) of a LAZ file. */
14
+ export interface LazInfo {
15
+ /** 0 none (plain records), 1 pointwise, 2 pointwise chunked (formats 0 to 5), 3 layered chunked (formats 6 to 10). */
16
+ readonly compressor: number;
17
+ /** 0: arithmetic coding (the only coder defined). */
18
+ readonly coder: number;
19
+ /** Version of the software that wrote the file, as `major.minor.revision`. */
20
+ readonly version: string;
21
+ readonly options: number;
22
+ /** Points per chunk, or `'variable'` when the chunk table stores each chunk's count. */
23
+ readonly chunkSize: number | 'variable';
24
+ readonly items: readonly LazItem[];
25
+ }
26
+ /** Options of `lazChunks`. */
27
+ export interface LazChunkOptions {
28
+ /** Stops decoding between chunks. */
29
+ readonly signal?: AbortSignal;
30
+ }
31
+ /** Reads the LASzip record. Throws a TypeError when the file has none or it is malformed. */
32
+ export declare function lazInfo(records: readonly LASRecord[]): LazInfo;
33
+ /**
34
+ * Decodes a LAZ file one chunk at a time: yields the uncompressed point records of each chunk, in file order. Stops
35
+ * with `signal` between chunks (and gives the event loop a turn about every 30 ms). Throws a MargoError with code
36
+ * `unsupported` for items this decoder does not read, a RangeError or TypeError for corrupt or truncated data.
37
+ */
38
+ export declare function lazChunks(file: Uint8Array, header: LASHeader, records: readonly LASRecord[], options?: LazChunkOptions): AsyncGenerator<Uint8Array, void, undefined>;
39
+ /**
40
+ * Decodes one chunk held by itself (a COPC node's bytes): `count` uncompressed point records, for a file with `header`
41
+ * and `records`. Throws as `lazChunks`.
42
+ */
43
+ export declare function decodeLazChunk(chunk: Uint8Array, count: number, header: LASHeader, records: readonly LASRecord[]): Uint8Array;
44
+ /**
45
+ * A LAZ decoder for `parseLAS` / `loadLAS`, which load this one by themselves when `options.laz` is not given. Point
46
+ * formats 0 to 5 (POINT10, GPSTIME11, RGB12 and extra bytes, version 2, WAVEPACKET13, version 1) and 6 to 10 (POINT14,
47
+ * RGB14, RGBNIR14, WAVEPACKET14 and extra bytes, layered version 3), pointwise, or in fixed or variable chunks. Decodes
48
+ * one chunk at a time into the point arrays.
49
+ */
50
+ export declare function createLazDecoder(): LazDecoder;