Changed up how resources import/export files. Added Model codecs.

This commit is contained in:
2024-02-20 22:47:52 -08:00
parent 54012df3a1
commit 93f881cf03
20 changed files with 998 additions and 882 deletions

View File

@@ -42,7 +42,7 @@ namespace ehs
Img();
Img(Str_8 id);
Img(const Str_8& filePath);
Img(Str_8 id, UInt_8 byteDepth, UInt_8 channels, const Vec2_u64& resolution, const Byte* data);
@@ -124,13 +124,7 @@ namespace ehs
bool IsValid() const;
bool ToFile(const Str_8& filePath) const;
static Img FromFile(const Str_8& filePath);
static Img* FromFile_Heap(const Str_8& filePath);
static Img FromData(Str_8 id, const Str_8& ext, Serializer<UInt_64>& data);
bool Export(const Str_8& filePath) const;
private:
Img GetNearestNeighbor(const Vec2_u64& newResolution) const;
@@ -185,4 +179,10 @@ namespace ehs
void BD16_to_BD8(UInt_64 newSize, Byte* buffer) const;
};
bool EncodeQOI(const ehs::ImgCodec* codec, ehs::Serializer<ehs::UInt_64>& out, const ehs::Img* in);
bool DecodeQOI(const ehs::ImgCodec* codec, ehs::Serializer<ehs::UInt_64>& in, ehs::Img* out);
bool DecodePNG(const ehs::ImgCodec* codec, ehs::Serializer<ehs::UInt_64>& in, ehs::Img* out);
}