diff options
| author | Dylan <boss@tehbox.org> | 2026-05-06 13:39:47 +1200 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2026-05-06 13:39:47 +1200 |
| commit | d60976a70e68e1cd312b0e56fe6fbe6c7428cbaa (patch) | |
| tree | 00bc987a6d935ca26e4d4c2d61ad70d7aa3c2f4c /src/files.h | |
| parent | a75bdd0e167140eeb4afb091c9dedd84474c8531 (diff) | |
| download | tehimage-d60976a70e68e1cd312b0e56fe6fbe6c7428cbaa.tar.gz tehimage-d60976a70e68e1cd312b0e56fe6fbe6c7428cbaa.zip | |
feat: Started on PNG writing implementation
Currently writes IHDR and IEND chunks correctly
CRC implementation is borrowed from the specification
Writer class now also has a buffer for the CRC calculation
Diffstat (limited to 'src/files.h')
| -rw-r--r-- | src/files.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/files.h b/src/files.h index fbbe8b7..ad65ce8 100644 --- a/src/files.h +++ b/src/files.h @@ -4,6 +4,7 @@ #include <string> #define READER_BUFFER_SIZE 4096 +#define WRITER_BUFFER_SIZE 4096 #define DEFINE_INT_READER(TYPE) \ template<> TYPE Reader::readData<TYPE>() \ @@ -78,8 +79,12 @@ namespace TehImage void zeroBytes(std::size_t len); void close(); + + void flushBuffer(); + + char buffer[WRITER_BUFFER_SIZE]; + std::size_t pos; private: - /* std::size_t pos; */ FILE* file; bool ready = false; FileEndianness fileEndianness; |
