summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/util/image.hpp5
-rw-r--r--include/mbgl/util/premultiply.hpp12
2 files changed, 16 insertions, 1 deletions
diff --git a/include/mbgl/util/image.hpp b/include/mbgl/util/image.hpp
index c019bb949c..a41b8462bd 100644
--- a/include/mbgl/util/image.hpp
+++ b/include/mbgl/util/image.hpp
@@ -40,11 +40,14 @@ public:
Image(Image&& o)
: size(o.size),
- data(std::move(o.data)) {}
+ data(std::move(o.data)) {
+ o.size.width = o.size.height = 0;
+ }
Image& operator=(Image&& o) {
size = o.size;
data = std::move(o.data);
+ o.size.width = o.size.height = 0;
return *this;
}
diff --git a/include/mbgl/util/premultiply.hpp b/include/mbgl/util/premultiply.hpp
new file mode 100644
index 0000000000..532c7cb11d
--- /dev/null
+++ b/include/mbgl/util/premultiply.hpp
@@ -0,0 +1,12 @@
+#pragma once
+
+#include <mbgl/util/image.hpp>
+
+namespace mbgl {
+namespace util {
+
+PremultipliedImage premultiply(UnassociatedImage&&);
+UnassociatedImage unpremultiply(PremultipliedImage&&);
+
+} // namespace util
+} // namespace mbgl