From 60ccc62f4934e44ad5b905fdbcf458302b8d8a09 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Fri, 3 Jun 2022 23:26:44 -0700 Subject: Changeset: 63 [WIP] Rename directories --- source/30-game/Image.hpp | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 source/30-game/Image.hpp (limited to 'source/30-game/Image.hpp') 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 -#include -#include -#include - -/// 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 mData; - glm::ivec2 mSize; - int mChannels; - -public: - Image(); - - bool InitFromImageFile(const char* filePath, int desiredChannels = 0); - bool InitFromImageData(std::span data, int desiredChannels = 0); - bool InitFromPixels(std::span pixels, glm::ivec2 dimensions, int channels); - bool InitFromPixels(std::unique_ptr 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 GetData() const; - glm::ivec2 GetSize() const; - int GetChannels() const; - bool IsEmpty() const; -}; -- cgit v1.2.3-70-g09d2