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.hpp45
1 files changed, 17 insertions, 28 deletions
diff --git a/src/mbgl/geometry/dem_data.hpp b/src/mbgl/geometry/dem_data.hpp
index e59fbfedf2..507a51661d 100644
--- a/src/mbgl/geometry/dem_data.hpp
+++ b/src/mbgl/geometry/dem_data.hpp
@@ -12,24 +12,29 @@ namespace mbgl {
class DEMData {
public:
- class Level {
- public:
- Level(int32_t dim, int32_t border);
+ DEMData(const PremultipliedImage& image);
+ 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;
- }
+ 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 {
+ return reinterpret_cast<const int32_t*>(image.data.get())[idx(x, y)] - 65536;
+ }
- const PremultipliedImage* getImage() {
- return &image;
- }
+ const PremultipliedImage* getImage() const {
+ return &image;
+ }
+
+ const int32_t dim;
+ const int32_t border;
+ const int32_t stride;
private:
+ PremultipliedImage image;
+
size_t idx(const int32_t x, const int32_t y) const {
assert(x >= -border);
assert(x < dim + border);
@@ -38,22 +43,6 @@ public:
return (y + border) * stride + (x + border);
}
- public:
- const int32_t dim;
- const int32_t border;
- const int32_t stride;
- PremultipliedImage image;
- };
-
- DEMData(const PremultipliedImage& image);
- void backfillBorder(const DEMData& borderTileData, int8_t dx, int8_t dy);
- bool isLoaded() const {
- return loaded;
- }
- Level level;
- private:
- bool loaded = false;
-
};
} // namespace mbgl