diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2016-08-22 17:57:22 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2016-09-27 10:42:10 +0200 |
commit | 63e53de157e75e504a6bf1a678cebaea5acf72b9 (patch) | |
tree | 234cb14695f21df69012f1470ee512b8fc8d9904 /include/mbgl/util/image.hpp | |
parent | 512037cfdc14fb1f7686254efe97b72433c5e4b6 (diff) | |
download | qtlocation-mapboxgl-63e53de157e75e504a6bf1a678cebaea5acf72b9.tar.gz |
[core] standardize on uint16_t for texture sizes
Diffstat (limited to 'include/mbgl/util/image.hpp')
-rw-r--r-- | include/mbgl/util/image.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/mbgl/util/image.hpp b/include/mbgl/util/image.hpp index 124cdca7cd..795d1f9d1a 100644 --- a/include/mbgl/util/image.hpp +++ b/include/mbgl/util/image.hpp @@ -18,12 +18,12 @@ class Image : private util::noncopyable { public: Image() = default; - Image(size_t w, size_t h) + Image(uint16_t w, uint16_t h) : width(w), height(h), data(std::make_unique<uint8_t[]>(size())) {} - Image(size_t w, size_t h, std::unique_ptr<uint8_t[]> data_) + Image(uint16_t w, uint16_t h, std::unique_ptr<uint8_t[]> data_) : width(w), height(h), data(std::move(data_)) {} @@ -46,11 +46,11 @@ public: rhs.data.get() + rhs.size()); } - size_t stride() const { return width * 4; } - size_t size() const { return width * height * 4; } + size_t stride() const { return static_cast<size_t>(width) * 4; } + size_t size() const { return static_cast<size_t>(width) * height * 4; } - size_t width = 0; - size_t height = 0; + uint16_t width = 0; + uint16_t height = 0; std::unique_ptr<uint8_t[]> data; }; |