summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIvo van Dongen <ivovandongen@users.noreply.github.com>2017-05-12 23:19:00 +0300
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-05-12 13:19:00 -0700
commitcc9f040a2d35293c51dcc5be9c7affea7f1263bd (patch)
treede62a5610e719f5bfe07226c3382d4d2a5e17530 /include
parentc80f3e9d29d1c26ccc88ef30f8f17329c9bfb1b7 (diff)
downloadqtlocation-mapboxgl-cc9f040a2d35293c51dcc5be9c7affea7f1263bd.tar.gz
[core] Split style image collection from SpriteAtlas
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/image.hpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/mbgl/style/image.hpp b/include/mbgl/style/image.hpp
index 499377467e..4abd86f1be 100644
--- a/include/mbgl/style/image.hpp
+++ b/include/mbgl/style/image.hpp
@@ -2,6 +2,8 @@
#include <mbgl/util/image.hpp>
+#include <memory>
+
namespace mbgl {
namespace style {
@@ -9,16 +11,21 @@ class Image {
public:
Image(PremultipliedImage&&, float pixelRatio, bool sdf = false);
- PremultipliedImage image;
+ PremultipliedImage& getImage() const;
// Pixel ratio of the sprite image.
- const float pixelRatio;
+ float getPixelRatio() const;
// Whether this image should be interpreted as a signed distance field icon.
- const bool sdf;
+ bool isSdf() const;
+
+ float getWidth() const;
+ float getHeight() const;
+
+ class Impl;
- float getWidth() const { return image.size.width / pixelRatio; }
- float getHeight() const { return image.size.height / pixelRatio; }
+private:
+ const std::shared_ptr<Impl> impl;
};
} // namespace style