-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfractalworker.h
More file actions
42 lines (36 loc) · 1.26 KB
/
fractalworker.h
File metadata and controls
42 lines (36 loc) · 1.26 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
#ifndef FRACTALWORKER_H
#define FRACTALWORKER_H
#include <QRunnable>
#include <QImage>
#include <QObject>
#include <QMutex>
#include "common_type.h"
class FractalWorker : public QObject, public QRunnable
{
Q_OBJECT
public:
FractalWorker(int startY, int endY, double left, double top, double xInterval, double yInterval,
int width, int height, int maxIterations, IndexOfPt* imageData,
bool isJulia, Complex lastPoint)
: startY(startY), endY(endY), left(left), top(top), xInterval(xInterval), yInterval(yInterval),
width(width), height(height), maxIterations(maxIterations), imageData(imageData),
isJulia(isJulia), lastPoint(lastPoint) {}
~FractalWorker() override = default;
void run() override;
signals:
void finished();
private:
// Worker parameters
int startY, endY;
double left, top, xInterval, yInterval;
int width, height, maxIterations;
IndexOfPt* imageData;
// Fractal-specific parameters
bool isJulia;
Complex lastPoint;
private:
inline int calcPoint(Complex start, Complex c) const;
inline int calcPointAVX(Complex z, Complex c) const;
inline int calcPointSmoothAVX(Complex z, Complex c) const;
};
#endif // FRACTALWORKER_H