 |
wxMaxima
|
Go to the documentation of this file.
34 #include <wx/bitmap.h>
35 #define NANOSVG_ALL_COLOR_KEYWORDS
36 #include "nanoSVG/nanosvg.h"
37 #include "nanoSVG/nanosvgrast.h"
45 SvgBitmap(
const unsigned char *data,
size_t len,
int width = 640,
int height = 480,
int scaleFactor = 1);
46 SvgBitmap(
const unsigned char *data,
size_t len, wxSize siz,
int scaleFactor = 1);
52 static wxBitmap
RGBA2wxBitmap(
const unsigned char imgdata[],
const int &width,
const int &height,
const int &scaleFactor = 1);
59 {
return m_svgImage ? wxSize(m_svgImage->width, m_svgImage->height) : wxDefaultSize; }
73 static struct NSVGrasterizer* m_svgRast;
75 std::unique_ptr<
NSVGimage, decltype(std::free)*> m_svgImage{
nullptr, std::free};
const SvgBitmap & SetSize(wxSize siz)
Sets the bitmap to a new size and renders the svg image at this size.
Definition: SvgBitmap.h:56
wxSize GetOriginalSize() const
Gets the original size of the svg image.
Definition: SvgBitmap.h:58
static wxBitmap GetInvalidBitmap(int targetSize)
Definition: SvgBitmap.cpp:121
SvgBitmap(const unsigned char *data, size_t len, int width=640, int height=480, int scaleFactor=1)
A constructor that loads the data into a wxBitmap.
Definition: SvgBitmap.cpp:36
static wxBitmap RGBA2wxBitmap(const unsigned char imgdata[], const int &width, const int &height, const int &scaleFactor=1)
Converts rgba data to a wxBitmap.
Definition: SvgBitmap.cpp:130
Definition: SvgBitmap.h:41
const SvgBitmap & SetSize(int width, int height)
Sets the bitmap to a new size and renders the svg image at this size.
Definition: SvgBitmap.cpp:70
Definition: nanosvg.h:158