2023-12-26 23:44:40 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
2023-12-28 17:39:04 +00:00
|
|
|
#include <string>
|
2023-12-26 23:44:40 +00:00
|
|
|
|
|
|
|
enum class ImageFormat
|
|
|
|
{
|
|
|
|
R8G8B8A8,
|
|
|
|
B8G8R8A8
|
|
|
|
};
|
|
|
|
|
|
|
|
class Image
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~Image() = default;
|
|
|
|
|
|
|
|
virtual int GetWidth() const = 0;
|
|
|
|
virtual int GetHeight() const = 0;
|
|
|
|
virtual ImageFormat GetFormat() const = 0;
|
|
|
|
virtual void* GetData() const = 0;
|
|
|
|
|
|
|
|
static std::shared_ptr<Image> Create(int width, int height, ImageFormat format, const void* data);
|
2023-12-29 04:21:41 +00:00
|
|
|
static std::shared_ptr<Image> LoadResource(const std::string& resourcename, double dpiscale = 1.0);
|
2023-12-26 23:44:40 +00:00
|
|
|
};
|