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

Function prefetchFrustumTextures

src/hooks/useFrustumTexture.ts:188–204  ·  view source on GitHub ↗
(
  images: Array<{ file: File; name: string }>,
  onProgress?: (progress: number) => void
)

Source from the content-addressed store, hash-verified

186 * This caches resized bitmaps, not actual GPU textures.
187 */
188export async function prefetchFrustumTextures(
189 images: Array<{ file: File; name: string }>,
190 onProgress?: (progress: number) => void
191): Promise<void> {
192 if (images.length === 0) {
193 onProgress?.(1);
194 return;
195 }
196
197 let completed = 0;
198 for (const { file, name } of images) {
199 await loadFrustumBitmapFromFile(file, name);
200 completed++;
201 onProgress?.(completed / images.length);
202 }
203 notifyFrustumTextureCacheChanged();
204}
205
206export interface BackgroundFrustumTexturePrefetchOptions {
207 batchSize?: number;

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected