@pixerate/editor 0.135.0 → 0.137.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation-editor/index.cjs +63 -55
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +8 -5
- package/dist/animation-editor/index.d.ts +8 -5
- package/dist/animation-editor/index.js +10 -2
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/{bezier-J8i4uqSH.d.cts → bezier-CZ2AhjID.d.cts} +1 -1
- package/dist/{bezier-lNEOp0Jx.d.ts → bezier-Dywv3Bw8.d.ts} +1 -1
- package/dist/blending-D7jCmjO6.d.cts +1026 -0
- package/dist/blending-NgF3qo3d.d.ts +1026 -0
- package/dist/brushes-CnvZSYYU.d.cts +744 -0
- package/dist/brushes-DJmUbIgz.d.ts +744 -0
- package/dist/{brushstrokeRender-SII6MG4R.js → brushstrokeRender-2FAXA3XC.js} +13 -16
- package/dist/{brushstrokeRender-SII6MG4R.js.map → brushstrokeRender-2FAXA3XC.js.map} +1 -1
- package/dist/{brushstrokeRender-JNHVEUFG.cjs → brushstrokeRender-IMFY3FF6.cjs} +16 -19
- package/dist/brushstrokeRender-IMFY3FF6.cjs.map +1 -0
- package/dist/canvas/index.cjs +10 -10
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +10 -7
- package/dist/canvas/index.d.ts +10 -7
- package/dist/canvas/index.js +4 -4
- package/dist/{chunk-W4LNKTHT.cjs → chunk-2XS6LTUP.cjs} +63 -63
- package/dist/{chunk-W4LNKTHT.cjs.map → chunk-2XS6LTUP.cjs.map} +1 -1
- package/dist/{chunk-HHTCDFZC.js → chunk-3D77LOBM.js} +234 -136
- package/dist/chunk-3D77LOBM.js.map +1 -0
- package/dist/{chunk-BR7EKQUP.js → chunk-3G6J7UFV.js} +322 -2
- package/dist/chunk-3G6J7UFV.js.map +1 -0
- package/dist/{chunk-62XUO5LB.js → chunk-3X6IAJUQ.js} +2 -2
- package/dist/{chunk-EM3FMJWE.js → chunk-5FSRTP6E.js} +320 -3
- package/dist/chunk-5FSRTP6E.js.map +1 -0
- package/dist/{chunk-Z2H7KECK.cjs → chunk-5OOIUXNJ.cjs} +345 -247
- package/dist/chunk-5OOIUXNJ.cjs.map +1 -0
- package/dist/{chunk-7RJ6P7MI.js → chunk-6S6362D2.js} +2 -2
- package/dist/chunk-A3BVTI3G.js +150 -0
- package/dist/chunk-A3BVTI3G.js.map +1 -0
- package/dist/{chunk-24ATT2PE.cjs → chunk-AEAAN4AD.cjs} +120 -120
- package/dist/{chunk-24ATT2PE.cjs.map → chunk-AEAAN4AD.cjs.map} +1 -1
- package/dist/chunk-ECCXGELC.cjs +727 -0
- package/dist/chunk-ECCXGELC.cjs.map +1 -0
- package/dist/{chunk-SVYE5HIM.js → chunk-EQQMGO42.js} +2 -2
- package/dist/{chunk-FHPVDTI2.cjs → chunk-F2Y4E4GU.cjs} +22 -22
- package/dist/{chunk-FHPVDTI2.cjs.map → chunk-F2Y4E4GU.cjs.map} +1 -1
- package/dist/{chunk-OXSV64JX.js → chunk-G6IKY6PL.js} +4 -4
- package/dist/{chunk-UYQUPUR6.js → chunk-HUO3TI4C.js} +3 -3
- package/dist/chunk-I52DRGGJ.js +727 -0
- package/dist/chunk-I52DRGGJ.js.map +1 -0
- package/dist/{chunk-DDSO4HS7.cjs → chunk-KEENUAFN.cjs} +2 -2
- package/dist/{chunk-DDSO4HS7.cjs.map → chunk-KEENUAFN.cjs.map} +1 -1
- package/dist/{chunk-2HC4DRF4.js → chunk-LLFHCSU2.js} +2 -2
- package/dist/{chunk-J5BA3BQ6.cjs → chunk-O7LUD7MH.cjs} +323 -3
- package/dist/chunk-O7LUD7MH.cjs.map +1 -0
- package/dist/{chunk-ILYFOJUN.js → chunk-OIBIRXRG.js} +3 -3
- package/dist/{chunk-FWEO3HSL.js → chunk-PQQF5KOW.js} +8 -8
- package/dist/{chunk-T6TV6HY6.cjs → chunk-PRSRYHQD.cjs} +36 -36
- package/dist/{chunk-T6TV6HY6.cjs.map → chunk-PRSRYHQD.cjs.map} +1 -1
- package/dist/chunk-Q6OUXEK3.cjs +150 -0
- package/dist/chunk-Q6OUXEK3.cjs.map +1 -0
- package/dist/{chunk-6GFRKLLS.cjs → chunk-QBWEH3IM.cjs} +429 -112
- package/dist/chunk-QBWEH3IM.cjs.map +1 -0
- package/dist/{chunk-ESIWZMMK.js → chunk-SYT2TLQF.js} +35 -37
- package/dist/{chunk-ESIWZMMK.js.map → chunk-SYT2TLQF.js.map} +1 -1
- package/dist/{chunk-YT3JL7YM.cjs → chunk-TLCTTQFF.cjs} +53 -53
- package/dist/{chunk-YT3JL7YM.cjs.map → chunk-TLCTTQFF.cjs.map} +1 -1
- package/dist/{chunk-P3RQ5UJE.cjs → chunk-UTQKC66X.cjs} +4 -4
- package/dist/{chunk-P3RQ5UJE.cjs.map → chunk-UTQKC66X.cjs.map} +1 -1
- package/dist/{chunk-J3B45HTA.cjs → chunk-XB25WOC2.cjs} +6 -6
- package/dist/{chunk-J3B45HTA.cjs.map → chunk-XB25WOC2.cjs.map} +1 -1
- package/dist/{chunk-YAFS2QFZ.cjs → chunk-XN2NBLV5.cjs} +313 -315
- package/dist/chunk-XN2NBLV5.cjs.map +1 -0
- package/dist/effects/index.d.cts +7 -4
- package/dist/effects/index.d.ts +7 -4
- package/dist/{export-DMeG6E06.d.ts → export-41rL6Cne.d.ts} +1 -1
- package/dist/{export-AZSwX087.d.cts → export-CyJdfP_Z.d.cts} +5 -4
- package/dist/{export-KzubBKo7.d.cts → export-D9mXp05Q.d.cts} +1 -1
- package/dist/{export-BDkyDNM8.d.ts → export-DwnZ_hvQ.d.ts} +5 -4
- package/dist/extensions/index.cjs +3 -3
- package/dist/extensions/index.cjs.map +1 -1
- package/dist/extensions/index.js +2 -2
- package/dist/generation/index.cjs +150 -945
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.d.cts +3 -423
- package/dist/generation/index.d.ts +3 -423
- package/dist/generation/index.js +59 -854
- package/dist/generation/index.js.map +1 -1
- package/dist/grammar/index.cjs +3 -3
- package/dist/grammar/index.cjs.map +1 -1
- package/dist/grammar/index.js +2 -2
- package/dist/{helpers-Coa4e2j_.d.ts → helpers-C-RgeyvH.d.ts} +25 -8
- package/dist/{helpers-DHl28yLO.d.cts → helpers-v6GMazzg.d.cts} +25 -8
- package/dist/image-editor/index.cjs +986 -986
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +15 -11
- package/dist/image-editor/index.d.ts +15 -11
- package/dist/image-editor/index.js +94 -94
- package/dist/index.cjs +28 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +36 -36
- package/dist/{opentype-BWR7Qv8W.d.cts → opentype-KR_jj6b_.d.cts} +1 -1
- package/dist/{opentype-Dfcx6wFx.d.ts → opentype-a1KAW-qs.d.ts} +1 -1
- package/dist/paint/index.cjs +5 -8
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +4 -2
- package/dist/paint/index.d.ts +4 -2
- package/dist/paint/index.js +15 -18
- package/dist/paint-editor/index.cjs +405 -403
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +15 -748
- package/dist/paint-editor/index.d.ts +15 -748
- package/dist/paint-editor/index.js +79 -77
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{pathfinder-D8KQ6blQ.d.cts → pathfinder-BHS4vQNm.d.cts} +1 -1
- package/dist/{pathfinder-Celbi3e6.d.ts → pathfinder-BVvTIBMo.d.ts} +1 -1
- package/dist/{pool-8JZGWHvR.d.ts → pool-CZQOrSXZ.d.ts} +1 -1
- package/dist/{pool-BfuxBKTd.d.cts → pool-FjZZmZ80.d.cts} +1 -1
- package/dist/provenance-DmlcgdzT.d.cts +426 -0
- package/dist/provenance-uh5r2TQ8.d.ts +426 -0
- package/dist/rand-8xbUb6ur.d.ts +1118 -0
- package/dist/rand-Cw9VLrVC.d.cts +1118 -0
- package/dist/raster/index.cjs +17 -19
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.js +9 -11
- package/dist/raster/index.js.map +1 -1
- package/dist/{svg-CxxqG3_W.d.ts → svg-CSz3mzkw.d.ts} +2 -2
- package/dist/{svg-pwXWq6s2.d.cts → svg-DTb40ICU.d.cts} +2 -2
- package/dist/{tools-y1M6O3UT.d.ts → tools-B0wXP5cF.d.ts} +1 -1
- package/dist/{tools-3EBjR91b.d.cts → tools-Ca0kI1qo.d.cts} +1 -1
- package/dist/vector/index.cjs +2698 -1674
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +390 -72
- package/dist/vector/index.d.ts +390 -72
- package/dist/vector/index.js +1665 -641
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.d.cts +7 -4
- package/dist/video-editor/index.d.ts +7 -4
- package/dist/{warp-Ceqdz7kj.d.cts → warp-DTOp0lON.d.cts} +1 -1
- package/dist/{warp-C1gwu2G_.d.ts → warp-pd7hrH4T.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-vector/SKILL.md +22 -0
- package/dist/brushstrokeRender-JNHVEUFG.cjs.map +0 -1
- package/dist/chunk-64PYNEHJ.js +0 -340
- package/dist/chunk-64PYNEHJ.js.map +0 -1
- package/dist/chunk-6GFRKLLS.cjs.map +0 -1
- package/dist/chunk-7QN76ESJ.js +0 -323
- package/dist/chunk-7QN76ESJ.js.map +0 -1
- package/dist/chunk-BR7EKQUP.js.map +0 -1
- package/dist/chunk-DCLJNVZS.cjs +0 -323
- package/dist/chunk-DCLJNVZS.cjs.map +0 -1
- package/dist/chunk-EM3FMJWE.js.map +0 -1
- package/dist/chunk-HHTCDFZC.js.map +0 -1
- package/dist/chunk-J5BA3BQ6.cjs.map +0 -1
- package/dist/chunk-YAFS2QFZ.cjs.map +0 -1
- package/dist/chunk-Z2H7KECK.cjs.map +0 -1
- package/dist/chunk-Z6OUCS2K.cjs +0 -340
- package/dist/chunk-Z6OUCS2K.cjs.map +0 -1
- package/dist/rand-BszBST4s.d.ts +0 -2140
- package/dist/rand-DOH_aMvm.d.cts +0 -2140
- /package/dist/{chunk-62XUO5LB.js.map → chunk-3X6IAJUQ.js.map} +0 -0
- /package/dist/{chunk-7RJ6P7MI.js.map → chunk-6S6362D2.js.map} +0 -0
- /package/dist/{chunk-SVYE5HIM.js.map → chunk-EQQMGO42.js.map} +0 -0
- /package/dist/{chunk-OXSV64JX.js.map → chunk-G6IKY6PL.js.map} +0 -0
- /package/dist/{chunk-UYQUPUR6.js.map → chunk-HUO3TI4C.js.map} +0 -0
- /package/dist/{chunk-2HC4DRF4.js.map → chunk-LLFHCSU2.js.map} +0 -0
- /package/dist/{chunk-ILYFOJUN.js.map → chunk-OIBIRXRG.js.map} +0 -0
- /package/dist/{chunk-FWEO3HSL.js.map → chunk-PQQF5KOW.js.map} +0 -0
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkQBWEH3IMcjs = require('./chunk-QBWEH3IM.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkO7LUD7MHcjs = require('./chunk-O7LUD7MH.cjs');
|
|
16
16
|
|
|
17
17
|
// src/paint/heal.ts
|
|
18
18
|
var TOL = 2e-3;
|
|
@@ -650,9 +650,9 @@ var TilePixelSource = (_class2 = class {
|
|
|
650
650
|
sample(x, y, out) {
|
|
651
651
|
const lx = x - this.offset.x;
|
|
652
652
|
const ly = y - this.offset.y;
|
|
653
|
-
const tx = Math.floor(lx /
|
|
654
|
-
const ty = Math.floor(ly /
|
|
655
|
-
const key =
|
|
653
|
+
const tx = Math.floor(lx / _chunkO7LUD7MHcjs.TILE);
|
|
654
|
+
const ty = Math.floor(ly / _chunkO7LUD7MHcjs.TILE);
|
|
655
|
+
const key = _chunkO7LUD7MHcjs.tileKey.call(void 0, tx, ty);
|
|
656
656
|
if (key !== this.lastKey) {
|
|
657
657
|
let t2 = this.cache.get(key);
|
|
658
658
|
if (t2 === void 0) {
|
|
@@ -667,7 +667,7 @@ var TilePixelSource = (_class2 = class {
|
|
|
667
667
|
out[0] = out[1] = out[2] = out[3] = 0;
|
|
668
668
|
return false;
|
|
669
669
|
}
|
|
670
|
-
const p = (ly - ty *
|
|
670
|
+
const p = (ly - ty * _chunkO7LUD7MHcjs.TILE) * _chunkO7LUD7MHcjs.TILE + (lx - tx * _chunkO7LUD7MHcjs.TILE);
|
|
671
671
|
if (this.channels === 1) {
|
|
672
672
|
out[0] = out[1] = out[2] = t[p];
|
|
673
673
|
out[3] = 255;
|
|
@@ -721,21 +721,21 @@ function readSourceRegion(source, rect, dx = 0, dy = 0) {
|
|
|
721
721
|
}
|
|
722
722
|
function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, options = {}) {
|
|
723
723
|
const out = (_nullishCoalesce(options.into, () => ( tileData))).slice();
|
|
724
|
-
const ox = tx *
|
|
725
|
-
const oy = ty *
|
|
724
|
+
const ox = tx * _chunkO7LUD7MHcjs.TILE + s.offset.x;
|
|
725
|
+
const oy = ty * _chunkO7LUD7MHcjs.TILE + s.offset.y;
|
|
726
726
|
let x0 = 0;
|
|
727
727
|
let y0 = 0;
|
|
728
|
-
let x1 =
|
|
729
|
-
let y1 =
|
|
728
|
+
let x1 = _chunkO7LUD7MHcjs.TILE;
|
|
729
|
+
let y1 = _chunkO7LUD7MHcjs.TILE;
|
|
730
730
|
if (options.region) {
|
|
731
731
|
const r = options.region;
|
|
732
732
|
x0 = Math.max(0, Math.floor(r.x) - ox);
|
|
733
733
|
y0 = Math.max(0, Math.floor(r.y) - oy);
|
|
734
|
-
x1 = Math.min(
|
|
735
|
-
y1 = Math.min(
|
|
734
|
+
x1 = Math.min(_chunkO7LUD7MHcjs.TILE, Math.ceil(r.x + r.width) - ox);
|
|
735
|
+
y1 = Math.min(_chunkO7LUD7MHcjs.TILE, Math.ceil(r.y + r.height) - oy);
|
|
736
736
|
if (x1 <= x0 || y1 <= y0) return out;
|
|
737
737
|
if (options.into) {
|
|
738
|
-
for (let y = y0; y < y1; y++) out.set(tileData.subarray((y *
|
|
738
|
+
for (let y = y0; y < y1; y++) out.set(tileData.subarray((y * _chunkO7LUD7MHcjs.TILE + x0) * channels, (y * _chunkO7LUD7MHcjs.TILE + x1) * channels), (y * _chunkO7LUD7MHcjs.TILE + x0) * channels);
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
741
|
const sel = s.selection;
|
|
@@ -748,17 +748,17 @@ function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, opti
|
|
|
748
748
|
let covTile;
|
|
749
749
|
for (let y = y0; y < y1; y++) {
|
|
750
750
|
const dy = oy + y;
|
|
751
|
-
const cty = Math.floor(dy /
|
|
751
|
+
const cty = Math.floor(dy / _chunkO7LUD7MHcjs.TILE);
|
|
752
752
|
for (let x = x0; x < x1; x++) {
|
|
753
753
|
const dx = ox + x;
|
|
754
|
-
const ctx = Math.floor(dx /
|
|
755
|
-
const key =
|
|
754
|
+
const ctx = Math.floor(dx / _chunkO7LUD7MHcjs.TILE);
|
|
755
|
+
const key = _chunkO7LUD7MHcjs.tileKey.call(void 0, ctx, cty);
|
|
756
756
|
if (key !== covKey) {
|
|
757
757
|
covKey = key;
|
|
758
758
|
covTile = coverage.tiles.get(key);
|
|
759
759
|
}
|
|
760
760
|
if (!covTile) continue;
|
|
761
|
-
const c = covTile[(dy - cty *
|
|
761
|
+
const c = covTile[(dy - cty * _chunkO7LUD7MHcjs.TILE) * _chunkO7LUD7MHcjs.TILE + (dx - ctx * _chunkO7LUD7MHcjs.TILE)];
|
|
762
762
|
if (c <= 0) continue;
|
|
763
763
|
let k = c * s.opacity;
|
|
764
764
|
if (sel) {
|
|
@@ -767,7 +767,7 @@ function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, opti
|
|
|
767
767
|
}
|
|
768
768
|
if (k > 1) k = 1;
|
|
769
769
|
if (k <= 0) continue;
|
|
770
|
-
const p = y *
|
|
770
|
+
const p = y * _chunkO7LUD7MHcjs.TILE + x;
|
|
771
771
|
if (channels === 1) {
|
|
772
772
|
const g = out[p];
|
|
773
773
|
let t;
|
|
@@ -795,9 +795,9 @@ function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, opti
|
|
|
795
795
|
const g0 = rgb[1];
|
|
796
796
|
const b0 = rgb[2];
|
|
797
797
|
paint.tone(rgb);
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
798
|
+
_chunkQBWEH3IMcjs.put255.call(void 0, out, i, r0 + (rgb[0] - r0) * k);
|
|
799
|
+
_chunkQBWEH3IMcjs.put255.call(void 0, out, i + 1, g0 + (rgb[1] - g0) * k);
|
|
800
|
+
_chunkQBWEH3IMcjs.put255.call(void 0, out, i + 2, b0 + (rgb[2] - b0) * k);
|
|
801
801
|
continue;
|
|
802
802
|
}
|
|
803
803
|
if (s.lockTransparency && a === 0) continue;
|
|
@@ -811,11 +811,11 @@ function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, opti
|
|
|
811
811
|
cb[ch] = out[i + ch] / 255;
|
|
812
812
|
cs[ch] = src[ch] / 255;
|
|
813
813
|
}
|
|
814
|
-
const o =
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
if (!s.lockTransparency)
|
|
814
|
+
const o = _chunkO7LUD7MHcjs.blendPixel.call(void 0, blend, cb, cs, k);
|
|
815
|
+
_chunkQBWEH3IMcjs.put255.call(void 0, out, i, o[0]);
|
|
816
|
+
_chunkQBWEH3IMcjs.put255.call(void 0, out, i + 1, o[1]);
|
|
817
|
+
_chunkQBWEH3IMcjs.put255.call(void 0, out, i + 2, o[2]);
|
|
818
|
+
if (!s.lockTransparency) _chunkQBWEH3IMcjs.put255.call(void 0, out, i + 3, o[3]);
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
821
|
return out;
|
|
@@ -823,20 +823,20 @@ function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, opti
|
|
|
823
823
|
function applyToneToDeepTile(coverage, samples, tx, ty, tone, s, options = {}) {
|
|
824
824
|
const linear = samples instanceof Float32Array;
|
|
825
825
|
const out = (_nullishCoalesce(options.into, () => ( samples))).slice();
|
|
826
|
-
const ox = tx *
|
|
827
|
-
const oy = ty *
|
|
826
|
+
const ox = tx * _chunkO7LUD7MHcjs.TILE + s.offset.x;
|
|
827
|
+
const oy = ty * _chunkO7LUD7MHcjs.TILE + s.offset.y;
|
|
828
828
|
let x0 = 0;
|
|
829
829
|
let y0 = 0;
|
|
830
|
-
let x1 =
|
|
831
|
-
let y1 =
|
|
830
|
+
let x1 = _chunkO7LUD7MHcjs.TILE;
|
|
831
|
+
let y1 = _chunkO7LUD7MHcjs.TILE;
|
|
832
832
|
if (options.region) {
|
|
833
833
|
const r = options.region;
|
|
834
834
|
x0 = Math.max(0, Math.floor(r.x) - ox);
|
|
835
835
|
y0 = Math.max(0, Math.floor(r.y) - oy);
|
|
836
|
-
x1 = Math.min(
|
|
837
|
-
y1 = Math.min(
|
|
836
|
+
x1 = Math.min(_chunkO7LUD7MHcjs.TILE, Math.ceil(r.x + r.width) - ox);
|
|
837
|
+
y1 = Math.min(_chunkO7LUD7MHcjs.TILE, Math.ceil(r.y + r.height) - oy);
|
|
838
838
|
if (x1 <= x0 || y1 <= y0) return out;
|
|
839
|
-
if (options.into) for (let y = y0; y < y1; y++) out.set(samples.subarray((y *
|
|
839
|
+
if (options.into) for (let y = y0; y < y1; y++) out.set(samples.subarray((y * _chunkO7LUD7MHcjs.TILE + x0) * 4, (y * _chunkO7LUD7MHcjs.TILE + x1) * 4), (y * _chunkO7LUD7MHcjs.TILE + x0) * 4);
|
|
840
840
|
}
|
|
841
841
|
const sel = s.selection;
|
|
842
842
|
const rgb = [0, 0, 0];
|
|
@@ -846,17 +846,17 @@ function applyToneToDeepTile(coverage, samples, tx, ty, tone, s, options = {}) {
|
|
|
846
846
|
let covTile;
|
|
847
847
|
for (let y = y0; y < y1; y++) {
|
|
848
848
|
const dy = oy + y;
|
|
849
|
-
const cty = Math.floor(dy /
|
|
849
|
+
const cty = Math.floor(dy / _chunkO7LUD7MHcjs.TILE);
|
|
850
850
|
for (let x = x0; x < x1; x++) {
|
|
851
851
|
const dx = ox + x;
|
|
852
|
-
const ctx = Math.floor(dx /
|
|
853
|
-
const key =
|
|
852
|
+
const ctx = Math.floor(dx / _chunkO7LUD7MHcjs.TILE);
|
|
853
|
+
const key = _chunkO7LUD7MHcjs.tileKey.call(void 0, ctx, cty);
|
|
854
854
|
if (key !== covKey) {
|
|
855
855
|
covKey = key;
|
|
856
856
|
covTile = coverage.tiles.get(key);
|
|
857
857
|
}
|
|
858
858
|
if (!covTile) continue;
|
|
859
|
-
const c = covTile[(dy - cty *
|
|
859
|
+
const c = covTile[(dy - cty * _chunkO7LUD7MHcjs.TILE) * _chunkO7LUD7MHcjs.TILE + (dx - ctx * _chunkO7LUD7MHcjs.TILE)];
|
|
860
860
|
if (c <= 0) continue;
|
|
861
861
|
let k = c * s.opacity;
|
|
862
862
|
if (sel) {
|
|
@@ -865,20 +865,20 @@ function applyToneToDeepTile(coverage, samples, tx, ty, tone, s, options = {}) {
|
|
|
865
865
|
}
|
|
866
866
|
if (k > 1) k = 1;
|
|
867
867
|
if (k <= 0) continue;
|
|
868
|
-
const i = (y *
|
|
868
|
+
const i = (y * _chunkO7LUD7MHcjs.TILE + x) * 4;
|
|
869
869
|
if (out[i + 3] === 0) continue;
|
|
870
870
|
for (let ch = 0; ch < 3; ch++) {
|
|
871
871
|
const v = out[i + ch];
|
|
872
872
|
if (linear) {
|
|
873
873
|
excess[ch] = v > 1 ? v - 1 : 0;
|
|
874
|
-
rgb[ch] =
|
|
874
|
+
rgb[ch] = _chunkO7LUD7MHcjs.srgbEncode.call(void 0, v > 1 ? 1 : v < 0 ? 0 : v);
|
|
875
875
|
} else rgb[ch] = v / 65535;
|
|
876
876
|
before[ch] = rgb[ch];
|
|
877
877
|
}
|
|
878
878
|
tone(rgb);
|
|
879
879
|
for (let ch = 0; ch < 3; ch++) {
|
|
880
880
|
const e = before[ch] + (rgb[ch] - before[ch]) * k;
|
|
881
|
-
if (linear) out[i + ch] =
|
|
881
|
+
if (linear) out[i + ch] = _chunkO7LUD7MHcjs.srgbDecode.call(void 0, e) + excess[ch];
|
|
882
882
|
else out[i + ch] = e <= 0 ? 0 : e >= 1 ? 65535 : Math.round(e * 65535);
|
|
883
883
|
}
|
|
884
884
|
}
|
|
@@ -963,8 +963,8 @@ var RetouchDabStroke = (_class3 = class {
|
|
|
963
963
|
constructor(brush, target, effect) {;_class3.prototype.__init5.call(this);_class3.prototype.__init6.call(this);_class3.prototype.__init7.call(this);_class3.prototype.__init8.call(this);
|
|
964
964
|
this.brush = brush;
|
|
965
965
|
this.effect = effect;
|
|
966
|
-
this.walker = new (0,
|
|
967
|
-
this.medium = new (0,
|
|
966
|
+
this.walker = new (0, _chunkQBWEH3IMcjs.DabWalker)(brush);
|
|
967
|
+
this.medium = new (0, _chunkQBWEH3IMcjs.TileMedium)(target);
|
|
968
968
|
}
|
|
969
969
|
|
|
970
970
|
|
|
@@ -995,11 +995,11 @@ var RetouchDabStroke = (_class3 = class {
|
|
|
995
995
|
paint(dabs) {
|
|
996
996
|
const rects = [];
|
|
997
997
|
for (const d of dabs) {
|
|
998
|
-
const rect =
|
|
998
|
+
const rect = _chunkQBWEH3IMcjs.dabRect.call(void 0, d, this.brush.hardness);
|
|
999
999
|
const n = rect.width * rect.height;
|
|
1000
1000
|
if (this.buf.length < n) this.buf = new Float32Array(n);
|
|
1001
1001
|
const cov = this.buf.subarray(0, n);
|
|
1002
|
-
|
|
1002
|
+
_chunkQBWEH3IMcjs.rasterizeDab.call(void 0, { ...d, alpha: 1 }, this.brush.hardness, rect, cov);
|
|
1003
1003
|
this.medium.reset();
|
|
1004
1004
|
this.effect(this.medium, d, rect, cov);
|
|
1005
1005
|
rects.push(rect);
|
|
@@ -1011,7 +1011,7 @@ var RetouchDabStroke = (_class3 = class {
|
|
|
1011
1011
|
}, _class3);
|
|
1012
1012
|
function smudgeEffect(brush, strength, mixing = "rgb") {
|
|
1013
1013
|
const s = Math.min(1, Math.max(0, strength));
|
|
1014
|
-
const tip = new (0,
|
|
1014
|
+
const tip = new (0, _chunkQBWEH3IMcjs.SmudgeTip)({ strength: s, length: s, mixing }, brush.size);
|
|
1015
1015
|
return (medium, d, rect, cov) => tip.dab(medium, { x: d.x, y: d.y, radius: d.radius, opacity: d.opacity * d.alpha }, rect, cov);
|
|
1016
1016
|
}
|
|
1017
1017
|
function spongeEffect(brush, saturate, vibrance) {
|
|
@@ -1034,9 +1034,9 @@ function spongeEffect(brush, saturate, vibrance) {
|
|
|
1034
1034
|
rgb[1] = px[i + 1] / 255;
|
|
1035
1035
|
rgb[2] = px[i + 2] / 255;
|
|
1036
1036
|
sponge(rgb, k, saturate, vibrance);
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1037
|
+
_chunkQBWEH3IMcjs.put255.call(void 0, px, i, rgb[0]);
|
|
1038
|
+
_chunkQBWEH3IMcjs.put255.call(void 0, px, i + 1, rgb[1]);
|
|
1039
|
+
_chunkQBWEH3IMcjs.put255.call(void 0, px, i + 2, rgb[2]);
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
1042
|
};
|
|
@@ -1057,19 +1057,19 @@ function rgbaViewOfGrey(target) {
|
|
|
1057
1057
|
lockTransparency: true,
|
|
1058
1058
|
selection: target.selection,
|
|
1059
1059
|
readTile: (tx, ty) => {
|
|
1060
|
-
const key =
|
|
1060
|
+
const key = _chunkO7LUD7MHcjs.tileKey.call(void 0, tx, ty);
|
|
1061
1061
|
let v = views.get(key);
|
|
1062
1062
|
if (!v) {
|
|
1063
|
-
v = expand(_nullishCoalesce(target.readTile(tx, ty), () => ( new Uint8ClampedArray(
|
|
1063
|
+
v = expand(_nullishCoalesce(target.readTile(tx, ty), () => ( new Uint8ClampedArray(_chunkO7LUD7MHcjs.TILE * _chunkO7LUD7MHcjs.TILE))));
|
|
1064
1064
|
views.set(key, v);
|
|
1065
1065
|
}
|
|
1066
1066
|
return v;
|
|
1067
1067
|
},
|
|
1068
1068
|
writeTile: (tx, ty) => {
|
|
1069
|
-
const key =
|
|
1069
|
+
const key = _chunkO7LUD7MHcjs.tileKey.call(void 0, tx, ty);
|
|
1070
1070
|
let v = views.get(key);
|
|
1071
1071
|
if (!v) {
|
|
1072
|
-
v = expand(_nullishCoalesce(target.readTile(tx, ty), () => ( new Uint8ClampedArray(
|
|
1072
|
+
v = expand(_nullishCoalesce(target.readTile(tx, ty), () => ( new Uint8ClampedArray(_chunkO7LUD7MHcjs.TILE * _chunkO7LUD7MHcjs.TILE))));
|
|
1073
1073
|
views.set(key, v);
|
|
1074
1074
|
}
|
|
1075
1075
|
dirty.set(key, { tx, ty, data: v });
|
|
@@ -1133,4 +1133,4 @@ function unionRect(a, b) {
|
|
|
1133
1133
|
|
|
1134
1134
|
|
|
1135
1135
|
exports.solveMembrane = solveMembrane; exports.seamlessClone = seamlessClone; exports.membraneFill = membraneFill; exports.dilateMask = dilateMask; exports.maskBounds = maskBounds; exports.bestOffset = bestOffset; exports.contentAwareFill = contentAwareFill; exports.TONE_RANGES = TONE_RANGES; exports.luma = luma; exports.dodgeBurnCurve = dodgeBurnCurve; exports.dodgeBurn = dodgeBurn; exports.saturationOf = saturationOf; exports.sponge = sponge; exports.perDabStrength = perDabStrength; exports.RETOUCH_SAMPLES = RETOUCH_SAMPLES; exports.SPOT_HEAL_TYPES = SPOT_HEAL_TYPES; exports.DEFAULT_RETOUCH = DEFAULT_RETOUCH; exports.normalizeRetouch = normalizeRetouch; exports.boxBlurPixels = boxBlurPixels; exports.retouchFilter = retouchFilter; exports.IDENTITY_CLONE_TRANSFORM = IDENTITY_CLONE_TRANSFORM; exports.isIdentityCloneTransform = isIdentityCloneTransform; exports.cloneSamplePoint = cloneSamplePoint; exports.TransformedPixelSource = TransformedPixelSource; exports.TilePixelSource = TilePixelSource; exports.RegionPixelSource = RegionPixelSource; exports.readSourceRegion = readSourceRegion; exports.applyRetouchToTile = applyRetouchToTile; exports.applyToneToDeepTile = applyToneToDeepTile; exports.toneOf = toneOf; exports.healPixels = healPixels; exports.spotHealPixels = spotHealPixels; exports.spotHealWindow = spotHealWindow; exports.RetouchDabStroke = RetouchDabStroke; exports.smudgeEffect = smudgeEffect; exports.spongeEffect = spongeEffect; exports.rgbaViewOfGrey = rgbaViewOfGrey;
|
|
1136
|
-
//# sourceMappingURL=chunk-
|
|
1136
|
+
//# sourceMappingURL=chunk-TLCTTQFF.cjs.map
|