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

Function prepareWebGpuPsnrApp

e2e/webgpu-psnr-app.spec.ts:684–707  ·  view source on GitHub ↗
(
  page: Page,
  fixtureFiles: TestDatasetFileEntry[] = createPsnrFixtureFiles()
)

Source from the content-addressed store, hash-verified

682}
683
684async function prepareWebGpuPsnrApp(
685 page: Page,
686 fixtureFiles: TestDatasetFileEntry[] = createPsnrFixtureFiles()
687): Promise<void> {
688 test.skip(!await page.evaluate(() => Boolean((navigator as Navigator & { gpu?: unknown }).gpu)), 'WebGPU is unavailable');
689
690 const closeButton = page.locator('button:has-text("x"), button:has-text("×")').first();
691 if (await closeButton.isVisible({ timeout: 2_000 })) {
692 await closeButton.click();
693 }
694
695 await loadTestDataset(page, fixtureFiles);
696 await expect(page.locator('text=Source:')).toBeVisible({ timeout: 45_000 });
697 await waitForSceneProbe(page);
698 await switchPointCloudToSplats(page);
699 await waitForWebGpuSplatCanvasVisible(page);
700 await waitForPsnrFrameReady(page);
701 await page.evaluate(async (selectedImageId) => {
702 const api = (window as Window & { __COLMAP_WEBVIEW_E2E__?: ColmapWebViewE2EApi }).__COLMAP_WEBVIEW_E2E__;
703 if (!api) throw new Error('Scene E2E probe is not installed');
704 api.setSelectedImageId(selectedImageId);
705 await api.waitForRenderFrames(6);
706 }, SELECTED_IMAGE_ID);
707}
708
709async function captureSceneCenter(page: Page): Promise<Buffer> {
710 const box = await page.getByTestId('scene-3d').boundingBox();

Callers 1

Calls 7

loadTestDatasetFunction · 0.90
createPsnrFixtureFilesFunction · 0.85
skipMethod · 0.80
waitForSceneProbeFunction · 0.70
switchPointCloudToSplatsFunction · 0.70
waitForPsnrFrameReadyFunction · 0.70

Tested by

no test coverage detected