diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-07-16 18:53:56 -0700 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-07-16 18:53:56 -0700 |
commit | 4ea281c750c5afcc68f2832bb42d98a1cbce6735 (patch) | |
tree | 60bc7d3ccba2c54859e2e023997cc027cc67aea7 /include/mbgl/style/rasterize_properties.hpp | |
parent | c1a64dc5fa73b54cc5de77629781dfc74302a1e7 (diff) | |
download | qtlocation-mapboxgl-4ea281c750c5afcc68f2832bb42d98a1cbce6735.tar.gz |
rename llmr => mbgl
Diffstat (limited to 'include/mbgl/style/rasterize_properties.hpp')
-rw-r--r-- | include/mbgl/style/rasterize_properties.hpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/include/mbgl/style/rasterize_properties.hpp b/include/mbgl/style/rasterize_properties.hpp new file mode 100644 index 0000000000..aea90dfbdd --- /dev/null +++ b/include/mbgl/style/rasterize_properties.hpp @@ -0,0 +1,38 @@ +#ifndef MBGL_STYLE_RASTERIZE_PROPERTIES +#define MBGL_STYLE_RASTERIZE_PROPERTIES + +#include <mbgl/style/function_properties.hpp> + +namespace mbgl { + +// The calculated properties for a layer in a tile. +class RasterizedProperties { +public: + float buffer = 1.0f / 32.0f; + uint16_t size = 256; + uint8_t blur = 0; +}; + +class RasterizeProperties { +public: + Function<bool> enabled = ConstantFunction<bool>(false); + Function<float> buffer = ConstantFunction<float>(1.0f / 32.0f); + Function<float> size = ConstantFunction<float>(256); + Function<float> blur = ConstantFunction<float>(0); + + inline bool isEnabled(const int8_t z) const { + return util::apply_visitor(FunctionEvaluator<bool>(z), enabled); + } + + inline RasterizedProperties get(const int8_t z) const { + RasterizedProperties properties; + properties.buffer = util::apply_visitor(FunctionEvaluator<float>(z), buffer); + properties.size = util::apply_visitor(FunctionEvaluator<float>(z), size); + properties.blur = util::apply_visitor(FunctionEvaluator<float>(z), blur); + return properties; + } +}; + +} + +#endif |