#ifndef ANIMTOOL_NUT_H_ #define ANIMTOOL_NUT_H_ #include #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