aboutsummaryrefslogtreecommitdiff
path: root/header.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-08-28 15:42:07 +0200
committerCharles <sircharlesaze@gmail.com>2019-08-28 15:42:07 +0200
commit29efc28aec91f7b9ca20865d54a9d570f409476e (patch)
treef3992781df58fd23cde830eedb4126dc899ed135 /header.h
parentdf6e7cbaa0edf2df8b5f3929a2eb34fa2aa5a28c (diff)
downloadmandelbrot_cpu-29efc28aec91f7b9ca20865d54a9d570f409476e.tar.gz
mandelbrot_cpu-29efc28aec91f7b9ca20865d54a9d570f409476e.tar.bz2
mandelbrot_cpu-29efc28aec91f7b9ca20865d54a9d570f409476e.zip
Color as union
Replace int color with union to have the posibility to set them with hexcode and retrive each color separatly as the member of a struct.
Diffstat (limited to 'header.h')
-rw-r--r--header.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/header.h b/header.h
index fba32c6..34d616b 100644
--- a/header.h
+++ b/header.h
@@ -10,12 +10,22 @@
# define REAL_RANGE 4.0
# define IMAG_RANGE 4.0
-# define MAX_ITERATION 35
+# define MAX_ITERATION 50
# define ESCAPE_VALUE 2
-/* typedef long double LDouble; */
+typedef unsigned char Byte;
+typedef int ColorHexcode;
-typedef int Color;
+typedef union
+{
+ ColorHexcode hexcode;
+ struct
+ {
+ Byte b;
+ Byte g;
+ Byte r;
+ } rgb;
+} Color;
typedef struct
{
@@ -34,6 +44,7 @@ typedef struct
double real_range;
double imag_range;
Color *palette;
+ Color in_set_color;
} GState;
// mandelbrot.c