EHS
Loading...
Searching...
No Matches
PNG.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/EHS.h"
4#include "ehs/Serializer.h"
5#include "PNG_Chunk.h"
6#include "Img.h"
7
8namespace ehs
9{
10 class EHS_LIB_IO PNG
11 {
12 private:
13 Str_8 id;
14 UInt_64 hashId;
15 Array<PNG_Chunk> chunks;
16
17 public:
18 PNG();
19
20 PNG(const Str_8& filePath);
21
22 PNG(const Str_8& id, Serializer<UInt_64>& data);
23
24 PNG(const PNG& png);
25
26 PNG& operator=(const PNG& png);
27
28 bool HasChunk(const UInt_64 hashId) const;
29
30 bool HasChunk(const Str_8& id) const;
31
32 PNG_Chunk* GetChunk(const UInt_64 hashId);
33
34 PNG_Chunk* GetChunk(const Str_8& id);
35
36 static bool IsPNG(Serializer<UInt_32>& data);
37
38 static void FilterNone(const Byte* const in, Byte* const out, const UInt_8 bitDepth, const UInt_8 channels, const UInt_32 scanline);
39
40 static void FilterSub(const Byte* const in, Byte* const out, const UInt_8 bitDepth, const UInt_8 channels, const UInt_32 scanline);
41
42 static void FilterUp(const Byte* const in, Byte* const out, const UInt_8 bitDepth, const UInt_8 channels, const UInt_32 scanline);
43
44 static void FilterAverage(const Byte* const in, Byte* const out, const UInt_8 bitDepth, const UInt_8 channels, const UInt_32 scanline);
45
46 static void FilterPaeth(const Byte* const in, Byte* const out, const UInt_8 bitDepth, const UInt_8 channels, const UInt_32 scanline);
47
48 private:
49 static Byte PaethPredictor(const Byte a, const Byte b, const Byte c);
50 };
51}
Definition Array.h:16
Definition PNG_Chunk.h:10
static void FilterUp(const Byte *const in, Byte *const out, const UInt_8 bitDepth, const UInt_8 channels, const UInt_32 scanline)
Definition PNG.cpp:174
static void FilterPaeth(const Byte *const in, Byte *const out, const UInt_8 bitDepth, const UInt_8 channels, const UInt_32 scanline)
Definition PNG.cpp:201
PNG & operator=(const PNG &png)
Definition PNG.cpp:94
bool HasChunk(const UInt_64 hashId) const
Definition PNG.cpp:106
static void FilterAverage(const Byte *const in, Byte *const out, const UInt_8 bitDepth, const UInt_8 channels, const UInt_32 scanline)
Definition PNG.cpp:183
PNG()
Definition PNG.cpp:7
static void FilterNone(const Byte *const in, Byte *const out, const UInt_8 bitDepth, const UInt_8 channels, const UInt_32 scanline)
Definition PNG.cpp:148
static bool IsPNG(Serializer< UInt_32 > &data)
Definition PNG.cpp:134
static void FilterSub(const Byte *const in, Byte *const out, const UInt_8 bitDepth, const UInt_8 channels, const UInt_32 scanline)
Definition PNG.cpp:157
PNG_Chunk * GetChunk(const UInt_64 hashId)
Definition PNG.cpp:120
Definition Serializer.h:25
Definition Anchor.h:6
unsigned int UInt_32
Definition Types.h:49
unsigned char UInt_8
Definition Types.h:43
Str< Char_8, UInt_64 > Str_8
Definition Str.h:1953
unsigned char Byte
Definition Types.h:39