Internal Returns the number of all cached ImageItems.
Static instanceReturns the singleton instance of the ImageCache.
Clear all ImageItems belonging to an owner.
specify to remove all items registered by any.
Number of images removed.
May remove cached items if no owner is registered anymore.
Add an image definition to the global cache. Useful when the image data is already loaded.
Specify which any requests the image.
URL of image.
Optional image: TexturizableImageOptional TexturizableImage.
Static disposeGenerated using TypeDoc
ImageCacheis a singleton, so it can be used with multiple owners on a single page.Remarks
This allows to have an image loaded only once for multiple views. THREE is doing something similar, but does not allow to share images that have been loaded from a canvas (which we may need to do if we use SVG images for textures).
One application that makes our own cache necessary is the generation of our own textures from data that is not an URL.
The
ImageCachecan be improved by adding statistics for memory footprint as well.