We be kinda rendering
This commit is contained in:
36
destrum/include/destrum/Graphics/imageLoader.h
Normal file
36
destrum/include/destrum/Graphics/imageLoader.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef IMAGELOADER_H
|
||||
#define IMAGELOADER_H
|
||||
#include <filesystem>
|
||||
|
||||
|
||||
struct ImageData {
|
||||
ImageData() = default;
|
||||
~ImageData();
|
||||
|
||||
// move only
|
||||
ImageData(ImageData&& o) = default;
|
||||
ImageData& operator=(ImageData&& o) = default;
|
||||
|
||||
// no copies
|
||||
ImageData(const ImageData& o) = delete;
|
||||
ImageData& operator=(const ImageData& o) = delete;
|
||||
|
||||
// data
|
||||
unsigned char* pixels{nullptr};
|
||||
int width{0};
|
||||
int height{0};
|
||||
int channels{0};
|
||||
|
||||
// HDR only
|
||||
float* hdrPixels{nullptr};
|
||||
bool hdr{false};
|
||||
int comp{0};
|
||||
|
||||
bool shouldSTBFree{false};
|
||||
};
|
||||
|
||||
namespace util {
|
||||
ImageData loadImage(const std::filesystem::path& p);
|
||||
}
|
||||
|
||||
#endif //IMAGELOADER_H
|
||||
Reference in New Issue
Block a user