diff options
author | rtk0c <[email protected]> | 2023-10-19 22:50:07 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2025-08-16 11:31:16 -0700 |
commit | 297232d21594b138bb368a42b5b0d085ff9ed6aa (patch) | |
tree | 075d5407e1e12a9d35cbee6e4c20ad34e0765c42 /source/30-game/Image.hpp | |
parent | d5cd34ff69f7fd134d5450696f298af1a864afbc (diff) |
The great renaming: switch to "module style"
Diffstat (limited to 'source/30-game/Image.hpp')
-rw-r--r-- | source/30-game/Image.hpp | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/source/30-game/Image.hpp b/source/30-game/Image.hpp deleted file mode 100644 index c577c24..0000000 --- a/source/30-game/Image.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "Color.hpp" -#include "RcPtr.hpp" - -#include <cstdint> -#include <glm/glm.hpp> -#include <memory> -#include <span> - -/// Image is a 2d array of pixels, stored as a continuous array in memory, with the first pixel -/// being the top-left pixel. If a vertically flipped image data is needed, load using stb_image -/// yourself, or flip the data here. -class Image : public RefCounted { -private: - std::unique_ptr<uint8_t[]> mData; - glm::ivec2 mSize; - int mChannels; - -public: - Image(); - - bool InitFromImageFile(const char* filePath, int desiredChannels = 0); - bool InitFromImageData(std::span<uint8_t> data, int desiredChannels = 0); - bool InitFromPixels(std::span<uint8_t> pixels, glm::ivec2 dimensions, int channels); - bool InitFromPixels(std::unique_ptr<uint8_t[]> pixels, glm::ivec2 dimensions, int channels); - - /// Get the pixel at the given location. - RgbaColor GetPixel(int x, int y) const; - void SetPixel(int x, int y, RgbaColor color); - - uint8_t* GetDataPtr() const; - size_t GetDataLength() const; - std::span<uint8_t> GetData() const; - glm::ivec2 GetSize() const; - int GetChannels() const; - bool IsEmpty() const; -}; |