29 #ifndef OPENCPN_SVG_UTILS_H
30 #define OPENCPN_SVG_UTILS_H
32 #include <wx/wxprec.h>
42 #include <unordered_map>
44 #define SVG_IN_TO_PT 72
45 #define SVG_IN_TO_PX 96
46 #define SVG_PT_TO_IN 1 / 72
47 #define SVG_PX_TO_IN 1 / 96
48 #define SVG_PT_TO_PX 96 / 72
49 #define SVG_MM_TO_PX 3.7795275591
50 #define SVG_PX_TO_MM 0.2645833333
51 #define SVG_MM_TO_PT 2.8346456693
52 #define SVG_PT_TO_MM 0.3527777778
53 #define SVG_CM_TO_PX 37.795275591
54 #define SVG_CM_TO_PT 28.346456693
55 #define SVG_MM_TO_IN 25.4
60 wxBitmap LoadSVG(
const wxString filename,
const unsigned int width,
61 const unsigned int height, wxBitmap* default_bitmap = NULL,
62 bool use_cache =
true);
68 bool SVGDocumentPixelSize(
const wxString filename,
unsigned int& width,
69 unsigned int& height);
72 unsigned int SVGPixelsToDisplay(
unsigned int svg_px);
78 wxString cache_directory;
80 std::unordered_map<std::string, wxBitmap> items;
88 void Clear(
bool disk =
true) {
92 std::string MakeKey(wxString file_path,
const int width,
const int height);
94 bool HasKey(
const wxString key);
96 wxBitmap Get(
const wxString key);
98 void Add(
const wxString,
const wxBitmap bmp);