18 lines
341 B
C++
18 lines
341 B
C++
|
#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;
|
||
|
}
|
||
|
}
|
||
|
}
|