[core] Split style image collection from SpriteAtlas

This commit is contained in:
Ivo van Dongen
2017-05-12 23:19:00 +03:00
committed by John Firebaugh
parent c80f3e9d29
commit cc9f040a2d
33 changed files with 677 additions and 413 deletions

View File

@@ -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 { return image.size.width / pixelRatio; }
float getHeight() const { return image.size.height / pixelRatio; }
float getWidth() const;
float getHeight() const;
class Impl;
private:
const std::shared_ptr<Impl> impl;
};
} // namespace style