blob: aea90dfbddbee705cfce89178ba5c5a26a4b1f6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
|