summaryrefslogtreecommitdiff
path: root/include/mbgl/util/image.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/util/image.hpp')
-rw-r--r--include/mbgl/util/image.hpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/mbgl/util/image.hpp b/include/mbgl/util/image.hpp
index fbb0686a7b..124cdca7cd 100644
--- a/include/mbgl/util/image.hpp
+++ b/include/mbgl/util/image.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include <mbgl/util/noncopyable.hpp>
+
#include <string>
#include <memory>
#include <algorithm>
@@ -12,7 +14,7 @@ enum ImageAlphaMode {
};
template <ImageAlphaMode Mode>
-class Image {
+class Image : private util::noncopyable {
public:
Image() = default;
@@ -26,6 +28,18 @@ public:
height(h),
data(std::move(data_)) {}
+ Image(Image&& o)
+ : width(o.width),
+ height(o.height),
+ data(std::move(o.data)) {}
+
+ Image& operator=(Image&& o) {
+ width = o.width;
+ height = o.height;
+ data = std::move(o.data);
+ return *this;
+ }
+
bool operator==(const Image& rhs) const {
return width == rhs.width && height == rhs.height &&
std::equal(data.get(), data.get() + size(), rhs.data.get(),