#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_alloc (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 */