summaryrefslogtreecommitdiff
path: root/include/mbgl/style/image.hpp
blob: 499377467e897f499bf671d055958ccd19d0c76a (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
#pragma once

#include <mbgl/util/image.hpp>

namespace mbgl {
namespace style {

class Image {
public:
    Image(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