1 #pragma once 2 3 #include <mbgl/style/light.hpp> 4 #include <mbgl/style/property_value.hpp> 5 #include <mbgl/style/types.hpp> 6 #include <mbgl/style/position.hpp> 7 #include <mbgl/style/properties.hpp> 8 #include <mbgl/renderer/property_evaluator.hpp> 9 #include <mbgl/util/color.hpp> 10 #include <mbgl/util/indexed_tuple.hpp> 11 12 namespace mbgl { 13 namespace style { 14 15 template <class T> 16 class LightProperty { 17 public: 18 using TransitionableType = Transitionable<PropertyValue<T>>; 19 using UnevaluatedType = Transitioning<PropertyValue<T>>; 20 using EvaluatorType = PropertyEvaluator<T>; 21 using PossiblyEvaluatedType = T; 22 using Type = T; 23 static constexpr bool IsDataDriven = false; 24 }; 25 26 struct LightAnchor : LightProperty<LightAnchorType> { defaultValuembgl::style::LightAnchor27 static LightAnchorType defaultValue() { 28 return LightAnchorType::Viewport; 29 } 30 }; 31 32 struct LightPosition : LightProperty<Position> { defaultValuembgl::style::LightPosition33 static Position defaultValue() { 34 std::array<float, 3> default_ = { { 1.15, 210, 30 } }; 35 return Position{ { default_ } }; 36 } 37 }; 38 39 struct LightColor : LightProperty<Color> { defaultValuembgl::style::LightColor40 static Color defaultValue() { 41 return Color::white(); 42 } 43 }; 44 45 struct LightIntensity : LightProperty<float> { defaultValuembgl::style::LightIntensity46 static float defaultValue() { 47 return 0.5; 48 } 49 }; 50 51 using LightProperties = Properties<LightAnchor, LightPosition, LightColor, LightIntensity>; 52 53 class Light::Impl { 54 public: 55 LightProperties::Transitionable properties; 56 }; 57 58 } // namespace style 59 } // namespace mbgl 60