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

Function createBitmapDeferred

src/hooks/useFrustumTexture.test.ts:224–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

222}
223
224function createBitmapDeferred(): {
225 promise: Promise<ImageBitmap>;
226 resolve: (bitmap: ImageBitmap) => void;
227} {
228 let resolveBitmap: ((bitmap: ImageBitmap) => void) | null = null;
229 const promise = new Promise<ImageBitmap>((resolve) => {
230 resolveBitmap = resolve;
231 });
232
233 return {
234 promise,
235 resolve: (bitmap) => {
236 resolveBitmap?.(bitmap);
237 },
238 };
239}
240
241function installCanvasToBlob(): () => void {
242 const originalToBlob = Object.getOwnPropertyDescriptor(HTMLCanvasElement.prototype, 'toBlob');

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected