parse the json stylesheet

This commit is contained in:
Konstantin Käfer
2014-03-12 11:23:01 +01:00
parent 60229ed7db
commit 91d42911fb
12 changed files with 301 additions and 674 deletions

View File

@@ -10,6 +10,7 @@ namespace llmr {
class ClassDescription {
public:
BackgroundClass background;
std::map<std::string, FillClass> fill;
std::map<std::string, LineClass> line;
std::map<std::string, PointClass> point;

View File

@@ -112,6 +112,10 @@ struct FillProperties {
std::string image;
};
struct BackgroundClass {
Color fill_color = {{ 0, 0, 0, 0 }};
};
}
#endif

View File

@@ -18,15 +18,15 @@ namespace llmr {
class Sprite;
class Style {
public:
struct exception : std::runtime_error { exception(const char *msg) : std::runtime_error(msg) {} };
public:
Style();
void reset();
void load(const uint8_t *const data, size_t bytes);
// This is commented out because it is not fully implemented yet. For now,
// we keep using the protobuf stylesheet format
// void loadJSON(const std::string& data);
void loadJSON(const uint8_t *const data, size_t bytes);
void cascade(float z);