aboutsummaryrefslogtreecommitdiff
path: root/header.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-08-29 11:04:35 +0200
committerCharles <sircharlesaze@gmail.com>2019-08-29 11:04:35 +0200
commitf85dda2684d7f75c77e3a78282dae89bc1f5a113 (patch)
tree70a764b14a34cc7aeccb2e5bcc8b3db09e487946 /header.h
parentec7cec7303aa642d234f444208a044dcc87904a4 (diff)
downloadmandelbrot_cpu-f85dda2684d7f75c77e3a78282dae89bc1f5a113.tar.gz
mandelbrot_cpu-f85dda2684d7f75c77e3a78282dae89bc1f5a113.tar.bz2
mandelbrot_cpu-f85dda2684d7f75c77e3a78282dae89bc1f5a113.zip
Complex number optimization
Stop using the complex standard lib, replaced it with a variables for the real part and imaginary part of z.
Diffstat (limited to 'header.h')
-rw-r--r--header.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/header.h b/header.h
index cd5a988..741919e 100644
--- a/header.h
+++ b/header.h
@@ -10,8 +10,9 @@
# define REAL_RANGE 4.0
# define IMAG_RANGE 4.0
-# define MAX_ITERATION 20
-# define ESCAPE_VALUE 2
+# define MAX_ITERATION 35
+# define ESCAPE_RADIUS 2
+# define ESCAPE_RADIUS_SQUARED (ESCAPE_RADIUS * ESCAPE_RADIUS)
typedef unsigned char Byte;
typedef int ColorHexcode;
@@ -49,13 +50,16 @@ typedef struct
} GState;
// mandelbrot.c
-int mandelbrot_in_set(double _Complex c);
+int mandelbrot_in_set(double a, double b);
void mandelbrot_print(void);
+int *mandelbrot_array(Point center, double real_range, double imag_range,
+ double real_len, double imag_len);
// graphics.c
GState *graphics_init(void);
void graphics_quit(GState *state);
void graphics_run(GState *state);
+Color *create_palette(Color start, Color end);
// helper.c
double map_range(double x, double src_lo, double src_hi, double dest_lo, double dest_hi);