( imageFile: File, imageName: string )
| 235 | * Useful when user selects or navigates to an image. |
| 236 | */ |
| 237 | export 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. |
no test coverage detected