#ifndef LLMR_STYLE_STYLE #define LLMR_STYLE_STYLE #include #include #include #include "../util/pbf.hpp" #include "value.hpp" #include "properties.hpp" #include "bucket_description.hpp" #include "layer_description.hpp" #include "class_description.hpp" namespace llmr { class Style { public: Style(); void reset(); void load(const uint8_t *const data, uint32_t bytes); void cascade(float z); private: static std::pair parseBucket(pbf data); static LayerDescription parseLayer(pbf data); static std::pair parseClass(pbf data); static std::pair parseFillClass(pbf data); static std::pair parseStrokeClass(pbf data); template static FunctionProperty parseProperty(pbf data); static Color parseColor(pbf& data); public: // This is static information parsed from the stylesheet. std::map buckets; std::vector layers; std::map classes; // This are applied settings. std::set appliedClasses; struct { std::map fills; std::map strokes; } computed; }; } #endif