Class ImageCache

Class Documentation

class legion::core::ImageCache

Data cache for loading, storing and managing raw images.

Public Static Functions

static image_handle create_image(const std::string &name, const filesystem::view &file, image_import_settings settings = default_image_settings)

Create a new image and load it from a file if a image with the same name doesn’t exist yet.

Return

image_handle A valid handle to the newly created image if it succeeds, invalid_image_handle if it fails.

Parameters
  • name: Identifying name for the image.

  • file: File to load from.

  • settings: Settings to pass on to the import pipeline.

static image_handle create_image(const filesystem::view &file, image_import_settings settings = default_image_settings)
static image_handle insert_image(image &&img)
static image_handle get_handle(const std::string &name)

Returns a handle to a image with a certain name. Will return invalid_image_handle if the requested image doesn’t exist.

static image_handle get_handle(id_type id)

Returns a handle to a image with a certain name. Will return invalid_image_handle if the requested image doesn’t exist.

Parameters
  • id: Name hash

static void destroy_image(const std::string &name)
static void destroy_image(id_type id)