-
Notifications
You must be signed in to change notification settings - Fork 0
/
mandelbrot.h
40 lines (31 loc) · 981 Bytes
/
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
#ifndef MANDELBROT_H
#define MANDELBROT_H
#include <QLabel>
class Mandelbrot : public QLabel
{
Q_OBJECT
public:
explicit Mandelbrot(QWidget *parent = nullptr);
int calcIterations(double ptX, double ptY);
QPointF getMathCoord(int ptX, int ptY);
QPoint getDispCoord(double ptX, double ptY);
std::vector<QPoint> calcOrbit(QPointF);
void calcMandelbrot();
QSharedPointer<QImage> getImage();
public slots:
void recieveJuliaCoord(QPointF);
protected:
void paintEvent(QPaintEvent *event) override;
void mousePressEvent(QMouseEvent* event) override;
void mouseMoveEvent(QMouseEvent* event) override;
void mouseReleaseEvent(QMouseEvent* event) override;
signals:
void sendMouseCoord(QPointF);
private:
int _minIterations = 1;
int _maxIterations = 100;
std::vector<QPoint> _orbit;
QSharedPointer<QImage> _brotImage;
int _maxOrbitLen = 100;
};
#endif // MANDELBROT_H