@kolkrabbi/design-editor 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BindDot-xnv1FDLI.js +125 -0
- package/dist/EditorIcon-BbFMmc1G.js +22919 -0
- package/dist/RuleRow-D0nV-GvB.js +584 -0
- package/dist/TreePicker-DlEXH2kw.js +303 -0
- package/dist/core-EQZBciYo.js +14113 -0
- package/dist/core.js +3 -0
- package/dist/design-editor.css +1 -2
- package/dist/design-editor.js +728 -77789
- package/dist/effects-C0ojfSm8.js +4548 -0
- package/dist/effects.js +2 -0
- package/dist/generators-RjXuwET7.js +2958 -0
- package/dist/generators.js +2 -0
- package/dist/{host-CVR9RL_W.js → host-BMD1sgpp.js} +89 -86
- package/dist/labels-B10g9Um5.js +40 -0
- package/dist/motion-ejcDWbeh.js +4319 -0
- package/dist/motion.js +2 -0
- package/dist/registry-C7rLJN2U.js +28794 -0
- package/dist/{src-QwKcYKfv.js → src-BOZt8ciR.js} +1 -1
- package/dist/useLayerEdit-BElo4uVW.js +256 -0
- package/package.json +26 -14
- package/dist/phase-t_DhU5Nm.js +0 -1719
|
@@ -0,0 +1,4548 @@
|
|
|
1
|
+
import { C as e, M as t, R as n, V as r, l as i, n as a, o, ot as s, r as c, s as l, t as u, tn as d } from "./EditorIcon-BbFMmc1G.js";
|
|
2
|
+
import { B as f, G as p, H as m, K as h, U as g, V as _, W as v, o as y, q as b, z as x } from "./registry-C7rLJN2U.js";
|
|
3
|
+
import { _ as S, g as C, n as w, t as T } from "./TreePicker-DlEXH2kw.js";
|
|
4
|
+
import { n as E, r as D, t as ee } from "./useLayerEdit-BElo4uVW.js";
|
|
5
|
+
import { t as O } from "./BindDot-xnv1FDLI.js";
|
|
6
|
+
import { Button as te, LabeledControl as k, SegmentedToggle as ne, Slider as A, ToggleSwitch as j, ViewToggle as M } from "@kolkrabbi/kol-component";
|
|
7
|
+
import { useEffect as N, useRef as re, useState as P } from "react";
|
|
8
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
9
|
+
//#region src/filters/fxCore.js
|
|
10
|
+
var R = {
|
|
11
|
+
key: "amount",
|
|
12
|
+
label: "Amount",
|
|
13
|
+
type: "range",
|
|
14
|
+
min: 0,
|
|
15
|
+
max: 100,
|
|
16
|
+
step: 1,
|
|
17
|
+
default: 100,
|
|
18
|
+
noRandom: !0
|
|
19
|
+
}, ie = /* @__PURE__ */ new Set();
|
|
20
|
+
function ae(e) {
|
|
21
|
+
ie.add(e);
|
|
22
|
+
}
|
|
23
|
+
function oe(e) {
|
|
24
|
+
for (let t of ie) t.delete(e);
|
|
25
|
+
}
|
|
26
|
+
var se = /* @__PURE__ */ new WeakMap();
|
|
27
|
+
ae(se);
|
|
28
|
+
function ce(e) {
|
|
29
|
+
let t = se.get(e);
|
|
30
|
+
if (!t) {
|
|
31
|
+
let n = e.getContext("2d");
|
|
32
|
+
t = {
|
|
33
|
+
base: n.getImageData(0, 0, e.width, e.height),
|
|
34
|
+
out: n.createImageData(e.width, e.height)
|
|
35
|
+
}, se.set(e, t);
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
}
|
|
39
|
+
function z(e, t) {
|
|
40
|
+
let n = Math.sin(e * 127.1 + t * 311.7) * 43758.5453;
|
|
41
|
+
return n - Math.floor(n);
|
|
42
|
+
}
|
|
43
|
+
function le(e, t) {
|
|
44
|
+
let n = (e | 0) * 374761393 + (t | 0) * 668265263;
|
|
45
|
+
return n = (n ^ n >> 13) * 1274126177, ((n ^ n >> 16) >>> 0) / 4294967295;
|
|
46
|
+
}
|
|
47
|
+
var B = null;
|
|
48
|
+
function ue(e, t) {
|
|
49
|
+
return B ||= document.createElement("canvas"), B.width !== e && (B.width = e), B.height !== t && (B.height = t), B;
|
|
50
|
+
}
|
|
51
|
+
function de(e, t, n, r, i) {
|
|
52
|
+
let a = i == null ? 1 : Math.max(0, Math.min(1, i / 100));
|
|
53
|
+
a >= 1 || (e.save(), e.globalAlpha = 1 - a, e.drawImage(t, 0, 0, n, r), e.restore());
|
|
54
|
+
}
|
|
55
|
+
var fe = [];
|
|
56
|
+
function pe(e, t, n) {
|
|
57
|
+
let r = fe[e];
|
|
58
|
+
return r || (r = document.createElement("canvas"), fe[e] = r), r.width !== t && (r.width = t), r.height !== n && (r.height = n), r;
|
|
59
|
+
}
|
|
60
|
+
function me(e, t, n, r, i, a) {
|
|
61
|
+
let o = i.length;
|
|
62
|
+
if (o === 0) {
|
|
63
|
+
e.drawImage(t, 0, 0, n, r);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
let s = t;
|
|
67
|
+
for (let t = 0; t < o; t++) {
|
|
68
|
+
let { def: c, params: l } = i[t];
|
|
69
|
+
if (t === o - 1) {
|
|
70
|
+
c.apply(e, s, n, r, l, a);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
let u = pe(t, s.width, s.height), d = u.getContext("2d");
|
|
74
|
+
d.setTransform(u.width / n, 0, 0, u.height / r, 0, 0), d.clearRect(0, 0, n, r), c.apply(d, s, n, r, l, a), oe(u), s = u;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function V(e, t, n, r, i, a, o) {
|
|
78
|
+
let { base: s, out: c } = ce(t);
|
|
79
|
+
i(s.data, c.data, t.width, t.height, a);
|
|
80
|
+
let l = o == null ? 1 : Math.max(0, Math.min(1, o / 100));
|
|
81
|
+
if (l < 1) {
|
|
82
|
+
let e = s.data, t = c.data;
|
|
83
|
+
for (let n = 0; n < t.length; n += 4) t[n] = e[n] + (t[n] - e[n]) * l, t[n + 1] = e[n + 1] + (t[n + 1] - e[n + 1]) * l, t[n + 2] = e[n + 2] + (t[n + 2] - e[n + 2]) * l;
|
|
84
|
+
}
|
|
85
|
+
let u = ue(t.width, t.height);
|
|
86
|
+
u.getContext("2d").putImageData(c, 0, 0), e.drawImage(u, 0, 0, n, r);
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/filters/glass.js
|
|
90
|
+
var he = Math.PI * 2, ge = (e) => e * e * (3 - 2 * e);
|
|
91
|
+
function _e(e, t) {
|
|
92
|
+
let n = Math.floor(e), r = Math.floor(t), i = e - n, a = t - r, o = le(n, r), s = le(n + 1, r), c = le(n, r + 1), l = le(n + 1, r + 1), u = ge(i), d = ge(a);
|
|
93
|
+
return (o * (1 - u) + s * u) * (1 - d) + (c * (1 - u) + l * u) * d;
|
|
94
|
+
}
|
|
95
|
+
function ve(e, t) {
|
|
96
|
+
let n = 0, r = .5, i = 1;
|
|
97
|
+
for (let a = 0; a < 4; a++) n += r * _e(e * i, t * i), i *= 2, r *= .5;
|
|
98
|
+
return n;
|
|
99
|
+
}
|
|
100
|
+
var H = (e) => le(e, 7) * 2 - 1, ye = [
|
|
101
|
+
{
|
|
102
|
+
id: "panes",
|
|
103
|
+
label: "Panes",
|
|
104
|
+
field(e, t, n, r) {
|
|
105
|
+
let i = Math.max(2, Math.round(3 + n * 6)), a = Math.floor(e * i), o = r ? .25 * Math.sin(r + a) : 0;
|
|
106
|
+
return [H(a * 2) * .35, H(a * 2 + 1) + o];
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: "slivers",
|
|
111
|
+
label: "Slivers",
|
|
112
|
+
field(e, t, n, r) {
|
|
113
|
+
let i = Math.max(4, Math.round(6 + n * 12)), a = Math.floor(e * i), o = r ? .25 * Math.sin(r + a) : 0;
|
|
114
|
+
return [H(a * 2) * .2, H(a * 2 + 1) + o];
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "bands",
|
|
119
|
+
label: "Bands",
|
|
120
|
+
field(e, t, n, r) {
|
|
121
|
+
let i = Math.max(2, Math.round(3 + n * 6)), a = Math.floor(t * i), o = r ? .25 * Math.sin(r + a) : 0;
|
|
122
|
+
return [H(a * 2) + o, H(a * 2 + 1) * .35];
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "glass",
|
|
127
|
+
label: "Glass",
|
|
128
|
+
field(e, t, n, r) {
|
|
129
|
+
let i = 2 + n * 3, a = .012, o = r * .15, s = ve(e * i + o, t * i), c = ve((e + a) * i + o, t * i) - s, l = ve(e * i + o, (t + a) * i) - s;
|
|
130
|
+
return [c / a * .12, l / a * .12];
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
id: "prismatic",
|
|
135
|
+
label: "Prismatic",
|
|
136
|
+
dispersion: 65,
|
|
137
|
+
field(e, t, n, r) {
|
|
138
|
+
let i = 2 + n * 3, a = .012, o = r * .15, s = ve(e * i + o, t * i), c = ve((e + a) * i + o, t * i) - s, l = ve(e * i + o, (t + a) * i) - s;
|
|
139
|
+
return [c / a * .12, l / a * .12];
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "ripple",
|
|
144
|
+
label: "Ripple",
|
|
145
|
+
field(e, t, n, r) {
|
|
146
|
+
let i = e - .5, a = t - .5, o = Math.hypot(i, a) + 1e-4, s = Math.sin(o * (8 + n * 22) - r * 2);
|
|
147
|
+
return [i / o * s, a / o * s];
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: "prism-ripple",
|
|
152
|
+
label: "Prism Ripple",
|
|
153
|
+
dispersion: 85,
|
|
154
|
+
field(e, t, n, r) {
|
|
155
|
+
let i = e - .5, a = t - .5, o = Math.hypot(i, a) + 1e-4, s = Math.sin(o * (8 + n * 22) - r * 2);
|
|
156
|
+
return [i / o * s, a / o * s];
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: "waves",
|
|
161
|
+
label: "Waves",
|
|
162
|
+
field(e, t, n, r) {
|
|
163
|
+
let i = 4 + n * 12;
|
|
164
|
+
return [Math.sin(t * i + r), Math.sin(e * i + r * .7)];
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: "diagonal",
|
|
169
|
+
label: "Diagonal",
|
|
170
|
+
field(e, t, n) {
|
|
171
|
+
let r = Math.max(2, Math.round(4 + n * 8)), i = H(Math.floor((e + t) * r));
|
|
172
|
+
return [i * .7, i * .7];
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
id: "shards",
|
|
177
|
+
label: "Shards",
|
|
178
|
+
field(e, t, n) {
|
|
179
|
+
let r = Math.max(2, Math.round(2 + n * 5)), i = Math.floor(e * r), a = Math.floor(t * r);
|
|
180
|
+
return [H(i * 31 + a), H(a * 31 + i)];
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: "grid",
|
|
185
|
+
label: "Grid",
|
|
186
|
+
field(e, t, n) {
|
|
187
|
+
let r = Math.max(2, Math.round(3 + n * 6));
|
|
188
|
+
return [H(Math.floor(t * r)), H(Math.floor(e * r))];
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: "lens",
|
|
193
|
+
label: "Lens",
|
|
194
|
+
field(e, t, n) {
|
|
195
|
+
let r = e - .5, i = t - .5, a = (.5 - Math.hypot(r, i)) * (1 + n);
|
|
196
|
+
return [r * a * 2, i * a * 2];
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: "swirl",
|
|
201
|
+
label: "Swirl",
|
|
202
|
+
field(e, t, n, r) {
|
|
203
|
+
let i = e - .5, a = t - .5, o = (.5 - Math.hypot(i, a)) * (2 + n * 4) + r * .5;
|
|
204
|
+
return [-a * o * 2, i * o * 2];
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
], be = ye.map((e) => ({
|
|
208
|
+
value: e.id,
|
|
209
|
+
label: e.label
|
|
210
|
+
})), xe = {
|
|
211
|
+
panes: {
|
|
212
|
+
xShift: 60,
|
|
213
|
+
yShift: 0,
|
|
214
|
+
scale: 1.5,
|
|
215
|
+
angle: 0,
|
|
216
|
+
chroma: 0,
|
|
217
|
+
mix: 100,
|
|
218
|
+
edge: "clamp",
|
|
219
|
+
mirror: !1
|
|
220
|
+
},
|
|
221
|
+
slivers: {
|
|
222
|
+
xShift: 22,
|
|
223
|
+
yShift: 80,
|
|
224
|
+
scale: 1.5,
|
|
225
|
+
angle: 0,
|
|
226
|
+
chroma: 0,
|
|
227
|
+
mix: 100,
|
|
228
|
+
edge: "clamp",
|
|
229
|
+
mirror: !1
|
|
230
|
+
},
|
|
231
|
+
bands: {
|
|
232
|
+
xShift: 80,
|
|
233
|
+
yShift: 24,
|
|
234
|
+
scale: 1.2,
|
|
235
|
+
angle: 0,
|
|
236
|
+
chroma: 0,
|
|
237
|
+
mix: 100,
|
|
238
|
+
edge: "clamp",
|
|
239
|
+
mirror: !1
|
|
240
|
+
},
|
|
241
|
+
glass: {
|
|
242
|
+
xShift: 40,
|
|
243
|
+
yShift: 40,
|
|
244
|
+
scale: 1.2,
|
|
245
|
+
angle: 0,
|
|
246
|
+
chroma: 0,
|
|
247
|
+
mix: 100,
|
|
248
|
+
edge: "mirror",
|
|
249
|
+
mirror: !1
|
|
250
|
+
},
|
|
251
|
+
prismatic: {
|
|
252
|
+
xShift: 50,
|
|
253
|
+
yShift: 50,
|
|
254
|
+
scale: 1.6,
|
|
255
|
+
angle: 0,
|
|
256
|
+
chroma: 0,
|
|
257
|
+
mix: 100,
|
|
258
|
+
edge: "mirror",
|
|
259
|
+
mirror: !1
|
|
260
|
+
},
|
|
261
|
+
ripple: {
|
|
262
|
+
xShift: 42,
|
|
263
|
+
yShift: 42,
|
|
264
|
+
scale: 1,
|
|
265
|
+
angle: 0,
|
|
266
|
+
chroma: 25,
|
|
267
|
+
mix: 100,
|
|
268
|
+
edge: "mirror",
|
|
269
|
+
mirror: !1
|
|
270
|
+
},
|
|
271
|
+
"prism-ripple": {
|
|
272
|
+
xShift: 55,
|
|
273
|
+
yShift: 55,
|
|
274
|
+
scale: 1.4,
|
|
275
|
+
angle: 0,
|
|
276
|
+
chroma: 0,
|
|
277
|
+
mix: 100,
|
|
278
|
+
edge: "mirror",
|
|
279
|
+
mirror: !1
|
|
280
|
+
},
|
|
281
|
+
waves: {
|
|
282
|
+
xShift: 30,
|
|
283
|
+
yShift: 55,
|
|
284
|
+
scale: 1,
|
|
285
|
+
angle: 0,
|
|
286
|
+
chroma: 20,
|
|
287
|
+
mix: 100,
|
|
288
|
+
edge: "mirror",
|
|
289
|
+
mirror: !1
|
|
290
|
+
},
|
|
291
|
+
diagonal: {
|
|
292
|
+
xShift: 70,
|
|
293
|
+
yShift: 10,
|
|
294
|
+
scale: 1.5,
|
|
295
|
+
angle: 0,
|
|
296
|
+
chroma: 0,
|
|
297
|
+
mix: 100,
|
|
298
|
+
edge: "clamp",
|
|
299
|
+
mirror: !1
|
|
300
|
+
},
|
|
301
|
+
shards: {
|
|
302
|
+
xShift: 60,
|
|
303
|
+
yShift: 60,
|
|
304
|
+
scale: 1.3,
|
|
305
|
+
angle: 0,
|
|
306
|
+
chroma: 0,
|
|
307
|
+
mix: 100,
|
|
308
|
+
edge: "clamp",
|
|
309
|
+
mirror: !1
|
|
310
|
+
},
|
|
311
|
+
grid: {
|
|
312
|
+
xShift: 50,
|
|
313
|
+
yShift: 50,
|
|
314
|
+
scale: 1.6,
|
|
315
|
+
angle: 0,
|
|
316
|
+
chroma: 0,
|
|
317
|
+
mix: 100,
|
|
318
|
+
edge: "clamp",
|
|
319
|
+
mirror: !1
|
|
320
|
+
},
|
|
321
|
+
lens: {
|
|
322
|
+
xShift: 85,
|
|
323
|
+
yShift: 85,
|
|
324
|
+
scale: 1,
|
|
325
|
+
angle: 0,
|
|
326
|
+
chroma: 45,
|
|
327
|
+
mix: 100,
|
|
328
|
+
edge: "clamp",
|
|
329
|
+
mirror: !1
|
|
330
|
+
},
|
|
331
|
+
swirl: {
|
|
332
|
+
xShift: 60,
|
|
333
|
+
yShift: 60,
|
|
334
|
+
scale: 1.2,
|
|
335
|
+
angle: 0,
|
|
336
|
+
chroma: 30,
|
|
337
|
+
mix: 100,
|
|
338
|
+
edge: "mirror",
|
|
339
|
+
mirror: !1
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
function Se(e, t, n) {
|
|
343
|
+
if (e >= 0 && e < t) return e | 0;
|
|
344
|
+
if (n === "wrap") {
|
|
345
|
+
let n = e % t;
|
|
346
|
+
return (n < 0 ? n + t : n) | 0;
|
|
347
|
+
}
|
|
348
|
+
if (n === "mirror") {
|
|
349
|
+
let n = t - 1, r = Math.abs(e) % (2 * n);
|
|
350
|
+
return (r <= n ? r : 2 * n - r) | 0;
|
|
351
|
+
}
|
|
352
|
+
return e < 0 ? 0 : t - 1;
|
|
353
|
+
}
|
|
354
|
+
var Ce = null;
|
|
355
|
+
function we(e, t) {
|
|
356
|
+
return Ce ||= document.createElement("canvas"), Ce.width !== e && (Ce.width = e), Ce.height !== t && (Ce.height = t), Ce;
|
|
357
|
+
}
|
|
358
|
+
function Te(e, t) {
|
|
359
|
+
let n = e.width, r = e.height, { base: i, out: a } = ce(e), o = i.data, s = a.data, c = ye.find((e) => e.id === t.pattern) || ye[0], l = t.xShift / 100 * n * .25, u = t.yShift / 100 * r * .25, d = t.mix / 100, f = t.angle * Math.PI / 180, p = Math.cos(f), m = Math.sin(f), h = t.chroma > 0 ? t.chroma : c.dispersion ?? 0, g = h / 100, _ = h / 100 * n * .02, v = n / 2, y = r / 2, b = t.edge;
|
|
360
|
+
for (let e = 0; e < r; e++) {
|
|
361
|
+
let i = e / r;
|
|
362
|
+
for (let a = 0; a < n; a++) {
|
|
363
|
+
let f = t.mirror && a >= n / 2 ? n - 1 - a : a, x = f / n - .5 - t.panX, S = i - .5 - t.panY, C = c.field(p * x + m * S + .5, -m * x + p * S + .5, t.scale, t.time), w = (p * C[0] - m * C[1]) * l, T = (m * C[0] + p * C[1]) * u, E = e * n + a << 2;
|
|
364
|
+
if (h > 0) {
|
|
365
|
+
let t = (a - v) / v, i = (e - y) / y, c = Se(f + w * (1 + g) + t * _, n, b), l = Se(e + T * (1 + g) + i * _, r, b), u = Se(f + w, n, b), p = Se(e + T, r, b), m = Se(f + w * (1 - g) - t * _, n, b), h = Se(e + T * (1 - g) - i * _, r, b), x = p * n + u << 2, S = o[l * n + c << 2], C = o[x + 1], D = o[(h * n + m << 2) + 2], ee = o[x + 3];
|
|
366
|
+
d >= 1 ? (s[E] = S, s[E + 1] = C, s[E + 2] = D, s[E + 3] = ee) : (s[E] = o[E] * (1 - d) + S * d, s[E + 1] = o[E + 1] * (1 - d) + C * d, s[E + 2] = o[E + 2] * (1 - d) + D * d, s[E + 3] = o[E + 3] * (1 - d) + ee * d);
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
let D = Se(e + T, r, b) * n + Se(f + w, n, b) << 2;
|
|
370
|
+
d >= 1 ? (s[E] = o[D], s[E + 1] = o[D + 1], s[E + 2] = o[D + 2], s[E + 3] = o[D + 3]) : (s[E] = o[E] * (1 - d) + o[D] * d, s[E + 1] = o[E + 1] * (1 - d) + o[D + 1] * d, s[E + 2] = o[E + 2] * (1 - d) + o[D + 2] * d, s[E + 3] = o[E + 3] * (1 - d) + o[D + 3] * d);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return a;
|
|
374
|
+
}
|
|
375
|
+
var Ee = {
|
|
376
|
+
id: "glass",
|
|
377
|
+
label: "Glass",
|
|
378
|
+
animated: !0,
|
|
379
|
+
presetPatches: xe,
|
|
380
|
+
params: [
|
|
381
|
+
{
|
|
382
|
+
key: "pattern",
|
|
383
|
+
label: "Pattern",
|
|
384
|
+
type: "select",
|
|
385
|
+
options: be,
|
|
386
|
+
default: "panes",
|
|
387
|
+
section: "Pattern"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
key: "xShift",
|
|
391
|
+
label: "X shift",
|
|
392
|
+
type: "range",
|
|
393
|
+
min: -100,
|
|
394
|
+
max: 100,
|
|
395
|
+
step: 1,
|
|
396
|
+
default: 60,
|
|
397
|
+
section: "Distort"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
key: "yShift",
|
|
401
|
+
label: "Y shift",
|
|
402
|
+
type: "range",
|
|
403
|
+
min: -100,
|
|
404
|
+
max: 100,
|
|
405
|
+
step: 1,
|
|
406
|
+
default: 0,
|
|
407
|
+
section: "Distort"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
key: "scale",
|
|
411
|
+
label: "Scale",
|
|
412
|
+
type: "range",
|
|
413
|
+
min: .2,
|
|
414
|
+
max: 4,
|
|
415
|
+
step: .05,
|
|
416
|
+
default: 1.5,
|
|
417
|
+
section: "Distort"
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
key: "angle",
|
|
421
|
+
label: "Angle",
|
|
422
|
+
type: "range",
|
|
423
|
+
min: 0,
|
|
424
|
+
max: 360,
|
|
425
|
+
step: 1,
|
|
426
|
+
default: 0,
|
|
427
|
+
section: "Distort"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
key: "mix",
|
|
431
|
+
label: "Mix",
|
|
432
|
+
type: "range",
|
|
433
|
+
min: 0,
|
|
434
|
+
max: 100,
|
|
435
|
+
step: 1,
|
|
436
|
+
default: 100,
|
|
437
|
+
section: "Blend"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
key: "chroma",
|
|
441
|
+
label: "Chroma",
|
|
442
|
+
type: "range",
|
|
443
|
+
min: 0,
|
|
444
|
+
max: 100,
|
|
445
|
+
step: 1,
|
|
446
|
+
default: 0,
|
|
447
|
+
section: "Blend"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
key: "edge",
|
|
451
|
+
label: "Edge",
|
|
452
|
+
type: "select",
|
|
453
|
+
default: "clamp",
|
|
454
|
+
section: "Blend",
|
|
455
|
+
options: [
|
|
456
|
+
{
|
|
457
|
+
value: "clamp",
|
|
458
|
+
label: "Clamp"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
value: "wrap",
|
|
462
|
+
label: "Wrap"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
value: "mirror",
|
|
466
|
+
label: "Mirror"
|
|
467
|
+
}
|
|
468
|
+
]
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
key: "mirror",
|
|
472
|
+
label: "Mirror fold",
|
|
473
|
+
type: "toggle",
|
|
474
|
+
default: !1,
|
|
475
|
+
section: "Blend"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
key: "spin",
|
|
479
|
+
label: "Spin · turns",
|
|
480
|
+
type: "range",
|
|
481
|
+
min: -2,
|
|
482
|
+
max: 2,
|
|
483
|
+
step: 1,
|
|
484
|
+
default: 0,
|
|
485
|
+
tab: "anim",
|
|
486
|
+
section: "Motion"
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
key: "drift",
|
|
490
|
+
label: "Drift",
|
|
491
|
+
type: "range",
|
|
492
|
+
min: 0,
|
|
493
|
+
max: .5,
|
|
494
|
+
step: .01,
|
|
495
|
+
default: 0,
|
|
496
|
+
tab: "anim",
|
|
497
|
+
section: "Motion"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
key: "phase",
|
|
501
|
+
label: "Phase",
|
|
502
|
+
type: "range",
|
|
503
|
+
min: 0,
|
|
504
|
+
max: 3,
|
|
505
|
+
step: .05,
|
|
506
|
+
default: 0,
|
|
507
|
+
when: (e) => ![
|
|
508
|
+
"diagonal",
|
|
509
|
+
"shards",
|
|
510
|
+
"grid",
|
|
511
|
+
"lens"
|
|
512
|
+
].includes(e.pattern),
|
|
513
|
+
tab: "anim",
|
|
514
|
+
section: "Motion"
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
key: "pulse",
|
|
518
|
+
label: "Pulse",
|
|
519
|
+
type: "range",
|
|
520
|
+
min: 0,
|
|
521
|
+
max: 1,
|
|
522
|
+
step: .05,
|
|
523
|
+
default: 0,
|
|
524
|
+
tab: "anim",
|
|
525
|
+
section: "Motion"
|
|
526
|
+
}
|
|
527
|
+
],
|
|
528
|
+
apply(e, t, n, r, i, a) {
|
|
529
|
+
let o = Math.sin(he * a), s = 1 + (i.pulse ?? 0) * .4 * o, c = Te(t, {
|
|
530
|
+
pattern: i.pattern,
|
|
531
|
+
scale: i.scale ?? 1.5,
|
|
532
|
+
mix: i.mix ?? 100,
|
|
533
|
+
edge: i.edge ?? "clamp",
|
|
534
|
+
mirror: !!i.mirror,
|
|
535
|
+
chroma: i.chroma ?? 0,
|
|
536
|
+
angle: (i.angle ?? 0) + 360 * a * Math.round(i.spin ?? 0),
|
|
537
|
+
xShift: (i.xShift ?? 0) * s,
|
|
538
|
+
yShift: (i.yShift ?? 0) * s,
|
|
539
|
+
panX: (i.drift ?? 0) * Math.cos(he * a),
|
|
540
|
+
panY: (i.drift ?? 0) * Math.sin(he * a),
|
|
541
|
+
time: (i.phase ?? 0) * Math.PI * o
|
|
542
|
+
}), l = we(t.width, t.height);
|
|
543
|
+
l.getContext("2d").putImageData(c, 0, 0), e.drawImage(l, 0, 0, n, r);
|
|
544
|
+
}
|
|
545
|
+
}, De = 160, Oe = /* @__PURE__ */ new WeakMap();
|
|
546
|
+
ae(Oe);
|
|
547
|
+
function ke(e) {
|
|
548
|
+
let t = Oe.get(e);
|
|
549
|
+
if (!t) {
|
|
550
|
+
let n = De, r = Math.max(1, Math.round(De * (e.height / Math.max(1, e.width)))), i = document.createElement("canvas");
|
|
551
|
+
i.width = n, i.height = r;
|
|
552
|
+
let a = i.getContext("2d");
|
|
553
|
+
a.drawImage(e, 0, 0, n, r);
|
|
554
|
+
let { data: o } = a.getImageData(0, 0, n, r);
|
|
555
|
+
t = (e, t) => {
|
|
556
|
+
let i = Math.min(n - 1, Math.max(0, e * n | 0)), a = Math.min(r - 1, Math.max(0, t * r | 0)) * n + i << 2;
|
|
557
|
+
return (.299 * o[a] + .587 * o[a + 1] + .114 * o[a + 2]) / 255;
|
|
558
|
+
}, Oe.set(e, t);
|
|
559
|
+
}
|
|
560
|
+
return t;
|
|
561
|
+
}
|
|
562
|
+
var Ae = (e) => (e.geometry ?? "rows") === "rows" || e.geometry === "columns", je = {
|
|
563
|
+
id: "scanline",
|
|
564
|
+
label: "Scanline",
|
|
565
|
+
animated: !0,
|
|
566
|
+
params: [
|
|
567
|
+
{
|
|
568
|
+
key: "geometry",
|
|
569
|
+
label: "Geometry",
|
|
570
|
+
type: "select",
|
|
571
|
+
options: p,
|
|
572
|
+
default: "rows",
|
|
573
|
+
section: "Geometry"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
key: "rows",
|
|
577
|
+
label: "Lines",
|
|
578
|
+
type: "range",
|
|
579
|
+
min: 8,
|
|
580
|
+
max: 260,
|
|
581
|
+
step: 1,
|
|
582
|
+
default: 120,
|
|
583
|
+
when: Ae,
|
|
584
|
+
section: "Geometry"
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
key: "rayCount",
|
|
588
|
+
label: "Rays",
|
|
589
|
+
type: "range",
|
|
590
|
+
min: 16,
|
|
591
|
+
max: 520,
|
|
592
|
+
step: 1,
|
|
593
|
+
default: 200,
|
|
594
|
+
when: (e) => e.geometry === "radial",
|
|
595
|
+
section: "Geometry"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
key: "ringCount",
|
|
599
|
+
label: "Rings",
|
|
600
|
+
type: "range",
|
|
601
|
+
min: 4,
|
|
602
|
+
max: 200,
|
|
603
|
+
step: 1,
|
|
604
|
+
default: 60,
|
|
605
|
+
when: (e) => e.geometry === "rings",
|
|
606
|
+
section: "Geometry"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
key: "turns",
|
|
610
|
+
label: "Turns",
|
|
611
|
+
type: "range",
|
|
612
|
+
min: 1,
|
|
613
|
+
max: 30,
|
|
614
|
+
step: .5,
|
|
615
|
+
default: 6,
|
|
616
|
+
when: (e) => e.geometry === "spiral",
|
|
617
|
+
section: "Geometry"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
key: "arms",
|
|
621
|
+
label: "Arms",
|
|
622
|
+
type: "range",
|
|
623
|
+
min: 1,
|
|
624
|
+
max: 8,
|
|
625
|
+
step: 1,
|
|
626
|
+
default: 1,
|
|
627
|
+
when: (e) => e.geometry === "spiral",
|
|
628
|
+
section: "Geometry"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
key: "swirl",
|
|
632
|
+
label: "Swirl",
|
|
633
|
+
type: "range",
|
|
634
|
+
min: -1,
|
|
635
|
+
max: 1,
|
|
636
|
+
step: .02,
|
|
637
|
+
default: 0,
|
|
638
|
+
when: (e) => e.geometry === "radial" || e.geometry === "rings",
|
|
639
|
+
section: "Geometry"
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
key: "weave",
|
|
643
|
+
label: "Weave",
|
|
644
|
+
type: "toggle",
|
|
645
|
+
default: !1,
|
|
646
|
+
when: Ae,
|
|
647
|
+
section: "Geometry"
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
key: "minGap",
|
|
651
|
+
label: "Min gap",
|
|
652
|
+
type: "range",
|
|
653
|
+
min: 1,
|
|
654
|
+
max: 24,
|
|
655
|
+
step: .5,
|
|
656
|
+
default: 3,
|
|
657
|
+
section: "Spacing"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
key: "maxGap",
|
|
661
|
+
label: "Max gap",
|
|
662
|
+
type: "range",
|
|
663
|
+
min: 4,
|
|
664
|
+
max: 64,
|
|
665
|
+
step: .5,
|
|
666
|
+
default: 22,
|
|
667
|
+
section: "Spacing"
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
key: "contrast",
|
|
671
|
+
label: "Contrast",
|
|
672
|
+
type: "range",
|
|
673
|
+
min: .3,
|
|
674
|
+
max: 4,
|
|
675
|
+
step: .05,
|
|
676
|
+
default: 1.2,
|
|
677
|
+
section: "Spacing"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
key: "displace",
|
|
681
|
+
label: "Displace",
|
|
682
|
+
type: "range",
|
|
683
|
+
min: 0,
|
|
684
|
+
max: 1,
|
|
685
|
+
step: .02,
|
|
686
|
+
default: 0,
|
|
687
|
+
section: "Spacing"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
key: "invert",
|
|
691
|
+
label: "Invert",
|
|
692
|
+
type: "toggle",
|
|
693
|
+
default: !1,
|
|
694
|
+
section: "Spacing"
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
key: "mark",
|
|
698
|
+
label: "Mark",
|
|
699
|
+
type: "select",
|
|
700
|
+
options: h,
|
|
701
|
+
default: "dots",
|
|
702
|
+
section: "Mark"
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
key: "markSize",
|
|
706
|
+
label: "Mark size",
|
|
707
|
+
type: "range",
|
|
708
|
+
min: .2,
|
|
709
|
+
max: 3,
|
|
710
|
+
step: .05,
|
|
711
|
+
default: 1,
|
|
712
|
+
when: (e) => (e.mark ?? "dots") !== "glyph",
|
|
713
|
+
section: "Mark"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
key: "dashLen",
|
|
717
|
+
label: "Dash length",
|
|
718
|
+
type: "range",
|
|
719
|
+
min: .3,
|
|
720
|
+
max: 3,
|
|
721
|
+
step: .05,
|
|
722
|
+
default: 1.2,
|
|
723
|
+
when: (e) => e.mark === "dash",
|
|
724
|
+
section: "Mark"
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
key: "charset",
|
|
728
|
+
label: "Charset",
|
|
729
|
+
type: "select",
|
|
730
|
+
options: v,
|
|
731
|
+
default: "ascii",
|
|
732
|
+
when: (e) => e.mark === "glyph",
|
|
733
|
+
section: "Mark"
|
|
734
|
+
},
|
|
735
|
+
{
|
|
736
|
+
key: "fontScale",
|
|
737
|
+
label: "Font size",
|
|
738
|
+
type: "range",
|
|
739
|
+
min: .4,
|
|
740
|
+
max: 2,
|
|
741
|
+
step: .05,
|
|
742
|
+
default: 1,
|
|
743
|
+
when: (e) => e.mark === "glyph",
|
|
744
|
+
section: "Mark"
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
key: "bg",
|
|
748
|
+
label: "Background",
|
|
749
|
+
type: "color",
|
|
750
|
+
default: "#06070b",
|
|
751
|
+
section: "Color"
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
key: "fg",
|
|
755
|
+
label: "Ink",
|
|
756
|
+
type: "color",
|
|
757
|
+
default: "#f4f1ea",
|
|
758
|
+
section: "Color"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
key: "pulse",
|
|
762
|
+
label: "Pulse",
|
|
763
|
+
type: "range",
|
|
764
|
+
min: 0,
|
|
765
|
+
max: 1,
|
|
766
|
+
step: .05,
|
|
767
|
+
default: 0,
|
|
768
|
+
tab: "anim",
|
|
769
|
+
section: "Motion"
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
key: "sweep",
|
|
773
|
+
label: "Sweep",
|
|
774
|
+
type: "range",
|
|
775
|
+
min: 0,
|
|
776
|
+
max: 1,
|
|
777
|
+
step: .05,
|
|
778
|
+
default: 0,
|
|
779
|
+
when: (e) => (e.mark ?? "dots") !== "lattice",
|
|
780
|
+
tab: "anim",
|
|
781
|
+
section: "Motion"
|
|
782
|
+
}
|
|
783
|
+
],
|
|
784
|
+
apply(e, t, n, r, i, a) {
|
|
785
|
+
b(e, a, n, r, {
|
|
786
|
+
...i,
|
|
787
|
+
invert: !!i.invert,
|
|
788
|
+
weave: !!i.weave,
|
|
789
|
+
bg: i.bg ?? "#06070b",
|
|
790
|
+
fg: i.fg ?? "#f4f1ea",
|
|
791
|
+
flow: 1,
|
|
792
|
+
spin: 0,
|
|
793
|
+
seed: 0,
|
|
794
|
+
sample: ke(t)
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
}, U = 180;
|
|
798
|
+
function Me(e = 6) {
|
|
799
|
+
let t = /* @__PURE__ */ new Map();
|
|
800
|
+
return (n, r) => {
|
|
801
|
+
if (t.has(n)) {
|
|
802
|
+
let e = t.get(n);
|
|
803
|
+
return t.delete(n), t.set(n, e), e;
|
|
804
|
+
}
|
|
805
|
+
let i = r();
|
|
806
|
+
if (t.set(n, i), t.size > e) {
|
|
807
|
+
let e = t.keys().next().value;
|
|
808
|
+
t.get(e).engine.dispose?.(), t.delete(e);
|
|
809
|
+
}
|
|
810
|
+
return i;
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
var Ne = Me(), Pe = () => {
|
|
814
|
+
let e = document.createElement("canvas");
|
|
815
|
+
return e.width = 2, e.height = 2, e;
|
|
816
|
+
}, Fe = null;
|
|
817
|
+
function Ie(e, t) {
|
|
818
|
+
Fe || (Fe = document.createElement("canvas"), Fe.width = U, Fe.height = U);
|
|
819
|
+
let n = Fe.getContext("2d", { willReadFrequently: !0 });
|
|
820
|
+
n.drawImage(e, 0, 0, U, U);
|
|
821
|
+
let r = n.getImageData(0, 0, U, U).data, i = new Float32Array(U * U);
|
|
822
|
+
for (let e = 0; e < U * U; e++) {
|
|
823
|
+
let n = e << 2, a = (.299 * r[n] + .587 * r[n + 1] + .114 * r[n + 2]) / 255;
|
|
824
|
+
a = (a - .5) * t + .5, i[e] = a < 0 ? 0 : a > 1 ? 1 : a;
|
|
825
|
+
}
|
|
826
|
+
return i;
|
|
827
|
+
}
|
|
828
|
+
var Le = (e) => e.map((e) => ({
|
|
829
|
+
value: e.value,
|
|
830
|
+
label: e.label
|
|
831
|
+
})), Re = {
|
|
832
|
+
id: "dither",
|
|
833
|
+
label: "Dither",
|
|
834
|
+
animated: !0,
|
|
835
|
+
params: [
|
|
836
|
+
{
|
|
837
|
+
key: "style",
|
|
838
|
+
label: "Texture",
|
|
839
|
+
type: "select",
|
|
840
|
+
default: "coral",
|
|
841
|
+
options: Le(f),
|
|
842
|
+
section: "Reaction"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
key: "contrast",
|
|
846
|
+
label: "Contrast",
|
|
847
|
+
type: "range",
|
|
848
|
+
min: .4,
|
|
849
|
+
max: 3,
|
|
850
|
+
step: .1,
|
|
851
|
+
default: 1.4,
|
|
852
|
+
section: "Reaction"
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
key: "invert",
|
|
856
|
+
label: "Invert",
|
|
857
|
+
type: "toggle",
|
|
858
|
+
default: !1,
|
|
859
|
+
section: "Reaction"
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
key: "palette",
|
|
863
|
+
label: "Palette",
|
|
864
|
+
type: "select",
|
|
865
|
+
default: "ink",
|
|
866
|
+
options: Le(_),
|
|
867
|
+
section: "Color"
|
|
868
|
+
},
|
|
869
|
+
{
|
|
870
|
+
key: "speed",
|
|
871
|
+
label: "Speed",
|
|
872
|
+
type: "range",
|
|
873
|
+
min: .2,
|
|
874
|
+
max: 3,
|
|
875
|
+
step: .1,
|
|
876
|
+
default: 1,
|
|
877
|
+
tab: "anim",
|
|
878
|
+
section: "Motion"
|
|
879
|
+
}
|
|
880
|
+
],
|
|
881
|
+
apply(e, t, n, r, i, a) {
|
|
882
|
+
let o = Ne(i.id, () => {
|
|
883
|
+
let e = new x(Pe(), U);
|
|
884
|
+
return e.setVariation({
|
|
885
|
+
model: "gray-scott",
|
|
886
|
+
params: {
|
|
887
|
+
feed: .0545,
|
|
888
|
+
kill: .062
|
|
889
|
+
},
|
|
890
|
+
palette: i.palette ?? "ink",
|
|
891
|
+
seed: "scatter"
|
|
892
|
+
}), {
|
|
893
|
+
engine: e,
|
|
894
|
+
cfg: {
|
|
895
|
+
src: null,
|
|
896
|
+
style: null,
|
|
897
|
+
contrast: null,
|
|
898
|
+
invert: null,
|
|
899
|
+
palette: e.palette
|
|
900
|
+
},
|
|
901
|
+
lastU: null
|
|
902
|
+
};
|
|
903
|
+
}), { engine: s, cfg: c } = o, l = c.style !== i.style || c.contrast !== i.contrast || c.invert !== !!i.invert;
|
|
904
|
+
if (c.src !== t || l) {
|
|
905
|
+
let e = m(Ie(t, i.contrast ?? 1.4), g(i.style), !!i.invert);
|
|
906
|
+
s.setImageField(e.feed, e.kill), c.src !== t && (s.reseed(), s.warmup(120)), c.src = t, c.style = i.style, c.contrast = i.contrast, c.invert = !!i.invert;
|
|
907
|
+
}
|
|
908
|
+
i.palette && c.palette !== i.palette && (s.setPalette(i.palette), c.palette = i.palette), s.setSpeed(i.speed ?? 1), a !== o.lastU && (s.step(), o.lastU = a), s.render(), s._blit(e, n, r);
|
|
909
|
+
}
|
|
910
|
+
}, ze = Math.PI * 2;
|
|
911
|
+
function Be(e, t, n, r, i) {
|
|
912
|
+
let a = i.offsetX | 0, o = i.offsetY | 0;
|
|
913
|
+
for (let i = 0; i < r; i++) for (let s = 0; s < n; s++) {
|
|
914
|
+
let c = i * n + s << 2, l = Math.max(0, Math.min(n - 1, s - a)), u = Math.max(0, Math.min(r - 1, i - o)) * n + l << 2, d = Math.max(0, Math.min(n - 1, s + a)), f = Math.max(0, Math.min(r - 1, i + o)) * n + d << 2;
|
|
915
|
+
t[c] = e[u], t[c + 1] = e[c + 1], t[c + 2] = e[f + 2], t[c + 3] = e[c + 3];
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
var W = (e, t) => e[t] * .299 + e[t + 1] * .587 + e[t + 2] * .114;
|
|
919
|
+
function Ve(e, t, n, r, i) {
|
|
920
|
+
let a = i.threshold / 100 * 255, o = +!!i.invert;
|
|
921
|
+
for (let i = 1; i < r - 1; i++) for (let r = 1; r < n - 1; r++) {
|
|
922
|
+
let s = W(e, (i - 1) * n + (r - 1) << 2), c = W(e, (i - 1) * n + r << 2), l = W(e, (i - 1) * n + (r + 1) << 2), u = W(e, i * n + (r - 1) << 2), d = W(e, i * n + (r + 1) << 2), f = W(e, (i + 1) * n + (r - 1) << 2), p = W(e, (i + 1) * n + r << 2), m = W(e, (i + 1) * n + (r + 1) << 2), h = -s + l - 2 * u + 2 * d - f + m, g = -s - 2 * c - l + f + 2 * p + m, _ = Math.sqrt(h * h + g * g) > a ? 255 : 0;
|
|
923
|
+
o && (_ = 255 - _);
|
|
924
|
+
let v = i * n + r << 2;
|
|
925
|
+
t[v] = _, t[v + 1] = _, t[v + 2] = _, t[v + 3] = e[v + 3];
|
|
926
|
+
}
|
|
927
|
+
let s = o ? 255 : 0;
|
|
928
|
+
for (let i = 0; i < n; i++) {
|
|
929
|
+
let a = i << 2, o = (r - 1) * n + i << 2;
|
|
930
|
+
t[a] = t[a + 1] = t[a + 2] = s, t[a + 3] = e[a + 3], t[o] = t[o + 1] = t[o + 2] = s, t[o + 3] = e[o + 3];
|
|
931
|
+
}
|
|
932
|
+
for (let i = 0; i < r; i++) {
|
|
933
|
+
let r = i * n << 2, a = i * n + n - 1 << 2;
|
|
934
|
+
t[r] = t[r + 1] = t[r + 2] = s, t[r + 3] = e[r + 3], t[a] = t[a + 1] = t[a + 2] = s, t[a + 3] = e[a + 3];
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
function He(e, t, n, r, i) {
|
|
938
|
+
let a = Math.max(2, i.levels | 0) - 1;
|
|
939
|
+
for (let n = 0; n < e.length; n += 4) t[n] = Math.round(e[n] / 255 * a) / a * 255, t[n + 1] = Math.round(e[n + 1] / 255 * a) / a * 255, t[n + 2] = Math.round(e[n + 2] / 255 * a) / a * 255, t[n + 3] = e[n + 3];
|
|
940
|
+
}
|
|
941
|
+
var Ue = new Float64Array();
|
|
942
|
+
function We(e, t, n, r) {
|
|
943
|
+
if (!(r < 2)) {
|
|
944
|
+
Ue.length < r && (Ue = new Float64Array(r));
|
|
945
|
+
for (let i = 0; i < r; i++) {
|
|
946
|
+
let r = t + i * n, a = e[r] * .299 + e[r + 1] * .587 + e[r + 2] * .114, o = ((e[r] * 256 + e[r + 1]) * 256 + e[r + 2]) * 256 + e[r + 3];
|
|
947
|
+
Ue[i] = Math.round(a * 256) * 4294967296 + o;
|
|
948
|
+
}
|
|
949
|
+
Ue.subarray(0, r).sort();
|
|
950
|
+
for (let i = 0; i < r; i++) {
|
|
951
|
+
let r = t + i * n, a = Ue[i] % 4294967296;
|
|
952
|
+
e[r] = a >>> 24 & 255, e[r + 1] = a >>> 16 & 255, e[r + 2] = a >>> 8 & 255, e[r + 3] = a & 255;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
function Ge(e, t, n, r, i) {
|
|
957
|
+
let a = i.threshold / 100 * 255, o = i.vertical;
|
|
958
|
+
if (t.set(e), o) for (let i = 0; i < n; i++) {
|
|
959
|
+
let o = -1;
|
|
960
|
+
for (let s = 0; s <= r; s++) {
|
|
961
|
+
let c = s < r ? s * n + i << 2 : -1, l = c >= 0 ? W(e, c) : 0;
|
|
962
|
+
c >= 0 && l > a ? o < 0 && (o = s) : o >= 0 && (We(t, o * n + i << 2, n << 2, s - o), o = -1);
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
else for (let i = 0; i < r; i++) {
|
|
966
|
+
let r = -1;
|
|
967
|
+
for (let o = 0; o <= n; o++) {
|
|
968
|
+
let s = o < n ? i * n + o << 2 : -1, c = s >= 0 ? W(e, s) : 0;
|
|
969
|
+
s >= 0 && c > a ? r < 0 && (r = o) : r >= 0 && (We(t, i * n + r << 2, 4, o - r), r = -1);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
function Ke(e, t, n, r, i) {
|
|
974
|
+
if (t.set(e), i.axis === "vertical") {
|
|
975
|
+
let i = r >> 1;
|
|
976
|
+
for (let a = 0; a < i; a++) {
|
|
977
|
+
let i = a * n << 2, o = (r - 1 - a) * n << 2;
|
|
978
|
+
for (let r = 0; r < n; r++) {
|
|
979
|
+
let n = i + (r << 2), a = o + (r << 2);
|
|
980
|
+
t[a] = e[n], t[a + 1] = e[n + 1], t[a + 2] = e[n + 2], t[a + 3] = e[n + 3];
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
} else {
|
|
984
|
+
let i = n >> 1;
|
|
985
|
+
for (let a = 0; a < r; a++) for (let r = 0; r < i; r++) {
|
|
986
|
+
let i = a * n + r << 2, o = a * n + (n - 1 - r) << 2;
|
|
987
|
+
t[o] = e[i], t[o + 1] = e[i + 1], t[o + 2] = e[i + 2], t[o + 3] = e[i + 3];
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
function qe(e, t, n, r, i) {
|
|
992
|
+
let a = Math.max(2, i.segments | 0), o = (i.angle || 0) * Math.PI / 180, s = n / 2, c = r / 2, l = ze / a, u = l / 2;
|
|
993
|
+
for (let i = 0; i < r; i++) for (let a = 0; a < n; a++) {
|
|
994
|
+
let d = a - s, f = i - c, p = Math.sqrt(d * d + f * f), m = Math.atan2(f, d) - o;
|
|
995
|
+
m -= Math.floor(m / l) * l, m > u && (m = l - m), m += o;
|
|
996
|
+
let h = Math.round(s + p * Math.cos(m)), g = Math.round(c + p * Math.sin(m));
|
|
997
|
+
h < 0 ? h = 0 : h >= n && (h = n - 1), g < 0 ? g = 0 : g >= r && (g = r - 1);
|
|
998
|
+
let _ = g * n + h << 2, v = i * n + a << 2;
|
|
999
|
+
t[v] = e[_], t[v + 1] = e[_ + 1], t[v + 2] = e[_ + 2], t[v + 3] = e[_ + 3];
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
function Je(e, t, n, r, i) {
|
|
1003
|
+
let a = i.level / 100 * 255;
|
|
1004
|
+
for (let n = 0; n < e.length; n += 4) {
|
|
1005
|
+
let r = W(e, n) >= a ? 255 : 0;
|
|
1006
|
+
t[n] = r, t[n + 1] = r, t[n + 2] = r, t[n + 3] = e[n + 3];
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
var Ye = [{
|
|
1010
|
+
value: "horizontal",
|
|
1011
|
+
label: "Horizontal"
|
|
1012
|
+
}, {
|
|
1013
|
+
value: "vertical",
|
|
1014
|
+
label: "Vertical"
|
|
1015
|
+
}], Xe = [
|
|
1016
|
+
{
|
|
1017
|
+
id: "fx-chromatic",
|
|
1018
|
+
label: "RGB Split",
|
|
1019
|
+
animated: !0,
|
|
1020
|
+
params: [
|
|
1021
|
+
{
|
|
1022
|
+
key: "offsetX",
|
|
1023
|
+
label: "Offset X",
|
|
1024
|
+
type: "range",
|
|
1025
|
+
min: 0,
|
|
1026
|
+
max: 50,
|
|
1027
|
+
step: 1,
|
|
1028
|
+
default: 5
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
key: "offsetY",
|
|
1032
|
+
label: "Offset Y",
|
|
1033
|
+
type: "range",
|
|
1034
|
+
min: 0,
|
|
1035
|
+
max: 50,
|
|
1036
|
+
step: 1,
|
|
1037
|
+
default: 0
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
key: "wobble",
|
|
1041
|
+
label: "Wobble",
|
|
1042
|
+
type: "range",
|
|
1043
|
+
min: 0,
|
|
1044
|
+
max: 1,
|
|
1045
|
+
step: .05,
|
|
1046
|
+
default: 0
|
|
1047
|
+
},
|
|
1048
|
+
R
|
|
1049
|
+
],
|
|
1050
|
+
apply(e, t, n, r, i, a) {
|
|
1051
|
+
let o = 1 + (i.wobble ?? 0) * Math.sin(ze * a), s = t.width / n || 1;
|
|
1052
|
+
V(e, t, n, r, Be, {
|
|
1053
|
+
offsetX: (i.offsetX ?? 5) * o * s,
|
|
1054
|
+
offsetY: (i.offsetY ?? 0) * o * s
|
|
1055
|
+
}, i.amount);
|
|
1056
|
+
}
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
id: "fx-edge",
|
|
1060
|
+
label: "Edge Detect",
|
|
1061
|
+
animated: !1,
|
|
1062
|
+
params: [
|
|
1063
|
+
{
|
|
1064
|
+
key: "threshold",
|
|
1065
|
+
label: "Threshold",
|
|
1066
|
+
type: "range",
|
|
1067
|
+
min: 0,
|
|
1068
|
+
max: 100,
|
|
1069
|
+
step: 1,
|
|
1070
|
+
default: 30
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
key: "invert",
|
|
1074
|
+
label: "Invert",
|
|
1075
|
+
type: "toggle",
|
|
1076
|
+
default: !1
|
|
1077
|
+
},
|
|
1078
|
+
R
|
|
1079
|
+
],
|
|
1080
|
+
apply(e, t, n, r, i) {
|
|
1081
|
+
V(e, t, n, r, Ve, {
|
|
1082
|
+
threshold: i.threshold ?? 30,
|
|
1083
|
+
invert: !!i.invert
|
|
1084
|
+
}, i.amount);
|
|
1085
|
+
}
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
id: "fx-posterize",
|
|
1089
|
+
label: "Posterize",
|
|
1090
|
+
animated: !1,
|
|
1091
|
+
params: [{
|
|
1092
|
+
key: "levels",
|
|
1093
|
+
label: "Levels",
|
|
1094
|
+
type: "range",
|
|
1095
|
+
min: 2,
|
|
1096
|
+
max: 32,
|
|
1097
|
+
step: 1,
|
|
1098
|
+
default: 4
|
|
1099
|
+
}, R],
|
|
1100
|
+
apply(e, t, n, r, i) {
|
|
1101
|
+
V(e, t, n, r, He, { levels: i.levels ?? 4 }, i.amount);
|
|
1102
|
+
}
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
id: "fx-pixelsort",
|
|
1106
|
+
label: "Pixel Sort",
|
|
1107
|
+
animated: !0,
|
|
1108
|
+
params: [
|
|
1109
|
+
{
|
|
1110
|
+
key: "threshold",
|
|
1111
|
+
label: "Threshold",
|
|
1112
|
+
type: "range",
|
|
1113
|
+
min: 0,
|
|
1114
|
+
max: 100,
|
|
1115
|
+
step: 1,
|
|
1116
|
+
default: 50
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
key: "direction",
|
|
1120
|
+
label: "Direction",
|
|
1121
|
+
type: "select",
|
|
1122
|
+
options: Ye,
|
|
1123
|
+
default: "horizontal"
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
key: "sweep",
|
|
1127
|
+
label: "Sweep",
|
|
1128
|
+
type: "range",
|
|
1129
|
+
min: 0,
|
|
1130
|
+
max: 1,
|
|
1131
|
+
step: .05,
|
|
1132
|
+
default: 0
|
|
1133
|
+
},
|
|
1134
|
+
R
|
|
1135
|
+
],
|
|
1136
|
+
apply(e, t, n, r, i, a) {
|
|
1137
|
+
let o = (i.threshold ?? 50) + (i.sweep ?? 0) * 50 * Math.sin(ze * a);
|
|
1138
|
+
V(e, t, n, r, Ge, {
|
|
1139
|
+
threshold: Math.max(0, Math.min(100, o)),
|
|
1140
|
+
vertical: i.direction === "vertical"
|
|
1141
|
+
}, i.amount);
|
|
1142
|
+
}
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
id: "fx-mirror",
|
|
1146
|
+
label: "Mirror",
|
|
1147
|
+
animated: !1,
|
|
1148
|
+
params: [{
|
|
1149
|
+
key: "axis",
|
|
1150
|
+
label: "Axis",
|
|
1151
|
+
type: "select",
|
|
1152
|
+
options: Ye,
|
|
1153
|
+
default: "horizontal"
|
|
1154
|
+
}, R],
|
|
1155
|
+
apply(e, t, n, r, i) {
|
|
1156
|
+
V(e, t, n, r, Ke, { axis: i.axis ?? "horizontal" }, i.amount);
|
|
1157
|
+
}
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
id: "fx-kaleido",
|
|
1161
|
+
label: "Kaleidoscope",
|
|
1162
|
+
animated: !0,
|
|
1163
|
+
params: [
|
|
1164
|
+
{
|
|
1165
|
+
key: "segments",
|
|
1166
|
+
label: "Segments",
|
|
1167
|
+
type: "range",
|
|
1168
|
+
min: 2,
|
|
1169
|
+
max: 16,
|
|
1170
|
+
step: 1,
|
|
1171
|
+
default: 6
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
key: "angle",
|
|
1175
|
+
label: "Angle",
|
|
1176
|
+
type: "range",
|
|
1177
|
+
min: 0,
|
|
1178
|
+
max: 360,
|
|
1179
|
+
step: 1,
|
|
1180
|
+
default: 0
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
key: "spin",
|
|
1184
|
+
label: "Spin · turns",
|
|
1185
|
+
type: "range",
|
|
1186
|
+
min: -2,
|
|
1187
|
+
max: 2,
|
|
1188
|
+
step: 1,
|
|
1189
|
+
default: 0
|
|
1190
|
+
},
|
|
1191
|
+
R
|
|
1192
|
+
],
|
|
1193
|
+
apply(e, t, n, r, i, a) {
|
|
1194
|
+
V(e, t, n, r, qe, {
|
|
1195
|
+
segments: i.segments ?? 6,
|
|
1196
|
+
angle: (i.angle ?? 0) + 360 * a * Math.round(i.spin ?? 0)
|
|
1197
|
+
}, i.amount);
|
|
1198
|
+
}
|
|
1199
|
+
},
|
|
1200
|
+
{
|
|
1201
|
+
id: "fx-threshold",
|
|
1202
|
+
label: "Threshold",
|
|
1203
|
+
animated: !1,
|
|
1204
|
+
params: [{
|
|
1205
|
+
key: "level",
|
|
1206
|
+
label: "Level",
|
|
1207
|
+
type: "range",
|
|
1208
|
+
min: 0,
|
|
1209
|
+
max: 100,
|
|
1210
|
+
step: 1,
|
|
1211
|
+
default: 50
|
|
1212
|
+
}, R],
|
|
1213
|
+
apply(e, t, n, r, i) {
|
|
1214
|
+
V(e, t, n, r, Je, { level: i.level ?? 50 }, i.amount);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
], Ze = [
|
|
1218
|
+
{
|
|
1219
|
+
value: "linear",
|
|
1220
|
+
label: "Linear bar"
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
value: "radial",
|
|
1224
|
+
label: "Radial pulse"
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
value: "wave",
|
|
1228
|
+
label: "Traveling wave"
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
value: "angular",
|
|
1232
|
+
label: "Radar sweep"
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
value: "noise",
|
|
1236
|
+
label: "Noise drift"
|
|
1237
|
+
}
|
|
1238
|
+
], Qe = [
|
|
1239
|
+
{
|
|
1240
|
+
value: "brightness",
|
|
1241
|
+
label: "Brightness"
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
value: "geometry",
|
|
1245
|
+
label: "Geometry"
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
value: "reveal",
|
|
1249
|
+
label: "Reveal"
|
|
1250
|
+
}
|
|
1251
|
+
], $e = new Set([
|
|
1252
|
+
"linear",
|
|
1253
|
+
"wave",
|
|
1254
|
+
"angular"
|
|
1255
|
+
]), et = [
|
|
1256
|
+
"shape",
|
|
1257
|
+
"target",
|
|
1258
|
+
"enabled",
|
|
1259
|
+
"amount",
|
|
1260
|
+
"speed",
|
|
1261
|
+
"width",
|
|
1262
|
+
"angle"
|
|
1263
|
+
];
|
|
1264
|
+
function tt(e = "linear", t = {}) {
|
|
1265
|
+
let n = {
|
|
1266
|
+
shape: e,
|
|
1267
|
+
target: "brightness",
|
|
1268
|
+
enabled: !0,
|
|
1269
|
+
amount: .6,
|
|
1270
|
+
speed: 1,
|
|
1271
|
+
width: .35,
|
|
1272
|
+
angle: 0
|
|
1273
|
+
};
|
|
1274
|
+
for (let e of et) t[e] !== void 0 && (n[e] = t[e]);
|
|
1275
|
+
return n;
|
|
1276
|
+
}
|
|
1277
|
+
var nt = [
|
|
1278
|
+
{
|
|
1279
|
+
name: "Scan",
|
|
1280
|
+
shape: "linear",
|
|
1281
|
+
target: "brightness",
|
|
1282
|
+
amount: .75,
|
|
1283
|
+
speed: 2,
|
|
1284
|
+
width: .3,
|
|
1285
|
+
angle: 0
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
name: "Pulse",
|
|
1289
|
+
shape: "radial",
|
|
1290
|
+
target: "brightness",
|
|
1291
|
+
amount: .85,
|
|
1292
|
+
speed: 1,
|
|
1293
|
+
width: .45
|
|
1294
|
+
},
|
|
1295
|
+
{
|
|
1296
|
+
name: "Wave",
|
|
1297
|
+
shape: "wave",
|
|
1298
|
+
target: "brightness",
|
|
1299
|
+
amount: .6,
|
|
1300
|
+
speed: 2,
|
|
1301
|
+
width: .25,
|
|
1302
|
+
angle: 0
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
name: "Radar",
|
|
1306
|
+
shape: "angular",
|
|
1307
|
+
target: "brightness",
|
|
1308
|
+
amount: .8,
|
|
1309
|
+
speed: 1,
|
|
1310
|
+
width: .35
|
|
1311
|
+
},
|
|
1312
|
+
{
|
|
1313
|
+
name: "Reveal",
|
|
1314
|
+
shape: "linear",
|
|
1315
|
+
target: "reveal",
|
|
1316
|
+
speed: 1,
|
|
1317
|
+
width: .4,
|
|
1318
|
+
angle: 0
|
|
1319
|
+
}
|
|
1320
|
+
], rt = Math.PI * 2, it = (e) => e - Math.floor(e);
|
|
1321
|
+
function at(e, t) {
|
|
1322
|
+
if (t <= 0) return 0;
|
|
1323
|
+
let n = Math.min(1, e / t);
|
|
1324
|
+
return 1 - n * n * (3 - 2 * n);
|
|
1325
|
+
}
|
|
1326
|
+
function ot(e, t) {
|
|
1327
|
+
let n = Math.floor(e), r = Math.floor(t), i = e - n, a = t - r, o = i * i * (3 - 2 * i), s = a * a * (3 - 2 * a), c = z(n, r), l = z(n + 1, r), u = z(n, r + 1), d = z(n + 1, r + 1);
|
|
1328
|
+
return c + (l - c) * o + (u - c) * s + (c - l - u + d) * o * s;
|
|
1329
|
+
}
|
|
1330
|
+
var st = Object.freeze({
|
|
1331
|
+
bright: 0,
|
|
1332
|
+
scaleMul: 1,
|
|
1333
|
+
offX: 0,
|
|
1334
|
+
offY: 0,
|
|
1335
|
+
rot: 0,
|
|
1336
|
+
hasReveal: !1,
|
|
1337
|
+
reveal: 0
|
|
1338
|
+
});
|
|
1339
|
+
function ct(e, t) {
|
|
1340
|
+
let n = Math.round(e.speed ?? 1), r = (e.angle ?? 0) * Math.PI / 180, i = e.width ?? .35;
|
|
1341
|
+
return {
|
|
1342
|
+
shape: e.shape ?? "linear",
|
|
1343
|
+
target: e.target ?? "brightness",
|
|
1344
|
+
amount: e.amount ?? .6,
|
|
1345
|
+
cos: Math.cos(r),
|
|
1346
|
+
sin: Math.sin(r),
|
|
1347
|
+
pos: it(t * n),
|
|
1348
|
+
ph: rt * t * n,
|
|
1349
|
+
halfW: Math.max(.01, i * .5),
|
|
1350
|
+
freq: 1 + (1 - i) * 8,
|
|
1351
|
+
nScale: 2 + (1 - i) * 8
|
|
1352
|
+
};
|
|
1353
|
+
}
|
|
1354
|
+
function lt(e) {
|
|
1355
|
+
return e.animate ? [tt(e.sweepShape ?? "linear", {
|
|
1356
|
+
target: e.sweepTarget ?? "brightness",
|
|
1357
|
+
amount: e.sweepAmount ?? .6,
|
|
1358
|
+
speed: e.sweepSpeed ?? 1,
|
|
1359
|
+
width: e.sweepWidth ?? .35,
|
|
1360
|
+
angle: e.sweepAngle ?? 0
|
|
1361
|
+
})] : [];
|
|
1362
|
+
}
|
|
1363
|
+
function ut(e, t) {
|
|
1364
|
+
let n = Array.isArray(e.sweeps) ? e.sweeps : lt(e), r = null;
|
|
1365
|
+
for (let e of n) !e || e.enabled === !1 || (r ??= []).push(ct(e, t));
|
|
1366
|
+
return r;
|
|
1367
|
+
}
|
|
1368
|
+
var G = {
|
|
1369
|
+
bright: 0,
|
|
1370
|
+
scaleMul: 1,
|
|
1371
|
+
offX: 0,
|
|
1372
|
+
offY: 0,
|
|
1373
|
+
rot: 0,
|
|
1374
|
+
hasReveal: !1,
|
|
1375
|
+
reveal: 0
|
|
1376
|
+
};
|
|
1377
|
+
function dt(e, t, n) {
|
|
1378
|
+
G.bright = 0, G.scaleMul = 1, G.offX = 0, G.offY = 0, G.rot = 0, G.hasReveal = !1, G.reveal = 0;
|
|
1379
|
+
for (let r = 0; r < e.length; r++) {
|
|
1380
|
+
let i = e[r], a = ft(i, t, n);
|
|
1381
|
+
if (i.target === "reveal") G.hasReveal = !0, a > G.reveal && (G.reveal = a);
|
|
1382
|
+
else if (i.target === "geometry") {
|
|
1383
|
+
let e = a * i.amount;
|
|
1384
|
+
G.scaleMul *= 1 + e, G.offX += i.cos * e, G.offY += i.sin * e, G.rot += e;
|
|
1385
|
+
} else G.bright += a * i.amount;
|
|
1386
|
+
}
|
|
1387
|
+
return G;
|
|
1388
|
+
}
|
|
1389
|
+
function ft(e, t, n) {
|
|
1390
|
+
switch (e.shape) {
|
|
1391
|
+
case "radial": {
|
|
1392
|
+
let r = t - .5, i = n - .5, a = it(Math.sqrt(r * r + i * i) / .7071), o = Math.abs(a - e.pos);
|
|
1393
|
+
return at(Math.min(o, 1 - o), e.halfW);
|
|
1394
|
+
}
|
|
1395
|
+
case "wave": {
|
|
1396
|
+
let r = (t - .5) * e.cos + (n - .5) * e.sin;
|
|
1397
|
+
return .5 + .5 * Math.sin(r * e.freq * rt - e.ph);
|
|
1398
|
+
}
|
|
1399
|
+
case "angular": {
|
|
1400
|
+
let r = it(Math.atan2(n - .5, t - .5) / rt), i = Math.abs(r - e.pos);
|
|
1401
|
+
return at(Math.min(i, 1 - i), e.halfW);
|
|
1402
|
+
}
|
|
1403
|
+
case "noise": return ot(t * e.nScale + .75 * Math.cos(e.ph), n * e.nScale + .75 * Math.sin(e.ph));
|
|
1404
|
+
default: {
|
|
1405
|
+
let r = it(.5 + (t - .5) * e.cos + (n - .5) * e.sin), i = Math.abs(r - e.pos);
|
|
1406
|
+
return at(Math.min(i, 1 - i), e.halfW);
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
var pt = (e) => !!e && e.some((e) => e.target === "reveal"), mt = " .:-=+*#%@", ht = [
|
|
1411
|
+
"—",
|
|
1412
|
+
"\\",
|
|
1413
|
+
"|",
|
|
1414
|
+
"/"
|
|
1415
|
+
], gt = [
|
|
1416
|
+
{
|
|
1417
|
+
value: "density",
|
|
1418
|
+
label: "Density"
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
value: "edges",
|
|
1422
|
+
label: "Edges"
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
value: "braille",
|
|
1426
|
+
label: "Braille"
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
value: "custom",
|
|
1430
|
+
label: "Custom ramp"
|
|
1431
|
+
}
|
|
1432
|
+
], _t = [
|
|
1433
|
+
{
|
|
1434
|
+
value: "classic",
|
|
1435
|
+
label: "Classic",
|
|
1436
|
+
ramp: mt
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
value: "extended",
|
|
1440
|
+
label: "Extended",
|
|
1441
|
+
ramp: " .'`^\",:;Il!i><~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$"
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
value: "blocks",
|
|
1445
|
+
label: "Blocks",
|
|
1446
|
+
ramp: " ░▒▓█"
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
value: "minimal",
|
|
1450
|
+
label: "Minimal",
|
|
1451
|
+
ramp: " .·:*"
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
value: "binary",
|
|
1455
|
+
label: "Binary",
|
|
1456
|
+
ramp: " 01"
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
value: "hex",
|
|
1460
|
+
label: "Hex",
|
|
1461
|
+
ramp: " 0123456789ABCDEF"
|
|
1462
|
+
},
|
|
1463
|
+
{
|
|
1464
|
+
value: "katakana",
|
|
1465
|
+
label: "Katakana",
|
|
1466
|
+
ramp: " ・ィゥョコニハホメラワ"
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
value: "strokes",
|
|
1470
|
+
label: "Strokes",
|
|
1471
|
+
ramp: " `'-/\\|+X#"
|
|
1472
|
+
}
|
|
1473
|
+
], vt = _t.map(({ value: e, label: t }) => ({
|
|
1474
|
+
value: e,
|
|
1475
|
+
label: t
|
|
1476
|
+
})), yt = [
|
|
1477
|
+
[
|
|
1478
|
+
0,
|
|
1479
|
+
0,
|
|
1480
|
+
1
|
|
1481
|
+
],
|
|
1482
|
+
[
|
|
1483
|
+
0,
|
|
1484
|
+
1,
|
|
1485
|
+
2
|
|
1486
|
+
],
|
|
1487
|
+
[
|
|
1488
|
+
0,
|
|
1489
|
+
2,
|
|
1490
|
+
4
|
|
1491
|
+
],
|
|
1492
|
+
[
|
|
1493
|
+
1,
|
|
1494
|
+
0,
|
|
1495
|
+
8
|
|
1496
|
+
],
|
|
1497
|
+
[
|
|
1498
|
+
1,
|
|
1499
|
+
1,
|
|
1500
|
+
16
|
|
1501
|
+
],
|
|
1502
|
+
[
|
|
1503
|
+
1,
|
|
1504
|
+
2,
|
|
1505
|
+
32
|
|
1506
|
+
],
|
|
1507
|
+
[
|
|
1508
|
+
0,
|
|
1509
|
+
3,
|
|
1510
|
+
64
|
|
1511
|
+
],
|
|
1512
|
+
[
|
|
1513
|
+
1,
|
|
1514
|
+
3,
|
|
1515
|
+
128
|
|
1516
|
+
]
|
|
1517
|
+
], bt = (e, t) => e[Math.max(0, Math.min(e.length - 1, Math.floor(t * e.length)))], xt = /* @__PURE__ */ new WeakMap();
|
|
1518
|
+
ae(xt);
|
|
1519
|
+
function St(e) {
|
|
1520
|
+
let t = xt.get(e);
|
|
1521
|
+
return t || (t = e.getContext("2d").getImageData(0, 0, e.width, e.height).data, xt.set(e, t)), t;
|
|
1522
|
+
}
|
|
1523
|
+
var Ct = {
|
|
1524
|
+
id: "fx-ascii",
|
|
1525
|
+
label: "ASCII",
|
|
1526
|
+
animated: !0,
|
|
1527
|
+
sweeps: !0,
|
|
1528
|
+
params: [
|
|
1529
|
+
{
|
|
1530
|
+
...R,
|
|
1531
|
+
section: "Effect"
|
|
1532
|
+
},
|
|
1533
|
+
{
|
|
1534
|
+
key: "algorithm",
|
|
1535
|
+
label: "Algorithm",
|
|
1536
|
+
type: "select",
|
|
1537
|
+
options: gt,
|
|
1538
|
+
default: "density",
|
|
1539
|
+
section: "Algorithm"
|
|
1540
|
+
},
|
|
1541
|
+
{
|
|
1542
|
+
key: "charset",
|
|
1543
|
+
label: "Charset",
|
|
1544
|
+
type: "select",
|
|
1545
|
+
options: vt,
|
|
1546
|
+
default: "classic",
|
|
1547
|
+
section: "Algorithm",
|
|
1548
|
+
when: (e) => (e.algorithm ?? "density") === "density"
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
key: "ramp",
|
|
1552
|
+
label: "Custom ramp",
|
|
1553
|
+
type: "text",
|
|
1554
|
+
rows: 1,
|
|
1555
|
+
placeholder: mt,
|
|
1556
|
+
default: mt,
|
|
1557
|
+
section: "Characters",
|
|
1558
|
+
when: (e) => e.algorithm === "custom"
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
key: "invert",
|
|
1562
|
+
label: "Invert",
|
|
1563
|
+
type: "toggle",
|
|
1564
|
+
default: !1,
|
|
1565
|
+
section: "Characters"
|
|
1566
|
+
},
|
|
1567
|
+
{
|
|
1568
|
+
key: "glyphScale",
|
|
1569
|
+
label: "Glyph scale",
|
|
1570
|
+
type: "range",
|
|
1571
|
+
min: .5,
|
|
1572
|
+
max: 2,
|
|
1573
|
+
step: .05,
|
|
1574
|
+
default: 1,
|
|
1575
|
+
section: "Characters"
|
|
1576
|
+
},
|
|
1577
|
+
{
|
|
1578
|
+
key: "cellSize",
|
|
1579
|
+
label: "Cell size",
|
|
1580
|
+
type: "range",
|
|
1581
|
+
min: 4,
|
|
1582
|
+
max: 40,
|
|
1583
|
+
step: 1,
|
|
1584
|
+
default: 10,
|
|
1585
|
+
noRandom: !0,
|
|
1586
|
+
section: "Cells"
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
key: "contrast",
|
|
1590
|
+
label: "Contrast",
|
|
1591
|
+
type: "range",
|
|
1592
|
+
min: -100,
|
|
1593
|
+
max: 100,
|
|
1594
|
+
step: 1,
|
|
1595
|
+
default: 0,
|
|
1596
|
+
section: "Cells"
|
|
1597
|
+
},
|
|
1598
|
+
{
|
|
1599
|
+
key: "useColor",
|
|
1600
|
+
label: "Original color",
|
|
1601
|
+
type: "toggle",
|
|
1602
|
+
default: !0,
|
|
1603
|
+
section: "Color"
|
|
1604
|
+
},
|
|
1605
|
+
{
|
|
1606
|
+
key: "fg",
|
|
1607
|
+
label: "Foreground",
|
|
1608
|
+
type: "color",
|
|
1609
|
+
role: "fg",
|
|
1610
|
+
default: "#f4f1ea",
|
|
1611
|
+
section: "Color",
|
|
1612
|
+
when: (e) => !(e.useColor ?? !0)
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
key: "bg",
|
|
1616
|
+
label: "Background",
|
|
1617
|
+
type: "color",
|
|
1618
|
+
role: "bg",
|
|
1619
|
+
default: "#06070b",
|
|
1620
|
+
section: "Color"
|
|
1621
|
+
}
|
|
1622
|
+
],
|
|
1623
|
+
apply(e, t, n, r, i, a) {
|
|
1624
|
+
if ((i.amount ?? 100) <= 0) {
|
|
1625
|
+
e.drawImage(t, 0, 0, n, r);
|
|
1626
|
+
return;
|
|
1627
|
+
}
|
|
1628
|
+
let o = t.width, s = t.height, c = St(t), l = o / n || 1, u = Math.max(2, Math.round((i.cellSize ?? 10) * l)), d = i.algorithm ?? "density", f = i.useColor ?? !0, p = !!i.invert, m = ut(i, a), h = pt(m), g = !!m && m.some((e) => e.target === "geometry"), _ = i.contrast ?? 0, v = 259 * (_ + 255) / (255 * (259 - _)), y = (e) => Math.max(0, Math.min(255, v * (e - 128) + 128)), b = (e, t) => {
|
|
1629
|
+
let n = Math.max(0, Math.min(o - 1, Math.round(e))), r = Math.max(0, Math.min(s - 1, Math.round(t))) * o + n << 2;
|
|
1630
|
+
if (c[r + 3] < 20) return null;
|
|
1631
|
+
let i = (.299 * y(c[r]) + .587 * y(c[r + 1]) + .114 * y(c[r + 2])) / 255;
|
|
1632
|
+
return p ? 1 - i : i;
|
|
1633
|
+
}, x = (e, t) => {
|
|
1634
|
+
let n = Math.max(0, Math.min(o - 1, Math.round(e))), r = Math.max(0, Math.min(s - 1, Math.round(t))) * o + n << 2;
|
|
1635
|
+
return `rgb(${Math.floor(y(c[r]))},${Math.floor(y(c[r + 1]))},${Math.floor(y(c[r + 2]))})`;
|
|
1636
|
+
}, S = d === "custom" ? i.ramp && i.ramp.length ? i.ramp : mt : (_t.find((e) => e.value === i.charset) ?? _t[0]).ramp;
|
|
1637
|
+
e.save(), e.scale(n / o, r / s), e.fillStyle = i.bg ?? "#06070b", e.fillRect(0, 0, o, s), h && e.drawImage(t, 0, 0, o, s), e.fillStyle = i.fg ?? "#f4f1ea", e.textAlign = "center", e.textBaseline = "middle", e.font = `${Math.max(4, u * (i.glyphScale ?? 1))}px ui-monospace, monospace`;
|
|
1638
|
+
for (let t = 0; t < s; t += u) for (let n = 0; n < o; n += u) {
|
|
1639
|
+
let r = n + u / 2, i = t + u / 2, a = b(r, i);
|
|
1640
|
+
if (a == null) continue;
|
|
1641
|
+
let c = m ? dt(m, r / o, i / s) : st;
|
|
1642
|
+
if (c.hasReveal && c.reveal < .5) continue;
|
|
1643
|
+
c.bright && (a = Math.max(0, Math.min(1, a + c.bright)));
|
|
1644
|
+
let l = null;
|
|
1645
|
+
switch (d) {
|
|
1646
|
+
case "edges": {
|
|
1647
|
+
let e = b(r + u, i), t = b(r, i + u);
|
|
1648
|
+
if (e == null || t == null) break;
|
|
1649
|
+
let n = e - a, o = t - a;
|
|
1650
|
+
if (Math.hypot(n, o) < .06) {
|
|
1651
|
+
l = a > .5 ? "·" : null;
|
|
1652
|
+
break;
|
|
1653
|
+
}
|
|
1654
|
+
let s = Math.atan2(o, n) + Math.PI / 2;
|
|
1655
|
+
l = ht[Math.round((s + Math.PI) / Math.PI * 2) % 4];
|
|
1656
|
+
break;
|
|
1657
|
+
}
|
|
1658
|
+
case "braille": {
|
|
1659
|
+
let e = u / 2, r = u / 4, i = 0;
|
|
1660
|
+
for (let a = 0; a < yt.length; a++) {
|
|
1661
|
+
let o = yt[a], s = b(n + e * o[0] + e / 2, t + r * o[1] + r / 2);
|
|
1662
|
+
s != null && s > .5 && (i |= o[2]);
|
|
1663
|
+
}
|
|
1664
|
+
if (i === 0) break;
|
|
1665
|
+
l = String.fromCharCode(10240 + i);
|
|
1666
|
+
break;
|
|
1667
|
+
}
|
|
1668
|
+
default:
|
|
1669
|
+
l = bt(S, a);
|
|
1670
|
+
break;
|
|
1671
|
+
}
|
|
1672
|
+
!l || l === " " || (f && (e.fillStyle = x(r, i)), g ? (e.save(), e.translate(r + c.offX * u, i + c.offY * u), e.rotate(c.rot), e.scale(c.scaleMul, c.scaleMul), e.fillText(l, 0, 0), e.restore()) : e.fillText(l, r, i));
|
|
1673
|
+
}
|
|
1674
|
+
e.restore(), de(e, t, n, r, i.amount);
|
|
1675
|
+
}
|
|
1676
|
+
}, K = Math.PI * 2;
|
|
1677
|
+
function wt(e, t, n, r, i, a) {
|
|
1678
|
+
let o = K / i;
|
|
1679
|
+
for (let s = 0; s < i; s++) {
|
|
1680
|
+
let i = s * o + a;
|
|
1681
|
+
s === 0 ? e.moveTo(t + Math.cos(i) * r, n + Math.sin(i) * r) : e.lineTo(t + Math.cos(i) * r, n + Math.sin(i) * r);
|
|
1682
|
+
}
|
|
1683
|
+
e.closePath();
|
|
1684
|
+
}
|
|
1685
|
+
function Tt(e, t, n, r, i, a) {
|
|
1686
|
+
let o = Math.PI / 2 * 3, s = Math.PI / r;
|
|
1687
|
+
e.moveTo(t, n - i);
|
|
1688
|
+
for (let c = 0; c < r; c++) {
|
|
1689
|
+
let r = t + Math.cos(o) * i, c = n + Math.sin(o) * i;
|
|
1690
|
+
e.lineTo(r, c), o += s, r = t + Math.cos(o) * a, c = n + Math.sin(o) * a, e.lineTo(r, c), o += s;
|
|
1691
|
+
}
|
|
1692
|
+
e.lineTo(t, n - i), e.closePath();
|
|
1693
|
+
}
|
|
1694
|
+
function Et(e, t, n, r, i) {
|
|
1695
|
+
let a = r / 2;
|
|
1696
|
+
switch (e.beginPath(), i) {
|
|
1697
|
+
case "circle":
|
|
1698
|
+
e.arc(t, n, a, 0, K), e.fill();
|
|
1699
|
+
break;
|
|
1700
|
+
case "rect":
|
|
1701
|
+
e.rect(t - a, n - a, r, r), e.fill();
|
|
1702
|
+
break;
|
|
1703
|
+
case "triangle":
|
|
1704
|
+
e.moveTo(t, n - a), e.lineTo(t + a, n + a), e.lineTo(t - a, n + a), e.closePath(), e.fill();
|
|
1705
|
+
break;
|
|
1706
|
+
case "octagon":
|
|
1707
|
+
wt(e, t, n, a, 8, Math.PI / 8), e.fill();
|
|
1708
|
+
break;
|
|
1709
|
+
case "star":
|
|
1710
|
+
Tt(e, t, n, 5, a, a * .4), e.fill();
|
|
1711
|
+
break;
|
|
1712
|
+
case "cross": {
|
|
1713
|
+
let i = a / 3;
|
|
1714
|
+
e.rect(t - i, n - a, i * 2, r), e.rect(t - a, n - i, r, i * 2), e.fill();
|
|
1715
|
+
break;
|
|
1716
|
+
}
|
|
1717
|
+
case "rect_v":
|
|
1718
|
+
e.rect(t - a * .3, n - a, r * .3, r), e.fill();
|
|
1719
|
+
break;
|
|
1720
|
+
case "rect_h":
|
|
1721
|
+
e.rect(t - a, n - a * .3, r, r * .3), e.fill();
|
|
1722
|
+
break;
|
|
1723
|
+
case "hex_v":
|
|
1724
|
+
wt(e, t, n, a, 6, Math.PI / 6), e.fill();
|
|
1725
|
+
break;
|
|
1726
|
+
case "line_diag_r":
|
|
1727
|
+
e.moveTo(t - a, n + a), e.lineTo(t - a + r * .2, n + a), e.lineTo(t + a, n - a), e.lineTo(t + a - r * .2, n - a), e.closePath(), e.fill();
|
|
1728
|
+
break;
|
|
1729
|
+
case "line_diag_l":
|
|
1730
|
+
e.moveTo(t - a, n - a), e.lineTo(t - a + r * .2, n - a), e.lineTo(t + a, n + a), e.lineTo(t + a - r * .2, n + a), e.closePath(), e.fill();
|
|
1731
|
+
break;
|
|
1732
|
+
case "chevron": {
|
|
1733
|
+
let r = a * .4;
|
|
1734
|
+
e.moveTo(t - a, n + a * .5), e.lineTo(t, n - a * .5), e.lineTo(t + a, n + a * .5), e.lineTo(t + a, n + a * .5 - r), e.lineTo(t, n - a * .5 - r), e.lineTo(t - a, n + a * .5 - r), e.closePath(), e.fill();
|
|
1735
|
+
break;
|
|
1736
|
+
}
|
|
1737
|
+
case "trapezoid":
|
|
1738
|
+
e.moveTo(t - a * .6, n - a), e.lineTo(t + a * .6, n - a), e.lineTo(t + a, n + a), e.lineTo(t - a, n + a), e.closePath(), e.fill();
|
|
1739
|
+
break;
|
|
1740
|
+
case "semi_top":
|
|
1741
|
+
e.arc(t, n + a * .1, a, Math.PI, 0), e.closePath(), e.fill();
|
|
1742
|
+
break;
|
|
1743
|
+
case "semi_bottom":
|
|
1744
|
+
e.arc(t, n - a * .1, a, 0, Math.PI), e.closePath(), e.fill();
|
|
1745
|
+
break;
|
|
1746
|
+
case "rect_hollow":
|
|
1747
|
+
e.rect(t - a, n - a, r, r), e.rect(t + a * .5, n - a * .5, -r * .5, r * .5), e.fill();
|
|
1748
|
+
break;
|
|
1749
|
+
case "spiral": {
|
|
1750
|
+
e.lineWidth = r * .15, e.lineCap = "round";
|
|
1751
|
+
let i = a / 20;
|
|
1752
|
+
e.moveTo(t, n);
|
|
1753
|
+
for (let r = 0; r < 40; r++) {
|
|
1754
|
+
let a = .5 * r, o = i * r;
|
|
1755
|
+
e.lineTo(t + Math.cos(a) * o, n + Math.sin(a) * o);
|
|
1756
|
+
}
|
|
1757
|
+
e.stroke();
|
|
1758
|
+
break;
|
|
1759
|
+
}
|
|
1760
|
+
case "concentric":
|
|
1761
|
+
e.arc(t, n, a, 0, K), e.arc(t, n, a * .7, 0, K, !0), e.arc(t, n, a * .4, 0, K), e.arc(t, n, a * .15, 0, K, !0), e.fill();
|
|
1762
|
+
break;
|
|
1763
|
+
case "gear": {
|
|
1764
|
+
let r = a, i = a * .7, o = a * .3;
|
|
1765
|
+
for (let a = 0; a < 16; a++) {
|
|
1766
|
+
let o = K * a / 16, s = a % 2 == 0 ? r : i, c = t + Math.cos(o) * s, l = n + Math.sin(o) * s;
|
|
1767
|
+
a === 0 ? e.moveTo(c, l) : e.lineTo(c, l);
|
|
1768
|
+
}
|
|
1769
|
+
e.closePath(), e.moveTo(t + o, n), e.arc(t, n, o, 0, K, !0), e.fill();
|
|
1770
|
+
break;
|
|
1771
|
+
}
|
|
1772
|
+
case "flower":
|
|
1773
|
+
for (let r = 0; r < 5; r++) {
|
|
1774
|
+
let i = K * r / 5, o = t + a * .6 * Math.cos(i), s = n + a * .6 * Math.sin(i);
|
|
1775
|
+
e.moveTo(t, n), e.arc(o, s, a * .4, 0, K);
|
|
1776
|
+
}
|
|
1777
|
+
e.fill();
|
|
1778
|
+
break;
|
|
1779
|
+
case "ghost":
|
|
1780
|
+
e.arc(t, n - a * .2, a * .8, Math.PI, 0), e.lineTo(t + a * .8, n + a), e.lineTo(t + a * .4, n + a * .7), e.lineTo(t, n + a), e.lineTo(t - a * .4, n + a * .7), e.lineTo(t - a * .8, n + a), e.closePath(), e.moveTo(t - a * .3, n - a * .2), e.arc(t - a * .3, n - a * .2, a * .2, 0, K), e.moveTo(t + a * .3, n - a * .2), e.arc(t + a * .3, n - a * .2, a * .2, 0, K), e.fill();
|
|
1781
|
+
break;
|
|
1782
|
+
default:
|
|
1783
|
+
e.arc(t, n, a, 0, K), e.fill();
|
|
1784
|
+
break;
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
var Dt = [
|
|
1788
|
+
{
|
|
1789
|
+
value: "halftone",
|
|
1790
|
+
label: "Halftone"
|
|
1791
|
+
},
|
|
1792
|
+
{
|
|
1793
|
+
value: "inv_halftone",
|
|
1794
|
+
label: "Inverse halftone"
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
value: "flat",
|
|
1798
|
+
label: "Static (flat)"
|
|
1799
|
+
},
|
|
1800
|
+
{
|
|
1801
|
+
value: "stretch_v",
|
|
1802
|
+
label: "Stretch vertical"
|
|
1803
|
+
},
|
|
1804
|
+
{
|
|
1805
|
+
value: "stretch_h",
|
|
1806
|
+
label: "Stretch horizontal"
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
value: "checker",
|
|
1810
|
+
label: "Checkerboard"
|
|
1811
|
+
},
|
|
1812
|
+
{
|
|
1813
|
+
value: "glitch",
|
|
1814
|
+
label: "Glitch"
|
|
1815
|
+
},
|
|
1816
|
+
{
|
|
1817
|
+
value: "melt",
|
|
1818
|
+
label: "Pixel melt"
|
|
1819
|
+
},
|
|
1820
|
+
{
|
|
1821
|
+
value: "crosshatch",
|
|
1822
|
+
label: "Crosshatch"
|
|
1823
|
+
},
|
|
1824
|
+
{
|
|
1825
|
+
value: "rotation",
|
|
1826
|
+
label: "Rotation"
|
|
1827
|
+
},
|
|
1828
|
+
{
|
|
1829
|
+
value: "random_size",
|
|
1830
|
+
label: "Random size"
|
|
1831
|
+
},
|
|
1832
|
+
{
|
|
1833
|
+
value: "random_rot",
|
|
1834
|
+
label: "Random rotation"
|
|
1835
|
+
},
|
|
1836
|
+
{
|
|
1837
|
+
value: "opacity",
|
|
1838
|
+
label: "Opacity"
|
|
1839
|
+
},
|
|
1840
|
+
{
|
|
1841
|
+
value: "inv_opacity",
|
|
1842
|
+
label: "Inverse opacity"
|
|
1843
|
+
},
|
|
1844
|
+
{
|
|
1845
|
+
value: "threshold",
|
|
1846
|
+
label: "Threshold"
|
|
1847
|
+
},
|
|
1848
|
+
{
|
|
1849
|
+
value: "flow",
|
|
1850
|
+
label: "Flow field"
|
|
1851
|
+
},
|
|
1852
|
+
{
|
|
1853
|
+
value: "edges",
|
|
1854
|
+
label: "Edge detect"
|
|
1855
|
+
},
|
|
1856
|
+
{
|
|
1857
|
+
value: "jitter",
|
|
1858
|
+
label: "Mosaic jitter"
|
|
1859
|
+
},
|
|
1860
|
+
{
|
|
1861
|
+
value: "posterize",
|
|
1862
|
+
label: "Posterize"
|
|
1863
|
+
},
|
|
1864
|
+
{
|
|
1865
|
+
value: "interference",
|
|
1866
|
+
label: "Interference"
|
|
1867
|
+
},
|
|
1868
|
+
{
|
|
1869
|
+
value: "crt_scan",
|
|
1870
|
+
label: "CRT scanline"
|
|
1871
|
+
},
|
|
1872
|
+
{
|
|
1873
|
+
value: "bio",
|
|
1874
|
+
label: "Bio-organic"
|
|
1875
|
+
},
|
|
1876
|
+
{
|
|
1877
|
+
value: "eraser",
|
|
1878
|
+
label: "Eraser"
|
|
1879
|
+
}
|
|
1880
|
+
], Ot = [
|
|
1881
|
+
{
|
|
1882
|
+
value: "circle",
|
|
1883
|
+
label: "Circle"
|
|
1884
|
+
},
|
|
1885
|
+
{
|
|
1886
|
+
value: "rect",
|
|
1887
|
+
label: "Square"
|
|
1888
|
+
},
|
|
1889
|
+
{
|
|
1890
|
+
value: "triangle",
|
|
1891
|
+
label: "Triangle"
|
|
1892
|
+
},
|
|
1893
|
+
{
|
|
1894
|
+
value: "octagon",
|
|
1895
|
+
label: "Octagon"
|
|
1896
|
+
},
|
|
1897
|
+
{
|
|
1898
|
+
value: "star",
|
|
1899
|
+
label: "Star"
|
|
1900
|
+
},
|
|
1901
|
+
{
|
|
1902
|
+
value: "cross",
|
|
1903
|
+
label: "Cross"
|
|
1904
|
+
},
|
|
1905
|
+
{
|
|
1906
|
+
value: "rect_v",
|
|
1907
|
+
label: "Rect vertical"
|
|
1908
|
+
},
|
|
1909
|
+
{
|
|
1910
|
+
value: "rect_h",
|
|
1911
|
+
label: "Rect horizontal"
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
value: "hex_v",
|
|
1915
|
+
label: "Hexagon"
|
|
1916
|
+
},
|
|
1917
|
+
{
|
|
1918
|
+
value: "line_diag_r",
|
|
1919
|
+
label: "Diagonal /"
|
|
1920
|
+
},
|
|
1921
|
+
{
|
|
1922
|
+
value: "line_diag_l",
|
|
1923
|
+
label: "Diagonal \\"
|
|
1924
|
+
},
|
|
1925
|
+
{
|
|
1926
|
+
value: "chevron",
|
|
1927
|
+
label: "Chevron"
|
|
1928
|
+
},
|
|
1929
|
+
{
|
|
1930
|
+
value: "trapezoid",
|
|
1931
|
+
label: "Trapezoid"
|
|
1932
|
+
},
|
|
1933
|
+
{
|
|
1934
|
+
value: "semi_top",
|
|
1935
|
+
label: "Semi-circle top"
|
|
1936
|
+
},
|
|
1937
|
+
{
|
|
1938
|
+
value: "semi_bottom",
|
|
1939
|
+
label: "Semi-circle bottom"
|
|
1940
|
+
},
|
|
1941
|
+
{
|
|
1942
|
+
value: "rect_hollow",
|
|
1943
|
+
label: "Square hollow"
|
|
1944
|
+
},
|
|
1945
|
+
{
|
|
1946
|
+
value: "spiral",
|
|
1947
|
+
label: "Spiral"
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
value: "concentric",
|
|
1951
|
+
label: "Concentric"
|
|
1952
|
+
},
|
|
1953
|
+
{
|
|
1954
|
+
value: "gear",
|
|
1955
|
+
label: "Gear"
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
value: "flower",
|
|
1959
|
+
label: "Flower"
|
|
1960
|
+
},
|
|
1961
|
+
{
|
|
1962
|
+
value: "ghost",
|
|
1963
|
+
label: "Pacman ghost"
|
|
1964
|
+
}
|
|
1965
|
+
], kt = new Set([
|
|
1966
|
+
"glitch",
|
|
1967
|
+
"flow",
|
|
1968
|
+
"edges",
|
|
1969
|
+
"melt",
|
|
1970
|
+
"jitter",
|
|
1971
|
+
"interference",
|
|
1972
|
+
"crt_scan",
|
|
1973
|
+
"eraser"
|
|
1974
|
+
]), At = {
|
|
1975
|
+
id: "fx-halftone-dither",
|
|
1976
|
+
label: "Dither",
|
|
1977
|
+
animated: !0,
|
|
1978
|
+
sweeps: !0,
|
|
1979
|
+
params: [
|
|
1980
|
+
{
|
|
1981
|
+
...R,
|
|
1982
|
+
section: "Effect"
|
|
1983
|
+
},
|
|
1984
|
+
{
|
|
1985
|
+
key: "mode",
|
|
1986
|
+
label: "Mode",
|
|
1987
|
+
type: "select",
|
|
1988
|
+
options: Dt,
|
|
1989
|
+
default: "halftone",
|
|
1990
|
+
section: "Mode"
|
|
1991
|
+
},
|
|
1992
|
+
{
|
|
1993
|
+
key: "shape",
|
|
1994
|
+
label: "Shape",
|
|
1995
|
+
type: "select",
|
|
1996
|
+
options: Ot,
|
|
1997
|
+
default: "circle",
|
|
1998
|
+
section: "Shape"
|
|
1999
|
+
},
|
|
2000
|
+
{
|
|
2001
|
+
key: "cellSize",
|
|
2002
|
+
label: "Cell size",
|
|
2003
|
+
type: "range",
|
|
2004
|
+
min: 4,
|
|
2005
|
+
max: 40,
|
|
2006
|
+
step: 1,
|
|
2007
|
+
default: 10,
|
|
2008
|
+
noRandom: !0,
|
|
2009
|
+
section: "Dither"
|
|
2010
|
+
},
|
|
2011
|
+
{
|
|
2012
|
+
key: "baseScale",
|
|
2013
|
+
label: "Scale",
|
|
2014
|
+
type: "range",
|
|
2015
|
+
min: .1,
|
|
2016
|
+
max: 3,
|
|
2017
|
+
step: .025,
|
|
2018
|
+
default: .9,
|
|
2019
|
+
section: "Dither"
|
|
2020
|
+
},
|
|
2021
|
+
{
|
|
2022
|
+
key: "gap",
|
|
2023
|
+
label: "Gap",
|
|
2024
|
+
type: "range",
|
|
2025
|
+
min: 0,
|
|
2026
|
+
max: 20,
|
|
2027
|
+
step: .25,
|
|
2028
|
+
default: 1,
|
|
2029
|
+
section: "Dither"
|
|
2030
|
+
},
|
|
2031
|
+
{
|
|
2032
|
+
key: "contrast",
|
|
2033
|
+
label: "Contrast",
|
|
2034
|
+
type: "range",
|
|
2035
|
+
min: -100,
|
|
2036
|
+
max: 100,
|
|
2037
|
+
step: 1,
|
|
2038
|
+
default: 0,
|
|
2039
|
+
section: "Dither"
|
|
2040
|
+
},
|
|
2041
|
+
{
|
|
2042
|
+
key: "intensity",
|
|
2043
|
+
label: "Intensity",
|
|
2044
|
+
type: "range",
|
|
2045
|
+
min: 0,
|
|
2046
|
+
max: 5,
|
|
2047
|
+
step: .05,
|
|
2048
|
+
default: 1,
|
|
2049
|
+
section: "Dither",
|
|
2050
|
+
when: (e) => kt.has(e.mode ?? "halftone")
|
|
2051
|
+
},
|
|
2052
|
+
{
|
|
2053
|
+
key: "useColor",
|
|
2054
|
+
label: "Original color",
|
|
2055
|
+
type: "toggle",
|
|
2056
|
+
default: !0,
|
|
2057
|
+
section: "Color"
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
key: "monoColor",
|
|
2061
|
+
label: "Foreground",
|
|
2062
|
+
type: "color",
|
|
2063
|
+
role: "fg",
|
|
2064
|
+
default: "#ffffff",
|
|
2065
|
+
section: "Color",
|
|
2066
|
+
when: (e) => !(e.useColor ?? !0)
|
|
2067
|
+
},
|
|
2068
|
+
{
|
|
2069
|
+
key: "bgColor",
|
|
2070
|
+
label: "Background",
|
|
2071
|
+
type: "color",
|
|
2072
|
+
role: "bg",
|
|
2073
|
+
default: "#111111",
|
|
2074
|
+
section: "Color"
|
|
2075
|
+
}
|
|
2076
|
+
],
|
|
2077
|
+
apply(e, t, n, r, i, a) {
|
|
2078
|
+
if ((i.amount ?? 100) <= 0) {
|
|
2079
|
+
e.drawImage(t, 0, 0, n, r);
|
|
2080
|
+
return;
|
|
2081
|
+
}
|
|
2082
|
+
let o = t.width, s = t.height, c = ce(t).base.data, l = o / n || 1, u = Math.max(2, Math.round((i.cellSize ?? 10) * l)), d = i.mode ?? "halftone", f = i.shape ?? "circle", p = i.baseScale ?? .9, m = (i.gap ?? 1) * l, h = i.intensity ?? 1, g = i.useColor ?? !0, _ = ut(i, a), v = pt(_), y = i.contrast ?? 0, b = 259 * (y + 255) / (255 * (259 - y)), x = (i.monoColor ?? "#ffffff").replace(/^#/, ""), S = parseInt(x.substring(0, 2), 16), C = parseInt(x.substring(2, 4), 16), w = parseInt(x.substring(4, 6), 16);
|
|
2083
|
+
e.save(), e.scale(n / o, r / s), e.fillStyle = i.bgColor ?? "#111111", e.fillRect(0, 0, o, s), v && e.drawImage(t, 0, 0, o, s);
|
|
2084
|
+
let T = Math.max(0, u - m);
|
|
2085
|
+
for (let t = 0; t < s; t += u) for (let n = 0; n < o; n += u) {
|
|
2086
|
+
let r = (t + (u >> 1)) * o + (n + (u >> 1)) << 2;
|
|
2087
|
+
if (r >= c.length) continue;
|
|
2088
|
+
let i = c[r], a = c[r + 1], l = c[r + 2];
|
|
2089
|
+
if (c[r + 3] < 20) continue;
|
|
2090
|
+
i = Math.max(0, Math.min(255, b * (i - 128) + 128)), a = Math.max(0, Math.min(255, b * (a - 128) + 128)), l = Math.max(0, Math.min(255, b * (l - 128) + 128));
|
|
2091
|
+
let m = _ ? dt(_, (n + u / 2) / o, (t + u / 2) / s) : st;
|
|
2092
|
+
if (m.hasReveal && m.reveal < .5) continue;
|
|
2093
|
+
let v = (.299 * i + .587 * a + .114 * l) / 255;
|
|
2094
|
+
m.bright && (v = Math.max(0, Math.min(1, v + m.bright)));
|
|
2095
|
+
let y = p, x = p, E = 0, D = 0, ee = 0, O = 1;
|
|
2096
|
+
switch (d) {
|
|
2097
|
+
case "flat": break;
|
|
2098
|
+
case "halftone":
|
|
2099
|
+
y = x = v * p * 1.5;
|
|
2100
|
+
break;
|
|
2101
|
+
case "inv_halftone":
|
|
2102
|
+
y = x = (1 - v) * p * 1.5;
|
|
2103
|
+
break;
|
|
2104
|
+
case "rotation":
|
|
2105
|
+
E = v * Math.PI;
|
|
2106
|
+
break;
|
|
2107
|
+
case "random_size":
|
|
2108
|
+
y = x = z(n, t) * p;
|
|
2109
|
+
break;
|
|
2110
|
+
case "random_rot":
|
|
2111
|
+
E = z(n, t) * K;
|
|
2112
|
+
break;
|
|
2113
|
+
case "glitch":
|
|
2114
|
+
D = (v - .5) * u * 1.5 * h;
|
|
2115
|
+
break;
|
|
2116
|
+
case "opacity":
|
|
2117
|
+
O = v;
|
|
2118
|
+
break;
|
|
2119
|
+
case "inv_opacity":
|
|
2120
|
+
O = 1 - v;
|
|
2121
|
+
break;
|
|
2122
|
+
case "threshold":
|
|
2123
|
+
v < .5 && (y = x = 0);
|
|
2124
|
+
break;
|
|
2125
|
+
case "crosshatch":
|
|
2126
|
+
E = v > .5 ? Math.PI / 4 : -Math.PI / 4, x = p * 1.5, y = p * .2;
|
|
2127
|
+
break;
|
|
2128
|
+
case "stretch_v":
|
|
2129
|
+
y = p * .5, x = v * p * 3;
|
|
2130
|
+
break;
|
|
2131
|
+
case "stretch_h":
|
|
2132
|
+
y = v * p * 3, x = p * .5;
|
|
2133
|
+
break;
|
|
2134
|
+
case "flow": {
|
|
2135
|
+
let e = r + (u << 2), t = r + (o * u << 2), n = c[e] || 0, i = c[e + 1] || 0, a = c[e + 2] || 0, s = c[t] || 0, l = c[t + 1] || 0, d = c[t + 2] || 0, f = (.299 * n + .587 * i + .114 * a) / 255, m = (.299 * s + .587 * l + .114 * d) / 255, g = (.299 * c[r] + .587 * c[r + 1] + .114 * c[r + 2]) / 255, _ = f - g, b = m - g;
|
|
2136
|
+
E = Math.atan2(b, _) * h, y = x = v * p * 1.2;
|
|
2137
|
+
break;
|
|
2138
|
+
}
|
|
2139
|
+
case "edges": {
|
|
2140
|
+
let e = r + (u << 2), t = c[e] || 0;
|
|
2141
|
+
t = b * (t - 128) + 128;
|
|
2142
|
+
let n = c[e + 1] || 0, i = c[e + 2] || 0, a = (.299 * t + .587 * n + .114 * i) / 255;
|
|
2143
|
+
y = x = Math.abs(v - a) * 5 * p * h;
|
|
2144
|
+
break;
|
|
2145
|
+
}
|
|
2146
|
+
case "melt":
|
|
2147
|
+
ee = v * u * 2 * h, y = x = v * p;
|
|
2148
|
+
break;
|
|
2149
|
+
case "jitter": {
|
|
2150
|
+
let e = (z(n, t) - .5) * u * 2;
|
|
2151
|
+
v > .5 && (D = e * h, ee = e * h), y = x = v * p;
|
|
2152
|
+
break;
|
|
2153
|
+
}
|
|
2154
|
+
case "checker":
|
|
2155
|
+
y = x = (Math.floor(n / u) + Math.floor(t / u)) % 2 == 0 ? v * p * 1.5 : (1 - v) * p * 1.5;
|
|
2156
|
+
break;
|
|
2157
|
+
case "posterize": {
|
|
2158
|
+
let e = .2;
|
|
2159
|
+
v > .3 && (e = .5), v > .6 && (e = .8), v > .8 && (e = 1), y = x = e * p;
|
|
2160
|
+
break;
|
|
2161
|
+
}
|
|
2162
|
+
case "interference": {
|
|
2163
|
+
let e = Math.sin(n * t * 1e-4 * h);
|
|
2164
|
+
y = x = (v + e) * .5 * p * 1.5;
|
|
2165
|
+
break;
|
|
2166
|
+
}
|
|
2167
|
+
case "crt_scan":
|
|
2168
|
+
Math.floor(t / u) % 2 == 0 ? (y = p * 1.2, x = p * .2, D = 2 * h) : (y = v * p, x = p * .8);
|
|
2169
|
+
break;
|
|
2170
|
+
case "bio":
|
|
2171
|
+
E = Math.sin(v * K) + z(n, t) * .5, y = x = (v + .2) * p;
|
|
2172
|
+
break;
|
|
2173
|
+
case "eraser":
|
|
2174
|
+
z(n, t) > v * h && (y = x = 0);
|
|
2175
|
+
break;
|
|
2176
|
+
}
|
|
2177
|
+
e.save(), e.translate(n + u / 2 + D + m.offX * u, t + u / 2 + ee + m.offY * u), e.rotate(E + m.rot), e.scale(y * m.scaleMul, x * m.scaleMul), e.fillStyle = g ? `rgba(${Math.floor(i)},${Math.floor(a)},${Math.floor(l)},${O})` : `rgba(${S},${C},${w},${O})`, e.strokeStyle = e.fillStyle, Et(e, 0, 0, T, f), e.restore();
|
|
2178
|
+
}
|
|
2179
|
+
e.restore(), de(e, t, n, r, i.amount);
|
|
2180
|
+
}
|
|
2181
|
+
}, jt = [
|
|
2182
|
+
{
|
|
2183
|
+
value: "radial",
|
|
2184
|
+
label: "Radial"
|
|
2185
|
+
},
|
|
2186
|
+
{
|
|
2187
|
+
value: "linear",
|
|
2188
|
+
label: "Linear"
|
|
2189
|
+
},
|
|
2190
|
+
{
|
|
2191
|
+
value: "waves",
|
|
2192
|
+
label: "Waves"
|
|
2193
|
+
},
|
|
2194
|
+
{
|
|
2195
|
+
value: "noise",
|
|
2196
|
+
label: "Noise"
|
|
2197
|
+
}
|
|
2198
|
+
], Mt = [
|
|
2199
|
+
{
|
|
2200
|
+
value: "square",
|
|
2201
|
+
label: "Square"
|
|
2202
|
+
},
|
|
2203
|
+
{
|
|
2204
|
+
value: "hex",
|
|
2205
|
+
label: "Hex"
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
value: "phyllotaxis",
|
|
2209
|
+
label: "Phyllotaxis"
|
|
2210
|
+
}
|
|
2211
|
+
], Nt = [
|
|
2212
|
+
{
|
|
2213
|
+
value: "dot",
|
|
2214
|
+
label: "Dot"
|
|
2215
|
+
},
|
|
2216
|
+
{
|
|
2217
|
+
value: "square",
|
|
2218
|
+
label: "Square"
|
|
2219
|
+
},
|
|
2220
|
+
{
|
|
2221
|
+
value: "ring",
|
|
2222
|
+
label: "Ring"
|
|
2223
|
+
}
|
|
2224
|
+
], Pt = [
|
|
2225
|
+
{
|
|
2226
|
+
value: "drekker",
|
|
2227
|
+
label: "Drekker",
|
|
2228
|
+
stops: [
|
|
2229
|
+
"#ff6b35",
|
|
2230
|
+
"#f7c59f",
|
|
2231
|
+
"#2ec4b6",
|
|
2232
|
+
"#2541b2"
|
|
2233
|
+
]
|
|
2234
|
+
},
|
|
2235
|
+
{
|
|
2236
|
+
value: "sunset",
|
|
2237
|
+
label: "Sunset",
|
|
2238
|
+
stops: [
|
|
2239
|
+
"#0d0221",
|
|
2240
|
+
"#ff3864",
|
|
2241
|
+
"#ffd23f"
|
|
2242
|
+
]
|
|
2243
|
+
},
|
|
2244
|
+
{
|
|
2245
|
+
value: "ice",
|
|
2246
|
+
label: "Ice",
|
|
2247
|
+
stops: [
|
|
2248
|
+
"#011627",
|
|
2249
|
+
"#2ec4b6",
|
|
2250
|
+
"#e0fbfc"
|
|
2251
|
+
]
|
|
2252
|
+
},
|
|
2253
|
+
{
|
|
2254
|
+
value: "mono",
|
|
2255
|
+
label: "Mono",
|
|
2256
|
+
stops: ["#000000", "#ffffff"]
|
|
2257
|
+
}
|
|
2258
|
+
];
|
|
2259
|
+
function Ft(e, t) {
|
|
2260
|
+
let n = Math.floor(e), r = Math.floor(t), i = e - n, a = t - r, o = i * i * (3 - 2 * i), s = a * a * (3 - 2 * a), c = z(n, r), l = z(n + 1, r), u = z(n, r + 1), d = z(n + 1, r + 1);
|
|
2261
|
+
return c + (l - c) * o + (u - c) * s + (c - l - u + d) * o * s;
|
|
2262
|
+
}
|
|
2263
|
+
function It(e, t) {
|
|
2264
|
+
let n = 0, r = .5, i = 1;
|
|
2265
|
+
for (let a = 0; a < 4; a++) n += r * Ft(e * i, t * i), i *= 2, r *= .5;
|
|
2266
|
+
return n;
|
|
2267
|
+
}
|
|
2268
|
+
function Lt(e, t, n, r, i) {
|
|
2269
|
+
let a = t - .5, o = n - .5;
|
|
2270
|
+
switch (e) {
|
|
2271
|
+
case "linear": return S(.5 + .5 * Math.sin(t * i * C - r));
|
|
2272
|
+
case "waves": {
|
|
2273
|
+
let e = Math.sqrt(a * a + o * o);
|
|
2274
|
+
return .5 + .5 * Math.sin(e * i * 8 - r);
|
|
2275
|
+
}
|
|
2276
|
+
case "noise": return S(It(t * i + .5 * Math.cos(r), n * i + .5 * Math.sin(r)));
|
|
2277
|
+
default: return S((1 - Math.sqrt(a * a + o * o) * 2) * (.7 + .3 * Math.sin(r)));
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
var Rt = (e) => e.map((e) => {
|
|
2281
|
+
let t = parseInt(e.slice(1), 16);
|
|
2282
|
+
return [
|
|
2283
|
+
t >> 16 & 255,
|
|
2284
|
+
t >> 8 & 255,
|
|
2285
|
+
t & 255
|
|
2286
|
+
];
|
|
2287
|
+
});
|
|
2288
|
+
function zt(e, t) {
|
|
2289
|
+
t = S(t);
|
|
2290
|
+
let n = e.length - 1, r = Math.min(n - 1, Math.floor(t * n)), i = t * n - r, a = e[r], o = e[r + 1];
|
|
2291
|
+
return `rgb(${a[0] + (o[0] - a[0]) * i | 0},${a[1] + (o[1] - a[1]) * i | 0},${a[2] + (o[2] - a[2]) * i | 0})`;
|
|
2292
|
+
}
|
|
2293
|
+
function Bt(e, t, n, r) {
|
|
2294
|
+
let i = [], a = n / r;
|
|
2295
|
+
if (e === "phyllotaxis") {
|
|
2296
|
+
let e = Math.round(200 + t * 36);
|
|
2297
|
+
for (let t = 0; t < e; t++) {
|
|
2298
|
+
let n = Math.sqrt(t / e) * .5, r = t * 2.399963229;
|
|
2299
|
+
i.push([.5 + n * Math.cos(r), .5 + n * Math.sin(r)]);
|
|
2300
|
+
}
|
|
2301
|
+
return i;
|
|
2302
|
+
}
|
|
2303
|
+
let o = 1 / (8 + t), s = o, c = o * a, l = 0;
|
|
2304
|
+
for (let t = c / 2; t < 1; t += c, l++) {
|
|
2305
|
+
let n = e === "hex" && l % 2 ? s / 2 : 0;
|
|
2306
|
+
for (let e = s / 2 + n; e < 1; e += s) i.push([e, t]);
|
|
2307
|
+
}
|
|
2308
|
+
return i;
|
|
2309
|
+
}
|
|
2310
|
+
var Vt = {
|
|
2311
|
+
key: "",
|
|
2312
|
+
list: []
|
|
2313
|
+
};
|
|
2314
|
+
function Ht(e, t, n, r) {
|
|
2315
|
+
let i = `${e}|${t}|${n}|${r}`;
|
|
2316
|
+
return Vt.key !== i && (Vt = {
|
|
2317
|
+
key: i,
|
|
2318
|
+
list: Bt(e, t, n, r)
|
|
2319
|
+
}), Vt.list;
|
|
2320
|
+
}
|
|
2321
|
+
var q = 256, Ut = /* @__PURE__ */ new WeakMap();
|
|
2322
|
+
ae(Ut);
|
|
2323
|
+
var Wt = null;
|
|
2324
|
+
function Gt(e) {
|
|
2325
|
+
let t = Ut.get(e);
|
|
2326
|
+
if (!t) {
|
|
2327
|
+
Wt ||= document.createElement("canvas"), Wt.width = q, Wt.height = q;
|
|
2328
|
+
let n = Wt.getContext("2d", { willReadFrequently: !0 });
|
|
2329
|
+
n.drawImage(e, 0, 0, q, q);
|
|
2330
|
+
let r = n.getImageData(0, 0, q, q).data, i = new Float32Array(q * q);
|
|
2331
|
+
for (let e = 0; e < q * q; e++) {
|
|
2332
|
+
let t = e << 2;
|
|
2333
|
+
i[e] = (.299 * r[t] + .587 * r[t + 1] + .114 * r[t + 2]) / 255;
|
|
2334
|
+
}
|
|
2335
|
+
t = i, Ut.set(e, t);
|
|
2336
|
+
}
|
|
2337
|
+
return t;
|
|
2338
|
+
}
|
|
2339
|
+
var Kt = {
|
|
2340
|
+
id: "fx-bitmap",
|
|
2341
|
+
label: "Bitmap",
|
|
2342
|
+
animated: !0,
|
|
2343
|
+
sweeps: !0,
|
|
2344
|
+
params: [
|
|
2345
|
+
{
|
|
2346
|
+
key: "amount",
|
|
2347
|
+
label: "Amount",
|
|
2348
|
+
type: "range",
|
|
2349
|
+
min: 0,
|
|
2350
|
+
max: 100,
|
|
2351
|
+
step: 1,
|
|
2352
|
+
default: 100,
|
|
2353
|
+
noRandom: !0,
|
|
2354
|
+
section: "Effect"
|
|
2355
|
+
},
|
|
2356
|
+
{
|
|
2357
|
+
key: "field",
|
|
2358
|
+
label: "Field",
|
|
2359
|
+
type: "select",
|
|
2360
|
+
options: jt,
|
|
2361
|
+
default: "radial",
|
|
2362
|
+
section: "Field"
|
|
2363
|
+
},
|
|
2364
|
+
{
|
|
2365
|
+
key: "fieldScale",
|
|
2366
|
+
label: "Field scale",
|
|
2367
|
+
type: "range",
|
|
2368
|
+
min: .2,
|
|
2369
|
+
max: 4,
|
|
2370
|
+
step: .05,
|
|
2371
|
+
default: 1,
|
|
2372
|
+
section: "Field",
|
|
2373
|
+
when: (e) => (e.field ?? "radial") !== "radial"
|
|
2374
|
+
},
|
|
2375
|
+
{
|
|
2376
|
+
key: "contrast",
|
|
2377
|
+
label: "Contrast",
|
|
2378
|
+
type: "range",
|
|
2379
|
+
min: .3,
|
|
2380
|
+
max: 4,
|
|
2381
|
+
step: .05,
|
|
2382
|
+
default: 1,
|
|
2383
|
+
section: "Field"
|
|
2384
|
+
},
|
|
2385
|
+
{
|
|
2386
|
+
key: "rotate",
|
|
2387
|
+
label: "Rotate",
|
|
2388
|
+
type: "range",
|
|
2389
|
+
min: 0,
|
|
2390
|
+
max: 360,
|
|
2391
|
+
step: 1,
|
|
2392
|
+
default: 0,
|
|
2393
|
+
section: "Field"
|
|
2394
|
+
},
|
|
2395
|
+
{
|
|
2396
|
+
key: "layout",
|
|
2397
|
+
label: "Layout",
|
|
2398
|
+
type: "segmented",
|
|
2399
|
+
options: Mt,
|
|
2400
|
+
default: "hex",
|
|
2401
|
+
section: "Grid"
|
|
2402
|
+
},
|
|
2403
|
+
{
|
|
2404
|
+
key: "density",
|
|
2405
|
+
label: "Density",
|
|
2406
|
+
type: "range",
|
|
2407
|
+
min: 4,
|
|
2408
|
+
max: 80,
|
|
2409
|
+
step: 1,
|
|
2410
|
+
default: 34,
|
|
2411
|
+
noRandom: !0,
|
|
2412
|
+
section: "Grid"
|
|
2413
|
+
},
|
|
2414
|
+
{
|
|
2415
|
+
key: "shape",
|
|
2416
|
+
label: "Cell shape",
|
|
2417
|
+
type: "segmented",
|
|
2418
|
+
options: Nt,
|
|
2419
|
+
default: "dot",
|
|
2420
|
+
section: "Cell"
|
|
2421
|
+
},
|
|
2422
|
+
{
|
|
2423
|
+
key: "dotScale",
|
|
2424
|
+
label: "Dot scale",
|
|
2425
|
+
type: "range",
|
|
2426
|
+
min: .2,
|
|
2427
|
+
max: 2,
|
|
2428
|
+
step: .05,
|
|
2429
|
+
default: 1,
|
|
2430
|
+
section: "Cell"
|
|
2431
|
+
},
|
|
2432
|
+
{
|
|
2433
|
+
key: "invert",
|
|
2434
|
+
label: "Invert",
|
|
2435
|
+
type: "toggle",
|
|
2436
|
+
default: !1,
|
|
2437
|
+
section: "Cell"
|
|
2438
|
+
},
|
|
2439
|
+
{
|
|
2440
|
+
key: "palette",
|
|
2441
|
+
label: "Palette",
|
|
2442
|
+
type: "select",
|
|
2443
|
+
options: Pt.map(({ value: e, label: t }) => ({
|
|
2444
|
+
value: e,
|
|
2445
|
+
label: t
|
|
2446
|
+
})),
|
|
2447
|
+
default: "drekker",
|
|
2448
|
+
section: "Color"
|
|
2449
|
+
},
|
|
2450
|
+
{
|
|
2451
|
+
key: "bg",
|
|
2452
|
+
label: "Background",
|
|
2453
|
+
type: "color",
|
|
2454
|
+
role: "bg",
|
|
2455
|
+
default: "#06070b",
|
|
2456
|
+
section: "Color"
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
key: "flow",
|
|
2460
|
+
label: "Flow · cycles",
|
|
2461
|
+
type: "range",
|
|
2462
|
+
min: 0,
|
|
2463
|
+
max: 4,
|
|
2464
|
+
step: 1,
|
|
2465
|
+
default: 1,
|
|
2466
|
+
noRandom: !0,
|
|
2467
|
+
tab: "anim",
|
|
2468
|
+
section: "Motion"
|
|
2469
|
+
},
|
|
2470
|
+
{
|
|
2471
|
+
key: "spin",
|
|
2472
|
+
label: "Spin · turns",
|
|
2473
|
+
type: "range",
|
|
2474
|
+
min: -2,
|
|
2475
|
+
max: 2,
|
|
2476
|
+
step: 1,
|
|
2477
|
+
default: 0,
|
|
2478
|
+
noRandom: !0,
|
|
2479
|
+
tab: "anim",
|
|
2480
|
+
section: "Motion"
|
|
2481
|
+
}
|
|
2482
|
+
],
|
|
2483
|
+
apply(e, t, n, r, i, a) {
|
|
2484
|
+
let o = Gt(t), s = S((i.amount ?? 100) / 100), c = i.field ?? "radial", l = Math.round(i.density ?? 34), u = i.dotScale ?? 1, d = i.contrast ?? 1, f = !!i.invert, p = i.shape ?? "dot", m = C * a * Math.round(i.flow ?? 1), h = ((i.rotate ?? 0) + 360 * a * Math.round(i.spin ?? 0)) * Math.PI / 180, g = ut(i, a), _ = pt(g);
|
|
2485
|
+
e.fillStyle = i.bg ?? "#06070b", e.fillRect(0, 0, n, r), _ && e.drawImage(t, 0, 0, n, r);
|
|
2486
|
+
let v = Rt((Pt.find((e) => e.value === i.palette) || Pt[0]).stops), y = (1 + l * .15) * (i.fieldScale ?? 1), b = Math.min(n, r) / (8 + l), x = Ht(i.layout ?? "hex", l, n, r), w = Math.cos(h), T = Math.sin(h);
|
|
2487
|
+
for (let t = 0; t < x.length; t++) {
|
|
2488
|
+
let i = x[t][0], a = x[t][1], l = g ? dt(g, i, a) : st;
|
|
2489
|
+
if (l.hasReveal && l.reveal < .5) continue;
|
|
2490
|
+
let h = Lt(c, (i - .5) * w - (a - .5) * T + .5, (i - .5) * T + (a - .5) * w + .5, m, y);
|
|
2491
|
+
if (s > 0) {
|
|
2492
|
+
let e = Math.min(q - 1, Math.floor(i * q)), t = o[Math.min(q - 1, Math.floor(a * q)) * q + e];
|
|
2493
|
+
h = s >= 1 ? t : h + (t - h) * s;
|
|
2494
|
+
}
|
|
2495
|
+
l.bright && (h = S(h + l.bright)), d !== 1 && (h = S(h ** +d)), f && (h = 1 - h);
|
|
2496
|
+
let _ = h * b * .62 * u * l.scaleMul;
|
|
2497
|
+
if (_ < .4) continue;
|
|
2498
|
+
let E = i * n + l.offX * b, D = a * r + l.offY * b;
|
|
2499
|
+
e.fillStyle = zt(v, h), p === "square" ? e.fillRect(E - _, D - _, _ * 2, _ * 2) : p === "ring" ? (e.lineWidth = Math.max(1, _ * .4), e.strokeStyle = e.fillStyle, e.beginPath(), e.arc(E, D, _, 0, C), e.stroke()) : (e.beginPath(), e.arc(E, D, _, 0, C), e.fill());
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
};
|
|
2503
|
+
//#endregion
|
|
2504
|
+
//#region src/filters/fxEffects.js
|
|
2505
|
+
function qt(e, t, n) {
|
|
2506
|
+
n < 0 ? n += 1 : n > 1 && --n;
|
|
2507
|
+
let r;
|
|
2508
|
+
return r = 6 * n < 1 ? e + (t - e) * n * 6 : 2 * n < 1 ? t : 3 * n < 2 ? e + (t - e) * (2 / 3 - n) * 6 : e, r * 255 + .5 | 0;
|
|
2509
|
+
}
|
|
2510
|
+
function Jt(e, t, n, r, i) {
|
|
2511
|
+
let a = (i.hue ?? 0) * .5, o = i.saturation ?? 0, s = (i.value ?? 0) * .5;
|
|
2512
|
+
for (let n = 0; n < e.length; n += 4) {
|
|
2513
|
+
let r = e[n] / 255, i = e[n + 1] / 255, c = e[n + 2] / 255, l = r > i ? r > c ? r : c : i > c ? i : c, u = r < i ? r < c ? r : c : i < c ? i : c, d = l - u, f = 0, p = 0, m = (u + l) / 2;
|
|
2514
|
+
for (d !== 0 && (f = r === l ? (i - c) / d + (i < c ? 6 : 0) : i === l ? (c - r) / d + 2 : (r - i) / d + 4, f /= 6, p = m > .5 ? d / (2 - l - u) : d / (l + u)), f += a; f < 0;) f += 1;
|
|
2515
|
+
for (; f > 1;) --f;
|
|
2516
|
+
if (p += p * o, p < 0 ? p = 0 : p > 1 && (p = 1), s > 0 ? m += (1 - m) * s : s < 0 && (m += m * s), p === 0) t[n] = t[n + 1] = t[n + 2] = m * 255 + .5 | 0;
|
|
2517
|
+
else {
|
|
2518
|
+
let e = m <= .5 ? m * (p + 1) : m + p - m * p, r = m * 2 - e;
|
|
2519
|
+
t[n] = qt(r, e, f + 1 / 3), t[n + 1] = qt(r, e, f), t[n + 2] = qt(r, e, f - 1 / 3);
|
|
2520
|
+
}
|
|
2521
|
+
t[n + 3] = e[n + 3];
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
function Yt(e, t, n, r, i) {
|
|
2525
|
+
let a = 1 + (i.brightness ?? 0);
|
|
2526
|
+
for (let n = 0; n < e.length; n += 4) {
|
|
2527
|
+
let r = e[n] * a + .5 | 0, i = e[n + 1] * a + .5 | 0, o = e[n + 2] * a + .5 | 0;
|
|
2528
|
+
t[n] = r > 255 ? 255 : r, t[n + 1] = i > 255 ? 255 : i, t[n + 2] = o > 255 ? 255 : o, t[n + 3] = e[n + 3];
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
function Xt(e, t, n, r, i) {
|
|
2532
|
+
let a = ((i.contrast ?? 0) + 100) / 100;
|
|
2533
|
+
for (let n = 0; n < e.length; n += 4) {
|
|
2534
|
+
let r = (e[n] - 127.5) * a + 127.5 + .5 | 0;
|
|
2535
|
+
t[n] = r > 255 ? 255 : r < 0 ? 0 : r, r = (e[n + 1] - 127.5) * a + 127.5 + .5 | 0, t[n + 1] = r > 255 ? 255 : r < 0 ? 0 : r, r = (e[n + 2] - 127.5) * a + 127.5 + .5 | 0, t[n + 2] = r > 255 ? 255 : r < 0 ? 0 : r, t[n + 3] = e[n + 3];
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
function Zt(e, t, n, r, i) {
|
|
2539
|
+
let a = i.red ?? 0, o = i.green ?? 0, s = i.blue ?? 0;
|
|
2540
|
+
for (let n = 0; n < e.length; n += 4) {
|
|
2541
|
+
let r = e[n] + a;
|
|
2542
|
+
t[n] = r > 255 ? 255 : r < 0 ? 0 : r, r = e[n + 1] + o, t[n + 1] = r > 255 ? 255 : r < 0 ? 0 : r, r = e[n + 2] + s, t[n + 2] = r > 255 ? 255 : r < 0 ? 0 : r, t[n + 3] = e[n + 3];
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
function Qt(e, t) {
|
|
2546
|
+
for (let n = 0; n < e.length; n += 4) t[n] = 255 - e[n], t[n + 1] = 255 - e[n + 1], t[n + 2] = 255 - e[n + 2], t[n + 3] = e[n + 3];
|
|
2547
|
+
}
|
|
2548
|
+
function $t(e, t) {
|
|
2549
|
+
for (let n = 0; n < e.length; n += 4) {
|
|
2550
|
+
let r = e[n], i = e[n + 1], a = e[n + 2], o = r * .393 + i * .769 + a * .189;
|
|
2551
|
+
t[n] = o > 255 ? 255 : o + .5 | 0, o = r * .349 + i * .686 + a * .168, t[n + 1] = o > 255 ? 255 : o + .5 | 0, o = r * .272 + i * .534 + a * .131, t[n + 2] = o > 255 ? 255 : o + .5 | 0, t[n + 3] = e[n + 3];
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
function en(e, t) {
|
|
2555
|
+
for (let n = 0; n < e.length; n += 4) t[n] = t[n + 1] = t[n + 2] = e[n] * 19595 + e[n + 1] * 38470 + e[n + 2] * 7471 >> 16, t[n + 3] = e[n + 3];
|
|
2556
|
+
}
|
|
2557
|
+
var tn = [
|
|
2558
|
+
512,
|
|
2559
|
+
512,
|
|
2560
|
+
456,
|
|
2561
|
+
512,
|
|
2562
|
+
328,
|
|
2563
|
+
456,
|
|
2564
|
+
335,
|
|
2565
|
+
512,
|
|
2566
|
+
405,
|
|
2567
|
+
328,
|
|
2568
|
+
271,
|
|
2569
|
+
456,
|
|
2570
|
+
388,
|
|
2571
|
+
335,
|
|
2572
|
+
292,
|
|
2573
|
+
512,
|
|
2574
|
+
454,
|
|
2575
|
+
405,
|
|
2576
|
+
364,
|
|
2577
|
+
328,
|
|
2578
|
+
298,
|
|
2579
|
+
271,
|
|
2580
|
+
496,
|
|
2581
|
+
456,
|
|
2582
|
+
420,
|
|
2583
|
+
388,
|
|
2584
|
+
360,
|
|
2585
|
+
335,
|
|
2586
|
+
312,
|
|
2587
|
+
292,
|
|
2588
|
+
273,
|
|
2589
|
+
512,
|
|
2590
|
+
482,
|
|
2591
|
+
454,
|
|
2592
|
+
428,
|
|
2593
|
+
405,
|
|
2594
|
+
383,
|
|
2595
|
+
364,
|
|
2596
|
+
345,
|
|
2597
|
+
328,
|
|
2598
|
+
312,
|
|
2599
|
+
298,
|
|
2600
|
+
284,
|
|
2601
|
+
271,
|
|
2602
|
+
259,
|
|
2603
|
+
496,
|
|
2604
|
+
475,
|
|
2605
|
+
456,
|
|
2606
|
+
437,
|
|
2607
|
+
420,
|
|
2608
|
+
404,
|
|
2609
|
+
388,
|
|
2610
|
+
374,
|
|
2611
|
+
360,
|
|
2612
|
+
347,
|
|
2613
|
+
335,
|
|
2614
|
+
323,
|
|
2615
|
+
312,
|
|
2616
|
+
302,
|
|
2617
|
+
292,
|
|
2618
|
+
282,
|
|
2619
|
+
273,
|
|
2620
|
+
265,
|
|
2621
|
+
512,
|
|
2622
|
+
497,
|
|
2623
|
+
482,
|
|
2624
|
+
468,
|
|
2625
|
+
454,
|
|
2626
|
+
441,
|
|
2627
|
+
428,
|
|
2628
|
+
417,
|
|
2629
|
+
405,
|
|
2630
|
+
394,
|
|
2631
|
+
383,
|
|
2632
|
+
373,
|
|
2633
|
+
364,
|
|
2634
|
+
354,
|
|
2635
|
+
345,
|
|
2636
|
+
337,
|
|
2637
|
+
328,
|
|
2638
|
+
320,
|
|
2639
|
+
312,
|
|
2640
|
+
305,
|
|
2641
|
+
298,
|
|
2642
|
+
291,
|
|
2643
|
+
284,
|
|
2644
|
+
278,
|
|
2645
|
+
271,
|
|
2646
|
+
265,
|
|
2647
|
+
259,
|
|
2648
|
+
507,
|
|
2649
|
+
496,
|
|
2650
|
+
485,
|
|
2651
|
+
475,
|
|
2652
|
+
465,
|
|
2653
|
+
456,
|
|
2654
|
+
446,
|
|
2655
|
+
437,
|
|
2656
|
+
428,
|
|
2657
|
+
420,
|
|
2658
|
+
412,
|
|
2659
|
+
404,
|
|
2660
|
+
396,
|
|
2661
|
+
388,
|
|
2662
|
+
381,
|
|
2663
|
+
374,
|
|
2664
|
+
367,
|
|
2665
|
+
360,
|
|
2666
|
+
354,
|
|
2667
|
+
347,
|
|
2668
|
+
341,
|
|
2669
|
+
335,
|
|
2670
|
+
329,
|
|
2671
|
+
323,
|
|
2672
|
+
318,
|
|
2673
|
+
312,
|
|
2674
|
+
307,
|
|
2675
|
+
302,
|
|
2676
|
+
297,
|
|
2677
|
+
292,
|
|
2678
|
+
287,
|
|
2679
|
+
282,
|
|
2680
|
+
278,
|
|
2681
|
+
273,
|
|
2682
|
+
269,
|
|
2683
|
+
265,
|
|
2684
|
+
261,
|
|
2685
|
+
512
|
|
2686
|
+
], nn = [
|
|
2687
|
+
9,
|
|
2688
|
+
11,
|
|
2689
|
+
12,
|
|
2690
|
+
13,
|
|
2691
|
+
13,
|
|
2692
|
+
14,
|
|
2693
|
+
14,
|
|
2694
|
+
15,
|
|
2695
|
+
15,
|
|
2696
|
+
15,
|
|
2697
|
+
15,
|
|
2698
|
+
16,
|
|
2699
|
+
16,
|
|
2700
|
+
16,
|
|
2701
|
+
16,
|
|
2702
|
+
17,
|
|
2703
|
+
17,
|
|
2704
|
+
17,
|
|
2705
|
+
17,
|
|
2706
|
+
17,
|
|
2707
|
+
17,
|
|
2708
|
+
17,
|
|
2709
|
+
18,
|
|
2710
|
+
18,
|
|
2711
|
+
18,
|
|
2712
|
+
18,
|
|
2713
|
+
18,
|
|
2714
|
+
18,
|
|
2715
|
+
18,
|
|
2716
|
+
18,
|
|
2717
|
+
18,
|
|
2718
|
+
19,
|
|
2719
|
+
19,
|
|
2720
|
+
19,
|
|
2721
|
+
19,
|
|
2722
|
+
19,
|
|
2723
|
+
19,
|
|
2724
|
+
19,
|
|
2725
|
+
19,
|
|
2726
|
+
19,
|
|
2727
|
+
19,
|
|
2728
|
+
19,
|
|
2729
|
+
19,
|
|
2730
|
+
19,
|
|
2731
|
+
19,
|
|
2732
|
+
20,
|
|
2733
|
+
20,
|
|
2734
|
+
20,
|
|
2735
|
+
20,
|
|
2736
|
+
20,
|
|
2737
|
+
20,
|
|
2738
|
+
20,
|
|
2739
|
+
20,
|
|
2740
|
+
20,
|
|
2741
|
+
20,
|
|
2742
|
+
20,
|
|
2743
|
+
20,
|
|
2744
|
+
20,
|
|
2745
|
+
20,
|
|
2746
|
+
20,
|
|
2747
|
+
20,
|
|
2748
|
+
20,
|
|
2749
|
+
20,
|
|
2750
|
+
21,
|
|
2751
|
+
21,
|
|
2752
|
+
21,
|
|
2753
|
+
21,
|
|
2754
|
+
21,
|
|
2755
|
+
21,
|
|
2756
|
+
21,
|
|
2757
|
+
21,
|
|
2758
|
+
21,
|
|
2759
|
+
21,
|
|
2760
|
+
21,
|
|
2761
|
+
21,
|
|
2762
|
+
21,
|
|
2763
|
+
21,
|
|
2764
|
+
21,
|
|
2765
|
+
21,
|
|
2766
|
+
21,
|
|
2767
|
+
21,
|
|
2768
|
+
21,
|
|
2769
|
+
21,
|
|
2770
|
+
21,
|
|
2771
|
+
21,
|
|
2772
|
+
21,
|
|
2773
|
+
21,
|
|
2774
|
+
21,
|
|
2775
|
+
21,
|
|
2776
|
+
21,
|
|
2777
|
+
22,
|
|
2778
|
+
22,
|
|
2779
|
+
22,
|
|
2780
|
+
22,
|
|
2781
|
+
22,
|
|
2782
|
+
22,
|
|
2783
|
+
22,
|
|
2784
|
+
22,
|
|
2785
|
+
22,
|
|
2786
|
+
22,
|
|
2787
|
+
22,
|
|
2788
|
+
22,
|
|
2789
|
+
22,
|
|
2790
|
+
22,
|
|
2791
|
+
22,
|
|
2792
|
+
22,
|
|
2793
|
+
22,
|
|
2794
|
+
22,
|
|
2795
|
+
22,
|
|
2796
|
+
22,
|
|
2797
|
+
22,
|
|
2798
|
+
22,
|
|
2799
|
+
22,
|
|
2800
|
+
22,
|
|
2801
|
+
22,
|
|
2802
|
+
22,
|
|
2803
|
+
22,
|
|
2804
|
+
22,
|
|
2805
|
+
22,
|
|
2806
|
+
22,
|
|
2807
|
+
22,
|
|
2808
|
+
22,
|
|
2809
|
+
22,
|
|
2810
|
+
22,
|
|
2811
|
+
22,
|
|
2812
|
+
22,
|
|
2813
|
+
22,
|
|
2814
|
+
23
|
|
2815
|
+
];
|
|
2816
|
+
function rn() {
|
|
2817
|
+
this.r = 0, this.g = 0, this.b = 0, this.a = 0, this.next = null;
|
|
2818
|
+
}
|
|
2819
|
+
function an(e, t, n, r) {
|
|
2820
|
+
let i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, ee = r + r + 1, O = t - 1, te = n - 1, k = r + 1, ne = k * (k + 1) / 2, A = new rn(), j = A, M, N, re, P = tn[r], F = nn[r];
|
|
2821
|
+
for (o = 1; o < ee; o++) j = j.next = new rn(), o === k && (re = j);
|
|
2822
|
+
for (j.next = A, u = l = 0, a = 0; a < n; a++) {
|
|
2823
|
+
for (y = b = x = S = d = f = p = m = 0, h = k * (C = e[l]), g = k * (w = e[l + 1]), _ = k * (T = e[l + 2]), v = k * (E = e[l + 3]), d += ne * C, f += ne * w, p += ne * T, m += ne * E, j = A, o = 0; o < k; o++) j.r = C, j.g = w, j.b = T, j.a = E, j = j.next;
|
|
2824
|
+
for (o = 1; o < k; o++) s = l + ((O < o ? O : o) << 2), d += (j.r = C = e[s]) * (D = k - o), f += (j.g = w = e[s + 1]) * D, p += (j.b = T = e[s + 2]) * D, m += (j.a = E = e[s + 3]) * D, y += C, b += w, x += T, S += E, j = j.next;
|
|
2825
|
+
for (M = A, N = re, i = 0; i < t; i++) e[l] = d * P >> F, e[l + 1] = f * P >> F, e[l + 2] = p * P >> F, e[l + 3] = m * P >> F, d -= h, f -= g, p -= _, m -= v, h -= M.r, g -= M.g, _ -= M.b, v -= M.a, s = u + ((s = i + r + 1) < O ? s : O) << 2, y += M.r = e[s], b += M.g = e[s + 1], x += M.b = e[s + 2], S += M.a = e[s + 3], d += y, f += b, p += x, m += S, M = M.next, h += C = N.r, g += w = N.g, _ += T = N.b, v += E = N.a, y -= C, b -= w, x -= T, S -= E, N = N.next, l += 4;
|
|
2826
|
+
u += t;
|
|
2827
|
+
}
|
|
2828
|
+
for (i = 0; i < t; i++) {
|
|
2829
|
+
for (b = x = S = y = f = p = m = d = 0, l = i << 2, h = k * (C = e[l]), g = k * (w = e[l + 1]), _ = k * (T = e[l + 2]), v = k * (E = e[l + 3]), d += ne * C, f += ne * w, p += ne * T, m += ne * E, j = A, o = 0; o < k; o++) j.r = C, j.g = w, j.b = T, j.a = E, j = j.next;
|
|
2830
|
+
for (c = t, o = 1; o <= r; o++) l = c + i << 2, d += (j.r = C = e[l]) * (D = k - o), f += (j.g = w = e[l + 1]) * D, p += (j.b = T = e[l + 2]) * D, m += (j.a = E = e[l + 3]) * D, y += C, b += w, x += T, S += E, j = j.next, o < te && (c += t);
|
|
2831
|
+
for (l = i, M = A, N = re, a = 0; a < n; a++) s = l << 2, e[s] = d * P >> F, e[s + 1] = f * P >> F, e[s + 2] = p * P >> F, e[s + 3] = m * P >> F, d -= h, f -= g, p -= _, m -= v, h -= M.r, g -= M.g, _ -= M.b, v -= M.a, s = i + ((s = a + k) < te ? s : te) * t << 2, d += y += M.r = e[s], f += b += M.g = e[s + 1], p += x += M.b = e[s + 2], m += S += M.a = e[s + 3], M = M.next, h += C = N.r, g += w = N.g, _ += T = N.b, v += E = N.a, y -= C, b -= w, x -= T, S -= E, N = N.next, l += t;
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
function on(e, t, n, r, i) {
|
|
2835
|
+
t.set(e);
|
|
2836
|
+
let a = Math.min(Math.round(i.blurRadius ?? 0), tn.length - 1);
|
|
2837
|
+
a >= 1 && an(t, n, r, a);
|
|
2838
|
+
}
|
|
2839
|
+
function sn(e, t, n, r, i) {
|
|
2840
|
+
let a = Math.max(1, Math.round(i.pixelSize ?? 1));
|
|
2841
|
+
if (a <= 1) {
|
|
2842
|
+
t.set(e);
|
|
2843
|
+
return;
|
|
2844
|
+
}
|
|
2845
|
+
let o = Math.ceil(n / a), s = Math.ceil(r / a);
|
|
2846
|
+
for (let i = 0; i < s; i++) {
|
|
2847
|
+
let s = i * a, c = Math.min(s + a, r);
|
|
2848
|
+
for (let r = 0; r < o; r++) {
|
|
2849
|
+
let i = r * a, o = Math.min(i + a, n), l = 0, u = 0, d = 0, f = 0, p = (o - i) * (c - s);
|
|
2850
|
+
for (let t = s; t < c; t++) {
|
|
2851
|
+
let r = t * n;
|
|
2852
|
+
for (let t = i; t < o; t++) {
|
|
2853
|
+
let n = r + t << 2;
|
|
2854
|
+
l += e[n], u += e[n + 1], d += e[n + 2], f += e[n + 3];
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
l = l / p + .5 | 0, u = u / p + .5 | 0, d = d / p + .5 | 0, f = f / p + .5 | 0;
|
|
2858
|
+
for (let e = s; e < c; e++) {
|
|
2859
|
+
let r = e * n;
|
|
2860
|
+
for (let e = i; e < o; e++) {
|
|
2861
|
+
let n = r + e << 2;
|
|
2862
|
+
t[n] = l, t[n + 1] = u, t[n + 2] = d, t[n + 3] = f;
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
}
|
|
2867
|
+
}
|
|
2868
|
+
function cn(e, t, n, r) {
|
|
2869
|
+
for (let n = 0; n < e.length; n += 4) {
|
|
2870
|
+
let r = e[n];
|
|
2871
|
+
t[n] = (r > 127 ? (r - 127.5) * 2 : (127.5 - r) * 2) | 0, r = e[n + 1], t[n + 1] = (r > 127 ? (r - 127.5) * 2 : (127.5 - r) * 2) | 0, r = e[n + 2], t[n + 2] = (r > 127 ? (r - 127.5) * 2 : (127.5 - r) * 2) | 0, t[n + 3] = e[n + 3];
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
var ln = [
|
|
2875
|
+
-2,
|
|
2876
|
+
-1,
|
|
2877
|
+
0,
|
|
2878
|
+
-1,
|
|
2879
|
+
1,
|
|
2880
|
+
1,
|
|
2881
|
+
0,
|
|
2882
|
+
1,
|
|
2883
|
+
2
|
|
2884
|
+
];
|
|
2885
|
+
function un(e, t, n, r) {
|
|
2886
|
+
let i = 0;
|
|
2887
|
+
for (let a = 0; a < r; a++) for (let o = 0; o < n; o++, i += 4) {
|
|
2888
|
+
let s = 0, c = 0, l = 0, u = 0;
|
|
2889
|
+
for (let t = -1; t <= 1; t++) {
|
|
2890
|
+
let i = a + t, d = (i >= 0 && i < r ? i : a) * n;
|
|
2891
|
+
for (let t = -1; t <= 1; t++) {
|
|
2892
|
+
let r = ln[u++];
|
|
2893
|
+
if (r === 0) continue;
|
|
2894
|
+
let i = o + t;
|
|
2895
|
+
(i < 0 || i >= n) && (i = o);
|
|
2896
|
+
let a = d + i << 2;
|
|
2897
|
+
s += r * e[a], c += r * e[a + 1], l += r * e[a + 2];
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
t[i] = s > 255 ? 255 : s < 0 ? 0 : s | 0, t[i + 1] = c > 255 ? 255 : c < 0 ? 0 : c | 0, t[i + 2] = l > 255 ? 255 : l < 0 ? 0 : l | 0, t[i + 3] = e[i + 3];
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
var dn = [
|
|
2904
|
+
0,
|
|
2905
|
+
-2,
|
|
2906
|
+
0,
|
|
2907
|
+
-2,
|
|
2908
|
+
20,
|
|
2909
|
+
-2,
|
|
2910
|
+
0,
|
|
2911
|
+
-2,
|
|
2912
|
+
0
|
|
2913
|
+
];
|
|
2914
|
+
function fn(e, t, n, r) {
|
|
2915
|
+
let i = 0;
|
|
2916
|
+
for (let a = 0; a < r; a++) for (let o = 0; o < n; o++, i += 4) {
|
|
2917
|
+
let s = 0, c = 0, l = 0, u = 0;
|
|
2918
|
+
for (let t = -1; t <= 1; t++) {
|
|
2919
|
+
let i = a + t, d = (i >= 0 && i < r ? i : a) * n;
|
|
2920
|
+
for (let t = -1; t <= 1; t++) {
|
|
2921
|
+
let r = dn[u++];
|
|
2922
|
+
if (r === 0) continue;
|
|
2923
|
+
let i = o + t;
|
|
2924
|
+
(i < 0 || i >= n) && (i = o);
|
|
2925
|
+
let a = d + i << 2;
|
|
2926
|
+
s += r * e[a], c += r * e[a + 1], l += r * e[a + 2];
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
s = s / 10 - 40, c = c / 10 - 40, l = l / 10 - 40, t[i] = s > 255 ? 255 : s < 0 ? 0 : s | 0, t[i + 1] = c > 255 ? 255 : c < 0 ? 0 : c | 0, t[i + 2] = l > 255 ? 255 : l < 0 ? 0 : l | 0, t[i + 3] = e[i + 3];
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
function pn(e, t, n, r, i) {
|
|
2933
|
+
let a = (i.noise ?? 0) * 255;
|
|
2934
|
+
if (a <= 0) {
|
|
2935
|
+
t.set(e);
|
|
2936
|
+
return;
|
|
2937
|
+
}
|
|
2938
|
+
let o = i.seed | 0;
|
|
2939
|
+
for (let n = 0, r = 0; n < e.length; n += 4, r++) {
|
|
2940
|
+
let i = (le(r, o) - .5) * 2 * a, s = e[n] + i;
|
|
2941
|
+
t[n] = s < 0 ? 0 : s > 255 ? 255 : s, s = e[n + 1] + i, t[n + 1] = s < 0 ? 0 : s > 255 ? 255 : s, s = e[n + 2] + i, t[n + 2] = s < 0 ? 0 : s > 255 ? 255 : s, t[n + 3] = e[n + 3];
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
var mn = [
|
|
2945
|
+
{
|
|
2946
|
+
id: "fx-hsl",
|
|
2947
|
+
label: "HSL",
|
|
2948
|
+
animated: !1,
|
|
2949
|
+
params: [
|
|
2950
|
+
{
|
|
2951
|
+
key: "hue",
|
|
2952
|
+
label: "Hue",
|
|
2953
|
+
type: "range",
|
|
2954
|
+
min: -1,
|
|
2955
|
+
max: 1,
|
|
2956
|
+
step: .01,
|
|
2957
|
+
default: 0
|
|
2958
|
+
},
|
|
2959
|
+
{
|
|
2960
|
+
key: "saturation",
|
|
2961
|
+
label: "Saturation",
|
|
2962
|
+
type: "range",
|
|
2963
|
+
min: -2,
|
|
2964
|
+
max: 10,
|
|
2965
|
+
step: .1,
|
|
2966
|
+
default: 0
|
|
2967
|
+
},
|
|
2968
|
+
{
|
|
2969
|
+
key: "value",
|
|
2970
|
+
label: "Value",
|
|
2971
|
+
type: "range",
|
|
2972
|
+
min: -2,
|
|
2973
|
+
max: 2,
|
|
2974
|
+
step: .1,
|
|
2975
|
+
default: 0
|
|
2976
|
+
},
|
|
2977
|
+
R
|
|
2978
|
+
],
|
|
2979
|
+
apply(e, t, n, r, i) {
|
|
2980
|
+
V(e, t, n, r, Jt, {
|
|
2981
|
+
hue: i.hue ?? 0,
|
|
2982
|
+
saturation: i.saturation ?? 0,
|
|
2983
|
+
value: i.value ?? 0
|
|
2984
|
+
}, i.amount);
|
|
2985
|
+
}
|
|
2986
|
+
},
|
|
2987
|
+
{
|
|
2988
|
+
id: "fx-hsv",
|
|
2989
|
+
label: "HSV",
|
|
2990
|
+
animated: !1,
|
|
2991
|
+
params: [
|
|
2992
|
+
{
|
|
2993
|
+
key: "hue",
|
|
2994
|
+
label: "Hue",
|
|
2995
|
+
type: "range",
|
|
2996
|
+
min: -1,
|
|
2997
|
+
max: 1,
|
|
2998
|
+
step: .01,
|
|
2999
|
+
default: 0
|
|
3000
|
+
},
|
|
3001
|
+
{
|
|
3002
|
+
key: "saturation",
|
|
3003
|
+
label: "Saturation",
|
|
3004
|
+
type: "range",
|
|
3005
|
+
min: -2,
|
|
3006
|
+
max: 10,
|
|
3007
|
+
step: .1,
|
|
3008
|
+
default: 0
|
|
3009
|
+
},
|
|
3010
|
+
{
|
|
3011
|
+
key: "value",
|
|
3012
|
+
label: "Value",
|
|
3013
|
+
type: "range",
|
|
3014
|
+
min: -2,
|
|
3015
|
+
max: 2,
|
|
3016
|
+
step: .1,
|
|
3017
|
+
default: 0
|
|
3018
|
+
},
|
|
3019
|
+
R
|
|
3020
|
+
],
|
|
3021
|
+
apply(e, t, n, r, i) {
|
|
3022
|
+
V(e, t, n, r, Jt, {
|
|
3023
|
+
hue: i.hue ?? 0,
|
|
3024
|
+
saturation: i.saturation ?? 0,
|
|
3025
|
+
value: i.value ?? 0
|
|
3026
|
+
}, i.amount);
|
|
3027
|
+
}
|
|
3028
|
+
},
|
|
3029
|
+
{
|
|
3030
|
+
id: "fx-brightness",
|
|
3031
|
+
label: "Brightness",
|
|
3032
|
+
animated: !1,
|
|
3033
|
+
params: [{
|
|
3034
|
+
key: "brightness",
|
|
3035
|
+
label: "Brightness",
|
|
3036
|
+
type: "range",
|
|
3037
|
+
min: -1,
|
|
3038
|
+
max: 1,
|
|
3039
|
+
step: .01,
|
|
3040
|
+
default: 0
|
|
3041
|
+
}, R],
|
|
3042
|
+
apply(e, t, n, r, i) {
|
|
3043
|
+
V(e, t, n, r, Yt, { brightness: i.brightness ?? 0 }, i.amount);
|
|
3044
|
+
}
|
|
3045
|
+
},
|
|
3046
|
+
{
|
|
3047
|
+
id: "fx-contrast",
|
|
3048
|
+
label: "Contrast",
|
|
3049
|
+
animated: !1,
|
|
3050
|
+
params: [{
|
|
3051
|
+
key: "contrast",
|
|
3052
|
+
label: "Contrast",
|
|
3053
|
+
type: "range",
|
|
3054
|
+
min: -100,
|
|
3055
|
+
max: 100,
|
|
3056
|
+
step: 1,
|
|
3057
|
+
default: 0
|
|
3058
|
+
}, R],
|
|
3059
|
+
apply(e, t, n, r, i) {
|
|
3060
|
+
V(e, t, n, r, Xt, { contrast: i.contrast ?? 0 }, i.amount);
|
|
3061
|
+
}
|
|
3062
|
+
},
|
|
3063
|
+
{
|
|
3064
|
+
id: "fx-rgb",
|
|
3065
|
+
label: "RGB",
|
|
3066
|
+
animated: !1,
|
|
3067
|
+
params: [
|
|
3068
|
+
{
|
|
3069
|
+
key: "red",
|
|
3070
|
+
label: "Red",
|
|
3071
|
+
type: "range",
|
|
3072
|
+
min: -255,
|
|
3073
|
+
max: 255,
|
|
3074
|
+
step: 1,
|
|
3075
|
+
default: 0
|
|
3076
|
+
},
|
|
3077
|
+
{
|
|
3078
|
+
key: "green",
|
|
3079
|
+
label: "Green",
|
|
3080
|
+
type: "range",
|
|
3081
|
+
min: -255,
|
|
3082
|
+
max: 255,
|
|
3083
|
+
step: 1,
|
|
3084
|
+
default: 0
|
|
3085
|
+
},
|
|
3086
|
+
{
|
|
3087
|
+
key: "blue",
|
|
3088
|
+
label: "Blue",
|
|
3089
|
+
type: "range",
|
|
3090
|
+
min: -255,
|
|
3091
|
+
max: 255,
|
|
3092
|
+
step: 1,
|
|
3093
|
+
default: 0
|
|
3094
|
+
},
|
|
3095
|
+
R
|
|
3096
|
+
],
|
|
3097
|
+
apply(e, t, n, r, i) {
|
|
3098
|
+
V(e, t, n, r, Zt, {
|
|
3099
|
+
red: i.red ?? 0,
|
|
3100
|
+
green: i.green ?? 0,
|
|
3101
|
+
blue: i.blue ?? 0
|
|
3102
|
+
}, i.amount);
|
|
3103
|
+
}
|
|
3104
|
+
},
|
|
3105
|
+
{
|
|
3106
|
+
id: "fx-invert",
|
|
3107
|
+
label: "Invert",
|
|
3108
|
+
animated: !1,
|
|
3109
|
+
params: [R],
|
|
3110
|
+
apply(e, t, n, r, i) {
|
|
3111
|
+
V(e, t, n, r, Qt, null, i.amount);
|
|
3112
|
+
}
|
|
3113
|
+
},
|
|
3114
|
+
{
|
|
3115
|
+
id: "fx-sepia",
|
|
3116
|
+
label: "Sepia",
|
|
3117
|
+
animated: !1,
|
|
3118
|
+
params: [R],
|
|
3119
|
+
apply(e, t, n, r, i) {
|
|
3120
|
+
V(e, t, n, r, $t, null, i.amount);
|
|
3121
|
+
}
|
|
3122
|
+
},
|
|
3123
|
+
{
|
|
3124
|
+
id: "fx-grayscale",
|
|
3125
|
+
label: "Grayscale",
|
|
3126
|
+
animated: !1,
|
|
3127
|
+
params: [R],
|
|
3128
|
+
apply(e, t, n, r, i) {
|
|
3129
|
+
V(e, t, n, r, en, null, i.amount);
|
|
3130
|
+
}
|
|
3131
|
+
},
|
|
3132
|
+
{
|
|
3133
|
+
id: "fx-enhance",
|
|
3134
|
+
label: "Enhance",
|
|
3135
|
+
animated: !1,
|
|
3136
|
+
params: [R],
|
|
3137
|
+
apply(e, t, n, r, i) {
|
|
3138
|
+
V(e, t, n, r, fn, null, i.amount);
|
|
3139
|
+
}
|
|
3140
|
+
},
|
|
3141
|
+
{
|
|
3142
|
+
id: "fx-blur",
|
|
3143
|
+
label: "Blur",
|
|
3144
|
+
animated: !1,
|
|
3145
|
+
params: [{
|
|
3146
|
+
key: "blurRadius",
|
|
3147
|
+
label: "Radius",
|
|
3148
|
+
type: "range",
|
|
3149
|
+
min: 0,
|
|
3150
|
+
max: 40,
|
|
3151
|
+
step: 1,
|
|
3152
|
+
default: 4
|
|
3153
|
+
}, R],
|
|
3154
|
+
apply(e, t, n, r, i) {
|
|
3155
|
+
let a = t.width / n || 1;
|
|
3156
|
+
V(e, t, n, r, on, { blurRadius: (i.blurRadius ?? 4) * a }, i.amount);
|
|
3157
|
+
}
|
|
3158
|
+
},
|
|
3159
|
+
{
|
|
3160
|
+
id: "fx-pixelate",
|
|
3161
|
+
label: "Pixelate",
|
|
3162
|
+
animated: !1,
|
|
3163
|
+
params: [{
|
|
3164
|
+
key: "pixelSize",
|
|
3165
|
+
label: "Pixel size",
|
|
3166
|
+
type: "range",
|
|
3167
|
+
min: 1,
|
|
3168
|
+
max: 20,
|
|
3169
|
+
step: 1,
|
|
3170
|
+
default: 6
|
|
3171
|
+
}, R],
|
|
3172
|
+
apply(e, t, n, r, i) {
|
|
3173
|
+
let a = t.width / n || 1;
|
|
3174
|
+
V(e, t, n, r, sn, { pixelSize: (i.pixelSize ?? 6) * a }, i.amount);
|
|
3175
|
+
}
|
|
3176
|
+
},
|
|
3177
|
+
{
|
|
3178
|
+
id: "fx-solarize",
|
|
3179
|
+
label: "Solarize",
|
|
3180
|
+
animated: !1,
|
|
3181
|
+
params: [R],
|
|
3182
|
+
apply(e, t, n, r, i) {
|
|
3183
|
+
V(e, t, n, r, cn, null, i.amount);
|
|
3184
|
+
}
|
|
3185
|
+
},
|
|
3186
|
+
{
|
|
3187
|
+
id: "fx-emboss",
|
|
3188
|
+
label: "Emboss",
|
|
3189
|
+
animated: !1,
|
|
3190
|
+
params: [R],
|
|
3191
|
+
apply(e, t, n, r, i) {
|
|
3192
|
+
V(e, t, n, r, un, null, i.amount);
|
|
3193
|
+
}
|
|
3194
|
+
},
|
|
3195
|
+
{
|
|
3196
|
+
id: "fx-noise",
|
|
3197
|
+
label: "Noise",
|
|
3198
|
+
animated: !0,
|
|
3199
|
+
params: [
|
|
3200
|
+
{
|
|
3201
|
+
key: "noise",
|
|
3202
|
+
label: "Noise",
|
|
3203
|
+
type: "range",
|
|
3204
|
+
min: 0,
|
|
3205
|
+
max: 1,
|
|
3206
|
+
step: .01,
|
|
3207
|
+
default: .2
|
|
3208
|
+
},
|
|
3209
|
+
{
|
|
3210
|
+
key: "flicker",
|
|
3211
|
+
label: "Flicker · steps",
|
|
3212
|
+
type: "range",
|
|
3213
|
+
min: 0,
|
|
3214
|
+
max: 12,
|
|
3215
|
+
step: 1,
|
|
3216
|
+
default: 8
|
|
3217
|
+
},
|
|
3218
|
+
R
|
|
3219
|
+
],
|
|
3220
|
+
apply(e, t, n, r, i, a) {
|
|
3221
|
+
let o = Math.max(0, Math.round(i.flicker ?? 8)), s = o > 0 ? Math.floor(a * o) % o : 0;
|
|
3222
|
+
V(e, t, n, r, pn, {
|
|
3223
|
+
noise: i.noise ?? .2,
|
|
3224
|
+
seed: s
|
|
3225
|
+
}, i.amount);
|
|
3226
|
+
}
|
|
3227
|
+
}
|
|
3228
|
+
], J = (e, t, n, r, i, a) => ({
|
|
3229
|
+
key: e,
|
|
3230
|
+
label: t,
|
|
3231
|
+
type: "range",
|
|
3232
|
+
min: n,
|
|
3233
|
+
max: r,
|
|
3234
|
+
step: i,
|
|
3235
|
+
default: a
|
|
3236
|
+
}), hn = (e, t, n, r) => ({
|
|
3237
|
+
key: e,
|
|
3238
|
+
label: t,
|
|
3239
|
+
type: "select",
|
|
3240
|
+
default: n,
|
|
3241
|
+
options: r
|
|
3242
|
+
}), gn = (e, t, n = !1) => ({
|
|
3243
|
+
key: e,
|
|
3244
|
+
label: t,
|
|
3245
|
+
type: "toggle",
|
|
3246
|
+
default: n
|
|
3247
|
+
}), Y = (e, t) => ({
|
|
3248
|
+
value: e,
|
|
3249
|
+
label: t
|
|
3250
|
+
}), X = (e, ...t) => t.map((t) => ({
|
|
3251
|
+
...t,
|
|
3252
|
+
section: e,
|
|
3253
|
+
...e === "Motion" && t.tab === void 0 ? { tab: "anim" } : null
|
|
3254
|
+
})), _n = {
|
|
3255
|
+
...J("speed", "Speed", .1, 2.5, .05, 1),
|
|
3256
|
+
tab: "anim"
|
|
3257
|
+
}, vn = [
|
|
3258
|
+
{
|
|
3259
|
+
id: "gl-trails",
|
|
3260
|
+
label: "Trails",
|
|
3261
|
+
kind: "engine",
|
|
3262
|
+
engine: "trails",
|
|
3263
|
+
params: [
|
|
3264
|
+
...X("Feedback", J("decay", "Decay", .8, .99, .005, .92), J("mix", "Mix", 0, 1, .02, 1)),
|
|
3265
|
+
...X("Heads", J("taps", "Taps", 1, 4, 1, 3), hn("spacing", "Spacing", "even", [
|
|
3266
|
+
Y("even", "Even"),
|
|
3267
|
+
Y("triplet", "Triplet"),
|
|
3268
|
+
Y("shift", "Shift")
|
|
3269
|
+
]), J("chroma", "Chroma", 0, 1, .02, .6)),
|
|
3270
|
+
...X("Transform", J("zoom", "Zoom", .9, 1.1, .002, 1), J("rotate", "Rotate", -.1, .1, .002, 0), {
|
|
3271
|
+
...J("drift", "Drift", 0, .06, .002, .02),
|
|
3272
|
+
tab: "anim"
|
|
3273
|
+
}, J("originX", "Origin X", 0, 1, .01, .5), J("originY", "Origin Y", 0, 1, .01, .5)),
|
|
3274
|
+
...X("Color", J("hue", "Hue", 0, 2, .02, 0), J("sat", "Saturation", 0, 3, .05, 1), J("palette", "70s lock", 0, 1, .02, 0), J("gain", "Gain", .2, 2, .05, 1), {
|
|
3275
|
+
..._n,
|
|
3276
|
+
when: (e) => (e.hue ?? 0) > 0
|
|
3277
|
+
})
|
|
3278
|
+
]
|
|
3279
|
+
},
|
|
3280
|
+
{
|
|
3281
|
+
id: "gl-scan",
|
|
3282
|
+
label: "Rutt-Etra",
|
|
3283
|
+
kind: "engine",
|
|
3284
|
+
engine: "scan",
|
|
3285
|
+
orbit: !0,
|
|
3286
|
+
params: [
|
|
3287
|
+
...X("Grid", {
|
|
3288
|
+
...J("lines", "Lines", 40, 300, 1, 140),
|
|
3289
|
+
noRandom: !0
|
|
3290
|
+
}, {
|
|
3291
|
+
...J("cols", "Columns", 40, 400, 1, 220),
|
|
3292
|
+
noRandom: !0
|
|
3293
|
+
}, J("displace", "Displace", 0, 2.5, .05, 1)),
|
|
3294
|
+
...X("Look", gn("mono", "Mono"), {
|
|
3295
|
+
key: "tint",
|
|
3296
|
+
label: "Tint",
|
|
3297
|
+
type: "color",
|
|
3298
|
+
default: "#9fe7ff",
|
|
3299
|
+
when: (e) => !!e.mono
|
|
3300
|
+
}, J("opacity", "Line opacity", .05, 1, .05, 1)),
|
|
3301
|
+
...X("Camera", {
|
|
3302
|
+
...J("yaw", "Yaw", -3.14, 3.14, .02, 0),
|
|
3303
|
+
when: (e) => !e.cameraMotion
|
|
3304
|
+
}, {
|
|
3305
|
+
...J("pitch", "Pitch", -1.4, 1.4, .02, .4),
|
|
3306
|
+
when: (e) => !e.cameraMotion
|
|
3307
|
+
}, {
|
|
3308
|
+
...J("dist", "Distance", 1.5, 8, .1, 3),
|
|
3309
|
+
when: (e) => !e.cameraMotion
|
|
3310
|
+
}, J("fov", "FOV", 20, 90, 1, 45)),
|
|
3311
|
+
...X("Motion", gn("cameraMotion", "Camera motion"), {
|
|
3312
|
+
...hn("motionPreset", "Motion", "orbit", [
|
|
3313
|
+
Y("orbit", "Orbit"),
|
|
3314
|
+
Y("spin", "Spin"),
|
|
3315
|
+
Y("rock", "Rock"),
|
|
3316
|
+
Y("rise", "Rise"),
|
|
3317
|
+
Y("push", "Push"),
|
|
3318
|
+
Y("pull", "Pull")
|
|
3319
|
+
]),
|
|
3320
|
+
when: (e) => !!e.cameraMotion
|
|
3321
|
+
}, {
|
|
3322
|
+
...J("motionSpeed", "Motion speed", .02, 1.5, .02, .3),
|
|
3323
|
+
when: (e) => !!e.cameraMotion
|
|
3324
|
+
}, {
|
|
3325
|
+
..._n,
|
|
3326
|
+
when: (e) => !!e.cameraMotion
|
|
3327
|
+
}),
|
|
3328
|
+
...X("Backdrop", {
|
|
3329
|
+
key: "bg",
|
|
3330
|
+
label: "Backdrop",
|
|
3331
|
+
type: "color",
|
|
3332
|
+
role: "bg",
|
|
3333
|
+
default: "#0b0e13"
|
|
3334
|
+
}, J("bgAlpha", "Backdrop opacity", 0, 1, .01, 1))
|
|
3335
|
+
]
|
|
3336
|
+
},
|
|
3337
|
+
{
|
|
3338
|
+
id: "gl-slitscan",
|
|
3339
|
+
label: "Slitscan",
|
|
3340
|
+
kind: "engine",
|
|
3341
|
+
engine: "slitscan",
|
|
3342
|
+
params: [
|
|
3343
|
+
...X("Scan", hn("mode", "Mode", "chop", [Y("chop", "Chop"), Y("finish", "Finish")]), hn("axis", "Axis", "horizontal", [Y("horizontal", "Horizontal"), Y("vertical", "Vertical")]), {
|
|
3344
|
+
...J("slit", "Slit", 0, 1, .01, .5),
|
|
3345
|
+
when: (e) => e.mode === "finish"
|
|
3346
|
+
}),
|
|
3347
|
+
...X("Flow", J("scroll", "Scroll", 0, 4, .05, 1), J("smooth", "Smooth", 0, 1, .02, 0), J("orig", "Original mix", 0, 1, .02, 0), gn("invert", "Invert")),
|
|
3348
|
+
...X("Motion", _n)
|
|
3349
|
+
]
|
|
3350
|
+
},
|
|
3351
|
+
{
|
|
3352
|
+
id: "gl-disco",
|
|
3353
|
+
label: "Disco",
|
|
3354
|
+
kind: "engine",
|
|
3355
|
+
engine: "disco",
|
|
3356
|
+
params: [
|
|
3357
|
+
...X("Mirror", hn("mirror", "Mirror", "kaleido", [
|
|
3358
|
+
Y("none", "None"),
|
|
3359
|
+
Y("kaleido", "Kaleido"),
|
|
3360
|
+
Y("mirrorX", "Mirror X"),
|
|
3361
|
+
Y("mirrorY", "Mirror Y"),
|
|
3362
|
+
Y("quad", "Quad")
|
|
3363
|
+
]), {
|
|
3364
|
+
...J("segments", "Segments", 1, 16, 1, 6),
|
|
3365
|
+
when: (e) => (e.mirror ?? "kaleido") === "kaleido"
|
|
3366
|
+
}, J("twist", "Twist", -3.14, 3.14, .02, 0)),
|
|
3367
|
+
...X("Transform", J("originX", "Origin X", 0, 1, .01, .5), J("originY", "Origin Y", 0, 1, .01, .5), J("zoomX", "Zoom X", .2, 4, .05, 1), J("zoomY", "Zoom Y", .2, 4, .05, 1), J("panX", "Pan X", -1, 1, .01, 0), J("panY", "Pan Y", -1, 1, .01, 0), J("rotate", "Rotate", -3.14, 3.14, .02, 0), J("spin", "Spin", -2, 2, .05, .1), J("driftX", "Drift X", -.5, .5, .005, 0), J("driftY", "Drift Y", -.5, .5, .005, 0)),
|
|
3368
|
+
...X("Motion", J("pulse", "Pulse", 0, 1, .02, 0), {
|
|
3369
|
+
...J("pulseRate", "Pulse rate", 0, 4, .05, .5),
|
|
3370
|
+
when: (e) => (e.pulse ?? 0) > 0
|
|
3371
|
+
}, J("strobe", "Strobe", 0, 12, .5, 0), _n),
|
|
3372
|
+
...X("Color", J("hue", "Hue", 0, 2, .02, .3), J("sat", "Saturation", 0, 3, .05, 1), J("palette", "70s lock", 0, 1, .02, 0), J("posterize", "Posterize", 0, 12, 1, 0))
|
|
3373
|
+
]
|
|
3374
|
+
},
|
|
3375
|
+
{
|
|
3376
|
+
id: "gl-distort",
|
|
3377
|
+
label: "Distortion",
|
|
3378
|
+
kind: "engine",
|
|
3379
|
+
engine: "distort",
|
|
3380
|
+
params: [
|
|
3381
|
+
...X("Distort", J("strength", "Strength", 0, .6, .01, .25), J("radius", "Radius", .02, .5, .01, .18), J("decay", "Decay", .8, .99, .005, .94), J("rgbShift", "RGB shift", 0, .1, .002, .03)),
|
|
3382
|
+
...X("Pointer", {
|
|
3383
|
+
...J("px", "Pointer X", 0, 1, .01, .5),
|
|
3384
|
+
when: (e) => (e.motionShape ?? "orbit") === "off"
|
|
3385
|
+
}, {
|
|
3386
|
+
...J("py", "Pointer Y", 0, 1, .01, .5),
|
|
3387
|
+
when: (e) => (e.motionShape ?? "orbit") === "off"
|
|
3388
|
+
}, {
|
|
3389
|
+
...gn("cursorRecord", "Record cursor"),
|
|
3390
|
+
when: (e) => (e.motionShape ?? "orbit") === "off"
|
|
3391
|
+
}, {
|
|
3392
|
+
...gn("cursorReplay", "Replay cursor"),
|
|
3393
|
+
when: (e) => (e.motionShape ?? "orbit") === "off"
|
|
3394
|
+
}),
|
|
3395
|
+
...X("Path", hn("motionShape", "Auto path", "orbit", [
|
|
3396
|
+
Y("off", "Off"),
|
|
3397
|
+
Y("orbit", "Orbit"),
|
|
3398
|
+
Y("figure8", "Figure 8"),
|
|
3399
|
+
Y("lissajous", "Lissajous"),
|
|
3400
|
+
Y("sweep", "Sweep"),
|
|
3401
|
+
Y("spiral", "Spiral")
|
|
3402
|
+
]), {
|
|
3403
|
+
...J("motionSpeed", "Path speed", 0, 4, .05, 1),
|
|
3404
|
+
tab: "anim",
|
|
3405
|
+
when: (e) => (e.motionShape ?? "orbit") !== "off"
|
|
3406
|
+
}, {
|
|
3407
|
+
...J("motionSize", "Path size", 0, 1, .02, .6),
|
|
3408
|
+
when: (e) => (e.motionShape ?? "orbit") !== "off"
|
|
3409
|
+
}, {
|
|
3410
|
+
...J("motionPulse", "Path pulse", 0, 1, .01, 0),
|
|
3411
|
+
tab: "anim",
|
|
3412
|
+
when: (e) => (e.motionShape ?? "orbit") !== "off"
|
|
3413
|
+
}, _n)
|
|
3414
|
+
]
|
|
3415
|
+
},
|
|
3416
|
+
{
|
|
3417
|
+
id: "gl-lens",
|
|
3418
|
+
label: "Lens",
|
|
3419
|
+
kind: "engine",
|
|
3420
|
+
engine: "lens",
|
|
3421
|
+
params: [
|
|
3422
|
+
...X("Surface", hn("type", "Surface", "glass", [
|
|
3423
|
+
Y("glass", "Glass"),
|
|
3424
|
+
Y("ripple", "Ripple"),
|
|
3425
|
+
Y("ice", "Ice"),
|
|
3426
|
+
Y("mirror", "Mirror"),
|
|
3427
|
+
Y("kaleido", "Kaleido"),
|
|
3428
|
+
Y("waves", "Waves")
|
|
3429
|
+
]), hn("shape", "Shape", "panel", [Y("panel", "Panel"), Y("circle", "Circle")]), J("size", "Size", .05, .7, .01, .34), {
|
|
3430
|
+
...J("radius", "Corner radius", 0, .3, .005, .08),
|
|
3431
|
+
when: (e) => (e.shape ?? "panel") !== "circle"
|
|
3432
|
+
}, J("edge", "Edge", 0, .08, .002, .025)),
|
|
3433
|
+
...X("Position", J("glassX", "Lens X", 0, 1, .01, .5), J("glassY", "Lens Y", 0, 1, .01, .5)),
|
|
3434
|
+
...X("Optics", J("magnify", "Magnify", 0, 1, .02, .22), J("depth", "Depth", 0, 120, 1, 40), J("chromatic", "Chromatic", 0, 40, .5, 8), J("frost", "Frost", 0, 20, .5, 0), J("scale", "Detail", 0, 1, .02, .4)),
|
|
3435
|
+
...X("Light", J("reflect", "Reflect", 0, 1.5, .05, .1), J("sheen", "Sheen", 0, 1.5, .05, .5), J("lightAngle", "Light angle", 0, 360, 1, 45), J("tintAmt", "Tint amount", 0, 1, .02, 0), {
|
|
3436
|
+
key: "tint",
|
|
3437
|
+
label: "Tint",
|
|
3438
|
+
type: "color",
|
|
3439
|
+
default: "#ffffff",
|
|
3440
|
+
when: (e) => (e.tintAmt ?? 0) > 0
|
|
3441
|
+
}),
|
|
3442
|
+
...X("Motion", J("flow", "Flow", 0, 2.5, .05, 1))
|
|
3443
|
+
]
|
|
3444
|
+
}
|
|
3445
|
+
], yn = new Set(["time", "speed"]), Z = (e, t, n, r, i, a) => ({
|
|
3446
|
+
key: e,
|
|
3447
|
+
label: t,
|
|
3448
|
+
type: "range",
|
|
3449
|
+
min: n,
|
|
3450
|
+
max: r,
|
|
3451
|
+
step: i,
|
|
3452
|
+
default: a,
|
|
3453
|
+
...yn.has(e) ? {
|
|
3454
|
+
tab: "anim",
|
|
3455
|
+
section: "Motion"
|
|
3456
|
+
} : null
|
|
3457
|
+
}), Q = (e, t, n) => ({
|
|
3458
|
+
key: e,
|
|
3459
|
+
label: t,
|
|
3460
|
+
type: "color",
|
|
3461
|
+
default: n
|
|
3462
|
+
}), bn = (e, t, n = !1) => ({
|
|
3463
|
+
key: e,
|
|
3464
|
+
label: t,
|
|
3465
|
+
type: "toggle",
|
|
3466
|
+
default: n
|
|
3467
|
+
}), $ = (e, t) => Z(e, t, 0, 1, .01, .5), xn = [
|
|
3468
|
+
{
|
|
3469
|
+
id: "filter-adjustment",
|
|
3470
|
+
label: "Adjustment",
|
|
3471
|
+
kind: "pixi",
|
|
3472
|
+
group: "color-adjustments",
|
|
3473
|
+
params: [
|
|
3474
|
+
Z("gamma", "Gamma", 0, 2, .01, 1),
|
|
3475
|
+
Z("saturation", "Saturation", 0, 2, .01, 1),
|
|
3476
|
+
Z("contrast", "Contrast", 0, 2, .01, 1),
|
|
3477
|
+
Z("brightness", "Brightness", 0, 2, .01, 1),
|
|
3478
|
+
Z("red", "Red", 0, 2, .01, 1),
|
|
3479
|
+
Z("green", "Green", 0, 2, .01, 1),
|
|
3480
|
+
Z("blue", "Blue", 0, 2, .01, 1),
|
|
3481
|
+
Z("alpha", "Alpha", 0, 1, .01, 1)
|
|
3482
|
+
]
|
|
3483
|
+
},
|
|
3484
|
+
{
|
|
3485
|
+
id: "filter-hsl-adjustment",
|
|
3486
|
+
label: "HSL Adjustment",
|
|
3487
|
+
kind: "pixi",
|
|
3488
|
+
group: "color-adjustments",
|
|
3489
|
+
params: [
|
|
3490
|
+
Z("hue", "Hue", -1, 1, .01, 0),
|
|
3491
|
+
Z("saturation", "Saturation", -1, 1, .01, 0),
|
|
3492
|
+
Z("lightness", "Lightness", -1, 1, .01, 0),
|
|
3493
|
+
Z("alpha", "Alpha", 0, 1, .01, 1),
|
|
3494
|
+
bn("colorize", "Colorize", !1)
|
|
3495
|
+
]
|
|
3496
|
+
},
|
|
3497
|
+
{
|
|
3498
|
+
id: "filter-color-gradient",
|
|
3499
|
+
label: "Color Gradient",
|
|
3500
|
+
kind: "pixi",
|
|
3501
|
+
group: "color-adjustments",
|
|
3502
|
+
params: []
|
|
3503
|
+
},
|
|
3504
|
+
{
|
|
3505
|
+
id: "filter-color-map",
|
|
3506
|
+
label: "Color Map",
|
|
3507
|
+
kind: "pixi",
|
|
3508
|
+
group: "color-adjustments",
|
|
3509
|
+
params: []
|
|
3510
|
+
},
|
|
3511
|
+
{
|
|
3512
|
+
id: "filter-color-overlay",
|
|
3513
|
+
label: "Color Overlay",
|
|
3514
|
+
kind: "pixi",
|
|
3515
|
+
group: "color-adjustments",
|
|
3516
|
+
params: [Q("color", "Color", "#ff0000"), Z("alpha", "Alpha", 0, 1, .01, 1)]
|
|
3517
|
+
},
|
|
3518
|
+
{
|
|
3519
|
+
id: "filter-color-replace",
|
|
3520
|
+
label: "Color Replace",
|
|
3521
|
+
kind: "pixi",
|
|
3522
|
+
group: "color-adjustments",
|
|
3523
|
+
params: [
|
|
3524
|
+
Q("originalColor", "Original color", "#ff0000"),
|
|
3525
|
+
Q("targetColor", "Target color", "#000000"),
|
|
3526
|
+
Z("tolerance", "Tolerance", 0, 1, .01, .4)
|
|
3527
|
+
]
|
|
3528
|
+
},
|
|
3529
|
+
{
|
|
3530
|
+
id: "filter-multi-color-replace",
|
|
3531
|
+
label: "Multi Color Replace",
|
|
3532
|
+
kind: "pixi",
|
|
3533
|
+
group: "color-adjustments",
|
|
3534
|
+
params: [
|
|
3535
|
+
Q("from1", "From 1", "#ff0000"),
|
|
3536
|
+
Q("to1", "To 1", "#ff0000"),
|
|
3537
|
+
Q("from2", "From 2", "#00ff00"),
|
|
3538
|
+
Q("to2", "To 2", "#00ff00"),
|
|
3539
|
+
Q("from3", "From 3", "#0000ff"),
|
|
3540
|
+
Q("to3", "To 3", "#0000ff"),
|
|
3541
|
+
Z("tolerance", "Tolerance", 0, 1, .01, .1)
|
|
3542
|
+
]
|
|
3543
|
+
},
|
|
3544
|
+
{
|
|
3545
|
+
id: "filter-radial-blur",
|
|
3546
|
+
label: "Radial Blur",
|
|
3547
|
+
kind: "pixi",
|
|
3548
|
+
group: "blur-sharpen",
|
|
3549
|
+
params: [
|
|
3550
|
+
Z("angle", "Angle", 0, 20, .1, 0),
|
|
3551
|
+
{
|
|
3552
|
+
...Z("kernelSize", "Kernel size", 3, 25, 2, 5),
|
|
3553
|
+
noRandom: !0
|
|
3554
|
+
},
|
|
3555
|
+
$("centerX", "Center X"),
|
|
3556
|
+
$("centerY", "Center Y")
|
|
3557
|
+
]
|
|
3558
|
+
},
|
|
3559
|
+
{
|
|
3560
|
+
id: "filter-zoom-blur",
|
|
3561
|
+
label: "Zoom Blur",
|
|
3562
|
+
kind: "pixi",
|
|
3563
|
+
group: "blur-sharpen",
|
|
3564
|
+
params: [
|
|
3565
|
+
Z("strength", "Strength", 0, 1, .01, .1),
|
|
3566
|
+
Z("innerRadius", "Inner radius", 0, 500, 1, 0),
|
|
3567
|
+
$("centerX", "Center X"),
|
|
3568
|
+
$("centerY", "Center Y")
|
|
3569
|
+
]
|
|
3570
|
+
},
|
|
3571
|
+
{
|
|
3572
|
+
id: "filter-motion-blur",
|
|
3573
|
+
label: "Motion Blur",
|
|
3574
|
+
kind: "pixi",
|
|
3575
|
+
group: "blur-sharpen",
|
|
3576
|
+
params: [
|
|
3577
|
+
Z("velocityX", "Velocity X", -50, 50, 1, 0),
|
|
3578
|
+
Z("velocityY", "Velocity Y", -50, 50, 1, 5),
|
|
3579
|
+
{
|
|
3580
|
+
...Z("kernelSize", "Kernel size", 5, 25, 2, 5),
|
|
3581
|
+
noRandom: !0
|
|
3582
|
+
},
|
|
3583
|
+
Z("offset", "Offset", -50, 50, 1, 0)
|
|
3584
|
+
]
|
|
3585
|
+
},
|
|
3586
|
+
{
|
|
3587
|
+
id: "filter-kawase-blur",
|
|
3588
|
+
label: "Kawase Blur",
|
|
3589
|
+
kind: "pixi",
|
|
3590
|
+
group: "blur-sharpen",
|
|
3591
|
+
params: [Z("blur", "Blur", 0, 20, 1, 4), Z("quality", "Quality", 1, 10, 1, 3)]
|
|
3592
|
+
},
|
|
3593
|
+
{
|
|
3594
|
+
id: "filter-tilt-shift",
|
|
3595
|
+
label: "Tilt Shift",
|
|
3596
|
+
kind: "pixi",
|
|
3597
|
+
group: "blur-sharpen",
|
|
3598
|
+
params: [Z("blur", "Blur", 0, 200, 1, 100), Z("gradientBlur", "Gradient blur", 0, 1e3, 10, 600)]
|
|
3599
|
+
},
|
|
3600
|
+
{
|
|
3601
|
+
id: "filter-backdrop-blur",
|
|
3602
|
+
label: "Backdrop Blur",
|
|
3603
|
+
kind: "pixi",
|
|
3604
|
+
group: "blur-sharpen",
|
|
3605
|
+
params: []
|
|
3606
|
+
},
|
|
3607
|
+
{
|
|
3608
|
+
id: "filter-displacement",
|
|
3609
|
+
label: "Displacement Map",
|
|
3610
|
+
kind: "pixi",
|
|
3611
|
+
group: "distortion",
|
|
3612
|
+
params: [
|
|
3613
|
+
Z("scaleX", "Scale X", 0, 200, 1, 20),
|
|
3614
|
+
Z("scaleY", "Scale Y", 0, 200, 1, 20),
|
|
3615
|
+
Z("frequency", "Frequency", .1, 10, .1, 1),
|
|
3616
|
+
Z("octaves", "Octaves", 1, 8, 1, 3),
|
|
3617
|
+
Z("persistence", "Persistence", 0, 1, .01, .5)
|
|
3618
|
+
]
|
|
3619
|
+
},
|
|
3620
|
+
{
|
|
3621
|
+
id: "filter-twist",
|
|
3622
|
+
label: "Twist",
|
|
3623
|
+
kind: "pixi",
|
|
3624
|
+
group: "distortion",
|
|
3625
|
+
params: [
|
|
3626
|
+
Z("radius", "Radius", 0, 500, 1, 200),
|
|
3627
|
+
Z("angle", "Angle", -10, 10, .1, 4),
|
|
3628
|
+
Z("padding", "Padding", 0, 100, 1, 20)
|
|
3629
|
+
]
|
|
3630
|
+
},
|
|
3631
|
+
{
|
|
3632
|
+
id: "filter-bulge-pinch",
|
|
3633
|
+
label: "Bulge/Pinch",
|
|
3634
|
+
kind: "pixi",
|
|
3635
|
+
group: "distortion",
|
|
3636
|
+
params: [
|
|
3637
|
+
Z("radius", "Radius", 0, 500, 1, 100),
|
|
3638
|
+
Z("strength", "Strength", -3, 3, .1, 1),
|
|
3639
|
+
$("centerX", "Center X"),
|
|
3640
|
+
$("centerY", "Center Y")
|
|
3641
|
+
]
|
|
3642
|
+
},
|
|
3643
|
+
{
|
|
3644
|
+
id: "filter-shockwave",
|
|
3645
|
+
label: "Shockwave",
|
|
3646
|
+
kind: "pixi",
|
|
3647
|
+
group: "distortion",
|
|
3648
|
+
params: [
|
|
3649
|
+
Z("amplitude", "Amplitude", 0, 100, 1, 30),
|
|
3650
|
+
Z("wavelength", "Wavelength", 10, 500, 1, 160),
|
|
3651
|
+
Z("speed", "Speed", 0, 2e3, 10, 500),
|
|
3652
|
+
Z("brightness", "Brightness", 0, 2, .05, 1),
|
|
3653
|
+
Z("time", "Time", 0, 20, .1, 1),
|
|
3654
|
+
$("centerX", "Center X"),
|
|
3655
|
+
$("centerY", "Center Y")
|
|
3656
|
+
]
|
|
3657
|
+
},
|
|
3658
|
+
{
|
|
3659
|
+
id: "filter-ascii",
|
|
3660
|
+
label: "ASCII",
|
|
3661
|
+
kind: "pixi",
|
|
3662
|
+
group: "artistic",
|
|
3663
|
+
params: [Z("size", "Size", 2, 20, 1, 8), bn("replaceColor", "Replace color", !1)]
|
|
3664
|
+
},
|
|
3665
|
+
{
|
|
3666
|
+
id: "filter-cross-hatch",
|
|
3667
|
+
label: "Cross Hatch",
|
|
3668
|
+
kind: "pixi",
|
|
3669
|
+
group: "artistic",
|
|
3670
|
+
params: []
|
|
3671
|
+
},
|
|
3672
|
+
{
|
|
3673
|
+
id: "filter-dot",
|
|
3674
|
+
label: "Dot Screen",
|
|
3675
|
+
kind: "pixi",
|
|
3676
|
+
group: "artistic",
|
|
3677
|
+
params: [
|
|
3678
|
+
Z("scale", "Scale", .1, 5, .1, 1),
|
|
3679
|
+
Z("angle", "Angle", 0, 360, 1, 5),
|
|
3680
|
+
bn("grayscale", "Grayscale", !0)
|
|
3681
|
+
]
|
|
3682
|
+
},
|
|
3683
|
+
{
|
|
3684
|
+
id: "filter-crt",
|
|
3685
|
+
label: "CRT",
|
|
3686
|
+
kind: "pixi",
|
|
3687
|
+
group: "artistic",
|
|
3688
|
+
params: [
|
|
3689
|
+
Z("curvature", "Curvature", 0, 10, .1, 1),
|
|
3690
|
+
Z("lineWidth", "Line width", 0, 5, .1, 1),
|
|
3691
|
+
Z("lineContrast", "Line contrast", 0, 1, .01, .25),
|
|
3692
|
+
Z("noise", "Noise", 0, 1, .01, .3),
|
|
3693
|
+
Z("noiseSize", "Noise size", 0, 10, .1, 1),
|
|
3694
|
+
Z("vignetting", "Vignetting", 0, 1, .01, .3),
|
|
3695
|
+
Z("vignettingAlpha", "Vignetting alpha", 0, 1, .01, 1),
|
|
3696
|
+
Z("vignettingBlur", "Vignetting blur", 0, 1, .01, .3),
|
|
3697
|
+
Z("time", "Time", 0, 20, .1, 0),
|
|
3698
|
+
bn("verticalLine", "Vertical line", !1)
|
|
3699
|
+
]
|
|
3700
|
+
},
|
|
3701
|
+
{
|
|
3702
|
+
id: "filter-old-film",
|
|
3703
|
+
label: "Old Film",
|
|
3704
|
+
kind: "pixi",
|
|
3705
|
+
group: "artistic",
|
|
3706
|
+
params: [
|
|
3707
|
+
Z("sepia", "Sepia", 0, 1, .01, .3),
|
|
3708
|
+
Z("noise", "Noise", 0, 1, .01, .3),
|
|
3709
|
+
Z("noiseSize", "Noise size", 0, 10, .1, 1),
|
|
3710
|
+
Z("scratch", "Scratch", 0, 1, .01, .5),
|
|
3711
|
+
Z("scratchDensity", "Scratch density", 0, 1, .01, .3),
|
|
3712
|
+
Z("scratchWidth", "Scratch width", 0, 20, .5, 1),
|
|
3713
|
+
Z("vignetting", "Vignetting", 0, 1, .01, .3),
|
|
3714
|
+
Z("vignettingAlpha", "Vignetting alpha", 0, 1, .01, 1),
|
|
3715
|
+
Z("vignettingBlur", "Vignetting blur", 0, 1, .01, .3)
|
|
3716
|
+
]
|
|
3717
|
+
},
|
|
3718
|
+
{
|
|
3719
|
+
id: "filter-glitch",
|
|
3720
|
+
label: "Glitch",
|
|
3721
|
+
kind: "pixi",
|
|
3722
|
+
group: "artistic",
|
|
3723
|
+
params: [
|
|
3724
|
+
Z("slices", "Slices", 1, 50, 1, 5),
|
|
3725
|
+
Z("offset", "Offset", 0, 500, 1, 100),
|
|
3726
|
+
Z("direction", "Direction", 0, 360, 1, 0),
|
|
3727
|
+
Z("seed", "Seed", 0, 1, .01, 0),
|
|
3728
|
+
Z("minSize", "Min size", 1, 50, 1, 8),
|
|
3729
|
+
{
|
|
3730
|
+
...Z("sampleSize", "Sample size", 256, 2048, 256, 512),
|
|
3731
|
+
noRandom: !0
|
|
3732
|
+
},
|
|
3733
|
+
{
|
|
3734
|
+
key: "fillMode",
|
|
3735
|
+
label: "Fill mode",
|
|
3736
|
+
type: "select",
|
|
3737
|
+
numeric: !0,
|
|
3738
|
+
noRandom: !0,
|
|
3739
|
+
default: 0,
|
|
3740
|
+
options: [
|
|
3741
|
+
{
|
|
3742
|
+
value: 0,
|
|
3743
|
+
label: "Transparent"
|
|
3744
|
+
},
|
|
3745
|
+
{
|
|
3746
|
+
value: 1,
|
|
3747
|
+
label: "Original"
|
|
3748
|
+
},
|
|
3749
|
+
{
|
|
3750
|
+
value: 2,
|
|
3751
|
+
label: "Loop"
|
|
3752
|
+
},
|
|
3753
|
+
{
|
|
3754
|
+
value: 3,
|
|
3755
|
+
label: "Clamp"
|
|
3756
|
+
},
|
|
3757
|
+
{
|
|
3758
|
+
value: 4,
|
|
3759
|
+
label: "Mirror"
|
|
3760
|
+
}
|
|
3761
|
+
]
|
|
3762
|
+
},
|
|
3763
|
+
bn("average", "Average", !1)
|
|
3764
|
+
]
|
|
3765
|
+
},
|
|
3766
|
+
{
|
|
3767
|
+
id: "filter-rgb-split",
|
|
3768
|
+
label: "RGB Split",
|
|
3769
|
+
kind: "pixi",
|
|
3770
|
+
group: "artistic",
|
|
3771
|
+
params: [Z("redX", "Red X", -50, 50, 1, -10), Z("blueX", "Blue X", -50, 50, 1, 10)]
|
|
3772
|
+
},
|
|
3773
|
+
{
|
|
3774
|
+
id: "filter-simplex-noise",
|
|
3775
|
+
label: "Simplex Noise",
|
|
3776
|
+
kind: "pixi",
|
|
3777
|
+
group: "artistic",
|
|
3778
|
+
params: [
|
|
3779
|
+
Z("strength", "Strength", 0, 1, .01, .5),
|
|
3780
|
+
Z("noiseScale", "Noise scale", 0, 50, .5, 10),
|
|
3781
|
+
Z("offsetX", "Offset X", -100, 100, 1, 0),
|
|
3782
|
+
Z("offsetY", "Offset Y", -100, 100, 1, 0),
|
|
3783
|
+
Z("offsetZ", "Offset Z", -100, 100, 1, 0),
|
|
3784
|
+
Z("step", "Step", -1, 1, .01, -1)
|
|
3785
|
+
]
|
|
3786
|
+
},
|
|
3787
|
+
{
|
|
3788
|
+
id: "filter-bloom",
|
|
3789
|
+
label: "Bloom",
|
|
3790
|
+
kind: "pixi",
|
|
3791
|
+
group: "lighting",
|
|
3792
|
+
params: [Z("blur", "Blur", 0, 20, 1, 2), Z("strength", "Strength", 0, 5, .1, 1)]
|
|
3793
|
+
},
|
|
3794
|
+
{
|
|
3795
|
+
id: "filter-advanced-bloom",
|
|
3796
|
+
label: "Advanced Bloom",
|
|
3797
|
+
kind: "pixi",
|
|
3798
|
+
group: "lighting",
|
|
3799
|
+
params: [
|
|
3800
|
+
Z("threshold", "Threshold", 0, 1, .01, .5),
|
|
3801
|
+
Z("bloomScale", "Bloom scale", 0, 3, .1, 1),
|
|
3802
|
+
Z("brightness", "Brightness", 0, 2, .1, 1),
|
|
3803
|
+
Z("blur", "Blur", 0, 20, 1, 8),
|
|
3804
|
+
Z("quality", "Quality", 1, 10, 1, 4)
|
|
3805
|
+
]
|
|
3806
|
+
},
|
|
3807
|
+
{
|
|
3808
|
+
id: "filter-glow",
|
|
3809
|
+
label: "Glow",
|
|
3810
|
+
kind: "pixi",
|
|
3811
|
+
group: "lighting",
|
|
3812
|
+
params: [
|
|
3813
|
+
Z("distance", "Distance", 0, 50, 1, 10),
|
|
3814
|
+
Z("outerStrength", "Outer strength", 0, 20, 1, 4),
|
|
3815
|
+
Z("innerStrength", "Inner strength", 0, 20, .5, 0),
|
|
3816
|
+
Z("alpha", "Alpha", 0, 1, .01, 1),
|
|
3817
|
+
Z("quality", "Quality", .1, 1, .05, .1),
|
|
3818
|
+
Q("color", "Color", "#ffffff")
|
|
3819
|
+
]
|
|
3820
|
+
},
|
|
3821
|
+
{
|
|
3822
|
+
id: "filter-godray",
|
|
3823
|
+
label: "God Ray",
|
|
3824
|
+
kind: "pixi",
|
|
3825
|
+
group: "lighting",
|
|
3826
|
+
params: [
|
|
3827
|
+
Z("angle", "Angle", 0, 90, 1, 30),
|
|
3828
|
+
Z("gain", "Gain", 0, 1, .01, .5),
|
|
3829
|
+
Z("lacunarity", "Lacunarity", 0, 5, .1, 2.5),
|
|
3830
|
+
Z("alpha", "Alpha", 0, 1, .01, 1),
|
|
3831
|
+
Z("time", "Time", 0, 20, .1, 0),
|
|
3832
|
+
bn("parallel", "Parallel", !0),
|
|
3833
|
+
$("centerX", "Center X"),
|
|
3834
|
+
$("centerY", "Center Y")
|
|
3835
|
+
]
|
|
3836
|
+
},
|
|
3837
|
+
{
|
|
3838
|
+
id: "filter-simple-lightmap",
|
|
3839
|
+
label: "Simple Lightmap",
|
|
3840
|
+
kind: "pixi",
|
|
3841
|
+
group: "lighting",
|
|
3842
|
+
params: []
|
|
3843
|
+
},
|
|
3844
|
+
{
|
|
3845
|
+
id: "filter-bevel",
|
|
3846
|
+
label: "Bevel",
|
|
3847
|
+
kind: "pixi",
|
|
3848
|
+
group: "stylize",
|
|
3849
|
+
params: [
|
|
3850
|
+
Z("thickness", "Thickness", 0, 20, 1, 2),
|
|
3851
|
+
Z("rotation", "Rotation", 0, 360, 1, 45),
|
|
3852
|
+
Q("lightColor", "Light color", "#ffffff"),
|
|
3853
|
+
Z("lightAlpha", "Light alpha", 0, 1, .01, .7),
|
|
3854
|
+
Q("shadowColor", "Shadow color", "#000000"),
|
|
3855
|
+
Z("shadowAlpha", "Shadow alpha", 0, 1, .01, .7)
|
|
3856
|
+
]
|
|
3857
|
+
},
|
|
3858
|
+
{
|
|
3859
|
+
id: "filter-drop-shadow",
|
|
3860
|
+
label: "Drop Shadow",
|
|
3861
|
+
kind: "pixi",
|
|
3862
|
+
group: "stylize",
|
|
3863
|
+
params: [
|
|
3864
|
+
Z("offsetX", "Offset X", -50, 50, 1, 4),
|
|
3865
|
+
Z("offsetY", "Offset Y", -50, 50, 1, 4),
|
|
3866
|
+
Z("blur", "Blur", 0, 20, 1, 2),
|
|
3867
|
+
Z("alpha", "Alpha", 0, 1, .01, .5),
|
|
3868
|
+
Z("quality", "Quality", 0, 10, 1, 3),
|
|
3869
|
+
Q("color", "Color", "#000000"),
|
|
3870
|
+
bn("shadowOnly", "Shadow only", !1)
|
|
3871
|
+
]
|
|
3872
|
+
},
|
|
3873
|
+
{
|
|
3874
|
+
id: "filter-outline",
|
|
3875
|
+
label: "Outline",
|
|
3876
|
+
kind: "pixi",
|
|
3877
|
+
group: "stylize",
|
|
3878
|
+
params: [
|
|
3879
|
+
Z("thickness", "Thickness", 0, 20, 1, 1),
|
|
3880
|
+
Q("color", "Color", "#000000"),
|
|
3881
|
+
Z("alpha", "Alpha", 0, 1, .01, 1),
|
|
3882
|
+
Z("quality", "Quality", .05, 1, .05, .1),
|
|
3883
|
+
bn("knockout", "Knockout", !1)
|
|
3884
|
+
]
|
|
3885
|
+
},
|
|
3886
|
+
{
|
|
3887
|
+
id: "filter-reflection",
|
|
3888
|
+
label: "Reflection",
|
|
3889
|
+
kind: "pixi",
|
|
3890
|
+
group: "stylize",
|
|
3891
|
+
params: [
|
|
3892
|
+
Z("boundary", "Boundary", 0, 1, .01, .5),
|
|
3893
|
+
Z("time", "Time", 0, 20, .1, 0),
|
|
3894
|
+
bn("mirror", "Mirror", !0)
|
|
3895
|
+
]
|
|
3896
|
+
},
|
|
3897
|
+
{
|
|
3898
|
+
id: "filter-convolution",
|
|
3899
|
+
label: "Convolution",
|
|
3900
|
+
kind: "pixi",
|
|
3901
|
+
group: "utility",
|
|
3902
|
+
params: []
|
|
3903
|
+
}
|
|
3904
|
+
], Sn = [
|
|
3905
|
+
Ee,
|
|
3906
|
+
je,
|
|
3907
|
+
Re,
|
|
3908
|
+
...Xe,
|
|
3909
|
+
Ct,
|
|
3910
|
+
At,
|
|
3911
|
+
Kt,
|
|
3912
|
+
...mn,
|
|
3913
|
+
...vn,
|
|
3914
|
+
...xn
|
|
3915
|
+
], Cn = (e) => Sn.find((t) => t.id === e) ?? null, wn = [
|
|
3916
|
+
{
|
|
3917
|
+
id: "halftone",
|
|
3918
|
+
label: "Halftone",
|
|
3919
|
+
filterIds: [
|
|
3920
|
+
"fx-halftone-dither",
|
|
3921
|
+
"fx-ascii",
|
|
3922
|
+
"fx-bitmap"
|
|
3923
|
+
]
|
|
3924
|
+
},
|
|
3925
|
+
{
|
|
3926
|
+
id: "scanline",
|
|
3927
|
+
label: "Scanline",
|
|
3928
|
+
filterIds: ["scanline"]
|
|
3929
|
+
},
|
|
3930
|
+
{
|
|
3931
|
+
id: "crt",
|
|
3932
|
+
label: "CRT",
|
|
3933
|
+
filterIds: [
|
|
3934
|
+
"gl-disco",
|
|
3935
|
+
"gl-slitscan",
|
|
3936
|
+
"gl-scan",
|
|
3937
|
+
"gl-trails"
|
|
3938
|
+
]
|
|
3939
|
+
},
|
|
3940
|
+
{
|
|
3941
|
+
id: "refraction",
|
|
3942
|
+
label: "Refraction",
|
|
3943
|
+
filterIds: [
|
|
3944
|
+
"gl-lens",
|
|
3945
|
+
"gl-distort",
|
|
3946
|
+
"fx-chromatic",
|
|
3947
|
+
"glass"
|
|
3948
|
+
]
|
|
3949
|
+
},
|
|
3950
|
+
{
|
|
3951
|
+
id: "pattern",
|
|
3952
|
+
label: "Pattern",
|
|
3953
|
+
filterIds: ["dither"]
|
|
3954
|
+
}
|
|
3955
|
+
], Tn = [
|
|
3956
|
+
{
|
|
3957
|
+
id: "color-adjustments",
|
|
3958
|
+
label: "Color Adjustments",
|
|
3959
|
+
filterIds: [
|
|
3960
|
+
"fx-hsl",
|
|
3961
|
+
"fx-hsv",
|
|
3962
|
+
"fx-brightness",
|
|
3963
|
+
"fx-contrast",
|
|
3964
|
+
"fx-rgb",
|
|
3965
|
+
"fx-invert",
|
|
3966
|
+
"fx-sepia",
|
|
3967
|
+
"fx-grayscale",
|
|
3968
|
+
"fx-enhance"
|
|
3969
|
+
],
|
|
3970
|
+
pixiGroup: "color-adjustments"
|
|
3971
|
+
},
|
|
3972
|
+
{
|
|
3973
|
+
id: "blur-sharpen",
|
|
3974
|
+
label: "Blur/Sharpen",
|
|
3975
|
+
filterIds: ["fx-blur", "fx-sharpen"],
|
|
3976
|
+
pixiGroup: "blur-sharpen"
|
|
3977
|
+
},
|
|
3978
|
+
{
|
|
3979
|
+
id: "distortion",
|
|
3980
|
+
label: "Distortion",
|
|
3981
|
+
filterIds: [],
|
|
3982
|
+
pixiGroup: "distortion"
|
|
3983
|
+
},
|
|
3984
|
+
{
|
|
3985
|
+
id: "artistic",
|
|
3986
|
+
label: "Artistic Effects",
|
|
3987
|
+
filterIds: [
|
|
3988
|
+
"fx-pixelate",
|
|
3989
|
+
"fx-posterize",
|
|
3990
|
+
"fx-solarize",
|
|
3991
|
+
"fx-emboss",
|
|
3992
|
+
"fx-noise"
|
|
3993
|
+
],
|
|
3994
|
+
pixiGroup: "artistic"
|
|
3995
|
+
},
|
|
3996
|
+
{
|
|
3997
|
+
id: "lighting",
|
|
3998
|
+
label: "Lighting",
|
|
3999
|
+
filterIds: [],
|
|
4000
|
+
pixiGroup: "lighting"
|
|
4001
|
+
},
|
|
4002
|
+
{
|
|
4003
|
+
id: "stylize",
|
|
4004
|
+
label: "Stylize",
|
|
4005
|
+
filterIds: [],
|
|
4006
|
+
pixiGroup: "stylize"
|
|
4007
|
+
},
|
|
4008
|
+
{
|
|
4009
|
+
id: "utility",
|
|
4010
|
+
label: "Utility",
|
|
4011
|
+
filterIds: ["fx-threshold"],
|
|
4012
|
+
pixiGroup: "utility"
|
|
4013
|
+
},
|
|
4014
|
+
{
|
|
4015
|
+
id: "post-processing",
|
|
4016
|
+
label: "Post-Processing",
|
|
4017
|
+
filterIds: [
|
|
4018
|
+
"fx-rgb",
|
|
4019
|
+
"fx-edge",
|
|
4020
|
+
"fx-posterize",
|
|
4021
|
+
"fx-pixelsort",
|
|
4022
|
+
"fx-mirror",
|
|
4023
|
+
"fx-kaleido",
|
|
4024
|
+
"fx-threshold"
|
|
4025
|
+
]
|
|
4026
|
+
}
|
|
4027
|
+
], En = new Set([...wn.flatMap((e) => e.filterIds), ...Tn.flatMap((e) => e.filterIds)]), Dn = (e, t) => [...e.filterIds.map((e) => t.find((t) => t.id === e)).filter(Boolean), ...e.pixiGroup ? t.filter((t) => t.kind === "pixi" && t.group === e.pixiGroup) : []], On = (e) => Dn(Tn.find((e) => e.id === "post-processing"), e);
|
|
4028
|
+
function kn(e) {
|
|
4029
|
+
let t = wn.map((t) => ({
|
|
4030
|
+
id: t.id,
|
|
4031
|
+
label: t.label,
|
|
4032
|
+
filters: t.filterIds.map((t) => e.find((e) => e.id === t)).filter(Boolean)
|
|
4033
|
+
}));
|
|
4034
|
+
t.splice(4, 0, {
|
|
4035
|
+
id: "fx-rack",
|
|
4036
|
+
label: "FX rack",
|
|
4037
|
+
rack: !0,
|
|
4038
|
+
filters: []
|
|
4039
|
+
});
|
|
4040
|
+
let n = e.filter((e) => e.kind !== "pixi" && !En.has(e.id));
|
|
4041
|
+
return n.length && t.push({
|
|
4042
|
+
id: "other",
|
|
4043
|
+
label: "Other",
|
|
4044
|
+
filters: n
|
|
4045
|
+
}), t.filter((e) => e.rack || e.filters.length > 0);
|
|
4046
|
+
}
|
|
4047
|
+
function An(e) {
|
|
4048
|
+
if (!e) return null;
|
|
4049
|
+
let t = wn.find((t) => t.filterIds.includes(e));
|
|
4050
|
+
if (t) return t.id;
|
|
4051
|
+
let n = Cn(e);
|
|
4052
|
+
if (n?.kind === "pixi") {
|
|
4053
|
+
let e = Tn.find((e) => e.pixiGroup === n.group);
|
|
4054
|
+
if (e) return e.id;
|
|
4055
|
+
}
|
|
4056
|
+
let r = Tn.find((t) => t.filterIds.includes(e));
|
|
4057
|
+
return r ? r.id : "other";
|
|
4058
|
+
}
|
|
4059
|
+
var jn = {
|
|
4060
|
+
"fx-halftone-dither": "mode",
|
|
4061
|
+
"fx-ascii": "algorithm",
|
|
4062
|
+
"fx-bitmap": "palette",
|
|
4063
|
+
glass: "pattern",
|
|
4064
|
+
scanline: "look",
|
|
4065
|
+
dither: "palette",
|
|
4066
|
+
"gl-lens": "type"
|
|
4067
|
+
}, Mn = (e) => jn[e] ?? null, Nn = (e, t) => ({
|
|
4068
|
+
[Mn(e.id)]: t,
|
|
4069
|
+
...e.presetPatches?.[t] ?? {}
|
|
4070
|
+
});
|
|
4071
|
+
function Pn(e) {
|
|
4072
|
+
if (!e) return {
|
|
4073
|
+
effectable: !1,
|
|
4074
|
+
engineHost: !1,
|
|
4075
|
+
engineLoop: !1
|
|
4076
|
+
};
|
|
4077
|
+
let t = e.type === "loop" || e.type === "misc", n = t && y(e.loopId)?.kind === "engine";
|
|
4078
|
+
return {
|
|
4079
|
+
effectable: e.type === "photo" || [
|
|
4080
|
+
"shape",
|
|
4081
|
+
"text",
|
|
4082
|
+
"pattern",
|
|
4083
|
+
"path"
|
|
4084
|
+
].includes(e.type) || t && !n,
|
|
4085
|
+
engineHost: e.type === "photo" || t && !n,
|
|
4086
|
+
engineLoop: n
|
|
4087
|
+
};
|
|
4088
|
+
}
|
|
4089
|
+
function Fn(e) {
|
|
4090
|
+
return kn(e).flatMap((t) => t.rack ? Tn.map((t) => ({
|
|
4091
|
+
id: t.id,
|
|
4092
|
+
label: t.label,
|
|
4093
|
+
filters: Dn(t, e)
|
|
4094
|
+
})).filter((e) => e.filters.length > 0) : [t]);
|
|
4095
|
+
}
|
|
4096
|
+
//#endregion
|
|
4097
|
+
//#region src/editor/compose/inspectors/EffectsPanel.jsx
|
|
4098
|
+
var In = [{
|
|
4099
|
+
value: "effect",
|
|
4100
|
+
label: "Effect"
|
|
4101
|
+
}, {
|
|
4102
|
+
value: "anim",
|
|
4103
|
+
label: "Motion"
|
|
4104
|
+
}];
|
|
4105
|
+
function Ln() {
|
|
4106
|
+
let { selectedId: e, layers: n } = t(), r = e && e !== "canvas" ? s(n, e) : null;
|
|
4107
|
+
return /* @__PURE__ */ I("div", {
|
|
4108
|
+
className: "kol-compose-rail kol-compose-rail--inspector",
|
|
4109
|
+
children: /* @__PURE__ */ I("div", {
|
|
4110
|
+
className: "kol-compose-inspector-body",
|
|
4111
|
+
children: r ? /* @__PURE__ */ I(Rn, { layer: r }, r.id) : /* @__PURE__ */ I(D, {
|
|
4112
|
+
className: "kol-helper-12 text-meta",
|
|
4113
|
+
children: "Select a layer to edit its effect."
|
|
4114
|
+
})
|
|
4115
|
+
})
|
|
4116
|
+
});
|
|
4117
|
+
}
|
|
4118
|
+
function Rn({ layer: e }) {
|
|
4119
|
+
let { updateLayer: i, palette: a, addFilter: o, removeFilter: s, toggleFilter: c, moveFilter: l, replaceFilter: u } = t(), d = ee(e.id, { history: "coalesce" }), f = n(e), p = f.some((e) => e.def?.kind === "engine"), { effectable: m, engineHost: h, engineLoop: g } = Pn(e), [_, v] = P(f.length ? 0 : null), y = _ == null ? null : f[_] ?? null, [b, x] = P(!1);
|
|
4120
|
+
N(() => {
|
|
4121
|
+
f.length > 0 && x(!1);
|
|
4122
|
+
}, [f.length]);
|
|
4123
|
+
let [S, C] = P("effect"), [T, D] = P(() => An(f[0]?.id) ?? null), A = re(f.map((e) => e.key));
|
|
4124
|
+
if (N(() => {
|
|
4125
|
+
let e = A.current, t = f.map((e) => e.key);
|
|
4126
|
+
A.current = t;
|
|
4127
|
+
let n = t.find((t) => !e.includes(t));
|
|
4128
|
+
if (n != null) {
|
|
4129
|
+
let e = t.indexOf(n);
|
|
4130
|
+
v(e);
|
|
4131
|
+
let r = An(f[e].id);
|
|
4132
|
+
r && D(r);
|
|
4133
|
+
return;
|
|
4134
|
+
}
|
|
4135
|
+
_ != null && _ >= t.length && v(t.length ? t.length - 1 : null);
|
|
4136
|
+
}, [f.length]), N(() => {
|
|
4137
|
+
if (!y) return;
|
|
4138
|
+
let e = An(y.id);
|
|
4139
|
+
e && D(e);
|
|
4140
|
+
}, [y?.key]), !m) return /* @__PURE__ */ I("p", {
|
|
4141
|
+
className: "kol-helper-12 text-meta",
|
|
4142
|
+
children: g ? "Engine loops can't host effects yet." : "This layer can't host an effect."
|
|
4143
|
+
});
|
|
4144
|
+
let j = y?.def?.kind === "engine", R = h && (y ? j || !p && _ === f.length - 1 : !p), ie = Fn(Sn.filter((e) => e.kind !== "engine" || R)), ae = ie.map((e) => ({
|
|
4145
|
+
value: e.id,
|
|
4146
|
+
label: e.label
|
|
4147
|
+
})), oe = ie.some((e) => e.id === T) ? T : ie[0]?.id, se = [{
|
|
4148
|
+
value: "",
|
|
4149
|
+
label: "None"
|
|
4150
|
+
}, ...(ie.find((e) => e.id === oe)?.filters ?? []).map((e) => ({
|
|
4151
|
+
value: e.id,
|
|
4152
|
+
label: e.label
|
|
4153
|
+
}))], ce = y && An(y.id) === oe ? y.id : "", z = (t) => {
|
|
4154
|
+
if (y) {
|
|
4155
|
+
if (!t) {
|
|
4156
|
+
s(e.id, _);
|
|
4157
|
+
return;
|
|
4158
|
+
}
|
|
4159
|
+
t !== y.id && u(e.id, _, t);
|
|
4160
|
+
return;
|
|
4161
|
+
}
|
|
4162
|
+
t && o(e.id, t);
|
|
4163
|
+
}, le = f.map(({ def: e, ...t }) => t), B = y ? {
|
|
4164
|
+
...e,
|
|
4165
|
+
...y.params,
|
|
4166
|
+
id: e.id
|
|
4167
|
+
} : null, ue = (e) => {
|
|
4168
|
+
if (_ == null) return;
|
|
4169
|
+
let t = le.map((t, n) => n === _ ? {
|
|
4170
|
+
...t,
|
|
4171
|
+
params: {
|
|
4172
|
+
...t.params,
|
|
4173
|
+
...e
|
|
4174
|
+
}
|
|
4175
|
+
} : t);
|
|
4176
|
+
d.patch({ filters: t });
|
|
4177
|
+
}, de = (e, t) => {
|
|
4178
|
+
if (e === "cameraDrag") {
|
|
4179
|
+
d.setProp(e, t);
|
|
4180
|
+
return;
|
|
4181
|
+
}
|
|
4182
|
+
ue({ [e]: t });
|
|
4183
|
+
}, fe = (e) => de("sweeps", e), pe = (e) => /* @__PURE__ */ I(O, {
|
|
4184
|
+
layer: B,
|
|
4185
|
+
param: e,
|
|
4186
|
+
setProp: de
|
|
4187
|
+
}), me = y?.def ? Mn(y.def.id) : null, V = me ? y.def.params.find((e) => e.key === me) : null, he = y?.def ? y.def.params.filter((e) => r(e) !== "anim" && e !== V) : [];
|
|
4188
|
+
return /* @__PURE__ */ L("div", {
|
|
4189
|
+
className: "flex flex-col gap-4",
|
|
4190
|
+
children: [
|
|
4191
|
+
f.length > 0 && /* @__PURE__ */ I("div", {
|
|
4192
|
+
className: "flex flex-col gap-1",
|
|
4193
|
+
children: f.map((t, n) => /* @__PURE__ */ I(Bn, {
|
|
4194
|
+
stage: t,
|
|
4195
|
+
selected: n === _,
|
|
4196
|
+
onSelect: () => v(n),
|
|
4197
|
+
onToggle: () => c(e.id, n),
|
|
4198
|
+
onRemove: () => s(e.id, n),
|
|
4199
|
+
onUp: () => l(e.id, n, n - 1),
|
|
4200
|
+
onDown: () => l(e.id, n, n + 1),
|
|
4201
|
+
canUp: n > 0 && t.def?.kind !== "engine",
|
|
4202
|
+
canDown: n < f.length - 1 && t.def?.kind !== "engine" && f[n + 1]?.def?.kind !== "engine"
|
|
4203
|
+
}, t.key))
|
|
4204
|
+
}),
|
|
4205
|
+
f.length > 0 && _ != null && /* @__PURE__ */ I(te, {
|
|
4206
|
+
variant: "primary",
|
|
4207
|
+
size: "sm",
|
|
4208
|
+
className: "w-full",
|
|
4209
|
+
onClick: () => v(null),
|
|
4210
|
+
disabled: f.length >= 8,
|
|
4211
|
+
title: f.length >= 8 ? "Chain is full (8 effects)" : "Add another effect",
|
|
4212
|
+
children: "Add effect"
|
|
4213
|
+
}),
|
|
4214
|
+
f.length === 0 && !b && /* @__PURE__ */ I(te, {
|
|
4215
|
+
variant: "primary",
|
|
4216
|
+
size: "sm",
|
|
4217
|
+
className: "w-full",
|
|
4218
|
+
onClick: () => x(!0),
|
|
4219
|
+
children: "Add effect"
|
|
4220
|
+
}),
|
|
4221
|
+
(f.length > 0 || b) && /* @__PURE__ */ L(F, { children: [
|
|
4222
|
+
/* @__PURE__ */ I(w, {
|
|
4223
|
+
label: "Type",
|
|
4224
|
+
options: ae,
|
|
4225
|
+
value: oe,
|
|
4226
|
+
onChange: D
|
|
4227
|
+
}),
|
|
4228
|
+
/* @__PURE__ */ I(w, {
|
|
4229
|
+
label: "Category",
|
|
4230
|
+
options: se,
|
|
4231
|
+
value: ce,
|
|
4232
|
+
onChange: z
|
|
4233
|
+
}),
|
|
4234
|
+
V && /* @__PURE__ */ I(w, {
|
|
4235
|
+
label: "Preset",
|
|
4236
|
+
options: V.options,
|
|
4237
|
+
value: y.params[V.key] ?? V.default,
|
|
4238
|
+
onChange: (e) => ue(Nn(y.def, e))
|
|
4239
|
+
})
|
|
4240
|
+
] }),
|
|
4241
|
+
f.length > 0 && e.imgW != null && /* @__PURE__ */ I("span", {
|
|
4242
|
+
className: "kol-helper-12 text-meta",
|
|
4243
|
+
children: "Filters don't apply to cropped photos."
|
|
4244
|
+
}),
|
|
4245
|
+
y?.def?.orbit && /* @__PURE__ */ I(k, {
|
|
4246
|
+
label: "Camera drag",
|
|
4247
|
+
children: /* @__PURE__ */ I(M, {
|
|
4248
|
+
options: [{
|
|
4249
|
+
value: "off",
|
|
4250
|
+
label: "Off"
|
|
4251
|
+
}, {
|
|
4252
|
+
value: "on",
|
|
4253
|
+
label: "On"
|
|
4254
|
+
}],
|
|
4255
|
+
viewMode: e.cameraDrag ? "on" : "off",
|
|
4256
|
+
onViewChange: (e) => de("cameraDrag", e === "on")
|
|
4257
|
+
})
|
|
4258
|
+
}),
|
|
4259
|
+
y?.def && /* @__PURE__ */ L(F, { children: [
|
|
4260
|
+
/* @__PURE__ */ I(ne, {
|
|
4261
|
+
value: S,
|
|
4262
|
+
onChange: C,
|
|
4263
|
+
options: In
|
|
4264
|
+
}),
|
|
4265
|
+
S === "effect" && /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(E, {
|
|
4266
|
+
schema: he,
|
|
4267
|
+
layer: B,
|
|
4268
|
+
setProp: de,
|
|
4269
|
+
palette: a,
|
|
4270
|
+
renderAnimate: pe
|
|
4271
|
+
}), /* @__PURE__ */ I(zn, {
|
|
4272
|
+
def: y.def,
|
|
4273
|
+
view: B,
|
|
4274
|
+
tab: "effect",
|
|
4275
|
+
onPatch: ue
|
|
4276
|
+
})] }),
|
|
4277
|
+
S === "anim" && /* @__PURE__ */ L(F, { children: [
|
|
4278
|
+
/* @__PURE__ */ I(E, {
|
|
4279
|
+
schema: y.def.params,
|
|
4280
|
+
layer: B,
|
|
4281
|
+
setProp: de,
|
|
4282
|
+
palette: a,
|
|
4283
|
+
renderAnimate: pe,
|
|
4284
|
+
tab: "anim"
|
|
4285
|
+
}),
|
|
4286
|
+
/* @__PURE__ */ I(zn, {
|
|
4287
|
+
def: y.def,
|
|
4288
|
+
view: B,
|
|
4289
|
+
tab: "anim",
|
|
4290
|
+
onPatch: ue
|
|
4291
|
+
}),
|
|
4292
|
+
y.def.sweeps && /* @__PURE__ */ I(Vn, {
|
|
4293
|
+
sweeps: Array.isArray(y.params.sweeps) ? y.params.sweeps : [],
|
|
4294
|
+
onChange: fe
|
|
4295
|
+
})
|
|
4296
|
+
] })
|
|
4297
|
+
] })
|
|
4298
|
+
]
|
|
4299
|
+
});
|
|
4300
|
+
}
|
|
4301
|
+
function zn({ def: t, view: n, tab: s, onPatch: u, inline: d = !1 }) {
|
|
4302
|
+
let f = e(), p = i(n), m = s === "anim", h = t.params.filter((e) => r(e) === "anim" === m), g = l(h, n), _ = m ? h.filter((e) => !e.noRandom) : c(h, n), v = (e, t) => {
|
|
4303
|
+
e.length && u(o(n, e, p.take(), { stripNoRandom: !!t?.motion }));
|
|
4304
|
+
}, y = (e) => {
|
|
4305
|
+
let t = {};
|
|
4306
|
+
for (let n of e) n.default !== void 0 && (t[n.key] = n.default);
|
|
4307
|
+
Object.keys(t).length && u(t);
|
|
4308
|
+
};
|
|
4309
|
+
return !_.length && !g.length ? null : /* @__PURE__ */ L("div", {
|
|
4310
|
+
className: "flex flex-col gap-2",
|
|
4311
|
+
children: [
|
|
4312
|
+
/* @__PURE__ */ I(a, {
|
|
4313
|
+
seed: p,
|
|
4314
|
+
inline: d
|
|
4315
|
+
}),
|
|
4316
|
+
_.length > 0 && /* @__PURE__ */ I(te, {
|
|
4317
|
+
variant: "primary",
|
|
4318
|
+
size: f,
|
|
4319
|
+
className: "w-full",
|
|
4320
|
+
onClick: (e) => e.altKey ? y(_) : v(_),
|
|
4321
|
+
children: m ? "Randomize motion" : "Randomize all"
|
|
4322
|
+
}),
|
|
4323
|
+
g.length > 0 && /* @__PURE__ */ I("div", {
|
|
4324
|
+
className: "grid grid-cols-2 gap-2",
|
|
4325
|
+
children: g.map((e) => /* @__PURE__ */ I(te, {
|
|
4326
|
+
variant: "primary",
|
|
4327
|
+
size: f,
|
|
4328
|
+
onClick: (t) => t.altKey ? y(e.params) : v(e.params, e),
|
|
4329
|
+
children: e.label
|
|
4330
|
+
}, e.id))
|
|
4331
|
+
})
|
|
4332
|
+
]
|
|
4333
|
+
});
|
|
4334
|
+
}
|
|
4335
|
+
function Bn({ stage: e, selected: t, onSelect: n, onToggle: r, onRemove: i, onUp: a, onDown: o, canUp: s, canDown: c }) {
|
|
4336
|
+
let l = e.enabled !== !1, d = (e, t, n, r) => /* @__PURE__ */ I("button", {
|
|
4337
|
+
type: "button",
|
|
4338
|
+
"aria-label": e,
|
|
4339
|
+
title: e,
|
|
4340
|
+
disabled: n,
|
|
4341
|
+
onClick: (e) => {
|
|
4342
|
+
e.stopPropagation(), t();
|
|
4343
|
+
},
|
|
4344
|
+
className: "inline-flex items-center justify-center w-5 h-5 rounded shrink-0 text-oq-64 hover:text-emphasis disabled:opacity-30",
|
|
4345
|
+
style: {
|
|
4346
|
+
border: "none",
|
|
4347
|
+
background: "transparent",
|
|
4348
|
+
cursor: n ? "default" : "pointer"
|
|
4349
|
+
},
|
|
4350
|
+
children: r
|
|
4351
|
+
});
|
|
4352
|
+
return /* @__PURE__ */ L("div", {
|
|
4353
|
+
role: "button",
|
|
4354
|
+
tabIndex: 0,
|
|
4355
|
+
onClick: n,
|
|
4356
|
+
onKeyDown: (e) => {
|
|
4357
|
+
(e.key === "Enter" || e.key === " ") && n();
|
|
4358
|
+
},
|
|
4359
|
+
className: `flex items-center gap-1 px-2 h-8 rounded cursor-pointer ${t ? "bg-fg-08" : "hover:bg-fg-04"}`,
|
|
4360
|
+
children: [
|
|
4361
|
+
d(l ? "Disable effect" : "Enable effect", r, !1, /* @__PURE__ */ I(u, {
|
|
4362
|
+
name: l ? "eye-on" : "eye-off",
|
|
4363
|
+
size: 12
|
|
4364
|
+
})),
|
|
4365
|
+
/* @__PURE__ */ I("span", {
|
|
4366
|
+
className: `kol-helper-12 flex-1 truncate ${l ? "text-emphasis" : "text-meta"}`,
|
|
4367
|
+
children: e.def?.label ?? e.id
|
|
4368
|
+
}),
|
|
4369
|
+
d("Move up", a, !s, /* @__PURE__ */ I(u, {
|
|
4370
|
+
name: "chevron-down",
|
|
4371
|
+
size: 11,
|
|
4372
|
+
style: { transform: "rotate(180deg)" }
|
|
4373
|
+
})),
|
|
4374
|
+
d("Move down", o, !c, /* @__PURE__ */ I(u, {
|
|
4375
|
+
name: "chevron-down",
|
|
4376
|
+
size: 11
|
|
4377
|
+
})),
|
|
4378
|
+
d("Remove effect", i, !1, /* @__PURE__ */ I(u, {
|
|
4379
|
+
name: "close",
|
|
4380
|
+
size: 11
|
|
4381
|
+
}))
|
|
4382
|
+
]
|
|
4383
|
+
});
|
|
4384
|
+
}
|
|
4385
|
+
function Vn({ sweeps: t, onChange: n, inline: r = !1 }) {
|
|
4386
|
+
let i = e(), a = (e) => Ze.find((t) => t.value === e)?.label ?? e, o = (e) => n([...t, e ? tt(e.shape, e) : tt()]), s = (e) => n(t.filter((t, n) => n !== e)), c = (e, r, i) => n(t.map((t, n) => n === e ? {
|
|
4387
|
+
...t,
|
|
4388
|
+
[r]: i
|
|
4389
|
+
} : t)), l = ({ label: e, ...t }) => r ? /* @__PURE__ */ L("div", {
|
|
4390
|
+
className: "flex items-center gap-3",
|
|
4391
|
+
children: [/* @__PURE__ */ I("span", {
|
|
4392
|
+
className: "kol-helper-10 tracking-widest text-meta whitespace-nowrap",
|
|
4393
|
+
children: e
|
|
4394
|
+
}), /* @__PURE__ */ I("div", {
|
|
4395
|
+
className: "flex-1 min-w-0",
|
|
4396
|
+
children: /* @__PURE__ */ I(A, { ...t })
|
|
4397
|
+
})]
|
|
4398
|
+
}) : /* @__PURE__ */ I(k, {
|
|
4399
|
+
label: e,
|
|
4400
|
+
children: /* @__PURE__ */ I(A, { ...t })
|
|
4401
|
+
});
|
|
4402
|
+
return /* @__PURE__ */ L("div", {
|
|
4403
|
+
className: "flex flex-col gap-3",
|
|
4404
|
+
children: [
|
|
4405
|
+
/* @__PURE__ */ I("span", {
|
|
4406
|
+
className: "kol-helper-10 text-meta",
|
|
4407
|
+
children: "Motion"
|
|
4408
|
+
}),
|
|
4409
|
+
/* @__PURE__ */ I(T, {
|
|
4410
|
+
options: [{
|
|
4411
|
+
value: "",
|
|
4412
|
+
label: "Add motion…"
|
|
4413
|
+
}, ...nt.map((e) => ({
|
|
4414
|
+
value: e.name,
|
|
4415
|
+
label: e.name
|
|
4416
|
+
}))],
|
|
4417
|
+
value: "",
|
|
4418
|
+
onChange: (e) => {
|
|
4419
|
+
let t = nt.find((t) => t.name === e);
|
|
4420
|
+
t && o(t);
|
|
4421
|
+
}
|
|
4422
|
+
}),
|
|
4423
|
+
t.map((e, t) => {
|
|
4424
|
+
let n = e.enabled !== !1, o = e.target === "reveal", d = $e.has(e.shape ?? "linear");
|
|
4425
|
+
return /* @__PURE__ */ L("div", {
|
|
4426
|
+
className: "flex flex-col gap-2 p-2 rounded bg-fg-04",
|
|
4427
|
+
children: [/* @__PURE__ */ L("div", {
|
|
4428
|
+
className: "flex items-center gap-2",
|
|
4429
|
+
children: [r ? /* @__PURE__ */ L(F, { children: [
|
|
4430
|
+
/* @__PURE__ */ I("span", {
|
|
4431
|
+
className: `kol-helper-10 tracking-widest ${n ? "text-emphasis" : "text-meta"}`,
|
|
4432
|
+
children: a(e.shape ?? "linear")
|
|
4433
|
+
}),
|
|
4434
|
+
/* @__PURE__ */ I(j, {
|
|
4435
|
+
size: i,
|
|
4436
|
+
checked: n,
|
|
4437
|
+
onChange: (e) => c(t, "enabled", e)
|
|
4438
|
+
}),
|
|
4439
|
+
/* @__PURE__ */ I("div", { className: "flex-1" })
|
|
4440
|
+
] }) : /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I("button", {
|
|
4441
|
+
type: "button",
|
|
4442
|
+
"aria-label": n ? "Disable sweep" : "Enable sweep",
|
|
4443
|
+
title: n ? "Disable sweep" : "Enable sweep",
|
|
4444
|
+
onClick: () => c(t, "enabled", !n),
|
|
4445
|
+
className: "inline-flex items-center justify-center w-5 h-5 rounded shrink-0 text-oq-64 hover:text-emphasis",
|
|
4446
|
+
style: {
|
|
4447
|
+
border: "none",
|
|
4448
|
+
background: "transparent",
|
|
4449
|
+
cursor: "pointer"
|
|
4450
|
+
},
|
|
4451
|
+
children: /* @__PURE__ */ I(u, {
|
|
4452
|
+
name: n ? "eye-on" : "eye-off",
|
|
4453
|
+
size: 12
|
|
4454
|
+
})
|
|
4455
|
+
}), /* @__PURE__ */ I("span", {
|
|
4456
|
+
className: `kol-helper-12 flex-1 truncate ${n ? "text-emphasis" : "text-meta"}`,
|
|
4457
|
+
children: a(e.shape ?? "linear")
|
|
4458
|
+
})] }), /* @__PURE__ */ I("button", {
|
|
4459
|
+
type: "button",
|
|
4460
|
+
"aria-label": "Remove sweep",
|
|
4461
|
+
title: "Remove sweep",
|
|
4462
|
+
onClick: () => s(t),
|
|
4463
|
+
className: "inline-flex items-center justify-center w-5 h-5 rounded shrink-0 text-oq-64 hover:text-emphasis",
|
|
4464
|
+
style: {
|
|
4465
|
+
border: "none",
|
|
4466
|
+
background: "transparent",
|
|
4467
|
+
cursor: "pointer"
|
|
4468
|
+
},
|
|
4469
|
+
children: /* @__PURE__ */ I(u, {
|
|
4470
|
+
name: "close",
|
|
4471
|
+
size: 11
|
|
4472
|
+
})
|
|
4473
|
+
})]
|
|
4474
|
+
}), n && /* @__PURE__ */ L(F, { children: [
|
|
4475
|
+
/* @__PURE__ */ I(T, {
|
|
4476
|
+
options: Ze,
|
|
4477
|
+
value: e.shape ?? "linear",
|
|
4478
|
+
onChange: (e) => c(t, "shape", e)
|
|
4479
|
+
}),
|
|
4480
|
+
/* @__PURE__ */ I(T, {
|
|
4481
|
+
options: Qe,
|
|
4482
|
+
value: e.target ?? "brightness",
|
|
4483
|
+
onChange: (e) => c(t, "target", e)
|
|
4484
|
+
}),
|
|
4485
|
+
!o && /* @__PURE__ */ I(l, {
|
|
4486
|
+
label: "Amount",
|
|
4487
|
+
min: -1,
|
|
4488
|
+
max: 1,
|
|
4489
|
+
step: .05,
|
|
4490
|
+
value: e.amount ?? .6,
|
|
4491
|
+
onChange: (e) => c(t, "amount", e)
|
|
4492
|
+
}),
|
|
4493
|
+
/* @__PURE__ */ I(l, {
|
|
4494
|
+
label: "Speed · cycles",
|
|
4495
|
+
min: -4,
|
|
4496
|
+
max: 4,
|
|
4497
|
+
step: 1,
|
|
4498
|
+
value: e.speed ?? 1,
|
|
4499
|
+
onChange: (e) => c(t, "speed", e)
|
|
4500
|
+
}),
|
|
4501
|
+
/* @__PURE__ */ I(l, {
|
|
4502
|
+
label: "Width",
|
|
4503
|
+
min: .05,
|
|
4504
|
+
max: 1,
|
|
4505
|
+
step: .01,
|
|
4506
|
+
value: e.width ?? .35,
|
|
4507
|
+
onChange: (e) => c(t, "width", e)
|
|
4508
|
+
}),
|
|
4509
|
+
d && /* @__PURE__ */ I(l, {
|
|
4510
|
+
label: "Angle",
|
|
4511
|
+
min: 0,
|
|
4512
|
+
max: 360,
|
|
4513
|
+
step: 1,
|
|
4514
|
+
value: e.angle ?? 0,
|
|
4515
|
+
onChange: (e) => c(t, "angle", e)
|
|
4516
|
+
})
|
|
4517
|
+
] })]
|
|
4518
|
+
}, t);
|
|
4519
|
+
}),
|
|
4520
|
+
/* @__PURE__ */ I(te, {
|
|
4521
|
+
iconComponent: u,
|
|
4522
|
+
variant: "primary",
|
|
4523
|
+
size: i,
|
|
4524
|
+
className: "w-full",
|
|
4525
|
+
iconLeft: "plus",
|
|
4526
|
+
iconSize: 12,
|
|
4527
|
+
onClick: () => o(),
|
|
4528
|
+
children: "Add custom sweep"
|
|
4529
|
+
})
|
|
4530
|
+
]
|
|
4531
|
+
});
|
|
4532
|
+
}
|
|
4533
|
+
//#endregion
|
|
4534
|
+
//#region src/packs/effects.js
|
|
4535
|
+
var Hn = {
|
|
4536
|
+
FILTERS: Sn,
|
|
4537
|
+
filterById: Cn,
|
|
4538
|
+
makeSweep: tt,
|
|
4539
|
+
runChain: me,
|
|
4540
|
+
invalidateSource: oe,
|
|
4541
|
+
effectCategories: kn,
|
|
4542
|
+
EffectsPanel: Ln,
|
|
4543
|
+
loadPixiPipeline: () => import("./pipeline-CMpuPUaX.js"),
|
|
4544
|
+
loadGlHost: () => import("./host-be1CWhN1.js")
|
|
4545
|
+
};
|
|
4546
|
+
d("effects", Hn);
|
|
4547
|
+
//#endregion
|
|
4548
|
+
export { An as a, Fn as c, Dn as d, Sn as f, Tn as i, On as l, zn as n, kn as o, Vn as r, Pn as s, Hn as t, Mn as u };
|