shithub: fractals

ref: 2f01a3e20e819812fc873f67940bf0011f49717d
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);