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

Function buildImageCacheCanvas

src/test/builders/browserFakes.ts:478–495  ·  view source on GitHub ↗
({
  width = 1,
  height = 1,
  getContext,
}: ImageCacheCanvasBuilderOptions = {})

Source from the content-addressed store, hash-verified

476}
477
478export function buildImageCacheCanvas({
479 width = 1,
480 height = 1,
481 getContext,
482}: ImageCacheCanvasBuilderOptions = {}): HTMLCanvasElement {
483 const canvas = document.createElement('canvas');
484 canvas.width = width;
485 canvas.height = height;
486
487 if (getContext) {
488 Object.defineProperty(canvas, 'getContext', {
489 configurable: true,
490 value: getContext,
491 });
492 }
493
494 return canvas;
495}
496
497export function buildCanvas2dContext({
498 drawImage = () => undefined,

Callers 10

createOptionsFunction · 0.90
createOptionsFunction · 0.90
createBaseOptionsFunction · 0.90
builders.test.tsFile · 0.85
buildCaptureStreamCanvasFunction · 0.85
buildRecordingRendererFunction · 0.85

Calls

no outgoing calls

Tested by 3

createOptionsFunction · 0.72
createOptionsFunction · 0.72
createBaseOptionsFunction · 0.72