Class ImageCacheInternal

ImageCache is 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 ImageCache can be improved by adding statistics for memory footprint as well.

Hierarchy

  • ImageCache

Constructors

Accessors

Methods

  • Clear all ImageItems belonging to an owner.

    Parameters

    • owner: any

      specify to remove all items registered by any.

    Returns void

    Number of images removed.

    Remarks

    May remove cached items if no owner is registered anymore.

  • Remove an image from the cache..

    Parameters

    • url: string

      URL of the image.

    • owner: any

      Owner removing the image.

    Returns boolean

    true if image has been removed.

Generated using TypeDoc