@manycore/aholo-splat-transform 1.2.7 → 1.2.9

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 (98) hide show
  1. package/CHANGELOG.md +120 -106
  2. package/COPYRIGHT.md +17 -0
  3. package/README.md +39 -39
  4. package/THIRD_PARTY_LICENSES.txt +1373 -0
  5. package/bin/cli.js +125 -118
  6. package/dist/SplatData.d.ts +67 -67
  7. package/dist/SplatData.js +167 -156
  8. package/dist/constant.d.ts +3 -3
  9. package/dist/constant.js +13 -13
  10. package/dist/file/IFile.d.ts +5 -5
  11. package/dist/file/IFile.js +1 -1
  12. package/dist/file/esz.d.ts +11 -0
  13. package/dist/file/esz.js +337 -0
  14. package/dist/file/index.d.ts +8 -7
  15. package/dist/file/index.js +7 -6
  16. package/dist/file/ksplat.d.ts +12 -12
  17. package/dist/file/ksplat.js +293 -232
  18. package/dist/file/lcc.d.ts +11 -11
  19. package/dist/file/lcc.js +161 -157
  20. package/dist/file/ply.d.ts +13 -13
  21. package/dist/file/ply.js +439 -388
  22. package/dist/file/sog.d.ts +80 -80
  23. package/dist/file/sog.js +525 -504
  24. package/dist/file/splat.d.ts +6 -6
  25. package/dist/file/splat.js +119 -99
  26. package/dist/file/spz.d.ts +11 -8
  27. package/dist/file/spz.js +597 -400
  28. package/dist/file/voxel.d.ts +43 -37
  29. package/dist/file/voxel.js +411 -280
  30. package/dist/index.d.ts +33 -33
  31. package/dist/index.js +54 -54
  32. package/dist/native/index.d.ts +54 -54
  33. package/dist/native/index.js +122 -128
  34. package/dist/native/utils.d.ts +1 -0
  35. package/dist/native/utils.js +54 -0
  36. package/dist/tasks/AutoChunkLodTask.d.ts +13 -13
  37. package/dist/tasks/AutoChunkLodTask.js +117 -117
  38. package/dist/tasks/AutoLodTask.d.ts +10 -10
  39. package/dist/tasks/AutoLodTask.js +20 -20
  40. package/dist/tasks/BaseTask.d.ts +15 -15
  41. package/dist/tasks/BaseTask.js +5 -5
  42. package/dist/tasks/FlexLodTask.d.ts +12 -12
  43. package/dist/tasks/FlexLodTask.js +54 -44
  44. package/dist/tasks/ModifyTask.d.ts +9 -9
  45. package/dist/tasks/ModifyTask.js +166 -156
  46. package/dist/tasks/ReadTask.d.ts +9 -9
  47. package/dist/tasks/ReadTask.js +29 -29
  48. package/dist/tasks/SkeletonLodTask.d.ts +10 -10
  49. package/dist/tasks/SkeletonLodTask.js +176 -156
  50. package/dist/tasks/VoxelTask.d.ts +35 -30
  51. package/dist/tasks/VoxelTask.js +40 -37
  52. package/dist/tasks/WriteTask.d.ts +12 -11
  53. package/dist/tasks/WriteTask.js +70 -70
  54. package/dist/utils/BufferReader.d.ts +12 -12
  55. package/dist/utils/BufferReader.js +45 -47
  56. package/dist/utils/Logger.d.ts +11 -11
  57. package/dist/utils/Logger.js +40 -38
  58. package/dist/utils/StreamChunkDecoder.d.ts +16 -16
  59. package/dist/utils/StreamChunkDecoder.js +31 -36
  60. package/dist/utils/index.d.ts +27 -27
  61. package/dist/utils/index.js +101 -101
  62. package/dist/utils/k-means.d.ts +4 -4
  63. package/dist/utils/k-means.js +340 -350
  64. package/dist/utils/math.d.ts +46 -46
  65. package/dist/utils/math.js +350 -351
  66. package/dist/utils/quantize-1d.d.ts +4 -4
  67. package/dist/utils/quantize-1d.js +164 -164
  68. package/dist/utils/sh-rotate.d.ts +2 -2
  69. package/dist/utils/sh-rotate.js +236 -175
  70. package/dist/utils/splat.d.ts +21 -20
  71. package/dist/utils/splat.js +397 -378
  72. package/dist/utils/voxel/binary.d.ts +8 -0
  73. package/dist/utils/voxel/binary.js +176 -0
  74. package/dist/utils/voxel/common.d.ts +178 -162
  75. package/dist/utils/voxel/common.js +1752 -1700
  76. package/dist/utils/voxel/coplanar-merge.d.ts +63 -63
  77. package/dist/utils/voxel/coplanar-merge.js +818 -819
  78. package/dist/utils/voxel/filter-cluster.d.ts +20 -0
  79. package/dist/utils/voxel/filter-cluster.js +628 -0
  80. package/dist/utils/voxel/gpu-dilation.d.ts +2 -2
  81. package/dist/utils/voxel/gpu-dilation.js +677 -665
  82. package/dist/utils/voxel/marching-cubes.d.ts +42 -42
  83. package/dist/utils/voxel/marching-cubes.js +1645 -1657
  84. package/dist/utils/voxel/mesh.d.ts +3 -3
  85. package/dist/utils/voxel/mesh.js +130 -130
  86. package/dist/utils/voxel/nav.d.ts +29 -29
  87. package/dist/utils/voxel/nav.js +1068 -1043
  88. package/dist/utils/voxel/postprocess.d.ts +23 -23
  89. package/dist/utils/voxel/postprocess.js +408 -375
  90. package/dist/utils/voxel/voxel-faces.d.ts +18 -18
  91. package/dist/utils/voxel/voxel-faces.js +662 -663
  92. package/dist/utils/voxel/voxelize.d.ts +34 -33
  93. package/dist/utils/voxel/voxelize.js +1208 -1193
  94. package/dist/utils/webgpu.d.ts +8 -8
  95. package/dist/utils/webgpu.js +122 -122
  96. package/package.json +37 -30
  97. package/dist/native/cpp/bin/linux/binding.node +0 -0
  98. package/dist/native/cpp/bin/windows/binding.node +0 -0
