diff options
Diffstat (limited to 'src/mbgl/style/layers/symbol_layer_impl.hpp')
-rw-r--r-- | src/mbgl/style/layers/symbol_layer_impl.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mbgl/style/layers/symbol_layer_impl.hpp b/src/mbgl/style/layers/symbol_layer_impl.hpp index fe37ba86ea..b760538f86 100644 --- a/src/mbgl/style/layers/symbol_layer_impl.hpp +++ b/src/mbgl/style/layers/symbol_layer_impl.hpp @@ -11,6 +11,36 @@ class SymbolLayout; namespace style { +// Repackaging evaluated values from SymbolLayoutProperties + SymbolPaintProperties +// for genericity over icons vs. text. +class SymbolPropertyValues { +public: + // Layout + AlignmentType pitchAlignment; + AlignmentType rotationAlignment; + float layoutSize; + + // Paint + float opacity; + Color color; + Color haloColor; + float haloWidth; + float haloBlur; + std::array<float, 2> translate; + TranslateAnchorType translateAnchor; + float paintSize; + + float sdfScale; // Constant (1.0 or 24.0) + + bool hasHalo() const { + return haloColor.a > 0.0f && haloWidth > 0.0f; + } + + bool hasForeground() const { + return color.a > 0.0f; + } +}; + class SymbolLayer::Impl : public Layer::Impl { public: std::unique_ptr<Layer> clone() const override; @@ -22,6 +52,9 @@ public: std::unique_ptr<Bucket> createBucket(BucketParameters&) const override; std::unique_ptr<SymbolLayout> createLayout(BucketParameters&) const; + SymbolPropertyValues iconPropertyValues(const SymbolLayoutProperties&) const; + SymbolPropertyValues textPropertyValues(const SymbolLayoutProperties&) const; + SymbolLayoutProperties layout; SymbolPaintProperties paint; |