-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfractalrenderer.h
More file actions
72 lines (62 loc) · 1.69 KB
/
fractalrenderer.h
File metadata and controls
72 lines (62 loc) · 1.69 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef FRACTALRENDERER_H
#define FRACTALRENDERER_H
#include "common_type.h"
#include <vector>
#include <QObject>
const int PALETE_STEP = 5;
const int MAX_INTERATION = 255;
const double INIT_LEFT = -3.0f;
const double INIT_TOP = -2.0f;
const double INIT_RIGHT = 1.0f;
const double INIT_BOTTOM = 2.0f;
const double INIT_LEFT_JULIA = -2.0f;
const double INIT_TOP_JULIA = -2.0f;
const double INIT_RIGHT_JULIA = 2.0f;
const double INIT_BOTTOM_JULIA = 2.0f;
class FractalRenderer
#if _DEV_QT
: public QObject
#endif
{
#if _DEV_QT
Q_OBJECT
#endif//_DEV_QT
public:
FractalRenderer(int _w = 0, int _h = 0);
virtual ~FractalRenderer();
const IndexOfPt* getImageData() const
{
return imageData;
}
int area() const
{
return widthEx * height;
}
void renderMandelbrot();
void moveProcess(int dx, int dy, double top, double left, double down, double right);
void resize(int _w, int _h);
void setInterval(int newInt)
{
maxInterval = newInt;
}
// void renderMandelbrot(double left, double top, double right, double bottom);
void renderMandelbrotMultithreaded(double left, double top, double right, double bottom);
void renderJulia(Complex c, double left, double top, double right, double bottom);
void setJulia(bool mode) { isJulia = mode; }
private:
int width;
int height;
int maxWidth;
int maxHeight;
int maxInterval;
Complex lastPoint;
int widthEx;
IndexOfPt *imageData;
bool isJulia;
#if _DEV_QT
signals:
void doneUpdate();
#endif//_DEV_QT
};
#endif // FRACTALRENDERER_H
//EOF