Lysa  0.0
Lysa 3D Engine
ImageManager Class Referenceabstract

Detailed Description

Loads, caches, and destroys GPU images.

Lua full name: lysa.ImageManager

Public Member Functions

Image load (path: string)
 Loads an image from the given virtual path and uploads it to the GPU. More...
 
nil save (img: Image, path: string)
 Saves an image to disk at the given virtual path. More...
 
Image get (id: integer)
 Returns the image with the given id. More...
 
Image get (name: string)
 Returns the image with the given name; raises an exception if not found. More...
 
boolean contains (name: string)
 Returns true if an image with the given name exists. More...
 
nil destroy (id: integer)
 Destroys the image with the given id and releases its GPU memory. More...
 
nil destroy (img: Image)
 Destroys the given image and releases its GPU memory. More...
 
nil destroy (ids: integer[])
 Destroys all images in the list and releases their GPU memory. More...
 

Properties

Image blank_image
 1×1 white RGBA image usable as a no-texture placeholder. (read-only)
 
Image blank_cube_map
 1×1 white cube-map usable as a no-texture placeholder. (read-only)
 
table<integer, images
 lysa.Image> All loaded images keyed by id. (read-only)
 

Member Function Documentation

Image load ( string  path)

Loads an image from the given virtual path and uploads it to the GPU.

Parameters
pathstring
Returns
Image
nil save ( Image  img,
string  path)

Saves an image to disk at the given virtual path.

Parameters
imgImage
pathstring
Image get ( integer  id)

Returns the image with the given id.

Parameters
idinteger
Returns
Image
Image get ( string  name)

Returns the image with the given name; raises an exception if not found.

Parameters
namestring
Returns
Image
boolean contains ( string  name)

Returns true if an image with the given name exists.

Parameters
namestring
Returns
boolean
nil destroy ( integer  id)

Destroys the image with the given id and releases its GPU memory.

Parameters
idinteger
nil destroy ( Image  img)

Destroys the given image and releases its GPU memory.

Parameters
imgImage
nil destroy ( integer[]  ids)

Destroys all images in the list and releases their GPU memory.

Parameters
idsinteger[]

Property Documentation

Image blank_image

1×1 white RGBA image usable as a no-texture placeholder. (read-only)

Image blank_cube_map

1×1 white cube-map usable as a no-texture placeholder. (read-only)

table<integer, images

lysa.Image> All loaded images keyed by id. (read-only)