2023-12-17 03:29:08 -08:00
|
|
|
#pragma once
|
|
|
|
|
2023-12-17 15:00:08 -08:00
|
|
|
#include "EHS.h"
|
|
|
|
#include "Str.h"
|
2023-12-17 15:56:13 -08:00
|
|
|
#include "io/File.h"
|
2023-12-17 03:29:08 -08:00
|
|
|
|
2023-12-17 15:56:13 -08:00
|
|
|
namespace ehs
|
2023-12-17 03:29:08 -08:00
|
|
|
{
|
|
|
|
class Img;
|
|
|
|
|
|
|
|
class ImgCodec
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
Str_8 id;
|
|
|
|
UInt_64 hashExt;
|
|
|
|
Str_8 ext;
|
|
|
|
Endianness endianness;
|
|
|
|
bool (*encodeCb)(const ImgCodec* const, Serializer<UInt_64>&, const Img*);
|
|
|
|
bool (*decodeCb)(const ImgCodec* const, Serializer<UInt_64>&, Img*);
|
|
|
|
|
|
|
|
public:
|
|
|
|
ImgCodec();
|
|
|
|
|
|
|
|
ImgCodec(Str_8 id, Str_8 ext, const Endianness end,
|
|
|
|
bool (*encodeCb)(const ImgCodec* const, Serializer<UInt_64>&, const Img*),
|
|
|
|
bool (*decodeCb)(const ImgCodec* const, Serializer<UInt_64>&, Img*));
|
|
|
|
|
|
|
|
ImgCodec(ImgCodec&& codec) noexcept;
|
|
|
|
|
|
|
|
ImgCodec(const ImgCodec& codec);
|
|
|
|
|
|
|
|
ImgCodec& operator=(ImgCodec&& codec) noexcept;
|
|
|
|
|
|
|
|
ImgCodec& operator=(const ImgCodec& codec);
|
|
|
|
|
|
|
|
Str_8 GetId() const;
|
|
|
|
|
|
|
|
UInt_64 GetHashExt() const;
|
|
|
|
|
|
|
|
Str_8 GetExt() const;
|
|
|
|
|
|
|
|
Endianness GetEndianness() const;
|
|
|
|
|
|
|
|
bool Encode(Serializer<UInt_64>& out, const Img* in) const;
|
|
|
|
|
|
|
|
bool Decode(Serializer<UInt_64>& in, Img* out) const;
|
|
|
|
};
|
|
|
|
}
|