24#ifndef OPENCPN_SVG_UTILS_H
25#define OPENCPN_SVG_UTILS_H
35#include <unordered_map>
44wxBitmap
LoadSVG(
const wxString filename,
const unsigned int width,
45 const unsigned int height, wxBitmap* default_bitmap = NULL,
46 bool use_cache =
true);
55 unsigned int& height);
65wxBitmap
LoadSvgStdIcon(
const std::string& svg_file,
const wxWindow* w,
78 void Clear(
bool disk =
true) {
82 std::string MakeKey(wxString file_path,
const int width,
const int height);
84 bool HasKey(
const wxString key);
86 wxBitmap Get(
const wxString key);
88 void Add(
const wxString,
const wxBitmap bmp);
92 wxString cache_directory;
94 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.