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

Function getCanvasContext

src/hooks/useMaskedThumbnail.ts:18–20  ·  view source on GitHub ↗
(canvas: ImageCacheCanvas)

Source from the content-addressed store, hash-verified

16type Canvas2DContext = CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
17
18function getCanvasContext(canvas: ImageCacheCanvas): Canvas2DContext | null {
19 return isOffscreenCanvas(canvas) ? canvas.getContext('2d') : canvas.getContext('2d');
20}
21
22function getFileCacheKey(file: File): string {
23 return `${file.name}:${file.size}:${file.lastModified}`;

Callers 1

Calls 2

isOffscreenCanvasFunction · 0.90
getContextMethod · 0.45

Tested by

no test coverage detected