add heightmap:resize(int, int, str)

This commit is contained in:
MihailRis
2024-08-17 22:09:31 +03:00
parent e560236a8c
commit 8c0a3f4260
4 changed files with 114 additions and 1 deletions
+11
View File
@@ -5,6 +5,12 @@
#include "typedefs.hpp"
enum class InterpolationType {
NEAREST,
LINEAR,
CUBIC,
};
class Heightmap {
std::vector<float> buffer;
uint width, height;
@@ -14,8 +20,13 @@ public:
buffer.resize(width*height);
}
Heightmap(uint width, uint height, std::vector<float> buffer)
: width(width), height(height), buffer(std::move(buffer)) {}
~Heightmap() = default;
void resize(uint width, uint height, InterpolationType interpolation);
uint getWidth() const {
return width;
}