@gaussforge/wasm 0.1.1 → 0.1.2

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.
@@ -0,0 +1,147 @@
1
+ class GaussForgeBase {
2
+ constructor() {
3
+ this.module = null;
4
+ this.instance = null;
5
+ this.initPromise = null;
6
+ }
7
+ async init(moduleFactory) {
8
+ if (this.initPromise)
9
+ return this.initPromise;
10
+ this.initPromise = (async () => {
11
+ try {
12
+ let moduleInstance;
13
+ if (moduleFactory) {
14
+ moduleInstance = moduleFactory();
15
+ }
16
+ else {
17
+ const createModule = await this.importWasmModule();
18
+ const factory = createModule.default;
19
+ moduleInstance = typeof factory === 'function' ? factory() : factory;
20
+ }
21
+ if (moduleInstance && typeof moduleInstance.then === 'function') {
22
+ moduleInstance = await moduleInstance;
23
+ }
24
+ this.module = moduleInstance;
25
+ this.instance = new this.module.GaussForgeWASM();
26
+ }
27
+ catch (error) {
28
+ this.initPromise = null;
29
+ throw new Error(`GaussForge Init Failed: ${error instanceof Error ? error.message : String(error)}`);
30
+ }
31
+ })();
32
+ return this.initPromise;
33
+ }
34
+ /**
35
+ * Core memory safety: Clone data
36
+ * Deep copy WASM memory view to JS heap to prevent Detached ArrayBuffer errors
37
+ * Handles all TypedArray types to ensure proper memory management
38
+ */
39
+ cloneFromWasm(data) {
40
+ if (!data || typeof data !== 'object')
41
+ return data;
42
+ // Handle all TypedArray types
43
+ if (data instanceof Uint8Array)
44
+ return new Uint8Array(data);
45
+ if (data instanceof Float32Array)
46
+ return new Float32Array(data);
47
+ if (data instanceof Int8Array)
48
+ return new Int8Array(data);
49
+ if (data instanceof Uint16Array)
50
+ return new Uint16Array(data);
51
+ if (data instanceof Int16Array)
52
+ return new Int16Array(data);
53
+ if (data instanceof Uint32Array)
54
+ return new Uint32Array(data);
55
+ if (data instanceof Int32Array)
56
+ return new Int32Array(data);
57
+ if (data instanceof Float64Array)
58
+ return new Float64Array(data);
59
+ if (Array.isArray(data))
60
+ return data.map(item => this.cloneFromWasm(item));
61
+ const copy = {};
62
+ for (const key in data) {
63
+ copy[key] = this.cloneFromWasm(data[key]);
64
+ }
65
+ return copy;
66
+ }
67
+ ensureInitialized() {
68
+ if (!this.instance)
69
+ throw new Error('GaussForge not initialized. Call init() first.');
70
+ }
71
+ async read(data, format, options = {}) {
72
+ this.ensureInitialized();
73
+ const input = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
74
+ const result = this.instance.read(input, format, options.strict || false);
75
+ if (result.error)
76
+ throw new Error(result.error);
77
+ return this.cloneFromWasm(result);
78
+ }
79
+ async write(ir, format, options = {}) {
80
+ this.ensureInitialized();
81
+ const result = this.instance.write(ir, format, options.strict || false);
82
+ if (result.error)
83
+ throw new Error(result.error);
84
+ return this.cloneFromWasm(result);
85
+ }
86
+ async convert(data, inFmt, outFmt, options = {}) {
87
+ this.ensureInitialized();
88
+ const input = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
89
+ const result = this.instance.convert(input, inFmt, outFmt, options.strict || false);
90
+ if (result.error)
91
+ throw new Error(result.error);
92
+ return this.cloneFromWasm(result);
93
+ }
94
+ getSupportedFormats() {
95
+ this.ensureInitialized();
96
+ return this.instance.getSupportedFormats();
97
+ }
98
+ getVersion() {
99
+ this.ensureInitialized();
100
+ return this.instance.getVersion();
101
+ }
102
+ /**
103
+ * Check if a format is supported
104
+ * @param format - Format name to check
105
+ * @returns true if the format is supported, false otherwise
106
+ */
107
+ isFormatSupported(format) {
108
+ this.ensureInitialized();
109
+ const formats = this.getSupportedFormats();
110
+ return formats.includes(format);
111
+ }
112
+ /**
113
+ * Explicitly destroy C++ instance to prevent memory leaks
114
+ */
115
+ dispose() {
116
+ if (this.instance) {
117
+ this.instance.delete();
118
+ this.instance = null;
119
+ }
120
+ this.module = null;
121
+ this.initPromise = null;
122
+ }
123
+ }
124
+
125
+ class GaussForge extends GaussForgeBase {
126
+ async importWasmModule() {
127
+ // @ts-ignore
128
+ return import('./gauss_forge.node.js');
129
+ }
130
+ }
131
+ let _instance = null;
132
+ async function createGaussForge(factory) {
133
+ if (!_instance) {
134
+ _instance = new GaussForge();
135
+ await _instance.init(factory);
136
+ }
137
+ return _instance;
138
+ }
139
+ function destroyGaussForge() {
140
+ if (_instance) {
141
+ _instance.dispose();
142
+ _instance = null;
143
+ }
144
+ }
145
+
146
+ export { GaussForge, createGaussForge, destroyGaussForge };
147
+ //# sourceMappingURL=index.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.node.js","sources":["../../base.ts","../../index.node.ts"],"sourcesContent":[null,null],"names":[],"mappings":"MA4BsB,cAAc,CAAA;AAApC,IAAA,WAAA,GAAA;QACc,IAAA,CAAA,MAAM,GAA4B,IAAI;QACtC,IAAA,CAAA,QAAQ,GAAkC,IAAI;QAC9C,IAAA,CAAA,WAAW,GAAyB,IAAI;IAuHtD;IAlHI,MAAM,IAAI,CAAC,aAAqD,EAAA;QAC5D,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,IAAI,CAAC,WAAW;AAE7C,QAAA,IAAI,CAAC,WAAW,GAAG,CAAC,YAAW;AAC3B,YAAA,IAAI;AACA,gBAAA,IAAI,cAAmB;gBACvB,IAAI,aAAa,EAAE;oBACf,cAAc,GAAG,aAAa,EAAE;gBACpC;qBAAO;AACH,oBAAA,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE;AAClD,oBAAA,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO;AACpC,oBAAA,cAAc,GAAG,OAAO,OAAO,KAAK,UAAU,GAAG,OAAO,EAAE,GAAG,OAAO;gBACxE;gBAEA,IAAI,cAAc,IAAI,OAAO,cAAc,CAAC,IAAI,KAAK,UAAU,EAAE;oBAC7D,cAAc,GAAG,MAAM,cAAc;gBACzC;AAEA,gBAAA,IAAI,CAAC,MAAM,GAAG,cAAkC;gBAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;YACpD;YA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ACH;AAED,IAAI,SAAS,GAAsB,IAAI;AAChC,eAAe,gBAAgB,CAAC,OAAa,EAAA;IAChD,IAAI,CAAC,SAAS,EAAE;AACZ,QAAA,SAAS,GAAG,IAAI,UAAU,EAAE;AAC5B,QAAA,MAAM,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;IACjC;AACA,IAAA,OAAO,SAAS;AACpB;SAEgB,iBAAiB,GAAA;IAC7B,IAAI,SAAS,EAAE;QACX,SAAS,CAAC,OAAO,EAAE;QACnB,SAAS,GAAG,IAAI;IACpB;AACJ;;;;"}
@@ -0,0 +1,8 @@
1
+ import { GaussForgeBase } from './base';
2
+ export * from './types';
3
+ export declare class GaussForge extends GaussForgeBase {
4
+ protected importWasmModule(): Promise<typeof import("./gauss_forge.web.js")>;
5
+ }
6
+ export declare function createGaussForge(factory?: any): Promise<GaussForge>;
7
+ export declare function destroyGaussForge(): void;
8
+ //# sourceMappingURL=index.web.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../index.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,cAAc,SAAS,CAAC;AAExB,qBAAa,UAAW,SAAQ,cAAc;cAC1B,gBAAgB;CAInC;AAGD,wBAAsB,gBAAgB,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAMzE;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAKxC"}
@@ -0,0 +1,147 @@
1
+ class GaussForgeBase {
2
+ constructor() {
3
+ this.module = null;
4
+ this.instance = null;
5
+ this.initPromise = null;
6
+ }
7
+ async init(moduleFactory) {
8
+ if (this.initPromise)
9
+ return this.initPromise;
10
+ this.initPromise = (async () => {
11
+ try {
12
+ let moduleInstance;
13
+ if (moduleFactory) {
14
+ moduleInstance = moduleFactory();
15
+ }
16
+ else {
17
+ const createModule = await this.importWasmModule();
18
+ const factory = createModule.default;
19
+ moduleInstance = typeof factory === 'function' ? factory() : factory;
20
+ }
21
+ if (moduleInstance && typeof moduleInstance.then === 'function') {
22
+ moduleInstance = await moduleInstance;
23
+ }
24
+ this.module = moduleInstance;
25
+ this.instance = new this.module.GaussForgeWASM();
26
+ }
27
+ catch (error) {
28
+ this.initPromise = null;
29
+ throw new Error(`GaussForge Init Failed: ${error instanceof Error ? error.message : String(error)}`);
30
+ }
31
+ })();
32
+ return this.initPromise;
33
+ }
34
+ /**
35
+ * Core memory safety: Clone data
36
+ * Deep copy WASM memory view to JS heap to prevent Detached ArrayBuffer errors
37
+ * Handles all TypedArray types to ensure proper memory management
38
+ */
39
+ cloneFromWasm(data) {
40
+ if (!data || typeof data !== 'object')
41
+ return data;
42
+ // Handle all TypedArray types
43
+ if (data instanceof Uint8Array)
44
+ return new Uint8Array(data);
45
+ if (data instanceof Float32Array)
46
+ return new Float32Array(data);
47
+ if (data instanceof Int8Array)
48
+ return new Int8Array(data);
49
+ if (data instanceof Uint16Array)
50
+ return new Uint16Array(data);
51
+ if (data instanceof Int16Array)
52
+ return new Int16Array(data);
53
+ if (data instanceof Uint32Array)
54
+ return new Uint32Array(data);
55
+ if (data instanceof Int32Array)
56
+ return new Int32Array(data);
57
+ if (data instanceof Float64Array)
58
+ return new Float64Array(data);
59
+ if (Array.isArray(data))
60
+ return data.map(item => this.cloneFromWasm(item));
61
+ const copy = {};
62
+ for (const key in data) {
63
+ copy[key] = this.cloneFromWasm(data[key]);
64
+ }
65
+ return copy;
66
+ }
67
+ ensureInitialized() {
68
+ if (!this.instance)
69
+ throw new Error('GaussForge not initialized. Call init() first.');
70
+ }
71
+ async read(data, format, options = {}) {
72
+ this.ensureInitialized();
73
+ const input = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
74
+ const result = this.instance.read(input, format, options.strict || false);
75
+ if (result.error)
76
+ throw new Error(result.error);
77
+ return this.cloneFromWasm(result);
78
+ }
79
+ async write(ir, format, options = {}) {
80
+ this.ensureInitialized();
81
+ const result = this.instance.write(ir, format, options.strict || false);
82
+ if (result.error)
83
+ throw new Error(result.error);
84
+ return this.cloneFromWasm(result);
85
+ }
86
+ async convert(data, inFmt, outFmt, options = {}) {
87
+ this.ensureInitialized();
88
+ const input = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
89
+ const result = this.instance.convert(input, inFmt, outFmt, options.strict || false);
90
+ if (result.error)
91
+ throw new Error(result.error);
92
+ return this.cloneFromWasm(result);
93
+ }
94
+ getSupportedFormats() {
95
+ this.ensureInitialized();
96
+ return this.instance.getSupportedFormats();
97
+ }
98
+ getVersion() {
99
+ this.ensureInitialized();
100
+ return this.instance.getVersion();
101
+ }
102
+ /**
103
+ * Check if a format is supported
104
+ * @param format - Format name to check
105
+ * @returns true if the format is supported, false otherwise
106
+ */
107
+ isFormatSupported(format) {
108
+ this.ensureInitialized();
109
+ const formats = this.getSupportedFormats();
110
+ return formats.includes(format);
111
+ }
112
+ /**
113
+ * Explicitly destroy C++ instance to prevent memory leaks
114
+ */
115
+ dispose() {
116
+ if (this.instance) {
117
+ this.instance.delete();
118
+ this.instance = null;
119
+ }
120
+ this.module = null;
121
+ this.initPromise = null;
122
+ }
123
+ }
124
+
125
+ class GaussForge extends GaussForgeBase {
126
+ async importWasmModule() {
127
+ // @ts-ignore
128
+ return import('./gauss_forge.web.js');
129
+ }
130
+ }
131
+ let _instance = null;
132
+ async function createGaussForge(factory) {
133
+ if (!_instance) {
134
+ _instance = new GaussForge();
135
+ await _instance.init(factory);
136
+ }
137
+ return _instance;
138
+ }
139
+ function destroyGaussForge() {
140
+ if (_instance) {
141
+ _instance.dispose();
142
+ _instance = null;
143
+ }
144
+ }
145
+
146
+ export { GaussForge, createGaussForge, destroyGaussForge };
147
+ //# sourceMappingURL=index.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.web.js","sources":["../../base.ts","../../index.web.ts"],"sourcesContent":[null,null],"names":[],"mappings":"MA4BsB,cAAc,CAAA;AAApC,IAAA,WAAA,GA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ge/wasm",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "GaussForge WASM library for Gaussian Splatting format conversion",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "module": "dist/index.esm.js",
6
+ "main": "dist/index.web.js",
7
+ "types": "dist/index.web.d.ts",
8
+ "module": "dist/index.web.js",
9
9
  "exports": {
10
10
  ".": {
11
- "import": "./dist/index.esm.js",
12
- "require": "./dist/index.js",
11
+ "browser": "./dist/index.web.js",
12
+ "node": "./dist/index.node.js",
13
+ "import": "./dist/index.web.js",
14
+ "require": "./dist/index.node.js",
13
15
  "types": "./dist/index.d.ts"
14
16
  },
15
17
  "./package.json": "./package.json"
16
18
  },
