diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2015-06-15 18:30:39 -0700 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2015-06-15 18:30:39 -0700 |
commit | bd0bf294bf1e350b184e54a824430c911dd66b9b (patch) | |
tree | d7c643cf197a8263fb1880ce73d034da253efe4c /src/mbgl/style/style_properties.hpp | |
parent | e75e538ddbb1dad0baad02576df86f6b8eb1510f (diff) | |
download | qtlocation-mapboxgl-bd0bf294bf1e350b184e54a824430c911dd66b9b.tar.gz |
squash of #1655: shape annotations support for core & iOS
Diffstat (limited to 'src/mbgl/style/style_properties.hpp')
-rw-r--r-- | src/mbgl/style/style_properties.hpp | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/src/mbgl/style/style_properties.hpp b/src/mbgl/style/style_properties.hpp deleted file mode 100644 index 8e8619fb99..0000000000 --- a/src/mbgl/style/style_properties.hpp +++ /dev/null @@ -1,115 +0,0 @@ -#ifndef MBGL_STYLE_STYLE_PROPERTIES -#define MBGL_STYLE_STYLE_PROPERTIES - -#include <mbgl/util/variant.hpp> -#include <mbgl/style/types.hpp> -#include <mbgl/style/piecewisefunction_properties.hpp> - -#include <array> -#include <string> -#include <type_traits> -#include <memory> -#include <vector> - -namespace mbgl { - -struct FillProperties { - FillProperties() {} - bool antialias = true; - float opacity = 1.0f; - Color fill_color = {{ 0, 0, 0, 1 }}; - Color stroke_color = {{ 0, 0, 0, -1 }}; - std::array<float, 2> translate = {{ 0, 0 }}; - TranslateAnchorType translateAnchor = TranslateAnchorType::Map; - Faded<std::string> image; - - inline bool isVisible() const { - return opacity > 0 && (fill_color[3] > 0 || stroke_color[3] > 0); - } -}; - -struct LineProperties { - inline LineProperties() {} - float opacity = 1.0f; - Color color = {{ 0, 0, 0, 1 }}; - std::array<float, 2> translate = {{ 0, 0 }}; - TranslateAnchorType translateAnchor = TranslateAnchorType::Map; - float width = 1; - float gap_width = 0; - float blur = 0; - Faded<std::vector<float>> dash_array; - float dash_line_width = 1; - Faded<std::string> image; - - inline bool isVisible() const { - return opacity > 0 && color[3] > 0 && width > 0; - } -}; - -struct SymbolProperties { - inline SymbolProperties() {} - - struct { - float opacity = 1.0f; - float size = 1.0f; - Color color = {{ 0, 0, 0, 1 }}; - Color halo_color = {{ 0, 0, 0, 0 }}; - float halo_width = 0.0f; - float halo_blur = 0.0f; - std::array<float, 2> translate = {{ 0, 0 }}; - TranslateAnchorType translate_anchor = TranslateAnchorType::Map; - } icon; - - struct { - float opacity = 1.0f; - float size = 16.0f; - Color color = {{ 0, 0, 0, 1 }}; - Color halo_color = {{ 0, 0, 0, 0 }}; - float halo_width = 0.0f; - float halo_blur = 0.0f; - std::array<float, 2> translate = {{ 0, 0 }}; - TranslateAnchorType translate_anchor = TranslateAnchorType::Map; - } text; - - inline bool isVisible() const { - return (icon.opacity > 0 && (icon.color[3] > 0 || icon.halo_color[3] > 0) && icon.size > 0) || - (text.opacity > 0 && (text.color[3] > 0 || text.halo_color[3] > 0) && text.size > 0); - } -}; - -struct RasterProperties { - inline RasterProperties() {} - float opacity = 1.0f; - float hue_rotate = 0.0f; - std::array<float, 2> brightness = {{ 0, 1 }}; - float saturation = 0.0f; - float contrast = 0.0f; - float fade = 0.0f; - - inline bool isVisible() const { - return opacity > 0; - } -}; - -struct BackgroundProperties { - inline BackgroundProperties() {} - float opacity = 1.0f; - Color color = {{ 0, 0, 0, 1 }}; - Faded<std::string> image; -}; - -typedef mapbox::util::variant< - FillProperties, - LineProperties, - SymbolProperties, - RasterProperties, - BackgroundProperties, - std::false_type -> StyleProperties; - -template <typename T> -const T &defaultStyleProperties(); - -} - -#endif |