diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-10-26 15:22:31 -0700 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-10-27 18:30:58 -0700 |
commit | 62b56b799a7d4fcd1a8f151eed878054b862da5b (patch) | |
tree | 34d510a69f9dd1bca30e9b137feffbd1eb6495d0 /src/mbgl/util/premultiply.cpp | |
parent | ef8017198ce8f0bd79ba5a5ed31e35a16e3433bb (diff) | |
download | qtlocation-mapboxgl-62b56b799a7d4fcd1a8f151eed878054b862da5b.tar.gz |
[core] change std::array<uint16_t, 2> to mbgl::Size
Diffstat (limited to 'src/mbgl/util/premultiply.cpp')
-rw-r--r-- | src/mbgl/util/premultiply.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mbgl/util/premultiply.cpp b/src/mbgl/util/premultiply.cpp index e0178fda33..219273d7cc 100644 --- a/src/mbgl/util/premultiply.cpp +++ b/src/mbgl/util/premultiply.cpp @@ -8,12 +8,11 @@ namespace util { PremultipliedImage premultiply(UnassociatedImage&& src) { PremultipliedImage dst; - dst.width = src.width; - dst.height = src.height; + dst.size = src.size; dst.data = std::move(src.data); uint8_t* data = dst.data.get(); - for (size_t i = 0; i < dst.size(); i += 4) { + for (size_t i = 0; i < dst.bytes(); i += 4) { uint8_t& r = data[i + 0]; uint8_t& g = data[i + 1]; uint8_t& b = data[i + 2]; @@ -29,12 +28,11 @@ PremultipliedImage premultiply(UnassociatedImage&& src) { UnassociatedImage unpremultiply(PremultipliedImage&& src) { UnassociatedImage dst; - dst.width = src.width; - dst.height = src.height; + dst.size = src.size; dst.data = std::move(src.data); uint8_t* data = dst.data.get(); - for (size_t i = 0; i < dst.size(); i += 4) { + for (size_t i = 0; i < dst.bytes(); i += 4) { uint8_t& r = data[i + 0]; uint8_t& g = data[i + 1]; uint8_t& b = data[i + 2]; |