-
Notifications
You must be signed in to change notification settings - Fork 2
/
of.noise-help.pd
154 lines (154 loc) · 4.58 KB
/
of.noise-help.pd
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#N canvas 573 174 707 593 12;
#X declare -lib ofelia;
#X obj 9 10 cnv 15 600 60 empty empty empty 20 12 0 14 -233017 -66577
0;
#X floatatom 70 413 5 0 0 0 - - -;
#X obj 30 442 of.rotate;
#X obj 462 45 declare -lib ofelia;
#X text 36 478 Texture on a geo:;
#X floatatom 236 255 5 0 0 0 - - -;
#X floatatom 106 253 5 0 0 0 - - -;
#X obj 30 498 of.plane 500 500;
#X text 149 252 noisescale;
#X text 28 32 A simple noise texture generaor (experimental);
#X msg 75 113 allocate 10 10 0;
#X text 278 253 noise Velocity;
#X floatatom 181 487 5 0 0 0 - - -;
#X floatatom 212 456 5 0 0 0 - - -;
#X floatatom 244 429 5 0 0 0 - - -;
#X obj 181 403 unpack 0 0 0 0;
#X text 181 507 width;
#X text 216 477 height;
#X text 290 454 1 = rgb;
#X text 290 444 0 = grayscale;
#X text 290 464 3 = rgba;
#X msg 490 303 get, f 4;
#X msg 101 220 filter \$1;
#X obj 101 199 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#N canvas 816 141 454 299 process 0;
#X msg 39 138 crop 100 100 100 100;
#X msg 39 164 cropfrom img 100 100 300 300;
#X msg 40 35 setimagetype 0;
#X msg 40 60 mirror 1 0;
#X text 124 60 vertical \, horizontal;
#X msg 40 85 rotate 1;
#X msg 40 111 resize 10 10;
#X text 124 85 rotate by 90°;
#X text 144 111 resize width \, height;
#X text 152 35 0= Grayscale \, 1 =rgb \, 2 = rgba;
#X obj 8 211 outlet;
#X text 245 163 to do...;
#X text 190 138 width \, height \, posX \, posY (careful);
#X connect 0 0 10 0;
#X connect 1 0 10 0;
#X connect 2 0 10 0;
#X connect 3 0 10 0;
#X connect 5 0 10 0;
#X connect 6 0 10 0;
#X restore 453 132 pd process;
#N canvas 629 136 651 566 Get_&_Set_Pixels 0;
#X floatatom 96 185 5 0 0 0 - - -;
#X msg 305 209 update;
#X msg 226 377 clear;
#X text 203 54 (0= Grayscale \, 1 =rgb \, 2 = rgba);
#X msg 96 140 fill 0 0 0;
#X msg 96 210 setpixel \$1 5 255 0 0 255;
#X text 300 185 need after:;
#X floatatom 96 234 5 0 0 0 - - -;
#X msg 96 260 setpixel \$1 0 255 255 255 \, update;
#X floatatom 99 289 5 0 0 0 - - -;
#X obj 48 441 print pixels;
#X msg 99 327 getpixel \$1 4;
#X text 285 91 draw on screen (active \, posX \, posY \, width \, height)
;
#X text 205 39 PixWidths \, PixHeights \, colortype;
#X text 273 377 clear all pixels = careful \, need re-allocate!;
#X text 145 290 Get pixels to middle outlet;
#X msg 86 90 draw 1 -200 -200 10 200 200;
#X text 86 21 1/;
#X text 96 67 2/;
#X text 107 118 3/;
#X text 183 141 fill all black (rgb or rgba if colortype =2);
#N canvas 470 402 647 300 Work_with_alpha 0;
#X obj 56 227 outlet;
#X floatatom 85 106 5 0 0 0 - - -;
#X msg 56 44 allocate 10 10 2 \, fill 200 0 0 50 \, draw 1 -150 -150
10 300 300;
#X text 55 20 allocate colortype =2 \, fill rgba (alpha = 50) \, draw
300x300px, f 67;
#X text 131 106 need after \, and update (carefull of the values!)
;
#X msg 85 132 setpixel \$1 0 255 255 255 150 \, update;
#X text 241 153 alpha = 150;
#X connect 1 0 5 0;
#X connect 2 0 0 0;
#X connect 5 0 0 0;
#X restore 227 346 pd Work_with_alpha;
#X msg 71 44 allocate 10 10 1;
#X text 140 182 Set pixels;
#X text 142 234 need after \, and update (carefull of the values!)
;
#X floatatom 227 412 5 0 0 0 - - -;
#X msg 227 436 grab \$1 100 100 100;
#X obj 22 402 of.noise;
#X obj 22 483 of.plane;
#X obj 22 8 of.draw;
#X connect 0 0 5 0;
#X connect 1 0 27 0;
#X connect 2 0 27 0;
#X connect 4 0 27 0;
#X connect 5 0 27 0;
#X connect 7 0 8 0;
#X connect 8 0 27 0;
#X connect 9 0 11 0;
#X connect 11 0 27 0;
#X connect 16 0 27 0;
#X connect 21 0 27 0;
#X connect 22 0 27 0;
#X connect 25 0 26 0;
#X connect 26 0 27 0;
#X connect 27 0 28 0;
#X connect 27 1 10 0;
#X connect 29 0 27 0;
#X restore 453 168 pd Get_&_Set_Pixels;
#X obj 30 83 of.draw;
#X msg 85 143 allocate 64 64 1;
#X msg 95 172 allocate 128 128 2;
#X msg 106 276 noisescale \$1;
#X msg 236 278 noisevel \$1;
#X text 122 196 filter;
#X text 530 305 infos from right outlet;
#X msg 493 273 generate;
#X msg 402 271 auto 0;
#X text 292 429 Color_type:;
#X text 199 339 arguments: allocate width height color_type auto;
#X text 394 234 auto generate noise (default 1), f 17;
#X text 558 274 manual regenerate;
#X obj 105 371 print pix;
#X obj 30 339 of.noise 10 10 0, f 22;
#X obj 518 19 of.window 1;
#X obj 497 21 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X connect 1 0 2 2;
#X connect 2 0 7 0;
#X connect 5 0 30 0;
#X connect 6 0 29 0;
#X connect 10 0 40 0;
#X connect 15 0 12 0;
#X connect 15 1 13 0;
#X connect 15 2 14 0;
#X connect 21 0 40 0;
#X connect 22 0 40 0;
#X connect 23 0 22 0;
#X connect 26 0 40 0;
#X connect 27 0 40 0;
#X connect 28 0 40 0;
#X connect 29 0 40 0;
#X connect 30 0 40 0;
#X connect 33 0 40 0;
#X connect 34 0 40 0;
#X connect 40 0 2 0;
#X connect 40 1 39 0;
#X connect 40 2 15 0;
#X connect 42 0 41 0;