| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <span> |
| 7 |
#include <string> |
| 8 |
|
| 9 |
#include "Common/Buffer.h" |
| 10 |
#include "Common/CommonTypes.h" |
| 11 |
|
| 12 |
namespace Common |
| 13 |
{ |
| 14 |
bool LoadPNG(std::span<const u8> input, Common::UniqueBuffer<u8>* data_out, u32* width_out, |
| 15 |
u32* height_out); |
| 16 |
|
| 17 |
enum class ImageByteFormat |
| 18 |
{ |
| 19 |
RGB, |
| 20 |
RGBA, |
| 21 |
}; |
| 22 |
|
| 23 |
bool SavePNG(const std::string& path, const u8* input, ImageByteFormat format, u32 width, |
| 24 |
u32 height, u32 stride, int level = 6); |
| 25 |
bool ConvertRGBAToRGBAndSavePNG(const std::string& path, const u8* input, u32 width, u32 height, |
| 26 |
u32 stride, int level); |
| 27 |
} |