@pixerate/editor 0.207.0 → 0.209.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation-editor/index.cjs +60 -59
- package/dist/animation-editor/index.js +6 -5
- package/dist/{brushstrokeRender-7LXCU7PD.js → brushstrokeRender-C3UU6GVC.js} +5 -4
- package/dist/{brushstrokeRender-VO4ZTWVA.cjs → brushstrokeRender-EAJNE6WP.cjs} +12 -11
- package/dist/canvas/index.cjs +8 -8
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-2N2QPO3H.js → chunk-2PBZBRP5.js} +9 -7
- package/dist/{chunk-7NW46N7I.cjs → chunk-3EHPLDFQ.cjs} +54 -52
- package/dist/{chunk-H367YTXI.js → chunk-42TWUPNJ.js} +13 -387
- package/dist/chunk-474IQG74.cjs +384 -0
- package/dist/{chunk-MLC7HUHO.js → chunk-BGOCAUXH.js} +1 -1
- package/dist/chunk-DWYQPL2A.js +2010 -0
- package/dist/{chunk-YXKLVD56.js → chunk-F7YA3MMC.js} +2 -2
- package/dist/{chunk-ZZGPYNS2.js → chunk-G4E6RUPC.js} +1 -1
- package/dist/chunk-HVVR5PZW.js +384 -0
- package/dist/{chunk-FR2Q2LVF.cjs → chunk-I7G3RSUJ.cjs} +35 -35
- package/dist/chunk-K6PXS6DO.cjs +102 -0
- package/dist/{chunk-ZIDUPSP4.js → chunk-KFIOEOCQ.js} +24 -761
- package/dist/{chunk-V7GWZIZK.cjs → chunk-KWNMBMKG.cjs} +23 -21
- package/dist/chunk-L3G23N5Y.js +763 -0
- package/dist/{chunk-GHCXLQ47.js → chunk-NDMXB4PR.js} +2 -2
- package/dist/{chunk-CWM3CUUX.cjs → chunk-OLNIPTB3.cjs} +39 -413
- package/dist/{chunk-EBDCRTZI.cjs → chunk-PQ3H2AAN.cjs} +92 -90
- package/dist/{chunk-BRKVNXDZ.cjs → chunk-QAUIZPYI.cjs} +7 -7
- package/dist/{chunk-UYXL6ZWQ.cjs → chunk-QE7D7TZR.cjs} +494 -1231
- package/dist/chunk-QYLWG22N.cjs +763 -0
- package/dist/{chunk-YQ5C5BVK.cjs → chunk-ROVK6AXX.cjs} +60 -60
- package/dist/{chunk-HGTDMKNE.cjs → chunk-UOGKSVRQ.cjs} +126 -221
- package/dist/{chunk-EL5PAHNP.js → chunk-USQCKRZG.js} +6 -4
- package/dist/{chunk-36OKQDCF.js → chunk-WJ2RBZMM.js} +5 -3
- package/dist/chunk-X4LUGTQX.cjs +2010 -0
- package/dist/{chunk-NQMP3CWF.js → chunk-YBJXCQTR.js} +15 -110
- package/dist/chunk-ZIF4UJJ6.js +102 -0
- package/dist/{chunk-WTW7QRTS.cjs → chunk-ZMHPQ6HP.cjs} +1 -1
- package/dist/image-editor/controller.d.cts +53 -5
- package/dist/image-editor/controller.d.ts +53 -5
- package/dist/image-editor/index.cjs +1806 -3356
- package/dist/image-editor/index.js +462 -2012
- package/dist/image-editor/selection/index.d.cts +1 -0
- package/dist/image-editor/selection/index.d.ts +1 -0
- package/dist/image-editor/selection/segment/focus.d.cts +2 -0
- package/dist/image-editor/selection/segment/focus.d.ts +2 -0
- package/dist/image-editor/selection/segment/grabcut.d.cts +4 -2
- package/dist/image-editor/selection/segment/grabcut.d.ts +4 -2
- package/dist/image-editor/selection/segment/sky.d.cts +2 -0
- package/dist/image-editor/selection/segment/sky.d.ts +2 -0
- package/dist/image-editor/selection/segment/subject.d.cts +2 -1
- package/dist/image-editor/selection/segment/subject.d.ts +2 -1
- package/dist/image-editor/selection/segment/work.d.cts +5 -0
- package/dist/image-editor/selection/segment/work.d.ts +5 -0
- package/dist/image-editor/selection/select-and-mask.d.cts +12 -2
- package/dist/image-editor/selection/select-and-mask.d.ts +12 -2
- package/dist/image-editor/selection/tool-options.d.cts +3 -1
- package/dist/image-editor/selection/tool-options.d.ts +3 -1
- package/dist/image-editor/selection/worker.d.cts +126 -0
- package/dist/image-editor/selection/worker.d.ts +126 -0
- package/dist/image-editor/selection-worker.cjs +14 -0
- package/dist/image-editor/selection-worker.d.cts +12 -0
- package/dist/image-editor/selection-worker.d.ts +12 -0
- package/dist/image-editor/selection-worker.js +14 -0
- package/dist/image-editor/types.d.cts +22 -0
- package/dist/image-editor/types.d.ts +22 -0
- package/dist/paint/index.cjs +6 -5
- package/dist/paint/index.js +5 -4
- package/dist/paint-editor/index.cjs +394 -390
- package/dist/paint-editor/index.js +18 -14
- package/dist/raster/index.cjs +22 -18
- package/dist/raster/index.js +29 -25
- package/dist/vector/index.cjs +986 -985
- package/dist/vector/index.js +6 -5
- package/package.json +11 -1
- package/skills/pixerate-image-editor/SKILL.md +1 -1
|
@@ -7,8 +7,9 @@ var _chunkZ64NRDEHcjs = require('../chunk-Z64NRDEH.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkQE7D7TZRcjs = require('../chunk-QE7D7TZR.cjs');
|
|
11
11
|
require('../chunk-A2IS7EHE.cjs');
|
|
12
|
+
require('../chunk-QYLWG22N.cjs');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
|
|
@@ -19,8 +20,9 @@ var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
22
|
-
var
|
|
23
|
+
var _chunkUOGKSVRQcjs = require('../chunk-UOGKSVRQ.cjs');
|
|
23
24
|
require('../chunk-QT26RHKK.cjs');
|
|
25
|
+
require('../chunk-K6PXS6DO.cjs');
|
|
24
26
|
|
|
25
27
|
|
|
26
28
|
|
|
@@ -43,7 +45,7 @@ require('../chunk-QT26RHKK.cjs');
|
|
|
43
45
|
|
|
44
46
|
|
|
45
47
|
|
|
46
|
-
var
|
|
48
|
+
var _chunkKWNMBMKGcjs = require('../chunk-KWNMBMKG.cjs');
|
|
47
49
|
require('../chunk-BROJYMWU.cjs');
|
|
48
50
|
|
|
49
51
|
|
|
@@ -54,7 +56,7 @@ var _chunkJLWLX52Lcjs = require('../chunk-JLWLX52L.cjs');
|
|
|
54
56
|
|
|
55
57
|
|
|
56
58
|
var _chunkK7ENM55Pcjs = require('../chunk-K7ENM55P.cjs');
|
|
57
|
-
require('../chunk-
|
|
59
|
+
require('../chunk-QAUIZPYI.cjs');
|
|
58
60
|
|
|
59
61
|
|
|
60
62
|
|
|
@@ -119,7 +121,7 @@ require('../chunk-BRKVNXDZ.cjs');
|
|
|
119
121
|
|
|
120
122
|
|
|
121
123
|
|
|
122
|
-
var
|
|
124
|
+
var _chunkROVK6AXXcjs = require('../chunk-ROVK6AXX.cjs');
|
|
123
125
|
require('../chunk-CVFAAZXE.cjs');
|
|
124
126
|
require('../chunk-GF2RBSDM.cjs');
|
|
125
127
|
require('../chunk-NM3G4VQT.cjs');
|
|
@@ -189,7 +191,7 @@ require('../chunk-WOFXZ3XU.cjs');
|
|
|
189
191
|
|
|
190
192
|
|
|
191
193
|
|
|
192
|
-
var
|
|
194
|
+
var _chunkPQ3H2AANcjs = require('../chunk-PQ3H2AAN.cjs');
|
|
193
195
|
require('../chunk-YQGCPL5X.cjs');
|
|
194
196
|
|
|
195
197
|
|
|
@@ -206,6 +208,7 @@ require('../chunk-YQGCPL5X.cjs');
|
|
|
206
208
|
|
|
207
209
|
|
|
208
210
|
|
|
211
|
+
var _chunkOLNIPTB3cjs = require('../chunk-OLNIPTB3.cjs');
|
|
209
212
|
|
|
210
213
|
|
|
211
214
|
|
|
@@ -219,7 +222,8 @@ require('../chunk-YQGCPL5X.cjs');
|
|
|
219
222
|
|
|
220
223
|
|
|
221
224
|
|
|
222
|
-
|
|
225
|
+
|
|
226
|
+
var _chunk474IQG74cjs = require('../chunk-474IQG74.cjs');
|
|
223
227
|
require('../chunk-XFM3OCHU.cjs');
|
|
224
228
|
require('../chunk-NIBFDFYW.cjs');
|
|
225
229
|
require('../chunk-ALNIFK5G.cjs');
|
|
@@ -250,7 +254,7 @@ function newPaintLayerId() {
|
|
|
250
254
|
return `pl${Date.now().toString(36)}${(nextId++).toString(36)}`;
|
|
251
255
|
}
|
|
252
256
|
function createPaintLayer(name, id = newPaintLayerId()) {
|
|
253
|
-
return { type: "pixel", id, name, visible: true, opacity: 1, blend: "normal", surface:
|
|
257
|
+
return { type: "pixel", id, name, visible: true, opacity: 1, blend: "normal", surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } };
|
|
254
258
|
}
|
|
255
259
|
var PaintDocumentError = class extends Error {
|
|
256
260
|
constructor(message) {
|
|
@@ -272,7 +276,7 @@ function normalizeCanvas(raw) {
|
|
|
272
276
|
function createPaintDocument(options = {}) {
|
|
273
277
|
const canvas = normalizeCanvas({ width: _nullishCoalesce(options.width, () => ( 2048)), height: _nullishCoalesce(options.height, () => ( 1536)), dpi: options.dpi });
|
|
274
278
|
const layer = createPaintLayer("Layer 1");
|
|
275
|
-
return { canvas, paper:
|
|
279
|
+
return { canvas, paper: _chunkROVK6AXXcjs.normalizePaper.call(void 0, _nullishCoalesce(options.paper, () => ( {}))), layers: [layer], activeLayerId: layer.id, strokes: [] };
|
|
276
280
|
}
|
|
277
281
|
|
|
278
282
|
// src/paint-editor/dab-stroke.ts
|
|
@@ -297,7 +301,7 @@ function mixRgb(a, b, t, mixing) {
|
|
|
297
301
|
if (mixing === "pigment") {
|
|
298
302
|
const o = [0, 0, 0];
|
|
299
303
|
const q = (v) => Math.round(Math.min(1, Math.max(0, v)) * 255);
|
|
300
|
-
|
|
304
|
+
_chunkOLNIPTB3cjs.mixPigment8.call(void 0, q(a[0]), q(a[1]), q(a[2]), q(b[0]), q(b[1]), q(b[2]), t, o);
|
|
301
305
|
return [o[0], o[1], o[2]];
|
|
302
306
|
}
|
|
303
307
|
return [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t, a[2] + (b[2] - a[2]) * t];
|
|
@@ -316,7 +320,7 @@ function multiColorForDab(mc, palette, index, seed, mixing) {
|
|
|
316
320
|
const n = palette.length;
|
|
317
321
|
if (mc.order === "random") {
|
|
318
322
|
const run = Math.floor(index / mc.length);
|
|
319
|
-
return [...palette[Math.min(n - 1, Math.floor(
|
|
323
|
+
return [...palette[Math.min(n - 1, Math.floor(_chunkPQ3H2AANcjs.rand01.call(void 0, seed, run, 11) * n))]];
|
|
320
324
|
}
|
|
321
325
|
const f = index / mc.length % n;
|
|
322
326
|
const i = Math.floor(f);
|
|
@@ -326,24 +330,24 @@ var PaintDabStroke = (_class = class {
|
|
|
326
330
|
constructor(brush, options) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);_class.prototype.__init10.call(this);
|
|
327
331
|
this.brush = brush;
|
|
328
332
|
this.options = options;
|
|
329
|
-
this.smoother = new (0,
|
|
330
|
-
this.copies = _optionalChain([options, 'access', _2 => _2.copies, 'optionalAccess', _3 => _3.length]) ? options.copies : [
|
|
333
|
+
this.smoother = new (0, _chunkROVK6AXXcjs.PenSmoother)(brush.tip.smoothing, brush.pressureSmoothing);
|
|
334
|
+
this.copies = _optionalChain([options, 'access', _2 => _2.copies, 'optionalAccess', _3 => _3.length]) ? options.copies : [_chunkROVK6AXXcjs.IDENTITY_COPY];
|
|
331
335
|
const exchanging = brush.engine === "mixer" || brush.engine === "dab";
|
|
332
|
-
const rates = brush.engine === "mixer" ?
|
|
336
|
+
const rates = brush.engine === "mixer" ? _chunkPQ3H2AANcjs.mixerRates.call(void 0, brush.mixer) : _chunkPQ3H2AANcjs.exchangeRates.call(void 0, brush.behavior.pickup, brush.behavior.mix, 1, brush.behavior.mixing);
|
|
333
337
|
this.mixing = brush.engine === "mixer" ? brush.mixer.mixing : brush.behavior.mixing;
|
|
334
338
|
this.states = this.copies.map((c, i) => ({
|
|
335
|
-
walker: new (0,
|
|
336
|
-
exchange: exchanging ? new (0,
|
|
337
|
-
smudge: brush.engine === "smudge" ? new (0,
|
|
339
|
+
walker: new (0, _chunkROVK6AXXcjs.PenDabWalker)(brush, (_nullishCoalesce(options.seed, () => ( 0))) + i * 7919 | 0, c.linear),
|
|
340
|
+
exchange: exchanging ? new (0, _chunkPQ3H2AANcjs.PaintExchange)(rates, options.load) : null,
|
|
341
|
+
smudge: brush.engine === "smudge" ? new (0, _chunkPQ3H2AANcjs.SmudgeTip)(brush.smudge, brush.tip.size * (1 + brush.dynamics.tiltSize * 1.5)) : null
|
|
338
342
|
}));
|
|
339
|
-
this.medium = new (0,
|
|
343
|
+
this.medium = new (0, _chunkPQ3H2AANcjs.TileMedium)(options.target, brush.engine === "dab" ? { blend: brush.tip.blend } : {});
|
|
340
344
|
this.depth = options.grain && !options.grain.flat ? Math.min(1, Math.max(0, options.paperDepth * brush.grain)) : 0;
|
|
341
|
-
this.coverage = brush.engine === "dab" ? new (0,
|
|
342
|
-
this.sampler = exchanging && options.paint ? new (0,
|
|
345
|
+
this.coverage = brush.engine === "dab" ? new (0, _chunkPQ3H2AANcjs.CoverageMap)() : null;
|
|
346
|
+
this.sampler = exchanging && options.paint ? new (0, _chunkPQ3H2AANcjs.PaintGradientSampler)(options.paint, _nullishCoalesce(options.seed, () => ( 0))) : null;
|
|
343
347
|
const table = _optionalChain([this, 'access', _4 => _4.sampler, 'optionalAccess', _5 => _5.acrossTip]) ? this.sampler.tipTable(GRADIENT_STEPS) : null;
|
|
344
348
|
this.gradient = table ? table.map((e) => e.rgb) : null;
|
|
345
349
|
this.gradientAlpha = table && table.some((e) => e.alpha < 1) ? table.map((e) => e.alpha) : null;
|
|
346
|
-
this.scratch = brush.engine === "blender" ?
|
|
350
|
+
this.scratch = brush.engine === "blender" ? _chunkPQ3H2AANcjs.createBlenderScratch.call(void 0, ) : null;
|
|
347
351
|
}
|
|
348
352
|
|
|
349
353
|
|
|
@@ -402,7 +406,7 @@ var PaintDabStroke = (_class = class {
|
|
|
402
406
|
}
|
|
403
407
|
paintDabs(copy, dabs, rects) {
|
|
404
408
|
for (const d of dabs) {
|
|
405
|
-
const rect =
|
|
409
|
+
const rect = _chunkPQ3H2AANcjs.dabRect.call(void 0, d, this.brush.tip.hardness);
|
|
406
410
|
if (rect.width <= 0 || rect.height <= 0) continue;
|
|
407
411
|
this.dab(copy, d, rect);
|
|
408
412
|
rects.push(rect);
|
|
@@ -418,13 +422,13 @@ var PaintDabStroke = (_class = class {
|
|
|
418
422
|
}
|
|
419
423
|
const tip = this.tip.subarray(0, n);
|
|
420
424
|
tip.fill(0);
|
|
421
|
-
|
|
425
|
+
_chunkPQ3H2AANcjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.brush.tip.hardness, rect, tip);
|
|
422
426
|
if (!(this.depth > 0 && this.options.grain)) return { tip, cov: tip };
|
|
423
427
|
const cov = this.cov.subarray(0, n);
|
|
424
428
|
const grain = this.options.grain;
|
|
425
429
|
for (let yy = 0, k = 0; yy < rect.height; yy++) {
|
|
426
430
|
const y = rect.y + yy + 0.5;
|
|
427
|
-
for (let xx = 0; xx < rect.width; xx++, k++) cov[k] = tip[k] > 0 ? tip[k] *
|
|
431
|
+
for (let xx = 0; xx < rect.width; xx++, k++) cov[k] = tip[k] > 0 ? tip[k] * _chunkPQ3H2AANcjs.grainCatch.call(void 0, grain.at(rect.x + xx + 0.5, y), this.depth, d.pressure) : 0;
|
|
428
432
|
}
|
|
429
433
|
return { tip, cov };
|
|
430
434
|
}
|
|
@@ -433,7 +437,7 @@ var PaintDabStroke = (_class = class {
|
|
|
433
437
|
const { tip, cov } = this.rasterize(d, rect);
|
|
434
438
|
const st = this.states[copy];
|
|
435
439
|
if (brush.engine === "blender") {
|
|
436
|
-
|
|
440
|
+
_chunkPQ3H2AANcjs.blenderDab.call(void 0, this.medium, rect, cov, d.opacity * d.alpha * brush.tip.opacity, d.radius, brush.blender, this.scratch);
|
|
437
441
|
return;
|
|
438
442
|
}
|
|
439
443
|
if (brush.engine === "smudge") {
|
|
@@ -555,7 +559,7 @@ function normalizeLighting(raw = {}, base = DEFAULT_LIGHTING) {
|
|
|
555
559
|
};
|
|
556
560
|
}
|
|
557
561
|
function emptyThickChannels() {
|
|
558
|
-
return { height: new (0,
|
|
562
|
+
return { height: new (0, _chunk474IQG74cjs.TiledSurface)(1, /* @__PURE__ */ new Map(), 0), material: new (0, _chunk474IQG74cjs.TiledSurface)(4, /* @__PURE__ */ new Map(), 0) };
|
|
559
563
|
}
|
|
560
564
|
var RELIEF_PX = 7;
|
|
561
565
|
var AMBIENT = 0.38;
|
|
@@ -579,16 +583,16 @@ function lightTile(color, height, heightAround, material, light) {
|
|
|
579
583
|
const k = RELIEF_PX / 255 * light.relief * 2;
|
|
580
584
|
const flatDiffuse = AMBIENT + (1 - AMBIENT) * lz;
|
|
581
585
|
const read = (x, y) => {
|
|
582
|
-
if (x >= 0 && y >= 0 && x <
|
|
583
|
-
const dx = x < 0 ? -1 : x >=
|
|
584
|
-
const dy = y < 0 ? -1 : y >=
|
|
586
|
+
if (x >= 0 && y >= 0 && x < _chunk474IQG74cjs.TILE && y < _chunk474IQG74cjs.TILE) return height[y * _chunk474IQG74cjs.TILE + x];
|
|
587
|
+
const dx = x < 0 ? -1 : x >= _chunk474IQG74cjs.TILE ? 1 : 0;
|
|
588
|
+
const dy = y < 0 ? -1 : y >= _chunk474IQG74cjs.TILE ? 1 : 0;
|
|
585
589
|
const t = heightAround(dx, dy);
|
|
586
590
|
if (!t) return 0;
|
|
587
|
-
return t[(y - dy *
|
|
591
|
+
return t[(y - dy * _chunk474IQG74cjs.TILE) * _chunk474IQG74cjs.TILE + (x - dx * _chunk474IQG74cjs.TILE)];
|
|
588
592
|
};
|
|
589
|
-
for (let y = 0; y <
|
|
590
|
-
for (let x = 0; x <
|
|
591
|
-
const p = y *
|
|
593
|
+
for (let y = 0; y < _chunk474IQG74cjs.TILE; y++) {
|
|
594
|
+
for (let x = 0; x < _chunk474IQG74cjs.TILE; x++) {
|
|
595
|
+
const p = y * _chunk474IQG74cjs.TILE + x;
|
|
592
596
|
const i = p * 4;
|
|
593
597
|
if (color[i + 3] === 0) continue;
|
|
594
598
|
const h = height[p];
|
|
@@ -609,10 +613,10 @@ function lightTile(color, height, heightAround, material, light) {
|
|
|
609
613
|
const nh = Math.max(0, nx * hx + ny * hy + nz * hz);
|
|
610
614
|
const spec = Math.max(0, Math.pow(nh, shininess) - Math.pow(hz, shininess)) * (0.25 + 0.75 * gloss) * light.relief;
|
|
611
615
|
for (let c = 0; c < 3; c++) {
|
|
612
|
-
const a =
|
|
616
|
+
const a = _chunkKWNMBMKGcjs.SRGB_TO_LINEAR[color[i + c]];
|
|
613
617
|
const tint = metal * a + (1 - metal);
|
|
614
618
|
const v = a * shade * (1 - 0.35 * metal) + spec * tint * (1 + metal);
|
|
615
|
-
out[i + c] =
|
|
619
|
+
out[i + c] = _chunkKWNMBMKGcjs.linearToSrgb8.call(void 0, v);
|
|
616
620
|
}
|
|
617
621
|
}
|
|
618
622
|
}
|
|
@@ -630,14 +634,14 @@ var LitCache = (_class2 = class {constructor() { _class2.prototype.__init11.call
|
|
|
630
634
|
for (const [key, tile] of color.tiles) {
|
|
631
635
|
const tx = key % 65536 - 32768;
|
|
632
636
|
const ty = Math.floor(key / 65536) - 32768;
|
|
633
|
-
const around = (dx, dy) => _nullishCoalesce(_optionalChain([ch, 'access', _10 => _10.height, 'access', _11 => _11.tiles, 'access', _12 => _12.get, 'call', _13 => _13(
|
|
637
|
+
const around = (dx, dy) => _nullishCoalesce(_optionalChain([ch, 'access', _10 => _10.height, 'access', _11 => _11.tiles, 'access', _12 => _12.get, 'call', _13 => _13(_chunk474IQG74cjs.tileKey.call(void 0, tx + dx, ty + dy)), 'optionalAccess', _14 => _14.data]), () => ( null));
|
|
634
638
|
let any = false;
|
|
635
639
|
for (let dy = -1; dy <= 1 && !any; dy++) for (let dx = -1; dx <= 1 && !any; dx++) if (around(dx, dy)) any = true;
|
|
636
640
|
if (!any) continue;
|
|
637
641
|
const h = _nullishCoalesce(ch.height.tiles.get(key), () => ( null));
|
|
638
642
|
const m = _nullishCoalesce(ch.material.tiles.get(key), () => ( null));
|
|
639
643
|
const inputs = [tile, lk, m];
|
|
640
|
-
for (let dy = -1; dy <= 1; dy++) for (let dx = -1; dx <= 1; dx++) inputs.push(_nullishCoalesce(ch.height.tiles.get(
|
|
644
|
+
for (let dy = -1; dy <= 1; dy++) for (let dx = -1; dx <= 1; dx++) inputs.push(_nullishCoalesce(ch.height.tiles.get(_chunk474IQG74cjs.tileKey.call(void 0, tx + dx, ty + dy)), () => ( null)));
|
|
641
645
|
const cached = this.tiles.get(key);
|
|
642
646
|
if (cached && cached.inputs.length === inputs.length && cached.inputs.every((v, i) => v === inputs[i])) {
|
|
643
647
|
out.set(key, cached.tile);
|
|
@@ -646,7 +650,7 @@ var LitCache = (_class2 = class {constructor() { _class2.prototype.__init11.call
|
|
|
646
650
|
const hd = h ? expand(h, 1) : null;
|
|
647
651
|
const md = m ? expand(m, 4) : null;
|
|
648
652
|
const data = lightTile(expand(tile, 4), hd, (dx, dy) => {
|
|
649
|
-
const t = ch.height.tiles.get(
|
|
653
|
+
const t = ch.height.tiles.get(_chunk474IQG74cjs.tileKey.call(void 0, tx + dx, ty + dy));
|
|
650
654
|
return t ? expand(t, 1) : null;
|
|
651
655
|
}, md, light);
|
|
652
656
|
const lit = { data, uniform: null };
|
|
@@ -654,12 +658,12 @@ var LitCache = (_class2 = class {constructor() { _class2.prototype.__init11.call
|
|
|
654
658
|
out.set(key, lit);
|
|
655
659
|
}
|
|
656
660
|
for (const key of [...this.tiles.keys()]) if (!keys.has(key)) this.tiles.delete(key);
|
|
657
|
-
return new (0,
|
|
661
|
+
return new (0, _chunk474IQG74cjs.TiledSurface)(4, out, color.defaultValue);
|
|
658
662
|
}
|
|
659
663
|
}, _class2);
|
|
660
664
|
function expand(t, channels) {
|
|
661
|
-
if (t.data.length ===
|
|
662
|
-
const out = new Uint8ClampedArray(
|
|
665
|
+
if (t.data.length === _chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * channels) return t.data;
|
|
666
|
+
const out = new Uint8ClampedArray(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * channels);
|
|
663
667
|
const u = _nullishCoalesce(t.uniform, () => ( 0));
|
|
664
668
|
if (channels === 1) out.fill(u & 255);
|
|
665
669
|
else {
|
|
@@ -672,19 +676,19 @@ var ThickStrokeDriver = (_class3 = class {
|
|
|
672
676
|
constructor(init) {;_class3.prototype.__init12.call(this);_class3.prototype.__init13.call(this);_class3.prototype.__init14.call(this);_class3.prototype.__init15.call(this);_class3.prototype.__init16.call(this);_class3.prototype.__init17.call(this);_class3.prototype.__init18.call(this);_class3.prototype.__init19.call(this);_class3.prototype.__init20.call(this);
|
|
673
677
|
this.init = init;
|
|
674
678
|
const b = init.brush;
|
|
675
|
-
this.smoother = new (0,
|
|
676
|
-
const copies = init.copies.length ? init.copies : [
|
|
679
|
+
this.smoother = new (0, _chunkROVK6AXXcjs.PenSmoother)(b.tip.smoothing, b.pressureSmoothing);
|
|
680
|
+
const copies = init.copies.length ? init.copies : [_chunkROVK6AXXcjs.IDENTITY_COPY];
|
|
677
681
|
this.copies = copies;
|
|
678
|
-
const rates =
|
|
682
|
+
const rates = _chunkPQ3H2AANcjs.exchangeRates.call(void 0, b.behavior.pickup, b.behavior.mix, 1, b.behavior.mixing);
|
|
679
683
|
this.states = copies.map((c, i) => ({
|
|
680
|
-
walker: new (0,
|
|
681
|
-
exchange: new (0,
|
|
682
|
-
smudge: b.impasto.tool === "knife" ? new (0,
|
|
684
|
+
walker: new (0, _chunkROVK6AXXcjs.PenDabWalker)(b, init.seed + i * 7919 | 0, c.linear),
|
|
685
|
+
exchange: new (0, _chunkPQ3H2AANcjs.PaintExchange)(rates, init.load),
|
|
686
|
+
smudge: b.impasto.tool === "knife" ? new (0, _chunkPQ3H2AANcjs.SmudgeTip)({ strength: 0.85, length: 0.6 + 0.38 * b.impasto.drag, mixing: b.behavior.mixing }, b.tip.size * 1.2) : null,
|
|
683
687
|
carried: null,
|
|
684
688
|
amount: 1
|
|
685
689
|
}));
|
|
686
|
-
this.medium = new (0,
|
|
687
|
-
this.sampler = init.paint ? new (0,
|
|
690
|
+
this.medium = new (0, _chunkPQ3H2AANcjs.TileMedium)(init.target, {});
|
|
691
|
+
this.sampler = init.paint ? new (0, _chunkPQ3H2AANcjs.PaintGradientSampler)(init.paint.map.by === "across-tip" ? { ...init.paint, map: { by: "distance", length: 300, repeat: "mirror" } } : init.paint, init.seed) : null;
|
|
688
692
|
}
|
|
689
693
|
|
|
690
694
|
__init12() {this.dabCount = 0}
|
|
@@ -710,47 +714,47 @@ var ThickStrokeDriver = (_class3 = class {
|
|
|
710
714
|
const h = new Map(this.init.channels.height.tiles);
|
|
711
715
|
const m = new Map(this.init.channels.material.tiles);
|
|
712
716
|
for (const [k, d] of this.height) {
|
|
713
|
-
const t =
|
|
717
|
+
const t = _chunk474IQG74cjs.finishTile.call(void 0, d, 1, 0);
|
|
714
718
|
if (t) h.set(k, t);
|
|
715
719
|
else h.delete(k);
|
|
716
720
|
}
|
|
717
721
|
for (const [k, d] of this.material) {
|
|
718
|
-
const t =
|
|
722
|
+
const t = _chunk474IQG74cjs.finishTile.call(void 0, new Uint8ClampedArray(d), 4, 0);
|
|
719
723
|
if (t) m.set(k, t);
|
|
720
724
|
else m.delete(k);
|
|
721
725
|
}
|
|
722
726
|
void this.version;
|
|
723
|
-
return { height: new (0,
|
|
727
|
+
return { height: new (0, _chunk474IQG74cjs.TiledSurface)(1, h, 0), material: new (0, _chunk474IQG74cjs.TiledSurface)(4, m, 0) };
|
|
724
728
|
}
|
|
725
729
|
heightTile(tx, ty, write) {
|
|
726
|
-
const key =
|
|
730
|
+
const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
|
|
727
731
|
let t = this.height.get(key);
|
|
728
732
|
if (t) {
|
|
729
733
|
return t;
|
|
730
734
|
}
|
|
731
735
|
const base = this.init.channels.height.tiles.get(key);
|
|
732
736
|
if (!write) return base ? expand(base, 1) : null;
|
|
733
|
-
t = base ? new Uint8ClampedArray(expand(base, 1)) : new Uint8ClampedArray(
|
|
737
|
+
t = base ? new Uint8ClampedArray(expand(base, 1)) : new Uint8ClampedArray(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE);
|
|
734
738
|
this.height.set(key, t);
|
|
735
739
|
return t;
|
|
736
740
|
}
|
|
737
741
|
materialTile(tx, ty) {
|
|
738
|
-
const key =
|
|
742
|
+
const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
|
|
739
743
|
let t = this.material.get(key);
|
|
740
744
|
if (!t) {
|
|
741
745
|
const base = this.init.channels.material.tiles.get(key);
|
|
742
|
-
t = base ? new Uint8ClampedArray(expand(base, 4)) : new Uint8ClampedArray(
|
|
746
|
+
t = base ? new Uint8ClampedArray(expand(base, 4)) : new Uint8ClampedArray(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4);
|
|
743
747
|
this.material.set(key, t);
|
|
744
748
|
}
|
|
745
749
|
return t;
|
|
746
750
|
}
|
|
747
751
|
getH(x, y) {
|
|
748
|
-
const t = this.heightTile(Math.floor(x /
|
|
749
|
-
return t ? t[(y & 255) *
|
|
752
|
+
const t = this.heightTile(Math.floor(x / _chunk474IQG74cjs.TILE), Math.floor(y / _chunk474IQG74cjs.TILE), false);
|
|
753
|
+
return t ? t[(y & 255) * _chunk474IQG74cjs.TILE + (x & 255)] : 0;
|
|
750
754
|
}
|
|
751
755
|
setH(x, y, v) {
|
|
752
|
-
const t = this.heightTile(Math.floor(x /
|
|
753
|
-
t[(y & 255) *
|
|
756
|
+
const t = this.heightTile(Math.floor(x / _chunk474IQG74cjs.TILE), Math.floor(y / _chunk474IQG74cjs.TILE), true);
|
|
757
|
+
t[(y & 255) * _chunk474IQG74cjs.TILE + (x & 255)] = v;
|
|
754
758
|
}
|
|
755
759
|
push(points) {
|
|
756
760
|
const rects = [];
|
|
@@ -780,7 +784,7 @@ var ThickStrokeDriver = (_class3 = class {
|
|
|
780
784
|
}
|
|
781
785
|
applyDabs(copy, dabs, rects) {
|
|
782
786
|
for (const d of dabs) {
|
|
783
|
-
const rect =
|
|
787
|
+
const rect = _chunkPQ3H2AANcjs.dabRect.call(void 0, d, this.init.brush.tip.hardness);
|
|
784
788
|
if (rect.width <= 0 || rect.height <= 0) continue;
|
|
785
789
|
this.dab(copy, d, rect);
|
|
786
790
|
rects.push(rect);
|
|
@@ -795,7 +799,7 @@ var ThickStrokeDriver = (_class3 = class {
|
|
|
795
799
|
const n = rect.width * rect.height;
|
|
796
800
|
if (this.tip.length < n) this.tip = new Float32Array(n);
|
|
797
801
|
const tip = this.tip.subarray(0, n);
|
|
798
|
-
|
|
802
|
+
_chunkPQ3H2AANcjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, b.tip.hardness, rect, tip);
|
|
799
803
|
const sel = this.init.target.selection;
|
|
800
804
|
if (sel) {
|
|
801
805
|
for (let yy = 0, p = 0; yy < rect.height; yy++)
|
|
@@ -849,7 +853,7 @@ var ThickStrokeDriver = (_class3 = class {
|
|
|
849
853
|
const full = 255 * thick * k;
|
|
850
854
|
switch (im.tool) {
|
|
851
855
|
case "brush": {
|
|
852
|
-
const ridge = 0.6 + 0.4 * Math.sin(u * 9 +
|
|
856
|
+
const ridge = 0.6 + 0.4 * Math.sin(u * 9 + _chunkPQ3H2AANcjs.hash2.call(void 0, Math.round(u * 6), 3, seed) * 6.28) + 0.15 * (_chunkPQ3H2AANcjs.hash2.call(void 0, lx, ly, seed) - 0.5);
|
|
853
857
|
const target = full * c * ridge;
|
|
854
858
|
h = Math.max(h0 * (1 - 0.25 * c * im.drag), Math.min(255, h0 * 0.35 + target));
|
|
855
859
|
break;
|
|
@@ -865,7 +869,7 @@ var ThickStrokeDriver = (_class3 = class {
|
|
|
865
869
|
break;
|
|
866
870
|
}
|
|
867
871
|
case "roller": {
|
|
868
|
-
const stipple = 0.75 + 0.5 *
|
|
872
|
+
const stipple = 0.75 + 0.5 * _chunkPQ3H2AANcjs.hash2.call(void 0, lx >> 1, ly >> 1, seed);
|
|
869
873
|
h = h0 + (Math.min(255, full * 0.6 * stipple) - h0) * Math.min(1, c * 1.5);
|
|
870
874
|
break;
|
|
871
875
|
}
|
|
@@ -910,8 +914,8 @@ var ThickStrokeDriver = (_class3 = class {
|
|
|
910
914
|
if (c <= 0) continue;
|
|
911
915
|
const lx = rect.x + xx - off.x;
|
|
912
916
|
const ly = rect.y + yy - off.y;
|
|
913
|
-
const t = this.materialTile(Math.floor(lx /
|
|
914
|
-
const i = ((ly & 255) *
|
|
917
|
+
const t = this.materialTile(Math.floor(lx / _chunk474IQG74cjs.TILE), Math.floor(ly / _chunk474IQG74cjs.TILE));
|
|
918
|
+
const i = ((ly & 255) * _chunk474IQG74cjs.TILE + (lx & 255)) * 4;
|
|
915
919
|
t[i] = Math.round(t[i] + (gloss * 255 - t[i]) * c);
|
|
916
920
|
t[i + 1] = Math.round(t[i + 1] + (metal * 255 - t[i + 1]) * c);
|
|
917
921
|
t[i + 3] = 255;
|
|
@@ -930,28 +934,28 @@ function reliefInfo(ch) {
|
|
|
930
934
|
function thickToJSON(ch) {
|
|
931
935
|
const b = ch.height.bounds;
|
|
932
936
|
if (!b) return null;
|
|
933
|
-
return { rect: { ...b }, height:
|
|
937
|
+
return { rect: { ...b }, height: _chunkOLNIPTB3cjs.pngDataUrl.call(void 0, b.width, b.height, _chunk474IQG74cjs.readRegion.call(void 0, ch.height, b), 1), material: _chunkOLNIPTB3cjs.pngDataUrl.call(void 0, b.width, b.height, _chunk474IQG74cjs.readRegion.call(void 0, ch.material, b), 4) };
|
|
934
938
|
}
|
|
935
939
|
function thickFromJSON(raw) {
|
|
936
940
|
const r = raw;
|
|
937
941
|
if (!r || typeof r !== "object" || !r.rect || typeof r.height !== "string" || typeof r.material !== "string") throw new Error("not saved thick-paint channels");
|
|
938
942
|
const decode = (url, gray) => {
|
|
939
|
-
const parsed =
|
|
943
|
+
const parsed = _chunkOLNIPTB3cjs.parseDataUrl.call(void 0, url);
|
|
940
944
|
if (!parsed) throw new Error("a channel is not a PNG data URL");
|
|
941
|
-
return
|
|
945
|
+
return _chunkOLNIPTB3cjs.decodePng.call(void 0, parsed.bytes, { keepGray: gray });
|
|
942
946
|
};
|
|
943
947
|
const h = decode(r.height, true);
|
|
944
948
|
const m = decode(r.material, false);
|
|
945
949
|
const hd = h.channels === 1 ? h.data : Uint8ClampedArray.from({ length: h.width * h.height }, (_, i) => h.data[i * 4]);
|
|
946
950
|
return {
|
|
947
|
-
height:
|
|
948
|
-
material:
|
|
951
|
+
height: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: h.width, height: h.height, data: hd }, 1, r.rect.x, r.rect.y),
|
|
952
|
+
material: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: m.width, height: m.height, data: m.data }, 4, r.rect.x, r.rect.y)
|
|
949
953
|
};
|
|
950
954
|
}
|
|
951
955
|
|
|
952
956
|
// src/paint-editor/stroke.ts
|
|
953
957
|
function defaultTile(surface) {
|
|
954
|
-
const data = new Uint8ClampedArray(
|
|
958
|
+
const data = new Uint8ClampedArray(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * surface.channels);
|
|
955
959
|
if (surface.defaultValue) data.fill(surface.defaultValue);
|
|
956
960
|
return data;
|
|
957
961
|
}
|
|
@@ -975,7 +979,7 @@ var PaintStrokeSession = (_class4 = class {
|
|
|
975
979
|
this.layerId = init.layerId;
|
|
976
980
|
this.base = init.surface;
|
|
977
981
|
this.live = new Map(this.base.tiles);
|
|
978
|
-
this.copies = init.copies.length ? init.copies : [
|
|
982
|
+
this.copies = init.copies.length ? init.copies : [_chunkROVK6AXXcjs.IDENTITY_COPY];
|
|
979
983
|
const brush = init.brush;
|
|
980
984
|
if (init.wet) this.wetDriver = init.wet.driver;
|
|
981
985
|
this.apply = {
|
|
@@ -990,11 +994,11 @@ var PaintStrokeSession = (_class4 = class {
|
|
|
990
994
|
};
|
|
991
995
|
if (this.wetDriver) {
|
|
992
996
|
} else if (init.sticker) {
|
|
993
|
-
this.stickerSpray = new (0,
|
|
997
|
+
this.stickerSpray = new (0, _chunkROVK6AXXcjs.StickerSpray)({ brush, target: this.tileTarget(), color: init.colorHex, seed: init.seed, copies: this.copies, nextId: init.sticker.nextId, paint: _nullishCoalesce(init.paint, () => ( null)) });
|
|
994
998
|
} else if (init.thick) {
|
|
995
999
|
const rgb = (c) => [c[0] / 255, c[1] / 255, c[2] / 255];
|
|
996
1000
|
this.thickDriver = new ThickStrokeDriver({ brush, target: this.tileTarget(), channels: init.thick.channels, color: rgb(init.color), load: init.mixerLoad, seed: init.seed, copies: this.copies, paint: _nullishCoalesce(init.paint, () => ( null)) });
|
|
997
|
-
} else if (brush.engine === "mixer" || brush.engine === "blender" || brush.engine === "smudge" ||
|
|
1001
|
+
} else if (brush.engine === "mixer" || brush.engine === "blender" || brush.engine === "smudge" || _chunkROVK6AXXcjs.usesPaintExchange.call(void 0, brush, Boolean(init.paint))) {
|
|
998
1002
|
const rgb = (c) => [c[0] / 255, c[1] / 255, c[2] / 255];
|
|
999
1003
|
this.wet = new PaintDabStroke(brush, {
|
|
1000
1004
|
target: this.tileTarget(),
|
|
@@ -1009,7 +1013,7 @@ var PaintStrokeSession = (_class4 = class {
|
|
|
1009
1013
|
});
|
|
1010
1014
|
} else {
|
|
1011
1015
|
const opts = { grain: init.grain, paperDepth: init.paperDepth, seed: init.seed, copies: this.copies, paint: _nullishCoalesce(init.paint, () => ( null)) };
|
|
1012
|
-
this.dry = brush.engine === "particle" ? new (0,
|
|
1016
|
+
this.dry = brush.engine === "particle" ? new (0, _chunkROVK6AXXcjs.ParticleStroke)(brush, opts) : brush.engine === "bristle" ? new (0, _chunkROVK6AXXcjs.BristleStroke)(brush, opts) : new (0, _chunkROVK6AXXcjs.DryStroke)(brush, opts);
|
|
1013
1017
|
}
|
|
1014
1018
|
}
|
|
1015
1019
|
|
|
@@ -1041,9 +1045,9 @@ var PaintStrokeSession = (_class4 = class {
|
|
|
1041
1045
|
offset: this.init.offset,
|
|
1042
1046
|
lockTransparency: this.init.lockTransparency,
|
|
1043
1047
|
selection: _nullishCoalesce(this.init.selection, () => ( null)),
|
|
1044
|
-
readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _15 => _15.live, 'access', _16 => _16.get, 'call', _17 => _17(
|
|
1048
|
+
readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _15 => _15.live, 'access', _16 => _16.get, 'call', _17 => _17(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _18 => _18.data]), () => ( null)),
|
|
1045
1049
|
writeTile: (tx, ty) => {
|
|
1046
|
-
const key =
|
|
1050
|
+
const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
|
|
1047
1051
|
if (!this.touched.has(key)) {
|
|
1048
1052
|
const src = _nullishCoalesce(_optionalChain([this, 'access', _19 => _19.base, 'access', _20 => _20.tiles, 'access', _21 => _21.get, 'call', _22 => _22(key), 'optionalAccess', _23 => _23.data]), () => ( defaultTile(this.base)));
|
|
1049
1053
|
this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
|
|
@@ -1099,7 +1103,7 @@ var PaintStrokeSession = (_class4 = class {
|
|
|
1099
1103
|
const changed = d.dabCount > 0;
|
|
1100
1104
|
this.result = { layerId: this.layerId, bounds: changed ? d.bounds : null, dabs: d.dabCount, strokeId: null, wet: true };
|
|
1101
1105
|
const carried = d.load;
|
|
1102
|
-
if (carried) this.result.mixerLoad = this.init.brush.behavior.dirty ? carried :
|
|
1106
|
+
if (carried) this.result.mixerLoad = this.init.brush.behavior.dirty ? carried : _chunkPQ3H2AANcjs.cleanMixer.call(void 0, carried);
|
|
1103
1107
|
this.host.commit(this, changed ? this.init.wet.surface() : null, false);
|
|
1104
1108
|
}
|
|
1105
1109
|
update(rects) {
|
|
@@ -1109,14 +1113,14 @@ var PaintStrokeSession = (_class4 = class {
|
|
|
1109
1113
|
if (!this.dry) {
|
|
1110
1114
|
for (const key of this.fresh) this.live.set(key, { data: this.live.get(key).data, uniform: null });
|
|
1111
1115
|
this.fresh.clear();
|
|
1112
|
-
this.host.update(this.layerId, new (0,
|
|
1116
|
+
this.host.update(this.layerId, new (0, _chunk474IQG74cjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
|
|
1113
1117
|
return;
|
|
1114
1118
|
}
|
|
1115
1119
|
const off = this.init.offset;
|
|
1116
1120
|
const regions = /* @__PURE__ */ new Map();
|
|
1117
1121
|
for (const r of rects) {
|
|
1118
|
-
for (const t of
|
|
1119
|
-
const key =
|
|
1122
|
+
for (const t of _chunk474IQG74cjs.tilesInRect.call(void 0, { x: r.x - off.x, y: r.y - off.y, width: r.width, height: r.height })) {
|
|
1123
|
+
const key = _chunk474IQG74cjs.tileKey.call(void 0, t.tx, t.ty);
|
|
1120
1124
|
const cur = regions.get(key);
|
|
1121
1125
|
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? union(cur.r, r) : r });
|
|
1122
1126
|
}
|
|
@@ -1125,10 +1129,10 @@ var PaintStrokeSession = (_class4 = class {
|
|
|
1125
1129
|
const src = _nullishCoalesce(_optionalChain([this, 'access', _27 => _27.base, 'access', _28 => _28.tiles, 'access', _29 => _29.get, 'call', _30 => _30(key), 'optionalAccess', _31 => _31.data]), () => ( defaultTile(this.base)));
|
|
1126
1130
|
const prev = this.touched.has(key) ? _optionalChain([this, 'access', _32 => _32.live, 'access', _33 => _33.get, 'call', _34 => _34(key), 'optionalAccess', _35 => _35.data]) : void 0;
|
|
1127
1131
|
this.touched.add(key);
|
|
1128
|
-
const data =
|
|
1132
|
+
const data = _chunkPQ3H2AANcjs.applyStrokeToTile.call(void 0, this.dry.coverage, src, ch, tx, ty, this.apply, prev ? { into: prev, region: r } : {});
|
|
1129
1133
|
this.live.set(key, { data, uniform: null });
|
|
1130
1134
|
}
|
|
1131
|
-
this.host.update(this.layerId, new (0,
|
|
1135
|
+
this.host.update(this.layerId, new (0, _chunk474IQG74cjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
|
|
1132
1136
|
}
|
|
1133
1137
|
/** Ends the stroke (one undo step) and returns what changed. */
|
|
1134
1138
|
end() {
|
|
@@ -1149,18 +1153,18 @@ var PaintStrokeSession = (_class4 = class {
|
|
|
1149
1153
|
const tiles = new Map(this.base.tiles);
|
|
1150
1154
|
let changed = false;
|
|
1151
1155
|
for (const key of this.touched) {
|
|
1152
|
-
const tile =
|
|
1156
|
+
const tile = _chunk474IQG74cjs.finishTile.call(void 0, this.live.get(key).data, ch, this.base.defaultValue);
|
|
1153
1157
|
const prev = this.base.tiles.get(key);
|
|
1154
1158
|
if (tile) tiles.set(key, tile);
|
|
1155
1159
|
else tiles.delete(key);
|
|
1156
1160
|
if (!sameTile(prev, tile)) changed = true;
|
|
1157
1161
|
}
|
|
1158
1162
|
if (this.thickDriver && this.thickDriver.dabCount > 0) changed = true;
|
|
1159
|
-
const surface = changed ? new (0,
|
|
1163
|
+
const surface = changed ? new (0, _chunk474IQG74cjs.TiledSurface)(ch, tiles, this.base.defaultValue) : null;
|
|
1160
1164
|
const dabs = this.dry ? this.dry.dabCount : this.thickDriver ? this.thickDriver.dabCount : this.stickerSpray ? this.stickerSpray.dabCount : this.wet.dabCount;
|
|
1161
1165
|
this.result = { layerId: this.layerId, bounds: changed ? this.bounds : null, dabs, strokeId: null };
|
|
1162
1166
|
const carried = _nullishCoalesce(_optionalChain([this, 'access', _36 => _36.wet, 'optionalAccess', _37 => _37.load]), () => ( _optionalChain([this, 'access', _38 => _38.thickDriver, 'optionalAccess', _39 => _39.load])));
|
|
1163
|
-
if (carried) this.result.mixerLoad = this.init.brush.behavior.dirty ? carried :
|
|
1167
|
+
if (carried) this.result.mixerLoad = this.init.brush.behavior.dirty ? carried : _chunkPQ3H2AANcjs.cleanMixer.call(void 0, carried);
|
|
1164
1168
|
this.host.commit(this, surface, false);
|
|
1165
1169
|
return this.result;
|
|
1166
1170
|
}
|
|
@@ -1173,15 +1177,15 @@ var PaintStrokeSession = (_class4 = class {
|
|
|
1173
1177
|
}, _class4);
|
|
1174
1178
|
function mixerLoadForStroke(brush, current, color) {
|
|
1175
1179
|
if (!brush.loadsColor) return { reservoir: null, amount: 0, pickup: brush.mixer.cleanEachStroke ? null : current.pickup };
|
|
1176
|
-
if (brush.mixer.loadEachStroke || !current.reservoir) return
|
|
1180
|
+
if (brush.mixer.loadEachStroke || !current.reservoir) return _chunkPQ3H2AANcjs.loadMixer.call(void 0, current, color);
|
|
1177
1181
|
return current;
|
|
1178
1182
|
}
|
|
1179
1183
|
function brushLoadForStroke(brush, current, color) {
|
|
1180
1184
|
if (brush.engine === "mixer") return mixerLoadForStroke(brush, current, color);
|
|
1181
1185
|
if (brush.engine === "impasto") return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
|
|
1182
|
-
if (brush.engine === "wet") return brush.wet.tool === "paint" ? { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null } :
|
|
1183
|
-
if (
|
|
1184
|
-
return
|
|
1186
|
+
if (brush.engine === "wet") return brush.wet.tool === "paint" ? { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null } : _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD;
|
|
1187
|
+
if (_chunkROVK6AXXcjs.usesPaintExchange.call(void 0, brush)) return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
|
|
1188
|
+
return _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD;
|
|
1185
1189
|
}
|
|
1186
1190
|
|
|
1187
1191
|
// src/paint-editor/stencils.ts
|
|
@@ -1448,7 +1452,7 @@ function normalizeBrushStroke(raw) {
|
|
|
1448
1452
|
const out = {
|
|
1449
1453
|
id: r.id,
|
|
1450
1454
|
layerId: r.layerId,
|
|
1451
|
-
brush:
|
|
1455
|
+
brush: _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, _nullishCoalesce(r.brush, () => ( {}))),
|
|
1452
1456
|
color: typeof r.color === "string" && /^#[0-9a-f]{6}$/i.test(r.color) ? r.color.toLowerCase() : "#000000",
|
|
1453
1457
|
points,
|
|
1454
1458
|
seed: finite2(r.seed) ? r.seed | 0 : 0
|
|
@@ -1467,7 +1471,7 @@ function normalizeBrushStroke(raw) {
|
|
|
1467
1471
|
}
|
|
1468
1472
|
if (st.length) out.stencils = st;
|
|
1469
1473
|
}
|
|
1470
|
-
const paint =
|
|
1474
|
+
const paint = _chunkPQ3H2AANcjs.readPaintSource.call(void 0, r.paint);
|
|
1471
1475
|
if (paint && paint.type === "gradient") out.paint = paint;
|
|
1472
1476
|
if (Array.isArray(r.steps) && r.steps.length === points.length && r.steps.every((v) => Number.isInteger(v) && v >= 0)) out.steps = [...r.steps];
|
|
1473
1477
|
return out;
|
|
@@ -1504,9 +1508,9 @@ function varyStroke(stroke, m, v) {
|
|
|
1504
1508
|
if (ps !== 1) q.pressure = Math.min(1, Math.max(0, (_nullishCoalesce(p.pressure, () => ( 1))) * ps));
|
|
1505
1509
|
return q;
|
|
1506
1510
|
});
|
|
1507
|
-
const brush = s !== 1 ?
|
|
1511
|
+
const brush = s !== 1 ? _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { ...stroke.brush, tip: { ...stroke.brush.tip, size: stroke.brush.tip.size * s } }) : stroke.brush;
|
|
1508
1512
|
const out = { ...stroke, brush, points };
|
|
1509
|
-
if (stroke.paint && s !== 1) out.paint =
|
|
1513
|
+
if (stroke.paint && s !== 1) out.paint = _chunkPQ3H2AANcjs.scalePaintGradient.call(void 0, stroke.paint, s);
|
|
1510
1514
|
if (_optionalChain([stroke, 'access', _57 => _57.copies, 'optionalAccess', _58 => _58.length])) {
|
|
1511
1515
|
const inv = invertAffine(m);
|
|
1512
1516
|
out.copies = stroke.copies.map((c) => composeAffine(m, composeAffine(c, inv)));
|
|
@@ -1538,7 +1542,7 @@ function paperGrain(paper) {
|
|
|
1538
1542
|
const key = JSON.stringify([paper.pattern, paper.seed, paper.scale, paper.tiling, paper.dry, _nullishCoalesce(paper.offset, () => ( null))]);
|
|
1539
1543
|
let g = grainCache.get(key);
|
|
1540
1544
|
if (!g) {
|
|
1541
|
-
g = new (0,
|
|
1545
|
+
g = new (0, _chunkPQ3H2AANcjs.PaperGrain)(paper, "dry");
|
|
1542
1546
|
if (grainCache.size > 16) grainCache.delete(grainCache.keys().next().value);
|
|
1543
1547
|
grainCache.set(key, g);
|
|
1544
1548
|
}
|
|
@@ -1548,7 +1552,7 @@ function paperTile(paper, r, light) {
|
|
|
1548
1552
|
const key = `${paperKey(paper, light)}|${r.x},${r.y},${r.width},${r.height}`;
|
|
1549
1553
|
let t = tileCache.get(key);
|
|
1550
1554
|
if (!t) {
|
|
1551
|
-
t =
|
|
1555
|
+
t = _chunkROVK6AXXcjs.renderPaper.call(void 0, paper, r, paperGrain(paper), light);
|
|
1552
1556
|
if (tileCache.size > 512) tileCache.delete(tileCache.keys().next().value);
|
|
1553
1557
|
tileCache.set(key, t);
|
|
1554
1558
|
}
|
|
@@ -1577,7 +1581,7 @@ var PROFILE = {
|
|
|
1577
1581
|
}
|
|
1578
1582
|
};
|
|
1579
1583
|
function createPaintCompositor() {
|
|
1580
|
-
return new (0,
|
|
1584
|
+
return new (0, _chunkUOGKSVRQcjs.RasterCompositor)(PROFILE);
|
|
1581
1585
|
}
|
|
1582
1586
|
function downsampleRgba(data, width, height, tw, th) {
|
|
1583
1587
|
tw = Math.max(1, Math.round(tw));
|
|
@@ -1653,11 +1657,11 @@ function header(state, options) {
|
|
|
1653
1657
|
return out;
|
|
1654
1658
|
}
|
|
1655
1659
|
function serializePaintDocument(state, options = {}) {
|
|
1656
|
-
const { layers, assets } =
|
|
1660
|
+
const { layers, assets } = _chunkQE7D7TZRcjs.serializeLayers.call(void 0, state.layers);
|
|
1657
1661
|
return { ...header(state, options), layers, assets };
|
|
1658
1662
|
}
|
|
1659
1663
|
async function serializePaintDocumentExternal(state, store, options = {}) {
|
|
1660
|
-
const { layers, assets } = await
|
|
1664
|
+
const { layers, assets } = await _chunkQE7D7TZRcjs.serializeLayersExternal.call(void 0, state.layers, store);
|
|
1661
1665
|
return { ...header(state, options), layers, assets };
|
|
1662
1666
|
}
|
|
1663
1667
|
function paintLayersOnly(layers, problems) {
|
|
@@ -1692,11 +1696,11 @@ function deserializePaintDocument(raw) {
|
|
|
1692
1696
|
}
|
|
1693
1697
|
const problems = [];
|
|
1694
1698
|
const canvas = normalizeCanvas({ width: r.width, height: r.height, dpi: _nullishCoalesce(r.dpi, () => ( void 0)) });
|
|
1695
|
-
const paper =
|
|
1699
|
+
const paper = _chunkROVK6AXXcjs.normalizePaper.call(void 0, _nullishCoalesce(r.paper, () => ( {})));
|
|
1696
1700
|
const assets = r.assets && typeof r.assets === "object" ? r.assets : {};
|
|
1697
|
-
const layers = paintLayersOnly(
|
|
1701
|
+
const layers = paintLayersOnly(_chunkQE7D7TZRcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
|
|
1698
1702
|
const wanted = typeof r.activeLayerId === "string" ? r.activeLayerId : null;
|
|
1699
|
-
const activeLayerId = wanted &&
|
|
1703
|
+
const activeLayerId = wanted && _chunkUOGKSVRQcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkUOGKSVRQcjs.flattenLayers.call(void 0, layers), 'access', _70 => _70.filter, 'call', _71 => _71((l) => l.type === "pixel"), 'access', _72 => _72.pop, 'call', _73 => _73(), 'optionalAccess', _74 => _74.id]), () => ( null));
|
|
1700
1704
|
const wetEvents = Array.isArray(r.wetEvents) ? r.wetEvents.filter((e) => e && typeof e === "object" && Number.isInteger(e.clock) && typeof e.kind === "string") : [];
|
|
1701
1705
|
const state = { canvas, paper, layers, activeLayerId, strokes: readStrokes(r.strokes, problems) };
|
|
1702
1706
|
if (wetEvents.length) state.wetEvents = wetEvents;
|
|
@@ -1710,7 +1714,7 @@ async function deserializePaintDocumentAsync(raw, store) {
|
|
|
1710
1714
|
if (!raw || typeof raw !== "object") throw new Error("Not a paint document: expected a JSON object.");
|
|
1711
1715
|
const r = raw;
|
|
1712
1716
|
const problems = [];
|
|
1713
|
-
const assets = await
|
|
1717
|
+
const assets = await _chunkQE7D7TZRcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
|
|
1714
1718
|
const loaded = deserializePaintDocument({ ...r, assets });
|
|
1715
1719
|
return { ...loaded, problems: [...problems, ...loaded.problems] };
|
|
1716
1720
|
}
|
|
@@ -1787,13 +1791,13 @@ function viewPenToDocument(view, p) {
|
|
|
1787
1791
|
|
|
1788
1792
|
// src/paint-editor/input.ts
|
|
1789
1793
|
function samplePressure(e) {
|
|
1790
|
-
return
|
|
1794
|
+
return _chunkKWNMBMKGcjs.pointerPressure.call(void 0, e);
|
|
1791
1795
|
}
|
|
1792
1796
|
function pointerToPenPoint(e, x, y, view) {
|
|
1793
1797
|
const p = { x, y, pressure: samplePressure(e) };
|
|
1794
1798
|
if (typeof e.timeStamp === "number" && Number.isFinite(e.timeStamp)) p.t = e.timeStamp;
|
|
1795
1799
|
if (e.pointerType !== "pen") return p;
|
|
1796
|
-
const o =
|
|
1800
|
+
const o = _chunkROVK6AXXcjs.penOrientation.call(void 0, {
|
|
1797
1801
|
x,
|
|
1798
1802
|
y,
|
|
1799
1803
|
altitude: typeof e.altitudeAngle === "number" ? e.altitudeAngle : void 0,
|
|
@@ -1857,7 +1861,7 @@ function downloadBytes(bytes, fileName, mimeType) {
|
|
|
1857
1861
|
|
|
1858
1862
|
// src/paint-editor/wet.ts
|
|
1859
1863
|
var STROKE_WATER = 0.9;
|
|
1860
|
-
var STROKE_MASS =
|
|
1864
|
+
var STROKE_MASS = _chunkKWNMBMKGcjs.PIGMENT_UNIT * 2.5;
|
|
1861
1865
|
var COVERAGE_STEPS = 4096;
|
|
1862
1866
|
function union2(a, b) {
|
|
1863
1867
|
if (!a) return { ...b };
|
|
@@ -1866,13 +1870,13 @@ function union2(a, b) {
|
|
|
1866
1870
|
return { x, y, width: Math.max(a.x + a.width, b.x + b.width) - x, height: Math.max(a.y + a.height, b.y + b.height) - y };
|
|
1867
1871
|
}
|
|
1868
1872
|
function wetPaperInput(paper) {
|
|
1869
|
-
const grain = new (0,
|
|
1873
|
+
const grain = new (0, _chunkPQ3H2AANcjs.PaperGrain)(paper, "wet");
|
|
1870
1874
|
const flat = grain.flat;
|
|
1871
1875
|
return {
|
|
1872
1876
|
absorption: paper.absorption,
|
|
1873
1877
|
permeability: paper.permeability,
|
|
1874
1878
|
roughness: flat ? 0 : paper.roughness,
|
|
1875
|
-
color:
|
|
1879
|
+
color: _chunkROVK6AXXcjs.hexToRgb8.call(void 0, paper.color),
|
|
1876
1880
|
heightAt: flat ? () => 0.5 : (x, y) => grain.at(x, y)
|
|
1877
1881
|
};
|
|
1878
1882
|
}
|
|
@@ -1880,27 +1884,27 @@ var WetStrokeDriver = (_class5 = class {
|
|
|
1880
1884
|
constructor(init) {;_class5.prototype.__init35.call(this);_class5.prototype.__init36.call(this);_class5.prototype.__init37.call(this);_class5.prototype.__init38.call(this);_class5.prototype.__init39.call(this);_class5.prototype.__init40.call(this);_class5.prototype.__init41.call(this);_class5.prototype.__init42.call(this);_class5.prototype.__init43.call(this);_class5.prototype.__init44.call(this);_class5.prototype.__init45.call(this);_class5.prototype.__init46.call(this);
|
|
1881
1885
|
this.init = init;
|
|
1882
1886
|
const brush = init.brush;
|
|
1883
|
-
this.smoother = new (0,
|
|
1884
|
-
const copies = init.copies.length ? init.copies : [
|
|
1887
|
+
this.smoother = new (0, _chunkROVK6AXXcjs.PenSmoother)(brush.tip.smoothing, brush.pressureSmoothing);
|
|
1888
|
+
const copies = init.copies.length ? init.copies : [_chunkROVK6AXXcjs.IDENTITY_COPY];
|
|
1885
1889
|
const wet = brush.wet;
|
|
1886
1890
|
const spacing = Math.max(0.02, brush.tip.spacing);
|
|
1887
1891
|
const perDab = Math.min(1, spacing * 1.2);
|
|
1888
1892
|
const thin = wet.thinner;
|
|
1889
|
-
this.medium = new (0,
|
|
1893
|
+
this.medium = new (0, _chunkKWNMBMKGcjs.WetMedium)(init.world, init.laneId, {
|
|
1890
1894
|
water: STROKE_WATER * Math.min(1, wet.water * (1 + thin)) * perDab,
|
|
1891
1895
|
mass: STROKE_MASS * wet.pigment * (1 - 0.6 * thin) * perDab,
|
|
1892
1896
|
body: wet.body * (1 - thin)
|
|
1893
1897
|
});
|
|
1894
|
-
const rates =
|
|
1898
|
+
const rates = _chunkPQ3H2AANcjs.exchangeRates.call(void 0, brush.behavior.pickup, brush.behavior.mix, wet.load, brush.behavior.mixing);
|
|
1895
1899
|
this.states = copies.map((c, i) => ({
|
|
1896
|
-
walker: new (0,
|
|
1897
|
-
exchange: wet.tool === "paint" ? new (0,
|
|
1900
|
+
walker: new (0, _chunkROVK6AXXcjs.PenDabWalker)(brush, init.seed + i * 7919 | 0, c.linear),
|
|
1901
|
+
exchange: wet.tool === "paint" ? new (0, _chunkPQ3H2AANcjs.PaintExchange)(rates, init.load) : null,
|
|
1898
1902
|
last: null
|
|
1899
1903
|
}));
|
|
1900
1904
|
this.copies = copies;
|
|
1901
1905
|
this.depth = init.grain && !init.grain.flat ? Math.min(1, Math.max(0, init.paperDepth * brush.grain)) : 0;
|
|
1902
1906
|
const g = _nullishCoalesce(init.paint, () => ( null));
|
|
1903
|
-
this.sampler = g ? new (0,
|
|
1907
|
+
this.sampler = g ? new (0, _chunkPQ3H2AANcjs.PaintGradientSampler)(g.map.by === "across-tip" ? { ...g, map: { by: "distance", length: 300, repeat: "mirror" } } : g, init.seed) : null;
|
|
1904
1908
|
}
|
|
1905
1909
|
|
|
1906
1910
|
__init35() {this.dabCount = 0}
|
|
@@ -1972,7 +1976,7 @@ var WetStrokeDriver = (_class5 = class {
|
|
|
1972
1976
|
}
|
|
1973
1977
|
applyDabs(copy, dabs, rects) {
|
|
1974
1978
|
for (const d of dabs) {
|
|
1975
|
-
const rect =
|
|
1979
|
+
const rect = _chunkPQ3H2AANcjs.dabRect.call(void 0, d, this.init.brush.tip.hardness);
|
|
1976
1980
|
if (rect.width <= 0 || rect.height <= 0) continue;
|
|
1977
1981
|
this.dab(copy, d, rect);
|
|
1978
1982
|
rects.push(rect);
|
|
@@ -1989,7 +1993,7 @@ var WetStrokeDriver = (_class5 = class {
|
|
|
1989
1993
|
const tip = this.tip.subarray(0, n);
|
|
1990
1994
|
const cov = this.cov.subarray(0, n);
|
|
1991
1995
|
tip.fill(0);
|
|
1992
|
-
|
|
1996
|
+
_chunkPQ3H2AANcjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.init.brush.tip.hardness, rect, tip);
|
|
1993
1997
|
const grain = this.depth > 0 ? this.init.grain : null;
|
|
1994
1998
|
const mask = this.init.mask;
|
|
1995
1999
|
for (let yy = 0, k = 0; yy < rect.height; yy++) {
|
|
@@ -2000,7 +2004,7 @@ var WetStrokeDriver = (_class5 = class {
|
|
|
2000
2004
|
tip[k] *= mx >= 0 && my >= 0 && mx < mask.width && my < mask.height ? mask.data[my * mask.width + mx] / 255 : 0;
|
|
2001
2005
|
}
|
|
2002
2006
|
let v = tip[k];
|
|
2003
|
-
if (v > 0 && grain) v *=
|
|
2007
|
+
if (v > 0 && grain) v *= _chunkPQ3H2AANcjs.grainCatch.call(void 0, grain.at(rect.x + xx + 0.5, rect.y + yy + 0.5), this.depth, d.pressure);
|
|
2004
2008
|
tip[k] = Math.round(tip[k] * COVERAGE_STEPS) / COVERAGE_STEPS;
|
|
2005
2009
|
cov[k] = Math.round(v * COVERAGE_STEPS) / COVERAGE_STEPS;
|
|
2006
2010
|
}
|
|
@@ -2078,7 +2082,7 @@ var PaintWetLayers = (_class6 = class {
|
|
|
2078
2082
|
|
|
2079
2083
|
|
|
2080
2084
|
__init47() {this.world = null}
|
|
2081
|
-
__init48() {this.tilt = { ...
|
|
2085
|
+
__init48() {this.tilt = { ..._chunkKWNMBMKGcjs.FLAT }}
|
|
2082
2086
|
__init49() {this.settings = /* @__PURE__ */ new Map()}
|
|
2083
2087
|
__init50() {this.paused = false}
|
|
2084
2088
|
/** Wet strokes dry as soon as they end (one undo step with the stroke). */
|
|
@@ -2102,8 +2106,8 @@ var PaintWetLayers = (_class6 = class {
|
|
|
2102
2106
|
/** Starts the GPU engine for the world (once; it may turn out unavailable). */
|
|
2103
2107
|
startGpu() {
|
|
2104
2108
|
if (this.gpuMode === "off" || this.gpu || this.gpuStarting || this.gpuSupport) return;
|
|
2105
|
-
const provider = this.options.gpuProvider === void 0 ?
|
|
2106
|
-
this.gpuStarting =
|
|
2109
|
+
const provider = this.options.gpuProvider === void 0 ? _chunkKWNMBMKGcjs.findWebGpu.call(void 0, ) : this.options.gpuProvider;
|
|
2110
|
+
this.gpuStarting = _chunkKWNMBMKGcjs.createWetGpuEngine.call(void 0, provider).then(({ engine, support }) => {
|
|
2107
2111
|
this.gpuSupport = support;
|
|
2108
2112
|
if (!engine) return;
|
|
2109
2113
|
if (this.gpuMode === "off" || !this.world) {
|
|
@@ -2159,7 +2163,7 @@ var PaintWetLayers = (_class6 = class {
|
|
|
2159
2163
|
this.dropWorld();
|
|
2160
2164
|
}
|
|
2161
2165
|
if (!this.world) {
|
|
2162
|
-
this.world = new (0,
|
|
2166
|
+
this.world = new (0, _chunkKWNMBMKGcjs.WetWorld)(width, height, wetPaperInput(this.host.paper()), { kernel: this.options.kernel, threads: this.options.threads });
|
|
2163
2167
|
this.world.setTilt(this.tilt);
|
|
2164
2168
|
this.world.gpuMinTiles = this.gpuMinTiles;
|
|
2165
2169
|
if (this.gpu) this.world.attachGpu(this.gpu);
|
|
@@ -2189,7 +2193,7 @@ var PaintWetLayers = (_class6 = class {
|
|
|
2189
2193
|
settingsOf(layerId, medium = "watercolor") {
|
|
2190
2194
|
let s = this.settings.get(layerId);
|
|
2191
2195
|
if (!s) {
|
|
2192
|
-
s = { params:
|
|
2196
|
+
s = { params: _chunkKWNMBMKGcjs.normalizeWetParams.call(void 0, WET_MEDIUM_PARAMS[medium], _chunkKWNMBMKGcjs.DEFAULT_WET_PARAMS), flow: { ..._chunkKWNMBMKGcjs.DEFAULT_FLOW } };
|
|
2193
2197
|
this.settings.set(layerId, s);
|
|
2194
2198
|
}
|
|
2195
2199
|
return s;
|
|
@@ -2198,31 +2202,31 @@ var PaintWetLayers = (_class6 = class {
|
|
|
2198
2202
|
ensureLane(layerId, medium) {
|
|
2199
2203
|
const w = this.ensureWorld();
|
|
2200
2204
|
if (!w.hasLane(layerId)) {
|
|
2201
|
-
const base = _nullishCoalesce(this.host.layerSurface(layerId), () => ( new (0,
|
|
2205
|
+
const base = _nullishCoalesce(this.host.layerSurface(layerId), () => ( new (0, _chunk474IQG74cjs.TiledSurface)(4, /* @__PURE__ */ new Map(), 0)));
|
|
2202
2206
|
const s = this.settingsOf(layerId, medium);
|
|
2203
2207
|
w.ensureLane(layerId, { params: s.params, base });
|
|
2204
2208
|
const { width, height } = this.host.canvas();
|
|
2205
|
-
if (s.flow.kind !== "none") w.setFlow(layerId,
|
|
2209
|
+
if (s.flow.kind !== "none") w.setFlow(layerId, _chunkKWNMBMKGcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
|
|
2206
2210
|
}
|
|
2207
2211
|
return w;
|
|
2208
2212
|
}
|
|
2209
2213
|
setParams(layerId, update) {
|
|
2210
2214
|
const s = this.settingsOf(layerId);
|
|
2211
|
-
s.params =
|
|
2215
|
+
s.params = _chunkKWNMBMKGcjs.normalizeWetParams.call(void 0, update, s.params);
|
|
2212
2216
|
if (_optionalChain([this, 'access', _100 => _100.world, 'optionalAccess', _101 => _101.hasLane, 'call', _102 => _102(layerId)])) this.world.setParams(layerId, s.params);
|
|
2213
2217
|
return { ...s.params };
|
|
2214
2218
|
}
|
|
2215
2219
|
setFlow(layerId, update) {
|
|
2216
2220
|
const s = this.settingsOf(layerId);
|
|
2217
|
-
s.flow =
|
|
2221
|
+
s.flow = _chunkKWNMBMKGcjs.normalizeFlow.call(void 0, update, s.flow);
|
|
2218
2222
|
if (_optionalChain([this, 'access', _103 => _103.world, 'optionalAccess', _104 => _104.hasLane, 'call', _105 => _105(layerId)])) {
|
|
2219
2223
|
const { width, height } = this.host.canvas();
|
|
2220
|
-
this.world.setFlow(layerId,
|
|
2224
|
+
this.world.setFlow(layerId, _chunkKWNMBMKGcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
|
|
2221
2225
|
}
|
|
2222
2226
|
return { ...s.flow };
|
|
2223
2227
|
}
|
|
2224
2228
|
setTilt(update) {
|
|
2225
|
-
this.tilt =
|
|
2229
|
+
this.tilt = _chunkKWNMBMKGcjs.normalizeTilt.call(void 0, update, this.tilt);
|
|
2226
2230
|
_optionalChain([this, 'access', _106 => _106.world, 'optionalAccess', _107 => _107.setTilt, 'call', _108 => _108(this.tilt)]);
|
|
2227
2231
|
return { ...this.tilt };
|
|
2228
2232
|
}
|
|
@@ -2444,10 +2448,10 @@ var PaintWetLayers = (_class6 = class {
|
|
|
2444
2448
|
const w = this.world;
|
|
2445
2449
|
if (!w) return [];
|
|
2446
2450
|
const out = [];
|
|
2447
|
-
const tx0 = Math.max(0, Math.floor(rect.x /
|
|
2448
|
-
const ty0 = Math.max(0, Math.floor(rect.y /
|
|
2449
|
-
const tx1 = Math.floor((rect.x + rect.width - 1) /
|
|
2450
|
-
const ty1 = Math.floor((rect.y + rect.height - 1) /
|
|
2451
|
+
const tx0 = Math.max(0, Math.floor(rect.x / _chunk474IQG74cjs.TILE));
|
|
2452
|
+
const ty0 = Math.max(0, Math.floor(rect.y / _chunk474IQG74cjs.TILE));
|
|
2453
|
+
const tx1 = Math.floor((rect.x + rect.width - 1) / _chunk474IQG74cjs.TILE);
|
|
2454
|
+
const ty1 = Math.floor((rect.y + rect.height - 1) / _chunk474IQG74cjs.TILE);
|
|
2451
2455
|
for (let ty = ty0; ty <= ty1; ty++)
|
|
2452
2456
|
for (let tx = tx0; tx <= tx1; tx++) {
|
|
2453
2457
|
let merged = null;
|
|
@@ -2469,8 +2473,8 @@ var PaintWetLayers = (_class6 = class {
|
|
|
2469
2473
|
}
|
|
2470
2474
|
}, _class6);
|
|
2471
2475
|
function wetPigmentOf(hex, body) {
|
|
2472
|
-
const [r, g, b] =
|
|
2473
|
-
return Array.from(
|
|
2476
|
+
const [r, g, b] = _chunkROVK6AXXcjs.hexToRgb8.call(void 0, hex);
|
|
2477
|
+
return Array.from(_chunkKWNMBMKGcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], body));
|
|
2474
2478
|
}
|
|
2475
2479
|
|
|
2476
2480
|
// src/paint-editor/thumbnails.ts
|
|
@@ -2478,28 +2482,28 @@ var thumbWorld = null;
|
|
|
2478
2482
|
function paintWetTestStroke(brush, paper, color, width, height) {
|
|
2479
2483
|
if (!thumbWorld || thumbWorld.width !== width || thumbWorld.height !== height) {
|
|
2480
2484
|
_optionalChain([thumbWorld, 'optionalAccess', _140 => _140.destroy, 'call', _141 => _141()]);
|
|
2481
|
-
thumbWorld = new (0,
|
|
2485
|
+
thumbWorld = new (0, _chunkKWNMBMKGcjs.WetWorld)(width, height, wetPaperInput(paper), { kernel: "typescript", threads: 0 });
|
|
2482
2486
|
} else thumbWorld.setPaper(wetPaperInput(paper));
|
|
2483
2487
|
const w = thumbWorld;
|
|
2484
2488
|
if (w.hasLane("thumb")) w.removeLane("thumb");
|
|
2485
2489
|
w.ensureLane("thumb");
|
|
2486
|
-
const [r, g, b] =
|
|
2490
|
+
const [r, g, b] = _chunkROVK6AXXcjs.hexToRgb8.call(void 0, color);
|
|
2487
2491
|
if (brush.wet.tool !== "paint" && brush.wet.tool !== "water") {
|
|
2488
2492
|
const half = Math.ceil(height / 2);
|
|
2489
|
-
w.paint("thumb", { x: 0, y: 0, width, height: half }, null, 0.4, Array.from(
|
|
2490
|
-
w.paint("thumb", { x: 0, y: half, width, height: height - half }, null, 0.4, Array.from(
|
|
2493
|
+
w.paint("thumb", { x: 0, y: 0, width, height: half }, null, 0.4, Array.from(_chunkKWNMBMKGcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], 0), (v) => v * 0.05));
|
|
2494
|
+
w.paint("thumb", { x: 0, y: half, width, height: height - half }, null, 0.4, Array.from(_chunkKWNMBMKGcjs.pigmentOf.call(void 0, [232 / 255, 196 / 255, 64 / 255], 0), (v) => v * 0.05));
|
|
2491
2495
|
}
|
|
2492
2496
|
const driver = new WetStrokeDriver({
|
|
2493
2497
|
world: w,
|
|
2494
2498
|
laneId: "thumb",
|
|
2495
2499
|
brush,
|
|
2496
2500
|
color: [r / 255, g / 255, b / 255],
|
|
2497
|
-
load: brushLoadForStroke(brush,
|
|
2501
|
+
load: brushLoadForStroke(brush, _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255]),
|
|
2498
2502
|
grain: paperGrain(paper),
|
|
2499
2503
|
paperDepth: paper.depth,
|
|
2500
|
-
paperColor:
|
|
2504
|
+
paperColor: _chunkROVK6AXXcjs.hexToRgb8.call(void 0, paper.color),
|
|
2501
2505
|
seed: 7,
|
|
2502
|
-
copies: [
|
|
2506
|
+
copies: [_chunkROVK6AXXcjs.IDENTITY_COPY]
|
|
2503
2507
|
});
|
|
2504
2508
|
driver.push(thumbnailStroke(width, height));
|
|
2505
2509
|
driver.finish();
|
|
@@ -2519,7 +2523,7 @@ function thumbnailStroke(width, height) {
|
|
|
2519
2523
|
return pts;
|
|
2520
2524
|
}
|
|
2521
2525
|
function paintTestStroke(surface, brush, paper, color, width, height) {
|
|
2522
|
-
const [r, g, b] =
|
|
2526
|
+
const [r, g, b] = _chunkROVK6AXXcjs.hexToRgb8.call(void 0, color);
|
|
2523
2527
|
let result = surface;
|
|
2524
2528
|
let thick = null;
|
|
2525
2529
|
const session = new PaintStrokeSession(
|
|
@@ -2538,14 +2542,14 @@ function paintTestStroke(surface, brush, paper, color, width, height) {
|
|
|
2538
2542
|
lockTransparency: false,
|
|
2539
2543
|
brush,
|
|
2540
2544
|
color: [r, g, b, 255],
|
|
2541
|
-
background: [...
|
|
2545
|
+
background: [..._chunkROVK6AXXcjs.hexToRgb8.call(void 0, paper.color), 255],
|
|
2542
2546
|
grain: paperGrain(paper),
|
|
2543
2547
|
paperDepth: paper.depth,
|
|
2544
2548
|
seed: 7,
|
|
2545
2549
|
colorHex: color,
|
|
2546
2550
|
affineCopies: [],
|
|
2547
|
-
copies: [
|
|
2548
|
-
mixerLoad: brushLoadForStroke(brush,
|
|
2551
|
+
copies: [_chunkROVK6AXXcjs.IDENTITY_COPY],
|
|
2552
|
+
mixerLoad: brushLoadForStroke(brush, _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255]),
|
|
2549
2553
|
thick: brush.engine === "impasto" ? { channels: emptyThickChannels() } : void 0,
|
|
2550
2554
|
sticker: brush.engine === "sticker" ? { nextId: 1 } : void 0
|
|
2551
2555
|
}
|
|
@@ -2558,16 +2562,16 @@ function renderBrushThumbnail(brush, options) {
|
|
|
2558
2562
|
const width = Math.max(16, Math.min(512, Math.round(_nullishCoalesce(options.width, () => ( 160)))));
|
|
2559
2563
|
const height = Math.max(16, Math.min(512, Math.round(_nullishCoalesce(options.height, () => ( 48)))));
|
|
2560
2564
|
const maxSize = height * 0.42;
|
|
2561
|
-
const b = brush.tip.size > maxSize ?
|
|
2562
|
-
const rgba = [...
|
|
2563
|
-
let surface =
|
|
2565
|
+
const b = brush.tip.size > maxSize ? _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { tip: { ...brush.tip, size: maxSize } }, brush) : brush;
|
|
2566
|
+
const rgba = [..._chunkROVK6AXXcjs.hexToRgb8.call(void 0, options.color), 255];
|
|
2567
|
+
let surface = _chunk474IQG74cjs.emptySurface.call(void 0, 4);
|
|
2564
2568
|
if (b.engine === "eraser") {
|
|
2565
|
-
surface =
|
|
2569
|
+
surface = _chunk474IQG74cjs.fillRect.call(void 0, surface, { x: 0, y: 0, width, height }, rgba);
|
|
2566
2570
|
} else if (b.engine === "wet") {
|
|
2567
2571
|
} else if (b.engine === "blender" || b.engine === "smudge" || b.engine === "mixer" && !b.loadsColor || b.behavior.pickup > 0) {
|
|
2568
2572
|
const half = Math.ceil(height / 2);
|
|
2569
|
-
surface =
|
|
2570
|
-
surface =
|
|
2573
|
+
surface = _chunk474IQG74cjs.fillRect.call(void 0, surface, { x: 0, y: 0, width, height: half }, rgba);
|
|
2574
|
+
surface = _chunk474IQG74cjs.fillRect.call(void 0, surface, { x: 0, y: half, width, height: height - half }, [232, 196, 64, 255]);
|
|
2571
2575
|
}
|
|
2572
2576
|
surface = b.engine === "wet" ? paintWetTestStroke(b, options.paper, options.color, width, height) : paintTestStroke(surface, b, options.paper, options.color, width, height);
|
|
2573
2577
|
const layer = { type: "pixel", id: "thumbnail", name: "thumbnail", visible: true, opacity: 1, blend: "normal", surface, offset: { x: 0, y: 0 } };
|
|
@@ -2811,8 +2815,8 @@ function colorHarmony2(base, kind, options = {}) {
|
|
|
2811
2815
|
function readSwatch(raw) {
|
|
2812
2816
|
if (!raw || typeof raw !== "object") return null;
|
|
2813
2817
|
const r = raw;
|
|
2814
|
-
const g =
|
|
2815
|
-
const color = typeof r.color === "string" && /^#[0-9a-f]{6}$/i.test(r.color) ? r.color.toLowerCase() : _optionalChain([g, 'optionalAccess', _142 => _142.type]) === "gradient" ?
|
|
2818
|
+
const g = _chunkPQ3H2AANcjs.readPaintSource.call(void 0, r.paint);
|
|
2819
|
+
const color = typeof r.color === "string" && /^#[0-9a-f]{6}$/i.test(r.color) ? r.color.toLowerCase() : _optionalChain([g, 'optionalAccess', _142 => _142.type]) === "gradient" ? _chunkPQ3H2AANcjs.paintSourceColor.call(void 0, g) : null;
|
|
2816
2820
|
if (!color) return null;
|
|
2817
2821
|
const out = { color };
|
|
2818
2822
|
if (typeof r.name === "string" && r.name.trim()) out.name = r.name.trim().slice(0, 80);
|
|
@@ -2835,7 +2839,7 @@ var DEFAULT_SWATCHES = [
|
|
|
2835
2839
|
// src/paint-editor/mixing-pad.ts
|
|
2836
2840
|
var MIXING_PAD_WIDTH = 360;
|
|
2837
2841
|
var MIXING_PAD_HEIGHT = 220;
|
|
2838
|
-
var PAD_PAINT =
|
|
2842
|
+
var PAD_PAINT = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, {
|
|
2839
2843
|
id: "pad-paint",
|
|
2840
2844
|
name: "Pad paint",
|
|
2841
2845
|
category: "mixer",
|
|
@@ -2843,7 +2847,7 @@ var PAD_PAINT = _chunkYQ5C5BVKcjs.normalizePaintBrush.call(void 0, {
|
|
|
2843
2847
|
tip: { size: 28, hardness: 0.75, spacing: 0.1, opacity: 1, flow: 0.7, pressureSize: false, pressureOpacity: false },
|
|
2844
2848
|
mixer: { wet: 0.45, load: 1, mix: 0.4, loadEachStroke: true, cleanEachStroke: true, mixing: "pigment" }
|
|
2845
2849
|
});
|
|
2846
|
-
var PAD_KNIFE =
|
|
2850
|
+
var PAD_KNIFE = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, {
|
|
2847
2851
|
id: "pad-knife",
|
|
2848
2852
|
name: "Palette knife",
|
|
2849
2853
|
category: "smudge",
|
|
@@ -2853,7 +2857,7 @@ var PAD_KNIFE = _chunkYQ5C5BVKcjs.normalizePaintBrush.call(void 0, {
|
|
|
2853
2857
|
// A knife drags streaks of paint and folds them into each other, mixing them as pigment.
|
|
2854
2858
|
smudge: { strength: 0.6, length: 0.8, mixing: "pigment" }
|
|
2855
2859
|
});
|
|
2856
|
-
var PAD_BLOB =
|
|
2860
|
+
var PAD_BLOB = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, {
|
|
2857
2861
|
id: "pad-blob",
|
|
2858
2862
|
name: "Pad blob",
|
|
2859
2863
|
category: "custom",
|
|
@@ -2863,7 +2867,7 @@ var PAD_BLOB = _chunkYQ5C5BVKcjs.normalizePaintBrush.call(void 0, {
|
|
|
2863
2867
|
var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.call(this);_class8.prototype.__init66.call(this);_class8.prototype.__init67.call(this);_class8.prototype.__init68.call(this); }
|
|
2864
2868
|
__init65() {this.width = MIXING_PAD_WIDTH}
|
|
2865
2869
|
__init66() {this.height = MIXING_PAD_HEIGHT}
|
|
2866
|
-
__init67() {this.surface =
|
|
2870
|
+
__init67() {this.surface = _chunk474IQG74cjs.emptySurface.call(void 0, 4)}
|
|
2867
2871
|
/** Increments on every change (for redrawing). */
|
|
2868
2872
|
__init68() {this.version = 0}
|
|
2869
2873
|
/** Paints (`paint`, with `color`) or smears (`knife`) through `points` in pad pixels. */
|
|
@@ -2875,12 +2879,12 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
|
|
|
2875
2879
|
}
|
|
2876
2880
|
}
|
|
2877
2881
|
let brush = options.tool === "knife" ? PAD_KNIFE : PAD_PAINT;
|
|
2878
|
-
if (options.size !== void 0) brush =
|
|
2882
|
+
if (options.size !== void 0) brush = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { tip: { ...brush.tip, size: options.size } }, brush);
|
|
2879
2883
|
return this.run(brush, points, options.color);
|
|
2880
2884
|
}
|
|
2881
2885
|
/** Paints `points` with `brush` in `color` on the pad. */
|
|
2882
2886
|
run(brush, points, color) {
|
|
2883
|
-
const [r, g, b] =
|
|
2887
|
+
const [r, g, b] = _chunkROVK6AXXcjs.hexToRgb8.call(void 0, color);
|
|
2884
2888
|
let result = null;
|
|
2885
2889
|
const session = new PaintStrokeSession(
|
|
2886
2890
|
{ update: () => {
|
|
@@ -2898,8 +2902,8 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
|
|
|
2898
2902
|
seed: 1,
|
|
2899
2903
|
colorHex: color,
|
|
2900
2904
|
affineCopies: [],
|
|
2901
|
-
copies: [
|
|
2902
|
-
mixerLoad: brushLoadForStroke(brush,
|
|
2905
|
+
copies: [_chunkROVK6AXXcjs.IDENTITY_COPY],
|
|
2906
|
+
mixerLoad: brushLoadForStroke(brush, _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255])
|
|
2903
2907
|
}
|
|
2904
2908
|
);
|
|
2905
2909
|
session.push(points);
|
|
@@ -2918,7 +2922,7 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
|
|
|
2918
2922
|
const y0 = Math.max(0, Math.floor(y) - r);
|
|
2919
2923
|
const x1 = Math.min(this.width, Math.floor(x) + r + 1);
|
|
2920
2924
|
const y1 = Math.min(this.height, Math.floor(y) + r + 1);
|
|
2921
|
-
const px =
|
|
2925
|
+
const px = _chunk474IQG74cjs.readRegion.call(void 0, this.surface, { x: x0, y: y0, width: x1 - x0, height: y1 - y0 });
|
|
2922
2926
|
let R = 0;
|
|
2923
2927
|
let G = 0;
|
|
2924
2928
|
let B = 0;
|
|
@@ -2935,7 +2939,7 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
|
|
|
2935
2939
|
return `#${hex(R)}${hex(G)}${hex(B)}`;
|
|
2936
2940
|
}
|
|
2937
2941
|
clear() {
|
|
2938
|
-
this.surface =
|
|
2942
|
+
this.surface = _chunk474IQG74cjs.emptySurface.call(void 0, 4);
|
|
2939
2943
|
this.version++;
|
|
2940
2944
|
}
|
|
2941
2945
|
/**
|
|
@@ -2965,7 +2969,7 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
|
|
|
2965
2969
|
throw new Error(`A pile of radius ${R} at (${cx}, ${cy}) does not fit on the ${this.width}\xD7${this.height} pad; move it at least ${R} px from every edge or use a smaller radius.`);
|
|
2966
2970
|
}
|
|
2967
2971
|
const bounds = { x: Math.floor(cx - R), y: Math.floor(cy - R), width: Math.ceil(2 * R), height: Math.ceil(2 * R) };
|
|
2968
|
-
if (options.clear !== false) this.surface =
|
|
2972
|
+
if (options.clear !== false) this.surface = _chunk474IQG74cjs.writeRegion.call(void 0, this.surface, bounds, new Uint8ClampedArray(bounds.width * bounds.height * 4));
|
|
2969
2973
|
const used = paints.filter((p) => p.parts > 0);
|
|
2970
2974
|
const area = Math.PI * (0.7 * R) ** 2;
|
|
2971
2975
|
used.forEach((p, i) => {
|
|
@@ -2974,10 +2978,10 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
|
|
|
2974
2978
|
const off = used.length === 1 ? 0 : 0.45 * R;
|
|
2975
2979
|
const x = Math.min(cx + R - r, Math.max(cx - R + r, cx + Math.cos(a) * off));
|
|
2976
2980
|
const y = Math.min(cy + R - r, Math.max(cy - R + r, cy + Math.sin(a) * off));
|
|
2977
|
-
const blob =
|
|
2981
|
+
const blob = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_BLOB.tip, size: Math.max(2, 2 * r) } }, PAD_BLOB);
|
|
2978
2982
|
this.run(blob, [{ x, y }], p.color.toLowerCase());
|
|
2979
2983
|
});
|
|
2980
|
-
const knife =
|
|
2984
|
+
const knife = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_KNIFE.tip, size: Math.max(12, R * 0.5) } }, PAD_KNIFE);
|
|
2981
2985
|
for (let k = 0; k < passes; k++) {
|
|
2982
2986
|
const stir = [];
|
|
2983
2987
|
const turns = 1.6;
|
|
@@ -2988,26 +2992,26 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
|
|
|
2988
2992
|
}
|
|
2989
2993
|
this.run(knife, stir, "#000000");
|
|
2990
2994
|
}
|
|
2991
|
-
const mixed =
|
|
2992
|
-
paints.map((p) =>
|
|
2995
|
+
const mixed = _chunkOLNIPTB3cjs.mixPigments.call(void 0,
|
|
2996
|
+
paints.map((p) => _chunkROVK6AXXcjs.hexToRgb8.call(void 0, p.color).map((v) => v / 255)),
|
|
2993
2997
|
paints.map((p) => p.parts)
|
|
2994
2998
|
);
|
|
2995
|
-
const core =
|
|
2999
|
+
const core = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { tip: { ...PAD_BLOB.tip, size: R * 1.1, hardness: 0.55 } }, PAD_BLOB);
|
|
2996
3000
|
const hex = "#" + mixed.map((v) => Math.round(v * 255).toString(16).padStart(2, "0")).join("");
|
|
2997
3001
|
this.run(core, [{ x: cx, y: cy }], hex);
|
|
2998
3002
|
return { color: this.pick(cx, cy, 2), bounds };
|
|
2999
3003
|
}
|
|
3000
3004
|
/** The pad's pixels as a PNG data URL (with alpha), for saving. */
|
|
3001
3005
|
toPng() {
|
|
3002
|
-
return
|
|
3006
|
+
return _chunkOLNIPTB3cjs.pngDataUrl.call(void 0, this.width, this.height, _chunk474IQG74cjs.readRegion.call(void 0, this.surface, { x: 0, y: 0, width: this.width, height: this.height }));
|
|
3003
3007
|
}
|
|
3004
3008
|
/** Replaces the pad with a PNG (data URL or base64) of the pad's size, as `toPng` writes. */
|
|
3005
3009
|
fromPng(png) {
|
|
3006
|
-
const bytes = png.startsWith("data:") ? _optionalChain([
|
|
3007
|
-
if (!bytes || !
|
|
3008
|
-
const img =
|
|
3010
|
+
const bytes = png.startsWith("data:") ? _optionalChain([_chunkOLNIPTB3cjs.parseDataUrl.call(void 0, png), 'optionalAccess', _144 => _144.bytes]) : _chunkOLNIPTB3cjs.base64ToBytes.call(void 0, png);
|
|
3011
|
+
if (!bytes || !_chunkOLNIPTB3cjs.isPng.call(void 0, bytes)) throw new Error("The pad image is not a PNG data URL or base64 PNG.");
|
|
3012
|
+
const img = _chunkOLNIPTB3cjs.decodePng.call(void 0, bytes);
|
|
3009
3013
|
if (img.width !== this.width || img.height !== this.height) throw new Error(`The pad image is ${img.width}\xD7${img.height}; a mixing pad is ${this.width}\xD7${this.height}.`);
|
|
3010
|
-
this.surface =
|
|
3014
|
+
this.surface = _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: img.width, height: img.height, data: img.data }, 4);
|
|
3011
3015
|
this.version++;
|
|
3012
3016
|
}
|
|
3013
3017
|
/** Whether nothing is on the pad. */
|
|
@@ -3016,7 +3020,7 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
|
|
|
3016
3020
|
}
|
|
3017
3021
|
/** The pad over white, `width × height` RGBA. */
|
|
3018
3022
|
pixels() {
|
|
3019
|
-
const px =
|
|
3023
|
+
const px = _chunk474IQG74cjs.readRegion.call(void 0, this.surface, { x: 0, y: 0, width: this.width, height: this.height });
|
|
3020
3024
|
for (let i = 0; i < px.length; i += 4) {
|
|
3021
3025
|
const a = px[i + 3] / 255;
|
|
3022
3026
|
px[i] = Math.round(px[i] * a + 255 * (1 - a));
|
|
@@ -3040,7 +3044,7 @@ function replayItems(doc) {
|
|
|
3040
3044
|
}
|
|
3041
3045
|
function emptiedLayers(layers) {
|
|
3042
3046
|
let out = [...layers];
|
|
3043
|
-
for (const l of
|
|
3047
|
+
for (const l of _chunkUOGKSVRQcjs.flattenLayers.call(void 0, layers)) if (l.type === "pixel") out = _chunkUOGKSVRQcjs.mapLayer.call(void 0, out, l.id, () => ({ ...l, surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } }));
|
|
3044
3048
|
return out;
|
|
3045
3049
|
}
|
|
3046
3050
|
async function replayPainting(source, target, options = {}) {
|
|
@@ -3172,7 +3176,7 @@ async function buildTimeLapse(source, target, options = {}) {
|
|
|
3172
3176
|
const f = replayFrame(target, maxSide, stroke);
|
|
3173
3177
|
width = f.width;
|
|
3174
3178
|
height = f.height;
|
|
3175
|
-
frames.push(
|
|
3179
|
+
frames.push(_chunkOLNIPTB3cjs.encodePng.call(void 0, f.width, f.height, f.data));
|
|
3176
3180
|
};
|
|
3177
3181
|
shoot(0);
|
|
3178
3182
|
await replayPainting(source, target, {
|
|
@@ -3316,15 +3320,15 @@ function readPaintEffectSource(raw) {
|
|
|
3316
3320
|
};
|
|
3317
3321
|
}
|
|
3318
3322
|
function paperEffectToJSON(p) {
|
|
3319
|
-
return { ...sourceOut(p), opacity: p.opacity, blend: p.blend, png:
|
|
3323
|
+
return { ...sourceOut(p), opacity: p.opacity, blend: p.blend, png: _chunkOLNIPTB3cjs.pngDataUrl.call(void 0, p.image.width, p.image.height, p.image.data) };
|
|
3320
3324
|
}
|
|
3321
3325
|
function paperEffectFromJSON(raw, width, height) {
|
|
3322
3326
|
const source = readPaintEffectSource(raw);
|
|
3323
3327
|
if (!source) throw new Error("it is not an effect (effect id and values)");
|
|
3324
3328
|
const r = raw;
|
|
3325
|
-
const parsed = typeof r.png === "string" ?
|
|
3329
|
+
const parsed = typeof r.png === "string" ? _chunkOLNIPTB3cjs.parseDataUrl.call(void 0, r.png) : null;
|
|
3326
3330
|
if (!parsed) throw new Error("its pixels are missing");
|
|
3327
|
-
const image =
|
|
3331
|
+
const image = _chunkOLNIPTB3cjs.decodePng.call(void 0, parsed.bytes);
|
|
3328
3332
|
if (image.width !== width || image.height !== height) throw new Error(`its pixels are ${image.width}\xD7${image.height}, not the canvas size ${width}\xD7${height}`);
|
|
3329
3333
|
const opacity = typeof r.opacity === "number" && r.opacity >= 0 && r.opacity <= 1 ? r.opacity : 1;
|
|
3330
3334
|
const blend = PAPER_EFFECT_BLENDS.includes(r.blend) ? r.blend : "multiply";
|
|
@@ -3349,7 +3353,7 @@ function parseColor(value, what = "color") {
|
|
|
3349
3353
|
return value.trim().toLowerCase();
|
|
3350
3354
|
}
|
|
3351
3355
|
function rgbaOf(hex) {
|
|
3352
|
-
const [r, g, b] =
|
|
3356
|
+
const [r, g, b] = _chunkROVK6AXXcjs.hexToRgb8.call(void 0, hex);
|
|
3353
3357
|
return [r, g, b, 255];
|
|
3354
3358
|
}
|
|
3355
3359
|
function rgbToHex(r, g, b) {
|
|
@@ -3377,7 +3381,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3377
3381
|
__init76() {this.secondaryColor = "#ffffff"}
|
|
3378
3382
|
/** Gradient paint chosen with `setPaint` (`null`: the paint colour). */
|
|
3379
3383
|
__init77() {this.gradient = null}
|
|
3380
|
-
__init78() {this.mixerLoad =
|
|
3384
|
+
__init78() {this.mixerLoad = _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD}
|
|
3381
3385
|
__init79() {this.view = { ...DEFAULT_VIEW, pan: { ...DEFAULT_VIEW.pan } }}
|
|
3382
3386
|
|
|
3383
3387
|
|
|
@@ -3418,9 +3422,9 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3418
3422
|
constructor(options = {}) {;_class10.prototype.__init72.call(this);_class10.prototype.__init73.call(this);_class10.prototype.__init74.call(this);_class10.prototype.__init75.call(this);_class10.prototype.__init76.call(this);_class10.prototype.__init77.call(this);_class10.prototype.__init78.call(this);_class10.prototype.__init79.call(this);_class10.prototype.__init80.call(this);_class10.prototype.__init81.call(this);_class10.prototype.__init82.call(this);_class10.prototype.__init83.call(this);_class10.prototype.__init84.call(this);_class10.prototype.__init85.call(this);_class10.prototype.__init86.call(this);_class10.prototype.__init87.call(this);_class10.prototype.__init88.call(this);_class10.prototype.__init89.call(this);_class10.prototype.__init90.call(this);_class10.prototype.__init91.call(this);_class10.prototype.__init92.call(this);_class10.prototype.__init93.call(this);_class10.prototype.__init94.call(this);_class10.prototype.__init95.call(this);_class10.prototype.__init96.call(this);_class10.prototype.__init97.call(this);_class10.prototype.__init98.call(this);_class10.prototype.__init99.call(this);_class10.prototype.__init100.call(this);_class10.prototype.__init101.call(this);_class10.prototype.__init102.call(this);_class10.prototype.__init103.call(this);_class10.prototype.__init104.call(this);_class10.prototype.__init105.call(this);_class10.prototype.__init106.call(this);_class10.prototype.__init107.call(this);_class10.prototype.__init108.call(this);_class10.prototype.__init109.call(this);
|
|
3419
3423
|
this.historyLimit = Math.max(1, _nullishCoalesce(options.historyLimit, () => ( 200)));
|
|
3420
3424
|
this.doc = createPaintDocument({ width: options.width, height: options.height, dpi: options.dpi, paper: this.resolvePaper(options.paper) });
|
|
3421
|
-
this.userBrushes = (_nullishCoalesce(options.brushes, () => ( []))).map((b) =>
|
|
3422
|
-
const start = _nullishCoalesce(this.findBrush(_nullishCoalesce(options.brushId, () => (
|
|
3423
|
-
this.brush =
|
|
3425
|
+
this.userBrushes = (_nullishCoalesce(options.brushes, () => ( []))).map((b) => _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { ...b, builtin: false }));
|
|
3426
|
+
const start = _nullishCoalesce(this.findBrush(_nullishCoalesce(options.brushId, () => ( _chunkROVK6AXXcjs.DEFAULT_BRUSH_ID))), () => ( this.findBrush(_chunkROVK6AXXcjs.DEFAULT_BRUSH_ID)));
|
|
3427
|
+
this.brush = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, start);
|
|
3424
3428
|
this.color = options.color ? parseColor(options.color) : "#1f2937";
|
|
3425
3429
|
this.hand = options.hand === "left" ? "left" : "right";
|
|
3426
3430
|
this.encodeImage = options.encodeImage;
|
|
@@ -3431,12 +3435,12 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3431
3435
|
canvas: () => this.doc.canvas,
|
|
3432
3436
|
paper: () => this.doc.paper,
|
|
3433
3437
|
layerSurface: (id) => {
|
|
3434
|
-
const l = _optionalChain([
|
|
3438
|
+
const l = _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _162 => _162.layer]);
|
|
3435
3439
|
return isPixelLayer(l) ? l.surface : null;
|
|
3436
3440
|
},
|
|
3437
3441
|
updateSurfaces: (surfaces, rects) => {
|
|
3438
3442
|
let layers = this.doc.layers;
|
|
3439
|
-
for (const [id, surface] of surfaces) if (
|
|
3443
|
+
for (const [id, surface] of surfaces) if (_chunkUOGKSVRQcjs.findLayer.call(void 0, layers, id)) layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, layers, id, (l) => ({ ...l, surface }));
|
|
3440
3444
|
this.doc = { ...this.doc, layers };
|
|
3441
3445
|
this.emit(rects.length ? rects : "all");
|
|
3442
3446
|
},
|
|
@@ -3467,7 +3471,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3467
3471
|
this.cached = {
|
|
3468
3472
|
document: this.doc,
|
|
3469
3473
|
brush: this.brush,
|
|
3470
|
-
brushes: this.library ??= [...
|
|
3474
|
+
brushes: this.library ??= [..._chunkROVK6AXXcjs.BUILTIN_BRUSHES, ...this.userBrushes],
|
|
3471
3475
|
color: this.color,
|
|
3472
3476
|
secondaryColor: this.secondaryColor,
|
|
3473
3477
|
paint: _nullishCoalesce(this.gradient, () => ( { type: "color", color: this.color })),
|
|
@@ -3658,7 +3662,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3658
3662
|
// --- Canvas and paper ----------------------------------------------------------
|
|
3659
3663
|
resolvePaper(paper) {
|
|
3660
3664
|
if (typeof paper === "string") {
|
|
3661
|
-
const p =
|
|
3665
|
+
const p = _chunkROVK6AXXcjs.paperPreset.call(void 0, paper);
|
|
3662
3666
|
if (!p) throw new PaintEditorError(`Unknown paper "${paper}". Call list_papers for the ids.`);
|
|
3663
3667
|
return p;
|
|
3664
3668
|
}
|
|
@@ -3751,23 +3755,23 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3751
3755
|
this.requireIdle("changing the paper");
|
|
3752
3756
|
let base = this.doc.paper;
|
|
3753
3757
|
if (update.preset !== void 0 && update.preset !== this.doc.paper.preset) {
|
|
3754
|
-
const p =
|
|
3758
|
+
const p = _chunkROVK6AXXcjs.paperPreset.call(void 0, update.preset);
|
|
3755
3759
|
if (!p) throw new PaintEditorError(`Unknown paper "${update.preset}". Call list_papers for the ids.`);
|
|
3756
3760
|
base = p;
|
|
3757
3761
|
}
|
|
3758
3762
|
const { preset: _p, ...rest } = update;
|
|
3759
3763
|
if (rest.color !== void 0) parseColor(rest.color, "paper color");
|
|
3760
|
-
const paper =
|
|
3764
|
+
const paper = _chunkROVK6AXXcjs.normalizePaper.call(void 0, { ...rest, preset: base.preset, offset: _nullishCoalesce(rest.offset, () => ( this.doc.paper.offset)) }, base);
|
|
3761
3765
|
const changedKeys = Object.keys(rest).filter((k) => k !== "name");
|
|
3762
3766
|
if (changedKeys.length && update.preset === void 0) paper.preset = base.preset;
|
|
3763
3767
|
if (this.wet.world) this.beginWetOp();
|
|
3764
3768
|
this.commit("Paper", { ...this.doc, paper });
|
|
3765
3769
|
this.wet.paperChanged();
|
|
3766
|
-
return
|
|
3770
|
+
return _chunkROVK6AXXcjs.clonePaper.call(void 0, paper);
|
|
3767
3771
|
}
|
|
3768
3772
|
// --- Layers --------------------------------------------------------------------
|
|
3769
3773
|
getLayer(id) {
|
|
3770
|
-
return _optionalChain([
|
|
3774
|
+
return _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _177 => _177.layer]);
|
|
3771
3775
|
}
|
|
3772
3776
|
/** The active pixel layer (or `undefined`). */
|
|
3773
3777
|
getActiveLayer() {
|
|
@@ -3786,12 +3790,12 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3786
3790
|
walk(this.doc.layers, null, 0);
|
|
3787
3791
|
return out;
|
|
3788
3792
|
}
|
|
3789
|
-
describeLayer(l, parentId = _nullishCoalesce(_optionalChain([
|
|
3793
|
+
describeLayer(l, parentId = _nullishCoalesce(_optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _178 => _178.parent, 'optionalAccess', _179 => _179.id]), () => ( null)), depth = _nullishCoalesce(_optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _180 => _180.path, 'access', _181 => _181.length]), () => ( 0))) {
|
|
3790
3794
|
let bounds = null;
|
|
3791
3795
|
if (l.type === "pixel") {
|
|
3792
|
-
const b =
|
|
3796
|
+
const b = _chunk474IQG74cjs.contentBounds.call(void 0, l.surface);
|
|
3793
3797
|
bounds = b ? { ...b, x: b.x + l.offset.x, y: b.y + l.offset.y } : null;
|
|
3794
|
-
} else for (const c of
|
|
3798
|
+
} else for (const c of _chunkUOGKSVRQcjs.flattenLayers.call(void 0, l.children)) if (c.type === "pixel") bounds = unionRect(bounds, this.describeLayer(c, l.id, depth + 1).bounds);
|
|
3795
3799
|
return {
|
|
3796
3800
|
id: l.id,
|
|
3797
3801
|
name: l.name,
|
|
@@ -3818,7 +3822,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3818
3822
|
if (!id) throw new PaintEditorError(`There is no active layer to ${what}; add one with add_layer.`);
|
|
3819
3823
|
const l = this.requireLayer(id);
|
|
3820
3824
|
if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; ${what} a pixel layer inside it.`);
|
|
3821
|
-
if (
|
|
3825
|
+
if (_chunkUOGKSVRQcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it (update_layer locks) before you ${what} it.`);
|
|
3822
3826
|
if (!l.visible) throw new PaintEditorError(`Layer "${l.name}" is hidden; show it (update_layer visible true) before you ${what} it.`);
|
|
3823
3827
|
return l;
|
|
3824
3828
|
}
|
|
@@ -3831,7 +3835,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3831
3835
|
/** Adds an empty pixel layer or group above `aboveId` (default: the active layer) and makes it active. */
|
|
3832
3836
|
addLayer(options = {}) {
|
|
3833
3837
|
this.requireIdle("adding a layer");
|
|
3834
|
-
const count =
|
|
3838
|
+
const count = _chunkUOGKSVRQcjs.flattenLayers.call(void 0, this.doc.layers).length;
|
|
3835
3839
|
const type = _nullishCoalesce(options.type, () => ( "pixel"));
|
|
3836
3840
|
const name = _optionalChain([options, 'access', _182 => _182.name, 'optionalAccess', _183 => _183.trim, 'call', _184 => _184()]) || (type === "group" ? `Group ${count + 1}` : `Layer ${count + 1}`);
|
|
3837
3841
|
const layer = type === "group" ? { type: "group", id: newPaintLayerId(), name, visible: true, opacity: 1, blend: "pass-through", children: [] } : createPaintLayer(name);
|
|
@@ -3843,21 +3847,21 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3843
3847
|
if (g.type !== "group") throw new PaintEditorError(`Layer "${g.name}" is not a group; pass a group id as parentId.`);
|
|
3844
3848
|
parentId = g.id;
|
|
3845
3849
|
} else if (above) {
|
|
3846
|
-
const loc =
|
|
3850
|
+
const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, above);
|
|
3847
3851
|
if (!loc) throw new PaintEditorError(`Unknown layer "${above}". Call list_layers for the ids.`);
|
|
3848
3852
|
parentId = _nullishCoalesce(_optionalChain([loc, 'access', _185 => _185.parent, 'optionalAccess', _186 => _186.id]), () => ( null));
|
|
3849
3853
|
index = loc.index + 1;
|
|
3850
3854
|
}
|
|
3851
|
-
const layers =
|
|
3855
|
+
const layers = _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.doc.layers, layer, parentId, index);
|
|
3852
3856
|
this.commit(type === "group" ? "Add group" : "Add layer", { ...this.doc, layers, activeLayerId: layer.id });
|
|
3853
3857
|
return this.describeLayer(layer);
|
|
3854
3858
|
}
|
|
3855
3859
|
updateLayer(id, update) {
|
|
3856
3860
|
this.requireIdle("changing a layer");
|
|
3857
3861
|
const l = this.requireLayer(id);
|
|
3858
|
-
if (
|
|
3862
|
+
if (_chunkUOGKSVRQcjs.isLayerLocked.call(void 0, l, "all") && Object.keys(update).some((k) => k !== "locks")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it first (locks {all: false}).`);
|
|
3859
3863
|
if (update.opacity !== void 0 && !(update.opacity >= 0 && update.opacity <= 1)) throw new PaintEditorError(`opacity ${update.opacity} is out of range; use 0..1.`);
|
|
3860
|
-
if (update.blend !== void 0 && !
|
|
3864
|
+
if (update.blend !== void 0 && !_chunkOLNIPTB3cjs.isBlendMode.call(void 0, update.blend) && !(l.type === "group" && update.blend === "pass-through")) {
|
|
3861
3865
|
throw new PaintEditorError(`Unknown blend mode "${update.blend}". Call get_canvas_info for the blend modes.`);
|
|
3862
3866
|
}
|
|
3863
3867
|
if (update.name !== void 0 && !update.name.trim()) throw new PaintEditorError("name is empty; give the layer a name.");
|
|
@@ -3871,31 +3875,31 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3871
3875
|
const locks = { ..._nullishCoalesce(l.locks, () => ( {})), ...update.locks };
|
|
3872
3876
|
next.locks = Object.values(locks).some(Boolean) ? locks : void 0;
|
|
3873
3877
|
}
|
|
3874
|
-
this.commit("Layer properties", { ...this.doc, layers:
|
|
3878
|
+
this.commit("Layer properties", { ...this.doc, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, id, () => next) });
|
|
3875
3879
|
return this.describeLayer(next);
|
|
3876
3880
|
}
|
|
3877
3881
|
removeLayer(id) {
|
|
3878
3882
|
this.requireIdle("removing a layer");
|
|
3879
3883
|
const l = this.requireLayer(id);
|
|
3880
|
-
if (
|
|
3881
|
-
const wetIds = this.wet.wetLayerIds().filter((x) => x === id || l.type === "group" &&
|
|
3884
|
+
if (_chunkUOGKSVRQcjs.isLayerLocked.call(void 0, l, "all")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it before removing it.`);
|
|
3885
|
+
const wetIds = this.wet.wetLayerIds().filter((x) => x === id || l.type === "group" && _chunkUOGKSVRQcjs.findLayer.call(void 0, l.children, x));
|
|
3882
3886
|
if (wetIds.length) {
|
|
3883
3887
|
this.beginWetOp();
|
|
3884
3888
|
for (const x of wetIds) this.wet.world.removeLane(x);
|
|
3885
3889
|
}
|
|
3886
|
-
const layers =
|
|
3890
|
+
const layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
|
|
3887
3891
|
let active = this.doc.activeLayerId;
|
|
3888
|
-
if (active && !
|
|
3889
|
-
this.commit("Remove layer", { ...this.doc, layers, activeLayerId: active, ...this.thickWithout(
|
|
3892
|
+
if (active && !_chunkUOGKSVRQcjs.findLayer.call(void 0, layers, active)) active = _nullishCoalesce(_optionalChain([_chunkUOGKSVRQcjs.flattenLayers.call(void 0, layers), 'access', _187 => _187.filter, 'call', _188 => _188((x) => x.type === "pixel"), 'access', _189 => _189.pop, 'call', _190 => _190(), 'optionalAccess', _191 => _191.id]), () => ( null));
|
|
3893
|
+
this.commit("Remove layer", { ...this.doc, layers, activeLayerId: active, ...this.thickWithout(_chunkUOGKSVRQcjs.flattenLayers.call(void 0, [l]).map((x) => x.id)), ...this.stickersWithout(_chunkUOGKSVRQcjs.flattenLayers.call(void 0, [l]).map((x) => x.id)) });
|
|
3890
3894
|
return { removed: id, activeLayerId: active };
|
|
3891
3895
|
}
|
|
3892
3896
|
duplicateLayer(id) {
|
|
3893
3897
|
this.requireIdle("duplicating a layer");
|
|
3894
|
-
if (
|
|
3898
|
+
if (_chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id)) {
|
|
3895
3899
|
const inside = (l) => l.type === "group" ? l.children.flatMap(inside) : [l.id];
|
|
3896
|
-
this.dryLayersFirst(inside(
|
|
3900
|
+
this.dryLayersFirst(inside(_chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id).layer));
|
|
3897
3901
|
}
|
|
3898
|
-
const loc =
|
|
3902
|
+
const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id);
|
|
3899
3903
|
if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
|
|
3900
3904
|
const thick = { ..._nullishCoalesce(this.doc.thick, () => ( {})) };
|
|
3901
3905
|
const stickers = { ..._nullishCoalesce(this.doc.stickers, () => ( {})) };
|
|
@@ -3906,53 +3910,53 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3906
3910
|
return l.type === "group" ? { ...l, id: id2, children: l.children.map(copy) } : { ...l, id: id2 };
|
|
3907
3911
|
};
|
|
3908
3912
|
const dup = { ...copy(loc.layer), name: `${loc.layer.name} copy` };
|
|
3909
|
-
const layers =
|
|
3913
|
+
const layers = _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.doc.layers, dup, _nullishCoalesce(_optionalChain([loc, 'access', _192 => _192.parent, 'optionalAccess', _193 => _193.id]), () => ( null)), loc.index + 1);
|
|
3910
3914
|
this.commit("Duplicate layer", this.withWetEvents({ ...this.doc, layers, activeLayerId: dup.id, ...this.doc.thick ? { thick } : {}, ...this.doc.stickers ? { stickers } : {} }));
|
|
3911
3915
|
return this.describeLayer(dup);
|
|
3912
3916
|
}
|
|
3913
3917
|
/** Moves a layer to `index` (0 = bottom) within `parentId` (default its own parent; `null` = top level). */
|
|
3914
3918
|
moveLayer(id, index, parentId) {
|
|
3915
3919
|
this.requireIdle("moving a layer");
|
|
3916
|
-
const loc =
|
|
3920
|
+
const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id);
|
|
3917
3921
|
if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
|
|
3918
3922
|
const target = parentId === void 0 ? _nullishCoalesce(_optionalChain([loc, 'access', _194 => _194.parent, 'optionalAccess', _195 => _195.id]), () => ( null)) : parentId;
|
|
3919
3923
|
if (target) {
|
|
3920
3924
|
const g = this.requireLayer(target);
|
|
3921
3925
|
if (g.type !== "group") throw new PaintEditorError(`Layer "${g.name}" is not a group; pass a group id as parentId.`);
|
|
3922
|
-
if (target === id || loc.layer.type === "group" &&
|
|
3926
|
+
if (target === id || loc.layer.type === "group" && _chunkUOGKSVRQcjs.findLayer.call(void 0, loc.layer.children, target)) throw new PaintEditorError("A group cannot move into itself.");
|
|
3923
3927
|
}
|
|
3924
|
-
const without =
|
|
3925
|
-
const siblings = target ?
|
|
3928
|
+
const without = _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
|
|
3929
|
+
const siblings = target ? _chunkUOGKSVRQcjs.findLayer.call(void 0, without, target).layer.children : without;
|
|
3926
3930
|
if (!Number.isInteger(index) || index < 0 || index > siblings.length) throw new PaintEditorError(`index ${index} is out of range; use 0..${siblings.length} (0 is the bottom).`);
|
|
3927
|
-
const layers =
|
|
3931
|
+
const layers = _chunkUOGKSVRQcjs.insertLayer.call(void 0, without, loc.layer, target, index);
|
|
3928
3932
|
this.commit("Move layer", { ...this.doc, layers });
|
|
3929
3933
|
return this.describeLayer(loc.layer);
|
|
3930
3934
|
}
|
|
3931
3935
|
/** Merges a pixel layer into the pixel layer below it (keeping the lower one's settings). */
|
|
3932
3936
|
mergeDown(id) {
|
|
3933
3937
|
this.requireIdle("merging");
|
|
3934
|
-
const pre =
|
|
3938
|
+
const pre = _chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id);
|
|
3935
3939
|
if (pre) {
|
|
3936
3940
|
const sib = pre.parent ? pre.parent.children : this.doc.layers;
|
|
3937
3941
|
this.dryLayersFirst([id, _optionalChain([sib, 'access', _196 => _196[pre.index - 1], 'optionalAccess', _197 => _197.id])].filter((x) => Boolean(x)));
|
|
3938
3942
|
}
|
|
3939
|
-
const loc =
|
|
3943
|
+
const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id);
|
|
3940
3944
|
if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
|
|
3941
3945
|
const siblings = loc.parent ? loc.parent.children : this.doc.layers;
|
|
3942
3946
|
const below = siblings[loc.index - 1];
|
|
3943
3947
|
const upper = loc.layer;
|
|
3944
3948
|
if (!isPixelLayer(upper) || !isPixelLayer(below)) throw new PaintEditorError("Merge down needs a pixel layer directly above another pixel layer in the same group.");
|
|
3945
|
-
if (
|
|
3949
|
+
if (_chunkUOGKSVRQcjs.isLayerLocked.call(void 0, below, "pixels")) throw new PaintEditorError(`Layer "${below.name}" has its pixels locked; unlock it to merge into it.`);
|
|
3946
3950
|
const rect = unionRect(this.describeLayer(below).bounds, this.describeLayer(upper).bounds);
|
|
3947
|
-
let surface =
|
|
3951
|
+
let surface = _chunk474IQG74cjs.emptySurface.call(void 0, 4);
|
|
3948
3952
|
if (rect) {
|
|
3949
3953
|
const base = { ...below, opacity: 1, blend: "normal", visible: true, clipped: void 0, mask: void 0 };
|
|
3950
3954
|
const upperLit = this.litLayers([upper])[0];
|
|
3951
3955
|
const px = createPaintCompositor().composite([base, upper.visible ? upperLit : { ...upperLit, opacity: 0 }], rect, this.sources());
|
|
3952
|
-
surface =
|
|
3956
|
+
surface = _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data: px }, 4, rect.x, rect.y);
|
|
3953
3957
|
}
|
|
3954
3958
|
const merged = { ...below, surface, offset: { x: 0, y: 0 } };
|
|
3955
|
-
const layers =
|
|
3959
|
+
const layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, upper.id, () => null), below.id, () => merged);
|
|
3956
3960
|
this.commit("Merge down", this.withWetEvents({ ...this.doc, layers, activeLayerId: below.id, ...this.thickWithout([upper.id]), ...this.stickersWithout([upper.id, below.id]) }));
|
|
3957
3961
|
return this.describeLayer(merged);
|
|
3958
3962
|
}
|
|
@@ -3965,7 +3969,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3965
3969
|
this.wet.world.removeLane(l.id);
|
|
3966
3970
|
}
|
|
3967
3971
|
const bounds = this.describeLayer(l).bounds;
|
|
3968
|
-
this.commit("Clear layer", this.withPaintEvent({ ...this.doc, layers:
|
|
3972
|
+
this.commit("Clear layer", this.withPaintEvent({ ...this.doc, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4) })), ...this.thickWithout([l.id]), ...this.stickersWithout([l.id]) }, { kind: "clear", layerId: l.id }));
|
|
3969
3973
|
return { layerId: l.id, bounds };
|
|
3970
3974
|
}
|
|
3971
3975
|
/**
|
|
@@ -3985,16 +3989,16 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
3985
3989
|
if (!(grainAmount >= 0 && grainAmount <= 1)) throw new PaintEditorError(`grain ${grainAmount} is out of range; use 0..1.`);
|
|
3986
3990
|
const pressure = _nullishCoalesce(options.pressure, () => ( 0.5));
|
|
3987
3991
|
const blend = _nullishCoalesce(options.blend, () => ( "normal"));
|
|
3988
|
-
if (!
|
|
3992
|
+
if (!_chunkOLNIPTB3cjs.isBlendMode.call(void 0, blend)) throw new PaintEditorError(`Unknown blend mode "${blend}".`);
|
|
3989
3993
|
const { width, height } = this.doc.canvas;
|
|
3990
3994
|
const rect = { x: 0, y: 0, width, height };
|
|
3991
|
-
const coverage = new (0,
|
|
3995
|
+
const coverage = new (0, _chunkPQ3H2AANcjs.CoverageMap)();
|
|
3992
3996
|
const depth = grainAmount * this.doc.paper.depth;
|
|
3993
3997
|
const grain = depth > 0 ? paperGrain(this.doc.paper) : null;
|
|
3994
|
-
for (const { tx, ty } of
|
|
3995
|
-
const r = { x: tx *
|
|
3998
|
+
for (const { tx, ty } of _chunk474IQG74cjs.tilesInRect.call(void 0, rect)) {
|
|
3999
|
+
const r = { x: tx * _chunk474IQG74cjs.TILE, y: ty * _chunk474IQG74cjs.TILE, width: Math.min(_chunk474IQG74cjs.TILE, width - tx * _chunk474IQG74cjs.TILE), height: Math.min(_chunk474IQG74cjs.TILE, height - ty * _chunk474IQG74cjs.TILE) };
|
|
3996
4000
|
const vals = new Float32Array(r.width * r.height);
|
|
3997
|
-
for (let y = 0, k = 0; y < r.height; y++) for (let x = 0; x < r.width; x++, k++) vals[k] = grain ?
|
|
4001
|
+
for (let y = 0, k = 0; y < r.height; y++) for (let x = 0; x < r.width; x++, k++) vals[k] = grain ? _chunkPQ3H2AANcjs.grainCatch.call(void 0, grain.at(r.x + x + 0.5, r.y + y + 0.5), depth, pressure) : 1;
|
|
3998
4002
|
coverage.accumulate(r, vals, 1);
|
|
3999
4003
|
}
|
|
4000
4004
|
const apply = {
|
|
@@ -4003,25 +4007,25 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4003
4007
|
background: rgbaOf(this.doc.paper.color),
|
|
4004
4008
|
opacity,
|
|
4005
4009
|
blend,
|
|
4006
|
-
lockTransparency:
|
|
4010
|
+
lockTransparency: _chunkUOGKSVRQcjs.isLayerLocked.call(void 0, l, "transparency"),
|
|
4007
4011
|
selection: null,
|
|
4008
4012
|
offset: l.offset
|
|
4009
4013
|
};
|
|
4010
4014
|
const surface = this.applyCoverage(l, coverage, rect, apply);
|
|
4011
|
-
this.commit("Fill layer", this.withPaintEvent(this.withWetEvents({ ...this.doc, layers:
|
|
4015
|
+
this.commit("Fill layer", this.withPaintEvent(this.withWetEvents({ ...this.doc, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })) }), { kind: "fill", layerId: l.id, data: { color, opacity, grain: grainAmount, pressure, blend } }));
|
|
4012
4016
|
return { layerId: l.id, bounds: rect };
|
|
4013
4017
|
}
|
|
4014
4018
|
applyCoverage(l, coverage, rect, apply) {
|
|
4015
4019
|
const base = l.surface;
|
|
4016
4020
|
const tiles = new Map(base.tiles);
|
|
4017
|
-
for (const { tx, ty } of
|
|
4018
|
-
const key =
|
|
4019
|
-
const src = _nullishCoalesce(_optionalChain([base, 'access', _202 => _202.tiles, 'access', _203 => _203.get, 'call', _204 => _204(key), 'optionalAccess', _205 => _205.data]), () => ( new Uint8ClampedArray(
|
|
4020
|
-
const tile =
|
|
4021
|
+
for (const { tx, ty } of _chunk474IQG74cjs.tilesInRect.call(void 0, { x: rect.x - l.offset.x, y: rect.y - l.offset.y, width: rect.width, height: rect.height })) {
|
|
4022
|
+
const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
|
|
4023
|
+
const src = _nullishCoalesce(_optionalChain([base, 'access', _202 => _202.tiles, 'access', _203 => _203.get, 'call', _204 => _204(key), 'optionalAccess', _205 => _205.data]), () => ( new Uint8ClampedArray(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4)));
|
|
4024
|
+
const tile = _chunk474IQG74cjs.finishTile.call(void 0, _chunkPQ3H2AANcjs.applyStrokeToTile.call(void 0, coverage, src, 4, tx, ty, apply), 4, 0);
|
|
4021
4025
|
if (tile) tiles.set(key, tile);
|
|
4022
4026
|
else tiles.delete(key);
|
|
4023
4027
|
}
|
|
4024
|
-
return new (0,
|
|
4028
|
+
return new (0, _chunk474IQG74cjs.TiledSurface)(4, tiles, 0);
|
|
4025
4029
|
}
|
|
4026
4030
|
// --- Provider effects ------------------------------------------------------------
|
|
4027
4031
|
/** The registered effects provider, or `null`. */
|
|
@@ -4049,7 +4053,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4049
4053
|
}
|
|
4050
4054
|
/** The effect a layer is drawn from, or `undefined` for other layers. */
|
|
4051
4055
|
getEffectLayer(layerId) {
|
|
4052
|
-
return
|
|
4056
|
+
return _chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, layerId) ? _optionalChain([this, 'access', _206 => _206.doc, 'access', _207 => _207.effectLayers, 'optionalAccess', _208 => _208[layerId]]) : void 0;
|
|
4053
4057
|
}
|
|
4054
4058
|
/** The effect paper (without its pixels), or `null`. */
|
|
4055
4059
|
getPaperEffect() {
|
|
@@ -4170,17 +4174,17 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4170
4174
|
this.requireIdle("adding a layer");
|
|
4171
4175
|
this.checkOpacity(options.opacity);
|
|
4172
4176
|
this.checkTime(options.time);
|
|
4173
|
-
if (options.blend !== void 0 && !
|
|
4177
|
+
if (options.blend !== void 0 && !_chunkOLNIPTB3cjs.isBlendMode.call(void 0, options.blend)) throw new PaintEditorError(`Unknown blend mode "${options.blend}". Call get_canvas_info for the blend modes.`);
|
|
4174
4178
|
if (options.aboveId !== void 0) this.requireLayer(options.aboveId);
|
|
4175
4179
|
const d = await this.describeEffect(effect, "layer");
|
|
4176
4180
|
const values = this.effectValues(d, { ...d.defaults }, options.values);
|
|
4177
4181
|
const pixels = await this.renderEffectCanvas(d, values, options.time);
|
|
4178
4182
|
this.requireIdle("adding a layer");
|
|
4179
4183
|
const above = _nullishCoalesce(options.aboveId, () => ( this.doc.activeLayerId));
|
|
4180
|
-
const loc = above ?
|
|
4184
|
+
const loc = above ? _chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, above) : null;
|
|
4181
4185
|
if (options.aboveId !== void 0 && !loc) throw new PaintEditorError(`Layer "${options.aboveId}" was removed while the effect rendered.`);
|
|
4182
|
-
const layer = { ...createPaintLayer(_optionalChain([options, 'access', _215 => _215.name, 'optionalAccess', _216 => _216.trim, 'call', _217 => _217()]) || d.name), surface:
|
|
4183
|
-
const layers =
|
|
4186
|
+
const layer = { ...createPaintLayer(_optionalChain([options, 'access', _215 => _215.name, 'optionalAccess', _216 => _216.trim, 'call', _217 => _217()]) || d.name), surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, pixels, 4), opacity: _nullishCoalesce(options.opacity, () => ( 1)), blend: _nullishCoalesce(options.blend, () => ( "normal")) };
|
|
4187
|
+
const layers = _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.doc.layers, layer, _nullishCoalesce(_optionalChain([loc, 'optionalAccess', _218 => _218.parent, 'optionalAccess', _219 => _219.id]), () => ( null)), loc ? loc.index + 1 : void 0);
|
|
4184
4188
|
const source = this.sourceOf(d, values, options.time);
|
|
4185
4189
|
this.commit("Add effect layer", { ...this.doc, layers, activeLayerId: layer.id, effectLayers: { ..._nullishCoalesce(this.doc.effectLayers, () => ( {})), [layer.id]: source } });
|
|
4186
4190
|
return { layer: this.describeLayer(layer), source };
|
|
@@ -4204,7 +4208,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4204
4208
|
this.requireIdle("changing an effect layer");
|
|
4205
4209
|
if (!isPixelLayer(now)) throw new PaintEditorError(`Layer "${l.name}" was removed while the effect rendered.`);
|
|
4206
4210
|
const source = this.sourceOf(d, values, time);
|
|
4207
|
-
this.commitOrAmend("Effect layer", { ...this.doc, layers:
|
|
4211
|
+
this.commitOrAmend("Effect layer", { ...this.doc, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...now, surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, pixels, 4), offset: { x: 0, y: 0 } })), effectLayers: { ..._nullishCoalesce(this.doc.effectLayers, () => ( {})), [l.id]: source } }, commitToHistory);
|
|
4208
4212
|
return source;
|
|
4209
4213
|
}
|
|
4210
4214
|
/** Turns an effect layer into a plain pixel layer, keeping its pixels (one undo step). */
|
|
@@ -4230,11 +4234,11 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4230
4234
|
const pixels = await this.renderEffectCanvas(d, values, options.time);
|
|
4231
4235
|
const now = this.sameLayerAfterRender(l);
|
|
4232
4236
|
const rect = this.canvasRectOf(now);
|
|
4233
|
-
const before =
|
|
4237
|
+
const before = _chunk474IQG74cjs.readRegion.call(void 0, now.surface, rect);
|
|
4234
4238
|
let after = overPixels(before, pixels.data, _nullishCoalesce(options.opacity, () => ( 1)));
|
|
4235
|
-
if (options.lockTransparency ||
|
|
4236
|
-
const surface =
|
|
4237
|
-
this.commit("Effect fill", { ...this.doc, layers:
|
|
4239
|
+
if (options.lockTransparency || _chunkUOGKSVRQcjs.isLayerLocked.call(void 0, now, "transparency")) after = mixPixels(before, after, 1);
|
|
4240
|
+
const surface = _chunk474IQG74cjs.writeRegion.call(void 0, now.surface, rect, after);
|
|
4241
|
+
this.commit("Effect fill", { ...this.doc, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, now.id, () => ({ ...now, surface })) });
|
|
4238
4242
|
return { layerId: now.id, source: this.sourceOf(d, values, options.time) };
|
|
4239
4243
|
}
|
|
4240
4244
|
/**
|
|
@@ -4249,16 +4253,16 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4249
4253
|
if (!(amount >= 0 && amount <= 1)) throw new PaintEditorError(`amount ${options.amount} is out of range; use 0..1.`);
|
|
4250
4254
|
this.checkTime(options.time);
|
|
4251
4255
|
const l = this.effectTarget(layerId, "light");
|
|
4252
|
-
if (!
|
|
4256
|
+
if (!_chunk474IQG74cjs.contentBounds.call(void 0, l.surface)) throw new PaintEditorError(`Layer "${l.name}" has no paint to light; paint on it first, or add an effect layer (add_effect_layer).`);
|
|
4253
4257
|
const d = await this.describeEffect(effect, "light");
|
|
4254
4258
|
const values = this.effectValues(d, { ...d.defaults }, options.values);
|
|
4255
4259
|
const rect = this.canvasRectOf(l);
|
|
4256
|
-
const before =
|
|
4260
|
+
const before = _chunk474IQG74cjs.readRegion.call(void 0, l.surface, rect);
|
|
4257
4261
|
const inputs = { source: { width: rect.width, height: rect.height, data: before } };
|
|
4258
4262
|
const heightInput = d.inputs.find((i) => i.kind === "image" && /^(height|depth|relief)$/i.test(i.name));
|
|
4259
4263
|
const relief = _optionalChain([this, 'access', _220 => _220.doc, 'access', _221 => _221.thick, 'optionalAccess', _222 => _222[l.id]]);
|
|
4260
4264
|
if (heightInput && relief) {
|
|
4261
|
-
const h =
|
|
4265
|
+
const h = _chunk474IQG74cjs.readRegion.call(void 0, relief.height, rect);
|
|
4262
4266
|
const rgba = new Uint8ClampedArray(rect.width * rect.height * 4);
|
|
4263
4267
|
for (let i = 0; i < h.length; i++) rgba.set([h[i], h[i], h[i], 255], i * 4);
|
|
4264
4268
|
inputs[heightInput.name] = { width: rect.width, height: rect.height, data: rgba };
|
|
@@ -4270,18 +4274,18 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4270
4274
|
}
|
|
4271
4275
|
const out = await this.effectsRenderer.render(this.effects.require(), d.id, { width: rect.width, height: rect.height }, { time: _nullishCoalesce(options.time, () => ( 0)), values, inputs });
|
|
4272
4276
|
const now = this.sameLayerAfterRender(l);
|
|
4273
|
-
const surface =
|
|
4274
|
-
this.commit("Light effect", { ...this.doc, layers:
|
|
4277
|
+
const surface = _chunk474IQG74cjs.writeRegion.call(void 0, now.surface, rect, mixPixels(before, out.data, amount));
|
|
4278
|
+
this.commit("Light effect", { ...this.doc, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, now.id, () => ({ ...now, surface })) });
|
|
4275
4279
|
return { layerId: now.id, source: this.sourceOf(d, values, options.time), amount };
|
|
4276
4280
|
}
|
|
4277
4281
|
// --- Brushes -------------------------------------------------------------------
|
|
4278
4282
|
findBrush(id) {
|
|
4279
|
-
return _nullishCoalesce(
|
|
4283
|
+
return _nullishCoalesce(_chunkROVK6AXXcjs.BUILTIN_BRUSHES.find((b) => b.id === id), () => ( this.userBrushes.find((b) => b.id === id)));
|
|
4280
4284
|
}
|
|
4281
4285
|
/** A library brush by id (`undefined` when unknown). */
|
|
4282
4286
|
getBrush(id) {
|
|
4283
4287
|
const b = this.findBrush(id);
|
|
4284
|
-
return b ?
|
|
4288
|
+
return b ? _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, b, b) : void 0;
|
|
4285
4289
|
}
|
|
4286
4290
|
requireBrush(id) {
|
|
4287
4291
|
const b = this.findBrush(id);
|
|
@@ -4296,7 +4300,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4296
4300
|
const { id, ...changes } = update;
|
|
4297
4301
|
const base = id !== void 0 ? this.requireBrush(id) : this.brush;
|
|
4298
4302
|
if (changes.paint !== void 0 && changes.paint !== null) this.readStrokePaint(changes.paint);
|
|
4299
|
-
const next =
|
|
4303
|
+
const next = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { ...changes, id: base.id }, base);
|
|
4300
4304
|
if (base.builtin && !Object.keys(changes).length) next.builtin = true;
|
|
4301
4305
|
else delete next.builtin;
|
|
4302
4306
|
this.brush = next;
|
|
@@ -4305,10 +4309,10 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4305
4309
|
}
|
|
4306
4310
|
/** Saves the active brush (or `brush`) into the user library under `id` / `name`. */
|
|
4307
4311
|
saveBrush(options) {
|
|
4308
|
-
if (!
|
|
4309
|
-
if (
|
|
4310
|
-
const source = options.brush ?
|
|
4311
|
-
const saved =
|
|
4312
|
+
if (!_chunkROVK6AXXcjs.BRUSH_ID.test(options.id)) throw new PaintEditorError(`Brush id "${options.id}" is invalid; use lowercase letters, digits and dashes (e.g. "my-pencil").`);
|
|
4313
|
+
if (_chunkROVK6AXXcjs.BUILTIN_BRUSHES.some((b) => b.id === options.id)) throw new PaintEditorError(`"${options.id}" is a built-in brush; save under another id.`);
|
|
4314
|
+
const source = options.brush ? _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, options.brush, this.brush) : this.brush;
|
|
4315
|
+
const saved = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { ...source, id: options.id, name: _nullishCoalesce(options.name, () => ( source.name)) });
|
|
4312
4316
|
delete saved.builtin;
|
|
4313
4317
|
const i = this.userBrushes.findIndex((b) => b.id === options.id);
|
|
4314
4318
|
if (i >= 0) this.userBrushes[i] = saved;
|
|
@@ -4318,7 +4322,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4318
4322
|
return saved;
|
|
4319
4323
|
}
|
|
4320
4324
|
removeBrush(id) {
|
|
4321
|
-
if (
|
|
4325
|
+
if (_chunkROVK6AXXcjs.BUILTIN_BRUSHES.some((b) => b.id === id)) throw new PaintEditorError(`"${id}" is a built-in brush and cannot be removed.`);
|
|
4322
4326
|
const i = this.userBrushes.findIndex((b) => b.id === id);
|
|
4323
4327
|
if (i < 0) throw new PaintEditorError(`Unknown brush "${id}". Call list_brushes for the ids.`);
|
|
4324
4328
|
this.userBrushes.splice(i, 1);
|
|
@@ -4327,12 +4331,12 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4327
4331
|
}
|
|
4328
4332
|
/** The user's saved brushes. */
|
|
4329
4333
|
getUserBrushes() {
|
|
4330
|
-
return this.userBrushes.map((b) =>
|
|
4334
|
+
return this.userBrushes.map((b) => _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, b, b));
|
|
4331
4335
|
}
|
|
4332
4336
|
/** A brush library file of the given brushes (default: the user's brushes). */
|
|
4333
4337
|
exportBrushes(ids) {
|
|
4334
4338
|
const list = ids ? ids.map((id) => this.requireBrush(id)) : this.userBrushes;
|
|
4335
|
-
return { format: "pixerate-brushes", version: 1, brushes: list.map(
|
|
4339
|
+
return { format: "pixerate-brushes", version: 1, brushes: list.map(_chunkROVK6AXXcjs.brushToJSON) };
|
|
4336
4340
|
}
|
|
4337
4341
|
/**
|
|
4338
4342
|
* Adds the brushes of a library file to the user library. A brush whose id is taken is skipped
|
|
@@ -4342,14 +4346,14 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4342
4346
|
const problems = [];
|
|
4343
4347
|
let list;
|
|
4344
4348
|
try {
|
|
4345
|
-
list =
|
|
4349
|
+
list = _chunkROVK6AXXcjs.parseBrushLibrary.call(void 0, file, problems);
|
|
4346
4350
|
} catch (e) {
|
|
4347
4351
|
throw new PaintEditorError(e.message);
|
|
4348
4352
|
}
|
|
4349
4353
|
const added = [];
|
|
4350
4354
|
const skipped = [];
|
|
4351
4355
|
for (const b of list) {
|
|
4352
|
-
if (
|
|
4356
|
+
if (_chunkROVK6AXXcjs.BUILTIN_BRUSHES.some((x) => x.id === b.id)) {
|
|
4353
4357
|
skipped.push(b.id);
|
|
4354
4358
|
problems.push(`"${b.id}" is a built-in brush id; rename it to import it.`);
|
|
4355
4359
|
continue;
|
|
@@ -4391,9 +4395,9 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4391
4395
|
setPaint(paint) {
|
|
4392
4396
|
let p;
|
|
4393
4397
|
try {
|
|
4394
|
-
p =
|
|
4398
|
+
p = _chunkPQ3H2AANcjs.parsePaintSource.call(void 0, paint);
|
|
4395
4399
|
} catch (e) {
|
|
4396
|
-
if (e instanceof
|
|
4400
|
+
if (e instanceof _chunkPQ3H2AANcjs.PaintSourceError) throw new PaintEditorError(e.message);
|
|
4397
4401
|
throw e;
|
|
4398
4402
|
}
|
|
4399
4403
|
if (p.type === "color") {
|
|
@@ -4410,19 +4414,19 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4410
4414
|
* brush's gradient, else the editor's gradient paint. Erasers, blenders and smudges take none.
|
|
4411
4415
|
*/
|
|
4412
4416
|
strokeGradient(init, brush, color) {
|
|
4413
|
-
if (!
|
|
4417
|
+
if (!_chunkROVK6AXXcjs.brushTakesPaint.call(void 0, brush)) return null;
|
|
4414
4418
|
let g = null;
|
|
4415
4419
|
if (init.paint !== void 0) {
|
|
4416
4420
|
const p = this.readStrokePaint(init.paint);
|
|
4417
4421
|
g = p.type === "gradient" ? p : null;
|
|
4418
4422
|
} else g = _nullishCoalesce(brush.paint, () => ( (init.color === void 0 ? this.gradient : null)));
|
|
4419
|
-
return g ?
|
|
4423
|
+
return g ? _chunkPQ3H2AANcjs.resolvePaintGradient.call(void 0, g, { paint: color, secondary: this.secondaryColor }) : null;
|
|
4420
4424
|
}
|
|
4421
4425
|
readStrokePaint(raw) {
|
|
4422
4426
|
try {
|
|
4423
|
-
return
|
|
4427
|
+
return _chunkPQ3H2AANcjs.parsePaintSource.call(void 0, raw);
|
|
4424
4428
|
} catch (e) {
|
|
4425
|
-
if (e instanceof
|
|
4429
|
+
if (e instanceof _chunkPQ3H2AANcjs.PaintSourceError) throw new PaintEditorError(e.message);
|
|
4426
4430
|
throw e;
|
|
4427
4431
|
}
|
|
4428
4432
|
}
|
|
@@ -4447,7 +4451,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4447
4451
|
if (options.layerId !== void 0) {
|
|
4448
4452
|
const l = this.requireLayer(options.layerId);
|
|
4449
4453
|
if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; pick from a pixel layer or the composite.`);
|
|
4450
|
-
const [r, g, b, a] =
|
|
4454
|
+
const [r, g, b, a] = _chunk474IQG74cjs.readPixel.call(void 0, l.surface, px - l.offset.x, py - l.offset.y);
|
|
4451
4455
|
return { color: rgbToHex(r, g, b), alpha: Math.round(a / 255 * 1e3) / 1e3 };
|
|
4452
4456
|
}
|
|
4453
4457
|
const d = this.exportCompositor.composite(this.renderLayers({ paper: options.paper }), { x: px, y: py, width: 1, height: 1 }, this.sources());
|
|
@@ -4456,14 +4460,14 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4456
4460
|
// --- Mixer Brush ---------------------------------------------------------------
|
|
4457
4461
|
/** Fills the Mixer Brush reservoir with a colour (default the editor colour). */
|
|
4458
4462
|
loadMixerBrush(color) {
|
|
4459
|
-
const [r, g, b] =
|
|
4460
|
-
this.mixerLoad =
|
|
4463
|
+
const [r, g, b] = _chunkROVK6AXXcjs.hexToRgb8.call(void 0, color === void 0 ? this.color : parseColor(color));
|
|
4464
|
+
this.mixerLoad = _chunkPQ3H2AANcjs.loadMixer.call(void 0, this.mixerLoad, [r / 255, g / 255, b / 255]);
|
|
4461
4465
|
this.emit([]);
|
|
4462
4466
|
return this.mixerLoad;
|
|
4463
4467
|
}
|
|
4464
4468
|
/** Empties the pickup well (and with `emptyReservoir` the loaded paint too). */
|
|
4465
4469
|
cleanMixerBrush(emptyReservoir = false) {
|
|
4466
|
-
this.mixerLoad = emptyReservoir ?
|
|
4470
|
+
this.mixerLoad = emptyReservoir ? _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD : _chunkPQ3H2AANcjs.cleanMixer.call(void 0, this.mixerLoad);
|
|
4467
4471
|
this.emit([]);
|
|
4468
4472
|
return this.mixerLoad;
|
|
4469
4473
|
}
|
|
@@ -4486,7 +4490,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4486
4490
|
// --- Strokes -------------------------------------------------------------------
|
|
4487
4491
|
strokeBrush(init) {
|
|
4488
4492
|
let brush = init.brushId !== void 0 ? this.requireBrush(init.brushId) : this.brush;
|
|
4489
|
-
if (init.brush) brush =
|
|
4493
|
+
if (init.brush) brush = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { ...init.brush, id: brush.id }, brush);
|
|
4490
4494
|
return brush;
|
|
4491
4495
|
}
|
|
4492
4496
|
/**
|
|
@@ -4510,41 +4514,41 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4510
4514
|
let layer = (() => {
|
|
4511
4515
|
const id = _nullishCoalesce(init.layerId, () => ( doc.activeLayerId));
|
|
4512
4516
|
if (!id) throw new PaintEditorError("There is no active layer to paint on; add one with add_layer.");
|
|
4513
|
-
const loc =
|
|
4517
|
+
const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, doc.layers, id);
|
|
4514
4518
|
if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
|
|
4515
4519
|
const l = loc.layer;
|
|
4516
4520
|
if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; paint on a pixel layer inside it.`);
|
|
4517
|
-
if (
|
|
4521
|
+
if (_chunkUOGKSVRQcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it (update_layer locks) to paint on it.`);
|
|
4518
4522
|
if (!l.visible) throw new PaintEditorError(`Layer "${l.name}" is hidden; show it (update_layer visible true) to paint on it.`);
|
|
4519
4523
|
return l;
|
|
4520
4524
|
})();
|
|
4521
4525
|
const brush = this.strokeBrush(init);
|
|
4522
4526
|
const stickerLayer = Boolean(_optionalChain([doc, 'access', _228 => _228.stickers, 'optionalAccess', _229 => _229[layer.id], 'optionalAccess', _230 => _230.length]));
|
|
4523
4527
|
if (brush.engine === "sticker") {
|
|
4524
|
-
if (!stickerLayer &&
|
|
4528
|
+
if (!stickerLayer && _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface)) throw new PaintEditorError(`Layer "${layer.name}" already has paint; spray stickers onto an empty layer (add_layer) so they stay editable.`);
|
|
4525
4529
|
} else if (stickerLayer) {
|
|
4526
4530
|
throw new PaintEditorError(`Layer "${layer.name}" is a sticker layer (its pixels are drawn from its stickers); paint on another layer (add_layer).`);
|
|
4527
4531
|
}
|
|
4528
4532
|
let wet;
|
|
4529
|
-
if (
|
|
4533
|
+
if (_chunkROVK6AXXcjs.isWetBrush.call(void 0, brush)) {
|
|
4530
4534
|
this.requireWetIdle("painting");
|
|
4531
4535
|
if (layer.offset.x || layer.offset.y) {
|
|
4532
|
-
const moved = { ...layer, surface:
|
|
4533
|
-
this.doc = { ...this.doc, layers:
|
|
4534
|
-
if (doc !== this.doc) doc = { ...doc, layers:
|
|
4536
|
+
const moved = { ...layer, surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, layer.offset.x, layer.offset.y), offset: { x: 0, y: 0 } };
|
|
4537
|
+
this.doc = { ...this.doc, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => moved) };
|
|
4538
|
+
if (doc !== this.doc) doc = { ...doc, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, doc.layers, layer.id, () => moved) };
|
|
4535
4539
|
layer = moved;
|
|
4536
4540
|
}
|
|
4537
|
-
if (!this.wet.wetLayerIds().includes(layer.id) && this.wet.wetLayerIds().length >=
|
|
4538
|
-
throw new PaintEditorError(`At most ${
|
|
4541
|
+
if (!this.wet.wetLayerIds().includes(layer.id) && this.wet.wetLayerIds().length >= _chunkKWNMBMKGcjs.MAX_WET_LANES) {
|
|
4542
|
+
throw new PaintEditorError(`At most ${_chunkKWNMBMKGcjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
|
|
4539
4543
|
}
|
|
4540
4544
|
this.beginWetOp();
|
|
4541
4545
|
const world = this.wet.ensureLane(layer.id, brush.wet.medium);
|
|
4542
4546
|
const id = layer.id;
|
|
4543
4547
|
const wetColor = init.color === void 0 ? this.color : parseColor(init.color);
|
|
4544
|
-
const [r, g, b] =
|
|
4548
|
+
const [r, g, b] = _chunkROVK6AXXcjs.hexToRgb8.call(void 0, wetColor);
|
|
4545
4549
|
const wetGradient = this.strokeGradient(init, brush, wetColor);
|
|
4546
4550
|
const load = _nullishCoalesce(init.load, () => ( brushLoadForStroke(brush, this.mixerLoad, [r / 255, g / 255, b / 255])));
|
|
4547
|
-
const seedW = _nullishCoalesce(init.seed, () => (
|
|
4551
|
+
const seedW = _nullishCoalesce(init.seed, () => ( _chunkPQ3H2AANcjs.mix32.call(void 0, this.seedCounter * 2654435761 >>> 0) & 2147483647));
|
|
4548
4552
|
const copiesW = (_nullishCoalesce(init.copies, () => ( this.strokeCopies()))).filter((m) => m.some((v, i) => v !== IDENTITY_AFFINE[i]));
|
|
4549
4553
|
const driver = new WetStrokeDriver({
|
|
4550
4554
|
world,
|
|
@@ -4554,7 +4558,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4554
4558
|
load,
|
|
4555
4559
|
grain: paperGrain(doc.paper),
|
|
4556
4560
|
paperDepth: doc.paper.depth,
|
|
4557
|
-
paperColor:
|
|
4561
|
+
paperColor: _chunkROVK6AXXcjs.hexToRgb8.call(void 0, doc.paper.color),
|
|
4558
4562
|
seed: seedW,
|
|
4559
4563
|
copies: [IDENTITY_AFFINE, ...copiesW].map(affineCopy),
|
|
4560
4564
|
mask: init.maskStencils ? this.stencilSelection(init.maskStencils) : init.stencils !== false ? this.stencilSelection() : null,
|
|
@@ -4564,7 +4568,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4564
4568
|
wet = { driver, surface: () => world.display(id).surface };
|
|
4565
4569
|
} else if (this.wet.wetLayerIds().includes(layer.id)) {
|
|
4566
4570
|
this.dryLayersFirst([layer.id]);
|
|
4567
|
-
const dried =
|
|
4571
|
+
const dried = _chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, layer.id).layer;
|
|
4568
4572
|
layer = dried;
|
|
4569
4573
|
}
|
|
4570
4574
|
let color = init.color === void 0 ? this.color : parseColor(init.color);
|
|
@@ -4577,13 +4581,13 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4577
4581
|
const selection = init.maskStencils ? this.stencilSelection(init.maskStencils) : useStencils ? this.stencilSelection() : null;
|
|
4578
4582
|
const inputFilter = snapper || stencilSnapper ? (p) => stencilSnapper ? stencilSnapper.snap(snapper ? snapper.snap(p) : p) : snapper.snap(p) : void 0;
|
|
4579
4583
|
const rgba = rgbaOf(color);
|
|
4580
|
-
const seed = _nullishCoalesce(init.seed, () => (
|
|
4584
|
+
const seed = _nullishCoalesce(init.seed, () => ( _chunkPQ3H2AANcjs.mix32.call(void 0, this.seedCounter++ * 2654435761 >>> 0) & 2147483647));
|
|
4581
4585
|
const copies = (_nullishCoalesce(init.copies, () => ( this.strokeCopies()))).filter((m) => m.some((v, i) => v !== IDENTITY_AFFINE[i]));
|
|
4582
4586
|
const session = new PaintStrokeSession(host, {
|
|
4583
4587
|
layerId: layer.id,
|
|
4584
4588
|
surface: layer.surface,
|
|
4585
4589
|
offset: layer.offset,
|
|
4586
|
-
lockTransparency:
|
|
4590
|
+
lockTransparency: _chunkUOGKSVRQcjs.isLayerLocked.call(void 0, layer, "transparency"),
|
|
4587
4591
|
brush,
|
|
4588
4592
|
color: rgba,
|
|
4589
4593
|
background: rgbaOf(doc.paper.color),
|
|
@@ -4611,7 +4615,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4611
4615
|
const stroke = {
|
|
4612
4616
|
id: `s${this.strokeCounter++}`,
|
|
4613
4617
|
layerId: session.layerId,
|
|
4614
|
-
brush:
|
|
4618
|
+
brush: _chunkROVK6AXXcjs.brushToJSON.call(void 0, init.brush),
|
|
4615
4619
|
color: init.colorHex,
|
|
4616
4620
|
points: session.points.map((p) => ({ ...p })),
|
|
4617
4621
|
seed: init.seed
|
|
@@ -4678,7 +4682,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4678
4682
|
const thick = ch ? { ..._nullishCoalesce(this.doc.thick, () => ( {})), [l.id]: ch } : this.doc.thick;
|
|
4679
4683
|
const sprayed = s.stickers();
|
|
4680
4684
|
const stickers = sprayed ? { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [l.id]: [..._nullishCoalesce(_optionalChain([this, 'access', _242 => _242.doc, 'access', _243 => _243.stickers, 'optionalAccess', _244 => _244[l.id]]), () => ( [])), ...sprayed] } : this.doc.stickers;
|
|
4681
|
-
this.commit(`${brush.name} stroke`, this.withWetEvents({ ...this.doc, layers:
|
|
4685
|
+
this.commit(`${brush.name} stroke`, this.withWetEvents({ ...this.doc, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })), strokes: [...this.doc.strokes, stroke], ...thick ? { thick } : {}, ...stickers ? { stickers } : {} }), wetStroke ? before : this.doc);
|
|
4682
4686
|
}
|
|
4683
4687
|
};
|
|
4684
4688
|
let session;
|
|
@@ -4706,13 +4710,13 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4706
4710
|
if (cancelled || !surface) return;
|
|
4707
4711
|
const stroke = this.record(s);
|
|
4708
4712
|
s.result.strokeId = stroke.id;
|
|
4709
|
-
const l =
|
|
4713
|
+
const l = _chunkUOGKSVRQcjs.findLayer.call(void 0, out.layers, s.layerId).layer;
|
|
4710
4714
|
const offset = s.init.wet ? { x: 0, y: 0 } : l.offset;
|
|
4711
4715
|
const ch = s.thickChannels();
|
|
4712
4716
|
const sprayed = s.stickers();
|
|
4713
4717
|
out = {
|
|
4714
4718
|
...out,
|
|
4715
|
-
layers:
|
|
4719
|
+
layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, out.layers, l.id, () => ({ ...l, surface, offset })),
|
|
4716
4720
|
strokes: [...out.strokes, stroke],
|
|
4717
4721
|
...ch ? { thick: { ..._nullishCoalesce(out.thick, () => ( {})), [l.id]: ch } } : {},
|
|
4718
4722
|
...sprayed ? { stickers: { ..._nullishCoalesce(out.stickers, () => ( {})), [l.id]: [..._nullishCoalesce(_optionalChain([out, 'access', _245 => _245.stickers, 'optionalAccess', _246 => _246[l.id]]), () => ( [])), ...sprayed] } } : {}
|
|
@@ -4727,8 +4731,8 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4727
4731
|
if (this.wet.instantDry && result.strokeId) {
|
|
4728
4732
|
this.wet.dry(session.layerId);
|
|
4729
4733
|
this.logWet({ kind: "dry", layerId: session.layerId, at: out.strokes.length });
|
|
4730
|
-
const dried =
|
|
4731
|
-
out = { ...out, layers:
|
|
4734
|
+
const dried = _chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, session.layerId).layer.surface;
|
|
4735
|
+
out = { ...out, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, out.layers, session.layerId, (l) => ({ ...l, surface: dried })) };
|
|
4732
4736
|
}
|
|
4733
4737
|
result.wet = this.wet.isWet(session.layerId);
|
|
4734
4738
|
}
|
|
@@ -4803,13 +4807,13 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4803
4807
|
let brush = v.brush;
|
|
4804
4808
|
if (options.brushId !== void 0) {
|
|
4805
4809
|
const b = this.requireBrush(options.brushId);
|
|
4806
|
-
brush =
|
|
4810
|
+
brush = _chunkROVK6AXXcjs.normalizePaintBrush.call(void 0, { tip: { ...b.tip, size: b.tip.size * (v.brush.tip.size / s.brush.tip.size) } }, b);
|
|
4807
4811
|
}
|
|
4808
4812
|
const layerId = _nullishCoalesce(options.layerId, () => ( s.layerId));
|
|
4809
|
-
if (!
|
|
4813
|
+
if (!_chunkUOGKSVRQcjs.findLayer.call(void 0, doc.layers, layerId)) throw new PaintEditorError(`Stroke "${s.id}" was painted on layer "${layerId}", which no longer exists; pass layerId to replay it elsewhere.`);
|
|
4810
4814
|
let load = s.load;
|
|
4811
4815
|
if (load && options.color !== void 0 && load.reservoir) {
|
|
4812
|
-
const [r, g, b] =
|
|
4816
|
+
const [r, g, b] = _chunkROVK6AXXcjs.hexToRgb8.call(void 0, options.color);
|
|
4813
4817
|
load = { ...load, reservoir: [r / 255, g / 255, b / 255] };
|
|
4814
4818
|
}
|
|
4815
4819
|
const paint = v.paint && options.color === void 0 ? { paint: v.paint } : {};
|
|
@@ -4902,7 +4906,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4902
4906
|
/** `renderHighRes` as PNG bytes. */
|
|
4903
4907
|
async exportHighResPng(options) {
|
|
4904
4908
|
const img = await this.renderHighRes(options);
|
|
4905
|
-
return
|
|
4909
|
+
return _chunkOLNIPTB3cjs.encodePng.call(void 0, img.width, img.height, img.data);
|
|
4906
4910
|
}
|
|
4907
4911
|
async renderHighRes(options) {
|
|
4908
4912
|
const target = this.createReplayTarget(options.scale);
|
|
@@ -4954,7 +4958,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
4954
4958
|
wetState() {
|
|
4955
4959
|
const st = this.getState().wet;
|
|
4956
4960
|
const backend = this.wet.backend();
|
|
4957
|
-
return { ...st, layers: this.wet.wetLayerIds().map((id) => this.wet.info(id)), backend, message: _nullishCoalesce(_optionalChain([backend, 'optionalAccess', _252 => _252.message]), () => (
|
|
4961
|
+
return { ...st, layers: this.wet.wetLayerIds().map((id) => this.wet.info(id)), backend, message: _nullishCoalesce(_optionalChain([backend, 'optionalAccess', _252 => _252.message]), () => ( _chunkKWNMBMKGcjs.wetSupport.call(void 0, ).message)), engine: this.wet.engineInfo() };
|
|
4958
4962
|
}
|
|
4959
4963
|
/**
|
|
4960
4964
|
* Engine B, the WebGPU accelerator for large wet areas: whether it may run, its state (`off`,
|
|
@@ -5023,11 +5027,11 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5023
5027
|
wetPaper(options = {}) {
|
|
5024
5028
|
this.requireIdle("wetting the paper");
|
|
5025
5029
|
const l = this.wetLayer(options.layerId, "wet the paper of");
|
|
5026
|
-
if (
|
|
5030
|
+
if (_chunkUOGKSVRQcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it first.`);
|
|
5027
5031
|
const amount = _nullishCoalesce(options.amount, () => ( 1));
|
|
5028
5032
|
if (!(amount > 0 && amount <= 1)) throw new PaintEditorError(`amount ${amount} is out of range; use above 0 up to 1.`);
|
|
5029
5033
|
const rect = _nullishCoalesce(this.checkRect(options.rect), () => ( { x: 0, y: 0, width: this.doc.canvas.width, height: this.doc.canvas.height }));
|
|
5030
|
-
if (!this.wet.wetLayerIds().includes(l.id) && this.wet.wetLayerIds().length >=
|
|
5034
|
+
if (!this.wet.wetLayerIds().includes(l.id) && this.wet.wetLayerIds().length >= _chunkKWNMBMKGcjs.MAX_WET_LANES) throw new PaintEditorError(`At most ${_chunkKWNMBMKGcjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
|
|
5031
5035
|
const before = this.doc;
|
|
5032
5036
|
this.beginWetOp();
|
|
5033
5037
|
const world = this.wet.ensureLane(l.id);
|
|
@@ -5107,7 +5111,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5107
5111
|
const live = this.live;
|
|
5108
5112
|
if (!live) return this.doc.layers;
|
|
5109
5113
|
if (_optionalChain([this, 'access', _256 => _256.liveLayers, 'optionalAccess', _257 => _257.key]) === live.surface) return this.liveLayers.layers;
|
|
5110
|
-
const layers =
|
|
5114
|
+
const layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, live.layerId, (l) => ({ ...l, surface: live.surface }));
|
|
5111
5115
|
this.liveLayers = { key: live.surface, layers };
|
|
5112
5116
|
return layers;
|
|
5113
5117
|
}
|
|
@@ -5144,7 +5148,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5144
5148
|
let out = layers;
|
|
5145
5149
|
for (const id of ids) {
|
|
5146
5150
|
const baked = this.wet.bakedSurface(id);
|
|
5147
|
-
if (baked &&
|
|
5151
|
+
if (baked && _chunkUOGKSVRQcjs.findLayer.call(void 0, out, id)) out = _chunkUOGKSVRQcjs.mapLayer.call(void 0, out, id, (l) => ({ ...l, surface: baked }));
|
|
5148
5152
|
}
|
|
5149
5153
|
return out;
|
|
5150
5154
|
}
|
|
@@ -5157,12 +5161,12 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5157
5161
|
const ids = /* @__PURE__ */ new Set([...Object.keys(_nullishCoalesce(thick, () => ( {}))), ...live ? [live.layerId] : []]);
|
|
5158
5162
|
for (const id of ids) {
|
|
5159
5163
|
const ch = _optionalChain([live, 'optionalAccess', _260 => _260.layerId]) === id ? live.channels : _optionalChain([thick, 'optionalAccess', _261 => _261[id]]);
|
|
5160
|
-
const l = ch && _optionalChain([
|
|
5164
|
+
const l = ch && _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, out, id), 'optionalAccess', _262 => _262.layer]);
|
|
5161
5165
|
if (!ch || !isPixelLayer(l)) continue;
|
|
5162
5166
|
let cache = this.litCaches.get(id);
|
|
5163
5167
|
if (!cache) this.litCaches.set(id, cache = new LitCache());
|
|
5164
5168
|
const lit = cache.lit(l.surface, ch, this.lighting);
|
|
5165
|
-
if (lit !== l.surface) out =
|
|
5169
|
+
if (lit !== l.surface) out = _chunkUOGKSVRQcjs.mapLayer.call(void 0, out, id, () => ({ ...l, surface: lit }));
|
|
5166
5170
|
}
|
|
5167
5171
|
return out;
|
|
5168
5172
|
}
|
|
@@ -5170,7 +5174,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5170
5174
|
let layers = this.litLayers((_nullishCoalesce(options.wet, () => ( "display"))) === "dried" ? this.driedLayers() : this.currentLayers());
|
|
5171
5175
|
if (options.layerIds) {
|
|
5172
5176
|
const picked = [];
|
|
5173
|
-
for (const id of options.layerIds) picked.push(_nullishCoalesce(_optionalChain([
|
|
5177
|
+
for (const id of options.layerIds) picked.push(_nullishCoalesce(_optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _263 => _263.layer]), () => ( this.requireLayer(id))));
|
|
5174
5178
|
layers = picked.map((l) => ({ ...l, visible: true }));
|
|
5175
5179
|
}
|
|
5176
5180
|
const under = options.paper === false ? [] : [paperNode(this.doc.paper, this.lighting)];
|
|
@@ -5214,7 +5218,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5214
5218
|
/** Wet settings saved with the document (`null` when they are all defaults). */
|
|
5215
5219
|
wetJSON() {
|
|
5216
5220
|
const layers = {};
|
|
5217
|
-
for (const [id, set] of this.wet.settings) if (
|
|
5221
|
+
for (const [id, set] of this.wet.settings) if (_chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id)) layers[id] = { params: { ...set.params }, flow: { ...set.flow } };
|
|
5218
5222
|
const flat = this.wet.tilt.angle === 0;
|
|
5219
5223
|
if (!Object.keys(layers).length && flat) return void 0;
|
|
5220
5224
|
return { tilt: { ...this.wet.tilt }, layers };
|
|
@@ -5223,7 +5227,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5223
5227
|
this.wet.reset();
|
|
5224
5228
|
if (!raw || typeof raw !== "object") return;
|
|
5225
5229
|
const r = raw;
|
|
5226
|
-
this.wet.setTilt(
|
|
5230
|
+
this.wet.setTilt(_chunkKWNMBMKGcjs.normalizeTilt.call(void 0, _nullishCoalesce(r.tilt, () => ( {}))));
|
|
5227
5231
|
if (r.layers && typeof r.layers === "object") {
|
|
5228
5232
|
for (const [id, v] of Object.entries(r.layers)) {
|
|
5229
5233
|
if (!v || typeof v !== "object") {
|
|
@@ -5231,7 +5235,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5231
5235
|
continue;
|
|
5232
5236
|
}
|
|
5233
5237
|
const x = v;
|
|
5234
|
-
this.wet.settings.set(id, { params:
|
|
5238
|
+
this.wet.settings.set(id, { params: _chunkKWNMBMKGcjs.normalizeWetParams.call(void 0, _nullishCoalesce(x.params, () => ( {}))), flow: _chunkKWNMBMKGcjs.normalizeFlow.call(void 0, _nullishCoalesce(x.flow, () => ( {}))) });
|
|
5235
5239
|
}
|
|
5236
5240
|
}
|
|
5237
5241
|
}
|
|
@@ -5240,17 +5244,17 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5240
5244
|
const ext = { ...this.extensions };
|
|
5241
5245
|
const channels = {};
|
|
5242
5246
|
for (const [id, ch] of Object.entries(_nullishCoalesce(this.doc.thick, () => ( {})))) {
|
|
5243
|
-
if (!
|
|
5247
|
+
if (!_chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id)) continue;
|
|
5244
5248
|
const saved = thickToJSON(ch);
|
|
5245
5249
|
if (saved) channels[id] = saved;
|
|
5246
5250
|
}
|
|
5247
5251
|
if (Object.keys(channels).length) ext.layerChannels = channels;
|
|
5248
5252
|
else delete ext.layerChannels;
|
|
5249
5253
|
const stickers = {};
|
|
5250
|
-
for (const [id, list] of Object.entries(_nullishCoalesce(this.doc.stickers, () => ( {})))) if (list.length &&
|
|
5254
|
+
for (const [id, list] of Object.entries(_nullishCoalesce(this.doc.stickers, () => ( {})))) if (list.length && _chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id)) stickers[id] = list.map((x) => ({ ...x }));
|
|
5251
5255
|
if (Object.keys(stickers).length) ext.stickers = stickers;
|
|
5252
5256
|
else delete ext.stickers;
|
|
5253
|
-
const effectLayers = effectLayersToJSON(_nullishCoalesce(this.doc.effectLayers, () => ( {})), (id) => isPixelLayer(_optionalChain([
|
|
5257
|
+
const effectLayers = effectLayersToJSON(_nullishCoalesce(this.doc.effectLayers, () => ( {})), (id) => isPixelLayer(_optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _266 => _266.layer])));
|
|
5254
5258
|
if (effectLayers) ext.effectLayers = effectLayers;
|
|
5255
5259
|
else delete ext.effectLayers;
|
|
5256
5260
|
if (this.doc.paperEffect) ext.paperEffect = paperEffectToJSON(this.doc.paperEffect);
|
|
@@ -5266,8 +5270,8 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5266
5270
|
if (ext.stickers && typeof ext.stickers === "object") {
|
|
5267
5271
|
const stickers = {};
|
|
5268
5272
|
for (const [id, list] of Object.entries(ext.stickers)) {
|
|
5269
|
-
if (!
|
|
5270
|
-
const ok = list.filter((x) => x && typeof x.id === "string" &&
|
|
5273
|
+
if (!_chunkUOGKSVRQcjs.findLayer.call(void 0, state.layers, id) || !Array.isArray(list)) continue;
|
|
5274
|
+
const ok = list.filter((x) => x && typeof x.id === "string" && _chunkROVK6AXXcjs.STAMP_KINDS.includes(x.stamp) && Number.isFinite(x.x) && Number.isFinite(x.y) && x.size > 0);
|
|
5271
5275
|
if (ok.length !== list.length) problems.push(`Some stickers of layer "${id}" could not be read; they were dropped.`);
|
|
5272
5276
|
stickers[id] = ok.map((x) => ({ ...x }));
|
|
5273
5277
|
}
|
|
@@ -5276,7 +5280,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5276
5280
|
if (ext.effectLayers && typeof ext.effectLayers === "object") {
|
|
5277
5281
|
const effectLayers = {};
|
|
5278
5282
|
for (const [id, v] of Object.entries(ext.effectLayers)) {
|
|
5279
|
-
if (!isPixelLayer(_optionalChain([
|
|
5283
|
+
if (!isPixelLayer(_optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, state.layers, id), 'optionalAccess', _267 => _267.layer]))) continue;
|
|
5280
5284
|
const source = readPaintEffectSource(v);
|
|
5281
5285
|
if (source) effectLayers[id] = source;
|
|
5282
5286
|
else problems.push(`The effect of layer "${id}" could not be read; it loads as a plain layer.`);
|
|
@@ -5294,7 +5298,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5294
5298
|
if (!raw || typeof raw !== "object") return state;
|
|
5295
5299
|
const thick = {};
|
|
5296
5300
|
for (const [id, v] of Object.entries(raw)) {
|
|
5297
|
-
if (!
|
|
5301
|
+
if (!_chunkUOGKSVRQcjs.findLayer.call(void 0, state.layers, id)) continue;
|
|
5298
5302
|
try {
|
|
5299
5303
|
thick[id] = thickFromJSON(v);
|
|
5300
5304
|
} catch (e) {
|
|
@@ -5354,7 +5358,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5354
5358
|
/** The canvas as PNG bytes (paper included by default; `scale` below 1 shrinks it). */
|
|
5355
5359
|
exportPng(options = {}) {
|
|
5356
5360
|
const img = this.scaled(options);
|
|
5357
|
-
return
|
|
5361
|
+
return _chunkOLNIPTB3cjs.encodePng.call(void 0, img.width, img.height, img.data);
|
|
5358
5362
|
}
|
|
5359
5363
|
scaled(options) {
|
|
5360
5364
|
const full = this.compositePixels(options);
|
|
@@ -5397,22 +5401,22 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5397
5401
|
opacity: 1,
|
|
5398
5402
|
blend: "normal",
|
|
5399
5403
|
locks: { all: true },
|
|
5400
|
-
surface:
|
|
5404
|
+
surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, paperPixels, 4),
|
|
5401
5405
|
offset: { x: 0, y: 0 }
|
|
5402
5406
|
};
|
|
5403
5407
|
const merged = this.compositePixels({ paper: true }).data;
|
|
5404
5408
|
const changed = /* @__PURE__ */ new Map();
|
|
5405
5409
|
const toStandard = (layers2) => layers2.map((l) => {
|
|
5406
|
-
const blend = l.blend === "pass-through" ? l.blend :
|
|
5410
|
+
const blend = l.blend === "pass-through" ? l.blend : _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, l.blend);
|
|
5407
5411
|
if (blend !== l.blend) changed.set(l.blend, [..._nullishCoalesce(changed.get(l.blend), () => ( [])), l.name]);
|
|
5408
5412
|
const next = blend === l.blend ? l : { ...l, blend };
|
|
5409
5413
|
return next.type === "group" ? { ...next, children: toStandard(next.children) } : next;
|
|
5410
5414
|
});
|
|
5411
5415
|
const layers = toStandard(dried);
|
|
5412
|
-
const result =
|
|
5416
|
+
const result = _chunkQE7D7TZRcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
|
|
5413
5417
|
for (const [mode, names] of changed) {
|
|
5414
|
-
const label = _nullishCoalesce(_optionalChain([
|
|
5415
|
-
const std = _nullishCoalesce(_optionalChain([
|
|
5418
|
+
const label = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _271 => _271.find, 'call', _272 => _272((m) => m.id === mode), 'optionalAccess', _273 => _273.label]), () => ( mode));
|
|
5419
|
+
const std = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _274 => _274.find, 'call', _275 => _275((m) => m.id === _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _276 => _276.label]), () => ( _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)));
|
|
5416
5420
|
const list = names.map((n) => `"${n}"`).join(", ");
|
|
5417
5421
|
const one = names.length === 1;
|
|
5418
5422
|
result.warnings.push(`${label} blending has no PSD equivalent; ${list} ${one ? "was" : "were"} written as ${std}, the nearest Photoshop mode, so ${one ? "it looks" : "they look"} different in Photoshop (the merged image is exact).`);
|
|
@@ -5422,7 +5426,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5422
5426
|
/** `render_preview` as a base64 PNG. */
|
|
5423
5427
|
previewPngBase64(options = {}) {
|
|
5424
5428
|
const img = this.renderPreview(options);
|
|
5425
|
-
return { data:
|
|
5429
|
+
return { data: _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, _chunkOLNIPTB3cjs.encodePng.call(void 0, img.width, img.height, img.data)), width: img.width, height: img.height };
|
|
5426
5430
|
}
|
|
5427
5431
|
// --- Guides --------------------------------------------------------------------
|
|
5428
5432
|
setGuides(next) {
|
|
@@ -5460,17 +5464,17 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5460
5464
|
pixels = this.decodeImage(input.png.trim().startsWith("data:") ? input.png.trim() : `data:image/png;base64,${input.png.trim()}`, what);
|
|
5461
5465
|
} else throw new PaintEditorError(`${what}: pass png (a PNG as base64 or a data URL) or pixels.`);
|
|
5462
5466
|
if (pixels.width > MAX_IMAGE_SIDE || pixels.height > MAX_IMAGE_SIDE) throw new PaintEditorError(`${what} is ${pixels.width}\xD7${pixels.height}; the limit is ${MAX_IMAGE_SIDE} px per side.`);
|
|
5463
|
-
const src =
|
|
5467
|
+
const src = _chunkOLNIPTB3cjs.pngDataUrl.call(void 0, pixels.width, pixels.height, pixels.data);
|
|
5464
5468
|
this.imagePixels.set(src, pixels);
|
|
5465
5469
|
return { src, pixels };
|
|
5466
5470
|
}
|
|
5467
5471
|
decodeImage(src, what = "Image") {
|
|
5468
5472
|
const cached = this.imagePixels.get(src);
|
|
5469
5473
|
if (cached) return cached;
|
|
5470
|
-
const parsed =
|
|
5474
|
+
const parsed = _chunkOLNIPTB3cjs.parseDataUrl.call(void 0, src);
|
|
5471
5475
|
if (!parsed) throw new PaintEditorError(`${what} is not a data URL or base64 PNG.`);
|
|
5472
5476
|
try {
|
|
5473
|
-
const png =
|
|
5477
|
+
const png = _chunkOLNIPTB3cjs.decodePng.call(void 0, parsed.bytes);
|
|
5474
5478
|
const px = { width: png.width, height: png.height, data: png.data };
|
|
5475
5479
|
this.imagePixels.set(src, px);
|
|
5476
5480
|
return px;
|
|
@@ -5659,9 +5663,9 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5659
5663
|
}
|
|
5660
5664
|
/** Replaces a layer's stickers and redraws its pixels from them (one undo step). */
|
|
5661
5665
|
commitStickers(label, layer, stickers) {
|
|
5662
|
-
if (
|
|
5663
|
-
const surface =
|
|
5664
|
-
const doc = { ...this.doc, layers:
|
|
5666
|
+
if (_chunkUOGKSVRQcjs.isLayerLocked.call(void 0, layer, "pixels")) throw new PaintEditorError(`Layer "${layer.name}" has its pixels locked; unlock it first.`);
|
|
5667
|
+
const surface = _chunkROVK6AXXcjs.stickerSurface.call(void 0, stickers);
|
|
5668
|
+
const doc = { ...this.doc, layers: _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => ({ ...layer, surface, offset: { x: 0, y: 0 } })), stickers: { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [layer.id]: stickers } };
|
|
5665
5669
|
this.commit(label, this.withPaintEvent(doc, { kind: "stickers", layerId: layer.id, data: { stickers: stickers.map((s) => ({ ...s })) } }));
|
|
5666
5670
|
}
|
|
5667
5671
|
/** Moves, turns, resizes, recolours or restamps one sticker (one undo step). Returns it. */
|
|
@@ -5671,7 +5675,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5671
5675
|
if (i < 0) throw new PaintEditorError(`Layer "${layer.name}" has no sticker "${id}". Call list_stickers for the ids.`);
|
|
5672
5676
|
let u;
|
|
5673
5677
|
try {
|
|
5674
|
-
u =
|
|
5678
|
+
u = _chunkROVK6AXXcjs.normalizeStickerUpdate.call(void 0, update);
|
|
5675
5679
|
} catch (e) {
|
|
5676
5680
|
throw new PaintEditorError(e.message);
|
|
5677
5681
|
}
|
|
@@ -5772,7 +5776,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5772
5776
|
}
|
|
5773
5777
|
makeSwatch(color, name) {
|
|
5774
5778
|
const p = typeof color === "string" ? { type: "color", color: parseColor(color) } : this.readStrokePaint(color);
|
|
5775
|
-
const out = { color:
|
|
5779
|
+
const out = { color: _chunkPQ3H2AANcjs.paintSourceColor.call(void 0, p, { paint: this.color, secondary: this.secondaryColor }) };
|
|
5776
5780
|
if (_optionalChain([name, 'optionalAccess', _295 => _295.trim, 'call', _296 => _296()])) out.name = name.trim();
|
|
5777
5781
|
if (p.type === "gradient") out.paint = p;
|
|
5778
5782
|
return out;
|
|
@@ -5914,7 +5918,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
|
|
|
5914
5918
|
}
|
|
5915
5919
|
/** A layer's tile surface (live while stroking), for thumbnails. */
|
|
5916
5920
|
layerSurface(id) {
|
|
5917
|
-
const l = _optionalChain([
|
|
5921
|
+
const l = _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, this.currentLayers(), id), 'optionalAccess', _299 => _299.layer]);
|
|
5918
5922
|
return isPixelLayer(l) ? l.surface : null;
|
|
5919
5923
|
}
|
|
5920
5924
|
}, _class10);
|
|
@@ -5924,7 +5928,7 @@ var moveRect = (r, dx, dy) => ({ ...r, x: r.x + dx, y: r.y + dy });
|
|
|
5924
5928
|
function shiftDocument(doc, dx, dy) {
|
|
5925
5929
|
if (!dx && !dy) return doc;
|
|
5926
5930
|
let layers = doc.layers;
|
|
5927
|
-
for (const l of
|
|
5931
|
+
for (const l of _chunkUOGKSVRQcjs.flattenLayers.call(void 0, doc.layers)) if (l.type === "pixel") layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, offset: movePoint(l.offset, dx, dy) }));
|
|
5928
5932
|
const m = [1, 0, 0, 1, dx, dy];
|
|
5929
5933
|
const moveStickers = (list) => list.map((s) => ({ ...s, x: Math.round((s.x + dx) * 100) / 100, y: Math.round((s.y + dy) * 100) / 100 }));
|
|
5930
5934
|
const out = {
|
|
@@ -6281,7 +6285,7 @@ function createPaintStickerTools(c) {
|
|
|
6281
6285
|
properties: {
|
|
6282
6286
|
layerId: LAYER_ID,
|
|
6283
6287
|
id: { type: "string", description: "Sticker id from list_stickers." },
|
|
6284
|
-
stamp: { type: "string", enum: [...
|
|
6288
|
+
stamp: { type: "string", enum: [..._chunkROVK6AXXcjs.STAMP_KINDS], description: "Another stamp." },
|
|
6285
6289
|
x: { type: "number", description: "Centre x in document pixels." },
|
|
6286
6290
|
y: { type: "number", description: "Centre y in document pixels." },
|
|
6287
6291
|
size: { type: "number", minimum: 2, maximum: 2048, description: "Diameter in pixels." },
|
|
@@ -6585,7 +6589,7 @@ function createPaintGuideTools(c) {
|
|
|
6585
6589
|
type: "object",
|
|
6586
6590
|
properties: {
|
|
6587
6591
|
color: { ...COLOR2, description: "A colour #rrggbb." },
|
|
6588
|
-
paint: { ...
|
|
6592
|
+
paint: { ..._chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA, description: "Gradient paint (or a colour) for the swatch, instead of color." },
|
|
6589
6593
|
name: { type: "string", minLength: 1, description: "Optional name." }
|
|
6590
6594
|
},
|
|
6591
6595
|
additionalProperties: false
|
|
@@ -6739,7 +6743,7 @@ function createPaintGuideTools(c) {
|
|
|
6739
6743
|
const pad = c.mixingPad;
|
|
6740
6744
|
return {
|
|
6741
6745
|
content: [
|
|
6742
|
-
{ type: "image", data:
|
|
6746
|
+
{ type: "image", data: _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, _chunkOLNIPTB3cjs.encodePng.call(void 0, pad.width, pad.height, pad.pixels())), mimeType: "image/png" },
|
|
6743
6747
|
{ type: "text", text: `Mixing pad ${pad.width}\xD7${pad.height}` }
|
|
6744
6748
|
]
|
|
6745
6749
|
};
|
|
@@ -6881,7 +6885,7 @@ function createPaintWetTools(c) {
|
|
|
6881
6885
|
type: "object",
|
|
6882
6886
|
properties: {
|
|
6883
6887
|
layerId: LAYER_ID2,
|
|
6884
|
-
kind: { type: "string", enum: [...
|
|
6888
|
+
kind: { type: "string", enum: [..._chunkKWNMBMKGcjs.WET_FLOW_KINDS], description: "none, linear, swirl, radial or turbulent." },
|
|
6885
6889
|
strength: UNIT("How hard it pushes, 0..1 (1 is about a 25\xB0 tilt; default 0.5)."),
|
|
6886
6890
|
angle: { type: "number", minimum: -360, maximum: 360, description: "linear: direction in degrees clockwise from canvas down (default 0)." },
|
|
6887
6891
|
center: {
|
|
@@ -7047,7 +7051,7 @@ function createPaintReplayTools(c) {
|
|
|
7047
7051
|
await c.wetIdle();
|
|
7048
7052
|
const tl = await c.timeLapse({ frames: a.frames, fps: a.fps, maxSide: a.maxSide, wetStepsPerFrame: a.wetStepsPerFrame, holdMs: a.holdMs });
|
|
7049
7053
|
const pick = [0, Math.floor(tl.frames.length / 3), Math.floor(2 * tl.frames.length / 3), tl.frames.length - 1].filter((v, i, arr) => arr.indexOf(v) === i);
|
|
7050
|
-
const sheet = contactSheet(pick.map((i) =>
|
|
7054
|
+
const sheet = contactSheet(pick.map((i) => _chunkOLNIPTB3cjs.decodePng.call(void 0, tl.frames[i])), pick.length, 160);
|
|
7051
7055
|
const info = {
|
|
7052
7056
|
frames: tl.frames.length,
|
|
7053
7057
|
fps: tl.fps,
|
|
@@ -7056,9 +7060,9 @@ function createPaintReplayTools(c) {
|
|
|
7056
7060
|
durationMs: tl.durationMs,
|
|
7057
7061
|
ffmpeg: tl.ffmpeg.command,
|
|
7058
7062
|
video: tl.video,
|
|
7059
|
-
...a.includeFrames ? { framesPng: tl.frames.map((f) =>
|
|
7063
|
+
...a.includeFrames ? { framesPng: tl.frames.map((f) => _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, f)) } : {}
|
|
7060
7064
|
};
|
|
7061
|
-
return { content: [{ type: "image", data:
|
|
7065
|
+
return { content: [{ type: "image", data: _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, _chunkOLNIPTB3cjs.encodePng.call(void 0, sheet.width, sheet.height, sheet.data)), mimeType: "image/png" }, { type: "text", text: JSON.stringify(info) }] };
|
|
7062
7066
|
}
|
|
7063
7067
|
},
|
|
7064
7068
|
{
|
|
@@ -7078,8 +7082,8 @@ function createPaintReplayTools(c) {
|
|
|
7078
7082
|
handler: async ({ scale, paper }) => {
|
|
7079
7083
|
await c.wetIdle();
|
|
7080
7084
|
const img = await c.renderHighRes({ scale, paper });
|
|
7081
|
-
const bytes =
|
|
7082
|
-
return { mimeType: "image/png", width: img.width, height: img.height, bytes: bytes.length, data:
|
|
7085
|
+
const bytes = _chunkOLNIPTB3cjs.encodePng.call(void 0, img.width, img.height, img.data);
|
|
7086
|
+
return { mimeType: "image/png", width: img.width, height: img.height, bytes: bytes.length, data: _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, bytes) };
|
|
7083
7087
|
}
|
|
7084
7088
|
}
|
|
7085
7089
|
];
|
|
@@ -7097,7 +7101,7 @@ var TIP = {
|
|
|
7097
7101
|
type: "object",
|
|
7098
7102
|
description: "The tip (the shared brush engine). Missing fields keep their current values.",
|
|
7099
7103
|
properties: {
|
|
7100
|
-
size: { type: "number", minimum: 1, maximum:
|
|
7104
|
+
size: { type: "number", minimum: 1, maximum: _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE, description: "Diameter in pixels." },
|
|
7101
7105
|
hardness: { type: "number", minimum: 0, maximum: 1, description: "Edge hardness, 0 (soft) .. 1 (hard)." },
|
|
7102
7106
|
spacing: { type: "number", minimum: 0.01, maximum: 10, description: "Dab spacing as a fraction of the diameter (0.05 is smooth, 1 is dotted)." },
|
|
7103
7107
|
angle: { type: "number", minimum: -360, maximum: 360, description: "Tip angle in degrees, counter-clockwise; with rotation stroke or barrel it is added to the stroke direction or pen rotation." },
|
|
@@ -7109,7 +7113,7 @@ var TIP = {
|
|
|
7109
7113
|
pressureOpacity: { type: "boolean", description: "Pressure scales the opacity." },
|
|
7110
7114
|
blend: {
|
|
7111
7115
|
type: "string",
|
|
7112
|
-
enum:
|
|
7116
|
+
enum: _chunkOLNIPTB3cjs.BLEND_MODES.map((m) => m.id),
|
|
7113
7117
|
description: "How paint combines with the layer. pigment mixes it in like real paint (blue into yellow gives green); multiply darkens like marker ink; watercolor glazes like a transparent wash; tint, highlight and shadow recolour, light and shade (see list_blend_modes)."
|
|
7114
7118
|
}
|
|
7115
7119
|
},
|
|
@@ -7142,11 +7146,11 @@ var MIXER = {
|
|
|
7142
7146
|
mix: { type: "number", minimum: 0, maximum: 1, description: "Mix ratio: how far each dab's paint moves from the reservoir towards the picked-up colour." },
|
|
7143
7147
|
loadEachStroke: { type: "boolean", description: "Refill the reservoir with the colour before each stroke." },
|
|
7144
7148
|
cleanEachStroke: { type: "boolean", description: "Empty the pickup well after each stroke." },
|
|
7145
|
-
mixing: { type: "string", enum: [...
|
|
7149
|
+
mixing: { type: "string", enum: [..._chunkPQ3H2AANcjs.MIXING_MODELS], description: "rgb: RGB averages. pigment: mixes like paint (Kubelka-Munk)." }
|
|
7146
7150
|
},
|
|
7147
7151
|
additionalProperties: false
|
|
7148
7152
|
};
|
|
7149
|
-
var MIXING = { type: "string", enum: [...
|
|
7153
|
+
var MIXING = { type: "string", enum: [..._chunkPQ3H2AANcjs.MIXING_MODELS], description: "pigment: mixes like paint (Kubelka-Munk, blue and yellow make green); rgb: straight RGB averages." };
|
|
7150
7154
|
var BEHAVIOR = {
|
|
7151
7155
|
type: "object",
|
|
7152
7156
|
description: "How the brush handles paint on the canvas (dab and mixer engines; on a mixer brush pickup, mix, dirty and mixing are its mixer wet, mix, !cleanEachStroke and mixing). Missing fields keep their current values.",
|
|
@@ -7159,7 +7163,7 @@ var BEHAVIOR = {
|
|
|
7159
7163
|
type: "object",
|
|
7160
7164
|
description: "Multi-coloured brush (the older form of paint, the brush's own gradient: tip is across-tip, dab is distance in dabs or random). Read back from paint when it has a multi-colour equivalent. Missing fields keep their current values.",
|
|
7161
7165
|
properties: {
|
|
7162
|
-
mode: { type: "string", enum: [...
|
|
7166
|
+
mode: { type: "string", enum: [..._chunkROVK6AXXcjs.MULTI_COLOR_MODES], description: "off; tip: the colours lie side by side across the tip (stripes along the stroke, like a brush loaded with several paints); dab: the colour changes along the stroke." },
|
|
7163
7167
|
colors: { type: "array", maxItems: 8, items: { ...COLOR3 }, description: "2..8 colours #rrggbb; fewer than 2 uses the paint colour and the secondary colour." },
|
|
7164
7168
|
order: { type: "string", enum: ["sequence", "random"], description: "dab mode: sequence runs through the colours in order, blending between them; random picks one per run of dabs (seeded)." },
|
|
7165
7169
|
length: { type: "integer", minimum: 1, maximum: 500, description: "dab mode: dabs per colour (default 12)." },
|
|
@@ -7172,7 +7176,7 @@ var BEHAVIOR = {
|
|
|
7172
7176
|
};
|
|
7173
7177
|
var BRUSH_PAINT = {
|
|
7174
7178
|
description: `The brush's own gradient paint, used instead of the editor's paint (null: the editor's paint). It is what the multi-colour settings became; stops may be "paint" / "secondary" for the editor's two colours.`,
|
|
7175
|
-
anyOf: [
|
|
7179
|
+
anyOf: [_chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA, { type: "null", description: "No gradient of its own: the editor's paint." }]
|
|
7176
7180
|
};
|
|
7177
7181
|
var BLENDER = {
|
|
7178
7182
|
type: "object",
|
|
@@ -7200,10 +7204,10 @@ var WET_BRUSH = {
|
|
|
7200
7204
|
properties: {
|
|
7201
7205
|
tool: {
|
|
7202
7206
|
type: "string",
|
|
7203
|
-
enum: [...
|
|
7207
|
+
enum: [..._chunkROVK6AXXcjs.WET_TOOLS],
|
|
7204
7208
|
description: "paint: water and pigment (picks up and mixes wet paint by behavior.pickup / mix); water: clear water (with rewet it lifts dried paint); dry: a hair dryer, takes water; blow: pushes the water along the stroke; blend: evens out wet pigment; smudge: drags wet paint; blot: a tissue, takes wet paint up (erase wet)."
|
|
7205
7209
|
},
|
|
7206
|
-
medium: { type: "string", enum: [...
|
|
7210
|
+
medium: { type: "string", enum: [..._chunkROVK6AXXcjs.WET_MEDIA], description: "The medium: watercolor, gouache or oil. A layer takes the medium's wet settings the first time it holds wet paint (oil: thick, barely flows, stays wet long and blends into the wet paint it meets)." },
|
|
7207
7211
|
load: { type: "number", minimum: 0, maximum: 1, description: "Paint loading: 1 never runs out; lower, the brush runs dry along a long stroke (each stroke reloads)." },
|
|
7208
7212
|
thinner: { type: "number", minimum: 0, maximum: 1, description: "Thinner (water or solvent): more transparent, runnier paint." },
|
|
7209
7213
|
water: { type: "number", minimum: 0, maximum: 1, description: "Wetness: water laid per stroke, 0.2 a damp brush .. 1 a dripping one." },
|
|
@@ -7220,7 +7224,7 @@ var IMPASTO_BRUSH = {
|
|
|
7220
7224
|
properties: {
|
|
7221
7225
|
tool: {
|
|
7222
7226
|
type: "string",
|
|
7223
|
-
enum: [...
|
|
7227
|
+
enum: [..._chunkROVK6AXXcjs.IMPASTO_TOOLS],
|
|
7224
7228
|
description: "brush: thick paint with bristle ridges along the stroke; tube: blobs squeezed from the tube; knife: a palette knife that scrapes the relief flat and smears the paint; roller: a flat stippled band; gloop: a thick, glossy, rounded bead."
|
|
7225
7229
|
},
|
|
7226
7230
|
thickness: { type: "number", minimum: 0, maximum: 1, description: "How far the paint stands up." },
|
|
@@ -7236,8 +7240,8 @@ var PARTICLE_BRUSH = {
|
|
|
7236
7240
|
type: "object",
|
|
7237
7241
|
description: "Particle engine settings (procedural brushes). Missing fields keep their current values.",
|
|
7238
7242
|
properties: {
|
|
7239
|
-
kind: { type: "string", enum: [...
|
|
7240
|
-
render: { type: "string", enum: [...
|
|
7243
|
+
kind: { type: "string", enum: [..._chunkROVK6AXXcjs.PARTICLE_KINDS], description: "string: strands of masses on springs dragged behind the pen (hair, fur, wet string); spring: particles on springs to the pen, overshooting and wobbling; orbit: particles circling the pen (curls); flow: particles thrown off the pen into a swirling flow until they fade." },
|
|
7244
|
+
render: { type: "string", enum: [..._chunkROVK6AXXcjs.PARTICLE_RENDERS], description: "dot: a mark at each step; line: each particle draws a continuous line; sequence: beads spaced along each path." },
|
|
7241
7245
|
count: { type: "integer", minimum: 1, maximum: 64, description: "Particles (flow: how many are thrown per tip of travel)." },
|
|
7242
7246
|
size: { type: "number", minimum: 0, maximum: 1, description: "Mark size as a fraction of the tip size." },
|
|
7243
7247
|
spread: { type: "number", minimum: 0, maximum: 1, description: "How far apart the particles start, as a fraction of the tip size." },
|
|
@@ -7267,7 +7271,7 @@ var STICKER_BRUSH = {
|
|
|
7267
7271
|
type: "object",
|
|
7268
7272
|
description: "Sticker engine settings: stamps sprayed along the stroke as editable stickers. Missing fields keep their current values.",
|
|
7269
7273
|
properties: {
|
|
7270
|
-
stamps: { type: "array", minItems: 1, maxItems: 9, items: { type: "string", enum: [...
|
|
7274
|
+
stamps: { type: "array", minItems: 1, maxItems: 9, items: { type: "string", enum: [..._chunkROVK6AXXcjs.STAMP_KINDS], description: "A stamp." }, description: "The stamps to spray (one picked at random per sticker)." },
|
|
7271
7275
|
density: { type: "number", minimum: 0, maximum: 1, description: "Stickers per distance travelled." },
|
|
7272
7276
|
sizeJitter: { type: "number", minimum: 0, maximum: 1, description: "Random size change." },
|
|
7273
7277
|
rotationJitter: { type: "number", minimum: 0, maximum: 1, description: "Random turn as a fraction of \xB1180\xB0." },
|
|
@@ -7278,16 +7282,16 @@ var STICKER_BRUSH = {
|
|
|
7278
7282
|
};
|
|
7279
7283
|
var BRUSH_FIELDS = {
|
|
7280
7284
|
name: { type: "string", minLength: 1, maxLength: 80, description: "Display name." },
|
|
7281
|
-
category: { type: "string", enum: [...
|
|
7285
|
+
category: { type: "string", enum: [..._chunkROVK6AXXcjs.PAINT_BRUSH_CATEGORIES], description: "Library category." },
|
|
7282
7286
|
engine: {
|
|
7283
7287
|
type: "string",
|
|
7284
|
-
enum: [...
|
|
7288
|
+
enum: [..._chunkROVK6AXXcjs.PAINT_BRUSH_ENGINES],
|
|
7285
7289
|
description: "dab: paints dabs (with behavior.pickup or gradient paint it paints dab by dab, lifting and mixing paint); eraser: removes paint; mixer: the Mixer Brush (a reservoir plus picked-up paint); blender: mixes the colours under and near the tip; smudge: drags paint along the stroke; wet: watercolour, gouache, oil and the wet tools on a simulated wet layer (see wet); impasto: thick paint with relief (see impasto); particle: procedural particle brushes (see particle); bristle: a tuft of bristles that bend and splay (see bristle); sticker: sprays editable sticker stamps (see sticker)."
|
|
7286
7290
|
},
|
|
7287
7291
|
tip: TIP,
|
|
7288
7292
|
grain: { type: "number", minimum: 0, maximum: 1, description: "Paper grain response: 0 ignores the grain, 1 catches only its peaks at light pressure (pencil, pastel, charcoal). Multiplied by the paper depth." },
|
|
7289
7293
|
pressureSmoothing: { type: "number", minimum: 0, maximum: 0.95, description: "Pressure smoothing, separate from the tip position smoothing." },
|
|
7290
|
-
rotation: { type: "string", enum: [...
|
|
7294
|
+
rotation: { type: "string", enum: [..._chunkROVK6AXXcjs.BRUSH_ROTATIONS], description: "What turns the tip: fixed (tip.angle), stroke (follows the direction of travel) or barrel (the pen barrel rotation, twist)." },
|
|
7291
7295
|
dynamics: DYNAMICS,
|
|
7292
7296
|
mixer: MIXER,
|
|
7293
7297
|
loadsColor: { type: "boolean", description: "Mixer engine: load the colour each stroke (false for a mixer that only moves paint)." },
|
|
@@ -7337,7 +7341,7 @@ function brushSummary(b) {
|
|
|
7337
7341
|
size: b.tip.size,
|
|
7338
7342
|
grain: b.grain,
|
|
7339
7343
|
rotation: b.rotation,
|
|
7340
|
-
wetCapable:
|
|
7344
|
+
wetCapable: _chunkROVK6AXXcjs.isWetCapable.call(void 0, b),
|
|
7341
7345
|
pickup: b.behavior.pickup,
|
|
7342
7346
|
dirty: b.behavior.dirty,
|
|
7343
7347
|
multicolor: b.behavior.multicolor.mode,
|
|
@@ -7383,7 +7387,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7383
7387
|
strokes: d.strokes.length,
|
|
7384
7388
|
undo: s.undoLabel,
|
|
7385
7389
|
redo: s.redoLabel,
|
|
7386
|
-
blendModes:
|
|
7390
|
+
blendModes: _chunkOLNIPTB3cjs.BLEND_MODES.map((m) => m.id),
|
|
7387
7391
|
wet: s.wet.wet,
|
|
7388
7392
|
lighting: c.getLighting()
|
|
7389
7393
|
};
|
|
@@ -7445,9 +7449,9 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7445
7449
|
inputSchema: EMPTY3,
|
|
7446
7450
|
annotations: { title: "List papers", ...READ6 },
|
|
7447
7451
|
handler: () => ({
|
|
7448
|
-
papers:
|
|
7449
|
-
families: [...
|
|
7450
|
-
patterns: [...
|
|
7452
|
+
papers: _chunkROVK6AXXcjs.PAPER_LIBRARY.map((p) => ({ id: p.preset, name: p.name, family: p.family, pattern: p.pattern, color: p.color, depth: p.depth, absorption: p.absorption, permeability: p.permeability, roughness: p.roughness })),
|
|
7453
|
+
families: [..._chunkROVK6AXXcjs.PAPER_FAMILIES],
|
|
7454
|
+
patterns: [..._chunkPQ3H2AANcjs.GRAIN_PATTERNS]
|
|
7451
7455
|
})
|
|
7452
7456
|
});
|
|
7453
7457
|
add({
|
|
@@ -7478,7 +7482,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7478
7482
|
depth: { type: "number", minimum: 0, maximum: 1, description: "Grain depth 0..1 (0: brushes ignore the grain)." },
|
|
7479
7483
|
scale: { type: "number", minimum: 0.25, maximum: 8, description: "Grain scale: 1 natural, 2 twice as coarse." },
|
|
7480
7484
|
seed: { type: "integer", minimum: 0, description: "Grain seed: another sheet of the same paper." },
|
|
7481
|
-
pattern: { type: "string", enum: [...
|
|
7485
|
+
pattern: { type: "string", enum: [..._chunkPQ3H2AANcjs.GRAIN_PATTERNS], description: "Grain pattern." },
|
|
7482
7486
|
tiling: { type: "string", enum: ["repeat", "mirror"], description: "How the grain tile repeats (mirror hides seams)." },
|
|
7483
7487
|
shading: { type: "number", minimum: 0, maximum: 1, description: "How much the grain shades the paper colour." },
|
|
7484
7488
|
dry: { ...tuning, description: "Height map tuning for dry media." },
|
|
@@ -7534,7 +7538,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7534
7538
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0..1." },
|
|
7535
7539
|
blend: {
|
|
7536
7540
|
type: "string",
|
|
7537
|
-
enum: [...
|
|
7541
|
+
enum: [..._chunkOLNIPTB3cjs.BLEND_MODES.map((m) => m.id), "pass-through"],
|
|
7538
7542
|
description: "Blend mode (pass-through for groups only). Painterly modes: watercolor (the layer glazes like a transparent wash), tint (recolours keeping lightness), highlight (adds soft coloured light), shadow (shades with ambient fill); see list_blend_modes."
|
|
7539
7543
|
},
|
|
7540
7544
|
clipped: { type: "boolean", description: "Clip to the layer below (paint only shows where it has paint)." },
|
|
@@ -7564,12 +7568,12 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7564
7568
|
inputSchema: EMPTY3,
|
|
7565
7569
|
annotations: { title: "List blend modes", ...READ6 },
|
|
7566
7570
|
handler: () => ({
|
|
7567
|
-
modes:
|
|
7571
|
+
modes: _chunkOLNIPTB3cjs.BLEND_MODES.map((m) => ({
|
|
7568
7572
|
id: m.id,
|
|
7569
7573
|
label: m.label,
|
|
7570
7574
|
group: m.painterly ? "painterly" : m.id === "pigment" ? "pigment" : "standard",
|
|
7571
7575
|
...m.description ? { description: m.description } : {},
|
|
7572
|
-
psd:
|
|
7576
|
+
psd: _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, m.id)
|
|
7573
7577
|
}))
|
|
7574
7578
|
})
|
|
7575
7579
|
});
|
|
@@ -7641,7 +7645,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7641
7645
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Opacity 0..1 (default 1)." },
|
|
7642
7646
|
grain: { type: "number", minimum: 0, maximum: 1, description: "Paper grain response 0..1 (default 0: flat)." },
|
|
7643
7647
|
pressure: { type: "number", minimum: 0, maximum: 1, description: "With grain: how far into the valleys, 0..1 (default 0.5)." },
|
|
7644
|
-
blend: { type: "string", enum:
|
|
7648
|
+
blend: { type: "string", enum: _chunkOLNIPTB3cjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal; pigment mixes like paint, watercolor glazes; see list_blend_modes)." }
|
|
7645
7649
|
},
|
|
7646
7650
|
additionalProperties: false
|
|
7647
7651
|
},
|
|
@@ -7677,10 +7681,10 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7677
7681
|
annotations: { title: "Get a brush", ...READ6 },
|
|
7678
7682
|
handler: ({ id }) => {
|
|
7679
7683
|
const st = c.getState();
|
|
7680
|
-
if (id === void 0) return { ...
|
|
7684
|
+
if (id === void 0) return { ..._chunkROVK6AXXcjs.brushToJSON.call(void 0, st.brush), strokePaint: _nullishCoalesce(st.brush.paint, () => ( st.paint)) };
|
|
7681
7685
|
const b = c.getBrush(id);
|
|
7682
7686
|
if (!b) throw new Error(`Unknown brush "${id}". Call list_brushes for the ids.`);
|
|
7683
|
-
return { ...
|
|
7687
|
+
return { ..._chunkROVK6AXXcjs.brushToJSON.call(void 0, b), builtin: Boolean(b.builtin), strokePaint: _nullishCoalesce(b.paint, () => ( st.paint)) };
|
|
7684
7688
|
}
|
|
7685
7689
|
});
|
|
7686
7690
|
add({
|
|
@@ -7689,7 +7693,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7689
7693
|
description: "Chooses the active brush (id) and / or changes its settings; strokes without a brush use it. Editor state, not an undo step. Changes stay on the active brush until save_brush stores them. Returns the active brush.",
|
|
7690
7694
|
inputSchema: { type: "object", properties: { id: { type: "string", description: "Brush id from list_brushes to start from." }, ...BRUSH_FIELDS }, additionalProperties: false },
|
|
7691
7695
|
annotations: { title: "Set the brush", ...SET4 },
|
|
7692
|
-
handler: (a) =>
|
|
7696
|
+
handler: (a) => _chunkROVK6AXXcjs.brushToJSON.call(void 0, c.setBrush(a))
|
|
7693
7697
|
});
|
|
7694
7698
|
add({
|
|
7695
7699
|
name: "save_brush",
|
|
@@ -7705,7 +7709,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7705
7709
|
additionalProperties: false
|
|
7706
7710
|
},
|
|
7707
7711
|
annotations: { title: "Save a brush", ...SET4 },
|
|
7708
|
-
handler: ({ id, name }) =>
|
|
7712
|
+
handler: ({ id, name }) => _chunkROVK6AXXcjs.brushToJSON.call(void 0, c.saveBrush({ id, name }))
|
|
7709
7713
|
});
|
|
7710
7714
|
add({
|
|
7711
7715
|
name: "remove_brush",
|
|
@@ -7765,7 +7769,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7765
7769
|
const t = c.brushThumbnail(_nullishCoalesce(id, () => ( c.getState().brush.id)), { width, height, color });
|
|
7766
7770
|
return {
|
|
7767
7771
|
content: [
|
|
7768
|
-
{ type: "image", data:
|
|
7772
|
+
{ type: "image", data: _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, _chunkOLNIPTB3cjs.encodePng.call(void 0, t.width, t.height, t.data)), mimeType: "image/png" },
|
|
7769
7773
|
{ type: "text", text: `Brush ${_nullishCoalesce(id, () => ( c.getState().brush.id))} ${t.width}\xD7${t.height}` }
|
|
7770
7774
|
]
|
|
7771
7775
|
};
|
|
@@ -7792,7 +7796,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7792
7796
|
name: "set_paint",
|
|
7793
7797
|
title: "Set the paint (colour or gradient)",
|
|
7794
7798
|
description: 'Sets what strokes paint with: one colour, or gradient paint that changes colour as the stroke goes. Gradient paint: 2..16 stops sorted by offset (#rrggbb, or "paint" / "secondary" for the two editor colours), space pigment (default: mixes like paint) / oklab / srgb, and map: distance (default: the colour changes as the stroke is dragged out, 300 px then mirrored back), pressure, tilt, velocity, direction, time, across-tip or random. Every stroking brush samples it per dab (dab, mixer, watercolour and gouache, oil and impasto, particle, bristle, sticker); erasers, blenders and smudges ignore it, and a brush with its own gradient (get_brush paint) paints that instead. set_color goes back to one colour. Editor state, not an undo step. Returns paint, color and secondaryColor.',
|
|
7795
|
-
inputSchema: { type: "object", properties: { paint:
|
|
7799
|
+
inputSchema: { type: "object", properties: { paint: _chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA }, required: ["paint"], additionalProperties: false },
|
|
7796
7800
|
annotations: { title: "Set the paint (colour or gradient)", ...SET4 },
|
|
7797
7801
|
handler: ({ paint }) => {
|
|
7798
7802
|
const p = c.setPaint(paint);
|
|
@@ -7854,7 +7858,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
7854
7858
|
brushId: { type: "string", description: "Brush id from list_brushes (default the active brush)." },
|
|
7855
7859
|
brush: { type: "object", description: "Brush changes for this stroke only.", properties: BRUSH_FIELDS, additionalProperties: false },
|
|
7856
7860
|
color: { ...COLOR3, description: "Paint colour #rrggbb (default the paint colour)." },
|
|
7857
|
-
paint: { ...
|
|
7861
|
+
paint: { ..._chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA, description: "What this stroke paints with instead of the editor's paint: a colour, or gradient paint that changes colour as the stroke goes (by distance, pressure, tilt, speed, direction, time, across the tip or at random). Wins over the brush's own gradient." },
|
|
7858
7862
|
seed: { type: "integer", minimum: 0, description: "Jitter seed (default a new one); the same seed and points give the same marks." },
|
|
7859
7863
|
snapToPerspective: { type: "boolean", description: "Snap the points to the perspective guide, as a pen stroke would (default false)." }
|
|
7860
7864
|
},
|
|
@@ -8038,7 +8042,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
8038
8042
|
annotations: { title: "Export the painting", ...READ6 },
|
|
8039
8043
|
handler: async ({ format, quality, scale, paper }) => {
|
|
8040
8044
|
const bytes = await c.exportImage({ format, quality, scale, paper });
|
|
8041
|
-
return { mimeType: _nullishCoalesce(format, () => ( "image/png")), bytes: bytes.length, data:
|
|
8045
|
+
return { mimeType: _nullishCoalesce(format, () => ( "image/png")), bytes: bytes.length, data: _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, bytes) };
|
|
8042
8046
|
}
|
|
8043
8047
|
});
|
|
8044
8048
|
add({
|
|
@@ -8049,7 +8053,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
8049
8053
|
annotations: { title: "Export as PSD", ...READ6 },
|
|
8050
8054
|
handler: () => {
|
|
8051
8055
|
const r = c.exportPsd();
|
|
8052
|
-
return { data:
|
|
8056
|
+
return { data: _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, r.bytes), bytes: r.bytes.length, psb: r.psb, warnings: r.warnings };
|
|
8053
8057
|
}
|
|
8054
8058
|
});
|
|
8055
8059
|
tools.push(...createPaintGuideTools(c));
|
|
@@ -8057,7 +8061,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
8057
8061
|
tools.push(...createPaintThickTools(c));
|
|
8058
8062
|
tools.push(...createPaintReplayTools(c));
|
|
8059
8063
|
tools.push(...createPaintStickerTools(c));
|
|
8060
|
-
tools.push(...
|
|
8064
|
+
tools.push(..._chunkKWNMBMKGcjs.createPigmentTools.call(void 0, ));
|
|
8061
8065
|
const exclude = new Set(_nullishCoalesce(options.exclude, () => ( [])));
|
|
8062
8066
|
const description = "Natural-media painting: paper and grain, dry and wet brushes, the brush library, strokes as data, pigment mixing, stencils, guides, layers and export.";
|
|
8063
8067
|
return withPaintPlayback({
|
|
@@ -8277,11 +8281,11 @@ var PaintCanvasPresenter = (_class12 = class {
|
|
|
8277
8281
|
const key = `${tx},${ty}`;
|
|
8278
8282
|
if (this.uploaded.get(key) === data) return;
|
|
8279
8283
|
this.uploaded.set(key, data);
|
|
8280
|
-
if (!this.scratch) this.scratch = ctx.createImageData(
|
|
8284
|
+
if (!this.scratch) this.scratch = ctx.createImageData(_chunk474IQG74cjs.TILE, _chunk474IQG74cjs.TILE);
|
|
8281
8285
|
this.scratch.data.set(data);
|
|
8282
|
-
const ox = tx *
|
|
8283
|
-
const oy = ty *
|
|
8284
|
-
ctx.putImageData(this.scratch, ox, oy, 0, 0, Math.min(
|
|
8286
|
+
const ox = tx * _chunk474IQG74cjs.TILE;
|
|
8287
|
+
const oy = ty * _chunk474IQG74cjs.TILE;
|
|
8288
|
+
ctx.putImageData(this.scratch, ox, oy, 0, 0, Math.min(_chunk474IQG74cjs.TILE, width - ox), Math.min(_chunk474IQG74cjs.TILE, height - oy));
|
|
8285
8289
|
drawn++;
|
|
8286
8290
|
}, { dirty });
|
|
8287
8291
|
return drawn;
|
|
@@ -8369,8 +8373,8 @@ function wheelPick(dx, dy, wheel, color) {
|
|
|
8369
8373
|
return rgbToHexColor(nr, ng, nb);
|
|
8370
8374
|
}
|
|
8371
8375
|
var BLEND_MENU_GROUPS = [
|
|
8372
|
-
{ label: "Standard", modes:
|
|
8373
|
-
{ label: "Paint", modes:
|
|
8376
|
+
{ label: "Standard", modes: _chunkOLNIPTB3cjs.BLEND_MODES.filter((m) => !m.painterly && m.id !== "pigment") },
|
|
8377
|
+
{ label: "Paint", modes: _chunkOLNIPTB3cjs.BLEND_MODES.filter((m) => m.painterly || m.id === "pigment") }
|
|
8374
8378
|
];
|
|
8375
8379
|
var PICKUP_SLIDERS = [
|
|
8376
8380
|
{ path: "behavior.pickup", label: "Pick-up", min: 0, max: 1, step: 0.01 },
|
|
@@ -8591,10 +8595,10 @@ function drawWaterOverlay(controller, ctx) {
|
|
|
8591
8595
|
if (!controller.getState().wet.overlay) return 0;
|
|
8592
8596
|
const tiles = controller.waterOverlayTiles({ x: 0, y: 0, width, height });
|
|
8593
8597
|
if (!tiles.length) return 0;
|
|
8594
|
-
const img = ctx.createImageData(
|
|
8598
|
+
const img = ctx.createImageData(_chunk474IQG74cjs.TILE, _chunk474IQG74cjs.TILE);
|
|
8595
8599
|
for (const t of tiles) {
|
|
8596
8600
|
img.data.set(t.data);
|
|
8597
|
-
ctx.putImageData(img, t.tx *
|
|
8601
|
+
ctx.putImageData(img, t.tx * _chunk474IQG74cjs.TILE, t.ty * _chunk474IQG74cjs.TILE, 0, 0, Math.min(_chunk474IQG74cjs.TILE, width - t.tx * _chunk474IQG74cjs.TILE), Math.min(_chunk474IQG74cjs.TILE, height - t.ty * _chunk474IQG74cjs.TILE));
|
|
8598
8602
|
}
|
|
8599
8603
|
return tiles.length;
|
|
8600
8604
|
}
|
|
@@ -8764,7 +8768,7 @@ function createPaintEffectsToolProvider(controller, options = {}) {
|
|
|
8764
8768
|
name: { type: "string", minLength: 1, description: "The layer name (default: the effect's name)." },
|
|
8765
8769
|
aboveId: { type: "string", minLength: 1, description: "Put it directly above this layer (default: above the active layer, else on top)." },
|
|
8766
8770
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0\u20131 (default 1)." },
|
|
8767
|
-
blend: { type: "string", enum:
|
|
8771
|
+
blend: { type: "string", enum: _chunkOLNIPTB3cjs.BLEND_MODES.map((m) => m.id), description: "Layer blend mode (default normal); screen or linear-dodge for light, multiply for textures." },
|
|
8768
8772
|
time: { type: "number", minimum: 0, description: "Which moment of an animated effect to draw, in ms (default 0)." }
|
|
8769
8773
|
},
|
|
8770
8774
|
required: ["effect"],
|
|
@@ -9140,4 +9144,4 @@ function createPaintEditorDocument(controller, options = {}) {
|
|
|
9140
9144
|
|
|
9141
9145
|
|
|
9142
9146
|
|
|
9143
|
-
exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BRUSH_ID = _chunkYQ5C5BVKcjs.BRUSH_ID; exports.BRUSH_ROTATIONS = _chunkYQ5C5BVKcjs.BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = _chunkYQ5C5BVKcjs.BUILTIN_BRUSHES; exports.BristleStroke = _chunkYQ5C5BVKcjs.BristleStroke; exports.DEFAULT_BEHAVIOR = _chunkYQ5C5BVKcjs.DEFAULT_BEHAVIOR; exports.DEFAULT_BRISTLE = _chunkYQ5C5BVKcjs.DEFAULT_BRISTLE; exports.DEFAULT_BRUSH_ID = _chunkYQ5C5BVKcjs.DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = _chunkYQ5C5BVKcjs.DEFAULT_DYNAMICS; exports.DEFAULT_FLOW = _chunkV7GWZIZKcjs.DEFAULT_FLOW; exports.DEFAULT_IMPASTO = _chunkYQ5C5BVKcjs.DEFAULT_IMPASTO; exports.DEFAULT_LIGHTING = DEFAULT_LIGHTING; exports.DEFAULT_MULTI_COLOR = _chunkYQ5C5BVKcjs.DEFAULT_MULTI_COLOR; exports.DEFAULT_PAINT_GRADIENT = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PAPER = _chunkYQ5C5BVKcjs.DEFAULT_PAPER; exports.DEFAULT_PARTICLE = _chunkYQ5C5BVKcjs.DEFAULT_PARTICLE; exports.DEFAULT_STICKER = _chunkYQ5C5BVKcjs.DEFAULT_STICKER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DEFAULT_WET_BRUSH = _chunkYQ5C5BVKcjs.DEFAULT_WET_BRUSH; exports.DEFAULT_WET_PARAMS = _chunkV7GWZIZKcjs.DEFAULT_WET_PARAMS; exports.DryStroke = _chunkYQ5C5BVKcjs.DryStroke; exports.GPU_LEAD = GPU_LEAD; exports.GRAIN_PATTERNS = _chunkEBDCRTZIcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkEBDCRTZIcjs.GRAIN_TILE; exports.HARMONY_KINDS = _chunkEUIDTZNQcjs.HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = _chunkYQ5C5BVKcjs.IDENTITY_COPY; exports.IMPASTO_TOOLS = _chunkYQ5C5BVKcjs.IMPASTO_TOOLS; exports.IMPASTO_TOOL_LABELS = IMPASTO_TOOL_LABELS; exports.LIGHT_SLIDERS = LIGHT_SLIDERS; exports.LitCache = LitCache; exports.MAX_BRUSH_SIZE = _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; exports.MAX_ZOOM = MAX_ZOOM; exports.MIN_CANVAS_SIDE = MIN_CANVAS_SIDE; exports.MIN_ZOOM = MIN_ZOOM; exports.MIXING_PAD_HEIGHT = MIXING_PAD_HEIGHT; exports.MIXING_PAD_WIDTH = MIXING_PAD_WIDTH; exports.MULTI_COLOR_MODES = _chunkYQ5C5BVKcjs.MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = _chunkYQ5C5BVKcjs.PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = _chunkYQ5C5BVKcjs.PAINT_BRUSH_ENGINES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_EFFECT_PLACES = PAINT_EFFECT_PLACES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_GRADIENT_FULL_SPEED = _chunkEBDCRTZIcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkEBDCRTZIcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_EFFECT_BLENDS = PAPER_EFFECT_BLENDS; exports.PAPER_EFFECT_NODE_ID = PAPER_EFFECT_NODE_ID; exports.PAPER_FAMILIES = _chunkYQ5C5BVKcjs.PAPER_FAMILIES; exports.PAPER_LIBRARY = _chunkYQ5C5BVKcjs.PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PAPER_TARGET = PAPER_TARGET; exports.PARTICLE_KINDS = _chunkYQ5C5BVKcjs.PARTICLE_KINDS; exports.PARTICLE_KIND_LABELS = PARTICLE_KIND_LABELS; exports.PARTICLE_RENDERS = _chunkYQ5C5BVKcjs.PARTICLE_RENDERS; exports.PARTICLE_RENDER_LABELS = PARTICLE_RENDER_LABELS; exports.PaintCanvasPresenter = PaintCanvasPresenter; exports.PaintDabStroke = PaintDabStroke; exports.PaintDirector = PaintDirector; exports.PaintDocumentError = PaintDocumentError; exports.PaintEditorController = PaintEditorController; exports.PaintEditorError = PaintEditorError; exports.PaintEffectsRenderer = PaintEffectsRenderer; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkEBDCRTZIcjs.PaintGradientSampler; exports.PaintPresence = PaintPresence; exports.PaintSourceError = _chunkEBDCRTZIcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaintWetLayers = PaintWetLayers; exports.PaperGrain = _chunkEBDCRTZIcjs.PaperGrain; exports.ParticleStroke = _chunkYQ5C5BVKcjs.ParticleStroke; exports.PenDabWalker = _chunkYQ5C5BVKcjs.PenDabWalker; exports.PenSmoother = _chunkYQ5C5BVKcjs.PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.STAMP_KINDS = _chunkYQ5C5BVKcjs.STAMP_KINDS; exports.STAMP_LABELS = STAMP_LABELS; exports.STENCIL_KINDS = STENCIL_KINDS; exports.STENCIL_SHAPES = STENCIL_SHAPES; exports.STICKER_SLIDERS = STICKER_SLIDERS; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.StencilSnapper = StencilSnapper; exports.StickerSpray = _chunkYQ5C5BVKcjs.StickerSpray; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.ThickStrokeDriver = ThickStrokeDriver; exports.TileableNoise = _chunkEBDCRTZIcjs.TileableNoise; exports.WET_FLOW_KINDS = _chunkV7GWZIZKcjs.WET_FLOW_KINDS; exports.WET_GPU_MODES = WET_GPU_MODES; exports.WET_GPU_OPTIONS = WET_GPU_OPTIONS; exports.WET_MEDIA = _chunkYQ5C5BVKcjs.WET_MEDIA; exports.WET_MEDIUM_LABELS = WET_MEDIUM_LABELS; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_PARAM_KEYS = _chunkV7GWZIZKcjs.WET_PARAM_KEYS; exports.WET_PARAM_SCHEMA = WET_PARAM_SCHEMA; exports.WET_PARAM_SLIDERS = WET_PARAM_SLIDERS; exports.WET_SPEED_SLIDER = WET_SPEED_SLIDER; exports.WET_TILT_SLIDERS = WET_TILT_SLIDERS; exports.WET_TOOLS = _chunkYQ5C5BVKcjs.WET_TOOLS; exports.WET_TOOL_LABELS = WET_TOOL_LABELS; exports.WetStrokeDriver = WetStrokeDriver; exports.addPaintGradientStop = _chunkEBDCRTZIcjs.addPaintGradientStop; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushEngineControls = brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushTakesPaint = _chunkYQ5C5BVKcjs.brushTakesPaint; exports.brushToJSON = _chunkYQ5C5BVKcjs.brushToJSON; exports.buildTimeLapse = buildTimeLapse; exports.checkPaintEffectPlace = checkPaintEffectPlace; exports.clonePaper = _chunkYQ5C5BVKcjs.clonePaper; exports.colorHarmony = colorHarmony2; exports.composeAffine = composeAffine; exports.contactSheet = contactSheet; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorDocument = createPaintEditorDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintEffectsToolProvider = createPaintEffectsToolProvider; exports.createPaintLayer = createPaintLayer; exports.createPaintReplayTools = createPaintReplayTools; exports.createPaintStickerTools = createPaintStickerTools; exports.createPaintThickTools = createPaintThickTools; exports.createPaintWetTools = createPaintWetTools; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.drawSticker = _chunkYQ5C5BVKcjs.drawSticker; exports.drawWaterOverlay = drawWaterOverlay; exports.effectLayersToJSON = effectLayersToJSON; exports.emptiedLayers = emptiedLayers; exports.emptyThickChannels = emptyThickChannels; exports.fitZoom = fitZoom; exports.grainCatch = _chunkEBDCRTZIcjs.grainCatch; exports.grainHeights = _chunkEBDCRTZIcjs.grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = _chunkEBDCRTZIcjs.hash2; exports.hexToPaintRgb = _chunkEBDCRTZIcjs.hexToPaintRgb; exports.hexToRgb8 = _chunkYQ5C5BVKcjs.hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = _chunkEUIDTZNQcjs.hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isGradientPaint = _chunkEBDCRTZIcjs.isGradientPaint; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetBrush = _chunkYQ5C5BVKcjs.isWetBrush; exports.isWetCapable = _chunkYQ5C5BVKcjs.isWetCapable; exports.lightTile = lightTile; exports.lightingKey = lightingKey; exports.mapPenPoint = mapPenPoint; exports.mix32 = _chunkEBDCRTZIcjs.mix32; exports.mixPixels = mixPixels; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = _chunkYQ5C5BVKcjs.mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = multiColorSliders; exports.multiColorToPaint = _chunkYQ5C5BVKcjs.multiColorToPaint; exports.newPaintLayerId = newPaintLayerId; exports.nextPaperEffectVersion = nextPaperEffectVersion; exports.normalizeBehavior = _chunkYQ5C5BVKcjs.normalizeBehavior; exports.normalizeBristle = _chunkYQ5C5BVKcjs.normalizeBristle; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = _chunkYQ5C5BVKcjs.normalizeDynamics; exports.normalizeFlow = _chunkV7GWZIZKcjs.normalizeFlow; exports.normalizeHexColor = _chunkEBDCRTZIcjs.normalizeHexColor; exports.normalizeImpasto = _chunkYQ5C5BVKcjs.normalizeImpasto; exports.normalizeLighting = normalizeLighting; exports.normalizeMultiColor = _chunkYQ5C5BVKcjs.normalizeMultiColor; exports.normalizePaintBrush = _chunkYQ5C5BVKcjs.normalizePaintBrush; exports.normalizePaper = _chunkYQ5C5BVKcjs.normalizePaper; exports.normalizeParticle = _chunkYQ5C5BVKcjs.normalizeParticle; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeStencil = normalizeStencil; exports.normalizeStickerSettings = _chunkYQ5C5BVKcjs.normalizeStickerSettings; exports.normalizeStickerUpdate = _chunkYQ5C5BVKcjs.normalizeStickerUpdate; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.normalizeWetBrush = _chunkYQ5C5BVKcjs.normalizeWetBrush; exports.normalizeWetParams = _chunkV7GWZIZKcjs.normalizeWetParams; exports.overPixels = overPixels; exports.padSampleRadius = padSampleRadius; exports.paintGradientMappingFor = _chunkEBDCRTZIcjs.paintGradientMappingFor; exports.paintPlaybackPanel = paintPlaybackPanel; exports.paintSourceColor = _chunkEBDCRTZIcjs.paintSourceColor; exports.paintSourceCss = _chunkEBDCRTZIcjs.paintSourceCss; exports.paintToMultiColor = _chunkYQ5C5BVKcjs.paintToMultiColor; exports.paperEffectFromJSON = paperEffectFromJSON; exports.paperEffectToJSON = paperEffectToJSON; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = _chunkYQ5C5BVKcjs.paperPreset; exports.parseBrushLibrary = _chunkYQ5C5BVKcjs.parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.parsePaintSource = _chunkEBDCRTZIcjs.parsePaintSource; exports.patchBrushValue = patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = _chunkYQ5C5BVKcjs.penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.planPaintToolPlayback = planPaintToolPlayback; exports.pointerToPenPoint = pointerToPenPoint; exports.quickStencil = quickStencil; exports.rand01 = _chunkEBDCRTZIcjs.rand01; exports.randSigned = _chunkEBDCRTZIcjs.randSigned; exports.readPaintEffectSource = readPaintEffectSource; exports.readPaintSource = _chunkEBDCRTZIcjs.readPaintSource; exports.readPath = readPath; exports.readSwatch = readSwatch; exports.reliefInfo = reliefInfo; exports.removePaintGradientStop = _chunkEBDCRTZIcjs.removePaintGradientStop; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = _chunkYQ5C5BVKcjs.renderPaper; exports.renderStickers = _chunkYQ5C5BVKcjs.renderStickers; exports.replayFrame = replayFrame; exports.replayItems = replayItems; exports.replayPainting = replayPainting; exports.resolvePaintGradient = _chunkEBDCRTZIcjs.resolvePaintGradient; exports.reversePaintGradient = _chunkEBDCRTZIcjs.reversePaintGradient; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.samplePressure = samplePressure; exports.scalePaintGradient = _chunkEBDCRTZIcjs.scalePaintGradient; exports.scaleStencil = scaleStencil; exports.screenToDocument = screenToDocument; exports.seedFromString = _chunkEBDCRTZIcjs.seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.solidPaint = _chunkEBDCRTZIcjs.solidPaint; exports.stampCoverage = _chunkYQ5C5BVKcjs.stampCoverage; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.startWetClock = startWetClock; exports.stencilMask = stencilMask; exports.stencilOutline = stencilOutline; exports.stickerRect = _chunkYQ5C5BVKcjs.stickerRect; exports.stickerSurface = _chunkYQ5C5BVKcjs.stickerSurface; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thickFromJSON = thickFromJSON; exports.thickToJSON = thickToJSON; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = _chunkYQ5C5BVKcjs.tiltToOrientation; exports.timeLapseVideo = timeLapseVideo; exports.timeLapseZip = timeLapseZip; exports.toStrokePoint = _chunkYQ5C5BVKcjs.toStrokePoint; exports.toggleStamp = toggleStamp; exports.translateStencil = translateStencil; exports.updatePaintGradientStop = _chunkEBDCRTZIcjs.updatePaintGradientStop; exports.usesPaintExchange = _chunkYQ5C5BVKcjs.usesPaintExchange; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wetEngineSummary = wetEngineSummary; exports.wetPaperInput = wetPaperInput; exports.wetPigmentOf = wetPigmentOf; exports.wetSupport = _chunkV7GWZIZKcjs.wetSupport; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = _chunkEUIDTZNQcjs.wheelToHue; exports.withPaintPlayback = withPaintPlayback;
|
|
9147
|
+
exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BRUSH_ID = _chunkROVK6AXXcjs.BRUSH_ID; exports.BRUSH_ROTATIONS = _chunkROVK6AXXcjs.BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = _chunkROVK6AXXcjs.BUILTIN_BRUSHES; exports.BristleStroke = _chunkROVK6AXXcjs.BristleStroke; exports.DEFAULT_BEHAVIOR = _chunkROVK6AXXcjs.DEFAULT_BEHAVIOR; exports.DEFAULT_BRISTLE = _chunkROVK6AXXcjs.DEFAULT_BRISTLE; exports.DEFAULT_BRUSH_ID = _chunkROVK6AXXcjs.DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = _chunkROVK6AXXcjs.DEFAULT_DYNAMICS; exports.DEFAULT_FLOW = _chunkKWNMBMKGcjs.DEFAULT_FLOW; exports.DEFAULT_IMPASTO = _chunkROVK6AXXcjs.DEFAULT_IMPASTO; exports.DEFAULT_LIGHTING = DEFAULT_LIGHTING; exports.DEFAULT_MULTI_COLOR = _chunkROVK6AXXcjs.DEFAULT_MULTI_COLOR; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PAPER = _chunkROVK6AXXcjs.DEFAULT_PAPER; exports.DEFAULT_PARTICLE = _chunkROVK6AXXcjs.DEFAULT_PARTICLE; exports.DEFAULT_STICKER = _chunkROVK6AXXcjs.DEFAULT_STICKER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DEFAULT_WET_BRUSH = _chunkROVK6AXXcjs.DEFAULT_WET_BRUSH; exports.DEFAULT_WET_PARAMS = _chunkKWNMBMKGcjs.DEFAULT_WET_PARAMS; exports.DryStroke = _chunkROVK6AXXcjs.DryStroke; exports.GPU_LEAD = GPU_LEAD; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.HARMONY_KINDS = _chunkEUIDTZNQcjs.HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = _chunkROVK6AXXcjs.IDENTITY_COPY; exports.IMPASTO_TOOLS = _chunkROVK6AXXcjs.IMPASTO_TOOLS; exports.IMPASTO_TOOL_LABELS = IMPASTO_TOOL_LABELS; exports.LIGHT_SLIDERS = LIGHT_SLIDERS; exports.LitCache = LitCache; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; exports.MAX_ZOOM = MAX_ZOOM; exports.MIN_CANVAS_SIDE = MIN_CANVAS_SIDE; exports.MIN_ZOOM = MIN_ZOOM; exports.MIXING_PAD_HEIGHT = MIXING_PAD_HEIGHT; exports.MIXING_PAD_WIDTH = MIXING_PAD_WIDTH; exports.MULTI_COLOR_MODES = _chunkROVK6AXXcjs.MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = _chunkROVK6AXXcjs.PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = _chunkROVK6AXXcjs.PAINT_BRUSH_ENGINES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_EFFECT_PLACES = PAINT_EFFECT_PLACES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_EFFECT_BLENDS = PAPER_EFFECT_BLENDS; exports.PAPER_EFFECT_NODE_ID = PAPER_EFFECT_NODE_ID; exports.PAPER_FAMILIES = _chunkROVK6AXXcjs.PAPER_FAMILIES; exports.PAPER_LIBRARY = _chunkROVK6AXXcjs.PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PAPER_TARGET = PAPER_TARGET; exports.PARTICLE_KINDS = _chunkROVK6AXXcjs.PARTICLE_KINDS; exports.PARTICLE_KIND_LABELS = PARTICLE_KIND_LABELS; exports.PARTICLE_RENDERS = _chunkROVK6AXXcjs.PARTICLE_RENDERS; exports.PARTICLE_RENDER_LABELS = PARTICLE_RENDER_LABELS; exports.PaintCanvasPresenter = PaintCanvasPresenter; exports.PaintDabStroke = PaintDabStroke; exports.PaintDirector = PaintDirector; exports.PaintDocumentError = PaintDocumentError; exports.PaintEditorController = PaintEditorController; exports.PaintEditorError = PaintEditorError; exports.PaintEffectsRenderer = PaintEffectsRenderer; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintPresence = PaintPresence; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaintWetLayers = PaintWetLayers; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.ParticleStroke = _chunkROVK6AXXcjs.ParticleStroke; exports.PenDabWalker = _chunkROVK6AXXcjs.PenDabWalker; exports.PenSmoother = _chunkROVK6AXXcjs.PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.STAMP_KINDS = _chunkROVK6AXXcjs.STAMP_KINDS; exports.STAMP_LABELS = STAMP_LABELS; exports.STENCIL_KINDS = STENCIL_KINDS; exports.STENCIL_SHAPES = STENCIL_SHAPES; exports.STICKER_SLIDERS = STICKER_SLIDERS; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.StencilSnapper = StencilSnapper; exports.StickerSpray = _chunkROVK6AXXcjs.StickerSpray; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.ThickStrokeDriver = ThickStrokeDriver; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.WET_FLOW_KINDS = _chunkKWNMBMKGcjs.WET_FLOW_KINDS; exports.WET_GPU_MODES = WET_GPU_MODES; exports.WET_GPU_OPTIONS = WET_GPU_OPTIONS; exports.WET_MEDIA = _chunkROVK6AXXcjs.WET_MEDIA; exports.WET_MEDIUM_LABELS = WET_MEDIUM_LABELS; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_PARAM_KEYS = _chunkKWNMBMKGcjs.WET_PARAM_KEYS; exports.WET_PARAM_SCHEMA = WET_PARAM_SCHEMA; exports.WET_PARAM_SLIDERS = WET_PARAM_SLIDERS; exports.WET_SPEED_SLIDER = WET_SPEED_SLIDER; exports.WET_TILT_SLIDERS = WET_TILT_SLIDERS; exports.WET_TOOLS = _chunkROVK6AXXcjs.WET_TOOLS; exports.WET_TOOL_LABELS = WET_TOOL_LABELS; exports.WetStrokeDriver = WetStrokeDriver; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushEngineControls = brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushTakesPaint = _chunkROVK6AXXcjs.brushTakesPaint; exports.brushToJSON = _chunkROVK6AXXcjs.brushToJSON; exports.buildTimeLapse = buildTimeLapse; exports.checkPaintEffectPlace = checkPaintEffectPlace; exports.clonePaper = _chunkROVK6AXXcjs.clonePaper; exports.colorHarmony = colorHarmony2; exports.composeAffine = composeAffine; exports.contactSheet = contactSheet; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorDocument = createPaintEditorDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintEffectsToolProvider = createPaintEffectsToolProvider; exports.createPaintLayer = createPaintLayer; exports.createPaintReplayTools = createPaintReplayTools; exports.createPaintStickerTools = createPaintStickerTools; exports.createPaintThickTools = createPaintThickTools; exports.createPaintWetTools = createPaintWetTools; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.drawSticker = _chunkROVK6AXXcjs.drawSticker; exports.drawWaterOverlay = drawWaterOverlay; exports.effectLayersToJSON = effectLayersToJSON; exports.emptiedLayers = emptiedLayers; exports.emptyThickChannels = emptyThickChannels; exports.fitZoom = fitZoom; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb8 = _chunkROVK6AXXcjs.hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = _chunkEUIDTZNQcjs.hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetBrush = _chunkROVK6AXXcjs.isWetBrush; exports.isWetCapable = _chunkROVK6AXXcjs.isWetCapable; exports.lightTile = lightTile; exports.lightingKey = lightingKey; exports.mapPenPoint = mapPenPoint; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPixels = mixPixels; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = _chunkROVK6AXXcjs.mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = multiColorSliders; exports.multiColorToPaint = _chunkROVK6AXXcjs.multiColorToPaint; exports.newPaintLayerId = newPaintLayerId; exports.nextPaperEffectVersion = nextPaperEffectVersion; exports.normalizeBehavior = _chunkROVK6AXXcjs.normalizeBehavior; exports.normalizeBristle = _chunkROVK6AXXcjs.normalizeBristle; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = _chunkROVK6AXXcjs.normalizeDynamics; exports.normalizeFlow = _chunkKWNMBMKGcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeImpasto = _chunkROVK6AXXcjs.normalizeImpasto; exports.normalizeLighting = normalizeLighting; exports.normalizeMultiColor = _chunkROVK6AXXcjs.normalizeMultiColor; exports.normalizePaintBrush = _chunkROVK6AXXcjs.normalizePaintBrush; exports.normalizePaper = _chunkROVK6AXXcjs.normalizePaper; exports.normalizeParticle = _chunkROVK6AXXcjs.normalizeParticle; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeStencil = normalizeStencil; exports.normalizeStickerSettings = _chunkROVK6AXXcjs.normalizeStickerSettings; exports.normalizeStickerUpdate = _chunkROVK6AXXcjs.normalizeStickerUpdate; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.normalizeWetBrush = _chunkROVK6AXXcjs.normalizeWetBrush; exports.normalizeWetParams = _chunkKWNMBMKGcjs.normalizeWetParams; exports.overPixels = overPixels; exports.padSampleRadius = padSampleRadius; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPlaybackPanel = paintPlaybackPanel; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paintToMultiColor = _chunkROVK6AXXcjs.paintToMultiColor; exports.paperEffectFromJSON = paperEffectFromJSON; exports.paperEffectToJSON = paperEffectToJSON; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = _chunkROVK6AXXcjs.paperPreset; exports.parseBrushLibrary = _chunkROVK6AXXcjs.parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.patchBrushValue = patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = _chunkROVK6AXXcjs.penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.planPaintToolPlayback = planPaintToolPlayback; exports.pointerToPenPoint = pointerToPenPoint; exports.quickStencil = quickStencil; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.readPaintEffectSource = readPaintEffectSource; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPath = readPath; exports.readSwatch = readSwatch; exports.reliefInfo = reliefInfo; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = _chunkROVK6AXXcjs.renderPaper; exports.renderStickers = _chunkROVK6AXXcjs.renderStickers; exports.replayFrame = replayFrame; exports.replayItems = replayItems; exports.replayPainting = replayPainting; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.samplePressure = samplePressure; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.scaleStencil = scaleStencil; exports.screenToDocument = screenToDocument; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.stampCoverage = _chunkROVK6AXXcjs.stampCoverage; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startWetClock = startWetClock; exports.stencilMask = stencilMask; exports.stencilOutline = stencilOutline; exports.stickerRect = _chunkROVK6AXXcjs.stickerRect; exports.stickerSurface = _chunkROVK6AXXcjs.stickerSurface; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thickFromJSON = thickFromJSON; exports.thickToJSON = thickToJSON; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = _chunkROVK6AXXcjs.tiltToOrientation; exports.timeLapseVideo = timeLapseVideo; exports.timeLapseZip = timeLapseZip; exports.toStrokePoint = _chunkROVK6AXXcjs.toStrokePoint; exports.toggleStamp = toggleStamp; exports.translateStencil = translateStencil; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.usesPaintExchange = _chunkROVK6AXXcjs.usesPaintExchange; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wetEngineSummary = wetEngineSummary; exports.wetPaperInput = wetPaperInput; exports.wetPigmentOf = wetPigmentOf; exports.wetSupport = _chunkKWNMBMKGcjs.wetSupport; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = _chunkEUIDTZNQcjs.wheelToHue; exports.withPaintPlayback = withPaintPlayback;
|