Some encode/decode practice.
This commit is contained in:
parent
8a41337e2d
commit
ff962a6b16
29 changed files with 727 additions and 305 deletions
33
src/image/PngElements.h
Normal file
33
src/image/PngElements.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
namespace Png
|
||||
{
|
||||
struct IHDRChunk
|
||||
{
|
||||
unsigned width{0};
|
||||
unsigned height{0};
|
||||
char bitDepth{0};
|
||||
char colorType{0};
|
||||
char compressionMethod{0};
|
||||
char filterMethod{0};
|
||||
char interlaceMethod{0};
|
||||
|
||||
std::string toString() const
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << "width: " << width << "\n";
|
||||
sstr << "height: " << height << "\n";
|
||||
sstr << "bitDepth: " << (int)bitDepth << "\n";
|
||||
sstr << "colorType: " << (int)colorType << "\n";
|
||||
sstr << "compressionMethod: " << (int)compressionMethod << "\n";
|
||||
sstr << "filterMethod: " << (int)filterMethod << "\n";
|
||||
sstr << "interlaceMethod: " << (int)interlaceMethod << "\n";
|
||||
return sstr.str();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue