@pixerate/editor 0.118.0 → 0.120.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/THIRD_PARTY_NOTICES.md +1 -0
- package/dist/animation-editor/index.cjs +54 -54
- package/dist/animation-editor/index.d.cts +3 -3
- package/dist/animation-editor/index.d.ts +3 -3
- package/dist/animation-editor/index.js +2 -2
- package/dist/{chunk-R2JE6SA7.js → chunk-BOWUU4LJ.js} +42 -7
- package/dist/chunk-BOWUU4LJ.js.map +1 -0
- package/dist/{chunk-M7O4BJRH.cjs → chunk-DFLJHLKA.cjs} +36 -36
- package/dist/{chunk-M7O4BJRH.cjs.map → chunk-DFLJHLKA.cjs.map} +1 -1
- package/dist/{chunk-2J3LS7JZ.cjs → chunk-HTAFDTNR.cjs} +221 -186
- package/dist/chunk-HTAFDTNR.cjs.map +1 -0
- package/dist/{chunk-L2T6EJ5S.cjs → chunk-L3PXFMOF.cjs} +38 -25
- package/dist/chunk-L3PXFMOF.cjs.map +1 -0
- package/dist/{chunk-IVSNUXW7.js → chunk-T7IZDNSL.js} +37 -24
- package/dist/chunk-T7IZDNSL.js.map +1 -0
- package/dist/{chunk-BYAWOAST.cjs → chunk-TS5IEUW6.cjs} +26 -25
- package/dist/chunk-TS5IEUW6.cjs.map +1 -0
- package/dist/{chunk-VD2UDVF7.js → chunk-UMVW2Q66.js} +21 -5
- package/dist/chunk-UMVW2Q66.js.map +1 -0
- package/dist/{chunk-FODKPD44.cjs → chunk-VYW7JBTM.cjs} +790 -549
- package/dist/chunk-VYW7JBTM.cjs.map +1 -0
- package/dist/{chunk-T2P5TIZ6.js → chunk-WAI6ATHC.js} +2 -2
- package/dist/{chunk-EBSYZRSW.cjs → chunk-WMRIG4XQ.cjs} +21 -5
- package/dist/chunk-WMRIG4XQ.cjs.map +1 -0
- package/dist/{chunk-7LNZAWSJ.js → chunk-WORWH5K5.js} +699 -458
- package/dist/chunk-WORWH5K5.js.map +1 -0
- package/dist/{chunk-JHXMNOMF.js → chunk-YHW26LS2.js} +14 -13
- package/dist/chunk-YHW26LS2.js.map +1 -0
- package/dist/{export-Dul1SbPv.d.ts → export-D2D8hb_u.d.ts} +18 -4
- package/dist/{export-DMOuzgZZ.d.cts → export-fP2hZYjm.d.cts} +18 -4
- package/dist/{flow-4-OC-UkQ.d.cts → flow-A2Dj-69w.d.cts} +21 -9
- package/dist/{flow-Cb7lkPm8.d.ts → flow-C95atNoQ.d.ts} +21 -9
- package/dist/image-editor/index.cjs +1104 -979
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +5 -5
- package/dist/image-editor/index.d.ts +5 -5
- package/dist/image-editor/index.js +157 -32
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint/index.cjs +5 -3
- 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 +4 -2
- package/dist/paint-editor/index.cjs +147 -147
- 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 +2 -2
- package/dist/raster/index.js +1 -1
- package/dist/{svg-CVdFc80-.d.cts → svg-S9zzvqaZ.d.cts} +5 -1
- package/dist/{svg-DlEuhwoX.d.ts → svg-leZpRsJB.d.ts} +5 -1
- package/dist/{types-CDLGhAZp.d.ts → types-BgwxFWvn.d.ts} +59 -3
- package/dist/{types-Tfly4Aya.d.cts → types-DdRTDnza.d.cts} +59 -3
- package/dist/vector/index.cjs +1314 -1009
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +110 -5
- package/dist/vector/index.d.ts +110 -5
- package/dist/vector/index.js +319 -14
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/references/photoshop-files.md +5 -2
- package/skills/pixerate-vector/SKILL.md +13 -1
- package/skills/pixerate-vector/references/commands.md +2 -0
- package/dist/chunk-2J3LS7JZ.cjs.map +0 -1
- package/dist/chunk-7LNZAWSJ.js.map +0 -1
- package/dist/chunk-BYAWOAST.cjs.map +0 -1
- package/dist/chunk-EBSYZRSW.cjs.map +0 -1
- package/dist/chunk-FODKPD44.cjs.map +0 -1
- package/dist/chunk-IVSNUXW7.js.map +0 -1
- package/dist/chunk-JHXMNOMF.js.map +0 -1
- package/dist/chunk-L2T6EJ5S.cjs.map +0 -1
- package/dist/chunk-R2JE6SA7.js.map +0 -1
- package/dist/chunk-VD2UDVF7.js.map +0 -1
- /package/dist/{chunk-T2P5TIZ6.js.map → chunk-WAI6ATHC.js.map} +0 -0
|
@@ -418,6 +418,7 @@ function applyStrokeToTile(coverage, tileData, channels, tx, ty, s, options = {}
|
|
|
418
418
|
function applyStrokeToDeepTile(coverage, samples, tx, ty, s, options = {}) {
|
|
419
419
|
const linear = samples instanceof Float32Array;
|
|
420
420
|
const scale = linear ? 1 : 65535;
|
|
421
|
+
const n = options.channels ?? 4;
|
|
421
422
|
const out = (options.into ?? samples).slice();
|
|
422
423
|
const ox = tx * TILE + s.offset.x;
|
|
423
424
|
const oy = ty * TILE + s.offset.y;
|
|
@@ -432,8 +433,9 @@ function applyStrokeToDeepTile(coverage, samples, tx, ty, s, options = {}) {
|
|
|
432
433
|
x1 = Math.min(TILE, Math.ceil(r.x + r.width) - ox);
|
|
433
434
|
y1 = Math.min(TILE, Math.ceil(r.y + r.height) - oy);
|
|
434
435
|
if (x1 <= x0 || y1 <= y0) return out;
|
|
435
|
-
if (options.into) for (let y = y0; y < y1; y++) out.set(samples.subarray((y * TILE + x0) *
|
|
436
|
+
if (options.into) for (let y = y0; y < y1; y++) out.set(samples.subarray((y * TILE + x0) * n, (y * TILE + x1) * n), (y * TILE + x0) * n);
|
|
436
437
|
}
|
|
438
|
+
const grey = (s.mode === "erase" ? s.background[0] : s.color[0]) / 255 * scale;
|
|
437
439
|
const colour = (c) => {
|
|
438
440
|
const v = [c[0] / 255, c[1] / 255, c[2] / 255, c[3] / 255];
|
|
439
441
|
if (linear) for (let k = 0; k < 3; k++) v[k] = srgbDecode(v[k]);
|
|
@@ -461,6 +463,12 @@ function applyStrokeToDeepTile(coverage, samples, tx, ty, s, options = {}) {
|
|
|
461
463
|
}
|
|
462
464
|
if (k > 1) k = 1;
|
|
463
465
|
if (k <= 0) continue;
|
|
466
|
+
if (n === 1) {
|
|
467
|
+
const p = y * TILE + x;
|
|
468
|
+
const v = out[p] + (grey - out[p]) * k;
|
|
469
|
+
out[p] = linear ? v : Math.round(v);
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
464
472
|
const i = (y * TILE + x) * 4;
|
|
465
473
|
if (s.mode === "erase" && !s.lockTransparency) {
|
|
466
474
|
put(i + 3, out[i + 3] / scale * (1 - k));
|
|
@@ -597,6 +605,10 @@ var PaintExchange = class {
|
|
|
597
605
|
this.amount *= 1 - this.rates.drain;
|
|
598
606
|
}
|
|
599
607
|
};
|
|
608
|
+
function put255(px, i, v) {
|
|
609
|
+
if (px instanceof Float32Array) px[i] = v > 0 ? v * 255 : 0;
|
|
610
|
+
else px[i] = Math.round(v * 255);
|
|
611
|
+
}
|
|
600
612
|
var TileMedium = class {
|
|
601
613
|
constructor(target, options = {}) {
|
|
602
614
|
this.target = target;
|
|
@@ -716,10 +728,10 @@ var TileMedium = class {
|
|
|
716
728
|
src[1] = pg;
|
|
717
729
|
src[2] = pb;
|
|
718
730
|
const r = blendPixel(blend, cb, src, k);
|
|
719
|
-
px
|
|
720
|
-
px
|
|
721
|
-
px
|
|
722
|
-
if (!t.lockTransparency) px
|
|
731
|
+
put255(px, i, r[0]);
|
|
732
|
+
put255(px, i + 1, r[1]);
|
|
733
|
+
put255(px, i + 2, r[2]);
|
|
734
|
+
if (!t.lockTransparency) put255(px, i + 3, r[3]);
|
|
723
735
|
continue;
|
|
724
736
|
}
|
|
725
737
|
const a = px[i + 3] / 255;
|
|
@@ -730,10 +742,10 @@ var TileMedium = class {
|
|
|
730
742
|
o[1] = pg;
|
|
731
743
|
o[2] = pb;
|
|
732
744
|
} else if (pigment && field) {
|
|
733
|
-
mixPigment8(px[i], px[i + 1], px[i + 2], Math.round(pr * 255), Math.round(pg * 255), Math.round(pb * 255), share, o);
|
|
745
|
+
mixPigment8(Math.round(px[i]), Math.round(px[i + 1]), Math.round(px[i + 2]), Math.round(pr * 255), Math.round(pg * 255), Math.round(pb * 255), share, o);
|
|
734
746
|
} else if (pigment) {
|
|
735
|
-
const key = px[i] << 16 | px[i + 1] << 8 | px[i + 2];
|
|
736
|
-
if (key !== lastKey) {
|
|
747
|
+
const key = px instanceof Float32Array ? -2 : px[i] << 16 | px[i + 1] << 8 | px[i + 2];
|
|
748
|
+
if (key !== lastKey || key === -2) {
|
|
737
749
|
setPigmentColor(this.canvasPig, px[i] / 255, px[i + 1] / 255, px[i + 2] / 255);
|
|
738
750
|
lastKey = key;
|
|
739
751
|
}
|
|
@@ -752,10 +764,10 @@ var TileMedium = class {
|
|
|
752
764
|
o[1] = px[i + 1] / 255 + (pg - px[i + 1] / 255) * share;
|
|
753
765
|
o[2] = px[i + 2] / 255 + (pb - px[i + 2] / 255) * share;
|
|
754
766
|
}
|
|
755
|
-
px
|
|
756
|
-
px
|
|
757
|
-
px
|
|
758
|
-
px
|
|
767
|
+
put255(px, i, o[0]);
|
|
768
|
+
put255(px, i + 1, o[1]);
|
|
769
|
+
put255(px, i + 2, o[2]);
|
|
770
|
+
put255(px, i + 3, na);
|
|
759
771
|
}
|
|
760
772
|
}
|
|
761
773
|
}
|
|
@@ -904,7 +916,7 @@ function blenderDab(medium, rect, cov, opacity, radius, settings, scratch2) {
|
|
|
904
916
|
const a = px[i + 3] / 255;
|
|
905
917
|
if (a > 0) {
|
|
906
918
|
if (pigment) {
|
|
907
|
-
const p = pigment8(px[i], px[i + 1], px[i + 2]);
|
|
919
|
+
const p = pigment8(Math.round(px[i]), Math.round(px[i + 1]), Math.round(px[i + 2]));
|
|
908
920
|
const sa = p.scatter * p.strength * a;
|
|
909
921
|
for (let k = 0; k < N; k++) row[k] += sa * p.ks[k];
|
|
910
922
|
row[N] += sa;
|
|
@@ -952,7 +964,7 @@ function blenderDab(medium, rect, cov, opacity, radius, settings, scratch2) {
|
|
|
952
964
|
if (asum <= 1e-9) {
|
|
953
965
|
if (lock || a <= 0) continue;
|
|
954
966
|
const i2 = medium.locate(dx, dy, true);
|
|
955
|
-
medium.pixels
|
|
967
|
+
put255(medium.pixels, i2 + 3, na);
|
|
956
968
|
continue;
|
|
957
969
|
}
|
|
958
970
|
const share = lock ? t : na > 0 ? t * avgA / na : 1;
|
|
@@ -963,17 +975,17 @@ function blenderDab(medium, rect, cov, opacity, radius, settings, scratch2) {
|
|
|
963
975
|
for (let c = 0; c < N; c++) mixPig.ks[c] = sum(c, x1, y1, x2, y2) / sa;
|
|
964
976
|
mixPig.scatter = sa / asum;
|
|
965
977
|
if (a <= 0 || share >= 1) lerpPigmentInto(mixPig, mixPig, 0, out, 0);
|
|
966
|
-
else lerpPigmentInto(pigment8(px[i], px[i + 1], px[i + 2]), mixPig, share, out, 0);
|
|
978
|
+
else lerpPigmentInto(pigment8(Math.round(px[i]), Math.round(px[i + 1]), Math.round(px[i + 2])), mixPig, share, out, 0);
|
|
967
979
|
} else {
|
|
968
980
|
for (let c = 0; c < 3; c++) {
|
|
969
981
|
const m = sum(c, x1, y1, x2, y2) / asum;
|
|
970
982
|
out[c] = a <= 0 || share >= 1 ? m : px[i + c] / 255 + (m - px[i + c] / 255) * share;
|
|
971
983
|
}
|
|
972
984
|
}
|
|
973
|
-
px
|
|
974
|
-
px
|
|
975
|
-
px
|
|
976
|
-
if (!lock) px
|
|
985
|
+
put255(px, i, out[0]);
|
|
986
|
+
put255(px, i + 1, out[1]);
|
|
987
|
+
put255(px, i + 2, out[2]);
|
|
988
|
+
if (!lock) put255(px, i + 3, na);
|
|
977
989
|
}
|
|
978
990
|
}
|
|
979
991
|
}
|
|
@@ -1078,10 +1090,10 @@ var SmudgeTip = class {
|
|
|
1078
1090
|
}
|
|
1079
1091
|
const i = medium.locate(dx, dy, true);
|
|
1080
1092
|
const out = medium.pixels;
|
|
1081
|
-
out
|
|
1082
|
-
out
|
|
1083
|
-
out
|
|
1084
|
-
out
|
|
1093
|
+
put255(out, i, r);
|
|
1094
|
+
put255(out, i + 1, g);
|
|
1095
|
+
put255(out, i + 2, b);
|
|
1096
|
+
put255(out, i + 3, na);
|
|
1085
1097
|
}
|
|
1086
1098
|
const pick = (1 - length) * Math.min(1, cv * d.opacity);
|
|
1087
1099
|
if (pick > 0) {
|
|
@@ -3241,6 +3253,7 @@ export {
|
|
|
3241
3253
|
MIXER_DRAIN,
|
|
3242
3254
|
exchangeRates,
|
|
3243
3255
|
PaintExchange,
|
|
3256
|
+
put255,
|
|
3244
3257
|
TileMedium,
|
|
3245
3258
|
DEFAULT_MIXER,
|
|
3246
3259
|
normalizeMixer,
|
|
@@ -3336,4 +3349,4 @@ export {
|
|
|
3336
3349
|
flowField,
|
|
3337
3350
|
WetMedium
|
|
3338
3351
|
};
|
|
3339
|
-
//# sourceMappingURL=chunk-
|
|
3352
|
+
//# sourceMappingURL=chunk-T7IZDNSL.js.map
|