Files
MapLibreParticleLab/include/llmr/util/image.hpp
Ansis Brammanis 7547beadd3 add includes
2014-05-19 17:39:51 -04:00

37 lines
611 B
C++

#ifndef LLMR_UTIL_IMAGE
#define LLMR_UTIL_IMAGE
#include <string>
#include <cstring>
#include <stdexcept>
namespace llmr {
namespace util {
std::string compress_png(int width, int height, void *rgba, bool flip = false);
class Image {
public:
Image(const std::string &img);
~Image();
inline const char *getData() const { return img; }
inline uint32_t getWidth() const { return width; }
inline uint32_t getHeight() const { return height; }
private:
// loaded image dimensions
uint32_t width = 0, height = 0;
// the raw image data
char *img = nullptr;
};
}
}
#endif