Common/Image: Add helper for loading from stream

This commit is contained in:
Connor McLaughlin
2021-01-30 21:36:31 +10:00
parent 3a7d9f1725
commit 0cdd1a70c0
2 changed files with 30 additions and 0 deletions

View File

@ -6,6 +6,8 @@
#include <optional>
#include <vector>
class ByteStream;
namespace Common {
template<typename PixelType>
class Image
@ -94,6 +96,7 @@ using RGBA8Image = Image<u32>;
bool LoadImageFromFile(Common::RGBA8Image* image, const char* filename);
bool LoadImageFromBuffer(Common::RGBA8Image* image, const void* buffer, std::size_t buffer_size);
bool LoadImageFromStream(Common::RGBA8Image* image, ByteStream* stream);
bool WriteImageToFile(const Common::RGBA8Image& image, const char* filename);
} // namespace Common