summaryrefslogtreecommitdiff
path: root/src/mbgl/style/image_impl.hpp
blob: b088a23261d72c99b916e5bb8dfefb7d3f05fdef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include <mbgl/style/image.hpp>

namespace mbgl {
namespace style {

class Image::Impl {
public:
    Impl(std::string id, PremultipliedImage&&, float pixelRatio, bool sdf = false);

    const std::string id;

    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