summaryrefslogtreecommitdiff
path: root/src/format/image
diff options
context:
space:
mode:
authorTazyFoundSoup <gardendistrict0x0@outlook.com>2026-05-21 08:36:05 +1000
committerTazyFoundSoup <gardendistrict0x0@outlook.com>2026-05-21 08:36:05 +1000
commit0a2dd22857b636c4d8f89fc49b034ac0e493d1bf (patch)
treea2854a5a1790c56eaa351ae70fff2a623eef20df /src/format/image
parentb36db772c2bf9f5702633d094563661d3705e1f1 (diff)
feat(png): Make initial PNG encoder function
Diffstat (limited to 'src/format/image')
-rw-r--r--src/format/image/png.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/format/image/png.c b/src/format/image/png.c
index 728fc23..12080d6 100644
--- a/src/format/image/png.c
+++ b/src/format/image/png.c
@@ -480,6 +480,7 @@ 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);
@@ -489,6 +490,23 @@ ff_result ff_write_chunk(ff_stream *stream, const char *type, uint8_t *buf, size
return FF_RESULT_OK;
}
+ff_result ff_encode_png(ff_ctx *ctx, ff_png_ctx *png_ctx, ff_stream *stream)
+{
+ FF_BENCH_START(ctx, "png");
+ FF_BENCH_MARK(ctx, "ff_encode_png");
+
+ stream->write(stream, 8, PNG_SIGNATURE);
+
+ // TODO: Actually write the PNG data
+ // For now I'll void the parameters
+ (void)ctx;
+ (void)png_ctx;
+
+ FF_BENCH_END(ctx);
+
+ return FF_RESULT_WARN_NO_IMPL;
+}
+
ff_result ff_png_normalize(ff_ctx *ctx, ff_png_ctx *png_ctx, ff_image_ctx **out_data, ff_flag consume)
{
if (png_ctx->bit_depth != 8) return FF_RESULT_WARN_NO_IMPL;