26#ifndef OPENCPN_SVG_UTILS_H
27#define OPENCPN_SVG_UTILS_H
37#include <unordered_map>
46wxBitmap
LoadSVG(
const wxString filename,
const unsigned int width,
47 const unsigned int height, wxBitmap* default_bitmap = NULL,
48 bool use_cache =
true);
57 unsigned int& height);
67wxBitmap
LoadSvgStdIcon(
const std::string& svg_file,
const wxWindow* w,
80 void Clear(
bool disk =
true) {
84 std::string MakeKey(wxString file_path,
const int width,
const int height);
86 bool HasKey(
const wxString key);
88 wxBitmap Get(
const wxString key);
90 void Add(
const wxString,
const wxBitmap bmp);
94 wxString cache_directory;
96 std::unordered_map<std::string, wxBitmap> items;
Manage memory and disk cache for rendered bitmaps.
wxBitmap LoadSVG(const wxString filename, const unsigned int width, const unsigned int height, wxBitmap *default_bitmap=NULL, bool use_cache=true)
Load SVG file and return it's bitmap representation of requested size In case file can't be loaded an...
wxBitmap LoadSvgStdIcon(const std::string &svg_file, const wxWindow *w, bool touch)
Load an svg icon from standard path, roughly scaled to the height of a char.
bool SVGDocumentPixelSize(const wxString filename, unsigned int &width, unsigned int &height)
Return the size of the SVG document in standard 96 DPI pixels https://developer.mozilla....
unsigned int SVGPixelsToDisplay(unsigned int svg_px)
Recalculate the length in standard 96 DPI pixels to actual display pixels.