refactor export equirectangular

This commit is contained in:
2019-08-15 19:12:50 +02:00
parent e959fb4d91
commit 542e5a9c19
12 changed files with 223 additions and 206 deletions

View File

@@ -11,13 +11,14 @@ public:
bool load_file(std::string filename);
const uint8_t* data() const { return m_data.get(); }
int size() const { return width * height * comp; }
bool save(const std::string& path);
void create(int w, int h)
bool save_png(const std::string& path);
bool save_jpg(const std::string& path, int quality);
void create(int w, int h, uint8_t* data = nullptr)
{
width = w;
height = h;
comp = 4;
m_data = std::make_unique<uint8_t[]>(size());
m_data = data ? std::unique_ptr<uint8_t[]>(data) : std::make_unique<uint8_t[]>(size());
}
void copy_from(const uint8_t* data)
{