6#ifndef EGT_DETAIL_IMAGECACHE_H
7#define EGT_DETAIL_IMAGECACHE_H
9#include <egt/detail/meta.h>
10#include <egt/painter.h>
40 float hscale = 1.0,
float vscale = 1.0,
41 bool approximate =
true);
49 float old_width,
float old_height,
50 float new_width,
float new_height);
54 static float round(
float v,
float fraction);
56 static std::string
id(
const std::string& name,
float hscale,
float vscale);
58 std::map<std::string, shared_cairo_surface_t>
m_cache;
Internal image cache.
Definition imagecache.h:33
static float round(float v, float fraction)
static std::string id(const std::string &name, float hscale, float vscale)
std::map< std::string, shared_cairo_surface_t > m_cache
Definition imagecache.h:58
shared_cairo_surface_t get(const std::string &uri, float hscale=1.0, float vscale=1.0, bool approximate=true)
Get an image surface.
void clear()
Clear the image cache.
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)
EGT_API ImageCache & image_cache()
Global image cache instance.
std::shared_ptr< cairo_surface_t > shared_cairo_surface_t
Shared pointer for a cairo surface.
Definition types.h:29
EGT framework namespace.
Definition animation.h:24