diff options
| author | Dylan <boss@tehbox.org> | 2026-05-06 15:55:37 +1200 |
|---|---|---|
| committer | Dylan <boss@tehbox.org> | 2026-05-06 15:55:51 +1200 |
| commit | 4d5d07beeef8ae4b7daf602bf66216ed8ff81442 (patch) | |
| tree | 77decab5aedd2650e0678c3845a27c8e18ef8909 | |
| parent | d60976a70e68e1cd312b0e56fe6fbe6c7428cbaa (diff) | |
| download | tehimage-4d5d07beeef8ae4b7daf602bf66216ed8ff81442.tar.gz tehimage-4d5d07beeef8ae4b7daf602bf66216ed8ff81442.zip | |
feat: Started on PNG writing implementation
| -rw-r--r-- | src/BMPImage.cpp | 2 | ||||
| -rw-r--r-- | src/files.cpp | 1 | ||||
| -rw-r--r-- | src/files.h | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/src/BMPImage.cpp b/src/BMPImage.cpp index a22e65d..3e3f675 100644 --- a/src/BMPImage.cpp +++ b/src/BMPImage.cpp @@ -117,6 +117,7 @@ namespace TehImage for(int y = height-1; y >= 0; y--) { + writer.flushBuffer(); for(int x = 0; x < width; x++) { Pixel& pixel = (*this)[x,y]; @@ -125,6 +126,7 @@ namespace TehImage writer.writeData(pixel.r); } writer.zeroBytes((4-((width * 3)%4))%4); + writer.flushBuffer(); } writer.close(); diff --git a/src/files.cpp b/src/files.cpp index 20f2672..c4c46a9 100644 --- a/src/files.cpp +++ b/src/files.cpp @@ -115,6 +115,7 @@ namespace TehImage :fileEndianness(fileEndianness) { file = fopen(filename.c_str(), "w"); + pos = 0; ready = true; } diff --git a/src/files.h b/src/files.h index ad65ce8..8d7d12f 100644 --- a/src/files.h +++ b/src/files.h @@ -4,7 +4,7 @@ #include <string> #define READER_BUFFER_SIZE 4096 -#define WRITER_BUFFER_SIZE 4096 +#define WRITER_BUFFER_SIZE 65536 #define DEFINE_INT_READER(TYPE) \ template<> TYPE Reader::readData<TYPE>() \ |
