MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / loadWasm

Function loadWasm

tests/pycolmap/generate_fixtures.ts:38–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36const FIXTURES_DIR = resolve(__dirname, 'fixtures');
37
38async function loadWasm(): Promise<WasmReconstructionWrapper> {
39 const factory = resolveColmapWasmFactory(await import(pathToFileURL(WASM_JS).href));
40 const wasmBinary = readFileSync(WASM_BIN);
41 const module = await factory({
42 wasmBinary,
43 locateFile: (f) => resolve(ROOT, 'public/wasm', f),
44 });
45 const wrapper = new WasmReconstructionWrapper();
46 Reflect.set(wrapper, 'module', module);
47 Reflect.set(wrapper, 'reconstruction', new module.Reconstruction());
48 return wrapper;
49}
50
51function toAB(path: string): ArrayBuffer {
52 const bytes = readFileSync(path);

Callers 1

mainFunction · 0.85

Calls 2

resolveColmapWasmFactoryFunction · 0.90
resolveFunction · 0.50

Tested by

no test coverage detected