render_struct.h
author Tero Marttila <terom@fixme.fi>
Tue, 17 Jun 2008 19:08:05 +0300
changeset 22 4627760fc0d1
parent 17 8e8b56b0e0f5
permissions -rw-r--r--
add img_{left,right,top,bottom} and img_{x,y}_step to struct render and change render_mandelbrot/slices to use them

committer: Tero Marttila <terom@fixme.fi>
#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 */