EHS/include/ehs/io/img/ImgCodec.h
karutoh 1a4a1ecd9c
Some checks failed
Build & Release / Linux-x86_64-Build (push) Successful in 40s
Build & Release / Linux-AARCH64-Build (push) Has been cancelled
First commit.
2024-01-31 22:28:19 -08:00

48 lines
1007 B
C++

#pragma once
#include "ehs/EHS.h"
#include "ehs/Str.h"
#include "ehs/io/File.h"
namespace ehs
{
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;
};
}