EHS
Loading...
Searching...
No Matches
ImgCodec.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/EHS.h"
4#include "ehs/Str.h"
5#include "ehs/io/File.h"
6
7namespace ehs
8{
9 class Img;
10 class ImgCodec;
11
12 typedef bool (*EncodeImgCb)(const ImgCodec* const, Serializer<UInt_64>&, const Img*);
13 typedef bool (*DecodeImgCb)(const ImgCodec* const, Serializer<UInt_64>&, Img*);
14
15 class EHS_LIB_IO ImgCodec
16 {
17 private:
18 Str_8 id;
19 UInt_64 hashExt;
20 Str_8 ext;
21 Endianness endianness;
22 EncodeImgCb encoder;
23 DecodeImgCb decoder;
24
25 public:
26 ImgCodec();
27
28 ImgCodec(Str_8 id, Str_8 ext, Endianness end, EncodeImgCb encoder, DecodeImgCb decoder);
29
30 ImgCodec(ImgCodec&& codec) noexcept;
31
32 ImgCodec(const ImgCodec& codec);
33
34 ImgCodec& operator=(ImgCodec&& codec) noexcept;
35
36 ImgCodec& operator=(const ImgCodec& codec);
37
38 Str_8 GetId() const;
39
40 UInt_64 GetHashExt() const;
41
42 Str_8 GetExt() const;
43
45
46 bool Encode(Serializer<UInt_64>& out, const Img* in) const;
47
48 bool Decode(Serializer<UInt_64>& in, Img* out) const;
49 };
50}
Definition ImgCodec.h:16
bool Decode(Serializer< UInt_64 > &in, Img *out) const
Definition ImgCodec.cpp:99
Str_8 GetExt() const
Definition ImgCodec.cpp:78
ImgCodec & operator=(ImgCodec &&codec) noexcept
Definition ImgCodec.cpp:33
Str_8 GetId() const
Definition ImgCodec.cpp:68
Endianness GetEndianness() const
Definition ImgCodec.cpp:83
UInt_64 GetHashExt() const
Definition ImgCodec.cpp:73
bool Encode(Serializer< UInt_64 > &out, const Img *in) const
Definition ImgCodec.cpp:88
ImgCodec()
Definition ImgCodec.cpp:6
Definition Img.h:17
Definition Serializer.h:25
Definition Anchor.h:6
Endianness
Definition CPU.h:21
bool(* EncodeImgCb)(const ImgCodec *const, Serializer< UInt_64 > &, const Img *)
Definition ImgCodec.h:12
Str< Char_8, UInt_64 > Str_8
Definition Str.h:1953
bool(* DecodeImgCb)(const ImgCodec *const, Serializer< UInt_64 > &, Img *)
Definition ImgCodec.h:13