@pixerate/editor 0.116.0 → 0.117.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/{chunk-ZYZGEILO.cjs → chunk-2J3LS7JZ.cjs} +203 -203
- package/dist/{chunk-ZYZGEILO.cjs.map → chunk-2J3LS7JZ.cjs.map} +1 -1
- package/dist/{chunk-TFOPHZ3U.cjs → chunk-7ISPWEJA.cjs} +302 -5
- package/dist/chunk-7ISPWEJA.cjs.map +1 -0
- package/dist/{chunk-2UT4GXYA.cjs → chunk-BYAWOAST.cjs} +109 -41
- package/dist/chunk-BYAWOAST.cjs.map +1 -0
- package/dist/{chunk-PAOWHJ5O.cjs → chunk-EBSYZRSW.cjs} +217 -400
- package/dist/chunk-EBSYZRSW.cjs.map +1 -0
- package/dist/{chunk-XK5LZKBD.js → chunk-HKDTM6VC.js} +298 -1
- package/dist/chunk-HKDTM6VC.js.map +1 -0
- package/dist/{chunk-D53VQGEJ.js → chunk-IVSNUXW7.js} +79 -2
- package/dist/chunk-IVSNUXW7.js.map +1 -0
- package/dist/{chunk-ARQ7PQ6Q.js → chunk-JHXMNOMF.js} +71 -3
- package/dist/chunk-JHXMNOMF.js.map +1 -0
- package/dist/{chunk-HOCPSFGA.cjs → chunk-L2T6EJ5S.cjs} +154 -77
- package/dist/chunk-L2T6EJ5S.cjs.map +1 -0
- package/dist/{chunk-SEBYNBHW.js → chunk-R2JE6SA7.js} +9 -9
- package/dist/{chunk-D53KSJUV.js → chunk-VD2UDVF7.js} +100 -283
- package/dist/chunk-VD2UDVF7.js.map +1 -0
- package/dist/{export-BXxSGBCq.d.cts → export-DMOuzgZZ.d.cts} +8 -3
- package/dist/{export-Dm44YUvS.d.ts → export-Dul1SbPv.d.ts} +8 -3
- package/dist/{flow-COCB42TP.d.cts → flow-4-OC-UkQ.d.cts} +22 -1
- package/dist/{flow-BMtHAmg4.d.ts → flow-Cb7lkPm8.d.ts} +22 -1
- package/dist/image-editor/index.cjs +1112 -1024
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +6 -6
- package/dist/image-editor/index.d.ts +6 -6
- package/dist/image-editor/index.js +124 -36
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint/index.cjs +8 -4
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint/index.js +7 -3
- package/dist/paint-editor/index.cjs +242 -242
- package/dist/paint-editor/index.d.cts +4 -4
- package/dist/paint-editor/index.d.ts +4 -4
- package/dist/paint-editor/index.js +4 -4
- package/dist/raster/index.cjs +6 -4
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.d.cts +2 -2
- package/dist/raster/index.d.ts +2 -2
- package/dist/raster/index.js +27 -25
- package/dist/{render-CrmHOgpo.d.ts → render-B05K68_h.d.ts} +9 -1
- package/dist/{render-B1K_OoLy.d.cts → render-DnAbIKcs.d.cts} +9 -1
- package/dist/vector/index.cjs +11272 -10183
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +135 -1
- package/dist/vector/index.d.ts +135 -1
- package/dist/vector/index.js +11179 -10090
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-2UT4GXYA.cjs.map +0 -1
- package/dist/chunk-ARQ7PQ6Q.js.map +0 -1
- package/dist/chunk-D53KSJUV.js.map +0 -1
- package/dist/chunk-D53VQGEJ.js.map +0 -1
- package/dist/chunk-HOCPSFGA.cjs.map +0 -1
- package/dist/chunk-PAOWHJ5O.cjs.map +0 -1
- package/dist/chunk-TFOPHZ3U.cjs.map +0 -1
- package/dist/chunk-XK5LZKBD.js.map +0 -1
- /package/dist/{chunk-SEBYNBHW.js.map → chunk-R2JE6SA7.js.map} +0 -0
|
@@ -7,7 +7,7 @@ var _chunkSMJGE7HMcjs = require('../chunk-SMJGE7HM.cjs');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk2J3LS7JZcjs = require('../chunk-2J3LS7JZ.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ var _chunkZYZGEILOcjs = require('../chunk-ZYZGEILO.cjs');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkEBSYZRSWcjs = require('../chunk-EBSYZRSW.cjs');
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
@@ -68,7 +68,7 @@ var _chunkEJVDBITDcjs = require('../chunk-EJVDBITD.cjs');
|
|
|
68
68
|
|
|
69
69
|
|
|
70
70
|
|
|
71
|
-
var
|
|
71
|
+
var _chunkL2T6EJ5Scjs = require('../chunk-L2T6EJ5S.cjs');
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
@@ -90,7 +90,7 @@ var _chunkHOCPSFGAcjs = require('../chunk-HOCPSFGA.cjs');
|
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
|
|
93
|
-
var
|
|
93
|
+
var _chunk7ISPWEJAcjs = require('../chunk-7ISPWEJA.cjs');
|
|
94
94
|
require('../chunk-G5NMLUVF.cjs');
|
|
95
95
|
require('../chunk-643B2HKC.cjs');
|
|
96
96
|
|
|
@@ -481,7 +481,7 @@ function newPaintLayerId() {
|
|
|
481
481
|
return `pl${Date.now().toString(36)}${(nextId++).toString(36)}`;
|
|
482
482
|
}
|
|
483
483
|
function createPaintLayer(name, id = newPaintLayerId()) {
|
|
484
|
-
return { type: "pixel", id, name, visible: true, opacity: 1, blend: "normal", surface:
|
|
484
|
+
return { type: "pixel", id, name, visible: true, opacity: 1, blend: "normal", surface: _chunk7ISPWEJAcjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } };
|
|
485
485
|
}
|
|
486
486
|
var PaintDocumentError = class extends Error {
|
|
487
487
|
constructor(message) {
|
|
@@ -717,7 +717,7 @@ var DryStroke = (_class5 = class {
|
|
|
717
717
|
}
|
|
718
718
|
|
|
719
719
|
|
|
720
|
-
__init12() {this.coverage = new (0,
|
|
720
|
+
__init12() {this.coverage = new (0, _chunkL2T6EJ5Scjs.CoverageMap)()}
|
|
721
721
|
__init13() {this.dabCount = 0}
|
|
722
722
|
|
|
723
723
|
|
|
@@ -751,11 +751,11 @@ var DryStroke = (_class5 = class {
|
|
|
751
751
|
const hardness = this.brush.tip.hardness;
|
|
752
752
|
const grain = this.options.grain;
|
|
753
753
|
for (const d of dabs) {
|
|
754
|
-
const rect =
|
|
754
|
+
const rect = _chunkL2T6EJ5Scjs.dabRect.call(void 0, d, hardness);
|
|
755
755
|
const n = rect.width * rect.height;
|
|
756
756
|
if (this.buf.length < n) this.buf = new Float32Array(n);
|
|
757
757
|
const vals = this.buf.subarray(0, n);
|
|
758
|
-
|
|
758
|
+
_chunkL2T6EJ5Scjs.rasterizeDab.call(void 0, d, hardness, rect, vals);
|
|
759
759
|
if (this.depth > 0 && grain) {
|
|
760
760
|
for (let yy = 0, k = 0; yy < rect.height; yy++) {
|
|
761
761
|
const y = rect.y + yy + 0.5;
|
|
@@ -905,7 +905,7 @@ var StickerSpray = (_class6 = class {
|
|
|
905
905
|
const spacing = Math.max(0.05, 1 / Math.max(0.05, b.sticker.density * 4));
|
|
906
906
|
const walk = { ...b, tip: { ...b.tip, spacing }, dynamics: { ...b.dynamics, scatter: 0, sizeJitter: 0, angleJitter: 0 } };
|
|
907
907
|
this.walkers = this.copies.map((c, i) => new PenDabWalker(walk, init.seed + i * 7919 | 0, c.linear));
|
|
908
|
-
this.medium = new (0,
|
|
908
|
+
this.medium = new (0, _chunkL2T6EJ5Scjs.TileMedium)(init.target, {});
|
|
909
909
|
this.next = init.nextId;
|
|
910
910
|
}
|
|
911
911
|
|
|
@@ -969,7 +969,7 @@ var StickerSpray = (_class6 = class {
|
|
|
969
969
|
}
|
|
970
970
|
}, _class6);
|
|
971
971
|
function renderStickers(stickers, target) {
|
|
972
|
-
const medium = new (0,
|
|
972
|
+
const medium = new (0, _chunkL2T6EJ5Scjs.TileMedium)(target, {});
|
|
973
973
|
for (const s of stickers) drawSticker(medium, s);
|
|
974
974
|
}
|
|
975
975
|
function normalizeStickerUpdate(u) {
|
|
@@ -1006,21 +1006,21 @@ function stickerSurface(stickers) {
|
|
|
1006
1006
|
offset: { x: 0, y: 0 },
|
|
1007
1007
|
lockTransparency: false,
|
|
1008
1008
|
selection: null,
|
|
1009
|
-
readTile: (tx, ty) => _nullishCoalesce(live.get(
|
|
1009
|
+
readTile: (tx, ty) => _nullishCoalesce(live.get(_chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty)), () => ( null)),
|
|
1010
1010
|
writeTile: (tx, ty) => {
|
|
1011
|
-
const k =
|
|
1011
|
+
const k = _chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty);
|
|
1012
1012
|
let t = live.get(k);
|
|
1013
|
-
if (!t) live.set(k, t = new Uint8ClampedArray(
|
|
1013
|
+
if (!t) live.set(k, t = new Uint8ClampedArray(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * 4));
|
|
1014
1014
|
return t;
|
|
1015
1015
|
}
|
|
1016
1016
|
};
|
|
1017
1017
|
renderStickers(stickers, target);
|
|
1018
1018
|
const tiles = /* @__PURE__ */ new Map();
|
|
1019
1019
|
for (const [k, d] of live) {
|
|
1020
|
-
const t =
|
|
1020
|
+
const t = _chunk7ISPWEJAcjs.finishTile.call(void 0, d, 4, 0);
|
|
1021
1021
|
if (t) tiles.set(k, t);
|
|
1022
1022
|
}
|
|
1023
|
-
return new (0,
|
|
1023
|
+
return new (0, _chunk7ISPWEJAcjs.TiledSurface)(4, tiles, 0);
|
|
1024
1024
|
}
|
|
1025
1025
|
|
|
1026
1026
|
// src/paint-editor/procedural.ts
|
|
@@ -1038,7 +1038,7 @@ var MarkStroke = (_class7 = class {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
|
|
1040
1040
|
|
|
1041
|
-
__init21() {this.coverage = new (0,
|
|
1041
|
+
__init21() {this.coverage = new (0, _chunkL2T6EJ5Scjs.CoverageMap)()}
|
|
1042
1042
|
__init22() {this.dabCount = 0}
|
|
1043
1043
|
|
|
1044
1044
|
|
|
@@ -1079,12 +1079,12 @@ var MarkStroke = (_class7 = class {
|
|
|
1079
1079
|
if (!(r > 0.05) || !(alpha > 0)) return;
|
|
1080
1080
|
const dab = { x, y, radius: Math.max(0.5, r), alpha: Math.min(1, alpha), opacity: Math.min(1, opacity), angle: 0, roundness: 1 };
|
|
1081
1081
|
const hardness = this.brush.tip.hardness;
|
|
1082
|
-
const rect =
|
|
1082
|
+
const rect = _chunkL2T6EJ5Scjs.dabRect.call(void 0, dab, hardness);
|
|
1083
1083
|
const n = rect.width * rect.height;
|
|
1084
1084
|
if (n <= 0) return;
|
|
1085
1085
|
if (this.buf.length < n) this.buf = new Float32Array(n);
|
|
1086
1086
|
const vals = this.buf.subarray(0, n);
|
|
1087
|
-
|
|
1087
|
+
_chunkL2T6EJ5Scjs.rasterizeDab.call(void 0, dab, hardness, rect, vals);
|
|
1088
1088
|
const grain = this.options.grain;
|
|
1089
1089
|
if (this.depth > 0 && grain) {
|
|
1090
1090
|
for (let yy = 0, k = 0; yy < rect.height; yy++)
|
|
@@ -1438,7 +1438,7 @@ function normalizePaintBrush(raw = {}, base) {
|
|
|
1438
1438
|
if (rb.dirty !== void 0) mixerIn.cleanEachStroke = !rb.dirty;
|
|
1439
1439
|
if (rb.mixing !== void 0) mixerIn.mixing = rb.mixing;
|
|
1440
1440
|
}
|
|
1441
|
-
const mixer =
|
|
1441
|
+
const mixer = _chunkL2T6EJ5Scjs.normalizeMixer.call(void 0, mixerIn);
|
|
1442
1442
|
let behavior = normalizeBehavior(rb, b.behavior);
|
|
1443
1443
|
if (engine === "mixer") behavior = { ...behavior, pickup: mixer.wet, mix: mixer.mix, dirty: !mixer.cleanEachStroke, mixing: mixer.mixing };
|
|
1444
1444
|
return {
|
|
@@ -1446,7 +1446,7 @@ function normalizePaintBrush(raw = {}, base) {
|
|
|
1446
1446
|
name: typeof raw.name === "string" && raw.name.trim() ? raw.name.trim().slice(0, 80) : b.name,
|
|
1447
1447
|
category: PAINT_BRUSH_CATEGORIES.includes(raw.category) ? raw.category : b.category,
|
|
1448
1448
|
engine,
|
|
1449
|
-
tip:
|
|
1449
|
+
tip: _chunkL2T6EJ5Scjs.normalizeBrush.call(void 0, { ...b.tip, ..._nullishCoalesce(raw.tip, () => ( {})) }),
|
|
1450
1450
|
grain: unit4(raw.grain, b.grain),
|
|
1451
1451
|
pressureSmoothing: range(raw.pressureSmoothing, 0, 0.95, b.pressureSmoothing),
|
|
1452
1452
|
rotation: BRUSH_ROTATIONS.includes(raw.rotation) ? raw.rotation : b.rotation,
|
|
@@ -1454,8 +1454,8 @@ function normalizePaintBrush(raw = {}, base) {
|
|
|
1454
1454
|
mixer,
|
|
1455
1455
|
loadsColor: typeof raw.loadsColor === "boolean" ? raw.loadsColor : b.loadsColor,
|
|
1456
1456
|
behavior,
|
|
1457
|
-
blender:
|
|
1458
|
-
smudge:
|
|
1457
|
+
blender: _chunkL2T6EJ5Scjs.normalizeBlender.call(void 0, _nullishCoalesce(raw.blender, () => ( {})), b.blender),
|
|
1458
|
+
smudge: _chunkL2T6EJ5Scjs.normalizeSmudge.call(void 0, _nullishCoalesce(raw.smudge, () => ( {})), b.smudge),
|
|
1459
1459
|
wet: normalizeWetBrush(_nullishCoalesce(raw.wet, () => ( {})), _nullishCoalesce(b.wet, () => ( DEFAULT_WET_BRUSH))),
|
|
1460
1460
|
impasto: normalizeImpasto(_nullishCoalesce(raw.impasto, () => ( {})), _nullishCoalesce(b.impasto, () => ( DEFAULT_IMPASTO))),
|
|
1461
1461
|
particle: normalizeParticle(_nullishCoalesce(raw.particle, () => ( {})), _nullishCoalesce(b.particle, () => ( DEFAULT_PARTICLE))),
|
|
@@ -1469,16 +1469,16 @@ var BASE_BRUSH = {
|
|
|
1469
1469
|
name: "Round",
|
|
1470
1470
|
category: "custom",
|
|
1471
1471
|
engine: "dab",
|
|
1472
|
-
tip: { ...
|
|
1472
|
+
tip: { ..._chunkL2T6EJ5Scjs.DEFAULT_BRUSH },
|
|
1473
1473
|
grain: 0,
|
|
1474
1474
|
pressureSmoothing: 0,
|
|
1475
1475
|
rotation: "fixed",
|
|
1476
1476
|
dynamics: { ...DEFAULT_DYNAMICS },
|
|
1477
|
-
mixer: { ...
|
|
1477
|
+
mixer: { ..._chunkL2T6EJ5Scjs.DEFAULT_MIXER },
|
|
1478
1478
|
loadsColor: true,
|
|
1479
1479
|
behavior: { ...DEFAULT_BEHAVIOR, multicolor: { ...DEFAULT_MULTI_COLOR, colors: [] } },
|
|
1480
|
-
blender: { ...
|
|
1481
|
-
smudge: { ...
|
|
1480
|
+
blender: { ..._chunkL2T6EJ5Scjs.DEFAULT_BLENDER },
|
|
1481
|
+
smudge: { ..._chunkL2T6EJ5Scjs.DEFAULT_SMUDGE },
|
|
1482
1482
|
wet: { ...DEFAULT_WET_BRUSH },
|
|
1483
1483
|
impasto: { ...DEFAULT_IMPASTO },
|
|
1484
1484
|
particle: { ...DEFAULT_PARTICLE },
|
|
@@ -1995,7 +1995,7 @@ function mixRgb(a, b, t, mixing) {
|
|
|
1995
1995
|
if (mixing === "pigment") {
|
|
1996
1996
|
const o = [0, 0, 0];
|
|
1997
1997
|
const q = (v) => Math.round(Math.min(1, Math.max(0, v)) * 255);
|
|
1998
|
-
|
|
1998
|
+
_chunk7ISPWEJAcjs.mixPigment8.call(void 0, q(a[0]), q(a[1]), q(a[2]), q(b[0]), q(b[1]), q(b[2]), t, o);
|
|
1999
1999
|
return [o[0], o[1], o[2]];
|
|
2000
2000
|
}
|
|
2001
2001
|
return [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t, a[2] + (b[2] - a[2]) * t];
|
|
@@ -2027,20 +2027,20 @@ var PaintDabStroke = (_class9 = class {
|
|
|
2027
2027
|
this.smoother = new PenSmoother(brush.tip.smoothing, brush.pressureSmoothing);
|
|
2028
2028
|
this.copies = _optionalChain([options, 'access', _7 => _7.copies, 'optionalAccess', _8 => _8.length]) ? options.copies : [IDENTITY_COPY];
|
|
2029
2029
|
const exchanging = brush.engine === "mixer" || brush.engine === "dab";
|
|
2030
|
-
const rates = brush.engine === "mixer" ?
|
|
2030
|
+
const rates = brush.engine === "mixer" ? _chunkL2T6EJ5Scjs.mixerRates.call(void 0, brush.mixer) : _chunkL2T6EJ5Scjs.exchangeRates.call(void 0, brush.behavior.pickup, brush.behavior.mix, 1, brush.behavior.mixing);
|
|
2031
2031
|
this.mixing = brush.engine === "mixer" ? brush.mixer.mixing : brush.behavior.mixing;
|
|
2032
2032
|
this.states = this.copies.map((c, i) => ({
|
|
2033
2033
|
walker: new PenDabWalker(brush, (_nullishCoalesce(options.seed, () => ( 0))) + i * 7919 | 0, c.linear),
|
|
2034
|
-
exchange: exchanging ? new (0,
|
|
2035
|
-
smudge: brush.engine === "smudge" ? new (0,
|
|
2034
|
+
exchange: exchanging ? new (0, _chunkL2T6EJ5Scjs.PaintExchange)(rates, options.load) : null,
|
|
2035
|
+
smudge: brush.engine === "smudge" ? new (0, _chunkL2T6EJ5Scjs.SmudgeTip)(brush.smudge, brush.tip.size * (1 + brush.dynamics.tiltSize * 1.5)) : null
|
|
2036
2036
|
}));
|
|
2037
|
-
this.medium = new (0,
|
|
2037
|
+
this.medium = new (0, _chunkL2T6EJ5Scjs.TileMedium)(options.target, brush.engine === "dab" ? { blend: brush.tip.blend } : {});
|
|
2038
2038
|
this.depth = options.grain && !options.grain.flat ? Math.min(1, Math.max(0, options.paperDepth * brush.grain)) : 0;
|
|
2039
|
-
this.coverage = brush.engine === "dab" ? new (0,
|
|
2039
|
+
this.coverage = brush.engine === "dab" ? new (0, _chunkL2T6EJ5Scjs.CoverageMap)() : null;
|
|
2040
2040
|
const mc = brush.behavior.multicolor;
|
|
2041
2041
|
this.palette = exchanging && mc.mode !== "off" ? multiColorPalette(mc, options.color, options.secondary) : null;
|
|
2042
2042
|
this.gradient = this.palette && mc.mode === "tip" ? multiColorGradient(this.palette, mc.softness, this.mixing) : null;
|
|
2043
|
-
this.scratch = brush.engine === "blender" ?
|
|
2043
|
+
this.scratch = brush.engine === "blender" ? _chunkL2T6EJ5Scjs.createBlenderScratch.call(void 0, ) : null;
|
|
2044
2044
|
}
|
|
2045
2045
|
|
|
2046
2046
|
|
|
@@ -2095,7 +2095,7 @@ var PaintDabStroke = (_class9 = class {
|
|
|
2095
2095
|
}
|
|
2096
2096
|
paintDabs(copy, dabs, rects) {
|
|
2097
2097
|
for (const d of dabs) {
|
|
2098
|
-
const rect =
|
|
2098
|
+
const rect = _chunkL2T6EJ5Scjs.dabRect.call(void 0, d, this.brush.tip.hardness);
|
|
2099
2099
|
if (rect.width <= 0 || rect.height <= 0) continue;
|
|
2100
2100
|
this.dab(copy, d, rect);
|
|
2101
2101
|
rects.push(rect);
|
|
@@ -2111,7 +2111,7 @@ var PaintDabStroke = (_class9 = class {
|
|
|
2111
2111
|
}
|
|
2112
2112
|
const tip = this.tip.subarray(0, n);
|
|
2113
2113
|
tip.fill(0);
|
|
2114
|
-
|
|
2114
|
+
_chunkL2T6EJ5Scjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.brush.tip.hardness, rect, tip);
|
|
2115
2115
|
if (!(this.depth > 0 && this.options.grain)) return { tip, cov: tip };
|
|
2116
2116
|
const cov = this.cov.subarray(0, n);
|
|
2117
2117
|
const grain = this.options.grain;
|
|
@@ -2126,7 +2126,7 @@ var PaintDabStroke = (_class9 = class {
|
|
|
2126
2126
|
const { tip, cov } = this.rasterize(d, rect);
|
|
2127
2127
|
const st = this.states[copy];
|
|
2128
2128
|
if (brush.engine === "blender") {
|
|
2129
|
-
|
|
2129
|
+
_chunkL2T6EJ5Scjs.blenderDab.call(void 0, this.medium, rect, cov, d.opacity * d.alpha * brush.tip.opacity, d.radius, brush.blender, this.scratch);
|
|
2130
2130
|
return;
|
|
2131
2131
|
}
|
|
2132
2132
|
if (brush.engine === "smudge") {
|
|
@@ -2226,7 +2226,7 @@ function normalizeLighting(raw = {}, base = DEFAULT_LIGHTING) {
|
|
|
2226
2226
|
};
|
|
2227
2227
|
}
|
|
2228
2228
|
function emptyThickChannels() {
|
|
2229
|
-
return { height: new (0,
|
|
2229
|
+
return { height: new (0, _chunk7ISPWEJAcjs.TiledSurface)(1, /* @__PURE__ */ new Map(), 0), material: new (0, _chunk7ISPWEJAcjs.TiledSurface)(4, /* @__PURE__ */ new Map(), 0) };
|
|
2230
2230
|
}
|
|
2231
2231
|
var RELIEF_PX = 7;
|
|
2232
2232
|
var AMBIENT = 0.38;
|
|
@@ -2250,16 +2250,16 @@ function lightTile(color, height, heightAround, material, light) {
|
|
|
2250
2250
|
const k = RELIEF_PX / 255 * light.relief * 2;
|
|
2251
2251
|
const flatDiffuse = AMBIENT + (1 - AMBIENT) * lz;
|
|
2252
2252
|
const read = (x, y) => {
|
|
2253
|
-
if (x >= 0 && y >= 0 && x <
|
|
2254
|
-
const dx = x < 0 ? -1 : x >=
|
|
2255
|
-
const dy = y < 0 ? -1 : y >=
|
|
2253
|
+
if (x >= 0 && y >= 0 && x < _chunk7ISPWEJAcjs.TILE && y < _chunk7ISPWEJAcjs.TILE) return height[y * _chunk7ISPWEJAcjs.TILE + x];
|
|
2254
|
+
const dx = x < 0 ? -1 : x >= _chunk7ISPWEJAcjs.TILE ? 1 : 0;
|
|
2255
|
+
const dy = y < 0 ? -1 : y >= _chunk7ISPWEJAcjs.TILE ? 1 : 0;
|
|
2256
2256
|
const t = heightAround(dx, dy);
|
|
2257
2257
|
if (!t) return 0;
|
|
2258
|
-
return t[(y - dy *
|
|
2258
|
+
return t[(y - dy * _chunk7ISPWEJAcjs.TILE) * _chunk7ISPWEJAcjs.TILE + (x - dx * _chunk7ISPWEJAcjs.TILE)];
|
|
2259
2259
|
};
|
|
2260
|
-
for (let y = 0; y <
|
|
2261
|
-
for (let x = 0; x <
|
|
2262
|
-
const p = y *
|
|
2260
|
+
for (let y = 0; y < _chunk7ISPWEJAcjs.TILE; y++) {
|
|
2261
|
+
for (let x = 0; x < _chunk7ISPWEJAcjs.TILE; x++) {
|
|
2262
|
+
const p = y * _chunk7ISPWEJAcjs.TILE + x;
|
|
2263
2263
|
const i = p * 4;
|
|
2264
2264
|
if (color[i + 3] === 0) continue;
|
|
2265
2265
|
const h = height[p];
|
|
@@ -2280,10 +2280,10 @@ function lightTile(color, height, heightAround, material, light) {
|
|
|
2280
2280
|
const nh = Math.max(0, nx * hx + ny * hy + nz * hz);
|
|
2281
2281
|
const spec = Math.max(0, Math.pow(nh, shininess) - Math.pow(hz, shininess)) * (0.25 + 0.75 * gloss) * light.relief;
|
|
2282
2282
|
for (let c = 0; c < 3; c++) {
|
|
2283
|
-
const a =
|
|
2283
|
+
const a = _chunkL2T6EJ5Scjs.SRGB_TO_LINEAR[color[i + c]];
|
|
2284
2284
|
const tint = metal * a + (1 - metal);
|
|
2285
2285
|
const v = a * shade * (1 - 0.35 * metal) + spec * tint * (1 + metal);
|
|
2286
|
-
out[i + c] =
|
|
2286
|
+
out[i + c] = _chunkL2T6EJ5Scjs.linearToSrgb8.call(void 0, v);
|
|
2287
2287
|
}
|
|
2288
2288
|
}
|
|
2289
2289
|
}
|
|
@@ -2301,14 +2301,14 @@ var LitCache = (_class10 = class {constructor() { _class10.prototype.__init35.ca
|
|
|
2301
2301
|
for (const [key, tile] of color.tiles) {
|
|
2302
2302
|
const tx = key % 65536 - 32768;
|
|
2303
2303
|
const ty = Math.floor(key / 65536) - 32768;
|
|
2304
|
-
const around = (dx, dy) => _nullishCoalesce(_optionalChain([ch, 'access', _13 => _13.height, 'access', _14 => _14.tiles, 'access', _15 => _15.get, 'call', _16 => _16(
|
|
2304
|
+
const around = (dx, dy) => _nullishCoalesce(_optionalChain([ch, 'access', _13 => _13.height, 'access', _14 => _14.tiles, 'access', _15 => _15.get, 'call', _16 => _16(_chunk7ISPWEJAcjs.tileKey.call(void 0, tx + dx, ty + dy)), 'optionalAccess', _17 => _17.data]), () => ( null));
|
|
2305
2305
|
let any = false;
|
|
2306
2306
|
for (let dy = -1; dy <= 1 && !any; dy++) for (let dx = -1; dx <= 1 && !any; dx++) if (around(dx, dy)) any = true;
|
|
2307
2307
|
if (!any) continue;
|
|
2308
2308
|
const h = _nullishCoalesce(ch.height.tiles.get(key), () => ( null));
|
|
2309
2309
|
const m = _nullishCoalesce(ch.material.tiles.get(key), () => ( null));
|
|
2310
2310
|
const inputs = [tile, lk, m];
|
|
2311
|
-
for (let dy = -1; dy <= 1; dy++) for (let dx = -1; dx <= 1; dx++) inputs.push(_nullishCoalesce(ch.height.tiles.get(
|
|
2311
|
+
for (let dy = -1; dy <= 1; dy++) for (let dx = -1; dx <= 1; dx++) inputs.push(_nullishCoalesce(ch.height.tiles.get(_chunk7ISPWEJAcjs.tileKey.call(void 0, tx + dx, ty + dy)), () => ( null)));
|
|
2312
2312
|
const cached = this.tiles.get(key);
|
|
2313
2313
|
if (cached && cached.inputs.length === inputs.length && cached.inputs.every((v, i) => v === inputs[i])) {
|
|
2314
2314
|
out.set(key, cached.tile);
|
|
@@ -2317,7 +2317,7 @@ var LitCache = (_class10 = class {constructor() { _class10.prototype.__init35.ca
|
|
|
2317
2317
|
const hd = h ? expand(h, 1) : null;
|
|
2318
2318
|
const md = m ? expand(m, 4) : null;
|
|
2319
2319
|
const data = lightTile(expand(tile, 4), hd, (dx, dy) => {
|
|
2320
|
-
const t = ch.height.tiles.get(
|
|
2320
|
+
const t = ch.height.tiles.get(_chunk7ISPWEJAcjs.tileKey.call(void 0, tx + dx, ty + dy));
|
|
2321
2321
|
return t ? expand(t, 1) : null;
|
|
2322
2322
|
}, md, light);
|
|
2323
2323
|
const lit = { data, uniform: null };
|
|
@@ -2325,12 +2325,12 @@ var LitCache = (_class10 = class {constructor() { _class10.prototype.__init35.ca
|
|
|
2325
2325
|
out.set(key, lit);
|
|
2326
2326
|
}
|
|
2327
2327
|
for (const key of [...this.tiles.keys()]) if (!keys.has(key)) this.tiles.delete(key);
|
|
2328
|
-
return new (0,
|
|
2328
|
+
return new (0, _chunk7ISPWEJAcjs.TiledSurface)(4, out, color.defaultValue);
|
|
2329
2329
|
}
|
|
2330
2330
|
}, _class10);
|
|
2331
2331
|
function expand(t, channels) {
|
|
2332
|
-
if (t.data.length ===
|
|
2333
|
-
const out = new Uint8ClampedArray(
|
|
2332
|
+
if (t.data.length === _chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * channels) return t.data;
|
|
2333
|
+
const out = new Uint8ClampedArray(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * channels);
|
|
2334
2334
|
const u = _nullishCoalesce(t.uniform, () => ( 0));
|
|
2335
2335
|
if (channels === 1) out.fill(u & 255);
|
|
2336
2336
|
else {
|
|
@@ -2346,15 +2346,15 @@ var ThickStrokeDriver = (_class11 = class {
|
|
|
2346
2346
|
this.smoother = new PenSmoother(b.tip.smoothing, b.pressureSmoothing);
|
|
2347
2347
|
const copies = init.copies.length ? init.copies : [IDENTITY_COPY];
|
|
2348
2348
|
this.copies = copies;
|
|
2349
|
-
const rates =
|
|
2349
|
+
const rates = _chunkL2T6EJ5Scjs.exchangeRates.call(void 0, b.behavior.pickup, b.behavior.mix, 1, b.behavior.mixing);
|
|
2350
2350
|
this.states = copies.map((c, i) => ({
|
|
2351
2351
|
walker: new PenDabWalker(b, init.seed + i * 7919 | 0, c.linear),
|
|
2352
|
-
exchange: new (0,
|
|
2353
|
-
smudge: b.impasto.tool === "knife" ? new (0,
|
|
2352
|
+
exchange: new (0, _chunkL2T6EJ5Scjs.PaintExchange)(rates, init.load),
|
|
2353
|
+
smudge: b.impasto.tool === "knife" ? new (0, _chunkL2T6EJ5Scjs.SmudgeTip)({ strength: 0.85, length: 0.6 + 0.38 * b.impasto.drag, mixing: b.behavior.mixing }, b.tip.size * 1.2) : null,
|
|
2354
2354
|
carried: null,
|
|
2355
2355
|
amount: 1
|
|
2356
2356
|
}));
|
|
2357
|
-
this.medium = new (0,
|
|
2357
|
+
this.medium = new (0, _chunkL2T6EJ5Scjs.TileMedium)(init.target, {});
|
|
2358
2358
|
}
|
|
2359
2359
|
|
|
2360
2360
|
__init36() {this.dabCount = 0}
|
|
@@ -2378,47 +2378,47 @@ var ThickStrokeDriver = (_class11 = class {
|
|
|
2378
2378
|
const h = new Map(this.init.channels.height.tiles);
|
|
2379
2379
|
const m = new Map(this.init.channels.material.tiles);
|
|
2380
2380
|
for (const [k, d] of this.height) {
|
|
2381
|
-
const t =
|
|
2381
|
+
const t = _chunk7ISPWEJAcjs.finishTile.call(void 0, d, 1, 0);
|
|
2382
2382
|
if (t) h.set(k, t);
|
|
2383
2383
|
else h.delete(k);
|
|
2384
2384
|
}
|
|
2385
2385
|
for (const [k, d] of this.material) {
|
|
2386
|
-
const t =
|
|
2386
|
+
const t = _chunk7ISPWEJAcjs.finishTile.call(void 0, new Uint8ClampedArray(d), 4, 0);
|
|
2387
2387
|
if (t) m.set(k, t);
|
|
2388
2388
|
else m.delete(k);
|
|
2389
2389
|
}
|
|
2390
2390
|
void this.version;
|
|
2391
|
-
return { height: new (0,
|
|
2391
|
+
return { height: new (0, _chunk7ISPWEJAcjs.TiledSurface)(1, h, 0), material: new (0, _chunk7ISPWEJAcjs.TiledSurface)(4, m, 0) };
|
|
2392
2392
|
}
|
|
2393
2393
|
heightTile(tx, ty, write) {
|
|
2394
|
-
const key =
|
|
2394
|
+
const key = _chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty);
|
|
2395
2395
|
let t = this.height.get(key);
|
|
2396
2396
|
if (t) {
|
|
2397
2397
|
return t;
|
|
2398
2398
|
}
|
|
2399
2399
|
const base = this.init.channels.height.tiles.get(key);
|
|
2400
2400
|
if (!write) return base ? expand(base, 1) : null;
|
|
2401
|
-
t = base ? new Uint8ClampedArray(expand(base, 1)) : new Uint8ClampedArray(
|
|
2401
|
+
t = base ? new Uint8ClampedArray(expand(base, 1)) : new Uint8ClampedArray(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE);
|
|
2402
2402
|
this.height.set(key, t);
|
|
2403
2403
|
return t;
|
|
2404
2404
|
}
|
|
2405
2405
|
materialTile(tx, ty) {
|
|
2406
|
-
const key =
|
|
2406
|
+
const key = _chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty);
|
|
2407
2407
|
let t = this.material.get(key);
|
|
2408
2408
|
if (!t) {
|
|
2409
2409
|
const base = this.init.channels.material.tiles.get(key);
|
|
2410
|
-
t = base ? new Uint8ClampedArray(expand(base, 4)) : new Uint8ClampedArray(
|
|
2410
|
+
t = base ? new Uint8ClampedArray(expand(base, 4)) : new Uint8ClampedArray(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * 4);
|
|
2411
2411
|
this.material.set(key, t);
|
|
2412
2412
|
}
|
|
2413
2413
|
return t;
|
|
2414
2414
|
}
|
|
2415
2415
|
getH(x, y) {
|
|
2416
|
-
const t = this.heightTile(Math.floor(x /
|
|
2417
|
-
return t ? t[(y & 255) *
|
|
2416
|
+
const t = this.heightTile(Math.floor(x / _chunk7ISPWEJAcjs.TILE), Math.floor(y / _chunk7ISPWEJAcjs.TILE), false);
|
|
2417
|
+
return t ? t[(y & 255) * _chunk7ISPWEJAcjs.TILE + (x & 255)] : 0;
|
|
2418
2418
|
}
|
|
2419
2419
|
setH(x, y, v) {
|
|
2420
|
-
const t = this.heightTile(Math.floor(x /
|
|
2421
|
-
t[(y & 255) *
|
|
2420
|
+
const t = this.heightTile(Math.floor(x / _chunk7ISPWEJAcjs.TILE), Math.floor(y / _chunk7ISPWEJAcjs.TILE), true);
|
|
2421
|
+
t[(y & 255) * _chunk7ISPWEJAcjs.TILE + (x & 255)] = v;
|
|
2422
2422
|
}
|
|
2423
2423
|
push(points) {
|
|
2424
2424
|
const rects = [];
|
|
@@ -2448,7 +2448,7 @@ var ThickStrokeDriver = (_class11 = class {
|
|
|
2448
2448
|
}
|
|
2449
2449
|
applyDabs(copy, dabs, rects) {
|
|
2450
2450
|
for (const d of dabs) {
|
|
2451
|
-
const rect =
|
|
2451
|
+
const rect = _chunkL2T6EJ5Scjs.dabRect.call(void 0, d, this.init.brush.tip.hardness);
|
|
2452
2452
|
if (rect.width <= 0 || rect.height <= 0) continue;
|
|
2453
2453
|
this.dab(copy, d, rect);
|
|
2454
2454
|
rects.push(rect);
|
|
@@ -2463,7 +2463,7 @@ var ThickStrokeDriver = (_class11 = class {
|
|
|
2463
2463
|
const n = rect.width * rect.height;
|
|
2464
2464
|
if (this.tip.length < n) this.tip = new Float32Array(n);
|
|
2465
2465
|
const tip = this.tip.subarray(0, n);
|
|
2466
|
-
|
|
2466
|
+
_chunkL2T6EJ5Scjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, b.tip.hardness, rect, tip);
|
|
2467
2467
|
const sel = this.init.target.selection;
|
|
2468
2468
|
if (sel) {
|
|
2469
2469
|
for (let yy = 0, p = 0; yy < rect.height; yy++)
|
|
@@ -2572,8 +2572,8 @@ var ThickStrokeDriver = (_class11 = class {
|
|
|
2572
2572
|
if (c <= 0) continue;
|
|
2573
2573
|
const lx = rect.x + xx - off.x;
|
|
2574
2574
|
const ly = rect.y + yy - off.y;
|
|
2575
|
-
const t = this.materialTile(Math.floor(lx /
|
|
2576
|
-
const i = ((ly & 255) *
|
|
2575
|
+
const t = this.materialTile(Math.floor(lx / _chunk7ISPWEJAcjs.TILE), Math.floor(ly / _chunk7ISPWEJAcjs.TILE));
|
|
2576
|
+
const i = ((ly & 255) * _chunk7ISPWEJAcjs.TILE + (lx & 255)) * 4;
|
|
2577
2577
|
t[i] = Math.round(t[i] + (gloss * 255 - t[i]) * c);
|
|
2578
2578
|
t[i + 1] = Math.round(t[i + 1] + (metal * 255 - t[i + 1]) * c);
|
|
2579
2579
|
t[i + 3] = 255;
|
|
@@ -2592,7 +2592,7 @@ function reliefInfo(ch) {
|
|
|
2592
2592
|
function thickToJSON(ch) {
|
|
2593
2593
|
const b = ch.height.bounds;
|
|
2594
2594
|
if (!b) return null;
|
|
2595
|
-
return { rect: { ...b }, height: _chunkEJVDBITDcjs.pngDataUrl.call(void 0, b.width, b.height,
|
|
2595
|
+
return { rect: { ...b }, height: _chunkEJVDBITDcjs.pngDataUrl.call(void 0, b.width, b.height, _chunk7ISPWEJAcjs.readRegion.call(void 0, ch.height, b), 1), material: _chunkEJVDBITDcjs.pngDataUrl.call(void 0, b.width, b.height, _chunk7ISPWEJAcjs.readRegion.call(void 0, ch.material, b), 4) };
|
|
2596
2596
|
}
|
|
2597
2597
|
function thickFromJSON(raw) {
|
|
2598
2598
|
const r = raw;
|
|
@@ -2606,14 +2606,14 @@ function thickFromJSON(raw) {
|
|
|
2606
2606
|
const m = decode(r.material, false);
|
|
2607
2607
|
const hd = h.channels === 1 ? h.data : Uint8ClampedArray.from({ length: h.width * h.height }, (_, i) => h.data[i * 4]);
|
|
2608
2608
|
return {
|
|
2609
|
-
height:
|
|
2610
|
-
material:
|
|
2609
|
+
height: _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width: h.width, height: h.height, data: hd }, 1, r.rect.x, r.rect.y),
|
|
2610
|
+
material: _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width: m.width, height: m.height, data: m.data }, 4, r.rect.x, r.rect.y)
|
|
2611
2611
|
};
|
|
2612
2612
|
}
|
|
2613
2613
|
|
|
2614
2614
|
// src/paint-editor/stroke.ts
|
|
2615
2615
|
function defaultTile(surface) {
|
|
2616
|
-
const data = new Uint8ClampedArray(
|
|
2616
|
+
const data = new Uint8ClampedArray(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * surface.channels);
|
|
2617
2617
|
if (surface.defaultValue) data.fill(surface.defaultValue);
|
|
2618
2618
|
return data;
|
|
2619
2619
|
}
|
|
@@ -2702,9 +2702,9 @@ var PaintStrokeSession = (_class12 = class {
|
|
|
2702
2702
|
offset: this.init.offset,
|
|
2703
2703
|
lockTransparency: this.init.lockTransparency,
|
|
2704
2704
|
selection: _nullishCoalesce(this.init.selection, () => ( null)),
|
|
2705
|
-
readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _18 => _18.live, 'access', _19 => _19.get, 'call', _20 => _20(
|
|
2705
|
+
readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _18 => _18.live, 'access', _19 => _19.get, 'call', _20 => _20(_chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _21 => _21.data]), () => ( null)),
|
|
2706
2706
|
writeTile: (tx, ty) => {
|
|
2707
|
-
const key =
|
|
2707
|
+
const key = _chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty);
|
|
2708
2708
|
if (!this.touched.has(key)) {
|
|
2709
2709
|
const src = _nullishCoalesce(_optionalChain([this, 'access', _22 => _22.base, 'access', _23 => _23.tiles, 'access', _24 => _24.get, 'call', _25 => _25(key), 'optionalAccess', _26 => _26.data]), () => ( defaultTile(this.base)));
|
|
2710
2710
|
this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
|
|
@@ -2760,7 +2760,7 @@ var PaintStrokeSession = (_class12 = class {
|
|
|
2760
2760
|
const changed = d.dabCount > 0;
|
|
2761
2761
|
this.result = { layerId: this.layerId, bounds: changed ? d.bounds : null, dabs: d.dabCount, strokeId: null, wet: true };
|
|
2762
2762
|
const carried = d.load;
|
|
2763
|
-
if (carried) this.result.mixerLoad = this.init.brush.behavior.dirty ? carried :
|
|
2763
|
+
if (carried) this.result.mixerLoad = this.init.brush.behavior.dirty ? carried : _chunkL2T6EJ5Scjs.cleanMixer.call(void 0, carried);
|
|
2764
2764
|
this.host.commit(this, changed ? this.init.wet.surface() : null, false);
|
|
2765
2765
|
}
|
|
2766
2766
|
update(rects) {
|
|
@@ -2770,14 +2770,14 @@ var PaintStrokeSession = (_class12 = class {
|
|
|
2770
2770
|
if (!this.dry) {
|
|
2771
2771
|
for (const key of this.fresh) this.live.set(key, { data: this.live.get(key).data, uniform: null });
|
|
2772
2772
|
this.fresh.clear();
|
|
2773
|
-
this.host.update(this.layerId, new (0,
|
|
2773
|
+
this.host.update(this.layerId, new (0, _chunk7ISPWEJAcjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
|
|
2774
2774
|
return;
|
|
2775
2775
|
}
|
|
2776
2776
|
const off = this.init.offset;
|
|
2777
2777
|
const regions = /* @__PURE__ */ new Map();
|
|
2778
2778
|
for (const r of rects) {
|
|
2779
|
-
for (const t of
|
|
2780
|
-
const key =
|
|
2779
|
+
for (const t of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, { x: r.x - off.x, y: r.y - off.y, width: r.width, height: r.height })) {
|
|
2780
|
+
const key = _chunk7ISPWEJAcjs.tileKey.call(void 0, t.tx, t.ty);
|
|
2781
2781
|
const cur = regions.get(key);
|
|
2782
2782
|
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? union(cur.r, r) : r });
|
|
2783
2783
|
}
|
|
@@ -2786,10 +2786,10 @@ var PaintStrokeSession = (_class12 = class {
|
|
|
2786
2786
|
const src = _nullishCoalesce(_optionalChain([this, 'access', _30 => _30.base, 'access', _31 => _31.tiles, 'access', _32 => _32.get, 'call', _33 => _33(key), 'optionalAccess', _34 => _34.data]), () => ( defaultTile(this.base)));
|
|
2787
2787
|
const prev = this.touched.has(key) ? _optionalChain([this, 'access', _35 => _35.live, 'access', _36 => _36.get, 'call', _37 => _37(key), 'optionalAccess', _38 => _38.data]) : void 0;
|
|
2788
2788
|
this.touched.add(key);
|
|
2789
|
-
const data =
|
|
2789
|
+
const data = _chunkL2T6EJ5Scjs.applyStrokeToTile.call(void 0, this.dry.coverage, src, ch, tx, ty, this.apply, prev ? { into: prev, region: r } : {});
|
|
2790
2790
|
this.live.set(key, { data, uniform: null });
|
|
2791
2791
|
}
|
|
2792
|
-
this.host.update(this.layerId, new (0,
|
|
2792
|
+
this.host.update(this.layerId, new (0, _chunk7ISPWEJAcjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
|
|
2793
2793
|
}
|
|
2794
2794
|
/** Ends the stroke (one undo step) and returns what changed. */
|
|
2795
2795
|
end() {
|
|
@@ -2810,18 +2810,18 @@ var PaintStrokeSession = (_class12 = class {
|
|
|
2810
2810
|
const tiles = new Map(this.base.tiles);
|
|
2811
2811
|
let changed = false;
|
|
2812
2812
|
for (const key of this.touched) {
|
|
2813
|
-
const tile =
|
|
2813
|
+
const tile = _chunk7ISPWEJAcjs.finishTile.call(void 0, this.live.get(key).data, ch, this.base.defaultValue);
|
|
2814
2814
|
const prev = this.base.tiles.get(key);
|
|
2815
2815
|
if (tile) tiles.set(key, tile);
|
|
2816
2816
|
else tiles.delete(key);
|
|
2817
2817
|
if (!sameTile(prev, tile)) changed = true;
|
|
2818
2818
|
}
|
|
2819
2819
|
if (this.thickDriver && this.thickDriver.dabCount > 0) changed = true;
|
|
2820
|
-
const surface = changed ? new (0,
|
|
2820
|
+
const surface = changed ? new (0, _chunk7ISPWEJAcjs.TiledSurface)(ch, tiles, this.base.defaultValue) : null;
|
|
2821
2821
|
const dabs = this.dry ? this.dry.dabCount : this.thickDriver ? this.thickDriver.dabCount : this.stickerSpray ? this.stickerSpray.dabCount : this.wet.dabCount;
|
|
2822
2822
|
this.result = { layerId: this.layerId, bounds: changed ? this.bounds : null, dabs, strokeId: null };
|
|
2823
2823
|
const carried = _nullishCoalesce(_optionalChain([this, 'access', _39 => _39.wet, 'optionalAccess', _40 => _40.load]), () => ( _optionalChain([this, 'access', _41 => _41.thickDriver, 'optionalAccess', _42 => _42.load])));
|
|
2824
|
-
if (carried) this.result.mixerLoad = this.init.brush.behavior.dirty ? carried :
|
|
2824
|
+
if (carried) this.result.mixerLoad = this.init.brush.behavior.dirty ? carried : _chunkL2T6EJ5Scjs.cleanMixer.call(void 0, carried);
|
|
2825
2825
|
this.host.commit(this, surface, false);
|
|
2826
2826
|
return this.result;
|
|
2827
2827
|
}
|
|
@@ -2834,15 +2834,15 @@ var PaintStrokeSession = (_class12 = class {
|
|
|
2834
2834
|
}, _class12);
|
|
2835
2835
|
function mixerLoadForStroke(brush, current, color) {
|
|
2836
2836
|
if (!brush.loadsColor) return { reservoir: null, amount: 0, pickup: brush.mixer.cleanEachStroke ? null : current.pickup };
|
|
2837
|
-
if (brush.mixer.loadEachStroke || !current.reservoir) return
|
|
2837
|
+
if (brush.mixer.loadEachStroke || !current.reservoir) return _chunkL2T6EJ5Scjs.loadMixer.call(void 0, current, color);
|
|
2838
2838
|
return current;
|
|
2839
2839
|
}
|
|
2840
2840
|
function brushLoadForStroke(brush, current, color) {
|
|
2841
2841
|
if (brush.engine === "mixer") return mixerLoadForStroke(brush, current, color);
|
|
2842
2842
|
if (brush.engine === "impasto") return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
|
|
2843
|
-
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 } :
|
|
2843
|
+
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 } : _chunkL2T6EJ5Scjs.EMPTY_MIXER_LOAD;
|
|
2844
2844
|
if (usesPaintExchange(brush)) return { reservoir: [color[0], color[1], color[2]], amount: 1, pickup: brush.behavior.dirty ? current.pickup : null };
|
|
2845
|
-
return
|
|
2845
|
+
return _chunkL2T6EJ5Scjs.EMPTY_MIXER_LOAD;
|
|
2846
2846
|
}
|
|
2847
2847
|
|
|
2848
2848
|
// src/paint-editor/stencils.ts
|
|
@@ -3223,7 +3223,7 @@ var PROFILE = {
|
|
|
3223
3223
|
}
|
|
3224
3224
|
};
|
|
3225
3225
|
function createPaintCompositor() {
|
|
3226
|
-
return new (0,
|
|
3226
|
+
return new (0, _chunkEBSYZRSWcjs.RasterCompositor)(PROFILE);
|
|
3227
3227
|
}
|
|
3228
3228
|
function downsampleRgba(data, width, height, tw, th) {
|
|
3229
3229
|
tw = Math.max(1, Math.round(tw));
|
|
@@ -3298,11 +3298,11 @@ function header(state, options) {
|
|
|
3298
3298
|
return out;
|
|
3299
3299
|
}
|
|
3300
3300
|
function serializePaintDocument(state, options = {}) {
|
|
3301
|
-
const { layers, assets } =
|
|
3301
|
+
const { layers, assets } = _chunk2J3LS7JZcjs.serializeLayers.call(void 0, state.layers);
|
|
3302
3302
|
return { ...header(state, options), layers, assets };
|
|
3303
3303
|
}
|
|
3304
3304
|
async function serializePaintDocumentExternal(state, store, options = {}) {
|
|
3305
|
-
const { layers, assets } = await
|
|
3305
|
+
const { layers, assets } = await _chunk2J3LS7JZcjs.serializeLayersExternal.call(void 0, state.layers, store);
|
|
3306
3306
|
return { ...header(state, options), layers, assets };
|
|
3307
3307
|
}
|
|
3308
3308
|
function paintLayersOnly(layers, problems) {
|
|
@@ -3339,9 +3339,9 @@ function deserializePaintDocument(raw) {
|
|
|
3339
3339
|
const canvas = normalizeCanvas({ width: r.width, height: r.height, dpi: _nullishCoalesce(r.dpi, () => ( void 0)) });
|
|
3340
3340
|
const paper = normalizePaper(_nullishCoalesce(r.paper, () => ( {})));
|
|
3341
3341
|
const assets = r.assets && typeof r.assets === "object" ? r.assets : {};
|
|
3342
|
-
const layers = paintLayersOnly(
|
|
3342
|
+
const layers = paintLayersOnly(_chunk2J3LS7JZcjs.deserializeLayers.call(void 0, r.layers, { assets, problems }), problems);
|
|
3343
3343
|
const wanted = typeof r.activeLayerId === "string" ? r.activeLayerId : null;
|
|
3344
|
-
const activeLayerId = wanted &&
|
|
3344
|
+
const activeLayerId = wanted && _chunkEBSYZRSWcjs.findLayer.call(void 0, layers, wanted) ? wanted : _nullishCoalesce(_optionalChain([_chunkEBSYZRSWcjs.flattenLayers.call(void 0, layers), 'access', _73 => _73.filter, 'call', _74 => _74((l) => l.type === "pixel"), 'access', _75 => _75.pop, 'call', _76 => _76(), 'optionalAccess', _77 => _77.id]), () => ( null));
|
|
3345
3345
|
const wetEvents = Array.isArray(r.wetEvents) ? r.wetEvents.filter((e) => e && typeof e === "object" && Number.isInteger(e.clock) && typeof e.kind === "string") : [];
|
|
3346
3346
|
const state = { canvas, paper, layers, activeLayerId, strokes: readStrokes(r.strokes, problems) };
|
|
3347
3347
|
if (wetEvents.length) state.wetEvents = wetEvents;
|
|
@@ -3353,7 +3353,7 @@ async function deserializePaintDocumentAsync(raw, store) {
|
|
|
3353
3353
|
if (!raw || typeof raw !== "object") throw new Error("Not a paint document: expected a JSON object.");
|
|
3354
3354
|
const r = raw;
|
|
3355
3355
|
const problems = [];
|
|
3356
|
-
const assets = await
|
|
3356
|
+
const assets = await _chunk2J3LS7JZcjs.resolveExternalAssets.call(void 0, _nullishCoalesce(r.assets, () => ( {})), store, problems);
|
|
3357
3357
|
const loaded = deserializePaintDocument({ ...r, assets });
|
|
3358
3358
|
return { ...loaded, problems: [...problems, ...loaded.problems] };
|
|
3359
3359
|
}
|
|
@@ -3501,7 +3501,7 @@ function downloadBytes(bytes, fileName, mimeType) {
|
|
|
3501
3501
|
|
|
3502
3502
|
// src/paint-editor/wet.ts
|
|
3503
3503
|
var STROKE_WATER = 0.9;
|
|
3504
|
-
var STROKE_MASS =
|
|
3504
|
+
var STROKE_MASS = _chunkL2T6EJ5Scjs.PIGMENT_UNIT * 2.5;
|
|
3505
3505
|
var COVERAGE_STEPS = 4096;
|
|
3506
3506
|
function union2(a, b) {
|
|
3507
3507
|
if (!a) return { ...b };
|
|
@@ -3530,15 +3530,15 @@ var WetStrokeDriver = (_class13 = class {
|
|
|
3530
3530
|
const spacing = Math.max(0.02, brush.tip.spacing);
|
|
3531
3531
|
const perDab = Math.min(1, spacing * 1.2);
|
|
3532
3532
|
const thin = wet.thinner;
|
|
3533
|
-
this.medium = new (0,
|
|
3533
|
+
this.medium = new (0, _chunkL2T6EJ5Scjs.WetMedium)(init.world, init.laneId, {
|
|
3534
3534
|
water: STROKE_WATER * Math.min(1, wet.water * (1 + thin)) * perDab,
|
|
3535
3535
|
mass: STROKE_MASS * wet.pigment * (1 - 0.6 * thin) * perDab,
|
|
3536
3536
|
body: wet.body * (1 - thin)
|
|
3537
3537
|
});
|
|
3538
|
-
const rates =
|
|
3538
|
+
const rates = _chunkL2T6EJ5Scjs.exchangeRates.call(void 0, brush.behavior.pickup, brush.behavior.mix, wet.load, brush.behavior.mixing);
|
|
3539
3539
|
this.states = copies.map((c, i) => ({
|
|
3540
3540
|
walker: new PenDabWalker(brush, init.seed + i * 7919 | 0, c.linear),
|
|
3541
|
-
exchange: wet.tool === "paint" ? new (0,
|
|
3541
|
+
exchange: wet.tool === "paint" ? new (0, _chunkL2T6EJ5Scjs.PaintExchange)(rates, init.load) : null,
|
|
3542
3542
|
last: null
|
|
3543
3543
|
}));
|
|
3544
3544
|
this.copies = copies;
|
|
@@ -3612,7 +3612,7 @@ var WetStrokeDriver = (_class13 = class {
|
|
|
3612
3612
|
}
|
|
3613
3613
|
applyDabs(copy, dabs, rects) {
|
|
3614
3614
|
for (const d of dabs) {
|
|
3615
|
-
const rect =
|
|
3615
|
+
const rect = _chunkL2T6EJ5Scjs.dabRect.call(void 0, d, this.init.brush.tip.hardness);
|
|
3616
3616
|
if (rect.width <= 0 || rect.height <= 0) continue;
|
|
3617
3617
|
this.dab(copy, d, rect);
|
|
3618
3618
|
rects.push(rect);
|
|
@@ -3629,7 +3629,7 @@ var WetStrokeDriver = (_class13 = class {
|
|
|
3629
3629
|
const tip = this.tip.subarray(0, n);
|
|
3630
3630
|
const cov = this.cov.subarray(0, n);
|
|
3631
3631
|
tip.fill(0);
|
|
3632
|
-
|
|
3632
|
+
_chunkL2T6EJ5Scjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.init.brush.tip.hardness, rect, tip);
|
|
3633
3633
|
const grain = this.depth > 0 ? this.init.grain : null;
|
|
3634
3634
|
const mask = this.init.mask;
|
|
3635
3635
|
for (let yy = 0, k = 0; yy < rect.height; yy++) {
|
|
@@ -3708,7 +3708,7 @@ var PaintWetLayers = (_class14 = class {
|
|
|
3708
3708
|
|
|
3709
3709
|
|
|
3710
3710
|
__init69() {this.world = null}
|
|
3711
|
-
__init70() {this.tilt = { ...
|
|
3711
|
+
__init70() {this.tilt = { ..._chunkL2T6EJ5Scjs.FLAT }}
|
|
3712
3712
|
__init71() {this.settings = /* @__PURE__ */ new Map()}
|
|
3713
3713
|
__init72() {this.paused = false}
|
|
3714
3714
|
/** Wet strokes dry as soon as they end (one undo step with the stroke). */
|
|
@@ -3726,7 +3726,7 @@ var PaintWetLayers = (_class14 = class {
|
|
|
3726
3726
|
const { width, height } = this.host.canvas();
|
|
3727
3727
|
if (this.world && (this.world.width !== width || this.world.height !== height)) throw new Error("The wet world is the wrong size; dry the paint before resizing the canvas.");
|
|
3728
3728
|
if (!this.world) {
|
|
3729
|
-
this.world = new (0,
|
|
3729
|
+
this.world = new (0, _chunkL2T6EJ5Scjs.WetWorld)(width, height, wetPaperInput(this.host.paper()), { kernel: this.options.kernel, threads: this.options.threads });
|
|
3730
3730
|
this.world.setTilt(this.tilt);
|
|
3731
3731
|
}
|
|
3732
3732
|
return this.world;
|
|
@@ -3753,7 +3753,7 @@ var PaintWetLayers = (_class14 = class {
|
|
|
3753
3753
|
settingsOf(layerId, medium = "watercolor") {
|
|
3754
3754
|
let s = this.settings.get(layerId);
|
|
3755
3755
|
if (!s) {
|
|
3756
|
-
s = { params:
|
|
3756
|
+
s = { params: _chunkL2T6EJ5Scjs.normalizeWetParams.call(void 0, WET_MEDIUM_PARAMS[medium], _chunkL2T6EJ5Scjs.DEFAULT_WET_PARAMS), flow: { ..._chunkL2T6EJ5Scjs.DEFAULT_FLOW } };
|
|
3757
3757
|
this.settings.set(layerId, s);
|
|
3758
3758
|
}
|
|
3759
3759
|
return s;
|
|
@@ -3762,31 +3762,31 @@ var PaintWetLayers = (_class14 = class {
|
|
|
3762
3762
|
ensureLane(layerId, medium) {
|
|
3763
3763
|
const w = this.ensureWorld();
|
|
3764
3764
|
if (!w.hasLane(layerId)) {
|
|
3765
|
-
const base = _nullishCoalesce(this.host.layerSurface(layerId), () => ( new (0,
|
|
3765
|
+
const base = _nullishCoalesce(this.host.layerSurface(layerId), () => ( new (0, _chunk7ISPWEJAcjs.TiledSurface)(4, /* @__PURE__ */ new Map(), 0)));
|
|
3766
3766
|
const s = this.settingsOf(layerId, medium);
|
|
3767
3767
|
w.ensureLane(layerId, { params: s.params, base });
|
|
3768
3768
|
const { width, height } = this.host.canvas();
|
|
3769
|
-
if (s.flow.kind !== "none") w.setFlow(layerId,
|
|
3769
|
+
if (s.flow.kind !== "none") w.setFlow(layerId, _chunkL2T6EJ5Scjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
|
|
3770
3770
|
}
|
|
3771
3771
|
return w;
|
|
3772
3772
|
}
|
|
3773
3773
|
setParams(layerId, update) {
|
|
3774
3774
|
const s = this.settingsOf(layerId);
|
|
3775
|
-
s.params =
|
|
3775
|
+
s.params = _chunkL2T6EJ5Scjs.normalizeWetParams.call(void 0, update, s.params);
|
|
3776
3776
|
if (_optionalChain([this, 'access', _89 => _89.world, 'optionalAccess', _90 => _90.hasLane, 'call', _91 => _91(layerId)])) this.world.setParams(layerId, s.params);
|
|
3777
3777
|
return { ...s.params };
|
|
3778
3778
|
}
|
|
3779
3779
|
setFlow(layerId, update) {
|
|
3780
3780
|
const s = this.settingsOf(layerId);
|
|
3781
|
-
s.flow =
|
|
3781
|
+
s.flow = _chunkL2T6EJ5Scjs.normalizeFlow.call(void 0, update, s.flow);
|
|
3782
3782
|
if (_optionalChain([this, 'access', _92 => _92.world, 'optionalAccess', _93 => _93.hasLane, 'call', _94 => _94(layerId)])) {
|
|
3783
3783
|
const { width, height } = this.host.canvas();
|
|
3784
|
-
this.world.setFlow(layerId,
|
|
3784
|
+
this.world.setFlow(layerId, _chunkL2T6EJ5Scjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
|
|
3785
3785
|
}
|
|
3786
3786
|
return { ...s.flow };
|
|
3787
3787
|
}
|
|
3788
3788
|
setTilt(update) {
|
|
3789
|
-
this.tilt =
|
|
3789
|
+
this.tilt = _chunkL2T6EJ5Scjs.normalizeTilt.call(void 0, update, this.tilt);
|
|
3790
3790
|
_optionalChain([this, 'access', _95 => _95.world, 'optionalAccess', _96 => _96.setTilt, 'call', _97 => _97(this.tilt)]);
|
|
3791
3791
|
return { ...this.tilt };
|
|
3792
3792
|
}
|
|
@@ -3956,10 +3956,10 @@ var PaintWetLayers = (_class14 = class {
|
|
|
3956
3956
|
const w = this.world;
|
|
3957
3957
|
if (!w) return [];
|
|
3958
3958
|
const out = [];
|
|
3959
|
-
const tx0 = Math.max(0, Math.floor(rect.x /
|
|
3960
|
-
const ty0 = Math.max(0, Math.floor(rect.y /
|
|
3961
|
-
const tx1 = Math.floor((rect.x + rect.width - 1) /
|
|
3962
|
-
const ty1 = Math.floor((rect.y + rect.height - 1) /
|
|
3959
|
+
const tx0 = Math.max(0, Math.floor(rect.x / _chunk7ISPWEJAcjs.TILE));
|
|
3960
|
+
const ty0 = Math.max(0, Math.floor(rect.y / _chunk7ISPWEJAcjs.TILE));
|
|
3961
|
+
const tx1 = Math.floor((rect.x + rect.width - 1) / _chunk7ISPWEJAcjs.TILE);
|
|
3962
|
+
const ty1 = Math.floor((rect.y + rect.height - 1) / _chunk7ISPWEJAcjs.TILE);
|
|
3963
3963
|
for (let ty = ty0; ty <= ty1; ty++)
|
|
3964
3964
|
for (let tx = tx0; tx <= tx1; tx++) {
|
|
3965
3965
|
let merged = null;
|
|
@@ -3980,7 +3980,7 @@ var PaintWetLayers = (_class14 = class {
|
|
|
3980
3980
|
}, _class14);
|
|
3981
3981
|
function wetPigmentOf(hex, body) {
|
|
3982
3982
|
const [r, g, b] = hexToRgb8(hex);
|
|
3983
|
-
return Array.from(
|
|
3983
|
+
return Array.from(_chunkL2T6EJ5Scjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], body));
|
|
3984
3984
|
}
|
|
3985
3985
|
|
|
3986
3986
|
// src/paint-editor/thumbnails.ts
|
|
@@ -3988,7 +3988,7 @@ var thumbWorld = null;
|
|
|
3988
3988
|
function paintWetTestStroke(brush, paper, color, width, height) {
|
|
3989
3989
|
if (!thumbWorld || thumbWorld.width !== width || thumbWorld.height !== height) {
|
|
3990
3990
|
_optionalChain([thumbWorld, 'optionalAccess', _123 => _123.destroy, 'call', _124 => _124()]);
|
|
3991
|
-
thumbWorld = new (0,
|
|
3991
|
+
thumbWorld = new (0, _chunkL2T6EJ5Scjs.WetWorld)(width, height, wetPaperInput(paper), { kernel: "typescript", threads: 0 });
|
|
3992
3992
|
} else thumbWorld.setPaper(wetPaperInput(paper));
|
|
3993
3993
|
const w = thumbWorld;
|
|
3994
3994
|
if (w.hasLane("thumb")) w.removeLane("thumb");
|
|
@@ -3996,15 +3996,15 @@ function paintWetTestStroke(brush, paper, color, width, height) {
|
|
|
3996
3996
|
const [r, g, b] = hexToRgb8(color);
|
|
3997
3997
|
if (brush.wet.tool !== "paint" && brush.wet.tool !== "water") {
|
|
3998
3998
|
const half = Math.ceil(height / 2);
|
|
3999
|
-
w.paint("thumb", { x: 0, y: 0, width, height: half }, null, 0.4, Array.from(
|
|
4000
|
-
w.paint("thumb", { x: 0, y: half, width, height: height - half }, null, 0.4, Array.from(
|
|
3999
|
+
w.paint("thumb", { x: 0, y: 0, width, height: half }, null, 0.4, Array.from(_chunkL2T6EJ5Scjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], 0), (v) => v * 0.05));
|
|
4000
|
+
w.paint("thumb", { x: 0, y: half, width, height: height - half }, null, 0.4, Array.from(_chunkL2T6EJ5Scjs.pigmentOf.call(void 0, [232 / 255, 196 / 255, 64 / 255], 0), (v) => v * 0.05));
|
|
4001
4001
|
}
|
|
4002
4002
|
const driver = new WetStrokeDriver({
|
|
4003
4003
|
world: w,
|
|
4004
4004
|
laneId: "thumb",
|
|
4005
4005
|
brush,
|
|
4006
4006
|
color: [r / 255, g / 255, b / 255],
|
|
4007
|
-
load: brushLoadForStroke(brush,
|
|
4007
|
+
load: brushLoadForStroke(brush, _chunkL2T6EJ5Scjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255]),
|
|
4008
4008
|
grain: paperGrain(paper),
|
|
4009
4009
|
paperDepth: paper.depth,
|
|
4010
4010
|
paperColor: hexToRgb8(paper.color),
|
|
@@ -4055,7 +4055,7 @@ function paintTestStroke(surface, brush, paper, color, width, height) {
|
|
|
4055
4055
|
colorHex: color,
|
|
4056
4056
|
affineCopies: [],
|
|
4057
4057
|
copies: [IDENTITY_COPY],
|
|
4058
|
-
mixerLoad: brushLoadForStroke(brush,
|
|
4058
|
+
mixerLoad: brushLoadForStroke(brush, _chunkL2T6EJ5Scjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255]),
|
|
4059
4059
|
thick: brush.engine === "impasto" ? { channels: emptyThickChannels() } : void 0,
|
|
4060
4060
|
sticker: brush.engine === "sticker" ? { nextId: 1 } : void 0
|
|
4061
4061
|
}
|
|
@@ -4070,14 +4070,14 @@ function renderBrushThumbnail(brush, options) {
|
|
|
4070
4070
|
const maxSize = height * 0.42;
|
|
4071
4071
|
const b = brush.tip.size > maxSize ? normalizePaintBrush({ tip: { ...brush.tip, size: maxSize } }, brush) : brush;
|
|
4072
4072
|
const rgba = [...hexToRgb8(options.color), 255];
|
|
4073
|
-
let surface =
|
|
4073
|
+
let surface = _chunk7ISPWEJAcjs.emptySurface.call(void 0, 4);
|
|
4074
4074
|
if (b.engine === "eraser") {
|
|
4075
|
-
surface =
|
|
4075
|
+
surface = _chunk7ISPWEJAcjs.fillRect.call(void 0, surface, { x: 0, y: 0, width, height }, rgba);
|
|
4076
4076
|
} else if (b.engine === "wet") {
|
|
4077
4077
|
} else if (b.engine === "blender" || b.engine === "smudge" || b.engine === "mixer" && !b.loadsColor || b.behavior.pickup > 0) {
|
|
4078
4078
|
const half = Math.ceil(height / 2);
|
|
4079
|
-
surface =
|
|
4080
|
-
surface =
|
|
4079
|
+
surface = _chunk7ISPWEJAcjs.fillRect.call(void 0, surface, { x: 0, y: 0, width, height: half }, rgba);
|
|
4080
|
+
surface = _chunk7ISPWEJAcjs.fillRect.call(void 0, surface, { x: 0, y: half, width, height: height - half }, [232, 196, 64, 255]);
|
|
4081
4081
|
}
|
|
4082
4082
|
surface = b.engine === "wet" ? paintWetTestStroke(b, options.paper, options.color, width, height) : paintTestStroke(surface, b, options.paper, options.color, width, height);
|
|
4083
4083
|
const layer = { type: "pixel", id: "thumbnail", name: "thumbnail", visible: true, opacity: 1, blend: "normal", surface, offset: { x: 0, y: 0 } };
|
|
@@ -4414,7 +4414,7 @@ var PAD_BLOB = normalizePaintBrush({
|
|
|
4414
4414
|
var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init82.call(this);_class16.prototype.__init83.call(this);_class16.prototype.__init84.call(this);_class16.prototype.__init85.call(this); }
|
|
4415
4415
|
__init82() {this.width = MIXING_PAD_WIDTH}
|
|
4416
4416
|
__init83() {this.height = MIXING_PAD_HEIGHT}
|
|
4417
|
-
__init84() {this.surface =
|
|
4417
|
+
__init84() {this.surface = _chunk7ISPWEJAcjs.emptySurface.call(void 0, 4)}
|
|
4418
4418
|
/** Increments on every change (for redrawing). */
|
|
4419
4419
|
__init85() {this.version = 0}
|
|
4420
4420
|
/** Paints (`paint`, with `color`) or smears (`knife`) through `points` in pad pixels. */
|
|
@@ -4450,7 +4450,7 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init82.c
|
|
|
4450
4450
|
colorHex: color,
|
|
4451
4451
|
affineCopies: [],
|
|
4452
4452
|
copies: [IDENTITY_COPY],
|
|
4453
|
-
mixerLoad: brushLoadForStroke(brush,
|
|
4453
|
+
mixerLoad: brushLoadForStroke(brush, _chunkL2T6EJ5Scjs.EMPTY_MIXER_LOAD, [r / 255, g / 255, b / 255])
|
|
4454
4454
|
}
|
|
4455
4455
|
);
|
|
4456
4456
|
session.push(points);
|
|
@@ -4469,7 +4469,7 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init82.c
|
|
|
4469
4469
|
const y0 = Math.max(0, Math.floor(y) - r);
|
|
4470
4470
|
const x1 = Math.min(this.width, Math.floor(x) + r + 1);
|
|
4471
4471
|
const y1 = Math.min(this.height, Math.floor(y) + r + 1);
|
|
4472
|
-
const px =
|
|
4472
|
+
const px = _chunk7ISPWEJAcjs.readRegion.call(void 0, this.surface, { x: x0, y: y0, width: x1 - x0, height: y1 - y0 });
|
|
4473
4473
|
let R = 0;
|
|
4474
4474
|
let G = 0;
|
|
4475
4475
|
let B = 0;
|
|
@@ -4486,7 +4486,7 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init82.c
|
|
|
4486
4486
|
return `#${hex(R)}${hex(G)}${hex(B)}`;
|
|
4487
4487
|
}
|
|
4488
4488
|
clear() {
|
|
4489
|
-
this.surface =
|
|
4489
|
+
this.surface = _chunk7ISPWEJAcjs.emptySurface.call(void 0, 4);
|
|
4490
4490
|
this.version++;
|
|
4491
4491
|
}
|
|
4492
4492
|
/**
|
|
@@ -4516,7 +4516,7 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init82.c
|
|
|
4516
4516
|
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.`);
|
|
4517
4517
|
}
|
|
4518
4518
|
const bounds = { x: Math.floor(cx - R), y: Math.floor(cy - R), width: Math.ceil(2 * R), height: Math.ceil(2 * R) };
|
|
4519
|
-
if (options.clear !== false) this.surface =
|
|
4519
|
+
if (options.clear !== false) this.surface = _chunk7ISPWEJAcjs.writeRegion.call(void 0, this.surface, bounds, new Uint8ClampedArray(bounds.width * bounds.height * 4));
|
|
4520
4520
|
const used = paints.filter((p) => p.parts > 0);
|
|
4521
4521
|
const area = Math.PI * (0.7 * R) ** 2;
|
|
4522
4522
|
used.forEach((p, i) => {
|
|
@@ -4539,7 +4539,7 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init82.c
|
|
|
4539
4539
|
}
|
|
4540
4540
|
this.run(knife, stir, "#000000");
|
|
4541
4541
|
}
|
|
4542
|
-
const mixed =
|
|
4542
|
+
const mixed = _chunk7ISPWEJAcjs.mixPigments.call(void 0,
|
|
4543
4543
|
paints.map((p) => hexToRgb8(p.color).map((v) => v / 255)),
|
|
4544
4544
|
paints.map((p) => p.parts)
|
|
4545
4545
|
);
|
|
@@ -4550,7 +4550,7 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init82.c
|
|
|
4550
4550
|
}
|
|
4551
4551
|
/** The pad's pixels as a PNG data URL (with alpha), for saving. */
|
|
4552
4552
|
toPng() {
|
|
4553
|
-
return _chunkEJVDBITDcjs.pngDataUrl.call(void 0, this.width, this.height,
|
|
4553
|
+
return _chunkEJVDBITDcjs.pngDataUrl.call(void 0, this.width, this.height, _chunk7ISPWEJAcjs.readRegion.call(void 0, this.surface, { x: 0, y: 0, width: this.width, height: this.height }));
|
|
4554
4554
|
}
|
|
4555
4555
|
/** Replaces the pad with a PNG (data URL or base64) of the pad's size, as `toPng` writes. */
|
|
4556
4556
|
fromPng(png) {
|
|
@@ -4558,7 +4558,7 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init82.c
|
|
|
4558
4558
|
if (!bytes || !_chunkEJVDBITDcjs.isPng.call(void 0, bytes)) throw new Error("The pad image is not a PNG data URL or base64 PNG.");
|
|
4559
4559
|
const img = _chunkEJVDBITDcjs.decodePng.call(void 0, bytes);
|
|
4560
4560
|
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}.`);
|
|
4561
|
-
this.surface =
|
|
4561
|
+
this.surface = _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width: img.width, height: img.height, data: img.data }, 4);
|
|
4562
4562
|
this.version++;
|
|
4563
4563
|
}
|
|
4564
4564
|
/** Whether nothing is on the pad. */
|
|
@@ -4567,7 +4567,7 @@ var MixingPad = (_class16 = class {constructor() { _class16.prototype.__init82.c
|
|
|
4567
4567
|
}
|
|
4568
4568
|
/** The pad over white, `width × height` RGBA. */
|
|
4569
4569
|
pixels() {
|
|
4570
|
-
const px =
|
|
4570
|
+
const px = _chunk7ISPWEJAcjs.readRegion.call(void 0, this.surface, { x: 0, y: 0, width: this.width, height: this.height });
|
|
4571
4571
|
for (let i = 0; i < px.length; i += 4) {
|
|
4572
4572
|
const a = px[i + 3] / 255;
|
|
4573
4573
|
px[i] = Math.round(px[i] * a + 255 * (1 - a));
|
|
@@ -4591,7 +4591,7 @@ function replayItems(doc) {
|
|
|
4591
4591
|
}
|
|
4592
4592
|
function emptiedLayers(layers) {
|
|
4593
4593
|
let out = [...layers];
|
|
4594
|
-
for (const l of
|
|
4594
|
+
for (const l of _chunkEBSYZRSWcjs.flattenLayers.call(void 0, layers)) if (l.type === "pixel") out = _chunkEBSYZRSWcjs.mapLayer.call(void 0, out, l.id, () => ({ ...l, surface: _chunk7ISPWEJAcjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } }));
|
|
4595
4595
|
return out;
|
|
4596
4596
|
}
|
|
4597
4597
|
async function replayPainting(source, target, options = {}) {
|
|
@@ -4802,7 +4802,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
4802
4802
|
__init89() {this.library = null}
|
|
4803
4803
|
|
|
4804
4804
|
__init90() {this.secondaryColor = "#ffffff"}
|
|
4805
|
-
__init91() {this.mixerLoad =
|
|
4805
|
+
__init91() {this.mixerLoad = _chunkL2T6EJ5Scjs.EMPTY_MIXER_LOAD}
|
|
4806
4806
|
__init92() {this.view = { ...DEFAULT_VIEW, pan: { ...DEFAULT_VIEW.pan } }}
|
|
4807
4807
|
|
|
4808
4808
|
|
|
@@ -4852,12 +4852,12 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
4852
4852
|
canvas: () => this.doc.canvas,
|
|
4853
4853
|
paper: () => this.doc.paper,
|
|
4854
4854
|
layerSurface: (id) => {
|
|
4855
|
-
const l = _optionalChain([
|
|
4855
|
+
const l = _optionalChain([_chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _143 => _143.layer]);
|
|
4856
4856
|
return isPixelLayer(l) ? l.surface : null;
|
|
4857
4857
|
},
|
|
4858
4858
|
updateSurfaces: (surfaces, rects) => {
|
|
4859
4859
|
let layers = this.doc.layers;
|
|
4860
|
-
for (const [id, surface] of surfaces) if (
|
|
4860
|
+
for (const [id, surface] of surfaces) if (_chunkEBSYZRSWcjs.findLayer.call(void 0, layers, id)) layers = _chunkEBSYZRSWcjs.mapLayer.call(void 0, layers, id, (l) => ({ ...l, surface }));
|
|
4861
4861
|
this.doc = { ...this.doc, layers };
|
|
4862
4862
|
this.emit(rects.length ? rects : "all");
|
|
4863
4863
|
},
|
|
@@ -5098,7 +5098,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5098
5098
|
}
|
|
5099
5099
|
// --- Layers --------------------------------------------------------------------
|
|
5100
5100
|
getLayer(id) {
|
|
5101
|
-
return _optionalChain([
|
|
5101
|
+
return _optionalChain([_chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _155 => _155.layer]);
|
|
5102
5102
|
}
|
|
5103
5103
|
/** The active pixel layer (or `undefined`). */
|
|
5104
5104
|
getActiveLayer() {
|
|
@@ -5117,12 +5117,12 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5117
5117
|
walk(this.doc.layers, null, 0);
|
|
5118
5118
|
return out;
|
|
5119
5119
|
}
|
|
5120
|
-
describeLayer(l, parentId = _nullishCoalesce(_optionalChain([
|
|
5120
|
+
describeLayer(l, parentId = _nullishCoalesce(_optionalChain([_chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _156 => _156.parent, 'optionalAccess', _157 => _157.id]), () => ( null)), depth = _nullishCoalesce(_optionalChain([_chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _158 => _158.path, 'access', _159 => _159.length]), () => ( 0))) {
|
|
5121
5121
|
let bounds = null;
|
|
5122
5122
|
if (l.type === "pixel") {
|
|
5123
|
-
const b =
|
|
5123
|
+
const b = _chunk7ISPWEJAcjs.contentBounds.call(void 0, l.surface);
|
|
5124
5124
|
bounds = b ? { ...b, x: b.x + l.offset.x, y: b.y + l.offset.y } : null;
|
|
5125
|
-
} else for (const c of
|
|
5125
|
+
} else for (const c of _chunkEBSYZRSWcjs.flattenLayers.call(void 0, l.children)) if (c.type === "pixel") bounds = unionRect(bounds, this.describeLayer(c, l.id, depth + 1).bounds);
|
|
5126
5126
|
return {
|
|
5127
5127
|
id: l.id,
|
|
5128
5128
|
name: l.name,
|
|
@@ -5149,7 +5149,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5149
5149
|
if (!id) throw new PaintEditorError(`There is no active layer to ${what}; add one with add_layer.`);
|
|
5150
5150
|
const l = this.requireLayer(id);
|
|
5151
5151
|
if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; ${what} a pixel layer inside it.`);
|
|
5152
|
-
if (
|
|
5152
|
+
if (_chunkEBSYZRSWcjs.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.`);
|
|
5153
5153
|
if (!l.visible) throw new PaintEditorError(`Layer "${l.name}" is hidden; show it (update_layer visible true) before you ${what} it.`);
|
|
5154
5154
|
return l;
|
|
5155
5155
|
}
|
|
@@ -5162,7 +5162,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5162
5162
|
/** Adds an empty pixel layer or group above `aboveId` (default: the active layer) and makes it active. */
|
|
5163
5163
|
addLayer(options = {}) {
|
|
5164
5164
|
this.requireIdle("adding a layer");
|
|
5165
|
-
const count =
|
|
5165
|
+
const count = _chunkEBSYZRSWcjs.flattenLayers.call(void 0, this.doc.layers).length;
|
|
5166
5166
|
const type = _nullishCoalesce(options.type, () => ( "pixel"));
|
|
5167
5167
|
const name = _optionalChain([options, 'access', _160 => _160.name, 'optionalAccess', _161 => _161.trim, 'call', _162 => _162()]) || (type === "group" ? `Group ${count + 1}` : `Layer ${count + 1}`);
|
|
5168
5168
|
const layer = type === "group" ? { type: "group", id: newPaintLayerId(), name, visible: true, opacity: 1, blend: "pass-through", children: [] } : createPaintLayer(name);
|
|
@@ -5174,21 +5174,21 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5174
5174
|
if (g.type !== "group") throw new PaintEditorError(`Layer "${g.name}" is not a group; pass a group id as parentId.`);
|
|
5175
5175
|
parentId = g.id;
|
|
5176
5176
|
} else if (above) {
|
|
5177
|
-
const loc =
|
|
5177
|
+
const loc = _chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, above);
|
|
5178
5178
|
if (!loc) throw new PaintEditorError(`Unknown layer "${above}". Call list_layers for the ids.`);
|
|
5179
5179
|
parentId = _nullishCoalesce(_optionalChain([loc, 'access', _163 => _163.parent, 'optionalAccess', _164 => _164.id]), () => ( null));
|
|
5180
5180
|
index = loc.index + 1;
|
|
5181
5181
|
}
|
|
5182
|
-
const layers =
|
|
5182
|
+
const layers = _chunkEBSYZRSWcjs.insertLayer.call(void 0, this.doc.layers, layer, parentId, index);
|
|
5183
5183
|
this.commit(type === "group" ? "Add group" : "Add layer", { ...this.doc, layers, activeLayerId: layer.id });
|
|
5184
5184
|
return this.describeLayer(layer);
|
|
5185
5185
|
}
|
|
5186
5186
|
updateLayer(id, update) {
|
|
5187
5187
|
this.requireIdle("changing a layer");
|
|
5188
5188
|
const l = this.requireLayer(id);
|
|
5189
|
-
if (
|
|
5189
|
+
if (_chunkEBSYZRSWcjs.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}).`);
|
|
5190
5190
|
if (update.opacity !== void 0 && !(update.opacity >= 0 && update.opacity <= 1)) throw new PaintEditorError(`opacity ${update.opacity} is out of range; use 0..1.`);
|
|
5191
|
-
if (update.blend !== void 0 && !
|
|
5191
|
+
if (update.blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, update.blend) && !(l.type === "group" && update.blend === "pass-through")) {
|
|
5192
5192
|
throw new PaintEditorError(`Unknown blend mode "${update.blend}". Call get_canvas_info for the blend modes.`);
|
|
5193
5193
|
}
|
|
5194
5194
|
if (update.name !== void 0 && !update.name.trim()) throw new PaintEditorError("name is empty; give the layer a name.");
|
|
@@ -5202,31 +5202,31 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5202
5202
|
const locks = { ..._nullishCoalesce(l.locks, () => ( {})), ...update.locks };
|
|
5203
5203
|
next.locks = Object.values(locks).some(Boolean) ? locks : void 0;
|
|
5204
5204
|
}
|
|
5205
|
-
this.commit("Layer properties", { ...this.doc, layers:
|
|
5205
|
+
this.commit("Layer properties", { ...this.doc, layers: _chunkEBSYZRSWcjs.mapLayer.call(void 0, this.doc.layers, id, () => next) });
|
|
5206
5206
|
return this.describeLayer(next);
|
|
5207
5207
|
}
|
|
5208
5208
|
removeLayer(id) {
|
|
5209
5209
|
this.requireIdle("removing a layer");
|
|
5210
5210
|
const l = this.requireLayer(id);
|
|
5211
|
-
if (
|
|
5212
|
-
const wetIds = this.wet.wetLayerIds().filter((x) => x === id || l.type === "group" &&
|
|
5211
|
+
if (_chunkEBSYZRSWcjs.isLayerLocked.call(void 0, l, "all")) throw new PaintEditorError(`Layer "${l.name}" is fully locked; unlock it before removing it.`);
|
|
5212
|
+
const wetIds = this.wet.wetLayerIds().filter((x) => x === id || l.type === "group" && _chunkEBSYZRSWcjs.findLayer.call(void 0, l.children, x));
|
|
5213
5213
|
if (wetIds.length) {
|
|
5214
5214
|
this.beginWetOp();
|
|
5215
5215
|
for (const x of wetIds) this.wet.world.removeLane(x);
|
|
5216
5216
|
}
|
|
5217
|
-
const layers =
|
|
5217
|
+
const layers = _chunkEBSYZRSWcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
|
|
5218
5218
|
let active = this.doc.activeLayerId;
|
|
5219
|
-
if (active && !
|
|
5220
|
-
this.commit("Remove layer", { ...this.doc, layers, activeLayerId: active, ...this.thickWithout(
|
|
5219
|
+
if (active && !_chunkEBSYZRSWcjs.findLayer.call(void 0, layers, active)) active = _nullishCoalesce(_optionalChain([_chunkEBSYZRSWcjs.flattenLayers.call(void 0, layers), 'access', _165 => _165.filter, 'call', _166 => _166((x) => x.type === "pixel"), 'access', _167 => _167.pop, 'call', _168 => _168(), 'optionalAccess', _169 => _169.id]), () => ( null));
|
|
5220
|
+
this.commit("Remove layer", { ...this.doc, layers, activeLayerId: active, ...this.thickWithout(_chunkEBSYZRSWcjs.flattenLayers.call(void 0, [l]).map((x) => x.id)), ...this.stickersWithout(_chunkEBSYZRSWcjs.flattenLayers.call(void 0, [l]).map((x) => x.id)) });
|
|
5221
5221
|
return { removed: id, activeLayerId: active };
|
|
5222
5222
|
}
|
|
5223
5223
|
duplicateLayer(id) {
|
|
5224
5224
|
this.requireIdle("duplicating a layer");
|
|
5225
|
-
if (
|
|
5225
|
+
if (_chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id)) {
|
|
5226
5226
|
const inside = (l) => l.type === "group" ? l.children.flatMap(inside) : [l.id];
|
|
5227
|
-
this.dryLayersFirst(inside(
|
|
5227
|
+
this.dryLayersFirst(inside(_chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id).layer));
|
|
5228
5228
|
}
|
|
5229
|
-
const loc =
|
|
5229
|
+
const loc = _chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id);
|
|
5230
5230
|
if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
|
|
5231
5231
|
const thick = { ..._nullishCoalesce(this.doc.thick, () => ( {})) };
|
|
5232
5232
|
const stickers = { ..._nullishCoalesce(this.doc.stickers, () => ( {})) };
|
|
@@ -5237,53 +5237,53 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5237
5237
|
return l.type === "group" ? { ...l, id: id2, children: l.children.map(copy) } : { ...l, id: id2 };
|
|
5238
5238
|
};
|
|
5239
5239
|
const dup = { ...copy(loc.layer), name: `${loc.layer.name} copy` };
|
|
5240
|
-
const layers =
|
|
5240
|
+
const layers = _chunkEBSYZRSWcjs.insertLayer.call(void 0, this.doc.layers, dup, _nullishCoalesce(_optionalChain([loc, 'access', _170 => _170.parent, 'optionalAccess', _171 => _171.id]), () => ( null)), loc.index + 1);
|
|
5241
5241
|
this.commit("Duplicate layer", this.withWetEvents({ ...this.doc, layers, activeLayerId: dup.id, ...this.doc.thick ? { thick } : {}, ...this.doc.stickers ? { stickers } : {} }));
|
|
5242
5242
|
return this.describeLayer(dup);
|
|
5243
5243
|
}
|
|
5244
5244
|
/** Moves a layer to `index` (0 = bottom) within `parentId` (default its own parent; `null` = top level). */
|
|
5245
5245
|
moveLayer(id, index, parentId) {
|
|
5246
5246
|
this.requireIdle("moving a layer");
|
|
5247
|
-
const loc =
|
|
5247
|
+
const loc = _chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id);
|
|
5248
5248
|
if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
|
|
5249
5249
|
const target = parentId === void 0 ? _nullishCoalesce(_optionalChain([loc, 'access', _172 => _172.parent, 'optionalAccess', _173 => _173.id]), () => ( null)) : parentId;
|
|
5250
5250
|
if (target) {
|
|
5251
5251
|
const g = this.requireLayer(target);
|
|
5252
5252
|
if (g.type !== "group") throw new PaintEditorError(`Layer "${g.name}" is not a group; pass a group id as parentId.`);
|
|
5253
|
-
if (target === id || loc.layer.type === "group" &&
|
|
5253
|
+
if (target === id || loc.layer.type === "group" && _chunkEBSYZRSWcjs.findLayer.call(void 0, loc.layer.children, target)) throw new PaintEditorError("A group cannot move into itself.");
|
|
5254
5254
|
}
|
|
5255
|
-
const without =
|
|
5256
|
-
const siblings = target ?
|
|
5255
|
+
const without = _chunkEBSYZRSWcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
|
|
5256
|
+
const siblings = target ? _chunkEBSYZRSWcjs.findLayer.call(void 0, without, target).layer.children : without;
|
|
5257
5257
|
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).`);
|
|
5258
|
-
const layers =
|
|
5258
|
+
const layers = _chunkEBSYZRSWcjs.insertLayer.call(void 0, without, loc.layer, target, index);
|
|
5259
5259
|
this.commit("Move layer", { ...this.doc, layers });
|
|
5260
5260
|
return this.describeLayer(loc.layer);
|
|
5261
5261
|
}
|
|
5262
5262
|
/** Merges a pixel layer into the pixel layer below it (keeping the lower one's settings). */
|
|
5263
5263
|
mergeDown(id) {
|
|
5264
5264
|
this.requireIdle("merging");
|
|
5265
|
-
const pre =
|
|
5265
|
+
const pre = _chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id);
|
|
5266
5266
|
if (pre) {
|
|
5267
5267
|
const sib = pre.parent ? pre.parent.children : this.doc.layers;
|
|
5268
5268
|
this.dryLayersFirst([id, _optionalChain([sib, 'access', _174 => _174[pre.index - 1], 'optionalAccess', _175 => _175.id])].filter((x) => Boolean(x)));
|
|
5269
5269
|
}
|
|
5270
|
-
const loc =
|
|
5270
|
+
const loc = _chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id);
|
|
5271
5271
|
if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
|
|
5272
5272
|
const siblings = loc.parent ? loc.parent.children : this.doc.layers;
|
|
5273
5273
|
const below = siblings[loc.index - 1];
|
|
5274
5274
|
const upper = loc.layer;
|
|
5275
5275
|
if (!isPixelLayer(upper) || !isPixelLayer(below)) throw new PaintEditorError("Merge down needs a pixel layer directly above another pixel layer in the same group.");
|
|
5276
|
-
if (
|
|
5276
|
+
if (_chunkEBSYZRSWcjs.isLayerLocked.call(void 0, below, "pixels")) throw new PaintEditorError(`Layer "${below.name}" has its pixels locked; unlock it to merge into it.`);
|
|
5277
5277
|
const rect = unionRect(this.describeLayer(below).bounds, this.describeLayer(upper).bounds);
|
|
5278
|
-
let surface =
|
|
5278
|
+
let surface = _chunk7ISPWEJAcjs.emptySurface.call(void 0, 4);
|
|
5279
5279
|
if (rect) {
|
|
5280
5280
|
const base = { ...below, opacity: 1, blend: "normal", visible: true, clipped: void 0, mask: void 0 };
|
|
5281
5281
|
const upperLit = this.litLayers([upper])[0];
|
|
5282
5282
|
const px = createPaintCompositor().composite([base, upper.visible ? upperLit : { ...upperLit, opacity: 0 }], rect, this.sources());
|
|
5283
|
-
surface =
|
|
5283
|
+
surface = _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data: px }, 4, rect.x, rect.y);
|
|
5284
5284
|
}
|
|
5285
5285
|
const merged = { ...below, surface, offset: { x: 0, y: 0 } };
|
|
5286
|
-
const layers =
|
|
5286
|
+
const layers = _chunkEBSYZRSWcjs.mapLayer.call(void 0, _chunkEBSYZRSWcjs.mapLayer.call(void 0, this.doc.layers, upper.id, () => null), below.id, () => merged);
|
|
5287
5287
|
this.commit("Merge down", this.withWetEvents({ ...this.doc, layers, activeLayerId: below.id, ...this.thickWithout([upper.id]), ...this.stickersWithout([upper.id, below.id]) }));
|
|
5288
5288
|
return this.describeLayer(merged);
|
|
5289
5289
|
}
|
|
@@ -5296,7 +5296,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5296
5296
|
this.wet.world.removeLane(l.id);
|
|
5297
5297
|
}
|
|
5298
5298
|
const bounds = this.describeLayer(l).bounds;
|
|
5299
|
-
this.commit("Clear layer", this.withPaintEvent({ ...this.doc, layers:
|
|
5299
|
+
this.commit("Clear layer", this.withPaintEvent({ ...this.doc, layers: _chunkEBSYZRSWcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface: _chunk7ISPWEJAcjs.emptySurface.call(void 0, 4) })), ...this.thickWithout([l.id]), ...this.stickersWithout([l.id]) }, { kind: "clear", layerId: l.id }));
|
|
5300
5300
|
return { layerId: l.id, bounds };
|
|
5301
5301
|
}
|
|
5302
5302
|
/**
|
|
@@ -5316,14 +5316,14 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5316
5316
|
if (!(grainAmount >= 0 && grainAmount <= 1)) throw new PaintEditorError(`grain ${grainAmount} is out of range; use 0..1.`);
|
|
5317
5317
|
const pressure = _nullishCoalesce(options.pressure, () => ( 0.5));
|
|
5318
5318
|
const blend = _nullishCoalesce(options.blend, () => ( "normal"));
|
|
5319
|
-
if (!
|
|
5319
|
+
if (!_chunk7ISPWEJAcjs.isBlendMode.call(void 0, blend)) throw new PaintEditorError(`Unknown blend mode "${blend}".`);
|
|
5320
5320
|
const { width, height } = this.doc.canvas;
|
|
5321
5321
|
const rect = { x: 0, y: 0, width, height };
|
|
5322
|
-
const coverage = new (0,
|
|
5322
|
+
const coverage = new (0, _chunkL2T6EJ5Scjs.CoverageMap)();
|
|
5323
5323
|
const depth = grainAmount * this.doc.paper.depth;
|
|
5324
5324
|
const grain = depth > 0 ? paperGrain(this.doc.paper) : null;
|
|
5325
|
-
for (const { tx, ty } of
|
|
5326
|
-
const r = { x: tx *
|
|
5325
|
+
for (const { tx, ty } of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, rect)) {
|
|
5326
|
+
const r = { x: tx * _chunk7ISPWEJAcjs.TILE, y: ty * _chunk7ISPWEJAcjs.TILE, width: Math.min(_chunk7ISPWEJAcjs.TILE, width - tx * _chunk7ISPWEJAcjs.TILE), height: Math.min(_chunk7ISPWEJAcjs.TILE, height - ty * _chunk7ISPWEJAcjs.TILE) };
|
|
5327
5327
|
const vals = new Float32Array(r.width * r.height);
|
|
5328
5328
|
for (let y = 0, k = 0; y < r.height; y++) for (let x = 0; x < r.width; x++, k++) vals[k] = grain ? grainCatch(grain.at(r.x + x + 0.5, r.y + y + 0.5), depth, pressure) : 1;
|
|
5329
5329
|
coverage.accumulate(r, vals, 1);
|
|
@@ -5334,25 +5334,25 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5334
5334
|
background: rgbaOf(this.doc.paper.color),
|
|
5335
5335
|
opacity,
|
|
5336
5336
|
blend,
|
|
5337
|
-
lockTransparency:
|
|
5337
|
+
lockTransparency: _chunkEBSYZRSWcjs.isLayerLocked.call(void 0, l, "transparency"),
|
|
5338
5338
|
selection: null,
|
|
5339
5339
|
offset: l.offset
|
|
5340
5340
|
};
|
|
5341
5341
|
const surface = this.applyCoverage(l, coverage, rect, apply);
|
|
5342
|
-
this.commit("Fill layer", this.withPaintEvent(this.withWetEvents({ ...this.doc, layers:
|
|
5342
|
+
this.commit("Fill layer", this.withPaintEvent(this.withWetEvents({ ...this.doc, layers: _chunkEBSYZRSWcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })) }), { kind: "fill", layerId: l.id, data: { color, opacity, grain: grainAmount, pressure, blend } }));
|
|
5343
5343
|
return { layerId: l.id, bounds: rect };
|
|
5344
5344
|
}
|
|
5345
5345
|
applyCoverage(l, coverage, rect, apply) {
|
|
5346
5346
|
const base = l.surface;
|
|
5347
5347
|
const tiles = new Map(base.tiles);
|
|
5348
|
-
for (const { tx, ty } of
|
|
5349
|
-
const key =
|
|
5350
|
-
const src = _nullishCoalesce(_optionalChain([base, 'access', _180 => _180.tiles, 'access', _181 => _181.get, 'call', _182 => _182(key), 'optionalAccess', _183 => _183.data]), () => ( new Uint8ClampedArray(
|
|
5351
|
-
const tile =
|
|
5348
|
+
for (const { tx, ty } of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, { x: rect.x - l.offset.x, y: rect.y - l.offset.y, width: rect.width, height: rect.height })) {
|
|
5349
|
+
const key = _chunk7ISPWEJAcjs.tileKey.call(void 0, tx, ty);
|
|
5350
|
+
const src = _nullishCoalesce(_optionalChain([base, 'access', _180 => _180.tiles, 'access', _181 => _181.get, 'call', _182 => _182(key), 'optionalAccess', _183 => _183.data]), () => ( new Uint8ClampedArray(_chunk7ISPWEJAcjs.TILE * _chunk7ISPWEJAcjs.TILE * 4)));
|
|
5351
|
+
const tile = _chunk7ISPWEJAcjs.finishTile.call(void 0, _chunkL2T6EJ5Scjs.applyStrokeToTile.call(void 0, coverage, src, 4, tx, ty, apply), 4, 0);
|
|
5352
5352
|
if (tile) tiles.set(key, tile);
|
|
5353
5353
|
else tiles.delete(key);
|
|
5354
5354
|
}
|
|
5355
|
-
return new (0,
|
|
5355
|
+
return new (0, _chunk7ISPWEJAcjs.TiledSurface)(4, tiles, 0);
|
|
5356
5356
|
}
|
|
5357
5357
|
// --- Brushes -------------------------------------------------------------------
|
|
5358
5358
|
findBrush(id) {
|
|
@@ -5477,7 +5477,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5477
5477
|
if (options.layerId !== void 0) {
|
|
5478
5478
|
const l = this.requireLayer(options.layerId);
|
|
5479
5479
|
if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; pick from a pixel layer or the composite.`);
|
|
5480
|
-
const [r, g, b, a] =
|
|
5480
|
+
const [r, g, b, a] = _chunk7ISPWEJAcjs.readPixel.call(void 0, l.surface, px - l.offset.x, py - l.offset.y);
|
|
5481
5481
|
return { color: rgbToHex(r, g, b), alpha: Math.round(a / 255 * 1e3) / 1e3 };
|
|
5482
5482
|
}
|
|
5483
5483
|
const d = this.exportCompositor.composite(this.renderLayers({}), { x: px, y: py, width: 1, height: 1 }, this.sources());
|
|
@@ -5487,13 +5487,13 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5487
5487
|
/** Fills the Mixer Brush reservoir with a colour (default the editor colour). */
|
|
5488
5488
|
loadMixerBrush(color) {
|
|
5489
5489
|
const [r, g, b] = hexToRgb8(color === void 0 ? this.color : parseColor(color));
|
|
5490
|
-
this.mixerLoad =
|
|
5490
|
+
this.mixerLoad = _chunkL2T6EJ5Scjs.loadMixer.call(void 0, this.mixerLoad, [r / 255, g / 255, b / 255]);
|
|
5491
5491
|
this.emit([]);
|
|
5492
5492
|
return this.mixerLoad;
|
|
5493
5493
|
}
|
|
5494
5494
|
/** Empties the pickup well (and with `emptyReservoir` the loaded paint too). */
|
|
5495
5495
|
cleanMixerBrush(emptyReservoir = false) {
|
|
5496
|
-
this.mixerLoad = emptyReservoir ?
|
|
5496
|
+
this.mixerLoad = emptyReservoir ? _chunkL2T6EJ5Scjs.EMPTY_MIXER_LOAD : _chunkL2T6EJ5Scjs.cleanMixer.call(void 0, this.mixerLoad);
|
|
5497
5497
|
this.emit([]);
|
|
5498
5498
|
return this.mixerLoad;
|
|
5499
5499
|
}
|
|
@@ -5535,18 +5535,18 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5535
5535
|
let layer = (() => {
|
|
5536
5536
|
const id = _nullishCoalesce(init.layerId, () => ( doc.activeLayerId));
|
|
5537
5537
|
if (!id) throw new PaintEditorError("There is no active layer to paint on; add one with add_layer.");
|
|
5538
|
-
const loc =
|
|
5538
|
+
const loc = _chunkEBSYZRSWcjs.findLayer.call(void 0, doc.layers, id);
|
|
5539
5539
|
if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
|
|
5540
5540
|
const l = loc.layer;
|
|
5541
5541
|
if (!isPixelLayer(l)) throw new PaintEditorError(`Layer "${l.name}" is a group; paint on a pixel layer inside it.`);
|
|
5542
|
-
if (
|
|
5542
|
+
if (_chunkEBSYZRSWcjs.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.`);
|
|
5543
5543
|
if (!l.visible) throw new PaintEditorError(`Layer "${l.name}" is hidden; show it (update_layer visible true) to paint on it.`);
|
|
5544
5544
|
return l;
|
|
5545
5545
|
})();
|
|
5546
5546
|
const brush = this.strokeBrush(init);
|
|
5547
5547
|
const stickerLayer = Boolean(_optionalChain([doc, 'access', _184 => _184.stickers, 'optionalAccess', _185 => _185[layer.id], 'optionalAccess', _186 => _186.length]));
|
|
5548
5548
|
if (brush.engine === "sticker") {
|
|
5549
|
-
if (!stickerLayer &&
|
|
5549
|
+
if (!stickerLayer && _chunk7ISPWEJAcjs.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.`);
|
|
5550
5550
|
} else if (stickerLayer) {
|
|
5551
5551
|
throw new PaintEditorError(`Layer "${layer.name}" is a sticker layer (its pixels are drawn from its stickers); paint on another layer (add_layer).`);
|
|
5552
5552
|
}
|
|
@@ -5554,13 +5554,13 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5554
5554
|
if (isWetBrush(brush)) {
|
|
5555
5555
|
this.requireWetIdle("painting");
|
|
5556
5556
|
if (layer.offset.x || layer.offset.y) {
|
|
5557
|
-
const moved = { ...layer, surface:
|
|
5558
|
-
this.doc = { ...this.doc, layers:
|
|
5559
|
-
if (doc !== this.doc) doc = { ...doc, layers:
|
|
5557
|
+
const moved = { ...layer, surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, layer.surface, layer.offset.x, layer.offset.y), offset: { x: 0, y: 0 } };
|
|
5558
|
+
this.doc = { ...this.doc, layers: _chunkEBSYZRSWcjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => moved) };
|
|
5559
|
+
if (doc !== this.doc) doc = { ...doc, layers: _chunkEBSYZRSWcjs.mapLayer.call(void 0, doc.layers, layer.id, () => moved) };
|
|
5560
5560
|
layer = moved;
|
|
5561
5561
|
}
|
|
5562
|
-
if (!this.wet.wetLayerIds().includes(layer.id) && this.wet.wetLayerIds().length >=
|
|
5563
|
-
throw new PaintEditorError(`At most ${
|
|
5562
|
+
if (!this.wet.wetLayerIds().includes(layer.id) && this.wet.wetLayerIds().length >= _chunkL2T6EJ5Scjs.MAX_WET_LANES) {
|
|
5563
|
+
throw new PaintEditorError(`At most ${_chunkL2T6EJ5Scjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
|
|
5564
5564
|
}
|
|
5565
5565
|
this.beginWetOp();
|
|
5566
5566
|
const world = this.wet.ensureLane(layer.id, brush.wet.medium);
|
|
@@ -5586,7 +5586,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5586
5586
|
wet = { driver, surface: () => world.display(id).surface };
|
|
5587
5587
|
} else if (this.wet.wetLayerIds().includes(layer.id)) {
|
|
5588
5588
|
this.dryLayersFirst([layer.id]);
|
|
5589
|
-
const dried =
|
|
5589
|
+
const dried = _chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, layer.id).layer;
|
|
5590
5590
|
layer = dried;
|
|
5591
5591
|
}
|
|
5592
5592
|
let color = init.color === void 0 ? this.color : parseColor(init.color);
|
|
@@ -5605,7 +5605,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5605
5605
|
layerId: layer.id,
|
|
5606
5606
|
surface: layer.surface,
|
|
5607
5607
|
offset: layer.offset,
|
|
5608
|
-
lockTransparency:
|
|
5608
|
+
lockTransparency: _chunkEBSYZRSWcjs.isLayerLocked.call(void 0, layer, "transparency"),
|
|
5609
5609
|
brush,
|
|
5610
5610
|
color: rgba,
|
|
5611
5611
|
background: rgbaOf(doc.paper.color),
|
|
@@ -5698,7 +5698,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5698
5698
|
const thick = ch ? { ..._nullishCoalesce(this.doc.thick, () => ( {})), [l.id]: ch } : this.doc.thick;
|
|
5699
5699
|
const sprayed = s.stickers();
|
|
5700
5700
|
const stickers = sprayed ? { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [l.id]: [..._nullishCoalesce(_optionalChain([this, 'access', _198 => _198.doc, 'access', _199 => _199.stickers, 'optionalAccess', _200 => _200[l.id]]), () => ( [])), ...sprayed] } : this.doc.stickers;
|
|
5701
|
-
this.commit(`${brush.name} stroke`, this.withWetEvents({ ...this.doc, layers:
|
|
5701
|
+
this.commit(`${brush.name} stroke`, this.withWetEvents({ ...this.doc, layers: _chunkEBSYZRSWcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })), strokes: [...this.doc.strokes, stroke], ...thick ? { thick } : {}, ...stickers ? { stickers } : {} }), wetStroke ? before : this.doc);
|
|
5702
5702
|
}
|
|
5703
5703
|
};
|
|
5704
5704
|
let session;
|
|
@@ -5726,13 +5726,13 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5726
5726
|
if (cancelled || !surface) return;
|
|
5727
5727
|
const stroke = this.record(s);
|
|
5728
5728
|
s.result.strokeId = stroke.id;
|
|
5729
|
-
const l =
|
|
5729
|
+
const l = _chunkEBSYZRSWcjs.findLayer.call(void 0, out.layers, s.layerId).layer;
|
|
5730
5730
|
const offset = s.init.wet ? { x: 0, y: 0 } : l.offset;
|
|
5731
5731
|
const ch = s.thickChannels();
|
|
5732
5732
|
const sprayed = s.stickers();
|
|
5733
5733
|
out = {
|
|
5734
5734
|
...out,
|
|
5735
|
-
layers:
|
|
5735
|
+
layers: _chunkEBSYZRSWcjs.mapLayer.call(void 0, out.layers, l.id, () => ({ ...l, surface, offset })),
|
|
5736
5736
|
strokes: [...out.strokes, stroke],
|
|
5737
5737
|
...ch ? { thick: { ..._nullishCoalesce(out.thick, () => ( {})), [l.id]: ch } } : {},
|
|
5738
5738
|
...sprayed ? { stickers: { ..._nullishCoalesce(out.stickers, () => ( {})), [l.id]: [..._nullishCoalesce(_optionalChain([out, 'access', _201 => _201.stickers, 'optionalAccess', _202 => _202[l.id]]), () => ( [])), ...sprayed] } } : {}
|
|
@@ -5747,8 +5747,8 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5747
5747
|
if (this.wet.instantDry && result.strokeId) {
|
|
5748
5748
|
this.wet.dry(session.layerId);
|
|
5749
5749
|
this.logWet({ kind: "dry", layerId: session.layerId, at: out.strokes.length });
|
|
5750
|
-
const dried =
|
|
5751
|
-
out = { ...out, layers:
|
|
5750
|
+
const dried = _chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, session.layerId).layer.surface;
|
|
5751
|
+
out = { ...out, layers: _chunkEBSYZRSWcjs.mapLayer.call(void 0, out.layers, session.layerId, (l) => ({ ...l, surface: dried })) };
|
|
5752
5752
|
}
|
|
5753
5753
|
result.wet = this.wet.isWet(session.layerId);
|
|
5754
5754
|
}
|
|
@@ -5826,7 +5826,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5826
5826
|
brush = normalizePaintBrush({ tip: { ...b.tip, size: b.tip.size * (v.brush.tip.size / s.brush.tip.size) } }, b);
|
|
5827
5827
|
}
|
|
5828
5828
|
const layerId = _nullishCoalesce(options.layerId, () => ( s.layerId));
|
|
5829
|
-
if (!
|
|
5829
|
+
if (!_chunkEBSYZRSWcjs.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.`);
|
|
5830
5830
|
let load = s.load;
|
|
5831
5831
|
if (load && options.color !== void 0 && load.reservoir) {
|
|
5832
5832
|
const [r, g, b] = hexToRgb8(options.color);
|
|
@@ -5972,7 +5972,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
5972
5972
|
wetState() {
|
|
5973
5973
|
const st = this.getState().wet;
|
|
5974
5974
|
const backend = this.wet.backend();
|
|
5975
|
-
return { ...st, layers: this.wet.wetLayerIds().map((id) => this.wet.info(id)), backend, message: _nullishCoalesce(_optionalChain([backend, 'optionalAccess', _208 => _208.message]), () => (
|
|
5975
|
+
return { ...st, layers: this.wet.wetLayerIds().map((id) => this.wet.info(id)), backend, message: _nullishCoalesce(_optionalChain([backend, 'optionalAccess', _208 => _208.message]), () => ( _chunkL2T6EJ5Scjs.wetSupport.call(void 0, ).message)) };
|
|
5976
5976
|
}
|
|
5977
5977
|
/** One layer's wet settings and state. */
|
|
5978
5978
|
wetLayerInfo(layerId) {
|
|
@@ -6017,11 +6017,11 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6017
6017
|
wetPaper(options = {}) {
|
|
6018
6018
|
this.requireIdle("wetting the paper");
|
|
6019
6019
|
const l = this.wetLayer(options.layerId, "wet the paper of");
|
|
6020
|
-
if (
|
|
6020
|
+
if (_chunkEBSYZRSWcjs.isLayerLocked.call(void 0, l, "pixels")) throw new PaintEditorError(`Layer "${l.name}" has its pixels locked; unlock it first.`);
|
|
6021
6021
|
const amount = _nullishCoalesce(options.amount, () => ( 1));
|
|
6022
6022
|
if (!(amount > 0 && amount <= 1)) throw new PaintEditorError(`amount ${amount} is out of range; use above 0 up to 1.`);
|
|
6023
6023
|
const rect = _nullishCoalesce(this.checkRect(options.rect), () => ( { x: 0, y: 0, width: this.doc.canvas.width, height: this.doc.canvas.height }));
|
|
6024
|
-
if (!this.wet.wetLayerIds().includes(l.id) && this.wet.wetLayerIds().length >=
|
|
6024
|
+
if (!this.wet.wetLayerIds().includes(l.id) && this.wet.wetLayerIds().length >= _chunkL2T6EJ5Scjs.MAX_WET_LANES) throw new PaintEditorError(`At most ${_chunkL2T6EJ5Scjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
|
|
6025
6025
|
const before = this.doc;
|
|
6026
6026
|
this.beginWetOp();
|
|
6027
6027
|
const world = this.wet.ensureLane(l.id);
|
|
@@ -6101,7 +6101,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6101
6101
|
const live = this.live;
|
|
6102
6102
|
if (!live) return this.doc.layers;
|
|
6103
6103
|
if (_optionalChain([this, 'access', _212 => _212.liveLayers, 'optionalAccess', _213 => _213.key]) === live.surface) return this.liveLayers.layers;
|
|
6104
|
-
const layers =
|
|
6104
|
+
const layers = _chunkEBSYZRSWcjs.mapLayer.call(void 0, this.doc.layers, live.layerId, (l) => ({ ...l, surface: live.surface }));
|
|
6105
6105
|
this.liveLayers = { key: live.surface, layers };
|
|
6106
6106
|
return layers;
|
|
6107
6107
|
}
|
|
@@ -6130,7 +6130,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6130
6130
|
let out = layers;
|
|
6131
6131
|
for (const id of ids) {
|
|
6132
6132
|
const baked = this.wet.bakedSurface(id);
|
|
6133
|
-
if (baked &&
|
|
6133
|
+
if (baked && _chunkEBSYZRSWcjs.findLayer.call(void 0, out, id)) out = _chunkEBSYZRSWcjs.mapLayer.call(void 0, out, id, (l) => ({ ...l, surface: baked }));
|
|
6134
6134
|
}
|
|
6135
6135
|
return out;
|
|
6136
6136
|
}
|
|
@@ -6143,12 +6143,12 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6143
6143
|
const ids = /* @__PURE__ */ new Set([...Object.keys(_nullishCoalesce(thick, () => ( {}))), ...live ? [live.layerId] : []]);
|
|
6144
6144
|
for (const id of ids) {
|
|
6145
6145
|
const ch = _optionalChain([live, 'optionalAccess', _216 => _216.layerId]) === id ? live.channels : _optionalChain([thick, 'optionalAccess', _217 => _217[id]]);
|
|
6146
|
-
const l = ch && _optionalChain([
|
|
6146
|
+
const l = ch && _optionalChain([_chunkEBSYZRSWcjs.findLayer.call(void 0, out, id), 'optionalAccess', _218 => _218.layer]);
|
|
6147
6147
|
if (!ch || !isPixelLayer(l)) continue;
|
|
6148
6148
|
let cache = this.litCaches.get(id);
|
|
6149
6149
|
if (!cache) this.litCaches.set(id, cache = new LitCache());
|
|
6150
6150
|
const lit = cache.lit(l.surface, ch, this.lighting);
|
|
6151
|
-
if (lit !== l.surface) out =
|
|
6151
|
+
if (lit !== l.surface) out = _chunkEBSYZRSWcjs.mapLayer.call(void 0, out, id, () => ({ ...l, surface: lit }));
|
|
6152
6152
|
}
|
|
6153
6153
|
return out;
|
|
6154
6154
|
}
|
|
@@ -6156,7 +6156,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6156
6156
|
let layers = this.litLayers((_nullishCoalesce(options.wet, () => ( "display"))) === "dried" ? this.driedLayers() : this.currentLayers());
|
|
6157
6157
|
if (options.layerIds) {
|
|
6158
6158
|
const picked = [];
|
|
6159
|
-
for (const id of options.layerIds) picked.push(_nullishCoalesce(_optionalChain([
|
|
6159
|
+
for (const id of options.layerIds) picked.push(_nullishCoalesce(_optionalChain([_chunkEBSYZRSWcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _219 => _219.layer]), () => ( this.requireLayer(id))));
|
|
6160
6160
|
layers = picked.map((l) => ({ ...l, visible: true }));
|
|
6161
6161
|
}
|
|
6162
6162
|
const under = options.paper === false ? [] : [paperNode(this.doc.paper, this.lighting)];
|
|
@@ -6198,7 +6198,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6198
6198
|
/** Wet settings saved with the document (`null` when they are all defaults). */
|
|
6199
6199
|
wetJSON() {
|
|
6200
6200
|
const layers = {};
|
|
6201
|
-
for (const [id, set] of this.wet.settings) if (
|
|
6201
|
+
for (const [id, set] of this.wet.settings) if (_chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id)) layers[id] = { params: { ...set.params }, flow: { ...set.flow } };
|
|
6202
6202
|
const flat = this.wet.tilt.angle === 0;
|
|
6203
6203
|
if (!Object.keys(layers).length && flat) return void 0;
|
|
6204
6204
|
return { tilt: { ...this.wet.tilt }, layers };
|
|
@@ -6207,7 +6207,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6207
6207
|
this.wet.reset();
|
|
6208
6208
|
if (!raw || typeof raw !== "object") return;
|
|
6209
6209
|
const r = raw;
|
|
6210
|
-
this.wet.setTilt(
|
|
6210
|
+
this.wet.setTilt(_chunkL2T6EJ5Scjs.normalizeTilt.call(void 0, _nullishCoalesce(r.tilt, () => ( {}))));
|
|
6211
6211
|
if (r.layers && typeof r.layers === "object") {
|
|
6212
6212
|
for (const [id, v] of Object.entries(r.layers)) {
|
|
6213
6213
|
if (!v || typeof v !== "object") {
|
|
@@ -6215,7 +6215,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6215
6215
|
continue;
|
|
6216
6216
|
}
|
|
6217
6217
|
const x = v;
|
|
6218
|
-
this.wet.settings.set(id, { params:
|
|
6218
|
+
this.wet.settings.set(id, { params: _chunkL2T6EJ5Scjs.normalizeWetParams.call(void 0, _nullishCoalesce(x.params, () => ( {}))), flow: _chunkL2T6EJ5Scjs.normalizeFlow.call(void 0, _nullishCoalesce(x.flow, () => ( {}))) });
|
|
6219
6219
|
}
|
|
6220
6220
|
}
|
|
6221
6221
|
}
|
|
@@ -6224,14 +6224,14 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6224
6224
|
const ext = { ...this.extensions };
|
|
6225
6225
|
const channels = {};
|
|
6226
6226
|
for (const [id, ch] of Object.entries(_nullishCoalesce(this.doc.thick, () => ( {})))) {
|
|
6227
|
-
if (!
|
|
6227
|
+
if (!_chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id)) continue;
|
|
6228
6228
|
const saved = thickToJSON(ch);
|
|
6229
6229
|
if (saved) channels[id] = saved;
|
|
6230
6230
|
}
|
|
6231
6231
|
if (Object.keys(channels).length) ext.layerChannels = channels;
|
|
6232
6232
|
else delete ext.layerChannels;
|
|
6233
6233
|
const stickers = {};
|
|
6234
|
-
for (const [id, list] of Object.entries(_nullishCoalesce(this.doc.stickers, () => ( {})))) if (list.length &&
|
|
6234
|
+
for (const [id, list] of Object.entries(_nullishCoalesce(this.doc.stickers, () => ( {})))) if (list.length && _chunkEBSYZRSWcjs.findLayer.call(void 0, this.doc.layers, id)) stickers[id] = list.map((x) => ({ ...x }));
|
|
6235
6235
|
if (Object.keys(stickers).length) ext.stickers = stickers;
|
|
6236
6236
|
else delete ext.stickers;
|
|
6237
6237
|
if (this.lighting.azimuth !== DEFAULT_LIGHTING.azimuth || this.lighting.elevation !== DEFAULT_LIGHTING.elevation || this.lighting.relief !== DEFAULT_LIGHTING.relief) ext.lighting = { ...this.lighting };
|
|
@@ -6245,7 +6245,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6245
6245
|
if (ext.stickers && typeof ext.stickers === "object") {
|
|
6246
6246
|
const stickers = {};
|
|
6247
6247
|
for (const [id, list] of Object.entries(ext.stickers)) {
|
|
6248
|
-
if (!
|
|
6248
|
+
if (!_chunkEBSYZRSWcjs.findLayer.call(void 0, state.layers, id) || !Array.isArray(list)) continue;
|
|
6249
6249
|
const ok = list.filter((x) => x && typeof x.id === "string" && STAMP_KINDS.includes(x.stamp) && Number.isFinite(x.x) && Number.isFinite(x.y) && x.size > 0);
|
|
6250
6250
|
if (ok.length !== list.length) problems.push(`Some stickers of layer "${id}" could not be read; they were dropped.`);
|
|
6251
6251
|
stickers[id] = ok.map((x) => ({ ...x }));
|
|
@@ -6256,7 +6256,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6256
6256
|
if (!raw || typeof raw !== "object") return state;
|
|
6257
6257
|
const thick = {};
|
|
6258
6258
|
for (const [id, v] of Object.entries(raw)) {
|
|
6259
|
-
if (!
|
|
6259
|
+
if (!_chunkEBSYZRSWcjs.findLayer.call(void 0, state.layers, id)) continue;
|
|
6260
6260
|
try {
|
|
6261
6261
|
thick[id] = thickFromJSON(v);
|
|
6262
6262
|
} catch (e) {
|
|
@@ -6358,22 +6358,22 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6358
6358
|
opacity: 1,
|
|
6359
6359
|
blend: "normal",
|
|
6360
6360
|
locks: { all: true },
|
|
6361
|
-
surface:
|
|
6361
|
+
surface: _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, paperPixels, 4),
|
|
6362
6362
|
offset: { x: 0, y: 0 }
|
|
6363
6363
|
};
|
|
6364
6364
|
const merged = this.compositePixels({ paper: true }).data;
|
|
6365
6365
|
const changed = /* @__PURE__ */ new Map();
|
|
6366
6366
|
const toStandard = (layers2) => layers2.map((l) => {
|
|
6367
|
-
const blend = l.blend === "pass-through" ? l.blend :
|
|
6367
|
+
const blend = l.blend === "pass-through" ? l.blend : _chunk7ISPWEJAcjs.standardBlendMode.call(void 0, l.blend);
|
|
6368
6368
|
if (blend !== l.blend) changed.set(l.blend, [..._nullishCoalesce(changed.get(l.blend), () => ( [])), l.name]);
|
|
6369
6369
|
const next = blend === l.blend ? l : { ...l, blend };
|
|
6370
6370
|
return next.type === "group" ? { ...next, children: toStandard(next.children) } : next;
|
|
6371
6371
|
});
|
|
6372
6372
|
const layers = toStandard(dried);
|
|
6373
|
-
const result =
|
|
6373
|
+
const result = _chunk2J3LS7JZcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
|
|
6374
6374
|
for (const [mode, names] of changed) {
|
|
6375
|
-
const label = _nullishCoalesce(_optionalChain([
|
|
6376
|
-
const std = _nullishCoalesce(_optionalChain([
|
|
6375
|
+
const label = _nullishCoalesce(_optionalChain([_chunk7ISPWEJAcjs.BLEND_MODES, 'access', _225 => _225.find, 'call', _226 => _226((m) => m.id === mode), 'optionalAccess', _227 => _227.label]), () => ( mode));
|
|
6376
|
+
const std = _nullishCoalesce(_optionalChain([_chunk7ISPWEJAcjs.BLEND_MODES, 'access', _228 => _228.find, 'call', _229 => _229((m) => m.id === _chunk7ISPWEJAcjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _230 => _230.label]), () => ( _chunk7ISPWEJAcjs.standardBlendMode.call(void 0, mode)));
|
|
6377
6377
|
const list = names.map((n) => `"${n}"`).join(", ");
|
|
6378
6378
|
const one = names.length === 1;
|
|
6379
6379
|
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).`);
|
|
@@ -6620,9 +6620,9 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6620
6620
|
}
|
|
6621
6621
|
/** Replaces a layer's stickers and redraws its pixels from them (one undo step). */
|
|
6622
6622
|
commitStickers(label, layer, stickers) {
|
|
6623
|
-
if (
|
|
6623
|
+
if (_chunkEBSYZRSWcjs.isLayerLocked.call(void 0, layer, "pixels")) throw new PaintEditorError(`Layer "${layer.name}" has its pixels locked; unlock it first.`);
|
|
6624
6624
|
const surface = stickerSurface(stickers);
|
|
6625
|
-
const doc = { ...this.doc, layers:
|
|
6625
|
+
const doc = { ...this.doc, layers: _chunkEBSYZRSWcjs.mapLayer.call(void 0, this.doc.layers, layer.id, () => ({ ...layer, surface, offset: { x: 0, y: 0 } })), stickers: { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [layer.id]: stickers } };
|
|
6626
6626
|
this.commit(label, this.withPaintEvent(doc, { kind: "stickers", layerId: layer.id, data: { stickers: stickers.map((s) => ({ ...s })) } }));
|
|
6627
6627
|
}
|
|
6628
6628
|
/** Moves, turns, resizes, recolours or restamps one sticker (one undo step). Returns it. */
|
|
@@ -6868,7 +6868,7 @@ var PaintEditorController = (_class17 = class _PaintEditorController {
|
|
|
6868
6868
|
}
|
|
6869
6869
|
/** A layer's tile surface (live while stroking), for thumbnails. */
|
|
6870
6870
|
layerSurface(id) {
|
|
6871
|
-
const l = _optionalChain([
|
|
6871
|
+
const l = _optionalChain([_chunkEBSYZRSWcjs.findLayer.call(void 0, this.currentLayers(), id), 'optionalAccess', _253 => _253.layer]);
|
|
6872
6872
|
return isPixelLayer(l) ? l.surface : null;
|
|
6873
6873
|
}
|
|
6874
6874
|
}, _class17);
|
|
@@ -7674,7 +7674,7 @@ function createPaintWetTools(c) {
|
|
|
7674
7674
|
type: "object",
|
|
7675
7675
|
properties: {
|
|
7676
7676
|
layerId: LAYER_ID2,
|
|
7677
|
-
kind: { type: "string", enum: [...
|
|
7677
|
+
kind: { type: "string", enum: [..._chunkL2T6EJ5Scjs.WET_FLOW_KINDS], description: "none, linear, swirl, radial or turbulent." },
|
|
7678
7678
|
strength: UNIT("How hard it pushes, 0..1 (1 is about a 25\xB0 tilt; default 0.5)."),
|
|
7679
7679
|
angle: { type: "number", minimum: -360, maximum: 360, description: "linear: direction in degrees clockwise from canvas down (default 0)." },
|
|
7680
7680
|
center: {
|
|
@@ -7872,7 +7872,7 @@ var TIP = {
|
|
|
7872
7872
|
type: "object",
|
|
7873
7873
|
description: "The tip (the shared brush engine). Missing fields keep their current values.",
|
|
7874
7874
|
properties: {
|
|
7875
|
-
size: { type: "number", minimum: 1, maximum:
|
|
7875
|
+
size: { type: "number", minimum: 1, maximum: _chunkL2T6EJ5Scjs.MAX_BRUSH_SIZE, description: "Diameter in document pixels." },
|
|
7876
7876
|
hardness: { type: "number", minimum: 0, maximum: 1, description: "Edge hardness, 0 (soft) .. 1 (hard)." },
|
|
7877
7877
|
spacing: { type: "number", minimum: 0.01, maximum: 10, description: "Dab spacing as a fraction of the diameter (0.05 is smooth, 1 is dotted)." },
|
|
7878
7878
|
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." },
|
|
@@ -7884,7 +7884,7 @@ var TIP = {
|
|
|
7884
7884
|
pressureOpacity: { type: "boolean", description: "Pressure scales the opacity." },
|
|
7885
7885
|
blend: {
|
|
7886
7886
|
type: "string",
|
|
7887
|
-
enum:
|
|
7887
|
+
enum: _chunk7ISPWEJAcjs.BLEND_MODES.map((m) => m.id),
|
|
7888
7888
|
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)."
|
|
7889
7889
|
}
|
|
7890
7890
|
},
|
|
@@ -7917,11 +7917,11 @@ var MIXER = {
|
|
|
7917
7917
|
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." },
|
|
7918
7918
|
loadEachStroke: { type: "boolean", description: "Refill the reservoir with the colour before each stroke." },
|
|
7919
7919
|
cleanEachStroke: { type: "boolean", description: "Empty the pickup well after each stroke." },
|
|
7920
|
-
mixing: { type: "string", enum: [...
|
|
7920
|
+
mixing: { type: "string", enum: [..._chunkL2T6EJ5Scjs.MIXING_MODELS], description: "rgb: RGB averages. pigment: mixes like paint (Kubelka-Munk)." }
|
|
7921
7921
|
},
|
|
7922
7922
|
additionalProperties: false
|
|
7923
7923
|
};
|
|
7924
|
-
var MIXING = { type: "string", enum: [...
|
|
7924
|
+
var MIXING = { type: "string", enum: [..._chunkL2T6EJ5Scjs.MIXING_MODELS], description: "pigment: mixes like paint (Kubelka-Munk, blue and yellow make green); rgb: straight RGB averages." };
|
|
7925
7925
|
var BEHAVIOR = {
|
|
7926
7926
|
type: "object",
|
|
7927
7927
|
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.",
|
|
@@ -8149,7 +8149,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
8149
8149
|
strokes: d.strokes.length,
|
|
8150
8150
|
undo: s.undoLabel,
|
|
8151
8151
|
redo: s.redoLabel,
|
|
8152
|
-
blendModes:
|
|
8152
|
+
blendModes: _chunk7ISPWEJAcjs.BLEND_MODES.map((m) => m.id),
|
|
8153
8153
|
wet: s.wet.wet,
|
|
8154
8154
|
lighting: c.getLighting()
|
|
8155
8155
|
};
|
|
@@ -8285,7 +8285,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
8285
8285
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0..1." },
|
|
8286
8286
|
blend: {
|
|
8287
8287
|
type: "string",
|
|
8288
|
-
enum: [...
|
|
8288
|
+
enum: [..._chunk7ISPWEJAcjs.BLEND_MODES.map((m) => m.id), "pass-through"],
|
|
8289
8289
|
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."
|
|
8290
8290
|
},
|
|
8291
8291
|
clipped: { type: "boolean", description: "Clip to the layer below (paint only shows where it has paint)." },
|
|
@@ -8314,12 +8314,12 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
8314
8314
|
inputSchema: EMPTY3,
|
|
8315
8315
|
annotations: { title: "List blend modes", ...READ6 },
|
|
8316
8316
|
handler: () => ({
|
|
8317
|
-
modes:
|
|
8317
|
+
modes: _chunk7ISPWEJAcjs.BLEND_MODES.map((m) => ({
|
|
8318
8318
|
id: m.id,
|
|
8319
8319
|
label: m.label,
|
|
8320
8320
|
group: m.painterly ? "painterly" : m.id === "pigment" ? "pigment" : "standard",
|
|
8321
8321
|
...m.description ? { description: m.description } : {},
|
|
8322
|
-
psd:
|
|
8322
|
+
psd: _chunk7ISPWEJAcjs.standardBlendMode.call(void 0, m.id)
|
|
8323
8323
|
}))
|
|
8324
8324
|
})
|
|
8325
8325
|
});
|
|
@@ -8387,7 +8387,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
8387
8387
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Opacity 0..1 (default 1)." },
|
|
8388
8388
|
grain: { type: "number", minimum: 0, maximum: 1, description: "Paper grain response 0..1 (default 0: flat)." },
|
|
8389
8389
|
pressure: { type: "number", minimum: 0, maximum: 1, description: "With grain: how far into the valleys, 0..1 (default 0.5)." },
|
|
8390
|
-
blend: { type: "string", enum:
|
|
8390
|
+
blend: { type: "string", enum: _chunk7ISPWEJAcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal; pigment mixes like paint, watercolor glazes; see list_blend_modes)." }
|
|
8391
8391
|
},
|
|
8392
8392
|
additionalProperties: false
|
|
8393
8393
|
},
|
|
@@ -8803,7 +8803,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
|
|
|
8803
8803
|
tools.push(...createPaintThickTools(c));
|
|
8804
8804
|
tools.push(...createPaintReplayTools(c));
|
|
8805
8805
|
tools.push(...createPaintStickerTools(c));
|
|
8806
|
-
tools.push(...
|
|
8806
|
+
tools.push(..._chunkL2T6EJ5Scjs.createPigmentTools.call(void 0, ));
|
|
8807
8807
|
return { id: _nullishCoalesce(options.id, () => ( "paint-editor")), namespace: options.namespace, tools };
|
|
8808
8808
|
}
|
|
8809
8809
|
|
|
@@ -8998,11 +8998,11 @@ var PaintCanvasPresenter = (_class19 = class {
|
|
|
8998
8998
|
const key = `${tx},${ty}`;
|
|
8999
8999
|
if (this.uploaded.get(key) === data) return;
|
|
9000
9000
|
this.uploaded.set(key, data);
|
|
9001
|
-
if (!this.scratch) this.scratch = ctx.createImageData(
|
|
9001
|
+
if (!this.scratch) this.scratch = ctx.createImageData(_chunk7ISPWEJAcjs.TILE, _chunk7ISPWEJAcjs.TILE);
|
|
9002
9002
|
this.scratch.data.set(data);
|
|
9003
|
-
const ox = tx *
|
|
9004
|
-
const oy = ty *
|
|
9005
|
-
ctx.putImageData(this.scratch, ox, oy, 0, 0, Math.min(
|
|
9003
|
+
const ox = tx * _chunk7ISPWEJAcjs.TILE;
|
|
9004
|
+
const oy = ty * _chunk7ISPWEJAcjs.TILE;
|
|
9005
|
+
ctx.putImageData(this.scratch, ox, oy, 0, 0, Math.min(_chunk7ISPWEJAcjs.TILE, width - ox), Math.min(_chunk7ISPWEJAcjs.TILE, height - oy));
|
|
9006
9006
|
drawn++;
|
|
9007
9007
|
}, { dirty });
|
|
9008
9008
|
return drawn;
|
|
@@ -9090,8 +9090,8 @@ function wheelPick(dx, dy, wheel, color) {
|
|
|
9090
9090
|
return rgbToHexColor(nr, ng, nb);
|
|
9091
9091
|
}
|
|
9092
9092
|
var BLEND_MENU_GROUPS = [
|
|
9093
|
-
{ label: "Standard", modes:
|
|
9094
|
-
{ label: "Paint", modes:
|
|
9093
|
+
{ label: "Standard", modes: _chunk7ISPWEJAcjs.BLEND_MODES.filter((m) => !m.painterly && m.id !== "pigment") },
|
|
9094
|
+
{ label: "Paint", modes: _chunk7ISPWEJAcjs.BLEND_MODES.filter((m) => m.painterly || m.id === "pigment") }
|
|
9095
9095
|
];
|
|
9096
9096
|
var PICKUP_SLIDERS = [
|
|
9097
9097
|
{ path: "behavior.pickup", label: "Pick-up", min: 0, max: 1, step: 0.01 },
|
|
@@ -9291,10 +9291,10 @@ function drawWaterOverlay(controller, ctx) {
|
|
|
9291
9291
|
if (!controller.getState().wet.overlay) return 0;
|
|
9292
9292
|
const tiles = controller.waterOverlayTiles({ x: 0, y: 0, width, height });
|
|
9293
9293
|
if (!tiles.length) return 0;
|
|
9294
|
-
const img = ctx.createImageData(
|
|
9294
|
+
const img = ctx.createImageData(_chunk7ISPWEJAcjs.TILE, _chunk7ISPWEJAcjs.TILE);
|
|
9295
9295
|
for (const t of tiles) {
|
|
9296
9296
|
img.data.set(t.data);
|
|
9297
|
-
ctx.putImageData(img, t.tx *
|
|
9297
|
+
ctx.putImageData(img, t.tx * _chunk7ISPWEJAcjs.TILE, t.ty * _chunk7ISPWEJAcjs.TILE, 0, 0, Math.min(_chunk7ISPWEJAcjs.TILE, width - t.tx * _chunk7ISPWEJAcjs.TILE), Math.min(_chunk7ISPWEJAcjs.TILE, height - t.ty * _chunk7ISPWEJAcjs.TILE));
|
|
9298
9298
|
}
|
|
9299
9299
|
return tiles.length;
|
|
9300
9300
|
}
|
|
@@ -9578,5 +9578,5 @@ function quickStencil(kind, canvas) {
|
|
|
9578
9578
|
|
|
9579
9579
|
|
|
9580
9580
|
|
|
9581
|
-
exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkTFOPHZ3Ucjs.BLEND_MODES; exports.BRUSH_ID = BRUSH_ID; exports.BRUSH_ROTATIONS = BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = BUILTIN_BRUSHES; exports.BristleStroke = BristleStroke; exports.DEFAULT_BEHAVIOR = DEFAULT_BEHAVIOR; exports.DEFAULT_BRISTLE = DEFAULT_BRISTLE; exports.DEFAULT_BRUSH_ID = DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = DEFAULT_DYNAMICS; exports.DEFAULT_FLOW = _chunkHOCPSFGAcjs.DEFAULT_FLOW; exports.DEFAULT_IMPASTO = DEFAULT_IMPASTO; exports.DEFAULT_LIGHTING = DEFAULT_LIGHTING; exports.DEFAULT_MULTI_COLOR = DEFAULT_MULTI_COLOR; exports.DEFAULT_PAPER = DEFAULT_PAPER; exports.DEFAULT_PARTICLE = DEFAULT_PARTICLE; exports.DEFAULT_STICKER = DEFAULT_STICKER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DEFAULT_WET_BRUSH = DEFAULT_WET_BRUSH; exports.DEFAULT_WET_PARAMS = _chunkHOCPSFGAcjs.DEFAULT_WET_PARAMS; exports.DryStroke = DryStroke; exports.GRAIN_PATTERNS = GRAIN_PATTERNS; exports.GRAIN_TILE = GRAIN_TILE; exports.HARMONY_KINDS = HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = IDENTITY_COPY; exports.IMPASTO_TOOLS = IMPASTO_TOOLS; exports.IMPASTO_TOOL_LABELS = IMPASTO_TOOL_LABELS; exports.LIGHT_SLIDERS = LIGHT_SLIDERS; exports.LitCache = LitCache; exports.MAX_BRUSH_SIZE = _chunkHOCPSFGAcjs.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 = MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunkTFOPHZ3Ucjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = PAINT_BRUSH_ENGINES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_FAMILIES = PAPER_FAMILIES; exports.PAPER_LIBRARY = PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PARTICLE_KINDS = PARTICLE_KINDS; exports.PARTICLE_KIND_LABELS = PARTICLE_KIND_LABELS; exports.PARTICLE_RENDERS = 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.PaintGesture = PaintGesture; exports.PaintPresence = PaintPresence; exports.PaintStrokeSession = PaintStrokeSession; exports.PaintWetLayers = PaintWetLayers; exports.PaperGrain = PaperGrain; exports.ParticleStroke = ParticleStroke; exports.PenDabWalker = PenDabWalker; exports.PenSmoother = PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.STAMP_KINDS = 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 = StickerSpray; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.ThickStrokeDriver = ThickStrokeDriver; exports.TileableNoise = TileableNoise; exports.WET_FLOW_KINDS = _chunkHOCPSFGAcjs.WET_FLOW_KINDS; exports.WET_MEDIA = WET_MEDIA; exports.WET_MEDIUM_LABELS = WET_MEDIUM_LABELS; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_PARAM_KEYS = _chunkHOCPSFGAcjs.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 = WET_TOOLS; exports.WET_TOOL_LABELS = WET_TOOL_LABELS; exports.WetStrokeDriver = WetStrokeDriver; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushEngineControls = brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushToJSON = brushToJSON; exports.buildTimeLapse = buildTimeLapse; exports.clonePaper = clonePaper; exports.colorHarmony = colorHarmony; exports.composeAffine = composeAffine; exports.contactSheet = contactSheet; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; 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 = drawSticker; exports.drawWaterOverlay = drawWaterOverlay; exports.emptiedLayers = emptiedLayers; exports.emptyThickChannels = emptyThickChannels; exports.fitZoom = fitZoom; exports.grainCatch = grainCatch; exports.grainHeights = grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = hash2; exports.hexToRgb8 = hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkTFOPHZ3Ucjs.isBlendMode; exports.isPainterlyBlendMode = _chunkTFOPHZ3Ucjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetBrush = isWetBrush; exports.isWetCapable = isWetCapable; exports.lightTile = lightTile; exports.lightingKey = lightingKey; exports.mapPenPoint = mapPenPoint; exports.mix32 = mix32; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = multiColorSliders; exports.newPaintLayerId = newPaintLayerId; exports.normalizeBehavior = normalizeBehavior; exports.normalizeBristle = normalizeBristle; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = normalizeDynamics; exports.normalizeFlow = _chunkHOCPSFGAcjs.normalizeFlow; exports.normalizeImpasto = normalizeImpasto; exports.normalizeLighting = normalizeLighting; exports.normalizeMultiColor = normalizeMultiColor; exports.normalizePaintBrush = normalizePaintBrush; exports.normalizePaper = normalizePaper; exports.normalizeParticle = normalizeParticle; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeStencil = normalizeStencil; exports.normalizeStickerSettings = normalizeStickerSettings; exports.normalizeStickerUpdate = normalizeStickerUpdate; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.normalizeWetBrush = normalizeWetBrush; exports.normalizeWetParams = _chunkHOCPSFGAcjs.normalizeWetParams; exports.padSampleRadius = padSampleRadius; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = paperPreset; exports.parseBrushLibrary = parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.patchBrushValue = patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.pointerToPenPoint = pointerToPenPoint; exports.quickStencil = quickStencil; exports.rand01 = rand01; exports.randSigned = randSigned; exports.readPath = readPath; exports.reliefInfo = reliefInfo; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = renderPaper; exports.renderStickers = renderStickers; exports.replayFrame = replayFrame; exports.replayItems = replayItems; exports.replayPainting = replayPainting; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.samplePressure = samplePressure; exports.scaleStencil = scaleStencil; exports.screenToDocument = screenToDocument; exports.seedFromString = seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.stampCoverage = stampCoverage; exports.standardBlendMode = _chunkTFOPHZ3Ucjs.standardBlendMode; exports.startWetClock = startWetClock; exports.stencilMask = stencilMask; exports.stencilOutline = stencilOutline; exports.stickerRect = stickerRect; exports.stickerSurface = 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 = tiltToOrientation; exports.timeLapseVideo = timeLapseVideo; exports.timeLapseZip = timeLapseZip; exports.toStrokePoint = toStrokePoint; exports.toggleStamp = toggleStamp; exports.usesPaintExchange = usesPaintExchange; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wetPaperInput = wetPaperInput; exports.wetPigmentOf = wetPigmentOf; exports.wetSupport = _chunkHOCPSFGAcjs.wetSupport; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = wheelToHue;
|
|
9581
|
+
exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunk7ISPWEJAcjs.BLEND_MODES; exports.BRUSH_ID = BRUSH_ID; exports.BRUSH_ROTATIONS = BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = BUILTIN_BRUSHES; exports.BristleStroke = BristleStroke; exports.DEFAULT_BEHAVIOR = DEFAULT_BEHAVIOR; exports.DEFAULT_BRISTLE = DEFAULT_BRISTLE; exports.DEFAULT_BRUSH_ID = DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = DEFAULT_DYNAMICS; exports.DEFAULT_FLOW = _chunkL2T6EJ5Scjs.DEFAULT_FLOW; exports.DEFAULT_IMPASTO = DEFAULT_IMPASTO; exports.DEFAULT_LIGHTING = DEFAULT_LIGHTING; exports.DEFAULT_MULTI_COLOR = DEFAULT_MULTI_COLOR; exports.DEFAULT_PAPER = DEFAULT_PAPER; exports.DEFAULT_PARTICLE = DEFAULT_PARTICLE; exports.DEFAULT_STICKER = DEFAULT_STICKER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DEFAULT_WET_BRUSH = DEFAULT_WET_BRUSH; exports.DEFAULT_WET_PARAMS = _chunkL2T6EJ5Scjs.DEFAULT_WET_PARAMS; exports.DryStroke = DryStroke; exports.GRAIN_PATTERNS = GRAIN_PATTERNS; exports.GRAIN_TILE = GRAIN_TILE; exports.HARMONY_KINDS = HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = IDENTITY_COPY; exports.IMPASTO_TOOLS = IMPASTO_TOOLS; exports.IMPASTO_TOOL_LABELS = IMPASTO_TOOL_LABELS; exports.LIGHT_SLIDERS = LIGHT_SLIDERS; exports.LitCache = LitCache; exports.MAX_BRUSH_SIZE = _chunkL2T6EJ5Scjs.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 = MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunk7ISPWEJAcjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = PAINT_BRUSH_ENGINES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_FAMILIES = PAPER_FAMILIES; exports.PAPER_LIBRARY = PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PARTICLE_KINDS = PARTICLE_KINDS; exports.PARTICLE_KIND_LABELS = PARTICLE_KIND_LABELS; exports.PARTICLE_RENDERS = 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.PaintGesture = PaintGesture; exports.PaintPresence = PaintPresence; exports.PaintStrokeSession = PaintStrokeSession; exports.PaintWetLayers = PaintWetLayers; exports.PaperGrain = PaperGrain; exports.ParticleStroke = ParticleStroke; exports.PenDabWalker = PenDabWalker; exports.PenSmoother = PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.STAMP_KINDS = 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 = StickerSpray; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.ThickStrokeDriver = ThickStrokeDriver; exports.TileableNoise = TileableNoise; exports.WET_FLOW_KINDS = _chunkL2T6EJ5Scjs.WET_FLOW_KINDS; exports.WET_MEDIA = WET_MEDIA; exports.WET_MEDIUM_LABELS = WET_MEDIUM_LABELS; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_PARAM_KEYS = _chunkL2T6EJ5Scjs.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 = WET_TOOLS; exports.WET_TOOL_LABELS = WET_TOOL_LABELS; exports.WetStrokeDriver = WetStrokeDriver; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushEngineControls = brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushToJSON = brushToJSON; exports.buildTimeLapse = buildTimeLapse; exports.clonePaper = clonePaper; exports.colorHarmony = colorHarmony; exports.composeAffine = composeAffine; exports.contactSheet = contactSheet; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; 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 = drawSticker; exports.drawWaterOverlay = drawWaterOverlay; exports.emptiedLayers = emptiedLayers; exports.emptyThickChannels = emptyThickChannels; exports.fitZoom = fitZoom; exports.grainCatch = grainCatch; exports.grainHeights = grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = hash2; exports.hexToRgb8 = hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunk7ISPWEJAcjs.isBlendMode; exports.isPainterlyBlendMode = _chunk7ISPWEJAcjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetBrush = isWetBrush; exports.isWetCapable = isWetCapable; exports.lightTile = lightTile; exports.lightingKey = lightingKey; exports.mapPenPoint = mapPenPoint; exports.mix32 = mix32; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = multiColorSliders; exports.newPaintLayerId = newPaintLayerId; exports.normalizeBehavior = normalizeBehavior; exports.normalizeBristle = normalizeBristle; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = normalizeDynamics; exports.normalizeFlow = _chunkL2T6EJ5Scjs.normalizeFlow; exports.normalizeImpasto = normalizeImpasto; exports.normalizeLighting = normalizeLighting; exports.normalizeMultiColor = normalizeMultiColor; exports.normalizePaintBrush = normalizePaintBrush; exports.normalizePaper = normalizePaper; exports.normalizeParticle = normalizeParticle; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeStencil = normalizeStencil; exports.normalizeStickerSettings = normalizeStickerSettings; exports.normalizeStickerUpdate = normalizeStickerUpdate; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.normalizeWetBrush = normalizeWetBrush; exports.normalizeWetParams = _chunkL2T6EJ5Scjs.normalizeWetParams; exports.padSampleRadius = padSampleRadius; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = paperPreset; exports.parseBrushLibrary = parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.patchBrushValue = patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.pointerToPenPoint = pointerToPenPoint; exports.quickStencil = quickStencil; exports.rand01 = rand01; exports.randSigned = randSigned; exports.readPath = readPath; exports.reliefInfo = reliefInfo; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = renderPaper; exports.renderStickers = renderStickers; exports.replayFrame = replayFrame; exports.replayItems = replayItems; exports.replayPainting = replayPainting; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.samplePressure = samplePressure; exports.scaleStencil = scaleStencil; exports.screenToDocument = screenToDocument; exports.seedFromString = seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.stampCoverage = stampCoverage; exports.standardBlendMode = _chunk7ISPWEJAcjs.standardBlendMode; exports.startWetClock = startWetClock; exports.stencilMask = stencilMask; exports.stencilOutline = stencilOutline; exports.stickerRect = stickerRect; exports.stickerSurface = 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 = tiltToOrientation; exports.timeLapseVideo = timeLapseVideo; exports.timeLapseZip = timeLapseZip; exports.toStrokePoint = toStrokePoint; exports.toggleStamp = toggleStamp; exports.usesPaintExchange = usesPaintExchange; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wetPaperInput = wetPaperInput; exports.wetPigmentOf = wetPigmentOf; exports.wetSupport = _chunkL2T6EJ5Scjs.wetSupport; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = wheelToHue;
|
|
9582
9582
|
//# sourceMappingURL=index.cjs.map
|