sf-svg
Image.hpp
Go to the documentation of this file.
1 /* ====================================================== *
2  * nanosvg++ *
3  * This software is a fork of nanosvg (nanosvgrastr.hpp). *
4  * No license-related aspects are affected. *
5  * Kamil Koczurek | koczurekk@gmail.com *
6  * ====================================================== */
11 
12 #ifndef IMAGE_HPP
13 #define IMAGE_HPP
14 
15 #include <SFML/System/Vector2.hpp>
16 #include <iostream>
17 #include <string>
18 
19 #include "nanosvg.hpp"
20 #include "Shape.hpp"
21 
22 namespace nsvg {
28  class Image {
29  cstyle::ImageStruct* internal = nullptr;
30 
31  public:
35  Image();
36 
40  Image(const Image& image);
41 
45  Image& operator =(const Image& image);
46 
54  bool loadFromFile(const std::string& filename, const std::string& units, const float dpi = 96.f);
55 
63  bool loadFromMemory(std::string input, const std::string& units, const float dpi = 96.f);
64 
69 
74 
78  sf::Vector2f getSize() const;
79 
83  ~Image();
84  };
85 }
86 
87 #endif // IMAGE_HPP
C++-styled cstyle::ImageStruct wrapper.
Definition: Image.hpp:28
Vector of shapes.
Definition: Shape.hpp:130
sf::Vector2f getSize() const
Get size.
Definition: Image.cpp:65
~Image()
Destructor.
Definition: Image.cpp:72
bool loadFromMemory(std::string input, const std::string &units, const float dpi=96.f)
Parses SVG from memory.
Definition: Image.cpp:42
Image & operator=(const Image &image)
Assignment operator.
Definition: Image.cpp:22
Nanosvg++ namespace.
Definition: enums.hpp:15
cstyle::ImageStruct * getInternalImage()
Get internal image.
Definition: Image.cpp:57
Nanosvg++ declarations.
Shape class declaration.
ShapeVector getShapes()
Get shape vector.
Definition: Image.cpp:61
Image()
Default constructor.
Definition: Image.cpp:15
bool loadFromFile(const std::string &filename, const std::string &units, const float dpi=96.f)
Parses SVG from file.
Definition: Image.cpp:27
Definition: nanosvg.hpp:122