1 // This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.
2 
3 #include <mbgl/style/layers/raster_layer.hpp>
4 #include <mbgl/style/layers/raster_layer_impl.hpp>
5 #include <mbgl/style/layer_observer.hpp>
6 
7 namespace mbgl {
8 namespace style {
9 
RasterLayer(const std::string & layerID,const std::string & sourceID)10 RasterLayer::RasterLayer(const std::string& layerID, const std::string& sourceID)
11     : Layer(makeMutable<Impl>(LayerType::Raster, layerID, sourceID)) {
12 }
13 
RasterLayer(Immutable<Impl> impl_)14 RasterLayer::RasterLayer(Immutable<Impl> impl_)
15     : Layer(std::move(impl_)) {
16 }
17 
18 RasterLayer::~RasterLayer() = default;
19 
impl() const20 const RasterLayer::Impl& RasterLayer::impl() const {
21     return static_cast<const Impl&>(*baseImpl);
22 }
23 
mutableImpl() const24 Mutable<RasterLayer::Impl> RasterLayer::mutableImpl() const {
25     return makeMutable<Impl>(impl());
26 }
27 
cloneRef(const std::string & id_) const28 std::unique_ptr<Layer> RasterLayer::cloneRef(const std::string& id_) const {
29     auto impl_ = mutableImpl();
30     impl_->id = id_;
31     impl_->paint = RasterPaintProperties::Transitionable();
32     return std::make_unique<RasterLayer>(std::move(impl_));
33 }
34 
stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer> &) const35 void RasterLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const {
36 }
37 
38 // Source
39 
getSourceID() const40 const std::string& RasterLayer::getSourceID() const {
41     return impl().source;
42 }
43 
44 
45 // Visibility
46 
setVisibility(VisibilityType value)47 void RasterLayer::setVisibility(VisibilityType value) {
48     if (value == getVisibility())
49         return;
50     auto impl_ = mutableImpl();
51     impl_->visibility = value;
52     baseImpl = std::move(impl_);
53     observer->onLayerChanged(*this);
54 }
55 
56 // Zoom range
57 
setMinZoom(float minZoom)58 void RasterLayer::setMinZoom(float minZoom) {
59     auto impl_ = mutableImpl();
60     impl_->minZoom = minZoom;
61     baseImpl = std::move(impl_);
62     observer->onLayerChanged(*this);
63 }
64 
setMaxZoom(float maxZoom)65 void RasterLayer::setMaxZoom(float maxZoom) {
66     auto impl_ = mutableImpl();
67     impl_->maxZoom = maxZoom;
68     baseImpl = std::move(impl_);
69     observer->onLayerChanged(*this);
70 }
71 
72 // Layout properties
73 
74 
75 // Paint properties
76 
getDefaultRasterOpacity()77 PropertyValue<float> RasterLayer::getDefaultRasterOpacity() {
78     return { 1 };
79 }
80 
getRasterOpacity() const81 PropertyValue<float> RasterLayer::getRasterOpacity() const {
82     return impl().paint.template get<RasterOpacity>().value;
83 }
84 
setRasterOpacity(PropertyValue<float> value)85 void RasterLayer::setRasterOpacity(PropertyValue<float> value) {
86     if (value == getRasterOpacity())
87         return;
88     auto impl_ = mutableImpl();
89     impl_->paint.template get<RasterOpacity>().value = value;
90     baseImpl = std::move(impl_);
91     observer->onLayerChanged(*this);
92 }
93 
setRasterOpacityTransition(const TransitionOptions & options)94 void RasterLayer::setRasterOpacityTransition(const TransitionOptions& options) {
95     auto impl_ = mutableImpl();
96     impl_->paint.template get<RasterOpacity>().options = options;
97     baseImpl = std::move(impl_);
98 }
99 
getRasterOpacityTransition() const100 TransitionOptions RasterLayer::getRasterOpacityTransition() const {
101     return impl().paint.template get<RasterOpacity>().options;
102 }
103 
getDefaultRasterHueRotate()104 PropertyValue<float> RasterLayer::getDefaultRasterHueRotate() {
105     return { 0 };
106 }
107 
getRasterHueRotate() const108 PropertyValue<float> RasterLayer::getRasterHueRotate() const {
109     return impl().paint.template get<RasterHueRotate>().value;
110 }
111 
setRasterHueRotate(PropertyValue<float> value)112 void RasterLayer::setRasterHueRotate(PropertyValue<float> value) {
113     if (value == getRasterHueRotate())
114         return;
115     auto impl_ = mutableImpl();
116     impl_->paint.template get<RasterHueRotate>().value = value;
117     baseImpl = std::move(impl_);
118     observer->onLayerChanged(*this);
119 }
120 
setRasterHueRotateTransition(const TransitionOptions & options)121 void RasterLayer::setRasterHueRotateTransition(const TransitionOptions& options) {
122     auto impl_ = mutableImpl();
123     impl_->paint.template get<RasterHueRotate>().options = options;
124     baseImpl = std::move(impl_);
125 }
126 
getRasterHueRotateTransition() const127 TransitionOptions RasterLayer::getRasterHueRotateTransition() const {
128     return impl().paint.template get<RasterHueRotate>().options;
129 }
130 
getDefaultRasterBrightnessMin()131 PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMin() {
132     return { 0 };
133 }
134 
getRasterBrightnessMin() const135 PropertyValue<float> RasterLayer::getRasterBrightnessMin() const {
136     return impl().paint.template get<RasterBrightnessMin>().value;
137 }
138 
setRasterBrightnessMin(PropertyValue<float> value)139 void RasterLayer::setRasterBrightnessMin(PropertyValue<float> value) {
140     if (value == getRasterBrightnessMin())
141         return;
142     auto impl_ = mutableImpl();
143     impl_->paint.template get<RasterBrightnessMin>().value = value;
144     baseImpl = std::move(impl_);
145     observer->onLayerChanged(*this);
146 }
147 
setRasterBrightnessMinTransition(const TransitionOptions & options)148 void RasterLayer::setRasterBrightnessMinTransition(const TransitionOptions& options) {
149     auto impl_ = mutableImpl();
150     impl_->paint.template get<RasterBrightnessMin>().options = options;
151     baseImpl = std::move(impl_);
152 }
153 
getRasterBrightnessMinTransition() const154 TransitionOptions RasterLayer::getRasterBrightnessMinTransition() const {
155     return impl().paint.template get<RasterBrightnessMin>().options;
156 }
157 
getDefaultRasterBrightnessMax()158 PropertyValue<float> RasterLayer::getDefaultRasterBrightnessMax() {
159     return { 1 };
160 }
161 
getRasterBrightnessMax() const162 PropertyValue<float> RasterLayer::getRasterBrightnessMax() const {
163     return impl().paint.template get<RasterBrightnessMax>().value;
164 }
165 
setRasterBrightnessMax(PropertyValue<float> value)166 void RasterLayer::setRasterBrightnessMax(PropertyValue<float> value) {
167     if (value == getRasterBrightnessMax())
168         return;
169     auto impl_ = mutableImpl();
170     impl_->paint.template get<RasterBrightnessMax>().value = value;
171     baseImpl = std::move(impl_);
172     observer->onLayerChanged(*this);
173 }
174 
setRasterBrightnessMaxTransition(const TransitionOptions & options)175 void RasterLayer::setRasterBrightnessMaxTransition(const TransitionOptions& options) {
176     auto impl_ = mutableImpl();
177     impl_->paint.template get<RasterBrightnessMax>().options = options;
178     baseImpl = std::move(impl_);
179 }
180 
getRasterBrightnessMaxTransition() const181 TransitionOptions RasterLayer::getRasterBrightnessMaxTransition() const {
182     return impl().paint.template get<RasterBrightnessMax>().options;
183 }
184 
getDefaultRasterSaturation()185 PropertyValue<float> RasterLayer::getDefaultRasterSaturation() {
186     return { 0 };
187 }
188 
getRasterSaturation() const189 PropertyValue<float> RasterLayer::getRasterSaturation() const {
190     return impl().paint.template get<RasterSaturation>().value;
191 }
192 
setRasterSaturation(PropertyValue<float> value)193 void RasterLayer::setRasterSaturation(PropertyValue<float> value) {
194     if (value == getRasterSaturation())
195         return;
196     auto impl_ = mutableImpl();
197     impl_->paint.template get<RasterSaturation>().value = value;
198     baseImpl = std::move(impl_);
199     observer->onLayerChanged(*this);
200 }
201 
setRasterSaturationTransition(const TransitionOptions & options)202 void RasterLayer::setRasterSaturationTransition(const TransitionOptions& options) {
203     auto impl_ = mutableImpl();
204     impl_->paint.template get<RasterSaturation>().options = options;
205     baseImpl = std::move(impl_);
206 }
207 
getRasterSaturationTransition() const208 TransitionOptions RasterLayer::getRasterSaturationTransition() const {
209     return impl().paint.template get<RasterSaturation>().options;
210 }
211 
getDefaultRasterContrast()212 PropertyValue<float> RasterLayer::getDefaultRasterContrast() {
213     return { 0 };
214 }
215 
getRasterContrast() const216 PropertyValue<float> RasterLayer::getRasterContrast() const {
217     return impl().paint.template get<RasterContrast>().value;
218 }
219 
setRasterContrast(PropertyValue<float> value)220 void RasterLayer::setRasterContrast(PropertyValue<float> value) {
221     if (value == getRasterContrast())
222         return;
223     auto impl_ = mutableImpl();
224     impl_->paint.template get<RasterContrast>().value = value;
225     baseImpl = std::move(impl_);
226     observer->onLayerChanged(*this);
227 }
228 
setRasterContrastTransition(const TransitionOptions & options)229 void RasterLayer::setRasterContrastTransition(const TransitionOptions& options) {
230     auto impl_ = mutableImpl();
231     impl_->paint.template get<RasterContrast>().options = options;
232     baseImpl = std::move(impl_);
233 }
234 
getRasterContrastTransition() const235 TransitionOptions RasterLayer::getRasterContrastTransition() const {
236     return impl().paint.template get<RasterContrast>().options;
237 }
238 
getDefaultRasterResampling()239 PropertyValue<RasterResamplingType> RasterLayer::getDefaultRasterResampling() {
240     return { RasterResamplingType::Linear };
241 }
242 
getRasterResampling() const243 PropertyValue<RasterResamplingType> RasterLayer::getRasterResampling() const {
244     return impl().paint.template get<RasterResampling>().value;
245 }
246 
setRasterResampling(PropertyValue<RasterResamplingType> value)247 void RasterLayer::setRasterResampling(PropertyValue<RasterResamplingType> value) {
248     if (value == getRasterResampling())
249         return;
250     auto impl_ = mutableImpl();
251     impl_->paint.template get<RasterResampling>().value = value;
252     baseImpl = std::move(impl_);
253     observer->onLayerChanged(*this);
254 }
255 
setRasterResamplingTransition(const TransitionOptions & options)256 void RasterLayer::setRasterResamplingTransition(const TransitionOptions& options) {
257     auto impl_ = mutableImpl();
258     impl_->paint.template get<RasterResampling>().options = options;
259     baseImpl = std::move(impl_);
260 }
261 
getRasterResamplingTransition() const262 TransitionOptions RasterLayer::getRasterResamplingTransition() const {
263     return impl().paint.template get<RasterResampling>().options;
264 }
265 
getDefaultRasterFadeDuration()266 PropertyValue<float> RasterLayer::getDefaultRasterFadeDuration() {
267     return { 300 };
268 }
269 
getRasterFadeDuration() const270 PropertyValue<float> RasterLayer::getRasterFadeDuration() const {
271     return impl().paint.template get<RasterFadeDuration>().value;
272 }
273 
setRasterFadeDuration(PropertyValue<float> value)274 void RasterLayer::setRasterFadeDuration(PropertyValue<float> value) {
275     if (value == getRasterFadeDuration())
276         return;
277     auto impl_ = mutableImpl();
278     impl_->paint.template get<RasterFadeDuration>().value = value;
279     baseImpl = std::move(impl_);
280     observer->onLayerChanged(*this);
281 }
282 
setRasterFadeDurationTransition(const TransitionOptions & options)283 void RasterLayer::setRasterFadeDurationTransition(const TransitionOptions& options) {
284     auto impl_ = mutableImpl();
285     impl_->paint.template get<RasterFadeDuration>().options = options;
286     baseImpl = std::move(impl_);
287 }
288 
getRasterFadeDurationTransition() const289 TransitionOptions RasterLayer::getRasterFadeDurationTransition() const {
290     return impl().paint.template get<RasterFadeDuration>().options;
291 }
292 
293 } // namespace style
294 } // namespace mbgl
295