charcoal/OpenGLEngine/ImageLoader.cpp

18 lines
341 B
C++
Raw Normal View History

2018-10-08 01:51:05 +00:00
#include "ImageLoader.h"
#include "lodepng.h"
namespace charcoal
{
namespace image_loader
{
ImageRGBA load_file(const std::string& filename)
{
std::vector<unsigned char> file_data;
lodepng::load_file(file_data, filename);
ImageRGBA ret;
lodepng::decode(ret.data, ret.width, ret.height, file_data);
return ret;
}
}
}