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

Function createWasmParserWrapper

src/parsers/wasmParser.test.ts:120–209  ·  view source on GitHub ↗
(
  camera: CameraInfo,
  {
    frameSensorType = SensorType.IMU,
    rigSensorType = SensorType.IMU,
  }: WasmParserWrapperOptions = {}
)

Source from the content-addressed store, hash-verified

118}
119
120function createWasmParserWrapper(
121 camera: CameraInfo,
122 {
123 frameSensorType = SensorType.IMU,
124 rigSensorType = SensorType.IMU,
125 }: WasmParserWrapperOptions = {}
126) {
127 const wrapper = buildWasmReconstructionWrapper({ pointCount: 2 });
128
129 Object.defineProperties(wrapper, {
130 cameraCount: {
131 configurable: true,
132 get: () => 1,
133 },
134 dispose: {
135 configurable: true,
136 value: vi.fn(),
137 },
138 getAllCameras: {
139 configurable: true,
140 value: () => ({ [camera.cameraId]: camera }),
141 },
142 getAllImageInfos: {
143 configurable: true,
144 value: () => [],
145 },
146 getAllFrames: {
147 configurable: true,
148 value: () => ({
149 8: {
150 frameId: 8,
151 rigId: 7,
152 rigFromWorld: { qvec: [1, 0, 0, 0], tvec: [0, 0, 0] },
153 dataIds: [{ sensorId: { type: frameSensorType, id: 2 }, dataId: 42 }],
154 },
155 }),
156 },
157 getAllRigs: {
158 configurable: true,
159 value: () => ({
160 7: {
161 rigId: 7,
162 refSensorId: { type: SensorType.CAMERA, id: 1 },
163 sensors: [
164 { sensorId: { type: SensorType.CAMERA, id: 1 }, hasPose: false },
165 {
166 sensorId: { type: rigSensorType, id: 2 },
167 hasPose: true,
168 pose: { qvec: [1, 0, 0, 0], tvec: [0, 0, 0] },
169 },
170 ],
171 },
172 }),
173 },
174 getNumPoints2DPerImage: {
175 configurable: true,
176 value: () => new Uint32Array(),
177 },

Callers 1

wasmParser.test.tsFile · 0.85

Calls 1

Tested by

no test coverage detected