@@ -1,12 +1,12 @@
1
- export declare class BufferReader {
2
- head: number;
3
- tail: number;
4
- buffer: Uint8Array;
5
- view: DataView;
6
- get remaining(): number;
7
- constructor(buffer?: Uint8Array);
8
- private grow;
9
- private compact;
10
- write(chunk: Uint8Array): void;
11
- read(counts: number): Uint8Array;
12
- }
1
+ export declare class BufferReader {
2
+ head: number;
3
+ tail: number;
4
+ buffer: Uint8Array;
5
+ view: DataView;
6
+ get remaining(): number;
7
+ constructor(buffer?: Uint8Array);
8
+ private grow;
9
+ private compact;
10
+ write(chunk: Uint8Array): void;
11
+ read(counts: number): Uint8Array;
12
+ }
@@ -1,47 +1,45 @@
1
- export class BufferReader {
2
- head = 0;
3
- tail = 0;
4
- buffer;
5
- view;
6
- get remaining() {
7
- return this.tail - this.head;
8
- }
9
- constructor(buffer = new Uint8Array()) {
10
- this.buffer = buffer;
11
- this.view = new DataView(this.buffer.buffer);
12
- }
13
- grow(required) {
14
- const newCap = Math.max(required, this.buffer.length * 2);
15
- const next = new Uint8Array(newCap);
16
- next.set(this.buffer.subarray(this.head, this.tail), 0);
17
- this.tail -= this.head;
18
- this.head = 0;
19
- this.buffer = next;
20
- this.view = new DataView(next.buffer);
21
- }
22
- compact() {
23
- if (this.head === 0) {
24
- return;
25
- }
26
- this.buffer.copyWithin(0, this.head, this.tail);
27
- this.tail -= this.head;
28
- this.head = 0;
29
- }
30
- write(chunk) {
31
- const remaining = this.tail - this.head;
32
- const required = remaining + chunk.length;
33
- if (this.buffer.length < required) {
34
- this.grow(required);
35
- }
36
- else if (this.head > 0 && this.buffer.length - this.tail < chunk.length) {
37
- this.compact();
38
- }
39
- this.buffer.set(chunk, this.tail);
40
- this.tail += chunk.length;
41
- }
42
- read(counts) {
43
- const head = this.head;
44
- const tail = this.head = head + counts;
45
- return this.buffer.subarray(head, tail);
46
- }
47
- }
1
+ export class BufferReader {
2
+ get remaining() {
3
+ return this.tail - this.head;
4
+ }
5
+ constructor(buffer = new Uint8Array()) {
6
+ this.head = 0;
7
+ this.tail = 0;
8
+ this.buffer = buffer;
9
+ this.view = new DataView(this.buffer.buffer);
10
+ }
11
+ grow(required) {
12
+ const newCap = Math.max(required, this.buffer.length * 2);
13
+ const next = new Uint8Array(newCap);
14
+ next.set(this.buffer.subarray(this.head, this.tail), 0);
15
+ this.tail -= this.head;
16
+ this.head = 0;
17
+ this.buffer = next;
18
+ this.view = new DataView(next.buffer);
19
+ }
20
+ compact() {
21
+ if (this.head === 0) {
22
+ return;
23
+ }
24
+ this.buffer.copyWithin(0, this.head, this.tail);
25
+ this.tail -= this.head;
26
+ this.head = 0;
27
+ }
28
+ write(chunk) {
29
+ const remaining = this.tail - this.head;
30
+ const required = remaining + chunk.length;
31
+ if (this.buffer.length < required) {
32
+ this.grow(required);
33
+ }
34
+ else if (this.head > 0 && this.buffer.length - this.tail < chunk.length) {
35
+ this.compact();
36
+ }
37
+ this.buffer.set(chunk, this.tail);
38
+ this.tail += chunk.length;
39
+ }
40
+ read(counts) {
41
+ const head = this.head;
42
+ const tail = (this.head = head + counts);
43
+ return this.buffer.subarray(head, tail);
44
+ }
45
+ }
@@ -1,11 +1,11 @@
1
- export declare class Logger {
2
- prefix: string;
3
- silent: boolean;
4
- private format;
5
- info(msg: string, force?: boolean): void;
6
- warn(msg: string, force?: boolean): void;
7
- error(msg: string, force?: boolean): void;
8
- time(label: string): void;
9
- timeEnd(label: string): void;
10
- }
11
- export declare const logger: Logger;
1
+ export declare class Logger {
2
+ prefix: string;
3
+ silent: boolean;
4
+ private format;
5
+ info(msg: string, force?: boolean): void;
6
+ warn(msg: string, force?: boolean): void;
7
+ error(msg: string, force?: boolean): void;
8
+ time(label: string): void;
9
+ timeEnd(label: string): void;
10
+ }
11
+ export declare const logger: Logger;
@@ -1,38 +1,40 @@
1
- export class Logger {
2
- prefix = '';
3
- silent = false;
4
- format(msg) {
5
- return this.prefix ? `${this.prefix} ${msg}` : msg;
6
- }
7
- info(msg, force = false) {
8
- if (this.silent && !force) {
9
- return;
10
- }
11
- console.log(this.format(msg));
12
- }
13
- warn(msg, force = false) {
14
- if (this.silent && !force) {
15
- return;
16
- }
17
- console.warn(this.format(msg));
18
- }
19
- error(msg, force = false) {
20
- if (this.silent && !force) {
21
- return;
22
- }
23
- console.error(this.format(msg));
24
- }
25
- time(label) {
26
- if (this.silent) {
27
- return;
28
- }
29
- console.time(this.format(label));
30
- }
31
- timeEnd(label) {
32
- if (this.silent) {
33
- return;
34
- }
35
- console.timeEnd(this.format(label));
36
- }
37
- }
38
- export const logger = new Logger();
1
+ export class Logger {
2
+ constructor() {
3
+ this.prefix = '';
4
+ this.silent = false;
5
+ }
6
+ format(msg) {
7
+ return this.prefix ? `${this.prefix} ${msg}` : msg;
8
+ }
9
+ info(msg, force = false) {
10
+ if (this.silent && !force) {
11
+ return;
12
+ }
13
+ console.log(this.format(msg));
14
+ }
15
+ warn(msg, force = false) {
16
+ if (this.silent && !force) {
17
+ return;
18
+ }
19
+ console.warn(this.format(msg));
20
+ }
21
+ error(msg, force = false) {
22
+ if (this.silent && !force) {
23
+ return;
24
+ }
25
+ console.error(this.format(msg));
26
+ }
27
+ time(label) {
28
+ if (this.silent) {
29
+ return;
30
+ }
31
+ console.time(this.format(label));
32
+ }
33
+ timeEnd(label) {
34
+ if (this.silent) {
35
+ return;
36
+ }
37
+ console.timeEnd(this.format(label));
38
+ }
39
+ }
40
+ export const logger = new Logger();
@@ -1,16 +1,16 @@
1
- import { BufferReader } from './BufferReader.js';
2
- export interface ChunkDecoder {
3
- init(): [number, number];
4
- decode(offset: number, counts: number, buffer: Uint8Array): void;
5
- }
6
- export declare class StreamChunkDecoder {
7
- private reader;
8
- private decoders;
9
- private decodedTotals;
10
- private currentIndex;
11
- private currentTotals;
12
- private currentItemSize;
13
- constructor(reader: BufferReader);
14
- setDecoders(decoders: ChunkDecoder[]): void;
15
- flush(): void;
16
- }
1
+ import type { BufferReader } from './BufferReader.js';
2
+ export interface ChunkDecoder {
3
+ init(): [number, number];
4
+ decode(offset: number, counts: number, buffer: Uint8Array): void;
5
+ }
6
+ export declare class StreamChunkDecoder {
7
+ private reader;
8
+ private decoders;
9
+ private decodedTotals;
10
+ private currentIndex;
11
+ private currentTotals;
12
+ private currentItemSize;
13
+ constructor(reader: BufferReader);
14
+ setDecoders(decoders: ChunkDecoder[]): void;
15
+ flush(): void;
16
+ }
@@ -1,36 +1,31 @@
1
- export class StreamChunkDecoder {
2
- reader;
3
- decoders;
4
- decodedTotals;
5
- currentIndex = 0;
6
- currentTotals;
7
- currentItemSize;
8
- constructor(reader) {
9
- this.reader = reader;
10
- }
11
- setDecoders(decoders) {
12
- this.decoders = decoders;
13
- this.decodedTotals = new Uint32Array(decoders.length);
14
- const [totals, itemSize] = decoders[this.currentIndex].init();
15
- this.currentTotals = totals;
16
- this.currentItemSize = itemSize;
17
- }
18
- flush() {
19
- const { reader, decoders, decodedTotals, currentIndex, currentTotals, currentItemSize } = this;
20
- const stage = decoders[currentIndex];
21
- const decoded = decodedTotals[currentIndex];
22
- const counts = Math.min(currentTotals - decoded, (reader.remaining / currentItemSize) | 0);
23
- const buf = reader.read(counts * currentItemSize);
24
- stage.decode(decoded, counts, buf);
25
- decodedTotals[currentIndex] += counts;
26
- if (decodedTotals[currentIndex] === currentTotals) {
27
- this.currentIndex++;
28
- if (this.currentIndex < decoders.length) {
29
- const [totals, itemSize] = decoders[this.currentIndex].init();
30
- this.currentTotals = totals;
31
- this.currentItemSize = itemSize;
32
- this.flush();
33
- }
34
- }
35
- }
36
- }
1
+ export class StreamChunkDecoder {
2
+ constructor(reader) {
3
+ this.currentIndex = 0;
4
+ this.reader = reader;
5
+ }
6
+ setDecoders(decoders) {
7
+ this.decoders = decoders;
8
+ this.decodedTotals = new Uint32Array(decoders.length);
9
+ const [totals, itemSize] = decoders[this.currentIndex].init();
10
+ this.currentTotals = totals;
11
+ this.currentItemSize = itemSize;
12
+ }
13
+ flush() {
14
+ const { reader, decoders, decodedTotals, currentIndex, currentTotals, currentItemSize } = this;
15
+ const stage = decoders[currentIndex];
16
+ const decoded = decodedTotals[currentIndex];
17
+ const counts = Math.min(currentTotals - decoded, (reader.remaining / currentItemSize) | 0);
18
+ const buf = reader.read(counts * currentItemSize);
19
+ stage.decode(decoded, counts, buf);
20
+ decodedTotals[currentIndex] += counts;
21
+ if (decodedTotals[currentIndex] === currentTotals) {
22
+ this.currentIndex++;
23
+ if (this.currentIndex < decoders.length) {
24
+ const [totals, itemSize] = decoders[this.currentIndex].init();
25
+ this.currentTotals = totals;
26
+ this.currentItemSize = itemSize;
27
+ this.flush();
28
+ }
29
+ }
30
+ }
31
+ }
@@ -1,27 +1,27 @@
1
- interface Deferred<T = void> {
2
- resolve: (value: T | PromiseLike<T>) => void;
3
- reject: (reason: any) => void;
4
- promise: Promise<T>;
5
- }
6
- export declare function deferred<T = void>(): Deferred<T>;
7
- export declare function sleep(timeout: number): Promise<void>;
8
- export declare function clamp(v: number, min: number, max: number): number;
9
- export declare function isUrl(str: string): boolean;
10
- export declare function extractFromRootDir(entries: Record<string, Uint8Array>): Record<string, Uint8Array>;
11
- export declare function fromHalf(h: number): number;
12
- export * from './Logger.js';
13
- export * from './BufferReader.js';
14
- export * from './StreamChunkDecoder.js';
15
- export * from './math.js';
16
- export * from './sh-rotate.js';
17
- export * from './splat.js';
18
- export * from './k-means.js';
19
- export * from './quantize-1d.js';
20
- export * from './webgpu.js';
21
- export * from './voxel/common.js';
22
- export * from './voxel/voxelize.js';
23
- export * from './voxel/postprocess.js';
24
- export * from './voxel/nav.js';
25
- export * from './voxel/mesh.js';
26
- export * from './voxel/voxel-faces.js';
27
- export * from './voxel/gpu-dilation.js';
1
+ interface Deferred<T = void> {
2
+ resolve: (value: T | PromiseLike<T>) => void;
3
+ reject: (reason: any) => void;
4
+ promise: Promise<T>;
5
+ }
6
+ export declare function deferred<T = void>(): Deferred<T>;
7
+ export declare function sleep(timeout: number): Promise<void>;
8
+ export declare function clamp(v: number, min: number, max: number): number;
9
+ export declare function isUrl(str: string): boolean;
10
+ export declare function extractFromRootDir(entries: Record<string, Uint8Array>): Record<string, Uint8Array>;
11
+ export declare function fromHalf(h: number): number;
12
+ export * from './Logger.js';
13
+ export * from './BufferReader.js';
14
+ export * from './StreamChunkDecoder.js';
15
+ export * from './math.js';
16
+ export * from './sh-rotate.js';
17
+ export * from './splat.js';
18
+ export * from './k-means.js';
19
+ export * from './quantize-1d.js';
20
+ export * from './webgpu.js';
21
+ export * from './voxel/common.js';
22
+ export * from './voxel/voxelize.js';
23
+ export * from './voxel/postprocess.js';
24
+ export * from './voxel/nav.js';
25
+ export * from './voxel/mesh.js';
26
+ export * from './voxel/voxel-faces.js';
27
+ export * from './voxel/gpu-dilation.js';
@@ -1,101 +1,101 @@
1
- export function deferred() {
2
- let resolve = () => { };
3
- let reject = () => { };
4
- const promise = new Promise(function (resolveInner, rejectInner) {
5
- resolve = resolveInner;
6
- reject = rejectInner;
7
- });
8
- return {
9
- promise,
10
- resolve,
11
- reject,
12
- };
13
- }
14
- export function sleep(timeout) {
15
- return new Promise(resolve => {
16
- setTimeout(resolve, timeout);
17
- });
18
- }
19
- export function clamp(v, min, max) {
20
- return Math.min(Math.max(v, min), max);
21
- }
22
- export function isUrl(str) {
23
- let url;
24
- try {
25
- url = new URL(str);
26
- }
27
- catch {
28
- return false;
29
- }
30
- return url.protocol === 'http:' || url.protocol === 'https:';
31
- }
32
- export function extractFromRootDir(entries) {
33
- let dir = '';
34
- for (const path in entries) {
35
- if (path.endsWith('/')) {
36
- dir = path;
37
- break;
38
- }
39
- }
40
- const result = {};
41
- for (const path in entries) {
42
- result[path.replace(dir, '')] = entries[path];
43
- }
44
- return result;
45
- }
46
- const f32buffer = new Float32Array(1);
47
- const u32buffer = new Uint32Array(f32buffer.buffer);
48
- export function fromHalf(h) {
49
- const sign = (h >> 15) & 0x1;
50
- const exp = (h >> 10) & 0x1f;
51
- const frac = h & 0x3ff;
52
- let f32bits;
53
- if (exp === 0) {
54
- if (frac === 0) {
55
- f32bits = sign << 31;
56
- }
57
- else {
58
- let mant = frac;
59
- let e = -14;
60
- while ((mant & 0x400) === 0) {
61
- mant <<= 1;
62
- e--;
63
- }
64
- mant &= 0x3ff;
65
- const newExp = e + 127;
66
- const newFrac = mant << 13;
67
- f32bits = (sign << 31) | (newExp << 23) | newFrac;
68
- }
69
- }
70
- else if (exp === 0x1f) {
71
- if (frac === 0) {
72
- f32bits = (sign << 31) | 0x7f800000;
73
- }
74
- else {
75
- f32bits = (sign << 31) | 0x7fc00000;
76
- }
77
- }
78
- else {
79
- const newExp = exp - 15 + 127;
80
- const newFrac = frac << 13;
81
- f32bits = (sign << 31) | (newExp << 23) | newFrac;
82
- }
83
- u32buffer[0] = f32bits;
84
- return f32buffer[0];
85
- }
86
- export * from './Logger.js';
87
- export * from './BufferReader.js';
88
- export * from './StreamChunkDecoder.js';
89
- export * from './math.js';
90
- export * from './sh-rotate.js';
91
- export * from './splat.js';
92
- export * from './k-means.js';
93
- export * from './quantize-1d.js';
94
- export * from './webgpu.js';
95
- export * from './voxel/common.js';
96
- export * from './voxel/voxelize.js';
97
- export * from './voxel/postprocess.js';
98
- export * from './voxel/nav.js';
99
- export * from './voxel/mesh.js';
100
- export * from './voxel/voxel-faces.js';
101
- export * from './voxel/gpu-dilation.js';
1
+ export function deferred() {
2
+ let resolve = () => { };
3
+ let reject = () => { };
4
+ const promise = new Promise(function (resolveInner, rejectInner) {
5
+ resolve = resolveInner;
6
+ reject = rejectInner;
7
+ });
8
+ return {
9
+ promise,
10
+ resolve,
11
+ reject,
12
+ };
13
+ }
14
+ export function sleep(timeout) {
15
+ return new Promise(resolve => {
16
+ setTimeout(resolve, timeout);
17
+ });
18
+ }
19
+ export function clamp(v, min, max) {
20
+ return Math.min(Math.max(v, min), max);
21
+ }
22
+ export function isUrl(str) {
23
+ let url;
24
+ try {
25
+ url = new URL(str);
26
+ }
27
+ catch {
28
+ return false;
29
+ }
30
+ return url.protocol === 'http:' || url.protocol === 'https:';
31
+ }
32
+ export function extractFromRootDir(entries) {
33
+ let dir = '';
34
+ for (const path in entries) {
35
+ if (path.endsWith('/')) {
36
+ dir = path;
37
+ break;
38
+ }
39
+ }
40
+ const result = {};
41
+ for (const path in entries) {
42
+ result[path.replace(dir, '')] = entries[path];
43
+ }
44
+ return result;
45
+ }
46
+ const f32buffer = new Float32Array(1);
47
+ const u32buffer = new Uint32Array(f32buffer.buffer);
48
+ export function fromHalf(h) {
49
+ const sign = (h >> 15) & 0x1;
50
+ const exp = (h >> 10) & 0x1f;
51
+ const frac = h & 0x3ff;
52
+ let f32bits;
53
+ if (exp === 0) {
54
+ if (frac === 0) {
55
+ f32bits = sign << 31;
56
+ }
57
+ else {
58
+ let mant = frac;
59
+ let e = -14;
60
+ while ((mant & 0x400) === 0) {
61
+ mant <<= 1;
62
+ e--;
63
+ }
64
+ mant &= 0x3ff;
65
+ const newExp = e + 127;
66
+ const newFrac = mant << 13;
67
+ f32bits = (sign << 31) | (newExp << 23) | newFrac;
68
+ }
69
+ }
70
+ else if (exp === 0x1f) {
71
+ if (frac === 0) {
72
+ f32bits = (sign << 31) | 0x7f800000;
73
+ }
74
+ else {
75
+ f32bits = (sign << 31) | 0x7fc00000;
76
+ }
77
+ }
78
+ else {
79
+ const newExp = exp - 15 + 127;
80
+ const newFrac = frac << 13;
81
+ f32bits = (sign << 31) | (newExp << 23) | newFrac;
82
+ }
83
+ u32buffer[0] = f32bits;
84
+ return f32buffer[0];
85
+ }
86
+ export * from './Logger.js';
87
+ export * from './BufferReader.js';
88
+ export * from './StreamChunkDecoder.js';
89
+ export * from './math.js';
90
+ export * from './sh-rotate.js';
91
+ export * from './splat.js';
92
+ export * from './k-means.js';
93
+ export * from './quantize-1d.js';
94
+ export * from './webgpu.js';
95
+ export * from './voxel/common.js';
96
+ export * from './voxel/voxelize.js';
97
+ export * from './voxel/postprocess.js';
98
+ export * from './voxel/nav.js';
99
+ export * from './voxel/mesh.js';
100
+ export * from './voxel/voxel-faces.js';
101
+ export * from './voxel/gpu-dilation.js';
@@ -1,4 +1,4 @@
1
- export declare function kmeans(points: Float32Array[], k: number, iterations: number, device: GPUDevice): Promise<{
2
- centroids: Float32Array<ArrayBufferLike>[];
3
- labels: Uint32Array<ArrayBuffer>;
4
- }>;
1
+ export declare function kmeans(points: Float32Array[], k: number, iterations: number, device: GPUDevice): Promise<{
2
+ centroids: Float32Array<ArrayBufferLike>[];
3
+ labels: Uint32Array<ArrayBuffer>;
4
+ }>;