MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / getSplatMeshSourceOptions

Function getSplatMeshSourceOptions

src/utils/sparkSplatRuntime.ts:19–37  ·  view source on GitHub ↗
(
  sourceFile: File
)

Source from the content-addressed store, hash-verified

17}
18
19export async function getSplatMeshSourceOptions(
20 sourceFile: File
21): Promise<Pick<SplatMeshOptions, 'fileBytes' | 'stream' | 'streamLength'>> {
22 if (!isSplatFilePath(sourceFile.name)) {
23 throw new Error(`Unsupported splat format: ${sourceFile.name}`);
24 }
25
26 if (typeof sourceFile.stream === 'function') {
27 return {
28 stream: sourceFile.stream(),
29 streamLength: sourceFile.size,
30 };
31 }
32
33 const fileBytes = await sourceFile.arrayBuffer();
34 return {
35 fileBytes: new Uint8Array(fileBytes),
36 };
37}

Callers 3

loadSplatFunction · 0.90

Calls 1

isSplatFilePathFunction · 0.90

Tested by

no test coverage detected