29 lines
996 B
C++
29 lines
996 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include <ReTexture/flags.h>
|
|
|
|
namespace ReTexture {
|
|
class SoftwareTexture {
|
|
private:
|
|
unsigned int width = 0;
|
|
unsigned int height = 0;
|
|
TextureFormat format;
|
|
TextureFlag flags;
|
|
void load(const std::string& file);
|
|
void loadBMP(const std::string& file);
|
|
void loadPNG(const std::string& file);
|
|
void invertY();
|
|
public:
|
|
std::vector<unsigned char> pixelData;
|
|
explicit SoftwareTexture(const std::string& file);
|
|
SoftwareTexture(const std::string& file, const TextureFlag& flags);
|
|
SoftwareTexture(const std::vector<unsigned char>& pixel_data, TextureFormat format, unsigned int width, unsigned int height);
|
|
SoftwareTexture downscale(unsigned int rhs);
|
|
[[nodiscard]] unsigned int getWidth() const;
|
|
[[nodiscard]] unsigned int getHeight() const;
|
|
TextureFormat getTextureFormat();
|
|
TextureFlag getFlags();
|
|
};
|
|
} |