/* qbism.h * * Andy Goth * * Derived from, and hopefully compatible with, GIMP's gqbist.c, originally by * Jens Ch. Restemeier . gqbist.c is available * under the GPL (GNU General Public License), version 2 or later. Therefore, * the file is also available under the GPL. And there was much rejoicing. */ #include /* All suppoted transformation operations. */ typedef enum { XOP_PROJECTION, XOP_SHIFT, XOP_SHIFTBACK, XOP_ROTATE, XOP_ROTATE2, XOP_MULTIPLY, XOP_SINE, XOP_CONDITIONAL, XOP_COMPLEMENT, XOP_COUNT } xform_op_t; /* A single transformation instruction. */ typedef struct { xform_op_t opcode; /* Operation to perform. */ int source; /* Index of the source register. */ int control; /* Index of the control register. */ int dest; /* Index of the destination register. */ } xform_t; /* A sequence of transformation instructions. */ typedef struct { xform_t* seq; /* The sequence of instructions. */ int num_steps; /* Number of instructions in the sequence. */ int num_regs; /* Number of registers needed. */ } algo_t; /* A register. Consists of red, green, and blue channels. */ typedef float reg_t[3]; void* xmalloc(size_t bytes); void* xrealloc(void* buf, size_t bytes); void algo_read_qbe(algo_t* algo, FILE* in); void algo_write_qbe(algo_t* algo, FILE* out); void qbism_render(algo_t* algo, int width, int height, FILE* out); /* vim: set ts=4 sts=4 sw=4 tw=80 et: */