// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`. #include #include #include #include #include #include #include #include #include namespace mbgl { namespace style { RasterLayer::RasterLayer(const std::string& layerID, const std::string& sourceID) : Layer(makeMutable(LayerType::Raster, layerID, sourceID)) { } RasterLayer::RasterLayer(Immutable impl_) : Layer(std::move(impl_)) { } RasterLayer::~RasterLayer() = default; const RasterLayer::Impl& RasterLayer::impl() const { return static_cast(*baseImpl); } Mutable RasterLayer::mutableImpl() const { return makeMutable(impl()); } std::unique_ptr RasterLayer::cloneRef(const std::string& id_) const { auto impl_ = mutableImpl(); impl_->id = id_; impl_->paint = RasterPaintProperties::Transitionable(); return std::make_unique(std::move(impl_)); } void RasterLayer::Impl::stringifyLayout(rapidjson::Writer&) 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 RasterLayer::getDefaultRasterOpacity() { return { 1 }; } PropertyValue RasterLayer::getRasterOpacity() const { return impl().paint.template get().value; } void RasterLayer::setRasterOpacity(PropertyValue value) { if (value == getRasterOpacity()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void RasterLayer::setRasterOpacityTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions RasterLayer::getRasterOpacityTransition() const { return impl().paint.template get().options; } PropertyValue RasterLayer::getDefaultRasterHueRotate() { return { 0 }; } PropertyValue RasterLayer::getRasterHueRotate() const { return impl().paint.template get().value; } void RasterLayer::setRasterHueRotate(PropertyValue value) { if (value == getRasterHueRotate()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void RasterLayer::setRasterHueRotateTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions RasterLayer::getRasterHueRotateTransition() const { return impl().paint.template get().options; } PropertyValue RasterLayer::getDefaultRasterBrightnessMin() { return { 0 }; } PropertyValue RasterLayer::getRasterBrightnessMin() const { return impl().paint.template get().value; } void RasterLayer::setRasterBrightnessMin(PropertyValue value) { if (value == getRasterBrightnessMin()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void RasterLayer::setRasterBrightnessMinTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions RasterLayer::getRasterBrightnessMinTransition() const { return impl().paint.template get().options; } PropertyValue RasterLayer::getDefaultRasterBrightnessMax() { return { 1 }; } PropertyValue RasterLayer::getRasterBrightnessMax() const { return impl().paint.template get().value; } void RasterLayer::setRasterBrightnessMax(PropertyValue value) { if (value == getRasterBrightnessMax()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void RasterLayer::setRasterBrightnessMaxTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions RasterLayer::getRasterBrightnessMaxTransition() const { return impl().paint.template get().options; } PropertyValue RasterLayer::getDefaultRasterSaturation() { return { 0 }; } PropertyValue RasterLayer::getRasterSaturation() const { return impl().paint.template get().value; } void RasterLayer::setRasterSaturation(PropertyValue value) { if (value == getRasterSaturation()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void RasterLayer::setRasterSaturationTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions RasterLayer::getRasterSaturationTransition() const { return impl().paint.template get().options; } PropertyValue RasterLayer::getDefaultRasterContrast() { return { 0 }; } PropertyValue RasterLayer::getRasterContrast() const { return impl().paint.template get().value; } void RasterLayer::setRasterContrast(PropertyValue value) { if (value == getRasterContrast()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void RasterLayer::setRasterContrastTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions RasterLayer::getRasterContrastTransition() const { return impl().paint.template get().options; } PropertyValue RasterLayer::getDefaultRasterResampling() { return { RasterResamplingType::Linear }; } PropertyValue RasterLayer::getRasterResampling() const { return impl().paint.template get().value; } void RasterLayer::setRasterResampling(PropertyValue value) { if (value == getRasterResampling()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void RasterLayer::setRasterResamplingTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions RasterLayer::getRasterResamplingTransition() const { return impl().paint.template get().options; } PropertyValue RasterLayer::getDefaultRasterFadeDuration() { return { 300 }; } PropertyValue RasterLayer::getRasterFadeDuration() const { return impl().paint.template get().value; } void RasterLayer::setRasterFadeDuration(PropertyValue value) { if (value == getRasterFadeDuration()) return; auto impl_ = mutableImpl(); impl_->paint.template get().value = value; baseImpl = std::move(impl_); observer->onLayerChanged(*this); } void RasterLayer::setRasterFadeDurationTransition(const TransitionOptions& options) { auto impl_ = mutableImpl(); impl_->paint.template get().options = options; baseImpl = std::move(impl_); } TransitionOptions RasterLayer::getRasterFadeDurationTransition() const { return impl().paint.template get().options; } using namespace conversion; optional RasterLayer::setPaintProperty(const std::string& name, const Convertible& value) { if (name == "raster-opacity") { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setRasterOpacity(*typedValue); return nullopt; } if (name == "raster-opacity-transition") { Error error; optional transition = convert(value, error); if (!transition) { return error; } setRasterOpacityTransition(*transition); return nullopt; } if (name == "raster-hue-rotate") { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setRasterHueRotate(*typedValue); return nullopt; } if (name == "raster-hue-rotate-transition") { Error error; optional transition = convert(value, error); if (!transition) { return error; } setRasterHueRotateTransition(*transition); return nullopt; } if (name == "raster-brightness-min") { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setRasterBrightnessMin(*typedValue); return nullopt; } if (name == "raster-brightness-min-transition") { Error error; optional transition = convert(value, error); if (!transition) { return error; } setRasterBrightnessMinTransition(*transition); return nullopt; } if (name == "raster-brightness-max") { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setRasterBrightnessMax(*typedValue); return nullopt; } if (name == "raster-brightness-max-transition") { Error error; optional transition = convert(value, error); if (!transition) { return error; } setRasterBrightnessMaxTransition(*transition); return nullopt; } if (name == "raster-saturation") { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setRasterSaturation(*typedValue); return nullopt; } if (name == "raster-saturation-transition") { Error error; optional transition = convert(value, error); if (!transition) { return error; } setRasterSaturationTransition(*transition); return nullopt; } if (name == "raster-contrast") { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setRasterContrast(*typedValue); return nullopt; } if (name == "raster-contrast-transition") { Error error; optional transition = convert(value, error); if (!transition) { return error; } setRasterContrastTransition(*transition); return nullopt; } if (name == "raster-resampling") { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setRasterResampling(*typedValue); return nullopt; } if (name == "raster-resampling-transition") { Error error; optional transition = convert(value, error); if (!transition) { return error; } setRasterResamplingTransition(*transition); return nullopt; } if (name == "raster-fade-duration") { Error error; optional> typedValue = convert>(value, error, false, false); if (!typedValue) { return error; } setRasterFadeDuration(*typedValue); return nullopt; } if (name == "raster-fade-duration-transition") { Error error; optional transition = convert(value, error); if (!transition) { return error; } setRasterFadeDurationTransition(*transition); return nullopt; } return Error { "layer doesn't support this property" }; } optional RasterLayer::setLayoutProperty(const std::string& name, const Convertible& value) { if (name == "visibility") { if (isUndefined(value)) { setVisibility(VisibilityType::Visible); return nullopt; } Error error; optional visibility = convert(value, error); if (!visibility) { return error; } setVisibility(*visibility); return nullopt; } return Error { "layer doesn't support this property" }; } } // namespace style } // namespace mbgl