diff options
Diffstat (limited to 'src/mbgl/style/layers')
-rw-r--r-- | src/mbgl/style/layers/raster_layer.cpp | 27 | ||||
-rw-r--r-- | src/mbgl/style/layers/raster_layer_properties.hpp | 5 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src/mbgl/style/layers/raster_layer.cpp b/src/mbgl/style/layers/raster_layer.cpp index 36b2e3e027..e5b03df0f6 100644 --- a/src/mbgl/style/layers/raster_layer.cpp +++ b/src/mbgl/style/layers/raster_layer.cpp @@ -236,6 +236,33 @@ TransitionOptions RasterLayer::getRasterContrastTransition() const { return impl().paint.template get<RasterContrast>().options; } +PropertyValue<RasterResamplingType> RasterLayer::getDefaultRasterResampling() { + return { RasterResamplingType::Linear }; +} + +PropertyValue<RasterResamplingType> RasterLayer::getRasterResampling() const { + return impl().paint.template get<RasterResampling>().value; +} + +void RasterLayer::setRasterResampling(PropertyValue<RasterResamplingType> value) { + if (value == getRasterResampling()) + return; + auto impl_ = mutableImpl(); + impl_->paint.template get<RasterResampling>().value = value; + baseImpl = std::move(impl_); + observer->onLayerChanged(*this); +} + +void RasterLayer::setRasterResamplingTransition(const TransitionOptions& options) { + auto impl_ = mutableImpl(); + impl_->paint.template get<RasterResampling>().options = options; + baseImpl = std::move(impl_); +} + +TransitionOptions RasterLayer::getRasterResamplingTransition() const { + return impl().paint.template get<RasterResampling>().options; +} + PropertyValue<float> RasterLayer::getDefaultRasterFadeDuration() { return { 300 }; } diff --git a/src/mbgl/style/layers/raster_layer_properties.hpp b/src/mbgl/style/layers/raster_layer_properties.hpp index 12df09f32c..08818c9fb3 100644 --- a/src/mbgl/style/layers/raster_layer_properties.hpp +++ b/src/mbgl/style/layers/raster_layer_properties.hpp @@ -36,6 +36,10 @@ struct RasterContrast : PaintProperty<float> { static float defaultValue() { return 0; } }; +struct RasterResampling : PaintProperty<RasterResamplingType> { + static RasterResamplingType defaultValue() { return RasterResamplingType::Linear; } +}; + struct RasterFadeDuration : PaintProperty<float> { static float defaultValue() { return 300; } }; @@ -47,6 +51,7 @@ class RasterPaintProperties : public Properties< RasterBrightnessMax, RasterSaturation, RasterContrast, + RasterResampling, RasterFadeDuration > {}; |