@pixerate/editor 0.105.0 → 0.107.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-DS7KDKPX.js → chunk-3PHA3UKI.js} +2 -2
- package/dist/{chunk-ZID226ZG.cjs → chunk-FRD3FUXI.cjs} +172 -172
- package/dist/{chunk-ZID226ZG.cjs.map → chunk-FRD3FUXI.cjs.map} +1 -1
- package/dist/{chunk-67FRIOPZ.js → chunk-G4BIYE6R.js} +2 -2
- package/dist/{chunk-PV42JITT.cjs → chunk-HUFQD4CB.cjs} +44 -44
- package/dist/{chunk-PV42JITT.cjs.map → chunk-HUFQD4CB.cjs.map} +1 -1
- package/dist/{chunk-4X5MIVCE.js → chunk-SOROZ2BF.js} +3 -3
- package/dist/{chunk-CRMAXIUV.cjs → chunk-SZ6KMZNM.cjs} +157 -8
- package/dist/chunk-SZ6KMZNM.cjs.map +1 -0
- package/dist/{chunk-WSTEXEKD.cjs → chunk-T3QZ6S47.cjs} +92 -92
- package/dist/{chunk-WSTEXEKD.cjs.map → chunk-T3QZ6S47.cjs.map} +1 -1
- package/dist/{chunk-HEW6KDNI.js → chunk-WMBIJCHA.js} +155 -6
- package/dist/chunk-WMBIJCHA.js.map +1 -0
- package/dist/{compositor-Bc3PNP3C.d.cts → compositor-D92URMlm.d.cts} +1 -1
- package/dist/{compositor-BsYYllvR.d.ts → compositor-Kt_M4ruo.d.ts} +1 -1
- package/dist/{export-_m3Es4ru.d.cts → export-JGWQEPJn.d.cts} +3 -3
- package/dist/{export-iMrop3Jm.d.ts → export-a9bnF7Cl.d.ts} +3 -3
- package/dist/image-editor/index.cjs +831 -632
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +42 -9
- package/dist/image-editor/index.d.ts +42 -9
- package/dist/image-editor/index.js +203 -4
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{mixer-C1M1Nua_.d.cts → mixer-5ziHU8OS.d.cts} +1 -1
- package/dist/{mixer-Cu5a9Bzd.d.ts → mixer-DNqiYXYQ.d.ts} +1 -1
- package/dist/paint/index.cjs +3 -3
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint/index.js +2 -2
- package/dist/paint-editor/index.cjs +175 -127
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +18 -7
- package/dist/paint-editor/index.d.ts +18 -7
- package/dist/paint-editor/index.js +59 -11
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/raster/index.cjs +11 -3
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.d.cts +4 -4
- package/dist/raster/index.d.ts +4 -4
- package/dist/raster/index.js +10 -2
- package/dist/{surface-BBJN9wxg.d.ts → surface-CkKOHGPm.d.cts} +20 -2
- package/dist/{surface-BBJN9wxg.d.cts → surface-CkKOHGPm.d.ts} +20 -2
- package/package.json +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +21 -1
- package/dist/chunk-CRMAXIUV.cjs.map +0 -1
- package/dist/chunk-HEW6KDNI.js.map +0 -1
- /package/dist/{chunk-DS7KDKPX.js.map → chunk-3PHA3UKI.js.map} +0 -0
- /package/dist/{chunk-67FRIOPZ.js.map → chunk-G4BIYE6R.js.map} +0 -0
- /package/dist/{chunk-4X5MIVCE.js.map → chunk-SOROZ2BF.js.map} +0 -0
|
@@ -279,7 +279,7 @@ require('../chunk-6BU5WU4R.cjs');
|
|
|
279
279
|
|
|
280
280
|
|
|
281
281
|
|
|
282
|
-
var
|
|
282
|
+
var _chunkFRD3FUXIcjs = require('../chunk-FRD3FUXI.cjs');
|
|
283
283
|
|
|
284
284
|
|
|
285
285
|
|
|
@@ -343,7 +343,7 @@ var _chunkZID226ZGcjs = require('../chunk-ZID226ZG.cjs');
|
|
|
343
343
|
|
|
344
344
|
|
|
345
345
|
|
|
346
|
-
var
|
|
346
|
+
var _chunkT3QZ6S47cjs = require('../chunk-T3QZ6S47.cjs');
|
|
347
347
|
|
|
348
348
|
|
|
349
349
|
|
|
@@ -380,7 +380,7 @@ var _chunkMUUXNRU4cjs = require('../chunk-MUUXNRU4.cjs');
|
|
|
380
380
|
|
|
381
381
|
|
|
382
382
|
|
|
383
|
-
var
|
|
383
|
+
var _chunkHUFQD4CBcjs = require('../chunk-HUFQD4CB.cjs');
|
|
384
384
|
|
|
385
385
|
|
|
386
386
|
|
|
@@ -429,7 +429,11 @@ var _chunkPV42JITTcjs = require('../chunk-PV42JITT.cjs');
|
|
|
429
429
|
|
|
430
430
|
|
|
431
431
|
|
|
432
|
-
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
var _chunkSZ6KMZNMcjs = require('../chunk-SZ6KMZNM.cjs');
|
|
433
437
|
|
|
434
438
|
|
|
435
439
|
|
|
@@ -557,10 +561,10 @@ var DEVELOP_FILTER_ID = "develop";
|
|
|
557
561
|
var BLUR_FILTER_ID = "blur";
|
|
558
562
|
var legacyMaskMemo = /* @__PURE__ */ new WeakMap();
|
|
559
563
|
function rasterMaskFromLegacy(mask, width, height) {
|
|
560
|
-
const sel =
|
|
564
|
+
const sel = _chunkFRD3FUXIcjs.decodeLayerMask.call(void 0, mask);
|
|
561
565
|
if (!sel) return null;
|
|
562
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
563
|
-
const surface =
|
|
566
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkFRD3FUXIcjs.resizeSelection.call(void 0, sel, width, height);
|
|
567
|
+
const surface = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0);
|
|
564
568
|
legacyMaskMemo.set(surface, { width: mask.width, height: mask.height, rle: mask.rle });
|
|
565
569
|
const out = { surface, defaultValue: 0 };
|
|
566
570
|
if (mask.density !== void 0 && mask.density !== 1) out.density = mask.density;
|
|
@@ -579,18 +583,18 @@ function hasResampledLegacyMask(layers, width, height) {
|
|
|
579
583
|
function legacyMaskOf(mask, width, height) {
|
|
580
584
|
let memo = legacyMaskMemo.get(mask.surface);
|
|
581
585
|
if (!memo) {
|
|
582
|
-
const data =
|
|
583
|
-
memo = { width, height, rle:
|
|
586
|
+
const data = _chunkSZ6KMZNMcjs.readRegion.call(void 0, mask.surface, { x: 0, y: 0, width, height });
|
|
587
|
+
memo = { width, height, rle: _chunkFRD3FUXIcjs.encodeSelectionRle.call(void 0, new Uint8Array(data.buffer, data.byteOffset, data.length)) };
|
|
584
588
|
legacyMaskMemo.set(mask.surface, memo);
|
|
585
589
|
}
|
|
586
|
-
return
|
|
590
|
+
return _chunkFRD3FUXIcjs.normalizeLayerMask.call(void 0, { ...memo, density: mask.density, feather: mask.feather, enabled: mask.enabled });
|
|
587
591
|
}
|
|
588
592
|
function sameJson(a, b) {
|
|
589
593
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
590
594
|
}
|
|
591
595
|
function isDefaultDepthMask(mask) {
|
|
592
596
|
if (!mask) return true;
|
|
593
|
-
return sameJson({ ...
|
|
597
|
+
return sameJson({ ..._chunkFRD3FUXIcjs.DEFAULT_DEPTH_MASK_VALUES, ...mask, depthRange: [..._nullishCoalesce(mask.depthRange, () => ( []))] }, _chunkFRD3FUXIcjs.DEFAULT_DEPTH_MASK_VALUES);
|
|
594
598
|
}
|
|
595
599
|
function developFromAdjustments(adjustments) {
|
|
596
600
|
return {
|
|
@@ -603,7 +607,7 @@ function developFromAdjustments(adjustments) {
|
|
|
603
607
|
exposure: _nullishCoalesce(adjustments.exposure, () => ( 0)),
|
|
604
608
|
temperature: _nullishCoalesce(adjustments.temperature, () => ( 0)),
|
|
605
609
|
tint: _nullishCoalesce(adjustments.tint, () => ( 0)),
|
|
606
|
-
process:
|
|
610
|
+
process: _chunkFRD3FUXIcjs.normalizeProcessVersion.call(void 0, adjustments.process)
|
|
607
611
|
};
|
|
608
612
|
}
|
|
609
613
|
function annotationLayerName(annotation) {
|
|
@@ -660,7 +664,7 @@ function backgroundLayer(filters = [], mask) {
|
|
|
660
664
|
visible: true,
|
|
661
665
|
opacity: 1,
|
|
662
666
|
blend: "normal",
|
|
663
|
-
surface:
|
|
667
|
+
surface: _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4),
|
|
664
668
|
offset: { x: 0, y: 0 },
|
|
665
669
|
source: "document",
|
|
666
670
|
filters
|
|
@@ -670,7 +674,7 @@ function backgroundLayer(filters = [], mask) {
|
|
|
670
674
|
}
|
|
671
675
|
function depthRasterMask(source) {
|
|
672
676
|
const out = {
|
|
673
|
-
surface:
|
|
677
|
+
surface: _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 1, 255),
|
|
674
678
|
defaultValue: 255,
|
|
675
679
|
source: { ...source, depthRange: [...source.depthRange] }
|
|
676
680
|
};
|
|
@@ -679,8 +683,8 @@ function depthRasterMask(source) {
|
|
|
679
683
|
}
|
|
680
684
|
function layersFromLegacy(parts, width, height) {
|
|
681
685
|
const stored = parts.adjustments;
|
|
682
|
-
const adjustments = stored ? { ...
|
|
683
|
-
const adjLayers =
|
|
686
|
+
const adjustments = stored ? { ..._chunkFRD3FUXIcjs.DEFAULT_ADJUSTMENTS_VALUES, ...stored, process: _chunkFRD3FUXIcjs.normalizeProcessVersion.call(void 0, stored.process) } : { ..._chunkFRD3FUXIcjs.DEFAULT_ADJUSTMENTS_VALUES };
|
|
687
|
+
const adjLayers = _chunkFRD3FUXIcjs.normalizeAdjustmentLayers.call(void 0, adjustments.layers);
|
|
684
688
|
const filters = [developFromAdjustments(adjustments)];
|
|
685
689
|
const blur = typeof adjustments.blur === "number" && adjustments.blur > 0 ? adjustments.blur : 0;
|
|
686
690
|
let legacyOutputBlur;
|
|
@@ -689,7 +693,7 @@ function layersFromLegacy(parts, width, height) {
|
|
|
689
693
|
else filters.push({ id: BLUR_FILTER_ID, kind: "blur", enabled: true, radius: blur });
|
|
690
694
|
}
|
|
691
695
|
const depth = parts.depthMask;
|
|
692
|
-
const mask = depth && !isDefaultDepthMask(depth) ? depthRasterMask({ ...
|
|
696
|
+
const mask = depth && !isDefaultDepthMask(depth) ? depthRasterMask({ ..._chunkFRD3FUXIcjs.DEFAULT_DEPTH_MASK_VALUES, ...depth }) : void 0;
|
|
693
697
|
const layers = [backgroundLayer(filters, mask)];
|
|
694
698
|
for (const l of adjLayers) layers.push(adjustmentNodeFromLegacy(l, width, height));
|
|
695
699
|
for (const a of _nullishCoalesce(parts.annotations, () => ( []))) layers.push(annotationLayerFor(JSON.parse(JSON.stringify(a))));
|
|
@@ -729,10 +733,10 @@ var isPlain = (l) => l.visible && l.opacity === 1 && l.blend === "normal" && !l.
|
|
|
729
733
|
function legacyView(stack, width, height, activeLayerId = null) {
|
|
730
734
|
const { layers } = stack;
|
|
731
735
|
const target = developTarget(layers, activeLayerId);
|
|
732
|
-
const develop = target ?
|
|
733
|
-
const blur = _nullishCoalesce(_nullishCoalesce(stack.legacyOutputBlur, () => ( (target ? _optionalChain([
|
|
736
|
+
const develop = target ? _chunkFRD3FUXIcjs.developFilter.call(void 0, target) : void 0;
|
|
737
|
+
const blur = _nullishCoalesce(_nullishCoalesce(stack.legacyOutputBlur, () => ( (target ? _optionalChain([_chunkFRD3FUXIcjs.blurFilter.call(void 0, target), 'optionalAccess', _2 => _2.radius]) : void 0))), () => ( 0));
|
|
734
738
|
const adjustments = {
|
|
735
|
-
...
|
|
739
|
+
..._chunkFRD3FUXIcjs.DEFAULT_ADJUSTMENTS_VALUES,
|
|
736
740
|
...develop ? {
|
|
737
741
|
brightness: develop.brightness,
|
|
738
742
|
contrast: develop.contrast,
|
|
@@ -743,7 +747,7 @@ function legacyView(stack, width, height, activeLayerId = null) {
|
|
|
743
747
|
} : {},
|
|
744
748
|
blur,
|
|
745
749
|
opacity: stack.outputOpacity,
|
|
746
|
-
process: develop ?
|
|
750
|
+
process: develop ? _chunkFRD3FUXIcjs.normalizeProcessVersion.call(void 0, develop.process) : _chunkFRD3FUXIcjs.DEFAULT_ADJUSTMENTS_VALUES.process
|
|
747
751
|
};
|
|
748
752
|
const adjNodes = [];
|
|
749
753
|
const annotations = [];
|
|
@@ -757,7 +761,7 @@ function legacyView(stack, width, height, activeLayerId = null) {
|
|
|
757
761
|
walk(layers);
|
|
758
762
|
if (adjNodes.length) adjustments.layers = adjNodes.map((n) => legacyAdjustmentLayer(n, width, height));
|
|
759
763
|
const depthSource = _optionalChain([target, 'optionalAccess', _3 => _3.mask, 'optionalAccess', _4 => _4.source]);
|
|
760
|
-
const depthMask = depthSource ? { ...depthSource, depthRange: [...depthSource.depthRange] } : { ...
|
|
764
|
+
const depthMask = depthSource ? { ...depthSource, depthRange: [...depthSource.depthRange] } : { ..._chunkFRD3FUXIcjs.DEFAULT_DEPTH_MASK_VALUES, depthRange: [..._chunkFRD3FUXIcjs.DEFAULT_DEPTH_MASK_VALUES.depthRange] };
|
|
761
765
|
return { adjustments, depthMask, annotations, exact: isLegacyShape(stack) };
|
|
762
766
|
}
|
|
763
767
|
function isLegacyShape(stack) {
|
|
@@ -795,7 +799,7 @@ function isLegacyShape(stack) {
|
|
|
795
799
|
|
|
796
800
|
// src/image-editor/layers/render.ts
|
|
797
801
|
function isQuarterTurn(rotate) {
|
|
798
|
-
return
|
|
802
|
+
return _chunkFRD3FUXIcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
|
|
799
803
|
}
|
|
800
804
|
function isIntegerRect(r) {
|
|
801
805
|
return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
|
|
@@ -803,7 +807,7 @@ function isIntegerRect(r) {
|
|
|
803
807
|
function baseProjection(region, transform, baseW, baseH) {
|
|
804
808
|
return {
|
|
805
809
|
region,
|
|
806
|
-
angle:
|
|
810
|
+
angle: _chunkFRD3FUXIcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
807
811
|
flipH: transform.flipH,
|
|
808
812
|
flipV: transform.flipV,
|
|
809
813
|
scale: 1,
|
|
@@ -812,14 +816,14 @@ function baseProjection(region, transform, baseW, baseH) {
|
|
|
812
816
|
};
|
|
813
817
|
}
|
|
814
818
|
function projectQuarterTurn(src, srcRect, region, transform) {
|
|
815
|
-
const rotated =
|
|
819
|
+
const rotated = _chunkFRD3FUXIcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
816
820
|
const w = Math.max(1, Math.round(rotated.width));
|
|
817
821
|
const h = Math.max(1, Math.round(rotated.height));
|
|
818
822
|
const out = new Uint8ClampedArray(w * h * 4);
|
|
819
823
|
const p = baseProjection(region, transform, w, h);
|
|
820
|
-
const o =
|
|
821
|
-
const ox =
|
|
822
|
-
const oy =
|
|
824
|
+
const o = _chunkFRD3FUXIcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
|
|
825
|
+
const ox = _chunkFRD3FUXIcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
|
|
826
|
+
const oy = _chunkFRD3FUXIcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
|
|
823
827
|
const ux = Math.round(ox.x - o.x);
|
|
824
828
|
const vx = Math.round(ox.y - o.y);
|
|
825
829
|
const uy = Math.round(oy.x - o.x);
|
|
@@ -848,7 +852,7 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
|
|
|
848
852
|
const d = img.data;
|
|
849
853
|
for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
|
|
850
854
|
}
|
|
851
|
-
if (legacyOutputBlur && legacyOutputBlur > 0)
|
|
855
|
+
if (legacyOutputBlur && legacyOutputBlur > 0) _chunkFRD3FUXIcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
|
|
852
856
|
}
|
|
853
857
|
function needsLegacyBase(input) {
|
|
854
858
|
const { stack, region, canvas, transform } = input;
|
|
@@ -857,10 +861,10 @@ function needsLegacyBase(input) {
|
|
|
857
861
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
|
|
858
862
|
if (_optionalChain([bg, 'access', _7 => _7.mask, 'optionalAccess', _8 => _8.source, 'optionalAccess', _9 => _9.enabled]) && bg.mask.source.maskSource) return true;
|
|
859
863
|
if (stack.outputOpacity < 1) return true;
|
|
860
|
-
const blur =
|
|
864
|
+
const blur = _chunkFRD3FUXIcjs.blurFilter.call(void 0, bg);
|
|
861
865
|
if (blur && blur.enabled && blur.radius > 0) {
|
|
862
866
|
const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
|
|
863
|
-
const angle =
|
|
867
|
+
const angle = _chunkFRD3FUXIcjs.normalizeAngle.call(void 0, transform.rotate);
|
|
864
868
|
if (!full || angle === 90 || angle === 270) return true;
|
|
865
869
|
}
|
|
866
870
|
if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
|
|
@@ -885,7 +889,7 @@ function coveringRect(region) {
|
|
|
885
889
|
const y = Math.floor(region.y);
|
|
886
890
|
return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
|
|
887
891
|
}
|
|
888
|
-
function renderLayeredBase(stack, region, transform, sources, compositor = new (0,
|
|
892
|
+
function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkFRD3FUXIcjs.LayerCompositor)()) {
|
|
889
893
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
|
|
890
894
|
throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
|
|
891
895
|
}
|
|
@@ -1019,8 +1023,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1019
1023
|
* The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
|
|
1020
1024
|
* trust dirty rectangles; exports use `exportCompositor`.
|
|
1021
1025
|
*/
|
|
1022
|
-
__init8() {this.compositor = new (0,
|
|
1023
|
-
__init9() {this.exportCompositor = new (0,
|
|
1026
|
+
__init8() {this.compositor = new (0, _chunkFRD3FUXIcjs.LayerCompositor)()}
|
|
1027
|
+
__init9() {this.exportCompositor = new (0, _chunkFRD3FUXIcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
|
|
1024
1028
|
/** How the host resolves layer pixels (set by the controller). */
|
|
1025
1029
|
|
|
1026
1030
|
/**
|
|
@@ -1086,9 +1090,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1086
1090
|
return;
|
|
1087
1091
|
}
|
|
1088
1092
|
const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
|
|
1089
|
-
const projection =
|
|
1093
|
+
const projection = _chunkFRD3FUXIcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
|
|
1090
1094
|
const { region } = projection;
|
|
1091
|
-
const rotated =
|
|
1095
|
+
const rotated = _chunkFRD3FUXIcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1092
1096
|
const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
|
|
1093
1097
|
let overlay = annotations;
|
|
1094
1098
|
if (route === "legacy") {
|
|
@@ -1098,8 +1102,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1098
1102
|
`${naturalWidth}x${naturalHeight}`,
|
|
1099
1103
|
`${region.x},${region.y},${region.width},${region.height}`,
|
|
1100
1104
|
`${projection.angle},${transform.flipH},${transform.flipV}`,
|
|
1101
|
-
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${
|
|
1102
|
-
|
|
1105
|
+
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkFRD3FUXIcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
|
|
1106
|
+
_chunkFRD3FUXIcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
|
|
1103
1107
|
`${depthMask.enabled},${depthMask.maskSource},${_optionalChain([depthMask, 'access', _10 => _10.depthRange, 'optionalAccess', _11 => _11[0]])}-${_optionalChain([depthMask, 'access', _12 => _12.depthRange, 'optionalAccess', _13 => _13[1]])},${depthMask.softness},${depthMask.invert},${depthMask.mode}`
|
|
1104
1108
|
].join("|");
|
|
1105
1109
|
let baseCanvas = this.cachedBaseCanvas;
|
|
@@ -1131,7 +1135,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1131
1135
|
}
|
|
1132
1136
|
if (overlay.length > 0 || options.draftAnnotation) {
|
|
1133
1137
|
ctx.save();
|
|
1134
|
-
|
|
1138
|
+
_chunkFRD3FUXIcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1135
1139
|
ctx.beginPath();
|
|
1136
1140
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1137
1141
|
ctx.clip();
|
|
@@ -1154,7 +1158,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1154
1158
|
if (_optionalChain([state, 'access', _18 => _18.selection, 'optionalAccess', _19 => _19.bounds]) && display !== "none" || _optionalChain([options, 'access', _20 => _20.draftSelectionPath, 'optionalAccess', _21 => _21.length])) {
|
|
1155
1159
|
ctx.save();
|
|
1156
1160
|
try {
|
|
1157
|
-
|
|
1161
|
+
_chunkFRD3FUXIcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1158
1162
|
ctx.beginPath();
|
|
1159
1163
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1160
1164
|
ctx.clip();
|
|
@@ -1169,7 +1173,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1169
1173
|
const b = options.brushCursor;
|
|
1170
1174
|
ctx.save();
|
|
1171
1175
|
try {
|
|
1172
|
-
|
|
1176
|
+
_chunkFRD3FUXIcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1173
1177
|
const px2 = 1 / (projection.scale || 1);
|
|
1174
1178
|
ctx.beginPath();
|
|
1175
1179
|
ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
|
|
@@ -1187,7 +1191,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1187
1191
|
const t = options.freeTransform;
|
|
1188
1192
|
ctx.save();
|
|
1189
1193
|
try {
|
|
1190
|
-
const scr = (p) =>
|
|
1194
|
+
const scr = (p) => _chunkFRD3FUXIcjs.projectImagePoint.call(void 0, p, projection);
|
|
1191
1195
|
ctx.beginPath();
|
|
1192
1196
|
if (t.warp) {
|
|
1193
1197
|
for (const c of t.warp.curves) {
|
|
@@ -1245,7 +1249,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1245
1249
|
}
|
|
1246
1250
|
if (isActivelyCropping) {
|
|
1247
1251
|
const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
|
|
1248
|
-
this.drawCropOverlay(ctx,
|
|
1252
|
+
this.drawCropOverlay(ctx, _chunkFRD3FUXIcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
|
|
1249
1253
|
}
|
|
1250
1254
|
}
|
|
1251
1255
|
/**
|
|
@@ -1254,7 +1258,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1254
1258
|
*/
|
|
1255
1259
|
async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
|
|
1256
1260
|
const { adjustments, depthMask } = state;
|
|
1257
|
-
const rotated =
|
|
1261
|
+
const rotated = _chunkFRD3FUXIcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1258
1262
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1259
1263
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1260
1264
|
const baseCanvas = this.createCanvas(baseW, baseH);
|
|
@@ -1262,7 +1266,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1262
1266
|
if (!baseCtx) return baseCanvas;
|
|
1263
1267
|
const projection = getBaseProjection(region, transform, baseW, baseH);
|
|
1264
1268
|
baseCtx.save();
|
|
1265
|
-
|
|
1269
|
+
_chunkFRD3FUXIcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
|
|
1266
1270
|
baseCtx.drawImage(
|
|
1267
1271
|
img,
|
|
1268
1272
|
region.x,
|
|
@@ -1277,8 +1281,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1277
1281
|
baseCtx.restore();
|
|
1278
1282
|
const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
|
|
1279
1283
|
if (imageData) {
|
|
1280
|
-
const layerMasks =
|
|
1281
|
-
|
|
1284
|
+
const layerMasks = _chunkFRD3FUXIcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
|
|
1285
|
+
_chunkFRD3FUXIcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
|
|
1282
1286
|
if (depthMask.enabled && depthMask.maskSource) {
|
|
1283
1287
|
try {
|
|
1284
1288
|
const maskImg = await this.imageCache.get(depthMask.maskSource);
|
|
@@ -1289,7 +1293,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1289
1293
|
const maskCtx = maskCanvas.getContext("2d");
|
|
1290
1294
|
if (maskCtx) {
|
|
1291
1295
|
maskCtx.save();
|
|
1292
|
-
|
|
1296
|
+
_chunkFRD3FUXIcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
|
|
1293
1297
|
maskCtx.drawImage(
|
|
1294
1298
|
maskImg,
|
|
1295
1299
|
region.x * sx,
|
|
@@ -1304,7 +1308,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1304
1308
|
maskCtx.restore();
|
|
1305
1309
|
const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
|
|
1306
1310
|
if (maskData) {
|
|
1307
|
-
|
|
1311
|
+
_chunkFRD3FUXIcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
|
|
1308
1312
|
}
|
|
1309
1313
|
}
|
|
1310
1314
|
} catch (e6) {
|
|
@@ -1355,7 +1359,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1355
1359
|
/** Loads what the compositor reads synchronously: depth maps (at canvas size) and annotation images. */
|
|
1356
1360
|
/** Loads depth maps and annotation images the compositor reads synchronously. */
|
|
1357
1361
|
async prepareLayerAssets(layers, width, height) {
|
|
1358
|
-
for (const l of
|
|
1362
|
+
for (const l of _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers)) {
|
|
1359
1363
|
const source = _optionalChain([l, 'access', _43 => _43.mask, 'optionalAccess', _44 => _44.source]);
|
|
1360
1364
|
if (_optionalChain([source, 'optionalAccess', _45 => _45.enabled]) && source.maskSource) {
|
|
1361
1365
|
const key = `${source.maskSource}|${width}x${height}`;
|
|
@@ -1409,14 +1413,14 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1409
1413
|
}
|
|
1410
1414
|
}
|
|
1411
1415
|
putTile(ctx, data, tx, ty, rect) {
|
|
1412
|
-
const ox = tx *
|
|
1413
|
-
const oy = ty *
|
|
1416
|
+
const ox = tx * _chunkSZ6KMZNMcjs.TILE - rect.x;
|
|
1417
|
+
const oy = ty * _chunkSZ6KMZNMcjs.TILE - rect.y;
|
|
1414
1418
|
const x0 = Math.max(0, -ox);
|
|
1415
1419
|
const y0 = Math.max(0, -oy);
|
|
1416
|
-
const x1 = Math.min(
|
|
1417
|
-
const y1 = Math.min(
|
|
1420
|
+
const x1 = Math.min(_chunkSZ6KMZNMcjs.TILE, rect.width - ox);
|
|
1421
|
+
const y1 = Math.min(_chunkSZ6KMZNMcjs.TILE, rect.height - oy);
|
|
1418
1422
|
if (x1 <= x0 || y1 <= y0) return;
|
|
1419
|
-
const img = ctx.createImageData(
|
|
1423
|
+
const img = ctx.createImageData(_chunkSZ6KMZNMcjs.TILE, _chunkSZ6KMZNMcjs.TILE);
|
|
1420
1424
|
img.data.set(data);
|
|
1421
1425
|
ctx.putImageData(img, ox, oy, x0, y0, x1 - x0, y1 - y0);
|
|
1422
1426
|
}
|
|
@@ -1437,7 +1441,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1437
1441
|
if (!ctx || typeof ctx.createImageData !== "function") return null;
|
|
1438
1442
|
let changed = false;
|
|
1439
1443
|
this.compositor.compositeTiles(layers, rect, this.compositorSources(width, height), (tx, ty, data) => {
|
|
1440
|
-
const key =
|
|
1444
|
+
const key = _chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty);
|
|
1441
1445
|
if (comp.tiles.get(key) === data) return;
|
|
1442
1446
|
comp.tiles.set(key, data);
|
|
1443
1447
|
comp.histograms.delete(key);
|
|
@@ -1457,17 +1461,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1457
1461
|
if (!comp) return null;
|
|
1458
1462
|
const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
|
|
1459
1463
|
const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
|
|
1460
|
-
const rotated =
|
|
1464
|
+
const rotated = _chunkFRD3FUXIcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1461
1465
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1462
1466
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1463
|
-
const key = `${comp.version}|${region.x},${region.y},${region.width},${region.height}|${
|
|
1467
|
+
const key = `${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkFRD3FUXIcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
|
|
1464
1468
|
if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
|
|
1465
1469
|
const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
|
|
1466
1470
|
const ctx = canvas.getContext("2d");
|
|
1467
1471
|
if (!ctx) return null;
|
|
1468
1472
|
ctx.clearRect(0, 0, baseW, baseH);
|
|
1469
1473
|
ctx.save();
|
|
1470
|
-
|
|
1474
|
+
_chunkFRD3FUXIcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
|
|
1471
1475
|
ctx.beginPath();
|
|
1472
1476
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1473
1477
|
ctx.clip();
|
|
@@ -1562,12 +1566,12 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1562
1566
|
* Draws an individual annotation onto the canvas.
|
|
1563
1567
|
*/
|
|
1564
1568
|
async drawAnnotation(ctx, ann) {
|
|
1565
|
-
const blend =
|
|
1569
|
+
const blend = _chunkSZ6KMZNMcjs.normalizeBlendMode.call(void 0, ann.blend);
|
|
1566
1570
|
if (blend === "normal") {
|
|
1567
1571
|
await this.drawAnnotationContent(ctx, ann);
|
|
1568
1572
|
return;
|
|
1569
1573
|
}
|
|
1570
|
-
const op =
|
|
1574
|
+
const op = _chunkSZ6KMZNMcjs.canvasCompositeOperation.call(void 0, blend);
|
|
1571
1575
|
if (op) {
|
|
1572
1576
|
ctx.save();
|
|
1573
1577
|
ctx.globalCompositeOperation = op;
|
|
@@ -1600,7 +1604,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1600
1604
|
const backdrop = ctx.getImageData(0, 0, w, h);
|
|
1601
1605
|
const source = lctx.getImageData(0, 0, w, h);
|
|
1602
1606
|
if (!backdrop || !source) return false;
|
|
1603
|
-
|
|
1607
|
+
_chunkSZ6KMZNMcjs.blendImageData.call(void 0, backdrop, source, _chunkSZ6KMZNMcjs.normalizeBlendMode.call(void 0, ann.blend));
|
|
1604
1608
|
lctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1605
1609
|
lctx.putImageData(backdrop, 0, 0);
|
|
1606
1610
|
} catch (e10) {
|
|
@@ -1739,7 +1743,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1739
1743
|
ctx.strokeStyle = "#3b82f6";
|
|
1740
1744
|
ctx.lineWidth = 1.5;
|
|
1741
1745
|
ctx.setLineDash([4, 4]);
|
|
1742
|
-
const bounds =
|
|
1746
|
+
const bounds = _chunkFRD3FUXIcjs.getAnnotationBounds.call(void 0, ann);
|
|
1743
1747
|
const pad = 4;
|
|
1744
1748
|
ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
|
|
1745
1749
|
ctx.fillStyle = "#ffffff";
|
|
@@ -1760,7 +1764,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1760
1764
|
}
|
|
1761
1765
|
/** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
|
|
1762
1766
|
getAnnotationBounds(ann) {
|
|
1763
|
-
return
|
|
1767
|
+
return _chunkFRD3FUXIcjs.getAnnotationBounds.call(void 0, ann);
|
|
1764
1768
|
}
|
|
1765
1769
|
/**
|
|
1766
1770
|
* Draws a rule-of-thirds crop grid overlay. All rectangles come from
|
|
@@ -1842,8 +1846,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1842
1846
|
}
|
|
1843
1847
|
const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
|
|
1844
1848
|
const { crop, transform, annotations } = state;
|
|
1845
|
-
const region = crop ?
|
|
1846
|
-
const rotated =
|
|
1849
|
+
const region = crop ? _chunkFRD3FUXIcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
|
|
1850
|
+
const rotated = _chunkFRD3FUXIcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1847
1851
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1848
1852
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1849
1853
|
const exportW = options.width || baseW;
|
|
@@ -1872,7 +1876,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1872
1876
|
const bctx = baseCanvas.getContext("2d");
|
|
1873
1877
|
if (bctx) {
|
|
1874
1878
|
bctx.save();
|
|
1875
|
-
|
|
1879
|
+
_chunkFRD3FUXIcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
|
|
1876
1880
|
bctx.beginPath();
|
|
1877
1881
|
bctx.rect(region.x, region.y, region.width, region.height);
|
|
1878
1882
|
bctx.clip();
|
|
@@ -1885,7 +1889,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1885
1889
|
if (options.includeAnnotations !== false && overlay.length > 0) {
|
|
1886
1890
|
ctx.save();
|
|
1887
1891
|
ctx.scale(exportW / baseW, exportH / baseH);
|
|
1888
|
-
|
|
1892
|
+
_chunkFRD3FUXIcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
|
|
1889
1893
|
for (const ann of overlay) {
|
|
1890
1894
|
await this.drawAnnotation(ctx, ann);
|
|
1891
1895
|
}
|
|
@@ -1975,7 +1979,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1975
1979
|
case "rect":
|
|
1976
1980
|
case "image":
|
|
1977
1981
|
case "text": {
|
|
1978
|
-
const b =
|
|
1982
|
+
const b = _chunkFRD3FUXIcjs.getAnnotationBounds.call(void 0, ann);
|
|
1979
1983
|
ctx.fillRect(b.x, b.y, b.width, b.height);
|
|
1980
1984
|
break;
|
|
1981
1985
|
}
|
|
@@ -1995,7 +1999,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
|
|
|
1995
1999
|
function getBaseProjection(region, transform, baseW, baseH) {
|
|
1996
2000
|
return {
|
|
1997
2001
|
region,
|
|
1998
|
-
angle:
|
|
2002
|
+
angle: _chunkFRD3FUXIcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
1999
2003
|
flipH: transform.flipH,
|
|
2000
2004
|
flipV: transform.flipV,
|
|
2001
2005
|
scale: 1,
|
|
@@ -2025,12 +2029,12 @@ var CompositeCanvas = (_class3 = class {
|
|
|
2025
2029
|
if (!h) {
|
|
2026
2030
|
const tx = key % 65536 - 32768;
|
|
2027
2031
|
const ty = Math.floor(key / 65536) - 32768;
|
|
2028
|
-
const x0 = Math.max(r.x, tx *
|
|
2029
|
-
const y0 = Math.max(r.y, ty *
|
|
2030
|
-
const x1 = Math.min(r.x + r.width, tx *
|
|
2031
|
-
const y1 = Math.min(r.y + r.height, ty *
|
|
2032
|
+
const x0 = Math.max(r.x, tx * _chunkSZ6KMZNMcjs.TILE);
|
|
2033
|
+
const y0 = Math.max(r.y, ty * _chunkSZ6KMZNMcjs.TILE);
|
|
2034
|
+
const x1 = Math.min(r.x + r.width, tx * _chunkSZ6KMZNMcjs.TILE + _chunkSZ6KMZNMcjs.TILE);
|
|
2035
|
+
const y1 = Math.min(r.y + r.height, ty * _chunkSZ6KMZNMcjs.TILE + _chunkSZ6KMZNMcjs.TILE);
|
|
2032
2036
|
h = emptyHistogram();
|
|
2033
|
-
if (x1 > x0 && y1 > y0) addToHistogram(h, data,
|
|
2037
|
+
if (x1 > x0 && y1 > y0) addToHistogram(h, data, _chunkSZ6KMZNMcjs.TILE, { x: x0 - tx * _chunkSZ6KMZNMcjs.TILE, y: y0 - ty * _chunkSZ6KMZNMcjs.TILE, width: x1 - x0, height: y1 - y0 });
|
|
2034
2038
|
this.histograms.set(key, h);
|
|
2035
2039
|
}
|
|
2036
2040
|
parts.push(h);
|
|
@@ -2099,8 +2103,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
2099
2103
|
}
|
|
2100
2104
|
function toMask(width, height, coverage) {
|
|
2101
2105
|
const out = new Uint8Array(coverage.length);
|
|
2102
|
-
for (let i = 0; i < out.length; i++) out[i] =
|
|
2103
|
-
return
|
|
2106
|
+
for (let i = 0; i < out.length; i++) out[i] = _chunkFRD3FUXIcjs.coverageToByte.call(void 0, coverage[i]);
|
|
2107
|
+
return _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, width, height, out);
|
|
2104
2108
|
}
|
|
2105
2109
|
function polygonSelection(width, height, points, options = {}) {
|
|
2106
2110
|
return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
|
|
@@ -2227,7 +2231,7 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2227
2231
|
const { width: w, height: h } = pixels;
|
|
2228
2232
|
const sx = Math.floor(seed.x);
|
|
2229
2233
|
const sy = Math.floor(seed.y);
|
|
2230
|
-
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return
|
|
2234
|
+
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, w, h);
|
|
2231
2235
|
const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
|
|
2232
2236
|
const marks = new Uint8Array(n);
|
|
2233
2237
|
let bx0 = w;
|
|
@@ -2275,9 +2279,9 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2275
2279
|
}
|
|
2276
2280
|
}
|
|
2277
2281
|
}
|
|
2278
|
-
if (bx1 < 0) return
|
|
2279
|
-
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return
|
|
2280
|
-
return
|
|
2282
|
+
if (bx1 < 0) return _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, w, h);
|
|
2283
|
+
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, w, h, marks);
|
|
2284
|
+
return _chunkFRD3FUXIcjs.createSelectionMask.call(void 0,
|
|
2281
2285
|
w,
|
|
2282
2286
|
h,
|
|
2283
2287
|
antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
|
|
@@ -2299,7 +2303,7 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2299
2303
|
const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
|
|
2300
2304
|
const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
|
|
2301
2305
|
const out = new Uint8Array(n);
|
|
2302
|
-
if (!parsed.length) return
|
|
2306
|
+
if (!parsed.length) return _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2303
2307
|
for (let i = 0; i < n; i++) {
|
|
2304
2308
|
const p = i * 4;
|
|
2305
2309
|
if (data[p + 3] <= 0) continue;
|
|
@@ -2315,9 +2319,9 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2315
2319
|
}
|
|
2316
2320
|
if (k > best) best = k;
|
|
2317
2321
|
}
|
|
2318
|
-
out[i] =
|
|
2322
|
+
out[i] = _chunkFRD3FUXIcjs.coverageToByte.call(void 0, best);
|
|
2319
2323
|
}
|
|
2320
|
-
return
|
|
2324
|
+
return _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2321
2325
|
}
|
|
2322
2326
|
var TONE_RANGE_PRESETS = {
|
|
2323
2327
|
shadows: [0, 65],
|
|
@@ -2335,9 +2339,9 @@ function toneRange(pixels, range, falloff = 20) {
|
|
|
2335
2339
|
if (d[p + 3] <= 0) continue;
|
|
2336
2340
|
const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
|
|
2337
2341
|
const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
|
|
2338
|
-
out[i] =
|
|
2342
|
+
out[i] = _chunkFRD3FUXIcjs.coverageToByte.call(void 0, 1 - outside / ramp);
|
|
2339
2343
|
}
|
|
2340
|
-
return
|
|
2344
|
+
return _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2341
2345
|
}
|
|
2342
2346
|
function hueRange(pixels, center) {
|
|
2343
2347
|
const n = checkPixels(pixels);
|
|
@@ -2360,9 +2364,9 @@ function hueRange(pixels, center) {
|
|
|
2360
2364
|
hue *= 60;
|
|
2361
2365
|
let dh = ((hue - center) % 360 + 360) % 360;
|
|
2362
2366
|
dh = Math.min(dh, 360 - dh);
|
|
2363
|
-
out[i] =
|
|
2367
|
+
out[i] = _chunkFRD3FUXIcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
|
|
2364
2368
|
}
|
|
2365
|
-
return
|
|
2369
|
+
return _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2366
2370
|
}
|
|
2367
2371
|
|
|
2368
2372
|
// src/image-editor/selection/refine.ts
|
|
@@ -2496,9 +2500,9 @@ function edgeWidth(guide, w, h, r) {
|
|
|
2496
2500
|
g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
|
|
2497
2501
|
}
|
|
2498
2502
|
}
|
|
2499
|
-
const gm =
|
|
2500
|
-
const hi =
|
|
2501
|
-
const lo =
|
|
2503
|
+
const gm = _chunkFRD3FUXIcjs.greyMorphology.call(void 0, g, w, h, r, true);
|
|
2504
|
+
const hi = _chunkFRD3FUXIcjs.greyMorphology.call(void 0, y, w, h, r, true);
|
|
2505
|
+
const lo = _chunkFRD3FUXIcjs.greyMorphology.call(void 0, y, w, h, r, false);
|
|
2502
2506
|
const out = new Float32Array(n);
|
|
2503
2507
|
for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
|
|
2504
2508
|
return out;
|
|
@@ -2522,7 +2526,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2522
2526
|
}
|
|
2523
2527
|
}
|
|
2524
2528
|
if (any) {
|
|
2525
|
-
const dist =
|
|
2529
|
+
const dist = _chunkFRD3FUXIcjs.distanceTransform.call(void 0, boundary, w, h);
|
|
2526
2530
|
const r = gfRadius(p);
|
|
2527
2531
|
const q = guidedFilterColor(guide, m, w, h, r);
|
|
2528
2532
|
const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
|
|
@@ -2538,17 +2542,17 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2538
2542
|
}
|
|
2539
2543
|
const ss = smoothSigma(p);
|
|
2540
2544
|
if (ss >= 0.3) {
|
|
2541
|
-
a =
|
|
2545
|
+
a = _chunkT3QZ6S47cjs.gaussianBlur.call(void 0, a, w, h, ss, "clamp");
|
|
2542
2546
|
const gain = 1 + ss;
|
|
2543
2547
|
for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
|
|
2544
2548
|
}
|
|
2545
|
-
a =
|
|
2549
|
+
a = _chunkT3QZ6S47cjs.gaussianBlur.call(void 0, a, w, h, featherSigma(p), "clamp");
|
|
2546
2550
|
if (p.contrast > 0) {
|
|
2547
2551
|
const gain = 1 / (1 - 0.99 * p.contrast / 100);
|
|
2548
2552
|
for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
|
|
2549
2553
|
}
|
|
2550
2554
|
const amount = shiftAmount(p);
|
|
2551
|
-
if (Math.abs(amount) >= 1e-4) a =
|
|
2555
|
+
if (Math.abs(amount) >= 1e-4) a = _chunkFRD3FUXIcjs.shiftCoverage.call(void 0, a, w, h, amount);
|
|
2552
2556
|
return a;
|
|
2553
2557
|
}
|
|
2554
2558
|
function guidePlanes(pixels, win) {
|
|
@@ -2592,15 +2596,15 @@ function refineSelection(pixels, mask, params = {}) {
|
|
|
2592
2596
|
const out = new Uint8Array(mask.width * mask.height);
|
|
2593
2597
|
for (let y = 0; y < wh; y++) {
|
|
2594
2598
|
const dst = (y0 + y) * mask.width + x0;
|
|
2595
|
-
for (let x = 0; x < ww; x++) out[dst + x] =
|
|
2599
|
+
for (let x = 0; x < ww; x++) out[dst + x] = _chunkFRD3FUXIcjs.coverageToByte.call(void 0, refined[y * ww + x]);
|
|
2596
2600
|
}
|
|
2597
|
-
return
|
|
2601
|
+
return _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
|
|
2598
2602
|
}
|
|
2599
2603
|
|
|
2600
2604
|
// src/image-editor/free-transform.ts
|
|
2601
2605
|
var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
|
|
2602
2606
|
var fail = (message) => {
|
|
2603
|
-
throw new (0,
|
|
2607
|
+
throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(message);
|
|
2604
2608
|
};
|
|
2605
2609
|
var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
|
|
2606
2610
|
function previewStep(scale) {
|
|
@@ -2611,12 +2615,12 @@ function toDoc(r, o) {
|
|
|
2611
2615
|
return r ? { x: r.x + o.x, y: r.y + o.y, width: r.width, height: r.height } : null;
|
|
2612
2616
|
}
|
|
2613
2617
|
function selectionSurface(sel) {
|
|
2614
|
-
return
|
|
2618
|
+
return _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: sel.width, height: sel.height, data: sel.data }, 1, 0, 0, 0);
|
|
2615
2619
|
}
|
|
2616
2620
|
function liftPixels(surface, sel, o) {
|
|
2617
2621
|
const sb = sel.bounds;
|
|
2618
2622
|
const area = { x: sb.x - o.x, y: sb.y - o.y, width: sb.width, height: sb.height };
|
|
2619
|
-
const px2 =
|
|
2623
|
+
const px2 = _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, area);
|
|
2620
2624
|
const kept = new Uint8ClampedArray(px2);
|
|
2621
2625
|
for (let y = 0; y < area.height; y++) {
|
|
2622
2626
|
for (let x = 0; x < area.width; x++) {
|
|
@@ -2632,12 +2636,12 @@ function liftPixels(surface, sel, o) {
|
|
|
2632
2636
|
if (!kept[i + 3]) kept[i] = kept[i + 1] = kept[i + 2] = 0;
|
|
2633
2637
|
}
|
|
2634
2638
|
}
|
|
2635
|
-
return { lifted:
|
|
2639
|
+
return { lifted: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: area.width, height: area.height, data: px2 }, 4, area.x, area.y), rest: _chunkSZ6KMZNMcjs.writeRegion.call(void 0, surface, area, kept) };
|
|
2636
2640
|
}
|
|
2637
2641
|
function liftMask(mask, sel, o) {
|
|
2638
2642
|
const sb = sel.bounds;
|
|
2639
2643
|
const area = { x: sb.x - o.x, y: sb.y - o.y, width: sb.width, height: sb.height };
|
|
2640
|
-
const v =
|
|
2644
|
+
const v = _chunkSZ6KMZNMcjs.readRegion.call(void 0, mask, area);
|
|
2641
2645
|
const def = mask.defaultValue;
|
|
2642
2646
|
const lifted = new Uint8ClampedArray(area.width * area.height * 4);
|
|
2643
2647
|
const rest = new Uint8ClampedArray(v.length);
|
|
@@ -2653,12 +2657,12 @@ function liftMask(mask, sel, o) {
|
|
|
2653
2657
|
rest[i] = g * (1 - k) + def * k;
|
|
2654
2658
|
}
|
|
2655
2659
|
}
|
|
2656
|
-
return { lifted:
|
|
2660
|
+
return { lifted: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: area.width, height: area.height, data: lifted }, 4, area.x, area.y), rest: _chunkSZ6KMZNMcjs.writeRegion.call(void 0, mask, area, rest) };
|
|
2657
2661
|
}
|
|
2658
2662
|
var FreeTransformSession = (_class4 = class {
|
|
2659
2663
|
constructor(host, init = {}) {;_class4.prototype.__init24.call(this);_class4.prototype.__init25.call(this);_class4.prototype.__init26.call(this);_class4.prototype.__init27.call(this);_class4.prototype.__init28.call(this);_class4.prototype.__init29.call(this);_class4.prototype.__init30.call(this);
|
|
2660
2664
|
this.host = host;
|
|
2661
|
-
if (init.interpolation !== void 0 && !
|
|
2665
|
+
if (init.interpolation !== void 0 && !_chunkT3QZ6S47cjs.isInterpolation.call(void 0, init.interpolation)) fail(`Unknown interpolation "${String(init.interpolation)}"; use nearest, bilinear or bicubic.`);
|
|
2662
2666
|
this.interp = _nullishCoalesce(init.interpolation, () => ( "bicubic"));
|
|
2663
2667
|
const sel = host.selection();
|
|
2664
2668
|
const selected = Boolean(_optionalChain([sel, 'optionalAccess', _59 => _59.bounds]));
|
|
@@ -2667,7 +2671,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2667
2671
|
fail(`Unknown content "${String(content)}"; use auto, layer, selection, selection-copy or selection-outline.`);
|
|
2668
2672
|
}
|
|
2669
2673
|
const targetId = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
|
|
2670
|
-
const target = targetId && content !== "selection-outline" ? _optionalChain([
|
|
2674
|
+
const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkT3QZ6S47cjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _60 => _60.layer]) : void 0;
|
|
2671
2675
|
const smartTarget = _optionalChain([target, 'optionalAccess', _61 => _61.type]) === "smart" && (_nullishCoalesce(init.channel, () => ( (target.id === host.activeLayerId() ? host.activeTarget() : "pixels")))) !== "mask";
|
|
2672
2676
|
if (content === "auto") content = selected && !smartTarget ? "selection" : "layer";
|
|
2673
2677
|
this.content = content;
|
|
@@ -2687,7 +2691,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2687
2691
|
} else {
|
|
2688
2692
|
const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
|
|
2689
2693
|
if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
|
|
2690
|
-
const layer =
|
|
2694
|
+
const layer = _chunkFRD3FUXIcjs.requireLayer.call(void 0, layers, id).layer;
|
|
2691
2695
|
this.layerId = layer.id;
|
|
2692
2696
|
const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
|
|
2693
2697
|
const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
|
|
@@ -2698,20 +2702,20 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2698
2702
|
if (!maskAlone && layer.type !== "pixel" && layer.type !== "smart") fail(`Layer "${layer.name || id}" is a ${layer.type} layer; Free Transform works on pixel layers, smart objects, layer masks (channel mask) and selections.`);
|
|
2699
2703
|
if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
|
|
2700
2704
|
if (content !== "selection-copy") {
|
|
2701
|
-
|
|
2702
|
-
if (!maskAlone)
|
|
2705
|
+
_chunkFRD3FUXIcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
|
|
2706
|
+
if (!maskAlone) _chunkFRD3FUXIcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
|
|
2703
2707
|
}
|
|
2704
2708
|
const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
2705
2709
|
const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
|
|
2706
2710
|
if (layer.type === "smart" && !maskAlone) {
|
|
2707
2711
|
if (content !== "layer") fail(`Layer "${layer.name || id}" is a smart object, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
|
|
2708
|
-
if (!
|
|
2712
|
+
if (!_chunkFRD3FUXIcjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
|
|
2709
2713
|
this.smart = layer;
|
|
2710
2714
|
this.smartObject = true;
|
|
2711
|
-
this.startGeometry =
|
|
2715
|
+
this.startGeometry = _chunkFRD3FUXIcjs.placementGeometry.call(void 0, layer);
|
|
2712
2716
|
if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
|
|
2713
2717
|
this.startInterp = this.interp;
|
|
2714
|
-
this.box =
|
|
2718
|
+
this.box = _chunkFRD3FUXIcjs.contentsBox.call(void 0, layer.contents);
|
|
2715
2719
|
this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
|
|
2716
2720
|
this.geometryValue = this.startGeometry;
|
|
2717
2721
|
this.shown = this.startLayers;
|
|
@@ -2722,26 +2726,26 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2722
2726
|
if (content === "selection") {
|
|
2723
2727
|
const { lifted, rest } = liftMask(mask.surface, sel, o);
|
|
2724
2728
|
this.parts.push({ what: "mask", offset: o, moving: lifted, base: rest, reduced: /* @__PURE__ */ new Map() });
|
|
2725
|
-
box = toDoc(
|
|
2729
|
+
box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, lifted), o);
|
|
2726
2730
|
} else {
|
|
2727
2731
|
this.parts.push({ what: "mask", offset: o, moving: mask.surface, base: null, reduced: /* @__PURE__ */ new Map() });
|
|
2728
|
-
box = toDoc(
|
|
2732
|
+
box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, mask.surface), o);
|
|
2729
2733
|
}
|
|
2730
2734
|
moves.push("mask");
|
|
2731
2735
|
} else if (content === "layer") {
|
|
2732
2736
|
this.parts.push({ what: "pixels", offset: o, moving: pixels, base: null, reduced: /* @__PURE__ */ new Map() });
|
|
2733
2737
|
moves.push("pixels");
|
|
2734
|
-
box = toDoc(
|
|
2738
|
+
box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, pixels), o);
|
|
2735
2739
|
if (mask && linked) {
|
|
2736
2740
|
this.parts.push({ what: "mask", offset: o, moving: mask.surface, base: null, reduced: /* @__PURE__ */ new Map() });
|
|
2737
2741
|
moves.push("mask");
|
|
2738
|
-
if (!box) box = toDoc(
|
|
2742
|
+
if (!box) box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, mask.surface), o);
|
|
2739
2743
|
}
|
|
2740
2744
|
} else if (content === "selection") {
|
|
2741
2745
|
const { lifted, rest } = liftPixels(pixels, sel, o);
|
|
2742
2746
|
this.parts.push({ what: "pixels", offset: o, moving: lifted, base: rest, reduced: /* @__PURE__ */ new Map() });
|
|
2743
2747
|
moves.push("pixels");
|
|
2744
|
-
box = toDoc(
|
|
2748
|
+
box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, lifted), o);
|
|
2745
2749
|
if (mask && linked) {
|
|
2746
2750
|
const m = liftMask(mask.surface, sel, o);
|
|
2747
2751
|
this.parts.push({ what: "mask", offset: o, moving: m.lifted, base: m.rest, reduced: /* @__PURE__ */ new Map() });
|
|
@@ -2749,11 +2753,11 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2749
2753
|
}
|
|
2750
2754
|
} else {
|
|
2751
2755
|
const { lifted } = liftPixels(pixels, sel, o);
|
|
2752
|
-
box = toDoc(
|
|
2756
|
+
box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, lifted), o);
|
|
2753
2757
|
if (box) {
|
|
2754
2758
|
const copy = {
|
|
2755
2759
|
type: "pixel",
|
|
2756
|
-
id:
|
|
2760
|
+
id: _chunkFRD3FUXIcjs.newLayerId.call(void 0, ),
|
|
2757
2761
|
name: `${layer.name || "Layer"} copy`,
|
|
2758
2762
|
visible: true,
|
|
2759
2763
|
opacity: 1,
|
|
@@ -2762,8 +2766,8 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2762
2766
|
offset: { ...o }
|
|
2763
2767
|
};
|
|
2764
2768
|
this.copyId = copy.id;
|
|
2765
|
-
const loc =
|
|
2766
|
-
this.startLayers =
|
|
2769
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, layers, layer.id);
|
|
2770
|
+
this.startLayers = _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _65 => _65.parent, 'optionalAccess', _66 => _66.id]), () => ( null)), loc.index + 1);
|
|
2767
2771
|
this.parts.push({ what: "pixels", offset: o, moving: lifted, base: null, reduced: /* @__PURE__ */ new Map() });
|
|
2768
2772
|
moves.push("pixels");
|
|
2769
2773
|
}
|
|
@@ -2777,7 +2781,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2777
2781
|
if (!box) fail(content === "layer" ? "The layer has no pixels to transform." : "The selection holds no pixels of this layer; select some, or transform the outline (content selection-outline).");
|
|
2778
2782
|
this.box = box;
|
|
2779
2783
|
this.moves = moves;
|
|
2780
|
-
this.startGeometry =
|
|
2784
|
+
this.startGeometry = _chunkFRD3FUXIcjs.identityTransform.call(void 0, box);
|
|
2781
2785
|
this.startInterp = this.interp;
|
|
2782
2786
|
this.geometryValue = this.startGeometry;
|
|
2783
2787
|
this.shown = this.startLayers;
|
|
@@ -2840,7 +2844,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2840
2844
|
update(changes, preview = {}) {
|
|
2841
2845
|
this.check();
|
|
2842
2846
|
if (changes.interpolation !== void 0) {
|
|
2843
|
-
if (!
|
|
2847
|
+
if (!_chunkT3QZ6S47cjs.isInterpolation.call(void 0, changes.interpolation)) fail(`Unknown interpolation "${String(changes.interpolation)}"; use nearest, bilinear or bicubic.`);
|
|
2844
2848
|
this.interp = changes.interpolation;
|
|
2845
2849
|
}
|
|
2846
2850
|
const next = {
|
|
@@ -2849,7 +2853,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2849
2853
|
warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
|
|
2850
2854
|
};
|
|
2851
2855
|
if (next.corners.length !== 4 || !next.corners.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) fail("corners must be four finite points: top-left, top-right, bottom-right, bottom-left.");
|
|
2852
|
-
if (!
|
|
2856
|
+
if (!_chunkFRD3FUXIcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
|
|
2853
2857
|
this.geometryValue = next;
|
|
2854
2858
|
if (preview !== false) this.render(preview);
|
|
2855
2859
|
return next;
|
|
@@ -2858,10 +2862,10 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2858
2862
|
resample(final, preview = {}) {
|
|
2859
2863
|
if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
|
|
2860
2864
|
const g = this.geometryValue;
|
|
2861
|
-
const identity =
|
|
2862
|
-
const warp =
|
|
2863
|
-
const h = warp ? null :
|
|
2864
|
-
const f = warp ?
|
|
2865
|
+
const identity = _chunkFRD3FUXIcjs.isIdentityTransform.call(void 0, g);
|
|
2866
|
+
const warp = _chunkFRD3FUXIcjs.hasWarp.call(void 0, g);
|
|
2867
|
+
const h = warp ? null : _chunkFRD3FUXIcjs.geometryHomography.call(void 0, g);
|
|
2868
|
+
const f = warp ? _chunkFRD3FUXIcjs.transformMap.call(void 0, g) : null;
|
|
2865
2869
|
const step = final ? 1 : previewStep(preview.scale);
|
|
2866
2870
|
const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
|
|
2867
2871
|
let layers = this.startLayers;
|
|
@@ -2878,7 +2882,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2878
2882
|
k = step;
|
|
2879
2883
|
let r = part.reduced.get(k);
|
|
2880
2884
|
if (!r) {
|
|
2881
|
-
r =
|
|
2885
|
+
r = _chunkT3QZ6S47cjs.reduceSurface.call(void 0, part.moving, k);
|
|
2882
2886
|
part.reduced.set(k, r);
|
|
2883
2887
|
}
|
|
2884
2888
|
src = r;
|
|
@@ -2887,33 +2891,33 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2887
2891
|
if (preview.clip && !final) opts.clip = { x: Math.floor(preview.clip.x - o.x), y: Math.floor(preview.clip.y - o.y), width: Math.ceil(preview.clip.width) + 1, height: Math.ceil(preview.clip.height) + 1 };
|
|
2888
2892
|
try {
|
|
2889
2893
|
if (f) {
|
|
2890
|
-
moved =
|
|
2894
|
+
moved = _chunkT3QZ6S47cjs.warpSurface.call(void 0, src, (p) => {
|
|
2891
2895
|
const q = f({ x: p.x * k + o.x, y: p.y * k + o.y });
|
|
2892
2896
|
return q && { x: q.x - o.x, y: q.y - o.y };
|
|
2893
2897
|
}, opts);
|
|
2894
2898
|
} else {
|
|
2895
2899
|
const hl = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, [k, 0, 0, 0, k, 0, 0, 0, 1], T(o.x, o.y)), h), T(-o.x, -o.y));
|
|
2896
|
-
moved =
|
|
2900
|
+
moved = _chunkT3QZ6S47cjs.transformSurface.call(void 0, src, hl, opts);
|
|
2897
2901
|
}
|
|
2898
2902
|
} catch (e) {
|
|
2899
|
-
if (e instanceof
|
|
2903
|
+
if (e instanceof _chunkT3QZ6S47cjs.TransformTooLargeError) fail(e.message);
|
|
2900
2904
|
throw e;
|
|
2901
2905
|
}
|
|
2902
2906
|
}
|
|
2903
|
-
const result = part.base ?
|
|
2907
|
+
const result = part.base ? _chunkT3QZ6S47cjs.compositeSurfaceOver.call(void 0, part.base, moved) : moved;
|
|
2904
2908
|
if (part.what === "selection") {
|
|
2905
2909
|
const { width, height } = this.host.canvas();
|
|
2906
|
-
const data = new Uint8Array(
|
|
2907
|
-
const next =
|
|
2910
|
+
const data = new Uint8Array(_chunkSZ6KMZNMcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
|
|
2911
|
+
const next = _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, width, height, data);
|
|
2908
2912
|
selection = next.bounds ? next : null;
|
|
2909
2913
|
} else if (part.what === "pixels") {
|
|
2910
|
-
layers =
|
|
2914
|
+
layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, targetId, (l) => {
|
|
2911
2915
|
const next = { ...l, surface: result };
|
|
2912
2916
|
delete next.source;
|
|
2913
2917
|
return next;
|
|
2914
2918
|
});
|
|
2915
2919
|
} else {
|
|
2916
|
-
layers =
|
|
2920
|
+
layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, targetId, (l) => ({ ...l, mask: { ...l.mask, surface: result } }));
|
|
2917
2921
|
}
|
|
2918
2922
|
}
|
|
2919
2923
|
return { layers, selection };
|
|
@@ -2926,25 +2930,25 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2926
2930
|
const canvas = this.host.canvas();
|
|
2927
2931
|
try {
|
|
2928
2932
|
if (final) {
|
|
2929
|
-
const res =
|
|
2933
|
+
const res = _chunkFRD3FUXIcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
|
|
2930
2934
|
this.smartMasksMoved = res.masksMoved;
|
|
2931
2935
|
return res.layers;
|
|
2932
2936
|
}
|
|
2933
2937
|
const step = previewStep(preview.scale);
|
|
2934
|
-
const surface =
|
|
2935
|
-
return
|
|
2938
|
+
const surface = _chunkFRD3FUXIcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
|
|
2939
|
+
return _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
|
|
2936
2940
|
} catch (e) {
|
|
2937
|
-
if (e instanceof
|
|
2941
|
+
if (e instanceof _chunkT3QZ6S47cjs.TransformTooLargeError) fail(e.message);
|
|
2938
2942
|
throw e;
|
|
2939
2943
|
}
|
|
2940
2944
|
}
|
|
2941
2945
|
/** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
|
|
2942
2946
|
isChanged() {
|
|
2943
2947
|
const g = this.geometryValue;
|
|
2944
|
-
if (!this.smart) return !
|
|
2948
|
+
if (!this.smart) return !_chunkFRD3FUXIcjs.isIdentityTransform.call(void 0, g);
|
|
2945
2949
|
const a = this.startGeometry;
|
|
2946
2950
|
const same = g.corners.every((c, i) => Math.abs(c.x - a.corners[i].x) < 1e-9 && Math.abs(c.y - a.corners[i].y) < 1e-9);
|
|
2947
|
-
const warp = (w, box) => w &&
|
|
2951
|
+
const warp = (w, box) => w && _chunkFRD3FUXIcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
|
|
2948
2952
|
return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
|
|
2949
2953
|
}
|
|
2950
2954
|
render(preview) {
|
|
@@ -2976,10 +2980,10 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2976
2980
|
result(changed, layers, selection) {
|
|
2977
2981
|
let bounds = null;
|
|
2978
2982
|
const id = _nullishCoalesce(this.copyId, () => ( this.layerId));
|
|
2979
|
-
const layer = id ? _optionalChain([
|
|
2980
|
-
if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _68 => _68.type]) === "pixel") bounds = toDoc(
|
|
2981
|
-
else if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _69 => _69.type]) === "smart") bounds =
|
|
2982
|
-
else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _70 => _70.mask])) bounds = toDoc(
|
|
2983
|
+
const layer = id ? _optionalChain([_chunkT3QZ6S47cjs.findLayer.call(void 0, layers, id), 'optionalAccess', _67 => _67.layer]) : void 0;
|
|
2984
|
+
if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _68 => _68.type]) === "pixel") bounds = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
|
|
2985
|
+
else if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _69 => _69.type]) === "smart") bounds = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, layer.surface);
|
|
2986
|
+
else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _70 => _70.mask])) bounds = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
|
|
2983
2987
|
else if (this.moves.includes("selection")) bounds = _optionalChain([selection, 'optionalAccess', _71 => _71.bounds]) ? { ...selection.bounds } : null;
|
|
2984
2988
|
return {
|
|
2985
2989
|
layerId: _nullishCoalesce(this.copyId, () => ( this.layerId)),
|
|
@@ -2994,26 +2998,26 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2994
2998
|
}, _class4);
|
|
2995
2999
|
|
|
2996
3000
|
// src/image-editor/controller.ts
|
|
2997
|
-
var IMAGE_EDITOR_SCHEMA_VERSION =
|
|
3001
|
+
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkFRD3FUXIcjs.LAYERED_SCHEMA_VERSION;
|
|
2998
3002
|
function paintCoverageInto(base, coverage, apply, rects) {
|
|
2999
3003
|
const tiles = new Map(base.tiles);
|
|
3000
3004
|
const done = /* @__PURE__ */ new Set();
|
|
3001
3005
|
for (const r of rects) {
|
|
3002
|
-
for (const t of
|
|
3003
|
-
const key =
|
|
3006
|
+
for (const t of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, { x: r.x - apply.offset.x, y: r.y - apply.offset.y, width: r.width, height: r.height })) {
|
|
3007
|
+
const key = _chunkSZ6KMZNMcjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3004
3008
|
if (done.has(key)) continue;
|
|
3005
3009
|
done.add(key);
|
|
3006
3010
|
const src = _nullishCoalesce(_optionalChain([base, 'access', _72 => _72.tiles, 'access', _73 => _73.get, 'call', _74 => _74(key), 'optionalAccess', _75 => _75.data]), () => ( defaultTile(base)));
|
|
3007
|
-
const data =
|
|
3008
|
-
const tile =
|
|
3011
|
+
const data = _chunkHUFQD4CBcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
|
|
3012
|
+
const tile = _chunkSZ6KMZNMcjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
|
|
3009
3013
|
if (tile) tiles.set(key, tile);
|
|
3010
3014
|
else tiles.delete(key);
|
|
3011
3015
|
}
|
|
3012
3016
|
}
|
|
3013
|
-
return new (0,
|
|
3017
|
+
return new (0, _chunkSZ6KMZNMcjs.TiledSurface)(base.channels, tiles, base.defaultValue);
|
|
3014
3018
|
}
|
|
3015
3019
|
function defaultTile(s) {
|
|
3016
|
-
const d = new Uint8ClampedArray(
|
|
3020
|
+
const d = new Uint8ClampedArray(_chunkSZ6KMZNMcjs.TILE * _chunkSZ6KMZNMcjs.TILE * s.channels);
|
|
3017
3021
|
if (s.defaultValue) d.fill(s.defaultValue);
|
|
3018
3022
|
return d;
|
|
3019
3023
|
}
|
|
@@ -3025,7 +3029,7 @@ var PaintStrokeSession = (_class5 = class {
|
|
|
3025
3029
|
this.before = controller._captureForStroke();
|
|
3026
3030
|
this.base = target.surface;
|
|
3027
3031
|
this.live = new Map(this.base.tiles);
|
|
3028
|
-
if (stroke instanceof
|
|
3032
|
+
if (stroke instanceof _chunkHUFQD4CBcjs.StrokeCoverage) {
|
|
3029
3033
|
this.stroke = stroke;
|
|
3030
3034
|
this.mixer = null;
|
|
3031
3035
|
} else {
|
|
@@ -3055,9 +3059,9 @@ var PaintStrokeSession = (_class5 = class {
|
|
|
3055
3059
|
offset: a.offset,
|
|
3056
3060
|
lockTransparency: a.lockTransparency,
|
|
3057
3061
|
selection: a.selection,
|
|
3058
|
-
readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _76 => _76.live, 'access', _77 => _77.get, 'call', _78 => _78(
|
|
3062
|
+
readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _76 => _76.live, 'access', _77 => _77.get, 'call', _78 => _78(_chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _79 => _79.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
|
|
3059
3063
|
writeTile: (tx, ty) => {
|
|
3060
|
-
const key =
|
|
3064
|
+
const key = _chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty);
|
|
3061
3065
|
if (!this.touched.has(key)) {
|
|
3062
3066
|
const src = _nullishCoalesce(_optionalChain([this, 'access', _80 => _80.base, 'access', _81 => _81.tiles, 'access', _82 => _82.get, 'call', _83 => _83(key), 'optionalAccess', _84 => _84.data]), () => ( defaultTile(this.base)));
|
|
3063
3067
|
this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
|
|
@@ -3083,30 +3087,30 @@ var PaintStrokeSession = (_class5 = class {
|
|
|
3083
3087
|
if (this.mixer) {
|
|
3084
3088
|
for (const key of this.fresh) this.live.set(key, { data: this.live.get(key).data, uniform: null });
|
|
3085
3089
|
this.fresh.clear();
|
|
3086
|
-
this.controller._strokeUpdate(this.target.id, this.target.channel, new (0,
|
|
3090
|
+
this.controller._strokeUpdate(this.target.id, this.target.channel, new (0, _chunkSZ6KMZNMcjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
|
|
3087
3091
|
return;
|
|
3088
3092
|
}
|
|
3089
3093
|
const stroke = this.stroke;
|
|
3090
3094
|
const regions = /* @__PURE__ */ new Map();
|
|
3091
3095
|
for (const r of rects) {
|
|
3092
|
-
for (const t of
|
|
3093
|
-
const key =
|
|
3096
|
+
for (const t of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
|
|
3097
|
+
const key = _chunkSZ6KMZNMcjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3094
3098
|
const cur = regions.get(key);
|
|
3095
|
-
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ?
|
|
3099
|
+
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkFRD3FUXIcjs.unionRect.call(void 0, cur.r, r) : r });
|
|
3096
3100
|
}
|
|
3097
3101
|
}
|
|
3098
3102
|
for (const [key, { tx, ty, r }] of regions) {
|
|
3099
3103
|
const src = _nullishCoalesce(_optionalChain([this, 'access', _85 => _85.base, 'access', _86 => _86.tiles, 'access', _87 => _87.get, 'call', _88 => _88(key), 'optionalAccess', _89 => _89.data]), () => ( defaultTile(this.base)));
|
|
3100
3104
|
const prev = this.touched.has(key) ? _optionalChain([this, 'access', _90 => _90.live, 'access', _91 => _91.get, 'call', _92 => _92(key), 'optionalAccess', _93 => _93.data]) : void 0;
|
|
3101
3105
|
this.touched.add(key);
|
|
3102
|
-
const data =
|
|
3106
|
+
const data = _chunkHUFQD4CBcjs.applyStrokeToTile.call(void 0, stroke.coverage, src, ch, tx, ty, this.apply, prev ? { into: prev, region: r } : {});
|
|
3103
3107
|
this.live.set(key, { data, uniform: null });
|
|
3104
3108
|
}
|
|
3105
|
-
this.controller._strokeUpdate(this.target.id, this.target.channel, new (0,
|
|
3109
|
+
this.controller._strokeUpdate(this.target.id, this.target.channel, new (0, _chunkSZ6KMZNMcjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
|
|
3106
3110
|
}
|
|
3107
3111
|
/** Finishes the stroke (one undo step) and returns what changed. */
|
|
3108
3112
|
end() {
|
|
3109
|
-
if (this.closed) throw new (0,
|
|
3113
|
+
if (this.closed) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("This stroke has already ended.");
|
|
3110
3114
|
const last = _nullishCoalesce(this.last, () => ( void 0));
|
|
3111
3115
|
this.update(this.mixer ? this.mixer.finish(last) : this.stroke.finish(last));
|
|
3112
3116
|
this.closed = true;
|
|
@@ -3115,13 +3119,13 @@ var PaintStrokeSession = (_class5 = class {
|
|
|
3115
3119
|
let changed = false;
|
|
3116
3120
|
for (const key of this.touched) {
|
|
3117
3121
|
const live = this.live.get(key);
|
|
3118
|
-
const tile =
|
|
3122
|
+
const tile = _chunkSZ6KMZNMcjs.finishTile.call(void 0, live.data, ch, this.base.defaultValue);
|
|
3119
3123
|
const prev = this.base.tiles.get(key);
|
|
3120
3124
|
if (tile) tiles.set(key, tile);
|
|
3121
3125
|
else tiles.delete(key);
|
|
3122
3126
|
if (!sameTile(prev, tile)) changed = true;
|
|
3123
3127
|
}
|
|
3124
|
-
const surface = changed ? new (0,
|
|
3128
|
+
const surface = changed ? new (0, _chunkSZ6KMZNMcjs.TiledSurface)(ch, tiles, this.base.defaultValue) : null;
|
|
3125
3129
|
const mixerLoad = this.mixer ? this.mixerInit.end(this.mixer.load) : void 0;
|
|
3126
3130
|
this.controller._strokeCommit(this.before, this.target.id, this.target.channel, surface);
|
|
3127
3131
|
const b = this.mixer ? this.mixer.bounds : this.stroke.coverage.bounds;
|
|
@@ -3143,20 +3147,20 @@ function sameTile(a, b) {
|
|
|
3143
3147
|
for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
|
|
3144
3148
|
return true;
|
|
3145
3149
|
}
|
|
3146
|
-
var DEFAULT_ADJUSTMENTS =
|
|
3150
|
+
var DEFAULT_ADJUSTMENTS = _chunkFRD3FUXIcjs.DEFAULT_ADJUSTMENTS_VALUES;
|
|
3147
3151
|
function normalizeStoredAdjustments(stored) {
|
|
3148
3152
|
if (!stored) return { ...DEFAULT_ADJUSTMENTS };
|
|
3149
3153
|
const out = {
|
|
3150
3154
|
...DEFAULT_ADJUSTMENTS,
|
|
3151
3155
|
...stored,
|
|
3152
|
-
process:
|
|
3156
|
+
process: _chunkFRD3FUXIcjs.normalizeProcessVersion.call(void 0, stored.process)
|
|
3153
3157
|
};
|
|
3154
|
-
const layers =
|
|
3158
|
+
const layers = _chunkFRD3FUXIcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
|
|
3155
3159
|
if (layers.length) out.layers = layers;
|
|
3156
3160
|
else delete out.layers;
|
|
3157
3161
|
return out;
|
|
3158
3162
|
}
|
|
3159
|
-
var isLayered = (data) => Boolean(data && data.version ===
|
|
3163
|
+
var isLayered = (data) => Boolean(data && data.version === _chunkFRD3FUXIcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
|
|
3160
3164
|
function migrateSerializedImageEditorState(data) {
|
|
3161
3165
|
if (isLayered(data)) {
|
|
3162
3166
|
const out = {
|
|
@@ -3189,9 +3193,9 @@ function migrateToLayeredState(data, size) {
|
|
|
3189
3193
|
const clean = migrateSerializedImageEditorState(data);
|
|
3190
3194
|
if (isLayered(clean)) return clean;
|
|
3191
3195
|
const stack = layersFromLegacy(clean, Math.round(size.width), Math.round(size.height));
|
|
3192
|
-
const { layers, assets } =
|
|
3196
|
+
const { layers, assets } = _chunkFRD3FUXIcjs.serializeLayers.call(void 0, stack.layers);
|
|
3193
3197
|
const out = {
|
|
3194
|
-
version:
|
|
3198
|
+
version: _chunkFRD3FUXIcjs.LAYERED_SCHEMA_VERSION,
|
|
3195
3199
|
width: Math.round(size.width),
|
|
3196
3200
|
height: Math.round(size.height),
|
|
3197
3201
|
layers,
|
|
@@ -3205,8 +3209,8 @@ function migrateToLayeredState(data, size) {
|
|
|
3205
3209
|
if (clean.selection) out.selection = clean.selection;
|
|
3206
3210
|
return out;
|
|
3207
3211
|
}
|
|
3208
|
-
var DEFAULT_TRANSFORM =
|
|
3209
|
-
var DEFAULT_DEPTH_MASK =
|
|
3212
|
+
var DEFAULT_TRANSFORM = _chunkFRD3FUXIcjs.DEFAULT_TRANSFORM_VALUES;
|
|
3213
|
+
var DEFAULT_DEPTH_MASK = _chunkFRD3FUXIcjs.DEFAULT_DEPTH_MASK_VALUES;
|
|
3210
3214
|
var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
|
|
3211
3215
|
var ImageEditorController = (_class6 = class {
|
|
3212
3216
|
|
|
@@ -3229,7 +3233,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3229
3233
|
__init44() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
|
|
3230
3234
|
__init45() {this.viewKey = []}
|
|
3231
3235
|
/** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
|
|
3232
|
-
__init46() {this.compositor = new (0,
|
|
3236
|
+
__init46() {this.compositor = new (0, _chunkFRD3FUXIcjs.LayerCompositor)()}
|
|
3233
3237
|
constructor(options = {}) {;_class6.prototype.__init36.call(this);_class6.prototype.__init37.call(this);_class6.prototype.__init38.call(this);_class6.prototype.__init39.call(this);_class6.prototype.__init40.call(this);_class6.prototype.__init41.call(this);_class6.prototype.__init42.call(this);_class6.prototype.__init43.call(this);_class6.prototype.__init44.call(this);_class6.prototype.__init45.call(this);_class6.prototype.__init46.call(this);_class6.prototype.__init47.call(this);_class6.prototype.__init48.call(this);_class6.prototype.__init49.call(this);_class6.prototype.__init50.call(this);_class6.prototype.__init51.call(this);_class6.prototype.__init52.call(this);_class6.prototype.__init53.call(this);_class6.prototype.__init54.call(this);_class6.prototype.__init55.call(this);_class6.prototype.__init56.call(this);_class6.prototype.__init57.call(this);
|
|
3234
3238
|
this.maxHistoryDepth = _nullishCoalesce(options.maxHistoryDepth, () => ( 50));
|
|
3235
3239
|
this.maxHistoryBytes = _nullishCoalesce(options.maxHistoryBytes, () => ( 512 * 1024 * 1024));
|
|
@@ -3264,7 +3268,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3264
3268
|
activeLayerId: null,
|
|
3265
3269
|
activeTarget: "pixels",
|
|
3266
3270
|
outputOpacity: 1,
|
|
3267
|
-
paint: { brush: { ...
|
|
3271
|
+
paint: { brush: { ..._chunkHUFQD4CBcjs.DEFAULT_BRUSH }, foreground: "#000000", background: "#ffffff", mixer: { ..._chunkHUFQD4CBcjs.DEFAULT_MIXER }, mixerLoad: _chunkHUFQD4CBcjs.EMPTY_MIXER_LOAD },
|
|
3268
3272
|
fit: _nullishCoalesce(options.fit, () => ( "margin"))
|
|
3269
3273
|
};
|
|
3270
3274
|
if (options.image instanceof Object && "width" in options.image) {
|
|
@@ -3278,7 +3282,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3278
3282
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
3279
3283
|
if (_optionalChain([options, 'access', _102 => _102.initialState, 'optionalAccess', _103 => _103.selection])) {
|
|
3280
3284
|
try {
|
|
3281
|
-
this.state.selection = normalizeSelection(
|
|
3285
|
+
this.state.selection = normalizeSelection(_chunkFRD3FUXIcjs.deserializeSelection.call(void 0, options.initialState.selection));
|
|
3282
3286
|
} catch (e12) {
|
|
3283
3287
|
}
|
|
3284
3288
|
}
|
|
@@ -3515,7 +3519,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3515
3519
|
applyCropPreset(ratio) {
|
|
3516
3520
|
this.recordHistory();
|
|
3517
3521
|
const { width, height } = this.state.imageDimensions;
|
|
3518
|
-
if (ratio &&
|
|
3522
|
+
if (ratio && _chunkFRD3FUXIcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
|
|
3519
3523
|
ratio = 1 / ratio;
|
|
3520
3524
|
}
|
|
3521
3525
|
if (!ratio) {
|
|
@@ -3571,7 +3575,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3571
3575
|
return this.state.layers;
|
|
3572
3576
|
}
|
|
3573
3577
|
getLayer(id) {
|
|
3574
|
-
return _optionalChain([
|
|
3578
|
+
return _optionalChain([_chunkT3QZ6S47cjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _106 => _106.layer]);
|
|
3575
3579
|
}
|
|
3576
3580
|
/** The active layer, or `undefined`. */
|
|
3577
3581
|
getActiveLayer() {
|
|
@@ -3599,9 +3603,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
3599
3603
|
const layer = this.getLayer(id);
|
|
3600
3604
|
if (!layer || layer.type !== "pixel" && layer.type !== "smart") return null;
|
|
3601
3605
|
const surface = this.surfaceOf(layer);
|
|
3602
|
-
const b =
|
|
3606
|
+
const b = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, surface);
|
|
3603
3607
|
if (!b) return null;
|
|
3604
|
-
return { x: b.x + layer.offset.x, y: b.y + layer.offset.y, width: b.width, height: b.height, data:
|
|
3608
|
+
return { x: b.x + layer.offset.x, y: b.y + layer.offset.y, width: b.width, height: b.height, data: _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, b) };
|
|
3605
3609
|
}
|
|
3606
3610
|
__init48() {this.boundsCache = /* @__PURE__ */ new WeakMap()}
|
|
3607
3611
|
/**
|
|
@@ -3614,7 +3618,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3614
3618
|
const surface = this.surfaceOf(layer);
|
|
3615
3619
|
let b = this.boundsCache.get(surface);
|
|
3616
3620
|
if (b === void 0) {
|
|
3617
|
-
b =
|
|
3621
|
+
b = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, surface);
|
|
3618
3622
|
this.boundsCache.set(surface, b);
|
|
3619
3623
|
}
|
|
3620
3624
|
return b ? { x: b.x + layer.offset.x, y: b.y + layer.offset.y, width: b.width, height: b.height } : null;
|
|
@@ -3627,7 +3631,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3627
3631
|
const layer = this.getLayer(id);
|
|
3628
3632
|
if (!layer || layer.type !== "pixel" && layer.type !== "smart") return null;
|
|
3629
3633
|
const surface = this.surfaceOf(layer);
|
|
3630
|
-
const enc =
|
|
3634
|
+
const enc = _chunkFRD3FUXIcjs.encodeSurface.call(void 0, surface);
|
|
3631
3635
|
return enc ? enc.url : null;
|
|
3632
3636
|
}
|
|
3633
3637
|
/**
|
|
@@ -3641,7 +3645,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3641
3645
|
let layers = this.state.layers;
|
|
3642
3646
|
if (options.layerIds) {
|
|
3643
3647
|
const keep = new Set(options.layerIds);
|
|
3644
|
-
layers =
|
|
3648
|
+
layers = _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers).filter((l) => keep.has(l.id) && l.type !== "group");
|
|
3645
3649
|
}
|
|
3646
3650
|
const data = this.compositor.composite(layers, r, this.compositorSources());
|
|
3647
3651
|
return { width: r.width, height: r.height, data };
|
|
@@ -3684,7 +3688,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3684
3688
|
const fromPixels = (px3) => {
|
|
3685
3689
|
let s = this.sourceSurfaces.get(px3);
|
|
3686
3690
|
if (!s) {
|
|
3687
|
-
s =
|
|
3691
|
+
s = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, px3, 4);
|
|
3688
3692
|
this.sourceSurfaces.set(px3, s);
|
|
3689
3693
|
}
|
|
3690
3694
|
return s;
|
|
@@ -3699,7 +3703,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3699
3703
|
const decoded = this.decodeSource();
|
|
3700
3704
|
if (decoded) {
|
|
3701
3705
|
if (!this.samplePixelsOverride) this.samplePixels = decoded;
|
|
3702
|
-
const s =
|
|
3706
|
+
const s = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, decoded, 4);
|
|
3703
3707
|
this.sourceSurfaces.set(el, s);
|
|
3704
3708
|
this.sourceSurfaces.set(decoded, s);
|
|
3705
3709
|
return s;
|
|
@@ -3743,7 +3747,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3743
3747
|
if (commitToHistory) this.recordHistory();
|
|
3744
3748
|
this.state.layers = next;
|
|
3745
3749
|
_optionalChain([extra, 'optionalCall', _116 => _116()]);
|
|
3746
|
-
if (this.state.activeLayerId && !
|
|
3750
|
+
if (this.state.activeLayerId && !_chunkT3QZ6S47cjs.findLayer.call(void 0, next, this.state.activeLayerId)) {
|
|
3747
3751
|
this.state.activeLayerId = null;
|
|
3748
3752
|
this.state.activeTarget = "pixels";
|
|
3749
3753
|
}
|
|
@@ -3752,7 +3756,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3752
3756
|
/** The default position of a new layer: above the active layer, else the top of the stack. */
|
|
3753
3757
|
newLayerPlacement(placement) {
|
|
3754
3758
|
if (placement.aboveId || placement.belowId || placement.parentId || placement.index !== void 0) return placement;
|
|
3755
|
-
const active = this.state.activeLayerId ?
|
|
3759
|
+
const active = this.state.activeLayerId ? _chunkT3QZ6S47cjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId) : null;
|
|
3756
3760
|
return active ? { aboveId: active.layer.id } : {};
|
|
3757
3761
|
}
|
|
3758
3762
|
/**
|
|
@@ -3762,23 +3766,23 @@ var ImageEditorController = (_class6 = class {
|
|
|
3762
3766
|
*/
|
|
3763
3767
|
addPixelLayer(init = {}) {
|
|
3764
3768
|
const { width, height } = this.naturalSize;
|
|
3765
|
-
let surface =
|
|
3769
|
+
let surface = _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4);
|
|
3766
3770
|
if (init.pixels) {
|
|
3767
3771
|
const px2 = init.pixels;
|
|
3768
3772
|
if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
|
|
3769
|
-
throw new (0,
|
|
3773
|
+
throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
|
|
3770
3774
|
}
|
|
3771
|
-
surface =
|
|
3775
|
+
surface = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, px2, 4);
|
|
3772
3776
|
} else if (init.color !== void 0) {
|
|
3773
3777
|
const c = parseColor(init.color);
|
|
3774
|
-
surface =
|
|
3778
|
+
surface = _chunkSZ6KMZNMcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkSZ6KMZNMcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
|
|
3775
3779
|
}
|
|
3776
|
-
const blend =
|
|
3777
|
-
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
3778
|
-
const ids = new Set(
|
|
3780
|
+
const blend = _chunkFRD3FUXIcjs.parseBlend.call(void 0, init.blend);
|
|
3781
|
+
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
3782
|
+
const ids = new Set(_chunkT3QZ6S47cjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
3779
3783
|
const layer = {
|
|
3780
3784
|
type: "pixel",
|
|
3781
|
-
id: init.id && !ids.has(init.id) ? init.id :
|
|
3785
|
+
id: init.id && !ids.has(init.id) ? init.id : _chunkFRD3FUXIcjs.newLayerId.call(void 0, ),
|
|
3782
3786
|
name: _optionalChain([init, 'access', _117 => _117.name, 'optionalAccess', _118 => _118.trim, 'call', _119 => _119()]) || this.nextLayerName(),
|
|
3783
3787
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
3784
3788
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
@@ -3787,7 +3791,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3787
3791
|
offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
|
|
3788
3792
|
};
|
|
3789
3793
|
if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
|
|
3790
|
-
const next =
|
|
3794
|
+
const next = _chunkFRD3FUXIcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
3791
3795
|
this.commitLayers(next, () => {
|
|
3792
3796
|
this.state.activeLayerId = layer.id;
|
|
3793
3797
|
this.state.activeTarget = "pixels";
|
|
@@ -3806,46 +3810,46 @@ var ImageEditorController = (_class6 = class {
|
|
|
3806
3810
|
async decodeImage(image) {
|
|
3807
3811
|
const trimmed = image.trim();
|
|
3808
3812
|
let png = null;
|
|
3809
|
-
if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([
|
|
3813
|
+
if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkT3QZ6S47cjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _120 => _120.bytes]), () => ( null));
|
|
3810
3814
|
else if (/^[A-Za-z0-9+/=\s]+$/.test(trimmed) && trimmed.length > 16) {
|
|
3811
3815
|
try {
|
|
3812
|
-
const bytes =
|
|
3813
|
-
if (
|
|
3816
|
+
const bytes = _chunkT3QZ6S47cjs.base64ToBytes.call(void 0, trimmed);
|
|
3817
|
+
if (_chunkT3QZ6S47cjs.isPng.call(void 0, bytes)) png = bytes;
|
|
3814
3818
|
} catch (e15) {
|
|
3815
3819
|
png = null;
|
|
3816
3820
|
}
|
|
3817
3821
|
}
|
|
3818
3822
|
if (png) {
|
|
3819
3823
|
try {
|
|
3820
|
-
const d =
|
|
3824
|
+
const d = _chunkT3QZ6S47cjs.decodePng.call(void 0, png);
|
|
3821
3825
|
return { width: d.width, height: d.height, data: d.data };
|
|
3822
3826
|
} catch (e16) {
|
|
3823
3827
|
}
|
|
3824
3828
|
}
|
|
3825
|
-
const src = png ? `data:image/png;base64,${
|
|
3829
|
+
const src = png ? `data:image/png;base64,${_chunkT3QZ6S47cjs.bytesToBase64.call(void 0, png)}` : trimmed;
|
|
3826
3830
|
let img;
|
|
3827
3831
|
try {
|
|
3828
3832
|
img = await this.renderer.imageCache.get(src);
|
|
3829
3833
|
} catch (e17) {
|
|
3830
|
-
throw new (0,
|
|
3834
|
+
throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("The image could not be decoded here. Pass a PNG (data URL or base64), or run in a browser for other formats and URLs.");
|
|
3831
3835
|
}
|
|
3832
3836
|
const w = img.naturalWidth || img.width;
|
|
3833
3837
|
const h = img.naturalHeight || img.height;
|
|
3834
3838
|
const ctx = this.renderer.createCanvas(w, h).getContext("2d");
|
|
3835
|
-
if (!ctx || typeof ctx.getImageData !== "function") throw new (0,
|
|
3839
|
+
if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
|
|
3836
3840
|
ctx.drawImage(img, 0, 0, w, h);
|
|
3837
3841
|
const data = ctx.getImageData(0, 0, w, h);
|
|
3838
3842
|
return { width: w, height: h, data: data.data };
|
|
3839
3843
|
}
|
|
3840
3844
|
nextLayerName() {
|
|
3841
|
-
const names = new Set(
|
|
3845
|
+
const names = new Set(_chunkT3QZ6S47cjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.name));
|
|
3842
3846
|
let n = 1;
|
|
3843
3847
|
while (names.has(`Layer ${n}`)) n++;
|
|
3844
3848
|
return `Layer ${n}`;
|
|
3845
3849
|
}
|
|
3846
3850
|
/** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
|
|
3847
3851
|
duplicateLayer(id, name) {
|
|
3848
|
-
const res =
|
|
3852
|
+
const res = _chunkFRD3FUXIcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
|
|
3849
3853
|
this.commitLayers(res.layers, () => {
|
|
3850
3854
|
this.state.activeLayerId = res.id;
|
|
3851
3855
|
});
|
|
@@ -3853,17 +3857,17 @@ var ImageEditorController = (_class6 = class {
|
|
|
3853
3857
|
}
|
|
3854
3858
|
/** Deletes a layer (refused when locked), as one undo step. */
|
|
3855
3859
|
removeLayer(id) {
|
|
3856
|
-
const next =
|
|
3860
|
+
const next = _chunkFRD3FUXIcjs.removeLayer.call(void 0, this.state.layers, id);
|
|
3857
3861
|
this.commitLayers(next, () => {
|
|
3858
|
-
if (this.state.selectedAnnotationId && !
|
|
3862
|
+
if (this.state.selectedAnnotationId && !_chunkT3QZ6S47cjs.flattenLayers.call(void 0, next).some((l) => l.type === "annotation" && l.annotation.id === this.state.selectedAnnotationId)) {
|
|
3859
3863
|
this.state.selectedAnnotationId = null;
|
|
3860
3864
|
}
|
|
3861
3865
|
});
|
|
3862
3866
|
}
|
|
3863
3867
|
/** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
|
|
3864
3868
|
moveLayer(id, placement) {
|
|
3865
|
-
const next =
|
|
3866
|
-
const loc =
|
|
3869
|
+
const next = _chunkFRD3FUXIcjs.moveLayer.call(void 0, this.state.layers, id, placement);
|
|
3870
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, next, id);
|
|
3867
3871
|
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _121 => _121.parent, 'optionalAccess', _122 => _122.id]), () => ( null)), index: loc.index };
|
|
3868
3872
|
this.commitLayers(next);
|
|
3869
3873
|
return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _123 => _123.parent, 'optionalAccess', _124 => _124.id]), () => ( null)), index: loc.index };
|
|
@@ -3873,23 +3877,23 @@ var ImageEditorController = (_class6 = class {
|
|
|
3873
3877
|
* one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
|
|
3874
3878
|
*/
|
|
3875
3879
|
setLayerProperties(id, props, commitToHistory = true) {
|
|
3876
|
-
const next =
|
|
3880
|
+
const next = _chunkFRD3FUXIcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
|
|
3877
3881
|
this.commitLayers(next, void 0, commitToHistory);
|
|
3878
|
-
return
|
|
3882
|
+
return _chunkT3QZ6S47cjs.findLayer.call(void 0, next, id).layer;
|
|
3879
3883
|
}
|
|
3880
3884
|
/** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
|
|
3881
3885
|
addGroup(init = {}) {
|
|
3882
|
-
const blend = init.blend === void 0 ? "pass-through" :
|
|
3886
|
+
const blend = init.blend === void 0 ? "pass-through" : _chunkFRD3FUXIcjs.parseBlend.call(void 0, init.blend, true);
|
|
3883
3887
|
const group = {
|
|
3884
3888
|
type: "group",
|
|
3885
|
-
id:
|
|
3889
|
+
id: _chunkFRD3FUXIcjs.newLayerId.call(void 0, "group"),
|
|
3886
3890
|
name: _optionalChain([init, 'access', _125 => _125.name, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]) || "Group",
|
|
3887
3891
|
visible: true,
|
|
3888
3892
|
opacity: 1,
|
|
3889
3893
|
blend,
|
|
3890
3894
|
children: []
|
|
3891
3895
|
};
|
|
3892
|
-
const next =
|
|
3896
|
+
const next = _chunkFRD3FUXIcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
|
|
3893
3897
|
this.commitLayers(next, () => {
|
|
3894
3898
|
this.state.activeLayerId = group.id;
|
|
3895
3899
|
this.state.activeTarget = "pixels";
|
|
@@ -3898,7 +3902,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3898
3902
|
}
|
|
3899
3903
|
/** Puts sibling layers into a new group (one undo step). Returns the group id. */
|
|
3900
3904
|
groupLayers(ids, name) {
|
|
3901
|
-
const res =
|
|
3905
|
+
const res = _chunkFRD3FUXIcjs.groupLayers.call(void 0, this.state.layers, ids, name);
|
|
3902
3906
|
this.commitLayers(res.layers, () => {
|
|
3903
3907
|
this.state.activeLayerId = res.id;
|
|
3904
3908
|
});
|
|
@@ -3906,7 +3910,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3906
3910
|
}
|
|
3907
3911
|
/** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
|
|
3908
3912
|
ungroupLayer(id) {
|
|
3909
|
-
const res =
|
|
3913
|
+
const res = _chunkFRD3FUXIcjs.ungroupLayer.call(void 0, this.state.layers, id);
|
|
3910
3914
|
this.commitLayers(res.layers);
|
|
3911
3915
|
return res.ids;
|
|
3912
3916
|
}
|
|
@@ -3915,20 +3919,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
3915
3919
|
* (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
|
|
3916
3920
|
*/
|
|
3917
3921
|
offsetLayer(id, move, commitToHistory = true) {
|
|
3918
|
-
const layer =
|
|
3922
|
+
const layer = _chunkFRD3FUXIcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
3919
3923
|
if (layer.type === "smart") {
|
|
3920
3924
|
const tl = layer.placement.corners[0];
|
|
3921
3925
|
const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
3922
3926
|
const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
3923
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
3924
|
-
this.commitLayers(
|
|
3925
|
-
const moved =
|
|
3927
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("x and y must be numbers.");
|
|
3928
|
+
this.commitLayers(_chunkFRD3FUXIcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
|
|
3929
|
+
const moved = _chunkT3QZ6S47cjs.findLayer.call(void 0, this.state.layers, id).layer;
|
|
3926
3930
|
return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
|
|
3927
3931
|
}
|
|
3928
3932
|
const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
3929
3933
|
const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
|
|
3930
3934
|
const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
|
|
3931
|
-
const next =
|
|
3935
|
+
const next = _chunkFRD3FUXIcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
|
|
3932
3936
|
this.commitLayers(next, void 0, commitToHistory);
|
|
3933
3937
|
return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
|
|
3934
3938
|
}
|
|
@@ -3938,20 +3942,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
3938
3942
|
* target when the layer is active.
|
|
3939
3943
|
*/
|
|
3940
3944
|
addLayerMask(id, from = "reveal-all", props = {}) {
|
|
3941
|
-
const layer =
|
|
3945
|
+
const layer = _chunkFRD3FUXIcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
3942
3946
|
let mask;
|
|
3943
3947
|
if (from === "selection") {
|
|
3944
3948
|
const sel = this.state.selection;
|
|
3945
|
-
if (!_optionalChain([sel, 'optionalAccess', _128 => _128.bounds])) throw new (0,
|
|
3949
|
+
if (!_optionalChain([sel, 'optionalAccess', _128 => _128.bounds])) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
3946
3950
|
mask = this.maskFromSelection(sel, props);
|
|
3947
3951
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
3948
|
-
mask = { ...mask, surface:
|
|
3952
|
+
mask = { ...mask, surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
3949
3953
|
}
|
|
3950
3954
|
} else {
|
|
3951
3955
|
const v = from === "reveal-all" ? 255 : 0;
|
|
3952
|
-
mask = withMaskProps({ surface:
|
|
3956
|
+
mask = withMaskProps({ surface: _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
3953
3957
|
}
|
|
3954
|
-
const next =
|
|
3958
|
+
const next = _chunkFRD3FUXIcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
|
|
3955
3959
|
this.commitLayers(next, () => {
|
|
3956
3960
|
if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
|
|
3957
3961
|
});
|
|
@@ -3959,18 +3963,18 @@ var ImageEditorController = (_class6 = class {
|
|
|
3959
3963
|
}
|
|
3960
3964
|
/** Removes a layer's mask (one undo step). */
|
|
3961
3965
|
removeLayerMask(id) {
|
|
3962
|
-
const layer =
|
|
3963
|
-
if (!layer.mask) throw new (0,
|
|
3964
|
-
this.commitLayers(
|
|
3966
|
+
const layer = _chunkFRD3FUXIcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
3967
|
+
if (!layer.mask) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
3968
|
+
this.commitLayers(_chunkFRD3FUXIcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
|
|
3965
3969
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
3966
3970
|
});
|
|
3967
3971
|
}
|
|
3968
3972
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
3969
3973
|
setLayerMaskProps(id, props, commitToHistory = true) {
|
|
3970
|
-
const layer =
|
|
3971
|
-
if (!layer.mask) throw new (0,
|
|
3974
|
+
const layer = _chunkFRD3FUXIcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
3975
|
+
if (!layer.mask) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
3972
3976
|
const mask = withMaskProps(layer.mask, props);
|
|
3973
|
-
this.commitLayers(
|
|
3977
|
+
this.commitLayers(_chunkFRD3FUXIcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
|
|
3974
3978
|
return mask;
|
|
3975
3979
|
}
|
|
3976
3980
|
/**
|
|
@@ -3978,11 +3982,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
3978
3982
|
* the depth map) and removes the mask, as one undo step.
|
|
3979
3983
|
*/
|
|
3980
3984
|
async applyLayerMask(id) {
|
|
3981
|
-
const loc =
|
|
3985
|
+
const loc = _chunkFRD3FUXIcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
3982
3986
|
const layer = loc.layer;
|
|
3983
|
-
if (layer.type !== "pixel") throw new (0,
|
|
3984
|
-
if (!layer.mask) throw new (0,
|
|
3985
|
-
|
|
3987
|
+
if (layer.type !== "pixel") throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
|
|
3988
|
+
if (!layer.mask) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
3989
|
+
_chunkFRD3FUXIcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
|
|
3986
3990
|
const { width, height } = this.naturalSize;
|
|
3987
3991
|
await this.renderer.prepareLayerAssets([layer], width, height);
|
|
3988
3992
|
const sources = this.renderer.compositorSources(width, height);
|
|
@@ -3990,11 +3994,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
3990
3994
|
let out = surface;
|
|
3991
3995
|
const b = surface.bounds;
|
|
3992
3996
|
if (b) {
|
|
3993
|
-
const draft = new (0,
|
|
3994
|
-
for (const t of
|
|
3997
|
+
const draft = new (0, _chunkSZ6KMZNMcjs.SurfaceDraft)(surface);
|
|
3998
|
+
for (const t of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, b)) {
|
|
3995
3999
|
const data = draft.peek(t.tx, t.ty);
|
|
3996
4000
|
if (!data) continue;
|
|
3997
|
-
const r = { x: t.tx *
|
|
4001
|
+
const r = { x: t.tx * _chunkSZ6KMZNMcjs.TILE + layer.offset.x, y: t.ty * _chunkSZ6KMZNMcjs.TILE + layer.offset.y, width: _chunkSZ6KMZNMcjs.TILE, height: _chunkSZ6KMZNMcjs.TILE };
|
|
3998
4002
|
const cov = this.compositor.maskCoverage(layer, r, sources);
|
|
3999
4003
|
if (!cov) continue;
|
|
4000
4004
|
const d = draft.tile(t.tx, t.ty);
|
|
@@ -4005,7 +4009,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4005
4009
|
const next = { ...layer, surface: out };
|
|
4006
4010
|
delete next.mask;
|
|
4007
4011
|
delete next.source;
|
|
4008
|
-
this.commitLayers(
|
|
4012
|
+
this.commitLayers(_chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, id, () => next), () => {
|
|
4009
4013
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
4010
4014
|
});
|
|
4011
4015
|
}
|
|
@@ -4015,17 +4019,17 @@ var ImageEditorController = (_class6 = class {
|
|
|
4015
4019
|
*/
|
|
4016
4020
|
layerViaCopy(options = {}) {
|
|
4017
4021
|
const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
|
|
4018
|
-
if (!id) throw new (0,
|
|
4019
|
-
const loc =
|
|
4022
|
+
if (!id) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
|
|
4023
|
+
const loc = _chunkFRD3FUXIcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
4020
4024
|
const layer = loc.layer;
|
|
4021
|
-
if (layer.type !== "pixel") throw new (0,
|
|
4025
|
+
if (layer.type !== "pixel") throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
|
|
4022
4026
|
const sel = this.state.selection;
|
|
4023
|
-
if (!_optionalChain([sel, 'optionalAccess', _129 => _129.bounds])) throw new (0,
|
|
4024
|
-
if (options.cut)
|
|
4027
|
+
if (!_optionalChain([sel, 'optionalAccess', _129 => _129.bounds])) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
|
|
4028
|
+
if (options.cut) _chunkFRD3FUXIcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
|
|
4025
4029
|
const surface = this.surfaceOf(layer);
|
|
4026
4030
|
const sb = sel.bounds;
|
|
4027
4031
|
const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
|
|
4028
|
-
const px2 =
|
|
4032
|
+
const px2 = _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, src);
|
|
4029
4033
|
const kept = options.cut ? new Uint8ClampedArray(px2) : null;
|
|
4030
4034
|
for (let y = 0; y < sb.height; y++) {
|
|
4031
4035
|
for (let x = 0; x < sb.width; x++) {
|
|
@@ -4037,19 +4041,19 @@ var ImageEditorController = (_class6 = class {
|
|
|
4037
4041
|
}
|
|
4038
4042
|
const copy = {
|
|
4039
4043
|
type: "pixel",
|
|
4040
|
-
id:
|
|
4044
|
+
id: _chunkFRD3FUXIcjs.newLayerId.call(void 0, ),
|
|
4041
4045
|
name: _optionalChain([options, 'access', _130 => _130.name, 'optionalAccess', _131 => _131.trim, 'call', _132 => _132()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
4042
4046
|
visible: true,
|
|
4043
4047
|
opacity: 1,
|
|
4044
4048
|
blend: "normal",
|
|
4045
|
-
surface:
|
|
4049
|
+
surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
|
|
4046
4050
|
offset: { ...layer.offset }
|
|
4047
4051
|
};
|
|
4048
|
-
let next =
|
|
4052
|
+
let next = _chunkT3QZ6S47cjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _133 => _133.parent, 'optionalAccess', _134 => _134.id]), () => ( null)), loc.index + 1);
|
|
4049
4053
|
if (kept) {
|
|
4050
|
-
const cutLayer = { ...layer, surface:
|
|
4054
|
+
const cutLayer = { ...layer, surface: _chunkSZ6KMZNMcjs.writeRegion.call(void 0, surface, src, kept) };
|
|
4051
4055
|
delete cutLayer.source;
|
|
4052
|
-
next =
|
|
4056
|
+
next = _chunkT3QZ6S47cjs.mapLayer.call(void 0, next, id, () => cutLayer);
|
|
4053
4057
|
}
|
|
4054
4058
|
this.commitLayers(next, () => {
|
|
4055
4059
|
this.state.activeLayerId = copy.id;
|
|
@@ -4108,7 +4112,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4108
4112
|
* Refused while another transform is open.
|
|
4109
4113
|
*/
|
|
4110
4114
|
beginFreeTransform(init = {}) {
|
|
4111
|
-
if (this.getFreeTransform()) throw new (0,
|
|
4115
|
+
if (this.getFreeTransform()) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
|
|
4112
4116
|
const session = new FreeTransformSession(this.transformHost(), init);
|
|
4113
4117
|
this.openTransform = session;
|
|
4114
4118
|
this.notify();
|
|
@@ -4122,26 +4126,26 @@ var ImageEditorController = (_class6 = class {
|
|
|
4122
4126
|
*/
|
|
4123
4127
|
transformLayer(spec) {
|
|
4124
4128
|
const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
|
|
4125
|
-
if (given > 1) throw new (0,
|
|
4126
|
-
if (!given && spec.warp === void 0) throw new (0,
|
|
4129
|
+
if (given > 1) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give only one of matrix, corners and params.");
|
|
4130
|
+
if (!given && spec.warp === void 0) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
|
|
4127
4131
|
if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
|
|
4128
|
-
throw new (0,
|
|
4132
|
+
throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
|
|
4129
4133
|
}
|
|
4130
4134
|
if (spec.matrix) {
|
|
4131
4135
|
const [a, b, c, d] = spec.matrix;
|
|
4132
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
4136
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
|
|
4133
4137
|
}
|
|
4134
4138
|
const session = this.beginFreeTransform(spec);
|
|
4135
4139
|
try {
|
|
4136
4140
|
const g = session.startGeometry;
|
|
4137
|
-
const corners = spec.matrix ? g.corners.map((p) => _chunkDWGZUSEScjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ?
|
|
4141
|
+
const corners = spec.matrix ? g.corners.map((p) => _chunkDWGZUSEScjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkFRD3FUXIcjs.applyParams.call(void 0, g, spec.params) : g.corners;
|
|
4138
4142
|
let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
|
|
4139
4143
|
if (spec.warp) {
|
|
4140
4144
|
if ("style" in spec.warp) {
|
|
4141
|
-
if (!_chunkDWGZUSEScjs.WARP_STYLES.includes(spec.warp.style)) throw new (0,
|
|
4142
|
-
warp =
|
|
4145
|
+
if (!_chunkDWGZUSEScjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkDWGZUSEScjs.WARP_STYLES.join(", ")}.`);
|
|
4146
|
+
warp = _chunkFRD3FUXIcjs.presetWarp.call(void 0, session.box, spec.warp);
|
|
4143
4147
|
} else {
|
|
4144
|
-
if (!
|
|
4148
|
+
if (!_chunkFRD3FUXIcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
|
|
4145
4149
|
warp = spec.warp;
|
|
4146
4150
|
}
|
|
4147
4151
|
}
|
|
@@ -4154,10 +4158,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4154
4158
|
}
|
|
4155
4159
|
/** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
|
|
4156
4160
|
flipLayer(axis, init = {}) {
|
|
4157
|
-
if (axis !== "horizontal" && axis !== "vertical") throw new (0,
|
|
4161
|
+
if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
|
|
4158
4162
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
4159
4163
|
try {
|
|
4160
|
-
session.update({ corners:
|
|
4164
|
+
session.update({ corners: _chunkFRD3FUXIcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
|
|
4161
4165
|
return session.commit();
|
|
4162
4166
|
} catch (e) {
|
|
4163
4167
|
session.cancel();
|
|
@@ -4169,10 +4173,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4169
4173
|
* centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
|
|
4170
4174
|
*/
|
|
4171
4175
|
rotateLayer90(turn, init = {}) {
|
|
4172
|
-
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0,
|
|
4176
|
+
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
|
|
4173
4177
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
4174
4178
|
try {
|
|
4175
|
-
const b = session.smartObject ? _nullishCoalesce(
|
|
4179
|
+
const b = session.smartObject ? _nullishCoalesce(_chunkFRD3FUXIcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
|
|
4176
4180
|
const cx = b.x + b.width / 2;
|
|
4177
4181
|
const cy = b.y + b.height / 2;
|
|
4178
4182
|
const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
|
|
@@ -4187,22 +4191,22 @@ var ImageEditorController = (_class6 = class {
|
|
|
4187
4191
|
}
|
|
4188
4192
|
/** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
|
|
4189
4193
|
addLayerFilter(id, filter) {
|
|
4190
|
-
const f =
|
|
4191
|
-
const next =
|
|
4194
|
+
const f = _chunkFRD3FUXIcjs.normalizeFilter.call(void 0, filter);
|
|
4195
|
+
const next = _chunkFRD3FUXIcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
|
|
4192
4196
|
this.commitLayers(next);
|
|
4193
|
-
return _nullishCoalesce(
|
|
4197
|
+
return _nullishCoalesce(_chunkT3QZ6S47cjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
4194
4198
|
}
|
|
4195
4199
|
/** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
|
|
4196
4200
|
updateLayerFilter(id, filterId, changes, commitToHistory = true) {
|
|
4197
|
-
const next =
|
|
4201
|
+
const next = _chunkFRD3FUXIcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
|
|
4198
4202
|
this.commitLayers(next, void 0, commitToHistory);
|
|
4199
|
-
return _nullishCoalesce(
|
|
4203
|
+
return _nullishCoalesce(_chunkT3QZ6S47cjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
4200
4204
|
}
|
|
4201
4205
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
4202
4206
|
removeLayerFilter(id, filterId) {
|
|
4203
|
-
const next =
|
|
4207
|
+
const next = _chunkFRD3FUXIcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
|
|
4204
4208
|
this.commitLayers(next);
|
|
4205
|
-
return _nullishCoalesce(
|
|
4209
|
+
return _nullishCoalesce(_chunkT3QZ6S47cjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
4206
4210
|
}
|
|
4207
4211
|
// --- Smart objects ---
|
|
4208
4212
|
get canvasSize() {
|
|
@@ -4216,8 +4220,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
4216
4220
|
*/
|
|
4217
4221
|
convertToSmartObject(ids, options = {}) {
|
|
4218
4222
|
const list = _optionalChain([ids, 'optionalAccess', _138 => _138.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
|
|
4219
|
-
if (!list.length) throw new (0,
|
|
4220
|
-
const res =
|
|
4223
|
+
if (!list.length) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
|
|
4224
|
+
const res = _chunkFRD3FUXIcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
|
|
4221
4225
|
this.commitLayers(res.layers, () => {
|
|
4222
4226
|
this.state.activeLayerId = res.layer.id;
|
|
4223
4227
|
this.state.activeTarget = "pixels";
|
|
@@ -4226,7 +4230,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4226
4230
|
}
|
|
4227
4231
|
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
4228
4232
|
rasterizeSmartObject(id) {
|
|
4229
|
-
const res =
|
|
4233
|
+
const res = _chunkFRD3FUXIcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
|
|
4230
4234
|
this.commitLayers(res.layers, () => {
|
|
4231
4235
|
if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
4232
4236
|
});
|
|
@@ -4234,10 +4238,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4234
4238
|
}
|
|
4235
4239
|
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
4236
4240
|
getSmartObject(id) {
|
|
4237
|
-
const layer =
|
|
4241
|
+
const layer = _chunkFRD3FUXIcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4238
4242
|
const c = layer.contents;
|
|
4239
|
-
const g =
|
|
4240
|
-
const readout =
|
|
4243
|
+
const g = _chunkFRD3FUXIcjs.placementGeometry.call(void 0, layer);
|
|
4244
|
+
const readout = _chunkFRD3FUXIcjs.describeTransform.call(void 0, g);
|
|
4241
4245
|
const stack = layer.smartFilters;
|
|
4242
4246
|
return {
|
|
4243
4247
|
layerId: layer.id,
|
|
@@ -4247,11 +4251,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
4247
4251
|
kind: c.kind,
|
|
4248
4252
|
width: c.width,
|
|
4249
4253
|
height: c.height,
|
|
4250
|
-
decoded:
|
|
4254
|
+
decoded: _chunkFRD3FUXIcjs.isContentsDecoded.call(void 0, c),
|
|
4251
4255
|
fileType: _nullishCoalesce(_optionalChain([c, 'access', _139 => _139.file, 'optionalAccess', _140 => _140.type]), () => ( null)),
|
|
4252
4256
|
linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _141 => _141.linked, 'optionalAccess', _142 => _142.path]), () => ( null)),
|
|
4253
|
-
instances:
|
|
4254
|
-
layerCount: c.document ?
|
|
4257
|
+
instances: _chunkFRD3FUXIcjs.instancesOf.call(void 0, this.state.layers, c.id),
|
|
4258
|
+
layerCount: c.document ? _chunkT3QZ6S47cjs.flattenLayers.call(void 0, c.document.layers).length : 0
|
|
4255
4259
|
},
|
|
4256
4260
|
placement: {
|
|
4257
4261
|
corners: g.corners.map((p) => ({ x: p.x, y: p.y })),
|
|
@@ -4262,13 +4266,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
4262
4266
|
scaleY: readout.scaleY,
|
|
4263
4267
|
rotate: readout.rotate,
|
|
4264
4268
|
skewX: readout.skewX,
|
|
4265
|
-
center:
|
|
4266
|
-
bounds:
|
|
4269
|
+
center: _chunkFRD3FUXIcjs.anchorPoint.call(void 0, g, "center"),
|
|
4270
|
+
bounds: _chunkFRD3FUXIcjs.transformedBox.call(void 0, g)
|
|
4267
4271
|
},
|
|
4268
4272
|
smartFilters: {
|
|
4269
4273
|
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _143 => _143.enabled]), () => ( true)),
|
|
4270
4274
|
filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _144 => _144.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
|
|
4271
|
-
mask: _optionalChain([stack, 'optionalAccess', _145 => _145.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds:
|
|
4275
|
+
mask: _optionalChain([stack, 'optionalAccess', _145 => _145.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunkSZ6KMZNMcjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
|
|
4272
4276
|
},
|
|
4273
4277
|
bounds: this.getLayerBounds(id)
|
|
4274
4278
|
};
|
|
@@ -4280,7 +4284,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4280
4284
|
* change. Returns the new placement summary.
|
|
4281
4285
|
*/
|
|
4282
4286
|
setSmartObjectPlacement(id, placement, commitToHistory = true) {
|
|
4283
|
-
const res =
|
|
4287
|
+
const res = _chunkFRD3FUXIcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
|
|
4284
4288
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4285
4289
|
return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
|
|
4286
4290
|
}
|
|
@@ -4293,23 +4297,23 @@ var ImageEditorController = (_class6 = class {
|
|
|
4293
4297
|
* nothing is relative to the current transform.
|
|
4294
4298
|
*/
|
|
4295
4299
|
setSmartObjectTransform(id, spec) {
|
|
4296
|
-
const layer =
|
|
4297
|
-
const g =
|
|
4300
|
+
const layer = _chunkFRD3FUXIcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4301
|
+
const g = _chunkFRD3FUXIcjs.placementGeometry.call(void 0, layer);
|
|
4298
4302
|
const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
|
|
4299
4303
|
const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
|
|
4300
|
-
if (ways > 1) throw new (0,
|
|
4304
|
+
if (ways > 1) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
|
|
4301
4305
|
let corners = g.corners;
|
|
4302
4306
|
if (spec.corners) corners = spec.corners;
|
|
4303
4307
|
else if (spec.matrix) {
|
|
4304
|
-
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0,
|
|
4308
|
+
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
|
|
4305
4309
|
const [a, b, c, d] = spec.matrix;
|
|
4306
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
4307
|
-
corners =
|
|
4310
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
|
|
4311
|
+
corners = _chunkFRD3FUXIcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
|
|
4308
4312
|
} else if (numeric.length) {
|
|
4309
|
-
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0,
|
|
4310
|
-
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0,
|
|
4311
|
-
const now =
|
|
4312
|
-
const centre =
|
|
4313
|
+
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
|
|
4314
|
+
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`${k} must be a finite number.`);
|
|
4315
|
+
const now = _chunkFRD3FUXIcjs.describeTransform.call(void 0, g);
|
|
4316
|
+
const centre = _chunkFRD3FUXIcjs.anchorPoint.call(void 0, g, "center");
|
|
4313
4317
|
const params = {
|
|
4314
4318
|
scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
|
|
4315
4319
|
scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
|
|
@@ -4317,20 +4321,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
4317
4321
|
skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
|
|
4318
4322
|
skewY: _nullishCoalesce(spec.skewY, () => ( 0))
|
|
4319
4323
|
};
|
|
4320
|
-
const m =
|
|
4324
|
+
const m = _chunkFRD3FUXIcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
|
|
4321
4325
|
const cx = g.box.width / 2;
|
|
4322
4326
|
const cy = g.box.height / 2;
|
|
4323
4327
|
const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
|
|
4324
|
-
corners =
|
|
4328
|
+
corners = _chunkFRD3FUXIcjs.cornersFromMatrix.call(void 0, g.box, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, m, _chunkDWGZUSEScjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
|
|
4325
4329
|
}
|
|
4326
4330
|
let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
|
|
4327
4331
|
if (spec.warp === null) warp = null;
|
|
4328
4332
|
else if (spec.warp) {
|
|
4329
4333
|
if ("style" in spec.warp) {
|
|
4330
|
-
if (!_chunkDWGZUSEScjs.WARP_STYLES.includes(spec.warp.style)) throw new (0,
|
|
4331
|
-
warp =
|
|
4334
|
+
if (!_chunkDWGZUSEScjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkDWGZUSEScjs.WARP_STYLES.join(", ")}.`);
|
|
4335
|
+
warp = _chunkFRD3FUXIcjs.presetWarp.call(void 0, g.box, spec.warp);
|
|
4332
4336
|
} else {
|
|
4333
|
-
if (!
|
|
4337
|
+
if (!_chunkFRD3FUXIcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
|
|
4334
4338
|
warp = spec.warp;
|
|
4335
4339
|
}
|
|
4336
4340
|
}
|
|
@@ -4344,16 +4348,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
4344
4348
|
* the layers that changed.
|
|
4345
4349
|
*/
|
|
4346
4350
|
replaceSmartObjectContents(id, source) {
|
|
4347
|
-
const layer =
|
|
4351
|
+
const layer = _chunkFRD3FUXIcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4348
4352
|
let contents;
|
|
4349
4353
|
if ("contents" in source) contents = source.contents;
|
|
4350
|
-
else if ("pixels" in source) contents =
|
|
4354
|
+
else if ("pixels" in source) contents = _chunkFRD3FUXIcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
|
|
4351
4355
|
else {
|
|
4352
|
-
const psd =
|
|
4353
|
-
contents =
|
|
4356
|
+
const psd = _chunkFRD3FUXIcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkFRD3FUXIcjs.newLayerId.call(void 0, ) });
|
|
4357
|
+
contents = _chunkFRD3FUXIcjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
|
|
4354
4358
|
contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
|
|
4355
4359
|
}
|
|
4356
|
-
const res =
|
|
4360
|
+
const res = _chunkFRD3FUXIcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
|
|
4357
4361
|
this.commitLayers(res.layers);
|
|
4358
4362
|
return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
|
|
4359
4363
|
}
|
|
@@ -4368,16 +4372,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
4368
4372
|
* and bytes.
|
|
4369
4373
|
*/
|
|
4370
4374
|
exportSmartObjectContents(id) {
|
|
4371
|
-
const layer =
|
|
4375
|
+
const layer = _chunkFRD3FUXIcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4372
4376
|
const c = layer.contents;
|
|
4373
4377
|
const base = c.name.replace(/\.\w+$/, "") || "Contents";
|
|
4374
4378
|
if (c.file) {
|
|
4375
|
-
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ...
|
|
4379
|
+
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkFRD3FUXIcjs.BROWSER_IMAGE_TYPES };
|
|
4376
4380
|
const ext = c.file.type.toLowerCase();
|
|
4377
4381
|
return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
|
|
4378
4382
|
}
|
|
4379
|
-
if (!
|
|
4380
|
-
const f =
|
|
4383
|
+
if (!_chunkFRD3FUXIcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
|
|
4384
|
+
const f = _chunkFRD3FUXIcjs.smartContentsFile.call(void 0, c);
|
|
4381
4385
|
return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
|
|
4382
4386
|
}
|
|
4383
4387
|
/**
|
|
@@ -4386,7 +4390,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4386
4390
|
* undo step. Returns the copy's id.
|
|
4387
4391
|
*/
|
|
4388
4392
|
copySmartObject(id, linked = false, name) {
|
|
4389
|
-
const res =
|
|
4393
|
+
const res = _chunkFRD3FUXIcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
|
|
4390
4394
|
this.commitLayers(res.layers, () => {
|
|
4391
4395
|
this.state.activeLayerId = res.layer.id;
|
|
4392
4396
|
this.state.activeTarget = "pixels";
|
|
@@ -4395,31 +4399,31 @@ var ImageEditorController = (_class6 = class {
|
|
|
4395
4399
|
}
|
|
4396
4400
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
4397
4401
|
addSmartFilter(id, filter, index) {
|
|
4398
|
-
const res =
|
|
4402
|
+
const res = _chunkFRD3FUXIcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkFRD3FUXIcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
|
|
4399
4403
|
this.commitLayers(res.layers);
|
|
4400
4404
|
return res.filter;
|
|
4401
4405
|
}
|
|
4402
4406
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
4403
4407
|
updateSmartFilter(id, filterId, changes, commitToHistory = true) {
|
|
4404
|
-
const res =
|
|
4408
|
+
const res = _chunkFRD3FUXIcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
|
|
4405
4409
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4406
4410
|
return res.filter;
|
|
4407
4411
|
}
|
|
4408
4412
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
4409
4413
|
removeSmartFilter(id, filterId) {
|
|
4410
|
-
const res =
|
|
4414
|
+
const res = _chunkFRD3FUXIcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
|
|
4411
4415
|
this.commitLayers(res.layers);
|
|
4412
4416
|
return _nullishCoalesce(_optionalChain([res, 'access', _146 => _146.layer, 'access', _147 => _147.smartFilters, 'optionalAccess', _148 => _148.filters]), () => ( []));
|
|
4413
4417
|
}
|
|
4414
4418
|
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
4415
4419
|
moveSmartFilter(id, filterId, index) {
|
|
4416
|
-
const res =
|
|
4420
|
+
const res = _chunkFRD3FUXIcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
|
|
4417
4421
|
this.commitLayers(res.layers);
|
|
4418
4422
|
return _nullishCoalesce(_optionalChain([res, 'access', _149 => _149.layer, 'access', _150 => _150.smartFilters, 'optionalAccess', _151 => _151.filters]), () => ( []));
|
|
4419
4423
|
}
|
|
4420
4424
|
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
4421
4425
|
setSmartFiltersEnabled(id, enabled) {
|
|
4422
|
-
const res =
|
|
4426
|
+
const res = _chunkFRD3FUXIcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
|
|
4423
4427
|
this.commitLayers(res.layers);
|
|
4424
4428
|
return _nullishCoalesce(_optionalChain([res, 'access', _152 => _152.layer, 'access', _153 => _153.smartFilters, 'optionalAccess', _154 => _154.enabled]), () => ( true));
|
|
4425
4429
|
}
|
|
@@ -4429,21 +4433,21 @@ var ImageEditorController = (_class6 = class {
|
|
|
4429
4433
|
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
4430
4434
|
*/
|
|
4431
4435
|
setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
|
|
4432
|
-
const layer =
|
|
4436
|
+
const layer = _chunkFRD3FUXIcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4433
4437
|
let mask;
|
|
4434
4438
|
if (from === "none") mask = null;
|
|
4435
4439
|
else if (from === "keep") {
|
|
4436
|
-
if (!_optionalChain([layer, 'access', _155 => _155.smartFilters, 'optionalAccess', _156 => _156.mask])) throw new (0,
|
|
4440
|
+
if (!_optionalChain([layer, 'access', _155 => _155.smartFilters, 'optionalAccess', _156 => _156.mask])) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
|
|
4437
4441
|
mask = withMaskProps(layer.smartFilters.mask, props);
|
|
4438
4442
|
} else if (from === "selection") {
|
|
4439
4443
|
const sel = this.state.selection;
|
|
4440
|
-
if (!_optionalChain([sel, 'optionalAccess', _157 => _157.bounds])) throw new (0,
|
|
4444
|
+
if (!_optionalChain([sel, 'optionalAccess', _157 => _157.bounds])) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
4441
4445
|
mask = this.maskFromSelection(sel, props);
|
|
4442
4446
|
} else {
|
|
4443
4447
|
const v = from === "reveal-all" ? 255 : 0;
|
|
4444
|
-
mask = withMaskProps({ surface:
|
|
4448
|
+
mask = withMaskProps({ surface: _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
4445
4449
|
}
|
|
4446
|
-
const res =
|
|
4450
|
+
const res = _chunkFRD3FUXIcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
|
|
4447
4451
|
this.commitLayers(res.layers, () => {
|
|
4448
4452
|
if (this.state.activeLayerId !== id) return;
|
|
4449
4453
|
if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
|
|
@@ -4458,18 +4462,18 @@ var ImageEditorController = (_class6 = class {
|
|
|
4458
4462
|
*/
|
|
4459
4463
|
async prepareSmartObjects() {
|
|
4460
4464
|
const pending = /* @__PURE__ */ new Map();
|
|
4461
|
-
for (const l of
|
|
4462
|
-
if (l.type === "smart" && !
|
|
4465
|
+
for (const l of _chunkT3QZ6S47cjs.flattenLayers.call(void 0, this.state.layers)) {
|
|
4466
|
+
if (l.type === "smart" && !_chunkFRD3FUXIcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkFRD3FUXIcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
|
|
4463
4467
|
}
|
|
4464
4468
|
const left = [];
|
|
4465
4469
|
for (const [cid, c] of pending) {
|
|
4466
4470
|
try {
|
|
4467
|
-
const url = `data:${
|
|
4471
|
+
const url = `data:${_chunkFRD3FUXIcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkT3QZ6S47cjs.bytesToBase64.call(void 0, c.file.bytes)}`;
|
|
4468
4472
|
const px2 = await this.decodeImage(url);
|
|
4469
|
-
const decoded = { ...c, kind: "raster", raster:
|
|
4473
|
+
const decoded = { ...c, kind: "raster", raster: _chunkFRD3FUXIcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
|
|
4470
4474
|
const swap = (layers) => {
|
|
4471
4475
|
let out = layers;
|
|
4472
|
-
for (const l of
|
|
4476
|
+
for (const l of _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkT3QZ6S47cjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
|
|
4473
4477
|
return out;
|
|
4474
4478
|
};
|
|
4475
4479
|
this.state.layers = swap(this.state.layers);
|
|
@@ -4494,10 +4498,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4494
4498
|
* Contents can nest. Returns the contents' size and layer ids.
|
|
4495
4499
|
*/
|
|
4496
4500
|
editSmartObjectContents(id) {
|
|
4497
|
-
if (this.getFreeTransform()) throw new (0,
|
|
4498
|
-
const layer =
|
|
4501
|
+
if (this.getFreeTransform()) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
|
|
4502
|
+
const layer = _chunkFRD3FUXIcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4499
4503
|
const c = layer.contents;
|
|
4500
|
-
if (!
|
|
4504
|
+
if (!_chunkFRD3FUXIcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _161 => _161.file, 'optionalAccess', _162 => _162.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
|
|
4501
4505
|
const saved = {
|
|
4502
4506
|
state: { ...this.state },
|
|
4503
4507
|
undo: this.undoStack,
|
|
@@ -4508,7 +4512,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4508
4512
|
samplePixelsOverride: this.samplePixelsOverride,
|
|
4509
4513
|
psdResolution: this.psdResolution
|
|
4510
4514
|
};
|
|
4511
|
-
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id:
|
|
4515
|
+
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkFRD3FUXIcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
|
|
4512
4516
|
this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
|
|
4513
4517
|
const s = this.state;
|
|
4514
4518
|
this.state = {
|
|
@@ -4516,7 +4520,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4516
4520
|
sourceUrl: null,
|
|
4517
4521
|
imageDimensions: { width: c.width, height: c.height },
|
|
4518
4522
|
crop: null,
|
|
4519
|
-
transform: { ...
|
|
4523
|
+
transform: { ..._chunkFRD3FUXIcjs.DEFAULT_TRANSFORM_VALUES },
|
|
4520
4524
|
layers,
|
|
4521
4525
|
activeLayerId: layers.length ? layers[layers.length - 1].id : null,
|
|
4522
4526
|
activeTarget: "pixels",
|
|
@@ -4540,7 +4544,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4540
4544
|
this.viewKey = [];
|
|
4541
4545
|
this.initialSnapshot = this.captureHistoryEntry();
|
|
4542
4546
|
this.notify();
|
|
4543
|
-
return { layerId: layer.id, depth: this.contentsStack.length, width: c.width, height: c.height, layerIds:
|
|
4547
|
+
return { layerId: layer.id, depth: this.contentsStack.length, width: c.width, height: c.height, layerIds: _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers).map((l) => l.id) };
|
|
4544
4548
|
}
|
|
4545
4549
|
/**
|
|
4546
4550
|
* Closes the innermost open contents: with `save` (default) the edited layers become the smart
|
|
@@ -4549,24 +4553,24 @@ var ImageEditorController = (_class6 = class {
|
|
|
4549
4553
|
*/
|
|
4550
4554
|
closeSmartObjectContents(save = true) {
|
|
4551
4555
|
const top = this.contentsStack.pop();
|
|
4552
|
-
if (!top) throw new (0,
|
|
4556
|
+
if (!top) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
|
|
4553
4557
|
if (_optionalChain([this, 'access', _168 => _168.openTransform, 'optionalAccess', _169 => _169.isOpen])) this.openTransform.cancel();
|
|
4554
4558
|
this.openTransform = null;
|
|
4555
4559
|
const edited = this.state;
|
|
4556
4560
|
const changed = save && this.undoStack.length > 0;
|
|
4557
4561
|
let next = null;
|
|
4558
4562
|
if (changed) {
|
|
4559
|
-
const layer = _optionalChain([
|
|
4563
|
+
const layer = _optionalChain([_chunkT3QZ6S47cjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _170 => _170.layer]);
|
|
4560
4564
|
const old = _optionalChain([layer, 'optionalAccess', _171 => _171.contents]);
|
|
4561
4565
|
const { width, height } = edited.imageDimensions;
|
|
4562
4566
|
const only = edited.layers.length === 1 ? edited.layers[0] : null;
|
|
4563
4567
|
const plain3 = _optionalChain([only, 'optionalAccess', _172 => _172.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _173 => _173.filters, 'optionalAccess', _174 => _174.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
|
|
4564
4568
|
if (_optionalChain([old, 'optionalAccess', _175 => _175.kind]) === "raster" && plain3) {
|
|
4565
|
-
const px2 =
|
|
4566
|
-
next =
|
|
4569
|
+
const px2 = _chunkSZ6KMZNMcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
|
|
4570
|
+
next = _chunkFRD3FUXIcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
|
|
4567
4571
|
} else {
|
|
4568
4572
|
const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
|
|
4569
|
-
next =
|
|
4573
|
+
next = _chunkFRD3FUXIcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _176 => _176.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _177 => _177.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
|
|
4570
4574
|
}
|
|
4571
4575
|
}
|
|
4572
4576
|
const saved = top.saved;
|
|
@@ -4585,7 +4589,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4585
4589
|
this.notify();
|
|
4586
4590
|
return { layerId: top.layerId, changed: false, layerIds: [] };
|
|
4587
4591
|
}
|
|
4588
|
-
const res =
|
|
4592
|
+
const res = _chunkFRD3FUXIcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
|
|
4589
4593
|
this.commitLayers(res.layers);
|
|
4590
4594
|
return { layerId: top.layerId, changed: true, layerIds: res.ids };
|
|
4591
4595
|
}
|
|
@@ -4600,35 +4604,35 @@ var ImageEditorController = (_class6 = class {
|
|
|
4600
4604
|
// --- Layer effects ---
|
|
4601
4605
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
4602
4606
|
getLayerEffects(id) {
|
|
4603
|
-
return
|
|
4607
|
+
return _chunkFRD3FUXIcjs.layerEffectsOf.call(void 0, _chunkFRD3FUXIcjs.requireLayer.call(void 0, this.state.layers, id).layer);
|
|
4604
4608
|
}
|
|
4605
4609
|
/**
|
|
4606
4610
|
* Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
|
|
4607
4611
|
* `index` in the layer's effect list (default the end). Returns the new effect and the effects.
|
|
4608
4612
|
*/
|
|
4609
4613
|
addLayerEffect(id, kind, params = {}, index) {
|
|
4610
|
-
const res =
|
|
4614
|
+
const res = _chunkFRD3FUXIcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
|
|
4611
4615
|
this.commitLayers(res.layers);
|
|
4612
4616
|
return { effect: res.effect, effects: this.getLayerEffects(id) };
|
|
4613
4617
|
}
|
|
4614
4618
|
/** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
|
|
4615
4619
|
updateLayerEffect(id, effectId, changes, commitToHistory = true) {
|
|
4616
|
-
this.commitLayers(
|
|
4620
|
+
this.commitLayers(_chunkFRD3FUXIcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
|
|
4617
4621
|
return this.getLayerEffects(id);
|
|
4618
4622
|
}
|
|
4619
4623
|
/** Removes one effect (one undo step). Returns the remaining effects. */
|
|
4620
4624
|
removeLayerEffect(id, effectId) {
|
|
4621
|
-
this.commitLayers(
|
|
4625
|
+
this.commitLayers(_chunkFRD3FUXIcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
|
|
4622
4626
|
return this.getLayerEffects(id);
|
|
4623
4627
|
}
|
|
4624
4628
|
/** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
|
|
4625
4629
|
setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
|
|
4626
|
-
this.commitLayers(
|
|
4630
|
+
this.commitLayers(_chunkFRD3FUXIcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
|
|
4627
4631
|
return this.getLayerEffects(id);
|
|
4628
4632
|
}
|
|
4629
4633
|
/** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
|
|
4630
4634
|
setLayerEffects(id, effects, commitToHistory = true) {
|
|
4631
|
-
this.commitLayers(
|
|
4635
|
+
this.commitLayers(_chunkFRD3FUXIcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
|
|
4632
4636
|
return this.getLayerEffects(id);
|
|
4633
4637
|
}
|
|
4634
4638
|
__init54() {this.patternIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -4649,15 +4653,15 @@ var ImageEditorController = (_class6 = class {
|
|
|
4649
4653
|
}
|
|
4650
4654
|
/** The light effects with "use global light" follow. */
|
|
4651
4655
|
getGlobalLight() {
|
|
4652
|
-
return { ..._nullishCoalesce(this.state.globalLight, () => (
|
|
4656
|
+
return { ..._nullishCoalesce(this.state.globalLight, () => ( _chunkT3QZ6S47cjs.DEFAULT_GLOBAL_LIGHT)) };
|
|
4653
4657
|
}
|
|
4654
4658
|
/** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
|
|
4655
4659
|
setGlobalLight(light, commitToHistory = true) {
|
|
4656
4660
|
const next = { ...this.getGlobalLight(), ...light };
|
|
4657
|
-
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0,
|
|
4658
|
-
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0,
|
|
4661
|
+
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
|
|
4662
|
+
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
|
|
4659
4663
|
if (commitToHistory) this.recordHistory();
|
|
4660
|
-
if (next.angle ===
|
|
4664
|
+
if (next.angle === _chunkT3QZ6S47cjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkT3QZ6S47cjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
|
|
4661
4665
|
else this.state.globalLight = next;
|
|
4662
4666
|
this.notify();
|
|
4663
4667
|
return this.getGlobalLight();
|
|
@@ -4665,12 +4669,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
4665
4669
|
/** Composites `layers` (in isolation) over `rect` into a surface, loading depth maps first. */
|
|
4666
4670
|
async compositeToSurface(layers, rect) {
|
|
4667
4671
|
const { width, height } = this.naturalSize;
|
|
4668
|
-
if (
|
|
4669
|
-
throw new (0,
|
|
4672
|
+
if (_chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
|
|
4673
|
+
throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
|
|
4670
4674
|
}
|
|
4671
4675
|
await this.renderer.prepareLayerAssets(layers, width, height);
|
|
4672
|
-
const data = new (0,
|
|
4673
|
-
return
|
|
4676
|
+
const data = new (0, _chunkFRD3FUXIcjs.LayerCompositor)().composite(layers, rect, this.renderer.compositorSources(width, height));
|
|
4677
|
+
return _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
|
|
4674
4678
|
}
|
|
4675
4679
|
/** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
|
|
4676
4680
|
paintBounds(layer) {
|
|
@@ -4678,13 +4682,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
4678
4682
|
const canvas = { x: 0, y: 0, width, height };
|
|
4679
4683
|
if (layer.type === "pixel") return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
4680
4684
|
if (layer.type === "annotation") {
|
|
4681
|
-
const b =
|
|
4685
|
+
const b = _chunkFRD3FUXIcjs.getAnnotationBounds.call(void 0, layer.annotation);
|
|
4682
4686
|
const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
|
|
4683
4687
|
return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
|
|
4684
4688
|
}
|
|
4685
4689
|
if (layer.type === "group") {
|
|
4686
4690
|
let r = null;
|
|
4687
|
-
for (const c of layer.children) r =
|
|
4691
|
+
for (const c of layer.children) r = _chunkFRD3FUXIcjs.unionRect.call(void 0, r, this.paintBounds(c));
|
|
4688
4692
|
return _nullishCoalesce(r, () => ( canvas));
|
|
4689
4693
|
}
|
|
4690
4694
|
return canvas;
|
|
@@ -4695,17 +4699,17 @@ var ImageEditorController = (_class6 = class {
|
|
|
4695
4699
|
* Returns the merged id.
|
|
4696
4700
|
*/
|
|
4697
4701
|
async mergeDown(id) {
|
|
4698
|
-
const loc =
|
|
4702
|
+
const loc = _chunkFRD3FUXIcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
4699
4703
|
const upper = loc.layer;
|
|
4700
4704
|
const siblings = loc.parent ? loc.parent.children : this.state.layers;
|
|
4701
4705
|
const lower = siblings[loc.index - 1];
|
|
4702
|
-
if (!lower) throw new (0,
|
|
4703
|
-
if (lower.type !== "pixel") throw new (0,
|
|
4704
|
-
if (!upper.visible) throw new (0,
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
let rect = _nullishCoalesce(
|
|
4708
|
-
const reach = Math.max(
|
|
4706
|
+
if (!lower) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
|
|
4707
|
+
if (lower.type !== "pixel") throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
|
|
4708
|
+
if (!upper.visible) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
|
|
4709
|
+
_chunkFRD3FUXIcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
|
|
4710
|
+
_chunkFRD3FUXIcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
|
|
4711
|
+
let rect = _nullishCoalesce(_chunkFRD3FUXIcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
|
|
4712
|
+
const reach = Math.max(_chunkT3QZ6S47cjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkT3QZ6S47cjs.effectsMargin.call(void 0, upper.effects));
|
|
4709
4713
|
if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
|
|
4710
4714
|
const base = { ...lower, blend: "normal", opacity: 1 };
|
|
4711
4715
|
delete base.clipped;
|
|
@@ -4716,8 +4720,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
4716
4720
|
delete merged.filters;
|
|
4717
4721
|
delete merged.source;
|
|
4718
4722
|
delete merged.effects;
|
|
4719
|
-
let next =
|
|
4720
|
-
next =
|
|
4723
|
+
let next = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, id, () => null);
|
|
4724
|
+
next = _chunkT3QZ6S47cjs.mapLayer.call(void 0, next, lower.id, () => merged);
|
|
4721
4725
|
this.commitLayers(next, () => {
|
|
4722
4726
|
this.state.activeLayerId = merged.id;
|
|
4723
4727
|
this.state.activeTarget = "pixels";
|
|
@@ -4730,12 +4734,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
4730
4734
|
*/
|
|
4731
4735
|
async mergeVisible() {
|
|
4732
4736
|
const visible = this.state.layers.filter((l) => l.visible);
|
|
4733
|
-
if (!visible.length) throw new (0,
|
|
4737
|
+
if (!visible.length) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("No layer is visible.");
|
|
4734
4738
|
const { width, height } = this.naturalSize;
|
|
4735
4739
|
const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
|
|
4736
4740
|
const merged = {
|
|
4737
4741
|
type: "pixel",
|
|
4738
|
-
id:
|
|
4742
|
+
id: _chunkFRD3FUXIcjs.newLayerId.call(void 0, ),
|
|
4739
4743
|
name: "Merged",
|
|
4740
4744
|
visible: true,
|
|
4741
4745
|
opacity: 1,
|
|
@@ -4800,7 +4804,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4800
4804
|
const dy = Math.min(height - 1, Math.floor((y + 0.5) * height / th)) - oy;
|
|
4801
4805
|
for (let x = 0; x < tw; x++) {
|
|
4802
4806
|
const dx = Math.min(width - 1, Math.floor((x + 0.5) * width / tw)) - ox;
|
|
4803
|
-
const v =
|
|
4807
|
+
const v = _chunkSZ6KMZNMcjs.readPixel.call(void 0, surface, dx, dy);
|
|
4804
4808
|
const i = (y * tw + x) * 4;
|
|
4805
4809
|
if (surface.channels === 1) {
|
|
4806
4810
|
out[i] = out[i + 1] = out[i + 2] = v[0];
|
|
@@ -4823,17 +4827,17 @@ var ImageEditorController = (_class6 = class {
|
|
|
4823
4827
|
getLayerThumbnailDataURL(id, options = {}) {
|
|
4824
4828
|
const thumb = this.getLayerThumbnail(id, options);
|
|
4825
4829
|
if (!thumb) return null;
|
|
4826
|
-
return
|
|
4830
|
+
return _chunkT3QZ6S47cjs.pngDataUrl.call(void 0, thumb.width, thumb.height, thumb.data, 4);
|
|
4827
4831
|
}
|
|
4828
4832
|
// --- Painting ---
|
|
4829
4833
|
/** Brush settings, colours and tool options of the paint tools (view state, no undo). */
|
|
4830
4834
|
setPaintOptions(options) {
|
|
4831
4835
|
const cur = this.state.paint;
|
|
4832
4836
|
const next = {
|
|
4833
|
-
brush: options.brush ?
|
|
4837
|
+
brush: options.brush ? _chunkHUFQD4CBcjs.normalizeBrush.call(void 0, { ...cur.brush, ...options.brush }) : cur.brush,
|
|
4834
4838
|
foreground: options.foreground !== void 0 ? toHex(parseColor(options.foreground)) : cur.foreground,
|
|
4835
4839
|
background: options.background !== void 0 ? toHex(parseColor(options.background)) : cur.background,
|
|
4836
|
-
mixer: options.mixer ?
|
|
4840
|
+
mixer: options.mixer ? _chunkHUFQD4CBcjs.normalizeMixer.call(void 0, { ...cur.mixer, ...options.mixer }) : cur.mixer,
|
|
4837
4841
|
mixerLoad: cur.mixerLoad
|
|
4838
4842
|
};
|
|
4839
4843
|
this.state.paint = next;
|
|
@@ -4846,23 +4850,23 @@ var ImageEditorController = (_class6 = class {
|
|
|
4846
4850
|
*/
|
|
4847
4851
|
loadMixerBrush(color) {
|
|
4848
4852
|
const c = parseColor(_nullishCoalesce(color, () => ( this.state.paint.foreground)));
|
|
4849
|
-
const load =
|
|
4853
|
+
const load = _chunkHUFQD4CBcjs.loadMixer.call(void 0, this.state.paint.mixerLoad, [c[0] / 255, c[1] / 255, c[2] / 255]);
|
|
4850
4854
|
this.state.paint = { ...this.state.paint, mixerLoad: load };
|
|
4851
4855
|
this.notify();
|
|
4852
4856
|
return load;
|
|
4853
4857
|
}
|
|
4854
4858
|
/** Cleans the Mixer Brush: empties the pickup well (the reservoir is kept). Returns the brush load. */
|
|
4855
4859
|
cleanMixerBrush() {
|
|
4856
|
-
const load =
|
|
4860
|
+
const load = _chunkHUFQD4CBcjs.cleanMixer.call(void 0, this.state.paint.mixerLoad);
|
|
4857
4861
|
this.state.paint = { ...this.state.paint, mixerLoad: load };
|
|
4858
4862
|
this.notify();
|
|
4859
4863
|
return load;
|
|
4860
4864
|
}
|
|
4861
4865
|
/** Empties the Mixer Brush entirely (no reservoir, nothing picked up). Returns the brush load. */
|
|
4862
4866
|
emptyMixerBrush() {
|
|
4863
|
-
this.state.paint = { ...this.state.paint, mixerLoad:
|
|
4867
|
+
this.state.paint = { ...this.state.paint, mixerLoad: _chunkHUFQD4CBcjs.EMPTY_MIXER_LOAD };
|
|
4864
4868
|
this.notify();
|
|
4865
|
-
return
|
|
4869
|
+
return _chunkHUFQD4CBcjs.EMPTY_MIXER_LOAD;
|
|
4866
4870
|
}
|
|
4867
4871
|
/** D: black foreground, white background. */
|
|
4868
4872
|
resetPaintColors() {
|
|
@@ -4876,25 +4880,25 @@ var ImageEditorController = (_class6 = class {
|
|
|
4876
4880
|
/** Resolves and validates what a stroke, fill or clear paints into. */
|
|
4877
4881
|
paintTarget(layerId, channel, action) {
|
|
4878
4882
|
const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
|
|
4879
|
-
if (!id) throw new (0,
|
|
4880
|
-
const layer =
|
|
4883
|
+
if (!id) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
|
|
4884
|
+
const layer = _chunkFRD3FUXIcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
4881
4885
|
const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
|
|
4882
4886
|
if (ch === "mask") {
|
|
4883
|
-
if (!layer.mask) throw new (0,
|
|
4884
|
-
if (layer.mask.source) throw new (0,
|
|
4885
|
-
|
|
4887
|
+
if (!layer.mask) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
|
|
4888
|
+
if (layer.mask.source) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
|
|
4889
|
+
_chunkFRD3FUXIcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
4886
4890
|
} else if (ch === "filter-mask") {
|
|
4887
4891
|
if (layer.type !== "smart" || !_optionalChain([layer, 'access', _185 => _185.smartFilters, 'optionalAccess', _186 => _186.mask])) {
|
|
4888
|
-
throw new (0,
|
|
4892
|
+
throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
|
|
4889
4893
|
}
|
|
4890
|
-
if (!
|
|
4891
|
-
|
|
4894
|
+
if (!_chunkFRD3FUXIcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
|
|
4895
|
+
_chunkFRD3FUXIcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
4892
4896
|
} else {
|
|
4893
|
-
if (layer.type === "smart") throw new (0,
|
|
4894
|
-
if (layer.type !== "pixel") throw new (0,
|
|
4895
|
-
|
|
4897
|
+
if (layer.type === "smart") throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
|
|
4898
|
+
if (layer.type !== "pixel") throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
|
|
4899
|
+
_chunkFRD3FUXIcjs.requireUnlocked.call(void 0, layer, "pixels", action);
|
|
4896
4900
|
}
|
|
4897
|
-
if (!layer.visible) throw new (0,
|
|
4901
|
+
if (!layer.visible) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
|
|
4898
4902
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
4899
4903
|
const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
|
|
4900
4904
|
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _187 => _187.locks, 'optionalAccess', _188 => _188.transparency]));
|
|
@@ -4903,7 +4907,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4903
4907
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
4904
4908
|
withSurface(layer, channel, surface) {
|
|
4905
4909
|
if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
|
|
4906
|
-
if (channel === "filter-mask") return
|
|
4910
|
+
if (channel === "filter-mask") return _chunkFRD3FUXIcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
|
|
4907
4911
|
const next = { ...layer, surface };
|
|
4908
4912
|
delete next.source;
|
|
4909
4913
|
return next;
|
|
@@ -4916,12 +4920,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
4916
4920
|
*/
|
|
4917
4921
|
beginStroke(init = {}) {
|
|
4918
4922
|
const tool = _nullishCoalesce(init.tool, () => ( "brush"));
|
|
4919
|
-
if (tool !== "brush" && tool !== "eraser" && tool !== "mixer") throw new (0,
|
|
4923
|
+
if (tool !== "brush" && tool !== "eraser" && tool !== "mixer") throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use brush, eraser or mixer.`);
|
|
4920
4924
|
const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : "paint");
|
|
4921
4925
|
if (tool === "mixer" && target.channel !== "pixels") {
|
|
4922
|
-
throw new (0,
|
|
4926
|
+
throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
|
|
4923
4927
|
}
|
|
4924
|
-
const brush =
|
|
4928
|
+
const brush = _chunkHUFQD4CBcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
|
|
4925
4929
|
const color = parseColor(_nullishCoalesce(init.color, () => ( this.state.paint.foreground)));
|
|
4926
4930
|
const background = parseColor(_nullishCoalesce(init.background, () => ( this.state.paint.background)));
|
|
4927
4931
|
const toMaskGrey = (c) => {
|
|
@@ -4939,20 +4943,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
4939
4943
|
offset: target.offset
|
|
4940
4944
|
};
|
|
4941
4945
|
if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply);
|
|
4942
|
-
return new PaintStrokeSession(this, target, new (0,
|
|
4946
|
+
return new PaintStrokeSession(this, target, new (0, _chunkHUFQD4CBcjs.StrokeCoverage)(brush), apply);
|
|
4943
4947
|
}
|
|
4944
4948
|
/** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
|
|
4945
4949
|
mixerStroke(init, brush) {
|
|
4946
|
-
const settings =
|
|
4950
|
+
const settings = _chunkHUFQD4CBcjs.normalizeMixer.call(void 0, { ...this.state.paint.mixer, ..._nullishCoalesce(init.mixer, () => ( {})) });
|
|
4947
4951
|
let load = this.state.paint.mixerLoad;
|
|
4948
4952
|
if (init.color !== void 0 || settings.loadEachStroke) {
|
|
4949
4953
|
const c = parseColor(_nullishCoalesce(init.color, () => ( this.state.paint.foreground)));
|
|
4950
|
-
load =
|
|
4954
|
+
load = _chunkHUFQD4CBcjs.loadMixer.call(void 0, load, [c[0] / 255, c[1] / 255, c[2] / 255]);
|
|
4951
4955
|
}
|
|
4952
4956
|
return {
|
|
4953
|
-
create: (pixels) => new (0,
|
|
4957
|
+
create: (pixels) => new (0, _chunkHUFQD4CBcjs.MixerStroke)(brush, settings, load, pixels),
|
|
4954
4958
|
end: (after) => {
|
|
4955
|
-
const next = settings.cleanEachStroke ?
|
|
4959
|
+
const next = settings.cleanEachStroke ? _chunkHUFQD4CBcjs.cleanMixer.call(void 0, after) : after;
|
|
4956
4960
|
this.state.paint = { ...this.state.paint, mixerLoad: next };
|
|
4957
4961
|
return next;
|
|
4958
4962
|
}
|
|
@@ -4960,12 +4964,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
4960
4964
|
}
|
|
4961
4965
|
/** @internal Shows a stroke's live surface (no history). */
|
|
4962
4966
|
_strokeUpdate(layerId, channel, surface, rects) {
|
|
4963
|
-
this.state.layers =
|
|
4967
|
+
this.state.layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
|
|
4964
4968
|
this.notify(channel === "filter-mask" ? void 0 : rects);
|
|
4965
4969
|
}
|
|
4966
4970
|
/** @internal Commits a finished stroke as one undo step (`before` is the pre-stroke state). */
|
|
4967
4971
|
_strokeCommit(before, layerId, channel, surface) {
|
|
4968
|
-
if (surface) this.state.layers =
|
|
4972
|
+
if (surface) this.state.layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
|
|
4969
4973
|
else this.state.layers = before.layers;
|
|
4970
4974
|
if (surface && !this.isApplyingHistory) {
|
|
4971
4975
|
this.undoStack.push(before);
|
|
@@ -4985,9 +4989,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
4985
4989
|
* document bounds and the number of dabs.
|
|
4986
4990
|
*/
|
|
4987
4991
|
paintStroke(init) {
|
|
4988
|
-
if (!Array.isArray(init.points) || !init.points.length) throw new (0,
|
|
4992
|
+
if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("points must hold at least one { x, y } point.");
|
|
4989
4993
|
for (const p of init.points) {
|
|
4990
|
-
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _192 => _192.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _193 => _193.y]))) throw new (0,
|
|
4994
|
+
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _192 => _192.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _193 => _193.y]))) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
|
|
4991
4995
|
}
|
|
4992
4996
|
const session = this.beginStroke(init);
|
|
4993
4997
|
session.push(init.points);
|
|
@@ -5013,11 +5017,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
5013
5017
|
const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
|
|
5014
5018
|
const { width, height } = this.naturalSize;
|
|
5015
5019
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
5016
|
-
if (!(opacity >= 0 && opacity <= 1)) throw new (0,
|
|
5017
|
-
const blend = _nullishCoalesce(
|
|
5020
|
+
if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
5021
|
+
const blend = _nullishCoalesce(_chunkFRD3FUXIcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
|
|
5018
5022
|
const sel = options.useSelection !== false && _optionalChain([this, 'access', _194 => _194.state, 'access', _195 => _195.selection, 'optionalAccess', _196 => _196.bounds]) ? this.state.selection : null;
|
|
5019
5023
|
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _197 => _197.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
5020
|
-
const coverage = new (0,
|
|
5024
|
+
const coverage = new (0, _chunkHUFQD4CBcjs.CoverageMap)();
|
|
5021
5025
|
const ones = new Float32Array(region.width * region.height);
|
|
5022
5026
|
if (sel) {
|
|
5023
5027
|
for (let y = 0; y < region.height; y++) {
|
|
@@ -5042,7 +5046,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5042
5046
|
offset: target.offset
|
|
5043
5047
|
};
|
|
5044
5048
|
const surface = paintCoverageInto(target.surface, coverage, apply, [region]);
|
|
5045
|
-
const next =
|
|
5049
|
+
const next = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => this.withSurface(l, target.channel, surface));
|
|
5046
5050
|
this.commitLayers(next);
|
|
5047
5051
|
return { layerId: target.id, channel: target.channel, bounds: region, dabs: 0 };
|
|
5048
5052
|
}
|
|
@@ -5064,18 +5068,18 @@ var ImageEditorController = (_class6 = class {
|
|
|
5064
5068
|
const target = this.developLayer();
|
|
5065
5069
|
let layers = this.state.layers;
|
|
5066
5070
|
if (target && (DEVELOP_KEYS.some((k) => k in partial) || "process" in partial)) {
|
|
5067
|
-
layers =
|
|
5071
|
+
layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, target.id, (l) => withDevelop(l, partial));
|
|
5068
5072
|
}
|
|
5069
5073
|
if ("blur" in partial && typeof partial.blur === "number") {
|
|
5070
5074
|
const blur = Math.max(0, partial.blur);
|
|
5071
5075
|
if (this.state.legacyOutputBlur !== void 0) this.state.legacyOutputBlur = blur;
|
|
5072
|
-
else if (target) layers =
|
|
5076
|
+
else if (target) layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, target.id, (l) => withBlur(l, blur));
|
|
5073
5077
|
}
|
|
5074
5078
|
if ("opacity" in partial && typeof partial.opacity === "number") {
|
|
5075
5079
|
this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
|
|
5076
5080
|
}
|
|
5077
5081
|
if ("layers" in partial) {
|
|
5078
|
-
layers = this.replaceAdjustmentNodes(layers,
|
|
5082
|
+
layers = this.replaceAdjustmentNodes(layers, _chunkFRD3FUXIcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
|
|
5079
5083
|
}
|
|
5080
5084
|
this.state.layers = layers;
|
|
5081
5085
|
this.notify();
|
|
@@ -5083,7 +5087,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5083
5087
|
/** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
|
|
5084
5088
|
get isProcessOutdated() {
|
|
5085
5089
|
this.syncViews();
|
|
5086
|
-
return
|
|
5090
|
+
return _chunkFRD3FUXIcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkFRD3FUXIcjs.LATEST_PROCESS_VERSION;
|
|
5087
5091
|
}
|
|
5088
5092
|
/**
|
|
5089
5093
|
* Update to Current Process: re-interprets the current adjustment values with the latest
|
|
@@ -5091,7 +5095,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5091
5095
|
*/
|
|
5092
5096
|
upgradeProcess() {
|
|
5093
5097
|
if (!this.isProcessOutdated) return false;
|
|
5094
|
-
this.setAdjustments({ process:
|
|
5098
|
+
this.setAdjustments({ process: _chunkFRD3FUXIcjs.LATEST_PROCESS_VERSION });
|
|
5095
5099
|
return true;
|
|
5096
5100
|
}
|
|
5097
5101
|
/** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
|
|
@@ -5099,10 +5103,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
5099
5103
|
this.recordHistory();
|
|
5100
5104
|
const target = this.developLayer();
|
|
5101
5105
|
if (target) {
|
|
5102
|
-
this.state.layers =
|
|
5106
|
+
this.state.layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0,
|
|
5103
5107
|
this.state.layers,
|
|
5104
5108
|
target.id,
|
|
5105
|
-
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process:
|
|
5109
|
+
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkFRD3FUXIcjs.LATEST_PROCESS_VERSION }), 0)
|
|
5106
5110
|
);
|
|
5107
5111
|
}
|
|
5108
5112
|
delete this.state.legacyOutputBlur;
|
|
@@ -5119,7 +5123,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5119
5123
|
return this.getAdjustmentLayers().find((l) => l.id === id);
|
|
5120
5124
|
}
|
|
5121
5125
|
adjustmentNodes(layers = this.state.layers) {
|
|
5122
|
-
return
|
|
5126
|
+
return _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "adjustment");
|
|
5123
5127
|
}
|
|
5124
5128
|
/**
|
|
5125
5129
|
* Where a new layer goes when no position is given: directly above the topmost layer that is
|
|
@@ -5133,26 +5137,26 @@ var ImageEditorController = (_class6 = class {
|
|
|
5133
5137
|
/** Inserts `node` by `aboveId` / `parentId` / adjustment index / default position. */
|
|
5134
5138
|
placeLayer(layers, node, where) {
|
|
5135
5139
|
if (where.aboveId) {
|
|
5136
|
-
const loc =
|
|
5137
|
-
if (loc) return
|
|
5140
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, layers, where.aboveId);
|
|
5141
|
+
if (loc) return _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _198 => _198.parent, 'optionalAccess', _199 => _199.id]), () => ( null)), loc.index + 1);
|
|
5138
5142
|
}
|
|
5139
5143
|
if (where.parentId) {
|
|
5140
|
-
const loc =
|
|
5141
|
-
if (loc && loc.layer.type === "group") return
|
|
5144
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, layers, where.parentId);
|
|
5145
|
+
if (loc && loc.layer.type === "group") return _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, node, loc.layer.id);
|
|
5142
5146
|
}
|
|
5143
5147
|
if (where.adjustmentIndex !== void 0) {
|
|
5144
5148
|
const nodes = this.adjustmentNodes(layers);
|
|
5145
5149
|
const at = Math.max(0, Math.min(nodes.length, Math.round(where.adjustmentIndex)));
|
|
5146
5150
|
if (at < nodes.length) {
|
|
5147
|
-
const loc =
|
|
5148
|
-
return
|
|
5151
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, layers, nodes[at].id);
|
|
5152
|
+
return _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _200 => _200.parent, 'optionalAccess', _201 => _201.id]), () => ( null)), loc.index);
|
|
5149
5153
|
}
|
|
5150
5154
|
if (nodes.length) {
|
|
5151
|
-
const loc =
|
|
5152
|
-
return
|
|
5155
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
|
|
5156
|
+
return _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _202 => _202.parent, 'optionalAccess', _203 => _203.id]), () => ( null)), loc.index + 1);
|
|
5153
5157
|
}
|
|
5154
5158
|
}
|
|
5155
|
-
return
|
|
5159
|
+
return _chunkT3QZ6S47cjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
|
|
5156
5160
|
}
|
|
5157
5161
|
/** `setAdjustments({ layers })`: updates nodes by id in place, removes missing ones, adds new ones. */
|
|
5158
5162
|
replaceAdjustmentNodes(layers, next) {
|
|
@@ -5161,7 +5165,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5161
5165
|
let out = layers;
|
|
5162
5166
|
for (const node of this.adjustmentNodes(layers)) {
|
|
5163
5167
|
const update = byId.get(node.id);
|
|
5164
|
-
out =
|
|
5168
|
+
out = _chunkT3QZ6S47cjs.mapLayer.call(void 0, out, node.id, () => update ? mergeAdjustmentNode(node, update, width, height) : null);
|
|
5165
5169
|
}
|
|
5166
5170
|
const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
|
|
5167
5171
|
for (const l of next) {
|
|
@@ -5180,8 +5184,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5180
5184
|
*/
|
|
5181
5185
|
addAdjustmentLayer(init, index) {
|
|
5182
5186
|
const spec = typeof init === "string" ? { kind: init } : init;
|
|
5183
|
-
const ids = new Set(
|
|
5184
|
-
const layer =
|
|
5187
|
+
const ids = new Set(_chunkT3QZ6S47cjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
5188
|
+
const layer = _chunkFRD3FUXIcjs.createAdjustmentLayer.call(void 0, spec.kind, {
|
|
5185
5189
|
id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
|
|
5186
5190
|
name: spec.name,
|
|
5187
5191
|
params: spec.params,
|
|
@@ -5190,7 +5194,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5190
5194
|
blend: spec.blend,
|
|
5191
5195
|
mask: _nullishCoalesce(spec.mask, () => ( void 0))
|
|
5192
5196
|
});
|
|
5193
|
-
while (ids.has(layer.id)) layer.id =
|
|
5197
|
+
while (ids.has(layer.id)) layer.id = _chunkFRD3FUXIcjs.newLayerId.call(void 0, "adj");
|
|
5194
5198
|
const { width, height } = this.naturalSize;
|
|
5195
5199
|
this.recordHistory();
|
|
5196
5200
|
const node = adjustmentNodeFromLegacy(layer, width, height);
|
|
@@ -5209,11 +5213,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
5209
5213
|
* Returns false for an unknown id.
|
|
5210
5214
|
*/
|
|
5211
5215
|
updateAdjustmentLayer(id, update, commitToHistory = true) {
|
|
5212
|
-
const loc =
|
|
5216
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, this.state.layers, id);
|
|
5213
5217
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
5214
5218
|
const { width, height } = this.naturalSize;
|
|
5215
5219
|
const node = loc.layer;
|
|
5216
|
-
const merged =
|
|
5220
|
+
const merged = _chunkFRD3FUXIcjs.normalizeAdjustmentLayer.call(void 0, {
|
|
5217
5221
|
id: node.id,
|
|
5218
5222
|
kind: node.kind,
|
|
5219
5223
|
enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
|
|
@@ -5237,16 +5241,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
5237
5241
|
if (mask) next.mask = mask;
|
|
5238
5242
|
else delete next.mask;
|
|
5239
5243
|
}
|
|
5240
|
-
this.state.layers =
|
|
5244
|
+
this.state.layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, id, () => next);
|
|
5241
5245
|
this.notify();
|
|
5242
5246
|
return true;
|
|
5243
5247
|
}
|
|
5244
5248
|
/** Removes a layer as one undo step. Returns false for an unknown id. */
|
|
5245
5249
|
removeAdjustmentLayer(id) {
|
|
5246
|
-
const loc =
|
|
5250
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, this.state.layers, id);
|
|
5247
5251
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
5248
5252
|
this.recordHistory();
|
|
5249
|
-
this.state.layers =
|
|
5253
|
+
this.state.layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, id, () => null);
|
|
5250
5254
|
if (this.state.activeLayerId === id) this.state.activeLayerId = null;
|
|
5251
5255
|
this.notify();
|
|
5252
5256
|
return true;
|
|
@@ -5259,9 +5263,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
5259
5263
|
if (to === from) return layers;
|
|
5260
5264
|
const node = nodes[from];
|
|
5261
5265
|
const anchor = nodes[to];
|
|
5262
|
-
const without =
|
|
5263
|
-
const loc =
|
|
5264
|
-
return
|
|
5266
|
+
const without = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, id, () => null);
|
|
5267
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, without, anchor.id);
|
|
5268
|
+
return _chunkT3QZ6S47cjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _204 => _204.parent, 'optionalAccess', _205 => _205.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
|
|
5265
5269
|
}
|
|
5266
5270
|
/** Moves a layer to `toIndex` among the adjustment layers (0 = bottom) as one undo step. Returns false if nothing moved. */
|
|
5267
5271
|
moveAdjustmentLayer(id, toIndex) {
|
|
@@ -5286,7 +5290,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5286
5290
|
if (!nodes.length) return;
|
|
5287
5291
|
this.recordHistory();
|
|
5288
5292
|
let layers = this.state.layers;
|
|
5289
|
-
for (const n of nodes) layers =
|
|
5293
|
+
for (const n of nodes) layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, n.id, () => null);
|
|
5290
5294
|
this.state.layers = layers;
|
|
5291
5295
|
if (nodes.some((n) => n.id === this.state.activeLayerId)) this.state.activeLayerId = null;
|
|
5292
5296
|
this.notify();
|
|
@@ -5320,8 +5324,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5320
5324
|
const { width, height } = this.naturalSize;
|
|
5321
5325
|
let next = null;
|
|
5322
5326
|
if (mask) {
|
|
5323
|
-
const sized = mask.width === width && mask.height === height ? mask :
|
|
5324
|
-
next =
|
|
5327
|
+
const sized = mask.width === width && mask.height === height ? mask : _chunkFRD3FUXIcjs.resizeSelection.call(void 0, mask, width, height);
|
|
5328
|
+
next = _chunkFRD3FUXIcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
|
|
5325
5329
|
} else if (mode !== "replace") {
|
|
5326
5330
|
return false;
|
|
5327
5331
|
}
|
|
@@ -5335,7 +5339,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5335
5339
|
/** Select › All. */
|
|
5336
5340
|
selectAll() {
|
|
5337
5341
|
const { width, height } = this.naturalSize;
|
|
5338
|
-
return this.setSelection(
|
|
5342
|
+
return this.setSelection(_chunkFRD3FUXIcjs.fullSelection.call(void 0, width, height));
|
|
5339
5343
|
}
|
|
5340
5344
|
/** Select › Deselect. */
|
|
5341
5345
|
deselect() {
|
|
@@ -5344,11 +5348,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
5344
5348
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
5345
5349
|
invertSelection() {
|
|
5346
5350
|
const { width, height } = this.naturalSize;
|
|
5347
|
-
const current = _nullishCoalesce(this.state.selection, () => (
|
|
5348
|
-
return this.setSelection(
|
|
5351
|
+
const current = _nullishCoalesce(this.state.selection, () => ( _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, width, height)));
|
|
5352
|
+
return this.setSelection(_chunkFRD3FUXIcjs.invertSelection.call(void 0, current));
|
|
5349
5353
|
}
|
|
5350
5354
|
shapeCommand(mask, options) {
|
|
5351
|
-
const shaped = options.feather && options.feather > 0 ?
|
|
5355
|
+
const shaped = options.feather && options.feather > 0 ? _chunkFRD3FUXIcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
|
|
5352
5356
|
return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
|
|
5353
5357
|
}
|
|
5354
5358
|
/** Rectangular marquee in natural image pixels. */
|
|
@@ -5406,28 +5410,28 @@ var ImageEditorController = (_class6 = class {
|
|
|
5406
5410
|
if (options.sample === "active-layer") {
|
|
5407
5411
|
const layer = this.getActiveLayer();
|
|
5408
5412
|
if (!layer || layer.type !== "pixel") {
|
|
5409
|
-
throw new (0,
|
|
5413
|
+
throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
|
|
5410
5414
|
}
|
|
5411
|
-
const surface = layer.source === "document" && options.pixels ?
|
|
5412
|
-
return { width, height, data:
|
|
5415
|
+
const surface = layer.source === "document" && options.pixels ? _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
|
|
5416
|
+
return { width, height, data: _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
|
|
5413
5417
|
}
|
|
5414
5418
|
if (legacy && !options.sampleMerged) return base;
|
|
5415
5419
|
this.syncViews();
|
|
5416
5420
|
if (legacy && !options.pixels) {
|
|
5417
5421
|
const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
|
|
5418
|
-
|
|
5422
|
+
_chunkFRD3FUXIcjs.applyAdjustments.call(void 0, copy, legacyView(this.stack(), width, height, null).adjustments);
|
|
5419
5423
|
return copy;
|
|
5420
5424
|
}
|
|
5421
5425
|
const pixels = options.pixels;
|
|
5422
5426
|
const sources = {
|
|
5423
5427
|
width,
|
|
5424
5428
|
height,
|
|
5425
|
-
surfaceOf: (l) => l.type === "pixel" && l.source === "document" && pixels ?
|
|
5429
|
+
surfaceOf: (l) => l.type === "pixel" && l.source === "document" && pixels ? _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, pixels, 4) : this.surfaceOf(l),
|
|
5426
5430
|
version: pixels ? "pixels" : this.sourceVersion()
|
|
5427
5431
|
};
|
|
5428
5432
|
const stack = withoutAnnotations(this.state.layers);
|
|
5429
5433
|
const layers = options.sampleMerged ? stack : pixelsOnly(stack);
|
|
5430
|
-
const data = new (0,
|
|
5434
|
+
const data = new (0, _chunkFRD3FUXIcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
|
|
5431
5435
|
return { width, height, data };
|
|
5432
5436
|
}
|
|
5433
5437
|
async requirePixels(options) {
|
|
@@ -5454,7 +5458,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5454
5458
|
modifySelection(op, radius) {
|
|
5455
5459
|
const sel = this.state.selection;
|
|
5456
5460
|
if (!_optionalChain([sel, 'optionalAccess', _211 => _211.bounds])) return false;
|
|
5457
|
-
return this.setSelection(
|
|
5461
|
+
return this.setSelection(_chunkFRD3FUXIcjs.modifySelection.call(void 0, sel, op, radius));
|
|
5458
5462
|
}
|
|
5459
5463
|
/**
|
|
5460
5464
|
* Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
|
|
@@ -5485,7 +5489,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5485
5489
|
} else {
|
|
5486
5490
|
pixels = source;
|
|
5487
5491
|
}
|
|
5488
|
-
this.setSelection(
|
|
5492
|
+
this.setSelection(_chunkFRD3FUXIcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
|
|
5489
5493
|
return this.getSelection();
|
|
5490
5494
|
}
|
|
5491
5495
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
@@ -5497,8 +5501,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5497
5501
|
// --- Layer masks ---
|
|
5498
5502
|
maskFromSelection(sel, props = {}) {
|
|
5499
5503
|
const { width, height } = this.naturalSize;
|
|
5500
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
5501
|
-
const mask = { surface:
|
|
5504
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkFRD3FUXIcjs.resizeSelection.call(void 0, sel, width, height);
|
|
5505
|
+
const mask = { surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
|
|
5502
5506
|
return withMaskProps(mask, props);
|
|
5503
5507
|
}
|
|
5504
5508
|
/**
|
|
@@ -5511,10 +5515,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
5511
5515
|
return this.setLayerMask(layerId, this.maskFromSelection(sel, props));
|
|
5512
5516
|
}
|
|
5513
5517
|
setLayerMask(layerId, mask, commitToHistory = true) {
|
|
5514
|
-
const loc =
|
|
5518
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
5515
5519
|
if (!loc) return false;
|
|
5516
5520
|
if (commitToHistory) this.recordHistory();
|
|
5517
|
-
this.state.layers =
|
|
5521
|
+
this.state.layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
|
|
5518
5522
|
const next = { ...l };
|
|
5519
5523
|
if (mask) next.mask = mask;
|
|
5520
5524
|
else delete next.mask;
|
|
@@ -5542,8 +5546,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5542
5546
|
const { width, height } = this.naturalSize;
|
|
5543
5547
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
5544
5548
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
5545
|
-
const data =
|
|
5546
|
-
const sel =
|
|
5549
|
+
const data = _chunkSZ6KMZNMcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
5550
|
+
const sel = _chunkFRD3FUXIcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
5547
5551
|
return this.setSelection(sel, mode);
|
|
5548
5552
|
}
|
|
5549
5553
|
// --- Histogram ---
|
|
@@ -5571,7 +5575,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5571
5575
|
if (target) {
|
|
5572
5576
|
const merged = { ...this.state.depthMask, ...partial };
|
|
5573
5577
|
merged.depthRange = [...merged.depthRange];
|
|
5574
|
-
this.state.layers =
|
|
5578
|
+
this.state.layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
5575
5579
|
const next = { ...l };
|
|
5576
5580
|
if (isDefaultDepthMask(merged)) {
|
|
5577
5581
|
if (_optionalChain([next, 'access', _217 => _217.mask, 'optionalAccess', _218 => _218.source])) delete next.mask;
|
|
@@ -5585,7 +5589,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5585
5589
|
this.recordHistory();
|
|
5586
5590
|
const target = this.developLayer();
|
|
5587
5591
|
if (_optionalChain([target, 'optionalAccess', _219 => _219.mask, 'optionalAccess', _220 => _220.source])) {
|
|
5588
|
-
this.state.layers =
|
|
5592
|
+
this.state.layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
5589
5593
|
const next = { ...l };
|
|
5590
5594
|
delete next.mask;
|
|
5591
5595
|
return next;
|
|
@@ -5595,7 +5599,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5595
5599
|
}
|
|
5596
5600
|
// --- Annotations & Layers ---
|
|
5597
5601
|
annotationLayer(id) {
|
|
5598
|
-
return
|
|
5602
|
+
return _chunkT3QZ6S47cjs.flattenLayers.call(void 0, this.state.layers).find(
|
|
5599
5603
|
(l) => l.type === "annotation" && l.annotation.id === id
|
|
5600
5604
|
);
|
|
5601
5605
|
}
|
|
@@ -5605,8 +5609,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5605
5609
|
const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
|
|
5606
5610
|
const fullAnnotation = { ...annotation, id };
|
|
5607
5611
|
const layer = annotationLayerFor(fullAnnotation);
|
|
5608
|
-
const loc = placement.aboveId ?
|
|
5609
|
-
this.state.layers = loc ?
|
|
5612
|
+
const loc = placement.aboveId ? _chunkT3QZ6S47cjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
5613
|
+
this.state.layers = loc ? _chunkT3QZ6S47cjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _221 => _221.parent, 'optionalAccess', _222 => _222.id]), () => ( null)), loc.index + 1) : _chunkT3QZ6S47cjs.insertLayer.call(void 0, this.state.layers, layer, null);
|
|
5610
5614
|
this.state.selectedAnnotationId = id;
|
|
5611
5615
|
this.notify();
|
|
5612
5616
|
return id;
|
|
@@ -5619,14 +5623,14 @@ var ImageEditorController = (_class6 = class {
|
|
|
5619
5623
|
if (layer) {
|
|
5620
5624
|
const annotation = { ...layer.annotation, ...partial, id };
|
|
5621
5625
|
const name = layer.name === annotationLayerName(layer.annotation) ? annotationLayerName(annotation) : layer.name;
|
|
5622
|
-
this.state.layers =
|
|
5626
|
+
this.state.layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, layer.id, () => ({ ...layer, annotation, name }));
|
|
5623
5627
|
}
|
|
5624
5628
|
this.notify();
|
|
5625
5629
|
}
|
|
5626
5630
|
removeAnnotation(id) {
|
|
5627
5631
|
this.recordHistory();
|
|
5628
5632
|
const layer = this.annotationLayer(id);
|
|
5629
|
-
if (layer) this.state.layers =
|
|
5633
|
+
if (layer) this.state.layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, layer.id, () => null);
|
|
5630
5634
|
if (this.state.selectedAnnotationId === id) {
|
|
5631
5635
|
this.state.selectedAnnotationId = null;
|
|
5632
5636
|
}
|
|
@@ -5635,7 +5639,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5635
5639
|
clearAnnotations() {
|
|
5636
5640
|
this.recordHistory();
|
|
5637
5641
|
let layers = this.state.layers;
|
|
5638
|
-
for (const l of
|
|
5642
|
+
for (const l of _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation") layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, l.id, () => null);
|
|
5639
5643
|
this.state.layers = layers;
|
|
5640
5644
|
this.state.selectedAnnotationId = null;
|
|
5641
5645
|
this.notify();
|
|
@@ -5714,7 +5718,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5714
5718
|
this.syncViews();
|
|
5715
5719
|
if (_optionalChain([options, 'optionalAccess', _223 => _223.layerIds])) {
|
|
5716
5720
|
const keep = new Set(options.layerIds);
|
|
5717
|
-
const layers =
|
|
5721
|
+
const layers = _chunkT3QZ6S47cjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
|
|
5718
5722
|
return this.renderer.renderExport(source, { ...this.state, layers }, options);
|
|
5719
5723
|
}
|
|
5720
5724
|
return this.renderer.renderExport(source, this.state, options);
|
|
@@ -5824,10 +5828,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
5824
5828
|
/** No source image, and no layer reading one (an opened PSD): the layers are the whole document. */
|
|
5825
5829
|
isSourceless() {
|
|
5826
5830
|
if (this.imageElement || this.state.sourceUrl || !this.state.layers.length) return false;
|
|
5827
|
-
return !
|
|
5831
|
+
return !_chunkT3QZ6S47cjs.flattenLayers.call(void 0, this.state.layers).some((l) => l.type === "pixel" && l.source === "document");
|
|
5828
5832
|
}
|
|
5829
5833
|
get isMultiLayer() {
|
|
5830
|
-
return
|
|
5834
|
+
return _chunkT3QZ6S47cjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" || l.type === "group").length > 1;
|
|
5831
5835
|
}
|
|
5832
5836
|
/**
|
|
5833
5837
|
* Applies an inpainted result (natural image space, see `toSourceDataURL`) as ONE undoable step.
|
|
@@ -5862,16 +5866,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
5862
5866
|
return;
|
|
5863
5867
|
}
|
|
5864
5868
|
const target = this.developLayer();
|
|
5865
|
-
if (!target) throw new (0,
|
|
5866
|
-
|
|
5869
|
+
if (!target) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("There is no pixel layer to mask.");
|
|
5870
|
+
_chunkFRD3FUXIcjs.requireUnlocked.call(void 0, target, "all", "mask it");
|
|
5867
5871
|
const { width, height } = this.naturalSize;
|
|
5868
5872
|
let px2 = await this.decodeImage(newDataUrl);
|
|
5869
5873
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
5870
5874
|
const alpha = new Uint8ClampedArray(width * height);
|
|
5871
5875
|
for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
|
|
5872
|
-
let surface =
|
|
5873
|
-
if (target.offset.x || target.offset.y) surface =
|
|
5874
|
-
this.commitLayers(
|
|
5876
|
+
let surface = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
|
|
5877
|
+
if (target.offset.x || target.offset.y) surface = _chunkSZ6KMZNMcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
|
|
5878
|
+
this.commitLayers(_chunkFRD3FUXIcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
|
|
5875
5879
|
return target.id;
|
|
5876
5880
|
}
|
|
5877
5881
|
/**
|
|
@@ -5880,8 +5884,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5880
5884
|
* step. Returns the layer id.
|
|
5881
5885
|
*/
|
|
5882
5886
|
async rasterizeLayer(id) {
|
|
5883
|
-
const layer =
|
|
5884
|
-
|
|
5887
|
+
const layer = _chunkFRD3FUXIcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5888
|
+
_chunkFRD3FUXIcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
|
|
5885
5889
|
const { width, height } = this.naturalSize;
|
|
5886
5890
|
const canvas = { x: 0, y: 0, width, height };
|
|
5887
5891
|
let next;
|
|
@@ -5897,8 +5901,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5897
5901
|
if (layer.locks) next.locks = layer.locks;
|
|
5898
5902
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
5899
5903
|
} else if (layer.type === "pixel") {
|
|
5900
|
-
if (!_optionalChain([layer, 'access', _227 => _227.filters, 'optionalAccess', _228 => _228.length])) throw new (0,
|
|
5901
|
-
|
|
5904
|
+
if (!_optionalChain([layer, 'access', _227 => _227.filters, 'optionalAccess', _228 => _228.length])) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
|
|
5905
|
+
_chunkFRD3FUXIcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
|
|
5902
5906
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
5903
5907
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
5904
5908
|
delete content.mask;
|
|
@@ -5910,14 +5914,14 @@ var ImageEditorController = (_class6 = class {
|
|
|
5910
5914
|
delete next.filters;
|
|
5911
5915
|
delete next.source;
|
|
5912
5916
|
if (layer.mask && (layer.offset.x || layer.offset.y)) {
|
|
5913
|
-
next.mask = { ...layer.mask, surface:
|
|
5917
|
+
next.mask = { ...layer.mask, surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, layer.mask.surface, layer.offset.x, layer.offset.y) };
|
|
5914
5918
|
}
|
|
5915
5919
|
} else if (layer.type === "smart") {
|
|
5916
5920
|
return this.rasterizeSmartObject(id);
|
|
5917
5921
|
} else {
|
|
5918
|
-
throw new (0,
|
|
5922
|
+
throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Only annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
|
|
5919
5923
|
}
|
|
5920
|
-
this.commitLayers(
|
|
5924
|
+
this.commitLayers(_chunkT3QZ6S47cjs.mapLayer.call(void 0, this.state.layers, id, () => next));
|
|
5921
5925
|
return id;
|
|
5922
5926
|
}
|
|
5923
5927
|
// --- PSD ---
|
|
@@ -5930,7 +5934,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5930
5934
|
* Throws `PsdError` for files that cannot be read at all.
|
|
5931
5935
|
*/
|
|
5932
5936
|
loadPsd(bytes) {
|
|
5933
|
-
const result =
|
|
5937
|
+
const result = _chunkFRD3FUXIcjs.importPsd.call(void 0, bytes, { newId: () => _chunkFRD3FUXIcjs.newLayerId.call(void 0, ) });
|
|
5934
5938
|
this.abandonContents();
|
|
5935
5939
|
this.recordHistory();
|
|
5936
5940
|
const s = this.state;
|
|
@@ -5940,12 +5944,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
5940
5944
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
5941
5945
|
s.layers = result.layers;
|
|
5942
5946
|
s.crop = null;
|
|
5943
|
-
s.transform = { ...
|
|
5947
|
+
s.transform = { ..._chunkFRD3FUXIcjs.DEFAULT_TRANSFORM_VALUES };
|
|
5944
5948
|
s.outputOpacity = 1;
|
|
5945
5949
|
delete s.legacyOutputBlur;
|
|
5946
5950
|
s.selection = null;
|
|
5947
5951
|
s.selectedAnnotationId = null;
|
|
5948
|
-
const pixels =
|
|
5952
|
+
const pixels = _chunkT3QZ6S47cjs.flattenLayers.call(void 0, result.layers).filter((l) => l.type === "pixel");
|
|
5949
5953
|
s.activeLayerId = pixels.length ? pixels[pixels.length - 1].id : null;
|
|
5950
5954
|
s.activeTarget = "pixels";
|
|
5951
5955
|
this.psdResolution = result.resolution;
|
|
@@ -5956,7 +5960,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5956
5960
|
this.lastLoadProblems = result.warnings;
|
|
5957
5961
|
this.notify();
|
|
5958
5962
|
return {
|
|
5959
|
-
layerIds:
|
|
5963
|
+
layerIds: _chunkT3QZ6S47cjs.flattenLayers.call(void 0, result.layers).map((l) => l.id),
|
|
5960
5964
|
warnings: result.warnings,
|
|
5961
5965
|
width: result.width,
|
|
5962
5966
|
height: result.height,
|
|
@@ -5978,7 +5982,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5978
5982
|
const canRasterize = this.renderer.canRasterize();
|
|
5979
5983
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
5980
5984
|
const sources = this.renderer.compositorSources(width, height);
|
|
5981
|
-
const compositor = new (0,
|
|
5985
|
+
const compositor = new (0, _chunkFRD3FUXIcjs.LayerCompositor)();
|
|
5982
5986
|
const bakeMask = (layer) => {
|
|
5983
5987
|
const mask = layer.mask;
|
|
5984
5988
|
if (!_optionalChain([mask, 'optionalAccess', _229 => _229.source])) return mask;
|
|
@@ -5990,7 +5994,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5990
5994
|
const bytes = new Uint8ClampedArray(width * height);
|
|
5991
5995
|
if (coverage) for (let i = 0; i < bytes.length; i++) bytes[i] = Math.round(coverage[i] * 255);
|
|
5992
5996
|
else bytes.fill(255);
|
|
5993
|
-
const baked = { surface:
|
|
5997
|
+
const baked = { surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data: bytes }, 1, -ox, -oy), defaultValue: 0 };
|
|
5994
5998
|
if (mask.density !== void 0 && mask.density < 1) baked.density = mask.density;
|
|
5995
5999
|
if (mask.feather) baked.feather = mask.feather;
|
|
5996
6000
|
if (mask.enabled === false) baked.enabled = false;
|
|
@@ -6030,7 +6034,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6030
6034
|
visible: layer.visible,
|
|
6031
6035
|
opacity: layer.opacity,
|
|
6032
6036
|
blend,
|
|
6033
|
-
surface:
|
|
6037
|
+
surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4),
|
|
6034
6038
|
offset: { x: 0, y: 0 }
|
|
6035
6039
|
};
|
|
6036
6040
|
if (layer.clipped) out2.clipped = true;
|
|
@@ -6052,7 +6056,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6052
6056
|
out.surface = this.surfaceOf(layer);
|
|
6053
6057
|
delete out.source;
|
|
6054
6058
|
}
|
|
6055
|
-
const active = _nullishCoalesce(_optionalChain([layer, 'access', _231 => _231.filters, 'optionalAccess', _232 => _232.filter, 'call', _233 => _233(
|
|
6059
|
+
const active = _nullishCoalesce(_optionalChain([layer, 'access', _231 => _231.filters, 'optionalAccess', _232 => _232.filter, 'call', _233 => _233(_chunkFRD3FUXIcjs.isActiveFilter)]), () => ( []));
|
|
6056
6060
|
if (active.length) {
|
|
6057
6061
|
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
6058
6062
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -6061,7 +6065,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6061
6065
|
delete content.fillOpacity;
|
|
6062
6066
|
delete content.effects;
|
|
6063
6067
|
const data = compositor.composite([content], canvas, sources);
|
|
6064
|
-
out = { ...out, surface:
|
|
6068
|
+
out = { ...out, surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
|
|
6065
6069
|
}
|
|
6066
6070
|
if (_optionalChain([layer, 'access', _234 => _234.filters, 'optionalAccess', _235 => _235.some, 'call', _236 => _236((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
|
|
6067
6071
|
delete out.filters;
|
|
@@ -6082,7 +6086,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6082
6086
|
if (s.legacyOutputBlur) warnings.push("The document-level blur of an old document is not written.");
|
|
6083
6087
|
for (const [msg, names] of note) warnings.push(`${msg} (${names.length === 1 ? "layer" : "layers"} ${names.map((n) => `"${n}"`).join(", ")}).`);
|
|
6084
6088
|
const merged = compositor.composite(prepared, canvas, { ...sources, version: `psd:${Date.now()}` });
|
|
6085
|
-
const result =
|
|
6089
|
+
const result = _chunkFRD3FUXIcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight });
|
|
6086
6090
|
warnings.push(...result.warnings);
|
|
6087
6091
|
return { bytes: result.bytes, warnings, psb: result.psb, width, height };
|
|
6088
6092
|
}
|
|
@@ -6098,13 +6102,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
6098
6102
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
6099
6103
|
if (this.state.selection && (sx !== 1 || sy !== 1)) {
|
|
6100
6104
|
this.state.selection = normalizeSelection(
|
|
6101
|
-
|
|
6105
|
+
_chunkFRD3FUXIcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
|
|
6102
6106
|
);
|
|
6103
6107
|
}
|
|
6104
6108
|
let layers = this.state.layers;
|
|
6105
6109
|
if (sx !== 1 || sy !== 1) {
|
|
6106
6110
|
if (this.state.crop) {
|
|
6107
|
-
this.state.crop =
|
|
6111
|
+
this.state.crop = _chunkFRD3FUXIcjs.clampCropToImage.call(void 0,
|
|
6108
6112
|
{
|
|
6109
6113
|
x: Math.round(this.state.crop.x * sx),
|
|
6110
6114
|
y: Math.round(this.state.crop.y * sy),
|
|
@@ -6116,16 +6120,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
6116
6120
|
);
|
|
6117
6121
|
}
|
|
6118
6122
|
layers = resizeLegacyMasks(layers, prev, next.dimensions);
|
|
6119
|
-
for (const l of
|
|
6123
|
+
for (const l of _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers)) {
|
|
6120
6124
|
if (l.type === "annotation") {
|
|
6121
|
-
layers =
|
|
6125
|
+
layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
|
|
6122
6126
|
}
|
|
6123
6127
|
}
|
|
6124
6128
|
}
|
|
6125
6129
|
const bg = developTarget(layers, null);
|
|
6126
|
-
if (bg && bg.source !== "document") layers =
|
|
6130
|
+
if (bg && bg.source !== "document") layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
|
|
6127
6131
|
if (clearAnnotations) {
|
|
6128
|
-
for (const l of
|
|
6132
|
+
for (const l of _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation") layers = _chunkT3QZ6S47cjs.mapLayer.call(void 0, layers, l.id, () => null);
|
|
6129
6133
|
this.state.selectedAnnotationId = null;
|
|
6130
6134
|
}
|
|
6131
6135
|
this.state.layers = layers;
|
|
@@ -6143,7 +6147,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6143
6147
|
let out;
|
|
6144
6148
|
try {
|
|
6145
6149
|
out = this.serializeState();
|
|
6146
|
-
if (_optionalChain([this, 'access', _240 => _240.state, 'access', _241 => _241.selection, 'optionalAccess', _242 => _242.bounds])) out.selection =
|
|
6150
|
+
if (_optionalChain([this, 'access', _240 => _240.state, 'access', _241 => _241.selection, 'optionalAccess', _242 => _242.bounds])) out.selection = _chunkFRD3FUXIcjs.serializeSelection.call(void 0, this.state.selection);
|
|
6147
6151
|
} finally {
|
|
6148
6152
|
if (root) {
|
|
6149
6153
|
this.state = current;
|
|
@@ -6151,8 +6155,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
6151
6155
|
this.viewKey = [];
|
|
6152
6156
|
}
|
|
6153
6157
|
}
|
|
6154
|
-
if (!options || out.version !==
|
|
6155
|
-
return
|
|
6158
|
+
if (!options || out.version !== _chunkFRD3FUXIcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
|
|
6159
|
+
return _chunkFRD3FUXIcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
|
|
6156
6160
|
}
|
|
6157
6161
|
/**
|
|
6158
6162
|
* Loads a stored state whose v3 assets may live in an asset store (references other than data
|
|
@@ -6160,12 +6164,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
6160
6164
|
* out and listed in `lastLoadProblems`.
|
|
6161
6165
|
*/
|
|
6162
6166
|
async loadJSONAsync(data, options = {}) {
|
|
6163
|
-
if (data.version !==
|
|
6167
|
+
if (data.version !== _chunkFRD3FUXIcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
|
|
6164
6168
|
this.loadJSON(data);
|
|
6165
6169
|
return;
|
|
6166
6170
|
}
|
|
6167
6171
|
const problems = [];
|
|
6168
|
-
const assets = await
|
|
6172
|
+
const assets = await _chunkFRD3FUXIcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
|
|
6169
6173
|
this.loadJSON({ ...data, assets });
|
|
6170
6174
|
this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
|
|
6171
6175
|
}
|
|
@@ -6177,7 +6181,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6177
6181
|
let selection = null;
|
|
6178
6182
|
if (data.selection) {
|
|
6179
6183
|
try {
|
|
6180
|
-
selection = normalizeSelection(
|
|
6184
|
+
selection = normalizeSelection(_chunkFRD3FUXIcjs.deserializeSelection.call(void 0, data.selection));
|
|
6181
6185
|
} catch (e21) {
|
|
6182
6186
|
selection = null;
|
|
6183
6187
|
}
|
|
@@ -6195,18 +6199,18 @@ var ImageEditorController = (_class6 = class {
|
|
|
6195
6199
|
if (isLayered(data)) {
|
|
6196
6200
|
const problems = [];
|
|
6197
6201
|
const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
|
|
6198
|
-
s.layers =
|
|
6202
|
+
s.layers = _chunkFRD3FUXIcjs.deserializeLayers.call(void 0, data.layers, { assets: _nullishCoalesce(data.assets, () => ( {})), problems, smartContents: Array.isArray(data.smartContents) ? data.smartContents : [], canvas });
|
|
6199
6203
|
this.lastLoadProblems = problems;
|
|
6200
6204
|
s.crop = data.crop ? { ...data.crop } : null;
|
|
6201
6205
|
s.transform = { ...data.transform };
|
|
6202
6206
|
s.outputOpacity = data.opacity;
|
|
6203
6207
|
if (typeof data.legacyOutputBlur === "number" && data.legacyOutputBlur >= 0) s.legacyOutputBlur = data.legacyOutputBlur;
|
|
6204
6208
|
else delete s.legacyOutputBlur;
|
|
6205
|
-
s.activeLayerId = data.activeLayerId &&
|
|
6209
|
+
s.activeLayerId = data.activeLayerId && _chunkT3QZ6S47cjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : null;
|
|
6206
6210
|
const light = data.globalLight;
|
|
6207
6211
|
if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
|
|
6208
6212
|
else delete s.globalLight;
|
|
6209
|
-
const patterns =
|
|
6213
|
+
const patterns = _chunkFRD3FUXIcjs.deserializePatterns.call(void 0, data.patterns, problems);
|
|
6210
6214
|
if (patterns.length) s.patterns = patterns;
|
|
6211
6215
|
else delete s.patterns;
|
|
6212
6216
|
if (!this.imageElement && typeof data.width === "number" && typeof data.height === "number" && data.width > 0 && data.height > 0) {
|
|
@@ -6247,9 +6251,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
6247
6251
|
annotations: JSON.parse(JSON.stringify(view.annotations))
|
|
6248
6252
|
};
|
|
6249
6253
|
}
|
|
6250
|
-
const { layers, assets, smartContents } =
|
|
6254
|
+
const { layers, assets, smartContents } = _chunkFRD3FUXIcjs.serializeLayers.call(void 0, this.state.layers);
|
|
6251
6255
|
const out = {
|
|
6252
|
-
version:
|
|
6256
|
+
version: _chunkFRD3FUXIcjs.LAYERED_SCHEMA_VERSION,
|
|
6253
6257
|
width,
|
|
6254
6258
|
height,
|
|
6255
6259
|
layers,
|
|
@@ -6261,7 +6265,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6261
6265
|
};
|
|
6262
6266
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
6263
6267
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
6264
|
-
if (_optionalChain([this, 'access', _249 => _249.state, 'access', _250 => _250.patterns, 'optionalAccess', _251 => _251.length])) out.patterns =
|
|
6268
|
+
if (_optionalChain([this, 'access', _249 => _249.state, 'access', _250 => _250.patterns, 'optionalAccess', _251 => _251.length])) out.patterns = _chunkFRD3FUXIcjs.serializePatterns.call(void 0, this.state.patterns);
|
|
6265
6269
|
if (smartContents) out.smartContents = smartContents;
|
|
6266
6270
|
return out;
|
|
6267
6271
|
}
|
|
@@ -6270,7 +6274,7 @@ function serializeAdjustments(adjustments) {
|
|
|
6270
6274
|
const out = { ...adjustments };
|
|
6271
6275
|
if (_optionalChain([out, 'access', _252 => _252.layers, 'optionalAccess', _253 => _253.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
6272
6276
|
else delete out.layers;
|
|
6273
|
-
if (
|
|
6277
|
+
if (_chunkFRD3FUXIcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkFRD3FUXIcjs.LEGACY_PROCESS_VERSION) {
|
|
6274
6278
|
delete out.process;
|
|
6275
6279
|
if (!out.tint) delete out.tint;
|
|
6276
6280
|
}
|
|
@@ -6281,7 +6285,7 @@ function withDevelop(layer, partial) {
|
|
|
6281
6285
|
let i = filters.findIndex((f) => f.kind === "develop");
|
|
6282
6286
|
if (i === -1) {
|
|
6283
6287
|
filters.unshift({
|
|
6284
|
-
id: layer.source === "document" ? DEVELOP_FILTER_ID :
|
|
6288
|
+
id: layer.source === "document" ? DEVELOP_FILTER_ID : _chunkFRD3FUXIcjs.newLayerId.call(void 0, "flt"),
|
|
6285
6289
|
kind: "develop",
|
|
6286
6290
|
enabled: true,
|
|
6287
6291
|
brightness: 0,
|
|
@@ -6290,7 +6294,7 @@ function withDevelop(layer, partial) {
|
|
|
6290
6294
|
exposure: 0,
|
|
6291
6295
|
temperature: 0,
|
|
6292
6296
|
tint: 0,
|
|
6293
|
-
process:
|
|
6297
|
+
process: _chunkFRD3FUXIcjs.LATEST_PROCESS_VERSION
|
|
6294
6298
|
});
|
|
6295
6299
|
i = 0;
|
|
6296
6300
|
}
|
|
@@ -6299,7 +6303,7 @@ function withDevelop(layer, partial) {
|
|
|
6299
6303
|
const v = partial[k];
|
|
6300
6304
|
if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
|
|
6301
6305
|
}
|
|
6302
|
-
if ("process" in partial) next.process =
|
|
6306
|
+
if ("process" in partial) next.process = _chunkFRD3FUXIcjs.normalizeProcessVersion.call(void 0, partial.process);
|
|
6303
6307
|
filters[i] = next;
|
|
6304
6308
|
return { ...layer, filters };
|
|
6305
6309
|
}
|
|
@@ -6308,7 +6312,7 @@ function withBlur(layer, radius) {
|
|
|
6308
6312
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
6309
6313
|
if (radius > 0) {
|
|
6310
6314
|
filters.push({
|
|
6311
|
-
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _257 => _257.id]), () => ( (layer.source === "document" ? BLUR_FILTER_ID :
|
|
6315
|
+
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _257 => _257.id]), () => ( (layer.source === "document" ? BLUR_FILTER_ID : _chunkFRD3FUXIcjs.newLayerId.call(void 0, "flt")))),
|
|
6312
6316
|
kind: "blur",
|
|
6313
6317
|
enabled: true,
|
|
6314
6318
|
radius
|
|
@@ -6376,31 +6380,31 @@ function resizeLegacyMasks(layers, from, to) {
|
|
|
6376
6380
|
const th = Math.max(1, Math.round(to.height));
|
|
6377
6381
|
if (fw === tw && fh === th) return layers;
|
|
6378
6382
|
let out = layers;
|
|
6379
|
-
for (const l of
|
|
6383
|
+
for (const l of _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers)) {
|
|
6380
6384
|
if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
|
|
6381
6385
|
const old = l.mask;
|
|
6382
6386
|
const mask = rasterMaskFromLegacy(legacyMaskOf(old, fw, fh), tw, th);
|
|
6383
6387
|
if (!mask) continue;
|
|
6384
|
-
out =
|
|
6388
|
+
out = _chunkT3QZ6S47cjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
|
|
6385
6389
|
}
|
|
6386
6390
|
return out;
|
|
6387
6391
|
}
|
|
6388
6392
|
function isOpaqueInside(surface, width, height) {
|
|
6389
6393
|
const row = new Uint8ClampedArray(width * 4);
|
|
6390
6394
|
for (let y = 0; y < height; y++) {
|
|
6391
|
-
|
|
6395
|
+
_chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, { x: 0, y, width, height: 1 }, row);
|
|
6392
6396
|
for (let i = 3; i < row.length; i += 4) if (row[i] !== 255) return false;
|
|
6393
6397
|
}
|
|
6394
6398
|
return true;
|
|
6395
6399
|
}
|
|
6396
6400
|
function collectStateTiles(layers, into) {
|
|
6397
|
-
for (const l of
|
|
6398
|
-
if (l.type === "pixel" && l.source !== "document")
|
|
6399
|
-
if (l.mask && !l.mask.source)
|
|
6401
|
+
for (const l of _chunkT3QZ6S47cjs.flattenLayers.call(void 0, layers)) {
|
|
6402
|
+
if (l.type === "pixel" && l.source !== "document") _chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.surface, into);
|
|
6403
|
+
if (l.mask && !l.mask.source) _chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.mask.surface, into);
|
|
6400
6404
|
if (l.type === "smart") {
|
|
6401
|
-
|
|
6402
|
-
if (_optionalChain([l, 'access', _258 => _258.smartFilters, 'optionalAccess', _259 => _259.mask]))
|
|
6403
|
-
if (l.contents.raster)
|
|
6405
|
+
_chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.surface, into);
|
|
6406
|
+
if (_optionalChain([l, 'access', _258 => _258.smartFilters, 'optionalAccess', _259 => _259.mask])) _chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
|
|
6407
|
+
if (l.contents.raster) _chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.contents.raster, into);
|
|
6404
6408
|
if (l.contents.document) collectStateTiles(l.contents.document.layers, into);
|
|
6405
6409
|
}
|
|
6406
6410
|
}
|
|
@@ -6453,12 +6457,12 @@ function withoutAnnotations(layers) {
|
|
|
6453
6457
|
function parseColor(value) {
|
|
6454
6458
|
if (Array.isArray(value)) {
|
|
6455
6459
|
if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
|
|
6456
|
-
throw new (0,
|
|
6460
|
+
throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
|
|
6457
6461
|
}
|
|
6458
6462
|
return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
|
|
6459
6463
|
}
|
|
6460
6464
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
|
|
6461
|
-
if (!m) throw new (0,
|
|
6465
|
+
if (!m) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
|
|
6462
6466
|
let hex = m[1];
|
|
6463
6467
|
if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
|
|
6464
6468
|
const n = (i) => parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -6608,7 +6612,7 @@ function loadImageEditorDocument(input) {
|
|
|
6608
6612
|
// Optional: only present when something was selected when saving.
|
|
6609
6613
|
selection: {
|
|
6610
6614
|
parse: (value) => {
|
|
6611
|
-
const mask =
|
|
6615
|
+
const mask = _chunkFRD3FUXIcjs.deserializeSelection.call(void 0, value);
|
|
6612
6616
|
const v = value;
|
|
6613
6617
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
6614
6618
|
},
|
|
@@ -6696,7 +6700,7 @@ function loadLayeredDocument(doc) {
|
|
|
6696
6700
|
},
|
|
6697
6701
|
selection: {
|
|
6698
6702
|
parse: (value) => {
|
|
6699
|
-
const mask =
|
|
6703
|
+
const mask = _chunkFRD3FUXIcjs.deserializeSelection.call(void 0, value);
|
|
6700
6704
|
const v = value;
|
|
6701
6705
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
6702
6706
|
},
|
|
@@ -6898,6 +6902,150 @@ function readAdjustmentControls(adjustments) {
|
|
|
6898
6902
|
}
|
|
6899
6903
|
return out;
|
|
6900
6904
|
}
|
|
6905
|
+
var IMAGE_FILTER_PRESETS = [
|
|
6906
|
+
{
|
|
6907
|
+
id: "none",
|
|
6908
|
+
label: "Original",
|
|
6909
|
+
adjustments: {
|
|
6910
|
+
brightness: 0,
|
|
6911
|
+
contrast: 0,
|
|
6912
|
+
saturation: 0,
|
|
6913
|
+
exposure: 0,
|
|
6914
|
+
temperature: 0,
|
|
6915
|
+
tint: 0,
|
|
6916
|
+
blur: 0,
|
|
6917
|
+
opacity: 1
|
|
6918
|
+
}
|
|
6919
|
+
},
|
|
6920
|
+
{
|
|
6921
|
+
id: "dramatic",
|
|
6922
|
+
label: "Dramatic",
|
|
6923
|
+
adjustments: {
|
|
6924
|
+
brightness: -5,
|
|
6925
|
+
contrast: 45,
|
|
6926
|
+
saturation: 20,
|
|
6927
|
+
exposure: 5,
|
|
6928
|
+
temperature: -10,
|
|
6929
|
+
tint: 0
|
|
6930
|
+
}
|
|
6931
|
+
},
|
|
6932
|
+
{
|
|
6933
|
+
id: "cyberpunk",
|
|
6934
|
+
label: "Cyberpunk",
|
|
6935
|
+
adjustments: {
|
|
6936
|
+
brightness: 5,
|
|
6937
|
+
contrast: 35,
|
|
6938
|
+
saturation: 55,
|
|
6939
|
+
exposure: 0,
|
|
6940
|
+
temperature: -25,
|
|
6941
|
+
tint: 40
|
|
6942
|
+
}
|
|
6943
|
+
},
|
|
6944
|
+
{
|
|
6945
|
+
id: "vintage",
|
|
6946
|
+
label: "Vintage",
|
|
6947
|
+
adjustments: {
|
|
6948
|
+
brightness: 8,
|
|
6949
|
+
contrast: -15,
|
|
6950
|
+
saturation: -35,
|
|
6951
|
+
exposure: 5,
|
|
6952
|
+
temperature: 35,
|
|
6953
|
+
tint: 10
|
|
6954
|
+
}
|
|
6955
|
+
},
|
|
6956
|
+
{
|
|
6957
|
+
id: "warm",
|
|
6958
|
+
label: "Warm",
|
|
6959
|
+
adjustments: {
|
|
6960
|
+
brightness: 5,
|
|
6961
|
+
contrast: 10,
|
|
6962
|
+
saturation: 15,
|
|
6963
|
+
exposure: 0,
|
|
6964
|
+
temperature: 45,
|
|
6965
|
+
tint: 5
|
|
6966
|
+
}
|
|
6967
|
+
},
|
|
6968
|
+
{
|
|
6969
|
+
id: "cool",
|
|
6970
|
+
label: "Cool",
|
|
6971
|
+
adjustments: {
|
|
6972
|
+
brightness: 0,
|
|
6973
|
+
contrast: 15,
|
|
6974
|
+
saturation: 10,
|
|
6975
|
+
exposure: 0,
|
|
6976
|
+
temperature: -45,
|
|
6977
|
+
tint: -10
|
|
6978
|
+
}
|
|
6979
|
+
},
|
|
6980
|
+
{
|
|
6981
|
+
id: "grayscale",
|
|
6982
|
+
label: "B&W",
|
|
6983
|
+
adjustments: {
|
|
6984
|
+
brightness: 0,
|
|
6985
|
+
contrast: 20,
|
|
6986
|
+
saturation: -100,
|
|
6987
|
+
exposure: 0,
|
|
6988
|
+
temperature: 0,
|
|
6989
|
+
tint: 0
|
|
6990
|
+
}
|
|
6991
|
+
},
|
|
6992
|
+
{
|
|
6993
|
+
id: "noir",
|
|
6994
|
+
label: "Noir",
|
|
6995
|
+
adjustments: {
|
|
6996
|
+
brightness: -15,
|
|
6997
|
+
contrast: 65,
|
|
6998
|
+
saturation: -100,
|
|
6999
|
+
exposure: -5,
|
|
7000
|
+
temperature: 0,
|
|
7001
|
+
tint: 0
|
|
7002
|
+
}
|
|
7003
|
+
},
|
|
7004
|
+
{
|
|
7005
|
+
id: "fade",
|
|
7006
|
+
label: "Fade",
|
|
7007
|
+
adjustments: {
|
|
7008
|
+
brightness: 15,
|
|
7009
|
+
contrast: -25,
|
|
7010
|
+
saturation: -20,
|
|
7011
|
+
exposure: 10,
|
|
7012
|
+
temperature: 10,
|
|
7013
|
+
tint: 0
|
|
7014
|
+
}
|
|
7015
|
+
}
|
|
7016
|
+
];
|
|
7017
|
+
var IMAGE_CROP_PRESETS = [
|
|
7018
|
+
{ id: "free", label: "Free", aspectRatio: null },
|
|
7019
|
+
{ id: "1:1", label: "1:1", aspectRatio: 1 },
|
|
7020
|
+
{ id: "16:9", label: "16:9", aspectRatio: 16 / 9 },
|
|
7021
|
+
{ id: "4:3", label: "4:3", aspectRatio: 4 / 3 },
|
|
7022
|
+
{ id: "4:5", label: "4:5", aspectRatio: 4 / 5 },
|
|
7023
|
+
{ id: "9:16", label: "9:16", aspectRatio: 9 / 16 }
|
|
7024
|
+
];
|
|
7025
|
+
var DEPTH_MASK_CONTROLS = [
|
|
7026
|
+
{
|
|
7027
|
+
id: "near",
|
|
7028
|
+
label: "Near Threshold",
|
|
7029
|
+
section: "effects",
|
|
7030
|
+
min: 0,
|
|
7031
|
+
max: 255,
|
|
7032
|
+
step: 1,
|
|
7033
|
+
default: 0,
|
|
7034
|
+
decimals: 0,
|
|
7035
|
+
track: plain
|
|
7036
|
+
},
|
|
7037
|
+
{
|
|
7038
|
+
id: "far",
|
|
7039
|
+
label: "Far Threshold",
|
|
7040
|
+
section: "effects",
|
|
7041
|
+
min: 0,
|
|
7042
|
+
max: 255,
|
|
7043
|
+
step: 1,
|
|
7044
|
+
default: 255,
|
|
7045
|
+
decimals: 0,
|
|
7046
|
+
track: plain
|
|
7047
|
+
}
|
|
7048
|
+
];
|
|
6901
7049
|
|
|
6902
7050
|
// src/image-editor/selection/tool-options.ts
|
|
6903
7051
|
var SELECTION_TOOLS = [
|
|
@@ -6946,14 +7094,14 @@ function describeSelection(mask) {
|
|
|
6946
7094
|
// src/image-editor/selection-tools.ts
|
|
6947
7095
|
var modeSchema = {
|
|
6948
7096
|
type: "string",
|
|
6949
|
-
enum: [...
|
|
7097
|
+
enum: [..._chunkFRD3FUXIcjs.SELECTION_MODES],
|
|
6950
7098
|
description: "How the result combines with the current selection (default replace)."
|
|
6951
7099
|
};
|
|
6952
7100
|
var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
|
|
6953
7101
|
function summary(controller) {
|
|
6954
7102
|
const sel = controller.getSelection();
|
|
6955
7103
|
const { width, height } = controller.getState().imageDimensions;
|
|
6956
|
-
const area =
|
|
7104
|
+
const area = _chunkFRD3FUXIcjs.selectionArea.call(void 0, sel);
|
|
6957
7105
|
return {
|
|
6958
7106
|
empty: !sel,
|
|
6959
7107
|
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _269 => _269.bounds]), () => ( null)),
|
|
@@ -6999,7 +7147,7 @@ function createImageSelectionTools(controller) {
|
|
|
6999
7147
|
},
|
|
7000
7148
|
annotations: writeAnnotations("Select a region", true),
|
|
7001
7149
|
handler: ({ shape, x, y, width, height, mode, feather }) => {
|
|
7002
|
-
const opts = { mode:
|
|
7150
|
+
const opts = { mode: _chunkFRD3FUXIcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
|
|
7003
7151
|
switch (shape) {
|
|
7004
7152
|
case "all":
|
|
7005
7153
|
controller.selectAll();
|
|
@@ -7052,7 +7200,7 @@ function createImageSelectionTools(controller) {
|
|
|
7052
7200
|
annotations: writeAnnotations("Select by colour", true),
|
|
7053
7201
|
handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
|
|
7054
7202
|
const common = {
|
|
7055
|
-
mode:
|
|
7203
|
+
mode: _chunkFRD3FUXIcjs.parseSelectionMode.call(void 0, mode),
|
|
7056
7204
|
sampleMerged: sampleMerged === true,
|
|
7057
7205
|
sample: _nullishCoalesce(sample, () => ( "composite"))
|
|
7058
7206
|
};
|
|
@@ -7073,7 +7221,7 @@ function createImageSelectionTools(controller) {
|
|
|
7073
7221
|
inputSchema: {
|
|
7074
7222
|
type: "object",
|
|
7075
7223
|
properties: {
|
|
7076
|
-
op: { type: "string", enum: [...
|
|
7224
|
+
op: { type: "string", enum: [..._chunkFRD3FUXIcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
|
|
7077
7225
|
radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
|
|
7078
7226
|
},
|
|
7079
7227
|
required: ["op", "radius"],
|
|
@@ -7081,7 +7229,7 @@ function createImageSelectionTools(controller) {
|
|
|
7081
7229
|
},
|
|
7082
7230
|
annotations: writeAnnotations("Modify the selection"),
|
|
7083
7231
|
handler: ({ op, radius }) => {
|
|
7084
|
-
if (!
|
|
7232
|
+
if (!_chunkFRD3FUXIcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
|
|
7085
7233
|
if (!controller.getSelection()) throw new Error("Nothing is selected.");
|
|
7086
7234
|
controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
|
|
7087
7235
|
return summary(controller);
|
|
@@ -7125,7 +7273,7 @@ function createImageSelectionTools(controller) {
|
|
|
7125
7273
|
type: "object",
|
|
7126
7274
|
properties: {
|
|
7127
7275
|
layerId: { type: "string", description: "Existing adjustment layer to mask." },
|
|
7128
|
-
kind: { type: "string", enum:
|
|
7276
|
+
kind: { type: "string", enum: _chunkFRD3FUXIcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
|
|
7129
7277
|
params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
|
|
7130
7278
|
density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
|
|
7131
7279
|
feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
|
|
@@ -7145,11 +7293,11 @@ function createImageSelectionTools(controller) {
|
|
|
7145
7293
|
if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
|
|
7146
7294
|
controller.applySelectionAsLayerMask(layerId, props);
|
|
7147
7295
|
id = layerId;
|
|
7148
|
-
} else if (
|
|
7296
|
+
} else if (_chunkFRD3FUXIcjs.isAdjustmentKind.call(void 0, kind)) {
|
|
7149
7297
|
id = controller.addAdjustmentLayer({
|
|
7150
7298
|
kind,
|
|
7151
7299
|
params,
|
|
7152
|
-
mask:
|
|
7300
|
+
mask: _chunkFRD3FUXIcjs.layerMaskFromSelection.call(void 0, sel, props)
|
|
7153
7301
|
});
|
|
7154
7302
|
} else {
|
|
7155
7303
|
throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
|
|
@@ -7286,11 +7434,11 @@ function createImageEditTools(controller) {
|
|
|
7286
7434
|
const geometry = () => {
|
|
7287
7435
|
const s = controller.getState();
|
|
7288
7436
|
const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
|
|
7289
|
-
const out =
|
|
7437
|
+
const out = _chunkFRD3FUXIcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
|
|
7290
7438
|
return {
|
|
7291
7439
|
image: { ...s.imageDimensions },
|
|
7292
7440
|
crop: s.crop ? { ...s.crop } : null,
|
|
7293
|
-
rotation:
|
|
7441
|
+
rotation: _chunkFRD3FUXIcjs.normalizeAngle.call(void 0, s.transform.rotate),
|
|
7294
7442
|
flipH: s.transform.flipH,
|
|
7295
7443
|
flipV: s.transform.flipV,
|
|
7296
7444
|
output: { width: Math.round(out.width), height: Math.round(out.height) }
|
|
@@ -7337,7 +7485,7 @@ function createImageEditTools(controller) {
|
|
|
7337
7485
|
properties: {
|
|
7338
7486
|
layer: LAYER_ID,
|
|
7339
7487
|
enabled: { type: "boolean", description: "false hides the layer without deleting it." },
|
|
7340
|
-
blend: { type: "string", enum:
|
|
7488
|
+
blend: { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (see list_controls)." },
|
|
7341
7489
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1." },
|
|
7342
7490
|
name: { type: "string", description: "Layer name shown in the layers panel." }
|
|
7343
7491
|
},
|
|
@@ -7350,7 +7498,7 @@ function createImageEditTools(controller) {
|
|
|
7350
7498
|
if (enabled === void 0 && blend === void 0 && opacity === void 0 && name === void 0) {
|
|
7351
7499
|
throw new Error("Nothing to change. Pass enabled, blend, opacity or name.");
|
|
7352
7500
|
}
|
|
7353
|
-
if (blend !== void 0 && !
|
|
7501
|
+
if (blend !== void 0 && !_chunkSZ6KMZNMcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
7354
7502
|
controller.updateAdjustmentLayer(layer, { enabled, blend, opacity, name });
|
|
7355
7503
|
return { layer: layerJson(layer) };
|
|
7356
7504
|
}
|
|
@@ -7504,7 +7652,7 @@ function maskSummary(mask) {
|
|
|
7504
7652
|
};
|
|
7505
7653
|
if (!mask.source) {
|
|
7506
7654
|
out.defaultValue = mask.defaultValue;
|
|
7507
|
-
out.paintedBounds =
|
|
7655
|
+
out.paintedBounds = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, mask.surface);
|
|
7508
7656
|
}
|
|
7509
7657
|
return out;
|
|
7510
7658
|
}
|
|
@@ -7512,7 +7660,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
7512
7660
|
const out = {
|
|
7513
7661
|
id: layer.id,
|
|
7514
7662
|
type: layer.type,
|
|
7515
|
-
name: layer.name || (layer.type === "adjustment" ?
|
|
7663
|
+
name: layer.name || (layer.type === "adjustment" ? _chunkFRD3FUXIcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
|
|
7516
7664
|
visible: layer.visible,
|
|
7517
7665
|
opacity: round3(layer.opacity),
|
|
7518
7666
|
blend: layer.blend,
|
|
@@ -7558,7 +7706,7 @@ var PLACEMENT = {
|
|
|
7558
7706
|
parentId: { type: "string", description: "Put the layer inside this group (at index, default its top)." },
|
|
7559
7707
|
index: { type: "integer", minimum: 0, description: "Position among the siblings, 0 = bottom (with parentId, or at the top level)." }
|
|
7560
7708
|
};
|
|
7561
|
-
var BLEND = { type: "string", enum:
|
|
7709
|
+
var BLEND = { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." };
|
|
7562
7710
|
function placementFrom(args) {
|
|
7563
7711
|
const p = {};
|
|
7564
7712
|
if (typeof args.aboveId === "string") p.aboveId = args.aboveId;
|
|
@@ -7570,7 +7718,7 @@ function placementFrom(args) {
|
|
|
7570
7718
|
function createImageLayerTools(controller) {
|
|
7571
7719
|
const describe = (id) => {
|
|
7572
7720
|
const s = controller.getState();
|
|
7573
|
-
const loc =
|
|
7721
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, s.layers, id);
|
|
7574
7722
|
if (!loc) return null;
|
|
7575
7723
|
return {
|
|
7576
7724
|
...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
|
|
@@ -7579,8 +7727,8 @@ function createImageLayerTools(controller) {
|
|
|
7579
7727
|
};
|
|
7580
7728
|
};
|
|
7581
7729
|
const exists = (id, what = "layerId") => {
|
|
7582
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
7583
|
-
|
|
7730
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
|
|
7731
|
+
_chunkFRD3FUXIcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
7584
7732
|
return id;
|
|
7585
7733
|
};
|
|
7586
7734
|
const listLayers = {
|
|
@@ -7616,7 +7764,7 @@ function createImageLayerTools(controller) {
|
|
|
7616
7764
|
handler: ({ layerId, target }) => {
|
|
7617
7765
|
const id = exists(layerId);
|
|
7618
7766
|
const layer = controller.getLayer(id);
|
|
7619
|
-
if (target === "mask" && !layer.mask) throw new (0,
|
|
7767
|
+
if (target === "mask" && !layer.mask) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
7620
7768
|
controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
|
|
7621
7769
|
return { layer: describe(id), activeTarget: controller.getState().activeTarget };
|
|
7622
7770
|
}
|
|
@@ -7641,7 +7789,7 @@ function createImageLayerTools(controller) {
|
|
|
7641
7789
|
},
|
|
7642
7790
|
annotations: { title: "Add a pixel layer", ...WRITE2 },
|
|
7643
7791
|
handler: async (args) => {
|
|
7644
|
-
if (args.color !== void 0 && args.image !== void 0) throw new (0,
|
|
7792
|
+
if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give color or image, not both.");
|
|
7645
7793
|
for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
|
|
7646
7794
|
const init = {
|
|
7647
7795
|
name: args.name,
|
|
@@ -7708,7 +7856,7 @@ function createImageLayerTools(controller) {
|
|
|
7708
7856
|
visible: { type: "boolean", description: "Show (true) or hide (false)." },
|
|
7709
7857
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0..1." },
|
|
7710
7858
|
fillOpacity: { type: "number", minimum: 0, maximum: 1, description: "Fill 0..1 (pixel layers)." },
|
|
7711
|
-
blend: { type: "string", enum: [...
|
|
7859
|
+
blend: { type: "string", enum: [..._chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), "pass-through"], description: "Blend mode; pass-through for groups only." },
|
|
7712
7860
|
clipped: { type: "boolean", description: "Clip to the nearest unclipped layer below." },
|
|
7713
7861
|
locks: {
|
|
7714
7862
|
type: "object",
|
|
@@ -7731,7 +7879,7 @@ function createImageLayerTools(controller) {
|
|
|
7731
7879
|
const id = exists(args.layerId);
|
|
7732
7880
|
const props = {};
|
|
7733
7881
|
for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
|
|
7734
|
-
if (!Object.keys(props).length) throw new (0,
|
|
7882
|
+
if (!Object.keys(props).length) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give at least one property to change.");
|
|
7735
7883
|
controller.setLayerProperties(id, props);
|
|
7736
7884
|
return { layer: describe(id) };
|
|
7737
7885
|
}
|
|
@@ -7763,7 +7911,7 @@ function createImageLayerTools(controller) {
|
|
|
7763
7911
|
type: "object",
|
|
7764
7912
|
properties: {
|
|
7765
7913
|
name: { type: "string", description: 'Group name (default "Group").' },
|
|
7766
|
-
blend: { type: "string", enum: [...
|
|
7914
|
+
blend: { type: "string", enum: [..._chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), "pass-through"], description: "Blend mode (default pass-through)." },
|
|
7767
7915
|
...PLACEMENT
|
|
7768
7916
|
},
|
|
7769
7917
|
additionalProperties: false
|
|
@@ -7825,8 +7973,8 @@ function createImageLayerTools(controller) {
|
|
|
7825
7973
|
annotations: { title: "Move a layer's pixels", ...WRITE2 },
|
|
7826
7974
|
handler: ({ layerId, x, y, dx, dy }) => {
|
|
7827
7975
|
const id = exists(layerId);
|
|
7828
|
-
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0,
|
|
7829
|
-
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0,
|
|
7976
|
+
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give x and y, or dx and dy.");
|
|
7977
|
+
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
|
|
7830
7978
|
return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
|
|
7831
7979
|
}
|
|
7832
7980
|
};
|
|
@@ -7898,7 +8046,7 @@ function createImageLayerTools(controller) {
|
|
|
7898
8046
|
annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
|
|
7899
8047
|
handler: ({ layerId, density, feather, enabled, linked }) => {
|
|
7900
8048
|
const id = exists(layerId);
|
|
7901
|
-
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0,
|
|
8049
|
+
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give density, feather, enabled or linked.");
|
|
7902
8050
|
const mask = controller.setLayerMaskProps(id, {
|
|
7903
8051
|
density,
|
|
7904
8052
|
feather,
|
|
@@ -7981,7 +8129,7 @@ function createImageLayerTools(controller) {
|
|
|
7981
8129
|
handler: (args) => {
|
|
7982
8130
|
const id = exists(args.layerId);
|
|
7983
8131
|
const changes = filterValues(args);
|
|
7984
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
8132
|
+
if (!Object.keys(changes).length) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give at least one value to change.");
|
|
7985
8133
|
return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
|
|
7986
8134
|
}
|
|
7987
8135
|
};
|
|
@@ -8035,7 +8183,7 @@ var WRITE_IDEMPOTENT3 = { readOnlyHint: false, destructiveHint: false, idempoten
|
|
|
8035
8183
|
var DESTRUCTIVE2 = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false };
|
|
8036
8184
|
var LAYER_ID3 = { type: "string", description: "Layer id from list_layers (a pixel, annotation or group layer)." };
|
|
8037
8185
|
var EFFECT_ID = { type: "string", description: "Effect id from list_layer_effects or add_layer_effect." };
|
|
8038
|
-
var BLEND_IDS =
|
|
8186
|
+
var BLEND_IDS = _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id).filter((id) => id !== "pigment");
|
|
8039
8187
|
var DEFS = {
|
|
8040
8188
|
color: { type: "string", pattern: "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$", description: "Colour as #rrggbb." },
|
|
8041
8189
|
contour: {
|
|
@@ -8228,8 +8376,8 @@ function settingsSchema(forUpdate) {
|
|
|
8228
8376
|
}
|
|
8229
8377
|
function patternList(controller) {
|
|
8230
8378
|
const doc = controller.getDocumentPatterns().map((p) => ({ id: p.id, name: p.name, width: p.width, height: p.height, builtin: false }));
|
|
8231
|
-
const builtins =
|
|
8232
|
-
const p =
|
|
8379
|
+
const builtins = _chunkT3QZ6S47cjs.builtinPatternIds.call(void 0, ).map((id) => {
|
|
8380
|
+
const p = _chunkT3QZ6S47cjs.builtinPattern.call(void 0, id);
|
|
8233
8381
|
return { id, name: p.name, width: p.width, height: p.height, builtin: true };
|
|
8234
8382
|
});
|
|
8235
8383
|
return [...doc, ...builtins];
|
|
@@ -8238,15 +8386,15 @@ function describeLayerEffects(effects) {
|
|
|
8238
8386
|
return {
|
|
8239
8387
|
enabled: effects.enabled,
|
|
8240
8388
|
scale: _nullishCoalesce(effects.scale, () => ( 1)),
|
|
8241
|
-
margin:
|
|
8389
|
+
margin: _chunkT3QZ6S47cjs.effectsMargin.call(void 0, effects),
|
|
8242
8390
|
fromPsd: Boolean(effects.psd),
|
|
8243
|
-
effects: effects.items.map((e) => ({ ...JSON.parse(JSON.stringify(e)), label:
|
|
8391
|
+
effects: effects.items.map((e) => ({ ...JSON.parse(JSON.stringify(e)), label: _chunkT3QZ6S47cjs.layerEffectLabel.call(void 0, e.kind) }))
|
|
8244
8392
|
};
|
|
8245
8393
|
}
|
|
8246
8394
|
function createImageEffectTools(controller) {
|
|
8247
8395
|
const layerArg = (id) => {
|
|
8248
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
8249
|
-
|
|
8396
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
|
|
8397
|
+
_chunkFRD3FUXIcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
8250
8398
|
return id;
|
|
8251
8399
|
};
|
|
8252
8400
|
const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
|
|
@@ -8256,7 +8404,7 @@ function createImageEffectTools(controller) {
|
|
|
8256
8404
|
description: "Returns a layer's effects: the master switch (enabled), Scale Effects (scale, 1 = 100 %), margin (px the effects reach beyond the shape), whether they came from a PSD, and every effect with its id, kind, label and all settings. Also returns the document global light and the pattern ids pattern effects can use.",
|
|
8257
8405
|
inputSchema: { type: "object", properties: { layerId: LAYER_ID3 }, required: ["layerId"], additionalProperties: false },
|
|
8258
8406
|
annotations: { title: "List layer effects", ...READ3 },
|
|
8259
|
-
handler: ({ layerId }) => result(layerArg(layerId), { globalLight: controller.getGlobalLight(), patterns: patternList(controller), kinds: [...
|
|
8407
|
+
handler: ({ layerId }) => result(layerArg(layerId), { globalLight: controller.getGlobalLight(), patterns: patternList(controller), kinds: [..._chunkT3QZ6S47cjs.LAYER_EFFECT_KINDS] })
|
|
8260
8408
|
};
|
|
8261
8409
|
const add2 = {
|
|
8262
8410
|
name: "add_layer_effect",
|
|
@@ -8267,7 +8415,7 @@ function createImageEffectTools(controller) {
|
|
|
8267
8415
|
$defs: DEFS,
|
|
8268
8416
|
properties: {
|
|
8269
8417
|
layerId: LAYER_ID3,
|
|
8270
|
-
kind: { type: "string", enum: [...
|
|
8418
|
+
kind: { type: "string", enum: [..._chunkT3QZ6S47cjs.LAYER_EFFECT_KINDS], description: "Effect kind." },
|
|
8271
8419
|
settings: settingsSchema(false),
|
|
8272
8420
|
index: { type: "integer", minimum: 0, description: "Position in the layer's effect list (default the end)." }
|
|
8273
8421
|
},
|
|
@@ -8277,7 +8425,7 @@ function createImageEffectTools(controller) {
|
|
|
8277
8425
|
annotations: { title: "Add a layer effect", ...WRITE3 },
|
|
8278
8426
|
handler: ({ layerId, kind, settings, index }) => {
|
|
8279
8427
|
const id = layerArg(layerId);
|
|
8280
|
-
if (!
|
|
8428
|
+
if (!_chunkT3QZ6S47cjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`kind must be one of ${_chunkT3QZ6S47cjs.LAYER_EFFECT_KINDS.join(", ")}.`);
|
|
8281
8429
|
const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
|
|
8282
8430
|
return result(id, { effectId: effect.id });
|
|
8283
8431
|
}
|
|
@@ -8297,7 +8445,7 @@ function createImageEffectTools(controller) {
|
|
|
8297
8445
|
handler: ({ layerId, effectId, settings }) => {
|
|
8298
8446
|
const id = layerArg(layerId);
|
|
8299
8447
|
const changes = _nullishCoalesce(settings, () => ( {}));
|
|
8300
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
8448
|
+
if (!Object.keys(changes).length) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give at least one setting to change.");
|
|
8301
8449
|
controller.updateLayerEffect(id, effectId, changes);
|
|
8302
8450
|
return result(id);
|
|
8303
8451
|
}
|
|
@@ -8349,7 +8497,7 @@ function createImageEffectTools(controller) {
|
|
|
8349
8497
|
},
|
|
8350
8498
|
annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
|
|
8351
8499
|
handler: ({ angle, altitude }) => {
|
|
8352
|
-
if (angle === void 0 && altitude === void 0) throw new (0,
|
|
8500
|
+
if (angle === void 0 && altitude === void 0) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give angle, altitude or both.");
|
|
8353
8501
|
const next = {};
|
|
8354
8502
|
if (angle !== void 0) next.angle = angle;
|
|
8355
8503
|
if (altitude !== void 0) next.altitude = altitude;
|
|
@@ -8423,7 +8571,7 @@ function handlePaintShortcut(controller, e) {
|
|
|
8423
8571
|
}
|
|
8424
8572
|
if (key === "]" || key === "}") {
|
|
8425
8573
|
if (e.shiftKey || key === "}") set({ hardness: Math.min(1, Math.round((brush.hardness + 0.25) * 4) / 4) });
|
|
8426
|
-
else set({ size: Math.min(
|
|
8574
|
+
else set({ size: Math.min(_chunkHUFQD4CBcjs.MAX_BRUSH_SIZE, brush.size + sizeStep(brush.size)) });
|
|
8427
8575
|
return true;
|
|
8428
8576
|
}
|
|
8429
8577
|
if (/^[0-9]$/.test(key) && isPaintTool(controller.getState().activeTool)) {
|
|
@@ -8527,7 +8675,7 @@ var BRUSH = {
|
|
|
8527
8675
|
type: "object",
|
|
8528
8676
|
description: "Brush settings; missing fields use the current paint options (default round, hard, 20 px).",
|
|
8529
8677
|
properties: {
|
|
8530
|
-
size: { type: "number", minimum: 1, maximum:
|
|
8678
|
+
size: { type: "number", minimum: 1, maximum: _chunkHUFQD4CBcjs.MAX_BRUSH_SIZE, description: "Diameter in px (default 20)." },
|
|
8531
8679
|
hardness: { type: "number", minimum: 0, maximum: 1, description: "Edge hardness 0 (soft) .. 1 (hard, default)." },
|
|
8532
8680
|
spacing: { type: "number", minimum: 0.01, maximum: 10, description: "Dab spacing as a fraction of the diameter (default 0.1)." },
|
|
8533
8681
|
angle: { type: "number", minimum: -360, maximum: 360, description: "Tip angle in degrees (default 0)." },
|
|
@@ -8537,7 +8685,7 @@ var BRUSH = {
|
|
|
8537
8685
|
smoothing: { type: "number", minimum: 0, maximum: 0.95, description: "Point smoothing 0..0.95 (default 0)." },
|
|
8538
8686
|
pressureSize: { type: "boolean", description: "Point pressure scales the size (default true)." },
|
|
8539
8687
|
pressureOpacity: { type: "boolean", description: "Point pressure scales the opacity (default false)." },
|
|
8540
|
-
blend: { type: "string", enum:
|
|
8688
|
+
blend: { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "How paint combines with the layer (default normal). pigment mixes it in like real paint (blue into yellow gives green) instead of laying it over." }
|
|
8541
8689
|
},
|
|
8542
8690
|
additionalProperties: false
|
|
8543
8691
|
};
|
|
@@ -8550,7 +8698,7 @@ var MIXER = {
|
|
|
8550
8698
|
mix: { type: "number", minimum: 0, maximum: 1, description: "How far each dab's paint moves from the reservoir towards the picked-up colour, 0 .. 1 (default 0.5)." },
|
|
8551
8699
|
loadEachStroke: { type: "boolean", description: "Refill the reservoir with `color` (or the foreground) before the stroke (default true). Off, the brush keeps what is left of its last load." },
|
|
8552
8700
|
cleanEachStroke: { type: "boolean", description: "Empty the pickup well after the stroke (default true). Off, the next stroke starts with the colour this one picked up." },
|
|
8553
|
-
mixing: { type: "string", enum: [...
|
|
8701
|
+
mixing: { type: "string", enum: [..._chunkHUFQD4CBcjs.MIXING_MODELS], description: "rgb (default): RGB averages. pigment: mixes like paint (Kubelka-Munk), so blue dragged through yellow makes green." }
|
|
8554
8702
|
},
|
|
8555
8703
|
additionalProperties: false
|
|
8556
8704
|
};
|
|
@@ -8603,7 +8751,7 @@ function createImagePaintTools(controller) {
|
|
|
8603
8751
|
annotations: { title: "Paint a brush stroke", ...WRITE4 },
|
|
8604
8752
|
handler: (args) => {
|
|
8605
8753
|
const tool = args.tool;
|
|
8606
|
-
if (args.mixer !== void 0 && tool !== "mixer") throw new (0,
|
|
8754
|
+
if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
|
|
8607
8755
|
const result = controller.paintStroke({
|
|
8608
8756
|
tool,
|
|
8609
8757
|
points: args.points,
|
|
@@ -8659,7 +8807,7 @@ function createImagePaintTools(controller) {
|
|
|
8659
8807
|
properties: {
|
|
8660
8808
|
color: { type: "string", description: "Fill colour #rrggbb or #rrggbbaa (default the foreground)." },
|
|
8661
8809
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Fill opacity 0..1 (default 1)." },
|
|
8662
|
-
blend: { type: "string", enum:
|
|
8810
|
+
blend: { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal). pigment mixes the colour into the pixels like paint, opacity being the share of new paint." },
|
|
8663
8811
|
useSelection: { type: "boolean", description: "Limit to the selection when there is one (default true)." },
|
|
8664
8812
|
...TARGET
|
|
8665
8813
|
},
|
|
@@ -8702,11 +8850,11 @@ var DATA = {
|
|
|
8702
8850
|
description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
|
|
8703
8851
|
};
|
|
8704
8852
|
function psdBytesFromBase64(data) {
|
|
8705
|
-
if (typeof data !== "string" || !data.trim()) throw new (0,
|
|
8853
|
+
if (typeof data !== "string" || !data.trim()) throw new (0, _chunkFRD3FUXIcjs.PsdError)("data is required: the PSD file as base64.");
|
|
8706
8854
|
const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
|
|
8707
|
-
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0,
|
|
8708
|
-
const bytes =
|
|
8709
|
-
if (bytes.length < 26) throw new (0,
|
|
8855
|
+
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkFRD3FUXIcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
|
|
8856
|
+
const bytes = _chunkT3QZ6S47cjs.base64ToBytes.call(void 0, body);
|
|
8857
|
+
if (bytes.length < 26) throw new (0, _chunkFRD3FUXIcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
|
|
8710
8858
|
return bytes;
|
|
8711
8859
|
}
|
|
8712
8860
|
function createImagePsdTools(controller) {
|
|
@@ -8717,7 +8865,7 @@ function createImagePsdTools(controller) {
|
|
|
8717
8865
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
8718
8866
|
annotations: { title: "Inspect a PSD", ...READ5 },
|
|
8719
8867
|
handler: ({ data }) => {
|
|
8720
|
-
const res =
|
|
8868
|
+
const res = _chunkFRD3FUXIcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
|
|
8721
8869
|
return {
|
|
8722
8870
|
width: res.width,
|
|
8723
8871
|
height: res.height,
|
|
@@ -8756,7 +8904,7 @@ function createImagePsdTools(controller) {
|
|
|
8756
8904
|
handler: async () => {
|
|
8757
8905
|
const res = await controller.toPsd();
|
|
8758
8906
|
return {
|
|
8759
|
-
data:
|
|
8907
|
+
data: _chunkT3QZ6S47cjs.bytesToBase64.call(void 0, res.bytes),
|
|
8760
8908
|
mimeType: "image/vnd.adobe.photoshop",
|
|
8761
8909
|
size: res.bytes.length,
|
|
8762
8910
|
psb: res.psb,
|
|
@@ -8792,7 +8940,7 @@ var TARGET2 = {
|
|
|
8792
8940
|
enum: ["pixels", "mask"],
|
|
8793
8941
|
description: "pixels (default) moves the pixels and a linked mask; mask moves an unlinked mask alone (a linked mask always moves with its pixels)."
|
|
8794
8942
|
},
|
|
8795
|
-
interpolation: { type: "string", enum:
|
|
8943
|
+
interpolation: { type: "string", enum: _chunkT3QZ6S47cjs.INTERPOLATIONS, description: "Resampling: nearest (hard pixels), bilinear or bicubic (default, Photoshop\u2019s Bicubic)." }
|
|
8796
8944
|
};
|
|
8797
8945
|
var GEOMETRY = {
|
|
8798
8946
|
scaleX: { type: "number", description: "Width in percent of the frame (default 100; negative flips horizontally)." },
|
|
@@ -8804,7 +8952,7 @@ var GEOMETRY = {
|
|
|
8804
8952
|
dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
|
|
8805
8953
|
reference: {
|
|
8806
8954
|
description: "Fixed point of scale, skew and rotate: an anchor of the frame (top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right; default center) or a document point {x, y}.",
|
|
8807
|
-
anyOf: [{ type: "string", enum:
|
|
8955
|
+
anyOf: [{ type: "string", enum: _chunkFRD3FUXIcjs.TRANSFORM_ANCHORS }, POINT]
|
|
8808
8956
|
},
|
|
8809
8957
|
matrix: {
|
|
8810
8958
|
type: "array",
|
|
@@ -8825,14 +8973,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
|
|
|
8825
8973
|
function geometryFrom(args) {
|
|
8826
8974
|
const numeric = NUMERIC.filter((k) => args[k] !== void 0);
|
|
8827
8975
|
const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
|
|
8828
|
-
if (ways === 0) throw new (0,
|
|
8829
|
-
if (ways > 1) throw new (0,
|
|
8976
|
+
if (ways === 0) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
|
|
8977
|
+
if (ways > 1) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
|
|
8830
8978
|
if (args.matrix !== void 0) return { matrix: args.matrix };
|
|
8831
8979
|
if (args.corners !== void 0) return { corners: args.corners };
|
|
8832
8980
|
const params = {};
|
|
8833
8981
|
for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
|
|
8834
|
-
if (params.scaleX === 0 || params.scaleY === 0) throw new (0,
|
|
8835
|
-
if (typeof params.reference === "string" && !
|
|
8982
|
+
if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
|
|
8983
|
+
if (typeof params.reference === "string" && !_chunkFRD3FUXIcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkFRD3FUXIcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
|
|
8836
8984
|
return { params };
|
|
8837
8985
|
}
|
|
8838
8986
|
function targetFrom(args) {
|
|
@@ -8881,7 +9029,7 @@ function createImageTransformTools(controller) {
|
|
|
8881
9029
|
moved: [...s.moves],
|
|
8882
9030
|
frame: { ...s.box },
|
|
8883
9031
|
corners: s.startGeometry.corners.map(roundPoint),
|
|
8884
|
-
center: roundPoint(
|
|
9032
|
+
center: roundPoint(_chunkFRD3FUXIcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
|
|
8885
9033
|
};
|
|
8886
9034
|
if (s.smartObject) out.smartObject = true;
|
|
8887
9035
|
s.cancel();
|
|
@@ -8936,11 +9084,11 @@ function createImageTransformTools(controller) {
|
|
|
8936
9084
|
annotations: { title: "Warp a layer", ...WRITE5 },
|
|
8937
9085
|
handler: (args) => {
|
|
8938
9086
|
const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
|
|
8939
|
-
if (hasPreset && args.mesh !== void 0) throw new (0,
|
|
8940
|
-
if (!hasPreset && args.mesh === void 0) throw new (0,
|
|
9087
|
+
if (hasPreset && args.mesh !== void 0) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
|
|
9088
|
+
if (!hasPreset && args.mesh === void 0) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give a preset style or a mesh.");
|
|
8941
9089
|
let warp;
|
|
8942
9090
|
if (hasPreset) {
|
|
8943
|
-
if (args.style === void 0) throw new (0,
|
|
9091
|
+
if (args.style === void 0) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkDWGZUSEScjs.WARP_STYLES.join(", ")}.`);
|
|
8944
9092
|
warp = {
|
|
8945
9093
|
style: args.style,
|
|
8946
9094
|
bend: _nullishCoalesce(args.bend, () => ( 50)),
|
|
@@ -8951,7 +9099,7 @@ function createImageTransformTools(controller) {
|
|
|
8951
9099
|
} else {
|
|
8952
9100
|
const m = args.mesh;
|
|
8953
9101
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
8954
|
-
if (m.points.length !== want) throw new (0,
|
|
9102
|
+
if (m.points.length !== want) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
|
|
8955
9103
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
8956
9104
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
8957
9105
|
}
|
|
@@ -9027,7 +9175,7 @@ var POINT2 = {
|
|
|
9027
9175
|
required: ["x", "y"],
|
|
9028
9176
|
additionalProperties: false
|
|
9029
9177
|
};
|
|
9030
|
-
var FILTER_BLENDS =
|
|
9178
|
+
var FILTER_BLENDS = _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id).filter((m) => m !== "pigment");
|
|
9031
9179
|
var FILTER_SETTINGS = {
|
|
9032
9180
|
enabled: { type: "boolean", description: "false keeps the filter but skips it (the eye in the Layers panel; default true)." },
|
|
9033
9181
|
blend: { type: "string", enum: FILTER_BLENDS, description: "How the filter\u2019s result blends with the result below it (Blending Options; default normal)." },
|
|
@@ -9046,13 +9194,13 @@ function settingsFrom(args) {
|
|
|
9046
9194
|
return out;
|
|
9047
9195
|
}
|
|
9048
9196
|
function imageArg(image) {
|
|
9049
|
-
if (typeof image !== "string" || !image.trim()) throw new (0,
|
|
9197
|
+
if (typeof image !== "string" || !image.trim()) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
|
|
9050
9198
|
return image.trim();
|
|
9051
9199
|
}
|
|
9052
9200
|
function createImageSmartObjectTools(controller) {
|
|
9053
9201
|
const smartId = (id) => {
|
|
9054
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
9055
|
-
|
|
9202
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
|
|
9203
|
+
_chunkFRD3FUXIcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
|
|
9056
9204
|
return id;
|
|
9057
9205
|
};
|
|
9058
9206
|
const info = (id) => {
|
|
@@ -9064,7 +9212,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9064
9212
|
};
|
|
9065
9213
|
const layerSummary = (id) => {
|
|
9066
9214
|
const s = controller.getState();
|
|
9067
|
-
const loc =
|
|
9215
|
+
const loc = _chunkT3QZ6S47cjs.findLayer.call(void 0, s.layers, id);
|
|
9068
9216
|
return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _288 => _288.parent, 'optionalAccess', _289 => _289.id]), () => ( null)), index: loc.index } : null;
|
|
9069
9217
|
};
|
|
9070
9218
|
const getSmart = {
|
|
@@ -9089,7 +9237,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9089
9237
|
},
|
|
9090
9238
|
annotations: { title: "Convert to Smart Object", ...WRITE6 },
|
|
9091
9239
|
handler: ({ layerIds, name }) => {
|
|
9092
|
-
for (const id2 of _nullishCoalesce(layerIds, () => ( [])))
|
|
9240
|
+
for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkFRD3FUXIcjs.requireLayer.call(void 0, controller.getLayers(), id2);
|
|
9093
9241
|
const id = controller.convertToSmartObject(layerIds, { name });
|
|
9094
9242
|
return { layer: layerSummary(id), smartObject: info(id) };
|
|
9095
9243
|
}
|
|
@@ -9147,7 +9295,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9147
9295
|
}
|
|
9148
9296
|
]
|
|
9149
9297
|
},
|
|
9150
|
-
interpolation: { type: "string", enum:
|
|
9298
|
+
interpolation: { type: "string", enum: _chunkT3QZ6S47cjs.INTERPOLATIONS, description: "Resampling: nearest, bilinear or bicubic (default: as before, bicubic for new smart objects)." }
|
|
9151
9299
|
},
|
|
9152
9300
|
required: ["layerId"],
|
|
9153
9301
|
additionalProperties: false
|
|
@@ -9162,12 +9310,12 @@ function createImageSmartObjectTools(controller) {
|
|
|
9162
9310
|
else if (w) {
|
|
9163
9311
|
const m = w;
|
|
9164
9312
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
9165
|
-
if (m.points.length !== want) throw new (0,
|
|
9313
|
+
if (m.points.length !== want) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
|
|
9166
9314
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
9167
9315
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
9168
9316
|
}
|
|
9169
9317
|
const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
|
|
9170
|
-
if (!keys.some((k) => args[k] !== void 0)) throw new (0,
|
|
9318
|
+
if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
|
|
9171
9319
|
const res = controller.setSmartObjectTransform(id, {
|
|
9172
9320
|
corners: args.corners,
|
|
9173
9321
|
matrix: args.matrix,
|
|
@@ -9209,7 +9357,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9209
9357
|
annotations: { title: "Export a smart object\u2019s contents", ...READ7 },
|
|
9210
9358
|
handler: ({ layerId }) => {
|
|
9211
9359
|
const f = controller.exportSmartObjectContents(smartId(layerId));
|
|
9212
|
-
return { name: f.name, mimeType: f.mimeType, byteLength: f.bytes.length, base64:
|
|
9360
|
+
return { name: f.name, mimeType: f.mimeType, byteLength: f.bytes.length, base64: _chunkT3QZ6S47cjs.bytesToBase64.call(void 0, f.bytes) };
|
|
9213
9361
|
}
|
|
9214
9362
|
};
|
|
9215
9363
|
const copy = {
|
|
@@ -9292,7 +9440,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9292
9440
|
handler: (args) => {
|
|
9293
9441
|
const id = smartId(args.layerId);
|
|
9294
9442
|
const changes = settingsFrom(args);
|
|
9295
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
9443
|
+
if (!Object.keys(changes).length) throw new (0, _chunkFRD3FUXIcjs.LayerOperationError)("Give at least one value to change.");
|
|
9296
9444
|
const filter = controller.updateSmartFilter(id, args.filterId, changes);
|
|
9297
9445
|
return { layerId: id, filter, smartFilters: info(id).smartFilters };
|
|
9298
9446
|
}
|
|
@@ -9376,7 +9524,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9376
9524
|
var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
|
|
9377
9525
|
function adjustmentsSummary(adjustments) {
|
|
9378
9526
|
return {
|
|
9379
|
-
process:
|
|
9527
|
+
process: _chunkFRD3FUXIcjs.normalizeProcessVersion.call(void 0, adjustments.process),
|
|
9380
9528
|
values: readAdjustmentControls(adjustments),
|
|
9381
9529
|
layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
|
|
9382
9530
|
};
|
|
@@ -9419,7 +9567,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
9419
9567
|
default: def,
|
|
9420
9568
|
...requiresProcess ? { requiresProcess } : {}
|
|
9421
9569
|
})),
|
|
9422
|
-
layerKinds:
|
|
9570
|
+
layerKinds: _chunkFRD3FUXIcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
|
|
9423
9571
|
kind,
|
|
9424
9572
|
label,
|
|
9425
9573
|
controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
|
|
@@ -9431,7 +9579,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
9431
9579
|
default: def
|
|
9432
9580
|
}))
|
|
9433
9581
|
})),
|
|
9434
|
-
blendModes:
|
|
9582
|
+
blendModes: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id),
|
|
9435
9583
|
layerPathFormat: "layers.<layerId>.<controlId>"
|
|
9436
9584
|
})
|
|
9437
9585
|
};
|
|
@@ -9505,7 +9653,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
9505
9653
|
const result = { applied, clamped };
|
|
9506
9654
|
if (typeof label === "string" && label) result.label = label;
|
|
9507
9655
|
const notes = [];
|
|
9508
|
-
if ("tint" in applied &&
|
|
9656
|
+
if ("tint" in applied && _chunkFRD3FUXIcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
|
|
9509
9657
|
notes.push("Tint has no effect on process 1 edits.");
|
|
9510
9658
|
}
|
|
9511
9659
|
if (notes.length) result.notes = notes;
|
|
@@ -9515,14 +9663,14 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
9515
9663
|
const addLayer = {
|
|
9516
9664
|
name: "add_adjustment_layer",
|
|
9517
9665
|
title: "Add an adjustment layer",
|
|
9518
|
-
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " +
|
|
9666
|
+
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkFRD3FUXIcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
|
|
9519
9667
|
inputSchema: {
|
|
9520
9668
|
type: "object",
|
|
9521
9669
|
properties: {
|
|
9522
|
-
kind: { type: "string", enum:
|
|
9670
|
+
kind: { type: "string", enum: _chunkFRD3FUXIcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
|
|
9523
9671
|
params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
|
|
9524
9672
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
|
|
9525
|
-
blend: { type: "string", enum:
|
|
9673
|
+
blend: { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
|
|
9526
9674
|
name: { type: "string", description: "Layer name shown in the layers panel." },
|
|
9527
9675
|
aboveId: { type: "string", description: "Put the layer directly above this layer (from list_layers). Default: above the other adjustment layers, below annotations." },
|
|
9528
9676
|
parentId: { type: "string", description: "Put the layer at the top of this group (from list_layers)." }
|
|
@@ -9538,8 +9686,8 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
9538
9686
|
openWorldHint: false
|
|
9539
9687
|
},
|
|
9540
9688
|
handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
|
|
9541
|
-
if (!
|
|
9542
|
-
if (blend !== void 0 && !
|
|
9689
|
+
if (!_chunkFRD3FUXIcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
|
|
9690
|
+
if (blend !== void 0 && !_chunkSZ6KMZNMcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
9543
9691
|
if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
|
|
9544
9692
|
for (const ref of [aboveId, parentId]) {
|
|
9545
9693
|
if (ref !== void 0 && !controller.getLayer(ref)) throw new Error(`Unknown layer "${ref}". Call list_layers for ids.`);
|
|
@@ -9613,7 +9761,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
9613
9761
|
...createImageSmartObjectTools(controller),
|
|
9614
9762
|
...createImageEffectTools(controller),
|
|
9615
9763
|
...createImagePaintTools(controller),
|
|
9616
|
-
...
|
|
9764
|
+
..._chunkHUFQD4CBcjs.createPigmentTools.call(void 0, ),
|
|
9617
9765
|
...createImagePsdTools(controller)
|
|
9618
9766
|
]
|
|
9619
9767
|
};
|
|
@@ -9628,7 +9776,7 @@ function boxToCurvePoint(x, y, width, height) {
|
|
|
9628
9776
|
return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
|
|
9629
9777
|
}
|
|
9630
9778
|
function curveSvgPath(points, width, height, samples = 64) {
|
|
9631
|
-
const lut =
|
|
9779
|
+
const lut = _chunkFRD3FUXIcjs.curveLutFromLevels.call(void 0, points);
|
|
9632
9780
|
const n = lut.length - 1;
|
|
9633
9781
|
let d = "";
|
|
9634
9782
|
for (let i = 0; i <= samples; i++) {
|
|
@@ -9936,7 +10084,7 @@ function layerPanelRows(layers, activeId) {
|
|
|
9936
10084
|
}
|
|
9937
10085
|
function layerLabel(layer) {
|
|
9938
10086
|
if (layer.name) return layer.name;
|
|
9939
|
-
if (layer.type === "adjustment") return
|
|
10087
|
+
if (layer.type === "adjustment") return _chunkFRD3FUXIcjs.adjustmentKindLabel.call(void 0, layer.kind);
|
|
9940
10088
|
return layer.type === "group" ? "Group" : "Layer";
|
|
9941
10089
|
}
|
|
9942
10090
|
function layerBadge(layer) {
|
|
@@ -9959,7 +10107,7 @@ function dropZone(fraction, isGroup) {
|
|
|
9959
10107
|
}
|
|
9960
10108
|
function dropPlacement(layers, dragId, targetId, zone) {
|
|
9961
10109
|
if (dragId === targetId) return null;
|
|
9962
|
-
const target =
|
|
10110
|
+
const target = _chunkT3QZ6S47cjs.findLayer.call(void 0, layers, targetId);
|
|
9963
10111
|
if (!target) return null;
|
|
9964
10112
|
if (zone === "inside" && target.layer.type === "group") return { parentId: targetId };
|
|
9965
10113
|
return zone === "above" ? { aboveId: targetId } : { belowId: targetId };
|
|
@@ -9967,7 +10115,7 @@ function dropPlacement(layers, dragId, targetId, zone) {
|
|
|
9967
10115
|
function layerMenu(controller) {
|
|
9968
10116
|
const s = controller.getState();
|
|
9969
10117
|
const active = controller.getActiveLayer();
|
|
9970
|
-
const loc = active ?
|
|
10118
|
+
const loc = active ? _chunkT3QZ6S47cjs.findLayer.call(void 0, s.layers, active.id) : null;
|
|
9971
10119
|
const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
|
|
9972
10120
|
const below = loc ? siblings[loc.index - 1] : void 0;
|
|
9973
10121
|
const hasSel = controller.hasSelection;
|
|
@@ -10087,6 +10235,49 @@ function smartFilterRows(layer) {
|
|
|
10087
10235
|
}));
|
|
10088
10236
|
return rows.reverse();
|
|
10089
10237
|
}
|
|
10238
|
+
function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
|
|
10239
|
+
const state = controller.getState();
|
|
10240
|
+
const ctrlLayers = controller.getLayers();
|
|
10241
|
+
if (!ctrlLayers || ctrlLayers.length === 0) return [];
|
|
10242
|
+
const serialized = controller.toJSON();
|
|
10243
|
+
const assets = _nullishCoalesce(serialized.assets, () => ( {}));
|
|
10244
|
+
const allSerializedLayers = [];
|
|
10245
|
+
const collectSerialized = (list) => {
|
|
10246
|
+
for (const sl of list) {
|
|
10247
|
+
allSerializedLayers.push(sl);
|
|
10248
|
+
if (sl.children && Array.isArray(sl.children)) {
|
|
10249
|
+
collectSerialized(sl.children);
|
|
10250
|
+
}
|
|
10251
|
+
}
|
|
10252
|
+
};
|
|
10253
|
+
collectSerialized(_nullishCoalesce(serialized.layers, () => ( [])));
|
|
10254
|
+
const sLayerMap = new Map(allSerializedLayers.map((sl) => [sl.id, sl]));
|
|
10255
|
+
const imgW = _optionalChain([state, 'access', _322 => _322.imageDimensions, 'optionalAccess', _323 => _323.width]) || 1;
|
|
10256
|
+
const imgH = _optionalChain([state, 'access', _324 => _324.imageDimensions, 'optionalAccess', _325 => _325.height]) || 1;
|
|
10257
|
+
return ctrlLayers.map((l) => {
|
|
10258
|
+
const bounds = controller.getLayerBounds(l.id) || {
|
|
10259
|
+
x: 0,
|
|
10260
|
+
y: 0,
|
|
10261
|
+
width: imgW,
|
|
10262
|
+
height: imgH
|
|
10263
|
+
};
|
|
10264
|
+
const sLayer = sLayerMap.get(l.id);
|
|
10265
|
+
const assetKey = _optionalChain([sLayer, 'optionalAccess', _326 => _326.asset]);
|
|
10266
|
+
const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _327 => _327.source]) === "document" ? fallbackImageUrl : "");
|
|
10267
|
+
return {
|
|
10268
|
+
id: l.id,
|
|
10269
|
+
name: l.name || "Untitled Layer",
|
|
10270
|
+
imageUrl: layerDataUrl || fallbackImageUrl,
|
|
10271
|
+
thumbnailUrl: layerDataUrl || void 0,
|
|
10272
|
+
visible: l.visible !== false,
|
|
10273
|
+
opacity: _nullishCoalesce(l.opacity, () => ( 1)),
|
|
10274
|
+
x: imgW ? bounds.x / imgW : 0,
|
|
10275
|
+
y: imgH ? bounds.y / imgH : 0,
|
|
10276
|
+
width: imgW ? bounds.width / imgW : 1,
|
|
10277
|
+
height: imgH ? bounds.height / imgH : 1
|
|
10278
|
+
};
|
|
10279
|
+
});
|
|
10280
|
+
}
|
|
10090
10281
|
|
|
10091
10282
|
// src/image-editor/layers/effects-ui.ts
|
|
10092
10283
|
function layerEffectsPanel(layer) {
|
|
@@ -10094,25 +10285,25 @@ function layerEffectsPanel(layer) {
|
|
|
10094
10285
|
if (!layer) return { ...empty, available: false, reason: "Select a layer to add effects." };
|
|
10095
10286
|
if (layer.type === "adjustment") return { ...empty, available: false, reason: "Adjustment layers cannot have effects." };
|
|
10096
10287
|
const fx = layer.effects;
|
|
10097
|
-
const readOnly = Boolean(_optionalChain([layer, 'access',
|
|
10288
|
+
const readOnly = Boolean(_optionalChain([layer, 'access', _328 => _328.locks, 'optionalAccess', _329 => _329.all]));
|
|
10098
10289
|
return {
|
|
10099
10290
|
available: true,
|
|
10100
10291
|
readOnly,
|
|
10101
10292
|
reason: readOnly ? "The layer is locked; unlock it to change its effects." : void 0,
|
|
10102
|
-
enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
10103
|
-
scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
10104
|
-
rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
10293
|
+
enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _330 => _330.enabled]), () => ( true)),
|
|
10294
|
+
scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _331 => _331.scale]), () => ( 1)),
|
|
10295
|
+
rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _332 => _332.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkT3QZ6S47cjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
|
|
10105
10296
|
};
|
|
10106
10297
|
}
|
|
10107
10298
|
function layerEffectsBadge(layer) {
|
|
10108
|
-
if (!_optionalChain([layer, 'access',
|
|
10109
|
-
return
|
|
10299
|
+
if (!_optionalChain([layer, 'access', _333 => _333.effects, 'optionalAccess', _334 => _334.items, 'access', _335 => _335.length])) return null;
|
|
10300
|
+
return _chunkT3QZ6S47cjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
|
|
10110
10301
|
}
|
|
10111
|
-
var LAYER_EFFECT_MENU =
|
|
10112
|
-
var BLENDS =
|
|
10302
|
+
var LAYER_EFFECT_MENU = _chunkT3QZ6S47cjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkT3QZ6S47cjs.layerEffectLabel.call(void 0, kind) }));
|
|
10303
|
+
var BLENDS = _chunkSZ6KMZNMcjs.BLEND_MODES.filter((m) => m.id !== "pigment").map((m) => ({ value: m.id, label: m.label }));
|
|
10113
10304
|
var opt = (...pairs) => pairs.map(([value, label]) => ({ value, label }));
|
|
10114
10305
|
function patternOptions(patterns) {
|
|
10115
|
-
return [...patterns.map((p) => ({ value: p.id, label: p.name || p.id })), ...
|
|
10306
|
+
return [...patterns.map((p) => ({ value: p.id, label: p.name || p.id })), ..._chunkT3QZ6S47cjs.builtinPatternIds.call(void 0, ).map((id) => ({ value: id, label: _chunkT3QZ6S47cjs.builtinPattern.call(void 0, id).name }))];
|
|
10116
10307
|
}
|
|
10117
10308
|
function getPath(o, path) {
|
|
10118
10309
|
let v = o;
|
|
@@ -10150,8 +10341,8 @@ function fillControls(f, allowPattern, patterns) {
|
|
|
10150
10341
|
}
|
|
10151
10342
|
function gradientControls(prefix, g) {
|
|
10152
10343
|
return [
|
|
10153
|
-
{ key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access',
|
|
10154
|
-
{ key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access',
|
|
10344
|
+
{ key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _336 => _336.stops, 'access', _337 => _337[0], 'optionalAccess', _338 => _338.color]), () => ( "#000000")) },
|
|
10345
|
+
{ key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _339 => _339.stops, 'access', _340 => _340[g.stops.length - 1], 'optionalAccess', _341 => _341.color]), () => ( "#ffffff")) },
|
|
10155
10346
|
{ key: `${prefix}.style`, label: "Style", type: "select", value: g.style, options: opt(["linear", "Linear"], ["radial", "Radial"], ["angle", "Angle"], ["reflected", "Reflected"], ["diamond", "Diamond"]) },
|
|
10156
10347
|
{ key: `${prefix}.angle`, label: "Angle", type: "range", min: -180, max: 180, step: 1, value: g.angle, unit: "\xB0" },
|
|
10157
10348
|
{ key: `${prefix}.scale`, label: "Scale", type: "range", min: 0.1, max: 1.5, step: 0.01, value: g.scale, percent: true, unit: "%" },
|
|
@@ -10242,20 +10433,20 @@ function layerEffectControls(e, patterns = []) {
|
|
|
10242
10433
|
}
|
|
10243
10434
|
}
|
|
10244
10435
|
function fillOfType(current, type, patterns) {
|
|
10245
|
-
if (type === "gradient") return { type: "gradient", gradient:
|
|
10246
|
-
if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access',
|
|
10436
|
+
if (type === "gradient") return { type: "gradient", gradient: _chunkT3QZ6S47cjs.defaultEffectGradient.call(void 0, ) };
|
|
10437
|
+
if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _342 => _342[0], 'optionalAccess', _343 => _343.id]), () => ( "checker")), scale: 1 };
|
|
10247
10438
|
return { type: "color", color: current.type === "color" ? current.color : "#000000" };
|
|
10248
10439
|
}
|
|
10249
10440
|
function effectControlChange(effect, key, value, patterns = []) {
|
|
10250
10441
|
const [top, ...rest] = key.split(".");
|
|
10251
10442
|
if (top === "fill" && rest[0] === "type") return { fill: fillOfType(effect.fill, String(value), patterns) };
|
|
10252
10443
|
if (top === "patternId" && !rest.length) {
|
|
10253
|
-
const name = _optionalChain([patternOptions, 'call',
|
|
10444
|
+
const name = _optionalChain([patternOptions, 'call', _344 => _344(patterns), 'access', _345 => _345.find, 'call', _346 => _346((o) => o.value === value), 'optionalAccess', _347 => _347.label]);
|
|
10254
10445
|
return name ? { patternId: value, name } : { patternId: value };
|
|
10255
10446
|
}
|
|
10256
10447
|
if (!rest.length) return { [top]: value };
|
|
10257
10448
|
if (top === "fill" && rest[0] === "patternId") {
|
|
10258
|
-
const name = _optionalChain([patternOptions, 'call',
|
|
10449
|
+
const name = _optionalChain([patternOptions, 'call', _348 => _348(patterns), 'access', _349 => _349.find, 'call', _350 => _350((o) => o.value === value), 'optionalAccess', _351 => _351.label]);
|
|
10259
10450
|
return { fill: { ...effect.fill, patternId: value, ...name ? { name } : {} } };
|
|
10260
10451
|
}
|
|
10261
10452
|
return { [top]: setPath(getPath(effect, top), rest, value) };
|
|
@@ -10408,7 +10599,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10408
10599
|
__init77() {this.error = null}
|
|
10409
10600
|
__init78() {this.lastResult = null}
|
|
10410
10601
|
get active() {
|
|
10411
|
-
return Boolean(_optionalChain([this, 'access',
|
|
10602
|
+
return Boolean(_optionalChain([this, 'access', _352 => _352.sessionRef, 'optionalAccess', _353 => _353.isOpen]));
|
|
10412
10603
|
}
|
|
10413
10604
|
get session() {
|
|
10414
10605
|
return this.active ? this.sessionRef : null;
|
|
@@ -10417,7 +10608,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10417
10608
|
return this.modeValue;
|
|
10418
10609
|
}
|
|
10419
10610
|
get interpolation() {
|
|
10420
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
10611
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _354 => _354.sessionRef, 'optionalAccess', _355 => _355.interpolation]), () => ( "bicubic"));
|
|
10421
10612
|
}
|
|
10422
10613
|
__init79() {this.listeners = /* @__PURE__ */ new Set()}
|
|
10423
10614
|
/** Calls `listener` whenever the overlay, readout, mode or error changes. Returns the unsubscribe. */
|
|
@@ -10428,7 +10619,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10428
10619
|
};
|
|
10429
10620
|
}
|
|
10430
10621
|
changed() {
|
|
10431
|
-
_optionalChain([this, 'access',
|
|
10622
|
+
_optionalChain([this, 'access', _356 => _356.options, 'access', _357 => _357.onChange, 'optionalCall', _358 => _358()]);
|
|
10432
10623
|
for (const l of this.listeners) l();
|
|
10433
10624
|
}
|
|
10434
10625
|
/** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
|
|
@@ -10436,7 +10627,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10436
10627
|
if (this.active) return null;
|
|
10437
10628
|
try {
|
|
10438
10629
|
if (!init.layerId && init.content !== "selection-outline" && !this.controller.getState().activeLayerId) {
|
|
10439
|
-
const top = [...
|
|
10630
|
+
const top = [..._chunkT3QZ6S47cjs.flattenLayers.call(void 0, this.controller.getState().layers)].reverse().find((l) => l.type === "pixel" && l.visible);
|
|
10440
10631
|
if (top) this.controller.setActiveLayer(top.id);
|
|
10441
10632
|
}
|
|
10442
10633
|
const s = this.controller.beginFreeTransform(init);
|
|
@@ -10763,7 +10954,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10763
10954
|
bar() {
|
|
10764
10955
|
const s = this.session;
|
|
10765
10956
|
if (!s || !this.corners) return null;
|
|
10766
|
-
const read =
|
|
10957
|
+
const read = _chunkFRD3FUXIcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
|
|
10767
10958
|
return {
|
|
10768
10959
|
affine: read.affine,
|
|
10769
10960
|
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
@@ -10788,7 +10979,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10788
10979
|
this.changed();
|
|
10789
10980
|
return;
|
|
10790
10981
|
}
|
|
10791
|
-
const m =
|
|
10982
|
+
const m = _chunkFRD3FUXIcjs.matrixFromParams.call(void 0, s.box, {
|
|
10792
10983
|
scaleX: next.scaleX,
|
|
10793
10984
|
scaleY: next.scaleY,
|
|
10794
10985
|
rotate: next.rotate,
|
|
@@ -10798,7 +10989,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10798
10989
|
dx: next.x - this.refBox.x,
|
|
10799
10990
|
dy: next.y - this.refBox.y
|
|
10800
10991
|
});
|
|
10801
|
-
this.setCorners(
|
|
10992
|
+
this.setCorners(_chunkFRD3FUXIcjs.cornersFromMatrix.call(void 0, s.box, m));
|
|
10802
10993
|
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
10803
10994
|
this.changed();
|
|
10804
10995
|
}
|
|
@@ -10822,7 +11013,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10822
11013
|
}
|
|
10823
11014
|
/** Abandons the transform and restores everything. */
|
|
10824
11015
|
cancel() {
|
|
10825
|
-
_optionalChain([this, 'access',
|
|
11016
|
+
_optionalChain([this, 'access', _359 => _359.sessionRef, 'optionalAccess', _360 => _360.cancel, 'call', _361 => _361()]);
|
|
10826
11017
|
this.sessionRef = null;
|
|
10827
11018
|
this.corners = null;
|
|
10828
11019
|
this.mesh = null;
|
|
@@ -11437,5 +11628,13 @@ var FreeTransformTool = (_class9 = class {
|
|
|
11437
11628
|
|
|
11438
11629
|
|
|
11439
11630
|
|
|
11440
|
-
exports.ADJUSTMENT_KEYS = _chunkZID226ZGcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkZID226ZGcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkZID226ZGcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkZID226ZGcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = BACKGROUND_LAYER_NAME; exports.BLEND_MODES = _chunkCRMAXIUVcjs.BLEND_MODES; exports.BLUR_FILTER_ID = BLUR_FILTER_ID; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.CoverageMap = _chunkPV42JITTcjs.CoverageMap; exports.D50 = _chunkZID226ZGcjs.D50; exports.D65 = _chunkZID226ZGcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_BRUSH = _chunkPV42JITTcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_GLOBAL_LIGHT = _chunkWSTEXEKDcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MIXER = _chunkPV42JITTcjs.DEFAULT_MIXER; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEVELOP_FILTER_ID = DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkWSTEXEKDcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DabWalker = _chunkPV42JITTcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkZID226ZGcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkPV42JITTcjs.EMPTY_MIXER_LOAD; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkZID226ZGcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkZID226ZGcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkZID226ZGcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.INTERPOLATIONS = _chunkWSTEXEKDcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = _chunkZID226ZGcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkZID226ZGcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkWSTEXEKDcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkZID226ZGcjs.LEGACY_PROCESS_VERSION; exports.LUMA_709 = _chunkZID226ZGcjs.LUMA_709; exports.LayerCompositor = _chunkZID226ZGcjs.LayerCompositor; exports.LayerEffectError = _chunkWSTEXEKDcjs.LayerEffectError; exports.LayerOperationError = _chunkZID226ZGcjs.LayerOperationError; exports.MAX_BRUSH_SIZE = _chunkPV42JITTcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkWSTEXEKDcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkZID226ZGcjs.MAX_KELVIN; exports.MAX_TRANSFORM_PIXELS = _chunkWSTEXEKDcjs.MAX_TRANSFORM_PIXELS; exports.MIN_KELVIN = _chunkZID226ZGcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkZID226ZGcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkPV42JITTcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkPV42JITTcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkPV42JITTcjs.MIXING_MODELS; exports.MixerStroke = _chunkPV42JITTcjs.MixerStroke; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PATTERN_BLOCK_KEYS = _chunkZID226ZGcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCRMAXIUVcjs.PIGMENT_BANDS; exports.PIGMENT_LAMBDA_MIN = _chunkCRMAXIUVcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCRMAXIUVcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_WAVELENGTHS = _chunkCRMAXIUVcjs.PIGMENT_WAVELENGTHS; exports.PSD_BLEND_KEYS = _chunkZID226ZGcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkWSTEXEKDcjs.PatternPlacement; exports.PatternTile = _chunkWSTEXEKDcjs.PatternTile; exports.PsdError = _chunkZID226ZGcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = _chunkZID226ZGcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkZID226ZGcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SMART_RENDER_MARGIN = _chunkZID226ZGcjs.SMART_RENDER_MARGIN; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkZID226ZGcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.StrokeCoverage = _chunkPV42JITTcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCRMAXIUVcjs.SurfaceDraft; exports.TILE = _chunkCRMAXIUVcjs.TILE; exports.TILE_SHIFT = _chunkCRMAXIUVcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkZID226ZGcjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunkZID226ZGcjs.TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkZID226ZGcjs.TRANSFORM_ANCHORS; exports.TiledSurface = _chunkCRMAXIUVcjs.TiledSurface; exports.TransformTooLargeError = _chunkWSTEXEKDcjs.TransformTooLargeError; exports.VIBRANCE_GREY = _chunkZID226ZGcjs.VIBRANCE_GREY; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkDWGZUSEScjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkDWGZUSEScjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.XYZ_D50_TO_SRGB = _chunkZID226ZGcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkWSTEXEKDcjs.ZlibError; exports.activeAdjustmentLayers = _chunkZID226ZGcjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunkZID226ZGcjs.activeSmartFilters; exports.addLayerEffect = _chunkZID226ZGcjs.addLayerEffect; exports.addLayerFilter = _chunkZID226ZGcjs.addLayerFilter; exports.addSmartFilter = _chunkZID226ZGcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkZID226ZGcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkZID226ZGcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkZID226ZGcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = adjustmentNodeFromLegacy; exports.adler32 = _chunkWSTEXEKDcjs.adler32; exports.anchorPoint = _chunkZID226ZGcjs.anchorPoint; exports.annotationLayerFor = annotationLayerFor; exports.annotationLayerName = annotationLayerName; exports.applyAdjustmentLayers = _chunkZID226ZGcjs.applyAdjustmentLayers; exports.applyAdjustments = _chunkZID226ZGcjs.applyAdjustments; exports.applyBoxBlur = _chunkZID226ZGcjs.applyBoxBlur; exports.applyDepthMask = _chunkZID226ZGcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkZID226ZGcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkZID226ZGcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkZID226ZGcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkZID226ZGcjs.applyParams; exports.applyProcess2Adjustments = _chunkZID226ZGcjs.applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applySmartFilters = _chunkZID226ZGcjs.applySmartFilters; exports.applyStrokeToTile = _chunkPV42JITTcjs.applyStrokeToTile; exports.backgroundLayer = backgroundLayer; exports.base64ToBytes = _chunkWSTEXEKDcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.blackWhiteGray = _chunkZID226ZGcjs.blackWhiteGray; exports.blendChannel = _chunkCRMAXIUVcjs.blendChannel; exports.blendImageData = _chunkCRMAXIUVcjs.blendImageData; exports.blendLum = _chunkCRMAXIUVcjs.blendLum; exports.blendPixel = _chunkCRMAXIUVcjs.blendPixel; exports.blendRgb = _chunkCRMAXIUVcjs.blendRgb; exports.blendTile = _chunkWSTEXEKDcjs.blendTile; exports.blurFilter = _chunkZID226ZGcjs.blurFilter; exports.borderCoverage = _chunkZID226ZGcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkZID226ZGcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkZID226ZGcjs.bradfordAdaptation; exports.buildLayerMaskPlanes = _chunkZID226ZGcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkZID226ZGcjs.buildToneLut; exports.builtinPattern = _chunkWSTEXEKDcjs.builtinPattern; exports.builtinPatternIds = _chunkWSTEXEKDcjs.builtinPatternIds; exports.bytesToBase64 = _chunkWSTEXEKDcjs.bytesToBase64; exports.calculateCropDrag = _chunkZID226ZGcjs.calculateCropDrag; exports.canvasCompositeOperation = _chunkCRMAXIUVcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkZID226ZGcjs.canvasToImagePoint; exports.changedTiles = _chunkWSTEXEKDcjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkZID226ZGcjs.clampCropToImage; exports.cleanMixer = _chunkPV42JITTcjs.cleanMixer; exports.collectTiles = _chunkCRMAXIUVcjs.collectTiles; exports.colorBalanceChannel = _chunkZID226ZGcjs.colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = _chunkZID226ZGcjs.combineSelections; exports.compileAdjustmentLayer = _chunkZID226ZGcjs.compileAdjustmentLayer; exports.compositeSurfaceOver = _chunkWSTEXEKDcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkZID226ZGcjs.computeSelectionBounds; exports.contentBounds = _chunkCRMAXIUVcjs.contentBounds; exports.contentsBox = _chunkZID226ZGcjs.contentsBox; exports.contentsSurface = _chunkZID226ZGcjs.contentsSurface; exports.contractCoverage = _chunkZID226ZGcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertToSmartObject = _chunkZID226ZGcjs.convertToSmartObject; exports.copySmartObject = _chunkZID226ZGcjs.copySmartObject; exports.cornersFromMatrix = _chunkZID226ZGcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkPV42JITTcjs.coverageTileCoord; exports.coverageToByte = _chunkZID226ZGcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkZID226ZGcjs.createAdjustmentLayer; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createPigment = _chunkCRMAXIUVcjs.createPigment; exports.createPigmentTools = _chunkPV42JITTcjs.createPigmentTools; exports.createSelectionMask = _chunkZID226ZGcjs.createSelectionMask; exports.curveLut = _chunkWSTEXEKDcjs.curveLut; exports.curveLutFromLevels = _chunkZID226ZGcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkPV42JITTcjs.dabCoverage; exports.dabRect = _chunkPV42JITTcjs.dabRect; exports.decodeLayerChannel = _chunkZID226ZGcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkZID226ZGcjs.decodeLayerMask; exports.decodeMergedImage = _chunkZID226ZGcjs.decodeMergedImage; exports.decodePlanes = _chunkZID226ZGcjs.decodePlanes; exports.decodePng = _chunkWSTEXEKDcjs.decodePng; exports.decodePngDataUrl = _chunkZID226ZGcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkZID226ZGcjs.decodeSelectionRle; exports.defaultAdjustmentParams = _chunkZID226ZGcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkWSTEXEKDcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkWSTEXEKDcjs.defaultLayerEffect; exports.deflate = _chunkWSTEXEKDcjs.deflate; exports.deflateRaw = _chunkWSTEXEKDcjs.deflateRaw; exports.depthMaskAlpha = _chunkZID226ZGcjs.depthMaskAlpha; exports.depthRasterMask = depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkZID226ZGcjs.describeTransform; exports.deserializeEffects = _chunkZID226ZGcjs.deserializeEffects; exports.deserializeLayer = _chunkZID226ZGcjs.deserializeLayer; exports.deserializeLayers = _chunkZID226ZGcjs.deserializeLayers; exports.deserializePatterns = _chunkZID226ZGcjs.deserializePatterns; exports.deserializeSelection = _chunkZID226ZGcjs.deserializeSelection; exports.developFilter = _chunkZID226ZGcjs.developFilter; exports.developFromAdjustments = developFromAdjustments; exports.developTarget = developTarget; exports.distanceTransform = _chunkZID226ZGcjs.distanceTransform; exports.documentContents = _chunkZID226ZGcjs.documentContents; exports.downloadPsd = downloadPsd; exports.dragWarpMeshPoint = _chunkDWGZUSEScjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.duplicateLayer = _chunkZID226ZGcjs.duplicateLayer; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkWSTEXEKDcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkWSTEXEKDcjs.effectReach; exports.effectsFingerprint = _chunkWSTEXEKDcjs.effectsFingerprint; exports.effectsMargin = _chunkWSTEXEKDcjs.effectsMargin; exports.effectsScale = _chunkWSTEXEKDcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCRMAXIUVcjs.emptySurface; exports.encodePng = _chunkWSTEXEKDcjs.encodePng; exports.encodeRle = _chunkZID226ZGcjs.encodeRle; exports.encodeSelectionRle = _chunkZID226ZGcjs.encodeSelectionRle; exports.encodeSurface = _chunkZID226ZGcjs.encodeSurface; exports.evalWarpMesh = _chunkDWGZUSEScjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkZID226ZGcjs.evaluateAdjustmentLayers; exports.expandCoverage = _chunkZID226ZGcjs.expandCoverage; exports.exportPsd = _chunkZID226ZGcjs.exportPsd; exports.featherCoverage = _chunkZID226ZGcjs.featherCoverage; exports.fillRect = _chunkCRMAXIUVcjs.fillRect; exports.filterMaskCoverage = _chunkZID226ZGcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkWSTEXEKDcjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunkCRMAXIUVcjs.finishTile; exports.flattenLayers = _chunkWSTEXEKDcjs.flattenLayers; exports.flipCorners = _chunkZID226ZGcjs.flipCorners; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkZID226ZGcjs.fullSelection; exports.gaussianBlur = _chunkWSTEXEKDcjs.gaussianBlur; exports.geometryHomography = _chunkZID226ZGcjs.geometryHomography; exports.getAnnotationBounds = _chunkZID226ZGcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkZID226ZGcjs.getCropCursor; exports.getRotatedSize = _chunkZID226ZGcjs.getRotatedSize; exports.getViewportMetrics = _chunkZID226ZGcjs.getViewportMetrics; exports.getViewportProjection = _chunkZID226ZGcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunkZID226ZGcjs.greyMorphology; exports.groupLayers = _chunkZID226ZGcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkWSTEXEKDcjs.hasActiveEffects; exports.hasResampledLegacyMask = hasResampledLegacyMask; exports.hasSurface = _chunkZID226ZGcjs.hasSurface; exports.hasWarp = _chunkZID226ZGcjs.hasWarp; exports.hashMaskContent = _chunkZID226ZGcjs.hashMaskContent; exports.hashNoise = _chunkWSTEXEKDcjs.hashNoise; exports.hexToRgb = _chunkZID226ZGcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkZID226ZGcjs.hitTestAnnotation; exports.hitTestCrop = _chunkZID226ZGcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkZID226ZGcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkZID226ZGcjs.hueRangeTables; exports.hueRangeWeight = _chunkZID226ZGcjs.hueRangeWeight; exports.hueSaturation = _chunkZID226ZGcjs.hueSaturation; exports.identityCurve = _chunkZID226ZGcjs.identityCurve; exports.identityLevels = _chunkZID226ZGcjs.identityLevels; exports.identityTransform = _chunkZID226ZGcjs.identityTransform; exports.identityWarpMesh = _chunkDWGZUSEScjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunkZID226ZGcjs.imageToCanvasPoint; exports.importPsd = _chunkZID226ZGcjs.importPsd; exports.inflate = _chunkWSTEXEKDcjs.inflate; exports.inflateRaw = _chunkWSTEXEKDcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkWSTEXEKDcjs.insertLayer; exports.instancesOf = _chunkZID226ZGcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkZID226ZGcjs.invertMatrix3; exports.invertSelection = _chunkZID226ZGcjs.invertSelection; exports.isActiveFilter = _chunkZID226ZGcjs.isActiveFilter; exports.isAdjustmentKind = _chunkZID226ZGcjs.isAdjustmentKind; exports.isBlendMode = _chunkCRMAXIUVcjs.isBlendMode; exports.isContentsDecoded = _chunkZID226ZGcjs.isContentsDecoded; exports.isDefaultDepthMask = isDefaultDepthMask; exports.isIdentityTransform = _chunkZID226ZGcjs.isIdentityTransform; exports.isInterpolation = _chunkWSTEXEKDcjs.isInterpolation; exports.isLayerEffectKind = _chunkWSTEXEKDcjs.isLayerEffectKind; exports.isLayerLocked = _chunkWSTEXEKDcjs.isLayerLocked; exports.isLegacyShape = isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPng = _chunkWSTEXEKDcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkZID226ZGcjs.isQuarterTurnSwapped; exports.isSelectionEmpty = _chunkZID226ZGcjs.isSelectionEmpty; exports.isSelectionMode = _chunkZID226ZGcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCRMAXIUVcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunkZID226ZGcjs.isSpatialFilter; exports.isTransformAnchor = _chunkZID226ZGcjs.isTransformAnchor; exports.isValidWarp = _chunkZID226ZGcjs.isValidWarp; exports.kelvinToTemperature = _chunkZID226ZGcjs.kelvinToTemperature; exports.keysWeight = _chunkWSTEXEKDcjs.keysWeight; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkWSTEXEKDcjs.layerEffectFields; exports.layerEffectLabel = _chunkWSTEXEKDcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkZID226ZGcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkZID226ZGcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkZID226ZGcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkZID226ZGcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkZID226ZGcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkZID226ZGcjs.layerTree; exports.layerTypeLabel = _chunkZID226ZGcjs.layerTypeLabel; exports.layersFromLegacy = layersFromLegacy; exports.legacyAdjustmentLayer = legacyAdjustmentLayer; exports.legacyMaskOf = legacyMaskOf; exports.legacyView = legacyView; exports.lerpPigment = _chunkCRMAXIUVcjs.lerpPigment; exports.lerpPigmentInto = _chunkCRMAXIUVcjs.lerpPigmentInto; exports.levelsValue = _chunkZID226ZGcjs.levelsValue; exports.linearSrgbToXy = _chunkZID226ZGcjs.linearSrgbToXy; exports.linearToSrgb = _chunkZID226ZGcjs.linearToSrgb; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkPV42JITTcjs.loadMixer; exports.magicWand = magicWand; exports.mapCropHandle = _chunkZID226ZGcjs.mapCropHandle; exports.mapLayer = _chunkWSTEXEKDcjs.mapLayer; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkZID226ZGcjs.matrixFromCorners; exports.matrixFromParams = _chunkZID226ZGcjs.matrixFromParams; exports.mergeLayerEffect = _chunkWSTEXEKDcjs.mergeLayerEffect; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunkCRMAXIUVcjs.mixPigment8; exports.mixPigmentRgb = _chunkCRMAXIUVcjs.mixPigmentRgb; exports.mixPigments = _chunkCRMAXIUVcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.modifySelection = _chunkZID226ZGcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkZID226ZGcjs.moveLayer; exports.moveSmartFilter = _chunkZID226ZGcjs.moveSmartFilter; exports.mulMatrix3 = _chunkZID226ZGcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkZID226ZGcjs.neutralHueRange; exports.newContentsId = _chunkZID226ZGcjs.newContentsId; exports.newEffectId = _chunkWSTEXEKDcjs.newEffectId; exports.newLayerId = _chunkZID226ZGcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkZID226ZGcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkZID226ZGcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkZID226ZGcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCRMAXIUVcjs.normalizeBlendMode; exports.normalizeBrush = _chunkPV42JITTcjs.normalizeBrush; exports.normalizeFilter = _chunkZID226ZGcjs.normalizeFilter; exports.normalizeLayerEffects = _chunkWSTEXEKDcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkZID226ZGcjs.normalizeLayerMask; exports.normalizeMixer = _chunkPV42JITTcjs.normalizeMixer; exports.normalizePlacement = _chunkZID226ZGcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkZID226ZGcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeSmartFilter = _chunkZID226ZGcjs.normalizeSmartFilter; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.offsetLayer = _chunkZID226ZGcjs.offsetLayer; exports.offsetSmartObject = _chunkZID226ZGcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCRMAXIUVcjs.packRgba; exports.parseAdjustmentBlock = _chunkZID226ZGcjs.parseAdjustmentBlock; exports.parseBlend = _chunkZID226ZGcjs.parseBlend; exports.parseColor = parseColor; exports.parseDataUrl = _chunkWSTEXEKDcjs.parseDataUrl; exports.parseEffectColor = _chunkWSTEXEKDcjs.parseEffectColor; exports.parseLfx2 = _chunkZID226ZGcjs.parseLfx2; exports.parseLrfx = _chunkZID226ZGcjs.parseLrfx; exports.parsePatternBlock = _chunkZID226ZGcjs.parsePatternBlock; exports.parseSelectionMode = _chunkZID226ZGcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkZID226ZGcjs.parseVersionedDescriptor; exports.photoFilterMatrix = _chunkZID226ZGcjs.photoFilterMatrix; exports.pixelLayerBounds = _chunkZID226ZGcjs.pixelLayerBounds; exports.pixelLayers = _chunkZID226ZGcjs.pixelLayers; exports.placeContents = _chunkZID226ZGcjs.placeContents; exports.placeLayer = _chunkZID226ZGcjs.placeLayer; exports.placementAt = _chunkZID226ZGcjs.placementAt; exports.placementBounds = _chunkZID226ZGcjs.placementBounds; exports.placementGeometry = _chunkZID226ZGcjs.placementGeometry; exports.pngDataUrl = _chunkWSTEXEKDcjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkZID226ZGcjs.posterizeValue; exports.presetWarp = _chunkZID226ZGcjs.presetWarp; exports.previewStep = previewStep; exports.projectImagePoint = _chunkZID226ZGcjs.projectImagePoint; exports.projectImageRect = _chunkZID226ZGcjs.projectImageRect; exports.projectMaskCoverage = _chunkZID226ZGcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkZID226ZGcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkZID226ZGcjs.psdToLayers; exports.pullWarpMesh = _chunkDWGZUSEScjs.pullWarpMesh; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunkZID226ZGcjs.rangeLightness; exports.rasterContents = _chunkZID226ZGcjs.rasterContents; exports.rasterMaskFromLegacy = rasterMaskFromLegacy; exports.rasterizeDab = _chunkPV42JITTcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkZID226ZGcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readPixel = _chunkCRMAXIUVcjs.readPixel; exports.readPsd = _chunkZID226ZGcjs.readPsd; exports.readRegion = _chunkCRMAXIUVcjs.readRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkWSTEXEKDcjs.reduceSurface; exports.referencePoint = _chunkZID226ZGcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCRMAXIUVcjs.reflectanceToRgb; exports.removeAlpha = _chunkZID226ZGcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkZID226ZGcjs.removeLayer; exports.removeLayerEffect = _chunkZID226ZGcjs.removeLayerEffect; exports.removeLayerFilter = _chunkZID226ZGcjs.removeLayerFilter; exports.removeSmartFilter = _chunkZID226ZGcjs.removeSmartFilter; exports.renderLayerEffects = _chunkWSTEXEKDcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderSmartObject = _chunkZID226ZGcjs.renderSmartObject; exports.replaceContents = _chunkZID226ZGcjs.replaceContents; exports.requireLayer = _chunkZID226ZGcjs.requireLayer; exports.requireSmartObject = _chunkZID226ZGcjs.requireSmartObject; exports.requireUnlocked = _chunkZID226ZGcjs.requireUnlocked; exports.rerender = _chunkZID226ZGcjs.rerender; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkZID226ZGcjs.resizeSelection; exports.resizeWarpMesh = _chunkDWGZUSEScjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkZID226ZGcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.rgbToGray = _chunkZID226ZGcjs.rgbToGray; exports.rgbToHsl = _chunkZID226ZGcjs.rgbToHsl; exports.rgbToReflectance = _chunkCRMAXIUVcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.runLayerFilters = _chunkZID226ZGcjs.runLayerFilters; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkZID226ZGcjs.sampleLut; exports.sampleToneLut = _chunkZID226ZGcjs.sampleToneLut; exports.scaleLayerEffect = _chunkWSTEXEKDcjs.scaleLayerEffect; exports.selectionArea = _chunkZID226ZGcjs.selectionArea; exports.selectionFromCoverage = _chunkZID226ZGcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkZID226ZGcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkZID226ZGcjs.selectionToCoverage; exports.selectionToPixels = _chunkZID226ZGcjs.selectionToPixels; exports.selectionValueAt = _chunkZID226ZGcjs.selectionValueAt; exports.serializeContents = _chunkZID226ZGcjs.serializeContents; exports.serializeEffects = _chunkZID226ZGcjs.serializeEffects; exports.serializeLayer = _chunkZID226ZGcjs.serializeLayer; exports.serializeLayers = _chunkZID226ZGcjs.serializeLayers; exports.serializeLayersExternal = _chunkZID226ZGcjs.serializeLayersExternal; exports.serializePatterns = _chunkZID226ZGcjs.serializePatterns; exports.serializeSelection = _chunkZID226ZGcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkZID226ZGcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkZID226ZGcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkZID226ZGcjs.setLayerMask; exports.setLayerProperties = _chunkZID226ZGcjs.setLayerProperties; exports.setLum = _chunkCRMAXIUVcjs.setLum; exports.setPigmentColor = _chunkCRMAXIUVcjs.setPigmentColor; exports.setSmartFilterMask = _chunkZID226ZGcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkZID226ZGcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkZID226ZGcjs.setSmartPlacement; exports.shiftCoverage = _chunkZID226ZGcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkZID226ZGcjs.smartObjectLayers; exports.smoothCoverage = _chunkZID226ZGcjs.smoothCoverage; exports.smoothPoints = _chunkPV42JITTcjs.smoothPoints; exports.solidSurface = _chunkCRMAXIUVcjs.solidSurface; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = _chunkZID226ZGcjs.srgbToLinear; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCRMAXIUVcjs.surfaceBytes; exports.surfaceFromPixels = _chunkCRMAXIUVcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCRMAXIUVcjs.surfacesEqual; exports.tempTintToXy = _chunkZID226ZGcjs.tempTintToXy; exports.temperatureToKelvin = _chunkZID226ZGcjs.temperatureToKelvin; exports.tileCoord = _chunkCRMAXIUVcjs.tileCoord; exports.tileKey = _chunkCRMAXIUVcjs.tileKey; exports.tileRect = _chunkCRMAXIUVcjs.tileRect; exports.tilesInRect = _chunkCRMAXIUVcjs.tilesInRect; exports.tipFalloff = _chunkPV42JITTcjs.tipFalloff; exports.tipReach = _chunkPV42JITTcjs.tipReach; exports.tipShape = _chunkPV42JITTcjs.tipShape; exports.toHex = toHex; exports.toneCurve = _chunkZID226ZGcjs.toneCurve; exports.toneLuts = _chunkZID226ZGcjs.toneLuts; exports.toneRange = toneRange; exports.transformHomography = _chunkZID226ZGcjs.transformHomography; exports.transformMap = _chunkZID226ZGcjs.transformMap; exports.transformSurface = _chunkWSTEXEKDcjs.transformSurface; exports.transformedBounds = _chunkWSTEXEKDcjs.transformedBounds; exports.transformedBox = _chunkZID226ZGcjs.transformedBox; exports.transformedPoint = _chunkZID226ZGcjs.transformedPoint; exports.translateSurface = _chunkCRMAXIUVcjs.translateSurface; exports.ungroupLayer = _chunkZID226ZGcjs.ungroupLayer; exports.uniformTile = _chunkCRMAXIUVcjs.uniformTile; exports.unionRect = _chunkZID226ZGcjs.unionRect; exports.unprojectCanvasPoint = _chunkZID226ZGcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkZID226ZGcjs.updateLayerEffect; exports.updateLayerFilter = _chunkZID226ZGcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkZID226ZGcjs.updateLayerMaskProps; exports.updateSmartFilter = _chunkZID226ZGcjs.updateSmartFilter; exports.uvToXy = _chunkZID226ZGcjs.uvToXy; exports.validateEffectGradient = _chunkWSTEXEKDcjs.validateEffectGradient; exports.validateLayerEffect = _chunkWSTEXEKDcjs.validateLayerEffect; exports.validateLayerEffects = _chunkWSTEXEKDcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkZID226ZGcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkZID226ZGcjs.vibranceLinear; exports.vibrancePixel = _chunkZID226ZGcjs.vibrancePixel; exports.walkDabs = _chunkPV42JITTcjs.walkDabs; exports.warpMeshEditPoints = _chunkDWGZUSEScjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkDWGZUSEScjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkDWGZUSEScjs.warpMeshParamAt; exports.warpPresetMesh = _chunkDWGZUSEScjs.warpPresetMesh; exports.warpSurface = _chunkWSTEXEKDcjs.warpSurface; exports.wbMatrix = _chunkZID226ZGcjs.wbMatrix; exports.whiteBalanceFromSample = _chunkZID226ZGcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkZID226ZGcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkZID226ZGcjs.withFilterMaskSurface; exports.withNewIds = _chunkZID226ZGcjs.withNewIds; exports.writeAdjustmentBlock = _chunkZID226ZGcjs.writeAdjustmentBlock; exports.writeLfx2 = _chunkZID226ZGcjs.writeLfx2; exports.writePatternBlock = _chunkZID226ZGcjs.writePatternBlock; exports.writePsd = _chunkZID226ZGcjs.writePsd; exports.writeRegion = _chunkCRMAXIUVcjs.writeRegion; exports.xyToTempTint = _chunkZID226ZGcjs.xyToTempTint; exports.xyToUv = _chunkZID226ZGcjs.xyToUv;
|
|
11631
|
+
|
|
11632
|
+
|
|
11633
|
+
|
|
11634
|
+
|
|
11635
|
+
|
|
11636
|
+
|
|
11637
|
+
|
|
11638
|
+
|
|
11639
|
+
exports.ADJUSTMENT_KEYS = _chunkFRD3FUXIcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkFRD3FUXIcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkFRD3FUXIcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkFRD3FUXIcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = BACKGROUND_LAYER_NAME; exports.BLEND_MODES = _chunkSZ6KMZNMcjs.BLEND_MODES; exports.BLUR_FILTER_ID = BLUR_FILTER_ID; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.CoverageMap = _chunkHUFQD4CBcjs.CoverageMap; exports.D50 = _chunkFRD3FUXIcjs.D50; exports.D65 = _chunkFRD3FUXIcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_BRUSH = _chunkHUFQD4CBcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_GLOBAL_LIGHT = _chunkT3QZ6S47cjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MIXER = _chunkHUFQD4CBcjs.DEFAULT_MIXER; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkT3QZ6S47cjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DabWalker = _chunkHUFQD4CBcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkFRD3FUXIcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkHUFQD4CBcjs.EMPTY_MIXER_LOAD; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkFRD3FUXIcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkFRD3FUXIcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkFRD3FUXIcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTERPOLATIONS = _chunkT3QZ6S47cjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = _chunkFRD3FUXIcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkFRD3FUXIcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkT3QZ6S47cjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkFRD3FUXIcjs.LEGACY_PROCESS_VERSION; exports.LUMA_709 = _chunkFRD3FUXIcjs.LUMA_709; exports.LayerCompositor = _chunkFRD3FUXIcjs.LayerCompositor; exports.LayerEffectError = _chunkT3QZ6S47cjs.LayerEffectError; exports.LayerOperationError = _chunkFRD3FUXIcjs.LayerOperationError; exports.MAX_BRUSH_SIZE = _chunkHUFQD4CBcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkT3QZ6S47cjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkFRD3FUXIcjs.MAX_KELVIN; exports.MAX_TRANSFORM_PIXELS = _chunkT3QZ6S47cjs.MAX_TRANSFORM_PIXELS; exports.MIN_KELVIN = _chunkFRD3FUXIcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkFRD3FUXIcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkHUFQD4CBcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkHUFQD4CBcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkHUFQD4CBcjs.MIXING_MODELS; exports.MixerStroke = _chunkHUFQD4CBcjs.MixerStroke; exports.PAINTERLY_BLEND_MODES = _chunkSZ6KMZNMcjs.PAINTERLY_BLEND_MODES; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PATTERN_BLOCK_KEYS = _chunkFRD3FUXIcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkSZ6KMZNMcjs.PIGMENT_BANDS; exports.PIGMENT_LAMBDA_MIN = _chunkSZ6KMZNMcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkSZ6KMZNMcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_WAVELENGTHS = _chunkSZ6KMZNMcjs.PIGMENT_WAVELENGTHS; exports.PSD_BLEND_KEYS = _chunkFRD3FUXIcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkT3QZ6S47cjs.PatternPlacement; exports.PatternTile = _chunkT3QZ6S47cjs.PatternTile; exports.PsdError = _chunkFRD3FUXIcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = _chunkFRD3FUXIcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkFRD3FUXIcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SHADOW_AMBIENT = _chunkSZ6KMZNMcjs.SHADOW_AMBIENT; exports.SMART_RENDER_MARGIN = _chunkFRD3FUXIcjs.SMART_RENDER_MARGIN; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkFRD3FUXIcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.StrokeCoverage = _chunkHUFQD4CBcjs.StrokeCoverage; exports.SurfaceDraft = _chunkSZ6KMZNMcjs.SurfaceDraft; exports.TILE = _chunkSZ6KMZNMcjs.TILE; exports.TILE_SHIFT = _chunkSZ6KMZNMcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkFRD3FUXIcjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunkFRD3FUXIcjs.TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkFRD3FUXIcjs.TRANSFORM_ANCHORS; exports.TiledSurface = _chunkSZ6KMZNMcjs.TiledSurface; exports.TransformTooLargeError = _chunkT3QZ6S47cjs.TransformTooLargeError; exports.VIBRANCE_GREY = _chunkFRD3FUXIcjs.VIBRANCE_GREY; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkDWGZUSEScjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkDWGZUSEScjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.XYZ_D50_TO_SRGB = _chunkFRD3FUXIcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkT3QZ6S47cjs.ZlibError; exports.activeAdjustmentLayers = _chunkFRD3FUXIcjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunkFRD3FUXIcjs.activeSmartFilters; exports.addLayerEffect = _chunkFRD3FUXIcjs.addLayerEffect; exports.addLayerFilter = _chunkFRD3FUXIcjs.addLayerFilter; exports.addSmartFilter = _chunkFRD3FUXIcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkFRD3FUXIcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkFRD3FUXIcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkFRD3FUXIcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = adjustmentNodeFromLegacy; exports.adler32 = _chunkT3QZ6S47cjs.adler32; exports.anchorPoint = _chunkFRD3FUXIcjs.anchorPoint; exports.annotationLayerFor = annotationLayerFor; exports.annotationLayerName = annotationLayerName; exports.applyAdjustmentLayers = _chunkFRD3FUXIcjs.applyAdjustmentLayers; exports.applyAdjustments = _chunkFRD3FUXIcjs.applyAdjustments; exports.applyBoxBlur = _chunkFRD3FUXIcjs.applyBoxBlur; exports.applyDepthMask = _chunkFRD3FUXIcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkFRD3FUXIcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkFRD3FUXIcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkFRD3FUXIcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkFRD3FUXIcjs.applyParams; exports.applyProcess2Adjustments = _chunkFRD3FUXIcjs.applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applySmartFilters = _chunkFRD3FUXIcjs.applySmartFilters; exports.applyStrokeToTile = _chunkHUFQD4CBcjs.applyStrokeToTile; exports.backgroundLayer = backgroundLayer; exports.base64ToBytes = _chunkT3QZ6S47cjs.base64ToBytes; exports.baseProjection = baseProjection; exports.blackWhiteGray = _chunkFRD3FUXIcjs.blackWhiteGray; exports.blendChannel = _chunkSZ6KMZNMcjs.blendChannel; exports.blendImageData = _chunkSZ6KMZNMcjs.blendImageData; exports.blendLum = _chunkSZ6KMZNMcjs.blendLum; exports.blendPixel = _chunkSZ6KMZNMcjs.blendPixel; exports.blendRgb = _chunkSZ6KMZNMcjs.blendRgb; exports.blendTile = _chunkT3QZ6S47cjs.blendTile; exports.blurFilter = _chunkFRD3FUXIcjs.blurFilter; exports.borderCoverage = _chunkFRD3FUXIcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkFRD3FUXIcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkFRD3FUXIcjs.bradfordAdaptation; exports.buildLayerMaskPlanes = _chunkFRD3FUXIcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkFRD3FUXIcjs.buildToneLut; exports.builtinPattern = _chunkT3QZ6S47cjs.builtinPattern; exports.builtinPatternIds = _chunkT3QZ6S47cjs.builtinPatternIds; exports.bytesToBase64 = _chunkT3QZ6S47cjs.bytesToBase64; exports.calculateCropDrag = _chunkFRD3FUXIcjs.calculateCropDrag; exports.canvasCompositeOperation = _chunkSZ6KMZNMcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkFRD3FUXIcjs.canvasToImagePoint; exports.changedTiles = _chunkT3QZ6S47cjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkFRD3FUXIcjs.clampCropToImage; exports.cleanMixer = _chunkHUFQD4CBcjs.cleanMixer; exports.collectTiles = _chunkSZ6KMZNMcjs.collectTiles; exports.colorBalanceChannel = _chunkFRD3FUXIcjs.colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = _chunkFRD3FUXIcjs.combineSelections; exports.compileAdjustmentLayer = _chunkFRD3FUXIcjs.compileAdjustmentLayer; exports.compositeSurfaceOver = _chunkT3QZ6S47cjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkFRD3FUXIcjs.computeSelectionBounds; exports.contentBounds = _chunkSZ6KMZNMcjs.contentBounds; exports.contentsBox = _chunkFRD3FUXIcjs.contentsBox; exports.contentsSurface = _chunkFRD3FUXIcjs.contentsSurface; exports.contractCoverage = _chunkFRD3FUXIcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertToSmartObject = _chunkFRD3FUXIcjs.convertToSmartObject; exports.copySmartObject = _chunkFRD3FUXIcjs.copySmartObject; exports.cornersFromMatrix = _chunkFRD3FUXIcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkHUFQD4CBcjs.coverageTileCoord; exports.coverageToByte = _chunkFRD3FUXIcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkFRD3FUXIcjs.createAdjustmentLayer; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createPigment = _chunkSZ6KMZNMcjs.createPigment; exports.createPigmentTools = _chunkHUFQD4CBcjs.createPigmentTools; exports.createSelectionMask = _chunkFRD3FUXIcjs.createSelectionMask; exports.curveLut = _chunkT3QZ6S47cjs.curveLut; exports.curveLutFromLevels = _chunkFRD3FUXIcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkHUFQD4CBcjs.dabCoverage; exports.dabRect = _chunkHUFQD4CBcjs.dabRect; exports.decodeLayerChannel = _chunkFRD3FUXIcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkFRD3FUXIcjs.decodeLayerMask; exports.decodeMergedImage = _chunkFRD3FUXIcjs.decodeMergedImage; exports.decodePlanes = _chunkFRD3FUXIcjs.decodePlanes; exports.decodePng = _chunkT3QZ6S47cjs.decodePng; exports.decodePngDataUrl = _chunkFRD3FUXIcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkFRD3FUXIcjs.decodeSelectionRle; exports.defaultAdjustmentParams = _chunkFRD3FUXIcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkT3QZ6S47cjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkT3QZ6S47cjs.defaultLayerEffect; exports.deflate = _chunkT3QZ6S47cjs.deflate; exports.deflateRaw = _chunkT3QZ6S47cjs.deflateRaw; exports.depthMaskAlpha = _chunkFRD3FUXIcjs.depthMaskAlpha; exports.depthRasterMask = depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkFRD3FUXIcjs.describeTransform; exports.deserializeEffects = _chunkFRD3FUXIcjs.deserializeEffects; exports.deserializeLayer = _chunkFRD3FUXIcjs.deserializeLayer; exports.deserializeLayers = _chunkFRD3FUXIcjs.deserializeLayers; exports.deserializePatterns = _chunkFRD3FUXIcjs.deserializePatterns; exports.deserializeSelection = _chunkFRD3FUXIcjs.deserializeSelection; exports.developFilter = _chunkFRD3FUXIcjs.developFilter; exports.developFromAdjustments = developFromAdjustments; exports.developTarget = developTarget; exports.distanceTransform = _chunkFRD3FUXIcjs.distanceTransform; exports.documentContents = _chunkFRD3FUXIcjs.documentContents; exports.downloadPsd = downloadPsd; exports.dragWarpMeshPoint = _chunkDWGZUSEScjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.duplicateLayer = _chunkFRD3FUXIcjs.duplicateLayer; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkT3QZ6S47cjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkT3QZ6S47cjs.effectReach; exports.effectsFingerprint = _chunkT3QZ6S47cjs.effectsFingerprint; exports.effectsMargin = _chunkT3QZ6S47cjs.effectsMargin; exports.effectsScale = _chunkT3QZ6S47cjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkSZ6KMZNMcjs.emptySurface; exports.encodePng = _chunkT3QZ6S47cjs.encodePng; exports.encodeRle = _chunkFRD3FUXIcjs.encodeRle; exports.encodeSelectionRle = _chunkFRD3FUXIcjs.encodeSelectionRle; exports.encodeSurface = _chunkFRD3FUXIcjs.encodeSurface; exports.evalWarpMesh = _chunkDWGZUSEScjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkFRD3FUXIcjs.evaluateAdjustmentLayers; exports.expandCoverage = _chunkFRD3FUXIcjs.expandCoverage; exports.exportPsd = _chunkFRD3FUXIcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkFRD3FUXIcjs.featherCoverage; exports.fillRect = _chunkSZ6KMZNMcjs.fillRect; exports.filterMaskCoverage = _chunkFRD3FUXIcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkT3QZ6S47cjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunkSZ6KMZNMcjs.finishTile; exports.flattenLayers = _chunkT3QZ6S47cjs.flattenLayers; exports.flipCorners = _chunkFRD3FUXIcjs.flipCorners; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkFRD3FUXIcjs.fullSelection; exports.gaussianBlur = _chunkT3QZ6S47cjs.gaussianBlur; exports.geometryHomography = _chunkFRD3FUXIcjs.geometryHomography; exports.getAnnotationBounds = _chunkFRD3FUXIcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkFRD3FUXIcjs.getCropCursor; exports.getRotatedSize = _chunkFRD3FUXIcjs.getRotatedSize; exports.getViewportMetrics = _chunkFRD3FUXIcjs.getViewportMetrics; exports.getViewportProjection = _chunkFRD3FUXIcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunkFRD3FUXIcjs.greyMorphology; exports.groupLayers = _chunkFRD3FUXIcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkT3QZ6S47cjs.hasActiveEffects; exports.hasResampledLegacyMask = hasResampledLegacyMask; exports.hasSurface = _chunkFRD3FUXIcjs.hasSurface; exports.hasWarp = _chunkFRD3FUXIcjs.hasWarp; exports.hashMaskContent = _chunkFRD3FUXIcjs.hashMaskContent; exports.hashNoise = _chunkT3QZ6S47cjs.hashNoise; exports.hexToRgb = _chunkFRD3FUXIcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkFRD3FUXIcjs.hitTestAnnotation; exports.hitTestCrop = _chunkFRD3FUXIcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkFRD3FUXIcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkFRD3FUXIcjs.hueRangeTables; exports.hueRangeWeight = _chunkFRD3FUXIcjs.hueRangeWeight; exports.hueSaturation = _chunkFRD3FUXIcjs.hueSaturation; exports.identityCurve = _chunkFRD3FUXIcjs.identityCurve; exports.identityLevels = _chunkFRD3FUXIcjs.identityLevels; exports.identityTransform = _chunkFRD3FUXIcjs.identityTransform; exports.identityWarpMesh = _chunkDWGZUSEScjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunkFRD3FUXIcjs.imageToCanvasPoint; exports.importPsd = _chunkFRD3FUXIcjs.importPsd; exports.inflate = _chunkT3QZ6S47cjs.inflate; exports.inflateRaw = _chunkT3QZ6S47cjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkT3QZ6S47cjs.insertLayer; exports.instancesOf = _chunkFRD3FUXIcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkFRD3FUXIcjs.invertMatrix3; exports.invertSelection = _chunkFRD3FUXIcjs.invertSelection; exports.isActiveFilter = _chunkFRD3FUXIcjs.isActiveFilter; exports.isAdjustmentKind = _chunkFRD3FUXIcjs.isAdjustmentKind; exports.isBlendMode = _chunkSZ6KMZNMcjs.isBlendMode; exports.isContentsDecoded = _chunkFRD3FUXIcjs.isContentsDecoded; exports.isDefaultDepthMask = isDefaultDepthMask; exports.isIdentityTransform = _chunkFRD3FUXIcjs.isIdentityTransform; exports.isInterpolation = _chunkT3QZ6S47cjs.isInterpolation; exports.isLayerEffectKind = _chunkT3QZ6S47cjs.isLayerEffectKind; exports.isLayerLocked = _chunkT3QZ6S47cjs.isLayerLocked; exports.isLegacyShape = isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkSZ6KMZNMcjs.isPainterlyBlendMode; exports.isPng = _chunkT3QZ6S47cjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkFRD3FUXIcjs.isQuarterTurnSwapped; exports.isSelectionEmpty = _chunkFRD3FUXIcjs.isSelectionEmpty; exports.isSelectionMode = _chunkFRD3FUXIcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkSZ6KMZNMcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunkFRD3FUXIcjs.isSpatialFilter; exports.isTransformAnchor = _chunkFRD3FUXIcjs.isTransformAnchor; exports.isValidWarp = _chunkFRD3FUXIcjs.isValidWarp; exports.kelvinToTemperature = _chunkFRD3FUXIcjs.kelvinToTemperature; exports.keysWeight = _chunkT3QZ6S47cjs.keysWeight; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkT3QZ6S47cjs.layerEffectFields; exports.layerEffectLabel = _chunkT3QZ6S47cjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkFRD3FUXIcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkFRD3FUXIcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkFRD3FUXIcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkFRD3FUXIcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkFRD3FUXIcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkFRD3FUXIcjs.layerTree; exports.layerTypeLabel = _chunkFRD3FUXIcjs.layerTypeLabel; exports.layersFromLegacy = layersFromLegacy; exports.legacyAdjustmentLayer = legacyAdjustmentLayer; exports.legacyMaskOf = legacyMaskOf; exports.legacyView = legacyView; exports.lerpPigment = _chunkSZ6KMZNMcjs.lerpPigment; exports.lerpPigmentInto = _chunkSZ6KMZNMcjs.lerpPigmentInto; exports.levelsValue = _chunkFRD3FUXIcjs.levelsValue; exports.linearSrgbToXy = _chunkFRD3FUXIcjs.linearSrgbToXy; exports.linearToSrgb = _chunkFRD3FUXIcjs.linearToSrgb; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkHUFQD4CBcjs.loadMixer; exports.magicWand = magicWand; exports.mapCropHandle = _chunkFRD3FUXIcjs.mapCropHandle; exports.mapLayer = _chunkT3QZ6S47cjs.mapLayer; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkFRD3FUXIcjs.matrixFromCorners; exports.matrixFromParams = _chunkFRD3FUXIcjs.matrixFromParams; exports.mergeLayerEffect = _chunkT3QZ6S47cjs.mergeLayerEffect; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunkSZ6KMZNMcjs.mixPigment8; exports.mixPigmentRgb = _chunkSZ6KMZNMcjs.mixPigmentRgb; exports.mixPigments = _chunkSZ6KMZNMcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.modifySelection = _chunkFRD3FUXIcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkFRD3FUXIcjs.moveLayer; exports.moveSmartFilter = _chunkFRD3FUXIcjs.moveSmartFilter; exports.mulMatrix3 = _chunkFRD3FUXIcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkFRD3FUXIcjs.neutralHueRange; exports.newContentsId = _chunkFRD3FUXIcjs.newContentsId; exports.newEffectId = _chunkT3QZ6S47cjs.newEffectId; exports.newLayerId = _chunkFRD3FUXIcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkFRD3FUXIcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkFRD3FUXIcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkFRD3FUXIcjs.normalizeAngle; exports.normalizeBlendMode = _chunkSZ6KMZNMcjs.normalizeBlendMode; exports.normalizeBrush = _chunkHUFQD4CBcjs.normalizeBrush; exports.normalizeFilter = _chunkFRD3FUXIcjs.normalizeFilter; exports.normalizeLayerEffects = _chunkT3QZ6S47cjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkFRD3FUXIcjs.normalizeLayerMask; exports.normalizeMixer = _chunkHUFQD4CBcjs.normalizeMixer; exports.normalizePlacement = _chunkFRD3FUXIcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkFRD3FUXIcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeSmartFilter = _chunkFRD3FUXIcjs.normalizeSmartFilter; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.offsetLayer = _chunkFRD3FUXIcjs.offsetLayer; exports.offsetSmartObject = _chunkFRD3FUXIcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkSZ6KMZNMcjs.packRgba; exports.parseAdjustmentBlock = _chunkFRD3FUXIcjs.parseAdjustmentBlock; exports.parseBlend = _chunkFRD3FUXIcjs.parseBlend; exports.parseColor = parseColor; exports.parseDataUrl = _chunkT3QZ6S47cjs.parseDataUrl; exports.parseEffectColor = _chunkT3QZ6S47cjs.parseEffectColor; exports.parseLfx2 = _chunkFRD3FUXIcjs.parseLfx2; exports.parseLrfx = _chunkFRD3FUXIcjs.parseLrfx; exports.parsePatternBlock = _chunkFRD3FUXIcjs.parsePatternBlock; exports.parseSelectionMode = _chunkFRD3FUXIcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkFRD3FUXIcjs.parseVersionedDescriptor; exports.photoFilterMatrix = _chunkFRD3FUXIcjs.photoFilterMatrix; exports.pixelLayerBounds = _chunkFRD3FUXIcjs.pixelLayerBounds; exports.pixelLayers = _chunkFRD3FUXIcjs.pixelLayers; exports.placeContents = _chunkFRD3FUXIcjs.placeContents; exports.placeLayer = _chunkFRD3FUXIcjs.placeLayer; exports.placementAt = _chunkFRD3FUXIcjs.placementAt; exports.placementBounds = _chunkFRD3FUXIcjs.placementBounds; exports.placementGeometry = _chunkFRD3FUXIcjs.placementGeometry; exports.pngDataUrl = _chunkT3QZ6S47cjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkFRD3FUXIcjs.posterizeValue; exports.presetWarp = _chunkFRD3FUXIcjs.presetWarp; exports.previewStep = previewStep; exports.projectImagePoint = _chunkFRD3FUXIcjs.projectImagePoint; exports.projectImageRect = _chunkFRD3FUXIcjs.projectImageRect; exports.projectMaskCoverage = _chunkFRD3FUXIcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkFRD3FUXIcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkFRD3FUXIcjs.psdToLayers; exports.pullWarpMesh = _chunkDWGZUSEScjs.pullWarpMesh; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunkFRD3FUXIcjs.rangeLightness; exports.rasterContents = _chunkFRD3FUXIcjs.rasterContents; exports.rasterMaskFromLegacy = rasterMaskFromLegacy; exports.rasterizeDab = _chunkHUFQD4CBcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkFRD3FUXIcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readPixel = _chunkSZ6KMZNMcjs.readPixel; exports.readPsd = _chunkFRD3FUXIcjs.readPsd; exports.readRegion = _chunkSZ6KMZNMcjs.readRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkT3QZ6S47cjs.reduceSurface; exports.referencePoint = _chunkFRD3FUXIcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkSZ6KMZNMcjs.reflectanceToRgb; exports.removeAlpha = _chunkFRD3FUXIcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkFRD3FUXIcjs.removeLayer; exports.removeLayerEffect = _chunkFRD3FUXIcjs.removeLayerEffect; exports.removeLayerFilter = _chunkFRD3FUXIcjs.removeLayerFilter; exports.removeSmartFilter = _chunkFRD3FUXIcjs.removeSmartFilter; exports.renderLayerEffects = _chunkT3QZ6S47cjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderSmartObject = _chunkFRD3FUXIcjs.renderSmartObject; exports.replaceContents = _chunkFRD3FUXIcjs.replaceContents; exports.requireLayer = _chunkFRD3FUXIcjs.requireLayer; exports.requireSmartObject = _chunkFRD3FUXIcjs.requireSmartObject; exports.requireUnlocked = _chunkFRD3FUXIcjs.requireUnlocked; exports.rerender = _chunkFRD3FUXIcjs.rerender; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkFRD3FUXIcjs.resizeSelection; exports.resizeWarpMesh = _chunkDWGZUSEScjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkFRD3FUXIcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.rgbToGray = _chunkFRD3FUXIcjs.rgbToGray; exports.rgbToHsl = _chunkFRD3FUXIcjs.rgbToHsl; exports.rgbToReflectance = _chunkSZ6KMZNMcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.runLayerFilters = _chunkFRD3FUXIcjs.runLayerFilters; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkFRD3FUXIcjs.sampleLut; exports.sampleToneLut = _chunkFRD3FUXIcjs.sampleToneLut; exports.scaleLayerEffect = _chunkT3QZ6S47cjs.scaleLayerEffect; exports.selectionArea = _chunkFRD3FUXIcjs.selectionArea; exports.selectionFromCoverage = _chunkFRD3FUXIcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkFRD3FUXIcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkFRD3FUXIcjs.selectionToCoverage; exports.selectionToPixels = _chunkFRD3FUXIcjs.selectionToPixels; exports.selectionValueAt = _chunkFRD3FUXIcjs.selectionValueAt; exports.serializeContents = _chunkFRD3FUXIcjs.serializeContents; exports.serializeEffects = _chunkFRD3FUXIcjs.serializeEffects; exports.serializeLayer = _chunkFRD3FUXIcjs.serializeLayer; exports.serializeLayers = _chunkFRD3FUXIcjs.serializeLayers; exports.serializeLayersExternal = _chunkFRD3FUXIcjs.serializeLayersExternal; exports.serializePatterns = _chunkFRD3FUXIcjs.serializePatterns; exports.serializeSelection = _chunkFRD3FUXIcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkFRD3FUXIcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkFRD3FUXIcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkFRD3FUXIcjs.setLayerMask; exports.setLayerProperties = _chunkFRD3FUXIcjs.setLayerProperties; exports.setLum = _chunkSZ6KMZNMcjs.setLum; exports.setPigmentColor = _chunkSZ6KMZNMcjs.setPigmentColor; exports.setSmartFilterMask = _chunkFRD3FUXIcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkFRD3FUXIcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkFRD3FUXIcjs.setSmartPlacement; exports.shiftCoverage = _chunkFRD3FUXIcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkFRD3FUXIcjs.smartObjectLayers; exports.smoothCoverage = _chunkFRD3FUXIcjs.smoothCoverage; exports.smoothPoints = _chunkHUFQD4CBcjs.smoothPoints; exports.solidSurface = _chunkSZ6KMZNMcjs.solidSurface; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = _chunkFRD3FUXIcjs.srgbToLinear; exports.standardBlendMode = _chunkSZ6KMZNMcjs.standardBlendMode; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkSZ6KMZNMcjs.surfaceBytes; exports.surfaceFromPixels = _chunkSZ6KMZNMcjs.surfaceFromPixels; exports.surfacesEqual = _chunkSZ6KMZNMcjs.surfacesEqual; exports.tempTintToXy = _chunkFRD3FUXIcjs.tempTintToXy; exports.temperatureToKelvin = _chunkFRD3FUXIcjs.temperatureToKelvin; exports.tileCoord = _chunkSZ6KMZNMcjs.tileCoord; exports.tileKey = _chunkSZ6KMZNMcjs.tileKey; exports.tileRect = _chunkSZ6KMZNMcjs.tileRect; exports.tilesInRect = _chunkSZ6KMZNMcjs.tilesInRect; exports.tipFalloff = _chunkHUFQD4CBcjs.tipFalloff; exports.tipReach = _chunkHUFQD4CBcjs.tipReach; exports.tipShape = _chunkHUFQD4CBcjs.tipShape; exports.toHex = toHex; exports.toneCurve = _chunkFRD3FUXIcjs.toneCurve; exports.toneLuts = _chunkFRD3FUXIcjs.toneLuts; exports.toneRange = toneRange; exports.transformHomography = _chunkFRD3FUXIcjs.transformHomography; exports.transformMap = _chunkFRD3FUXIcjs.transformMap; exports.transformSurface = _chunkT3QZ6S47cjs.transformSurface; exports.transformedBounds = _chunkT3QZ6S47cjs.transformedBounds; exports.transformedBox = _chunkFRD3FUXIcjs.transformedBox; exports.transformedPoint = _chunkFRD3FUXIcjs.transformedPoint; exports.translateSurface = _chunkSZ6KMZNMcjs.translateSurface; exports.ungroupLayer = _chunkFRD3FUXIcjs.ungroupLayer; exports.uniformTile = _chunkSZ6KMZNMcjs.uniformTile; exports.unionRect = _chunkFRD3FUXIcjs.unionRect; exports.unprojectCanvasPoint = _chunkFRD3FUXIcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkFRD3FUXIcjs.updateLayerEffect; exports.updateLayerFilter = _chunkFRD3FUXIcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkFRD3FUXIcjs.updateLayerMaskProps; exports.updateSmartFilter = _chunkFRD3FUXIcjs.updateSmartFilter; exports.uvToXy = _chunkFRD3FUXIcjs.uvToXy; exports.validateEffectGradient = _chunkT3QZ6S47cjs.validateEffectGradient; exports.validateLayerEffect = _chunkT3QZ6S47cjs.validateLayerEffect; exports.validateLayerEffects = _chunkT3QZ6S47cjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkFRD3FUXIcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkFRD3FUXIcjs.vibranceLinear; exports.vibrancePixel = _chunkFRD3FUXIcjs.vibrancePixel; exports.walkDabs = _chunkHUFQD4CBcjs.walkDabs; exports.warpMeshEditPoints = _chunkDWGZUSEScjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkDWGZUSEScjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkDWGZUSEScjs.warpMeshParamAt; exports.warpPresetMesh = _chunkDWGZUSEScjs.warpPresetMesh; exports.warpSurface = _chunkT3QZ6S47cjs.warpSurface; exports.wbMatrix = _chunkFRD3FUXIcjs.wbMatrix; exports.whiteBalanceFromSample = _chunkFRD3FUXIcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkFRD3FUXIcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkFRD3FUXIcjs.withFilterMaskSurface; exports.withNewIds = _chunkFRD3FUXIcjs.withNewIds; exports.writeAdjustmentBlock = _chunkFRD3FUXIcjs.writeAdjustmentBlock; exports.writeLfx2 = _chunkFRD3FUXIcjs.writeLfx2; exports.writePatternBlock = _chunkFRD3FUXIcjs.writePatternBlock; exports.writePsd = _chunkFRD3FUXIcjs.writePsd; exports.writeRegion = _chunkSZ6KMZNMcjs.writeRegion; exports.xyToTempTint = _chunkFRD3FUXIcjs.xyToTempTint; exports.xyToUv = _chunkFRD3FUXIcjs.xyToUv;
|
|
11441
11640
|
//# sourceMappingURL=index.cjs.map
|