render_raw.h
changeset 13 ee426f453cf5
child 17 8e8b56b0e0f5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/render_raw.h	Sat Jun 07 05:05:18 2008 +0300
@@ -0,0 +1,41 @@
+#ifndef RENDER_RAW_H
+#define RENDER_RAW_H
+
+#include "render.h"
+
+/*
+ * For rendering raw pixel data
+ */
+struct render_raw;
+
+/*
+ * Build and return a render_raw that can be used to handle the raw rendered pixel data.
+ *
+ * If render's I/O was set up with render_io_stream, the raw pixels will simply
+ * be fwritten to that stream (and fflushed at the end). If I/O was set up with
+ * render_io_custom, write_fn will be called with a row of pixel data (a buffer
+ * img_w bytes long) for every row that's written. Flush_fn will be called once
+ * all the pixels have been "written".
+ *
+ * returns NULL on failure.
+ */
+struct render_raw *render_raw_init (struct render *render);
+
+/*
+ * Feed a full row of raw pixel data to be handled
+ *
+ * buf must be render.img_w bytes wide.
+ */
+int render_raw_row (struct render_raw *ctx, unsigned char *rowbuf);
+
+/*
+ * Mark the render as complete and free the render_raw, flushing out any remaining data.
+ */
+int render_raw_done (struct render_raw *ctx);
+
+/*
+ * Abort the render, free the render_raw, and discard any remaining data.
+ */
+int render_raw_abort (struct render_raw *ctx);
+
+#endif /* RENDER_RAW_H */