![]() |
1.12 |
Internal image cache. More...
#include <imagecache.h>
Public Member Functions | |
| void | clear () |
| Clear the image cache. | |
| std::shared_ptr< Surface > | get (const std::string &uri, float hscale=1.0, float vscale=1.0, bool approximate=true, bool is_cached=false) |
| Get an image surface. | |
Static Protected Member Functions | |
| static std::string | id (const std::string &name, float hscale, float vscale) |
| static Surface | resize (const Surface &surface, const Size &size) |
| static float | round (float v, float fraction) |
Protected Attributes | |
| std::map< std::string, std::shared_ptr< Surface > > | 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.
| std::shared_ptr< Surface > get | ( | const std::string & | uri, |
| float | hscale = 1.0, |
||
| float | vscale = 1.0, |
||
| bool | approximate = true, |
||
| bool | is_cached = false |
||
| ) |
Get an image surface.
|
staticprotected |
|
staticprotected |
|
protected |