diff options
author | Molly Lloyd <mollymerp@users.noreply.github.com> | 2018-06-21 14:37:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-21 14:37:17 -0700 |
commit | e1af62e87dfd77d1c38802f082c4981dab1beeab (patch) | |
tree | 8371dccdcf8545fd50b2edddbdd3a622bb00b27a /src/mbgl/style/layers/raster_layer.cpp | |
parent | eb70b8984901d8113f3a29d26cc355d5b3ed46fd (diff) | |
download | qtlocation-mapboxgl-e1af62e87dfd77d1c38802f082c4981dab1beeab.tar.gz |
[core] add raster-resampling property (#12176)upstream/rclee
* update style-code for raster-resampling
* implement user-defined raster-resampling
* invert filter condition
* raster-resampling -> raster-resampling-mode for darwin language conventions
Diffstat (limited to 'src/mbgl/style/layers/raster_layer.cpp')
-rw-r--r-- | src/mbgl/style/layers/raster_layer.cpp | 27 |
1 files changed, 27 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 }; } |