@pixerate/editor 0.104.0 → 0.106.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-NQLQ2JOI.js → chunk-4X5MIVCE.js} +1155 -295
- package/dist/chunk-4X5MIVCE.js.map +1 -0
- package/dist/{chunk-VSMM7B3P.cjs → chunk-ZID226ZG.cjs} +1169 -309
- package/dist/chunk-ZID226ZG.cjs.map +1 -0
- package/dist/{compositor-CTMU-B1t.d.cts → compositor-Bc3PNP3C.d.cts} +1 -1
- package/dist/{compositor-B1ZrKR89.d.ts → compositor-BsYYllvR.d.ts} +1 -1
- package/dist/{export-X9rY79p0.d.cts → export-_m3Es4ru.d.cts} +19 -4
- package/dist/{export-BLpMyCYg.d.ts → export-iMrop3Jm.d.ts} +19 -4
- package/dist/image-editor/index.cjs +714 -539
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +50 -9
- package/dist/image-editor/index.d.ts +50 -9
- package/dist/image-editor/index.js +228 -53
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{mixer-DGcH6HLu.d.cts → mixer-C1M1Nua_.d.cts} +1 -1
- package/dist/{mixer-DG_9Yu2W.d.ts → mixer-Cu5a9Bzd.d.ts} +1 -1
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint-editor/index.cjs +348 -32
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +154 -13
- package/dist/paint-editor/index.d.ts +154 -13
- package/dist/paint-editor/index.js +317 -1
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/raster/index.d.cts +4 -4
- package/dist/raster/index.d.ts +4 -4
- package/dist/{surface-AfHCH7BR.d.cts → surface-BBJN9wxg.d.cts} +1 -1
- package/dist/{surface-AfHCH7BR.d.ts → surface-BBJN9wxg.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-NQLQ2JOI.js.map +0 -1
- package/dist/chunk-VSMM7B3P.cjs.map +0 -1
|
@@ -277,7 +277,9 @@ require('../chunk-6BU5WU4R.cjs');
|
|
|
277
277
|
|
|
278
278
|
|
|
279
279
|
|
|
280
|
-
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
var _chunkZID226ZGcjs = require('../chunk-ZID226ZG.cjs');
|
|
281
283
|
|
|
282
284
|
|
|
283
285
|
|
|
@@ -555,9 +557,9 @@ var DEVELOP_FILTER_ID = "develop";
|
|
|
555
557
|
var BLUR_FILTER_ID = "blur";
|
|
556
558
|
var legacyMaskMemo = /* @__PURE__ */ new WeakMap();
|
|
557
559
|
function rasterMaskFromLegacy(mask, width, height) {
|
|
558
|
-
const sel =
|
|
560
|
+
const sel = _chunkZID226ZGcjs.decodeLayerMask.call(void 0, mask);
|
|
559
561
|
if (!sel) return null;
|
|
560
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
562
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkZID226ZGcjs.resizeSelection.call(void 0, sel, width, height);
|
|
561
563
|
const surface = _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0);
|
|
562
564
|
legacyMaskMemo.set(surface, { width: mask.width, height: mask.height, rle: mask.rle });
|
|
563
565
|
const out = { surface, defaultValue: 0 };
|
|
@@ -578,17 +580,17 @@ function legacyMaskOf(mask, width, height) {
|
|
|
578
580
|
let memo = legacyMaskMemo.get(mask.surface);
|
|
579
581
|
if (!memo) {
|
|
580
582
|
const data = _chunkCRMAXIUVcjs.readRegion.call(void 0, mask.surface, { x: 0, y: 0, width, height });
|
|
581
|
-
memo = { width, height, rle:
|
|
583
|
+
memo = { width, height, rle: _chunkZID226ZGcjs.encodeSelectionRle.call(void 0, new Uint8Array(data.buffer, data.byteOffset, data.length)) };
|
|
582
584
|
legacyMaskMemo.set(mask.surface, memo);
|
|
583
585
|
}
|
|
584
|
-
return
|
|
586
|
+
return _chunkZID226ZGcjs.normalizeLayerMask.call(void 0, { ...memo, density: mask.density, feather: mask.feather, enabled: mask.enabled });
|
|
585
587
|
}
|
|
586
588
|
function sameJson(a, b) {
|
|
587
589
|
return JSON.stringify(a) === JSON.stringify(b);
|
|
588
590
|
}
|
|
589
591
|
function isDefaultDepthMask(mask) {
|
|
590
592
|
if (!mask) return true;
|
|
591
|
-
return sameJson({ ...
|
|
593
|
+
return sameJson({ ..._chunkZID226ZGcjs.DEFAULT_DEPTH_MASK_VALUES, ...mask, depthRange: [..._nullishCoalesce(mask.depthRange, () => ( []))] }, _chunkZID226ZGcjs.DEFAULT_DEPTH_MASK_VALUES);
|
|
592
594
|
}
|
|
593
595
|
function developFromAdjustments(adjustments) {
|
|
594
596
|
return {
|
|
@@ -601,7 +603,7 @@ function developFromAdjustments(adjustments) {
|
|
|
601
603
|
exposure: _nullishCoalesce(adjustments.exposure, () => ( 0)),
|
|
602
604
|
temperature: _nullishCoalesce(adjustments.temperature, () => ( 0)),
|
|
603
605
|
tint: _nullishCoalesce(adjustments.tint, () => ( 0)),
|
|
604
|
-
process:
|
|
606
|
+
process: _chunkZID226ZGcjs.normalizeProcessVersion.call(void 0, adjustments.process)
|
|
605
607
|
};
|
|
606
608
|
}
|
|
607
609
|
function annotationLayerName(annotation) {
|
|
@@ -677,8 +679,8 @@ function depthRasterMask(source) {
|
|
|
677
679
|
}
|
|
678
680
|
function layersFromLegacy(parts, width, height) {
|
|
679
681
|
const stored = parts.adjustments;
|
|
680
|
-
const adjustments = stored ? { ...
|
|
681
|
-
const adjLayers =
|
|
682
|
+
const adjustments = stored ? { ..._chunkZID226ZGcjs.DEFAULT_ADJUSTMENTS_VALUES, ...stored, process: _chunkZID226ZGcjs.normalizeProcessVersion.call(void 0, stored.process) } : { ..._chunkZID226ZGcjs.DEFAULT_ADJUSTMENTS_VALUES };
|
|
683
|
+
const adjLayers = _chunkZID226ZGcjs.normalizeAdjustmentLayers.call(void 0, adjustments.layers);
|
|
682
684
|
const filters = [developFromAdjustments(adjustments)];
|
|
683
685
|
const blur = typeof adjustments.blur === "number" && adjustments.blur > 0 ? adjustments.blur : 0;
|
|
684
686
|
let legacyOutputBlur;
|
|
@@ -687,7 +689,7 @@ function layersFromLegacy(parts, width, height) {
|
|
|
687
689
|
else filters.push({ id: BLUR_FILTER_ID, kind: "blur", enabled: true, radius: blur });
|
|
688
690
|
}
|
|
689
691
|
const depth = parts.depthMask;
|
|
690
|
-
const mask = depth && !isDefaultDepthMask(depth) ? depthRasterMask({ ...
|
|
692
|
+
const mask = depth && !isDefaultDepthMask(depth) ? depthRasterMask({ ..._chunkZID226ZGcjs.DEFAULT_DEPTH_MASK_VALUES, ...depth }) : void 0;
|
|
691
693
|
const layers = [backgroundLayer(filters, mask)];
|
|
692
694
|
for (const l of adjLayers) layers.push(adjustmentNodeFromLegacy(l, width, height));
|
|
693
695
|
for (const a of _nullishCoalesce(parts.annotations, () => ( []))) layers.push(annotationLayerFor(JSON.parse(JSON.stringify(a))));
|
|
@@ -727,10 +729,10 @@ var isPlain = (l) => l.visible && l.opacity === 1 && l.blend === "normal" && !l.
|
|
|
727
729
|
function legacyView(stack, width, height, activeLayerId = null) {
|
|
728
730
|
const { layers } = stack;
|
|
729
731
|
const target = developTarget(layers, activeLayerId);
|
|
730
|
-
const develop = target ?
|
|
731
|
-
const blur = _nullishCoalesce(_nullishCoalesce(stack.legacyOutputBlur, () => ( (target ? _optionalChain([
|
|
732
|
+
const develop = target ? _chunkZID226ZGcjs.developFilter.call(void 0, target) : void 0;
|
|
733
|
+
const blur = _nullishCoalesce(_nullishCoalesce(stack.legacyOutputBlur, () => ( (target ? _optionalChain([_chunkZID226ZGcjs.blurFilter.call(void 0, target), 'optionalAccess', _2 => _2.radius]) : void 0))), () => ( 0));
|
|
732
734
|
const adjustments = {
|
|
733
|
-
...
|
|
735
|
+
..._chunkZID226ZGcjs.DEFAULT_ADJUSTMENTS_VALUES,
|
|
734
736
|
...develop ? {
|
|
735
737
|
brightness: develop.brightness,
|
|
736
738
|
contrast: develop.contrast,
|
|
@@ -741,7 +743,7 @@ function legacyView(stack, width, height, activeLayerId = null) {
|
|
|
741
743
|
} : {},
|
|
742
744
|
blur,
|
|
743
745
|
opacity: stack.outputOpacity,
|
|
744
|
-
process: develop ?
|
|
746
|
+
process: develop ? _chunkZID226ZGcjs.normalizeProcessVersion.call(void 0, develop.process) : _chunkZID226ZGcjs.DEFAULT_ADJUSTMENTS_VALUES.process
|
|
745
747
|
};
|
|
746
748
|
const adjNodes = [];
|
|
747
749
|
const annotations = [];
|
|
@@ -755,7 +757,7 @@ function legacyView(stack, width, height, activeLayerId = null) {
|
|
|
755
757
|
walk(layers);
|
|
756
758
|
if (adjNodes.length) adjustments.layers = adjNodes.map((n) => legacyAdjustmentLayer(n, width, height));
|
|
757
759
|
const depthSource = _optionalChain([target, 'optionalAccess', _3 => _3.mask, 'optionalAccess', _4 => _4.source]);
|
|
758
|
-
const depthMask = depthSource ? { ...depthSource, depthRange: [...depthSource.depthRange] } : { ...
|
|
760
|
+
const depthMask = depthSource ? { ...depthSource, depthRange: [...depthSource.depthRange] } : { ..._chunkZID226ZGcjs.DEFAULT_DEPTH_MASK_VALUES, depthRange: [..._chunkZID226ZGcjs.DEFAULT_DEPTH_MASK_VALUES.depthRange] };
|
|
759
761
|
return { adjustments, depthMask, annotations, exact: isLegacyShape(stack) };
|
|
760
762
|
}
|
|
761
763
|
function isLegacyShape(stack) {
|
|
@@ -793,7 +795,7 @@ function isLegacyShape(stack) {
|
|
|
793
795
|
|
|
794
796
|
// src/image-editor/layers/render.ts
|
|
795
797
|
function isQuarterTurn(rotate) {
|
|
796
|
-
return
|
|
798
|
+
return _chunkZID226ZGcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
|
|
797
799
|
}
|
|
798
800
|
function isIntegerRect(r) {
|
|
799
801
|
return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
|
|
@@ -801,7 +803,7 @@ function isIntegerRect(r) {
|
|
|
801
803
|
function baseProjection(region, transform, baseW, baseH) {
|
|
802
804
|
return {
|
|
803
805
|
region,
|
|
804
|
-
angle:
|
|
806
|
+
angle: _chunkZID226ZGcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
805
807
|
flipH: transform.flipH,
|
|
806
808
|
flipV: transform.flipV,
|
|
807
809
|
scale: 1,
|
|
@@ -810,14 +812,14 @@ function baseProjection(region, transform, baseW, baseH) {
|
|
|
810
812
|
};
|
|
811
813
|
}
|
|
812
814
|
function projectQuarterTurn(src, srcRect, region, transform) {
|
|
813
|
-
const rotated =
|
|
815
|
+
const rotated = _chunkZID226ZGcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
814
816
|
const w = Math.max(1, Math.round(rotated.width));
|
|
815
817
|
const h = Math.max(1, Math.round(rotated.height));
|
|
816
818
|
const out = new Uint8ClampedArray(w * h * 4);
|
|
817
819
|
const p = baseProjection(region, transform, w, h);
|
|
818
|
-
const o =
|
|
819
|
-
const ox =
|
|
820
|
-
const oy =
|
|
820
|
+
const o = _chunkZID226ZGcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
|
|
821
|
+
const ox = _chunkZID226ZGcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
|
|
822
|
+
const oy = _chunkZID226ZGcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
|
|
821
823
|
const ux = Math.round(ox.x - o.x);
|
|
822
824
|
const vx = Math.round(ox.y - o.y);
|
|
823
825
|
const uy = Math.round(oy.x - o.x);
|
|
@@ -846,7 +848,7 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
|
|
|
846
848
|
const d = img.data;
|
|
847
849
|
for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
|
|
848
850
|
}
|
|
849
|
-
if (legacyOutputBlur && legacyOutputBlur > 0)
|
|
851
|
+
if (legacyOutputBlur && legacyOutputBlur > 0) _chunkZID226ZGcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
|
|
850
852
|
}
|
|
851
853
|
function needsLegacyBase(input) {
|
|
852
854
|
const { stack, region, canvas, transform } = input;
|
|
@@ -855,10 +857,10 @@ function needsLegacyBase(input) {
|
|
|
855
857
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
|
|
856
858
|
if (_optionalChain([bg, 'access', _7 => _7.mask, 'optionalAccess', _8 => _8.source, 'optionalAccess', _9 => _9.enabled]) && bg.mask.source.maskSource) return true;
|
|
857
859
|
if (stack.outputOpacity < 1) return true;
|
|
858
|
-
const blur =
|
|
860
|
+
const blur = _chunkZID226ZGcjs.blurFilter.call(void 0, bg);
|
|
859
861
|
if (blur && blur.enabled && blur.radius > 0) {
|
|
860
862
|
const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
|
|
861
|
-
const angle =
|
|
863
|
+
const angle = _chunkZID226ZGcjs.normalizeAngle.call(void 0, transform.rotate);
|
|
862
864
|
if (!full || angle === 90 || angle === 270) return true;
|
|
863
865
|
}
|
|
864
866
|
if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
|
|
@@ -883,7 +885,7 @@ function coveringRect(region) {
|
|
|
883
885
|
const y = Math.floor(region.y);
|
|
884
886
|
return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
|
|
885
887
|
}
|
|
886
|
-
function renderLayeredBase(stack, region, transform, sources, compositor = new (0,
|
|
888
|
+
function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkZID226ZGcjs.LayerCompositor)()) {
|
|
887
889
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
|
|
888
890
|
throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
|
|
889
891
|
}
|
|
@@ -1017,8 +1019,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1017
1019
|
* The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
|
|
1018
1020
|
* trust dirty rectangles; exports use `exportCompositor`.
|
|
1019
1021
|
*/
|
|
1020
|
-
__init8() {this.compositor = new (0,
|
|
1021
|
-
__init9() {this.exportCompositor = new (0,
|
|
1022
|
+
__init8() {this.compositor = new (0, _chunkZID226ZGcjs.LayerCompositor)()}
|
|
1023
|
+
__init9() {this.exportCompositor = new (0, _chunkZID226ZGcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
|
|
1022
1024
|
/** How the host resolves layer pixels (set by the controller). */
|
|
1023
1025
|
|
|
1024
1026
|
/**
|
|
@@ -1084,9 +1086,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1084
1086
|
return;
|
|
1085
1087
|
}
|
|
1086
1088
|
const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
|
|
1087
|
-
const projection =
|
|
1089
|
+
const projection = _chunkZID226ZGcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
|
|
1088
1090
|
const { region } = projection;
|
|
1089
|
-
const rotated =
|
|
1091
|
+
const rotated = _chunkZID226ZGcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1090
1092
|
const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
|
|
1091
1093
|
let overlay = annotations;
|
|
1092
1094
|
if (route === "legacy") {
|
|
@@ -1096,8 +1098,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1096
1098
|
`${naturalWidth}x${naturalHeight}`,
|
|
1097
1099
|
`${region.x},${region.y},${region.width},${region.height}`,
|
|
1098
1100
|
`${projection.angle},${transform.flipH},${transform.flipV}`,
|
|
1099
|
-
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${
|
|
1100
|
-
|
|
1101
|
+
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkZID226ZGcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
|
|
1102
|
+
_chunkZID226ZGcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
|
|
1101
1103
|
`${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}`
|
|
1102
1104
|
].join("|");
|
|
1103
1105
|
let baseCanvas = this.cachedBaseCanvas;
|
|
@@ -1129,7 +1131,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1129
1131
|
}
|
|
1130
1132
|
if (overlay.length > 0 || options.draftAnnotation) {
|
|
1131
1133
|
ctx.save();
|
|
1132
|
-
|
|
1134
|
+
_chunkZID226ZGcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1133
1135
|
ctx.beginPath();
|
|
1134
1136
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1135
1137
|
ctx.clip();
|
|
@@ -1152,7 +1154,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1152
1154
|
if (_optionalChain([state, 'access', _18 => _18.selection, 'optionalAccess', _19 => _19.bounds]) && display !== "none" || _optionalChain([options, 'access', _20 => _20.draftSelectionPath, 'optionalAccess', _21 => _21.length])) {
|
|
1153
1155
|
ctx.save();
|
|
1154
1156
|
try {
|
|
1155
|
-
|
|
1157
|
+
_chunkZID226ZGcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1156
1158
|
ctx.beginPath();
|
|
1157
1159
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1158
1160
|
ctx.clip();
|
|
@@ -1167,7 +1169,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1167
1169
|
const b = options.brushCursor;
|
|
1168
1170
|
ctx.save();
|
|
1169
1171
|
try {
|
|
1170
|
-
|
|
1172
|
+
_chunkZID226ZGcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1171
1173
|
const px2 = 1 / (projection.scale || 1);
|
|
1172
1174
|
ctx.beginPath();
|
|
1173
1175
|
ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
|
|
@@ -1185,7 +1187,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1185
1187
|
const t = options.freeTransform;
|
|
1186
1188
|
ctx.save();
|
|
1187
1189
|
try {
|
|
1188
|
-
const scr = (p) =>
|
|
1190
|
+
const scr = (p) => _chunkZID226ZGcjs.projectImagePoint.call(void 0, p, projection);
|
|
1189
1191
|
ctx.beginPath();
|
|
1190
1192
|
if (t.warp) {
|
|
1191
1193
|
for (const c of t.warp.curves) {
|
|
@@ -1243,7 +1245,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1243
1245
|
}
|
|
1244
1246
|
if (isActivelyCropping) {
|
|
1245
1247
|
const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
|
|
1246
|
-
this.drawCropOverlay(ctx,
|
|
1248
|
+
this.drawCropOverlay(ctx, _chunkZID226ZGcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
|
|
1247
1249
|
}
|
|
1248
1250
|
}
|
|
1249
1251
|
/**
|
|
@@ -1252,7 +1254,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1252
1254
|
*/
|
|
1253
1255
|
async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
|
|
1254
1256
|
const { adjustments, depthMask } = state;
|
|
1255
|
-
const rotated =
|
|
1257
|
+
const rotated = _chunkZID226ZGcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1256
1258
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1257
1259
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1258
1260
|
const baseCanvas = this.createCanvas(baseW, baseH);
|
|
@@ -1260,7 +1262,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1260
1262
|
if (!baseCtx) return baseCanvas;
|
|
1261
1263
|
const projection = getBaseProjection(region, transform, baseW, baseH);
|
|
1262
1264
|
baseCtx.save();
|
|
1263
|
-
|
|
1265
|
+
_chunkZID226ZGcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
|
|
1264
1266
|
baseCtx.drawImage(
|
|
1265
1267
|
img,
|
|
1266
1268
|
region.x,
|
|
@@ -1275,8 +1277,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1275
1277
|
baseCtx.restore();
|
|
1276
1278
|
const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
|
|
1277
1279
|
if (imageData) {
|
|
1278
|
-
const layerMasks =
|
|
1279
|
-
|
|
1280
|
+
const layerMasks = _chunkZID226ZGcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
|
|
1281
|
+
_chunkZID226ZGcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
|
|
1280
1282
|
if (depthMask.enabled && depthMask.maskSource) {
|
|
1281
1283
|
try {
|
|
1282
1284
|
const maskImg = await this.imageCache.get(depthMask.maskSource);
|
|
@@ -1287,7 +1289,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1287
1289
|
const maskCtx = maskCanvas.getContext("2d");
|
|
1288
1290
|
if (maskCtx) {
|
|
1289
1291
|
maskCtx.save();
|
|
1290
|
-
|
|
1292
|
+
_chunkZID226ZGcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
|
|
1291
1293
|
maskCtx.drawImage(
|
|
1292
1294
|
maskImg,
|
|
1293
1295
|
region.x * sx,
|
|
@@ -1302,7 +1304,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1302
1304
|
maskCtx.restore();
|
|
1303
1305
|
const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
|
|
1304
1306
|
if (maskData) {
|
|
1305
|
-
|
|
1307
|
+
_chunkZID226ZGcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
|
|
1306
1308
|
}
|
|
1307
1309
|
}
|
|
1308
1310
|
} catch (e6) {
|
|
@@ -1455,17 +1457,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1455
1457
|
if (!comp) return null;
|
|
1456
1458
|
const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
|
|
1457
1459
|
const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
|
|
1458
|
-
const rotated =
|
|
1460
|
+
const rotated = _chunkZID226ZGcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1459
1461
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1460
1462
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1461
|
-
const key = `${comp.version}|${region.x},${region.y},${region.width},${region.height}|${
|
|
1463
|
+
const key = `${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkZID226ZGcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
|
|
1462
1464
|
if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
|
|
1463
1465
|
const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
|
|
1464
1466
|
const ctx = canvas.getContext("2d");
|
|
1465
1467
|
if (!ctx) return null;
|
|
1466
1468
|
ctx.clearRect(0, 0, baseW, baseH);
|
|
1467
1469
|
ctx.save();
|
|
1468
|
-
|
|
1470
|
+
_chunkZID226ZGcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
|
|
1469
1471
|
ctx.beginPath();
|
|
1470
1472
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1471
1473
|
ctx.clip();
|
|
@@ -1737,7 +1739,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1737
1739
|
ctx.strokeStyle = "#3b82f6";
|
|
1738
1740
|
ctx.lineWidth = 1.5;
|
|
1739
1741
|
ctx.setLineDash([4, 4]);
|
|
1740
|
-
const bounds =
|
|
1742
|
+
const bounds = _chunkZID226ZGcjs.getAnnotationBounds.call(void 0, ann);
|
|
1741
1743
|
const pad = 4;
|
|
1742
1744
|
ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
|
|
1743
1745
|
ctx.fillStyle = "#ffffff";
|
|
@@ -1758,7 +1760,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1758
1760
|
}
|
|
1759
1761
|
/** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
|
|
1760
1762
|
getAnnotationBounds(ann) {
|
|
1761
|
-
return
|
|
1763
|
+
return _chunkZID226ZGcjs.getAnnotationBounds.call(void 0, ann);
|
|
1762
1764
|
}
|
|
1763
1765
|
/**
|
|
1764
1766
|
* Draws a rule-of-thirds crop grid overlay. All rectangles come from
|
|
@@ -1840,8 +1842,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1840
1842
|
}
|
|
1841
1843
|
const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
|
|
1842
1844
|
const { crop, transform, annotations } = state;
|
|
1843
|
-
const region = crop ?
|
|
1844
|
-
const rotated =
|
|
1845
|
+
const region = crop ? _chunkZID226ZGcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
|
|
1846
|
+
const rotated = _chunkZID226ZGcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1845
1847
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1846
1848
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1847
1849
|
const exportW = options.width || baseW;
|
|
@@ -1870,7 +1872,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1870
1872
|
const bctx = baseCanvas.getContext("2d");
|
|
1871
1873
|
if (bctx) {
|
|
1872
1874
|
bctx.save();
|
|
1873
|
-
|
|
1875
|
+
_chunkZID226ZGcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
|
|
1874
1876
|
bctx.beginPath();
|
|
1875
1877
|
bctx.rect(region.x, region.y, region.width, region.height);
|
|
1876
1878
|
bctx.clip();
|
|
@@ -1883,7 +1885,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1883
1885
|
if (options.includeAnnotations !== false && overlay.length > 0) {
|
|
1884
1886
|
ctx.save();
|
|
1885
1887
|
ctx.scale(exportW / baseW, exportH / baseH);
|
|
1886
|
-
|
|
1888
|
+
_chunkZID226ZGcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
|
|
1887
1889
|
for (const ann of overlay) {
|
|
1888
1890
|
await this.drawAnnotation(ctx, ann);
|
|
1889
1891
|
}
|
|
@@ -1973,7 +1975,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1973
1975
|
case "rect":
|
|
1974
1976
|
case "image":
|
|
1975
1977
|
case "text": {
|
|
1976
|
-
const b =
|
|
1978
|
+
const b = _chunkZID226ZGcjs.getAnnotationBounds.call(void 0, ann);
|
|
1977
1979
|
ctx.fillRect(b.x, b.y, b.width, b.height);
|
|
1978
1980
|
break;
|
|
1979
1981
|
}
|
|
@@ -1993,7 +1995,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
|
|
|
1993
1995
|
function getBaseProjection(region, transform, baseW, baseH) {
|
|
1994
1996
|
return {
|
|
1995
1997
|
region,
|
|
1996
|
-
angle:
|
|
1998
|
+
angle: _chunkZID226ZGcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
1997
1999
|
flipH: transform.flipH,
|
|
1998
2000
|
flipV: transform.flipV,
|
|
1999
2001
|
scale: 1,
|
|
@@ -2097,8 +2099,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
2097
2099
|
}
|
|
2098
2100
|
function toMask(width, height, coverage) {
|
|
2099
2101
|
const out = new Uint8Array(coverage.length);
|
|
2100
|
-
for (let i = 0; i < out.length; i++) out[i] =
|
|
2101
|
-
return
|
|
2102
|
+
for (let i = 0; i < out.length; i++) out[i] = _chunkZID226ZGcjs.coverageToByte.call(void 0, coverage[i]);
|
|
2103
|
+
return _chunkZID226ZGcjs.createSelectionMask.call(void 0, width, height, out);
|
|
2102
2104
|
}
|
|
2103
2105
|
function polygonSelection(width, height, points, options = {}) {
|
|
2104
2106
|
return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
|
|
@@ -2225,7 +2227,7 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2225
2227
|
const { width: w, height: h } = pixels;
|
|
2226
2228
|
const sx = Math.floor(seed.x);
|
|
2227
2229
|
const sy = Math.floor(seed.y);
|
|
2228
|
-
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return
|
|
2230
|
+
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkZID226ZGcjs.createSelectionMask.call(void 0, w, h);
|
|
2229
2231
|
const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
|
|
2230
2232
|
const marks = new Uint8Array(n);
|
|
2231
2233
|
let bx0 = w;
|
|
@@ -2273,9 +2275,9 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2273
2275
|
}
|
|
2274
2276
|
}
|
|
2275
2277
|
}
|
|
2276
|
-
if (bx1 < 0) return
|
|
2277
|
-
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return
|
|
2278
|
-
return
|
|
2278
|
+
if (bx1 < 0) return _chunkZID226ZGcjs.createSelectionMask.call(void 0, w, h);
|
|
2279
|
+
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkZID226ZGcjs.createSelectionMask.call(void 0, w, h, marks);
|
|
2280
|
+
return _chunkZID226ZGcjs.createSelectionMask.call(void 0,
|
|
2279
2281
|
w,
|
|
2280
2282
|
h,
|
|
2281
2283
|
antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
|
|
@@ -2297,7 +2299,7 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2297
2299
|
const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
|
|
2298
2300
|
const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
|
|
2299
2301
|
const out = new Uint8Array(n);
|
|
2300
|
-
if (!parsed.length) return
|
|
2302
|
+
if (!parsed.length) return _chunkZID226ZGcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2301
2303
|
for (let i = 0; i < n; i++) {
|
|
2302
2304
|
const p = i * 4;
|
|
2303
2305
|
if (data[p + 3] <= 0) continue;
|
|
@@ -2313,9 +2315,9 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2313
2315
|
}
|
|
2314
2316
|
if (k > best) best = k;
|
|
2315
2317
|
}
|
|
2316
|
-
out[i] =
|
|
2318
|
+
out[i] = _chunkZID226ZGcjs.coverageToByte.call(void 0, best);
|
|
2317
2319
|
}
|
|
2318
|
-
return
|
|
2320
|
+
return _chunkZID226ZGcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2319
2321
|
}
|
|
2320
2322
|
var TONE_RANGE_PRESETS = {
|
|
2321
2323
|
shadows: [0, 65],
|
|
@@ -2333,9 +2335,9 @@ function toneRange(pixels, range, falloff = 20) {
|
|
|
2333
2335
|
if (d[p + 3] <= 0) continue;
|
|
2334
2336
|
const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
|
|
2335
2337
|
const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
|
|
2336
|
-
out[i] =
|
|
2338
|
+
out[i] = _chunkZID226ZGcjs.coverageToByte.call(void 0, 1 - outside / ramp);
|
|
2337
2339
|
}
|
|
2338
|
-
return
|
|
2340
|
+
return _chunkZID226ZGcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2339
2341
|
}
|
|
2340
2342
|
function hueRange(pixels, center) {
|
|
2341
2343
|
const n = checkPixels(pixels);
|
|
@@ -2358,9 +2360,9 @@ function hueRange(pixels, center) {
|
|
|
2358
2360
|
hue *= 60;
|
|
2359
2361
|
let dh = ((hue - center) % 360 + 360) % 360;
|
|
2360
2362
|
dh = Math.min(dh, 360 - dh);
|
|
2361
|
-
out[i] =
|
|
2363
|
+
out[i] = _chunkZID226ZGcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
|
|
2362
2364
|
}
|
|
2363
|
-
return
|
|
2365
|
+
return _chunkZID226ZGcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2364
2366
|
}
|
|
2365
2367
|
|
|
2366
2368
|
// src/image-editor/selection/refine.ts
|
|
@@ -2494,9 +2496,9 @@ function edgeWidth(guide, w, h, r) {
|
|
|
2494
2496
|
g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
|
|
2495
2497
|
}
|
|
2496
2498
|
}
|
|
2497
|
-
const gm =
|
|
2498
|
-
const hi =
|
|
2499
|
-
const lo =
|
|
2499
|
+
const gm = _chunkZID226ZGcjs.greyMorphology.call(void 0, g, w, h, r, true);
|
|
2500
|
+
const hi = _chunkZID226ZGcjs.greyMorphology.call(void 0, y, w, h, r, true);
|
|
2501
|
+
const lo = _chunkZID226ZGcjs.greyMorphology.call(void 0, y, w, h, r, false);
|
|
2500
2502
|
const out = new Float32Array(n);
|
|
2501
2503
|
for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
|
|
2502
2504
|
return out;
|
|
@@ -2520,7 +2522,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2520
2522
|
}
|
|
2521
2523
|
}
|
|
2522
2524
|
if (any) {
|
|
2523
|
-
const dist =
|
|
2525
|
+
const dist = _chunkZID226ZGcjs.distanceTransform.call(void 0, boundary, w, h);
|
|
2524
2526
|
const r = gfRadius(p);
|
|
2525
2527
|
const q = guidedFilterColor(guide, m, w, h, r);
|
|
2526
2528
|
const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
|
|
@@ -2546,7 +2548,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2546
2548
|
for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
|
|
2547
2549
|
}
|
|
2548
2550
|
const amount = shiftAmount(p);
|
|
2549
|
-
if (Math.abs(amount) >= 1e-4) a =
|
|
2551
|
+
if (Math.abs(amount) >= 1e-4) a = _chunkZID226ZGcjs.shiftCoverage.call(void 0, a, w, h, amount);
|
|
2550
2552
|
return a;
|
|
2551
2553
|
}
|
|
2552
2554
|
function guidePlanes(pixels, win) {
|
|
@@ -2590,15 +2592,15 @@ function refineSelection(pixels, mask, params = {}) {
|
|
|
2590
2592
|
const out = new Uint8Array(mask.width * mask.height);
|
|
2591
2593
|
for (let y = 0; y < wh; y++) {
|
|
2592
2594
|
const dst = (y0 + y) * mask.width + x0;
|
|
2593
|
-
for (let x = 0; x < ww; x++) out[dst + x] =
|
|
2595
|
+
for (let x = 0; x < ww; x++) out[dst + x] = _chunkZID226ZGcjs.coverageToByte.call(void 0, refined[y * ww + x]);
|
|
2594
2596
|
}
|
|
2595
|
-
return
|
|
2597
|
+
return _chunkZID226ZGcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
|
|
2596
2598
|
}
|
|
2597
2599
|
|
|
2598
2600
|
// src/image-editor/free-transform.ts
|
|
2599
2601
|
var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
|
|
2600
2602
|
var fail = (message) => {
|
|
2601
|
-
throw new (0,
|
|
2603
|
+
throw new (0, _chunkZID226ZGcjs.LayerOperationError)(message);
|
|
2602
2604
|
};
|
|
2603
2605
|
var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
|
|
2604
2606
|
function previewStep(scale) {
|
|
@@ -2685,7 +2687,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2685
2687
|
} else {
|
|
2686
2688
|
const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
|
|
2687
2689
|
if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
|
|
2688
|
-
const layer =
|
|
2690
|
+
const layer = _chunkZID226ZGcjs.requireLayer.call(void 0, layers, id).layer;
|
|
2689
2691
|
this.layerId = layer.id;
|
|
2690
2692
|
const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
|
|
2691
2693
|
const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
|
|
@@ -2696,20 +2698,20 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2696
2698
|
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.`);
|
|
2697
2699
|
if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
|
|
2698
2700
|
if (content !== "selection-copy") {
|
|
2699
|
-
|
|
2700
|
-
if (!maskAlone)
|
|
2701
|
+
_chunkZID226ZGcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
|
|
2702
|
+
if (!maskAlone) _chunkZID226ZGcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
|
|
2701
2703
|
}
|
|
2702
2704
|
const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
2703
2705
|
const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
|
|
2704
2706
|
if (layer.type === "smart" && !maskAlone) {
|
|
2705
2707
|
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).`);
|
|
2706
|
-
if (!
|
|
2708
|
+
if (!_chunkZID226ZGcjs.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.`);
|
|
2707
2709
|
this.smart = layer;
|
|
2708
2710
|
this.smartObject = true;
|
|
2709
|
-
this.startGeometry =
|
|
2711
|
+
this.startGeometry = _chunkZID226ZGcjs.placementGeometry.call(void 0, layer);
|
|
2710
2712
|
if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
|
|
2711
2713
|
this.startInterp = this.interp;
|
|
2712
|
-
this.box =
|
|
2714
|
+
this.box = _chunkZID226ZGcjs.contentsBox.call(void 0, layer.contents);
|
|
2713
2715
|
this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
|
|
2714
2716
|
this.geometryValue = this.startGeometry;
|
|
2715
2717
|
this.shown = this.startLayers;
|
|
@@ -2751,7 +2753,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2751
2753
|
if (box) {
|
|
2752
2754
|
const copy = {
|
|
2753
2755
|
type: "pixel",
|
|
2754
|
-
id:
|
|
2756
|
+
id: _chunkZID226ZGcjs.newLayerId.call(void 0, ),
|
|
2755
2757
|
name: `${layer.name || "Layer"} copy`,
|
|
2756
2758
|
visible: true,
|
|
2757
2759
|
opacity: 1,
|
|
@@ -2775,7 +2777,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2775
2777
|
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).");
|
|
2776
2778
|
this.box = box;
|
|
2777
2779
|
this.moves = moves;
|
|
2778
|
-
this.startGeometry =
|
|
2780
|
+
this.startGeometry = _chunkZID226ZGcjs.identityTransform.call(void 0, box);
|
|
2779
2781
|
this.startInterp = this.interp;
|
|
2780
2782
|
this.geometryValue = this.startGeometry;
|
|
2781
2783
|
this.shown = this.startLayers;
|
|
@@ -2847,7 +2849,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2847
2849
|
warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
|
|
2848
2850
|
};
|
|
2849
2851
|
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.");
|
|
2850
|
-
if (!
|
|
2852
|
+
if (!_chunkZID226ZGcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
|
|
2851
2853
|
this.geometryValue = next;
|
|
2852
2854
|
if (preview !== false) this.render(preview);
|
|
2853
2855
|
return next;
|
|
@@ -2856,10 +2858,10 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2856
2858
|
resample(final, preview = {}) {
|
|
2857
2859
|
if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
|
|
2858
2860
|
const g = this.geometryValue;
|
|
2859
|
-
const identity =
|
|
2860
|
-
const warp =
|
|
2861
|
-
const h = warp ? null :
|
|
2862
|
-
const f = warp ?
|
|
2861
|
+
const identity = _chunkZID226ZGcjs.isIdentityTransform.call(void 0, g);
|
|
2862
|
+
const warp = _chunkZID226ZGcjs.hasWarp.call(void 0, g);
|
|
2863
|
+
const h = warp ? null : _chunkZID226ZGcjs.geometryHomography.call(void 0, g);
|
|
2864
|
+
const f = warp ? _chunkZID226ZGcjs.transformMap.call(void 0, g) : null;
|
|
2863
2865
|
const step = final ? 1 : previewStep(preview.scale);
|
|
2864
2866
|
const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
|
|
2865
2867
|
let layers = this.startLayers;
|
|
@@ -2902,7 +2904,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2902
2904
|
if (part.what === "selection") {
|
|
2903
2905
|
const { width, height } = this.host.canvas();
|
|
2904
2906
|
const data = new Uint8Array(_chunkCRMAXIUVcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
|
|
2905
|
-
const next =
|
|
2907
|
+
const next = _chunkZID226ZGcjs.createSelectionMask.call(void 0, width, height, data);
|
|
2906
2908
|
selection = next.bounds ? next : null;
|
|
2907
2909
|
} else if (part.what === "pixels") {
|
|
2908
2910
|
layers = _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, targetId, (l) => {
|
|
@@ -2924,12 +2926,12 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2924
2926
|
const canvas = this.host.canvas();
|
|
2925
2927
|
try {
|
|
2926
2928
|
if (final) {
|
|
2927
|
-
const res =
|
|
2929
|
+
const res = _chunkZID226ZGcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
|
|
2928
2930
|
this.smartMasksMoved = res.masksMoved;
|
|
2929
2931
|
return res.layers;
|
|
2930
2932
|
}
|
|
2931
2933
|
const step = previewStep(preview.scale);
|
|
2932
|
-
const surface =
|
|
2934
|
+
const surface = _chunkZID226ZGcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
|
|
2933
2935
|
return _chunkWSTEXEKDcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
|
|
2934
2936
|
} catch (e) {
|
|
2935
2937
|
if (e instanceof _chunkWSTEXEKDcjs.TransformTooLargeError) fail(e.message);
|
|
@@ -2939,10 +2941,10 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2939
2941
|
/** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
|
|
2940
2942
|
isChanged() {
|
|
2941
2943
|
const g = this.geometryValue;
|
|
2942
|
-
if (!this.smart) return !
|
|
2944
|
+
if (!this.smart) return !_chunkZID226ZGcjs.isIdentityTransform.call(void 0, g);
|
|
2943
2945
|
const a = this.startGeometry;
|
|
2944
2946
|
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);
|
|
2945
|
-
const warp = (w, box) => w &&
|
|
2947
|
+
const warp = (w, box) => w && _chunkZID226ZGcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
|
|
2946
2948
|
return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
|
|
2947
2949
|
}
|
|
2948
2950
|
render(preview) {
|
|
@@ -2992,40 +2994,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2992
2994
|
}, _class4);
|
|
2993
2995
|
|
|
2994
2996
|
// src/image-editor/controller.ts
|
|
2995
|
-
|
|
2996
|
-
const out = [];
|
|
2997
|
-
for (const l of layers) {
|
|
2998
|
-
if (l.type === "annotation") continue;
|
|
2999
|
-
let next = l;
|
|
3000
|
-
if (l.type === "group") next = { ...l, children: prepareNestedForPsd(l.children) };
|
|
3001
|
-
else if (l.type === "smart") next = _chunkVSMM7B3Pcjs.rasterizeSmartObject.call(void 0, [l], l.id).layer;
|
|
3002
|
-
else if (l.type === "pixel" && _optionalChain([l, 'access', _72 => _72.filters, 'optionalAccess', _73 => _73.length])) {
|
|
3003
|
-
const p = { ...l };
|
|
3004
|
-
if (l.filters.some(_chunkVSMM7B3Pcjs.isActiveFilter)) {
|
|
3005
|
-
const b = l.surface.bounds;
|
|
3006
|
-
if (b) {
|
|
3007
|
-
const r = { x: b.x + l.offset.x - 64, y: b.y + l.offset.y - 64, width: b.width + 128, height: b.height + 128 };
|
|
3008
|
-
const plain3 = { ...l, visible: true, opacity: 1, blend: "normal" };
|
|
3009
|
-
delete plain3.mask;
|
|
3010
|
-
delete plain3.clipped;
|
|
3011
|
-
delete plain3.effects;
|
|
3012
|
-
delete plain3.fillOpacity;
|
|
3013
|
-
const data = new (0, _chunkVSMM7B3Pcjs.LayerCompositor)().composite([plain3], r, { width: r.x + r.width, height: r.y + r.height });
|
|
3014
|
-
p.surface = _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width: r.width, height: r.height, data }, 4, r.x - l.offset.x, r.y - l.offset.y);
|
|
3015
|
-
}
|
|
3016
|
-
}
|
|
3017
|
-
delete p.filters;
|
|
3018
|
-
next = p;
|
|
3019
|
-
}
|
|
3020
|
-
if (_optionalChain([next, 'access', _74 => _74.mask, 'optionalAccess', _75 => _75.source])) {
|
|
3021
|
-
next = { ...next };
|
|
3022
|
-
delete next.mask;
|
|
3023
|
-
}
|
|
3024
|
-
out.push(next);
|
|
3025
|
-
}
|
|
3026
|
-
return out;
|
|
3027
|
-
}
|
|
3028
|
-
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkVSMM7B3Pcjs.LAYERED_SCHEMA_VERSION;
|
|
2997
|
+
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkZID226ZGcjs.LAYERED_SCHEMA_VERSION;
|
|
3029
2998
|
function paintCoverageInto(base, coverage, apply, rects) {
|
|
3030
2999
|
const tiles = new Map(base.tiles);
|
|
3031
3000
|
const done = /* @__PURE__ */ new Set();
|
|
@@ -3034,7 +3003,7 @@ function paintCoverageInto(base, coverage, apply, rects) {
|
|
|
3034
3003
|
const key = _chunkCRMAXIUVcjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3035
3004
|
if (done.has(key)) continue;
|
|
3036
3005
|
done.add(key);
|
|
3037
|
-
const src = _nullishCoalesce(_optionalChain([base, 'access',
|
|
3006
|
+
const src = _nullishCoalesce(_optionalChain([base, 'access', _72 => _72.tiles, 'access', _73 => _73.get, 'call', _74 => _74(key), 'optionalAccess', _75 => _75.data]), () => ( defaultTile(base)));
|
|
3038
3007
|
const data = _chunkPV42JITTcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
|
|
3039
3008
|
const tile = _chunkCRMAXIUVcjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
|
|
3040
3009
|
if (tile) tiles.set(key, tile);
|
|
@@ -3086,11 +3055,11 @@ var PaintStrokeSession = (_class5 = class {
|
|
|
3086
3055
|
offset: a.offset,
|
|
3087
3056
|
lockTransparency: a.lockTransparency,
|
|
3088
3057
|
selection: a.selection,
|
|
3089
|
-
readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access',
|
|
3058
|
+
readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _76 => _76.live, 'access', _77 => _77.get, 'call', _78 => _78(_chunkCRMAXIUVcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _79 => _79.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
|
|
3090
3059
|
writeTile: (tx, ty) => {
|
|
3091
3060
|
const key = _chunkCRMAXIUVcjs.tileKey.call(void 0, tx, ty);
|
|
3092
3061
|
if (!this.touched.has(key)) {
|
|
3093
|
-
const src = _nullishCoalesce(_optionalChain([this, 'access',
|
|
3062
|
+
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)));
|
|
3094
3063
|
this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
|
|
3095
3064
|
this.touched.add(key);
|
|
3096
3065
|
}
|
|
@@ -3123,12 +3092,12 @@ var PaintStrokeSession = (_class5 = class {
|
|
|
3123
3092
|
for (const t of _chunkCRMAXIUVcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
|
|
3124
3093
|
const key = _chunkCRMAXIUVcjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3125
3094
|
const cur = regions.get(key);
|
|
3126
|
-
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ?
|
|
3095
|
+
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkZID226ZGcjs.unionRect.call(void 0, cur.r, r) : r });
|
|
3127
3096
|
}
|
|
3128
3097
|
}
|
|
3129
3098
|
for (const [key, { tx, ty, r }] of regions) {
|
|
3130
|
-
const src = _nullishCoalesce(_optionalChain([this, 'access',
|
|
3131
|
-
const prev = this.touched.has(key) ? _optionalChain([this, 'access',
|
|
3099
|
+
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
|
+
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;
|
|
3132
3101
|
this.touched.add(key);
|
|
3133
3102
|
const data = _chunkPV42JITTcjs.applyStrokeToTile.call(void 0, stroke.coverage, src, ch, tx, ty, this.apply, prev ? { into: prev, region: r } : {});
|
|
3134
3103
|
this.live.set(key, { data, uniform: null });
|
|
@@ -3137,7 +3106,7 @@ var PaintStrokeSession = (_class5 = class {
|
|
|
3137
3106
|
}
|
|
3138
3107
|
/** Finishes the stroke (one undo step) and returns what changed. */
|
|
3139
3108
|
end() {
|
|
3140
|
-
if (this.closed) throw new (0,
|
|
3109
|
+
if (this.closed) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("This stroke has already ended.");
|
|
3141
3110
|
const last = _nullishCoalesce(this.last, () => ( void 0));
|
|
3142
3111
|
this.update(this.mixer ? this.mixer.finish(last) : this.stroke.finish(last));
|
|
3143
3112
|
this.closed = true;
|
|
@@ -3174,20 +3143,20 @@ function sameTile(a, b) {
|
|
|
3174
3143
|
for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
|
|
3175
3144
|
return true;
|
|
3176
3145
|
}
|
|
3177
|
-
var DEFAULT_ADJUSTMENTS =
|
|
3146
|
+
var DEFAULT_ADJUSTMENTS = _chunkZID226ZGcjs.DEFAULT_ADJUSTMENTS_VALUES;
|
|
3178
3147
|
function normalizeStoredAdjustments(stored) {
|
|
3179
3148
|
if (!stored) return { ...DEFAULT_ADJUSTMENTS };
|
|
3180
3149
|
const out = {
|
|
3181
3150
|
...DEFAULT_ADJUSTMENTS,
|
|
3182
3151
|
...stored,
|
|
3183
|
-
process:
|
|
3152
|
+
process: _chunkZID226ZGcjs.normalizeProcessVersion.call(void 0, stored.process)
|
|
3184
3153
|
};
|
|
3185
|
-
const layers =
|
|
3154
|
+
const layers = _chunkZID226ZGcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
|
|
3186
3155
|
if (layers.length) out.layers = layers;
|
|
3187
3156
|
else delete out.layers;
|
|
3188
3157
|
return out;
|
|
3189
3158
|
}
|
|
3190
|
-
var isLayered = (data) => Boolean(data && data.version ===
|
|
3159
|
+
var isLayered = (data) => Boolean(data && data.version === _chunkZID226ZGcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
|
|
3191
3160
|
function migrateSerializedImageEditorState(data) {
|
|
3192
3161
|
if (isLayered(data)) {
|
|
3193
3162
|
const out = {
|
|
@@ -3203,14 +3172,14 @@ function migrateSerializedImageEditorState(data) {
|
|
|
3203
3172
|
const legacy = data;
|
|
3204
3173
|
const adjustments = normalizeStoredAdjustments(legacy.adjustments);
|
|
3205
3174
|
return {
|
|
3206
|
-
version: _optionalChain([adjustments, 'access',
|
|
3175
|
+
version: _optionalChain([adjustments, 'access', _94 => _94.layers, 'optionalAccess', _95 => _95.length]) ? 2 : 1,
|
|
3207
3176
|
crop: legacy.crop ? { ...legacy.crop } : null,
|
|
3208
3177
|
transform: { ...DEFAULT_TRANSFORM, ...legacy.transform },
|
|
3209
3178
|
adjustments: serializeAdjustments(adjustments),
|
|
3210
3179
|
depthMask: {
|
|
3211
3180
|
...DEFAULT_DEPTH_MASK,
|
|
3212
3181
|
...legacy.depthMask,
|
|
3213
|
-
depthRange: [..._nullishCoalesce(_optionalChain([legacy, 'access',
|
|
3182
|
+
depthRange: [..._nullishCoalesce(_optionalChain([legacy, 'access', _96 => _96.depthMask, 'optionalAccess', _97 => _97.depthRange]), () => ( DEFAULT_DEPTH_MASK.depthRange))]
|
|
3214
3183
|
},
|
|
3215
3184
|
annotations: JSON.parse(JSON.stringify(_nullishCoalesce(legacy.annotations, () => ( [])))),
|
|
3216
3185
|
...legacy.selection ? { selection: { ...legacy.selection } } : {}
|
|
@@ -3220,9 +3189,9 @@ function migrateToLayeredState(data, size) {
|
|
|
3220
3189
|
const clean = migrateSerializedImageEditorState(data);
|
|
3221
3190
|
if (isLayered(clean)) return clean;
|
|
3222
3191
|
const stack = layersFromLegacy(clean, Math.round(size.width), Math.round(size.height));
|
|
3223
|
-
const { layers, assets } =
|
|
3192
|
+
const { layers, assets } = _chunkZID226ZGcjs.serializeLayers.call(void 0, stack.layers);
|
|
3224
3193
|
const out = {
|
|
3225
|
-
version:
|
|
3194
|
+
version: _chunkZID226ZGcjs.LAYERED_SCHEMA_VERSION,
|
|
3226
3195
|
width: Math.round(size.width),
|
|
3227
3196
|
height: Math.round(size.height),
|
|
3228
3197
|
layers,
|
|
@@ -3236,8 +3205,8 @@ function migrateToLayeredState(data, size) {
|
|
|
3236
3205
|
if (clean.selection) out.selection = clean.selection;
|
|
3237
3206
|
return out;
|
|
3238
3207
|
}
|
|
3239
|
-
var DEFAULT_TRANSFORM =
|
|
3240
|
-
var DEFAULT_DEPTH_MASK =
|
|
3208
|
+
var DEFAULT_TRANSFORM = _chunkZID226ZGcjs.DEFAULT_TRANSFORM_VALUES;
|
|
3209
|
+
var DEFAULT_DEPTH_MASK = _chunkZID226ZGcjs.DEFAULT_DEPTH_MASK_VALUES;
|
|
3241
3210
|
var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
|
|
3242
3211
|
var ImageEditorController = (_class6 = class {
|
|
3243
3212
|
|
|
@@ -3260,7 +3229,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3260
3229
|
__init44() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
|
|
3261
3230
|
__init45() {this.viewKey = []}
|
|
3262
3231
|
/** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
|
|
3263
|
-
__init46() {this.compositor = new (0,
|
|
3232
|
+
__init46() {this.compositor = new (0, _chunkZID226ZGcjs.LayerCompositor)()}
|
|
3264
3233
|
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);
|
|
3265
3234
|
this.maxHistoryDepth = _nullishCoalesce(options.maxHistoryDepth, () => ( 50));
|
|
3266
3235
|
this.maxHistoryBytes = _nullishCoalesce(options.maxHistoryBytes, () => ( 512 * 1024 * 1024));
|
|
@@ -3274,7 +3243,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3274
3243
|
sourceIsOpaque: () => this.sourceIsOpaque(),
|
|
3275
3244
|
version: () => `${this.sourceVersion()}:${this.patternsVersion()}`,
|
|
3276
3245
|
globalLight: () => this.state.globalLight,
|
|
3277
|
-
pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access',
|
|
3246
|
+
pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _98 => _98.state, 'access', _99 => _99.patterns, 'optionalAccess', _100 => _100.find, 'call', _101 => _101((p) => p.id === id)]), () => ( null))
|
|
3278
3247
|
};
|
|
3279
3248
|
this.state = {
|
|
3280
3249
|
sourceUrl: typeof options.image === "string" ? options.image : null,
|
|
@@ -3307,9 +3276,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
3307
3276
|
};
|
|
3308
3277
|
}
|
|
3309
3278
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
3310
|
-
if (_optionalChain([options, 'access',
|
|
3279
|
+
if (_optionalChain([options, 'access', _102 => _102.initialState, 'optionalAccess', _103 => _103.selection])) {
|
|
3311
3280
|
try {
|
|
3312
|
-
this.state.selection = normalizeSelection(
|
|
3281
|
+
this.state.selection = normalizeSelection(_chunkZID226ZGcjs.deserializeSelection.call(void 0, options.initialState.selection));
|
|
3313
3282
|
} catch (e12) {
|
|
3314
3283
|
}
|
|
3315
3284
|
}
|
|
@@ -3391,7 +3360,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3391
3360
|
else if (!strokeRects) this.pendingDirty = "all";
|
|
3392
3361
|
this.syncViews();
|
|
3393
3362
|
const currentState = { ...this.state };
|
|
3394
|
-
_optionalChain([this, 'access',
|
|
3363
|
+
_optionalChain([this, 'access', _104 => _104.onStateChange, 'optionalCall', _105 => _105(currentState)]);
|
|
3395
3364
|
this.listeners.forEach((l) => l(currentState));
|
|
3396
3365
|
}
|
|
3397
3366
|
/** Recomputes the compatibility views (`adjustments`, `depthMask`, `annotations`) when the stack changed. */
|
|
@@ -3546,7 +3515,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3546
3515
|
applyCropPreset(ratio) {
|
|
3547
3516
|
this.recordHistory();
|
|
3548
3517
|
const { width, height } = this.state.imageDimensions;
|
|
3549
|
-
if (ratio &&
|
|
3518
|
+
if (ratio && _chunkZID226ZGcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
|
|
3550
3519
|
ratio = 1 / ratio;
|
|
3551
3520
|
}
|
|
3552
3521
|
if (!ratio) {
|
|
@@ -3602,7 +3571,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3602
3571
|
return this.state.layers;
|
|
3603
3572
|
}
|
|
3604
3573
|
getLayer(id) {
|
|
3605
|
-
return _optionalChain([_chunkWSTEXEKDcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess',
|
|
3574
|
+
return _optionalChain([_chunkWSTEXEKDcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _106 => _106.layer]);
|
|
3606
3575
|
}
|
|
3607
3576
|
/** The active layer, or `undefined`. */
|
|
3608
3577
|
getActiveLayer() {
|
|
@@ -3615,7 +3584,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3615
3584
|
setActiveLayer(id, target = "pixels") {
|
|
3616
3585
|
if (id !== null && !this.getLayer(id)) return false;
|
|
3617
3586
|
const layer = id ? this.getLayer(id) : void 0;
|
|
3618
|
-
const t = target === "mask" && _optionalChain([layer, 'optionalAccess',
|
|
3587
|
+
const t = target === "mask" && _optionalChain([layer, 'optionalAccess', _107 => _107.mask]) ? "mask" : target === "filter-mask" && _optionalChain([layer, 'optionalAccess', _108 => _108.type]) === "smart" && _optionalChain([layer, 'access', _109 => _109.smartFilters, 'optionalAccess', _110 => _110.mask]) ? "filter-mask" : "pixels";
|
|
3619
3588
|
if (this.state.activeLayerId === id && this.state.activeTarget === t) return true;
|
|
3620
3589
|
this.state.activeLayerId = id;
|
|
3621
3590
|
this.state.activeTarget = t;
|
|
@@ -3650,6 +3619,17 @@ var ImageEditorController = (_class6 = class {
|
|
|
3650
3619
|
}
|
|
3651
3620
|
return b ? { x: b.x + layer.offset.x, y: b.y + layer.offset.y, width: b.width, height: b.height } : null;
|
|
3652
3621
|
}
|
|
3622
|
+
/**
|
|
3623
|
+
* A tight base64 PNG data URL of a pixel or smart layer's content, or `null` for an unknown or
|
|
3624
|
+
* non-pixel layer, or when the layer is completely transparent.
|
|
3625
|
+
*/
|
|
3626
|
+
getLayerDataURL(id) {
|
|
3627
|
+
const layer = this.getLayer(id);
|
|
3628
|
+
if (!layer || layer.type !== "pixel" && layer.type !== "smart") return null;
|
|
3629
|
+
const surface = this.surfaceOf(layer);
|
|
3630
|
+
const enc = _chunkZID226ZGcjs.encodeSurface.call(void 0, surface);
|
|
3631
|
+
return enc ? enc.url : null;
|
|
3632
|
+
}
|
|
3653
3633
|
/**
|
|
3654
3634
|
* Composites the layer stack in document space without a canvas (annotation layers need one
|
|
3655
3635
|
* and are left out): `rect` (default: the canvas) as RGBA, straight alpha. Crop, rotation and
|
|
@@ -3674,7 +3654,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3674
3654
|
surfaceOf: (l) => this.surfaceOf(l),
|
|
3675
3655
|
version: `${this.sourceVersion()}:${this.patternsVersion()}`,
|
|
3676
3656
|
globalLight: this.state.globalLight,
|
|
3677
|
-
pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access',
|
|
3657
|
+
pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _111 => _111.state, 'access', _112 => _112.patterns, 'optionalAccess', _113 => _113.find, 'call', _114 => _114((p) => p.id === id)]), () => ( null))
|
|
3678
3658
|
};
|
|
3679
3659
|
}
|
|
3680
3660
|
__init49() {this.sourceIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -3751,7 +3731,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3751
3731
|
if (!ctx || typeof ctx.getImageData !== "function") return null;
|
|
3752
3732
|
ctx.drawImage(el, 0, 0, width, height);
|
|
3753
3733
|
const data = ctx.getImageData(0, 0, width, height);
|
|
3754
|
-
if (!_optionalChain([data, 'optionalAccess',
|
|
3734
|
+
if (!_optionalChain([data, 'optionalAccess', _115 => _115.data]) || data.data.length < width * height * 4) return null;
|
|
3755
3735
|
return { width, height, data: data.data };
|
|
3756
3736
|
} catch (e14) {
|
|
3757
3737
|
return null;
|
|
@@ -3762,7 +3742,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3762
3742
|
commitLayers(next, extra, commitToHistory = true) {
|
|
3763
3743
|
if (commitToHistory) this.recordHistory();
|
|
3764
3744
|
this.state.layers = next;
|
|
3765
|
-
_optionalChain([extra, 'optionalCall',
|
|
3745
|
+
_optionalChain([extra, 'optionalCall', _116 => _116()]);
|
|
3766
3746
|
if (this.state.activeLayerId && !_chunkWSTEXEKDcjs.findLayer.call(void 0, next, this.state.activeLayerId)) {
|
|
3767
3747
|
this.state.activeLayerId = null;
|
|
3768
3748
|
this.state.activeTarget = "pixels";
|
|
@@ -3786,20 +3766,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
3786
3766
|
if (init.pixels) {
|
|
3787
3767
|
const px2 = init.pixels;
|
|
3788
3768
|
if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
|
|
3789
|
-
throw new (0,
|
|
3769
|
+
throw new (0, _chunkZID226ZGcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
|
|
3790
3770
|
}
|
|
3791
3771
|
surface = _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, px2, 4);
|
|
3792
3772
|
} else if (init.color !== void 0) {
|
|
3793
3773
|
const c = parseColor(init.color);
|
|
3794
3774
|
surface = _chunkCRMAXIUVcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkCRMAXIUVcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
|
|
3795
3775
|
}
|
|
3796
|
-
const blend =
|
|
3797
|
-
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
3776
|
+
const blend = _chunkZID226ZGcjs.parseBlend.call(void 0, init.blend);
|
|
3777
|
+
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
3798
3778
|
const ids = new Set(_chunkWSTEXEKDcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
3799
3779
|
const layer = {
|
|
3800
3780
|
type: "pixel",
|
|
3801
|
-
id: init.id && !ids.has(init.id) ? init.id :
|
|
3802
|
-
name: _optionalChain([init, 'access',
|
|
3781
|
+
id: init.id && !ids.has(init.id) ? init.id : _chunkZID226ZGcjs.newLayerId.call(void 0, ),
|
|
3782
|
+
name: _optionalChain([init, 'access', _117 => _117.name, 'optionalAccess', _118 => _118.trim, 'call', _119 => _119()]) || this.nextLayerName(),
|
|
3803
3783
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
3804
3784
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
3805
3785
|
blend: _nullishCoalesce(blend, () => ( "normal")),
|
|
@@ -3807,7 +3787,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3807
3787
|
offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
|
|
3808
3788
|
};
|
|
3809
3789
|
if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
|
|
3810
|
-
const next =
|
|
3790
|
+
const next = _chunkZID226ZGcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
3811
3791
|
this.commitLayers(next, () => {
|
|
3812
3792
|
this.state.activeLayerId = layer.id;
|
|
3813
3793
|
this.state.activeTarget = "pixels";
|
|
@@ -3826,7 +3806,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3826
3806
|
async decodeImage(image) {
|
|
3827
3807
|
const trimmed = image.trim();
|
|
3828
3808
|
let png = null;
|
|
3829
|
-
if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkWSTEXEKDcjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess',
|
|
3809
|
+
if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkWSTEXEKDcjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _120 => _120.bytes]), () => ( null));
|
|
3830
3810
|
else if (/^[A-Za-z0-9+/=\s]+$/.test(trimmed) && trimmed.length > 16) {
|
|
3831
3811
|
try {
|
|
3832
3812
|
const bytes = _chunkWSTEXEKDcjs.base64ToBytes.call(void 0, trimmed);
|
|
@@ -3847,12 +3827,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
3847
3827
|
try {
|
|
3848
3828
|
img = await this.renderer.imageCache.get(src);
|
|
3849
3829
|
} catch (e17) {
|
|
3850
|
-
throw new (0,
|
|
3830
|
+
throw new (0, _chunkZID226ZGcjs.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.");
|
|
3851
3831
|
}
|
|
3852
3832
|
const w = img.naturalWidth || img.width;
|
|
3853
3833
|
const h = img.naturalHeight || img.height;
|
|
3854
3834
|
const ctx = this.renderer.createCanvas(w, h).getContext("2d");
|
|
3855
|
-
if (!ctx || typeof ctx.getImageData !== "function") throw new (0,
|
|
3835
|
+
if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
|
|
3856
3836
|
ctx.drawImage(img, 0, 0, w, h);
|
|
3857
3837
|
const data = ctx.getImageData(0, 0, w, h);
|
|
3858
3838
|
return { width: w, height: h, data: data.data };
|
|
@@ -3865,7 +3845,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3865
3845
|
}
|
|
3866
3846
|
/** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
|
|
3867
3847
|
duplicateLayer(id, name) {
|
|
3868
|
-
const res =
|
|
3848
|
+
const res = _chunkZID226ZGcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
|
|
3869
3849
|
this.commitLayers(res.layers, () => {
|
|
3870
3850
|
this.state.activeLayerId = res.id;
|
|
3871
3851
|
});
|
|
@@ -3873,7 +3853,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3873
3853
|
}
|
|
3874
3854
|
/** Deletes a layer (refused when locked), as one undo step. */
|
|
3875
3855
|
removeLayer(id) {
|
|
3876
|
-
const next =
|
|
3856
|
+
const next = _chunkZID226ZGcjs.removeLayer.call(void 0, this.state.layers, id);
|
|
3877
3857
|
this.commitLayers(next, () => {
|
|
3878
3858
|
if (this.state.selectedAnnotationId && !_chunkWSTEXEKDcjs.flattenLayers.call(void 0, next).some((l) => l.type === "annotation" && l.annotation.id === this.state.selectedAnnotationId)) {
|
|
3879
3859
|
this.state.selectedAnnotationId = null;
|
|
@@ -3882,34 +3862,34 @@ var ImageEditorController = (_class6 = class {
|
|
|
3882
3862
|
}
|
|
3883
3863
|
/** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
|
|
3884
3864
|
moveLayer(id, placement) {
|
|
3885
|
-
const next =
|
|
3865
|
+
const next = _chunkZID226ZGcjs.moveLayer.call(void 0, this.state.layers, id, placement);
|
|
3886
3866
|
const loc = _chunkWSTEXEKDcjs.findLayer.call(void 0, next, id);
|
|
3887
|
-
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
3867
|
+
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _121 => _121.parent, 'optionalAccess', _122 => _122.id]), () => ( null)), index: loc.index };
|
|
3888
3868
|
this.commitLayers(next);
|
|
3889
|
-
return { parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
3869
|
+
return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _123 => _123.parent, 'optionalAccess', _124 => _124.id]), () => ( null)), index: loc.index };
|
|
3890
3870
|
}
|
|
3891
3871
|
/**
|
|
3892
3872
|
* Changes name, visibility, opacity, fill, blend, clipping, locks or (groups) collapsed state, as
|
|
3893
3873
|
* one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
|
|
3894
3874
|
*/
|
|
3895
3875
|
setLayerProperties(id, props, commitToHistory = true) {
|
|
3896
|
-
const next =
|
|
3876
|
+
const next = _chunkZID226ZGcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
|
|
3897
3877
|
this.commitLayers(next, void 0, commitToHistory);
|
|
3898
3878
|
return _chunkWSTEXEKDcjs.findLayer.call(void 0, next, id).layer;
|
|
3899
3879
|
}
|
|
3900
3880
|
/** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
|
|
3901
3881
|
addGroup(init = {}) {
|
|
3902
|
-
const blend = init.blend === void 0 ? "pass-through" :
|
|
3882
|
+
const blend = init.blend === void 0 ? "pass-through" : _chunkZID226ZGcjs.parseBlend.call(void 0, init.blend, true);
|
|
3903
3883
|
const group = {
|
|
3904
3884
|
type: "group",
|
|
3905
|
-
id:
|
|
3906
|
-
name: _optionalChain([init, 'access',
|
|
3885
|
+
id: _chunkZID226ZGcjs.newLayerId.call(void 0, "group"),
|
|
3886
|
+
name: _optionalChain([init, 'access', _125 => _125.name, 'optionalAccess', _126 => _126.trim, 'call', _127 => _127()]) || "Group",
|
|
3907
3887
|
visible: true,
|
|
3908
3888
|
opacity: 1,
|
|
3909
3889
|
blend,
|
|
3910
3890
|
children: []
|
|
3911
3891
|
};
|
|
3912
|
-
const next =
|
|
3892
|
+
const next = _chunkZID226ZGcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
|
|
3913
3893
|
this.commitLayers(next, () => {
|
|
3914
3894
|
this.state.activeLayerId = group.id;
|
|
3915
3895
|
this.state.activeTarget = "pixels";
|
|
@@ -3918,7 +3898,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3918
3898
|
}
|
|
3919
3899
|
/** Puts sibling layers into a new group (one undo step). Returns the group id. */
|
|
3920
3900
|
groupLayers(ids, name) {
|
|
3921
|
-
const res =
|
|
3901
|
+
const res = _chunkZID226ZGcjs.groupLayers.call(void 0, this.state.layers, ids, name);
|
|
3922
3902
|
this.commitLayers(res.layers, () => {
|
|
3923
3903
|
this.state.activeLayerId = res.id;
|
|
3924
3904
|
});
|
|
@@ -3926,7 +3906,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3926
3906
|
}
|
|
3927
3907
|
/** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
|
|
3928
3908
|
ungroupLayer(id) {
|
|
3929
|
-
const res =
|
|
3909
|
+
const res = _chunkZID226ZGcjs.ungroupLayer.call(void 0, this.state.layers, id);
|
|
3930
3910
|
this.commitLayers(res.layers);
|
|
3931
3911
|
return res.ids;
|
|
3932
3912
|
}
|
|
@@ -3935,20 +3915,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
3935
3915
|
* (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
|
|
3936
3916
|
*/
|
|
3937
3917
|
offsetLayer(id, move, commitToHistory = true) {
|
|
3938
|
-
const layer =
|
|
3918
|
+
const layer = _chunkZID226ZGcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
3939
3919
|
if (layer.type === "smart") {
|
|
3940
3920
|
const tl = layer.placement.corners[0];
|
|
3941
3921
|
const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
3942
3922
|
const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
3943
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
3944
|
-
this.commitLayers(
|
|
3923
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("x and y must be numbers.");
|
|
3924
|
+
this.commitLayers(_chunkZID226ZGcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
|
|
3945
3925
|
const moved = _chunkWSTEXEKDcjs.findLayer.call(void 0, this.state.layers, id).layer;
|
|
3946
3926
|
return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
|
|
3947
3927
|
}
|
|
3948
3928
|
const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
3949
3929
|
const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
|
|
3950
3930
|
const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
|
|
3951
|
-
const next =
|
|
3931
|
+
const next = _chunkZID226ZGcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
|
|
3952
3932
|
this.commitLayers(next, void 0, commitToHistory);
|
|
3953
3933
|
return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
|
|
3954
3934
|
}
|
|
@@ -3958,11 +3938,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
3958
3938
|
* target when the layer is active.
|
|
3959
3939
|
*/
|
|
3960
3940
|
addLayerMask(id, from = "reveal-all", props = {}) {
|
|
3961
|
-
const layer =
|
|
3941
|
+
const layer = _chunkZID226ZGcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
3962
3942
|
let mask;
|
|
3963
3943
|
if (from === "selection") {
|
|
3964
3944
|
const sel = this.state.selection;
|
|
3965
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
3945
|
+
if (!_optionalChain([sel, 'optionalAccess', _128 => _128.bounds])) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
3966
3946
|
mask = this.maskFromSelection(sel, props);
|
|
3967
3947
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
3968
3948
|
mask = { ...mask, surface: _chunkCRMAXIUVcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
@@ -3971,7 +3951,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3971
3951
|
const v = from === "reveal-all" ? 255 : 0;
|
|
3972
3952
|
mask = withMaskProps({ surface: _chunkCRMAXIUVcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
3973
3953
|
}
|
|
3974
|
-
const next =
|
|
3954
|
+
const next = _chunkZID226ZGcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
|
|
3975
3955
|
this.commitLayers(next, () => {
|
|
3976
3956
|
if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
|
|
3977
3957
|
});
|
|
@@ -3979,18 +3959,18 @@ var ImageEditorController = (_class6 = class {
|
|
|
3979
3959
|
}
|
|
3980
3960
|
/** Removes a layer's mask (one undo step). */
|
|
3981
3961
|
removeLayerMask(id) {
|
|
3982
|
-
const layer =
|
|
3983
|
-
if (!layer.mask) throw new (0,
|
|
3984
|
-
this.commitLayers(
|
|
3962
|
+
const layer = _chunkZID226ZGcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
3963
|
+
if (!layer.mask) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
3964
|
+
this.commitLayers(_chunkZID226ZGcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
|
|
3985
3965
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
3986
3966
|
});
|
|
3987
3967
|
}
|
|
3988
3968
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
3989
3969
|
setLayerMaskProps(id, props, commitToHistory = true) {
|
|
3990
|
-
const layer =
|
|
3991
|
-
if (!layer.mask) throw new (0,
|
|
3970
|
+
const layer = _chunkZID226ZGcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
3971
|
+
if (!layer.mask) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
3992
3972
|
const mask = withMaskProps(layer.mask, props);
|
|
3993
|
-
this.commitLayers(
|
|
3973
|
+
this.commitLayers(_chunkZID226ZGcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
|
|
3994
3974
|
return mask;
|
|
3995
3975
|
}
|
|
3996
3976
|
/**
|
|
@@ -3998,11 +3978,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
3998
3978
|
* the depth map) and removes the mask, as one undo step.
|
|
3999
3979
|
*/
|
|
4000
3980
|
async applyLayerMask(id) {
|
|
4001
|
-
const loc =
|
|
3981
|
+
const loc = _chunkZID226ZGcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
4002
3982
|
const layer = loc.layer;
|
|
4003
|
-
if (layer.type !== "pixel") throw new (0,
|
|
4004
|
-
if (!layer.mask) throw new (0,
|
|
4005
|
-
|
|
3983
|
+
if (layer.type !== "pixel") throw new (0, _chunkZID226ZGcjs.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.`);
|
|
3984
|
+
if (!layer.mask) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
3985
|
+
_chunkZID226ZGcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
|
|
4006
3986
|
const { width, height } = this.naturalSize;
|
|
4007
3987
|
await this.renderer.prepareLayerAssets([layer], width, height);
|
|
4008
3988
|
const sources = this.renderer.compositorSources(width, height);
|
|
@@ -4035,13 +4015,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
4035
4015
|
*/
|
|
4036
4016
|
layerViaCopy(options = {}) {
|
|
4037
4017
|
const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
|
|
4038
|
-
if (!id) throw new (0,
|
|
4039
|
-
const loc =
|
|
4018
|
+
if (!id) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
|
|
4019
|
+
const loc = _chunkZID226ZGcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
4040
4020
|
const layer = loc.layer;
|
|
4041
|
-
if (layer.type !== "pixel") throw new (0,
|
|
4021
|
+
if (layer.type !== "pixel") throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
|
|
4042
4022
|
const sel = this.state.selection;
|
|
4043
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
4044
|
-
if (options.cut)
|
|
4023
|
+
if (!_optionalChain([sel, 'optionalAccess', _129 => _129.bounds])) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
|
|
4024
|
+
if (options.cut) _chunkZID226ZGcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
|
|
4045
4025
|
const surface = this.surfaceOf(layer);
|
|
4046
4026
|
const sb = sel.bounds;
|
|
4047
4027
|
const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
|
|
@@ -4057,15 +4037,15 @@ var ImageEditorController = (_class6 = class {
|
|
|
4057
4037
|
}
|
|
4058
4038
|
const copy = {
|
|
4059
4039
|
type: "pixel",
|
|
4060
|
-
id:
|
|
4061
|
-
name: _optionalChain([options, 'access',
|
|
4040
|
+
id: _chunkZID226ZGcjs.newLayerId.call(void 0, ),
|
|
4041
|
+
name: _optionalChain([options, 'access', _130 => _130.name, 'optionalAccess', _131 => _131.trim, 'call', _132 => _132()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
4062
4042
|
visible: true,
|
|
4063
4043
|
opacity: 1,
|
|
4064
4044
|
blend: "normal",
|
|
4065
4045
|
surface: _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
|
|
4066
4046
|
offset: { ...layer.offset }
|
|
4067
4047
|
};
|
|
4068
|
-
let next = _chunkWSTEXEKDcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
4048
|
+
let next = _chunkWSTEXEKDcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _133 => _133.parent, 'optionalAccess', _134 => _134.id]), () => ( null)), loc.index + 1);
|
|
4069
4049
|
if (kept) {
|
|
4070
4050
|
const cutLayer = { ...layer, surface: _chunkCRMAXIUVcjs.writeRegion.call(void 0, surface, src, kept) };
|
|
4071
4051
|
delete cutLayer.source;
|
|
@@ -4089,7 +4069,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4089
4069
|
layers: () => this.state.layers,
|
|
4090
4070
|
activeLayerId: () => this.state.activeLayerId,
|
|
4091
4071
|
activeTarget: () => this.state.activeTarget,
|
|
4092
|
-
selection: () => _optionalChain([this, 'access',
|
|
4072
|
+
selection: () => _optionalChain([this, 'access', _135 => _135.state, 'access', _136 => _136.selection, 'optionalAccess', _137 => _137.bounds]) ? this.state.selection : null,
|
|
4093
4073
|
canvas: () => this.naturalSize,
|
|
4094
4074
|
pixelsOf: (layer) => this.surfaceOf(layer),
|
|
4095
4075
|
capture: () => this.captureHistoryEntry(),
|
|
@@ -4128,7 +4108,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4128
4108
|
* Refused while another transform is open.
|
|
4129
4109
|
*/
|
|
4130
4110
|
beginFreeTransform(init = {}) {
|
|
4131
|
-
if (this.getFreeTransform()) throw new (0,
|
|
4111
|
+
if (this.getFreeTransform()) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
|
|
4132
4112
|
const session = new FreeTransformSession(this.transformHost(), init);
|
|
4133
4113
|
this.openTransform = session;
|
|
4134
4114
|
this.notify();
|
|
@@ -4142,26 +4122,26 @@ var ImageEditorController = (_class6 = class {
|
|
|
4142
4122
|
*/
|
|
4143
4123
|
transformLayer(spec) {
|
|
4144
4124
|
const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
|
|
4145
|
-
if (given > 1) throw new (0,
|
|
4146
|
-
if (!given && spec.warp === void 0) throw new (0,
|
|
4125
|
+
if (given > 1) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give only one of matrix, corners and params.");
|
|
4126
|
+
if (!given && spec.warp === void 0) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
|
|
4147
4127
|
if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
|
|
4148
|
-
throw new (0,
|
|
4128
|
+
throw new (0, _chunkZID226ZGcjs.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).");
|
|
4149
4129
|
}
|
|
4150
4130
|
if (spec.matrix) {
|
|
4151
4131
|
const [a, b, c, d] = spec.matrix;
|
|
4152
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
4132
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
|
|
4153
4133
|
}
|
|
4154
4134
|
const session = this.beginFreeTransform(spec);
|
|
4155
4135
|
try {
|
|
4156
4136
|
const g = session.startGeometry;
|
|
4157
|
-
const corners = spec.matrix ? g.corners.map((p) => _chunkDWGZUSEScjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ?
|
|
4137
|
+
const corners = spec.matrix ? g.corners.map((p) => _chunkDWGZUSEScjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkZID226ZGcjs.applyParams.call(void 0, g, spec.params) : g.corners;
|
|
4158
4138
|
let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
|
|
4159
4139
|
if (spec.warp) {
|
|
4160
4140
|
if ("style" in spec.warp) {
|
|
4161
|
-
if (!_chunkDWGZUSEScjs.WARP_STYLES.includes(spec.warp.style)) throw new (0,
|
|
4162
|
-
warp =
|
|
4141
|
+
if (!_chunkDWGZUSEScjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkDWGZUSEScjs.WARP_STYLES.join(", ")}.`);
|
|
4142
|
+
warp = _chunkZID226ZGcjs.presetWarp.call(void 0, session.box, spec.warp);
|
|
4163
4143
|
} else {
|
|
4164
|
-
if (!
|
|
4144
|
+
if (!_chunkZID226ZGcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkZID226ZGcjs.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.");
|
|
4165
4145
|
warp = spec.warp;
|
|
4166
4146
|
}
|
|
4167
4147
|
}
|
|
@@ -4174,10 +4154,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4174
4154
|
}
|
|
4175
4155
|
/** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
|
|
4176
4156
|
flipLayer(axis, init = {}) {
|
|
4177
|
-
if (axis !== "horizontal" && axis !== "vertical") throw new (0,
|
|
4157
|
+
if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
|
|
4178
4158
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
4179
4159
|
try {
|
|
4180
|
-
session.update({ corners:
|
|
4160
|
+
session.update({ corners: _chunkZID226ZGcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
|
|
4181
4161
|
return session.commit();
|
|
4182
4162
|
} catch (e) {
|
|
4183
4163
|
session.cancel();
|
|
@@ -4189,10 +4169,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4189
4169
|
* centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
|
|
4190
4170
|
*/
|
|
4191
4171
|
rotateLayer90(turn, init = {}) {
|
|
4192
|
-
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0,
|
|
4172
|
+
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
|
|
4193
4173
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
4194
4174
|
try {
|
|
4195
|
-
const b = session.smartObject ? _nullishCoalesce(
|
|
4175
|
+
const b = session.smartObject ? _nullishCoalesce(_chunkZID226ZGcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
|
|
4196
4176
|
const cx = b.x + b.width / 2;
|
|
4197
4177
|
const cy = b.y + b.height / 2;
|
|
4198
4178
|
const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
|
|
@@ -4207,20 +4187,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
4207
4187
|
}
|
|
4208
4188
|
/** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
|
|
4209
4189
|
addLayerFilter(id, filter) {
|
|
4210
|
-
const f =
|
|
4211
|
-
const next =
|
|
4190
|
+
const f = _chunkZID226ZGcjs.normalizeFilter.call(void 0, filter);
|
|
4191
|
+
const next = _chunkZID226ZGcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
|
|
4212
4192
|
this.commitLayers(next);
|
|
4213
4193
|
return _nullishCoalesce(_chunkWSTEXEKDcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
4214
4194
|
}
|
|
4215
4195
|
/** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
|
|
4216
4196
|
updateLayerFilter(id, filterId, changes, commitToHistory = true) {
|
|
4217
|
-
const next =
|
|
4197
|
+
const next = _chunkZID226ZGcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
|
|
4218
4198
|
this.commitLayers(next, void 0, commitToHistory);
|
|
4219
4199
|
return _nullishCoalesce(_chunkWSTEXEKDcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
4220
4200
|
}
|
|
4221
4201
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
4222
4202
|
removeLayerFilter(id, filterId) {
|
|
4223
|
-
const next =
|
|
4203
|
+
const next = _chunkZID226ZGcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
|
|
4224
4204
|
this.commitLayers(next);
|
|
4225
4205
|
return _nullishCoalesce(_chunkWSTEXEKDcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
4226
4206
|
}
|
|
@@ -4235,9 +4215,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
4235
4215
|
* anything else nests as a layer document. Returns the smart object's id.
|
|
4236
4216
|
*/
|
|
4237
4217
|
convertToSmartObject(ids, options = {}) {
|
|
4238
|
-
const list = _optionalChain([ids, 'optionalAccess',
|
|
4239
|
-
if (!list.length) throw new (0,
|
|
4240
|
-
const res =
|
|
4218
|
+
const list = _optionalChain([ids, 'optionalAccess', _138 => _138.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
|
|
4219
|
+
if (!list.length) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
|
|
4220
|
+
const res = _chunkZID226ZGcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
|
|
4241
4221
|
this.commitLayers(res.layers, () => {
|
|
4242
4222
|
this.state.activeLayerId = res.layer.id;
|
|
4243
4223
|
this.state.activeTarget = "pixels";
|
|
@@ -4246,7 +4226,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4246
4226
|
}
|
|
4247
4227
|
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
4248
4228
|
rasterizeSmartObject(id) {
|
|
4249
|
-
const res =
|
|
4229
|
+
const res = _chunkZID226ZGcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
|
|
4250
4230
|
this.commitLayers(res.layers, () => {
|
|
4251
4231
|
if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
4252
4232
|
});
|
|
@@ -4254,10 +4234,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4254
4234
|
}
|
|
4255
4235
|
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
4256
4236
|
getSmartObject(id) {
|
|
4257
|
-
const layer =
|
|
4237
|
+
const layer = _chunkZID226ZGcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4258
4238
|
const c = layer.contents;
|
|
4259
|
-
const g =
|
|
4260
|
-
const readout =
|
|
4239
|
+
const g = _chunkZID226ZGcjs.placementGeometry.call(void 0, layer);
|
|
4240
|
+
const readout = _chunkZID226ZGcjs.describeTransform.call(void 0, g);
|
|
4261
4241
|
const stack = layer.smartFilters;
|
|
4262
4242
|
return {
|
|
4263
4243
|
layerId: layer.id,
|
|
@@ -4267,10 +4247,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4267
4247
|
kind: c.kind,
|
|
4268
4248
|
width: c.width,
|
|
4269
4249
|
height: c.height,
|
|
4270
|
-
decoded:
|
|
4271
|
-
fileType: _nullishCoalesce(_optionalChain([c, 'access',
|
|
4272
|
-
linkedPath: _nullishCoalesce(_optionalChain([c, 'access',
|
|
4273
|
-
instances:
|
|
4250
|
+
decoded: _chunkZID226ZGcjs.isContentsDecoded.call(void 0, c),
|
|
4251
|
+
fileType: _nullishCoalesce(_optionalChain([c, 'access', _139 => _139.file, 'optionalAccess', _140 => _140.type]), () => ( null)),
|
|
4252
|
+
linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _141 => _141.linked, 'optionalAccess', _142 => _142.path]), () => ( null)),
|
|
4253
|
+
instances: _chunkZID226ZGcjs.instancesOf.call(void 0, this.state.layers, c.id),
|
|
4274
4254
|
layerCount: c.document ? _chunkWSTEXEKDcjs.flattenLayers.call(void 0, c.document.layers).length : 0
|
|
4275
4255
|
},
|
|
4276
4256
|
placement: {
|
|
@@ -4282,13 +4262,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
4282
4262
|
scaleY: readout.scaleY,
|
|
4283
4263
|
rotate: readout.rotate,
|
|
4284
4264
|
skewX: readout.skewX,
|
|
4285
|
-
center:
|
|
4286
|
-
bounds:
|
|
4265
|
+
center: _chunkZID226ZGcjs.anchorPoint.call(void 0, g, "center"),
|
|
4266
|
+
bounds: _chunkZID226ZGcjs.transformedBox.call(void 0, g)
|
|
4287
4267
|
},
|
|
4288
4268
|
smartFilters: {
|
|
4289
|
-
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess',
|
|
4290
|
-
filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess',
|
|
4291
|
-
mask: _optionalChain([stack, 'optionalAccess',
|
|
4269
|
+
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _143 => _143.enabled]), () => ( true)),
|
|
4270
|
+
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: _chunkCRMAXIUVcjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
|
|
4292
4272
|
},
|
|
4293
4273
|
bounds: this.getLayerBounds(id)
|
|
4294
4274
|
};
|
|
@@ -4300,7 +4280,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4300
4280
|
* change. Returns the new placement summary.
|
|
4301
4281
|
*/
|
|
4302
4282
|
setSmartObjectPlacement(id, placement, commitToHistory = true) {
|
|
4303
|
-
const res =
|
|
4283
|
+
const res = _chunkZID226ZGcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
|
|
4304
4284
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4305
4285
|
return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
|
|
4306
4286
|
}
|
|
@@ -4313,23 +4293,23 @@ var ImageEditorController = (_class6 = class {
|
|
|
4313
4293
|
* nothing is relative to the current transform.
|
|
4314
4294
|
*/
|
|
4315
4295
|
setSmartObjectTransform(id, spec) {
|
|
4316
|
-
const layer =
|
|
4317
|
-
const g =
|
|
4296
|
+
const layer = _chunkZID226ZGcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4297
|
+
const g = _chunkZID226ZGcjs.placementGeometry.call(void 0, layer);
|
|
4318
4298
|
const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
|
|
4319
4299
|
const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
|
|
4320
|
-
if (ways > 1) throw new (0,
|
|
4300
|
+
if (ways > 1) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
|
|
4321
4301
|
let corners = g.corners;
|
|
4322
4302
|
if (spec.corners) corners = spec.corners;
|
|
4323
4303
|
else if (spec.matrix) {
|
|
4324
|
-
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0,
|
|
4304
|
+
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkZID226ZGcjs.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).");
|
|
4325
4305
|
const [a, b, c, d] = spec.matrix;
|
|
4326
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
4327
|
-
corners =
|
|
4306
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
|
|
4307
|
+
corners = _chunkZID226ZGcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
|
|
4328
4308
|
} else if (numeric.length) {
|
|
4329
|
-
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0,
|
|
4330
|
-
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0,
|
|
4331
|
-
const now =
|
|
4332
|
-
const centre =
|
|
4309
|
+
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
|
|
4310
|
+
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`${k} must be a finite number.`);
|
|
4311
|
+
const now = _chunkZID226ZGcjs.describeTransform.call(void 0, g);
|
|
4312
|
+
const centre = _chunkZID226ZGcjs.anchorPoint.call(void 0, g, "center");
|
|
4333
4313
|
const params = {
|
|
4334
4314
|
scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
|
|
4335
4315
|
scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
|
|
@@ -4337,20 +4317,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
4337
4317
|
skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
|
|
4338
4318
|
skewY: _nullishCoalesce(spec.skewY, () => ( 0))
|
|
4339
4319
|
};
|
|
4340
|
-
const m =
|
|
4320
|
+
const m = _chunkZID226ZGcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
|
|
4341
4321
|
const cx = g.box.width / 2;
|
|
4342
4322
|
const cy = g.box.height / 2;
|
|
4343
4323
|
const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
|
|
4344
|
-
corners =
|
|
4324
|
+
corners = _chunkZID226ZGcjs.cornersFromMatrix.call(void 0, g.box, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, m, _chunkDWGZUSEScjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
|
|
4345
4325
|
}
|
|
4346
4326
|
let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
|
|
4347
4327
|
if (spec.warp === null) warp = null;
|
|
4348
4328
|
else if (spec.warp) {
|
|
4349
4329
|
if ("style" in spec.warp) {
|
|
4350
|
-
if (!_chunkDWGZUSEScjs.WARP_STYLES.includes(spec.warp.style)) throw new (0,
|
|
4351
|
-
warp =
|
|
4330
|
+
if (!_chunkDWGZUSEScjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkDWGZUSEScjs.WARP_STYLES.join(", ")}.`);
|
|
4331
|
+
warp = _chunkZID226ZGcjs.presetWarp.call(void 0, g.box, spec.warp);
|
|
4352
4332
|
} else {
|
|
4353
|
-
if (!
|
|
4333
|
+
if (!_chunkZID226ZGcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkZID226ZGcjs.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.");
|
|
4354
4334
|
warp = spec.warp;
|
|
4355
4335
|
}
|
|
4356
4336
|
}
|
|
@@ -4364,16 +4344,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
4364
4344
|
* the layers that changed.
|
|
4365
4345
|
*/
|
|
4366
4346
|
replaceSmartObjectContents(id, source) {
|
|
4367
|
-
const layer =
|
|
4347
|
+
const layer = _chunkZID226ZGcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4368
4348
|
let contents;
|
|
4369
4349
|
if ("contents" in source) contents = source.contents;
|
|
4370
|
-
else if ("pixels" in source) contents =
|
|
4350
|
+
else if ("pixels" in source) contents = _chunkZID226ZGcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
|
|
4371
4351
|
else {
|
|
4372
|
-
const psd =
|
|
4373
|
-
contents =
|
|
4352
|
+
const psd = _chunkZID226ZGcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkZID226ZGcjs.newLayerId.call(void 0, ) });
|
|
4353
|
+
contents = _chunkZID226ZGcjs.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`)));
|
|
4374
4354
|
contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
|
|
4375
4355
|
}
|
|
4376
|
-
const res =
|
|
4356
|
+
const res = _chunkZID226ZGcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
|
|
4377
4357
|
this.commitLayers(res.layers);
|
|
4378
4358
|
return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
|
|
4379
4359
|
}
|
|
@@ -4388,24 +4368,17 @@ var ImageEditorController = (_class6 = class {
|
|
|
4388
4368
|
* and bytes.
|
|
4389
4369
|
*/
|
|
4390
4370
|
exportSmartObjectContents(id) {
|
|
4391
|
-
const layer =
|
|
4371
|
+
const layer = _chunkZID226ZGcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4392
4372
|
const c = layer.contents;
|
|
4393
4373
|
const base = c.name.replace(/\.\w+$/, "") || "Contents";
|
|
4394
4374
|
if (c.file) {
|
|
4395
|
-
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop",
|
|
4375
|
+
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkZID226ZGcjs.BROWSER_IMAGE_TYPES };
|
|
4396
4376
|
const ext = c.file.type.toLowerCase();
|
|
4397
4377
|
return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
|
|
4398
4378
|
}
|
|
4399
|
-
if (!
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
return { name: `${base}.png`, mimeType: "image/png", bytes: _chunkWSTEXEKDcjs.encodePng.call(void 0, c.width, c.height, data) };
|
|
4403
|
-
}
|
|
4404
|
-
const doc = c.document;
|
|
4405
|
-
const merged = _chunkCRMAXIUVcjs.readRegion.call(void 0, _chunkVSMM7B3Pcjs.contentsSurface.call(void 0, c), { x: 0, y: 0, width: c.width, height: c.height });
|
|
4406
|
-
const prepared = prepareNestedForPsd(doc.layers);
|
|
4407
|
-
const res = _chunkVSMM7B3Pcjs.exportPsd.call(void 0, { width: c.width, height: c.height, layers: prepared, merged, patterns: doc.patterns, globalLight: doc.globalLight });
|
|
4408
|
-
return { name: `${base}.${res.psb ? "psb" : "psd"}`, mimeType: "image/vnd.adobe.photoshop", bytes: res.bytes };
|
|
4379
|
+
if (!_chunkZID226ZGcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
|
|
4380
|
+
const f = _chunkZID226ZGcjs.smartContentsFile.call(void 0, c);
|
|
4381
|
+
return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
|
|
4409
4382
|
}
|
|
4410
4383
|
/**
|
|
4411
4384
|
* Layer › Smart Objects › New Smart Object via Copy (`linked: false`: independent contents) or a
|
|
@@ -4413,7 +4386,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4413
4386
|
* undo step. Returns the copy's id.
|
|
4414
4387
|
*/
|
|
4415
4388
|
copySmartObject(id, linked = false, name) {
|
|
4416
|
-
const res =
|
|
4389
|
+
const res = _chunkZID226ZGcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
|
|
4417
4390
|
this.commitLayers(res.layers, () => {
|
|
4418
4391
|
this.state.activeLayerId = res.layer.id;
|
|
4419
4392
|
this.state.activeTarget = "pixels";
|
|
@@ -4422,33 +4395,33 @@ var ImageEditorController = (_class6 = class {
|
|
|
4422
4395
|
}
|
|
4423
4396
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
4424
4397
|
addSmartFilter(id, filter, index) {
|
|
4425
|
-
const res =
|
|
4398
|
+
const res = _chunkZID226ZGcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkZID226ZGcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
|
|
4426
4399
|
this.commitLayers(res.layers);
|
|
4427
4400
|
return res.filter;
|
|
4428
4401
|
}
|
|
4429
4402
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
4430
4403
|
updateSmartFilter(id, filterId, changes, commitToHistory = true) {
|
|
4431
|
-
const res =
|
|
4404
|
+
const res = _chunkZID226ZGcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
|
|
4432
4405
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4433
4406
|
return res.filter;
|
|
4434
4407
|
}
|
|
4435
4408
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
4436
4409
|
removeSmartFilter(id, filterId) {
|
|
4437
|
-
const res =
|
|
4410
|
+
const res = _chunkZID226ZGcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
|
|
4438
4411
|
this.commitLayers(res.layers);
|
|
4439
|
-
return _nullishCoalesce(_optionalChain([res, 'access',
|
|
4412
|
+
return _nullishCoalesce(_optionalChain([res, 'access', _146 => _146.layer, 'access', _147 => _147.smartFilters, 'optionalAccess', _148 => _148.filters]), () => ( []));
|
|
4440
4413
|
}
|
|
4441
4414
|
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
4442
4415
|
moveSmartFilter(id, filterId, index) {
|
|
4443
|
-
const res =
|
|
4416
|
+
const res = _chunkZID226ZGcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
|
|
4444
4417
|
this.commitLayers(res.layers);
|
|
4445
|
-
return _nullishCoalesce(_optionalChain([res, 'access',
|
|
4418
|
+
return _nullishCoalesce(_optionalChain([res, 'access', _149 => _149.layer, 'access', _150 => _150.smartFilters, 'optionalAccess', _151 => _151.filters]), () => ( []));
|
|
4446
4419
|
}
|
|
4447
4420
|
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
4448
4421
|
setSmartFiltersEnabled(id, enabled) {
|
|
4449
|
-
const res =
|
|
4422
|
+
const res = _chunkZID226ZGcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
|
|
4450
4423
|
this.commitLayers(res.layers);
|
|
4451
|
-
return _nullishCoalesce(_optionalChain([res, 'access',
|
|
4424
|
+
return _nullishCoalesce(_optionalChain([res, 'access', _152 => _152.layer, 'access', _153 => _153.smartFilters, 'optionalAccess', _154 => _154.enabled]), () => ( true));
|
|
4452
4425
|
}
|
|
4453
4426
|
/**
|
|
4454
4427
|
* Sets the smart filter mask (one undo step): `reveal-all`, `hide-all`, `selection` (the
|
|
@@ -4456,27 +4429,27 @@ var ImageEditorController = (_class6 = class {
|
|
|
4456
4429
|
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
4457
4430
|
*/
|
|
4458
4431
|
setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
|
|
4459
|
-
const layer =
|
|
4432
|
+
const layer = _chunkZID226ZGcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4460
4433
|
let mask;
|
|
4461
4434
|
if (from === "none") mask = null;
|
|
4462
4435
|
else if (from === "keep") {
|
|
4463
|
-
if (!_optionalChain([layer, 'access',
|
|
4436
|
+
if (!_optionalChain([layer, 'access', _155 => _155.smartFilters, 'optionalAccess', _156 => _156.mask])) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
|
|
4464
4437
|
mask = withMaskProps(layer.smartFilters.mask, props);
|
|
4465
4438
|
} else if (from === "selection") {
|
|
4466
4439
|
const sel = this.state.selection;
|
|
4467
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
4440
|
+
if (!_optionalChain([sel, 'optionalAccess', _157 => _157.bounds])) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
4468
4441
|
mask = this.maskFromSelection(sel, props);
|
|
4469
4442
|
} else {
|
|
4470
4443
|
const v = from === "reveal-all" ? 255 : 0;
|
|
4471
4444
|
mask = withMaskProps({ surface: _chunkCRMAXIUVcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
4472
4445
|
}
|
|
4473
|
-
const res =
|
|
4446
|
+
const res = _chunkZID226ZGcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
|
|
4474
4447
|
this.commitLayers(res.layers, () => {
|
|
4475
4448
|
if (this.state.activeLayerId !== id) return;
|
|
4476
4449
|
if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
|
|
4477
4450
|
else if (!mask && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
4478
4451
|
}, commitToHistory);
|
|
4479
|
-
return _nullishCoalesce(_optionalChain([res, 'access',
|
|
4452
|
+
return _nullishCoalesce(_optionalChain([res, 'access', _158 => _158.layer, 'access', _159 => _159.smartFilters, 'optionalAccess', _160 => _160.mask]), () => ( null));
|
|
4480
4453
|
}
|
|
4481
4454
|
/**
|
|
4482
4455
|
* Decodes smart object contents that came as files the synchronous decoders cannot read (a JPEG
|
|
@@ -4485,13 +4458,15 @@ var ImageEditorController = (_class6 = class {
|
|
|
4485
4458
|
*/
|
|
4486
4459
|
async prepareSmartObjects() {
|
|
4487
4460
|
const pending = /* @__PURE__ */ new Map();
|
|
4488
|
-
for (const l of _chunkWSTEXEKDcjs.flattenLayers.call(void 0, this.state.layers))
|
|
4461
|
+
for (const l of _chunkWSTEXEKDcjs.flattenLayers.call(void 0, this.state.layers)) {
|
|
4462
|
+
if (l.type === "smart" && !_chunkZID226ZGcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkZID226ZGcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
|
|
4463
|
+
}
|
|
4489
4464
|
const left = [];
|
|
4490
4465
|
for (const [cid, c] of pending) {
|
|
4491
4466
|
try {
|
|
4492
|
-
const url = `data:${
|
|
4467
|
+
const url = `data:${_chunkZID226ZGcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkWSTEXEKDcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
|
|
4493
4468
|
const px2 = await this.decodeImage(url);
|
|
4494
|
-
const decoded = { ...c, kind: "raster", raster:
|
|
4469
|
+
const decoded = { ...c, kind: "raster", raster: _chunkZID226ZGcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
|
|
4495
4470
|
const swap = (layers) => {
|
|
4496
4471
|
let out = layers;
|
|
4497
4472
|
for (const l of _chunkWSTEXEKDcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkWSTEXEKDcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
|
|
@@ -4519,10 +4494,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4519
4494
|
* Contents can nest. Returns the contents' size and layer ids.
|
|
4520
4495
|
*/
|
|
4521
4496
|
editSmartObjectContents(id) {
|
|
4522
|
-
if (this.getFreeTransform()) throw new (0,
|
|
4523
|
-
const layer =
|
|
4497
|
+
if (this.getFreeTransform()) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
|
|
4498
|
+
const layer = _chunkZID226ZGcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4524
4499
|
const c = layer.contents;
|
|
4525
|
-
if (!
|
|
4500
|
+
if (!_chunkZID226ZGcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkZID226ZGcjs.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.`);
|
|
4526
4501
|
const saved = {
|
|
4527
4502
|
state: { ...this.state },
|
|
4528
4503
|
undo: this.undoStack,
|
|
@@ -4533,7 +4508,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4533
4508
|
samplePixelsOverride: this.samplePixelsOverride,
|
|
4534
4509
|
psdResolution: this.psdResolution
|
|
4535
4510
|
};
|
|
4536
|
-
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id:
|
|
4511
|
+
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkZID226ZGcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
|
|
4537
4512
|
this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
|
|
4538
4513
|
const s = this.state;
|
|
4539
4514
|
this.state = {
|
|
@@ -4541,7 +4516,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4541
4516
|
sourceUrl: null,
|
|
4542
4517
|
imageDimensions: { width: c.width, height: c.height },
|
|
4543
4518
|
crop: null,
|
|
4544
|
-
transform: { ...
|
|
4519
|
+
transform: { ..._chunkZID226ZGcjs.DEFAULT_TRANSFORM_VALUES },
|
|
4545
4520
|
layers,
|
|
4546
4521
|
activeLayerId: layers.length ? layers[layers.length - 1].id : null,
|
|
4547
4522
|
activeTarget: "pixels",
|
|
@@ -4553,9 +4528,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
4553
4528
|
editingContents: this.getEditingContents()
|
|
4554
4529
|
};
|
|
4555
4530
|
delete this.state.legacyOutputBlur;
|
|
4556
|
-
if (_optionalChain([c, 'access',
|
|
4531
|
+
if (_optionalChain([c, 'access', _163 => _163.document, 'optionalAccess', _164 => _164.globalLight])) this.state.globalLight = c.document.globalLight;
|
|
4557
4532
|
else delete this.state.globalLight;
|
|
4558
|
-
if (_optionalChain([c, 'access',
|
|
4533
|
+
if (_optionalChain([c, 'access', _165 => _165.document, 'optionalAccess', _166 => _166.patterns, 'optionalAccess', _167 => _167.length])) this.state.patterns = c.document.patterns;
|
|
4559
4534
|
else delete this.state.patterns;
|
|
4560
4535
|
this.imageElement = null;
|
|
4561
4536
|
this.samplePixels = null;
|
|
@@ -4574,24 +4549,24 @@ var ImageEditorController = (_class6 = class {
|
|
|
4574
4549
|
*/
|
|
4575
4550
|
closeSmartObjectContents(save = true) {
|
|
4576
4551
|
const top = this.contentsStack.pop();
|
|
4577
|
-
if (!top) throw new (0,
|
|
4578
|
-
if (_optionalChain([this, 'access',
|
|
4552
|
+
if (!top) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
|
|
4553
|
+
if (_optionalChain([this, 'access', _168 => _168.openTransform, 'optionalAccess', _169 => _169.isOpen])) this.openTransform.cancel();
|
|
4579
4554
|
this.openTransform = null;
|
|
4580
4555
|
const edited = this.state;
|
|
4581
4556
|
const changed = save && this.undoStack.length > 0;
|
|
4582
4557
|
let next = null;
|
|
4583
4558
|
if (changed) {
|
|
4584
|
-
const layer = _optionalChain([_chunkWSTEXEKDcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess',
|
|
4585
|
-
const old = _optionalChain([layer, 'optionalAccess',
|
|
4559
|
+
const layer = _optionalChain([_chunkWSTEXEKDcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _170 => _170.layer]);
|
|
4560
|
+
const old = _optionalChain([layer, 'optionalAccess', _171 => _171.contents]);
|
|
4586
4561
|
const { width, height } = edited.imageDimensions;
|
|
4587
4562
|
const only = edited.layers.length === 1 ? edited.layers[0] : null;
|
|
4588
|
-
const plain3 = _optionalChain([only, 'optionalAccess',
|
|
4589
|
-
if (_optionalChain([old, 'optionalAccess',
|
|
4563
|
+
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
|
+
if (_optionalChain([old, 'optionalAccess', _175 => _175.kind]) === "raster" && plain3) {
|
|
4590
4565
|
const px2 = _chunkCRMAXIUVcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
|
|
4591
|
-
next =
|
|
4566
|
+
next = _chunkZID226ZGcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
|
|
4592
4567
|
} else {
|
|
4593
4568
|
const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
|
|
4594
|
-
next =
|
|
4569
|
+
next = _chunkZID226ZGcjs.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);
|
|
4595
4570
|
}
|
|
4596
4571
|
}
|
|
4597
4572
|
const saved = top.saved;
|
|
@@ -4610,13 +4585,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
4610
4585
|
this.notify();
|
|
4611
4586
|
return { layerId: top.layerId, changed: false, layerIds: [] };
|
|
4612
4587
|
}
|
|
4613
|
-
const res =
|
|
4588
|
+
const res = _chunkZID226ZGcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
|
|
4614
4589
|
this.commitLayers(res.layers);
|
|
4615
4590
|
return { layerId: top.layerId, changed: true, layerIds: res.ids };
|
|
4616
4591
|
}
|
|
4617
4592
|
/** The document's own layers (not the contents open for editing). */
|
|
4618
4593
|
rootLayers() {
|
|
4619
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
4594
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _178 => _178.contentsStack, 'access', _179 => _179[0], 'optionalAccess', _180 => _180.saved, 'access', _181 => _181.state, 'access', _182 => _182.layers]), () => ( this.state.layers));
|
|
4620
4595
|
}
|
|
4621
4596
|
/** Drops every open contents edit (loading another document). */
|
|
4622
4597
|
abandonContents() {
|
|
@@ -4625,35 +4600,35 @@ var ImageEditorController = (_class6 = class {
|
|
|
4625
4600
|
// --- Layer effects ---
|
|
4626
4601
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
4627
4602
|
getLayerEffects(id) {
|
|
4628
|
-
return
|
|
4603
|
+
return _chunkZID226ZGcjs.layerEffectsOf.call(void 0, _chunkZID226ZGcjs.requireLayer.call(void 0, this.state.layers, id).layer);
|
|
4629
4604
|
}
|
|
4630
4605
|
/**
|
|
4631
4606
|
* Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
|
|
4632
4607
|
* `index` in the layer's effect list (default the end). Returns the new effect and the effects.
|
|
4633
4608
|
*/
|
|
4634
4609
|
addLayerEffect(id, kind, params = {}, index) {
|
|
4635
|
-
const res =
|
|
4610
|
+
const res = _chunkZID226ZGcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
|
|
4636
4611
|
this.commitLayers(res.layers);
|
|
4637
4612
|
return { effect: res.effect, effects: this.getLayerEffects(id) };
|
|
4638
4613
|
}
|
|
4639
4614
|
/** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
|
|
4640
4615
|
updateLayerEffect(id, effectId, changes, commitToHistory = true) {
|
|
4641
|
-
this.commitLayers(
|
|
4616
|
+
this.commitLayers(_chunkZID226ZGcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
|
|
4642
4617
|
return this.getLayerEffects(id);
|
|
4643
4618
|
}
|
|
4644
4619
|
/** Removes one effect (one undo step). Returns the remaining effects. */
|
|
4645
4620
|
removeLayerEffect(id, effectId) {
|
|
4646
|
-
this.commitLayers(
|
|
4621
|
+
this.commitLayers(_chunkZID226ZGcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
|
|
4647
4622
|
return this.getLayerEffects(id);
|
|
4648
4623
|
}
|
|
4649
4624
|
/** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
|
|
4650
4625
|
setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
|
|
4651
|
-
this.commitLayers(
|
|
4626
|
+
this.commitLayers(_chunkZID226ZGcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
|
|
4652
4627
|
return this.getLayerEffects(id);
|
|
4653
4628
|
}
|
|
4654
4629
|
/** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
|
|
4655
4630
|
setLayerEffects(id, effects, commitToHistory = true) {
|
|
4656
|
-
this.commitLayers(
|
|
4631
|
+
this.commitLayers(_chunkZID226ZGcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
|
|
4657
4632
|
return this.getLayerEffects(id);
|
|
4658
4633
|
}
|
|
4659
4634
|
__init54() {this.patternIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -4679,8 +4654,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
4679
4654
|
/** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
|
|
4680
4655
|
setGlobalLight(light, commitToHistory = true) {
|
|
4681
4656
|
const next = { ...this.getGlobalLight(), ...light };
|
|
4682
|
-
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0,
|
|
4683
|
-
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0,
|
|
4657
|
+
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
|
|
4658
|
+
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
|
|
4684
4659
|
if (commitToHistory) this.recordHistory();
|
|
4685
4660
|
if (next.angle === _chunkWSTEXEKDcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkWSTEXEKDcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
|
|
4686
4661
|
else this.state.globalLight = next;
|
|
@@ -4691,10 +4666,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4691
4666
|
async compositeToSurface(layers, rect) {
|
|
4692
4667
|
const { width, height } = this.naturalSize;
|
|
4693
4668
|
if (_chunkWSTEXEKDcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
|
|
4694
|
-
throw new (0,
|
|
4669
|
+
throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
|
|
4695
4670
|
}
|
|
4696
4671
|
await this.renderer.prepareLayerAssets(layers, width, height);
|
|
4697
|
-
const data = new (0,
|
|
4672
|
+
const data = new (0, _chunkZID226ZGcjs.LayerCompositor)().composite(layers, rect, this.renderer.compositorSources(width, height));
|
|
4698
4673
|
return _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
|
|
4699
4674
|
}
|
|
4700
4675
|
/** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
|
|
@@ -4703,13 +4678,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
4703
4678
|
const canvas = { x: 0, y: 0, width, height };
|
|
4704
4679
|
if (layer.type === "pixel") return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
4705
4680
|
if (layer.type === "annotation") {
|
|
4706
|
-
const b =
|
|
4681
|
+
const b = _chunkZID226ZGcjs.getAnnotationBounds.call(void 0, layer.annotation);
|
|
4707
4682
|
const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
|
|
4708
4683
|
return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
|
|
4709
4684
|
}
|
|
4710
4685
|
if (layer.type === "group") {
|
|
4711
4686
|
let r = null;
|
|
4712
|
-
for (const c of layer.children) r =
|
|
4687
|
+
for (const c of layer.children) r = _chunkZID226ZGcjs.unionRect.call(void 0, r, this.paintBounds(c));
|
|
4713
4688
|
return _nullishCoalesce(r, () => ( canvas));
|
|
4714
4689
|
}
|
|
4715
4690
|
return canvas;
|
|
@@ -4720,16 +4695,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
4720
4695
|
* Returns the merged id.
|
|
4721
4696
|
*/
|
|
4722
4697
|
async mergeDown(id) {
|
|
4723
|
-
const loc =
|
|
4698
|
+
const loc = _chunkZID226ZGcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
4724
4699
|
const upper = loc.layer;
|
|
4725
4700
|
const siblings = loc.parent ? loc.parent.children : this.state.layers;
|
|
4726
4701
|
const lower = siblings[loc.index - 1];
|
|
4727
|
-
if (!lower) throw new (0,
|
|
4728
|
-
if (lower.type !== "pixel") throw new (0,
|
|
4729
|
-
if (!upper.visible) throw new (0,
|
|
4730
|
-
|
|
4731
|
-
|
|
4732
|
-
let rect = _nullishCoalesce(
|
|
4702
|
+
if (!lower) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
|
|
4703
|
+
if (lower.type !== "pixel") throw new (0, _chunkZID226ZGcjs.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.`);
|
|
4704
|
+
if (!upper.visible) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
|
|
4705
|
+
_chunkZID226ZGcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
|
|
4706
|
+
_chunkZID226ZGcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
|
|
4707
|
+
let rect = _nullishCoalesce(_chunkZID226ZGcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
|
|
4733
4708
|
const reach = Math.max(_chunkWSTEXEKDcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkWSTEXEKDcjs.effectsMargin.call(void 0, upper.effects));
|
|
4734
4709
|
if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
|
|
4735
4710
|
const base = { ...lower, blend: "normal", opacity: 1 };
|
|
@@ -4755,12 +4730,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
4755
4730
|
*/
|
|
4756
4731
|
async mergeVisible() {
|
|
4757
4732
|
const visible = this.state.layers.filter((l) => l.visible);
|
|
4758
|
-
if (!visible.length) throw new (0,
|
|
4733
|
+
if (!visible.length) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("No layer is visible.");
|
|
4759
4734
|
const { width, height } = this.naturalSize;
|
|
4760
4735
|
const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
|
|
4761
4736
|
const merged = {
|
|
4762
4737
|
type: "pixel",
|
|
4763
|
-
id:
|
|
4738
|
+
id: _chunkZID226ZGcjs.newLayerId.call(void 0, ),
|
|
4764
4739
|
name: "Merged",
|
|
4765
4740
|
visible: true,
|
|
4766
4741
|
opacity: 1,
|
|
@@ -4818,7 +4793,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4818
4793
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
4819
4794
|
const key = `${tw}x${th}:${ox},${oy}`;
|
|
4820
4795
|
let byKey = this.thumbCache.get(surface);
|
|
4821
|
-
const hit = _optionalChain([byKey, 'optionalAccess',
|
|
4796
|
+
const hit = _optionalChain([byKey, 'optionalAccess', _183 => _183.get, 'call', _184 => _184(key)]);
|
|
4822
4797
|
if (hit) return hit;
|
|
4823
4798
|
const out = new Uint8ClampedArray(tw * th * 4);
|
|
4824
4799
|
for (let y = 0; y < th; y++) {
|
|
@@ -4841,6 +4816,15 @@ var ImageEditorController = (_class6 = class {
|
|
|
4841
4816
|
byKey.set(key, thumb);
|
|
4842
4817
|
return thumb;
|
|
4843
4818
|
}
|
|
4819
|
+
/**
|
|
4820
|
+
* A small PNG data URL preview of a pixel or smart layer over the canvas (or of its mask with `mask: true`),
|
|
4821
|
+
* longest side `maxSide` px; `null` for layers without pixels.
|
|
4822
|
+
*/
|
|
4823
|
+
getLayerThumbnailDataURL(id, options = {}) {
|
|
4824
|
+
const thumb = this.getLayerThumbnail(id, options);
|
|
4825
|
+
if (!thumb) return null;
|
|
4826
|
+
return _chunkWSTEXEKDcjs.pngDataUrl.call(void 0, thumb.width, thumb.height, thumb.data, 4);
|
|
4827
|
+
}
|
|
4844
4828
|
// --- Painting ---
|
|
4845
4829
|
/** Brush settings, colours and tool options of the paint tools (view state, no undo). */
|
|
4846
4830
|
setPaintOptions(options) {
|
|
@@ -4892,34 +4876,34 @@ var ImageEditorController = (_class6 = class {
|
|
|
4892
4876
|
/** Resolves and validates what a stroke, fill or clear paints into. */
|
|
4893
4877
|
paintTarget(layerId, channel, action) {
|
|
4894
4878
|
const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
|
|
4895
|
-
if (!id) throw new (0,
|
|
4896
|
-
const layer =
|
|
4879
|
+
if (!id) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
|
|
4880
|
+
const layer = _chunkZID226ZGcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
4897
4881
|
const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
|
|
4898
4882
|
if (ch === "mask") {
|
|
4899
|
-
if (!layer.mask) throw new (0,
|
|
4900
|
-
if (layer.mask.source) throw new (0,
|
|
4901
|
-
|
|
4883
|
+
if (!layer.mask) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
|
|
4884
|
+
if (layer.mask.source) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
|
|
4885
|
+
_chunkZID226ZGcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
4902
4886
|
} else if (ch === "filter-mask") {
|
|
4903
|
-
if (layer.type !== "smart" || !_optionalChain([layer, 'access',
|
|
4904
|
-
throw new (0,
|
|
4887
|
+
if (layer.type !== "smart" || !_optionalChain([layer, 'access', _185 => _185.smartFilters, 'optionalAccess', _186 => _186.mask])) {
|
|
4888
|
+
throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
|
|
4905
4889
|
}
|
|
4906
|
-
if (!
|
|
4907
|
-
|
|
4890
|
+
if (!_chunkZID226ZGcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
|
|
4891
|
+
_chunkZID226ZGcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
4908
4892
|
} else {
|
|
4909
|
-
if (layer.type === "smart") throw new (0,
|
|
4910
|
-
if (layer.type !== "pixel") throw new (0,
|
|
4911
|
-
|
|
4893
|
+
if (layer.type === "smart") throw new (0, _chunkZID226ZGcjs.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.`);
|
|
4894
|
+
if (layer.type !== "pixel") throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
|
|
4895
|
+
_chunkZID226ZGcjs.requireUnlocked.call(void 0, layer, "pixels", action);
|
|
4912
4896
|
}
|
|
4913
|
-
if (!layer.visible) throw new (0,
|
|
4897
|
+
if (!layer.visible) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
|
|
4914
4898
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
4915
4899
|
const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
|
|
4916
|
-
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access',
|
|
4900
|
+
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _187 => _187.locks, 'optionalAccess', _188 => _188.transparency]));
|
|
4917
4901
|
return { id, layer, channel: ch, offset, surface, lockTransparency };
|
|
4918
4902
|
}
|
|
4919
4903
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
4920
4904
|
withSurface(layer, channel, surface) {
|
|
4921
4905
|
if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
|
|
4922
|
-
if (channel === "filter-mask") return
|
|
4906
|
+
if (channel === "filter-mask") return _chunkZID226ZGcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
|
|
4923
4907
|
const next = { ...layer, surface };
|
|
4924
4908
|
delete next.source;
|
|
4925
4909
|
return next;
|
|
@@ -4932,10 +4916,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4932
4916
|
*/
|
|
4933
4917
|
beginStroke(init = {}) {
|
|
4934
4918
|
const tool = _nullishCoalesce(init.tool, () => ( "brush"));
|
|
4935
|
-
if (tool !== "brush" && tool !== "eraser" && tool !== "mixer") throw new (0,
|
|
4919
|
+
if (tool !== "brush" && tool !== "eraser" && tool !== "mixer") throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use brush, eraser or mixer.`);
|
|
4936
4920
|
const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : "paint");
|
|
4937
4921
|
if (tool === "mixer" && target.channel !== "pixels") {
|
|
4938
|
-
throw new (0,
|
|
4922
|
+
throw new (0, _chunkZID226ZGcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
|
|
4939
4923
|
}
|
|
4940
4924
|
const brush = _chunkPV42JITTcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
|
|
4941
4925
|
const color = parseColor(_nullishCoalesce(init.color, () => ( this.state.paint.foreground)));
|
|
@@ -4951,7 +4935,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4951
4935
|
opacity: brush.opacity,
|
|
4952
4936
|
blend: target.channel !== "pixels" ? "normal" : brush.blend,
|
|
4953
4937
|
lockTransparency: target.lockTransparency,
|
|
4954
|
-
selection: _optionalChain([this, 'access',
|
|
4938
|
+
selection: _optionalChain([this, 'access', _189 => _189.state, 'access', _190 => _190.selection, 'optionalAccess', _191 => _191.bounds]) ? this.state.selection : null,
|
|
4955
4939
|
offset: target.offset
|
|
4956
4940
|
};
|
|
4957
4941
|
if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply);
|
|
@@ -5001,9 +4985,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
5001
4985
|
* document bounds and the number of dabs.
|
|
5002
4986
|
*/
|
|
5003
4987
|
paintStroke(init) {
|
|
5004
|
-
if (!Array.isArray(init.points) || !init.points.length) throw new (0,
|
|
4988
|
+
if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("points must hold at least one { x, y } point.");
|
|
5005
4989
|
for (const p of init.points) {
|
|
5006
|
-
if (!Number.isFinite(_optionalChain([p, 'optionalAccess',
|
|
4990
|
+
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _192 => _192.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _193 => _193.y]))) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
|
|
5007
4991
|
}
|
|
5008
4992
|
const session = this.beginStroke(init);
|
|
5009
4993
|
session.push(init.points);
|
|
@@ -5029,10 +5013,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
5029
5013
|
const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
|
|
5030
5014
|
const { width, height } = this.naturalSize;
|
|
5031
5015
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
5032
|
-
if (!(opacity >= 0 && opacity <= 1)) throw new (0,
|
|
5033
|
-
const blend = _nullishCoalesce(
|
|
5034
|
-
const sel = options.useSelection !== false && _optionalChain([this, 'access',
|
|
5035
|
-
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess',
|
|
5016
|
+
if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
5017
|
+
const blend = _nullishCoalesce(_chunkZID226ZGcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
|
|
5018
|
+
const sel = options.useSelection !== false && _optionalChain([this, 'access', _194 => _194.state, 'access', _195 => _195.selection, 'optionalAccess', _196 => _196.bounds]) ? this.state.selection : null;
|
|
5019
|
+
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _197 => _197.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
5036
5020
|
const coverage = new (0, _chunkPV42JITTcjs.CoverageMap)();
|
|
5037
5021
|
const ones = new Float32Array(region.width * region.height);
|
|
5038
5022
|
if (sel) {
|
|
@@ -5091,7 +5075,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5091
5075
|
this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
|
|
5092
5076
|
}
|
|
5093
5077
|
if ("layers" in partial) {
|
|
5094
|
-
layers = this.replaceAdjustmentNodes(layers,
|
|
5078
|
+
layers = this.replaceAdjustmentNodes(layers, _chunkZID226ZGcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
|
|
5095
5079
|
}
|
|
5096
5080
|
this.state.layers = layers;
|
|
5097
5081
|
this.notify();
|
|
@@ -5099,7 +5083,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5099
5083
|
/** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
|
|
5100
5084
|
get isProcessOutdated() {
|
|
5101
5085
|
this.syncViews();
|
|
5102
|
-
return
|
|
5086
|
+
return _chunkZID226ZGcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkZID226ZGcjs.LATEST_PROCESS_VERSION;
|
|
5103
5087
|
}
|
|
5104
5088
|
/**
|
|
5105
5089
|
* Update to Current Process: re-interprets the current adjustment values with the latest
|
|
@@ -5107,7 +5091,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5107
5091
|
*/
|
|
5108
5092
|
upgradeProcess() {
|
|
5109
5093
|
if (!this.isProcessOutdated) return false;
|
|
5110
|
-
this.setAdjustments({ process:
|
|
5094
|
+
this.setAdjustments({ process: _chunkZID226ZGcjs.LATEST_PROCESS_VERSION });
|
|
5111
5095
|
return true;
|
|
5112
5096
|
}
|
|
5113
5097
|
/** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
|
|
@@ -5118,7 +5102,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5118
5102
|
this.state.layers = _chunkWSTEXEKDcjs.mapLayer.call(void 0,
|
|
5119
5103
|
this.state.layers,
|
|
5120
5104
|
target.id,
|
|
5121
|
-
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process:
|
|
5105
|
+
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkZID226ZGcjs.LATEST_PROCESS_VERSION }), 0)
|
|
5122
5106
|
);
|
|
5123
5107
|
}
|
|
5124
5108
|
delete this.state.legacyOutputBlur;
|
|
@@ -5150,7 +5134,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5150
5134
|
placeLayer(layers, node, where) {
|
|
5151
5135
|
if (where.aboveId) {
|
|
5152
5136
|
const loc = _chunkWSTEXEKDcjs.findLayer.call(void 0, layers, where.aboveId);
|
|
5153
|
-
if (loc) return _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
5137
|
+
if (loc) return _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _198 => _198.parent, 'optionalAccess', _199 => _199.id]), () => ( null)), loc.index + 1);
|
|
5154
5138
|
}
|
|
5155
5139
|
if (where.parentId) {
|
|
5156
5140
|
const loc = _chunkWSTEXEKDcjs.findLayer.call(void 0, layers, where.parentId);
|
|
@@ -5161,11 +5145,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
5161
5145
|
const at = Math.max(0, Math.min(nodes.length, Math.round(where.adjustmentIndex)));
|
|
5162
5146
|
if (at < nodes.length) {
|
|
5163
5147
|
const loc = _chunkWSTEXEKDcjs.findLayer.call(void 0, layers, nodes[at].id);
|
|
5164
|
-
return _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
5148
|
+
return _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _200 => _200.parent, 'optionalAccess', _201 => _201.id]), () => ( null)), loc.index);
|
|
5165
5149
|
}
|
|
5166
5150
|
if (nodes.length) {
|
|
5167
5151
|
const loc = _chunkWSTEXEKDcjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
|
|
5168
|
-
return _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
5152
|
+
return _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _202 => _202.parent, 'optionalAccess', _203 => _203.id]), () => ( null)), loc.index + 1);
|
|
5169
5153
|
}
|
|
5170
5154
|
}
|
|
5171
5155
|
return _chunkWSTEXEKDcjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
|
|
@@ -5197,7 +5181,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5197
5181
|
addAdjustmentLayer(init, index) {
|
|
5198
5182
|
const spec = typeof init === "string" ? { kind: init } : init;
|
|
5199
5183
|
const ids = new Set(_chunkWSTEXEKDcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
5200
|
-
const layer =
|
|
5184
|
+
const layer = _chunkZID226ZGcjs.createAdjustmentLayer.call(void 0, spec.kind, {
|
|
5201
5185
|
id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
|
|
5202
5186
|
name: spec.name,
|
|
5203
5187
|
params: spec.params,
|
|
@@ -5206,7 +5190,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5206
5190
|
blend: spec.blend,
|
|
5207
5191
|
mask: _nullishCoalesce(spec.mask, () => ( void 0))
|
|
5208
5192
|
});
|
|
5209
|
-
while (ids.has(layer.id)) layer.id =
|
|
5193
|
+
while (ids.has(layer.id)) layer.id = _chunkZID226ZGcjs.newLayerId.call(void 0, "adj");
|
|
5210
5194
|
const { width, height } = this.naturalSize;
|
|
5211
5195
|
this.recordHistory();
|
|
5212
5196
|
const node = adjustmentNodeFromLegacy(layer, width, height);
|
|
@@ -5229,7 +5213,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5229
5213
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
5230
5214
|
const { width, height } = this.naturalSize;
|
|
5231
5215
|
const node = loc.layer;
|
|
5232
|
-
const merged =
|
|
5216
|
+
const merged = _chunkZID226ZGcjs.normalizeAdjustmentLayer.call(void 0, {
|
|
5233
5217
|
id: node.id,
|
|
5234
5218
|
kind: node.kind,
|
|
5235
5219
|
enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
|
|
@@ -5277,7 +5261,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5277
5261
|
const anchor = nodes[to];
|
|
5278
5262
|
const without = _chunkWSTEXEKDcjs.mapLayer.call(void 0, layers, id, () => null);
|
|
5279
5263
|
const loc = _chunkWSTEXEKDcjs.findLayer.call(void 0, without, anchor.id);
|
|
5280
|
-
return _chunkWSTEXEKDcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
5264
|
+
return _chunkWSTEXEKDcjs.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);
|
|
5281
5265
|
}
|
|
5282
5266
|
/** Moves a layer to `toIndex` among the adjustment layers (0 = bottom) as one undo step. Returns false if nothing moved. */
|
|
5283
5267
|
moveAdjustmentLayer(id, toIndex) {
|
|
@@ -5313,7 +5297,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5313
5297
|
return _nullishCoalesce(this.state.selection, () => ( null));
|
|
5314
5298
|
}
|
|
5315
5299
|
get hasSelection() {
|
|
5316
|
-
return Boolean(_optionalChain([this, 'access',
|
|
5300
|
+
return Boolean(_optionalChain([this, 'access', _206 => _206.state, 'access', _207 => _207.selection, 'optionalAccess', _208 => _208.bounds]));
|
|
5317
5301
|
}
|
|
5318
5302
|
get naturalSize() {
|
|
5319
5303
|
return {
|
|
@@ -5336,8 +5320,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5336
5320
|
const { width, height } = this.naturalSize;
|
|
5337
5321
|
let next = null;
|
|
5338
5322
|
if (mask) {
|
|
5339
|
-
const sized = mask.width === width && mask.height === height ? mask :
|
|
5340
|
-
next =
|
|
5323
|
+
const sized = mask.width === width && mask.height === height ? mask : _chunkZID226ZGcjs.resizeSelection.call(void 0, mask, width, height);
|
|
5324
|
+
next = _chunkZID226ZGcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
|
|
5341
5325
|
} else if (mode !== "replace") {
|
|
5342
5326
|
return false;
|
|
5343
5327
|
}
|
|
@@ -5351,7 +5335,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5351
5335
|
/** Select › All. */
|
|
5352
5336
|
selectAll() {
|
|
5353
5337
|
const { width, height } = this.naturalSize;
|
|
5354
|
-
return this.setSelection(
|
|
5338
|
+
return this.setSelection(_chunkZID226ZGcjs.fullSelection.call(void 0, width, height));
|
|
5355
5339
|
}
|
|
5356
5340
|
/** Select › Deselect. */
|
|
5357
5341
|
deselect() {
|
|
@@ -5360,11 +5344,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
5360
5344
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
5361
5345
|
invertSelection() {
|
|
5362
5346
|
const { width, height } = this.naturalSize;
|
|
5363
|
-
const current = _nullishCoalesce(this.state.selection, () => (
|
|
5364
|
-
return this.setSelection(
|
|
5347
|
+
const current = _nullishCoalesce(this.state.selection, () => ( _chunkZID226ZGcjs.createSelectionMask.call(void 0, width, height)));
|
|
5348
|
+
return this.setSelection(_chunkZID226ZGcjs.invertSelection.call(void 0, current));
|
|
5365
5349
|
}
|
|
5366
5350
|
shapeCommand(mask, options) {
|
|
5367
|
-
const shaped = options.feather && options.feather > 0 ?
|
|
5351
|
+
const shaped = options.feather && options.feather > 0 ? _chunkZID226ZGcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
|
|
5368
5352
|
return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
|
|
5369
5353
|
}
|
|
5370
5354
|
/** Rectangular marquee in natural image pixels. */
|
|
@@ -5403,7 +5387,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5403
5387
|
try {
|
|
5404
5388
|
const canvas = await this.renderSource();
|
|
5405
5389
|
const ctx = canvas.getContext("2d");
|
|
5406
|
-
const data2 = _optionalChain([ctx, 'optionalAccess',
|
|
5390
|
+
const data2 = _optionalChain([ctx, 'optionalAccess', _209 => _209.getImageData, 'optionalCall', _210 => _210(0, 0, width, height)]);
|
|
5407
5391
|
if (data2 && data2.data && data2.data.length >= width * height * 4) {
|
|
5408
5392
|
base = { width, height, data: data2.data };
|
|
5409
5393
|
this.samplePixels = base;
|
|
@@ -5422,7 +5406,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5422
5406
|
if (options.sample === "active-layer") {
|
|
5423
5407
|
const layer = this.getActiveLayer();
|
|
5424
5408
|
if (!layer || layer.type !== "pixel") {
|
|
5425
|
-
throw new (0,
|
|
5409
|
+
throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
|
|
5426
5410
|
}
|
|
5427
5411
|
const surface = layer.source === "document" && options.pixels ? _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
|
|
5428
5412
|
return { width, height, data: _chunkCRMAXIUVcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
|
|
@@ -5431,7 +5415,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5431
5415
|
this.syncViews();
|
|
5432
5416
|
if (legacy && !options.pixels) {
|
|
5433
5417
|
const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
|
|
5434
|
-
|
|
5418
|
+
_chunkZID226ZGcjs.applyAdjustments.call(void 0, copy, legacyView(this.stack(), width, height, null).adjustments);
|
|
5435
5419
|
return copy;
|
|
5436
5420
|
}
|
|
5437
5421
|
const pixels = options.pixels;
|
|
@@ -5443,7 +5427,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5443
5427
|
};
|
|
5444
5428
|
const stack = withoutAnnotations(this.state.layers);
|
|
5445
5429
|
const layers = options.sampleMerged ? stack : pixelsOnly(stack);
|
|
5446
|
-
const data = new (0,
|
|
5430
|
+
const data = new (0, _chunkZID226ZGcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
|
|
5447
5431
|
return { width, height, data };
|
|
5448
5432
|
}
|
|
5449
5433
|
async requirePixels(options) {
|
|
@@ -5469,8 +5453,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5469
5453
|
/** Select › Modify: grow, shrink, feather, border or smooth by `radius` pixels (one undo step). */
|
|
5470
5454
|
modifySelection(op, radius) {
|
|
5471
5455
|
const sel = this.state.selection;
|
|
5472
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
5473
|
-
return this.setSelection(
|
|
5456
|
+
if (!_optionalChain([sel, 'optionalAccess', _211 => _211.bounds])) return false;
|
|
5457
|
+
return this.setSelection(_chunkZID226ZGcjs.modifySelection.call(void 0, sel, op, radius));
|
|
5474
5458
|
}
|
|
5475
5459
|
/**
|
|
5476
5460
|
* Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
|
|
@@ -5478,7 +5462,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5478
5462
|
*/
|
|
5479
5463
|
async refineSelection(params, options = {}) {
|
|
5480
5464
|
const sel = this.state.selection;
|
|
5481
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
5465
|
+
if (!_optionalChain([sel, 'optionalAccess', _212 => _212.bounds])) return false;
|
|
5482
5466
|
const pixels = (_nullishCoalesce(params.radius, () => ( 0))) > 0 ? await this.requirePixels(options) : null;
|
|
5483
5467
|
return this.setSelection(refineSelection(pixels, sel, params));
|
|
5484
5468
|
}
|
|
@@ -5495,13 +5479,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
5495
5479
|
const canvas = this.renderer.createCanvas(w, h);
|
|
5496
5480
|
const ctx = canvas.getContext("2d");
|
|
5497
5481
|
if (ctx) ctx.drawImage(img, 0, 0, w, h);
|
|
5498
|
-
const data = _optionalChain([ctx, 'optionalAccess',
|
|
5482
|
+
const data = _optionalChain([ctx, 'optionalAccess', _213 => _213.getImageData, 'optionalCall', _214 => _214(0, 0, w, h)]);
|
|
5499
5483
|
if (!data) throw new Error("The mask image pixels are not available (no canvas access); pass pixels.");
|
|
5500
5484
|
pixels = { width: w, height: h, data: data.data };
|
|
5501
5485
|
} else {
|
|
5502
5486
|
pixels = source;
|
|
5503
5487
|
}
|
|
5504
|
-
this.setSelection(
|
|
5488
|
+
this.setSelection(_chunkZID226ZGcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
|
|
5505
5489
|
return this.getSelection();
|
|
5506
5490
|
}
|
|
5507
5491
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
@@ -5513,7 +5497,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5513
5497
|
// --- Layer masks ---
|
|
5514
5498
|
maskFromSelection(sel, props = {}) {
|
|
5515
5499
|
const { width, height } = this.naturalSize;
|
|
5516
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
5500
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkZID226ZGcjs.resizeSelection.call(void 0, sel, width, height);
|
|
5517
5501
|
const mask = { surface: _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
|
|
5518
5502
|
return withMaskProps(mask, props);
|
|
5519
5503
|
}
|
|
@@ -5523,7 +5507,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5523
5507
|
*/
|
|
5524
5508
|
applySelectionAsLayerMask(layerId, props = {}) {
|
|
5525
5509
|
const sel = this.state.selection;
|
|
5526
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
5510
|
+
if (!_optionalChain([sel, 'optionalAccess', _215 => _215.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
|
|
5527
5511
|
return this.setLayerMask(layerId, this.maskFromSelection(sel, props));
|
|
5528
5512
|
}
|
|
5529
5513
|
setLayerMask(layerId, mask, commitToHistory = true) {
|
|
@@ -5554,12 +5538,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
5554
5538
|
/** Load Selection from a layer mask (its pixels; density and feather are not applied). */
|
|
5555
5539
|
selectionFromLayerMask(layerId, mode = "replace") {
|
|
5556
5540
|
const layer = this.getLayer(layerId);
|
|
5557
|
-
if (!_optionalChain([layer, 'optionalAccess',
|
|
5541
|
+
if (!_optionalChain([layer, 'optionalAccess', _216 => _216.mask]) || layer.mask.source) return false;
|
|
5558
5542
|
const { width, height } = this.naturalSize;
|
|
5559
5543
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
5560
5544
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
5561
5545
|
const data = _chunkCRMAXIUVcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
5562
|
-
const sel =
|
|
5546
|
+
const sel = _chunkZID226ZGcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
5563
5547
|
return this.setSelection(sel, mode);
|
|
5564
5548
|
}
|
|
5565
5549
|
// --- Histogram ---
|
|
@@ -5590,7 +5574,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5590
5574
|
this.state.layers = _chunkWSTEXEKDcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
5591
5575
|
const next = { ...l };
|
|
5592
5576
|
if (isDefaultDepthMask(merged)) {
|
|
5593
|
-
if (_optionalChain([next, 'access',
|
|
5577
|
+
if (_optionalChain([next, 'access', _217 => _217.mask, 'optionalAccess', _218 => _218.source])) delete next.mask;
|
|
5594
5578
|
} else next.mask = depthRasterMask(merged);
|
|
5595
5579
|
return next;
|
|
5596
5580
|
});
|
|
@@ -5600,7 +5584,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5600
5584
|
resetDepthMask() {
|
|
5601
5585
|
this.recordHistory();
|
|
5602
5586
|
const target = this.developLayer();
|
|
5603
|
-
if (_optionalChain([target, 'optionalAccess',
|
|
5587
|
+
if (_optionalChain([target, 'optionalAccess', _219 => _219.mask, 'optionalAccess', _220 => _220.source])) {
|
|
5604
5588
|
this.state.layers = _chunkWSTEXEKDcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
5605
5589
|
const next = { ...l };
|
|
5606
5590
|
delete next.mask;
|
|
@@ -5622,7 +5606,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5622
5606
|
const fullAnnotation = { ...annotation, id };
|
|
5623
5607
|
const layer = annotationLayerFor(fullAnnotation);
|
|
5624
5608
|
const loc = placement.aboveId ? _chunkWSTEXEKDcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
5625
|
-
this.state.layers = loc ? _chunkWSTEXEKDcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
5609
|
+
this.state.layers = loc ? _chunkWSTEXEKDcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _221 => _221.parent, 'optionalAccess', _222 => _222.id]), () => ( null)), loc.index + 1) : _chunkWSTEXEKDcjs.insertLayer.call(void 0, this.state.layers, layer, null);
|
|
5626
5610
|
this.state.selectedAnnotationId = id;
|
|
5627
5611
|
this.notify();
|
|
5628
5612
|
return id;
|
|
@@ -5728,7 +5712,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5728
5712
|
return this.renderer.createCanvas(1, 1);
|
|
5729
5713
|
}
|
|
5730
5714
|
this.syncViews();
|
|
5731
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
5715
|
+
if (_optionalChain([options, 'optionalAccess', _223 => _223.layerIds])) {
|
|
5732
5716
|
const keep = new Set(options.layerIds);
|
|
5733
5717
|
const layers = _chunkWSTEXEKDcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
|
|
5734
5718
|
return this.renderer.renderExport(source, { ...this.state, layers }, options);
|
|
@@ -5861,7 +5845,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5861
5845
|
let px2 = await this.decodeImage(newDataUrl);
|
|
5862
5846
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
5863
5847
|
const data = new Uint8ClampedArray(px2.data);
|
|
5864
|
-
const sel = _optionalChain([this, 'access',
|
|
5848
|
+
const sel = _optionalChain([this, 'access', _224 => _224.state, 'access', _225 => _225.selection, 'optionalAccess', _226 => _226.bounds]) ? this.state.selection : null;
|
|
5865
5849
|
if (sel) for (let p = 0, i = 3; p < width * height; p++, i += 4) data[i] = Math.round(data[i] * sel.data[p] / 255);
|
|
5866
5850
|
return this.addPixelLayer({ name: "Inpaint", pixels: { width, height, data } });
|
|
5867
5851
|
}
|
|
@@ -5878,8 +5862,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5878
5862
|
return;
|
|
5879
5863
|
}
|
|
5880
5864
|
const target = this.developLayer();
|
|
5881
|
-
if (!target) throw new (0,
|
|
5882
|
-
|
|
5865
|
+
if (!target) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("There is no pixel layer to mask.");
|
|
5866
|
+
_chunkZID226ZGcjs.requireUnlocked.call(void 0, target, "all", "mask it");
|
|
5883
5867
|
const { width, height } = this.naturalSize;
|
|
5884
5868
|
let px2 = await this.decodeImage(newDataUrl);
|
|
5885
5869
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
@@ -5887,7 +5871,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5887
5871
|
for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
|
|
5888
5872
|
let surface = _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
|
|
5889
5873
|
if (target.offset.x || target.offset.y) surface = _chunkCRMAXIUVcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
|
|
5890
|
-
this.commitLayers(
|
|
5874
|
+
this.commitLayers(_chunkZID226ZGcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
|
|
5891
5875
|
return target.id;
|
|
5892
5876
|
}
|
|
5893
5877
|
/**
|
|
@@ -5896,8 +5880,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5896
5880
|
* step. Returns the layer id.
|
|
5897
5881
|
*/
|
|
5898
5882
|
async rasterizeLayer(id) {
|
|
5899
|
-
const layer =
|
|
5900
|
-
|
|
5883
|
+
const layer = _chunkZID226ZGcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5884
|
+
_chunkZID226ZGcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
|
|
5901
5885
|
const { width, height } = this.naturalSize;
|
|
5902
5886
|
const canvas = { x: 0, y: 0, width, height };
|
|
5903
5887
|
let next;
|
|
@@ -5913,8 +5897,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5913
5897
|
if (layer.locks) next.locks = layer.locks;
|
|
5914
5898
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
5915
5899
|
} else if (layer.type === "pixel") {
|
|
5916
|
-
if (!_optionalChain([layer, 'access',
|
|
5917
|
-
|
|
5900
|
+
if (!_optionalChain([layer, 'access', _227 => _227.filters, 'optionalAccess', _228 => _228.length])) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
|
|
5901
|
+
_chunkZID226ZGcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
|
|
5918
5902
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
5919
5903
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
5920
5904
|
delete content.mask;
|
|
@@ -5931,7 +5915,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5931
5915
|
} else if (layer.type === "smart") {
|
|
5932
5916
|
return this.rasterizeSmartObject(id);
|
|
5933
5917
|
} else {
|
|
5934
|
-
throw new (0,
|
|
5918
|
+
throw new (0, _chunkZID226ZGcjs.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.`);
|
|
5935
5919
|
}
|
|
5936
5920
|
this.commitLayers(_chunkWSTEXEKDcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
|
|
5937
5921
|
return id;
|
|
@@ -5946,7 +5930,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5946
5930
|
* Throws `PsdError` for files that cannot be read at all.
|
|
5947
5931
|
*/
|
|
5948
5932
|
loadPsd(bytes) {
|
|
5949
|
-
const result =
|
|
5933
|
+
const result = _chunkZID226ZGcjs.importPsd.call(void 0, bytes, { newId: () => _chunkZID226ZGcjs.newLayerId.call(void 0, ) });
|
|
5950
5934
|
this.abandonContents();
|
|
5951
5935
|
this.recordHistory();
|
|
5952
5936
|
const s = this.state;
|
|
@@ -5956,7 +5940,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5956
5940
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
5957
5941
|
s.layers = result.layers;
|
|
5958
5942
|
s.crop = null;
|
|
5959
|
-
s.transform = { ...
|
|
5943
|
+
s.transform = { ..._chunkZID226ZGcjs.DEFAULT_TRANSFORM_VALUES };
|
|
5960
5944
|
s.outputOpacity = 1;
|
|
5961
5945
|
delete s.legacyOutputBlur;
|
|
5962
5946
|
s.selection = null;
|
|
@@ -5994,10 +5978,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
5994
5978
|
const canRasterize = this.renderer.canRasterize();
|
|
5995
5979
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
5996
5980
|
const sources = this.renderer.compositorSources(width, height);
|
|
5997
|
-
const compositor = new (0,
|
|
5981
|
+
const compositor = new (0, _chunkZID226ZGcjs.LayerCompositor)();
|
|
5998
5982
|
const bakeMask = (layer) => {
|
|
5999
5983
|
const mask = layer.mask;
|
|
6000
|
-
if (!_optionalChain([mask, 'optionalAccess',
|
|
5984
|
+
if (!_optionalChain([mask, 'optionalAccess', _229 => _229.source])) return mask;
|
|
6001
5985
|
add2("Parametric (depth) masks were baked into pixel masks", layer.name);
|
|
6002
5986
|
const plain3 = { ...layer, mask: { ...mask, density: 1, feather: 0, enabled: true } };
|
|
6003
5987
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
@@ -6014,7 +5998,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6014
5998
|
};
|
|
6015
5999
|
const prepare = async (layer) => {
|
|
6016
6000
|
const p = await prepareLayer(layer);
|
|
6017
|
-
if (_optionalChain([p, 'optionalAccess',
|
|
6001
|
+
if (_optionalChain([p, 'optionalAccess', _230 => _230.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
|
|
6018
6002
|
return p;
|
|
6019
6003
|
};
|
|
6020
6004
|
const prepareLayer = async (layer) => {
|
|
@@ -6057,18 +6041,18 @@ var ImageEditorController = (_class6 = class {
|
|
|
6057
6041
|
return out2;
|
|
6058
6042
|
}
|
|
6059
6043
|
if (layer.type === "smart") {
|
|
6060
|
-
|
|
6061
|
-
const
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
return
|
|
6044
|
+
const out2 = { ...layer };
|
|
6045
|
+
const mask2 = bakeMask(layer);
|
|
6046
|
+
if (mask2) out2.mask = mask2;
|
|
6047
|
+
else delete out2.mask;
|
|
6048
|
+
return out2;
|
|
6065
6049
|
}
|
|
6066
6050
|
let out = { ...layer };
|
|
6067
6051
|
if (layer.source === "document") {
|
|
6068
6052
|
out.surface = this.surfaceOf(layer);
|
|
6069
6053
|
delete out.source;
|
|
6070
6054
|
}
|
|
6071
|
-
const active = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
6055
|
+
const active = _nullishCoalesce(_optionalChain([layer, 'access', _231 => _231.filters, 'optionalAccess', _232 => _232.filter, 'call', _233 => _233(_chunkZID226ZGcjs.isActiveFilter)]), () => ( []));
|
|
6072
6056
|
if (active.length) {
|
|
6073
6057
|
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
6074
6058
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -6079,7 +6063,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6079
6063
|
const data = compositor.composite([content], canvas, sources);
|
|
6080
6064
|
out = { ...out, surface: _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
|
|
6081
6065
|
}
|
|
6082
|
-
if (_optionalChain([layer, 'access',
|
|
6066
|
+
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);
|
|
6083
6067
|
delete out.filters;
|
|
6084
6068
|
const mask = bakeMask(layer);
|
|
6085
6069
|
if (mask) out.mask = mask;
|
|
@@ -6098,7 +6082,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6098
6082
|
if (s.legacyOutputBlur) warnings.push("The document-level blur of an old document is not written.");
|
|
6099
6083
|
for (const [msg, names] of note) warnings.push(`${msg} (${names.length === 1 ? "layer" : "layers"} ${names.map((n) => `"${n}"`).join(", ")}).`);
|
|
6100
6084
|
const merged = compositor.composite(prepared, canvas, { ...sources, version: `psd:${Date.now()}` });
|
|
6101
|
-
const result =
|
|
6085
|
+
const result = _chunkZID226ZGcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight });
|
|
6102
6086
|
warnings.push(...result.warnings);
|
|
6103
6087
|
return { bytes: result.bytes, warnings, psb: result.psb, width, height };
|
|
6104
6088
|
}
|
|
@@ -6114,13 +6098,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
6114
6098
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
6115
6099
|
if (this.state.selection && (sx !== 1 || sy !== 1)) {
|
|
6116
6100
|
this.state.selection = normalizeSelection(
|
|
6117
|
-
|
|
6101
|
+
_chunkZID226ZGcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
|
|
6118
6102
|
);
|
|
6119
6103
|
}
|
|
6120
6104
|
let layers = this.state.layers;
|
|
6121
6105
|
if (sx !== 1 || sy !== 1) {
|
|
6122
6106
|
if (this.state.crop) {
|
|
6123
|
-
this.state.crop =
|
|
6107
|
+
this.state.crop = _chunkZID226ZGcjs.clampCropToImage.call(void 0,
|
|
6124
6108
|
{
|
|
6125
6109
|
x: Math.round(this.state.crop.x * sx),
|
|
6126
6110
|
y: Math.round(this.state.crop.y * sy),
|
|
@@ -6148,7 +6132,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6148
6132
|
this.notify();
|
|
6149
6133
|
}
|
|
6150
6134
|
toJSON(options) {
|
|
6151
|
-
const root = _optionalChain([this, 'access',
|
|
6135
|
+
const root = _optionalChain([this, 'access', _237 => _237.contentsStack, 'access', _238 => _238[0], 'optionalAccess', _239 => _239.saved]);
|
|
6152
6136
|
const current = this.state;
|
|
6153
6137
|
const element = this.imageElement;
|
|
6154
6138
|
if (root) {
|
|
@@ -6159,7 +6143,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6159
6143
|
let out;
|
|
6160
6144
|
try {
|
|
6161
6145
|
out = this.serializeState();
|
|
6162
|
-
if (_optionalChain([this, 'access',
|
|
6146
|
+
if (_optionalChain([this, 'access', _240 => _240.state, 'access', _241 => _241.selection, 'optionalAccess', _242 => _242.bounds])) out.selection = _chunkZID226ZGcjs.serializeSelection.call(void 0, this.state.selection);
|
|
6163
6147
|
} finally {
|
|
6164
6148
|
if (root) {
|
|
6165
6149
|
this.state = current;
|
|
@@ -6167,8 +6151,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
6167
6151
|
this.viewKey = [];
|
|
6168
6152
|
}
|
|
6169
6153
|
}
|
|
6170
|
-
if (!options || out.version !==
|
|
6171
|
-
return
|
|
6154
|
+
if (!options || out.version !== _chunkZID226ZGcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
|
|
6155
|
+
return _chunkZID226ZGcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
|
|
6172
6156
|
}
|
|
6173
6157
|
/**
|
|
6174
6158
|
* Loads a stored state whose v3 assets may live in an asset store (references other than data
|
|
@@ -6176,12 +6160,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
6176
6160
|
* out and listed in `lastLoadProblems`.
|
|
6177
6161
|
*/
|
|
6178
6162
|
async loadJSONAsync(data, options = {}) {
|
|
6179
|
-
if (data.version !==
|
|
6163
|
+
if (data.version !== _chunkZID226ZGcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
|
|
6180
6164
|
this.loadJSON(data);
|
|
6181
6165
|
return;
|
|
6182
6166
|
}
|
|
6183
6167
|
const problems = [];
|
|
6184
|
-
const assets = await
|
|
6168
|
+
const assets = await _chunkZID226ZGcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
|
|
6185
6169
|
this.loadJSON({ ...data, assets });
|
|
6186
6170
|
this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
|
|
6187
6171
|
}
|
|
@@ -6193,7 +6177,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6193
6177
|
let selection = null;
|
|
6194
6178
|
if (data.selection) {
|
|
6195
6179
|
try {
|
|
6196
|
-
selection = normalizeSelection(
|
|
6180
|
+
selection = normalizeSelection(_chunkZID226ZGcjs.deserializeSelection.call(void 0, data.selection));
|
|
6197
6181
|
} catch (e21) {
|
|
6198
6182
|
selection = null;
|
|
6199
6183
|
}
|
|
@@ -6211,7 +6195,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6211
6195
|
if (isLayered(data)) {
|
|
6212
6196
|
const problems = [];
|
|
6213
6197
|
const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
|
|
6214
|
-
s.layers =
|
|
6198
|
+
s.layers = _chunkZID226ZGcjs.deserializeLayers.call(void 0, data.layers, { assets: _nullishCoalesce(data.assets, () => ( {})), problems, smartContents: Array.isArray(data.smartContents) ? data.smartContents : [], canvas });
|
|
6215
6199
|
this.lastLoadProblems = problems;
|
|
6216
6200
|
s.crop = data.crop ? { ...data.crop } : null;
|
|
6217
6201
|
s.transform = { ...data.transform };
|
|
@@ -6222,7 +6206,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6222
6206
|
const light = data.globalLight;
|
|
6223
6207
|
if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
|
|
6224
6208
|
else delete s.globalLight;
|
|
6225
|
-
const patterns =
|
|
6209
|
+
const patterns = _chunkZID226ZGcjs.deserializePatterns.call(void 0, data.patterns, problems);
|
|
6226
6210
|
if (patterns.length) s.patterns = patterns;
|
|
6227
6211
|
else delete s.patterns;
|
|
6228
6212
|
if (!this.imageElement && typeof data.width === "number" && typeof data.height === "number" && data.width > 0 && data.height > 0) {
|
|
@@ -6249,10 +6233,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
6249
6233
|
serializeState() {
|
|
6250
6234
|
const { width, height } = this.naturalSize;
|
|
6251
6235
|
const view = legacyView(this.stack(), width, height, null);
|
|
6252
|
-
if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access',
|
|
6236
|
+
if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _243 => _243.state, 'access', _244 => _244.patterns, 'optionalAccess', _245 => _245.length])) {
|
|
6253
6237
|
return {
|
|
6254
6238
|
// States without adjustment layers keep schema 1, so they round-trip unchanged.
|
|
6255
|
-
version: _optionalChain([view, 'access',
|
|
6239
|
+
version: _optionalChain([view, 'access', _246 => _246.adjustments, 'access', _247 => _247.layers, 'optionalAccess', _248 => _248.length]) ? 2 : 1,
|
|
6256
6240
|
crop: this.state.crop ? { ...this.state.crop } : null,
|
|
6257
6241
|
transform: { ...this.state.transform },
|
|
6258
6242
|
adjustments: serializeAdjustments(view.adjustments),
|
|
@@ -6263,9 +6247,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
6263
6247
|
annotations: JSON.parse(JSON.stringify(view.annotations))
|
|
6264
6248
|
};
|
|
6265
6249
|
}
|
|
6266
|
-
const { layers, assets, smartContents } =
|
|
6250
|
+
const { layers, assets, smartContents } = _chunkZID226ZGcjs.serializeLayers.call(void 0, this.state.layers);
|
|
6267
6251
|
const out = {
|
|
6268
|
-
version:
|
|
6252
|
+
version: _chunkZID226ZGcjs.LAYERED_SCHEMA_VERSION,
|
|
6269
6253
|
width,
|
|
6270
6254
|
height,
|
|
6271
6255
|
layers,
|
|
@@ -6277,16 +6261,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
6277
6261
|
};
|
|
6278
6262
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
6279
6263
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
6280
|
-
if (_optionalChain([this, 'access',
|
|
6264
|
+
if (_optionalChain([this, 'access', _249 => _249.state, 'access', _250 => _250.patterns, 'optionalAccess', _251 => _251.length])) out.patterns = _chunkZID226ZGcjs.serializePatterns.call(void 0, this.state.patterns);
|
|
6281
6265
|
if (smartContents) out.smartContents = smartContents;
|
|
6282
6266
|
return out;
|
|
6283
6267
|
}
|
|
6284
6268
|
}, _class6);
|
|
6285
6269
|
function serializeAdjustments(adjustments) {
|
|
6286
6270
|
const out = { ...adjustments };
|
|
6287
|
-
if (_optionalChain([out, 'access',
|
|
6271
|
+
if (_optionalChain([out, 'access', _252 => _252.layers, 'optionalAccess', _253 => _253.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
6288
6272
|
else delete out.layers;
|
|
6289
|
-
if (
|
|
6273
|
+
if (_chunkZID226ZGcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkZID226ZGcjs.LEGACY_PROCESS_VERSION) {
|
|
6290
6274
|
delete out.process;
|
|
6291
6275
|
if (!out.tint) delete out.tint;
|
|
6292
6276
|
}
|
|
@@ -6297,7 +6281,7 @@ function withDevelop(layer, partial) {
|
|
|
6297
6281
|
let i = filters.findIndex((f) => f.kind === "develop");
|
|
6298
6282
|
if (i === -1) {
|
|
6299
6283
|
filters.unshift({
|
|
6300
|
-
id: layer.source === "document" ? DEVELOP_FILTER_ID :
|
|
6284
|
+
id: layer.source === "document" ? DEVELOP_FILTER_ID : _chunkZID226ZGcjs.newLayerId.call(void 0, "flt"),
|
|
6301
6285
|
kind: "develop",
|
|
6302
6286
|
enabled: true,
|
|
6303
6287
|
brightness: 0,
|
|
@@ -6306,7 +6290,7 @@ function withDevelop(layer, partial) {
|
|
|
6306
6290
|
exposure: 0,
|
|
6307
6291
|
temperature: 0,
|
|
6308
6292
|
tint: 0,
|
|
6309
|
-
process:
|
|
6293
|
+
process: _chunkZID226ZGcjs.LATEST_PROCESS_VERSION
|
|
6310
6294
|
});
|
|
6311
6295
|
i = 0;
|
|
6312
6296
|
}
|
|
@@ -6315,16 +6299,16 @@ function withDevelop(layer, partial) {
|
|
|
6315
6299
|
const v = partial[k];
|
|
6316
6300
|
if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
|
|
6317
6301
|
}
|
|
6318
|
-
if ("process" in partial) next.process =
|
|
6302
|
+
if ("process" in partial) next.process = _chunkZID226ZGcjs.normalizeProcessVersion.call(void 0, partial.process);
|
|
6319
6303
|
filters[i] = next;
|
|
6320
6304
|
return { ...layer, filters };
|
|
6321
6305
|
}
|
|
6322
6306
|
function withBlur(layer, radius) {
|
|
6323
|
-
const existing = _optionalChain([layer, 'access',
|
|
6307
|
+
const existing = _optionalChain([layer, 'access', _254 => _254.filters, 'optionalAccess', _255 => _255.find, 'call', _256 => _256((f) => f.kind === "blur")]);
|
|
6324
6308
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
6325
6309
|
if (radius > 0) {
|
|
6326
6310
|
filters.push({
|
|
6327
|
-
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
6311
|
+
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _257 => _257.id]), () => ( (layer.source === "document" ? BLUR_FILTER_ID : _chunkZID226ZGcjs.newLayerId.call(void 0, "flt")))),
|
|
6328
6312
|
kind: "blur",
|
|
6329
6313
|
enabled: true,
|
|
6330
6314
|
radius
|
|
@@ -6415,7 +6399,7 @@ function collectStateTiles(layers, into) {
|
|
|
6415
6399
|
if (l.mask && !l.mask.source) _chunkCRMAXIUVcjs.collectTiles.call(void 0, l.mask.surface, into);
|
|
6416
6400
|
if (l.type === "smart") {
|
|
6417
6401
|
_chunkCRMAXIUVcjs.collectTiles.call(void 0, l.surface, into);
|
|
6418
|
-
if (_optionalChain([l, 'access',
|
|
6402
|
+
if (_optionalChain([l, 'access', _258 => _258.smartFilters, 'optionalAccess', _259 => _259.mask])) _chunkCRMAXIUVcjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
|
|
6419
6403
|
if (l.contents.raster) _chunkCRMAXIUVcjs.collectTiles.call(void 0, l.contents.raster, into);
|
|
6420
6404
|
if (l.contents.document) collectStateTiles(l.contents.document.layers, into);
|
|
6421
6405
|
}
|
|
@@ -6426,7 +6410,7 @@ function pixelsOnly(layers) {
|
|
|
6426
6410
|
for (const l of layers) {
|
|
6427
6411
|
if (l.type === "adjustment") continue;
|
|
6428
6412
|
if (l.type === "group") out.push({ ...l, children: pixelsOnly(l.children) });
|
|
6429
|
-
else if (l.type === "pixel" && _optionalChain([l, 'access',
|
|
6413
|
+
else if (l.type === "pixel" && _optionalChain([l, 'access', _260 => _260.filters, 'optionalAccess', _261 => _261.length])) {
|
|
6430
6414
|
const p = { ...l };
|
|
6431
6415
|
delete p.filters;
|
|
6432
6416
|
out.push(p);
|
|
@@ -6469,12 +6453,12 @@ function withoutAnnotations(layers) {
|
|
|
6469
6453
|
function parseColor(value) {
|
|
6470
6454
|
if (Array.isArray(value)) {
|
|
6471
6455
|
if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
|
|
6472
|
-
throw new (0,
|
|
6456
|
+
throw new (0, _chunkZID226ZGcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
|
|
6473
6457
|
}
|
|
6474
6458
|
return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
|
|
6475
6459
|
}
|
|
6476
6460
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
|
|
6477
|
-
if (!m) throw new (0,
|
|
6461
|
+
if (!m) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
|
|
6478
6462
|
let hex = m[1];
|
|
6479
6463
|
if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
|
|
6480
6464
|
const n = (i) => parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -6484,7 +6468,7 @@ function toHex(c) {
|
|
|
6484
6468
|
return "#" + [c[0], c[1], c[2]].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("");
|
|
6485
6469
|
}
|
|
6486
6470
|
function normalizeSelection(mask) {
|
|
6487
|
-
return _optionalChain([mask, 'optionalAccess',
|
|
6471
|
+
return _optionalChain([mask, 'optionalAccess', _262 => _262.bounds]) ? mask : null;
|
|
6488
6472
|
}
|
|
6489
6473
|
function sameSelection(a, b) {
|
|
6490
6474
|
if (a.width !== b.width || a.height !== b.height) return false;
|
|
@@ -6624,7 +6608,7 @@ function loadImageEditorDocument(input) {
|
|
|
6624
6608
|
// Optional: only present when something was selected when saving.
|
|
6625
6609
|
selection: {
|
|
6626
6610
|
parse: (value) => {
|
|
6627
|
-
const mask =
|
|
6611
|
+
const mask = _chunkZID226ZGcjs.deserializeSelection.call(void 0, value);
|
|
6628
6612
|
const v = value;
|
|
6629
6613
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
6630
6614
|
},
|
|
@@ -6645,7 +6629,7 @@ function loadImageEditorDocument(input) {
|
|
|
6645
6629
|
}
|
|
6646
6630
|
const state = { version: 1, ...result.value };
|
|
6647
6631
|
if (isV2) {
|
|
6648
|
-
if (_optionalChain([state, 'access',
|
|
6632
|
+
if (_optionalChain([state, 'access', _263 => _263.adjustments, 'access', _264 => _264.layers, 'optionalAccess', _265 => _265.length])) state.version = 2;
|
|
6649
6633
|
result.report.version = 2;
|
|
6650
6634
|
}
|
|
6651
6635
|
if (state.selection === void 0) delete state.selection;
|
|
@@ -6712,7 +6696,7 @@ function loadLayeredDocument(doc) {
|
|
|
6712
6696
|
},
|
|
6713
6697
|
selection: {
|
|
6714
6698
|
parse: (value) => {
|
|
6715
|
-
const mask =
|
|
6699
|
+
const mask = _chunkZID226ZGcjs.deserializeSelection.call(void 0, value);
|
|
6716
6700
|
const v = value;
|
|
6717
6701
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
6718
6702
|
},
|
|
@@ -6853,7 +6837,7 @@ function findAdjustmentControl(id) {
|
|
|
6853
6837
|
}
|
|
6854
6838
|
function findLayerControl(kind, id) {
|
|
6855
6839
|
if (id === "opacity") return ADJUSTMENT_LAYER_OPACITY_CONTROL;
|
|
6856
|
-
return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access',
|
|
6840
|
+
return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _266 => _266[kind], 'optionalAccess', _267 => _267.find, 'call', _268 => _268((c) => c.id === id)]);
|
|
6857
6841
|
}
|
|
6858
6842
|
function clampControlValue(spec, v) {
|
|
6859
6843
|
if (typeof v !== "number" || !Number.isFinite(v)) return spec.default;
|
|
@@ -6914,6 +6898,150 @@ function readAdjustmentControls(adjustments) {
|
|
|
6914
6898
|
}
|
|
6915
6899
|
return out;
|
|
6916
6900
|
}
|
|
6901
|
+
var IMAGE_FILTER_PRESETS = [
|
|
6902
|
+
{
|
|
6903
|
+
id: "none",
|
|
6904
|
+
label: "Original",
|
|
6905
|
+
adjustments: {
|
|
6906
|
+
brightness: 0,
|
|
6907
|
+
contrast: 0,
|
|
6908
|
+
saturation: 0,
|
|
6909
|
+
exposure: 0,
|
|
6910
|
+
temperature: 0,
|
|
6911
|
+
tint: 0,
|
|
6912
|
+
blur: 0,
|
|
6913
|
+
opacity: 1
|
|
6914
|
+
}
|
|
6915
|
+
},
|
|
6916
|
+
{
|
|
6917
|
+
id: "dramatic",
|
|
6918
|
+
label: "Dramatic",
|
|
6919
|
+
adjustments: {
|
|
6920
|
+
brightness: -5,
|
|
6921
|
+
contrast: 45,
|
|
6922
|
+
saturation: 20,
|
|
6923
|
+
exposure: 5,
|
|
6924
|
+
temperature: -10,
|
|
6925
|
+
tint: 0
|
|
6926
|
+
}
|
|
6927
|
+
},
|
|
6928
|
+
{
|
|
6929
|
+
id: "cyberpunk",
|
|
6930
|
+
label: "Cyberpunk",
|
|
6931
|
+
adjustments: {
|
|
6932
|
+
brightness: 5,
|
|
6933
|
+
contrast: 35,
|
|
6934
|
+
saturation: 55,
|
|
6935
|
+
exposure: 0,
|
|
6936
|
+
temperature: -25,
|
|
6937
|
+
tint: 40
|
|
6938
|
+
}
|
|
6939
|
+
},
|
|
6940
|
+
{
|
|
6941
|
+
id: "vintage",
|
|
6942
|
+
label: "Vintage",
|
|
6943
|
+
adjustments: {
|
|
6944
|
+
brightness: 8,
|
|
6945
|
+
contrast: -15,
|
|
6946
|
+
saturation: -35,
|
|
6947
|
+
exposure: 5,
|
|
6948
|
+
temperature: 35,
|
|
6949
|
+
tint: 10
|
|
6950
|
+
}
|
|
6951
|
+
},
|
|
6952
|
+
{
|
|
6953
|
+
id: "warm",
|
|
6954
|
+
label: "Warm",
|
|
6955
|
+
adjustments: {
|
|
6956
|
+
brightness: 5,
|
|
6957
|
+
contrast: 10,
|
|
6958
|
+
saturation: 15,
|
|
6959
|
+
exposure: 0,
|
|
6960
|
+
temperature: 45,
|
|
6961
|
+
tint: 5
|
|
6962
|
+
}
|
|
6963
|
+
},
|
|
6964
|
+
{
|
|
6965
|
+
id: "cool",
|
|
6966
|
+
label: "Cool",
|
|
6967
|
+
adjustments: {
|
|
6968
|
+
brightness: 0,
|
|
6969
|
+
contrast: 15,
|
|
6970
|
+
saturation: 10,
|
|
6971
|
+
exposure: 0,
|
|
6972
|
+
temperature: -45,
|
|
6973
|
+
tint: -10
|
|
6974
|
+
}
|
|
6975
|
+
},
|
|
6976
|
+
{
|
|
6977
|
+
id: "grayscale",
|
|
6978
|
+
label: "B&W",
|
|
6979
|
+
adjustments: {
|
|
6980
|
+
brightness: 0,
|
|
6981
|
+
contrast: 20,
|
|
6982
|
+
saturation: -100,
|
|
6983
|
+
exposure: 0,
|
|
6984
|
+
temperature: 0,
|
|
6985
|
+
tint: 0
|
|
6986
|
+
}
|
|
6987
|
+
},
|
|
6988
|
+
{
|
|
6989
|
+
id: "noir",
|
|
6990
|
+
label: "Noir",
|
|
6991
|
+
adjustments: {
|
|
6992
|
+
brightness: -15,
|
|
6993
|
+
contrast: 65,
|
|
6994
|
+
saturation: -100,
|
|
6995
|
+
exposure: -5,
|
|
6996
|
+
temperature: 0,
|
|
6997
|
+
tint: 0
|
|
6998
|
+
}
|
|
6999
|
+
},
|
|
7000
|
+
{
|
|
7001
|
+
id: "fade",
|
|
7002
|
+
label: "Fade",
|
|
7003
|
+
adjustments: {
|
|
7004
|
+
brightness: 15,
|
|
7005
|
+
contrast: -25,
|
|
7006
|
+
saturation: -20,
|
|
7007
|
+
exposure: 10,
|
|
7008
|
+
temperature: 10,
|
|
7009
|
+
tint: 0
|
|
7010
|
+
}
|
|
7011
|
+
}
|
|
7012
|
+
];
|
|
7013
|
+
var IMAGE_CROP_PRESETS = [
|
|
7014
|
+
{ id: "free", label: "Free", aspectRatio: null },
|
|
7015
|
+
{ id: "1:1", label: "1:1", aspectRatio: 1 },
|
|
7016
|
+
{ id: "16:9", label: "16:9", aspectRatio: 16 / 9 },
|
|
7017
|
+
{ id: "4:3", label: "4:3", aspectRatio: 4 / 3 },
|
|
7018
|
+
{ id: "4:5", label: "4:5", aspectRatio: 4 / 5 },
|
|
7019
|
+
{ id: "9:16", label: "9:16", aspectRatio: 9 / 16 }
|
|
7020
|
+
];
|
|
7021
|
+
var DEPTH_MASK_CONTROLS = [
|
|
7022
|
+
{
|
|
7023
|
+
id: "near",
|
|
7024
|
+
label: "Near Threshold",
|
|
7025
|
+
section: "effects",
|
|
7026
|
+
min: 0,
|
|
7027
|
+
max: 255,
|
|
7028
|
+
step: 1,
|
|
7029
|
+
default: 0,
|
|
7030
|
+
decimals: 0,
|
|
7031
|
+
track: plain
|
|
7032
|
+
},
|
|
7033
|
+
{
|
|
7034
|
+
id: "far",
|
|
7035
|
+
label: "Far Threshold",
|
|
7036
|
+
section: "effects",
|
|
7037
|
+
min: 0,
|
|
7038
|
+
max: 255,
|
|
7039
|
+
step: 1,
|
|
7040
|
+
default: 255,
|
|
7041
|
+
decimals: 0,
|
|
7042
|
+
track: plain
|
|
7043
|
+
}
|
|
7044
|
+
];
|
|
6917
7045
|
|
|
6918
7046
|
// src/image-editor/selection/tool-options.ts
|
|
6919
7047
|
var SELECTION_TOOLS = [
|
|
@@ -6962,17 +7090,17 @@ function describeSelection(mask) {
|
|
|
6962
7090
|
// src/image-editor/selection-tools.ts
|
|
6963
7091
|
var modeSchema = {
|
|
6964
7092
|
type: "string",
|
|
6965
|
-
enum: [...
|
|
7093
|
+
enum: [..._chunkZID226ZGcjs.SELECTION_MODES],
|
|
6966
7094
|
description: "How the result combines with the current selection (default replace)."
|
|
6967
7095
|
};
|
|
6968
7096
|
var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
|
|
6969
7097
|
function summary(controller) {
|
|
6970
7098
|
const sel = controller.getSelection();
|
|
6971
7099
|
const { width, height } = controller.getState().imageDimensions;
|
|
6972
|
-
const area =
|
|
7100
|
+
const area = _chunkZID226ZGcjs.selectionArea.call(void 0, sel);
|
|
6973
7101
|
return {
|
|
6974
7102
|
empty: !sel,
|
|
6975
|
-
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess',
|
|
7103
|
+
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _269 => _269.bounds]), () => ( null)),
|
|
6976
7104
|
/** Σ coverage in pixels. */
|
|
6977
7105
|
area: Math.round(area),
|
|
6978
7106
|
percent: Math.round(area / Math.max(1, width * height) * 1e4) / 100,
|
|
@@ -7015,7 +7143,7 @@ function createImageSelectionTools(controller) {
|
|
|
7015
7143
|
},
|
|
7016
7144
|
annotations: writeAnnotations("Select a region", true),
|
|
7017
7145
|
handler: ({ shape, x, y, width, height, mode, feather }) => {
|
|
7018
|
-
const opts = { mode:
|
|
7146
|
+
const opts = { mode: _chunkZID226ZGcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
|
|
7019
7147
|
switch (shape) {
|
|
7020
7148
|
case "all":
|
|
7021
7149
|
controller.selectAll();
|
|
@@ -7068,7 +7196,7 @@ function createImageSelectionTools(controller) {
|
|
|
7068
7196
|
annotations: writeAnnotations("Select by colour", true),
|
|
7069
7197
|
handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
|
|
7070
7198
|
const common = {
|
|
7071
|
-
mode:
|
|
7199
|
+
mode: _chunkZID226ZGcjs.parseSelectionMode.call(void 0, mode),
|
|
7072
7200
|
sampleMerged: sampleMerged === true,
|
|
7073
7201
|
sample: _nullishCoalesce(sample, () => ( "composite"))
|
|
7074
7202
|
};
|
|
@@ -7089,7 +7217,7 @@ function createImageSelectionTools(controller) {
|
|
|
7089
7217
|
inputSchema: {
|
|
7090
7218
|
type: "object",
|
|
7091
7219
|
properties: {
|
|
7092
|
-
op: { type: "string", enum: [...
|
|
7220
|
+
op: { type: "string", enum: [..._chunkZID226ZGcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
|
|
7093
7221
|
radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
|
|
7094
7222
|
},
|
|
7095
7223
|
required: ["op", "radius"],
|
|
@@ -7097,7 +7225,7 @@ function createImageSelectionTools(controller) {
|
|
|
7097
7225
|
},
|
|
7098
7226
|
annotations: writeAnnotations("Modify the selection"),
|
|
7099
7227
|
handler: ({ op, radius }) => {
|
|
7100
|
-
if (!
|
|
7228
|
+
if (!_chunkZID226ZGcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
|
|
7101
7229
|
if (!controller.getSelection()) throw new Error("Nothing is selected.");
|
|
7102
7230
|
controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
|
|
7103
7231
|
return summary(controller);
|
|
@@ -7141,7 +7269,7 @@ function createImageSelectionTools(controller) {
|
|
|
7141
7269
|
type: "object",
|
|
7142
7270
|
properties: {
|
|
7143
7271
|
layerId: { type: "string", description: "Existing adjustment layer to mask." },
|
|
7144
|
-
kind: { type: "string", enum:
|
|
7272
|
+
kind: { type: "string", enum: _chunkZID226ZGcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
|
|
7145
7273
|
params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
|
|
7146
7274
|
density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
|
|
7147
7275
|
feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
|
|
@@ -7161,11 +7289,11 @@ function createImageSelectionTools(controller) {
|
|
|
7161
7289
|
if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
|
|
7162
7290
|
controller.applySelectionAsLayerMask(layerId, props);
|
|
7163
7291
|
id = layerId;
|
|
7164
|
-
} else if (
|
|
7292
|
+
} else if (_chunkZID226ZGcjs.isAdjustmentKind.call(void 0, kind)) {
|
|
7165
7293
|
id = controller.addAdjustmentLayer({
|
|
7166
7294
|
kind,
|
|
7167
7295
|
params,
|
|
7168
|
-
mask:
|
|
7296
|
+
mask: _chunkZID226ZGcjs.layerMaskFromSelection.call(void 0, sel, props)
|
|
7169
7297
|
});
|
|
7170
7298
|
} else {
|
|
7171
7299
|
throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
|
|
@@ -7216,7 +7344,7 @@ async function renderImageRegion(controller, request) {
|
|
|
7216
7344
|
if (request.includeOverlays) {
|
|
7217
7345
|
const s = request.scale;
|
|
7218
7346
|
const selection = state.selection;
|
|
7219
|
-
if (_optionalChain([selection, 'optionalAccess',
|
|
7347
|
+
if (_optionalChain([selection, 'optionalAccess', _270 => _270.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
|
|
7220
7348
|
const shade = selectionShade(selection, document);
|
|
7221
7349
|
if (shade) context.drawImage(shade, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
|
|
7222
7350
|
}
|
|
@@ -7241,7 +7369,7 @@ function createImageCaptureSurface(controller) {
|
|
|
7241
7369
|
return {
|
|
7242
7370
|
units: "image pixels",
|
|
7243
7371
|
content: whole,
|
|
7244
|
-
selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access',
|
|
7372
|
+
selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _271 => _271.getState, 'call', _272 => _272(), 'access', _273 => _273.selection, 'optionalAccess', _274 => _274.bounds]), () => ( null)) }),
|
|
7245
7373
|
overlays: "a shade over unselected pixels and the crop box outline",
|
|
7246
7374
|
maxScale: 8,
|
|
7247
7375
|
render: (request) => renderImageRegion(controller, request)
|
|
@@ -7302,11 +7430,11 @@ function createImageEditTools(controller) {
|
|
|
7302
7430
|
const geometry = () => {
|
|
7303
7431
|
const s = controller.getState();
|
|
7304
7432
|
const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
|
|
7305
|
-
const out =
|
|
7433
|
+
const out = _chunkZID226ZGcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
|
|
7306
7434
|
return {
|
|
7307
7435
|
image: { ...s.imageDimensions },
|
|
7308
7436
|
crop: s.crop ? { ...s.crop } : null,
|
|
7309
|
-
rotation:
|
|
7437
|
+
rotation: _chunkZID226ZGcjs.normalizeAngle.call(void 0, s.transform.rotate),
|
|
7310
7438
|
flipH: s.transform.flipH,
|
|
7311
7439
|
flipV: s.transform.flipV,
|
|
7312
7440
|
output: { width: Math.round(out.width), height: Math.round(out.height) }
|
|
@@ -7528,7 +7656,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
7528
7656
|
const out = {
|
|
7529
7657
|
id: layer.id,
|
|
7530
7658
|
type: layer.type,
|
|
7531
|
-
name: layer.name || (layer.type === "adjustment" ?
|
|
7659
|
+
name: layer.name || (layer.type === "adjustment" ? _chunkZID226ZGcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
|
|
7532
7660
|
visible: layer.visible,
|
|
7533
7661
|
opacity: round3(layer.opacity),
|
|
7534
7662
|
blend: layer.blend,
|
|
@@ -7561,8 +7689,8 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
7561
7689
|
out.bounds = boundsOf(layer);
|
|
7562
7690
|
out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
|
|
7563
7691
|
out.contents = { id: layer.contents.id, name: layer.contents.name, kind: layer.contents.kind, width: layer.contents.width, height: layer.contents.height };
|
|
7564
|
-
out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access',
|
|
7565
|
-
out.filterMask = maskSummary(_optionalChain([layer, 'access',
|
|
7692
|
+
out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _275 => _275.smartFilters, 'optionalAccess', _276 => _276.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
|
|
7693
|
+
out.filterMask = maskSummary(_optionalChain([layer, 'access', _277 => _277.smartFilters, 'optionalAccess', _278 => _278.mask]));
|
|
7566
7694
|
break;
|
|
7567
7695
|
}
|
|
7568
7696
|
return out;
|
|
@@ -7590,13 +7718,13 @@ function createImageLayerTools(controller) {
|
|
|
7590
7718
|
if (!loc) return null;
|
|
7591
7719
|
return {
|
|
7592
7720
|
...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
|
|
7593
|
-
parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
7721
|
+
parentId: _nullishCoalesce(_optionalChain([loc, 'access', _279 => _279.parent, 'optionalAccess', _280 => _280.id]), () => ( null)),
|
|
7594
7722
|
index: loc.index
|
|
7595
7723
|
};
|
|
7596
7724
|
};
|
|
7597
7725
|
const exists = (id, what = "layerId") => {
|
|
7598
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
7599
|
-
|
|
7726
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
|
|
7727
|
+
_chunkZID226ZGcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
7600
7728
|
return id;
|
|
7601
7729
|
};
|
|
7602
7730
|
const listLayers = {
|
|
@@ -7632,7 +7760,7 @@ function createImageLayerTools(controller) {
|
|
|
7632
7760
|
handler: ({ layerId, target }) => {
|
|
7633
7761
|
const id = exists(layerId);
|
|
7634
7762
|
const layer = controller.getLayer(id);
|
|
7635
|
-
if (target === "mask" && !layer.mask) throw new (0,
|
|
7763
|
+
if (target === "mask" && !layer.mask) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
7636
7764
|
controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
|
|
7637
7765
|
return { layer: describe(id), activeTarget: controller.getState().activeTarget };
|
|
7638
7766
|
}
|
|
@@ -7657,7 +7785,7 @@ function createImageLayerTools(controller) {
|
|
|
7657
7785
|
},
|
|
7658
7786
|
annotations: { title: "Add a pixel layer", ...WRITE2 },
|
|
7659
7787
|
handler: async (args) => {
|
|
7660
|
-
if (args.color !== void 0 && args.image !== void 0) throw new (0,
|
|
7788
|
+
if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give color or image, not both.");
|
|
7661
7789
|
for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
|
|
7662
7790
|
const init = {
|
|
7663
7791
|
name: args.name,
|
|
@@ -7747,7 +7875,7 @@ function createImageLayerTools(controller) {
|
|
|
7747
7875
|
const id = exists(args.layerId);
|
|
7748
7876
|
const props = {};
|
|
7749
7877
|
for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
|
|
7750
|
-
if (!Object.keys(props).length) throw new (0,
|
|
7878
|
+
if (!Object.keys(props).length) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give at least one property to change.");
|
|
7751
7879
|
controller.setLayerProperties(id, props);
|
|
7752
7880
|
return { layer: describe(id) };
|
|
7753
7881
|
}
|
|
@@ -7841,8 +7969,8 @@ function createImageLayerTools(controller) {
|
|
|
7841
7969
|
annotations: { title: "Move a layer's pixels", ...WRITE2 },
|
|
7842
7970
|
handler: ({ layerId, x, y, dx, dy }) => {
|
|
7843
7971
|
const id = exists(layerId);
|
|
7844
|
-
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0,
|
|
7845
|
-
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0,
|
|
7972
|
+
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give x and y, or dx and dy.");
|
|
7973
|
+
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
|
|
7846
7974
|
return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
|
|
7847
7975
|
}
|
|
7848
7976
|
};
|
|
@@ -7914,7 +8042,7 @@ function createImageLayerTools(controller) {
|
|
|
7914
8042
|
annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
|
|
7915
8043
|
handler: ({ layerId, density, feather, enabled, linked }) => {
|
|
7916
8044
|
const id = exists(layerId);
|
|
7917
|
-
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0,
|
|
8045
|
+
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give density, feather, enabled or linked.");
|
|
7918
8046
|
const mask = controller.setLayerMaskProps(id, {
|
|
7919
8047
|
density,
|
|
7920
8048
|
feather,
|
|
@@ -7997,7 +8125,7 @@ function createImageLayerTools(controller) {
|
|
|
7997
8125
|
handler: (args) => {
|
|
7998
8126
|
const id = exists(args.layerId);
|
|
7999
8127
|
const changes = filterValues(args);
|
|
8000
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
8128
|
+
if (!Object.keys(changes).length) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give at least one value to change.");
|
|
8001
8129
|
return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
|
|
8002
8130
|
}
|
|
8003
8131
|
};
|
|
@@ -8261,8 +8389,8 @@ function describeLayerEffects(effects) {
|
|
|
8261
8389
|
}
|
|
8262
8390
|
function createImageEffectTools(controller) {
|
|
8263
8391
|
const layerArg = (id) => {
|
|
8264
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
8265
|
-
|
|
8392
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
|
|
8393
|
+
_chunkZID226ZGcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
8266
8394
|
return id;
|
|
8267
8395
|
};
|
|
8268
8396
|
const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
|
|
@@ -8293,7 +8421,7 @@ function createImageEffectTools(controller) {
|
|
|
8293
8421
|
annotations: { title: "Add a layer effect", ...WRITE3 },
|
|
8294
8422
|
handler: ({ layerId, kind, settings, index }) => {
|
|
8295
8423
|
const id = layerArg(layerId);
|
|
8296
|
-
if (!_chunkWSTEXEKDcjs.isLayerEffectKind.call(void 0, kind)) throw new (0,
|
|
8424
|
+
if (!_chunkWSTEXEKDcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`kind must be one of ${_chunkWSTEXEKDcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
|
|
8297
8425
|
const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
|
|
8298
8426
|
return result(id, { effectId: effect.id });
|
|
8299
8427
|
}
|
|
@@ -8313,7 +8441,7 @@ function createImageEffectTools(controller) {
|
|
|
8313
8441
|
handler: ({ layerId, effectId, settings }) => {
|
|
8314
8442
|
const id = layerArg(layerId);
|
|
8315
8443
|
const changes = _nullishCoalesce(settings, () => ( {}));
|
|
8316
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
8444
|
+
if (!Object.keys(changes).length) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give at least one setting to change.");
|
|
8317
8445
|
controller.updateLayerEffect(id, effectId, changes);
|
|
8318
8446
|
return result(id);
|
|
8319
8447
|
}
|
|
@@ -8365,7 +8493,7 @@ function createImageEffectTools(controller) {
|
|
|
8365
8493
|
},
|
|
8366
8494
|
annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
|
|
8367
8495
|
handler: ({ angle, altitude }) => {
|
|
8368
|
-
if (angle === void 0 && altitude === void 0) throw new (0,
|
|
8496
|
+
if (angle === void 0 && altitude === void 0) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give angle, altitude or both.");
|
|
8369
8497
|
const next = {};
|
|
8370
8498
|
if (angle !== void 0) next.angle = angle;
|
|
8371
8499
|
if (altitude !== void 0) next.altitude = altitude;
|
|
@@ -8472,7 +8600,7 @@ var PaintGesture = (_class7 = class {
|
|
|
8472
8600
|
const layer = this.controller.getActiveLayer();
|
|
8473
8601
|
if (!layer) throw new Error("Select a layer to move in the Layers panel.");
|
|
8474
8602
|
if (layer.type !== "pixel") throw new Error(`Only pixel layers move; "${layer.name}" is a ${layer.type} layer.`);
|
|
8475
|
-
if (_optionalChain([layer, 'access',
|
|
8603
|
+
if (_optionalChain([layer, 'access', _281 => _281.locks, 'optionalAccess', _282 => _282.all]) || _optionalChain([layer, 'access', _283 => _283.locks, 'optionalAccess', _284 => _284.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
|
|
8476
8604
|
this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin: { ...layer.offset }, moved: false };
|
|
8477
8605
|
return null;
|
|
8478
8606
|
}
|
|
@@ -8521,7 +8649,7 @@ var PaintGesture = (_class7 = class {
|
|
|
8521
8649
|
this.move = null;
|
|
8522
8650
|
}
|
|
8523
8651
|
cancel() {
|
|
8524
|
-
_optionalChain([this, 'access',
|
|
8652
|
+
_optionalChain([this, 'access', _285 => _285.stroke, 'optionalAccess', _286 => _286.cancel, 'call', _287 => _287()]);
|
|
8525
8653
|
this.stroke = null;
|
|
8526
8654
|
this.move = null;
|
|
8527
8655
|
}
|
|
@@ -8619,7 +8747,7 @@ function createImagePaintTools(controller) {
|
|
|
8619
8747
|
annotations: { title: "Paint a brush stroke", ...WRITE4 },
|
|
8620
8748
|
handler: (args) => {
|
|
8621
8749
|
const tool = args.tool;
|
|
8622
|
-
if (args.mixer !== void 0 && tool !== "mixer") throw new (0,
|
|
8750
|
+
if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkZID226ZGcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
|
|
8623
8751
|
const result = controller.paintStroke({
|
|
8624
8752
|
tool,
|
|
8625
8753
|
points: args.points,
|
|
@@ -8718,11 +8846,11 @@ var DATA = {
|
|
|
8718
8846
|
description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
|
|
8719
8847
|
};
|
|
8720
8848
|
function psdBytesFromBase64(data) {
|
|
8721
|
-
if (typeof data !== "string" || !data.trim()) throw new (0,
|
|
8849
|
+
if (typeof data !== "string" || !data.trim()) throw new (0, _chunkZID226ZGcjs.PsdError)("data is required: the PSD file as base64.");
|
|
8722
8850
|
const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
|
|
8723
|
-
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0,
|
|
8851
|
+
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkZID226ZGcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
|
|
8724
8852
|
const bytes = _chunkWSTEXEKDcjs.base64ToBytes.call(void 0, body);
|
|
8725
|
-
if (bytes.length < 26) throw new (0,
|
|
8853
|
+
if (bytes.length < 26) throw new (0, _chunkZID226ZGcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
|
|
8726
8854
|
return bytes;
|
|
8727
8855
|
}
|
|
8728
8856
|
function createImagePsdTools(controller) {
|
|
@@ -8733,7 +8861,7 @@ function createImagePsdTools(controller) {
|
|
|
8733
8861
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
8734
8862
|
annotations: { title: "Inspect a PSD", ...READ5 },
|
|
8735
8863
|
handler: ({ data }) => {
|
|
8736
|
-
const res =
|
|
8864
|
+
const res = _chunkZID226ZGcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
|
|
8737
8865
|
return {
|
|
8738
8866
|
width: res.width,
|
|
8739
8867
|
height: res.height,
|
|
@@ -8747,7 +8875,7 @@ function createImagePsdTools(controller) {
|
|
|
8747
8875
|
const open = {
|
|
8748
8876
|
name: "import_psd",
|
|
8749
8877
|
title: "Open a PSD as the document",
|
|
8750
|
-
description: "Opens a PSD / PSB as the document, replacing the current layers, crop and rotation (one undo step; undo brings the previous document back). Pixel, group and adjustment layers, masks, blend modes, opacity, fill, clipping, visibility, locks, layer effects (with the patterns and global light of the file) map directly;
|
|
8878
|
+
description: "Opens a PSD / PSB as the document, replacing the current layers, crop and rotation (one undo step; undo brings the previous document back). Pixel, group and adjustment layers, masks, blend modes, opacity, fill, clipping, visibility, locks, layer effects (with the patterns and global light of the file) map directly; smart objects come in as smart objects (embedded contents, placement and warp, smart filters: Box Blur is drawn, other Photoshop filters are kept but not drawn, filter mask; linked contents as their stored pixels); type, fill and shape layers come in as their pixels; unsupported adjustments are left out. Returns the new layer tree with ids, the size and the warnings (each names the affected layers).",
|
|
8751
8879
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
8752
8880
|
annotations: { title: "Open a PSD as the document", ...DESTRUCTIVE4 },
|
|
8753
8881
|
handler: ({ data }) => {
|
|
@@ -8766,7 +8894,7 @@ function createImagePsdTools(controller) {
|
|
|
8766
8894
|
const save = {
|
|
8767
8895
|
name: "export_psd",
|
|
8768
8896
|
title: "Export the document as a PSD",
|
|
8769
|
-
description: "Writes the document as an 8-bit RGB PSD (a PSB above 30000 px) with real layers, groups, adjustment layers, masks and layer effects (an effects block opened from a PSD is written back unchanged while its effects are; the patterns effects use are embedded), in the source frame (crop and rotation are not applied). Layer filters and depth masks are baked, annotation layers are rasterized (in a browser; elsewhere left out), and the merged image is the editor's composite. Changes nothing. Returns the file as base64, its size in bytes, whether it is a PSB, and warnings for everything that was changed or left out.",
|
|
8897
|
+
description: "Writes the document as an 8-bit RGB PSD (a PSB above 30000 px) with real layers, groups, adjustment layers, masks and layer effects (an effects block opened from a PSD is written back unchanged while its effects are; the patterns effects use are embedded), in the source frame (crop and rotation are not applied). Smart objects are written as Photoshop smart objects (contents embedded once per linked set, placement, warp, smart filters and filter mask; a Develop smart filter has no Photoshop filter and is left out of the list). Layer filters and depth masks are baked, annotation layers are rasterized (in a browser; elsewhere left out), and the merged image is the editor's composite. Changes nothing. Returns the file as base64, its size in bytes, whether it is a PSB, and warnings for everything that was changed or left out.",
|
|
8770
8898
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
8771
8899
|
annotations: { title: "Export the document as a PSD", ...READ5 },
|
|
8772
8900
|
handler: async () => {
|
|
@@ -8820,7 +8948,7 @@ var GEOMETRY = {
|
|
|
8820
8948
|
dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
|
|
8821
8949
|
reference: {
|
|
8822
8950
|
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}.",
|
|
8823
|
-
anyOf: [{ type: "string", enum:
|
|
8951
|
+
anyOf: [{ type: "string", enum: _chunkZID226ZGcjs.TRANSFORM_ANCHORS }, POINT]
|
|
8824
8952
|
},
|
|
8825
8953
|
matrix: {
|
|
8826
8954
|
type: "array",
|
|
@@ -8841,14 +8969,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
|
|
|
8841
8969
|
function geometryFrom(args) {
|
|
8842
8970
|
const numeric = NUMERIC.filter((k) => args[k] !== void 0);
|
|
8843
8971
|
const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
|
|
8844
|
-
if (ways === 0) throw new (0,
|
|
8845
|
-
if (ways > 1) throw new (0,
|
|
8972
|
+
if (ways === 0) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
|
|
8973
|
+
if (ways > 1) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
|
|
8846
8974
|
if (args.matrix !== void 0) return { matrix: args.matrix };
|
|
8847
8975
|
if (args.corners !== void 0) return { corners: args.corners };
|
|
8848
8976
|
const params = {};
|
|
8849
8977
|
for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
|
|
8850
|
-
if (params.scaleX === 0 || params.scaleY === 0) throw new (0,
|
|
8851
|
-
if (typeof params.reference === "string" && !
|
|
8978
|
+
if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
|
|
8979
|
+
if (typeof params.reference === "string" && !_chunkZID226ZGcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkZID226ZGcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
|
|
8852
8980
|
return { params };
|
|
8853
8981
|
}
|
|
8854
8982
|
function targetFrom(args) {
|
|
@@ -8897,7 +9025,7 @@ function createImageTransformTools(controller) {
|
|
|
8897
9025
|
moved: [...s.moves],
|
|
8898
9026
|
frame: { ...s.box },
|
|
8899
9027
|
corners: s.startGeometry.corners.map(roundPoint),
|
|
8900
|
-
center: roundPoint(
|
|
9028
|
+
center: roundPoint(_chunkZID226ZGcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
|
|
8901
9029
|
};
|
|
8902
9030
|
if (s.smartObject) out.smartObject = true;
|
|
8903
9031
|
s.cancel();
|
|
@@ -8952,11 +9080,11 @@ function createImageTransformTools(controller) {
|
|
|
8952
9080
|
annotations: { title: "Warp a layer", ...WRITE5 },
|
|
8953
9081
|
handler: (args) => {
|
|
8954
9082
|
const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
|
|
8955
|
-
if (hasPreset && args.mesh !== void 0) throw new (0,
|
|
8956
|
-
if (!hasPreset && args.mesh === void 0) throw new (0,
|
|
9083
|
+
if (hasPreset && args.mesh !== void 0) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
|
|
9084
|
+
if (!hasPreset && args.mesh === void 0) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give a preset style or a mesh.");
|
|
8957
9085
|
let warp;
|
|
8958
9086
|
if (hasPreset) {
|
|
8959
|
-
if (args.style === void 0) throw new (0,
|
|
9087
|
+
if (args.style === void 0) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkDWGZUSEScjs.WARP_STYLES.join(", ")}.`);
|
|
8960
9088
|
warp = {
|
|
8961
9089
|
style: args.style,
|
|
8962
9090
|
bend: _nullishCoalesce(args.bend, () => ( 50)),
|
|
@@ -8967,7 +9095,7 @@ function createImageTransformTools(controller) {
|
|
|
8967
9095
|
} else {
|
|
8968
9096
|
const m = args.mesh;
|
|
8969
9097
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
8970
|
-
if (m.points.length !== want) throw new (0,
|
|
9098
|
+
if (m.points.length !== want) throw new (0, _chunkZID226ZGcjs.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}.`);
|
|
8971
9099
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
8972
9100
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
8973
9101
|
}
|
|
@@ -9062,13 +9190,13 @@ function settingsFrom(args) {
|
|
|
9062
9190
|
return out;
|
|
9063
9191
|
}
|
|
9064
9192
|
function imageArg(image) {
|
|
9065
|
-
if (typeof image !== "string" || !image.trim()) throw new (0,
|
|
9193
|
+
if (typeof image !== "string" || !image.trim()) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
|
|
9066
9194
|
return image.trim();
|
|
9067
9195
|
}
|
|
9068
9196
|
function createImageSmartObjectTools(controller) {
|
|
9069
9197
|
const smartId = (id) => {
|
|
9070
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
9071
|
-
|
|
9198
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
|
|
9199
|
+
_chunkZID226ZGcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
|
|
9072
9200
|
return id;
|
|
9073
9201
|
};
|
|
9074
9202
|
const info = (id) => {
|
|
@@ -9081,7 +9209,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9081
9209
|
const layerSummary = (id) => {
|
|
9082
9210
|
const s = controller.getState();
|
|
9083
9211
|
const loc = _chunkWSTEXEKDcjs.findLayer.call(void 0, s.layers, id);
|
|
9084
|
-
return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
9212
|
+
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;
|
|
9085
9213
|
};
|
|
9086
9214
|
const getSmart = {
|
|
9087
9215
|
name: "get_smart_object",
|
|
@@ -9105,7 +9233,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9105
9233
|
},
|
|
9106
9234
|
annotations: { title: "Convert to Smart Object", ...WRITE6 },
|
|
9107
9235
|
handler: ({ layerIds, name }) => {
|
|
9108
|
-
for (const id2 of _nullishCoalesce(layerIds, () => ( [])))
|
|
9236
|
+
for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkZID226ZGcjs.requireLayer.call(void 0, controller.getLayers(), id2);
|
|
9109
9237
|
const id = controller.convertToSmartObject(layerIds, { name });
|
|
9110
9238
|
return { layer: layerSummary(id), smartObject: info(id) };
|
|
9111
9239
|
}
|
|
@@ -9178,12 +9306,12 @@ function createImageSmartObjectTools(controller) {
|
|
|
9178
9306
|
else if (w) {
|
|
9179
9307
|
const m = w;
|
|
9180
9308
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
9181
|
-
if (m.points.length !== want) throw new (0,
|
|
9309
|
+
if (m.points.length !== want) throw new (0, _chunkZID226ZGcjs.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}.`);
|
|
9182
9310
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
9183
9311
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
9184
9312
|
}
|
|
9185
9313
|
const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
|
|
9186
|
-
if (!keys.some((k) => args[k] !== void 0)) throw new (0,
|
|
9314
|
+
if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkZID226ZGcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
|
|
9187
9315
|
const res = controller.setSmartObjectTransform(id, {
|
|
9188
9316
|
corners: args.corners,
|
|
9189
9317
|
matrix: args.matrix,
|
|
@@ -9308,7 +9436,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9308
9436
|
handler: (args) => {
|
|
9309
9437
|
const id = smartId(args.layerId);
|
|
9310
9438
|
const changes = settingsFrom(args);
|
|
9311
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
9439
|
+
if (!Object.keys(changes).length) throw new (0, _chunkZID226ZGcjs.LayerOperationError)("Give at least one value to change.");
|
|
9312
9440
|
const filter = controller.updateSmartFilter(id, args.filterId, changes);
|
|
9313
9441
|
return { layerId: id, filter, smartFilters: info(id).smartFilters };
|
|
9314
9442
|
}
|
|
@@ -9392,7 +9520,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9392
9520
|
var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
|
|
9393
9521
|
function adjustmentsSummary(adjustments) {
|
|
9394
9522
|
return {
|
|
9395
|
-
process:
|
|
9523
|
+
process: _chunkZID226ZGcjs.normalizeProcessVersion.call(void 0, adjustments.process),
|
|
9396
9524
|
values: readAdjustmentControls(adjustments),
|
|
9397
9525
|
layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
|
|
9398
9526
|
};
|
|
@@ -9435,7 +9563,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
9435
9563
|
default: def,
|
|
9436
9564
|
...requiresProcess ? { requiresProcess } : {}
|
|
9437
9565
|
})),
|
|
9438
|
-
layerKinds:
|
|
9566
|
+
layerKinds: _chunkZID226ZGcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
|
|
9439
9567
|
kind,
|
|
9440
9568
|
label,
|
|
9441
9569
|
controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
|
|
@@ -9521,7 +9649,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
9521
9649
|
const result = { applied, clamped };
|
|
9522
9650
|
if (typeof label === "string" && label) result.label = label;
|
|
9523
9651
|
const notes = [];
|
|
9524
|
-
if ("tint" in applied &&
|
|
9652
|
+
if ("tint" in applied && _chunkZID226ZGcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
|
|
9525
9653
|
notes.push("Tint has no effect on process 1 edits.");
|
|
9526
9654
|
}
|
|
9527
9655
|
if (notes.length) result.notes = notes;
|
|
@@ -9531,11 +9659,11 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
9531
9659
|
const addLayer = {
|
|
9532
9660
|
name: "add_adjustment_layer",
|
|
9533
9661
|
title: "Add an adjustment layer",
|
|
9534
|
-
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " +
|
|
9662
|
+
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkZID226ZGcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
|
|
9535
9663
|
inputSchema: {
|
|
9536
9664
|
type: "object",
|
|
9537
9665
|
properties: {
|
|
9538
|
-
kind: { type: "string", enum:
|
|
9666
|
+
kind: { type: "string", enum: _chunkZID226ZGcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
|
|
9539
9667
|
params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
|
|
9540
9668
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
|
|
9541
9669
|
blend: { type: "string", enum: _chunkCRMAXIUVcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
|
|
@@ -9554,13 +9682,13 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
9554
9682
|
openWorldHint: false
|
|
9555
9683
|
},
|
|
9556
9684
|
handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
|
|
9557
|
-
if (!
|
|
9685
|
+
if (!_chunkZID226ZGcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
|
|
9558
9686
|
if (blend !== void 0 && !_chunkCRMAXIUVcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
9559
9687
|
if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
|
|
9560
9688
|
for (const ref of [aboveId, parentId]) {
|
|
9561
9689
|
if (ref !== void 0 && !controller.getLayer(ref)) throw new Error(`Unknown layer "${ref}". Call list_layers for ids.`);
|
|
9562
9690
|
}
|
|
9563
|
-
if (parentId !== void 0 && _optionalChain([controller, 'access',
|
|
9691
|
+
if (parentId !== void 0 && _optionalChain([controller, 'access', _290 => _290.getLayer, 'call', _291 => _291(parentId), 'optionalAccess', _292 => _292.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
|
|
9564
9692
|
const id = controller.addAdjustmentLayer({ kind, params, opacity, blend, name, aboveId, parentId });
|
|
9565
9693
|
const layer = controller.getAdjustmentLayer(id);
|
|
9566
9694
|
return { layer: JSON.parse(JSON.stringify(layer)), index: controller.getAdjustmentLayers().findIndex((l) => l.id === id) };
|
|
@@ -9644,7 +9772,7 @@ function boxToCurvePoint(x, y, width, height) {
|
|
|
9644
9772
|
return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
|
|
9645
9773
|
}
|
|
9646
9774
|
function curveSvgPath(points, width, height, samples = 64) {
|
|
9647
|
-
const lut =
|
|
9775
|
+
const lut = _chunkZID226ZGcjs.curveLutFromLevels.call(void 0, points);
|
|
9648
9776
|
const n = lut.length - 1;
|
|
9649
9777
|
let d = "";
|
|
9650
9778
|
for (let i = 0; i <= samples; i++) {
|
|
@@ -9952,7 +10080,7 @@ function layerPanelRows(layers, activeId) {
|
|
|
9952
10080
|
}
|
|
9953
10081
|
function layerLabel(layer) {
|
|
9954
10082
|
if (layer.name) return layer.name;
|
|
9955
|
-
if (layer.type === "adjustment") return
|
|
10083
|
+
if (layer.type === "adjustment") return _chunkZID226ZGcjs.adjustmentKindLabel.call(void 0, layer.kind);
|
|
9956
10084
|
return layer.type === "group" ? "Group" : "Layer";
|
|
9957
10085
|
}
|
|
9958
10086
|
function layerBadge(layer) {
|
|
@@ -9987,36 +10115,36 @@ function layerMenu(controller) {
|
|
|
9987
10115
|
const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
|
|
9988
10116
|
const below = loc ? siblings[loc.index - 1] : void 0;
|
|
9989
10117
|
const hasSel = controller.hasSelection;
|
|
9990
|
-
const isPixel = _optionalChain([active, 'optionalAccess',
|
|
10118
|
+
const isPixel = _optionalChain([active, 'optionalAccess', _293 => _293.type]) === "pixel";
|
|
9991
10119
|
return [
|
|
9992
10120
|
{ action: "new-layer", label: "New Layer", enabled: true },
|
|
9993
10121
|
{ action: "new-group", label: "New Group", enabled: true },
|
|
9994
10122
|
{ action: "duplicate", label: "Duplicate Layer", enabled: Boolean(active) },
|
|
9995
10123
|
{ action: "delete", label: "Delete Layer", enabled: Boolean(active) },
|
|
9996
10124
|
{ action: "group-selected", label: "Group Layer", enabled: Boolean(active) },
|
|
9997
|
-
{ action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess',
|
|
9998
|
-
{ action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess',
|
|
10125
|
+
{ action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _294 => _294.type]) === "group" },
|
|
10126
|
+
{ action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _295 => _295.visible]) && _optionalChain([below, 'optionalAccess', _296 => _296.type]) === "pixel") },
|
|
9999
10127
|
{ action: "merge-visible", label: "Merge Visible", enabled: s.layers.some((l) => l.visible) },
|
|
10000
10128
|
{ action: "flatten", label: "Flatten Image", enabled: s.layers.length > 0 },
|
|
10001
10129
|
{ action: "via-copy", label: "Layer via Copy", enabled: isPixel && hasSel },
|
|
10002
10130
|
{ action: "via-cut", label: "Layer via Cut", enabled: isPixel && hasSel },
|
|
10003
10131
|
{ action: "add-mask", label: "Add Layer Mask", enabled: Boolean(active) },
|
|
10004
10132
|
{ action: "add-mask-selection", label: "Add Mask from Selection", enabled: Boolean(active) && hasSel },
|
|
10005
|
-
{ action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess',
|
|
10006
|
-
{ action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess',
|
|
10007
|
-
{ action: "toggle-mask", label: _optionalChain([active, 'optionalAccess',
|
|
10008
|
-
{ action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess',
|
|
10009
|
-
{ action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess',
|
|
10133
|
+
{ action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _297 => _297.mask])) },
|
|
10134
|
+
{ action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _298 => _298.mask])) },
|
|
10135
|
+
{ action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _299 => _299.mask, 'optionalAccess', _300 => _300.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _301 => _301.mask])) },
|
|
10136
|
+
{ action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _302 => _302.mask, 'optionalAccess', _303 => _303.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _304 => _304.mask]) && !active.mask.source) },
|
|
10137
|
+
{ action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _305 => _305.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _306 => _306.type]) === "smart" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _307 => _307.type]) === "pixel" && _optionalChain([active, 'access', _308 => _308.filters, 'optionalAccess', _309 => _309.length])) },
|
|
10010
10138
|
{ action: "convert-smart", label: "Convert to Smart Object", enabled: Boolean(active && active.type !== "annotation") },
|
|
10011
|
-
{ action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess',
|
|
10012
|
-
{ action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess',
|
|
10013
|
-
{ action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess',
|
|
10014
|
-
{ action: "toggle-clip", label: _optionalChain([active, 'optionalAccess',
|
|
10139
|
+
{ action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _310 => _310.type]) === "smart" },
|
|
10140
|
+
{ action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _311 => _311.type]) === "smart" },
|
|
10141
|
+
{ action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _312 => _312.type]) === "smart" && !_optionalChain([active, 'access', _313 => _313.smartFilters, 'optionalAccess', _314 => _314.mask]) },
|
|
10142
|
+
{ action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _315 => _315.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
|
|
10015
10143
|
];
|
|
10016
10144
|
}
|
|
10017
10145
|
async function runLayerMenuAction(controller, action) {
|
|
10018
10146
|
const active = controller.getActiveLayer();
|
|
10019
|
-
const id = _optionalChain([active, 'optionalAccess',
|
|
10147
|
+
const id = _optionalChain([active, 'optionalAccess', _316 => _316.id]);
|
|
10020
10148
|
try {
|
|
10021
10149
|
switch (action) {
|
|
10022
10150
|
case "new-layer":
|
|
@@ -10063,10 +10191,10 @@ async function runLayerMenuAction(controller, action) {
|
|
|
10063
10191
|
if (id) controller.removeLayerMask(id);
|
|
10064
10192
|
break;
|
|
10065
10193
|
case "toggle-mask":
|
|
10066
|
-
if (id && _optionalChain([active, 'optionalAccess',
|
|
10194
|
+
if (id && _optionalChain([active, 'optionalAccess', _317 => _317.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
|
|
10067
10195
|
break;
|
|
10068
10196
|
case "toggle-mask-link":
|
|
10069
|
-
if (id && _optionalChain([active, 'optionalAccess',
|
|
10197
|
+
if (id && _optionalChain([active, 'optionalAccess', _318 => _318.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
|
|
10070
10198
|
break;
|
|
10071
10199
|
case "rasterize":
|
|
10072
10200
|
if (id) await controller.rasterizeLayer(id);
|
|
@@ -10084,7 +10212,7 @@ async function runLayerMenuAction(controller, action) {
|
|
|
10084
10212
|
if (id) controller.setSmartFilterMask(id, "reveal-all");
|
|
10085
10213
|
break;
|
|
10086
10214
|
case "toggle-clip":
|
|
10087
|
-
if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess',
|
|
10215
|
+
if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _319 => _319.clipped]) });
|
|
10088
10216
|
break;
|
|
10089
10217
|
}
|
|
10090
10218
|
return null;
|
|
@@ -10094,7 +10222,7 @@ async function runLayerMenuAction(controller, action) {
|
|
|
10094
10222
|
}
|
|
10095
10223
|
function smartFilterRows(layer) {
|
|
10096
10224
|
if (layer.type !== "smart") return [];
|
|
10097
|
-
const list = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
10225
|
+
const list = _nullishCoalesce(_optionalChain([layer, 'access', _320 => _320.smartFilters, 'optionalAccess', _321 => _321.filters]), () => ( []));
|
|
10098
10226
|
const rows = list.map((f, index) => ({
|
|
10099
10227
|
filter: f,
|
|
10100
10228
|
index,
|
|
@@ -10103,6 +10231,49 @@ function smartFilterRows(layer) {
|
|
|
10103
10231
|
}));
|
|
10104
10232
|
return rows.reverse();
|
|
10105
10233
|
}
|
|
10234
|
+
function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
|
|
10235
|
+
const state = controller.getState();
|
|
10236
|
+
const ctrlLayers = controller.getLayers();
|
|
10237
|
+
if (!ctrlLayers || ctrlLayers.length === 0) return [];
|
|
10238
|
+
const serialized = controller.toJSON();
|
|
10239
|
+
const assets = _nullishCoalesce(serialized.assets, () => ( {}));
|
|
10240
|
+
const allSerializedLayers = [];
|
|
10241
|
+
const collectSerialized = (list) => {
|
|
10242
|
+
for (const sl of list) {
|
|
10243
|
+
allSerializedLayers.push(sl);
|
|
10244
|
+
if (sl.children && Array.isArray(sl.children)) {
|
|
10245
|
+
collectSerialized(sl.children);
|
|
10246
|
+
}
|
|
10247
|
+
}
|
|
10248
|
+
};
|
|
10249
|
+
collectSerialized(_nullishCoalesce(serialized.layers, () => ( [])));
|
|
10250
|
+
const sLayerMap = new Map(allSerializedLayers.map((sl) => [sl.id, sl]));
|
|
10251
|
+
const imgW = _optionalChain([state, 'access', _322 => _322.imageDimensions, 'optionalAccess', _323 => _323.width]) || 1;
|
|
10252
|
+
const imgH = _optionalChain([state, 'access', _324 => _324.imageDimensions, 'optionalAccess', _325 => _325.height]) || 1;
|
|
10253
|
+
return ctrlLayers.map((l) => {
|
|
10254
|
+
const bounds = controller.getLayerBounds(l.id) || {
|
|
10255
|
+
x: 0,
|
|
10256
|
+
y: 0,
|
|
10257
|
+
width: imgW,
|
|
10258
|
+
height: imgH
|
|
10259
|
+
};
|
|
10260
|
+
const sLayer = sLayerMap.get(l.id);
|
|
10261
|
+
const assetKey = _optionalChain([sLayer, 'optionalAccess', _326 => _326.asset]);
|
|
10262
|
+
const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _327 => _327.source]) === "document" ? fallbackImageUrl : "");
|
|
10263
|
+
return {
|
|
10264
|
+
id: l.id,
|
|
10265
|
+
name: l.name || "Untitled Layer",
|
|
10266
|
+
imageUrl: layerDataUrl || fallbackImageUrl,
|
|
10267
|
+
thumbnailUrl: layerDataUrl || void 0,
|
|
10268
|
+
visible: l.visible !== false,
|
|
10269
|
+
opacity: _nullishCoalesce(l.opacity, () => ( 1)),
|
|
10270
|
+
x: imgW ? bounds.x / imgW : 0,
|
|
10271
|
+
y: imgH ? bounds.y / imgH : 0,
|
|
10272
|
+
width: imgW ? bounds.width / imgW : 1,
|
|
10273
|
+
height: imgH ? bounds.height / imgH : 1
|
|
10274
|
+
};
|
|
10275
|
+
});
|
|
10276
|
+
}
|
|
10106
10277
|
|
|
10107
10278
|
// src/image-editor/layers/effects-ui.ts
|
|
10108
10279
|
function layerEffectsPanel(layer) {
|
|
@@ -10110,18 +10281,18 @@ function layerEffectsPanel(layer) {
|
|
|
10110
10281
|
if (!layer) return { ...empty, available: false, reason: "Select a layer to add effects." };
|
|
10111
10282
|
if (layer.type === "adjustment") return { ...empty, available: false, reason: "Adjustment layers cannot have effects." };
|
|
10112
10283
|
const fx = layer.effects;
|
|
10113
|
-
const readOnly = Boolean(_optionalChain([layer, 'access',
|
|
10284
|
+
const readOnly = Boolean(_optionalChain([layer, 'access', _328 => _328.locks, 'optionalAccess', _329 => _329.all]));
|
|
10114
10285
|
return {
|
|
10115
10286
|
available: true,
|
|
10116
10287
|
readOnly,
|
|
10117
10288
|
reason: readOnly ? "The layer is locked; unlock it to change its effects." : void 0,
|
|
10118
|
-
enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
10119
|
-
scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
10120
|
-
rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
10289
|
+
enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _330 => _330.enabled]), () => ( true)),
|
|
10290
|
+
scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _331 => _331.scale]), () => ( 1)),
|
|
10291
|
+
rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _332 => _332.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkWSTEXEKDcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
|
|
10121
10292
|
};
|
|
10122
10293
|
}
|
|
10123
10294
|
function layerEffectsBadge(layer) {
|
|
10124
|
-
if (!_optionalChain([layer, 'access',
|
|
10295
|
+
if (!_optionalChain([layer, 'access', _333 => _333.effects, 'optionalAccess', _334 => _334.items, 'access', _335 => _335.length])) return null;
|
|
10125
10296
|
return _chunkWSTEXEKDcjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
|
|
10126
10297
|
}
|
|
10127
10298
|
var LAYER_EFFECT_MENU = _chunkWSTEXEKDcjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkWSTEXEKDcjs.layerEffectLabel.call(void 0, kind) }));
|
|
@@ -10166,8 +10337,8 @@ function fillControls(f, allowPattern, patterns) {
|
|
|
10166
10337
|
}
|
|
10167
10338
|
function gradientControls(prefix, g) {
|
|
10168
10339
|
return [
|
|
10169
|
-
{ key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access',
|
|
10170
|
-
{ key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access',
|
|
10340
|
+
{ 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")) },
|
|
10341
|
+
{ 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")) },
|
|
10171
10342
|
{ key: `${prefix}.style`, label: "Style", type: "select", value: g.style, options: opt(["linear", "Linear"], ["radial", "Radial"], ["angle", "Angle"], ["reflected", "Reflected"], ["diamond", "Diamond"]) },
|
|
10172
10343
|
{ key: `${prefix}.angle`, label: "Angle", type: "range", min: -180, max: 180, step: 1, value: g.angle, unit: "\xB0" },
|
|
10173
10344
|
{ key: `${prefix}.scale`, label: "Scale", type: "range", min: 0.1, max: 1.5, step: 0.01, value: g.scale, percent: true, unit: "%" },
|
|
@@ -10259,19 +10430,19 @@ function layerEffectControls(e, patterns = []) {
|
|
|
10259
10430
|
}
|
|
10260
10431
|
function fillOfType(current, type, patterns) {
|
|
10261
10432
|
if (type === "gradient") return { type: "gradient", gradient: _chunkWSTEXEKDcjs.defaultEffectGradient.call(void 0, ) };
|
|
10262
|
-
if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access',
|
|
10433
|
+
if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _342 => _342[0], 'optionalAccess', _343 => _343.id]), () => ( "checker")), scale: 1 };
|
|
10263
10434
|
return { type: "color", color: current.type === "color" ? current.color : "#000000" };
|
|
10264
10435
|
}
|
|
10265
10436
|
function effectControlChange(effect, key, value, patterns = []) {
|
|
10266
10437
|
const [top, ...rest] = key.split(".");
|
|
10267
10438
|
if (top === "fill" && rest[0] === "type") return { fill: fillOfType(effect.fill, String(value), patterns) };
|
|
10268
10439
|
if (top === "patternId" && !rest.length) {
|
|
10269
|
-
const name = _optionalChain([patternOptions, 'call',
|
|
10440
|
+
const name = _optionalChain([patternOptions, 'call', _344 => _344(patterns), 'access', _345 => _345.find, 'call', _346 => _346((o) => o.value === value), 'optionalAccess', _347 => _347.label]);
|
|
10270
10441
|
return name ? { patternId: value, name } : { patternId: value };
|
|
10271
10442
|
}
|
|
10272
10443
|
if (!rest.length) return { [top]: value };
|
|
10273
10444
|
if (top === "fill" && rest[0] === "patternId") {
|
|
10274
|
-
const name = _optionalChain([patternOptions, 'call',
|
|
10445
|
+
const name = _optionalChain([patternOptions, 'call', _348 => _348(patterns), 'access', _349 => _349.find, 'call', _350 => _350((o) => o.value === value), 'optionalAccess', _351 => _351.label]);
|
|
10275
10446
|
return { fill: { ...effect.fill, patternId: value, ...name ? { name } : {} } };
|
|
10276
10447
|
}
|
|
10277
10448
|
return { [top]: setPath(getPath(effect, top), rest, value) };
|
|
@@ -10424,7 +10595,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10424
10595
|
__init77() {this.error = null}
|
|
10425
10596
|
__init78() {this.lastResult = null}
|
|
10426
10597
|
get active() {
|
|
10427
|
-
return Boolean(_optionalChain([this, 'access',
|
|
10598
|
+
return Boolean(_optionalChain([this, 'access', _352 => _352.sessionRef, 'optionalAccess', _353 => _353.isOpen]));
|
|
10428
10599
|
}
|
|
10429
10600
|
get session() {
|
|
10430
10601
|
return this.active ? this.sessionRef : null;
|
|
@@ -10433,7 +10604,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10433
10604
|
return this.modeValue;
|
|
10434
10605
|
}
|
|
10435
10606
|
get interpolation() {
|
|
10436
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
10607
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _354 => _354.sessionRef, 'optionalAccess', _355 => _355.interpolation]), () => ( "bicubic"));
|
|
10437
10608
|
}
|
|
10438
10609
|
__init79() {this.listeners = /* @__PURE__ */ new Set()}
|
|
10439
10610
|
/** Calls `listener` whenever the overlay, readout, mode or error changes. Returns the unsubscribe. */
|
|
@@ -10444,7 +10615,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10444
10615
|
};
|
|
10445
10616
|
}
|
|
10446
10617
|
changed() {
|
|
10447
|
-
_optionalChain([this, 'access',
|
|
10618
|
+
_optionalChain([this, 'access', _356 => _356.options, 'access', _357 => _357.onChange, 'optionalCall', _358 => _358()]);
|
|
10448
10619
|
for (const l of this.listeners) l();
|
|
10449
10620
|
}
|
|
10450
10621
|
/** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
|
|
@@ -10779,7 +10950,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10779
10950
|
bar() {
|
|
10780
10951
|
const s = this.session;
|
|
10781
10952
|
if (!s || !this.corners) return null;
|
|
10782
|
-
const read =
|
|
10953
|
+
const read = _chunkZID226ZGcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
|
|
10783
10954
|
return {
|
|
10784
10955
|
affine: read.affine,
|
|
10785
10956
|
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
@@ -10804,7 +10975,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10804
10975
|
this.changed();
|
|
10805
10976
|
return;
|
|
10806
10977
|
}
|
|
10807
|
-
const m =
|
|
10978
|
+
const m = _chunkZID226ZGcjs.matrixFromParams.call(void 0, s.box, {
|
|
10808
10979
|
scaleX: next.scaleX,
|
|
10809
10980
|
scaleY: next.scaleY,
|
|
10810
10981
|
rotate: next.rotate,
|
|
@@ -10814,7 +10985,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10814
10985
|
dx: next.x - this.refBox.x,
|
|
10815
10986
|
dy: next.y - this.refBox.y
|
|
10816
10987
|
});
|
|
10817
|
-
this.setCorners(
|
|
10988
|
+
this.setCorners(_chunkZID226ZGcjs.cornersFromMatrix.call(void 0, s.box, m));
|
|
10818
10989
|
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
10819
10990
|
this.changed();
|
|
10820
10991
|
}
|
|
@@ -10838,7 +11009,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
10838
11009
|
}
|
|
10839
11010
|
/** Abandons the transform and restores everything. */
|
|
10840
11011
|
cancel() {
|
|
10841
|
-
_optionalChain([this, 'access',
|
|
11012
|
+
_optionalChain([this, 'access', _359 => _359.sessionRef, 'optionalAccess', _360 => _360.cancel, 'call', _361 => _361()]);
|
|
10842
11013
|
this.sessionRef = null;
|
|
10843
11014
|
this.corners = null;
|
|
10844
11015
|
this.mesh = null;
|
|
@@ -11453,5 +11624,9 @@ var FreeTransformTool = (_class9 = class {
|
|
|
11453
11624
|
|
|
11454
11625
|
|
|
11455
11626
|
|
|
11456
|
-
exports.ADJUSTMENT_KEYS = _chunkVSMM7B3Pcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkVSMM7B3Pcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkVSMM7B3Pcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.D50; exports.D65 = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkVSMM7B3Pcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkWSTEXEKDcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkVSMM7B3Pcjs.LEGACY_PROCESS_VERSION; exports.LUMA_709 = _chunkVSMM7B3Pcjs.LUMA_709; exports.LayerCompositor = _chunkVSMM7B3Pcjs.LayerCompositor; exports.LayerEffectError = _chunkWSTEXEKDcjs.LayerEffectError; exports.LayerOperationError = _chunkVSMM7B3Pcjs.LayerOperationError; exports.MAX_BRUSH_SIZE = _chunkPV42JITTcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkWSTEXEKDcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkVSMM7B3Pcjs.MAX_KELVIN; exports.MAX_TRANSFORM_PIXELS = _chunkWSTEXEKDcjs.MAX_TRANSFORM_PIXELS; exports.MIN_KELVIN = _chunkVSMM7B3Pcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = _chunkVSMM7B3Pcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkVSMM7B3Pcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SMART_RENDER_MARGIN = _chunkVSMM7B3Pcjs.SMART_RENDER_MARGIN; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunkVSMM7B3Pcjs.TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkVSMM7B3Pcjs.TRANSFORM_ANCHORS; exports.TiledSurface = _chunkCRMAXIUVcjs.TiledSurface; exports.TransformTooLargeError = _chunkWSTEXEKDcjs.TransformTooLargeError; exports.VIBRANCE_GREY = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkWSTEXEKDcjs.ZlibError; exports.activeAdjustmentLayers = _chunkVSMM7B3Pcjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunkVSMM7B3Pcjs.activeSmartFilters; exports.addLayerEffect = _chunkVSMM7B3Pcjs.addLayerEffect; exports.addLayerFilter = _chunkVSMM7B3Pcjs.addLayerFilter; exports.addSmartFilter = _chunkVSMM7B3Pcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkVSMM7B3Pcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkVSMM7B3Pcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkVSMM7B3Pcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = adjustmentNodeFromLegacy; exports.adler32 = _chunkWSTEXEKDcjs.adler32; exports.anchorPoint = _chunkVSMM7B3Pcjs.anchorPoint; exports.annotationLayerFor = annotationLayerFor; exports.annotationLayerName = annotationLayerName; exports.applyAdjustmentLayers = _chunkVSMM7B3Pcjs.applyAdjustmentLayers; exports.applyAdjustments = _chunkVSMM7B3Pcjs.applyAdjustments; exports.applyBoxBlur = _chunkVSMM7B3Pcjs.applyBoxBlur; exports.applyDepthMask = _chunkVSMM7B3Pcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkVSMM7B3Pcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkVSMM7B3Pcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkVSMM7B3Pcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkVSMM7B3Pcjs.applyParams; exports.applyProcess2Adjustments = _chunkVSMM7B3Pcjs.applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applySmartFilters = _chunkVSMM7B3Pcjs.applySmartFilters; exports.applyStrokeToTile = _chunkPV42JITTcjs.applyStrokeToTile; exports.backgroundLayer = backgroundLayer; exports.base64ToBytes = _chunkWSTEXEKDcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.blackWhiteGray = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.blurFilter; exports.borderCoverage = _chunkVSMM7B3Pcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkVSMM7B3Pcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkVSMM7B3Pcjs.bradfordAdaptation; exports.buildLayerMaskPlanes = _chunkVSMM7B3Pcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkVSMM7B3Pcjs.buildToneLut; exports.builtinPattern = _chunkWSTEXEKDcjs.builtinPattern; exports.builtinPatternIds = _chunkWSTEXEKDcjs.builtinPatternIds; exports.bytesToBase64 = _chunkWSTEXEKDcjs.bytesToBase64; exports.calculateCropDrag = _chunkVSMM7B3Pcjs.calculateCropDrag; exports.canvasCompositeOperation = _chunkCRMAXIUVcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkVSMM7B3Pcjs.canvasToImagePoint; exports.changedTiles = _chunkWSTEXEKDcjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkVSMM7B3Pcjs.clampCropToImage; exports.cleanMixer = _chunkPV42JITTcjs.cleanMixer; exports.collectTiles = _chunkCRMAXIUVcjs.collectTiles; exports.colorBalanceChannel = _chunkVSMM7B3Pcjs.colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = _chunkVSMM7B3Pcjs.combineSelections; exports.compileAdjustmentLayer = _chunkVSMM7B3Pcjs.compileAdjustmentLayer; exports.compositeSurfaceOver = _chunkWSTEXEKDcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkVSMM7B3Pcjs.computeSelectionBounds; exports.contentBounds = _chunkCRMAXIUVcjs.contentBounds; exports.contentsBox = _chunkVSMM7B3Pcjs.contentsBox; exports.contentsSurface = _chunkVSMM7B3Pcjs.contentsSurface; exports.contractCoverage = _chunkVSMM7B3Pcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertToSmartObject = _chunkVSMM7B3Pcjs.convertToSmartObject; exports.copySmartObject = _chunkVSMM7B3Pcjs.copySmartObject; exports.cornersFromMatrix = _chunkVSMM7B3Pcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkPV42JITTcjs.coverageTileCoord; exports.coverageToByte = _chunkVSMM7B3Pcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.createSelectionMask; exports.curveLut = _chunkWSTEXEKDcjs.curveLut; exports.curveLutFromLevels = _chunkVSMM7B3Pcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkPV42JITTcjs.dabCoverage; exports.dabRect = _chunkPV42JITTcjs.dabRect; exports.decodeLayerChannel = _chunkVSMM7B3Pcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkVSMM7B3Pcjs.decodeLayerMask; exports.decodeMergedImage = _chunkVSMM7B3Pcjs.decodeMergedImage; exports.decodePlanes = _chunkVSMM7B3Pcjs.decodePlanes; exports.decodePng = _chunkWSTEXEKDcjs.decodePng; exports.decodePngDataUrl = _chunkVSMM7B3Pcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkVSMM7B3Pcjs.decodeSelectionRle; exports.defaultAdjustmentParams = _chunkVSMM7B3Pcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkWSTEXEKDcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkWSTEXEKDcjs.defaultLayerEffect; exports.deflate = _chunkWSTEXEKDcjs.deflate; exports.deflateRaw = _chunkWSTEXEKDcjs.deflateRaw; exports.depthMaskAlpha = _chunkVSMM7B3Pcjs.depthMaskAlpha; exports.depthRasterMask = depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkVSMM7B3Pcjs.describeTransform; exports.deserializeEffects = _chunkVSMM7B3Pcjs.deserializeEffects; exports.deserializeLayer = _chunkVSMM7B3Pcjs.deserializeLayer; exports.deserializeLayers = _chunkVSMM7B3Pcjs.deserializeLayers; exports.deserializePatterns = _chunkVSMM7B3Pcjs.deserializePatterns; exports.deserializeSelection = _chunkVSMM7B3Pcjs.deserializeSelection; exports.developFilter = _chunkVSMM7B3Pcjs.developFilter; exports.developFromAdjustments = developFromAdjustments; exports.developTarget = developTarget; exports.distanceTransform = _chunkVSMM7B3Pcjs.distanceTransform; exports.documentContents = _chunkVSMM7B3Pcjs.documentContents; exports.downloadPsd = downloadPsd; exports.dragWarpMeshPoint = _chunkDWGZUSEScjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.duplicateLayer = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.encodeRle; exports.encodeSelectionRle = _chunkVSMM7B3Pcjs.encodeSelectionRle; exports.encodeSurface = _chunkVSMM7B3Pcjs.encodeSurface; exports.evalWarpMesh = _chunkDWGZUSEScjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkVSMM7B3Pcjs.evaluateAdjustmentLayers; exports.expandCoverage = _chunkVSMM7B3Pcjs.expandCoverage; exports.exportPsd = _chunkVSMM7B3Pcjs.exportPsd; exports.featherCoverage = _chunkVSMM7B3Pcjs.featherCoverage; exports.fillRect = _chunkCRMAXIUVcjs.fillRect; exports.filterMaskCoverage = _chunkVSMM7B3Pcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkWSTEXEKDcjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunkCRMAXIUVcjs.finishTile; exports.flattenLayers = _chunkWSTEXEKDcjs.flattenLayers; exports.flipCorners = _chunkVSMM7B3Pcjs.flipCorners; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkVSMM7B3Pcjs.fullSelection; exports.gaussianBlur = _chunkWSTEXEKDcjs.gaussianBlur; exports.geometryHomography = _chunkVSMM7B3Pcjs.geometryHomography; exports.getAnnotationBounds = _chunkVSMM7B3Pcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkVSMM7B3Pcjs.getCropCursor; exports.getRotatedSize = _chunkVSMM7B3Pcjs.getRotatedSize; exports.getViewportMetrics = _chunkVSMM7B3Pcjs.getViewportMetrics; exports.getViewportProjection = _chunkVSMM7B3Pcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunkVSMM7B3Pcjs.greyMorphology; exports.groupLayers = _chunkVSMM7B3Pcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkWSTEXEKDcjs.hasActiveEffects; exports.hasResampledLegacyMask = hasResampledLegacyMask; exports.hasSurface = _chunkVSMM7B3Pcjs.hasSurface; exports.hasWarp = _chunkVSMM7B3Pcjs.hasWarp; exports.hashMaskContent = _chunkVSMM7B3Pcjs.hashMaskContent; exports.hashNoise = _chunkWSTEXEKDcjs.hashNoise; exports.hexToRgb = _chunkVSMM7B3Pcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkVSMM7B3Pcjs.hitTestAnnotation; exports.hitTestCrop = _chunkVSMM7B3Pcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkVSMM7B3Pcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkVSMM7B3Pcjs.hueRangeTables; exports.hueRangeWeight = _chunkVSMM7B3Pcjs.hueRangeWeight; exports.hueSaturation = _chunkVSMM7B3Pcjs.hueSaturation; exports.identityCurve = _chunkVSMM7B3Pcjs.identityCurve; exports.identityLevels = _chunkVSMM7B3Pcjs.identityLevels; exports.identityTransform = _chunkVSMM7B3Pcjs.identityTransform; exports.identityWarpMesh = _chunkDWGZUSEScjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunkVSMM7B3Pcjs.imageToCanvasPoint; exports.importPsd = _chunkVSMM7B3Pcjs.importPsd; exports.inflate = _chunkWSTEXEKDcjs.inflate; exports.inflateRaw = _chunkWSTEXEKDcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkWSTEXEKDcjs.insertLayer; exports.instancesOf = _chunkVSMM7B3Pcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkVSMM7B3Pcjs.invertMatrix3; exports.invertSelection = _chunkVSMM7B3Pcjs.invertSelection; exports.isActiveFilter = _chunkVSMM7B3Pcjs.isActiveFilter; exports.isAdjustmentKind = _chunkVSMM7B3Pcjs.isAdjustmentKind; exports.isBlendMode = _chunkCRMAXIUVcjs.isBlendMode; exports.isContentsDecoded = _chunkVSMM7B3Pcjs.isContentsDecoded; exports.isDefaultDepthMask = isDefaultDepthMask; exports.isIdentityTransform = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.isQuarterTurnSwapped; exports.isSelectionEmpty = _chunkVSMM7B3Pcjs.isSelectionEmpty; exports.isSelectionMode = _chunkVSMM7B3Pcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCRMAXIUVcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunkVSMM7B3Pcjs.isSpatialFilter; exports.isTransformAnchor = _chunkVSMM7B3Pcjs.isTransformAnchor; exports.isValidWarp = _chunkVSMM7B3Pcjs.isValidWarp; exports.kelvinToTemperature = _chunkVSMM7B3Pcjs.kelvinToTemperature; exports.keysWeight = _chunkWSTEXEKDcjs.keysWeight; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkWSTEXEKDcjs.layerEffectFields; exports.layerEffectLabel = _chunkWSTEXEKDcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkVSMM7B3Pcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkVSMM7B3Pcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkVSMM7B3Pcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkVSMM7B3Pcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkVSMM7B3Pcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkVSMM7B3Pcjs.layerTree; exports.layerTypeLabel = _chunkVSMM7B3Pcjs.layerTypeLabel; exports.layersFromLegacy = layersFromLegacy; exports.legacyAdjustmentLayer = legacyAdjustmentLayer; exports.legacyMaskOf = legacyMaskOf; exports.legacyView = legacyView; exports.lerpPigment = _chunkCRMAXIUVcjs.lerpPigment; exports.lerpPigmentInto = _chunkCRMAXIUVcjs.lerpPigmentInto; exports.levelsValue = _chunkVSMM7B3Pcjs.levelsValue; exports.linearSrgbToXy = _chunkVSMM7B3Pcjs.linearSrgbToXy; exports.linearToSrgb = _chunkVSMM7B3Pcjs.linearToSrgb; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkPV42JITTcjs.loadMixer; exports.magicWand = magicWand; exports.mapCropHandle = _chunkVSMM7B3Pcjs.mapCropHandle; exports.mapLayer = _chunkWSTEXEKDcjs.mapLayer; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkVSMM7B3Pcjs.matrixFromCorners; exports.matrixFromParams = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkVSMM7B3Pcjs.moveLayer; exports.moveSmartFilter = _chunkVSMM7B3Pcjs.moveSmartFilter; exports.mulMatrix3 = _chunkVSMM7B3Pcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkVSMM7B3Pcjs.neutralHueRange; exports.newContentsId = _chunkVSMM7B3Pcjs.newContentsId; exports.newEffectId = _chunkWSTEXEKDcjs.newEffectId; exports.newLayerId = _chunkVSMM7B3Pcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkVSMM7B3Pcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkVSMM7B3Pcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkVSMM7B3Pcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCRMAXIUVcjs.normalizeBlendMode; exports.normalizeBrush = _chunkPV42JITTcjs.normalizeBrush; exports.normalizeFilter = _chunkVSMM7B3Pcjs.normalizeFilter; exports.normalizeLayerEffects = _chunkWSTEXEKDcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkVSMM7B3Pcjs.normalizeLayerMask; exports.normalizeMixer = _chunkPV42JITTcjs.normalizeMixer; exports.normalizePlacement = _chunkVSMM7B3Pcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkVSMM7B3Pcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeSmartFilter = _chunkVSMM7B3Pcjs.normalizeSmartFilter; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.offsetLayer = _chunkVSMM7B3Pcjs.offsetLayer; exports.offsetSmartObject = _chunkVSMM7B3Pcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCRMAXIUVcjs.packRgba; exports.parseAdjustmentBlock = _chunkVSMM7B3Pcjs.parseAdjustmentBlock; exports.parseBlend = _chunkVSMM7B3Pcjs.parseBlend; exports.parseColor = parseColor; exports.parseDataUrl = _chunkWSTEXEKDcjs.parseDataUrl; exports.parseEffectColor = _chunkWSTEXEKDcjs.parseEffectColor; exports.parseLfx2 = _chunkVSMM7B3Pcjs.parseLfx2; exports.parseLrfx = _chunkVSMM7B3Pcjs.parseLrfx; exports.parsePatternBlock = _chunkVSMM7B3Pcjs.parsePatternBlock; exports.parseSelectionMode = _chunkVSMM7B3Pcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkVSMM7B3Pcjs.parseVersionedDescriptor; exports.photoFilterMatrix = _chunkVSMM7B3Pcjs.photoFilterMatrix; exports.pixelLayerBounds = _chunkVSMM7B3Pcjs.pixelLayerBounds; exports.pixelLayers = _chunkVSMM7B3Pcjs.pixelLayers; exports.placeContents = _chunkVSMM7B3Pcjs.placeContents; exports.placeLayer = _chunkVSMM7B3Pcjs.placeLayer; exports.placementAt = _chunkVSMM7B3Pcjs.placementAt; exports.placementBounds = _chunkVSMM7B3Pcjs.placementBounds; exports.placementGeometry = _chunkVSMM7B3Pcjs.placementGeometry; exports.pngDataUrl = _chunkWSTEXEKDcjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkVSMM7B3Pcjs.posterizeValue; exports.presetWarp = _chunkVSMM7B3Pcjs.presetWarp; exports.previewStep = previewStep; exports.projectImagePoint = _chunkVSMM7B3Pcjs.projectImagePoint; exports.projectImageRect = _chunkVSMM7B3Pcjs.projectImageRect; exports.projectMaskCoverage = _chunkVSMM7B3Pcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkVSMM7B3Pcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkVSMM7B3Pcjs.psdToLayers; exports.pullWarpMesh = _chunkDWGZUSEScjs.pullWarpMesh; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunkVSMM7B3Pcjs.rangeLightness; exports.rasterContents = _chunkVSMM7B3Pcjs.rasterContents; exports.rasterMaskFromLegacy = rasterMaskFromLegacy; exports.rasterizeDab = _chunkPV42JITTcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkVSMM7B3Pcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readPixel = _chunkCRMAXIUVcjs.readPixel; exports.readPsd = _chunkVSMM7B3Pcjs.readPsd; exports.readRegion = _chunkCRMAXIUVcjs.readRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkWSTEXEKDcjs.reduceSurface; exports.referencePoint = _chunkVSMM7B3Pcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCRMAXIUVcjs.reflectanceToRgb; exports.removeAlpha = _chunkVSMM7B3Pcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkVSMM7B3Pcjs.removeLayer; exports.removeLayerEffect = _chunkVSMM7B3Pcjs.removeLayerEffect; exports.removeLayerFilter = _chunkVSMM7B3Pcjs.removeLayerFilter; exports.removeSmartFilter = _chunkVSMM7B3Pcjs.removeSmartFilter; exports.renderLayerEffects = _chunkWSTEXEKDcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderSmartObject = _chunkVSMM7B3Pcjs.renderSmartObject; exports.replaceContents = _chunkVSMM7B3Pcjs.replaceContents; exports.requireLayer = _chunkVSMM7B3Pcjs.requireLayer; exports.requireSmartObject = _chunkVSMM7B3Pcjs.requireSmartObject; exports.requireUnlocked = _chunkVSMM7B3Pcjs.requireUnlocked; exports.rerender = _chunkVSMM7B3Pcjs.rerender; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkVSMM7B3Pcjs.resizeSelection; exports.resizeWarpMesh = _chunkDWGZUSEScjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkVSMM7B3Pcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.rgbToGray = _chunkVSMM7B3Pcjs.rgbToGray; exports.rgbToHsl = _chunkVSMM7B3Pcjs.rgbToHsl; exports.rgbToReflectance = _chunkCRMAXIUVcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.runLayerFilters = _chunkVSMM7B3Pcjs.runLayerFilters; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkVSMM7B3Pcjs.sampleLut; exports.sampleToneLut = _chunkVSMM7B3Pcjs.sampleToneLut; exports.scaleLayerEffect = _chunkWSTEXEKDcjs.scaleLayerEffect; exports.selectionArea = _chunkVSMM7B3Pcjs.selectionArea; exports.selectionFromCoverage = _chunkVSMM7B3Pcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkVSMM7B3Pcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkVSMM7B3Pcjs.selectionToCoverage; exports.selectionToPixels = _chunkVSMM7B3Pcjs.selectionToPixels; exports.selectionValueAt = _chunkVSMM7B3Pcjs.selectionValueAt; exports.serializeContents = _chunkVSMM7B3Pcjs.serializeContents; exports.serializeEffects = _chunkVSMM7B3Pcjs.serializeEffects; exports.serializeLayer = _chunkVSMM7B3Pcjs.serializeLayer; exports.serializeLayers = _chunkVSMM7B3Pcjs.serializeLayers; exports.serializeLayersExternal = _chunkVSMM7B3Pcjs.serializeLayersExternal; exports.serializePatterns = _chunkVSMM7B3Pcjs.serializePatterns; exports.serializeSelection = _chunkVSMM7B3Pcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkVSMM7B3Pcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkVSMM7B3Pcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkVSMM7B3Pcjs.setLayerMask; exports.setLayerProperties = _chunkVSMM7B3Pcjs.setLayerProperties; exports.setLum = _chunkCRMAXIUVcjs.setLum; exports.setPigmentColor = _chunkCRMAXIUVcjs.setPigmentColor; exports.setSmartFilterMask = _chunkVSMM7B3Pcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkVSMM7B3Pcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkVSMM7B3Pcjs.setSmartPlacement; exports.shiftCoverage = _chunkVSMM7B3Pcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkVSMM7B3Pcjs.smartObjectLayers; exports.smoothCoverage = _chunkVSMM7B3Pcjs.smoothCoverage; exports.smoothPoints = _chunkPV42JITTcjs.smoothPoints; exports.solidSurface = _chunkCRMAXIUVcjs.solidSurface; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = _chunkVSMM7B3Pcjs.srgbToLinear; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCRMAXIUVcjs.surfaceBytes; exports.surfaceFromPixels = _chunkCRMAXIUVcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCRMAXIUVcjs.surfacesEqual; exports.tempTintToXy = _chunkVSMM7B3Pcjs.tempTintToXy; exports.temperatureToKelvin = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.toneCurve; exports.toneLuts = _chunkVSMM7B3Pcjs.toneLuts; exports.toneRange = toneRange; exports.transformHomography = _chunkVSMM7B3Pcjs.transformHomography; exports.transformMap = _chunkVSMM7B3Pcjs.transformMap; exports.transformSurface = _chunkWSTEXEKDcjs.transformSurface; exports.transformedBounds = _chunkWSTEXEKDcjs.transformedBounds; exports.transformedBox = _chunkVSMM7B3Pcjs.transformedBox; exports.transformedPoint = _chunkVSMM7B3Pcjs.transformedPoint; exports.translateSurface = _chunkCRMAXIUVcjs.translateSurface; exports.ungroupLayer = _chunkVSMM7B3Pcjs.ungroupLayer; exports.uniformTile = _chunkCRMAXIUVcjs.uniformTile; exports.unionRect = _chunkVSMM7B3Pcjs.unionRect; exports.unprojectCanvasPoint = _chunkVSMM7B3Pcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkVSMM7B3Pcjs.updateLayerEffect; exports.updateLayerFilter = _chunkVSMM7B3Pcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkVSMM7B3Pcjs.updateLayerMaskProps; exports.updateSmartFilter = _chunkVSMM7B3Pcjs.updateSmartFilter; exports.uvToXy = _chunkVSMM7B3Pcjs.uvToXy; exports.validateEffectGradient = _chunkWSTEXEKDcjs.validateEffectGradient; exports.validateLayerEffect = _chunkWSTEXEKDcjs.validateLayerEffect; exports.validateLayerEffects = _chunkWSTEXEKDcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkVSMM7B3Pcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkVSMM7B3Pcjs.vibranceLinear; exports.vibrancePixel = _chunkVSMM7B3Pcjs.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 = _chunkVSMM7B3Pcjs.wbMatrix; exports.whiteBalanceFromSample = _chunkVSMM7B3Pcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkVSMM7B3Pcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkVSMM7B3Pcjs.withFilterMaskSurface; exports.withNewIds = _chunkVSMM7B3Pcjs.withNewIds; exports.writeAdjustmentBlock = _chunkVSMM7B3Pcjs.writeAdjustmentBlock; exports.writeLfx2 = _chunkVSMM7B3Pcjs.writeLfx2; exports.writePatternBlock = _chunkVSMM7B3Pcjs.writePatternBlock; exports.writePsd = _chunkVSMM7B3Pcjs.writePsd; exports.writeRegion = _chunkCRMAXIUVcjs.writeRegion; exports.xyToTempTint = _chunkVSMM7B3Pcjs.xyToTempTint; exports.xyToUv = _chunkVSMM7B3Pcjs.xyToUv;
|
|
11627
|
+
|
|
11628
|
+
|
|
11629
|
+
|
|
11630
|
+
|
|
11631
|
+
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.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; 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_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 = _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.extractNormalizedLayerItems = extractNormalizedLayerItems; 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;
|
|
11457
11632
|
//# sourceMappingURL=index.cjs.map
|