summaryrefslogtreecommitdiff
path: root/src/mbgl/style/image.cpp
blob: be7e52abfafeae4e6d74cf2b7031092450a6b464 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <mbgl/style/image.hpp>
#include <mbgl/style/image_impl.hpp>
#include <mbgl/util/exception.hpp>

namespace mbgl {
namespace style {

Image::Image(std::string id,
             PremultipliedImage&& image,
             const float pixelRatio,
             bool sdf,
             ImageStretches stretchX,
             ImageStretches stretchY,
             optional<ImageContent> content)
    : baseImpl(makeMutable<Impl>(
          std::move(id), std::move(image), pixelRatio, sdf, std::move(stretchX), std::move(stretchY), content)) {}

std::string Image::getID() const {
    return baseImpl->id;
}

Image::Image(const Image&) = default;

const PremultipliedImage& Image::getImage() const {
    return baseImpl->image;
}

bool Image::isSdf() const {
    return baseImpl->sdf;
}

float Image::getPixelRatio() const {
    return baseImpl->pixelRatio;
}

const ImageStretches& Image::getStretchX() const {
    return baseImpl->stretchX;
}

const ImageStretches& Image::getStretchY() const {
    return baseImpl->stretchY;
}

const optional<ImageContent>& Image::getContent() const {
    return baseImpl->content;
}

} // namespace style
} // namespace mbgl