diff options
Diffstat (limited to 'src/mbgl/style/image_impl.hpp')
-rw-r--r-- | src/mbgl/style/image_impl.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mbgl/style/image_impl.hpp b/src/mbgl/style/image_impl.hpp new file mode 100644 index 0000000000..dce4a6e4c0 --- /dev/null +++ b/src/mbgl/style/image_impl.hpp @@ -0,0 +1,25 @@ +#pragma once + +#include <mbgl/style/image.hpp> + +namespace mbgl { +namespace style { + +class Image::Impl { +public: + Impl(PremultipliedImage&&, float pixelRatio, bool sdf = false); + + PremultipliedImage image; + + // Pixel ratio of the sprite image. + const float pixelRatio; + + // Whether this image should be interpreted as a signed distance field icon. + const bool sdf; + + float getWidth() const { return image.size.width / pixelRatio; } + float getHeight() const { return image.size.height / pixelRatio; } +}; + +} // namespace style +} // namespace mbgl |