17
19
  "files": [
18
20
  "dist",
19
- "gauss_forge.js",
20
- "gauss_forge.wasm",
21
- "README.md",
22
- "package.json"
21
+ "README.md"
23
22
  ],
24
23
  "scripts": {
25
24
  "build": "npm run build:wasm && npm run build:ts",
26
25
  "build:wasm": "node build-wasm.js",
27
26
  "build:ts": "tsc && rollup -c",
28
- "prepublishOnly": "npm run build",
29
- "publish": "npm publish --access public"
27
+ "prepublishOnly": "npm run build"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
30
31
  },
31
32
  "keywords": [
32
33
  "gaussian-splatting",
package/dist/index.d.ts DELETED
@@ -1,82 +0,0 @@
1
- /**
2
- * GaussForge WASM TypeScript wrapper library
3
- */
4
- import type { GaussianCloudIR, ReadResult, WriteResult, ConvertResult, SupportedFormat, ReadOptions, WriteOptions, ConvertOptions } from './types';
5
- interface EmscriptenModule {
6
- GaussForgeWASM: new () => GaussForgeWASMInstance;
7
- [key: string]: any;
8
- }
9
- interface GaussForgeWASMInstance {
10
- read(data: ArrayBuffer | Uint8Array, format: string, strict?: boolean): ReadResult | {
11
- error: string;
12
- };
13
- write(ir: GaussianCloudIR, format: string, strict?: boolean): WriteResult | {
14
- error: string;
15
- };
16
- convert(data: ArrayBuffer | Uint8Array, inFormat: string, outFormat: string, strict?: boolean): ConvertResult | {
17
- error: string;
18
- };
19
- getSupportedFormats(): string[];
20
- }
21
- type ModuleFactory = (moduleOverrides?: any) => EmscriptenModule;
22
- /**
23
- * GaussForge WASM wrapper class
24
- */
25
- export declare class GaussForge {
26
- private module;
27
- private instance;
28
- private initPromise;
29
- /**
30
- * Initialize WASM module
31
- * @param moduleFactory Emscripten module factory function
32
- */
33
- init(moduleFactory?: ModuleFactory): Promise<void>;
34
- /**
35
- * Ensure module is initialized
36
- */
37
- private ensureInitialized;
38
- /**
39
- * Read Gaussian splatting data
40
- * @param data Input data (ArrayBuffer or Uint8Array)
41
- * @param format File format
42
- * @param options Read options
43
- * @returns Read result
44
- */
45
- read(data: ArrayBuffer | Uint8Array, format: SupportedFormat | string, options?: ReadOptions): Promise<ReadResult>;
46
- /**
47
- * Write Gaussian splatting data
48
- * @param ir Gaussian splatting intermediate representation
49
- * @param format Output format
50
- * @param options Write options
51
- * @returns Write result
52
- */
53
- write(ir: GaussianCloudIR, format: SupportedFormat | string, options?: WriteOptions): Promise<WriteResult>;
54
- /**
55
- * Convert file format
56
- * @param data Input data
57
- * @param inFormat Input format
58
- * @param outFormat Output format
59
- * @param options Convert options
60
- * @returns Convert result
61
- */
62
- convert(data: ArrayBuffer | Uint8Array, inFormat: SupportedFormat | string, outFormat: SupportedFormat | string, options?: ConvertOptions): Promise<ConvertResult>;
63
- /**
64
- * Get list of supported formats
65
- * @returns Array of supported formats
66
- */
67
- getSupportedFormats(): SupportedFormat[];
68
- /**
69
- * Check if format is supported
70
- * @param format Format name
71
- * @returns Whether the format is supported
72
- */
73
- isFormatSupported(format: string): boolean;
74
- }
75
- /**
76
- * Get default GaussForge instance
77
- * @param moduleFactory Optional module factory function
78
- * @returns GaussForge instance
79
- */
80
- export declare function createGaussForge(moduleFactory?: ModuleFactory): Promise<GaussForge>;
81
- export * from './types';
82
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sour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WAAW,GAAG,UAAU,EAC9B,MAAM,EAAE,eAAe,GAAG,MAAM,EAChC,OAAO,GAAE,WAAgB,GAC1B,OAAO,CAAC,UAAU,CAAC;IAatB;;;;;;OAMG;IACG,KAAK,CACP,EAAE,EAAE,eAAe,EACnB,MAAM,EAAE,eAAe,GAAG,MAAM,EAChC,OAAO,GAAE,YAAiB,GAC3B,OAAO,CAAC,WAAW,CAAC;IAYvB;;;;;;;OAOG;IACG,OAAO,CACT,IAAI,EAAE,WAAW,GAAG,UAAU,EAC9B,QAAQ,EAAE,eAAe,GAAG,MAAM,EAClC,SAAS,EAAE,eAAe,GAAG,MAAM,EACnC,OAAO,GAAE,cAAmB,GAC7B,OAAO,CAAC,aAAa,CAAC;IAkBzB;;;OAGG;IACH,mBAAmB,IAAI,eAAe,EAAE;IAKxC;;;;OAIG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;CAG7C;AAKD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAClC,aAAa,CAAC,EAAE,aAAa,GAC9B,OAAO,CAAC,UAAU,CAAC,CAMrB;AAGD,cAAc,SAAS,CAAC"}
package/dist/index.esm.js DELETED
@@ -1,155 +0,0 @@
1
- /**
2
- * GaussForge WASM TypeScript wrapper library
3
- */
4
- /**
5
- * GaussForge WASM wrapper class
6
- */
7
- class GaussForge {
8
- constructor() {
9
- this.module = null;
10
- this.instance = null;
11
- this.initPromise = null;
12
- }
13
- /**
14
- * Initialize WASM module
15
- * @param moduleFactory Emscripten module factory function
16
- */
17
- async init(moduleFactory) {
18
- if (this.initPromise) {
19
- return this.initPromise;
20
- }
21
- this.initPromise = (async () => {
22
- try {
23
- let moduleInstance;
24
- if (moduleFactory) {
25
- moduleInstance = moduleFactory();
26
- }
27
- else {
28
- // Default load from package root (in npm package) or current directory (during development)
29
- // Dynamically import Emscripten-generated module
30
- // @ts-ignore - May not exist during development, will have error at runtime
31
- // In npm package, gauss_forge.js is in package root, need to find from dist/ up
32
- const wasmPath = typeof __dirname !== 'undefined'
33
- ? require('path').join(__dirname, '..', 'gauss_forge.js') // CommonJS
34
- : new URL('../gauss_forge.js', import.meta.url).href; // ES Module
35
- const createModule = await import(wasmPath);
36
- // Emscripten module may be a function or object
37
- if (typeof createModule.default === 'function') {
38
- moduleInstance = createModule.default();
39
- }
40
- else if (createModule.default && typeof createModule.default.then === 'function') {
41
- // If it's a Promise, wait for it to complete
42
- moduleInstance = await createModule.default;
43
- }
44
- else {
45
- moduleInstance = createModule.default;
46
- }
47
- }
48
- // Wait for module to fully initialize (if module is a Promise)
49
- if (moduleInstance && 'then' in moduleInstance && typeof moduleInstance.then === 'function') {
50
- moduleInstance = await moduleInstance;
51
- }
52
- if (!moduleInstance || !moduleInstance.GaussForgeWASM) {
53
- throw new Error('Failed to initialize WASM module: GaussForgeWASM not found');
54
- }
55
- this.module = moduleInstance;
56
- this.instance = new this.module.GaussForgeWASM();
57
- }
58
- catch (error) {
59
- this.initPromise = null;
60
- const errorMessage = error instanceof Error ? error.message : String(error);
61
- throw new Error(`Failed to initialize GaussForge: ${errorMessage}`);
62
- }
63
- })();
64
- return this.initPromise;
65
- }
66
- /**
67
- * Ensure module is initialized
68
- */
69
- ensureInitialized() {
70
- if (!this.instance) {
71
- throw new Error('GaussForge not initialized. Call init() first.');
72
- }
73
- }
74
- /**
75
- * Read Gaussian splatting data
76
- * @param data Input data (ArrayBuffer or Uint8Array)
77
- * @param format File format
78
- * @param options Read options
79
- * @returns Read result
80
- */
81
- async read(data, format, options = {}) {
82
- this.ensureInitialized();
83
- const dataArray = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
84
- const result = this.instance.read(dataArray, format, options.strict || false);
85
- if ('error' in result) {
86
- throw new Error(result.error);
87
- }
88
- return result;
89
- }
90
- /**
91
- * Write Gaussian splatting data
92
- * @param ir Gaussian splatting intermediate representation
93
- * @param format Output format
94
- * @param options Write options
95
- * @returns Write result
96
- */
97
- async write(ir, format, options = {}) {
98
- this.ensureInitialized();
99
- const result = this.instance.write(ir, format, options.strict || false);
100
- if ('error' in result) {
101
- throw new Error(result.error);
102
- }
103
- return result;
104
- }
105
- /**
106
- * Convert file format
107
- * @param data Input data
108
- * @param inFormat Input format
109
- * @param outFormat Output format
110
- * @param options Convert options
111
- * @returns Convert result
112
- */
113
- async convert(data, inFormat, outFormat, options = {}) {
114
- this.ensureInitialized();
115
- const dataArray = data instanceof ArrayBuffer ? new Uint8Array(data) : data;
116
- const result = this.instance.convert(dataArray, inFormat, outFormat, options.strict || false);
117
- if ('error' in result) {
118
- throw new Error(result.error);
119
- }
120
- return result;
121
- }
122
- /**
123
- * Get list of supported formats
124
- * @returns Array of supported formats
125
- */
126
- getSupportedFormats() {
127
- this.ensureInitialized();
128
- return this.instance.getSupportedFormats();
129
- }
130
- /**
131
- * Check if format is supported
132
- * @param format Format name
133
- * @returns Whether the format is supported
134
- */
135
- isFormatSupported(format) {
136
- return this.getSupportedFormats().includes(format);
137
- }
138
- }
139
- // Default exported singleton instance
140
- let defaultInstance = null;
141
- /**
142
- * Get default GaussForge instance
143
- * @param moduleFactory Optional module factory function
144
- * @returns GaussForge instance
145
- */
146
- async function createGaussForge(moduleFactory) {
147
- if (!defaultInstance) {
148
- defaultInstance = new GaussForge();
149
- await defaultInstance.init(moduleFactory);
150
- }
151
- return defaultInstance;
152
- }
153
-
154
- export { GaussForge, createGaussForge };
155
- //# sourceMappingURL=index.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;AAEG;AA0CH;;AAEG;MACU,UAAU,CAAA;AAAvB,IAAA,WAAA,GAAA;QACY,IAAA,CAAA,MAAM,GAA4B,IAAI;QACtC,IAAA,CAAA,QAAQ,GAAkC,IAAI;QAC9C,IAAA,CAAA,WAAW,GAAyB,IAAI;IAmKpD;AAjKI;;;AAGG;IACH,MAAM,IAAI,CAAC,aAA6B,EAAA;AACpC,QAAA,IAAI,IAAI,CAAC,W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