From cc9f040a2d35293c51dcc5be9c7affea7f1263bd Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Fri, 12 May 2017 23:19:00 +0300 Subject: [core] Split style image collection from SpriteAtlas --- include/mbgl/style/image.hpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'include') 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 +#include + 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; }; } // namespace style -- cgit v1.2.1