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

Function prioritizeFrustumTexture

src/hooks/useFrustumTexture.ts:237–252  ·  view source on GitHub ↗
(
  imageFile: File,
  imageName: string
)

Source from the content-addressed store, hash-verified

235 * Useful when user selects or navigates to an image.
236 */
237export async function prioritizeFrustumTexture(
238 imageFile: File,
239 imageName: string
240): Promise<THREE.Texture | null> {
241 const bitmap = await loadFrustumBitmapFromFile(imageFile, imageName);
242 if (!bitmap) return null;
243
244 // Check if texture already exists
245 const existing = activeTextures.get(imageName);
246 if (existing) {
247 existing.lastUsed = Date.now();
248 return existing.texture;
249 }
250
251 return createTextureFromBitmap(bitmap, imageName);
252}
253
254/**
255 * Hook to get a frustum texture with caching and optimization.

Callers 1

useImageGalleryViewModelFunction · 0.90

Calls 3

createTextureFromBitmapFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected