Returns the number of all cached ImageItems.
Returns the singleton instance
of the ImageCache
.
Clear all ImageItems belonging to an owner.
specify to remove all items registered by {@link any}.
Number of images removed.
Add an image definition to the global cache. Useful when the image data is already loaded.
Specify which {@link any} requests the image.
URL of image.
Optional TexturizableImage.
Remove an image from the cache..
URL of the image.
Owner removing the image.
true
if image has been removed.
Dispose the singleton object.
Generated using TypeDoc
ImageCache
is a singleton, so it can be used with multiple owners on a single page.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
ImageCache
can be improved by adding statistics for memory footprint as well.