Rev 2097 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1528 | jag | 1 | /* |
2 | * morpher.h |
||
2302 | jag | 3 | * DIN Is Noise is copyright (c) 2006-2025 Jagannathan Sampath |
1713 | jag | 4 | * DIN Is Noise is released under GNU Public License 2.0 |
1528 | jag | 5 | * For more information, please visit https://dinisnoise.org/ |
6 | */ |
||
7 | |||
8 | |||
9 | #ifndef __MORPHER |
||
10 | #define __MORPHER |
||
11 | |||
12 | #include "spinner.h" |
||
13 | #include "plugin.h" |
||
14 | #include "curve_display.h" |
||
15 | #include "solver.h" |
||
16 | #include "slider.h" |
||
17 | |||
1546 | jag | 18 | // morphs two bezier curves (classic or shapeform) |
1528 | jag | 19 | struct morpher : plugin, change_listener< slider<float> > { |
20 | |||
1545 | jag | 21 | slider<float> sl_amount; |
1528 | jag | 22 | slider<float> sl_src_start, sl_tar_start; |
1545 | jag | 23 | spinner<int> sp_points; |
1528 | jag | 24 | |
25 | int num_points; |
||
26 | float amount; |
||
27 | |||
1545 | jag | 28 | struct dat { |
29 | label lbl; |
||
30 | curve_display cd; |
||
31 | button get; |
||
32 | multi_curve crv; |
||
33 | solver sol; |
||
34 | std::vector < point<float> > pts; |
||
35 | int start, cur, total; |
||
36 | dat () {start = cur = total = 0;} |
||
37 | } src, tar; |
||
38 | |||
1528 | jag | 39 | morpher (); |
40 | ~morpher (); |
||
41 | |||
42 | void assign_curve (multi_curve& crv, solver& sol, curve_display& crvdis); |
||
43 | void make_points (); |
||
44 | void make_classic_pts (std::vector < point<float> >& pts, solver& sol); |
||
45 | void make_shapeform_pts (std::vector < point<float> >& pts, solver& sol, multi_curve& crv); |
||
46 | void clicked (button& b); |
||
47 | void changed (field& f); |
||
48 | void changed (slider<float>& s); |
||
49 | void load_params (); |
||
50 | void save_params (); |
||
51 | void setup (); |
||
52 | void render (); |
||
53 | int apply (multi_curve& crv); |
||
54 | |||
55 | }; |
||
56 | #endif |