blob: 36b2e3e027172c2527a26509d03b7291c43e5220 (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
|
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
#include <mbgl/style/layers/raster_layer.hpp>
#include <mbgl/style/layers/raster_layer_impl.hpp>
#include <mbgl/style/layer_observer.hpp>
namespace mbgl {
namespace style {
RasterLayer::RasterLayer(const std::string& layerID, const std::string& sourceID)
: Layer(makeMutable<Impl>(LayerType::Raster, layerID, sourceID)) {
}
RasterLayer::RasterLayer(Immutable<Impl> impl_)
: Layer(std::move(impl_)) {
}
RasterLayer::~RasterLayer() = default;
const RasterLayer::Impl& RasterLayer::impl() const {
return static_cast<const Impl&>(*baseImpl);
}
Mutable<RasterLayer::Impl> RasterLayer::mutableImpl() const {
return makeMutable<Impl>(impl());
}
std::unique_ptr<Layer> RasterLayer::cloneRef(const std::string& id_) const {
auto impl_ = mutableImpl();
impl_->id = id_;
impl_->paint = RasterPaintProperties::Transitionable();
return std::make_unique<RasterLayer>(std::move(impl_));
}
void RasterLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const {
}
// Source
const std::string& RasterLayer::getSourceID() const {
return impl().source;
}
// Visibility
void RasterLayer::setVisibility(VisibilityType value) {
if (value == getVisibility())
return;
auto impl_ = mutableImpl();
impl_->visibility = value;
baseImpl = std::move(impl_);
observer->onLayerChanged(*this);
}
// Zoom range
void RasterLayer::setMinZoom(float minZoom) {
auto impl_ = mutableImpl();
impl_->minZoom = minZoom;
baseImpl = std::move(impl_);
observer->onLayerChanged(*this);
}
void RasterLayer::setMaxZoom(float maxZoom) {
auto impl_ = mutableImpl();
impl_->maxZoom = maxZoom;
baseImpl = std::move(impl_);
observer->onLayerChanged(*this);
}
// Layout properties
// Paint properties
PropertyValue<float> RasterLayer::getDefaultRasterOpacity() {
return { 1 };
}
PropertyValue<float> RasterLayer::getRasterOpacity() const {
return impl().paint.template get<RasterOpacity>().value;
}
void RasterLayer::setRasterOpacity(PropertyValue<float> value) {
if (value == getRasterOpacity())
return;
auto impl_ = mutableImpl();
impl_->paint.template get<RasterOpacity>().value = value;
baseImpl = std::move(impl_);
observer->onLayerChanged(*this);
}
void RasterLayer::setRasterOpacityTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
impl_->paint.template get<RasterOpacity>().options = options;
baseImpl = std::move(impl_);
}
TransitionOptions RasterLayer::getRasterOpacityTransition() const {
return impl().paint.template get<RasterOpacity>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterHueRotate() {
return { 0 };
}
PropertyValue<float> RasterLayer::getRasterHueRotate() const {
return impl().paint.template get<RasterHueRotate>().value;
}
void RasterLayer::setRasterHueRotate(PropertyValue<float> value) {
if (value == getRasterHueRotate())
return;
auto impl_ = mutableImpl();
impl_->paint.template get<RasterHueRotate>().value = value;
baseImpl = std::move(impl_);
observer->onLayerChanged(*this);
}
void RasterLayer::setRasterHueRotateTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
impl_->paint.template get<RasterHueRotate>().options = options;
baseImpl = std::move(impl_);
}
TransitionOptions RasterLayer::getRasterHueRotateTransition() const {
return impl().paint.template get<RasterHueRotate>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMin() {
return { 0 };
}
PropertyValue<float> RasterLayer::getRasterBrightnessMin() const {
return impl().paint.template get<RasterBrightnessMin>().value;
}
void RasterLayer::setRasterBrightnessMin(PropertyValue<float> value) {
if (value == getRasterBrightnessMin())
return;
auto impl_ = mutableImpl();
impl_->paint.template get<RasterBrightnessMin>().value = value;
baseImpl = std::move(impl_);
observer->onLayerChanged(*this);
}
void RasterLayer::setRasterBrightnessMinTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
impl_->paint.template get<RasterBrightnessMin>().options = options;
baseImpl = std::move(impl_);
}
TransitionOptions RasterLayer::getRasterBrightnessMinTransition() const {
return impl().paint.template get<RasterBrightnessMin>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMax() {
return { 1 };
}
PropertyValue<float> RasterLayer::getRasterBrightnessMax() const {
return impl().paint.template get<RasterBrightnessMax>().value;
}
void RasterLayer::setRasterBrightnessMax(PropertyValue<float> value) {
if (value == getRasterBrightnessMax())
return;
auto impl_ = mutableImpl();
impl_->paint.template get<RasterBrightnessMax>().value = value;
baseImpl = std::move(impl_);
observer->onLayerChanged(*this);
}
void RasterLayer::setRasterBrightnessMaxTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
impl_->paint.template get<RasterBrightnessMax>().options = options;
baseImpl = std::move(impl_);
}
TransitionOptions RasterLayer::getRasterBrightnessMaxTransition() const {
return impl().paint.template get<RasterBrightnessMax>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterSaturation() {
return { 0 };
}
PropertyValue<float> RasterLayer::getRasterSaturation() const {
return impl().paint.template get<RasterSaturation>().value;
}
void RasterLayer::setRasterSaturation(PropertyValue<float> value) {
if (value == getRasterSaturation())
return;
auto impl_ = mutableImpl();
impl_->paint.template get<RasterSaturation>().value = value;
baseImpl = std::move(impl_);
observer->onLayerChanged(*this);
}
void RasterLayer::setRasterSaturationTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
impl_->paint.template get<RasterSaturation>().options = options;
baseImpl = std::move(impl_);
}
TransitionOptions RasterLayer::getRasterSaturationTransition() const {
return impl().paint.template get<RasterSaturation>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterContrast() {
return { 0 };
}
PropertyValue<float> RasterLayer::getRasterContrast() const {
return impl().paint.template get<RasterContrast>().value;
}
void RasterLayer::setRasterContrast(PropertyValue<float> value) {
if (value == getRasterContrast())
return;
auto impl_ = mutableImpl();
impl_->paint.template get<RasterContrast>().value = value;
baseImpl = std::move(impl_);
observer->onLayerChanged(*this);
}
void RasterLayer::setRasterContrastTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
impl_->paint.template get<RasterContrast>().options = options;
baseImpl = std::move(impl_);
}
TransitionOptions RasterLayer::getRasterContrastTransition() const {
return impl().paint.template get<RasterContrast>().options;
}
PropertyValue<float> RasterLayer::getDefaultRasterFadeDuration() {
return { 300 };
}
PropertyValue<float> RasterLayer::getRasterFadeDuration() const {
return impl().paint.template get<RasterFadeDuration>().value;
}
void RasterLayer::setRasterFadeDuration(PropertyValue<float> value) {
if (value == getRasterFadeDuration())
return;
auto impl_ = mutableImpl();
impl_->paint.template get<RasterFadeDuration>().value = value;
baseImpl = std::move(impl_);
observer->onLayerChanged(*this);
}
void RasterLayer::setRasterFadeDurationTransition(const TransitionOptions& options) {
auto impl_ = mutableImpl();
impl_->paint.template get<RasterFadeDuration>().options = options;
baseImpl = std::move(impl_);
}
TransitionOptions RasterLayer::getRasterFadeDurationTransition() const {
return impl().paint.template get<RasterFadeDuration>().options;
}
} // namespace style
} // namespace mbgl
|