mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 20:11:50 +00:00
add canvas:encode method
This commit is contained in:
parent
dda823ac24
commit
d714e6943a
5 changed files with 108 additions and 0 deletions
|
|
@ -4,10 +4,20 @@
|
|||
#include <string>
|
||||
|
||||
#include "io/fwd.hpp"
|
||||
#include "util/Buffer.hpp"
|
||||
#include "util/EnumMetadata.hpp"
|
||||
|
||||
class ImageData;
|
||||
|
||||
namespace imageio {
|
||||
enum class ImageFileFormat {
|
||||
PNG
|
||||
};
|
||||
|
||||
VC_ENUM_METADATA(ImageFileFormat)
|
||||
{"png", ImageFileFormat::PNG},
|
||||
VC_ENUM_END
|
||||
|
||||
inline const std::string PNG = ".png";
|
||||
|
||||
bool is_read_supported(const std::string& extension);
|
||||
|
|
@ -15,4 +25,5 @@ namespace imageio {
|
|||
|
||||
std::unique_ptr<ImageData> read(const io::path& file);
|
||||
void write(const io::path& file, const ImageData* image);
|
||||
util::Buffer<unsigned char> encode(ImageFileFormat format, const ImageData& image);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue