diff options
author | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-05-12 23:19:00 +0300 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-12 13:19:00 -0700 |
commit | cc9f040a2d35293c51dcc5be9c7affea7f1263bd (patch) | |
tree | de62a5610e719f5bfe07226c3382d4d2a5e17530 /src/mbgl/style/image_impl.cpp | |
parent | c80f3e9d29d1c26ccc88ef30f8f17329c9bfb1b7 (diff) | |
download | qtlocation-mapboxgl-cc9f040a2d35293c51dcc5be9c7affea7f1263bd.tar.gz |
[core] Split style image collection from SpriteAtlas
Diffstat (limited to 'src/mbgl/style/image_impl.cpp')
-rw-r--r-- | src/mbgl/style/image_impl.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mbgl/style/image_impl.cpp b/src/mbgl/style/image_impl.cpp new file mode 100644 index 0000000000..910bffa905 --- /dev/null +++ b/src/mbgl/style/image_impl.cpp @@ -0,0 +1,22 @@ +#include <mbgl/style/image_impl.hpp> +#include <mbgl/util/exception.hpp> + +namespace mbgl { +namespace style { + +Image::Impl::Impl(PremultipliedImage&& image_, + const float pixelRatio_, + bool sdf_) + : image(std::move(image_)), + pixelRatio(pixelRatio_), + sdf(sdf_) { + + if (!image.valid()) { + throw util::SpriteImageException("Sprite image dimensions may not be zero"); + } else if (pixelRatio <= 0) { + throw util::SpriteImageException("Sprite pixelRatio may not be <= 0"); + } +} + +} // namespace style +} // namespace mbgl |