diff options
| author | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-05-21 08:19:09 +1000 |
|---|---|---|
| committer | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-05-21 08:19:09 +1000 |
| commit | a03feadd2a5a247b719e3798468eec13bc25fc48 (patch) | |
| tree | 4b25221add430b4ddd6477c660dab6a7f469c00e /src | |
| parent | 1dce609c8ee560ec9f75961063f56cc58da84764 (diff) | |
feat(png): Implement chunk writer in PNG encoder
Diffstat (limited to 'src')
| -rw-r--r-- | src/format/image/png.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/format/image/png.c b/src/format/image/png.c index 5b0c3d2..728fc23 100644 --- a/src/format/image/png.c +++ b/src/format/image/png.c @@ -1,3 +1,4 @@ +#include "tinyff/result.h" #include <tinyff/common.h> #include <tinyff/image/png.h> @@ -479,6 +480,14 @@ ff_result ff_close_png(ff_ctx* ctx, ff_png_ctx *png_ctx) return FF_RESULT_OK; } +ff_result ff_write_chunk(ff_stream *stream, const char *type, uint8_t *buf, size_t len) +{ + stream->write(stream, 4, type); + stream->write(stream, 4, (uint32_t*)&len); + stream->write(stream, len, buf); + stream->write(stream, 4, (uint32_t*)0); // TODO: Implement actual CRC calculation (use ff_write_be32) + return FF_RESULT_OK; +} ff_result ff_png_normalize(ff_ctx *ctx, ff_png_ctx *png_ctx, ff_image_ctx **out_data, ff_flag consume) { |
