render_struct.h
author Tero Marttila <terom@fixme.fi>
Wed, 27 Aug 2008 21:30:32 +0300
changeset 41 540737bf6bac
parent 22 4627760fc0d1
permissions -rw-r--r--
sending requests, and partial support for receiving -- incomplete, not tested
#ifndef RENDER_STRUCT_H
#define RENDER_STRUCT_H

#include "render.h"

struct render {
/* render mode */
    int mode;

/* image size */
    u_int32_t img_w;
    u_int32_t img_h;

/* mandelbrot region */
    double      x1;
    double      y1;
    double      x2;
    double      y2;

/* render region */
    u_int32_t img_left, img_right, img_top, img_bottom;
    u_int32_t img_x_step, img_y_step;

/* local rendering */
    unsigned char **local_rowbuf_addr;
    render_ctx_row_cb local_row_fn;

/* local I/O parameters */
    // if this is non-NULL, the image data is simply fwrite():en to this stream
    FILE *io_stream;

    // called to handle the output data
    render_ctx_write_cb io_write_fn;

    // called when the output data should be flushed - can be safely ignored if not needed
    render_ctx_flush_cb io_flush_fn;

    // the callback argument for all of the above *_fn
    void *cb_arg;
};

#endif /* RENDER_STRUCT_H */