summaryrefslogtreecommitdiff
path: root/src/mbgl/geometry/dem_data.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/geometry/dem_data.hpp')
-rw-r--r--src/mbgl/geometry/dem_data.hpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/mbgl/geometry/dem_data.hpp b/src/mbgl/geometry/dem_data.hpp
index 21146bc468..537575873f 100644
--- a/src/mbgl/geometry/dem_data.hpp
+++ b/src/mbgl/geometry/dem_data.hpp
@@ -16,13 +16,8 @@ public:
DEMData(const PremultipliedImage& image, Tileset::DEMEncoding encoding);
void backfillBorder(const DEMData& borderTileData, int8_t dx, int8_t dy);
- void set(const int32_t x, const int32_t y, const int32_t value) {
- reinterpret_cast<int32_t*>(image.data.get())[idx(x, y)] = value + 65536;
- }
-
- int32_t get(const int32_t x, const int32_t y) const {
- return reinterpret_cast<const int32_t*>(image.data.get())[idx(x, y)] - 65536;
- }
+ int32_t get(const int32_t x, const int32_t y) const;
+ const std::array<float, 4>& getUnpackVector() const;
const PremultipliedImage* getImage() const {
return &image;
@@ -32,16 +27,17 @@ public:
const int32_t stride;
- private:
- PremultipliedImage image;
+private:
+ Tileset::DEMEncoding encoding;
+ PremultipliedImage image;
- size_t idx(const int32_t x, const int32_t y) const {
- assert(x >= -1);
- assert(x < dim + 1);
- assert(y >= -1);
- assert(y < dim + 1);
- return (y + 1) * stride + (x + 1);
- }
+ size_t idx(const int32_t x, const int32_t y) const {
+ assert(x >= -1);
+ assert(x < dim + 1);
+ assert(y >= -1);
+ assert(y < dim + 1);
+ return (y + 1) * stride + (x + 1);
+ }
};