shithub: fractals

ref: c52df87d07198a3140227a03a9ddddddd418777a
dir: /gen.h/

View raw version
typedef struct SetParams SetParams;
struct SetParams {
	int julia;
	Complex c;
	int iterations;
};

typedef struct DrawParams DrawParams;
struct DrawParams {
	float scale;
	float offsetx;
	float offsety;
};

/* generate
 *  nil → err
 *    * → image
 */
Memimage* generate(int x, int y, SetParams params, DrawParams dparams);

/* iterate
 *  0 → err
 * >0 → out is valid, value is num iterations
 */
int calc(Complex *out, Complex c, SetParams params);

/* is c inside ℂ
 * -1 → err
 *  0 → c ∉ ℂ
 *  1 → c ∈ ℂ
 */
int ∈(Complex c, SetParams params);