1 #pragma once
2 
3 #include <mbgl/style/color_ramp_property_value.hpp>
4 #include <mbgl/style/properties.hpp>
5 #include <mbgl/style/property_value.hpp>
6 #include <mbgl/style/data_driven_property_value.hpp>
7 #include <mbgl/renderer/property_evaluator.hpp>
8 #include <mbgl/renderer/cross_faded_property_evaluator.hpp>
9 #include <mbgl/renderer/data_driven_property_evaluator.hpp>
10 
11 #include <utility>
12 
13 namespace mbgl {
14 namespace style {
15 
16 template <class T>
17 class PaintProperty {
18 public:
19     using TransitionableType = Transitionable<PropertyValue<T>>;
20     using UnevaluatedType = Transitioning<PropertyValue<T>>;
21     using EvaluatorType = PropertyEvaluator<T>;
22     using PossiblyEvaluatedType = T;
23     using Type = T;
24     static constexpr bool IsDataDriven = false;
25 };
26 
27 template <class T, class A, class U>
28 class DataDrivenPaintProperty {
29 public:
30     using TransitionableType = Transitionable<DataDrivenPropertyValue<T>>;
31     using UnevaluatedType = Transitioning<DataDrivenPropertyValue<T>>;
32     using EvaluatorType = DataDrivenPropertyEvaluator<T>;
33     using PossiblyEvaluatedType = PossiblyEvaluatedPropertyValue<T>;
34     using Type = T;
35     static constexpr bool IsDataDriven = true;
36 
37     using Attribute = A;
38     using Uniform = U;
39 };
40 
41 template <class T>
42 class CrossFadedPaintProperty {
43 public:
44     using TransitionableType = Transitionable<PropertyValue<T>>;
45     using UnevaluatedType = Transitioning<PropertyValue<T>>;
46     using EvaluatorType = CrossFadedPropertyEvaluator<T>;
47     using PossiblyEvaluatedType = Faded<T>;
48     using Type = T;
49     static constexpr bool IsDataDriven = false;
50 };
51 
52 /*
53  * Special-case paint property traits for heatmap-color and line-gradient,
54  * needed because these values do not fit into the
55  * Undefined | Value | {Camera,Source,Composite}Function taxonomy that applies
56  * to all other paint properties.
57  *
58  * These traits are provided here--despite the fact that color ramps
59  * is not used like other paint properties--to allow the parameter-pack-based
60  * batch evaluation of paint properties to compile properly.
61  */
62 class ColorRampProperty {
63 public:
64     using TransitionableType = Transitionable<ColorRampPropertyValue>;
65     using UnevaluatedType = Transitioning<ColorRampPropertyValue>;
66     using EvaluatorType = PropertyEvaluator<Color>;
67     using PossiblyEvaluatedType = Color;
68     using Type = Color;
69     static constexpr bool IsDataDriven = false;
70 
defaultValue()71     static Color defaultValue() { return {}; }
72 };
73 
74 } // namespace style
75 } // namespace mbgl
76