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