@loaders.gl/splats 4.5.0-alpha.1

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 (121) hide show
  1. package/LICENSE +41 -0
  2. package/README.md +3 -0
  3. package/dist/bundled.d.ts +2 -0
  4. package/dist/bundled.d.ts.map +1 -0
  5. package/dist/bundled.js +5 -0
  6. package/dist/bundled.js.map +1 -0
  7. package/dist/dist.dev.js +33741 -0
  8. package/dist/dist.min.js +82 -0
  9. package/dist/index.cjs +1786 -0
  10. package/dist/index.cjs.map +7 -0
  11. package/dist/index.d.ts +10 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +10 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/ksplat-loader-types.d.ts +19 -0
  16. package/dist/ksplat-loader-types.d.ts.map +1 -0
  17. package/dist/ksplat-loader-types.js +20 -0
  18. package/dist/ksplat-loader-types.js.map +1 -0
  19. package/dist/ksplat-loader.d.ts +21 -0
  20. package/dist/ksplat-loader.d.ts.map +1 -0
  21. package/dist/ksplat-loader.js +12 -0
  22. package/dist/ksplat-loader.js.map +1 -0
  23. package/dist/lib/parse-ksplat.d.ts +7 -0
  24. package/dist/lib/parse-ksplat.d.ts.map +1 -0
  25. package/dist/lib/parse-ksplat.js +312 -0
  26. package/dist/lib/parse-ksplat.js.map +1 -0
  27. package/dist/lib/parse-rad-chunk.d.ts +19 -0
  28. package/dist/lib/parse-rad-chunk.d.ts.map +1 -0
  29. package/dist/lib/parse-rad-chunk.js +514 -0
  30. package/dist/lib/parse-rad-chunk.js.map +1 -0
  31. package/dist/lib/parse-rad.d.ts +136 -0
  32. package/dist/lib/parse-rad.d.ts.map +1 -0
  33. package/dist/lib/parse-rad.js +110 -0
  34. package/dist/lib/parse-rad.js.map +1 -0
  35. package/dist/lib/parse-splat.d.ts +7 -0
  36. package/dist/lib/parse-splat.d.ts.map +1 -0
  37. package/dist/lib/parse-splat.js +58 -0
  38. package/dist/lib/parse-splat.js.map +1 -0
  39. package/dist/lib/parse-spz.d.ts +7 -0
  40. package/dist/lib/parse-spz.d.ts.map +1 -0
  41. package/dist/lib/parse-spz.js +268 -0
  42. package/dist/lib/parse-spz.js.map +1 -0
  43. package/dist/lib/splat-utils.d.ts +12 -0
  44. package/dist/lib/splat-utils.d.ts.map +1 -0
  45. package/dist/lib/splat-utils.js +38 -0
  46. package/dist/lib/splat-utils.js.map +1 -0
  47. package/dist/lib/splats-arrow-table.d.ts +5 -0
  48. package/dist/lib/splats-arrow-table.d.ts.map +1 -0
  49. package/dist/lib/splats-arrow-table.js +133 -0
  50. package/dist/lib/splats-arrow-table.js.map +1 -0
  51. package/dist/rad-loader-types.d.ts +16 -0
  52. package/dist/rad-loader-types.d.ts.map +1 -0
  53. package/dist/rad-loader-types.js +16 -0
  54. package/dist/rad-loader-types.js.map +1 -0
  55. package/dist/rad-loader.d.ts +20 -0
  56. package/dist/rad-loader.d.ts.map +1 -0
  57. package/dist/rad-loader.js +14 -0
  58. package/dist/rad-loader.js.map +1 -0
  59. package/dist/rad-metadata.schema.json +133 -0
  60. package/dist/rad-source-loader.d.ts +112 -0
  61. package/dist/rad-source-loader.d.ts.map +1 -0
  62. package/dist/rad-source-loader.js +329 -0
  63. package/dist/rad-source-loader.js.map +1 -0
  64. package/dist/rad-zod-schema.cjs +81 -0
  65. package/dist/rad-zod-schema.cjs.map +7 -0
  66. package/dist/rad-zod-schema.d.ts +88 -0
  67. package/dist/rad-zod-schema.d.ts.map +1 -0
  68. package/dist/rad-zod-schema.js +70 -0
  69. package/dist/rad-zod-schema.js.map +1 -0
  70. package/dist/radc-metadata.schema.json +112 -0
  71. package/dist/splat-loader-types.d.ts +19 -0
  72. package/dist/splat-loader-types.d.ts.map +1 -0
  73. package/dist/splat-loader-types.js +20 -0
  74. package/dist/splat-loader-types.js.map +1 -0
  75. package/dist/splat-loader.d.ts +21 -0
  76. package/dist/splat-loader.d.ts.map +1 -0
  77. package/dist/splat-loader.js +12 -0
  78. package/dist/splat-loader.js.map +1 -0
  79. package/dist/splats-format.d.ts +39 -0
  80. package/dist/splats-format.d.ts.map +1 -0
  81. package/dist/splats-format.js +42 -0
  82. package/dist/splats-format.js.map +1 -0
  83. package/dist/spz-loader-types.d.ts +20 -0
  84. package/dist/spz-loader-types.d.ts.map +1 -0
  85. package/dist/spz-loader-types.js +20 -0
  86. package/dist/spz-loader-types.js.map +1 -0
  87. package/dist/spz-loader.d.ts +22 -0
  88. package/dist/spz-loader.d.ts.map +1 -0
  89. package/dist/spz-loader.js +11 -0
  90. package/dist/spz-loader.js.map +1 -0
  91. package/dist/types.d.ts +34 -0
  92. package/dist/types.d.ts.map +1 -0
  93. package/dist/types.js +5 -0
  94. package/dist/types.js.map +1 -0
  95. package/dist/unbundled.d.ts +2 -0
  96. package/dist/unbundled.d.ts.map +1 -0
  97. package/dist/unbundled.js +5 -0
  98. package/dist/unbundled.js.map +1 -0
  99. package/package.json +94 -0
  100. package/src/bundled.ts +5 -0
  101. package/src/index.ts +28 -0
  102. package/src/ksplat-loader-types.ts +25 -0
  103. package/src/ksplat-loader.ts +16 -0
  104. package/src/lib/parse-ksplat.ts +540 -0
  105. package/src/lib/parse-rad-chunk.ts +721 -0
  106. package/src/lib/parse-rad.ts +318 -0
  107. package/src/lib/parse-splat.ts +77 -0
  108. package/src/lib/parse-spz.ts +368 -0
  109. package/src/lib/splat-utils.ts +49 -0
  110. package/src/lib/splats-arrow-table.ts +190 -0
  111. package/src/rad-loader-types.ts +20 -0
  112. package/src/rad-loader.ts +22 -0
  113. package/src/rad-source-loader.ts +491 -0
  114. package/src/rad-zod-schema.ts +83 -0
  115. package/src/splat-loader-types.ts +25 -0
  116. package/src/splat-loader.ts +16 -0
  117. package/src/splats-format.ts +47 -0
  118. package/src/spz-loader-types.ts +25 -0
  119. package/src/spz-loader.ts +16 -0
  120. package/src/types.ts +39 -0
  121. package/src/unbundled.ts +5 -0
