diff options
| author | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-04-15 17:34:02 +1000 |
|---|---|---|
| committer | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-04-15 17:34:02 +1000 |
| commit | 76107d44f5e30edfd3b89a0363cd00d117dccd4f (patch) | |
| tree | 36ce3d754b9277658030ea10594f13e0afdb5104 /include/tinyff | |
| parent | c4836057209ad7961b07518e43c8ba2277258513 (diff) | |
feat(png): Implement genericness for PNG
Diffstat (limited to 'include/tinyff')
| -rw-r--r-- | include/tinyff/image/png.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/include/tinyff/image/png.h b/include/tinyff/image/png.h index 5119fb1..b52845a 100644 --- a/include/tinyff/image/png.h +++ b/include/tinyff/image/png.h @@ -2,10 +2,8 @@ #define PNG_H #include <stdint.h> -#include <stdio.h> #include <stdbool.h> #include <string.h> -#include <stdlib.h> #include <tinyff/tinyff.h> #include <tinyff/common.h> @@ -22,8 +20,8 @@ static const unsigned char PNG_SIGNATURE[8] = { typedef enum { FF_PNG_MODE_NONE = 0, - FF_PNG_MODE_DIRECT_COLOR, // pixels - FF_PNG_MODE_PALETTE // palette + FF_PNG_MODE_DIRECT_COLOR = 1, // pixels + FF_PNG_MODE_PALETTE = -1 // palette } ff_png_mode; typedef struct { @@ -58,10 +56,6 @@ typedef struct { } ff_png_ctx; -// Small BpP helper function - -static inline uint16_t ff_png_bpp(ff_png_ctx *ctx); - typedef ff_result (*ff_png_chunk_handler_ptr)(ff_ctx* ctx, uint8_t *buf, size_t len, ff_png_ctx* png_ctx); @@ -92,6 +86,6 @@ ff_result ff_png_isvalid(ff_ctx* ctx, ff_stream *stream); ff_result ff_open_png(ff_ctx* ctx, ff_stream *stream, ff_png_ctx **out_ctx, ff_flag require_valid); ff_result ff_close_png(ff_ctx* ctx, ff_png_ctx *png_ctx); -ff_result ff_png_normalize(ff_ctx* ctx, ff_png_ctx *png_ctx, ff_image_ctx **out_data); +ff_result ff_png_normalize(ff_ctx* ctx, ff_png_ctx *png_ctx, ff_image_ctx **out_data, ff_flag consume); #endif |
