-
Notifications
You must be signed in to change notification settings - Fork 0
/
ifs.h
54 lines (42 loc) · 1.33 KB
/
ifs.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
#include "art.hpp"
#include "imgui.h"
#include <vector>
#include "settings.hpp"
struct Lens {
float r, s, tx, ty; /* Rotation, Scale, Translation X & Y */
float ro, rt, rc; /* Old Rotation, Rotation Target, Rotation Counter */
float so, st, sc; /* Old Scale, Scale Target, Scale Counter */
float sa, txa, tya; /* Scale change, Translation change */
int ua, ub, utx; /* Precomputed combined r,s,t values */
int uc, ud, uty; /* Precomputed combined r,s,t values */
};
class IFS : public Art {
public:
IFS()
: Art("IFS") {}
private:
virtual bool render_gui() override;
virtual void resize(int _w, int _h) override;
virtual bool render(uint32_t *p) override;
int ncolours = 1024;
int ccolour;
int widthb;
int width8, height8;
int pscale;
int lensnum = 3;
std::vector<Lens> lenses;
int length = 9;
int mode = 0;
bool brecurse = false;
bool multi = true;
bool translate = true, scale = true, rotate = true;
ImVec4 foreground = ImVec4(0, 1, 0, 1);
uint32_t current_color;
//void drawpoints();
void sp(int x, int y);
void lensmatrix(Lens *l);
void CreateLens(float nr, float ns, float nx, float ny, Lens *newlens);
void mutate(Lens *l);
void recurse(int x, int y, int length, int p);
void iterate(int count, int p);
};