summaryrefslogtreecommitdiff
path: root/src/mbgl/style/sources/image_source_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/sources/image_source_impl.cpp')
-rw-r--r--src/mbgl/style/sources/image_source_impl.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/mbgl/style/sources/image_source_impl.cpp b/src/mbgl/style/sources/image_source_impl.cpp
new file mode 100644
index 0000000000..c1f31dbdc6
--- /dev/null
+++ b/src/mbgl/style/sources/image_source_impl.cpp
@@ -0,0 +1,38 @@
+#include <mbgl/style/sources/image_source_impl.hpp>
+#include <mbgl/util/geo.hpp>
+
+namespace mbgl {
+namespace style {
+
+ImageSource::Impl::Impl(std::string id_, std::array<LatLng, 4> coords_)
+ : Source::Impl(SourceType::Image, std::move(id_)),
+ coords(std::move(coords_)) {
+}
+
+ImageSource::Impl::Impl(const Impl& other, std::array<LatLng, 4> coords_)
+ : Source::Impl(other),
+ coords(std::move(coords_)),
+ image(other.image) {
+}
+
+ImageSource::Impl::Impl(const Impl& rhs, PremultipliedImage&& image_)
+ : Source::Impl(rhs),
+ coords(rhs.coords),
+ image(std::make_shared<PremultipliedImage>(std::move(image_))) {
+}
+ImageSource::Impl::~Impl() = default;
+
+std::shared_ptr<PremultipliedImage> ImageSource::Impl::getImage() const {
+ return image;
+}
+
+std::array<LatLng, 4> ImageSource::Impl::getCoordinates() const {
+ return coords;
+}
+
+optional<std::string> ImageSource::Impl::getAttribution() const {
+ return {};
+}
+
+} // namespace style
+} // namespace mbgl