diff options
| author | Mel <einebeere@gmail.com> | 2023-06-12 17:09:55 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-06-12 17:14:03 +0200 |
| commit | d0de60dc33df75fbcacb53a09568b14d0fd48cb9 (patch) | |
| tree | 7aefdbb81f114552881834bd5b0d842bc2bdb691 /src/GFX/Image/RawImage.hpp | |
| parent | 23b0bc4d1ddc9fad3c32e8257497ddd13ac6a155 (diff) | |
| download | meowcraft-d0de60dc33df75fbcacb53a09568b14d0fd48cb9.tar.zst meowcraft-d0de60dc33df75fbcacb53a09568b14d0fd48cb9.zip | |
Multithreaded world generation with Perlin
Diffstat (limited to 'src/GFX/Image/RawImage.hpp')
| -rw-r--r-- | src/GFX/Image/RawImage.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/GFX/Image/RawImage.hpp b/src/GFX/Image/RawImage.hpp index 2b10cb0..8a837e6 100644 --- a/src/GFX/Image/RawImage.hpp +++ b/src/GFX/Image/RawImage.hpp @@ -2,19 +2,23 @@ #include <cstdint> #include <cstddef> +#include <string> #include <vector> +#include "../../Util/Sampler.hpp" namespace MC::GFX::Image { class RawImage { public: - RawImage() : m_pixels(), m_width(0), m_height(0), m_channels(0) {}; + RawImage() : m_pixels(), m_width(0), m_height(0) {}; - explicit RawImage(uint32_t width, uint32_t height, uint8_t channels) - : m_pixels(), m_width(width), m_height(height), m_channels(channels) { + RawImage(uint32_t width, uint32_t height) + : m_pixels(), m_width(width), m_height(height) { m_pixels.reserve(width * height); } + RawImage(Util::Sampler<2, float>& sampler, uint32_t width, uint32_t height); + struct Pixel { uint8_t r, g, b; }; @@ -27,11 +31,13 @@ public: uint32_t width() const; uint32_t height() const; uint8_t channels() const; + + std::string string() const; private: std::vector<Pixel> m_pixels; uint32_t m_width, m_height; - uint8_t m_channels; + uint8_t m_channels = 3; }; } |