@@ -0,0 +1,12 @@
1
+ export declare const SH_C0 = 0.28209479177387814;
2
+ /** Converts a normalized RGB value to a spherical harmonic DC coefficient. */
3
+ export declare function convertColorByteToSphericalHarmonicDc(colorByte: number): number;
4
+ /** Converts an unorm8 alpha byte to linear opacity. */
5
+ export declare function convertAlphaByteToLinearOpacity(alphaByte: number): number;
6
+ /** Returns a normalized quaternion, falling back to identity when invalid. */
7
+ export declare function normalizeQuaternion(w: number, x: number, y: number, z: number): [number, number, number, number];
8
+ /** Decodes the GaussianSplats3D uint8 quaternion component encoding. */
9
+ export declare function decodeQuaternionByte(byte: number): number;
10
+ /** Decodes an IEEE 754 binary16 value. */
11
+ export declare function decodeFloat16(value: number): number;
12
+ //# sourceMappingURL=splat-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splat-utils.d.ts","sourceRoot":"","sources":["../../src/lib/splat-utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,KAAK,sBAAsB,CAAC;AAEzC,8EAA8E;AAC9E,wBAAgB,qCAAqC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE/E;AAED,uDAAuD;AACvD,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CACjC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAMlC;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,0CAA0C;AAC1C,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYnD"}
@@ -0,0 +1,38 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export const SH_C0 = 0.28209479177387814;
5
+ /** Converts a normalized RGB value to a spherical harmonic DC coefficient. */
6
+ export function convertColorByteToSphericalHarmonicDc(colorByte) {
7
+ return (colorByte / 255 - 0.5) / SH_C0;
8
+ }
9
+ /** Converts an unorm8 alpha byte to linear opacity. */
10
+ export function convertAlphaByteToLinearOpacity(alphaByte) {
11
+ return Math.min(Math.max(alphaByte / 255, 0), 1);
12
+ }
13
+ /** Returns a normalized quaternion, falling back to identity when invalid. */
14
+ export function normalizeQuaternion(w, x, y, z) {
15
+ const length = Math.hypot(w, x, y, z);
16
+ if (!Number.isFinite(length) || length <= Number.EPSILON) {
17
+ return [1, 0, 0, 0];
18
+ }
19
+ return [w / length, x / length, y / length, z / length];
20
+ }
21
+ /** Decodes the GaussianSplats3D uint8 quaternion component encoding. */
22
+ export function decodeQuaternionByte(byte) {
23
+ return (byte - 128) / 128;
24
+ }
25
+ /** Decodes an IEEE 754 binary16 value. */
26
+ export function decodeFloat16(value) {
27
+ const sign = value & 0x8000 ? -1 : 1;
28
+ const exponent = (value >> 10) & 0x1f;
29
+ const fraction = value & 0x03ff;
30
+ if (exponent === 0) {
31
+ return sign * Math.pow(2, -14) * (fraction / 1024);
32
+ }
33
+ if (exponent === 0x1f) {
34
+ return fraction ? Number.NaN : sign * Number.POSITIVE_INFINITY;
35
+ }
36
+ return sign * Math.pow(2, exponent - 15) * (1 + fraction / 1024);
37
+ }
38
+ //# sourceMappingURL=splat-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splat-utils.js","sourceRoot":"","sources":["../../src/lib/splat-utils.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,MAAM,CAAC,MAAM,KAAK,GAAG,mBAAmB,CAAC;AAEzC,8EAA8E;AAC9E,MAAM,UAAU,qCAAqC,CAAC,SAAiB;IACrE,OAAO,CAAC,SAAS,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AACzC,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,+BAA+B,CAAC,SAAiB;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AAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACjE,CAAC;IACD,OAAO,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,CAAC;AACnE,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { MeshArrowTable } from '@loaders.gl/schema';
2
+ import type { GaussianSplats } from "../types.js";
3
+ /** Builds a Mesh Arrow table from decoded Gaussian splat values. */
4
+ export declare function makeGaussianSplatsArrowTable(splats: GaussianSplats): MeshArrowTable;
5
+ //# sourceMappingURL=splats-arrow-table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splats-arrow-table.d.ts","sourceRoot":"","sources":["../../src/lib/splats-arrow-table.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAQ,cAAc,EAAS,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAC,cAAc,EAAC,oBAAiB;AAG7C,oEAAoE;AACpE,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CA8EnF"}
@@ -0,0 +1,133 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ /* eslint-disable max-params */
5
+ import * as arrow from 'apache-arrow';
6
+ import { convertColorByteToSphericalHarmonicDc } from "./splat-utils.js";
7
+ /** Builds a Mesh Arrow table from decoded Gaussian splat values. */
8
+ export function makeGaussianSplatsArrowTable(splats) {
9
+ const columns = {};
10
+ const fields = [];
11
+ const schemaFields = [];
12
+ addColumn(columns, fields, schemaFields, 'POSITION', makeFixedSizeListVector(splats.positions, 3), {
13
+ type: 'fixed-size-list',
14
+ listSize: 3,
15
+ children: [{ name: 'value', type: 'float32' }]
16
+ });
17
+ const colorCoefficients = getColorCoefficients(splats);
18
+ addScalarColumn(columns, fields, schemaFields, 'f_dc_0', colorCoefficients[0], {
19
+ 'loaders_gl.gaussian_splats.semantic': 'spherical_harmonic_dc',
20
+ 'loaders_gl.gaussian_splats.component': '0',
21
+ 'loaders_gl.gaussian_splats.encoding': 'coefficient'
22
+ });
23
+ addScalarColumn(columns, fields, schemaFields, 'f_dc_1', colorCoefficients[1], {
24
+ 'loaders_gl.gaussian_splats.semantic': 'spherical_harmonic_dc',
25
+ 'loaders_gl.gaussian_splats.component': '1',
26
+ 'loaders_gl.gaussian_splats.encoding': 'coefficient'
27
+ });
28
+ addScalarColumn(columns, fields, schemaFields, 'f_dc_2', colorCoefficients[2], {
29
+ 'loaders_gl.gaussian_splats.semantic': 'spherical_harmonic_dc',
30
+ 'loaders_gl.gaussian_splats.component': '2',
31
+ 'loaders_gl.gaussian_splats.encoding': 'coefficient'
32
+ });
33
+ addScalarColumn(columns, fields, schemaFields, 'opacity', splats.opacities, {
34
+ 'loaders_gl.gaussian_splats.semantic': 'opacity',
35
+ 'loaders_gl.gaussian_splats.encoding': 'linear'
36
+ });
37
+ addVectorComponents(columns, fields, schemaFields, 'scale', splats.scales, 3, {
38
+ 'loaders_gl.gaussian_splats.semantic': 'scale',
39
+ 'loaders_gl.gaussian_splats.encoding': 'linear'
40
+ });
41
+ addVectorComponents(columns, fields, schemaFields, 'rot', splats.rotations, 4, {
42
+ 'loaders_gl.gaussian_splats.semantic': 'rotation',
43
+ 'loaders_gl.gaussian_splats.encoding': 'quaternion'
44
+ });
45
+ if (splats.sphericalHarmonics && splats.sphericalHarmonicsComponentCount) {
46
+ addSphericalHarmonicRestColumns(columns, fields, schemaFields, splats.sphericalHarmonics, splats.sphericalHarmonicsComponentCount);
47
+ }
48
+ const metadata = new Map([
49
+ ['loaders_gl.semantic_type', 'gaussian-splats'],
50
+ ['loaders_gl.gaussian_splats.version', '1'],
51
+ ['loaders_gl.gaussian_splats.source_format', splats.format],
52
+ ['topology', 'point-list'],
53
+ ['mode', '0']
54
+ ]);
55
+ const arrowSchema = new arrow.Schema(fields, metadata);
56
+ const schema = {
57
+ fields: schemaFields,
58
+ metadata: Object.fromEntries(metadata)
59
+ };
60
+ return {
61
+ shape: 'arrow-table',
62
+ schema,
63
+ data: new arrow.Table(arrowSchema, columns),
64
+ topology: 'point-list',
65
+ loaderData: splats.loaderData
66
+ };
67
+ }
68
+ /** Adds one scalar Arrow column per component of an interleaved vector array. */
69
+ function addVectorComponents(columns, fields, schemaFields, prefix, values, size, metadata) {
70
+ for (let component = 0; component < size; component++) {
71
+ const componentValues = new Float32Array(values.length / size);
72
+ for (let rowIndex = 0; rowIndex < componentValues.length; rowIndex++) {
73
+ componentValues[rowIndex] = values[rowIndex * size + component];
74
+ }
75
+ addScalarColumn(columns, fields, schemaFields, `${prefix}_${component}`, componentValues, {
76
+ ...metadata,
77
+ 'loaders_gl.gaussian_splats.component': String(component)
78
+ });
79
+ }
80
+ }
81
+ /** Adds one scalar Arrow column per spherical harmonic rest component. */
82
+ function addSphericalHarmonicRestColumns(columns, fields, schemaFields, sphericalHarmonics, componentCount) {
83
+ for (let component = 0; component < componentCount; component++) {
84
+ const componentValues = new Float32Array(sphericalHarmonics.length / componentCount);
85
+ for (let rowIndex = 0; rowIndex < componentValues.length; rowIndex++) {
86
+ componentValues[rowIndex] = sphericalHarmonics[rowIndex * componentCount + component];
87
+ }
88
+ addScalarColumn(columns, fields, schemaFields, `f_rest_${component}`, componentValues, {
89
+ 'loaders_gl.gaussian_splats.semantic': 'spherical_harmonic_rest',
90
+ 'loaders_gl.gaussian_splats.component': String(component),
91
+ 'loaders_gl.gaussian_splats.encoding': 'coefficient'
92
+ });
93
+ }
94
+ }
95
+ /** Adds a Float32 scalar Arrow column and matching loaders.gl schema field. */
96
+ function addScalarColumn(columns, fields, schemaFields, name, values, metadata) {
97
+ addColumn(columns, fields, schemaFields, name, arrow.makeVector(values), 'float32', metadata);
98
+ }
99
+ /** Adds an Arrow column, Arrow field, and loaders.gl schema field. */
100
+ function addColumn(columns, fields, schemaFields, name, column, schemaType, metadata = {}) {
101
+ columns[name] = column;
102
+ fields.push(new arrow.Field(name, column.type, false, new Map(Object.entries(metadata))));
103
+ schemaFields.push({ name, type: schemaType, nullable: false, metadata });
104
+ }
105
+ /** Builds a FixedSizeList Arrow vector from an interleaved Float32 array. */
106
+ function makeFixedSizeListVector(value, size) {
107
+ const values = arrow.makeVector(value);
108
+ const child = values.data[0];
109
+ const type = new arrow.FixedSizeList(size, new arrow.Field('value', child.type, false));
110
+ const data = new arrow.Data(type, 0, value.length / size, 0, {}, [child]);
111
+ return new arrow.Vector([data]);
112
+ }
113
+ /** Returns separate SH DC coefficient arrays from direct coefficients or RGB bytes. */
114
+ function getColorCoefficients(splats) {
115
+ const rowCount = splats.splatCount;
116
+ const fdc0 = new Float32Array(rowCount);
117
+ const fdc1 = new Float32Array(rowCount);
118
+ const fdc2 = new Float32Array(rowCount);
119
+ for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
120
+ if (splats.sphericalHarmonicDcs) {
121
+ fdc0[rowIndex] = splats.sphericalHarmonicDcs[rowIndex * 3 + 0];
122
+ fdc1[rowIndex] = splats.sphericalHarmonicDcs[rowIndex * 3 + 1];
123
+ fdc2[rowIndex] = splats.sphericalHarmonicDcs[rowIndex * 3 + 2];
124
+ }
125
+ else {
126
+ fdc0[rowIndex] = convertColorByteToSphericalHarmonicDc(splats.colors[rowIndex * 3 + 0]);
127
+ fdc1[rowIndex] = convertColorByteToSphericalHarmonicDc(splats.colors[rowIndex * 3 + 1]);
128
+ fdc2[rowIndex] = convertColorByteToSphericalHarmonicDc(splats.colors[rowIndex * 3 + 2]);
129
+ }
130
+ }
131
+ return [fdc0, fdc1, fdc2];
132
+ }
133
+ //# sourceMappingURL=splats-arrow-table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splats-arrow-table.js","sourceRoot":"","sources":["../../src/lib/splats-arrow-table.ts"],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,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,qCAAqC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACxF,IAAI,CAAC,QAAQ,CAAC,GAAG,qCAAqC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACxF,IAAI,CAAC,QAAQ,CAAC,GAAG,qCAAqC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC1F,CAAC;IACH,CAAC;IACD,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { RADMetadata } from "./lib/parse-rad.js";
2
+ /** Loader metadata for Spark `.rad` paged LoD Gaussian splat containers. */
3
+ export declare const RADLoader: {
4
+ readonly version: any;
5
+ readonly options: {};
6
+ readonly name: "RAD";
7
+ readonly id: "rad";
8
+ readonly module: "splats";
9
+ readonly extensions: ["rad"];
10
+ readonly mimeTypes: ["application/octet-stream"];
11
+ readonly binary: true;
12
+ readonly tests: [ArrayBuffer];
13
+ readonly dataType: RADMetadata;
14
+ readonly batchType: never;
15
+ };
16
+ //# sourceMappingURL=rad-loader-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rad-loader-types.d.ts","sourceRoot":"","sources":["../src/rad-loader-types.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,2BAAwB;AAMjD,4EAA4E;AAC5E,eAAO,MAAM,SAAS;;;;;;;;;;uBACS,WAAW;wBACrB,KAAK;CAIoC,CAAC"}
@@ -0,0 +1,16 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { RADFormat } from "./splats-format.js";
5
+ // __VERSION__ is injected by babel-plugin-version-inline
6
+ // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
+ const VERSION = typeof "4.5.0-alpha.1" !== 'undefined' ? "4.5.0-alpha.1" : 'latest';
8
+ /** Loader metadata for Spark `.rad` paged LoD Gaussian splat containers. */
9
+ export const RADLoader = {
10
+ dataType: null,
11
+ batchType: null,
12
+ ...RADFormat,
13
+ version: VERSION,
14
+ options: {}
15
+ };
16
+ //# sourceMappingURL=rad-loader-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rad-loader-types.js","sourceRoot":"","sources":["../src/rad-loader-types.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,SAAS,EAAC,2BAAwB;AAG1C,yDAAyD;AACzD,qDAAqD;AACrD,MAAM,OAAO,GAAG,sBAAkB,KAAK,WAAW,CAAC,CAAC,iBAAa,CAAC,CAAC,QAAQ,CAAC;AAE5E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,QAAQ,EAAE,IAA8B;IACxC,SAAS,EAAE,IAAa;IACxB,GAAG,SAAS;IACZ,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,EAAE;CACiD,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { RADMetadata } from "./lib/parse-rad.js";
2
+ export { parseRADChunkHeader, parseRADHeader, tryParseRADHeader } from "./lib/parse-rad.js";
3
+ export { parseRADChunk, parseRADChunkToGaussianSplats, type RADChunkDecodeOptions } from "./lib/parse-rad-chunk.js";
4
+ /** Parser-bearing loader for Spark `.rad` paged LoD Gaussian splat container metadata. */
5
+ export declare const RADLoaderWithParser: {
6
+ readonly parse: (arrayBuffer: ArrayBuffer) => Promise<RADMetadata>;
7
+ readonly parseSync: (arrayBuffer: ArrayBuffer) => RADMetadata;
8
+ readonly version: any;
9
+ readonly options: {};
10
+ readonly name: "RAD";
11
+ readonly id: "rad";
12
+ readonly module: "splats";
13
+ readonly extensions: ["rad"];
14
+ readonly mimeTypes: ["application/octet-stream"];
15
+ readonly binary: true;
16
+ readonly tests: [ArrayBuffer];
17
+ readonly dataType: RADMetadata;
18
+ readonly batchType: never;
19
+ };
20
+ //# sourceMappingURL=rad-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rad-loader.d.ts","sourceRoot":"","sources":["../src/rad-loader.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,2BAAwB;AAGjD,OAAO,EAAC,mBAAmB,EAAE,cAAc,EAAE,iBAAiB,EAAC,2BAAwB;AACvF,OAAO,EACL,aAAa,EACb,6BAA6B,EAC7B,KAAK,qBAAqB,EAC3B,iCAA8B;AAE/B,0FAA0F;AAC1F,eAAO,MAAM,mBAAmB;kCAEH,WAAW;sCACb,WAAW;;;;;;;;;;;;CACkC,CAAC"}
@@ -0,0 +1,14 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ import { parseRADHeader } from "./lib/parse-rad.js";
5
+ import { RADLoader as RADLoaderMetadata } from "./rad-loader-types.js";
6
+ export { parseRADChunkHeader, parseRADHeader, tryParseRADHeader } from "./lib/parse-rad.js";
7
+ export { parseRADChunk, parseRADChunkToGaussianSplats } from "./lib/parse-rad-chunk.js";
8
+ /** Parser-bearing loader for Spark `.rad` paged LoD Gaussian splat container metadata. */
9
+ export const RADLoaderWithParser = {
10
+ ...RADLoaderMetadata,
11
+ parse: async (arrayBuffer) => parseRADHeader(arrayBuffer),
12
+ parseSync: (arrayBuffer) => parseRADHeader(arrayBuffer)
13
+ };
14
+ //# sourceMappingURL=rad-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rad-loader.js","sourceRoot":"","sources":["../src/rad-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,cAAc,EAAC,2BAAwB;AAE/C,OAAO,EAAC,SAAS,IAAI,iBAAiB,EAAC,8BAA2B;AAElE,OAAO,EAAC,mBAAmB,EAAE,cAAc,EAAE,iBAAiB,EAAC,2BAAwB;AACvF,OAAO,EACL,aAAa,EACb,6BAA6B,EAE9B,iCAA8B;AAE/B,0FAA0F;AAC1F,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,iBAAiB;IACpB,KAAK,EAAE,KAAK,EAAE,WAAwB,EAAE,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC;IACtE,SAAS,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,cAAc,CAAC,WAAW,CAAC;CACE,CAAC"}
@@ -0,0 +1,133 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "version": {
6
+ "type": "number",
7
+ "const": 1
8
+ },
9
+ "type": {
10
+ "type": "string",
11
+ "const": "gsplat"
12
+ },
13
+ "count": {
14
+ "$ref": "#/definitions/__schema0"
15
+ },
16
+ "maxSh": {
17
+ "allOf": [
18
+ {
19
+ "$ref": "#/definitions/__schema0"
20
+ }
21
+ ]
22
+ },
23
+ "lodTree": {
24
+ "type": "boolean"
25
+ },
26
+ "chunkSize": {
27
+ "allOf": [
28
+ {
29
+ "$ref": "#/definitions/__schema0"
30
+ }
31
+ ]
32
+ },
33
+ "allChunkBytes": {
34
+ "allOf": [
35
+ {
36
+ "$ref": "#/definitions/__schema0"
37
+ }
38
+ ]
39
+ },
40
+ "chunks": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "object",
44
+ "properties": {
45
+ "offset": {
46
+ "$ref": "#/definitions/__schema0"
47
+ },
48
+ "bytes": {
49
+ "$ref": "#/definitions/__schema0"
50
+ },
51
+ "base": {
52
+ "allOf": [
53
+ {
54
+ "$ref": "#/definitions/__schema0"
55
+ }
56
+ ]
57
+ },
58
+ "count": {
59
+ "allOf": [
60
+ {
61
+ "$ref": "#/definitions/__schema0"
62
+ }
63
+ ]
64
+ },
65
+ "filename": {
66
+ "type": "string"
67
+ }
68
+ },
69
+ "required": [
70
+ "offset",
71
+ "bytes"
72
+ ],
73
+ "additionalProperties": {}
74
+ }
75
+ },
76
+ "splatEncoding": {
77
+ "type": "object",
78
+ "properties": {
79
+ "rgbMin": {
80
+ "type": "number"
81
+ },
82
+ "rgbMax": {
83
+ "type": "number"
84
+ },
85
+ "lnScaleMin": {
86
+ "type": "number"
87
+ },
88
+ "lnScaleMax": {
89
+ "type": "number"
90
+ },
91
+ "sh1Max": {
92
+ "type": "number"
93
+ },
94
+ "sh2Max": {
95
+ "type": "number"
96
+ },
97
+ "sh3Max": {
98
+ "type": "number"
99
+ },
100
+ "lodOpacity": {
101
+ "type": "boolean"
102
+ }
103
+ },
104
+ "additionalProperties": {}
105
+ },
106
+ "shCodeCount": {
107
+ "allOf": [
108
+ {
109
+ "$ref": "#/definitions/__schema0"
110
+ }
111
+ ]
112
+ },
113
+ "comment": {
114
+ "type": "string"
115
+ }
116
+ },
117
+ "required": [
118
+ "version",
119
+ "type",
120
+ "count",
121
+ "chunks"
122
+ ],
123
+ "additionalProperties": {},
124
+ "definitions": {
125
+ "__schema0": {
126
+ "type": "integer",
127
+ "minimum": 0,
128
+ "maximum": 9007199254740991
129
+ }
130
+ },
131
+ "$id": "https://unpkg.com/@loaders.gl/splats/rad-metadata.schema.json",
132
+ "title": "loaders.gl Spark RAD metadata"
133
+ }
@@ -0,0 +1,112 @@
1
+ import type { DataSourceOptions } from '@loaders.gl/loader-utils';
2
+ import { DataSource } from '@loaders.gl/loader-utils';
3
+ import type { MeshArrowTable } from '@loaders.gl/schema';
4
+ import { type RADChunkMetadata, type RADMetadata } from "./lib/parse-rad.js";
5
+ import { type RADChunkDecodeOptions } from "./lib/parse-rad-chunk.js";
6
+ import type { GaussianSplats } from "./types.js";
7
+ /** Options for creating a Spark RAD source. */
8
+ export type RADSourceLoaderOptions = DataSourceOptions & {
9
+ rad?: {
10
+ /** Optional request headers forwarded to RAD and RADC fetches. */
11
+ headers?: Record<string, string>;
12
+ /** Whether remote RAD and RADC fetches should include credentials. */
13
+ withCredentials?: boolean;
14
+ /** Header byte lengths to try while probing remote RAD metadata. */
15
+ headerByteLengths?: number[];
16
+ };
17
+ };
18
+ /** Optional parameters for fetching RAD chunk bytes or metadata. */
19
+ export type RADChunkRequestOptions = {
20
+ /** Abort signal forwarded to the underlying fetch. */
21
+ signal?: AbortSignal;
22
+ } & RADChunkDecodeOptions;
23
+ /** Options for iterating decoded RAD chunk tables. */
24
+ export type RADChunkTableIteratorOptions = RADChunkRequestOptions & {
25
+ /** First chunk index to decode. */
26
+ startChunkIndex?: number;
27
+ /** Maximum number of chunks to decode. */
28
+ maxChunks?: number;
29
+ /** Maximum number of splats to decode before stopping. */
30
+ maxSplats?: number;
31
+ /** Maximum number of RAD chunks to fetch and decode at once when the iterator must inspect a chunk window before yielding. */
32
+ maxConcurrentChunkRequests?: number;
33
+ /** Whether loaded child splats should replace parent LoD splats in returned tables. */
34
+ pruneLoadedLoDParents?: boolean;
35
+ };
36
+ /** Source factory for Spark `.rad` paged LoD Gaussian splat containers. */
37
+ export declare const RADSourceLoader: {
38
+ readonly name: "RADSourceLoader";
39
+ readonly version: any;
40
+ readonly type: "rad";
41
+ readonly fromUrl: true;
42
+ readonly fromBlob: true;
43
+ readonly options: {
44
+ readonly rad: {
45
+ readonly headers: never;
46
+ readonly withCredentials: false;
47
+ readonly headerByteLengths: never;
48
+ };
49
+ };
50
+ readonly defaultOptions: {
51
+ readonly rad: {
52
+ readonly headers: never;
53
+ readonly withCredentials: false;
54
+ readonly headerByteLengths: never;
55
+ };
56
+ };
57
+ readonly testURL: (url: string) => boolean;
58
+ readonly createDataSource: (data: string | Blob, options: RADSourceLoaderOptions) => RADSource;
59
+ readonly id: "rad";
60
+ readonly module: "splats";
61
+ readonly extensions: ["rad"];
62
+ readonly mimeTypes: ["application/octet-stream"];
63
+ readonly binary: true;
64
+ readonly tests: [ArrayBuffer];
65
+ readonly dataType: RADSource;
66
+ readonly batchType: never;
67
+ };
68
+ /** Runtime source for RAD metadata and chunk-byte access. */
69
+ export declare class RADSource extends DataSource<string | Blob, RADSourceLoaderOptions> {
70
+ /** Shared metadata promise exposed for source-style integrations. */
71
+ metadata: Promise<RADMetadata>;
72
+ /** Lazily initialized RAD header promise. */
73
+ private _metadataPromise;
74
+ /** Lazily initialized per-chunk metadata promises. */
75
+ private _chunkMetadataPromises;
76
+ constructor(data: string | Blob, options: RADSourceLoaderOptions);
77
+ /** Ensures the RAD header metadata has been loaded. */
78
+ initialize(): Promise<void>;
79
+ /** Returns parsed Spark RAD top-level metadata. */
80
+ getMetadata(): Promise<RADMetadata>;
81
+ /** Returns the number of chunks declared by the RAD metadata. */
82
+ getChunkCount(): Promise<number>;
83
+ /** Returns the URL used for a chunk, or `null` for Blob-backed inline chunks. */
84
+ getChunkUrl(chunkIndex: number): Promise<string | null>;
85
+ /** Fetches one raw RADC chunk by index. */
86
+ getChunk(chunkIndex: number, options?: RADChunkRequestOptions): Promise<ArrayBuffer>;
87
+ /** Fetches and parses metadata for one RADC chunk. */
88
+ getChunkMetadata(chunkIndex: number, options?: RADChunkRequestOptions): Promise<RADChunkMetadata>;
89
+ /** Fetches and decodes one RADC chunk into raw Gaussian splat arrays. */
90
+ getChunkSplats(chunkIndex: number, options?: RADChunkRequestOptions): Promise<GaussianSplats>;
91
+ /** Fetches and decodes one RADC chunk into a Mesh Arrow table. */
92
+ getChunkTable(chunkIndex: number, options?: RADChunkRequestOptions): Promise<MeshArrowTable>;
93
+ /** Iterates decoded RADC chunks as Mesh Arrow tables. */
94
+ getChunkTables(options?: RADChunkTableIteratorOptions): AsyncIterable<MeshArrowTable>;
95
+ /** Fetches and decodes RAD chunks with bounded concurrency while preserving chunk order. */
96
+ private _getChunkSplatsConcurrently;
97
+ /** Adds source-level RAD decode metadata to chunk decode options. */
98
+ private _getChunkDecodeOptions;
99
+ /** Loads and parses the top-level RAD metadata. */
100
+ private _loadMetadata;
101
+ /** Returns a validated chunk table entry. */
102
+ private _getChunkRange;
103
+ /** Fetches a full or ranged ArrayBuffer while tolerating non-206 range fallbacks. */
104
+ private _fetchArrayBuffer;
105
+ /** Fetches through custom source fetch hooks or the injected core fetchFile helper. */
106
+ private _fetchResponse;
107
+ /** Builds request options for RAD fetches. */
108
+ private _getRequestInit;
109
+ }
110
+ /** Resolves a sidecar RADC chunk filename relative to its parent RAD URL. */
111
+ export declare function resolveRADChunkUrl(rootUrl: string, chunkFilename: string): string;
112
+ //# sourceMappingURL=rad-source-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rad-source-loader.d.ts","sourceRoot":"","sources":["../src/rad-source-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AACpD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAEvD,OAAO,EAGL,KAAK,gBAAgB,EAErB,KAAK,WAAW,EACjB,2BAAwB;AACzB,OAAO,EAGL,KAAK,qBAAqB,EAC3B,iCAA8B;AAE/B,OAAO,KAAK,EAAC,cAAc,EAAC,mBAAgB;AAS5C,+CAA+C;AAC/C,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,GAAG;IACvD,GAAG,CAAC,EAAE;QACJ,kEAAkE;QAClE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,sEAAsE;QACtE,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,oEAAoE;QACpE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,sBAAsB,GAAG;IACnC,sDAAsD;IACtD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,qBAAqB,CAAC;AAE1B,sDAAsD;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