summaryrefslogtreecommitdiff
path: root/include/mbgl/util/image.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-02-17 15:53:14 +0100
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-03-22 11:56:01 -0700
commit1dd81d9776baf9b9ef61b05d29f7acbb0f2a1508 (patch)
treeded904ed0a8b2d9cb0f3f784d683162e5917e99f /include/mbgl/util/image.hpp
parentc608803ca95e833c9312c0f1cd622594224d5458 (diff)
downloadqtlocation-mapboxgl-1dd81d9776baf9b9ef61b05d29f7acbb0f2a1508.tar.gz
[test] remove crc64 and compare images
boost's crc64 breaks on iOS
Diffstat (limited to 'include/mbgl/util/image.hpp')
-rw-r--r--include/mbgl/util/image.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/mbgl/util/image.hpp b/include/mbgl/util/image.hpp
index 7927b777ea..a1c899d239 100644
--- a/include/mbgl/util/image.hpp
+++ b/include/mbgl/util/image.hpp
@@ -3,6 +3,7 @@
#include <string>
#include <memory>
+#include <algorithm>
namespace mbgl {
@@ -26,6 +27,12 @@ public:
height(h),
data(std::move(data_)) {}
+ bool operator==(const Image& rhs) const {
+ return width == rhs.width && height == rhs.height &&
+ std::equal(data.get(), data.get() + size(), rhs.data.get(),
+ rhs.data.get() + rhs.size());
+ }
+
size_t stride() const { return width * 4; }
size_t size() const { return width * height * 4; }