diff options
| author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-12 20:57:06 +0200 |
|---|---|---|
| committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-12 20:59:39 +0200 |
| commit | e5af28536bfb0f4c9131df56d2009ba5196f5e3a (patch) | |
| tree | 3ab928f961a1ccd8440b070d7b57f79146457e8c /src/fmt/nut.h | |
| download | animtool-e5af28536bfb0f4c9131df56d2009ba5196f5e3a.tar.xz | |
init
Diffstat (limited to 'src/fmt/nut.h')
| -rw-r--r-- | src/fmt/nut.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/fmt/nut.h b/src/fmt/nut.h new file mode 100644 index 0000000..383eaad --- /dev/null +++ b/src/fmt/nut.h @@ -0,0 +1,46 @@ +#ifndef ANIMTOOL_NUT_H_ +#define ANIMTOOL_NUT_H_ + +#include <stdio.h> +#include "util/str.h" +#include "util/container.h" + +enum nut_output_type : uint8_t { + NUT_OUT_FILE, + NUT_OUT_STATIC, + NUT_OUT_HEAP, +}; + +struct nut_output +{ + enum nut_output_type type; + size_t len; + union { + FILE *file; + struct { + size_t cap; + char *ptr; + }; + }; +}; + +struct nut_syncp_off +{ + size_t off; + size_t num; +}; + +struct nut_writer +{ + struct nut_output out; + size_t frame_size; + size_t last_syncpoint; + size_t n_frame; + arraybuf(struct nut_syncp_off) syncp_offs; +}; + +void nut_write_start(struct nut_writer *wr, FILE *f, unsigned int fps, unsigned int size[2]); +void nut_write_frame(struct nut_writer *wr, void *data); +void nut_write_end(struct nut_writer *wr); + +#endif |
