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
12namespace mbgl {
13namespace style {
14
15template <class T>
16class LightProperty {
17public:
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
26struct LightAnchor : LightProperty<LightAnchorType> {
27 static LightAnchorType defaultValue() {
28 return LightAnchorType::Viewport;
29 }
30};
31
32struct LightPosition : LightProperty<Position> {
33 static Position defaultValue() {
34 std::array<float, 3> default_ = { ._M_elems: { 1.15, 210, 30 } };
35 return Position{ { default_ } };
36 }
37};
38
39struct LightColor : LightProperty<Color> {
40 static Color defaultValue() {
41 return Color::white();
42 }
43};
44
45struct LightIntensity : LightProperty<float> {
46 static float defaultValue() {
47 return 0.5;
48 }
49};
50
51using LightProperties = Properties<LightAnchor, LightPosition, LightColor, LightIntensity>;
52
53class Light::Impl {
54public:
55 LightProperties::Transitionable properties;
56};
57
58} // namespace style
59} // namespace mbgl
60

source code of qtlocation/src/3rdparty/mapbox-gl-native/src/mbgl/style/light_impl.hpp