forked from jasoncoon/LightAppliance
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMandelbrot.h
57 lines (46 loc) · 1.31 KB
/
Mandelbrot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef Mandelbrot_H
#define Mandelbrot_H
#include "SmartMatrix_32x32.h"
#include "IRremote.h"
class Mandelbrot{
private:
SmartMatrix *matrix;
IRrecv *irReceiver;
unsigned long lastInput = 0;
static unsigned const MAXIMUM = 32;
unsigned MaxIterations = 30;
int NUMBER_OF_COLORS = MaxIterations;
unsigned halfMaxIterations = MaxIterations / 2;
rgb24 colors[MAXIMUM];
double imageHeight = 32;
double imageWidth = 32;
double MinRe = -2.0; // left
double MaxRe = 1.0; // right
double MinIm = -1.5; // bottom
double zoomFactor = .99;
double width = 3.0;
double MaxIm;
double Re_factor;
double Im_factor;
unsigned y;
double c_im;
unsigned x;
double c_re;
double Z_re;
double Z_im;
bool isInside;
unsigned n;
double Z_re2;
double Z_im2;
char stringBuffer[32];
unsigned long handleInput();
void draw();
void reset();
void generateColors();
rgb24 createHSVColor(float hue, float saturation, float value);
void hsvToRGB(float hue, float saturation, float value, float * red, float * green, float * blue);
public:
void runPattern(SmartMatrix matrixRef, IRrecv irReceiverRef, boolean(*checkForTermination)());
void runGame(SmartMatrix matrixRef, IRrecv irReceiverRef);
};
#endif