1.10 |
Internal image cache. More...
#include <imagecache.h>
Public Member Functions | |
void | clear () |
Clear the image cache. | |
shared_cairo_surface_t | get (const std::string &uri, float hscale=1.0, float vscale=1.0, bool approximate=true) |
Get an image surface. | |
Static Public Member Functions | |
static shared_cairo_surface_t | scale_surface (const shared_cairo_surface_t &old_surface, float old_width, float old_height, float new_width, float new_height) |
Static Protected Member Functions | |
static std::string | id (const std::string &name, float hscale, float vscale) |
static float | round (float v, float fraction) |
Protected Attributes | |
std::map< std::string, shared_cairo_surface_t > | m_cache |
Internal image cache.
Provides an in-memory cache for images based on name and scale. This prevents multiple attempts at loading the same file as well as re-scaling the image to the same scale multiple times.
This is a trade off in consuming more memory instead of possibly constantly reloading or scaling the same image.
void clear | ( | ) |
Clear the image cache.
shared_cairo_surface_t get | ( | const std::string & | uri, |
float | hscale = 1.0 , |
||
float | vscale = 1.0 , |
||
bool | approximate = true |
||
) |
Get an image surface.
|
staticprotected |
|
staticprotected |
|
static |
|
protected |