@loaders.gl/splats 5.0.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.
- package/LICENSE +41 -0
- package/README.md +3 -0
- package/dist/bundled.d.ts +2 -0
- package/dist/bundled.d.ts.map +1 -0
- package/dist/bundled.js +5 -0
- package/dist/bundled.js.map +1 -0
- package/dist/dist.dev.js +20876 -0
- package/dist/dist.min.js +18 -0
- package/dist/index.cjs +2046 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/ksplat-loader-types.d.ts +42 -0
- package/dist/ksplat-loader-types.d.ts.map +1 -0
- package/dist/ksplat-loader-types.js +26 -0
- package/dist/ksplat-loader-types.js.map +1 -0
- package/dist/ksplat-loader.d.ts +22 -0
- package/dist/ksplat-loader.d.ts.map +1 -0
- package/dist/ksplat-loader.js +13 -0
- package/dist/ksplat-loader.js.map +1 -0
- package/dist/lib/parse-ksplat.d.ts +7 -0
- package/dist/lib/parse-ksplat.d.ts.map +1 -0
- package/dist/lib/parse-ksplat.js +312 -0
- package/dist/lib/parse-ksplat.js.map +1 -0
- package/dist/lib/parse-rad-chunk.d.ts +19 -0
- package/dist/lib/parse-rad-chunk.d.ts.map +1 -0
- package/dist/lib/parse-rad-chunk.js +514 -0
- package/dist/lib/parse-rad-chunk.js.map +1 -0
- package/dist/lib/parse-rad.d.ts +120 -0
- package/dist/lib/parse-rad.d.ts.map +1 -0
- package/dist/lib/parse-rad.js +235 -0
- package/dist/lib/parse-rad.js.map +1 -0
- package/dist/lib/parse-splat.d.ts +7 -0
- package/dist/lib/parse-splat.d.ts.map +1 -0
- package/dist/lib/parse-splat.js +58 -0
- package/dist/lib/parse-splat.js.map +1 -0
- package/dist/lib/parse-spz.d.ts +7 -0
- package/dist/lib/parse-spz.d.ts.map +1 -0
- package/dist/lib/parse-spz.js +268 -0
- package/dist/lib/parse-spz.js.map +1 -0
- package/dist/lib/splat-utils.d.ts +12 -0
- package/dist/lib/splat-utils.d.ts.map +1 -0
- package/dist/lib/splat-utils.js +38 -0
- package/dist/lib/splat-utils.js.map +1 -0
- package/dist/lib/splats-arrow-table.d.ts +5 -0
- package/dist/lib/splats-arrow-table.d.ts.map +1 -0
- package/dist/lib/splats-arrow-table.js +132 -0
- package/dist/lib/splats-arrow-table.js.map +1 -0
- package/dist/rad-loader-types.d.ts +36 -0
- package/dist/rad-loader-types.d.ts.map +1 -0
- package/dist/rad-loader-types.js +22 -0
- package/dist/rad-loader-types.js.map +1 -0
- package/dist/rad-loader.d.ts +21 -0
- package/dist/rad-loader.d.ts.map +1 -0
- package/dist/rad-loader.js +15 -0
- package/dist/rad-loader.js.map +1 -0
- package/dist/rad-source-loader.d.ts +115 -0
- package/dist/rad-source-loader.d.ts.map +1 -0
- package/dist/rad-source-loader.js +338 -0
- package/dist/rad-source-loader.js.map +1 -0
- package/dist/splat-loader-types.d.ts +42 -0
- package/dist/splat-loader-types.d.ts.map +1 -0
- package/dist/splat-loader-types.js +26 -0
- package/dist/splat-loader-types.js.map +1 -0
- package/dist/splat-loader.d.ts +22 -0
- package/dist/splat-loader.d.ts.map +1 -0
- package/dist/splat-loader.js +13 -0
- package/dist/splat-loader.js.map +1 -0
- package/dist/splats-format.d.ts +43 -0
- package/dist/splats-format.d.ts.map +1 -0
- package/dist/splats-format.js +46 -0
- package/dist/splats-format.js.map +1 -0
- package/dist/spz-loader-types.d.ts +44 -0
- package/dist/spz-loader-types.d.ts.map +1 -0
- package/dist/spz-loader-types.js +26 -0
- package/dist/spz-loader-types.js.map +1 -0
- package/dist/spz-loader.d.ts +23 -0
- package/dist/spz-loader.d.ts.map +1 -0
- package/dist/spz-loader.js +12 -0
- package/dist/spz-loader.js.map +1 -0
- package/dist/types.d.ts +34 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/unbundled.d.ts +2 -0
- package/dist/unbundled.d.ts.map +1 -0
- package/dist/unbundled.js +5 -0
- package/dist/unbundled.js.map +1 -0
- package/package.json +85 -0
- package/src/bundled.ts +5 -0
- package/src/index.ts +26 -0
- package/src/ksplat-loader-types.ts +32 -0
- package/src/ksplat-loader.ts +18 -0
- package/src/lib/parse-ksplat.ts +538 -0
- package/src/lib/parse-rad-chunk.ts +721 -0
- package/src/lib/parse-rad.ts +439 -0
- package/src/lib/parse-splat.ts +77 -0
- package/src/lib/parse-spz.ts +368 -0
- package/src/lib/splat-utils.ts +49 -0
- package/src/lib/splats-arrow-table.ts +188 -0
- package/src/rad-loader-types.ts +27 -0
- package/src/rad-loader.ts +24 -0
- package/src/rad-source-loader.ts +504 -0
- package/src/splat-loader-types.ts +32 -0
- package/src/splat-loader.ts +18 -0
- package/src/splats-format.ts +51 -0
- package/src/spz-loader-types.ts +32 -0
- package/src/spz-loader.ts +18 -0
- package/src/types.ts +39 -0
- package/src/unbundled.ts +5 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
/** SPLAT - raw binary Gaussian splat format. */
|
|
5
|
+
export const SPLATFormat = {
|
|
6
|
+
name: 'SPLAT',
|
|
7
|
+
id: 'splat',
|
|
8
|
+
module: 'splats',
|
|
9
|
+
format: 'splat',
|
|
10
|
+
extensions: ['splat'],
|
|
11
|
+
mimeTypes: ['application/octet-stream'],
|
|
12
|
+
binary: true
|
|
13
|
+
};
|
|
14
|
+
/** KSPLAT - GaussianSplats3D optimized Gaussian splat format. */
|
|
15
|
+
export const KSPLATFormat = {
|
|
16
|
+
name: 'KSPLAT',
|
|
17
|
+
id: 'ksplat',
|
|
18
|
+
module: 'splats',
|
|
19
|
+
format: 'ksplat',
|
|
20
|
+
extensions: ['ksplat'],
|
|
21
|
+
mimeTypes: ['application/octet-stream'],
|
|
22
|
+
binary: true
|
|
23
|
+
};
|
|
24
|
+
/** SPZ - Niantic Spatial compressed Gaussian splat format. */
|
|
25
|
+
export const SPZFormat = {
|
|
26
|
+
name: 'SPZ',
|
|
27
|
+
id: 'spz',
|
|
28
|
+
module: 'splats',
|
|
29
|
+
format: 'spz',
|
|
30
|
+
extensions: ['spz'],
|
|
31
|
+
mimeTypes: ['application/octet-stream'],
|
|
32
|
+
binary: true,
|
|
33
|
+
tests: [new Uint8Array([0x4e, 0x47, 0x53, 0x50]).buffer]
|
|
34
|
+
};
|
|
35
|
+
/** RAD - Spark paged level-of-detail Gaussian splat container. */
|
|
36
|
+
export const RADFormat = {
|
|
37
|
+
name: 'RAD',
|
|
38
|
+
id: 'rad',
|
|
39
|
+
module: 'splats',
|
|
40
|
+
format: 'rad',
|
|
41
|
+
extensions: ['rad'],
|
|
42
|
+
mimeTypes: ['application/octet-stream'],
|
|
43
|
+
binary: true,
|
|
44
|
+
tests: [new Uint8Array([0x52, 0x41, 0x44, 0x30]).buffer]
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=splats-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splats-format.js","sourceRoot":"","sources":["../src/splats-format.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAIpC,gDAAgD;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,OAAO;IACb,EAAE,EAAE,OAAO;IACX,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,SAAS,EAAE,CAAC,0BAA0B,CAAC;IACvC,MAAM,EAAE,IAAI;CACa,CAAC;AAE5B,iEAAiE;AACjE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,QAAQ;IACd,EAAE,EAAE,QAAQ;IACZ,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,CAAC,QAAQ,CAAC;IACtB,SAAS,EAAE,CAAC,0BAA0B,CAAC;IACvC,MAAM,EAAE,IAAI;CACa,CAAC;AAE5B,8DAA8D;AAC9D,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,KAAK;IACX,EAAE,EAAE,KAAK;IACT,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,KAAK,CAAC;IACnB,SAAS,EAAE,CAAC,0BAA0B,CAAC;IACvC,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,CAAC,IAAI,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;CAC/B,CAAC;AAE5B,kEAAkE;AAClE,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,KAAK;IACX,EAAE,EAAE,KAAK;IACT,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,KAAK,CAAC;IACnB,SAAS,EAAE,CAAC,0BAA0B,CAAC;IACvC,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,CAAC,IAAI,UAAU,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;CAC/B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { MeshArrowTable } from '@loaders.gl/schema';
|
|
2
|
+
import type { SplatsLoaderOptions } from "./types.js";
|
|
3
|
+
/** Preloads the parser-bearing SPZ loader implementation. */
|
|
4
|
+
declare function preload(): Promise<{
|
|
5
|
+
readonly parse: (arrayBuffer: ArrayBuffer, options?: SplatsLoaderOptions) => Promise<MeshArrowTable>;
|
|
6
|
+
readonly version: any;
|
|
7
|
+
readonly options: {
|
|
8
|
+
readonly splats: {
|
|
9
|
+
readonly shape: "arrow-table";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
readonly name: "SPZ";
|
|
13
|
+
readonly id: "spz";
|
|
14
|
+
readonly module: "splats";
|
|
15
|
+
readonly format: "spz";
|
|
16
|
+
readonly extensions: ["spz"];
|
|
17
|
+
readonly mimeTypes: ["application/octet-stream"];
|
|
18
|
+
readonly binary: true;
|
|
19
|
+
readonly tests: [ArrayBuffer];
|
|
20
|
+
readonly dataType: MeshArrowTable;
|
|
21
|
+
readonly batchType: never;
|
|
22
|
+
}>;
|
|
23
|
+
/** Metadata-only loader for Niantic Spatial `.spz` Gaussian splat files. */
|
|
24
|
+
export declare const SPZLoader: {
|
|
25
|
+
readonly version: any;
|
|
26
|
+
readonly options: {
|
|
27
|
+
readonly splats: {
|
|
28
|
+
readonly shape: "arrow-table";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
readonly preload: typeof preload;
|
|
32
|
+
readonly name: "SPZ";
|
|
33
|
+
readonly id: "spz";
|
|
34
|
+
readonly module: "splats";
|
|
35
|
+
readonly format: "spz";
|
|
36
|
+
readonly extensions: ["spz"];
|
|
37
|
+
readonly mimeTypes: ["application/octet-stream"];
|
|
38
|
+
readonly binary: true;
|
|
39
|
+
readonly tests: [ArrayBuffer];
|
|
40
|
+
readonly dataType: MeshArrowTable;
|
|
41
|
+
readonly batchType: never;
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=spz-loader-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spz-loader-types.d.ts","sourceRoot":"","sources":["../src/spz-loader-types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAC,mBAAmB,EAAC,mBAAgB;AAOjD,6DAA6D;AAC7D,iBAAe,OAAO;;;;;;;;;;;;;;;;uBAOS,cAAc;wBACxB,KAAK;GALzB;AAED,4EAA4E;AAC5E,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;uBACS,cAAc;wBACxB,KAAK;CAS6C,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { SPZFormat } 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 "5.0.0-alpha.1" !== 'undefined' ? "5.0.0-alpha.1" : 'latest';
|
|
8
|
+
/** Preloads the parser-bearing SPZ loader implementation. */
|
|
9
|
+
async function preload() {
|
|
10
|
+
const { SPZLoaderWithParser } = await import("./spz-loader.js");
|
|
11
|
+
return SPZLoaderWithParser;
|
|
12
|
+
}
|
|
13
|
+
/** Metadata-only loader for Niantic Spatial `.spz` Gaussian splat files. */
|
|
14
|
+
export const SPZLoader = {
|
|
15
|
+
dataType: null,
|
|
16
|
+
batchType: null,
|
|
17
|
+
...SPZFormat,
|
|
18
|
+
version: VERSION,
|
|
19
|
+
options: {
|
|
20
|
+
splats: {
|
|
21
|
+
shape: 'arrow-table'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
preload
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=spz-loader-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spz-loader-types.js","sourceRoot":"","sources":["../src/spz-loader-types.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAKpC,OAAO,EAAC,SAAS,EAAC,2BAAwB;AAE1C,yDAAyD;AACzD,qDAAqD;AACrD,MAAM,OAAO,GAAG,sBAAkB,KAAK,WAAW,CAAC,CAAC,iBAAa,CAAC,CAAC,QAAQ,CAAC;AAE5E,6DAA6D;AAC7D,KAAK,UAAU,OAAO;IACpB,MAAM,EAAC,mBAAmB,EAAC,GAAG,MAAM,MAAM,mBAAgB,CAAC;IAC3D,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,QAAQ,EAAE,IAAiC;IAC3C,SAAS,EAAE,IAAa;IACxB,GAAG,SAAS;IACZ,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE;QACP,MAAM,EAAE;YACN,KAAK,EAAE,aAAa;SACrB;KACF;IACD,OAAO;CAC8D,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { MeshArrowTable } from '@loaders.gl/schema';
|
|
2
|
+
import type { SplatsLoaderOptions } from "./types.js";
|
|
3
|
+
/** Parser-bearing loader for Niantic Spatial `.spz` Gaussian splat files. */
|
|
4
|
+
export declare const SPZLoaderWithParser: {
|
|
5
|
+
readonly parse: (arrayBuffer: ArrayBuffer, options?: SplatsLoaderOptions) => Promise<MeshArrowTable>;
|
|
6
|
+
readonly version: any;
|
|
7
|
+
readonly options: {
|
|
8
|
+
readonly splats: {
|
|
9
|
+
readonly shape: "arrow-table";
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
readonly name: "SPZ";
|
|
13
|
+
readonly id: "spz";
|
|
14
|
+
readonly module: "splats";
|
|
15
|
+
readonly format: "spz";
|
|
16
|
+
readonly extensions: ["spz"];
|
|
17
|
+
readonly mimeTypes: ["application/octet-stream"];
|
|
18
|
+
readonly binary: true;
|
|
19
|
+
readonly tests: [ArrayBuffer];
|
|
20
|
+
readonly dataType: MeshArrowTable;
|
|
21
|
+
readonly batchType: never;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=spz-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spz-loader.d.ts","sourceRoot":"","sources":["../src/spz-loader.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAC,mBAAmB,EAAC,mBAAgB;AAMjD,6EAA6E;AAC7E,eAAO,MAAM,mBAAmB;kCAEH,WAAW,YAAY,mBAAmB;;;;;;;;;;;;;;;;;CAEU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { parseSPZ } from "./lib/parse-spz.js";
|
|
5
|
+
import { SPZLoader as SPZLoaderMetadata } from "./spz-loader-types.js";
|
|
6
|
+
const { preload: _SPZLoaderPreload, ...SPZLoaderMetadataWithoutPreload } = SPZLoaderMetadata;
|
|
7
|
+
/** Parser-bearing loader for Niantic Spatial `.spz` Gaussian splat files. */
|
|
8
|
+
export const SPZLoaderWithParser = {
|
|
9
|
+
...SPZLoaderMetadataWithoutPreload,
|
|
10
|
+
parse: async (arrayBuffer, options) => parseSPZ(arrayBuffer, options)
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=spz-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spz-loader.js","sourceRoot":"","sources":["../src/spz-loader.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAKpC,OAAO,EAAC,QAAQ,EAAC,2BAAwB;AACzC,OAAO,EAAC,SAAS,IAAI,iBAAiB,EAAC,8BAA2B;AAElE,MAAM,EAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,+BAA+B,EAAC,GAAG,iBAAiB,CAAC;AAE3F,6EAA6E;AAC7E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,+BAA+B;IAClC,KAAK,EAAE,KAAK,EAAE,WAAwB,EAAE,OAA6B,EAAE,EAAE,CACvE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC+C,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LoaderOptions } from '@loaders.gl/loader-utils';
|
|
2
|
+
/** Options shared by Gaussian splat loaders. */
|
|
3
|
+
export type SplatsLoaderOptions = LoaderOptions & {
|
|
4
|
+
splats?: {
|
|
5
|
+
/** Output shape. V1 supports loaders.gl Mesh Arrow tables. */
|
|
6
|
+
shape?: 'arrow-table';
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
/** Linear Gaussian splat values before Arrow table construction. */
|
|
10
|
+
export type GaussianSplats = {
|
|
11
|
+
/** Source format identifier. */
|
|
12
|
+
format: 'splat' | 'ksplat' | 'spz' | 'rad';
|
|
13
|
+
/** Number of decoded splats. */
|
|
14
|
+
splatCount: number;
|
|
15
|
+
/** Interleaved xyz positions. */
|
|
16
|
+
positions: Float32Array;
|
|
17
|
+
/** Interleaved xyz Gaussian scale standard deviations. */
|
|
18
|
+
scales: Float32Array;
|
|
19
|
+
/** Interleaved quaternions in `[w, x, y, z]` order. */
|
|
20
|
+
rotations: Float32Array;
|
|
21
|
+
/** Interleaved RGB colors as unorm8 values. */
|
|
22
|
+
colors: Uint8Array;
|
|
23
|
+
/** Optional interleaved RGB spherical harmonic DC coefficients. */
|
|
24
|
+
sphericalHarmonicDcs?: Float32Array;
|
|
25
|
+
/** Linear opacity values. Some LoD formats intentionally store values above 1. */
|
|
26
|
+
opacities: Float32Array;
|
|
27
|
+
/** Optional spherical harmonic rest coefficients. */
|
|
28
|
+
sphericalHarmonics?: Float32Array;
|
|
29
|
+
/** Number of SH rest coefficients per splat. */
|
|
30
|
+
sphericalHarmonicsComponentCount?: number;
|
|
31
|
+
/** Source-specific metadata. */
|
|
32
|
+
loaderData?: Record<string, unknown>;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D,gDAAgD;AAChD,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG;IAChD,MAAM,CAAC,EAAE;QACP,8DAA8D;QAC9D,KAAK,CAAC,EAAE,aAAa,CAAC;KACvB,CAAC;CACH,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG;IAC3B,gCAAgC;IAChC,MAAM,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;IAC3C,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,SAAS,EAAE,YAAY,CAAC;IACxB,0DAA0D;IAC1D,MAAM,EAAE,YAAY,CAAC;IACrB,uDAAuD;IACvD,SAAS,EAAE,YAAY,CAAC;IACxB,+CAA+C;IAC/C,MAAM,EAAE,UAAU,CAAC;IACnB,mEAAmE;IACnE,oBAAoB,CAAC,EAAE,YAAY,CAAC;IACpC,kFAAkF;IAClF,SAAS,EAAE,YAAY,CAAC;IACxB,qDAAqD;IACrD,kBAAkB,CAAC,EAAE,YAAY,CAAC;IAClC,gDAAgD;IAChD,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAC1C,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unbundled.d.ts","sourceRoot":"","sources":["../src/unbundled.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAC,mBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unbundled.js","sourceRoot":"","sources":["../src/unbundled.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAC,mBAAgB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@loaders.gl/splats",
|
|
3
|
+
"version": "5.0.0-alpha.1",
|
|
4
|
+
"description": "Framework-independent loaders for Gaussian splat formats",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/visgl/loaders.gl"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"webgl",
|
|
16
|
+
"loader",
|
|
17
|
+
"3d",
|
|
18
|
+
"point cloud",
|
|
19
|
+
"gaussian splats",
|
|
20
|
+
"splat",
|
|
21
|
+
"ksplat"
|
|
22
|
+
],
|
|
23
|
+
"types": "dist/index.d.ts",
|
|
24
|
+
"main": "dist/index.cjs",
|
|
25
|
+
"module": "dist/index.js",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"import": "./dist/index.js",
|
|
30
|
+
"require": "./dist/index.cjs"
|
|
31
|
+
},
|
|
32
|
+
"./splat-loader": {
|
|
33
|
+
"types": "./dist/splat-loader.d.ts",
|
|
34
|
+
"import": "./dist/splat-loader.js"
|
|
35
|
+
},
|
|
36
|
+
"./ksplat-loader": {
|
|
37
|
+
"types": "./dist/ksplat-loader.d.ts",
|
|
38
|
+
"import": "./dist/ksplat-loader.js"
|
|
39
|
+
},
|
|
40
|
+
"./spz-loader": {
|
|
41
|
+
"types": "./dist/spz-loader.d.ts",
|
|
42
|
+
"import": "./dist/spz-loader.js"
|
|
43
|
+
},
|
|
44
|
+
"./rad-loader": {
|
|
45
|
+
"types": "./dist/rad-loader.d.ts",
|
|
46
|
+
"import": "./dist/rad-loader.js"
|
|
47
|
+
},
|
|
48
|
+
"./rad-source-loader": {
|
|
49
|
+
"types": "./dist/rad-source-loader.d.ts",
|
|
50
|
+
"import": "./dist/rad-source-loader.js"
|
|
51
|
+
},
|
|
52
|
+
"./unbundled": {
|
|
53
|
+
"types": "./dist/unbundled.d.ts",
|
|
54
|
+
"import": "./dist/unbundled.js"
|
|
55
|
+
},
|
|
56
|
+
"./bundled": {
|
|
57
|
+
"types": "./dist/bundled.d.ts",
|
|
58
|
+
"import": "./dist/bundled.js"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"sideEffects": false,
|
|
62
|
+
"files": [
|
|
63
|
+
"src",
|
|
64
|
+
"dist",
|
|
65
|
+
"README.md"
|
|
66
|
+
],
|
|
67
|
+
"scripts": {
|
|
68
|
+
"pre-build": "npm run build-bundle && npm run build-bundle-dev",
|
|
69
|
+
"build-bundle": "ocular-bundle ./bundle.ts --output=dist/dist.min.js",
|
|
70
|
+
"build-bundle-dev": "ocular-bundle ./bundle.ts --env=dev --output=dist/dist.dev.js"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"@loaders.gl/compression": "5.0.0-alpha.1",
|
|
74
|
+
"@loaders.gl/loader-utils": "5.0.0-alpha.1",
|
|
75
|
+
"@loaders.gl/schema": "5.0.0-alpha.1",
|
|
76
|
+
"apache-arrow": ">= 17.0.0"
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"zstd-codec": "^0.1.0"
|
|
80
|
+
},
|
|
81
|
+
"peerDependencies": {
|
|
82
|
+
"@loaders.gl/core": "~5.0.0-alpha.0"
|
|
83
|
+
},
|
|
84
|
+
"gitHead": "77a55028e8204e09df1258f10cb61ed35353b258"
|
|
85
|
+
}
|
package/src/bundled.ts
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
export type {GaussianSplats, SplatsLoaderOptions} from './types';
|
|
6
|
+
export type {
|
|
7
|
+
RADChunkMetadata,
|
|
8
|
+
RADChunkProperty,
|
|
9
|
+
RADChunkPropertyCompression,
|
|
10
|
+
RADChunkPropertyEncoding,
|
|
11
|
+
RADChunkPropertyName,
|
|
12
|
+
RADChunkRange,
|
|
13
|
+
RADMetadata,
|
|
14
|
+
RADSplatEncoding
|
|
15
|
+
} from './lib/parse-rad';
|
|
16
|
+
export {SPLATFormat, KSPLATFormat, SPZFormat, RADFormat} from './splats-format';
|
|
17
|
+
export {SPLATLoader} from './splat-loader-types';
|
|
18
|
+
export {KSPLATLoader} from './ksplat-loader-types';
|
|
19
|
+
export {SPZLoader} from './spz-loader-types';
|
|
20
|
+
export {RADLoader} from './rad-loader-types';
|
|
21
|
+
export type {
|
|
22
|
+
RADChunkRequestOptions,
|
|
23
|
+
RADChunkTableIteratorOptions,
|
|
24
|
+
RADSourceLoaderOptions
|
|
25
|
+
} from './rad-source-loader';
|
|
26
|
+
export {RADSource, RADSourceLoader, resolveRADChunkUrl} from './rad-source-loader';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {Loader} from '@loaders.gl/loader-utils';
|
|
6
|
+
import type {MeshArrowTable} from '@loaders.gl/schema';
|
|
7
|
+
import type {SplatsLoaderOptions} from './types';
|
|
8
|
+
import {KSPLATFormat} from './splats-format';
|
|
9
|
+
|
|
10
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
11
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
12
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
13
|
+
|
|
14
|
+
/** Preloads the parser-bearing KSPLAT loader implementation. */
|
|
15
|
+
async function preload() {
|
|
16
|
+
const {KSPLATLoaderWithParser} = await import('./ksplat-loader');
|
|
17
|
+
return KSPLATLoaderWithParser;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Metadata-only loader for `.ksplat` Gaussian splat files. */
|
|
21
|
+
export const KSPLATLoader = {
|
|
22
|
+
dataType: null as unknown as MeshArrowTable,
|
|
23
|
+
batchType: null as never,
|
|
24
|
+
...KSPLATFormat,
|
|
25
|
+
version: VERSION,
|
|
26
|
+
options: {
|
|
27
|
+
splats: {
|
|
28
|
+
shape: 'arrow-table'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
preload
|
|
32
|
+
} as const satisfies Loader<MeshArrowTable, never, SplatsLoaderOptions>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {LoaderWithParser} from '@loaders.gl/loader-utils';
|
|
6
|
+
import type {MeshArrowTable} from '@loaders.gl/schema';
|
|
7
|
+
import type {SplatsLoaderOptions} from './types';
|
|
8
|
+
import {parseKSPLAT} from './lib/parse-ksplat';
|
|
9
|
+
import {KSPLATLoader as KSPLATLoaderMetadata} from './ksplat-loader-types';
|
|
10
|
+
|
|
11
|
+
const {preload: _KSPLATLoaderPreload, ...KSPLATLoaderMetadataWithoutPreload} = KSPLATLoaderMetadata;
|
|
12
|
+
|
|
13
|
+
/** Parser-bearing loader for `.ksplat` Gaussian splat files. */
|
|
14
|
+
export const KSPLATLoaderWithParser = {
|
|
15
|
+
...KSPLATLoaderMetadataWithoutPreload,
|
|
16
|
+
parse: async (arrayBuffer: ArrayBuffer) => parseKSPLAT(arrayBuffer),
|
|
17
|
+
parseSync: (arrayBuffer: ArrayBuffer) => parseKSPLAT(arrayBuffer)
|
|
18
|
+
} as const satisfies LoaderWithParser<MeshArrowTable, never, SplatsLoaderOptions>;
|