sf-svg
|
C++-styled cstyle::ImageStruct wrapper. More...
#include <Image.hpp>
Public Member Functions | |
Image () | |
Default constructor. More... | |
Image (const Image &image) | |
Copy constructor. More... | |
Image & | operator= (const Image &image) |
Assignment operator. More... | |
bool | loadFromFile (const std::string &filename, const std::string &units, const float dpi=96.f) |
Parses SVG from file. More... | |
bool | loadFromMemory (std::string input, const std::string &units, const float dpi=96.f) |
Parses SVG from memory. More... | |
cstyle::ImageStruct * | getInternalImage () |
Get internal image. More... | |
ShapeVector | getShapes () |
Get shape vector. More... | |
sf::Vector2f | getSize () const |
Get size. More... | |
~Image () | |
Destructor. More... | |
C++-styled cstyle::ImageStruct wrapper.
Provides object orientated interface for C-style nsvg::cstyle::ImageStruct.
nsvg::Image::Image | ( | ) |
Default constructor.
Does nothing;
nsvg::Image::Image | ( | const Image & | image | ) |
Copy constructor.
Protects from double-free error afrer assigning.
nsvg::Image::~Image | ( | ) |
Destructor.
Releases resources if any were allocated
cstyle::ImageStruct * nsvg::Image::getInternalImage | ( | ) |
Get internal image.
ShapeVector nsvg::Image::getShapes | ( | ) |
Get shape vector.
sf::Vector2f nsvg::Image::getSize | ( | ) | const |
Get size.
bool nsvg::Image::loadFromFile | ( | const std::string & | filename, |
const std::string & | units, | ||
const float | dpi = 96.f |
||
) |
Parses SVG from file.
[in] | filename | – path to file |
[in] | units | – passed to nanosvg |
[in] | dpi | – passed to nanosvg |
bool nsvg::Image::loadFromMemory | ( | std::string | input, |
const std::string & | units, | ||
const float | dpi = 96.f |
||
) |
Parses SVG from memory.
[in] | input | – null-terminated data |
[in] | units | – passed to nanosvg |
[in] | dpi | – passed to nanosvg |
Assignment operator.
Protects from double-free error afrer assigning.