@pixerate/editor 0.111.0 → 0.112.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-HHZ6ZJTW.js → chunk-CZOXTEMN.js} +1772 -456
- package/dist/chunk-CZOXTEMN.js.map +1 -0
- package/dist/{chunk-PHUMLSCW.cjs → chunk-YGIMK4NX.cjs} +1810 -494
- package/dist/chunk-YGIMK4NX.cjs.map +1 -0
- package/dist/{export-DoDhCszr.d.cts → export-DBba-buV.d.cts} +40 -13
- package/dist/{export-DBNVwb6h.d.ts → export-DNu_Jr8p.d.ts} +40 -13
- package/dist/image-editor/index.cjs +1166 -619
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +159 -3
- package/dist/image-editor/index.d.ts +159 -3
- package/dist/image-editor/index.js +554 -7
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint-editor/index.cjs +6 -6
- package/dist/paint-editor/index.d.cts +1 -1
- package/dist/paint-editor/index.d.ts +1 -1
- package/dist/paint-editor/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-HHZ6ZJTW.js.map +0 -1
- package/dist/chunk-PHUMLSCW.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12;
|
|
2
2
|
|
|
3
3
|
var _chunkD6FH2YAXcjs = require('../chunk-D6FH2YAX.cjs');
|
|
4
4
|
|
|
@@ -369,7 +369,7 @@ require('../chunk-FTBZPI77.cjs');
|
|
|
369
369
|
|
|
370
370
|
|
|
371
371
|
|
|
372
|
-
var
|
|
372
|
+
var _chunkYGIMK4NXcjs = require('../chunk-YGIMK4NX.cjs');
|
|
373
373
|
|
|
374
374
|
|
|
375
375
|
|
|
@@ -666,7 +666,7 @@ function quickMaskPixels(mask, style = {}) {
|
|
|
666
666
|
|
|
667
667
|
// src/image-editor/layers/render.ts
|
|
668
668
|
function isQuarterTurn(rotate) {
|
|
669
|
-
return
|
|
669
|
+
return _chunkYGIMK4NXcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
|
|
670
670
|
}
|
|
671
671
|
function isIntegerRect(r) {
|
|
672
672
|
return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
|
|
@@ -674,7 +674,7 @@ function isIntegerRect(r) {
|
|
|
674
674
|
function baseProjection(region, transform, baseW, baseH) {
|
|
675
675
|
return {
|
|
676
676
|
region,
|
|
677
|
-
angle:
|
|
677
|
+
angle: _chunkYGIMK4NXcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
678
678
|
flipH: transform.flipH,
|
|
679
679
|
flipV: transform.flipV,
|
|
680
680
|
scale: 1,
|
|
@@ -683,14 +683,14 @@ function baseProjection(region, transform, baseW, baseH) {
|
|
|
683
683
|
};
|
|
684
684
|
}
|
|
685
685
|
function projectQuarterTurn(src, srcRect, region, transform) {
|
|
686
|
-
const rotated =
|
|
686
|
+
const rotated = _chunkYGIMK4NXcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
687
687
|
const w = Math.max(1, Math.round(rotated.width));
|
|
688
688
|
const h = Math.max(1, Math.round(rotated.height));
|
|
689
689
|
const out = new Uint8ClampedArray(w * h * 4);
|
|
690
690
|
const p = baseProjection(region, transform, w, h);
|
|
691
|
-
const o =
|
|
692
|
-
const ox =
|
|
693
|
-
const oy =
|
|
691
|
+
const o = _chunkYGIMK4NXcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
|
|
692
|
+
const ox = _chunkYGIMK4NXcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
|
|
693
|
+
const oy = _chunkYGIMK4NXcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
|
|
694
694
|
const ux = Math.round(ox.x - o.x);
|
|
695
695
|
const vx = Math.round(ox.y - o.y);
|
|
696
696
|
const uy = Math.round(oy.x - o.x);
|
|
@@ -719,23 +719,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
|
|
|
719
719
|
const d = img.data;
|
|
720
720
|
for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
|
|
721
721
|
}
|
|
722
|
-
if (legacyOutputBlur && legacyOutputBlur > 0)
|
|
722
|
+
if (legacyOutputBlur && legacyOutputBlur > 0) _chunkYGIMK4NXcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
|
|
723
723
|
}
|
|
724
724
|
function needsLegacyBase(input) {
|
|
725
725
|
const { stack, region, canvas, transform } = input;
|
|
726
|
-
if (!
|
|
726
|
+
if (!_chunkYGIMK4NXcjs.isLegacyShape.call(void 0, stack)) return false;
|
|
727
727
|
const bg = stack.layers[0];
|
|
728
728
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
|
|
729
729
|
if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
|
|
730
730
|
if (stack.outputOpacity < 1) return true;
|
|
731
|
-
const blur =
|
|
731
|
+
const blur = _chunkYGIMK4NXcjs.blurFilter.call(void 0, bg);
|
|
732
732
|
if (blur && blur.enabled && blur.radius > 0) {
|
|
733
733
|
const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
|
|
734
|
-
const angle =
|
|
734
|
+
const angle = _chunkYGIMK4NXcjs.normalizeAngle.call(void 0, transform.rotate);
|
|
735
735
|
if (!full || angle === 90 || angle === 270) return true;
|
|
736
736
|
}
|
|
737
737
|
if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
|
|
738
|
-
if (
|
|
738
|
+
if (_chunkYGIMK4NXcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
|
|
739
739
|
return false;
|
|
740
740
|
}
|
|
741
741
|
var isPlainAnnotation = (l) => l.type === "annotation" ? l.opacity === 1 && l.blend === "normal" && !l.clipped && !l.mask : (l.type === "shape" || l.type === "type") && Boolean(l.annotation) && l.opacity === 1 && l.blend === (_nullishCoalesce(l.annotation.blend, () => ( "normal"))) && !l.clipped && !l.mask && !l.effects && (_nullishCoalesce(l.fillOpacity, () => ( 1))) === 1;
|
|
@@ -767,7 +767,7 @@ function coveringRect(region) {
|
|
|
767
767
|
const y = Math.floor(region.y);
|
|
768
768
|
return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
|
|
769
769
|
}
|
|
770
|
-
function renderLayeredBase(stack, region, transform, sources, compositor = new (0,
|
|
770
|
+
function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkYGIMK4NXcjs.LayerCompositor)()) {
|
|
771
771
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
|
|
772
772
|
throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
|
|
773
773
|
}
|
|
@@ -901,8 +901,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
901
901
|
* The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
|
|
902
902
|
* trust dirty rectangles; exports use `exportCompositor`.
|
|
903
903
|
*/
|
|
904
|
-
__init8() {this.compositor = new (0,
|
|
905
|
-
__init9() {this.exportCompositor = new (0,
|
|
904
|
+
__init8() {this.compositor = new (0, _chunkYGIMK4NXcjs.LayerCompositor)()}
|
|
905
|
+
__init9() {this.exportCompositor = new (0, _chunkYGIMK4NXcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
|
|
906
906
|
/** How the host resolves layer pixels (set by the controller). */
|
|
907
907
|
|
|
908
908
|
/**
|
|
@@ -968,9 +968,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
968
968
|
return;
|
|
969
969
|
}
|
|
970
970
|
const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
|
|
971
|
-
const projection =
|
|
971
|
+
const projection = _chunkYGIMK4NXcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
|
|
972
972
|
const { region } = projection;
|
|
973
|
-
const rotated =
|
|
973
|
+
const rotated = _chunkYGIMK4NXcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
974
974
|
const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
|
|
975
975
|
let overlay = annotations;
|
|
976
976
|
if (route === "legacy") {
|
|
@@ -980,8 +980,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
980
980
|
`${naturalWidth}x${naturalHeight}`,
|
|
981
981
|
`${region.x},${region.y},${region.width},${region.height}`,
|
|
982
982
|
`${projection.angle},${transform.flipH},${transform.flipV}`,
|
|
983
|
-
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${
|
|
984
|
-
|
|
983
|
+
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkYGIMK4NXcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
|
|
984
|
+
_chunkYGIMK4NXcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
|
|
985
985
|
`${depthMask.enabled},${depthMask.maskSource},${_optionalChain([depthMask, 'access', _5 => _5.depthRange, 'optionalAccess', _6 => _6[0]])}-${_optionalChain([depthMask, 'access', _7 => _7.depthRange, 'optionalAccess', _8 => _8[1]])},${depthMask.softness},${depthMask.invert},${depthMask.mode}`
|
|
986
986
|
].join("|");
|
|
987
987
|
let baseCanvas = this.cachedBaseCanvas;
|
|
@@ -1013,7 +1013,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1013
1013
|
}
|
|
1014
1014
|
if (overlay.length > 0 || options.draftAnnotation) {
|
|
1015
1015
|
ctx.save();
|
|
1016
|
-
|
|
1016
|
+
_chunkYGIMK4NXcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1017
1017
|
ctx.beginPath();
|
|
1018
1018
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1019
1019
|
ctx.clip();
|
|
@@ -1036,7 +1036,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1036
1036
|
if (_optionalChain([state, 'access', _13 => _13.selection, 'optionalAccess', _14 => _14.bounds]) && display !== "none" || _optionalChain([options, 'access', _15 => _15.draftSelectionPath, 'optionalAccess', _16 => _16.length])) {
|
|
1037
1037
|
ctx.save();
|
|
1038
1038
|
try {
|
|
1039
|
-
|
|
1039
|
+
_chunkYGIMK4NXcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1040
1040
|
ctx.beginPath();
|
|
1041
1041
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1042
1042
|
ctx.clip();
|
|
@@ -1051,7 +1051,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1051
1051
|
const b = options.brushCursor;
|
|
1052
1052
|
ctx.save();
|
|
1053
1053
|
try {
|
|
1054
|
-
|
|
1054
|
+
_chunkYGIMK4NXcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1055
1055
|
const px2 = 1 / (projection.scale || 1);
|
|
1056
1056
|
ctx.beginPath();
|
|
1057
1057
|
ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
|
|
@@ -1065,11 +1065,50 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1065
1065
|
}
|
|
1066
1066
|
ctx.restore();
|
|
1067
1067
|
}
|
|
1068
|
+
if (options.textEdit) {
|
|
1069
|
+
const t = options.textEdit;
|
|
1070
|
+
ctx.save();
|
|
1071
|
+
try {
|
|
1072
|
+
const scr = (p) => _chunkYGIMK4NXcjs.projectImagePoint.call(void 0, p, projection);
|
|
1073
|
+
const poly = (pts) => {
|
|
1074
|
+
ctx.beginPath();
|
|
1075
|
+
pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
|
|
1076
|
+
ctx.closePath();
|
|
1077
|
+
};
|
|
1078
|
+
if (t.frame) {
|
|
1079
|
+
poly(t.frame);
|
|
1080
|
+
ctx.setLineDash([4, 3]);
|
|
1081
|
+
ctx.lineWidth = 1;
|
|
1082
|
+
ctx.strokeStyle = "rgba(99,102,241,0.9)";
|
|
1083
|
+
ctx.stroke();
|
|
1084
|
+
ctx.setLineDash([]);
|
|
1085
|
+
}
|
|
1086
|
+
ctx.fillStyle = "rgba(99,102,241,0.35)";
|
|
1087
|
+
for (const q of t.selection) {
|
|
1088
|
+
poly(q);
|
|
1089
|
+
ctx.fill();
|
|
1090
|
+
}
|
|
1091
|
+
if (t.caret) {
|
|
1092
|
+
const [a, b] = t.caret.map(scr);
|
|
1093
|
+
ctx.beginPath();
|
|
1094
|
+
ctx.moveTo(a.x, a.y);
|
|
1095
|
+
ctx.lineTo(b.x, b.y);
|
|
1096
|
+
ctx.lineWidth = 3;
|
|
1097
|
+
ctx.strokeStyle = "#ffffff";
|
|
1098
|
+
ctx.stroke();
|
|
1099
|
+
ctx.lineWidth = 1.5;
|
|
1100
|
+
ctx.strokeStyle = "#111827";
|
|
1101
|
+
ctx.stroke();
|
|
1102
|
+
}
|
|
1103
|
+
} catch (e5) {
|
|
1104
|
+
}
|
|
1105
|
+
ctx.restore();
|
|
1106
|
+
}
|
|
1068
1107
|
if (options.freeTransform) {
|
|
1069
1108
|
const t = options.freeTransform;
|
|
1070
1109
|
ctx.save();
|
|
1071
1110
|
try {
|
|
1072
|
-
const scr = (p) =>
|
|
1111
|
+
const scr = (p) => _chunkYGIMK4NXcjs.projectImagePoint.call(void 0, p, projection);
|
|
1073
1112
|
ctx.beginPath();
|
|
1074
1113
|
if (t.warp) {
|
|
1075
1114
|
for (const c of t.warp.curves) {
|
|
@@ -1121,13 +1160,13 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1121
1160
|
ctx.lineWidth = 1;
|
|
1122
1161
|
ctx.strokeStyle = "#ffffff";
|
|
1123
1162
|
ctx.stroke();
|
|
1124
|
-
} catch (
|
|
1163
|
+
} catch (e6) {
|
|
1125
1164
|
}
|
|
1126
1165
|
ctx.restore();
|
|
1127
1166
|
}
|
|
1128
1167
|
if (isActivelyCropping) {
|
|
1129
1168
|
const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
|
|
1130
|
-
this.drawCropOverlay(ctx,
|
|
1169
|
+
this.drawCropOverlay(ctx, _chunkYGIMK4NXcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
|
|
1131
1170
|
}
|
|
1132
1171
|
}
|
|
1133
1172
|
/**
|
|
@@ -1136,7 +1175,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1136
1175
|
*/
|
|
1137
1176
|
async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
|
|
1138
1177
|
const { adjustments, depthMask } = state;
|
|
1139
|
-
const rotated =
|
|
1178
|
+
const rotated = _chunkYGIMK4NXcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1140
1179
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1141
1180
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1142
1181
|
const baseCanvas = this.createCanvas(baseW, baseH);
|
|
@@ -1144,7 +1183,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1144
1183
|
if (!baseCtx) return baseCanvas;
|
|
1145
1184
|
const projection = getBaseProjection(region, transform, baseW, baseH);
|
|
1146
1185
|
baseCtx.save();
|
|
1147
|
-
|
|
1186
|
+
_chunkYGIMK4NXcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
|
|
1148
1187
|
baseCtx.drawImage(
|
|
1149
1188
|
img,
|
|
1150
1189
|
region.x,
|
|
@@ -1159,8 +1198,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1159
1198
|
baseCtx.restore();
|
|
1160
1199
|
const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
|
|
1161
1200
|
if (imageData) {
|
|
1162
|
-
const layerMasks =
|
|
1163
|
-
|
|
1201
|
+
const layerMasks = _chunkYGIMK4NXcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
|
|
1202
|
+
_chunkYGIMK4NXcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
|
|
1164
1203
|
if (depthMask.enabled && depthMask.maskSource) {
|
|
1165
1204
|
try {
|
|
1166
1205
|
const maskImg = await this.imageCache.get(depthMask.maskSource);
|
|
@@ -1171,7 +1210,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1171
1210
|
const maskCtx = maskCanvas.getContext("2d");
|
|
1172
1211
|
if (maskCtx) {
|
|
1173
1212
|
maskCtx.save();
|
|
1174
|
-
|
|
1213
|
+
_chunkYGIMK4NXcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
|
|
1175
1214
|
maskCtx.drawImage(
|
|
1176
1215
|
maskImg,
|
|
1177
1216
|
region.x * sx,
|
|
@@ -1186,10 +1225,10 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1186
1225
|
maskCtx.restore();
|
|
1187
1226
|
const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
|
|
1188
1227
|
if (maskData) {
|
|
1189
|
-
|
|
1228
|
+
_chunkYGIMK4NXcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
|
|
1190
1229
|
}
|
|
1191
1230
|
}
|
|
1192
|
-
} catch (
|
|
1231
|
+
} catch (e7) {
|
|
1193
1232
|
}
|
|
1194
1233
|
}
|
|
1195
1234
|
_optionalChain([onPixels, 'optionalCall', _27 => _27(imageData)]);
|
|
@@ -1205,7 +1244,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1205
1244
|
else if (this.baseRoute === "layers") route = "layers";
|
|
1206
1245
|
else {
|
|
1207
1246
|
const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
|
|
1208
|
-
const shaped = this.baseRoute === "legacy" &&
|
|
1247
|
+
const shaped = this.baseRoute === "legacy" && _chunkYGIMK4NXcjs.isLegacyShape.call(void 0, stack);
|
|
1209
1248
|
route = shaped || needsLegacyBase({
|
|
1210
1249
|
stack,
|
|
1211
1250
|
region,
|
|
@@ -1251,14 +1290,14 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1251
1290
|
this.depthMaps.set(key, { width, height, data: data.data });
|
|
1252
1291
|
this.assetVersion++;
|
|
1253
1292
|
}
|
|
1254
|
-
} catch (
|
|
1293
|
+
} catch (e8) {
|
|
1255
1294
|
}
|
|
1256
1295
|
}
|
|
1257
1296
|
if (l.type === "annotation" && l.annotation.type === "image" && !this.imageCache.peek(l.annotation.src)) {
|
|
1258
1297
|
try {
|
|
1259
1298
|
await this.imageCache.get(l.annotation.src);
|
|
1260
1299
|
this.assetVersion++;
|
|
1261
|
-
} catch (
|
|
1300
|
+
} catch (e9) {
|
|
1262
1301
|
}
|
|
1263
1302
|
}
|
|
1264
1303
|
}
|
|
@@ -1286,7 +1325,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1286
1325
|
this.drawAnnotationShape(ctx, annotation, img);
|
|
1287
1326
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1288
1327
|
return new Uint8ClampedArray(ctx.getImageData(0, 0, rect.width, rect.height).data);
|
|
1289
|
-
} catch (
|
|
1328
|
+
} catch (e10) {
|
|
1290
1329
|
return null;
|
|
1291
1330
|
}
|
|
1292
1331
|
}
|
|
@@ -1339,17 +1378,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1339
1378
|
if (!comp) return null;
|
|
1340
1379
|
const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
|
|
1341
1380
|
const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
|
|
1342
|
-
const rotated =
|
|
1381
|
+
const rotated = _chunkYGIMK4NXcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1343
1382
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1344
1383
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1345
|
-
const key = `${comp.version}|${region.x},${region.y},${region.width},${region.height}|${
|
|
1384
|
+
const key = `${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkYGIMK4NXcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
|
|
1346
1385
|
if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
|
|
1347
1386
|
const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
|
|
1348
1387
|
const ctx = canvas.getContext("2d");
|
|
1349
1388
|
if (!ctx) return null;
|
|
1350
1389
|
ctx.clearRect(0, 0, baseW, baseH);
|
|
1351
1390
|
ctx.save();
|
|
1352
|
-
|
|
1391
|
+
_chunkYGIMK4NXcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
|
|
1353
1392
|
ctx.beginPath();
|
|
1354
1393
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1355
1394
|
ctx.clip();
|
|
@@ -1485,7 +1524,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1485
1524
|
_chunkXIOMMGPDcjs.blendImageData.call(void 0, backdrop, source, _chunkXIOMMGPDcjs.normalizeBlendMode.call(void 0, ann.blend));
|
|
1486
1525
|
lctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1487
1526
|
lctx.putImageData(backdrop, 0, 0);
|
|
1488
|
-
} catch (
|
|
1527
|
+
} catch (e11) {
|
|
1489
1528
|
return false;
|
|
1490
1529
|
}
|
|
1491
1530
|
ctx.save();
|
|
@@ -1501,7 +1540,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1501
1540
|
if (ann.type === "image") {
|
|
1502
1541
|
try {
|
|
1503
1542
|
img = await this.imageCache.get(ann.src);
|
|
1504
|
-
} catch (
|
|
1543
|
+
} catch (e12) {
|
|
1505
1544
|
}
|
|
1506
1545
|
}
|
|
1507
1546
|
this.drawAnnotationShape(ctx, ann, img);
|
|
@@ -1621,7 +1660,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1621
1660
|
ctx.strokeStyle = "#3b82f6";
|
|
1622
1661
|
ctx.lineWidth = 1.5;
|
|
1623
1662
|
ctx.setLineDash([4, 4]);
|
|
1624
|
-
const bounds =
|
|
1663
|
+
const bounds = _chunkYGIMK4NXcjs.getAnnotationBounds.call(void 0, ann);
|
|
1625
1664
|
const pad = 4;
|
|
1626
1665
|
ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
|
|
1627
1666
|
ctx.fillStyle = "#ffffff";
|
|
@@ -1642,7 +1681,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1642
1681
|
}
|
|
1643
1682
|
/** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
|
|
1644
1683
|
getAnnotationBounds(ann) {
|
|
1645
|
-
return
|
|
1684
|
+
return _chunkYGIMK4NXcjs.getAnnotationBounds.call(void 0, ann);
|
|
1646
1685
|
}
|
|
1647
1686
|
/**
|
|
1648
1687
|
* Draws a rule-of-thirds crop grid overlay. All rectangles come from
|
|
@@ -1724,8 +1763,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1724
1763
|
}
|
|
1725
1764
|
const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
|
|
1726
1765
|
const { crop, transform, annotations } = state;
|
|
1727
|
-
const region = crop ?
|
|
1728
|
-
const rotated =
|
|
1766
|
+
const region = crop ? _chunkYGIMK4NXcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
|
|
1767
|
+
const rotated = _chunkYGIMK4NXcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1729
1768
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1730
1769
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1731
1770
|
const exportW = options.width || baseW;
|
|
@@ -1754,7 +1793,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1754
1793
|
const bctx = baseCanvas.getContext("2d");
|
|
1755
1794
|
if (bctx) {
|
|
1756
1795
|
bctx.save();
|
|
1757
|
-
|
|
1796
|
+
_chunkYGIMK4NXcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
|
|
1758
1797
|
bctx.beginPath();
|
|
1759
1798
|
bctx.rect(region.x, region.y, region.width, region.height);
|
|
1760
1799
|
bctx.clip();
|
|
@@ -1767,7 +1806,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1767
1806
|
if (options.includeAnnotations !== false && overlay.length > 0) {
|
|
1768
1807
|
ctx.save();
|
|
1769
1808
|
ctx.scale(exportW / baseW, exportH / baseH);
|
|
1770
|
-
|
|
1809
|
+
_chunkYGIMK4NXcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
|
|
1771
1810
|
for (const ann of overlay) {
|
|
1772
1811
|
await this.drawAnnotation(ctx, ann);
|
|
1773
1812
|
}
|
|
@@ -1857,7 +1896,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1857
1896
|
case "rect":
|
|
1858
1897
|
case "image":
|
|
1859
1898
|
case "text": {
|
|
1860
|
-
const b =
|
|
1899
|
+
const b = _chunkYGIMK4NXcjs.getAnnotationBounds.call(void 0, ann);
|
|
1861
1900
|
ctx.fillRect(b.x, b.y, b.width, b.height);
|
|
1862
1901
|
break;
|
|
1863
1902
|
}
|
|
@@ -1877,7 +1916,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
|
|
|
1877
1916
|
function getBaseProjection(region, transform, baseW, baseH) {
|
|
1878
1917
|
return {
|
|
1879
1918
|
region,
|
|
1880
|
-
angle:
|
|
1919
|
+
angle: _chunkYGIMK4NXcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
1881
1920
|
flipH: transform.flipH,
|
|
1882
1921
|
flipV: transform.flipV,
|
|
1883
1922
|
scale: 1,
|
|
@@ -1981,8 +2020,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
1981
2020
|
}
|
|
1982
2021
|
function toMask(width, height, coverage) {
|
|
1983
2022
|
const out = new Uint8Array(coverage.length);
|
|
1984
|
-
for (let i = 0; i < out.length; i++) out[i] =
|
|
1985
|
-
return
|
|
2023
|
+
for (let i = 0; i < out.length; i++) out[i] = _chunkYGIMK4NXcjs.coverageToByte.call(void 0, coverage[i]);
|
|
2024
|
+
return _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, width, height, out);
|
|
1986
2025
|
}
|
|
1987
2026
|
function polygonSelection(width, height, points, options = {}) {
|
|
1988
2027
|
return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
|
|
@@ -2109,7 +2148,7 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2109
2148
|
const { width: w, height: h } = pixels;
|
|
2110
2149
|
const sx = Math.floor(seed.x);
|
|
2111
2150
|
const sy = Math.floor(seed.y);
|
|
2112
|
-
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return
|
|
2151
|
+
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, w, h);
|
|
2113
2152
|
const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
|
|
2114
2153
|
const marks = new Uint8Array(n);
|
|
2115
2154
|
let bx0 = w;
|
|
@@ -2157,9 +2196,9 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2157
2196
|
}
|
|
2158
2197
|
}
|
|
2159
2198
|
}
|
|
2160
|
-
if (bx1 < 0) return
|
|
2161
|
-
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return
|
|
2162
|
-
return
|
|
2199
|
+
if (bx1 < 0) return _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, w, h);
|
|
2200
|
+
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, w, h, marks);
|
|
2201
|
+
return _chunkYGIMK4NXcjs.createSelectionMask.call(void 0,
|
|
2163
2202
|
w,
|
|
2164
2203
|
h,
|
|
2165
2204
|
antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
|
|
@@ -2181,7 +2220,7 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2181
2220
|
const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
|
|
2182
2221
|
const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
|
|
2183
2222
|
const out = new Uint8Array(n);
|
|
2184
|
-
if (!parsed.length) return
|
|
2223
|
+
if (!parsed.length) return _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2185
2224
|
for (let i = 0; i < n; i++) {
|
|
2186
2225
|
const p = i * 4;
|
|
2187
2226
|
if (data[p + 3] <= 0) continue;
|
|
@@ -2197,9 +2236,9 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2197
2236
|
}
|
|
2198
2237
|
if (k > best) best = k;
|
|
2199
2238
|
}
|
|
2200
|
-
out[i] =
|
|
2239
|
+
out[i] = _chunkYGIMK4NXcjs.coverageToByte.call(void 0, best);
|
|
2201
2240
|
}
|
|
2202
|
-
return
|
|
2241
|
+
return _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2203
2242
|
}
|
|
2204
2243
|
var TONE_RANGE_PRESETS = {
|
|
2205
2244
|
shadows: [0, 65],
|
|
@@ -2217,9 +2256,9 @@ function toneRange(pixels, range, falloff = 20) {
|
|
|
2217
2256
|
if (d[p + 3] <= 0) continue;
|
|
2218
2257
|
const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
|
|
2219
2258
|
const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
|
|
2220
|
-
out[i] =
|
|
2259
|
+
out[i] = _chunkYGIMK4NXcjs.coverageToByte.call(void 0, 1 - outside / ramp);
|
|
2221
2260
|
}
|
|
2222
|
-
return
|
|
2261
|
+
return _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2223
2262
|
}
|
|
2224
2263
|
function hueRange(pixels, center) {
|
|
2225
2264
|
const n = checkPixels(pixels);
|
|
@@ -2242,9 +2281,9 @@ function hueRange(pixels, center) {
|
|
|
2242
2281
|
hue *= 60;
|
|
2243
2282
|
let dh = ((hue - center) % 360 + 360) % 360;
|
|
2244
2283
|
dh = Math.min(dh, 360 - dh);
|
|
2245
|
-
out[i] =
|
|
2284
|
+
out[i] = _chunkYGIMK4NXcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
|
|
2246
2285
|
}
|
|
2247
|
-
return
|
|
2286
|
+
return _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2248
2287
|
}
|
|
2249
2288
|
|
|
2250
2289
|
// src/image-editor/selection/refine.ts
|
|
@@ -2378,9 +2417,9 @@ function edgeWidth(guide, w, h, r) {
|
|
|
2378
2417
|
g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
|
|
2379
2418
|
}
|
|
2380
2419
|
}
|
|
2381
|
-
const gm =
|
|
2382
|
-
const hi =
|
|
2383
|
-
const lo =
|
|
2420
|
+
const gm = _chunkYGIMK4NXcjs.greyMorphology.call(void 0, g, w, h, r, true);
|
|
2421
|
+
const hi = _chunkYGIMK4NXcjs.greyMorphology.call(void 0, y, w, h, r, true);
|
|
2422
|
+
const lo = _chunkYGIMK4NXcjs.greyMorphology.call(void 0, y, w, h, r, false);
|
|
2384
2423
|
const out = new Float32Array(n);
|
|
2385
2424
|
for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
|
|
2386
2425
|
return out;
|
|
@@ -2404,7 +2443,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2404
2443
|
}
|
|
2405
2444
|
}
|
|
2406
2445
|
if (any) {
|
|
2407
|
-
const dist =
|
|
2446
|
+
const dist = _chunkYGIMK4NXcjs.distanceTransform.call(void 0, boundary, w, h);
|
|
2408
2447
|
const r = gfRadius(p);
|
|
2409
2448
|
const q = guidedFilterColor(guide, m, w, h, r);
|
|
2410
2449
|
const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
|
|
@@ -2430,7 +2469,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2430
2469
|
for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
|
|
2431
2470
|
}
|
|
2432
2471
|
const amount = shiftAmount(p);
|
|
2433
|
-
if (Math.abs(amount) >= 1e-4) a =
|
|
2472
|
+
if (Math.abs(amount) >= 1e-4) a = _chunkYGIMK4NXcjs.shiftCoverage.call(void 0, a, w, h, amount);
|
|
2434
2473
|
return a;
|
|
2435
2474
|
}
|
|
2436
2475
|
function guidePlanes(pixels, win) {
|
|
@@ -2474,9 +2513,9 @@ function refineSelection(pixels, mask, params = {}) {
|
|
|
2474
2513
|
const out = new Uint8Array(mask.width * mask.height);
|
|
2475
2514
|
for (let y = 0; y < wh; y++) {
|
|
2476
2515
|
const dst = (y0 + y) * mask.width + x0;
|
|
2477
|
-
for (let x = 0; x < ww; x++) out[dst + x] =
|
|
2516
|
+
for (let x = 0; x < ww; x++) out[dst + x] = _chunkYGIMK4NXcjs.coverageToByte.call(void 0, refined[y * ww + x]);
|
|
2478
2517
|
}
|
|
2479
|
-
return
|
|
2518
|
+
return _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
|
|
2480
2519
|
}
|
|
2481
2520
|
|
|
2482
2521
|
// src/image-editor/layers/text-shapers.ts
|
|
@@ -2635,7 +2674,7 @@ function createOutlineTextShaper(fonts, options = {}) {
|
|
|
2635
2674
|
// src/image-editor/free-transform.ts
|
|
2636
2675
|
var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
|
|
2637
2676
|
var fail = (message) => {
|
|
2638
|
-
throw new (0,
|
|
2677
|
+
throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(message);
|
|
2639
2678
|
};
|
|
2640
2679
|
var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
|
|
2641
2680
|
function previewStep(scale) {
|
|
@@ -2722,7 +2761,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2722
2761
|
} else {
|
|
2723
2762
|
const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
|
|
2724
2763
|
if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
|
|
2725
|
-
const layer =
|
|
2764
|
+
const layer = _chunkYGIMK4NXcjs.requireLayer.call(void 0, layers, id).layer;
|
|
2726
2765
|
this.layerId = layer.id;
|
|
2727
2766
|
const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
|
|
2728
2767
|
const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
|
|
@@ -2733,20 +2772,20 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2733
2772
|
if (!maskAlone && layer.type !== "pixel" && layer.type !== "smart" && layer.type !== "shape" && layer.type !== "type") fail(`Layer "${layer.name || id}" is a ${layer.type} layer; Free Transform works on pixel, shape, type and smart object layers, layer masks (channel mask) and selections.`);
|
|
2734
2773
|
if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
|
|
2735
2774
|
if (content !== "selection-copy") {
|
|
2736
|
-
|
|
2737
|
-
if (!maskAlone)
|
|
2775
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
|
|
2776
|
+
if (!maskAlone) _chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
|
|
2738
2777
|
}
|
|
2739
2778
|
const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
2740
2779
|
const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
|
|
2741
2780
|
if (layer.type === "smart" && !maskAlone) {
|
|
2742
2781
|
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).`);
|
|
2743
|
-
if (!
|
|
2782
|
+
if (!_chunkYGIMK4NXcjs.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.`);
|
|
2744
2783
|
this.smart = layer;
|
|
2745
2784
|
this.smartObject = true;
|
|
2746
|
-
this.startGeometry =
|
|
2785
|
+
this.startGeometry = _chunkYGIMK4NXcjs.placementGeometry.call(void 0, layer);
|
|
2747
2786
|
if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
|
|
2748
2787
|
this.startInterp = this.interp;
|
|
2749
|
-
this.box =
|
|
2788
|
+
this.box = _chunkYGIMK4NXcjs.contentsBox.call(void 0, layer.contents);
|
|
2750
2789
|
this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
|
|
2751
2790
|
this.geometryValue = this.startGeometry;
|
|
2752
2791
|
this.shown = this.startLayers;
|
|
@@ -2754,8 +2793,8 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2754
2793
|
}
|
|
2755
2794
|
if (layer.type === "type" && !maskAlone) {
|
|
2756
2795
|
if (content !== "layer") fail(`Layer "${layer.name || id}" is a type layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
|
|
2757
|
-
const frame =
|
|
2758
|
-
const m =
|
|
2796
|
+
const frame = _chunkYGIMK4NXcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
|
|
2797
|
+
const m = _chunkYGIMK4NXcjs.textMatrix.call(void 0, layer);
|
|
2759
2798
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
2760
2799
|
this.typeTarget = layer;
|
|
2761
2800
|
this.typeLayer = true;
|
|
@@ -2774,7 +2813,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2774
2813
|
}
|
|
2775
2814
|
if (layer.type === "shape" && !maskAlone) {
|
|
2776
2815
|
if (content !== "layer") fail(`Layer "${layer.name || id}" is a shape layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
|
|
2777
|
-
const g =
|
|
2816
|
+
const g = _chunkYGIMK4NXcjs.shapeGeometryBounds.call(void 0, layer);
|
|
2778
2817
|
if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
|
|
2779
2818
|
const w = Math.max(g.width, 1);
|
|
2780
2819
|
const h = Math.max(g.height, 1);
|
|
@@ -2822,7 +2861,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2822
2861
|
if (box) {
|
|
2823
2862
|
const copy = {
|
|
2824
2863
|
type: "pixel",
|
|
2825
|
-
id:
|
|
2864
|
+
id: _chunkYGIMK4NXcjs.newLayerId.call(void 0, ),
|
|
2826
2865
|
name: `${layer.name || "Layer"} copy`,
|
|
2827
2866
|
visible: true,
|
|
2828
2867
|
opacity: 1,
|
|
@@ -2846,7 +2885,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2846
2885
|
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).");
|
|
2847
2886
|
this.box = box;
|
|
2848
2887
|
this.moves = moves;
|
|
2849
|
-
this.startGeometry =
|
|
2888
|
+
this.startGeometry = _chunkYGIMK4NXcjs.identityTransform.call(void 0, box);
|
|
2850
2889
|
this.startInterp = this.interp;
|
|
2851
2890
|
this.geometryValue = this.startGeometry;
|
|
2852
2891
|
this.shown = this.startLayers;
|
|
@@ -2924,8 +2963,8 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2924
2963
|
warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
|
|
2925
2964
|
};
|
|
2926
2965
|
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.");
|
|
2927
|
-
if (!
|
|
2928
|
-
if (this.typeTarget && (
|
|
2966
|
+
if (!_chunkYGIMK4NXcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
|
|
2967
|
+
if (this.typeTarget && (_chunkYGIMK4NXcjs.hasWarp.call(void 0, next) || !_chunkYGIMK4NXcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
|
|
2929
2968
|
fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram, no warp); rasterize the layer (rasterize_layer) for distort, perspective or warp.");
|
|
2930
2969
|
}
|
|
2931
2970
|
this.geometryValue = next;
|
|
@@ -2937,10 +2976,10 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2937
2976
|
if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
|
|
2938
2977
|
if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
|
|
2939
2978
|
const g = this.geometryValue;
|
|
2940
|
-
const identity =
|
|
2941
|
-
const warp =
|
|
2942
|
-
const h = warp ? null :
|
|
2943
|
-
const f = warp ?
|
|
2979
|
+
const identity = _chunkYGIMK4NXcjs.isIdentityTransform.call(void 0, g);
|
|
2980
|
+
const warp = _chunkYGIMK4NXcjs.hasWarp.call(void 0, g);
|
|
2981
|
+
const h = warp ? null : _chunkYGIMK4NXcjs.geometryHomography.call(void 0, g);
|
|
2982
|
+
const f = warp ? _chunkYGIMK4NXcjs.transformMap.call(void 0, g) : null;
|
|
2944
2983
|
const step = final ? 1 : previewStep(preview.scale);
|
|
2945
2984
|
const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
|
|
2946
2985
|
let layers = this.startLayers;
|
|
@@ -2984,7 +3023,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
2984
3023
|
if (part.what === "selection") {
|
|
2985
3024
|
const { width, height } = this.host.canvas();
|
|
2986
3025
|
const data = new Uint8Array(_chunkXIOMMGPDcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
|
|
2987
|
-
const next =
|
|
3026
|
+
const next = _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, width, height, data);
|
|
2988
3027
|
selection = next.bounds ? next : null;
|
|
2989
3028
|
} else if (part.what === "pixels") {
|
|
2990
3029
|
layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, targetId, (l) => {
|
|
@@ -3006,14 +3045,14 @@ var FreeTransformSession = (_class4 = class {
|
|
|
3006
3045
|
resampleShape(final, preview, warpMap, h) {
|
|
3007
3046
|
const layer = this.shape;
|
|
3008
3047
|
let components = layer.components;
|
|
3009
|
-
if (!
|
|
3048
|
+
if (!_chunkYGIMK4NXcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
|
|
3010
3049
|
const affine = !warpMap && h && Math.abs(h[6]) < 1e-12 && Math.abs(h[7]) < 1e-12 && Math.abs(h[8] - 1) < 1e-12 ? [h[0], h[3], h[1], h[4], h[2], h[5]] : void 0;
|
|
3011
3050
|
const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p)));
|
|
3012
|
-
components =
|
|
3051
|
+
components = _chunkYGIMK4NXcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
|
|
3013
3052
|
}
|
|
3014
3053
|
const moved = { ...layer, components };
|
|
3015
3054
|
delete moved.annotation;
|
|
3016
|
-
const surface =
|
|
3055
|
+
const surface = _chunkYGIMK4NXcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
|
|
3017
3056
|
return _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
|
|
3018
3057
|
}
|
|
3019
3058
|
/**
|
|
@@ -3023,13 +3062,13 @@ var FreeTransformSession = (_class4 = class {
|
|
|
3023
3062
|
resampleType() {
|
|
3024
3063
|
const layer = this.typeTarget;
|
|
3025
3064
|
const g = this.geometryValue;
|
|
3026
|
-
if (
|
|
3027
|
-
const m =
|
|
3065
|
+
if (_chunkYGIMK4NXcjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
|
|
3066
|
+
const m = _chunkYGIMK4NXcjs.matrixFromCorners.call(void 0, g.box, g.corners);
|
|
3028
3067
|
if (!m) fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram); rasterize the layer for distort or perspective.");
|
|
3029
3068
|
const next = { ...layer, transform: m };
|
|
3030
3069
|
delete next.annotation;
|
|
3031
|
-
let layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () =>
|
|
3032
|
-
const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkW3GXSUSQcjs.invertMatrix.call(void 0,
|
|
3070
|
+
let layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkYGIMK4NXcjs.rerenderText.call(void 0, next, this.host.textEnv()));
|
|
3071
|
+
const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkW3GXSUSQcjs.invertMatrix.call(void 0, _chunkYGIMK4NXcjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
|
|
3033
3072
|
for (const part of this.parts) {
|
|
3034
3073
|
if (part.what !== "mask") continue;
|
|
3035
3074
|
const surface = _chunkPOGBUYWEcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
|
|
@@ -3045,12 +3084,12 @@ var FreeTransformSession = (_class4 = class {
|
|
|
3045
3084
|
const canvas = this.host.canvas();
|
|
3046
3085
|
try {
|
|
3047
3086
|
if (final) {
|
|
3048
|
-
const res =
|
|
3087
|
+
const res = _chunkYGIMK4NXcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
|
|
3049
3088
|
this.smartMasksMoved = res.masksMoved;
|
|
3050
3089
|
return res.layers;
|
|
3051
3090
|
}
|
|
3052
3091
|
const step = previewStep(preview.scale);
|
|
3053
|
-
const surface =
|
|
3092
|
+
const surface = _chunkYGIMK4NXcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
|
|
3054
3093
|
return _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
|
|
3055
3094
|
} catch (e) {
|
|
3056
3095
|
if (e instanceof _chunkPOGBUYWEcjs.TransformTooLargeError) fail(e.message);
|
|
@@ -3060,10 +3099,10 @@ var FreeTransformSession = (_class4 = class {
|
|
|
3060
3099
|
/** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
|
|
3061
3100
|
isChanged() {
|
|
3062
3101
|
const g = this.geometryValue;
|
|
3063
|
-
if (!this.smart && !this.typeTarget) return !
|
|
3102
|
+
if (!this.smart && !this.typeTarget) return !_chunkYGIMK4NXcjs.isIdentityTransform.call(void 0, g);
|
|
3064
3103
|
const a = this.startGeometry;
|
|
3065
3104
|
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);
|
|
3066
|
-
const warp = (w, box) => w &&
|
|
3105
|
+
const warp = (w, box) => w && _chunkYGIMK4NXcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
|
|
3067
3106
|
return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
|
|
3068
3107
|
}
|
|
3069
3108
|
render(preview) {
|
|
@@ -3113,7 +3152,7 @@ var FreeTransformSession = (_class4 = class {
|
|
|
3113
3152
|
}, _class4);
|
|
3114
3153
|
|
|
3115
3154
|
// src/image-editor/controller.ts
|
|
3116
|
-
var IMAGE_EDITOR_SCHEMA_VERSION =
|
|
3155
|
+
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkYGIMK4NXcjs.LAYERED_SCHEMA_VERSION;
|
|
3117
3156
|
function paintCoverageInto(base, coverage, apply, rects) {
|
|
3118
3157
|
const tiles = new Map(base.tiles);
|
|
3119
3158
|
const done = /* @__PURE__ */ new Set();
|
|
@@ -3211,7 +3250,7 @@ var PaintStrokeSession = (_class5 = class {
|
|
|
3211
3250
|
for (const t of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
|
|
3212
3251
|
const key = _chunkXIOMMGPDcjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3213
3252
|
const cur = regions.get(key);
|
|
3214
|
-
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ?
|
|
3253
|
+
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkYGIMK4NXcjs.unionRect.call(void 0, cur.r, r) : r });
|
|
3215
3254
|
}
|
|
3216
3255
|
}
|
|
3217
3256
|
for (const [key, { tx, ty, r }] of regions) {
|
|
@@ -3225,7 +3264,7 @@ var PaintStrokeSession = (_class5 = class {
|
|
|
3225
3264
|
}
|
|
3226
3265
|
/** Finishes the stroke (one undo step) and returns what changed. */
|
|
3227
3266
|
end() {
|
|
3228
|
-
if (this.closed) throw new (0,
|
|
3267
|
+
if (this.closed) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("This stroke has already ended.");
|
|
3229
3268
|
const last = _nullishCoalesce(this.last, () => ( void 0));
|
|
3230
3269
|
this.update(this.mixer ? this.mixer.finish(last) : this.stroke.finish(last));
|
|
3231
3270
|
this.closed = true;
|
|
@@ -3262,20 +3301,20 @@ function sameTile(a, b) {
|
|
|
3262
3301
|
for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
|
|
3263
3302
|
return true;
|
|
3264
3303
|
}
|
|
3265
|
-
var DEFAULT_ADJUSTMENTS =
|
|
3304
|
+
var DEFAULT_ADJUSTMENTS = _chunkYGIMK4NXcjs.DEFAULT_ADJUSTMENTS_VALUES;
|
|
3266
3305
|
function normalizeStoredAdjustments(stored) {
|
|
3267
3306
|
if (!stored) return { ...DEFAULT_ADJUSTMENTS };
|
|
3268
3307
|
const out = {
|
|
3269
3308
|
...DEFAULT_ADJUSTMENTS,
|
|
3270
3309
|
...stored,
|
|
3271
|
-
process:
|
|
3310
|
+
process: _chunkYGIMK4NXcjs.normalizeProcessVersion.call(void 0, stored.process)
|
|
3272
3311
|
};
|
|
3273
|
-
const layers =
|
|
3312
|
+
const layers = _chunkYGIMK4NXcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
|
|
3274
3313
|
if (layers.length) out.layers = layers;
|
|
3275
3314
|
else delete out.layers;
|
|
3276
3315
|
return out;
|
|
3277
3316
|
}
|
|
3278
|
-
var isLayered = (data) => Boolean(data && data.version ===
|
|
3317
|
+
var isLayered = (data) => Boolean(data && data.version === _chunkYGIMK4NXcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
|
|
3279
3318
|
function migrateSerializedImageEditorState(data) {
|
|
3280
3319
|
if (isLayered(data)) {
|
|
3281
3320
|
const out = {
|
|
@@ -3307,10 +3346,10 @@ function migrateSerializedImageEditorState(data) {
|
|
|
3307
3346
|
function migrateToLayeredState(data, size) {
|
|
3308
3347
|
const clean = migrateSerializedImageEditorState(data);
|
|
3309
3348
|
if (isLayered(clean)) return clean;
|
|
3310
|
-
const stack =
|
|
3311
|
-
const { layers, assets } =
|
|
3349
|
+
const stack = _chunkYGIMK4NXcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
|
|
3350
|
+
const { layers, assets } = _chunkYGIMK4NXcjs.serializeLayers.call(void 0, stack.layers);
|
|
3312
3351
|
const out = {
|
|
3313
|
-
version:
|
|
3352
|
+
version: _chunkYGIMK4NXcjs.LAYERED_SCHEMA_VERSION,
|
|
3314
3353
|
width: Math.round(size.width),
|
|
3315
3354
|
height: Math.round(size.height),
|
|
3316
3355
|
layers,
|
|
@@ -3324,8 +3363,8 @@ function migrateToLayeredState(data, size) {
|
|
|
3324
3363
|
if (clean.selection) out.selection = clean.selection;
|
|
3325
3364
|
return out;
|
|
3326
3365
|
}
|
|
3327
|
-
var DEFAULT_TRANSFORM =
|
|
3328
|
-
var DEFAULT_DEPTH_MASK =
|
|
3366
|
+
var DEFAULT_TRANSFORM = _chunkYGIMK4NXcjs.DEFAULT_TRANSFORM_VALUES;
|
|
3367
|
+
var DEFAULT_DEPTH_MASK = _chunkYGIMK4NXcjs.DEFAULT_DEPTH_MASK_VALUES;
|
|
3329
3368
|
var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
|
|
3330
3369
|
var ImageEditorController = (_class6 = class {
|
|
3331
3370
|
|
|
@@ -3348,7 +3387,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3348
3387
|
__init48() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
|
|
3349
3388
|
__init49() {this.viewKey = []}
|
|
3350
3389
|
/** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
|
|
3351
|
-
__init50() {this.compositor = new (0,
|
|
3390
|
+
__init50() {this.compositor = new (0, _chunkYGIMK4NXcjs.LayerCompositor)()}
|
|
3352
3391
|
constructor(options = {}) {;_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);_class6.prototype.__init58.call(this);_class6.prototype.__init59.call(this);_class6.prototype.__init60.call(this);_class6.prototype.__init61.call(this);
|
|
3353
3392
|
this.maxHistoryDepth = _nullishCoalesce(options.maxHistoryDepth, () => ( 50));
|
|
3354
3393
|
if (options.textShaper !== void 0) this.textShaperValue = options.textShaper;
|
|
@@ -3398,8 +3437,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
3398
3437
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
3399
3438
|
if (_optionalChain([options, 'access', _117 => _117.initialState, 'optionalAccess', _118 => _118.selection])) {
|
|
3400
3439
|
try {
|
|
3401
|
-
this.state.selection = normalizeSelection(
|
|
3402
|
-
} catch (
|
|
3440
|
+
this.state.selection = normalizeSelection(_chunkYGIMK4NXcjs.deserializeSelection.call(void 0, options.initialState.selection));
|
|
3441
|
+
} catch (e13) {
|
|
3403
3442
|
}
|
|
3404
3443
|
}
|
|
3405
3444
|
this.initialSnapshot = this.captureHistoryEntry();
|
|
@@ -3441,7 +3480,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3441
3480
|
height: img.naturalHeight || img.height || 600
|
|
3442
3481
|
}
|
|
3443
3482
|
};
|
|
3444
|
-
} catch (
|
|
3483
|
+
} catch (e14) {
|
|
3445
3484
|
return { sourceUrl: src, element: null, dimensions: { ...this.state.imageDimensions } };
|
|
3446
3485
|
}
|
|
3447
3486
|
}
|
|
@@ -3490,7 +3529,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3490
3529
|
if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
|
|
3491
3530
|
this.viewKey = key;
|
|
3492
3531
|
const { width, height } = this.naturalSize;
|
|
3493
|
-
const view =
|
|
3532
|
+
const view = _chunkYGIMK4NXcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
|
|
3494
3533
|
s.adjustments = view.adjustments;
|
|
3495
3534
|
s.depthMask = view.depthMask;
|
|
3496
3535
|
s.annotations = view.annotations;
|
|
@@ -3635,7 +3674,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3635
3674
|
applyCropPreset(ratio) {
|
|
3636
3675
|
this.recordHistory();
|
|
3637
3676
|
const { width, height } = this.state.imageDimensions;
|
|
3638
|
-
if (ratio &&
|
|
3677
|
+
if (ratio && _chunkYGIMK4NXcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
|
|
3639
3678
|
ratio = 1 / ratio;
|
|
3640
3679
|
}
|
|
3641
3680
|
if (!ratio) {
|
|
@@ -3717,7 +3756,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3717
3756
|
*/
|
|
3718
3757
|
getLayerPixels(id) {
|
|
3719
3758
|
const layer = this.getLayer(id);
|
|
3720
|
-
if (!layer || !
|
|
3759
|
+
if (!layer || !_chunkYGIMK4NXcjs.hasSurface.call(void 0, layer)) return null;
|
|
3721
3760
|
const surface = this.surfaceOf(layer);
|
|
3722
3761
|
const b = _chunkXIOMMGPDcjs.contentBounds.call(void 0, surface);
|
|
3723
3762
|
if (!b) return null;
|
|
@@ -3730,7 +3769,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3730
3769
|
*/
|
|
3731
3770
|
getLayerBounds(id) {
|
|
3732
3771
|
const layer = this.getLayer(id);
|
|
3733
|
-
if (!layer || !
|
|
3772
|
+
if (!layer || !_chunkYGIMK4NXcjs.hasSurface.call(void 0, layer)) return null;
|
|
3734
3773
|
const surface = this.surfaceOf(layer);
|
|
3735
3774
|
let b = this.boundsCache.get(surface);
|
|
3736
3775
|
if (b === void 0) {
|
|
@@ -3745,9 +3784,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
3745
3784
|
*/
|
|
3746
3785
|
getLayerDataURL(id) {
|
|
3747
3786
|
const layer = this.getLayer(id);
|
|
3748
|
-
if (!layer || !
|
|
3787
|
+
if (!layer || !_chunkYGIMK4NXcjs.hasSurface.call(void 0, layer)) return null;
|
|
3749
3788
|
const surface = this.surfaceOf(layer);
|
|
3750
|
-
const enc =
|
|
3789
|
+
const enc = _chunkYGIMK4NXcjs.encodeSurface.call(void 0, surface);
|
|
3751
3790
|
return enc ? enc.url : null;
|
|
3752
3791
|
}
|
|
3753
3792
|
/**
|
|
@@ -3853,7 +3892,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3853
3892
|
const data = ctx.getImageData(0, 0, width, height);
|
|
3854
3893
|
if (!_optionalChain([data, 'optionalAccess', _130 => _130.data]) || data.data.length < width * height * 4) return null;
|
|
3855
3894
|
return { width, height, data: data.data };
|
|
3856
|
-
} catch (
|
|
3895
|
+
} catch (e15) {
|
|
3857
3896
|
return null;
|
|
3858
3897
|
}
|
|
3859
3898
|
}
|
|
@@ -3886,19 +3925,19 @@ var ImageEditorController = (_class6 = class {
|
|
|
3886
3925
|
if (init.pixels) {
|
|
3887
3926
|
const px2 = init.pixels;
|
|
3888
3927
|
if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
|
|
3889
|
-
throw new (0,
|
|
3928
|
+
throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
|
|
3890
3929
|
}
|
|
3891
3930
|
surface = _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, px2, 4);
|
|
3892
3931
|
} else if (init.color !== void 0) {
|
|
3893
3932
|
const c = parseColor(init.color);
|
|
3894
3933
|
surface = _chunkXIOMMGPDcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkXIOMMGPDcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
|
|
3895
3934
|
}
|
|
3896
|
-
const blend =
|
|
3897
|
-
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
3935
|
+
const blend = _chunkYGIMK4NXcjs.parseBlend.call(void 0, init.blend);
|
|
3936
|
+
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
3898
3937
|
const ids = new Set(_chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
3899
3938
|
const layer = {
|
|
3900
3939
|
type: "pixel",
|
|
3901
|
-
id: init.id && !ids.has(init.id) ? init.id :
|
|
3940
|
+
id: init.id && !ids.has(init.id) ? init.id : _chunkYGIMK4NXcjs.newLayerId.call(void 0, ),
|
|
3902
3941
|
name: _optionalChain([init, 'access', _132 => _132.name, 'optionalAccess', _133 => _133.trim, 'call', _134 => _134()]) || this.nextLayerName(),
|
|
3903
3942
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
3904
3943
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
@@ -3907,7 +3946,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3907
3946
|
offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
|
|
3908
3947
|
};
|
|
3909
3948
|
if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
|
|
3910
|
-
const next =
|
|
3949
|
+
const next = _chunkYGIMK4NXcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
3911
3950
|
this.commitLayers(next, () => {
|
|
3912
3951
|
this.state.activeLayerId = layer.id;
|
|
3913
3952
|
this.state.activeTarget = "pixels";
|
|
@@ -3931,7 +3970,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3931
3970
|
try {
|
|
3932
3971
|
const bytes = _chunkPOGBUYWEcjs.base64ToBytes.call(void 0, trimmed);
|
|
3933
3972
|
if (_chunkPOGBUYWEcjs.isPng.call(void 0, bytes)) png = bytes;
|
|
3934
|
-
} catch (
|
|
3973
|
+
} catch (e16) {
|
|
3935
3974
|
png = null;
|
|
3936
3975
|
}
|
|
3937
3976
|
}
|
|
@@ -3939,20 +3978,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
3939
3978
|
try {
|
|
3940
3979
|
const d = _chunkPOGBUYWEcjs.decodePng.call(void 0, png);
|
|
3941
3980
|
return { width: d.width, height: d.height, data: d.data };
|
|
3942
|
-
} catch (
|
|
3981
|
+
} catch (e17) {
|
|
3943
3982
|
}
|
|
3944
3983
|
}
|
|
3945
3984
|
const src = png ? `data:image/png;base64,${_chunkPOGBUYWEcjs.bytesToBase64.call(void 0, png)}` : trimmed;
|
|
3946
3985
|
let img;
|
|
3947
3986
|
try {
|
|
3948
3987
|
img = await this.renderer.imageCache.get(src);
|
|
3949
|
-
} catch (
|
|
3950
|
-
throw new (0,
|
|
3988
|
+
} catch (e18) {
|
|
3989
|
+
throw new (0, _chunkYGIMK4NXcjs.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.");
|
|
3951
3990
|
}
|
|
3952
3991
|
const w = img.naturalWidth || img.width;
|
|
3953
3992
|
const h = img.naturalHeight || img.height;
|
|
3954
3993
|
const ctx = this.renderer.createCanvas(w, h).getContext("2d");
|
|
3955
|
-
if (!ctx || typeof ctx.getImageData !== "function") throw new (0,
|
|
3994
|
+
if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
|
|
3956
3995
|
ctx.drawImage(img, 0, 0, w, h);
|
|
3957
3996
|
const data = ctx.getImageData(0, 0, w, h);
|
|
3958
3997
|
return { width: w, height: h, data: data.data };
|
|
@@ -3965,7 +4004,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
3965
4004
|
}
|
|
3966
4005
|
/** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
|
|
3967
4006
|
duplicateLayer(id, name) {
|
|
3968
|
-
const res =
|
|
4007
|
+
const res = _chunkYGIMK4NXcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
|
|
3969
4008
|
this.commitLayers(res.layers, () => {
|
|
3970
4009
|
this.state.activeLayerId = res.id;
|
|
3971
4010
|
});
|
|
@@ -3973,16 +4012,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
3973
4012
|
}
|
|
3974
4013
|
/** Deletes a layer (refused when locked), as one undo step. */
|
|
3975
4014
|
removeLayer(id) {
|
|
3976
|
-
const next =
|
|
4015
|
+
const next = _chunkYGIMK4NXcjs.removeLayer.call(void 0, this.state.layers, id);
|
|
3977
4016
|
this.commitLayers(next, () => {
|
|
3978
|
-
if (this.state.selectedAnnotationId && !_chunkPOGBUYWEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([
|
|
4017
|
+
if (this.state.selectedAnnotationId && !_chunkPOGBUYWEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkYGIMK4NXcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _136 => _136.id]) === this.state.selectedAnnotationId)) {
|
|
3979
4018
|
this.state.selectedAnnotationId = null;
|
|
3980
4019
|
}
|
|
3981
4020
|
});
|
|
3982
4021
|
}
|
|
3983
4022
|
/** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
|
|
3984
4023
|
moveLayer(id, placement) {
|
|
3985
|
-
const next =
|
|
4024
|
+
const next = _chunkYGIMK4NXcjs.moveLayer.call(void 0, this.state.layers, id, placement);
|
|
3986
4025
|
const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, next, id);
|
|
3987
4026
|
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _137 => _137.parent, 'optionalAccess', _138 => _138.id]), () => ( null)), index: loc.index };
|
|
3988
4027
|
this.commitLayers(next);
|
|
@@ -3993,23 +4032,23 @@ var ImageEditorController = (_class6 = class {
|
|
|
3993
4032
|
* one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
|
|
3994
4033
|
*/
|
|
3995
4034
|
setLayerProperties(id, props, commitToHistory = true) {
|
|
3996
|
-
const next =
|
|
4035
|
+
const next = _chunkYGIMK4NXcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
|
|
3997
4036
|
this.commitLayers(next, void 0, commitToHistory);
|
|
3998
4037
|
return _chunkPOGBUYWEcjs.findLayer.call(void 0, next, id).layer;
|
|
3999
4038
|
}
|
|
4000
4039
|
/** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
|
|
4001
4040
|
addGroup(init = {}) {
|
|
4002
|
-
const blend = init.blend === void 0 ? "pass-through" :
|
|
4041
|
+
const blend = init.blend === void 0 ? "pass-through" : _chunkYGIMK4NXcjs.parseBlend.call(void 0, init.blend, true);
|
|
4003
4042
|
const group = {
|
|
4004
4043
|
type: "group",
|
|
4005
|
-
id:
|
|
4044
|
+
id: _chunkYGIMK4NXcjs.newLayerId.call(void 0, "group"),
|
|
4006
4045
|
name: _optionalChain([init, 'access', _141 => _141.name, 'optionalAccess', _142 => _142.trim, 'call', _143 => _143()]) || "Group",
|
|
4007
4046
|
visible: true,
|
|
4008
4047
|
opacity: 1,
|
|
4009
4048
|
blend,
|
|
4010
4049
|
children: []
|
|
4011
4050
|
};
|
|
4012
|
-
const next =
|
|
4051
|
+
const next = _chunkYGIMK4NXcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
|
|
4013
4052
|
this.commitLayers(next, () => {
|
|
4014
4053
|
this.state.activeLayerId = group.id;
|
|
4015
4054
|
this.state.activeTarget = "pixels";
|
|
@@ -4018,7 +4057,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4018
4057
|
}
|
|
4019
4058
|
/** Puts sibling layers into a new group (one undo step). Returns the group id. */
|
|
4020
4059
|
groupLayers(ids, name) {
|
|
4021
|
-
const res =
|
|
4060
|
+
const res = _chunkYGIMK4NXcjs.groupLayers.call(void 0, this.state.layers, ids, name);
|
|
4022
4061
|
this.commitLayers(res.layers, () => {
|
|
4023
4062
|
this.state.activeLayerId = res.id;
|
|
4024
4063
|
});
|
|
@@ -4026,7 +4065,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4026
4065
|
}
|
|
4027
4066
|
/** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
|
|
4028
4067
|
ungroupLayer(id) {
|
|
4029
|
-
const res =
|
|
4068
|
+
const res = _chunkYGIMK4NXcjs.ungroupLayer.call(void 0, this.state.layers, id);
|
|
4030
4069
|
this.commitLayers(res.layers);
|
|
4031
4070
|
return res.ids;
|
|
4032
4071
|
}
|
|
@@ -4035,38 +4074,38 @@ var ImageEditorController = (_class6 = class {
|
|
|
4035
4074
|
* (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
|
|
4036
4075
|
*/
|
|
4037
4076
|
offsetLayer(id, move, commitToHistory = true) {
|
|
4038
|
-
const layer =
|
|
4077
|
+
const layer = _chunkYGIMK4NXcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
4039
4078
|
if (layer.type === "smart") {
|
|
4040
4079
|
const tl = layer.placement.corners[0];
|
|
4041
4080
|
const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
4042
4081
|
const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
4043
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
4044
|
-
this.commitLayers(
|
|
4082
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("x and y must be numbers.");
|
|
4083
|
+
this.commitLayers(_chunkYGIMK4NXcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
|
|
4045
4084
|
const moved = _chunkPOGBUYWEcjs.findLayer.call(void 0, this.state.layers, id).layer;
|
|
4046
4085
|
return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
|
|
4047
4086
|
}
|
|
4048
4087
|
if (layer.type === "shape") {
|
|
4049
|
-
const g = _nullishCoalesce(
|
|
4088
|
+
const g = _nullishCoalesce(_chunkYGIMK4NXcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
|
|
4050
4089
|
const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
4051
4090
|
const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
4052
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
4053
|
-
|
|
4054
|
-
let moved =
|
|
4091
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("x and y must be numbers.");
|
|
4092
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
4093
|
+
let moved = _chunkYGIMK4NXcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
|
|
4055
4094
|
const mask = layer.mask;
|
|
4056
4095
|
if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkXIOMMGPDcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
|
|
4057
4096
|
this.commitLayers(_chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
4058
|
-
const b = _nullishCoalesce(
|
|
4097
|
+
const b = _nullishCoalesce(_chunkYGIMK4NXcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
|
|
4059
4098
|
return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
|
|
4060
4099
|
}
|
|
4061
4100
|
if (layer.type === "type") {
|
|
4062
4101
|
const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
|
|
4063
4102
|
const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
|
|
4064
4103
|
const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
|
|
4065
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
4066
|
-
|
|
4104
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("x and y must be numbers.");
|
|
4105
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
4067
4106
|
const mx = Math.round(dx);
|
|
4068
4107
|
const my = Math.round(dy);
|
|
4069
|
-
let moved = { ...
|
|
4108
|
+
let moved = { ..._chunkYGIMK4NXcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkXIOMMGPDcjs.translateSurface.call(void 0, layer.surface, mx, my) };
|
|
4070
4109
|
const mask = layer.mask;
|
|
4071
4110
|
if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkXIOMMGPDcjs.translateSurface.call(void 0, mask.surface, mx, my) } };
|
|
4072
4111
|
this.commitLayers(_chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
@@ -4076,7 +4115,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4076
4115
|
const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
4077
4116
|
const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
|
|
4078
4117
|
const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
|
|
4079
|
-
const next =
|
|
4118
|
+
const next = _chunkYGIMK4NXcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
|
|
4080
4119
|
this.commitLayers(next, void 0, commitToHistory);
|
|
4081
4120
|
return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
|
|
4082
4121
|
}
|
|
@@ -4086,11 +4125,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
4086
4125
|
* target when the layer is active.
|
|
4087
4126
|
*/
|
|
4088
4127
|
addLayerMask(id, from = "reveal-all", props = {}) {
|
|
4089
|
-
const layer =
|
|
4128
|
+
const layer = _chunkYGIMK4NXcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
4090
4129
|
let mask;
|
|
4091
4130
|
if (from === "selection") {
|
|
4092
4131
|
const sel = this.state.selection;
|
|
4093
|
-
if (!_optionalChain([sel, 'optionalAccess', _144 => _144.bounds])) throw new (0,
|
|
4132
|
+
if (!_optionalChain([sel, 'optionalAccess', _144 => _144.bounds])) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
4094
4133
|
mask = this.maskFromSelection(sel, props);
|
|
4095
4134
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
4096
4135
|
mask = { ...mask, surface: _chunkXIOMMGPDcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
@@ -4099,7 +4138,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4099
4138
|
const v = from === "reveal-all" ? 255 : 0;
|
|
4100
4139
|
mask = withMaskProps({ surface: _chunkXIOMMGPDcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
4101
4140
|
}
|
|
4102
|
-
const next =
|
|
4141
|
+
const next = _chunkYGIMK4NXcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
|
|
4103
4142
|
this.commitLayers(next, () => {
|
|
4104
4143
|
if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
|
|
4105
4144
|
});
|
|
@@ -4107,18 +4146,18 @@ var ImageEditorController = (_class6 = class {
|
|
|
4107
4146
|
}
|
|
4108
4147
|
/** Removes a layer's mask (one undo step). */
|
|
4109
4148
|
removeLayerMask(id) {
|
|
4110
|
-
const layer =
|
|
4111
|
-
if (!layer.mask) throw new (0,
|
|
4112
|
-
this.commitLayers(
|
|
4149
|
+
const layer = _chunkYGIMK4NXcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
4150
|
+
if (!layer.mask) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
4151
|
+
this.commitLayers(_chunkYGIMK4NXcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
|
|
4113
4152
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
4114
4153
|
});
|
|
4115
4154
|
}
|
|
4116
4155
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
4117
4156
|
setLayerMaskProps(id, props, commitToHistory = true) {
|
|
4118
|
-
const layer =
|
|
4119
|
-
if (!layer.mask) throw new (0,
|
|
4157
|
+
const layer = _chunkYGIMK4NXcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
4158
|
+
if (!layer.mask) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
4120
4159
|
const mask = withMaskProps(layer.mask, props);
|
|
4121
|
-
this.commitLayers(
|
|
4160
|
+
this.commitLayers(_chunkYGIMK4NXcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
|
|
4122
4161
|
return mask;
|
|
4123
4162
|
}
|
|
4124
4163
|
/**
|
|
@@ -4126,11 +4165,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
4126
4165
|
* the depth map) and removes the mask, as one undo step.
|
|
4127
4166
|
*/
|
|
4128
4167
|
async applyLayerMask(id) {
|
|
4129
|
-
const loc =
|
|
4168
|
+
const loc = _chunkYGIMK4NXcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
4130
4169
|
const layer = loc.layer;
|
|
4131
|
-
if (layer.type !== "pixel") throw new (0,
|
|
4132
|
-
if (!layer.mask) throw new (0,
|
|
4133
|
-
|
|
4170
|
+
if (layer.type !== "pixel") throw new (0, _chunkYGIMK4NXcjs.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.`);
|
|
4171
|
+
if (!layer.mask) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
4172
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
|
|
4134
4173
|
const { width, height } = this.naturalSize;
|
|
4135
4174
|
await this.renderer.prepareLayerAssets([layer], width, height);
|
|
4136
4175
|
const sources = this.renderer.compositorSources(width, height);
|
|
@@ -4163,13 +4202,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
4163
4202
|
*/
|
|
4164
4203
|
layerViaCopy(options = {}) {
|
|
4165
4204
|
const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
|
|
4166
|
-
if (!id) throw new (0,
|
|
4167
|
-
const loc =
|
|
4205
|
+
if (!id) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
|
|
4206
|
+
const loc = _chunkYGIMK4NXcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
4168
4207
|
const layer = loc.layer;
|
|
4169
|
-
if (layer.type !== "pixel") throw new (0,
|
|
4208
|
+
if (layer.type !== "pixel") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
|
|
4170
4209
|
const sel = this.state.selection;
|
|
4171
|
-
if (!_optionalChain([sel, 'optionalAccess', _145 => _145.bounds])) throw new (0,
|
|
4172
|
-
if (options.cut)
|
|
4210
|
+
if (!_optionalChain([sel, 'optionalAccess', _145 => _145.bounds])) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
|
|
4211
|
+
if (options.cut) _chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
|
|
4173
4212
|
const surface = this.surfaceOf(layer);
|
|
4174
4213
|
const sb = sel.bounds;
|
|
4175
4214
|
const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
|
|
@@ -4185,7 +4224,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4185
4224
|
}
|
|
4186
4225
|
const copy = {
|
|
4187
4226
|
type: "pixel",
|
|
4188
|
-
id:
|
|
4227
|
+
id: _chunkYGIMK4NXcjs.newLayerId.call(void 0, ),
|
|
4189
4228
|
name: _optionalChain([options, 'access', _146 => _146.name, 'optionalAccess', _147 => _147.trim, 'call', _148 => _148()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
4190
4229
|
visible: true,
|
|
4191
4230
|
opacity: 1,
|
|
@@ -4258,7 +4297,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4258
4297
|
* Refused while another transform is open.
|
|
4259
4298
|
*/
|
|
4260
4299
|
beginFreeTransform(init = {}) {
|
|
4261
|
-
if (this.getFreeTransform()) throw new (0,
|
|
4300
|
+
if (this.getFreeTransform()) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
|
|
4262
4301
|
const session = new FreeTransformSession(this.transformHost(), init);
|
|
4263
4302
|
this.openTransform = session;
|
|
4264
4303
|
this.notify();
|
|
@@ -4272,26 +4311,26 @@ var ImageEditorController = (_class6 = class {
|
|
|
4272
4311
|
*/
|
|
4273
4312
|
transformLayer(spec) {
|
|
4274
4313
|
const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
|
|
4275
|
-
if (given > 1) throw new (0,
|
|
4276
|
-
if (!given && spec.warp === void 0) throw new (0,
|
|
4314
|
+
if (given > 1) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give only one of matrix, corners and params.");
|
|
4315
|
+
if (!given && spec.warp === void 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
|
|
4277
4316
|
if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
|
|
4278
|
-
throw new (0,
|
|
4317
|
+
throw new (0, _chunkYGIMK4NXcjs.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).");
|
|
4279
4318
|
}
|
|
4280
4319
|
if (spec.matrix) {
|
|
4281
4320
|
const [a, b, c, d] = spec.matrix;
|
|
4282
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
4321
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
|
|
4283
4322
|
}
|
|
4284
4323
|
const session = this.beginFreeTransform(spec);
|
|
4285
4324
|
try {
|
|
4286
4325
|
const g = session.startGeometry;
|
|
4287
|
-
const corners = spec.matrix ? g.corners.map((p) => _chunkW3GXSUSQcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ?
|
|
4326
|
+
const corners = spec.matrix ? g.corners.map((p) => _chunkW3GXSUSQcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkYGIMK4NXcjs.applyParams.call(void 0, g, spec.params) : g.corners;
|
|
4288
4327
|
let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
|
|
4289
4328
|
if (spec.warp) {
|
|
4290
4329
|
if ("style" in spec.warp) {
|
|
4291
|
-
if (!_chunkW3GXSUSQcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0,
|
|
4292
|
-
warp =
|
|
4330
|
+
if (!_chunkW3GXSUSQcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkW3GXSUSQcjs.WARP_STYLES.join(", ")}.`);
|
|
4331
|
+
warp = _chunkYGIMK4NXcjs.presetWarp.call(void 0, session.box, spec.warp);
|
|
4293
4332
|
} else {
|
|
4294
|
-
if (!
|
|
4333
|
+
if (!_chunkYGIMK4NXcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkYGIMK4NXcjs.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.");
|
|
4295
4334
|
warp = spec.warp;
|
|
4296
4335
|
}
|
|
4297
4336
|
}
|
|
@@ -4304,10 +4343,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4304
4343
|
}
|
|
4305
4344
|
/** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
|
|
4306
4345
|
flipLayer(axis, init = {}) {
|
|
4307
|
-
if (axis !== "horizontal" && axis !== "vertical") throw new (0,
|
|
4346
|
+
if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
|
|
4308
4347
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
4309
4348
|
try {
|
|
4310
|
-
session.update({ corners:
|
|
4349
|
+
session.update({ corners: _chunkYGIMK4NXcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
|
|
4311
4350
|
return session.commit();
|
|
4312
4351
|
} catch (e) {
|
|
4313
4352
|
session.cancel();
|
|
@@ -4319,10 +4358,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4319
4358
|
* centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
|
|
4320
4359
|
*/
|
|
4321
4360
|
rotateLayer90(turn, init = {}) {
|
|
4322
|
-
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0,
|
|
4361
|
+
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
|
|
4323
4362
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
4324
4363
|
try {
|
|
4325
|
-
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(
|
|
4364
|
+
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkYGIMK4NXcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
|
|
4326
4365
|
const cx = b.x + b.width / 2;
|
|
4327
4366
|
const cy = b.y + b.height / 2;
|
|
4328
4367
|
const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
|
|
@@ -4337,20 +4376,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
4337
4376
|
}
|
|
4338
4377
|
/** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
|
|
4339
4378
|
addLayerFilter(id, filter) {
|
|
4340
|
-
const f =
|
|
4341
|
-
const next =
|
|
4379
|
+
const f = _chunkYGIMK4NXcjs.normalizeFilter.call(void 0, filter);
|
|
4380
|
+
const next = _chunkYGIMK4NXcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
|
|
4342
4381
|
this.commitLayers(next);
|
|
4343
4382
|
return _nullishCoalesce(_chunkPOGBUYWEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
4344
4383
|
}
|
|
4345
4384
|
/** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
|
|
4346
4385
|
updateLayerFilter(id, filterId, changes, commitToHistory = true) {
|
|
4347
|
-
const next =
|
|
4386
|
+
const next = _chunkYGIMK4NXcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
|
|
4348
4387
|
this.commitLayers(next, void 0, commitToHistory);
|
|
4349
4388
|
return _nullishCoalesce(_chunkPOGBUYWEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
4350
4389
|
}
|
|
4351
4390
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
4352
4391
|
removeLayerFilter(id, filterId) {
|
|
4353
|
-
const next =
|
|
4392
|
+
const next = _chunkYGIMK4NXcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
|
|
4354
4393
|
this.commitLayers(next);
|
|
4355
4394
|
return _nullishCoalesce(_chunkPOGBUYWEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
4356
4395
|
}
|
|
@@ -4366,8 +4405,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
4366
4405
|
*/
|
|
4367
4406
|
convertToSmartObject(ids, options = {}) {
|
|
4368
4407
|
const list = _optionalChain([ids, 'optionalAccess', _154 => _154.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
|
|
4369
|
-
if (!list.length) throw new (0,
|
|
4370
|
-
const res =
|
|
4408
|
+
if (!list.length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
|
|
4409
|
+
const res = _chunkYGIMK4NXcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
|
|
4371
4410
|
this.commitLayers(res.layers, () => {
|
|
4372
4411
|
this.state.activeLayerId = res.layer.id;
|
|
4373
4412
|
this.state.activeTarget = "pixels";
|
|
@@ -4376,7 +4415,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4376
4415
|
}
|
|
4377
4416
|
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
4378
4417
|
rasterizeSmartObject(id) {
|
|
4379
|
-
const res =
|
|
4418
|
+
const res = _chunkYGIMK4NXcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
|
|
4380
4419
|
this.commitLayers(res.layers, () => {
|
|
4381
4420
|
if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
4382
4421
|
});
|
|
@@ -4384,10 +4423,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4384
4423
|
}
|
|
4385
4424
|
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
4386
4425
|
getSmartObject(id) {
|
|
4387
|
-
const layer =
|
|
4426
|
+
const layer = _chunkYGIMK4NXcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4388
4427
|
const c = layer.contents;
|
|
4389
|
-
const g =
|
|
4390
|
-
const readout =
|
|
4428
|
+
const g = _chunkYGIMK4NXcjs.placementGeometry.call(void 0, layer);
|
|
4429
|
+
const readout = _chunkYGIMK4NXcjs.describeTransform.call(void 0, g);
|
|
4391
4430
|
const stack = layer.smartFilters;
|
|
4392
4431
|
return {
|
|
4393
4432
|
layerId: layer.id,
|
|
@@ -4397,10 +4436,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4397
4436
|
kind: c.kind,
|
|
4398
4437
|
width: c.width,
|
|
4399
4438
|
height: c.height,
|
|
4400
|
-
decoded:
|
|
4439
|
+
decoded: _chunkYGIMK4NXcjs.isContentsDecoded.call(void 0, c),
|
|
4401
4440
|
fileType: _nullishCoalesce(_optionalChain([c, 'access', _155 => _155.file, 'optionalAccess', _156 => _156.type]), () => ( null)),
|
|
4402
4441
|
linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _157 => _157.linked, 'optionalAccess', _158 => _158.path]), () => ( null)),
|
|
4403
|
-
instances:
|
|
4442
|
+
instances: _chunkYGIMK4NXcjs.instancesOf.call(void 0, this.state.layers, c.id),
|
|
4404
4443
|
layerCount: c.document ? _chunkPOGBUYWEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
|
|
4405
4444
|
},
|
|
4406
4445
|
placement: {
|
|
@@ -4412,8 +4451,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
4412
4451
|
scaleY: readout.scaleY,
|
|
4413
4452
|
rotate: readout.rotate,
|
|
4414
4453
|
skewX: readout.skewX,
|
|
4415
|
-
center:
|
|
4416
|
-
bounds:
|
|
4454
|
+
center: _chunkYGIMK4NXcjs.anchorPoint.call(void 0, g, "center"),
|
|
4455
|
+
bounds: _chunkYGIMK4NXcjs.transformedBox.call(void 0, g)
|
|
4417
4456
|
},
|
|
4418
4457
|
smartFilters: {
|
|
4419
4458
|
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _159 => _159.enabled]), () => ( true)),
|
|
@@ -4430,7 +4469,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4430
4469
|
* change. Returns the new placement summary.
|
|
4431
4470
|
*/
|
|
4432
4471
|
setSmartObjectPlacement(id, placement, commitToHistory = true) {
|
|
4433
|
-
const res =
|
|
4472
|
+
const res = _chunkYGIMK4NXcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
|
|
4434
4473
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4435
4474
|
return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
|
|
4436
4475
|
}
|
|
@@ -4443,23 +4482,23 @@ var ImageEditorController = (_class6 = class {
|
|
|
4443
4482
|
* nothing is relative to the current transform.
|
|
4444
4483
|
*/
|
|
4445
4484
|
setSmartObjectTransform(id, spec) {
|
|
4446
|
-
const layer =
|
|
4447
|
-
const g =
|
|
4485
|
+
const layer = _chunkYGIMK4NXcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4486
|
+
const g = _chunkYGIMK4NXcjs.placementGeometry.call(void 0, layer);
|
|
4448
4487
|
const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
|
|
4449
4488
|
const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
|
|
4450
|
-
if (ways > 1) throw new (0,
|
|
4489
|
+
if (ways > 1) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
|
|
4451
4490
|
let corners = g.corners;
|
|
4452
4491
|
if (spec.corners) corners = spec.corners;
|
|
4453
4492
|
else if (spec.matrix) {
|
|
4454
|
-
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0,
|
|
4493
|
+
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkYGIMK4NXcjs.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).");
|
|
4455
4494
|
const [a, b, c, d] = spec.matrix;
|
|
4456
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
4457
|
-
corners =
|
|
4495
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
|
|
4496
|
+
corners = _chunkYGIMK4NXcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
|
|
4458
4497
|
} else if (numeric.length) {
|
|
4459
|
-
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0,
|
|
4460
|
-
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0,
|
|
4461
|
-
const now =
|
|
4462
|
-
const centre =
|
|
4498
|
+
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
|
|
4499
|
+
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`${k} must be a finite number.`);
|
|
4500
|
+
const now = _chunkYGIMK4NXcjs.describeTransform.call(void 0, g);
|
|
4501
|
+
const centre = _chunkYGIMK4NXcjs.anchorPoint.call(void 0, g, "center");
|
|
4463
4502
|
const params = {
|
|
4464
4503
|
scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
|
|
4465
4504
|
scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
|
|
@@ -4467,20 +4506,20 @@ var ImageEditorController = (_class6 = class {
|
|
|
4467
4506
|
skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
|
|
4468
4507
|
skewY: _nullishCoalesce(spec.skewY, () => ( 0))
|
|
4469
4508
|
};
|
|
4470
|
-
const m =
|
|
4509
|
+
const m = _chunkYGIMK4NXcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
|
|
4471
4510
|
const cx = g.box.width / 2;
|
|
4472
4511
|
const cy = g.box.height / 2;
|
|
4473
4512
|
const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
|
|
4474
|
-
corners =
|
|
4513
|
+
corners = _chunkYGIMK4NXcjs.cornersFromMatrix.call(void 0, g.box, _chunkW3GXSUSQcjs.multiplyMatrices.call(void 0, m, _chunkW3GXSUSQcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
|
|
4475
4514
|
}
|
|
4476
4515
|
let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
|
|
4477
4516
|
if (spec.warp === null) warp = null;
|
|
4478
4517
|
else if (spec.warp) {
|
|
4479
4518
|
if ("style" in spec.warp) {
|
|
4480
|
-
if (!_chunkW3GXSUSQcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0,
|
|
4481
|
-
warp =
|
|
4519
|
+
if (!_chunkW3GXSUSQcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkW3GXSUSQcjs.WARP_STYLES.join(", ")}.`);
|
|
4520
|
+
warp = _chunkYGIMK4NXcjs.presetWarp.call(void 0, g.box, spec.warp);
|
|
4482
4521
|
} else {
|
|
4483
|
-
if (!
|
|
4522
|
+
if (!_chunkYGIMK4NXcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkYGIMK4NXcjs.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.");
|
|
4484
4523
|
warp = spec.warp;
|
|
4485
4524
|
}
|
|
4486
4525
|
}
|
|
@@ -4494,16 +4533,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
4494
4533
|
* the layers that changed.
|
|
4495
4534
|
*/
|
|
4496
4535
|
replaceSmartObjectContents(id, source) {
|
|
4497
|
-
const layer =
|
|
4536
|
+
const layer = _chunkYGIMK4NXcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4498
4537
|
let contents;
|
|
4499
4538
|
if ("contents" in source) contents = source.contents;
|
|
4500
|
-
else if ("pixels" in source) contents =
|
|
4539
|
+
else if ("pixels" in source) contents = _chunkYGIMK4NXcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
|
|
4501
4540
|
else {
|
|
4502
|
-
const psd =
|
|
4503
|
-
contents =
|
|
4541
|
+
const psd = _chunkYGIMK4NXcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkYGIMK4NXcjs.newLayerId.call(void 0, ) });
|
|
4542
|
+
contents = _chunkYGIMK4NXcjs.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`)));
|
|
4504
4543
|
contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
|
|
4505
4544
|
}
|
|
4506
|
-
const res =
|
|
4545
|
+
const res = _chunkYGIMK4NXcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
|
|
4507
4546
|
this.commitLayers(res.layers);
|
|
4508
4547
|
return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
|
|
4509
4548
|
}
|
|
@@ -4518,16 +4557,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
4518
4557
|
* and bytes.
|
|
4519
4558
|
*/
|
|
4520
4559
|
exportSmartObjectContents(id) {
|
|
4521
|
-
const layer =
|
|
4560
|
+
const layer = _chunkYGIMK4NXcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4522
4561
|
const c = layer.contents;
|
|
4523
4562
|
const base = c.name.replace(/\.\w+$/, "") || "Contents";
|
|
4524
4563
|
if (c.file) {
|
|
4525
|
-
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ...
|
|
4564
|
+
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkYGIMK4NXcjs.BROWSER_IMAGE_TYPES };
|
|
4526
4565
|
const ext = c.file.type.toLowerCase();
|
|
4527
4566
|
return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
|
|
4528
4567
|
}
|
|
4529
|
-
if (!
|
|
4530
|
-
const f =
|
|
4568
|
+
if (!_chunkYGIMK4NXcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
|
|
4569
|
+
const f = _chunkYGIMK4NXcjs.smartContentsFile.call(void 0, c);
|
|
4531
4570
|
return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
|
|
4532
4571
|
}
|
|
4533
4572
|
/**
|
|
@@ -4536,7 +4575,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4536
4575
|
* undo step. Returns the copy's id.
|
|
4537
4576
|
*/
|
|
4538
4577
|
copySmartObject(id, linked = false, name) {
|
|
4539
|
-
const res =
|
|
4578
|
+
const res = _chunkYGIMK4NXcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
|
|
4540
4579
|
this.commitLayers(res.layers, () => {
|
|
4541
4580
|
this.state.activeLayerId = res.layer.id;
|
|
4542
4581
|
this.state.activeTarget = "pixels";
|
|
@@ -4545,31 +4584,31 @@ var ImageEditorController = (_class6 = class {
|
|
|
4545
4584
|
}
|
|
4546
4585
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
4547
4586
|
addSmartFilter(id, filter, index) {
|
|
4548
|
-
const res =
|
|
4587
|
+
const res = _chunkYGIMK4NXcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkYGIMK4NXcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
|
|
4549
4588
|
this.commitLayers(res.layers);
|
|
4550
4589
|
return res.filter;
|
|
4551
4590
|
}
|
|
4552
4591
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
4553
4592
|
updateSmartFilter(id, filterId, changes, commitToHistory = true) {
|
|
4554
|
-
const res =
|
|
4593
|
+
const res = _chunkYGIMK4NXcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
|
|
4555
4594
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4556
4595
|
return res.filter;
|
|
4557
4596
|
}
|
|
4558
4597
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
4559
4598
|
removeSmartFilter(id, filterId) {
|
|
4560
|
-
const res =
|
|
4599
|
+
const res = _chunkYGIMK4NXcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
|
|
4561
4600
|
this.commitLayers(res.layers);
|
|
4562
4601
|
return _nullishCoalesce(_optionalChain([res, 'access', _162 => _162.layer, 'access', _163 => _163.smartFilters, 'optionalAccess', _164 => _164.filters]), () => ( []));
|
|
4563
4602
|
}
|
|
4564
4603
|
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
4565
4604
|
moveSmartFilter(id, filterId, index) {
|
|
4566
|
-
const res =
|
|
4605
|
+
const res = _chunkYGIMK4NXcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
|
|
4567
4606
|
this.commitLayers(res.layers);
|
|
4568
4607
|
return _nullishCoalesce(_optionalChain([res, 'access', _165 => _165.layer, 'access', _166 => _166.smartFilters, 'optionalAccess', _167 => _167.filters]), () => ( []));
|
|
4569
4608
|
}
|
|
4570
4609
|
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
4571
4610
|
setSmartFiltersEnabled(id, enabled) {
|
|
4572
|
-
const res =
|
|
4611
|
+
const res = _chunkYGIMK4NXcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
|
|
4573
4612
|
this.commitLayers(res.layers);
|
|
4574
4613
|
return _nullishCoalesce(_optionalChain([res, 'access', _168 => _168.layer, 'access', _169 => _169.smartFilters, 'optionalAccess', _170 => _170.enabled]), () => ( true));
|
|
4575
4614
|
}
|
|
@@ -4579,21 +4618,21 @@ var ImageEditorController = (_class6 = class {
|
|
|
4579
4618
|
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
4580
4619
|
*/
|
|
4581
4620
|
setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
|
|
4582
|
-
const layer =
|
|
4621
|
+
const layer = _chunkYGIMK4NXcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4583
4622
|
let mask;
|
|
4584
4623
|
if (from === "none") mask = null;
|
|
4585
4624
|
else if (from === "keep") {
|
|
4586
|
-
if (!_optionalChain([layer, 'access', _171 => _171.smartFilters, 'optionalAccess', _172 => _172.mask])) throw new (0,
|
|
4625
|
+
if (!_optionalChain([layer, 'access', _171 => _171.smartFilters, 'optionalAccess', _172 => _172.mask])) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
|
|
4587
4626
|
mask = withMaskProps(layer.smartFilters.mask, props);
|
|
4588
4627
|
} else if (from === "selection") {
|
|
4589
4628
|
const sel = this.state.selection;
|
|
4590
|
-
if (!_optionalChain([sel, 'optionalAccess', _173 => _173.bounds])) throw new (0,
|
|
4629
|
+
if (!_optionalChain([sel, 'optionalAccess', _173 => _173.bounds])) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
4591
4630
|
mask = this.maskFromSelection(sel, props);
|
|
4592
4631
|
} else {
|
|
4593
4632
|
const v = from === "reveal-all" ? 255 : 0;
|
|
4594
4633
|
mask = withMaskProps({ surface: _chunkXIOMMGPDcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
4595
4634
|
}
|
|
4596
|
-
const res =
|
|
4635
|
+
const res = _chunkYGIMK4NXcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
|
|
4597
4636
|
this.commitLayers(res.layers, () => {
|
|
4598
4637
|
if (this.state.activeLayerId !== id) return;
|
|
4599
4638
|
if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
|
|
@@ -4609,14 +4648,14 @@ var ImageEditorController = (_class6 = class {
|
|
|
4609
4648
|
async prepareSmartObjects() {
|
|
4610
4649
|
const pending = /* @__PURE__ */ new Map();
|
|
4611
4650
|
for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers)) {
|
|
4612
|
-
if (l.type === "smart" && !
|
|
4651
|
+
if (l.type === "smart" && !_chunkYGIMK4NXcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkYGIMK4NXcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
|
|
4613
4652
|
}
|
|
4614
4653
|
const left = [];
|
|
4615
4654
|
for (const [cid, c] of pending) {
|
|
4616
4655
|
try {
|
|
4617
|
-
const url = `data:${
|
|
4656
|
+
const url = `data:${_chunkYGIMK4NXcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkPOGBUYWEcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
|
|
4618
4657
|
const px2 = await this.decodeImage(url);
|
|
4619
|
-
const decoded = { ...c, kind: "raster", raster:
|
|
4658
|
+
const decoded = { ...c, kind: "raster", raster: _chunkYGIMK4NXcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
|
|
4620
4659
|
const swap = (layers) => {
|
|
4621
4660
|
let out = layers;
|
|
4622
4661
|
for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkPOGBUYWEcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
|
|
@@ -4624,7 +4663,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4624
4663
|
};
|
|
4625
4664
|
this.state.layers = swap(this.state.layers);
|
|
4626
4665
|
for (const e of [...this.undoStack, ...this.redoStack]) e.layers = swap(e.layers);
|
|
4627
|
-
} catch (
|
|
4666
|
+
} catch (e19) {
|
|
4628
4667
|
left.push(cid);
|
|
4629
4668
|
}
|
|
4630
4669
|
}
|
|
@@ -4644,10 +4683,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4644
4683
|
* Contents can nest. Returns the contents' size and layer ids.
|
|
4645
4684
|
*/
|
|
4646
4685
|
editSmartObjectContents(id) {
|
|
4647
|
-
if (this.getFreeTransform()) throw new (0,
|
|
4648
|
-
const layer =
|
|
4686
|
+
if (this.getFreeTransform()) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
|
|
4687
|
+
const layer = _chunkYGIMK4NXcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
4649
4688
|
const c = layer.contents;
|
|
4650
|
-
if (!
|
|
4689
|
+
if (!_chunkYGIMK4NXcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _177 => _177.file, 'optionalAccess', _178 => _178.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
|
|
4651
4690
|
const saved = {
|
|
4652
4691
|
state: { ...this.state },
|
|
4653
4692
|
undo: this.undoStack,
|
|
@@ -4658,7 +4697,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4658
4697
|
samplePixelsOverride: this.samplePixelsOverride,
|
|
4659
4698
|
psdResolution: this.psdResolution
|
|
4660
4699
|
};
|
|
4661
|
-
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id:
|
|
4700
|
+
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkYGIMK4NXcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
|
|
4662
4701
|
this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
|
|
4663
4702
|
const s = this.state;
|
|
4664
4703
|
this.state = {
|
|
@@ -4666,7 +4705,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4666
4705
|
sourceUrl: null,
|
|
4667
4706
|
imageDimensions: { width: c.width, height: c.height },
|
|
4668
4707
|
crop: null,
|
|
4669
|
-
transform: { ...
|
|
4708
|
+
transform: { ..._chunkYGIMK4NXcjs.DEFAULT_TRANSFORM_VALUES },
|
|
4670
4709
|
layers,
|
|
4671
4710
|
activeLayerId: layers.length ? layers[layers.length - 1].id : null,
|
|
4672
4711
|
activeTarget: "pixels",
|
|
@@ -4699,7 +4738,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4699
4738
|
*/
|
|
4700
4739
|
closeSmartObjectContents(save = true) {
|
|
4701
4740
|
const top = this.contentsStack.pop();
|
|
4702
|
-
if (!top) throw new (0,
|
|
4741
|
+
if (!top) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
|
|
4703
4742
|
if (_optionalChain([this, 'access', _184 => _184.openTransform, 'optionalAccess', _185 => _185.isOpen])) this.openTransform.cancel();
|
|
4704
4743
|
this.openTransform = null;
|
|
4705
4744
|
const edited = this.state;
|
|
@@ -4713,10 +4752,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
4713
4752
|
const plain3 = _optionalChain([only, 'optionalAccess', _188 => _188.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _189 => _189.filters, 'optionalAccess', _190 => _190.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
|
|
4714
4753
|
if (_optionalChain([old, 'optionalAccess', _191 => _191.kind]) === "raster" && plain3) {
|
|
4715
4754
|
const px2 = _chunkXIOMMGPDcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
|
|
4716
|
-
next =
|
|
4755
|
+
next = _chunkYGIMK4NXcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
|
|
4717
4756
|
} else {
|
|
4718
4757
|
const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
|
|
4719
|
-
next =
|
|
4758
|
+
next = _chunkYGIMK4NXcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _192 => _192.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _193 => _193.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
|
|
4720
4759
|
}
|
|
4721
4760
|
}
|
|
4722
4761
|
const saved = top.saved;
|
|
@@ -4735,7 +4774,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4735
4774
|
this.notify();
|
|
4736
4775
|
return { layerId: top.layerId, changed: false, layerIds: [] };
|
|
4737
4776
|
}
|
|
4738
|
-
const res =
|
|
4777
|
+
const res = _chunkYGIMK4NXcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
|
|
4739
4778
|
this.commitLayers(res.layers);
|
|
4740
4779
|
return { layerId: top.layerId, changed: true, layerIds: res.ids };
|
|
4741
4780
|
}
|
|
@@ -4750,35 +4789,35 @@ var ImageEditorController = (_class6 = class {
|
|
|
4750
4789
|
// --- Layer effects ---
|
|
4751
4790
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
4752
4791
|
getLayerEffects(id) {
|
|
4753
|
-
return
|
|
4792
|
+
return _chunkYGIMK4NXcjs.layerEffectsOf.call(void 0, _chunkYGIMK4NXcjs.requireLayer.call(void 0, this.state.layers, id).layer);
|
|
4754
4793
|
}
|
|
4755
4794
|
/**
|
|
4756
4795
|
* Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
|
|
4757
4796
|
* `index` in the layer's effect list (default the end). Returns the new effect and the effects.
|
|
4758
4797
|
*/
|
|
4759
4798
|
addLayerEffect(id, kind, params = {}, index) {
|
|
4760
|
-
const res =
|
|
4799
|
+
const res = _chunkYGIMK4NXcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
|
|
4761
4800
|
this.commitLayers(res.layers);
|
|
4762
4801
|
return { effect: res.effect, effects: this.getLayerEffects(id) };
|
|
4763
4802
|
}
|
|
4764
4803
|
/** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
|
|
4765
4804
|
updateLayerEffect(id, effectId, changes, commitToHistory = true) {
|
|
4766
|
-
this.commitLayers(
|
|
4805
|
+
this.commitLayers(_chunkYGIMK4NXcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
|
|
4767
4806
|
return this.getLayerEffects(id);
|
|
4768
4807
|
}
|
|
4769
4808
|
/** Removes one effect (one undo step). Returns the remaining effects. */
|
|
4770
4809
|
removeLayerEffect(id, effectId) {
|
|
4771
|
-
this.commitLayers(
|
|
4810
|
+
this.commitLayers(_chunkYGIMK4NXcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
|
|
4772
4811
|
return this.getLayerEffects(id);
|
|
4773
4812
|
}
|
|
4774
4813
|
/** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
|
|
4775
4814
|
setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
|
|
4776
|
-
this.commitLayers(
|
|
4815
|
+
this.commitLayers(_chunkYGIMK4NXcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
|
|
4777
4816
|
return this.getLayerEffects(id);
|
|
4778
4817
|
}
|
|
4779
4818
|
/** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
|
|
4780
4819
|
setLayerEffects(id, effects, commitToHistory = true) {
|
|
4781
|
-
this.commitLayers(
|
|
4820
|
+
this.commitLayers(_chunkYGIMK4NXcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
|
|
4782
4821
|
return this.getLayerEffects(id);
|
|
4783
4822
|
}
|
|
4784
4823
|
__init58() {this.patternIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -4804,8 +4843,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
4804
4843
|
/** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
|
|
4805
4844
|
setGlobalLight(light, commitToHistory = true) {
|
|
4806
4845
|
const next = { ...this.getGlobalLight(), ...light };
|
|
4807
|
-
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0,
|
|
4808
|
-
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0,
|
|
4846
|
+
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
|
|
4847
|
+
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
|
|
4809
4848
|
if (commitToHistory) this.recordHistory();
|
|
4810
4849
|
if (next.angle === _chunkPOGBUYWEcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkPOGBUYWEcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
|
|
4811
4850
|
else this.state.globalLight = next;
|
|
@@ -4816,25 +4855,25 @@ var ImageEditorController = (_class6 = class {
|
|
|
4816
4855
|
async compositeToSurface(layers, rect) {
|
|
4817
4856
|
const { width, height } = this.naturalSize;
|
|
4818
4857
|
if (_chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
|
|
4819
|
-
throw new (0,
|
|
4858
|
+
throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
|
|
4820
4859
|
}
|
|
4821
4860
|
await this.renderer.prepareLayerAssets(layers, width, height);
|
|
4822
|
-
const data = new (0,
|
|
4861
|
+
const data = new (0, _chunkYGIMK4NXcjs.LayerCompositor)().composite(layers, rect, this.renderer.compositorSources(width, height));
|
|
4823
4862
|
return _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
|
|
4824
4863
|
}
|
|
4825
4864
|
/** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
|
|
4826
4865
|
paintBounds(layer) {
|
|
4827
4866
|
const { width, height } = this.naturalSize;
|
|
4828
4867
|
const canvas = { x: 0, y: 0, width, height };
|
|
4829
|
-
if (
|
|
4868
|
+
if (_chunkYGIMK4NXcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
4830
4869
|
if (layer.type === "annotation") {
|
|
4831
|
-
const b =
|
|
4870
|
+
const b = _chunkYGIMK4NXcjs.getAnnotationBounds.call(void 0, layer.annotation);
|
|
4832
4871
|
const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
|
|
4833
4872
|
return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
|
|
4834
4873
|
}
|
|
4835
4874
|
if (layer.type === "group") {
|
|
4836
4875
|
let r = null;
|
|
4837
|
-
for (const c of layer.children) r =
|
|
4876
|
+
for (const c of layer.children) r = _chunkYGIMK4NXcjs.unionRect.call(void 0, r, this.paintBounds(c));
|
|
4838
4877
|
return _nullishCoalesce(r, () => ( canvas));
|
|
4839
4878
|
}
|
|
4840
4879
|
return canvas;
|
|
@@ -4845,16 +4884,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
4845
4884
|
* Returns the merged id.
|
|
4846
4885
|
*/
|
|
4847
4886
|
async mergeDown(id) {
|
|
4848
|
-
const loc =
|
|
4887
|
+
const loc = _chunkYGIMK4NXcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
4849
4888
|
const upper = loc.layer;
|
|
4850
4889
|
const siblings = loc.parent ? loc.parent.children : this.state.layers;
|
|
4851
4890
|
const lower = siblings[loc.index - 1];
|
|
4852
|
-
if (!lower) throw new (0,
|
|
4853
|
-
if (lower.type !== "pixel") throw new (0,
|
|
4854
|
-
if (!upper.visible) throw new (0,
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
let rect = _nullishCoalesce(
|
|
4891
|
+
if (!lower) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
|
|
4892
|
+
if (lower.type !== "pixel") throw new (0, _chunkYGIMK4NXcjs.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.`);
|
|
4893
|
+
if (!upper.visible) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
|
|
4894
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
|
|
4895
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
|
|
4896
|
+
let rect = _nullishCoalesce(_chunkYGIMK4NXcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
|
|
4858
4897
|
const reach = Math.max(_chunkPOGBUYWEcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkPOGBUYWEcjs.effectsMargin.call(void 0, upper.effects));
|
|
4859
4898
|
if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
|
|
4860
4899
|
const base = { ...lower, blend: "normal", opacity: 1 };
|
|
@@ -4880,12 +4919,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
4880
4919
|
*/
|
|
4881
4920
|
async mergeVisible() {
|
|
4882
4921
|
const visible = this.state.layers.filter((l) => l.visible);
|
|
4883
|
-
if (!visible.length) throw new (0,
|
|
4922
|
+
if (!visible.length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("No layer is visible.");
|
|
4884
4923
|
const { width, height } = this.naturalSize;
|
|
4885
4924
|
const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
|
|
4886
4925
|
const merged = {
|
|
4887
4926
|
type: "pixel",
|
|
4888
|
-
id:
|
|
4927
|
+
id: _chunkYGIMK4NXcjs.newLayerId.call(void 0, ),
|
|
4889
4928
|
name: "Merged",
|
|
4890
4929
|
visible: true,
|
|
4891
4930
|
opacity: 1,
|
|
@@ -4909,8 +4948,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
4909
4948
|
const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
|
|
4910
4949
|
const bg = {
|
|
4911
4950
|
type: "pixel",
|
|
4912
|
-
id:
|
|
4913
|
-
name:
|
|
4951
|
+
id: _chunkYGIMK4NXcjs.BACKGROUND_LAYER_ID,
|
|
4952
|
+
name: _chunkYGIMK4NXcjs.BACKGROUND_LAYER_NAME,
|
|
4914
4953
|
visible: true,
|
|
4915
4954
|
opacity: 1,
|
|
4916
4955
|
blend: "normal",
|
|
@@ -4937,7 +4976,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
4937
4976
|
const k = Math.min(1, side / Math.max(width, height));
|
|
4938
4977
|
const tw = Math.max(1, Math.round(width * k));
|
|
4939
4978
|
const th = Math.max(1, Math.round(height * k));
|
|
4940
|
-
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null :
|
|
4979
|
+
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkYGIMK4NXcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
|
|
4941
4980
|
if (!surface) return null;
|
|
4942
4981
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
4943
4982
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
@@ -5026,27 +5065,27 @@ var ImageEditorController = (_class6 = class {
|
|
|
5026
5065
|
/** Resolves and validates what a stroke, fill or clear paints into. */
|
|
5027
5066
|
paintTarget(layerId, channel, action) {
|
|
5028
5067
|
const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
|
|
5029
|
-
if (!id) throw new (0,
|
|
5030
|
-
const layer =
|
|
5068
|
+
if (!id) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
|
|
5069
|
+
const layer = _chunkYGIMK4NXcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5031
5070
|
const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
|
|
5032
5071
|
if (ch === "mask") {
|
|
5033
|
-
if (!layer.mask) throw new (0,
|
|
5034
|
-
if (layer.mask.source) throw new (0,
|
|
5035
|
-
|
|
5072
|
+
if (!layer.mask) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
|
|
5073
|
+
if (layer.mask.source) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
|
|
5074
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
5036
5075
|
} else if (ch === "filter-mask") {
|
|
5037
5076
|
if (layer.type !== "smart" || !_optionalChain([layer, 'access', _201 => _201.smartFilters, 'optionalAccess', _202 => _202.mask])) {
|
|
5038
|
-
throw new (0,
|
|
5077
|
+
throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
|
|
5039
5078
|
}
|
|
5040
|
-
if (!
|
|
5041
|
-
|
|
5079
|
+
if (!_chunkYGIMK4NXcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
|
|
5080
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
5042
5081
|
} else {
|
|
5043
|
-
if (layer.type === "smart") throw new (0,
|
|
5044
|
-
if (layer.type === "shape") throw new (0,
|
|
5045
|
-
if (layer.type === "type") throw new (0,
|
|
5046
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5047
|
-
|
|
5082
|
+
if (layer.type === "smart") throw new (0, _chunkYGIMK4NXcjs.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.`);
|
|
5083
|
+
if (layer.type === "shape") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
|
|
5084
|
+
if (layer.type === "type") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
|
|
5085
|
+
if (layer.type !== "pixel") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
|
|
5086
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "pixels", action);
|
|
5048
5087
|
}
|
|
5049
|
-
if (!layer.visible) throw new (0,
|
|
5088
|
+
if (!layer.visible) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
|
|
5050
5089
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
5051
5090
|
const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
|
|
5052
5091
|
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _203 => _203.locks, 'optionalAccess', _204 => _204.transparency]));
|
|
@@ -5055,7 +5094,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5055
5094
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
5056
5095
|
withSurface(layer, channel, surface) {
|
|
5057
5096
|
if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
|
|
5058
|
-
if (channel === "filter-mask") return
|
|
5097
|
+
if (channel === "filter-mask") return _chunkYGIMK4NXcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
|
|
5059
5098
|
const next = { ...layer, surface };
|
|
5060
5099
|
delete next.source;
|
|
5061
5100
|
return next;
|
|
@@ -5068,10 +5107,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
5068
5107
|
*/
|
|
5069
5108
|
beginStroke(init = {}) {
|
|
5070
5109
|
const tool = _nullishCoalesce(init.tool, () => ( "brush"));
|
|
5071
|
-
if (tool !== "brush" && tool !== "eraser" && tool !== "mixer") throw new (0,
|
|
5110
|
+
if (tool !== "brush" && tool !== "eraser" && tool !== "mixer") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use brush, eraser or mixer.`);
|
|
5072
5111
|
const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : "paint");
|
|
5073
5112
|
if (tool === "mixer" && target.channel !== "pixels") {
|
|
5074
|
-
throw new (0,
|
|
5113
|
+
throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
|
|
5075
5114
|
}
|
|
5076
5115
|
const brush = _chunk7VOHOPLWcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
|
|
5077
5116
|
const color = parseColor(_nullishCoalesce(init.color, () => ( this.state.paint.foreground)));
|
|
@@ -5137,9 +5176,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
5137
5176
|
* document bounds and the number of dabs.
|
|
5138
5177
|
*/
|
|
5139
5178
|
paintStroke(init) {
|
|
5140
|
-
if (!Array.isArray(init.points) || !init.points.length) throw new (0,
|
|
5179
|
+
if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("points must hold at least one { x, y } point.");
|
|
5141
5180
|
for (const p of init.points) {
|
|
5142
|
-
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _208 => _208.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _209 => _209.y]))) throw new (0,
|
|
5181
|
+
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _208 => _208.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _209 => _209.y]))) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
|
|
5143
5182
|
}
|
|
5144
5183
|
const session = this.beginStroke(init);
|
|
5145
5184
|
session.push(init.points);
|
|
@@ -5165,8 +5204,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5165
5204
|
const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
|
|
5166
5205
|
const { width, height } = this.naturalSize;
|
|
5167
5206
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
5168
|
-
if (!(opacity >= 0 && opacity <= 1)) throw new (0,
|
|
5169
|
-
const blend = _nullishCoalesce(
|
|
5207
|
+
if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
5208
|
+
const blend = _nullishCoalesce(_chunkYGIMK4NXcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
|
|
5170
5209
|
const sel = options.useSelection !== false && _optionalChain([this, 'access', _210 => _210.state, 'access', _211 => _211.selection, 'optionalAccess', _212 => _212.bounds]) ? this.state.selection : null;
|
|
5171
5210
|
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _213 => _213.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
5172
5211
|
const coverage = new (0, _chunk7VOHOPLWcjs.CoverageMap)();
|
|
@@ -5201,7 +5240,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5201
5240
|
// --- Adjustments ---
|
|
5202
5241
|
/** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
|
|
5203
5242
|
developLayer() {
|
|
5204
|
-
return
|
|
5243
|
+
return _chunkYGIMK4NXcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
|
|
5205
5244
|
}
|
|
5206
5245
|
/**
|
|
5207
5246
|
* Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
|
|
@@ -5227,7 +5266,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5227
5266
|
this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
|
|
5228
5267
|
}
|
|
5229
5268
|
if ("layers" in partial) {
|
|
5230
|
-
layers = this.replaceAdjustmentNodes(layers,
|
|
5269
|
+
layers = this.replaceAdjustmentNodes(layers, _chunkYGIMK4NXcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
|
|
5231
5270
|
}
|
|
5232
5271
|
this.state.layers = layers;
|
|
5233
5272
|
this.notify();
|
|
@@ -5235,7 +5274,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5235
5274
|
/** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
|
|
5236
5275
|
get isProcessOutdated() {
|
|
5237
5276
|
this.syncViews();
|
|
5238
|
-
return
|
|
5277
|
+
return _chunkYGIMK4NXcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkYGIMK4NXcjs.LATEST_PROCESS_VERSION;
|
|
5239
5278
|
}
|
|
5240
5279
|
/**
|
|
5241
5280
|
* Update to Current Process: re-interprets the current adjustment values with the latest
|
|
@@ -5243,7 +5282,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5243
5282
|
*/
|
|
5244
5283
|
upgradeProcess() {
|
|
5245
5284
|
if (!this.isProcessOutdated) return false;
|
|
5246
|
-
this.setAdjustments({ process:
|
|
5285
|
+
this.setAdjustments({ process: _chunkYGIMK4NXcjs.LATEST_PROCESS_VERSION });
|
|
5247
5286
|
return true;
|
|
5248
5287
|
}
|
|
5249
5288
|
/** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
|
|
@@ -5254,7 +5293,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5254
5293
|
this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0,
|
|
5255
5294
|
this.state.layers,
|
|
5256
5295
|
target.id,
|
|
5257
|
-
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process:
|
|
5296
|
+
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkYGIMK4NXcjs.LATEST_PROCESS_VERSION }), 0)
|
|
5258
5297
|
);
|
|
5259
5298
|
}
|
|
5260
5299
|
delete this.state.legacyOutputBlur;
|
|
@@ -5318,7 +5357,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5318
5357
|
const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
|
|
5319
5358
|
for (const l of next) {
|
|
5320
5359
|
if (existing.has(l.id)) continue;
|
|
5321
|
-
out = this.placeLayer(out,
|
|
5360
|
+
out = this.placeLayer(out, _chunkYGIMK4NXcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
|
|
5322
5361
|
}
|
|
5323
5362
|
const order = next.map((l) => l.id);
|
|
5324
5363
|
for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
|
|
@@ -5333,7 +5372,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5333
5372
|
addAdjustmentLayer(init, index) {
|
|
5334
5373
|
const spec = typeof init === "string" ? { kind: init } : init;
|
|
5335
5374
|
const ids = new Set(_chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
5336
|
-
const layer =
|
|
5375
|
+
const layer = _chunkYGIMK4NXcjs.createAdjustmentLayer.call(void 0, spec.kind, {
|
|
5337
5376
|
id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
|
|
5338
5377
|
name: spec.name,
|
|
5339
5378
|
params: spec.params,
|
|
@@ -5342,10 +5381,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
5342
5381
|
blend: spec.blend,
|
|
5343
5382
|
mask: _nullishCoalesce(spec.mask, () => ( void 0))
|
|
5344
5383
|
});
|
|
5345
|
-
while (ids.has(layer.id)) layer.id =
|
|
5384
|
+
while (ids.has(layer.id)) layer.id = _chunkYGIMK4NXcjs.newLayerId.call(void 0, "adj");
|
|
5346
5385
|
const { width, height } = this.naturalSize;
|
|
5347
5386
|
this.recordHistory();
|
|
5348
|
-
const node =
|
|
5387
|
+
const node = _chunkYGIMK4NXcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
|
|
5349
5388
|
const positioned = Boolean(spec.aboveId || spec.parentId);
|
|
5350
5389
|
this.state.layers = this.placeLayer(this.state.layers, node, {
|
|
5351
5390
|
aboveId: spec.aboveId,
|
|
@@ -5365,7 +5404,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5365
5404
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
5366
5405
|
const { width, height } = this.naturalSize;
|
|
5367
5406
|
const node = loc.layer;
|
|
5368
|
-
const merged =
|
|
5407
|
+
const merged = _chunkYGIMK4NXcjs.normalizeAdjustmentLayer.call(void 0, {
|
|
5369
5408
|
id: node.id,
|
|
5370
5409
|
kind: node.kind,
|
|
5371
5410
|
enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
|
|
@@ -5385,7 +5424,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5385
5424
|
params: merged.params
|
|
5386
5425
|
};
|
|
5387
5426
|
if (update.mask !== void 0) {
|
|
5388
|
-
const mask = update.mask ?
|
|
5427
|
+
const mask = update.mask ? _chunkYGIMK4NXcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
|
|
5389
5428
|
if (mask) next.mask = mask;
|
|
5390
5429
|
else delete next.mask;
|
|
5391
5430
|
}
|
|
@@ -5472,8 +5511,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
5472
5511
|
const { width, height } = this.naturalSize;
|
|
5473
5512
|
let next = null;
|
|
5474
5513
|
if (mask) {
|
|
5475
|
-
const sized = mask.width === width && mask.height === height ? mask :
|
|
5476
|
-
next =
|
|
5514
|
+
const sized = mask.width === width && mask.height === height ? mask : _chunkYGIMK4NXcjs.resizeSelection.call(void 0, mask, width, height);
|
|
5515
|
+
next = _chunkYGIMK4NXcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
|
|
5477
5516
|
} else if (mode !== "replace") {
|
|
5478
5517
|
return false;
|
|
5479
5518
|
}
|
|
@@ -5487,7 +5526,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5487
5526
|
/** Select › All. */
|
|
5488
5527
|
selectAll() {
|
|
5489
5528
|
const { width, height } = this.naturalSize;
|
|
5490
|
-
return this.setSelection(
|
|
5529
|
+
return this.setSelection(_chunkYGIMK4NXcjs.fullSelection.call(void 0, width, height));
|
|
5491
5530
|
}
|
|
5492
5531
|
/** Select › Deselect. */
|
|
5493
5532
|
deselect() {
|
|
@@ -5496,11 +5535,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
5496
5535
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
5497
5536
|
invertSelection() {
|
|
5498
5537
|
const { width, height } = this.naturalSize;
|
|
5499
|
-
const current = _nullishCoalesce(this.state.selection, () => (
|
|
5500
|
-
return this.setSelection(
|
|
5538
|
+
const current = _nullishCoalesce(this.state.selection, () => ( _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, width, height)));
|
|
5539
|
+
return this.setSelection(_chunkYGIMK4NXcjs.invertSelection.call(void 0, current));
|
|
5501
5540
|
}
|
|
5502
5541
|
shapeCommand(mask, options) {
|
|
5503
|
-
const shaped = options.feather && options.feather > 0 ?
|
|
5542
|
+
const shaped = options.feather && options.feather > 0 ? _chunkYGIMK4NXcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
|
|
5504
5543
|
return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
|
|
5505
5544
|
}
|
|
5506
5545
|
/** Rectangular marquee in natural image pixels. */
|
|
@@ -5545,7 +5584,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5545
5584
|
this.samplePixels = base;
|
|
5546
5585
|
this.samplePixelsOverride = false;
|
|
5547
5586
|
}
|
|
5548
|
-
} catch (
|
|
5587
|
+
} catch (e20) {
|
|
5549
5588
|
base = null;
|
|
5550
5589
|
}
|
|
5551
5590
|
}
|
|
@@ -5554,11 +5593,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
5554
5593
|
if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
|
|
5555
5594
|
return null;
|
|
5556
5595
|
}
|
|
5557
|
-
const legacy =
|
|
5596
|
+
const legacy = _chunkYGIMK4NXcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
|
|
5558
5597
|
if (options.sample === "active-layer") {
|
|
5559
5598
|
const layer = this.getActiveLayer();
|
|
5560
5599
|
if (!layer || layer.type !== "pixel") {
|
|
5561
|
-
throw new (0,
|
|
5600
|
+
throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
|
|
5562
5601
|
}
|
|
5563
5602
|
const surface = layer.source === "document" && options.pixels ? _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
|
|
5564
5603
|
return { width, height, data: _chunkXIOMMGPDcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
|
|
@@ -5567,7 +5606,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5567
5606
|
this.syncViews();
|
|
5568
5607
|
if (legacy && !options.pixels) {
|
|
5569
5608
|
const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
|
|
5570
|
-
|
|
5609
|
+
_chunkYGIMK4NXcjs.applyAdjustments.call(void 0, copy, _chunkYGIMK4NXcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
|
|
5571
5610
|
return copy;
|
|
5572
5611
|
}
|
|
5573
5612
|
const pixels = options.pixels;
|
|
@@ -5579,7 +5618,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5579
5618
|
};
|
|
5580
5619
|
const stack = withoutAnnotations(this.state.layers);
|
|
5581
5620
|
const layers = options.sampleMerged ? stack : pixelsOnly(stack);
|
|
5582
|
-
const data = new (0,
|
|
5621
|
+
const data = new (0, _chunkYGIMK4NXcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
|
|
5583
5622
|
return { width, height, data };
|
|
5584
5623
|
}
|
|
5585
5624
|
async requirePixels(options) {
|
|
@@ -5606,7 +5645,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5606
5645
|
modifySelection(op, radius) {
|
|
5607
5646
|
const sel = this.state.selection;
|
|
5608
5647
|
if (!_optionalChain([sel, 'optionalAccess', _227 => _227.bounds])) return false;
|
|
5609
|
-
return this.setSelection(
|
|
5648
|
+
return this.setSelection(_chunkYGIMK4NXcjs.modifySelection.call(void 0, sel, op, radius));
|
|
5610
5649
|
}
|
|
5611
5650
|
/**
|
|
5612
5651
|
* Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
|
|
@@ -5637,7 +5676,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5637
5676
|
} else {
|
|
5638
5677
|
pixels = source;
|
|
5639
5678
|
}
|
|
5640
|
-
this.setSelection(
|
|
5679
|
+
this.setSelection(_chunkYGIMK4NXcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
|
|
5641
5680
|
return this.getSelection();
|
|
5642
5681
|
}
|
|
5643
5682
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
@@ -5649,7 +5688,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5649
5688
|
// --- Layer masks ---
|
|
5650
5689
|
maskFromSelection(sel, props = {}) {
|
|
5651
5690
|
const { width, height } = this.naturalSize;
|
|
5652
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
5691
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkYGIMK4NXcjs.resizeSelection.call(void 0, sel, width, height);
|
|
5653
5692
|
const mask = { surface: _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
|
|
5654
5693
|
return withMaskProps(mask, props);
|
|
5655
5694
|
}
|
|
@@ -5695,7 +5734,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5695
5734
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
5696
5735
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
5697
5736
|
const data = _chunkXIOMMGPDcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
5698
|
-
const sel =
|
|
5737
|
+
const sel = _chunkYGIMK4NXcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
5699
5738
|
return this.setSelection(sel, mode);
|
|
5700
5739
|
}
|
|
5701
5740
|
// --- Histogram ---
|
|
@@ -5725,9 +5764,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
5725
5764
|
merged.depthRange = [...merged.depthRange];
|
|
5726
5765
|
this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
5727
5766
|
const next = { ...l };
|
|
5728
|
-
if (
|
|
5767
|
+
if (_chunkYGIMK4NXcjs.isDefaultDepthMask.call(void 0, merged)) {
|
|
5729
5768
|
if (_optionalChain([next, 'access', _233 => _233.mask, 'optionalAccess', _234 => _234.source])) delete next.mask;
|
|
5730
|
-
} else next.mask =
|
|
5769
|
+
} else next.mask = _chunkYGIMK4NXcjs.depthRasterMask.call(void 0, merged);
|
|
5731
5770
|
return next;
|
|
5732
5771
|
});
|
|
5733
5772
|
}
|
|
@@ -5748,7 +5787,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5748
5787
|
// --- Annotations & Layers ---
|
|
5749
5788
|
/** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
|
|
5750
5789
|
annotationLayer(id) {
|
|
5751
|
-
return _chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([
|
|
5790
|
+
return _chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkYGIMK4NXcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _237 => _237.id]) === id);
|
|
5752
5791
|
}
|
|
5753
5792
|
/** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
|
|
5754
5793
|
annotationEnv() {
|
|
@@ -5764,7 +5803,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5764
5803
|
this.recordHistory();
|
|
5765
5804
|
const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
|
|
5766
5805
|
const fullAnnotation = { ...annotation, id };
|
|
5767
|
-
const layer =
|
|
5806
|
+
const layer = _chunkYGIMK4NXcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
|
|
5768
5807
|
const loc = placement.aboveId ? _chunkPOGBUYWEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
5769
5808
|
this.state.layers = loc ? _chunkPOGBUYWEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _238 => _238.parent, 'optionalAccess', _239 => _239.id]), () => ( null)), loc.index + 1) : _chunkPOGBUYWEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
|
|
5770
5809
|
this.state.selectedAnnotationId = id;
|
|
@@ -5776,17 +5815,17 @@ var ImageEditorController = (_class6 = class {
|
|
|
5776
5815
|
this.recordHistory();
|
|
5777
5816
|
}
|
|
5778
5817
|
const layer = this.annotationLayer(id);
|
|
5779
|
-
const current = layer ?
|
|
5818
|
+
const current = layer ? _chunkYGIMK4NXcjs.annotationOfLayer.call(void 0, layer) : null;
|
|
5780
5819
|
if (layer && current) {
|
|
5781
5820
|
const annotation = { ...current, ...partial, id };
|
|
5782
|
-
const name = layer.name ===
|
|
5821
|
+
const name = layer.name === _chunkYGIMK4NXcjs.annotationLayerName.call(void 0, current) ? _chunkYGIMK4NXcjs.annotationLayerName.call(void 0, annotation) : layer.name;
|
|
5783
5822
|
this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
|
|
5784
5823
|
}
|
|
5785
5824
|
this.notify();
|
|
5786
5825
|
}
|
|
5787
5826
|
/** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
|
|
5788
5827
|
layerForAnnotation(layer, annotation, name) {
|
|
5789
|
-
const fresh =
|
|
5828
|
+
const fresh = _chunkYGIMK4NXcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
|
|
5790
5829
|
const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
|
|
5791
5830
|
for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
5792
5831
|
if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
|
|
@@ -5874,7 +5913,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
5874
5913
|
dirty: dirty === "all" ? void 0 : dirty,
|
|
5875
5914
|
checkpointLayerId: this.state.activeLayerId
|
|
5876
5915
|
});
|
|
5877
|
-
} catch (
|
|
5916
|
+
} catch (e21) {
|
|
5878
5917
|
}
|
|
5879
5918
|
}
|
|
5880
5919
|
async renderExport(options) {
|
|
@@ -6033,8 +6072,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
6033
6072
|
return;
|
|
6034
6073
|
}
|
|
6035
6074
|
const target = this.developLayer();
|
|
6036
|
-
if (!target) throw new (0,
|
|
6037
|
-
|
|
6075
|
+
if (!target) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("There is no pixel layer to mask.");
|
|
6076
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, target, "all", "mask it");
|
|
6038
6077
|
const { width, height } = this.naturalSize;
|
|
6039
6078
|
let px2 = await this.decodeImage(newDataUrl);
|
|
6040
6079
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
@@ -6042,7 +6081,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6042
6081
|
for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
|
|
6043
6082
|
let surface = _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
|
|
6044
6083
|
if (target.offset.x || target.offset.y) surface = _chunkXIOMMGPDcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
|
|
6045
|
-
this.commitLayers(
|
|
6084
|
+
this.commitLayers(_chunkYGIMK4NXcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
|
|
6046
6085
|
return target.id;
|
|
6047
6086
|
}
|
|
6048
6087
|
// --- Type layers ---
|
|
@@ -6066,7 +6105,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6066
6105
|
return _nullishCoalesce(_optionalChain([this, 'access', _244 => _244.getTextShaper, 'call', _245 => _245(), 'optionalAccess', _246 => _246.families, 'optionalCall', _247 => _247()]), () => ( ["sans-serif", "serif", "monospace"]));
|
|
6067
6106
|
}
|
|
6068
6107
|
typeInfo(id) {
|
|
6069
|
-
const layer =
|
|
6108
|
+
const layer = _chunkYGIMK4NXcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
6070
6109
|
const ranges = (runs) => {
|
|
6071
6110
|
let at = 0;
|
|
6072
6111
|
return runs.map((r) => {
|
|
@@ -6079,7 +6118,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6079
6118
|
let lines = [];
|
|
6080
6119
|
let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
|
|
6081
6120
|
if (shaper) {
|
|
6082
|
-
const layout =
|
|
6121
|
+
const layout = _chunkYGIMK4NXcjs.layoutText.call(void 0, layer, shaper);
|
|
6083
6122
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
6084
6123
|
lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
|
|
6085
6124
|
if (layer.rendering === "stored") missing = layout.missingFonts;
|
|
@@ -6109,25 +6148,25 @@ var ImageEditorController = (_class6 = class {
|
|
|
6109
6148
|
* text wrapped in `box`. Refused without a text shaper. Returns its id.
|
|
6110
6149
|
*/
|
|
6111
6150
|
addTextLayer(init) {
|
|
6112
|
-
const text =
|
|
6113
|
-
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0,
|
|
6114
|
-
const style =
|
|
6115
|
-
const paragraph =
|
|
6151
|
+
const text = _chunkYGIMK4NXcjs.normalizeText.call(void 0, init.text);
|
|
6152
|
+
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("x and y must be numbers (document pixels).");
|
|
6153
|
+
const style = _chunkYGIMK4NXcjs.patchTextStyle.call(void 0, { ..._chunkYGIMK4NXcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
|
|
6154
|
+
const paragraph = _chunkYGIMK4NXcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
|
|
6116
6155
|
let frame = { kind: "point" };
|
|
6117
6156
|
if (init.box) {
|
|
6118
6157
|
const { width, height } = init.box;
|
|
6119
|
-
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0,
|
|
6158
|
+
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
|
|
6120
6159
|
frame = { kind: "box", width, height };
|
|
6121
6160
|
}
|
|
6122
|
-
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0,
|
|
6123
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
6124
|
-
if (init.blend !== void 0 && !_chunkXIOMMGPDcjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
6161
|
+
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("rotation must be a number of degrees.");
|
|
6162
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
6163
|
+
if (init.blend !== void 0 && !_chunkXIOMMGPDcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
6125
6164
|
const t = [1, 0, 0, 1, init.x, init.y];
|
|
6126
6165
|
const transform = init.rotation ? _chunkW3GXSUSQcjs.multiplyMatrices.call(void 0, t, _chunkW3GXSUSQcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
|
|
6127
|
-
const layer =
|
|
6166
|
+
const layer = _chunkYGIMK4NXcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkYGIMK4NXcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
|
|
6128
6167
|
if (init.opacity !== void 0) layer.opacity = init.opacity;
|
|
6129
6168
|
if (init.blend !== void 0) layer.blend = init.blend;
|
|
6130
|
-
const next =
|
|
6169
|
+
const next = _chunkYGIMK4NXcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
6131
6170
|
this.commitLayers(next, () => {
|
|
6132
6171
|
this.state.activeLayerId = layer.id;
|
|
6133
6172
|
this.state.activeTarget = "pixels";
|
|
@@ -6139,28 +6178,28 @@ var ImageEditorController = (_class6 = class {
|
|
|
6139
6178
|
* `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
|
|
6140
6179
|
*/
|
|
6141
6180
|
setText(id, text, range = {}, commitToHistory = true) {
|
|
6142
|
-
const layer =
|
|
6143
|
-
const insert =
|
|
6144
|
-
const [start, end] =
|
|
6145
|
-
const { layers } =
|
|
6181
|
+
const layer = _chunkYGIMK4NXcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
6182
|
+
const insert = _chunkYGIMK4NXcjs.normalizeText.call(void 0, text);
|
|
6183
|
+
const [start, end] = _chunkYGIMK4NXcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
6184
|
+
const { layers } = _chunkYGIMK4NXcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkYGIMK4NXcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
|
|
6146
6185
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
6147
6186
|
return this.typeInfo(id);
|
|
6148
6187
|
}
|
|
6149
6188
|
/** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
|
|
6150
6189
|
setTextStyle(id, style, range = {}, commitToHistory = true) {
|
|
6151
|
-
const layer =
|
|
6152
|
-
const [start, end] =
|
|
6153
|
-
if (!Object.keys(style).length) throw new (0,
|
|
6154
|
-
|
|
6155
|
-
const { layers } =
|
|
6190
|
+
const layer = _chunkYGIMK4NXcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
6191
|
+
const [start, end] = _chunkYGIMK4NXcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
6192
|
+
if (!Object.keys(style).length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give at least one style field to set.");
|
|
6193
|
+
_chunkYGIMK4NXcjs.patchTextStyle.call(void 0, _chunkYGIMK4NXcjs.DEFAULT_TEXT_STYLE, style);
|
|
6194
|
+
const { layers } = _chunkYGIMK4NXcjs.updateTypeLayer.call(void 0,
|
|
6156
6195
|
this.state.layers,
|
|
6157
6196
|
id,
|
|
6158
6197
|
(l) => {
|
|
6159
6198
|
if (start === end) {
|
|
6160
|
-
if (l.text.length) throw new (0,
|
|
6161
|
-
return { runs: [{ length: 0, style:
|
|
6199
|
+
if (l.text.length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
|
|
6200
|
+
return { runs: [{ length: 0, style: _chunkYGIMK4NXcjs.patchTextStyle.call(void 0, _chunkYGIMK4NXcjs.styleAt.call(void 0, l.runs, 0, _chunkYGIMK4NXcjs.DEFAULT_TEXT_STYLE), style) }] };
|
|
6162
6201
|
}
|
|
6163
|
-
return { runs:
|
|
6202
|
+
return { runs: _chunkYGIMK4NXcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkYGIMK4NXcjs.patchTextStyle.call(void 0, s, style)) };
|
|
6164
6203
|
},
|
|
6165
6204
|
this.textEnv(),
|
|
6166
6205
|
"restyle its text"
|
|
@@ -6170,11 +6209,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
6170
6209
|
}
|
|
6171
6210
|
/** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
|
|
6172
6211
|
setParagraphStyle(id, style, range = {}, commitToHistory = true) {
|
|
6173
|
-
const layer =
|
|
6174
|
-
const [start, end] =
|
|
6175
|
-
if (!Object.keys(style).length) throw new (0,
|
|
6176
|
-
|
|
6177
|
-
const { layers } =
|
|
6212
|
+
const layer = _chunkYGIMK4NXcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
6213
|
+
const [start, end] = _chunkYGIMK4NXcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
6214
|
+
if (!Object.keys(style).length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give at least one paragraph field to set.");
|
|
6215
|
+
_chunkYGIMK4NXcjs.patchParagraphStyle.call(void 0, {}, style);
|
|
6216
|
+
const { layers } = _chunkYGIMK4NXcjs.updateTypeLayer.call(void 0,
|
|
6178
6217
|
this.state.layers,
|
|
6179
6218
|
id,
|
|
6180
6219
|
(l) => {
|
|
@@ -6183,7 +6222,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6183
6222
|
const a = at;
|
|
6184
6223
|
at += p.length;
|
|
6185
6224
|
const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
|
|
6186
|
-
return touches || !l.text.length ? { length: p.length, style:
|
|
6225
|
+
return touches || !l.text.length ? { length: p.length, style: _chunkYGIMK4NXcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
|
|
6187
6226
|
});
|
|
6188
6227
|
return { paragraphs };
|
|
6189
6228
|
},
|
|
@@ -6199,21 +6238,21 @@ var ImageEditorController = (_class6 = class {
|
|
|
6199
6238
|
* paragraph. Also resizes a box. One undo step.
|
|
6200
6239
|
*/
|
|
6201
6240
|
setTextFrame(id, frame, commitToHistory = true) {
|
|
6202
|
-
const layer =
|
|
6203
|
-
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0,
|
|
6204
|
-
if (frame.kind !== "box" && frame.kind !== "point") throw new (0,
|
|
6241
|
+
const layer = _chunkYGIMK4NXcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
6242
|
+
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("width and height must be at least 1 pixel.");
|
|
6243
|
+
if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("kind must be point or box.");
|
|
6205
6244
|
const shaper = this.getTextShaper();
|
|
6206
|
-
const { layers } =
|
|
6245
|
+
const { layers } = _chunkYGIMK4NXcjs.updateTypeLayer.call(void 0,
|
|
6207
6246
|
this.state.layers,
|
|
6208
6247
|
id,
|
|
6209
6248
|
(l) => {
|
|
6210
6249
|
if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
|
|
6211
|
-
if (!shaper) throw new (0,
|
|
6212
|
-
const lines =
|
|
6250
|
+
if (!shaper) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
|
|
6251
|
+
const lines = _chunkYGIMK4NXcjs.layoutText.call(void 0, l, shaper).lines;
|
|
6213
6252
|
const first = lines[0];
|
|
6214
6253
|
const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
|
|
6215
6254
|
const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
|
|
6216
|
-
const m =
|
|
6255
|
+
const m = _chunkYGIMK4NXcjs.textMatrix.call(void 0, l);
|
|
6217
6256
|
const shifted = [m[0], m[1], m[2], m[3], m[0] * dx + m[2] * dy + m[4], m[1] * dx + m[3] * dy + m[5]];
|
|
6218
6257
|
const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
|
|
6219
6258
|
return { frame: nextFrame, transform: shifted };
|
|
@@ -6230,21 +6269,21 @@ var ImageEditorController = (_class6 = class {
|
|
|
6230
6269
|
* `warnings` says when other colours were dropped. One undo step.
|
|
6231
6270
|
*/
|
|
6232
6271
|
convertTextToShape(id) {
|
|
6233
|
-
const layer =
|
|
6234
|
-
|
|
6272
|
+
const layer = _chunkYGIMK4NXcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
6273
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
|
|
6235
6274
|
const shaper = this.getTextShaper();
|
|
6236
|
-
if (!shaper) throw new (0,
|
|
6237
|
-
const parts =
|
|
6275
|
+
if (!shaper) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
|
|
6276
|
+
const parts = _chunkYGIMK4NXcjs.textOutlines.call(void 0, layer, shaper);
|
|
6238
6277
|
const subpaths = parts.flatMap((p) => _chunkW3GXSUSQcjs.bezierToSubpaths.call(void 0, p.path));
|
|
6239
|
-
if (!subpaths.length) throw new (0,
|
|
6278
|
+
if (!subpaths.length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
|
|
6240
6279
|
const warnings = [];
|
|
6241
6280
|
const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
|
|
6242
6281
|
if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
|
|
6243
|
-
const missing =
|
|
6282
|
+
const missing = _chunkYGIMK4NXcjs.layoutText.call(void 0, layer, shaper).missingFonts;
|
|
6244
6283
|
if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
|
|
6245
|
-
const first = _nullishCoalesce(_optionalChain([layer, 'access', _248 => _248.runs, 'access', _249 => _249.find, 'call', _250 => _250((r) => r.length > 0), 'optionalAccess', _251 => _251.style]), () => (
|
|
6284
|
+
const first = _nullishCoalesce(_optionalChain([layer, 'access', _248 => _248.runs, 'access', _249 => _249.find, 'call', _250 => _250((r) => r.length > 0), 'optionalAccess', _251 => _251.style]), () => ( _chunkYGIMK4NXcjs.DEFAULT_TEXT_STYLE));
|
|
6246
6285
|
const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
|
|
6247
|
-
const shape =
|
|
6286
|
+
const shape = _chunkYGIMK4NXcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
|
|
6248
6287
|
const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
|
|
6249
6288
|
for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
6250
6289
|
this.commitLayers(_chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
|
|
@@ -6252,23 +6291,23 @@ var ImageEditorController = (_class6 = class {
|
|
|
6252
6291
|
}
|
|
6253
6292
|
/** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
|
|
6254
6293
|
getTextLayout(id) {
|
|
6255
|
-
const layer =
|
|
6294
|
+
const layer = _chunkYGIMK4NXcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
6256
6295
|
const shaper = this.getTextShaper();
|
|
6257
|
-
return shaper ?
|
|
6296
|
+
return shaper ? _chunkYGIMK4NXcjs.layoutText.call(void 0, layer, shaper) : null;
|
|
6258
6297
|
}
|
|
6259
6298
|
/** The text index nearest a document point (for clicks on a type layer). */
|
|
6260
6299
|
textIndexAt(id, point) {
|
|
6261
|
-
const layer =
|
|
6300
|
+
const layer = _chunkYGIMK4NXcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
6262
6301
|
const layout = this.getTextLayout(id);
|
|
6263
|
-
return layout ?
|
|
6302
|
+
return layout ? _chunkYGIMK4NXcjs.textIndexAt.call(void 0, layout, _chunkYGIMK4NXcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
|
|
6264
6303
|
}
|
|
6265
6304
|
/** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
|
|
6266
6305
|
textCaret(id, index) {
|
|
6267
|
-
const layer =
|
|
6306
|
+
const layer = _chunkYGIMK4NXcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
6268
6307
|
const layout = this.getTextLayout(id);
|
|
6269
6308
|
if (!layout) return null;
|
|
6270
|
-
const c =
|
|
6271
|
-
const m =
|
|
6309
|
+
const c = _chunkYGIMK4NXcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
|
|
6310
|
+
const m = _chunkYGIMK4NXcjs.textMatrix.call(void 0, layer);
|
|
6272
6311
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
6273
6312
|
return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
|
|
6274
6313
|
}
|
|
@@ -6279,14 +6318,14 @@ var ImageEditorController = (_class6 = class {
|
|
|
6279
6318
|
}
|
|
6280
6319
|
/** One component from tool or UI input (validated). */
|
|
6281
6320
|
componentFrom(spec, path) {
|
|
6282
|
-
const op =
|
|
6283
|
-
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0,
|
|
6284
|
-
if (spec.shape !== void 0) return
|
|
6285
|
-
if (spec.subpaths !== void 0) return { op, subpaths:
|
|
6286
|
-
throw new (0,
|
|
6321
|
+
const op = _chunkYGIMK4NXcjs.requireOperation.call(void 0, spec.op, `${path}op`);
|
|
6322
|
+
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
|
|
6323
|
+
if (spec.shape !== void 0) return _chunkYGIMK4NXcjs.liveComponent.call(void 0, _chunkYGIMK4NXcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
|
|
6324
|
+
if (spec.subpaths !== void 0) return { op, subpaths: _chunkYGIMK4NXcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
|
|
6325
|
+
throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
|
|
6287
6326
|
}
|
|
6288
6327
|
shapeInfo(id) {
|
|
6289
|
-
const layer =
|
|
6328
|
+
const layer = _chunkYGIMK4NXcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
6290
6329
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
6291
6330
|
const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
|
|
6292
6331
|
const info = {
|
|
@@ -6297,12 +6336,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
6297
6336
|
op: c.op,
|
|
6298
6337
|
live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
|
|
6299
6338
|
subpaths: _chunkW3GXSUSQcjs.roundSubpaths.call(void 0, c.subpaths),
|
|
6300
|
-
bounds: box(
|
|
6339
|
+
bounds: box(_chunkYGIMK4NXcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
|
|
6301
6340
|
})),
|
|
6302
6341
|
fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
|
|
6303
6342
|
fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
|
|
6304
6343
|
stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
|
|
6305
|
-
geometryBounds: box(
|
|
6344
|
+
geometryBounds: box(_chunkYGIMK4NXcjs.shapeGeometryBounds.call(void 0, layer)),
|
|
6306
6345
|
bounds: this.getLayerBounds(id)
|
|
6307
6346
|
};
|
|
6308
6347
|
if (layer.annotation) info.annotationId = layer.annotation.id;
|
|
@@ -6319,17 +6358,17 @@ var ImageEditorController = (_class6 = class {
|
|
|
6319
6358
|
*/
|
|
6320
6359
|
addShapeLayer(init) {
|
|
6321
6360
|
const specs = _optionalChain([init, 'access', _256 => _256.components, 'optionalAccess', _257 => _257.length]) ? init.components : [init];
|
|
6322
|
-
if (_optionalChain([init, 'access', _258 => _258.components, 'optionalAccess', _259 => _259.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0,
|
|
6361
|
+
if (_optionalChain([init, 'access', _258 => _258.components, 'optionalAccess', _259 => _259.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
|
|
6323
6362
|
const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _260 => _260.components, 'optionalAccess', _261 => _261.length]) ? `components[${i}].` : ""));
|
|
6324
|
-
const stroke = init.stroke ?
|
|
6363
|
+
const stroke = init.stroke ? _chunkYGIMK4NXcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
|
|
6325
6364
|
const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
|
|
6326
|
-
const fill = init.fill === void 0 ? stroke && openOnly ? null :
|
|
6327
|
-
if (!fill && !stroke) throw new (0,
|
|
6328
|
-
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0,
|
|
6329
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
6330
|
-
if (init.blend !== void 0 && !_chunkXIOMMGPDcjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
6331
|
-
const layer =
|
|
6332
|
-
const next =
|
|
6365
|
+
const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkYGIMK4NXcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkYGIMK4NXcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
|
|
6366
|
+
if (!fill && !stroke) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
|
|
6367
|
+
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
6368
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
6369
|
+
if (init.blend !== void 0 && !_chunkXIOMMGPDcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
6370
|
+
const layer = _chunkYGIMK4NXcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
|
|
6371
|
+
const next = _chunkYGIMK4NXcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
6333
6372
|
this.commitLayers(next, () => {
|
|
6334
6373
|
this.state.activeLayerId = layer.id;
|
|
6335
6374
|
this.state.activeTarget = "pixels";
|
|
@@ -6342,18 +6381,18 @@ var ImageEditorController = (_class6 = class {
|
|
|
6342
6381
|
* only those settings of the current stroke. Returns the shape.
|
|
6343
6382
|
*/
|
|
6344
6383
|
setShapeStyle(id, changes, commitToHistory = true) {
|
|
6345
|
-
const layer =
|
|
6346
|
-
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null :
|
|
6347
|
-
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null :
|
|
6348
|
-
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0,
|
|
6384
|
+
const layer = _chunkYGIMK4NXcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
6385
|
+
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkYGIMK4NXcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
|
|
6386
|
+
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkYGIMK4NXcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
|
|
6387
|
+
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
6349
6388
|
const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
|
|
6350
|
-
const { layers } =
|
|
6389
|
+
const { layers } = _chunkYGIMK4NXcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
|
|
6351
6390
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
6352
6391
|
return this.shapeInfo(id);
|
|
6353
6392
|
}
|
|
6354
6393
|
componentIndex(layer, index) {
|
|
6355
6394
|
if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
|
|
6356
|
-
throw new (0,
|
|
6395
|
+
throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
|
|
6357
6396
|
}
|
|
6358
6397
|
return index;
|
|
6359
6398
|
}
|
|
@@ -6363,36 +6402,36 @@ var ImageEditorController = (_class6 = class {
|
|
|
6363
6402
|
* the live shape) or its operation. Returns the shape.
|
|
6364
6403
|
*/
|
|
6365
6404
|
setShapeComponent(id, index, change, commitToHistory = true) {
|
|
6366
|
-
const layer =
|
|
6405
|
+
const layer = _chunkYGIMK4NXcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
6367
6406
|
const i = this.componentIndex(layer, index);
|
|
6368
6407
|
const current = layer.components[i];
|
|
6369
6408
|
let shape = change.shape;
|
|
6370
6409
|
if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
|
|
6371
6410
|
else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
|
|
6372
|
-
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op:
|
|
6411
|
+
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkYGIMK4NXcjs.requireOperation.call(void 0, change.op) };
|
|
6373
6412
|
const components = layer.components.map((c, k) => k === i ? next : c);
|
|
6374
|
-
const { layers } =
|
|
6413
|
+
const { layers } = _chunkYGIMK4NXcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
6375
6414
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
6376
6415
|
return this.shapeInfo(id);
|
|
6377
6416
|
}
|
|
6378
6417
|
/** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
|
|
6379
6418
|
addShapeComponent(id, spec, index) {
|
|
6380
|
-
const layer =
|
|
6419
|
+
const layer = _chunkYGIMK4NXcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
6381
6420
|
const c = this.componentFrom(spec, "");
|
|
6382
6421
|
const at = index === void 0 ? layer.components.length : index;
|
|
6383
|
-
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0,
|
|
6422
|
+
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
|
|
6384
6423
|
const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
|
|
6385
|
-
const { layers } =
|
|
6424
|
+
const { layers } = _chunkYGIMK4NXcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
6386
6425
|
this.commitLayers(layers);
|
|
6387
6426
|
return this.shapeInfo(id);
|
|
6388
6427
|
}
|
|
6389
6428
|
/** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
|
|
6390
6429
|
removeShapeComponent(id, index) {
|
|
6391
|
-
const layer =
|
|
6430
|
+
const layer = _chunkYGIMK4NXcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
6392
6431
|
const i = this.componentIndex(layer, index);
|
|
6393
|
-
if (layer.components.length === 1) throw new (0,
|
|
6432
|
+
if (layer.components.length === 1) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
|
|
6394
6433
|
const components = layer.components.filter((_, k) => k !== i);
|
|
6395
|
-
const { layers } =
|
|
6434
|
+
const { layers } = _chunkYGIMK4NXcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
6396
6435
|
this.commitLayers(layers);
|
|
6397
6436
|
return this.shapeInfo(id);
|
|
6398
6437
|
}
|
|
@@ -6401,10 +6440,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
6401
6440
|
* shapes become paths), as one undo step. Returns the shape.
|
|
6402
6441
|
*/
|
|
6403
6442
|
mergeShapeComponents(id) {
|
|
6404
|
-
const layer =
|
|
6405
|
-
if (layer.components.length < 2) throw new (0,
|
|
6406
|
-
const components =
|
|
6407
|
-
const { layers } =
|
|
6443
|
+
const layer = _chunkYGIMK4NXcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
6444
|
+
if (layer.components.length < 2) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
|
|
6445
|
+
const components = _chunkYGIMK4NXcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
|
|
6446
|
+
const { layers } = _chunkYGIMK4NXcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
|
|
6408
6447
|
this.commitLayers(layers);
|
|
6409
6448
|
return this.shapeInfo(id);
|
|
6410
6449
|
}
|
|
@@ -6414,8 +6453,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
6414
6453
|
* step. Returns the layer id.
|
|
6415
6454
|
*/
|
|
6416
6455
|
async rasterizeLayer(id) {
|
|
6417
|
-
const layer =
|
|
6418
|
-
|
|
6456
|
+
const layer = _chunkYGIMK4NXcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
6457
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
|
|
6419
6458
|
const { width, height } = this.naturalSize;
|
|
6420
6459
|
const canvas = { x: 0, y: 0, width, height };
|
|
6421
6460
|
let next;
|
|
@@ -6431,8 +6470,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
6431
6470
|
if (layer.locks) next.locks = layer.locks;
|
|
6432
6471
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
6433
6472
|
} else if (layer.type === "pixel") {
|
|
6434
|
-
if (!_optionalChain([layer, 'access', _262 => _262.filters, 'optionalAccess', _263 => _263.length])) throw new (0,
|
|
6435
|
-
|
|
6473
|
+
if (!_optionalChain([layer, 'access', _262 => _262.filters, 'optionalAccess', _263 => _263.length])) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
|
|
6474
|
+
_chunkYGIMK4NXcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
|
|
6436
6475
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
6437
6476
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
6438
6477
|
delete content.mask;
|
|
@@ -6449,10 +6488,10 @@ var ImageEditorController = (_class6 = class {
|
|
|
6449
6488
|
} else if (layer.type === "smart") {
|
|
6450
6489
|
return this.rasterizeSmartObject(id);
|
|
6451
6490
|
} else if (layer.type === "shape" || layer.type === "type") {
|
|
6452
|
-
next = layer.type === "shape" ?
|
|
6491
|
+
next = layer.type === "shape" ? _chunkYGIMK4NXcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkYGIMK4NXcjs.typeAsPixelLayer.call(void 0, layer);
|
|
6453
6492
|
if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _264 => _264.annotation, 'optionalAccess', _265 => _265.id])) this.state.selectedAnnotationId = null;
|
|
6454
6493
|
} else {
|
|
6455
|
-
throw new (0,
|
|
6494
|
+
throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Only shape, type and annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
|
|
6456
6495
|
}
|
|
6457
6496
|
this.commitLayers(_chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
|
|
6458
6497
|
return id;
|
|
@@ -6467,7 +6506,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6467
6506
|
* Throws `PsdError` for files that cannot be read at all.
|
|
6468
6507
|
*/
|
|
6469
6508
|
loadPsd(bytes) {
|
|
6470
|
-
const result =
|
|
6509
|
+
const result = _chunkYGIMK4NXcjs.importPsd.call(void 0, bytes, { newId: () => _chunkYGIMK4NXcjs.newLayerId.call(void 0, ) });
|
|
6471
6510
|
this.abandonContents();
|
|
6472
6511
|
this.recordHistory();
|
|
6473
6512
|
const s = this.state;
|
|
@@ -6475,9 +6514,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
6475
6514
|
s.sourceUrl = null;
|
|
6476
6515
|
s.imageDimensions = { width: result.width, height: result.height };
|
|
6477
6516
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
6478
|
-
s.layers = result
|
|
6517
|
+
s.layers = this.checkPsdFonts(result);
|
|
6479
6518
|
s.crop = null;
|
|
6480
|
-
s.transform = { ...
|
|
6519
|
+
s.transform = { ..._chunkYGIMK4NXcjs.DEFAULT_TRANSFORM_VALUES };
|
|
6481
6520
|
s.outputOpacity = 1;
|
|
6482
6521
|
delete s.legacyOutputBlur;
|
|
6483
6522
|
s.selection = null;
|
|
@@ -6500,6 +6539,30 @@ var ImageEditorController = (_class6 = class {
|
|
|
6500
6539
|
summary: result.summary
|
|
6501
6540
|
};
|
|
6502
6541
|
}
|
|
6542
|
+
/**
|
|
6543
|
+
* Type layers whose fonts the shaper lacks: they keep Photoshop's pixels, are marked with their
|
|
6544
|
+
* `missingFonts`, and a warning names them (an edit draws them with a fallback).
|
|
6545
|
+
*/
|
|
6546
|
+
checkPsdFonts(result) {
|
|
6547
|
+
const shaper = this.getTextShaper();
|
|
6548
|
+
const types = _chunkPOGBUYWEcjs.flattenLayers.call(void 0, result.layers).filter((l) => l.type === "type");
|
|
6549
|
+
if (!types.length) return result.layers;
|
|
6550
|
+
let layers = result.layers;
|
|
6551
|
+
const missing = /* @__PURE__ */ new Map();
|
|
6552
|
+
for (const l of types) {
|
|
6553
|
+
const fonts = shaper ? _chunkYGIMK4NXcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
|
|
6554
|
+
if (!fonts.length) continue;
|
|
6555
|
+
layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
|
|
6556
|
+
for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
|
|
6557
|
+
}
|
|
6558
|
+
for (const [font, names] of missing) {
|
|
6559
|
+
result.warnings.push(
|
|
6560
|
+
shaper ? `The font "${font}" is missing here: the type shows Photoshop's pixels until it is edited, then a fallback font (${names.length === 1 ? "layer" : "layers"} ${names.map((n) => `"${n}"`).join(", ")}).` : `Type layers show Photoshop's pixels; nothing here can draw text, so they cannot be edited (${names.length === 1 ? "layer" : "layers"} ${names.map((n) => `"${n}"`).join(", ")}).`
|
|
6561
|
+
);
|
|
6562
|
+
if (!shaper) break;
|
|
6563
|
+
}
|
|
6564
|
+
return layers;
|
|
6565
|
+
}
|
|
6503
6566
|
/**
|
|
6504
6567
|
* The document as an 8-bit RGB PSD (PSB above 30 000 px) with real layers, groups, adjustment
|
|
6505
6568
|
* layers and masks, in the source frame. Layer filters and parametric (depth) masks are baked
|
|
@@ -6515,7 +6578,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6515
6578
|
const canRasterize = this.renderer.canRasterize();
|
|
6516
6579
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
6517
6580
|
const sources = this.renderer.compositorSources(width, height);
|
|
6518
|
-
const compositor = new (0,
|
|
6581
|
+
const compositor = new (0, _chunkYGIMK4NXcjs.LayerCompositor)();
|
|
6519
6582
|
const bakeMask = (layer) => {
|
|
6520
6583
|
const mask = layer.mask;
|
|
6521
6584
|
if (!_optionalChain([mask, 'optionalAccess', _266 => _266.source])) return mask;
|
|
@@ -6578,8 +6641,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
6578
6641
|
return out2;
|
|
6579
6642
|
}
|
|
6580
6643
|
if (layer.type === "shape" || layer.type === "type") {
|
|
6581
|
-
|
|
6582
|
-
const out2 =
|
|
6644
|
+
if (layer.type === "type" && _optionalChain([layer, 'access', _268 => _268.missingFonts, 'optionalAccess', _269 => _269.length])) add2(`Type layers drawn with a fallback for missing fonts (${layer.missingFonts.join(", ")}) keep the font names, so Photoshop may draw them differently`, layer.name);
|
|
6645
|
+
const out2 = { ...layer };
|
|
6583
6646
|
const mask2 = bakeMask(layer);
|
|
6584
6647
|
if (mask2) out2.mask = mask2;
|
|
6585
6648
|
else delete out2.mask;
|
|
@@ -6597,7 +6660,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6597
6660
|
out.surface = this.surfaceOf(layer);
|
|
6598
6661
|
delete out.source;
|
|
6599
6662
|
}
|
|
6600
|
-
const active = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
6663
|
+
const active = _nullishCoalesce(_optionalChain([layer, 'access', _270 => _270.filters, 'optionalAccess', _271 => _271.filter, 'call', _272 => _272(_chunkYGIMK4NXcjs.isActiveFilter)]), () => ( []));
|
|
6601
6664
|
if (active.length) {
|
|
6602
6665
|
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
6603
6666
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -6608,7 +6671,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6608
6671
|
const data = compositor.composite([content], canvas, sources);
|
|
6609
6672
|
out = { ...out, surface: _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
|
|
6610
6673
|
}
|
|
6611
|
-
if (_optionalChain([layer, 'access',
|
|
6674
|
+
if (_optionalChain([layer, 'access', _273 => _273.filters, 'optionalAccess', _274 => _274.some, 'call', _275 => _275((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
|
|
6612
6675
|
delete out.filters;
|
|
6613
6676
|
const mask = bakeMask(layer);
|
|
6614
6677
|
if (mask) out.mask = mask;
|
|
@@ -6627,7 +6690,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6627
6690
|
if (s.legacyOutputBlur) warnings.push("The document-level blur of an old document is not written.");
|
|
6628
6691
|
for (const [msg, names] of note) warnings.push(`${msg} (${names.length === 1 ? "layer" : "layers"} ${names.map((n) => `"${n}"`).join(", ")}).`);
|
|
6629
6692
|
const merged = compositor.composite(prepared, canvas, { ...sources, version: `psd:${Date.now()}` });
|
|
6630
|
-
const result =
|
|
6693
|
+
const result = _chunkYGIMK4NXcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight });
|
|
6631
6694
|
warnings.push(...result.warnings);
|
|
6632
6695
|
return { bytes: result.bytes, warnings, psb: result.psb, width, height };
|
|
6633
6696
|
}
|
|
@@ -6643,13 +6706,13 @@ var ImageEditorController = (_class6 = class {
|
|
|
6643
6706
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
6644
6707
|
if (this.state.selection && (sx !== 1 || sy !== 1)) {
|
|
6645
6708
|
this.state.selection = normalizeSelection(
|
|
6646
|
-
|
|
6709
|
+
_chunkYGIMK4NXcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
|
|
6647
6710
|
);
|
|
6648
6711
|
}
|
|
6649
6712
|
let layers = this.state.layers;
|
|
6650
6713
|
if (sx !== 1 || sy !== 1) {
|
|
6651
6714
|
if (this.state.crop) {
|
|
6652
|
-
this.state.crop =
|
|
6715
|
+
this.state.crop = _chunkYGIMK4NXcjs.clampCropToImage.call(void 0,
|
|
6653
6716
|
{
|
|
6654
6717
|
x: Math.round(this.state.crop.x * sx),
|
|
6655
6718
|
y: Math.round(this.state.crop.y * sy),
|
|
@@ -6661,24 +6724,24 @@ var ImageEditorController = (_class6 = class {
|
|
|
6661
6724
|
);
|
|
6662
6725
|
}
|
|
6663
6726
|
layers = resizeLegacyMasks(layers, prev, next.dimensions);
|
|
6664
|
-
const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access',
|
|
6727
|
+
const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _276 => _276.state, 'access', _277 => _277.patterns, 'optionalAccess', _278 => _278.find, 'call', _279 => _279((p) => p.id === pid)]), () => ( null)) };
|
|
6665
6728
|
for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) {
|
|
6666
6729
|
if (l.type === "annotation") {
|
|
6667
6730
|
layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
|
|
6668
6731
|
} else if (l.type === "shape") {
|
|
6669
6732
|
const a = l.annotation;
|
|
6670
6733
|
const scaled = a ? scaleAnnotation(a, sx, sy) : null;
|
|
6671
|
-
const fromAnnotation = scaled ?
|
|
6734
|
+
const fromAnnotation = scaled ? _chunkYGIMK4NXcjs.shapeFromAnnotation.call(void 0, scaled) : null;
|
|
6672
6735
|
const m = [sx, 0, 0, sy, 0, 0];
|
|
6673
|
-
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess',
|
|
6736
|
+
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _280 => _280.components]), () => ( _chunkYGIMK4NXcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
|
|
6674
6737
|
const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
|
|
6675
6738
|
if (scaled && fromAnnotation) moved.annotation = scaled;
|
|
6676
6739
|
else delete moved.annotation;
|
|
6677
|
-
layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, l.id, () =>
|
|
6740
|
+
layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkYGIMK4NXcjs.rerenderShape.call(void 0, moved, env));
|
|
6678
6741
|
}
|
|
6679
6742
|
}
|
|
6680
6743
|
}
|
|
6681
|
-
const bg =
|
|
6744
|
+
const bg = _chunkYGIMK4NXcjs.developTarget.call(void 0, layers, null);
|
|
6682
6745
|
if (bg && bg.source !== "document") layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
|
|
6683
6746
|
if (clearAnnotations) {
|
|
6684
6747
|
for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, l.id, () => null);
|
|
@@ -6688,7 +6751,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6688
6751
|
this.notify();
|
|
6689
6752
|
}
|
|
6690
6753
|
toJSON(options) {
|
|
6691
|
-
const root = _optionalChain([this, 'access',
|
|
6754
|
+
const root = _optionalChain([this, 'access', _281 => _281.contentsStack, 'access', _282 => _282[0], 'optionalAccess', _283 => _283.saved]);
|
|
6692
6755
|
const current = this.state;
|
|
6693
6756
|
const element = this.imageElement;
|
|
6694
6757
|
if (root) {
|
|
@@ -6699,7 +6762,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6699
6762
|
let out;
|
|
6700
6763
|
try {
|
|
6701
6764
|
out = this.serializeState();
|
|
6702
|
-
if (_optionalChain([this, 'access',
|
|
6765
|
+
if (_optionalChain([this, 'access', _284 => _284.state, 'access', _285 => _285.selection, 'optionalAccess', _286 => _286.bounds])) out.selection = _chunkYGIMK4NXcjs.serializeSelection.call(void 0, this.state.selection);
|
|
6703
6766
|
} finally {
|
|
6704
6767
|
if (root) {
|
|
6705
6768
|
this.state = current;
|
|
@@ -6707,8 +6770,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
6707
6770
|
this.viewKey = [];
|
|
6708
6771
|
}
|
|
6709
6772
|
}
|
|
6710
|
-
if (!options || out.version !==
|
|
6711
|
-
return
|
|
6773
|
+
if (!options || out.version !== _chunkYGIMK4NXcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
|
|
6774
|
+
return _chunkYGIMK4NXcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
|
|
6712
6775
|
}
|
|
6713
6776
|
/**
|
|
6714
6777
|
* Loads a stored state whose v3 assets may live in an asset store (references other than data
|
|
@@ -6716,12 +6779,12 @@ var ImageEditorController = (_class6 = class {
|
|
|
6716
6779
|
* out and listed in `lastLoadProblems`.
|
|
6717
6780
|
*/
|
|
6718
6781
|
async loadJSONAsync(data, options = {}) {
|
|
6719
|
-
if (data.version !==
|
|
6782
|
+
if (data.version !== _chunkYGIMK4NXcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
|
|
6720
6783
|
this.loadJSON(data);
|
|
6721
6784
|
return;
|
|
6722
6785
|
}
|
|
6723
6786
|
const problems = [];
|
|
6724
|
-
const assets = await
|
|
6787
|
+
const assets = await _chunkYGIMK4NXcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
|
|
6725
6788
|
this.loadJSON({ ...data, assets });
|
|
6726
6789
|
this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
|
|
6727
6790
|
}
|
|
@@ -6733,8 +6796,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
6733
6796
|
let selection = null;
|
|
6734
6797
|
if (data.selection) {
|
|
6735
6798
|
try {
|
|
6736
|
-
selection = normalizeSelection(
|
|
6737
|
-
} catch (
|
|
6799
|
+
selection = normalizeSelection(_chunkYGIMK4NXcjs.deserializeSelection.call(void 0, data.selection));
|
|
6800
|
+
} catch (e22) {
|
|
6738
6801
|
selection = null;
|
|
6739
6802
|
}
|
|
6740
6803
|
}
|
|
@@ -6751,8 +6814,8 @@ var ImageEditorController = (_class6 = class {
|
|
|
6751
6814
|
if (isLayered(data)) {
|
|
6752
6815
|
const problems = [];
|
|
6753
6816
|
const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
|
|
6754
|
-
const storedPatterns =
|
|
6755
|
-
s.layers =
|
|
6817
|
+
const storedPatterns = _chunkYGIMK4NXcjs.deserializePatterns.call(void 0, data.patterns, []);
|
|
6818
|
+
s.layers = _chunkYGIMK4NXcjs.deserializeLayers.call(void 0, data.layers, {
|
|
6756
6819
|
assets: _nullishCoalesce(data.assets, () => ( {})),
|
|
6757
6820
|
problems,
|
|
6758
6821
|
smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
|
|
@@ -6770,7 +6833,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6770
6833
|
const light = data.globalLight;
|
|
6771
6834
|
if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
|
|
6772
6835
|
else delete s.globalLight;
|
|
6773
|
-
const patterns =
|
|
6836
|
+
const patterns = _chunkYGIMK4NXcjs.deserializePatterns.call(void 0, data.patterns, problems);
|
|
6774
6837
|
if (patterns.length) s.patterns = patterns;
|
|
6775
6838
|
else delete s.patterns;
|
|
6776
6839
|
if (!this.imageElement && typeof data.width === "number" && typeof data.height === "number" && data.width > 0 && data.height > 0) {
|
|
@@ -6778,7 +6841,7 @@ var ImageEditorController = (_class6 = class {
|
|
|
6778
6841
|
}
|
|
6779
6842
|
} else {
|
|
6780
6843
|
const { width, height } = this.naturalSize;
|
|
6781
|
-
const stack =
|
|
6844
|
+
const stack = _chunkYGIMK4NXcjs.layersFromLegacy.call(void 0, data, width, height);
|
|
6782
6845
|
s.layers = stack.layers;
|
|
6783
6846
|
s.outputOpacity = stack.outputOpacity;
|
|
6784
6847
|
if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
|
|
@@ -6796,11 +6859,11 @@ var ImageEditorController = (_class6 = class {
|
|
|
6796
6859
|
}
|
|
6797
6860
|
serializeState() {
|
|
6798
6861
|
const { width, height } = this.naturalSize;
|
|
6799
|
-
const view =
|
|
6800
|
-
if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access',
|
|
6862
|
+
const view = _chunkYGIMK4NXcjs.legacyView.call(void 0, this.stack(), width, height, null);
|
|
6863
|
+
if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _287 => _287.state, 'access', _288 => _288.patterns, 'optionalAccess', _289 => _289.length])) {
|
|
6801
6864
|
return {
|
|
6802
6865
|
// States without adjustment layers keep schema 1, so they round-trip unchanged.
|
|
6803
|
-
version: _optionalChain([view, 'access',
|
|
6866
|
+
version: _optionalChain([view, 'access', _290 => _290.adjustments, 'access', _291 => _291.layers, 'optionalAccess', _292 => _292.length]) ? 2 : 1,
|
|
6804
6867
|
crop: this.state.crop ? { ...this.state.crop } : null,
|
|
6805
6868
|
transform: { ...this.state.transform },
|
|
6806
6869
|
adjustments: serializeAdjustments(view.adjustments),
|
|
@@ -6811,9 +6874,9 @@ var ImageEditorController = (_class6 = class {
|
|
|
6811
6874
|
annotations: JSON.parse(JSON.stringify(view.annotations))
|
|
6812
6875
|
};
|
|
6813
6876
|
}
|
|
6814
|
-
const { layers, assets, smartContents } =
|
|
6877
|
+
const { layers, assets, smartContents } = _chunkYGIMK4NXcjs.serializeLayers.call(void 0, this.state.layers);
|
|
6815
6878
|
const out = {
|
|
6816
|
-
version:
|
|
6879
|
+
version: _chunkYGIMK4NXcjs.LAYERED_SCHEMA_VERSION,
|
|
6817
6880
|
width,
|
|
6818
6881
|
height,
|
|
6819
6882
|
layers,
|
|
@@ -6825,16 +6888,16 @@ var ImageEditorController = (_class6 = class {
|
|
|
6825
6888
|
};
|
|
6826
6889
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
6827
6890
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
6828
|
-
if (_optionalChain([this, 'access',
|
|
6891
|
+
if (_optionalChain([this, 'access', _293 => _293.state, 'access', _294 => _294.patterns, 'optionalAccess', _295 => _295.length])) out.patterns = _chunkYGIMK4NXcjs.serializePatterns.call(void 0, this.state.patterns);
|
|
6829
6892
|
if (smartContents) out.smartContents = smartContents;
|
|
6830
6893
|
return out;
|
|
6831
6894
|
}
|
|
6832
6895
|
}, _class6);
|
|
6833
6896
|
function serializeAdjustments(adjustments) {
|
|
6834
6897
|
const out = { ...adjustments };
|
|
6835
|
-
if (_optionalChain([out, 'access',
|
|
6898
|
+
if (_optionalChain([out, 'access', _296 => _296.layers, 'optionalAccess', _297 => _297.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
6836
6899
|
else delete out.layers;
|
|
6837
|
-
if (
|
|
6900
|
+
if (_chunkYGIMK4NXcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkYGIMK4NXcjs.LEGACY_PROCESS_VERSION) {
|
|
6838
6901
|
delete out.process;
|
|
6839
6902
|
if (!out.tint) delete out.tint;
|
|
6840
6903
|
}
|
|
@@ -6845,7 +6908,7 @@ function withDevelop(layer, partial) {
|
|
|
6845
6908
|
let i = filters.findIndex((f) => f.kind === "develop");
|
|
6846
6909
|
if (i === -1) {
|
|
6847
6910
|
filters.unshift({
|
|
6848
|
-
id: layer.source === "document" ?
|
|
6911
|
+
id: layer.source === "document" ? _chunkYGIMK4NXcjs.DEVELOP_FILTER_ID : _chunkYGIMK4NXcjs.newLayerId.call(void 0, "flt"),
|
|
6849
6912
|
kind: "develop",
|
|
6850
6913
|
enabled: true,
|
|
6851
6914
|
brightness: 0,
|
|
@@ -6854,7 +6917,7 @@ function withDevelop(layer, partial) {
|
|
|
6854
6917
|
exposure: 0,
|
|
6855
6918
|
temperature: 0,
|
|
6856
6919
|
tint: 0,
|
|
6857
|
-
process:
|
|
6920
|
+
process: _chunkYGIMK4NXcjs.LATEST_PROCESS_VERSION
|
|
6858
6921
|
});
|
|
6859
6922
|
i = 0;
|
|
6860
6923
|
}
|
|
@@ -6863,16 +6926,16 @@ function withDevelop(layer, partial) {
|
|
|
6863
6926
|
const v = partial[k];
|
|
6864
6927
|
if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
|
|
6865
6928
|
}
|
|
6866
|
-
if ("process" in partial) next.process =
|
|
6929
|
+
if ("process" in partial) next.process = _chunkYGIMK4NXcjs.normalizeProcessVersion.call(void 0, partial.process);
|
|
6867
6930
|
filters[i] = next;
|
|
6868
6931
|
return { ...layer, filters };
|
|
6869
6932
|
}
|
|
6870
6933
|
function withBlur(layer, radius) {
|
|
6871
|
-
const existing = _optionalChain([layer, 'access',
|
|
6934
|
+
const existing = _optionalChain([layer, 'access', _298 => _298.filters, 'optionalAccess', _299 => _299.find, 'call', _300 => _300((f) => f.kind === "blur")]);
|
|
6872
6935
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
6873
6936
|
if (radius > 0) {
|
|
6874
6937
|
filters.push({
|
|
6875
|
-
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
6938
|
+
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _301 => _301.id]), () => ( (layer.source === "document" ? _chunkYGIMK4NXcjs.BLUR_FILTER_ID : _chunkYGIMK4NXcjs.newLayerId.call(void 0, "flt")))),
|
|
6876
6939
|
kind: "blur",
|
|
6877
6940
|
enabled: true,
|
|
6878
6941
|
radius
|
|
@@ -6896,7 +6959,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
6896
6959
|
if (!update.mask) delete next.mask;
|
|
6897
6960
|
else {
|
|
6898
6961
|
const current = node.mask && !node.mask.source ? node.mask : null;
|
|
6899
|
-
const memo = current ?
|
|
6962
|
+
const memo = current ? _chunkYGIMK4NXcjs.legacyMaskOf.call(void 0, current, width, height) : null;
|
|
6900
6963
|
if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
|
|
6901
6964
|
next.mask = withMaskProps(current, {
|
|
6902
6965
|
density: _nullishCoalesce(update.mask.density, () => ( 1)),
|
|
@@ -6904,7 +6967,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
6904
6967
|
enabled: update.mask.enabled !== false
|
|
6905
6968
|
});
|
|
6906
6969
|
} else {
|
|
6907
|
-
const m =
|
|
6970
|
+
const m = _chunkYGIMK4NXcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
|
|
6908
6971
|
if (m) next.mask = m;
|
|
6909
6972
|
else delete next.mask;
|
|
6910
6973
|
}
|
|
@@ -6943,7 +7006,7 @@ function resizeLegacyMasks(layers, from, to) {
|
|
|
6943
7006
|
for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) {
|
|
6944
7007
|
if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
|
|
6945
7008
|
const old = l.mask;
|
|
6946
|
-
const mask =
|
|
7009
|
+
const mask = _chunkYGIMK4NXcjs.rasterMaskFromLegacy.call(void 0, _chunkYGIMK4NXcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
|
|
6947
7010
|
if (!mask) continue;
|
|
6948
7011
|
out = _chunkPOGBUYWEcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
|
|
6949
7012
|
}
|
|
@@ -6964,7 +7027,7 @@ function collectStateTiles(layers, into) {
|
|
|
6964
7027
|
if (l.type === "shape" || l.type === "type") _chunkXIOMMGPDcjs.collectTiles.call(void 0, l.surface, into);
|
|
6965
7028
|
if (l.type === "smart") {
|
|
6966
7029
|
_chunkXIOMMGPDcjs.collectTiles.call(void 0, l.surface, into);
|
|
6967
|
-
if (_optionalChain([l, 'access',
|
|
7030
|
+
if (_optionalChain([l, 'access', _302 => _302.smartFilters, 'optionalAccess', _303 => _303.mask])) _chunkXIOMMGPDcjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
|
|
6968
7031
|
if (l.contents.raster) _chunkXIOMMGPDcjs.collectTiles.call(void 0, l.contents.raster, into);
|
|
6969
7032
|
if (l.contents.document) collectStateTiles(l.contents.document.layers, into);
|
|
6970
7033
|
}
|
|
@@ -6975,7 +7038,7 @@ function pixelsOnly(layers) {
|
|
|
6975
7038
|
for (const l of layers) {
|
|
6976
7039
|
if (l.type === "adjustment") continue;
|
|
6977
7040
|
if (l.type === "group") out.push({ ...l, children: pixelsOnly(l.children) });
|
|
6978
|
-
else if (l.type === "pixel" && _optionalChain([l, 'access',
|
|
7041
|
+
else if (l.type === "pixel" && _optionalChain([l, 'access', _304 => _304.filters, 'optionalAccess', _305 => _305.length])) {
|
|
6979
7042
|
const p = { ...l };
|
|
6980
7043
|
delete p.filters;
|
|
6981
7044
|
out.push(p);
|
|
@@ -7018,12 +7081,12 @@ function withoutAnnotations(layers) {
|
|
|
7018
7081
|
function parseColor(value) {
|
|
7019
7082
|
if (Array.isArray(value)) {
|
|
7020
7083
|
if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
|
|
7021
|
-
throw new (0,
|
|
7084
|
+
throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
|
|
7022
7085
|
}
|
|
7023
7086
|
return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
|
|
7024
7087
|
}
|
|
7025
7088
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
|
|
7026
|
-
if (!m) throw new (0,
|
|
7089
|
+
if (!m) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
|
|
7027
7090
|
let hex = m[1];
|
|
7028
7091
|
if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
|
|
7029
7092
|
const n = (i) => parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -7033,7 +7096,7 @@ function toHex(c) {
|
|
|
7033
7096
|
return "#" + [c[0], c[1], c[2]].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("");
|
|
7034
7097
|
}
|
|
7035
7098
|
function normalizeSelection(mask) {
|
|
7036
|
-
return _optionalChain([mask, 'optionalAccess',
|
|
7099
|
+
return _optionalChain([mask, 'optionalAccess', _306 => _306.bounds]) ? mask : null;
|
|
7037
7100
|
}
|
|
7038
7101
|
function sameSelection(a, b) {
|
|
7039
7102
|
if (a.width !== b.width || a.height !== b.height) return false;
|
|
@@ -7138,7 +7201,7 @@ function loadImageEditorDocument(input) {
|
|
|
7138
7201
|
if (typeof input === "string") {
|
|
7139
7202
|
try {
|
|
7140
7203
|
parsed = JSON.parse(input);
|
|
7141
|
-
} catch (
|
|
7204
|
+
} catch (e23) {
|
|
7142
7205
|
parsed = input;
|
|
7143
7206
|
}
|
|
7144
7207
|
}
|
|
@@ -7173,7 +7236,7 @@ function loadImageEditorDocument(input) {
|
|
|
7173
7236
|
// Optional: only present when something was selected when saving.
|
|
7174
7237
|
selection: {
|
|
7175
7238
|
parse: (value) => {
|
|
7176
|
-
const mask =
|
|
7239
|
+
const mask = _chunkYGIMK4NXcjs.deserializeSelection.call(void 0, value);
|
|
7177
7240
|
const v = value;
|
|
7178
7241
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
7179
7242
|
},
|
|
@@ -7194,7 +7257,7 @@ function loadImageEditorDocument(input) {
|
|
|
7194
7257
|
}
|
|
7195
7258
|
const state = { version: 1, ...result.value };
|
|
7196
7259
|
if (isV2) {
|
|
7197
|
-
if (_optionalChain([state, 'access',
|
|
7260
|
+
if (_optionalChain([state, 'access', _307 => _307.adjustments, 'access', _308 => _308.layers, 'optionalAccess', _309 => _309.length])) state.version = 2;
|
|
7198
7261
|
result.report.version = 2;
|
|
7199
7262
|
}
|
|
7200
7263
|
if (state.selection === void 0) delete state.selection;
|
|
@@ -7261,7 +7324,7 @@ function loadLayeredDocument(doc) {
|
|
|
7261
7324
|
},
|
|
7262
7325
|
selection: {
|
|
7263
7326
|
parse: (value) => {
|
|
7264
|
-
const mask =
|
|
7327
|
+
const mask = _chunkYGIMK4NXcjs.deserializeSelection.call(void 0, value);
|
|
7265
7328
|
const v = value;
|
|
7266
7329
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
7267
7330
|
},
|
|
@@ -7402,7 +7465,7 @@ function findAdjustmentControl(id) {
|
|
|
7402
7465
|
}
|
|
7403
7466
|
function findLayerControl(kind, id) {
|
|
7404
7467
|
if (id === "opacity") return ADJUSTMENT_LAYER_OPACITY_CONTROL;
|
|
7405
|
-
return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access',
|
|
7468
|
+
return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _310 => _310[kind], 'optionalAccess', _311 => _311.find, 'call', _312 => _312((c) => c.id === id)]);
|
|
7406
7469
|
}
|
|
7407
7470
|
function clampControlValue(spec, v) {
|
|
7408
7471
|
if (typeof v !== "number" || !Number.isFinite(v)) return spec.default;
|
|
@@ -7655,17 +7718,17 @@ function describeSelection(mask) {
|
|
|
7655
7718
|
// src/image-editor/selection-tools.ts
|
|
7656
7719
|
var modeSchema = {
|
|
7657
7720
|
type: "string",
|
|
7658
|
-
enum: [...
|
|
7721
|
+
enum: [..._chunkYGIMK4NXcjs.SELECTION_MODES],
|
|
7659
7722
|
description: "How the result combines with the current selection (default replace)."
|
|
7660
7723
|
};
|
|
7661
7724
|
var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
|
|
7662
7725
|
function summary(controller) {
|
|
7663
7726
|
const sel = controller.getSelection();
|
|
7664
7727
|
const { width, height } = controller.getState().imageDimensions;
|
|
7665
|
-
const area =
|
|
7728
|
+
const area = _chunkYGIMK4NXcjs.selectionArea.call(void 0, sel);
|
|
7666
7729
|
return {
|
|
7667
7730
|
empty: !sel,
|
|
7668
|
-
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess',
|
|
7731
|
+
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _313 => _313.bounds]), () => ( null)),
|
|
7669
7732
|
/** Σ coverage in pixels. */
|
|
7670
7733
|
area: Math.round(area),
|
|
7671
7734
|
percent: Math.round(area / Math.max(1, width * height) * 1e4) / 100,
|
|
@@ -7708,7 +7771,7 @@ function createImageSelectionTools(controller) {
|
|
|
7708
7771
|
},
|
|
7709
7772
|
annotations: writeAnnotations("Select a region", true),
|
|
7710
7773
|
handler: ({ shape, x, y, width, height, mode, feather }) => {
|
|
7711
|
-
const opts = { mode:
|
|
7774
|
+
const opts = { mode: _chunkYGIMK4NXcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
|
|
7712
7775
|
switch (shape) {
|
|
7713
7776
|
case "all":
|
|
7714
7777
|
controller.selectAll();
|
|
@@ -7761,7 +7824,7 @@ function createImageSelectionTools(controller) {
|
|
|
7761
7824
|
annotations: writeAnnotations("Select by colour", true),
|
|
7762
7825
|
handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
|
|
7763
7826
|
const common = {
|
|
7764
|
-
mode:
|
|
7827
|
+
mode: _chunkYGIMK4NXcjs.parseSelectionMode.call(void 0, mode),
|
|
7765
7828
|
sampleMerged: sampleMerged === true,
|
|
7766
7829
|
sample: _nullishCoalesce(sample, () => ( "composite"))
|
|
7767
7830
|
};
|
|
@@ -7782,7 +7845,7 @@ function createImageSelectionTools(controller) {
|
|
|
7782
7845
|
inputSchema: {
|
|
7783
7846
|
type: "object",
|
|
7784
7847
|
properties: {
|
|
7785
|
-
op: { type: "string", enum: [...
|
|
7848
|
+
op: { type: "string", enum: [..._chunkYGIMK4NXcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
|
|
7786
7849
|
radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
|
|
7787
7850
|
},
|
|
7788
7851
|
required: ["op", "radius"],
|
|
@@ -7790,7 +7853,7 @@ function createImageSelectionTools(controller) {
|
|
|
7790
7853
|
},
|
|
7791
7854
|
annotations: writeAnnotations("Modify the selection"),
|
|
7792
7855
|
handler: ({ op, radius }) => {
|
|
7793
|
-
if (!
|
|
7856
|
+
if (!_chunkYGIMK4NXcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
|
|
7794
7857
|
if (!controller.getSelection()) throw new Error("Nothing is selected.");
|
|
7795
7858
|
controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
|
|
7796
7859
|
return summary(controller);
|
|
@@ -7834,7 +7897,7 @@ function createImageSelectionTools(controller) {
|
|
|
7834
7897
|
type: "object",
|
|
7835
7898
|
properties: {
|
|
7836
7899
|
layerId: { type: "string", description: "Existing adjustment layer to mask." },
|
|
7837
|
-
kind: { type: "string", enum:
|
|
7900
|
+
kind: { type: "string", enum: _chunkYGIMK4NXcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
|
|
7838
7901
|
params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
|
|
7839
7902
|
density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
|
|
7840
7903
|
feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
|
|
@@ -7854,11 +7917,11 @@ function createImageSelectionTools(controller) {
|
|
|
7854
7917
|
if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
|
|
7855
7918
|
controller.applySelectionAsLayerMask(layerId, props);
|
|
7856
7919
|
id = layerId;
|
|
7857
|
-
} else if (
|
|
7920
|
+
} else if (_chunkYGIMK4NXcjs.isAdjustmentKind.call(void 0, kind)) {
|
|
7858
7921
|
id = controller.addAdjustmentLayer({
|
|
7859
7922
|
kind,
|
|
7860
7923
|
params,
|
|
7861
|
-
mask:
|
|
7924
|
+
mask: _chunkYGIMK4NXcjs.layerMaskFromSelection.call(void 0, sel, props)
|
|
7862
7925
|
});
|
|
7863
7926
|
} else {
|
|
7864
7927
|
throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
|
|
@@ -7909,7 +7972,7 @@ async function renderImageRegion(controller, request) {
|
|
|
7909
7972
|
if (request.includeOverlays) {
|
|
7910
7973
|
const s = request.scale;
|
|
7911
7974
|
const selection = state.selection;
|
|
7912
|
-
if (_optionalChain([selection, 'optionalAccess',
|
|
7975
|
+
if (_optionalChain([selection, 'optionalAccess', _314 => _314.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
|
|
7913
7976
|
const shade = selectionShade(selection, document);
|
|
7914
7977
|
if (shade) context.drawImage(shade, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
|
|
7915
7978
|
}
|
|
@@ -7934,7 +7997,7 @@ function createImageCaptureSurface(controller) {
|
|
|
7934
7997
|
return {
|
|
7935
7998
|
units: "image pixels",
|
|
7936
7999
|
content: whole,
|
|
7937
|
-
selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access',
|
|
8000
|
+
selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _315 => _315.getState, 'call', _316 => _316(), 'access', _317 => _317.selection, 'optionalAccess', _318 => _318.bounds]), () => ( null)) }),
|
|
7938
8001
|
overlays: "a shade over unselected pixels and the crop box outline",
|
|
7939
8002
|
maxScale: 8,
|
|
7940
8003
|
render: (request) => renderImageRegion(controller, request)
|
|
@@ -7995,11 +8058,11 @@ function createImageEditTools(controller) {
|
|
|
7995
8058
|
const geometry2 = () => {
|
|
7996
8059
|
const s = controller.getState();
|
|
7997
8060
|
const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
|
|
7998
|
-
const out =
|
|
8061
|
+
const out = _chunkYGIMK4NXcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
|
|
7999
8062
|
return {
|
|
8000
8063
|
image: { ...s.imageDimensions },
|
|
8001
8064
|
crop: s.crop ? { ...s.crop } : null,
|
|
8002
|
-
rotation:
|
|
8065
|
+
rotation: _chunkYGIMK4NXcjs.normalizeAngle.call(void 0, s.transform.rotate),
|
|
8003
8066
|
flipH: s.transform.flipH,
|
|
8004
8067
|
flipV: s.transform.flipV,
|
|
8005
8068
|
output: { width: Math.round(out.width), height: Math.round(out.height) }
|
|
@@ -8221,7 +8284,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
8221
8284
|
const out = {
|
|
8222
8285
|
id: layer.id,
|
|
8223
8286
|
type: layer.type,
|
|
8224
|
-
name: layer.name || (layer.type === "adjustment" ?
|
|
8287
|
+
name: layer.name || (layer.type === "adjustment" ? _chunkYGIMK4NXcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
|
|
8225
8288
|
visible: layer.visible,
|
|
8226
8289
|
opacity: round3(layer.opacity),
|
|
8227
8290
|
blend: layer.blend,
|
|
@@ -8254,7 +8317,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
8254
8317
|
out.bounds = boundsOf(layer);
|
|
8255
8318
|
out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
|
|
8256
8319
|
out.shape = {
|
|
8257
|
-
components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access',
|
|
8320
|
+
components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _319 => _319.live, 'optionalAccess', _320 => _320.kind]), () => ( "path")) })),
|
|
8258
8321
|
fill: layer.fill ? layer.fill.type : null,
|
|
8259
8322
|
stroke: layer.stroke ? { width: layer.stroke.width, paint: layer.stroke.paint.type } : null
|
|
8260
8323
|
};
|
|
@@ -8276,8 +8339,8 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
8276
8339
|
out.bounds = boundsOf(layer);
|
|
8277
8340
|
out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
|
|
8278
8341
|
out.contents = { id: layer.contents.id, name: layer.contents.name, kind: layer.contents.kind, width: layer.contents.width, height: layer.contents.height };
|
|
8279
|
-
out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access',
|
|
8280
|
-
out.filterMask = maskSummary(_optionalChain([layer, 'access',
|
|
8342
|
+
out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _321 => _321.smartFilters, 'optionalAccess', _322 => _322.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
|
|
8343
|
+
out.filterMask = maskSummary(_optionalChain([layer, 'access', _323 => _323.smartFilters, 'optionalAccess', _324 => _324.mask]));
|
|
8281
8344
|
break;
|
|
8282
8345
|
}
|
|
8283
8346
|
return out;
|
|
@@ -8305,13 +8368,13 @@ function createImageLayerTools(controller) {
|
|
|
8305
8368
|
if (!loc) return null;
|
|
8306
8369
|
return {
|
|
8307
8370
|
...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
|
|
8308
|
-
parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
8371
|
+
parentId: _nullishCoalesce(_optionalChain([loc, 'access', _325 => _325.parent, 'optionalAccess', _326 => _326.id]), () => ( null)),
|
|
8309
8372
|
index: loc.index
|
|
8310
8373
|
};
|
|
8311
8374
|
};
|
|
8312
8375
|
const exists = (id, what = "layerId") => {
|
|
8313
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
8314
|
-
|
|
8376
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
|
|
8377
|
+
_chunkYGIMK4NXcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
8315
8378
|
return id;
|
|
8316
8379
|
};
|
|
8317
8380
|
const listLayers = {
|
|
@@ -8347,7 +8410,7 @@ function createImageLayerTools(controller) {
|
|
|
8347
8410
|
handler: ({ layerId, target }) => {
|
|
8348
8411
|
const id = exists(layerId);
|
|
8349
8412
|
const layer = controller.getLayer(id);
|
|
8350
|
-
if (target === "mask" && !layer.mask) throw new (0,
|
|
8413
|
+
if (target === "mask" && !layer.mask) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
8351
8414
|
controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
|
|
8352
8415
|
return { layer: describe(id), activeTarget: controller.getState().activeTarget };
|
|
8353
8416
|
}
|
|
@@ -8372,7 +8435,7 @@ function createImageLayerTools(controller) {
|
|
|
8372
8435
|
},
|
|
8373
8436
|
annotations: { title: "Add a pixel layer", ...WRITE2 },
|
|
8374
8437
|
handler: async (args) => {
|
|
8375
|
-
if (args.color !== void 0 && args.image !== void 0) throw new (0,
|
|
8438
|
+
if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give color or image, not both.");
|
|
8376
8439
|
for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
|
|
8377
8440
|
const init = {
|
|
8378
8441
|
name: args.name,
|
|
@@ -8462,7 +8525,7 @@ function createImageLayerTools(controller) {
|
|
|
8462
8525
|
const id = exists(args.layerId);
|
|
8463
8526
|
const props = {};
|
|
8464
8527
|
for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
|
|
8465
|
-
if (!Object.keys(props).length) throw new (0,
|
|
8528
|
+
if (!Object.keys(props).length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give at least one property to change.");
|
|
8466
8529
|
controller.setLayerProperties(id, props);
|
|
8467
8530
|
return { layer: describe(id) };
|
|
8468
8531
|
}
|
|
@@ -8556,8 +8619,8 @@ function createImageLayerTools(controller) {
|
|
|
8556
8619
|
annotations: { title: "Move a layer's pixels", ...WRITE2 },
|
|
8557
8620
|
handler: ({ layerId, x, y, dx, dy }) => {
|
|
8558
8621
|
const id = exists(layerId);
|
|
8559
|
-
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0,
|
|
8560
|
-
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0,
|
|
8622
|
+
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give x and y, or dx and dy.");
|
|
8623
|
+
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
|
|
8561
8624
|
return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
|
|
8562
8625
|
}
|
|
8563
8626
|
};
|
|
@@ -8629,7 +8692,7 @@ function createImageLayerTools(controller) {
|
|
|
8629
8692
|
annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
|
|
8630
8693
|
handler: ({ layerId, density, feather, enabled, linked }) => {
|
|
8631
8694
|
const id = exists(layerId);
|
|
8632
|
-
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0,
|
|
8695
|
+
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give density, feather, enabled or linked.");
|
|
8633
8696
|
const mask = controller.setLayerMaskProps(id, {
|
|
8634
8697
|
density,
|
|
8635
8698
|
feather,
|
|
@@ -8712,7 +8775,7 @@ function createImageLayerTools(controller) {
|
|
|
8712
8775
|
handler: (args) => {
|
|
8713
8776
|
const id = exists(args.layerId);
|
|
8714
8777
|
const changes = filterValues(args);
|
|
8715
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
8778
|
+
if (!Object.keys(changes).length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give at least one value to change.");
|
|
8716
8779
|
return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
|
|
8717
8780
|
}
|
|
8718
8781
|
};
|
|
@@ -8976,8 +9039,8 @@ function describeLayerEffects(effects) {
|
|
|
8976
9039
|
}
|
|
8977
9040
|
function createImageEffectTools(controller) {
|
|
8978
9041
|
const layerArg = (id) => {
|
|
8979
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
8980
|
-
|
|
9042
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
|
|
9043
|
+
_chunkYGIMK4NXcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
8981
9044
|
return id;
|
|
8982
9045
|
};
|
|
8983
9046
|
const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
|
|
@@ -8992,7 +9055,7 @@ function createImageEffectTools(controller) {
|
|
|
8992
9055
|
const add2 = {
|
|
8993
9056
|
name: "add_layer_effect",
|
|
8994
9057
|
title: "Add a layer effect",
|
|
8995
|
-
description: "Adds a live effect to a pixel, annotation or group layer with Photoshop's defaults, changed by settings: drop-shadow, inner-shadow, outer-glow, inner-glow, bevel-emboss, satin, color-overlay, gradient-overlay, pattern-overlay or stroke. Several of one kind are allowed (the first listed is on top). One undo step. Returns the new effect's id and the layer's effects.",
|
|
9058
|
+
description: "Adds a live effect to a pixel, shape, type, smart object, annotation or group layer with Photoshop's defaults, changed by settings: drop-shadow, inner-shadow, outer-glow, inner-glow, bevel-emboss, satin, color-overlay, gradient-overlay, pattern-overlay or stroke. Several of one kind are allowed (the first listed is on top). One undo step. Returns the new effect's id and the layer's effects.",
|
|
8996
9059
|
inputSchema: {
|
|
8997
9060
|
type: "object",
|
|
8998
9061
|
$defs: DEFS,
|
|
@@ -9008,7 +9071,7 @@ function createImageEffectTools(controller) {
|
|
|
9008
9071
|
annotations: { title: "Add a layer effect", ...WRITE3 },
|
|
9009
9072
|
handler: ({ layerId, kind, settings, index }) => {
|
|
9010
9073
|
const id = layerArg(layerId);
|
|
9011
|
-
if (!_chunkPOGBUYWEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0,
|
|
9074
|
+
if (!_chunkPOGBUYWEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`kind must be one of ${_chunkPOGBUYWEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
|
|
9012
9075
|
const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
|
|
9013
9076
|
return result(id, { effectId: effect.id });
|
|
9014
9077
|
}
|
|
@@ -9028,7 +9091,7 @@ function createImageEffectTools(controller) {
|
|
|
9028
9091
|
handler: ({ layerId, effectId, settings }) => {
|
|
9029
9092
|
const id = layerArg(layerId);
|
|
9030
9093
|
const changes = _nullishCoalesce(settings, () => ( {}));
|
|
9031
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
9094
|
+
if (!Object.keys(changes).length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give at least one setting to change.");
|
|
9032
9095
|
controller.updateLayerEffect(id, effectId, changes);
|
|
9033
9096
|
return result(id);
|
|
9034
9097
|
}
|
|
@@ -9080,7 +9143,7 @@ function createImageEffectTools(controller) {
|
|
|
9080
9143
|
},
|
|
9081
9144
|
annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
|
|
9082
9145
|
handler: ({ angle, altitude }) => {
|
|
9083
|
-
if (angle === void 0 && altitude === void 0) throw new (0,
|
|
9146
|
+
if (angle === void 0 && altitude === void 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give angle, altitude or both.");
|
|
9084
9147
|
const next = {};
|
|
9085
9148
|
if (angle !== void 0) next.angle = angle;
|
|
9086
9149
|
if (altitude !== void 0) next.altitude = altitude;
|
|
@@ -9187,9 +9250,9 @@ var PaintGesture = (_class7 = class {
|
|
|
9187
9250
|
const layer = this.controller.getActiveLayer();
|
|
9188
9251
|
if (!layer) throw new Error("Select a layer to move in the Layers panel.");
|
|
9189
9252
|
if (layer.type !== "pixel" && layer.type !== "shape" && layer.type !== "smart") throw new Error(`Only pixel, shape and smart object layers move; "${layer.name}" is a ${layer.type} layer.`);
|
|
9190
|
-
if (_optionalChain([layer, 'access',
|
|
9253
|
+
if (_optionalChain([layer, 'access', _327 => _327.locks, 'optionalAccess', _328 => _328.all]) || _optionalChain([layer, 'access', _329 => _329.locks, 'optionalAccess', _330 => _330.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
|
|
9191
9254
|
const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
|
|
9192
|
-
const b =
|
|
9255
|
+
const b = _chunkYGIMK4NXcjs.shapeGeometryBounds.call(void 0, layer);
|
|
9193
9256
|
return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
|
|
9194
9257
|
})();
|
|
9195
9258
|
this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
|
|
@@ -9240,7 +9303,7 @@ var PaintGesture = (_class7 = class {
|
|
|
9240
9303
|
this.move = null;
|
|
9241
9304
|
}
|
|
9242
9305
|
cancel() {
|
|
9243
|
-
_optionalChain([this, 'access',
|
|
9306
|
+
_optionalChain([this, 'access', _331 => _331.stroke, 'optionalAccess', _332 => _332.cancel, 'call', _333 => _333()]);
|
|
9244
9307
|
this.stroke = null;
|
|
9245
9308
|
this.move = null;
|
|
9246
9309
|
}
|
|
@@ -9338,7 +9401,7 @@ function createImagePaintTools(controller) {
|
|
|
9338
9401
|
annotations: { title: "Paint a brush stroke", ...WRITE4 },
|
|
9339
9402
|
handler: (args) => {
|
|
9340
9403
|
const tool = args.tool;
|
|
9341
|
-
if (args.mixer !== void 0 && tool !== "mixer") throw new (0,
|
|
9404
|
+
if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
|
|
9342
9405
|
const result = controller.paintStroke({
|
|
9343
9406
|
tool,
|
|
9344
9407
|
points: args.points,
|
|
@@ -9437,11 +9500,11 @@ var DATA = {
|
|
|
9437
9500
|
description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
|
|
9438
9501
|
};
|
|
9439
9502
|
function psdBytesFromBase64(data) {
|
|
9440
|
-
if (typeof data !== "string" || !data.trim()) throw new (0,
|
|
9503
|
+
if (typeof data !== "string" || !data.trim()) throw new (0, _chunkYGIMK4NXcjs.PsdError)("data is required: the PSD file as base64.");
|
|
9441
9504
|
const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
|
|
9442
|
-
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0,
|
|
9505
|
+
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkYGIMK4NXcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
|
|
9443
9506
|
const bytes = _chunkPOGBUYWEcjs.base64ToBytes.call(void 0, body);
|
|
9444
|
-
if (bytes.length < 26) throw new (0,
|
|
9507
|
+
if (bytes.length < 26) throw new (0, _chunkYGIMK4NXcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
|
|
9445
9508
|
return bytes;
|
|
9446
9509
|
}
|
|
9447
9510
|
function createImagePsdTools(controller) {
|
|
@@ -9452,7 +9515,7 @@ function createImagePsdTools(controller) {
|
|
|
9452
9515
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
9453
9516
|
annotations: { title: "Inspect a PSD", ...READ5 },
|
|
9454
9517
|
handler: ({ data }) => {
|
|
9455
|
-
const res =
|
|
9518
|
+
const res = _chunkYGIMK4NXcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
|
|
9456
9519
|
return {
|
|
9457
9520
|
width: res.width,
|
|
9458
9521
|
height: res.height,
|
|
@@ -9466,7 +9529,7 @@ function createImagePsdTools(controller) {
|
|
|
9466
9529
|
const open = {
|
|
9467
9530
|
name: "import_psd",
|
|
9468
9531
|
title: "Open a PSD as the document",
|
|
9469
|
-
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);
|
|
9532
|
+
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); shape layers come in as live shapes (paths, path operations, fill, stroke, live rectangles, ellipses and lines); type layers come in as live text (runs, paragraphs, frame, transform) showing Photoshop\u2019s pixels until edited, with a warning for fonts missing here; fill 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).",
|
|
9470
9533
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
9471
9534
|
annotations: { title: "Open a PSD as the document", ...DESTRUCTIVE4 },
|
|
9472
9535
|
handler: ({ data }) => {
|
|
@@ -9485,7 +9548,7 @@ function createImagePsdTools(controller) {
|
|
|
9485
9548
|
const save = {
|
|
9486
9549
|
name: "export_psd",
|
|
9487
9550
|
title: "Export the document as a PSD",
|
|
9488
|
-
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.",
|
|
9551
|
+
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). Shape layers are written as Photoshop shape layers (path, fill, stroke, live shapes) and type layers as Photoshop type layers (text, runs, paragraphs, frame; blocks opened from a PSD are written back unchanged while the layer is). 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.",
|
|
9489
9552
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
9490
9553
|
annotations: { title: "Export the document as a PSD", ...READ5 },
|
|
9491
9554
|
handler: async () => {
|
|
@@ -9539,7 +9602,7 @@ var GEOMETRY = {
|
|
|
9539
9602
|
dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
|
|
9540
9603
|
reference: {
|
|
9541
9604
|
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}.",
|
|
9542
|
-
anyOf: [{ type: "string", enum:
|
|
9605
|
+
anyOf: [{ type: "string", enum: _chunkYGIMK4NXcjs.TRANSFORM_ANCHORS }, POINT]
|
|
9543
9606
|
},
|
|
9544
9607
|
matrix: {
|
|
9545
9608
|
type: "array",
|
|
@@ -9560,14 +9623,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
|
|
|
9560
9623
|
function geometryFrom(args) {
|
|
9561
9624
|
const numeric = NUMERIC.filter((k) => args[k] !== void 0);
|
|
9562
9625
|
const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
|
|
9563
|
-
if (ways === 0) throw new (0,
|
|
9564
|
-
if (ways > 1) throw new (0,
|
|
9626
|
+
if (ways === 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
|
|
9627
|
+
if (ways > 1) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
|
|
9565
9628
|
if (args.matrix !== void 0) return { matrix: args.matrix };
|
|
9566
9629
|
if (args.corners !== void 0) return { corners: args.corners };
|
|
9567
9630
|
const params = {};
|
|
9568
9631
|
for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
|
|
9569
|
-
if (params.scaleX === 0 || params.scaleY === 0) throw new (0,
|
|
9570
|
-
if (typeof params.reference === "string" && !
|
|
9632
|
+
if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
|
|
9633
|
+
if (typeof params.reference === "string" && !_chunkYGIMK4NXcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkYGIMK4NXcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
|
|
9571
9634
|
return { params };
|
|
9572
9635
|
}
|
|
9573
9636
|
function targetFrom(args) {
|
|
@@ -9616,7 +9679,7 @@ function createImageTransformTools(controller) {
|
|
|
9616
9679
|
moved: [...s.moves],
|
|
9617
9680
|
frame: { ...s.box },
|
|
9618
9681
|
corners: s.startGeometry.corners.map(roundPoint),
|
|
9619
|
-
center: roundPoint(
|
|
9682
|
+
center: roundPoint(_chunkYGIMK4NXcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
|
|
9620
9683
|
};
|
|
9621
9684
|
if (s.smartObject) out.smartObject = true;
|
|
9622
9685
|
s.cancel();
|
|
@@ -9671,11 +9734,11 @@ function createImageTransformTools(controller) {
|
|
|
9671
9734
|
annotations: { title: "Warp a layer", ...WRITE5 },
|
|
9672
9735
|
handler: (args) => {
|
|
9673
9736
|
const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
|
|
9674
|
-
if (hasPreset && args.mesh !== void 0) throw new (0,
|
|
9675
|
-
if (!hasPreset && args.mesh === void 0) throw new (0,
|
|
9737
|
+
if (hasPreset && args.mesh !== void 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
|
|
9738
|
+
if (!hasPreset && args.mesh === void 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give a preset style or a mesh.");
|
|
9676
9739
|
let warp;
|
|
9677
9740
|
if (hasPreset) {
|
|
9678
|
-
if (args.style === void 0) throw new (0,
|
|
9741
|
+
if (args.style === void 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkW3GXSUSQcjs.WARP_STYLES.join(", ")}.`);
|
|
9679
9742
|
warp = {
|
|
9680
9743
|
style: args.style,
|
|
9681
9744
|
bend: _nullishCoalesce(args.bend, () => ( 50)),
|
|
@@ -9686,7 +9749,7 @@ function createImageTransformTools(controller) {
|
|
|
9686
9749
|
} else {
|
|
9687
9750
|
const m = args.mesh;
|
|
9688
9751
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
9689
|
-
if (m.points.length !== want) throw new (0,
|
|
9752
|
+
if (m.points.length !== want) throw new (0, _chunkYGIMK4NXcjs.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}.`);
|
|
9690
9753
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
9691
9754
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
9692
9755
|
}
|
|
@@ -9781,13 +9844,13 @@ function settingsFrom(args) {
|
|
|
9781
9844
|
return out;
|
|
9782
9845
|
}
|
|
9783
9846
|
function imageArg(image) {
|
|
9784
|
-
if (typeof image !== "string" || !image.trim()) throw new (0,
|
|
9847
|
+
if (typeof image !== "string" || !image.trim()) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
|
|
9785
9848
|
return image.trim();
|
|
9786
9849
|
}
|
|
9787
9850
|
function createImageSmartObjectTools(controller) {
|
|
9788
9851
|
const smartId = (id) => {
|
|
9789
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
9790
|
-
|
|
9852
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
|
|
9853
|
+
_chunkYGIMK4NXcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
|
|
9791
9854
|
return id;
|
|
9792
9855
|
};
|
|
9793
9856
|
const info = (id) => {
|
|
@@ -9800,7 +9863,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9800
9863
|
const layerSummary = (id) => {
|
|
9801
9864
|
const s = controller.getState();
|
|
9802
9865
|
const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, s.layers, id);
|
|
9803
|
-
return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
9866
|
+
return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _334 => _334.parent, 'optionalAccess', _335 => _335.id]), () => ( null)), index: loc.index } : null;
|
|
9804
9867
|
};
|
|
9805
9868
|
const getSmart = {
|
|
9806
9869
|
name: "get_smart_object",
|
|
@@ -9824,7 +9887,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
9824
9887
|
},
|
|
9825
9888
|
annotations: { title: "Convert to Smart Object", ...WRITE6 },
|
|
9826
9889
|
handler: ({ layerIds, name }) => {
|
|
9827
|
-
for (const id2 of _nullishCoalesce(layerIds, () => ( [])))
|
|
9890
|
+
for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkYGIMK4NXcjs.requireLayer.call(void 0, controller.getLayers(), id2);
|
|
9828
9891
|
const id = controller.convertToSmartObject(layerIds, { name });
|
|
9829
9892
|
return { layer: layerSummary(id), smartObject: info(id) };
|
|
9830
9893
|
}
|
|
@@ -9897,12 +9960,12 @@ function createImageSmartObjectTools(controller) {
|
|
|
9897
9960
|
else if (w) {
|
|
9898
9961
|
const m = w;
|
|
9899
9962
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
9900
|
-
if (m.points.length !== want) throw new (0,
|
|
9963
|
+
if (m.points.length !== want) throw new (0, _chunkYGIMK4NXcjs.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}.`);
|
|
9901
9964
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
9902
9965
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
9903
9966
|
}
|
|
9904
9967
|
const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
|
|
9905
|
-
if (!keys.some((k) => args[k] !== void 0)) throw new (0,
|
|
9968
|
+
if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
|
|
9906
9969
|
const res = controller.setSmartObjectTransform(id, {
|
|
9907
9970
|
corners: args.corners,
|
|
9908
9971
|
matrix: args.matrix,
|
|
@@ -10027,7 +10090,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
10027
10090
|
handler: (args) => {
|
|
10028
10091
|
const id = smartId(args.layerId);
|
|
10029
10092
|
const changes = settingsFrom(args);
|
|
10030
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10093
|
+
if (!Object.keys(changes).length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give at least one value to change.");
|
|
10031
10094
|
const filter = controller.updateSmartFilter(id, args.filterId, changes);
|
|
10032
10095
|
return { layerId: id, filter, smartFilters: info(id).smartFilters };
|
|
10033
10096
|
}
|
|
@@ -10348,14 +10411,14 @@ function geometry(args) {
|
|
|
10348
10411
|
}
|
|
10349
10412
|
function createImageShapeTools(controller) {
|
|
10350
10413
|
const shapeId = (id) => {
|
|
10351
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10352
|
-
|
|
10414
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
|
|
10415
|
+
_chunkYGIMK4NXcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
|
|
10353
10416
|
return id;
|
|
10354
10417
|
};
|
|
10355
10418
|
const layerSummary = (id) => {
|
|
10356
10419
|
const s = controller.getState();
|
|
10357
10420
|
const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, s.layers, id);
|
|
10358
|
-
return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
10421
|
+
return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _336 => _336.parent, 'optionalAccess', _337 => _337.id]), () => ( null)), index: loc.index } : null;
|
|
10359
10422
|
};
|
|
10360
10423
|
const get = {
|
|
10361
10424
|
name: "get_shape_layer",
|
|
@@ -10424,7 +10487,7 @@ function createImageShapeTools(controller) {
|
|
|
10424
10487
|
annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
|
|
10425
10488
|
handler: ({ layerId, fill, stroke, fillRule }) => {
|
|
10426
10489
|
const id = shapeId(layerId);
|
|
10427
|
-
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0,
|
|
10490
|
+
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
|
|
10428
10491
|
return controller.setShapeStyle(id, { fill, stroke, fillRule });
|
|
10429
10492
|
}
|
|
10430
10493
|
};
|
|
@@ -10473,7 +10536,7 @@ function createImageShapeTools(controller) {
|
|
|
10473
10536
|
handler: ({ layerId, componentIndex, ...rest }) => {
|
|
10474
10537
|
const id = shapeId(layerId);
|
|
10475
10538
|
const change = geometry(rest);
|
|
10476
|
-
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0,
|
|
10539
|
+
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("Give shape, subpaths or op to change.");
|
|
10477
10540
|
return controller.setShapeComponent(id, componentIndex, change);
|
|
10478
10541
|
}
|
|
10479
10542
|
};
|
|
@@ -10547,14 +10610,14 @@ function pick(args, keys) {
|
|
|
10547
10610
|
}
|
|
10548
10611
|
function createImageTypeTools(controller) {
|
|
10549
10612
|
const typeId = (id) => {
|
|
10550
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10551
|
-
|
|
10613
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
|
|
10614
|
+
_chunkYGIMK4NXcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
|
|
10552
10615
|
return id;
|
|
10553
10616
|
};
|
|
10554
10617
|
const layerSummary = (id) => {
|
|
10555
10618
|
const s = controller.getState();
|
|
10556
10619
|
const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, s.layers, id);
|
|
10557
|
-
return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
10620
|
+
return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _338 => _338.parent, 'optionalAccess', _339 => _339.id]), () => ( null)), index: loc.index } : null;
|
|
10558
10621
|
};
|
|
10559
10622
|
const range = (args) => ({ start: args.start, end: args.end });
|
|
10560
10623
|
const listFonts = {
|
|
@@ -10563,7 +10626,7 @@ function createImageTypeTools(controller) {
|
|
|
10563
10626
|
description: "Returns the font families type layers can use here (generic families such as sans-serif always work). Changes nothing.",
|
|
10564
10627
|
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
10565
10628
|
annotations: { title: "List fonts", ...READ9 },
|
|
10566
|
-
handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access',
|
|
10629
|
+
handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _340 => _340.getTextShaper, 'call', _341 => _341(), 'optionalAccess', _342 => _342.id]), () => ( null)) })
|
|
10567
10630
|
};
|
|
10568
10631
|
const get = {
|
|
10569
10632
|
name: "get_text_layer",
|
|
@@ -10628,7 +10691,7 @@ function createImageTypeTools(controller) {
|
|
|
10628
10691
|
annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
|
|
10629
10692
|
handler: (args) => {
|
|
10630
10693
|
const style = pick(args, Object.keys(STYLE));
|
|
10631
|
-
if (!Object.keys(style).length) throw new (0,
|
|
10694
|
+
if (!Object.keys(style).length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
|
|
10632
10695
|
return controller.setTextStyle(typeId(args.layerId), style, range(args));
|
|
10633
10696
|
}
|
|
10634
10697
|
};
|
|
@@ -10640,7 +10703,7 @@ function createImageTypeTools(controller) {
|
|
|
10640
10703
|
annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
|
|
10641
10704
|
handler: (args) => {
|
|
10642
10705
|
const style = pick(args, Object.keys(PARAGRAPH));
|
|
10643
|
-
if (!Object.keys(style).length) throw new (0,
|
|
10706
|
+
if (!Object.keys(style).length) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
|
|
10644
10707
|
return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
|
|
10645
10708
|
}
|
|
10646
10709
|
};
|
|
@@ -10662,7 +10725,7 @@ function createImageTypeTools(controller) {
|
|
|
10662
10725
|
annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
|
|
10663
10726
|
handler: ({ layerId, kind, width, height }) => {
|
|
10664
10727
|
const id = typeId(layerId);
|
|
10665
|
-
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0,
|
|
10728
|
+
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkYGIMK4NXcjs.LayerOperationError)("kind box needs width and height in pixels.");
|
|
10666
10729
|
return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
|
|
10667
10730
|
}
|
|
10668
10731
|
};
|
|
@@ -10684,7 +10747,7 @@ function createImageTypeTools(controller) {
|
|
|
10684
10747
|
var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
|
|
10685
10748
|
function adjustmentsSummary(adjustments) {
|
|
10686
10749
|
return {
|
|
10687
|
-
process:
|
|
10750
|
+
process: _chunkYGIMK4NXcjs.normalizeProcessVersion.call(void 0, adjustments.process),
|
|
10688
10751
|
values: readAdjustmentControls(adjustments),
|
|
10689
10752
|
layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
|
|
10690
10753
|
};
|
|
@@ -10727,7 +10790,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
10727
10790
|
default: def,
|
|
10728
10791
|
...requiresProcess ? { requiresProcess } : {}
|
|
10729
10792
|
})),
|
|
10730
|
-
layerKinds:
|
|
10793
|
+
layerKinds: _chunkYGIMK4NXcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
|
|
10731
10794
|
kind,
|
|
10732
10795
|
label,
|
|
10733
10796
|
controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
|
|
@@ -10813,7 +10876,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
10813
10876
|
const result = { applied, clamped };
|
|
10814
10877
|
if (typeof label === "string" && label) result.label = label;
|
|
10815
10878
|
const notes = [];
|
|
10816
|
-
if ("tint" in applied &&
|
|
10879
|
+
if ("tint" in applied && _chunkYGIMK4NXcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
|
|
10817
10880
|
notes.push("Tint has no effect on process 1 edits.");
|
|
10818
10881
|
}
|
|
10819
10882
|
if (notes.length) result.notes = notes;
|
|
@@ -10823,11 +10886,11 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
10823
10886
|
const addLayer = {
|
|
10824
10887
|
name: "add_adjustment_layer",
|
|
10825
10888
|
title: "Add an adjustment layer",
|
|
10826
|
-
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " +
|
|
10889
|
+
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkYGIMK4NXcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
|
|
10827
10890
|
inputSchema: {
|
|
10828
10891
|
type: "object",
|
|
10829
10892
|
properties: {
|
|
10830
|
-
kind: { type: "string", enum:
|
|
10893
|
+
kind: { type: "string", enum: _chunkYGIMK4NXcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
|
|
10831
10894
|
params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
|
|
10832
10895
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
|
|
10833
10896
|
blend: { type: "string", enum: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
|
|
@@ -10846,13 +10909,13 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
10846
10909
|
openWorldHint: false
|
|
10847
10910
|
},
|
|
10848
10911
|
handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
|
|
10849
|
-
if (!
|
|
10912
|
+
if (!_chunkYGIMK4NXcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
|
|
10850
10913
|
if (blend !== void 0 && !_chunkXIOMMGPDcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
10851
10914
|
if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
|
|
10852
10915
|
for (const ref of [aboveId, parentId]) {
|
|
10853
10916
|
if (ref !== void 0 && !controller.getLayer(ref)) throw new Error(`Unknown layer "${ref}". Call list_layers for ids.`);
|
|
10854
10917
|
}
|
|
10855
|
-
if (parentId !== void 0 && _optionalChain([controller, 'access',
|
|
10918
|
+
if (parentId !== void 0 && _optionalChain([controller, 'access', _343 => _343.getLayer, 'call', _344 => _344(parentId), 'optionalAccess', _345 => _345.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
|
|
10856
10919
|
const id = controller.addAdjustmentLayer({ kind, params, opacity, blend, name, aboveId, parentId });
|
|
10857
10920
|
const layer = controller.getAdjustmentLayer(id);
|
|
10858
10921
|
return { layer: JSON.parse(JSON.stringify(layer)), index: controller.getAdjustmentLayers().findIndex((l) => l.id === id) };
|
|
@@ -10938,7 +11001,7 @@ function boxToCurvePoint(x, y, width, height) {
|
|
|
10938
11001
|
return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
|
|
10939
11002
|
}
|
|
10940
11003
|
function curveSvgPath(points, width, height, samples = 64) {
|
|
10941
|
-
const lut =
|
|
11004
|
+
const lut = _chunkYGIMK4NXcjs.curveLutFromLevels.call(void 0, points);
|
|
10942
11005
|
const n = lut.length - 1;
|
|
10943
11006
|
let d = "";
|
|
10944
11007
|
for (let i = 0; i <= samples; i++) {
|
|
@@ -11223,6 +11286,470 @@ function applyRegionBlur(imageData, regions, radius = 10) {
|
|
|
11223
11286
|
return imageData;
|
|
11224
11287
|
}
|
|
11225
11288
|
|
|
11289
|
+
// src/image-editor/layers/shape-type-ui.ts
|
|
11290
|
+
var DEFAULT_SHAPE_TOOL_OPTIONS = {
|
|
11291
|
+
kind: "rect",
|
|
11292
|
+
fill: "#4f46e5",
|
|
11293
|
+
stroke: null,
|
|
11294
|
+
strokeWidth: 2,
|
|
11295
|
+
radius: 0,
|
|
11296
|
+
sides: 6,
|
|
11297
|
+
points: 5,
|
|
11298
|
+
innerRatio: 0.5,
|
|
11299
|
+
weight: 4,
|
|
11300
|
+
arrow: false
|
|
11301
|
+
};
|
|
11302
|
+
var SHAPE_KIND_LABELS = { rect: "Rectangle", ellipse: "Ellipse", polygon: "Polygon", star: "Star", line: "Line" };
|
|
11303
|
+
var DEFAULT_TYPE_TOOL_OPTIONS = { fontFamily: "sans-serif", fontSize: 32, fontWeight: 400, italic: false, color: "#111827", align: "left" };
|
|
11304
|
+
function liveShapeForDrag(o, a, b, mods = {}) {
|
|
11305
|
+
if (o.kind === "line") {
|
|
11306
|
+
let x2 = b.x;
|
|
11307
|
+
let y2 = b.y;
|
|
11308
|
+
if (mods.shift) {
|
|
11309
|
+
const ang = Math.round(Math.atan2(b.y - a.y, b.x - a.x) / (Math.PI / 4)) * (Math.PI / 4);
|
|
11310
|
+
const len = Math.hypot(b.x - a.x, b.y - a.y);
|
|
11311
|
+
x2 = a.x + Math.cos(ang) * len;
|
|
11312
|
+
y2 = a.y + Math.sin(ang) * len;
|
|
11313
|
+
}
|
|
11314
|
+
if (Math.hypot(x2 - a.x, y2 - a.y) < 1) return null;
|
|
11315
|
+
const head = o.arrow ? { endArrow: { width: o.weight * 4, length: o.weight * 4 } } : {};
|
|
11316
|
+
return { kind: "line", x1: a.x, y1: a.y, x2, y2, weight: o.weight, ...head };
|
|
11317
|
+
}
|
|
11318
|
+
let w = b.x - a.x;
|
|
11319
|
+
let h = b.y - a.y;
|
|
11320
|
+
if (mods.shift) {
|
|
11321
|
+
const s = Math.max(Math.abs(w), Math.abs(h));
|
|
11322
|
+
w = Math.sign(w || 1) * s;
|
|
11323
|
+
h = Math.sign(h || 1) * s;
|
|
11324
|
+
}
|
|
11325
|
+
let x = a.x;
|
|
11326
|
+
let y = a.y;
|
|
11327
|
+
if (mods.alt) {
|
|
11328
|
+
x = a.x - w;
|
|
11329
|
+
y = a.y - h;
|
|
11330
|
+
w *= 2;
|
|
11331
|
+
h *= 2;
|
|
11332
|
+
}
|
|
11333
|
+
const box = { x: Math.min(x, x + w), y: Math.min(y, y + h), width: Math.abs(w), height: Math.abs(h) };
|
|
11334
|
+
if (box.width < 1 || box.height < 1) return null;
|
|
11335
|
+
switch (o.kind) {
|
|
11336
|
+
case "rect":
|
|
11337
|
+
return { kind: "rect", ...box, ...o.radius > 0 ? { radius: o.radius } : {} };
|
|
11338
|
+
case "ellipse":
|
|
11339
|
+
return { kind: "ellipse", ...box };
|
|
11340
|
+
case "polygon":
|
|
11341
|
+
return { kind: "polygon", ...box, sides: o.sides };
|
|
11342
|
+
case "star":
|
|
11343
|
+
return { kind: "star", ...box, points: o.points, innerRatio: o.innerRatio };
|
|
11344
|
+
}
|
|
11345
|
+
return null;
|
|
11346
|
+
}
|
|
11347
|
+
var ShapeDrawGesture = (_class9 = class {
|
|
11348
|
+
constructor(controller, options) {;_class9.prototype.__init70.call(this);_class9.prototype.__init71.call(this);_class9.prototype.__init72.call(this);
|
|
11349
|
+
this.controller = controller;
|
|
11350
|
+
this.options = options;
|
|
11351
|
+
}
|
|
11352
|
+
|
|
11353
|
+
|
|
11354
|
+
__init70() {this.start = null}
|
|
11355
|
+
__init71() {this.layerId = null}
|
|
11356
|
+
__init72() {this.error = null}
|
|
11357
|
+
get active() {
|
|
11358
|
+
return this.start !== null;
|
|
11359
|
+
}
|
|
11360
|
+
/** The shape layer drawn by the last drag (until the next one starts). */
|
|
11361
|
+
get drawnLayerId() {
|
|
11362
|
+
return this.layerId;
|
|
11363
|
+
}
|
|
11364
|
+
down(p) {
|
|
11365
|
+
this.error = null;
|
|
11366
|
+
this.start = { x: p.x, y: p.y };
|
|
11367
|
+
this.layerId = null;
|
|
11368
|
+
}
|
|
11369
|
+
move(p, mods = {}) {
|
|
11370
|
+
if (!this.start) return;
|
|
11371
|
+
const o = this.options();
|
|
11372
|
+
const shape = liveShapeForDrag(o, this.start, p, mods);
|
|
11373
|
+
if (!shape) return;
|
|
11374
|
+
try {
|
|
11375
|
+
if (!this.layerId) {
|
|
11376
|
+
const isLine = o.kind === "line";
|
|
11377
|
+
this.layerId = this.controller.addShapeLayer({
|
|
11378
|
+
shape,
|
|
11379
|
+
fill: isLine ? _nullishCoalesce(_nullishCoalesce(o.stroke, () => ( o.fill)), () => ( "#000000")) : o.fill,
|
|
11380
|
+
stroke: !isLine && o.stroke ? { width: o.strokeWidth, paint: o.stroke } : null
|
|
11381
|
+
});
|
|
11382
|
+
} else this.controller.setShapeComponent(this.layerId, 0, { shape }, false);
|
|
11383
|
+
} catch (e) {
|
|
11384
|
+
this.error = e instanceof Error ? e.message : String(e);
|
|
11385
|
+
this.start = null;
|
|
11386
|
+
}
|
|
11387
|
+
}
|
|
11388
|
+
up() {
|
|
11389
|
+
this.start = null;
|
|
11390
|
+
return this.layerId;
|
|
11391
|
+
}
|
|
11392
|
+
cancel() {
|
|
11393
|
+
this.start = null;
|
|
11394
|
+
}
|
|
11395
|
+
}, _class9);
|
|
11396
|
+
function applyShapeOptions(controller, layerId, change) {
|
|
11397
|
+
const info = controller.getShapeLayer(layerId);
|
|
11398
|
+
const style = {};
|
|
11399
|
+
if ("fill" in change) style.fill = _nullishCoalesce(change.fill, () => ( null));
|
|
11400
|
+
if ("stroke" in change || "strokeWidth" in change) {
|
|
11401
|
+
const color = "stroke" in change ? change.stroke : _optionalChain([info, 'access', _346 => _346.stroke, 'optionalAccess', _347 => _347.paint, 'access', _348 => _348.type]) === "color" ? info.stroke.paint.color : null;
|
|
11402
|
+
style.stroke = color ? { width: _nullishCoalesce(_nullishCoalesce(change.strokeWidth, () => ( _optionalChain([info, 'access', _349 => _349.stroke, 'optionalAccess', _350 => _350.width]))), () => ( 2)), paint: color } : null;
|
|
11403
|
+
}
|
|
11404
|
+
if (Object.keys(style).length) controller.setShapeStyle(layerId, style);
|
|
11405
|
+
const live = _optionalChain([info, 'access', _351 => _351.components, 'access', _352 => _352[0], 'optionalAccess', _353 => _353.live]);
|
|
11406
|
+
if (!live) return;
|
|
11407
|
+
const shape = {};
|
|
11408
|
+
if (live.kind === "rect" && change.radius !== void 0) shape.radius = change.radius;
|
|
11409
|
+
if (live.kind === "polygon" && change.sides !== void 0) shape.sides = change.sides;
|
|
11410
|
+
if (live.kind === "star" && change.points !== void 0) shape.points = change.points;
|
|
11411
|
+
if (live.kind === "star" && change.innerRatio !== void 0) shape.innerRatio = change.innerRatio;
|
|
11412
|
+
if (live.kind === "line" && change.weight !== void 0) shape.weight = change.weight;
|
|
11413
|
+
if (live.kind === "line" && change.arrow !== void 0) shape.endArrow = change.arrow ? { width: (live.weight || 1) * 4, length: (live.weight || 1) * 4 } : null;
|
|
11414
|
+
if (Object.keys(shape).length) controller.setShapeComponent(layerId, 0, { shape });
|
|
11415
|
+
}
|
|
11416
|
+
var TextEditSession = (_class10 = class {
|
|
11417
|
+
constructor(controller, layerId, index) {;_class10.prototype.__init73.call(this);_class10.prototype.__init74.call(this);_class10.prototype.__init75.call(this);
|
|
11418
|
+
this.controller = controller;
|
|
11419
|
+
this.layerId = layerId;
|
|
11420
|
+
const n = this.text.length;
|
|
11421
|
+
this.anchor = this.focus = Math.max(0, Math.min(n, _nullishCoalesce(index, () => ( n))));
|
|
11422
|
+
}
|
|
11423
|
+
|
|
11424
|
+
|
|
11425
|
+
|
|
11426
|
+
|
|
11427
|
+
__init73() {this.changed = false}
|
|
11428
|
+
__init74() {this.listeners = /* @__PURE__ */ new Set()}
|
|
11429
|
+
__init75() {this.error = null}
|
|
11430
|
+
get layer() {
|
|
11431
|
+
const l = _optionalChain([_chunkPOGBUYWEcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _354 => _354.layer]);
|
|
11432
|
+
if (!l || l.type !== "type") throw new Error("The type layer being edited is gone.");
|
|
11433
|
+
return l;
|
|
11434
|
+
}
|
|
11435
|
+
get text() {
|
|
11436
|
+
return this.layer.text;
|
|
11437
|
+
}
|
|
11438
|
+
get start() {
|
|
11439
|
+
return Math.min(this.anchor, this.focus);
|
|
11440
|
+
}
|
|
11441
|
+
get end() {
|
|
11442
|
+
return Math.max(this.anchor, this.focus);
|
|
11443
|
+
}
|
|
11444
|
+
/** Whether the layer still exists (it can be deleted or undone away while editing). */
|
|
11445
|
+
get alive() {
|
|
11446
|
+
return _optionalChain([_chunkPOGBUYWEcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _355 => _355.layer, 'access', _356 => _356.type]) === "type";
|
|
11447
|
+
}
|
|
11448
|
+
subscribe(fn) {
|
|
11449
|
+
this.listeners.add(fn);
|
|
11450
|
+
return () => this.listeners.delete(fn);
|
|
11451
|
+
}
|
|
11452
|
+
emit() {
|
|
11453
|
+
for (const l of this.listeners) l();
|
|
11454
|
+
}
|
|
11455
|
+
layout() {
|
|
11456
|
+
return this.controller.getTextLayout(this.layerId);
|
|
11457
|
+
}
|
|
11458
|
+
run(fn) {
|
|
11459
|
+
this.error = null;
|
|
11460
|
+
try {
|
|
11461
|
+
const out = fn(!this.changed);
|
|
11462
|
+
this.changed = true;
|
|
11463
|
+
return out;
|
|
11464
|
+
} catch (e) {
|
|
11465
|
+
this.error = e instanceof Error ? e.message : String(e);
|
|
11466
|
+
return void 0;
|
|
11467
|
+
} finally {
|
|
11468
|
+
this.emit();
|
|
11469
|
+
}
|
|
11470
|
+
}
|
|
11471
|
+
/** Replaces the selection with `text` (typing and pasting). */
|
|
11472
|
+
insert(text) {
|
|
11473
|
+
if (!text) return;
|
|
11474
|
+
const s = this.start;
|
|
11475
|
+
const e = this.end;
|
|
11476
|
+
const done = this.run((commit) => this.controller.setText(this.layerId, text, { start: s, end: e }, commit));
|
|
11477
|
+
if (done) this.anchor = this.focus = s + text.replace(/\r\n?/g, "\n").length;
|
|
11478
|
+
}
|
|
11479
|
+
/** Backspace: the selection, else the character before the caret. */
|
|
11480
|
+
deleteBackward() {
|
|
11481
|
+
if (this.start === this.end && this.start === 0) return;
|
|
11482
|
+
const s = this.start === this.end ? Math.max(0, this.start - this.surrogate(this.start - 1, -1)) : this.start;
|
|
11483
|
+
const e = this.end;
|
|
11484
|
+
if (this.run((commit) => this.controller.setText(this.layerId, "", { start: s, end: e }, commit))) this.anchor = this.focus = s;
|
|
11485
|
+
}
|
|
11486
|
+
/** Delete: the selection, else the character after the caret. */
|
|
11487
|
+
deleteForward() {
|
|
11488
|
+
const n = this.text.length;
|
|
11489
|
+
if (this.start === this.end && this.end >= n) return;
|
|
11490
|
+
const s = this.start;
|
|
11491
|
+
const e = this.start === this.end ? Math.min(n, this.end + this.surrogate(this.end, 1)) : this.end;
|
|
11492
|
+
if (this.run((commit) => this.controller.setText(this.layerId, "", { start: s, end: e }, commit))) this.anchor = this.focus = s;
|
|
11493
|
+
}
|
|
11494
|
+
/** 2 when the code unit at `i` is half of a surrogate pair (moving `dir`), else 1. */
|
|
11495
|
+
surrogate(i, dir) {
|
|
11496
|
+
const t = this.text;
|
|
11497
|
+
const c = t.charCodeAt(i);
|
|
11498
|
+
if (dir < 0 && c >= 56320 && c <= 57343 && i > 0) return 2;
|
|
11499
|
+
if (dir > 0 && c >= 55296 && c <= 56319 && i + 1 < t.length) return 2;
|
|
11500
|
+
return 1;
|
|
11501
|
+
}
|
|
11502
|
+
/** Moves the caret (Shift extends the selection). */
|
|
11503
|
+
move(to, extend = false) {
|
|
11504
|
+
const n = this.text.length;
|
|
11505
|
+
let f = this.focus;
|
|
11506
|
+
const collapsedJump = !extend && this.start !== this.end;
|
|
11507
|
+
if (to === "left") f = collapsedJump ? this.start : Math.max(0, f - this.surrogate(f - 1, -1));
|
|
11508
|
+
else if (to === "right") f = collapsedJump ? this.end : Math.min(n, f + this.surrogate(f, 1));
|
|
11509
|
+
else if (to === "start") f = 0;
|
|
11510
|
+
else if (to === "finish") f = n;
|
|
11511
|
+
else {
|
|
11512
|
+
const layout = this.layout();
|
|
11513
|
+
if (layout && layout.lines.length) {
|
|
11514
|
+
const c = _chunkYGIMK4NXcjs.caretAt.call(void 0, layout, f);
|
|
11515
|
+
const line = layout.lines[c.line];
|
|
11516
|
+
if (to === "home") f = line.start;
|
|
11517
|
+
else if (to === "end") {
|
|
11518
|
+
const last = line.chars[line.chars.length - 1];
|
|
11519
|
+
f = last ? Math.min(n, last.index + 1) : line.start;
|
|
11520
|
+
if (last && this.text[last.index] === " " && c.line < layout.lines.length - 1) f = last.index;
|
|
11521
|
+
} else {
|
|
11522
|
+
const target = layout.lines[c.line + (to === "up" ? -1 : 1)];
|
|
11523
|
+
if (!target) f = to === "up" ? 0 : n;
|
|
11524
|
+
else {
|
|
11525
|
+
const hit = target.chars.find((ch) => c.x < ch.x + ch.advance / 2);
|
|
11526
|
+
const last = target.chars[target.chars.length - 1];
|
|
11527
|
+
f = hit ? hit.index : last ? last.index + 1 : target.start;
|
|
11528
|
+
}
|
|
11529
|
+
}
|
|
11530
|
+
}
|
|
11531
|
+
}
|
|
11532
|
+
this.focus = f;
|
|
11533
|
+
if (!extend) this.anchor = f;
|
|
11534
|
+
this.emit();
|
|
11535
|
+
}
|
|
11536
|
+
selectAll() {
|
|
11537
|
+
this.anchor = 0;
|
|
11538
|
+
this.focus = this.text.length;
|
|
11539
|
+
this.emit();
|
|
11540
|
+
}
|
|
11541
|
+
/** Places the caret at a document point (Shift-click extends). */
|
|
11542
|
+
pointAt(p, extend = false) {
|
|
11543
|
+
this.focus = this.controller.textIndexAt(this.layerId, p);
|
|
11544
|
+
if (!extend) this.anchor = this.focus;
|
|
11545
|
+
this.emit();
|
|
11546
|
+
}
|
|
11547
|
+
/** Handles a key; returns `true` when it was the session's (the caller then prevents the default). */
|
|
11548
|
+
handleKey(e) {
|
|
11549
|
+
const mod2 = e.metaKey || e.ctrlKey;
|
|
11550
|
+
if (mod2 && e.key.toLowerCase() === "a") {
|
|
11551
|
+
this.selectAll();
|
|
11552
|
+
return true;
|
|
11553
|
+
}
|
|
11554
|
+
switch (e.key) {
|
|
11555
|
+
case "Backspace":
|
|
11556
|
+
this.deleteBackward();
|
|
11557
|
+
return true;
|
|
11558
|
+
case "Delete":
|
|
11559
|
+
this.deleteForward();
|
|
11560
|
+
return true;
|
|
11561
|
+
case "Enter":
|
|
11562
|
+
this.insert("\n");
|
|
11563
|
+
return true;
|
|
11564
|
+
case "ArrowLeft":
|
|
11565
|
+
this.move(mod2 ? "home" : "left", e.shiftKey);
|
|
11566
|
+
return true;
|
|
11567
|
+
case "ArrowRight":
|
|
11568
|
+
this.move(mod2 ? "end" : "right", e.shiftKey);
|
|
11569
|
+
return true;
|
|
11570
|
+
case "ArrowUp":
|
|
11571
|
+
this.move(mod2 ? "start" : "up", e.shiftKey);
|
|
11572
|
+
return true;
|
|
11573
|
+
case "ArrowDown":
|
|
11574
|
+
this.move(mod2 ? "finish" : "down", e.shiftKey);
|
|
11575
|
+
return true;
|
|
11576
|
+
case "Home":
|
|
11577
|
+
this.move("home", e.shiftKey);
|
|
11578
|
+
return true;
|
|
11579
|
+
case "End":
|
|
11580
|
+
this.move("end", e.shiftKey);
|
|
11581
|
+
return true;
|
|
11582
|
+
case "Tab":
|
|
11583
|
+
this.insert(" ");
|
|
11584
|
+
return true;
|
|
11585
|
+
}
|
|
11586
|
+
if (!mod2 && !e.altKey && e.key.length >= 1 && [...e.key].length === 1) {
|
|
11587
|
+
this.insert(e.key);
|
|
11588
|
+
return true;
|
|
11589
|
+
}
|
|
11590
|
+
return false;
|
|
11591
|
+
}
|
|
11592
|
+
/** Sets character style fields on the selection, or on the whole text when nothing is selected. */
|
|
11593
|
+
setStyle(style) {
|
|
11594
|
+
const s = this.start;
|
|
11595
|
+
const e = this.end;
|
|
11596
|
+
const range = s === e ? {} : { start: s, end: e };
|
|
11597
|
+
this.run((commit) => this.controller.setTextStyle(this.layerId, style, range, commit));
|
|
11598
|
+
}
|
|
11599
|
+
/** Sets paragraph fields on the paragraphs the selection touches. */
|
|
11600
|
+
setParagraph(style) {
|
|
11601
|
+
const s = this.start;
|
|
11602
|
+
const e = this.end;
|
|
11603
|
+
this.run((commit) => this.controller.setParagraphStyle(this.layerId, style, { start: s, end: e }, commit));
|
|
11604
|
+
}
|
|
11605
|
+
/** The style at the caret (or the selection's start), for the options bar. */
|
|
11606
|
+
styleHere() {
|
|
11607
|
+
const layer = this.layer;
|
|
11608
|
+
const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
|
|
11609
|
+
return _chunkYGIMK4NXcjs.styleAt.call(void 0, layer.runs, at, _chunkYGIMK4NXcjs.DEFAULT_TEXT_STYLE);
|
|
11610
|
+
}
|
|
11611
|
+
info() {
|
|
11612
|
+
return this.controller.getTextLayer(this.layerId);
|
|
11613
|
+
}
|
|
11614
|
+
/** The caret, the selection and the frame in natural pixels, for `RenderOptions.textEdit`. */
|
|
11615
|
+
overlay() {
|
|
11616
|
+
const layer = this.layer;
|
|
11617
|
+
const layout = this.layout();
|
|
11618
|
+
const m = _chunkYGIMK4NXcjs.textMatrix.call(void 0, layer);
|
|
11619
|
+
const at = (x, y) => _chunkW3GXSUSQcjs.applyMatrix.call(void 0, m, { x, y });
|
|
11620
|
+
let frame = null;
|
|
11621
|
+
if (layer.frame.kind === "box") frame = [at(0, 0), at(layer.frame.width, 0), at(layer.frame.width, layer.frame.height), at(0, layer.frame.height)];
|
|
11622
|
+
else if (layout) {
|
|
11623
|
+
const b = layout.bounds;
|
|
11624
|
+
frame = [at(b.x, b.y), at(b.x + b.width, b.y), at(b.x + b.width, b.y + b.height), at(b.x, b.y + b.height)];
|
|
11625
|
+
}
|
|
11626
|
+
if (!layout) return { caret: null, selection: [], frame };
|
|
11627
|
+
const selection = [];
|
|
11628
|
+
if (this.start !== this.end) {
|
|
11629
|
+
for (const l of layout.lines) {
|
|
11630
|
+
const chars = l.chars.filter((c2) => c2.index >= this.start && c2.index < this.end);
|
|
11631
|
+
if (!chars.length) continue;
|
|
11632
|
+
const x0 = chars[0].x;
|
|
11633
|
+
const x1 = chars[chars.length - 1].x + chars[chars.length - 1].advance;
|
|
11634
|
+
const top = l.baseline - l.ascent;
|
|
11635
|
+
const bottom = l.baseline + l.descent;
|
|
11636
|
+
selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
|
|
11637
|
+
}
|
|
11638
|
+
}
|
|
11639
|
+
const c = _chunkYGIMK4NXcjs.caretAt.call(void 0, layout, this.focus);
|
|
11640
|
+
return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
|
|
11641
|
+
}
|
|
11642
|
+
/** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
|
|
11643
|
+
close() {
|
|
11644
|
+
if (!this.alive) return false;
|
|
11645
|
+
if (!this.text.trim().length) {
|
|
11646
|
+
try {
|
|
11647
|
+
this.controller.removeLayer(this.layerId);
|
|
11648
|
+
} catch (e24) {
|
|
11649
|
+
}
|
|
11650
|
+
return false;
|
|
11651
|
+
}
|
|
11652
|
+
if (this.layer.name === "Text" && this.changed) {
|
|
11653
|
+
try {
|
|
11654
|
+
this.controller.setLayerProperties(this.layerId, { name: _chunkYGIMK4NXcjs.typeLayerName.call(void 0, this.text) }, false);
|
|
11655
|
+
} catch (e25) {
|
|
11656
|
+
}
|
|
11657
|
+
}
|
|
11658
|
+
return true;
|
|
11659
|
+
}
|
|
11660
|
+
}, _class10);
|
|
11661
|
+
function typeLayerAt(controller, p, slop = 4) {
|
|
11662
|
+
const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
|
|
11663
|
+
for (const l of layers) {
|
|
11664
|
+
if (!l.visible) continue;
|
|
11665
|
+
const inv = invert(_chunkYGIMK4NXcjs.textMatrix.call(void 0, l));
|
|
11666
|
+
const q = _chunkW3GXSUSQcjs.applyMatrix.call(void 0, inv, p);
|
|
11667
|
+
let b = null;
|
|
11668
|
+
if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
|
|
11669
|
+
else {
|
|
11670
|
+
const layout = controller.getTextLayout(l.id);
|
|
11671
|
+
if (layout) b = layout.bounds;
|
|
11672
|
+
}
|
|
11673
|
+
if (b && q.x >= b.x - slop && q.x <= b.x + b.width + slop && q.y >= b.y - slop && q.y <= b.y + b.height + slop) return l.id;
|
|
11674
|
+
}
|
|
11675
|
+
return null;
|
|
11676
|
+
}
|
|
11677
|
+
function flattenTypeLayers(layers) {
|
|
11678
|
+
const out = [];
|
|
11679
|
+
const walk = (list) => {
|
|
11680
|
+
for (const l of list) {
|
|
11681
|
+
if (l.type === "type") out.push(l);
|
|
11682
|
+
else if (l.type === "group") walk(l.children);
|
|
11683
|
+
}
|
|
11684
|
+
};
|
|
11685
|
+
walk(layers);
|
|
11686
|
+
return out;
|
|
11687
|
+
}
|
|
11688
|
+
function invert(m) {
|
|
11689
|
+
const [a, b, c, d, e, f] = m;
|
|
11690
|
+
const det = a * d - b * c || 1;
|
|
11691
|
+
return [d / det, -b / det, -c / det, a / det, (c * f - d * e) / det, (b * e - a * f) / det];
|
|
11692
|
+
}
|
|
11693
|
+
var TypeToolGesture = (_class11 = class {
|
|
11694
|
+
constructor(controller, options) {;_class11.prototype.__init76.call(this);_class11.prototype.__init77.call(this);_class11.prototype.__init78.call(this);
|
|
11695
|
+
this.controller = controller;
|
|
11696
|
+
this.options = options;
|
|
11697
|
+
}
|
|
11698
|
+
|
|
11699
|
+
|
|
11700
|
+
__init76() {this.session = null}
|
|
11701
|
+
__init77() {this.dragStart = null}
|
|
11702
|
+
__init78() {this.error = null}
|
|
11703
|
+
down(p, mods = {}) {
|
|
11704
|
+
this.error = null;
|
|
11705
|
+
const hit = typeLayerAt(this.controller, p);
|
|
11706
|
+
if (this.session && this.session.alive && hit === this.session.layerId) {
|
|
11707
|
+
this.session.pointAt(p, mods.shift);
|
|
11708
|
+
this.dragStart = null;
|
|
11709
|
+
return;
|
|
11710
|
+
}
|
|
11711
|
+
this.finish();
|
|
11712
|
+
if (hit) {
|
|
11713
|
+
this.controller.setActiveLayer(hit);
|
|
11714
|
+
this.session = new TextEditSession(this.controller, hit, this.controller.textIndexAt(hit, p));
|
|
11715
|
+
this.dragStart = null;
|
|
11716
|
+
return;
|
|
11717
|
+
}
|
|
11718
|
+
this.dragStart = { x: p.x, y: p.y };
|
|
11719
|
+
}
|
|
11720
|
+
/** Releases a click or drag that did not land on type: adds a new text layer (point text, or a box for a drag). */
|
|
11721
|
+
up(p) {
|
|
11722
|
+
const start = this.dragStart;
|
|
11723
|
+
this.dragStart = null;
|
|
11724
|
+
if (!start) return this.session;
|
|
11725
|
+
const o = this.options();
|
|
11726
|
+
const w = Math.abs(p.x - start.x);
|
|
11727
|
+
const h = Math.abs(p.y - start.y);
|
|
11728
|
+
try {
|
|
11729
|
+
const box = w >= 8 && h >= 8 ? { width: w, height: h } : void 0;
|
|
11730
|
+
const id = this.controller.addTextLayer({
|
|
11731
|
+
text: "",
|
|
11732
|
+
x: box ? Math.min(start.x, p.x) : start.x,
|
|
11733
|
+
y: box ? Math.min(start.y, p.y) : start.y,
|
|
11734
|
+
...box ? { box } : {},
|
|
11735
|
+
style: { fontFamily: o.fontFamily, fontSize: o.fontSize, fontWeight: o.fontWeight, italic: o.italic, color: o.color },
|
|
11736
|
+
paragraph: o.align !== "left" ? { align: o.align } : {},
|
|
11737
|
+
name: "Text"
|
|
11738
|
+
});
|
|
11739
|
+
this.session = new TextEditSession(this.controller, id, 0);
|
|
11740
|
+
} catch (e) {
|
|
11741
|
+
this.error = e instanceof Error ? e.message : String(e);
|
|
11742
|
+
}
|
|
11743
|
+
return this.session;
|
|
11744
|
+
}
|
|
11745
|
+
/** Ends the open session (an empty new layer is removed). */
|
|
11746
|
+
finish() {
|
|
11747
|
+
const s = this.session;
|
|
11748
|
+
this.session = null;
|
|
11749
|
+
_optionalChain([s, 'optionalAccess', _357 => _357.close, 'call', _358 => _358()]);
|
|
11750
|
+
}
|
|
11751
|
+
}, _class11);
|
|
11752
|
+
|
|
11226
11753
|
// src/image-editor/layers/panel.ts
|
|
11227
11754
|
function layerPanelRows(layers, activeId) {
|
|
11228
11755
|
const rows = [];
|
|
@@ -11246,7 +11773,7 @@ function layerPanelRows(layers, activeId) {
|
|
|
11246
11773
|
}
|
|
11247
11774
|
function layerLabel(layer) {
|
|
11248
11775
|
if (layer.name) return layer.name;
|
|
11249
|
-
if (layer.type === "adjustment") return
|
|
11776
|
+
if (layer.type === "adjustment") return _chunkYGIMK4NXcjs.adjustmentKindLabel.call(void 0, layer.kind);
|
|
11250
11777
|
return layer.type === "group" ? "Group" : "Layer";
|
|
11251
11778
|
}
|
|
11252
11779
|
function layerBadge(layer) {
|
|
@@ -11267,6 +11794,15 @@ function layerBadge(layer) {
|
|
|
11267
11794
|
return "T";
|
|
11268
11795
|
}
|
|
11269
11796
|
}
|
|
11797
|
+
function layerHasThumbnail(layer) {
|
|
11798
|
+
return layer.type === "pixel" || layer.type === "shape" || layer.type === "type";
|
|
11799
|
+
}
|
|
11800
|
+
function layerWarning(layer) {
|
|
11801
|
+
if (layer.type === "type" && _optionalChain([layer, 'access', _359 => _359.missingFonts, 'optionalAccess', _360 => _360.length])) {
|
|
11802
|
+
return `Missing ${layer.missingFonts.length === 1 ? "font" : "fonts"}: ${layer.missingFonts.join(", ")}. ${layer.rendering === "stored" ? "Showing the saved pixels until the text is edited." : "Drawn with a fallback font."}`;
|
|
11803
|
+
}
|
|
11804
|
+
return null;
|
|
11805
|
+
}
|
|
11270
11806
|
function dropZone(fraction, isGroup) {
|
|
11271
11807
|
if (isGroup && fraction > 0.3 && fraction < 0.7) return "inside";
|
|
11272
11808
|
return fraction < 0.5 ? "above" : "below";
|
|
@@ -11285,36 +11821,36 @@ function layerMenu(controller) {
|
|
|
11285
11821
|
const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
|
|
11286
11822
|
const below = loc ? siblings[loc.index - 1] : void 0;
|
|
11287
11823
|
const hasSel = controller.hasSelection;
|
|
11288
|
-
const isPixel = _optionalChain([active, 'optionalAccess',
|
|
11824
|
+
const isPixel = _optionalChain([active, 'optionalAccess', _361 => _361.type]) === "pixel";
|
|
11289
11825
|
return [
|
|
11290
11826
|
{ action: "new-layer", label: "New Layer", enabled: true },
|
|
11291
11827
|
{ action: "new-group", label: "New Group", enabled: true },
|
|
11292
11828
|
{ action: "duplicate", label: "Duplicate Layer", enabled: Boolean(active) },
|
|
11293
11829
|
{ action: "delete", label: "Delete Layer", enabled: Boolean(active) },
|
|
11294
11830
|
{ action: "group-selected", label: "Group Layer", enabled: Boolean(active) },
|
|
11295
|
-
{ action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess',
|
|
11296
|
-
{ action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess',
|
|
11831
|
+
{ action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _362 => _362.type]) === "group" },
|
|
11832
|
+
{ action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _363 => _363.visible]) && _optionalChain([below, 'optionalAccess', _364 => _364.type]) === "pixel") },
|
|
11297
11833
|
{ action: "merge-visible", label: "Merge Visible", enabled: s.layers.some((l) => l.visible) },
|
|
11298
11834
|
{ action: "flatten", label: "Flatten Image", enabled: s.layers.length > 0 },
|
|
11299
11835
|
{ action: "via-copy", label: "Layer via Copy", enabled: isPixel && hasSel },
|
|
11300
11836
|
{ action: "via-cut", label: "Layer via Cut", enabled: isPixel && hasSel },
|
|
11301
11837
|
{ action: "add-mask", label: "Add Layer Mask", enabled: Boolean(active) },
|
|
11302
11838
|
{ action: "add-mask-selection", label: "Add Mask from Selection", enabled: Boolean(active) && hasSel },
|
|
11303
|
-
{ action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess',
|
|
11304
|
-
{ action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess',
|
|
11305
|
-
{ action: "toggle-mask", label: _optionalChain([active, 'optionalAccess',
|
|
11306
|
-
{ action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess',
|
|
11307
|
-
{ action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess',
|
|
11839
|
+
{ action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _365 => _365.mask])) },
|
|
11840
|
+
{ action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _366 => _366.mask])) },
|
|
11841
|
+
{ action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _367 => _367.mask, 'optionalAccess', _368 => _368.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _369 => _369.mask])) },
|
|
11842
|
+
{ action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _370 => _370.mask, 'optionalAccess', _371 => _371.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _372 => _372.mask]) && !active.mask.source) },
|
|
11843
|
+
{ action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _373 => _373.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _374 => _374.type]) === "smart" || _optionalChain([active, 'optionalAccess', _375 => _375.type]) === "shape" || _optionalChain([active, 'optionalAccess', _376 => _376.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _377 => _377.type]) === "pixel" && _optionalChain([active, 'access', _378 => _378.filters, 'optionalAccess', _379 => _379.length])) },
|
|
11308
11844
|
{ action: "convert-smart", label: "Convert to Smart Object", enabled: Boolean(active && active.type !== "annotation") },
|
|
11309
|
-
{ action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess',
|
|
11310
|
-
{ action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess',
|
|
11311
|
-
{ action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess',
|
|
11312
|
-
{ action: "toggle-clip", label: _optionalChain([active, 'optionalAccess',
|
|
11845
|
+
{ action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _380 => _380.type]) === "smart" },
|
|
11846
|
+
{ action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _381 => _381.type]) === "smart" },
|
|
11847
|
+
{ action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _382 => _382.type]) === "smart" && !_optionalChain([active, 'access', _383 => _383.smartFilters, 'optionalAccess', _384 => _384.mask]) },
|
|
11848
|
+
{ action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _385 => _385.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
|
|
11313
11849
|
];
|
|
11314
11850
|
}
|
|
11315
11851
|
async function runLayerMenuAction(controller, action) {
|
|
11316
11852
|
const active = controller.getActiveLayer();
|
|
11317
|
-
const id = _optionalChain([active, 'optionalAccess',
|
|
11853
|
+
const id = _optionalChain([active, 'optionalAccess', _386 => _386.id]);
|
|
11318
11854
|
try {
|
|
11319
11855
|
switch (action) {
|
|
11320
11856
|
case "new-layer":
|
|
@@ -11361,10 +11897,10 @@ async function runLayerMenuAction(controller, action) {
|
|
|
11361
11897
|
if (id) controller.removeLayerMask(id);
|
|
11362
11898
|
break;
|
|
11363
11899
|
case "toggle-mask":
|
|
11364
|
-
if (id && _optionalChain([active, 'optionalAccess',
|
|
11900
|
+
if (id && _optionalChain([active, 'optionalAccess', _387 => _387.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
|
|
11365
11901
|
break;
|
|
11366
11902
|
case "toggle-mask-link":
|
|
11367
|
-
if (id && _optionalChain([active, 'optionalAccess',
|
|
11903
|
+
if (id && _optionalChain([active, 'optionalAccess', _388 => _388.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
|
|
11368
11904
|
break;
|
|
11369
11905
|
case "rasterize":
|
|
11370
11906
|
if (id) await controller.rasterizeLayer(id);
|
|
@@ -11382,7 +11918,7 @@ async function runLayerMenuAction(controller, action) {
|
|
|
11382
11918
|
if (id) controller.setSmartFilterMask(id, "reveal-all");
|
|
11383
11919
|
break;
|
|
11384
11920
|
case "toggle-clip":
|
|
11385
|
-
if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess',
|
|
11921
|
+
if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _389 => _389.clipped]) });
|
|
11386
11922
|
break;
|
|
11387
11923
|
}
|
|
11388
11924
|
return null;
|
|
@@ -11392,7 +11928,7 @@ async function runLayerMenuAction(controller, action) {
|
|
|
11392
11928
|
}
|
|
11393
11929
|
function smartFilterRows(layer) {
|
|
11394
11930
|
if (layer.type !== "smart") return [];
|
|
11395
|
-
const list = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
11931
|
+
const list = _nullishCoalesce(_optionalChain([layer, 'access', _390 => _390.smartFilters, 'optionalAccess', _391 => _391.filters]), () => ( []));
|
|
11396
11932
|
const rows = list.map((f, index) => ({
|
|
11397
11933
|
filter: f,
|
|
11398
11934
|
index,
|
|
@@ -11418,8 +11954,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
|
|
|
11418
11954
|
};
|
|
11419
11955
|
collectSerialized(_nullishCoalesce(serialized.layers, () => ( [])));
|
|
11420
11956
|
const sLayerMap = new Map(allSerializedLayers.map((sl) => [sl.id, sl]));
|
|
11421
|
-
const imgW = _optionalChain([state, 'access',
|
|
11422
|
-
const imgH = _optionalChain([state, 'access',
|
|
11957
|
+
const imgW = _optionalChain([state, 'access', _392 => _392.imageDimensions, 'optionalAccess', _393 => _393.width]) || 1;
|
|
11958
|
+
const imgH = _optionalChain([state, 'access', _394 => _394.imageDimensions, 'optionalAccess', _395 => _395.height]) || 1;
|
|
11423
11959
|
return ctrlLayers.map((l) => {
|
|
11424
11960
|
const bounds = controller.getLayerBounds(l.id) || {
|
|
11425
11961
|
x: 0,
|
|
@@ -11428,8 +11964,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
|
|
|
11428
11964
|
height: imgH
|
|
11429
11965
|
};
|
|
11430
11966
|
const sLayer = sLayerMap.get(l.id);
|
|
11431
|
-
const assetKey = _optionalChain([sLayer, 'optionalAccess',
|
|
11432
|
-
const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess',
|
|
11967
|
+
const assetKey = _optionalChain([sLayer, 'optionalAccess', _396 => _396.asset]);
|
|
11968
|
+
const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _397 => _397.source]) === "document" ? fallbackImageUrl : "");
|
|
11433
11969
|
return {
|
|
11434
11970
|
id: l.id,
|
|
11435
11971
|
name: l.name || "Untitled Layer",
|
|
@@ -11451,18 +11987,18 @@ function layerEffectsPanel(layer) {
|
|
|
11451
11987
|
if (!layer) return { ...empty, available: false, reason: "Select a layer to add effects." };
|
|
11452
11988
|
if (layer.type === "adjustment") return { ...empty, available: false, reason: "Adjustment layers cannot have effects." };
|
|
11453
11989
|
const fx = layer.effects;
|
|
11454
|
-
const readOnly = Boolean(_optionalChain([layer, 'access',
|
|
11990
|
+
const readOnly = Boolean(_optionalChain([layer, 'access', _398 => _398.locks, 'optionalAccess', _399 => _399.all]));
|
|
11455
11991
|
return {
|
|
11456
11992
|
available: true,
|
|
11457
11993
|
readOnly,
|
|
11458
11994
|
reason: readOnly ? "The layer is locked; unlock it to change its effects." : void 0,
|
|
11459
|
-
enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
11460
|
-
scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
11461
|
-
rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
11995
|
+
enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _400 => _400.enabled]), () => ( true)),
|
|
11996
|
+
scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _401 => _401.scale]), () => ( 1)),
|
|
11997
|
+
rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _402 => _402.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkPOGBUYWEcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
|
|
11462
11998
|
};
|
|
11463
11999
|
}
|
|
11464
12000
|
function layerEffectsBadge(layer) {
|
|
11465
|
-
if (!_optionalChain([layer, 'access',
|
|
12001
|
+
if (!_optionalChain([layer, 'access', _403 => _403.effects, 'optionalAccess', _404 => _404.items, 'access', _405 => _405.length])) return null;
|
|
11466
12002
|
return _chunkPOGBUYWEcjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
|
|
11467
12003
|
}
|
|
11468
12004
|
var LAYER_EFFECT_MENU = _chunkPOGBUYWEcjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkPOGBUYWEcjs.layerEffectLabel.call(void 0, kind) }));
|
|
@@ -11507,8 +12043,8 @@ function fillControls(f, allowPattern, patterns) {
|
|
|
11507
12043
|
}
|
|
11508
12044
|
function gradientControls(prefix, g) {
|
|
11509
12045
|
return [
|
|
11510
|
-
{ key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access',
|
|
11511
|
-
{ key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access',
|
|
12046
|
+
{ key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _406 => _406.stops, 'access', _407 => _407[0], 'optionalAccess', _408 => _408.color]), () => ( "#000000")) },
|
|
12047
|
+
{ key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _409 => _409.stops, 'access', _410 => _410[g.stops.length - 1], 'optionalAccess', _411 => _411.color]), () => ( "#ffffff")) },
|
|
11512
12048
|
{ key: `${prefix}.style`, label: "Style", type: "select", value: g.style, options: opt(["linear", "Linear"], ["radial", "Radial"], ["angle", "Angle"], ["reflected", "Reflected"], ["diamond", "Diamond"]) },
|
|
11513
12049
|
{ key: `${prefix}.angle`, label: "Angle", type: "range", min: -180, max: 180, step: 1, value: g.angle, unit: "\xB0" },
|
|
11514
12050
|
{ key: `${prefix}.scale`, label: "Scale", type: "range", min: 0.1, max: 1.5, step: 0.01, value: g.scale, percent: true, unit: "%" },
|
|
@@ -11600,19 +12136,19 @@ function layerEffectControls(e, patterns = []) {
|
|
|
11600
12136
|
}
|
|
11601
12137
|
function fillOfType(current, type, patterns) {
|
|
11602
12138
|
if (type === "gradient") return { type: "gradient", gradient: _chunkPOGBUYWEcjs.defaultEffectGradient.call(void 0, ) };
|
|
11603
|
-
if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access',
|
|
12139
|
+
if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _412 => _412[0], 'optionalAccess', _413 => _413.id]), () => ( "checker")), scale: 1 };
|
|
11604
12140
|
return { type: "color", color: current.type === "color" ? current.color : "#000000" };
|
|
11605
12141
|
}
|
|
11606
12142
|
function effectControlChange(effect, key, value, patterns = []) {
|
|
11607
12143
|
const [top, ...rest] = key.split(".");
|
|
11608
12144
|
if (top === "fill" && rest[0] === "type") return { fill: fillOfType(effect.fill, String(value), patterns) };
|
|
11609
12145
|
if (top === "patternId" && !rest.length) {
|
|
11610
|
-
const name = _optionalChain([patternOptions, 'call',
|
|
12146
|
+
const name = _optionalChain([patternOptions, 'call', _414 => _414(patterns), 'access', _415 => _415.find, 'call', _416 => _416((o) => o.value === value), 'optionalAccess', _417 => _417.label]);
|
|
11611
12147
|
return name ? { patternId: value, name } : { patternId: value };
|
|
11612
12148
|
}
|
|
11613
12149
|
if (!rest.length) return { [top]: value };
|
|
11614
12150
|
if (top === "fill" && rest[0] === "patternId") {
|
|
11615
|
-
const name = _optionalChain([patternOptions, 'call',
|
|
12151
|
+
const name = _optionalChain([patternOptions, 'call', _418 => _418(patterns), 'access', _419 => _419.find, 'call', _420 => _420((o) => o.value === value), 'optionalAccess', _421 => _421.label]);
|
|
11616
12152
|
return { fill: { ...effect.fill, patternId: value, ...name ? { name } : {} } };
|
|
11617
12153
|
}
|
|
11618
12154
|
return { [top]: setPath(getPath(effect, top), rest, value) };
|
|
@@ -11739,33 +12275,33 @@ function insidePolygon(poly, p) {
|
|
|
11739
12275
|
}
|
|
11740
12276
|
return inside;
|
|
11741
12277
|
}
|
|
11742
|
-
var FreeTransformTool = (
|
|
11743
|
-
constructor(controller, options = {}) {;
|
|
12278
|
+
var FreeTransformTool = (_class12 = class {
|
|
12279
|
+
constructor(controller, options = {}) {;_class12.prototype.__init79.call(this);_class12.prototype.__init80.call(this);_class12.prototype.__init81.call(this);_class12.prototype.__init82.call(this);_class12.prototype.__init83.call(this);_class12.prototype.__init84.call(this);_class12.prototype.__init85.call(this);_class12.prototype.__init86.call(this);_class12.prototype.__init87.call(this);_class12.prototype.__init88.call(this);_class12.prototype.__init89.call(this);_class12.prototype.__init90.call(this);_class12.prototype.__init91.call(this);_class12.prototype.__init92.call(this);
|
|
11744
12280
|
this.controller = controller;
|
|
11745
12281
|
this.options = options;
|
|
11746
12282
|
}
|
|
11747
12283
|
|
|
11748
12284
|
|
|
11749
|
-
|
|
11750
|
-
|
|
12285
|
+
__init79() {this.sessionRef = null}
|
|
12286
|
+
__init80() {this.modeValue = "scale"}
|
|
11751
12287
|
/** The reference point in the untransformed frame's space (follows the transform). */
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
12288
|
+
__init81() {this.refBox = { x: 0, y: 0 }}
|
|
12289
|
+
__init82() {this.corners = null}
|
|
12290
|
+
__init83() {this.drag = null}
|
|
11755
12291
|
/** The warp mesh in the frame's own space (null: no warp). */
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11759
|
-
|
|
12292
|
+
__init84() {this.mesh = null}
|
|
12293
|
+
__init85() {this.warpSettings = { style: "custom", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", columns: 1, rows: 1 }}
|
|
12294
|
+
__init86() {this.pending = false}
|
|
12295
|
+
__init87() {this.viewScale = 1}
|
|
11760
12296
|
|
|
11761
12297
|
/** Values typed into the options bar since the last drag (V skew is not recovered from the shape). */
|
|
11762
|
-
|
|
12298
|
+
__init88() {this.typed = {}}
|
|
11763
12299
|
/** Width and height scale together when typed (the chain icon). */
|
|
11764
|
-
|
|
11765
|
-
|
|
11766
|
-
|
|
12300
|
+
__init89() {this.proportional = true}
|
|
12301
|
+
__init90() {this.error = null}
|
|
12302
|
+
__init91() {this.lastResult = null}
|
|
11767
12303
|
get active() {
|
|
11768
|
-
return Boolean(_optionalChain([this, 'access',
|
|
12304
|
+
return Boolean(_optionalChain([this, 'access', _422 => _422.sessionRef, 'optionalAccess', _423 => _423.isOpen]));
|
|
11769
12305
|
}
|
|
11770
12306
|
get session() {
|
|
11771
12307
|
return this.active ? this.sessionRef : null;
|
|
@@ -11774,9 +12310,9 @@ var FreeTransformTool = (_class9 = class {
|
|
|
11774
12310
|
return this.modeValue;
|
|
11775
12311
|
}
|
|
11776
12312
|
get interpolation() {
|
|
11777
|
-
return _nullishCoalesce(_optionalChain([this, 'access',
|
|
12313
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _424 => _424.sessionRef, 'optionalAccess', _425 => _425.interpolation]), () => ( "bicubic"));
|
|
11778
12314
|
}
|
|
11779
|
-
|
|
12315
|
+
__init92() {this.listeners = /* @__PURE__ */ new Set()}
|
|
11780
12316
|
/** Calls `listener` whenever the overlay, readout, mode or error changes. Returns the unsubscribe. */
|
|
11781
12317
|
subscribe(listener) {
|
|
11782
12318
|
this.listeners.add(listener);
|
|
@@ -11785,7 +12321,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
11785
12321
|
};
|
|
11786
12322
|
}
|
|
11787
12323
|
changed() {
|
|
11788
|
-
_optionalChain([this, 'access',
|
|
12324
|
+
_optionalChain([this, 'access', _426 => _426.options, 'access', _427 => _427.onChange, 'optionalCall', _428 => _428()]);
|
|
11789
12325
|
for (const l of this.listeners) l();
|
|
11790
12326
|
}
|
|
11791
12327
|
/** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
|
|
@@ -12120,7 +12656,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
12120
12656
|
bar() {
|
|
12121
12657
|
const s = this.session;
|
|
12122
12658
|
if (!s || !this.corners) return null;
|
|
12123
|
-
const read =
|
|
12659
|
+
const read = _chunkYGIMK4NXcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
|
|
12124
12660
|
return {
|
|
12125
12661
|
affine: read.affine,
|
|
12126
12662
|
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
@@ -12145,7 +12681,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
12145
12681
|
this.changed();
|
|
12146
12682
|
return;
|
|
12147
12683
|
}
|
|
12148
|
-
const m =
|
|
12684
|
+
const m = _chunkYGIMK4NXcjs.matrixFromParams.call(void 0, s.box, {
|
|
12149
12685
|
scaleX: next.scaleX,
|
|
12150
12686
|
scaleY: next.scaleY,
|
|
12151
12687
|
rotate: next.rotate,
|
|
@@ -12155,7 +12691,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
12155
12691
|
dx: next.x - this.refBox.x,
|
|
12156
12692
|
dy: next.y - this.refBox.y
|
|
12157
12693
|
});
|
|
12158
|
-
this.setCorners(
|
|
12694
|
+
this.setCorners(_chunkYGIMK4NXcjs.cornersFromMatrix.call(void 0, s.box, m));
|
|
12159
12695
|
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
12160
12696
|
this.changed();
|
|
12161
12697
|
}
|
|
@@ -12179,7 +12715,7 @@ var FreeTransformTool = (_class9 = class {
|
|
|
12179
12715
|
}
|
|
12180
12716
|
/** Abandons the transform and restores everything. */
|
|
12181
12717
|
cancel() {
|
|
12182
|
-
_optionalChain([this, 'access',
|
|
12718
|
+
_optionalChain([this, 'access', _429 => _429.sessionRef, 'optionalAccess', _430 => _430.cancel, 'call', _431 => _431()]);
|
|
12183
12719
|
this.sessionRef = null;
|
|
12184
12720
|
this.corners = null;
|
|
12185
12721
|
this.mesh = null;
|
|
@@ -12220,7 +12756,18 @@ var FreeTransformTool = (_class9 = class {
|
|
|
12220
12756
|
}
|
|
12221
12757
|
return false;
|
|
12222
12758
|
}
|
|
12223
|
-
},
|
|
12759
|
+
}, _class12);
|
|
12760
|
+
|
|
12761
|
+
|
|
12762
|
+
|
|
12763
|
+
|
|
12764
|
+
|
|
12765
|
+
|
|
12766
|
+
|
|
12767
|
+
|
|
12768
|
+
|
|
12769
|
+
|
|
12770
|
+
|
|
12224
12771
|
|
|
12225
12772
|
|
|
12226
12773
|
|
|
@@ -12892,5 +13439,5 @@ var FreeTransformTool = (_class9 = class {
|
|
|
12892
13439
|
|
|
12893
13440
|
|
|
12894
13441
|
|
|
12895
|
-
exports.ADJUSTMENT_KEYS = _chunkPHUMLSCWcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkPHUMLSCWcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkPHUMLSCWcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkPHUMLSCWcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkPHUMLSCWcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkPHUMLSCWcjs.BACKGROUND_LAYER_NAME; exports.BLEND_MODES = _chunkXIOMMGPDcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkPHUMLSCWcjs.BLUR_FILTER_ID; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.CoverageMap = _chunk7VOHOPLWcjs.CoverageMap; exports.D50 = _chunkPHUMLSCWcjs.D50; exports.D65 = _chunkPHUMLSCWcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkPHUMLSCWcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk7VOHOPLWcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk7VOHOPLWcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_GLOBAL_LIGHT = _chunkPOGBUYWEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkPHUMLSCWcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk7VOHOPLWcjs.DEFAULT_MIXER; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk7VOHOPLWcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkPHUMLSCWcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkPHUMLSCWcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkPOGBUYWEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DabWalker = _chunk7VOHOPLWcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkPHUMLSCWcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkPHUMLSCWcjs.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 = _chunkPHUMLSCWcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkPHUMLSCWcjs.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 = _chunkPOGBUYWEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = _chunkPHUMLSCWcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkPHUMLSCWcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkPOGBUYWEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkPHUMLSCWcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkPHUMLSCWcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkPHUMLSCWcjs.LUMA_709; exports.LayerCompositor = _chunkPHUMLSCWcjs.LayerCompositor; exports.LayerEffectError = _chunkPOGBUYWEcjs.LayerEffectError; exports.LayerOperationError = _chunkPHUMLSCWcjs.LayerOperationError; exports.MAX_BRUSH_SIZE = _chunk7VOHOPLWcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkPOGBUYWEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkPHUMLSCWcjs.MAX_KELVIN; exports.MAX_TRANSFORM_PIXELS = _chunkPOGBUYWEcjs.MAX_TRANSFORM_PIXELS; exports.MIN_KELVIN = _chunkPHUMLSCWcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkPHUMLSCWcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk7VOHOPLWcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk7VOHOPLWcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk7VOHOPLWcjs.MIXING_MODELS; exports.MixerStroke = _chunk7VOHOPLWcjs.MixerStroke; exports.PAINTERLY_BLEND_MODES = _chunkXIOMMGPDcjs.PAINTERLY_BLEND_MODES; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PARAGRAPH_STYLE_FIELDS = _chunkPHUMLSCWcjs.PARAGRAPH_STYLE_FIELDS; exports.PATTERN_BLOCK_KEYS = _chunkPHUMLSCWcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkXIOMMGPDcjs.PIGMENT_BANDS; exports.PIGMENT_LAMBDA_MIN = _chunkXIOMMGPDcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkXIOMMGPDcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_WAVELENGTHS = _chunkXIOMMGPDcjs.PIGMENT_WAVELENGTHS; exports.PSD_BLEND_KEYS = _chunkPHUMLSCWcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.PaintExchange = _chunk7VOHOPLWcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkPOGBUYWEcjs.PatternPlacement; exports.PatternTile = _chunkPOGBUYWEcjs.PatternTile; exports.PsdError = _chunkPHUMLSCWcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = _chunkPHUMLSCWcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkPHUMLSCWcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SHADOW_AMBIENT = _chunkXIOMMGPDcjs.SHADOW_AMBIENT; exports.SHAPE_OPERATIONS = _chunkPHUMLSCWcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkPHUMLSCWcjs.SHAPE_RENDER_MARGIN; exports.SMART_RENDER_MARGIN = _chunkPHUMLSCWcjs.SMART_RENDER_MARGIN; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkPHUMLSCWcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.SmudgeTip = _chunk7VOHOPLWcjs.SmudgeTip; exports.StrokeCoverage = _chunk7VOHOPLWcjs.StrokeCoverage; exports.SurfaceDraft = _chunkXIOMMGPDcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkPHUMLSCWcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkPHUMLSCWcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkPHUMLSCWcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkXIOMMGPDcjs.TILE; exports.TILE_SHIFT = _chunkXIOMMGPDcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkPHUMLSCWcjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunkPHUMLSCWcjs.TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkPHUMLSCWcjs.TRANSFORM_ANCHORS; exports.TileMedium = _chunk7VOHOPLWcjs.TileMedium; exports.TiledSurface = _chunkXIOMMGPDcjs.TiledSurface; exports.TransformTooLargeError = _chunkPOGBUYWEcjs.TransformTooLargeError; exports.VIBRANCE_GREY = _chunkPHUMLSCWcjs.VIBRANCE_GREY; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkW3GXSUSQcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkW3GXSUSQcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.XYZ_D50_TO_SRGB = _chunkPHUMLSCWcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkPOGBUYWEcjs.ZlibError; exports.activeAdjustmentLayers = _chunkPHUMLSCWcjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunkPHUMLSCWcjs.activeSmartFilters; exports.addLayerEffect = _chunkPHUMLSCWcjs.addLayerEffect; exports.addLayerFilter = _chunkPHUMLSCWcjs.addLayerFilter; exports.addSmartFilter = _chunkPHUMLSCWcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkPHUMLSCWcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkPHUMLSCWcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkPHUMLSCWcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkPHUMLSCWcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkPOGBUYWEcjs.adler32; exports.anchorPoint = _chunkPHUMLSCWcjs.anchorPoint; exports.annotationBlend = _chunkPHUMLSCWcjs.annotationBlend; exports.annotationLayerFor = _chunkPHUMLSCWcjs.annotationLayerFor; exports.annotationLayerName = _chunkPHUMLSCWcjs.annotationLayerName; exports.annotationOfLayer = _chunkPHUMLSCWcjs.annotationOfLayer; exports.annotationOfShape = _chunkPHUMLSCWcjs.annotationOfShape; exports.annotationOfType = _chunkPHUMLSCWcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkPHUMLSCWcjs.applyAdjustmentLayers; exports.applyAdjustments = _chunkPHUMLSCWcjs.applyAdjustments; exports.applyBoxBlur = _chunkPHUMLSCWcjs.applyBoxBlur; exports.applyDepthMask = _chunkPHUMLSCWcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkPHUMLSCWcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkPHUMLSCWcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkPHUMLSCWcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkPHUMLSCWcjs.applyParams; exports.applyProcess2Adjustments = _chunkPHUMLSCWcjs.applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applySmartFilters = _chunkPHUMLSCWcjs.applySmartFilters; exports.applyStrokeToTile = _chunk7VOHOPLWcjs.applyStrokeToTile; exports.backgroundLayer = _chunkPHUMLSCWcjs.backgroundLayer; exports.base64ToBytes = _chunkPOGBUYWEcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.blackWhiteGray = _chunkPHUMLSCWcjs.blackWhiteGray; exports.blendChannel = _chunkXIOMMGPDcjs.blendChannel; exports.blendImageData = _chunkXIOMMGPDcjs.blendImageData; exports.blendLum = _chunkXIOMMGPDcjs.blendLum; exports.blendPixel = _chunkXIOMMGPDcjs.blendPixel; exports.blendRadius = _chunk7VOHOPLWcjs.blendRadius; exports.blendRgb = _chunkXIOMMGPDcjs.blendRgb; exports.blendTile = _chunkPOGBUYWEcjs.blendTile; exports.blenderDab = _chunk7VOHOPLWcjs.blenderDab; exports.blurFilter = _chunkPHUMLSCWcjs.blurFilter; exports.borderCoverage = _chunkPHUMLSCWcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkPHUMLSCWcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkPHUMLSCWcjs.bradfordAdaptation; exports.buildLayerMaskPlanes = _chunkPHUMLSCWcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkPHUMLSCWcjs.buildToneLut; exports.builtinPattern = _chunkPOGBUYWEcjs.builtinPattern; exports.builtinPatternIds = _chunkPOGBUYWEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkPOGBUYWEcjs.bytesToBase64; exports.calculateCropDrag = _chunkPHUMLSCWcjs.calculateCropDrag; exports.canvasCompositeOperation = _chunkXIOMMGPDcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkPHUMLSCWcjs.canvasToImagePoint; exports.caretAt = _chunkPHUMLSCWcjs.caretAt; exports.changedTiles = _chunkPOGBUYWEcjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkPHUMLSCWcjs.clampCropToImage; exports.cleanMixer = _chunk7VOHOPLWcjs.cleanMixer; exports.collectTiles = _chunkXIOMMGPDcjs.collectTiles; exports.colorBalanceChannel = _chunkPHUMLSCWcjs.colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = _chunkPHUMLSCWcjs.combineSelections; exports.compileAdjustmentLayer = _chunkPHUMLSCWcjs.compileAdjustmentLayer; exports.componentPath = _chunkPHUMLSCWcjs.componentPath; exports.compositeSurfaceOver = _chunkPOGBUYWEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkPHUMLSCWcjs.computeSelectionBounds; exports.contentBounds = _chunkXIOMMGPDcjs.contentBounds; exports.contentsBox = _chunkPHUMLSCWcjs.contentsBox; exports.contentsSurface = _chunkPHUMLSCWcjs.contentsSurface; exports.contractCoverage = _chunkPHUMLSCWcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertToSmartObject = _chunkPHUMLSCWcjs.convertToSmartObject; exports.copySmartObject = _chunkPHUMLSCWcjs.copySmartObject; exports.cornersFromMatrix = _chunkPHUMLSCWcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk7VOHOPLWcjs.coverageTileCoord; exports.coverageToByte = _chunkPHUMLSCWcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkPHUMLSCWcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk7VOHOPLWcjs.createBlenderScratch; exports.createCanvasTextShaper = createCanvasTextShaper; 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.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createOutlineTextShaper = createOutlineTextShaper; exports.createPigment = _chunkXIOMMGPDcjs.createPigment; exports.createPigmentTools = _chunk7VOHOPLWcjs.createPigmentTools; exports.createSelectionMask = _chunkPHUMLSCWcjs.createSelectionMask; exports.createShapeLayer = _chunkPHUMLSCWcjs.createShapeLayer; exports.createTypeLayer = _chunkPHUMLSCWcjs.createTypeLayer; exports.cssFont = cssFont; exports.cssFontFamily = cssFontFamily; exports.curveLut = _chunkPOGBUYWEcjs.curveLut; exports.curveLutFromLevels = _chunkPHUMLSCWcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk7VOHOPLWcjs.dabCoverage; exports.dabRect = _chunk7VOHOPLWcjs.dabRect; exports.decodeLayerChannel = _chunkPHUMLSCWcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkPHUMLSCWcjs.decodeLayerMask; exports.decodeMergedImage = _chunkPHUMLSCWcjs.decodeMergedImage; exports.decodePlanes = _chunkPHUMLSCWcjs.decodePlanes; exports.decodePng = _chunkPOGBUYWEcjs.decodePng; exports.decodePngDataUrl = _chunkPHUMLSCWcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkPHUMLSCWcjs.decodeSelectionRle; exports.defaultAdjustmentParams = _chunkPHUMLSCWcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkPOGBUYWEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkPOGBUYWEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkPHUMLSCWcjs.defaultShapeName; exports.deflate = _chunkPOGBUYWEcjs.deflate; exports.deflateRaw = _chunkPOGBUYWEcjs.deflateRaw; exports.depthMaskAlpha = _chunkPHUMLSCWcjs.depthMaskAlpha; exports.depthRasterMask = _chunkPHUMLSCWcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkPHUMLSCWcjs.describeTransform; exports.deserializeEffects = _chunkPHUMLSCWcjs.deserializeEffects; exports.deserializeLayer = _chunkPHUMLSCWcjs.deserializeLayer; exports.deserializeLayers = _chunkPHUMLSCWcjs.deserializeLayers; exports.deserializePatterns = _chunkPHUMLSCWcjs.deserializePatterns; exports.deserializeSelection = _chunkPHUMLSCWcjs.deserializeSelection; exports.developFilter = _chunkPHUMLSCWcjs.developFilter; exports.developFromAdjustments = _chunkPHUMLSCWcjs.developFromAdjustments; exports.developTarget = _chunkPHUMLSCWcjs.developTarget; exports.distanceTransform = _chunkPHUMLSCWcjs.distanceTransform; exports.documentContents = _chunkPHUMLSCWcjs.documentContents; exports.downloadPsd = downloadPsd; exports.dragWarpMeshPoint = _chunkW3GXSUSQcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.duplicateLayer = _chunkPHUMLSCWcjs.duplicateLayer; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkPOGBUYWEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkPOGBUYWEcjs.effectReach; exports.effectsFingerprint = _chunkPOGBUYWEcjs.effectsFingerprint; exports.effectsMargin = _chunkPOGBUYWEcjs.effectsMargin; exports.effectsScale = _chunkPOGBUYWEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkXIOMMGPDcjs.emptySurface; exports.encodePng = _chunkPOGBUYWEcjs.encodePng; exports.encodeRle = _chunkPHUMLSCWcjs.encodeRle; exports.encodeSelectionRle = _chunkPHUMLSCWcjs.encodeSelectionRle; exports.encodeSurface = _chunkPHUMLSCWcjs.encodeSurface; exports.evalWarpMesh = _chunkW3GXSUSQcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkPHUMLSCWcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk7VOHOPLWcjs.exchangeRates; exports.expandCoverage = _chunkPHUMLSCWcjs.expandCoverage; exports.exportPsd = _chunkPHUMLSCWcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkPHUMLSCWcjs.featherCoverage; exports.fillRect = _chunkXIOMMGPDcjs.fillRect; exports.filterMaskCoverage = _chunkPHUMLSCWcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkPOGBUYWEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunkXIOMMGPDcjs.finishTile; exports.fitParagraphRuns = _chunkPHUMLSCWcjs.fitParagraphRuns; exports.fitRuns = _chunkPHUMLSCWcjs.fitRuns; exports.flattenLayers = _chunkPOGBUYWEcjs.flattenLayers; exports.flattenPath = _chunkPHUMLSCWcjs.flattenPath; exports.flipCorners = _chunkPHUMLSCWcjs.flipCorners; exports.fontOf = _chunkPHUMLSCWcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkPHUMLSCWcjs.fullSelection; exports.gaussianBlur = _chunkPOGBUYWEcjs.gaussianBlur; exports.geometryHomography = _chunkPHUMLSCWcjs.geometryHomography; exports.getAnnotationBounds = _chunkPHUMLSCWcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkPHUMLSCWcjs.getCropCursor; exports.getRotatedSize = _chunkPHUMLSCWcjs.getRotatedSize; exports.getViewportMetrics = _chunkPHUMLSCWcjs.getViewportMetrics; exports.getViewportProjection = _chunkPHUMLSCWcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunkPHUMLSCWcjs.greyMorphology; exports.groupLayers = _chunkPHUMLSCWcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkPOGBUYWEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkPHUMLSCWcjs.hasResampledLegacyMask; exports.hasSurface = _chunkPHUMLSCWcjs.hasSurface; exports.hasWarp = _chunkPHUMLSCWcjs.hasWarp; exports.hashMaskContent = _chunkPHUMLSCWcjs.hashMaskContent; exports.hashNoise = _chunkPOGBUYWEcjs.hashNoise; exports.hexToRgb = _chunkPHUMLSCWcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkPHUMLSCWcjs.hitTestAnnotation; exports.hitTestCrop = _chunkPHUMLSCWcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkPHUMLSCWcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkPHUMLSCWcjs.hueRangeTables; exports.hueRangeWeight = _chunkPHUMLSCWcjs.hueRangeWeight; exports.hueSaturation = _chunkPHUMLSCWcjs.hueSaturation; exports.identityCurve = _chunkPHUMLSCWcjs.identityCurve; exports.identityLevels = _chunkPHUMLSCWcjs.identityLevels; exports.identityTransform = _chunkPHUMLSCWcjs.identityTransform; exports.identityWarpMesh = _chunkW3GXSUSQcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunkPHUMLSCWcjs.imageToCanvasPoint; exports.importPsd = _chunkPHUMLSCWcjs.importPsd; exports.inflate = _chunkPOGBUYWEcjs.inflate; exports.inflateRaw = _chunkPOGBUYWEcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkPOGBUYWEcjs.insertLayer; exports.instancesOf = _chunkPHUMLSCWcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkPHUMLSCWcjs.invertMatrix3; exports.invertSelection = _chunkPHUMLSCWcjs.invertSelection; exports.isActiveFilter = _chunkPHUMLSCWcjs.isActiveFilter; exports.isAdjustmentKind = _chunkPHUMLSCWcjs.isAdjustmentKind; exports.isBlendMode = _chunkXIOMMGPDcjs.isBlendMode; exports.isContentsDecoded = _chunkPHUMLSCWcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkPHUMLSCWcjs.isDefaultDepthMask; exports.isIdentityTransform = _chunkPHUMLSCWcjs.isIdentityTransform; exports.isInterpolation = _chunkPOGBUYWEcjs.isInterpolation; exports.isLayerEffectKind = _chunkPOGBUYWEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkPOGBUYWEcjs.isLayerLocked; exports.isLegacyShape = _chunkPHUMLSCWcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkXIOMMGPDcjs.isPainterlyBlendMode; exports.isPng = _chunkPOGBUYWEcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkPHUMLSCWcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkPHUMLSCWcjs.isRenderedLayer; exports.isSelectionEmpty = _chunkPHUMLSCWcjs.isSelectionEmpty; exports.isSelectionMode = _chunkPHUMLSCWcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkXIOMMGPDcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunkPHUMLSCWcjs.isSpatialFilter; exports.isTransformAnchor = _chunkPHUMLSCWcjs.isTransformAnchor; exports.isValidWarp = _chunkPHUMLSCWcjs.isValidWarp; exports.kelvinToTemperature = _chunkPHUMLSCWcjs.kelvinToTemperature; exports.keysWeight = _chunkPOGBUYWEcjs.keysWeight; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkPOGBUYWEcjs.layerEffectFields; exports.layerEffectLabel = _chunkPOGBUYWEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkPHUMLSCWcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkPHUMLSCWcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkPHUMLSCWcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkPHUMLSCWcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkPHUMLSCWcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkPHUMLSCWcjs.layerTree; exports.layerTypeLabel = _chunkPHUMLSCWcjs.layerTypeLabel; exports.layersFromLegacy = _chunkPHUMLSCWcjs.layersFromLegacy; exports.layoutText = _chunkPHUMLSCWcjs.layoutText; exports.legacyAdjustmentLayer = _chunkPHUMLSCWcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkPHUMLSCWcjs.legacyMaskOf; exports.legacyView = _chunkPHUMLSCWcjs.legacyView; exports.lerpPigment = _chunkXIOMMGPDcjs.lerpPigment; exports.lerpPigmentInto = _chunkXIOMMGPDcjs.lerpPigmentInto; exports.levelsValue = _chunkPHUMLSCWcjs.levelsValue; exports.linearSrgbToXy = _chunkPHUMLSCWcjs.linearSrgbToXy; exports.linearToSrgb = _chunkPHUMLSCWcjs.linearToSrgb; exports.liveComponent = _chunkPHUMLSCWcjs.liveComponent; exports.liveShapeSubpaths = _chunkPHUMLSCWcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk7VOHOPLWcjs.loadMixer; exports.magicWand = magicWand; exports.mapCropHandle = _chunkPHUMLSCWcjs.mapCropHandle; exports.mapLayer = _chunkPOGBUYWEcjs.mapLayer; exports.mapSubpaths = _chunkPHUMLSCWcjs.mapSubpaths; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkPHUMLSCWcjs.matrixFromCorners; exports.matrixFromParams = _chunkPHUMLSCWcjs.matrixFromParams; exports.mergeLayerEffect = _chunkPOGBUYWEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkPHUMLSCWcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunkXIOMMGPDcjs.mixPigment8; exports.mixPigmentRgb = _chunkXIOMMGPDcjs.mixPigmentRgb; exports.mixPigments = _chunkXIOMMGPDcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk7VOHOPLWcjs.mixerRates; exports.modifySelection = _chunkPHUMLSCWcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkPHUMLSCWcjs.moveLayer; exports.moveSmartFilter = _chunkPHUMLSCWcjs.moveSmartFilter; exports.mulMatrix3 = _chunkPHUMLSCWcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkPHUMLSCWcjs.neutralHueRange; exports.newContentsId = _chunkPHUMLSCWcjs.newContentsId; exports.newEffectId = _chunkPOGBUYWEcjs.newEffectId; exports.newLayerId = _chunkPHUMLSCWcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkPHUMLSCWcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkPHUMLSCWcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkPHUMLSCWcjs.normalizeAngle; exports.normalizeBlendMode = _chunkXIOMMGPDcjs.normalizeBlendMode; exports.normalizeBlender = _chunk7VOHOPLWcjs.normalizeBlender; exports.normalizeBrush = _chunk7VOHOPLWcjs.normalizeBrush; exports.normalizeFilter = _chunkPHUMLSCWcjs.normalizeFilter; exports.normalizeLayerEffects = _chunkPOGBUYWEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkPHUMLSCWcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkPHUMLSCWcjs.normalizeLiveShape; exports.normalizeMixer = _chunk7VOHOPLWcjs.normalizeMixer; exports.normalizePlacement = _chunkPHUMLSCWcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkPHUMLSCWcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeShapePaint = _chunkPHUMLSCWcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkPHUMLSCWcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkPHUMLSCWcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk7VOHOPLWcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkPHUMLSCWcjs.normalizeSubpaths; exports.normalizeText = _chunkPHUMLSCWcjs.normalizeText; exports.offsetLayer = _chunkPHUMLSCWcjs.offsetLayer; exports.offsetShape = _chunkPHUMLSCWcjs.offsetShape; exports.offsetSmartObject = _chunkPHUMLSCWcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkXIOMMGPDcjs.packRgba; exports.paragraphRanges = _chunkPHUMLSCWcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkPHUMLSCWcjs.parseAdjustmentBlock; exports.parseBlend = _chunkPHUMLSCWcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkPHUMLSCWcjs.parseCssColor; exports.parseDataUrl = _chunkPOGBUYWEcjs.parseDataUrl; exports.parseEffectColor = _chunkPOGBUYWEcjs.parseEffectColor; exports.parseLfx2 = _chunkPHUMLSCWcjs.parseLfx2; exports.parseLrfx = _chunkPHUMLSCWcjs.parseLrfx; exports.parsePatternBlock = _chunkPHUMLSCWcjs.parsePatternBlock; exports.parseSelectionMode = _chunkPHUMLSCWcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkPHUMLSCWcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkPHUMLSCWcjs.patchParagraphStyle; exports.patchTextStyle = _chunkPHUMLSCWcjs.patchTextStyle; exports.photoFilterMatrix = _chunkPHUMLSCWcjs.photoFilterMatrix; exports.pigment8 = _chunkXIOMMGPDcjs.pigment8; exports.pixelLayerBounds = _chunkPHUMLSCWcjs.pixelLayerBounds; exports.pixelLayers = _chunkPHUMLSCWcjs.pixelLayers; exports.placeContents = _chunkPHUMLSCWcjs.placeContents; exports.placeLayer = _chunkPHUMLSCWcjs.placeLayer; exports.placementAt = _chunkPHUMLSCWcjs.placementAt; exports.placementBounds = _chunkPHUMLSCWcjs.placementBounds; exports.placementGeometry = _chunkPHUMLSCWcjs.placementGeometry; exports.pngDataUrl = _chunkPOGBUYWEcjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkPHUMLSCWcjs.posterizeValue; exports.presetWarp = _chunkPHUMLSCWcjs.presetWarp; exports.previewStep = previewStep; exports.projectImagePoint = _chunkPHUMLSCWcjs.projectImagePoint; exports.projectImageRect = _chunkPHUMLSCWcjs.projectImageRect; exports.projectMaskCoverage = _chunkPHUMLSCWcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkPHUMLSCWcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkPHUMLSCWcjs.psdToLayers; exports.pullWarpMesh = _chunkW3GXSUSQcjs.pullWarpMesh; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunkPHUMLSCWcjs.rangeLightness; exports.rasterContents = _chunkPHUMLSCWcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkPHUMLSCWcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkPHUMLSCWcjs.rasterizeCoverage; exports.rasterizeDab = _chunk7VOHOPLWcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkPHUMLSCWcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readPixel = _chunkXIOMMGPDcjs.readPixel; exports.readPsd = _chunkPHUMLSCWcjs.readPsd; exports.readRegion = _chunkXIOMMGPDcjs.readRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkPOGBUYWEcjs.reduceSurface; exports.referencePoint = _chunkPHUMLSCWcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkXIOMMGPDcjs.reflectanceToRgb; exports.removeAlpha = _chunkPHUMLSCWcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkPHUMLSCWcjs.removeLayer; exports.removeLayerEffect = _chunkPHUMLSCWcjs.removeLayerEffect; exports.removeLayerFilter = _chunkPHUMLSCWcjs.removeLayerFilter; exports.removeSmartFilter = _chunkPHUMLSCWcjs.removeSmartFilter; exports.renderLayerEffects = _chunkPOGBUYWEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkPHUMLSCWcjs.renderShape; exports.renderShapeRect = _chunkPHUMLSCWcjs.renderShapeRect; exports.renderSmartObject = _chunkPHUMLSCWcjs.renderSmartObject; exports.renderText = _chunkPHUMLSCWcjs.renderText; exports.replaceContents = _chunkPHUMLSCWcjs.replaceContents; exports.replaceTextRange = _chunkPHUMLSCWcjs.replaceTextRange; exports.requireLayer = _chunkPHUMLSCWcjs.requireLayer; exports.requireOperation = _chunkPHUMLSCWcjs.requireOperation; exports.requireShapeLayer = _chunkPHUMLSCWcjs.requireShapeLayer; exports.requireSmartObject = _chunkPHUMLSCWcjs.requireSmartObject; exports.requireTypeLayer = _chunkPHUMLSCWcjs.requireTypeLayer; exports.requireUnlocked = _chunkPHUMLSCWcjs.requireUnlocked; exports.rerender = _chunkPHUMLSCWcjs.rerender; exports.rerenderShape = _chunkPHUMLSCWcjs.rerenderShape; exports.rerenderText = _chunkPHUMLSCWcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkPHUMLSCWcjs.resizeSelection; exports.resizeWarpMesh = _chunkW3GXSUSQcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkPHUMLSCWcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.restyleRange = _chunkPHUMLSCWcjs.restyleRange; exports.rgbToGray = _chunkPHUMLSCWcjs.rgbToGray; exports.rgbToHsl = _chunkPHUMLSCWcjs.rgbToHsl; exports.rgbToReflectance = _chunkXIOMMGPDcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.runLayerFilters = _chunkPHUMLSCWcjs.runLayerFilters; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkPHUMLSCWcjs.sampleLut; exports.sampleToneLut = _chunkPHUMLSCWcjs.sampleToneLut; exports.scaleLayerEffect = _chunkPOGBUYWEcjs.scaleLayerEffect; exports.selectionArea = _chunkPHUMLSCWcjs.selectionArea; exports.selectionFromCoverage = _chunkPHUMLSCWcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkPHUMLSCWcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkPHUMLSCWcjs.selectionToCoverage; exports.selectionToPixels = _chunkPHUMLSCWcjs.selectionToPixels; exports.selectionValueAt = _chunkPHUMLSCWcjs.selectionValueAt; exports.serializeContents = _chunkPHUMLSCWcjs.serializeContents; exports.serializeEffects = _chunkPHUMLSCWcjs.serializeEffects; exports.serializeLayer = _chunkPHUMLSCWcjs.serializeLayer; exports.serializeLayers = _chunkPHUMLSCWcjs.serializeLayers; exports.serializeLayersExternal = _chunkPHUMLSCWcjs.serializeLayersExternal; exports.serializePatterns = _chunkPHUMLSCWcjs.serializePatterns; exports.serializeSelection = _chunkPHUMLSCWcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkPHUMLSCWcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkPHUMLSCWcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkPHUMLSCWcjs.setLayerMask; exports.setLayerProperties = _chunkPHUMLSCWcjs.setLayerProperties; exports.setLum = _chunkXIOMMGPDcjs.setLum; exports.setPigmentColor = _chunkXIOMMGPDcjs.setPigmentColor; exports.setSmartFilterMask = _chunkPHUMLSCWcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkPHUMLSCWcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkPHUMLSCWcjs.setSmartPlacement; exports.shapeAsPixelLayer = _chunkPHUMLSCWcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkPHUMLSCWcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkPHUMLSCWcjs.shapeGeometryBounds; exports.shapeLayers = _chunkPHUMLSCWcjs.shapeLayers; exports.shapeOutline = _chunkPHUMLSCWcjs.shapeOutline; exports.shapeRenderClip = _chunkPHUMLSCWcjs.shapeRenderClip; exports.shiftCoverage = _chunkPHUMLSCWcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkPHUMLSCWcjs.smartObjectLayers; exports.smoothCoverage = _chunkPHUMLSCWcjs.smoothCoverage; exports.smoothPoints = _chunk7VOHOPLWcjs.smoothPoints; exports.solidSurface = _chunkXIOMMGPDcjs.solidSurface; exports.spliceRuns = _chunkPHUMLSCWcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = _chunkPHUMLSCWcjs.srgbToLinear; exports.standardBlendMode = _chunkXIOMMGPDcjs.standardBlendMode; exports.styleAt = _chunkPHUMLSCWcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkXIOMMGPDcjs.surfaceBytes; exports.surfaceFromPixels = _chunkXIOMMGPDcjs.surfaceFromPixels; exports.surfacesEqual = _chunkXIOMMGPDcjs.surfacesEqual; exports.tempTintToXy = _chunkPHUMLSCWcjs.tempTintToXy; exports.temperatureToKelvin = _chunkPHUMLSCWcjs.temperatureToKelvin; exports.textIndexAt = _chunkPHUMLSCWcjs.textIndexAt; exports.textMatrix = _chunkPHUMLSCWcjs.textMatrix; exports.textOutlines = _chunkPHUMLSCWcjs.textOutlines; exports.textRange = _chunkPHUMLSCWcjs.textRange; exports.tileCoord = _chunkXIOMMGPDcjs.tileCoord; exports.tileKey = _chunkXIOMMGPDcjs.tileKey; exports.tileRect = _chunkXIOMMGPDcjs.tileRect; exports.tilesInRect = _chunkXIOMMGPDcjs.tilesInRect; exports.tipFalloff = _chunk7VOHOPLWcjs.tipFalloff; exports.tipReach = _chunk7VOHOPLWcjs.tipReach; exports.tipShape = _chunk7VOHOPLWcjs.tipShape; exports.toHex = toHex; exports.toTextSpace = _chunkPHUMLSCWcjs.toTextSpace; exports.toneCurve = _chunkPHUMLSCWcjs.toneCurve; exports.toneLuts = _chunkPHUMLSCWcjs.toneLuts; exports.toneRange = toneRange; exports.transformHomography = _chunkPHUMLSCWcjs.transformHomography; exports.transformMap = _chunkPHUMLSCWcjs.transformMap; exports.transformShapeComponents = _chunkPHUMLSCWcjs.transformShapeComponents; exports.transformSurface = _chunkPOGBUYWEcjs.transformSurface; exports.transformTypeLayer = _chunkPHUMLSCWcjs.transformTypeLayer; exports.transformedBounds = _chunkPOGBUYWEcjs.transformedBounds; exports.transformedBox = _chunkPHUMLSCWcjs.transformedBox; exports.transformedPoint = _chunkPHUMLSCWcjs.transformedPoint; exports.translateSurface = _chunkXIOMMGPDcjs.translateSurface; exports.typeAsPixelLayer = _chunkPHUMLSCWcjs.typeAsPixelLayer; exports.typeFrame = _chunkPHUMLSCWcjs.typeFrame; exports.typeFromAnnotation = _chunkPHUMLSCWcjs.typeFromAnnotation; exports.typeLayerName = _chunkPHUMLSCWcjs.typeLayerName; exports.ungroupLayer = _chunkPHUMLSCWcjs.ungroupLayer; exports.uniformTile = _chunkXIOMMGPDcjs.uniformTile; exports.unionRect = _chunkPHUMLSCWcjs.unionRect; exports.unprojectCanvasPoint = _chunkPHUMLSCWcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkPHUMLSCWcjs.updateLayerEffect; exports.updateLayerFilter = _chunkPHUMLSCWcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkPHUMLSCWcjs.updateLayerMaskProps; exports.updateShapeLayer = _chunkPHUMLSCWcjs.updateShapeLayer; exports.updateSmartFilter = _chunkPHUMLSCWcjs.updateSmartFilter; exports.updateTypeLayer = _chunkPHUMLSCWcjs.updateTypeLayer; exports.uvToXy = _chunkPHUMLSCWcjs.uvToXy; exports.validateEffectGradient = _chunkPOGBUYWEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkPOGBUYWEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkPOGBUYWEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkPHUMLSCWcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkPHUMLSCWcjs.vibranceLinear; exports.vibrancePixel = _chunkPHUMLSCWcjs.vibrancePixel; exports.walkDabs = _chunk7VOHOPLWcjs.walkDabs; exports.warpMeshEditPoints = _chunkW3GXSUSQcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkW3GXSUSQcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkW3GXSUSQcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkW3GXSUSQcjs.warpPresetMesh; exports.warpSurface = _chunkPOGBUYWEcjs.warpSurface; exports.wbMatrix = _chunkPHUMLSCWcjs.wbMatrix; exports.whiteBalanceFromSample = _chunkPHUMLSCWcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkPHUMLSCWcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkPHUMLSCWcjs.withFilterMaskSurface; exports.withNewIds = _chunkPHUMLSCWcjs.withNewIds; exports.writeAdjustmentBlock = _chunkPHUMLSCWcjs.writeAdjustmentBlock; exports.writeLfx2 = _chunkPHUMLSCWcjs.writeLfx2; exports.writePatternBlock = _chunkPHUMLSCWcjs.writePatternBlock; exports.writePsd = _chunkPHUMLSCWcjs.writePsd; exports.writeRegion = _chunkXIOMMGPDcjs.writeRegion; exports.xyToTempTint = _chunkPHUMLSCWcjs.xyToTempTint; exports.xyToUv = _chunkPHUMLSCWcjs.xyToUv;
|
|
13442
|
+
exports.ADJUSTMENT_KEYS = _chunkYGIMK4NXcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkYGIMK4NXcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkYGIMK4NXcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkYGIMK4NXcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkYGIMK4NXcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkYGIMK4NXcjs.BACKGROUND_LAYER_NAME; exports.BLEND_MODES = _chunkXIOMMGPDcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkYGIMK4NXcjs.BLUR_FILTER_ID; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.CoverageMap = _chunk7VOHOPLWcjs.CoverageMap; exports.D50 = _chunkYGIMK4NXcjs.D50; exports.D65 = _chunkYGIMK4NXcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkYGIMK4NXcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk7VOHOPLWcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk7VOHOPLWcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_GLOBAL_LIGHT = _chunkPOGBUYWEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkYGIMK4NXcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk7VOHOPLWcjs.DEFAULT_MIXER; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk7VOHOPLWcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkYGIMK4NXcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkYGIMK4NXcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkPOGBUYWEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DabWalker = _chunk7VOHOPLWcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkYGIMK4NXcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkYGIMK4NXcjs.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 = _chunkYGIMK4NXcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkYGIMK4NXcjs.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 = _chunkPOGBUYWEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = _chunkYGIMK4NXcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkYGIMK4NXcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkPOGBUYWEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkYGIMK4NXcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkYGIMK4NXcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkYGIMK4NXcjs.LUMA_709; exports.LayerCompositor = _chunkYGIMK4NXcjs.LayerCompositor; exports.LayerEffectError = _chunkPOGBUYWEcjs.LayerEffectError; exports.LayerOperationError = _chunkYGIMK4NXcjs.LayerOperationError; exports.MAX_BRUSH_SIZE = _chunk7VOHOPLWcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkPOGBUYWEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkYGIMK4NXcjs.MAX_KELVIN; exports.MAX_TRANSFORM_PIXELS = _chunkPOGBUYWEcjs.MAX_TRANSFORM_PIXELS; exports.MIN_KELVIN = _chunkYGIMK4NXcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkYGIMK4NXcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk7VOHOPLWcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk7VOHOPLWcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk7VOHOPLWcjs.MIXING_MODELS; exports.MixerStroke = _chunk7VOHOPLWcjs.MixerStroke; exports.PAINTERLY_BLEND_MODES = _chunkXIOMMGPDcjs.PAINTERLY_BLEND_MODES; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PARAGRAPH_STYLE_FIELDS = _chunkYGIMK4NXcjs.PARAGRAPH_STYLE_FIELDS; exports.PATTERN_BLOCK_KEYS = _chunkYGIMK4NXcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkXIOMMGPDcjs.PIGMENT_BANDS; exports.PIGMENT_LAMBDA_MIN = _chunkXIOMMGPDcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkXIOMMGPDcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_WAVELENGTHS = _chunkXIOMMGPDcjs.PIGMENT_WAVELENGTHS; exports.PSD_BLEND_KEYS = _chunkYGIMK4NXcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.PaintExchange = _chunk7VOHOPLWcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkPOGBUYWEcjs.PatternPlacement; exports.PatternTile = _chunkPOGBUYWEcjs.PatternTile; exports.PsdError = _chunkYGIMK4NXcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = _chunkYGIMK4NXcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkYGIMK4NXcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SHADOW_AMBIENT = _chunkXIOMMGPDcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkYGIMK4NXcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkYGIMK4NXcjs.SHAPE_RENDER_MARGIN; exports.SMART_RENDER_MARGIN = _chunkYGIMK4NXcjs.SMART_RENDER_MARGIN; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkYGIMK4NXcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk7VOHOPLWcjs.SmudgeTip; exports.StrokeCoverage = _chunk7VOHOPLWcjs.StrokeCoverage; exports.SurfaceDraft = _chunkXIOMMGPDcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkYGIMK4NXcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkYGIMK4NXcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkYGIMK4NXcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkXIOMMGPDcjs.TILE; exports.TILE_SHIFT = _chunkXIOMMGPDcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkYGIMK4NXcjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunkYGIMK4NXcjs.TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkYGIMK4NXcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunk7VOHOPLWcjs.TileMedium; exports.TiledSurface = _chunkXIOMMGPDcjs.TiledSurface; exports.TransformTooLargeError = _chunkPOGBUYWEcjs.TransformTooLargeError; exports.TypeToolGesture = TypeToolGesture; exports.VIBRANCE_GREY = _chunkYGIMK4NXcjs.VIBRANCE_GREY; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkW3GXSUSQcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkW3GXSUSQcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.XYZ_D50_TO_SRGB = _chunkYGIMK4NXcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkPOGBUYWEcjs.ZlibError; exports.activeAdjustmentLayers = _chunkYGIMK4NXcjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunkYGIMK4NXcjs.activeSmartFilters; exports.addLayerEffect = _chunkYGIMK4NXcjs.addLayerEffect; exports.addLayerFilter = _chunkYGIMK4NXcjs.addLayerFilter; exports.addSmartFilter = _chunkYGIMK4NXcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkYGIMK4NXcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkYGIMK4NXcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkYGIMK4NXcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkYGIMK4NXcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkPOGBUYWEcjs.adler32; exports.anchorPoint = _chunkYGIMK4NXcjs.anchorPoint; exports.annotationBlend = _chunkYGIMK4NXcjs.annotationBlend; exports.annotationLayerFor = _chunkYGIMK4NXcjs.annotationLayerFor; exports.annotationLayerName = _chunkYGIMK4NXcjs.annotationLayerName; exports.annotationOfLayer = _chunkYGIMK4NXcjs.annotationOfLayer; exports.annotationOfShape = _chunkYGIMK4NXcjs.annotationOfShape; exports.annotationOfType = _chunkYGIMK4NXcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkYGIMK4NXcjs.applyAdjustmentLayers; exports.applyAdjustments = _chunkYGIMK4NXcjs.applyAdjustments; exports.applyBoxBlur = _chunkYGIMK4NXcjs.applyBoxBlur; exports.applyDepthMask = _chunkYGIMK4NXcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkYGIMK4NXcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkYGIMK4NXcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkYGIMK4NXcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkYGIMK4NXcjs.applyParams; exports.applyProcess2Adjustments = _chunkYGIMK4NXcjs.applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkYGIMK4NXcjs.applySmartFilters; exports.applyStrokeToTile = _chunk7VOHOPLWcjs.applyStrokeToTile; exports.backgroundLayer = _chunkYGIMK4NXcjs.backgroundLayer; exports.base64ToBytes = _chunkPOGBUYWEcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.blackWhiteGray = _chunkYGIMK4NXcjs.blackWhiteGray; exports.blendChannel = _chunkXIOMMGPDcjs.blendChannel; exports.blendImageData = _chunkXIOMMGPDcjs.blendImageData; exports.blendLum = _chunkXIOMMGPDcjs.blendLum; exports.blendPixel = _chunkXIOMMGPDcjs.blendPixel; exports.blendRadius = _chunk7VOHOPLWcjs.blendRadius; exports.blendRgb = _chunkXIOMMGPDcjs.blendRgb; exports.blendTile = _chunkPOGBUYWEcjs.blendTile; exports.blenderDab = _chunk7VOHOPLWcjs.blenderDab; exports.blurFilter = _chunkYGIMK4NXcjs.blurFilter; exports.borderCoverage = _chunkYGIMK4NXcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkYGIMK4NXcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkYGIMK4NXcjs.bradfordAdaptation; exports.buildLayerMaskPlanes = _chunkYGIMK4NXcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkYGIMK4NXcjs.buildToneLut; exports.builtinPattern = _chunkPOGBUYWEcjs.builtinPattern; exports.builtinPatternIds = _chunkPOGBUYWEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkPOGBUYWEcjs.bytesToBase64; exports.calculateCropDrag = _chunkYGIMK4NXcjs.calculateCropDrag; exports.canvasCompositeOperation = _chunkXIOMMGPDcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkYGIMK4NXcjs.canvasToImagePoint; exports.caretAt = _chunkYGIMK4NXcjs.caretAt; exports.changedTiles = _chunkPOGBUYWEcjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkYGIMK4NXcjs.clampCropToImage; exports.cleanMixer = _chunk7VOHOPLWcjs.cleanMixer; exports.collectTiles = _chunkXIOMMGPDcjs.collectTiles; exports.colorBalanceChannel = _chunkYGIMK4NXcjs.colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = _chunkYGIMK4NXcjs.combineSelections; exports.compileAdjustmentLayer = _chunkYGIMK4NXcjs.compileAdjustmentLayer; exports.componentPath = _chunkYGIMK4NXcjs.componentPath; exports.compositeSurfaceOver = _chunkPOGBUYWEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkYGIMK4NXcjs.computeSelectionBounds; exports.contentBounds = _chunkXIOMMGPDcjs.contentBounds; exports.contentsBox = _chunkYGIMK4NXcjs.contentsBox; exports.contentsSurface = _chunkYGIMK4NXcjs.contentsSurface; exports.contractCoverage = _chunkYGIMK4NXcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertToSmartObject = _chunkYGIMK4NXcjs.convertToSmartObject; exports.copySmartObject = _chunkYGIMK4NXcjs.copySmartObject; exports.cornersFromMatrix = _chunkYGIMK4NXcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk7VOHOPLWcjs.coverageTileCoord; exports.coverageToByte = _chunkYGIMK4NXcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkYGIMK4NXcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk7VOHOPLWcjs.createBlenderScratch; exports.createCanvasTextShaper = createCanvasTextShaper; 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.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createOutlineTextShaper = createOutlineTextShaper; exports.createPigment = _chunkXIOMMGPDcjs.createPigment; exports.createPigmentTools = _chunk7VOHOPLWcjs.createPigmentTools; exports.createSelectionMask = _chunkYGIMK4NXcjs.createSelectionMask; exports.createShapeLayer = _chunkYGIMK4NXcjs.createShapeLayer; exports.createTypeLayer = _chunkYGIMK4NXcjs.createTypeLayer; exports.cssFont = cssFont; exports.cssFontFamily = cssFontFamily; exports.curveLut = _chunkPOGBUYWEcjs.curveLut; exports.curveLutFromLevels = _chunkYGIMK4NXcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk7VOHOPLWcjs.dabCoverage; exports.dabRect = _chunk7VOHOPLWcjs.dabRect; exports.decodeLayerChannel = _chunkYGIMK4NXcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkYGIMK4NXcjs.decodeLayerMask; exports.decodeMergedImage = _chunkYGIMK4NXcjs.decodeMergedImage; exports.decodePlanes = _chunkYGIMK4NXcjs.decodePlanes; exports.decodePng = _chunkPOGBUYWEcjs.decodePng; exports.decodePngDataUrl = _chunkYGIMK4NXcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkYGIMK4NXcjs.decodeSelectionRle; exports.defaultAdjustmentParams = _chunkYGIMK4NXcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkPOGBUYWEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkPOGBUYWEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkYGIMK4NXcjs.defaultShapeName; exports.deflate = _chunkPOGBUYWEcjs.deflate; exports.deflateRaw = _chunkPOGBUYWEcjs.deflateRaw; exports.depthMaskAlpha = _chunkYGIMK4NXcjs.depthMaskAlpha; exports.depthRasterMask = _chunkYGIMK4NXcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkYGIMK4NXcjs.describeTransform; exports.deserializeEffects = _chunkYGIMK4NXcjs.deserializeEffects; exports.deserializeLayer = _chunkYGIMK4NXcjs.deserializeLayer; exports.deserializeLayers = _chunkYGIMK4NXcjs.deserializeLayers; exports.deserializePatterns = _chunkYGIMK4NXcjs.deserializePatterns; exports.deserializeSelection = _chunkYGIMK4NXcjs.deserializeSelection; exports.developFilter = _chunkYGIMK4NXcjs.developFilter; exports.developFromAdjustments = _chunkYGIMK4NXcjs.developFromAdjustments; exports.developTarget = _chunkYGIMK4NXcjs.developTarget; exports.distanceTransform = _chunkYGIMK4NXcjs.distanceTransform; exports.documentContents = _chunkYGIMK4NXcjs.documentContents; exports.downloadPsd = downloadPsd; exports.dragWarpMeshPoint = _chunkW3GXSUSQcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.duplicateLayer = _chunkYGIMK4NXcjs.duplicateLayer; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkPOGBUYWEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkPOGBUYWEcjs.effectReach; exports.effectsFingerprint = _chunkPOGBUYWEcjs.effectsFingerprint; exports.effectsMargin = _chunkPOGBUYWEcjs.effectsMargin; exports.effectsScale = _chunkPOGBUYWEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkXIOMMGPDcjs.emptySurface; exports.encodePng = _chunkPOGBUYWEcjs.encodePng; exports.encodeRle = _chunkYGIMK4NXcjs.encodeRle; exports.encodeSelectionRle = _chunkYGIMK4NXcjs.encodeSelectionRle; exports.encodeSurface = _chunkYGIMK4NXcjs.encodeSurface; exports.evalWarpMesh = _chunkW3GXSUSQcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkYGIMK4NXcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk7VOHOPLWcjs.exchangeRates; exports.expandCoverage = _chunkYGIMK4NXcjs.expandCoverage; exports.exportPsd = _chunkYGIMK4NXcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkYGIMK4NXcjs.featherCoverage; exports.fillRect = _chunkXIOMMGPDcjs.fillRect; exports.filterMaskCoverage = _chunkYGIMK4NXcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkPOGBUYWEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunkXIOMMGPDcjs.finishTile; exports.fitParagraphRuns = _chunkYGIMK4NXcjs.fitParagraphRuns; exports.fitRuns = _chunkYGIMK4NXcjs.fitRuns; exports.flattenLayers = _chunkPOGBUYWEcjs.flattenLayers; exports.flattenPath = _chunkYGIMK4NXcjs.flattenPath; exports.flipCorners = _chunkYGIMK4NXcjs.flipCorners; exports.fontOf = _chunkYGIMK4NXcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkYGIMK4NXcjs.fullSelection; exports.gaussianBlur = _chunkPOGBUYWEcjs.gaussianBlur; exports.geometryHomography = _chunkYGIMK4NXcjs.geometryHomography; exports.getAnnotationBounds = _chunkYGIMK4NXcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkYGIMK4NXcjs.getCropCursor; exports.getRotatedSize = _chunkYGIMK4NXcjs.getRotatedSize; exports.getViewportMetrics = _chunkYGIMK4NXcjs.getViewportMetrics; exports.getViewportProjection = _chunkYGIMK4NXcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunkYGIMK4NXcjs.greyMorphology; exports.groupLayers = _chunkYGIMK4NXcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkPOGBUYWEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkYGIMK4NXcjs.hasResampledLegacyMask; exports.hasSurface = _chunkYGIMK4NXcjs.hasSurface; exports.hasWarp = _chunkYGIMK4NXcjs.hasWarp; exports.hashMaskContent = _chunkYGIMK4NXcjs.hashMaskContent; exports.hashNoise = _chunkPOGBUYWEcjs.hashNoise; exports.hexToRgb = _chunkYGIMK4NXcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkYGIMK4NXcjs.hitTestAnnotation; exports.hitTestCrop = _chunkYGIMK4NXcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkYGIMK4NXcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkYGIMK4NXcjs.hueRangeTables; exports.hueRangeWeight = _chunkYGIMK4NXcjs.hueRangeWeight; exports.hueSaturation = _chunkYGIMK4NXcjs.hueSaturation; exports.identityCurve = _chunkYGIMK4NXcjs.identityCurve; exports.identityLevels = _chunkYGIMK4NXcjs.identityLevels; exports.identityTransform = _chunkYGIMK4NXcjs.identityTransform; exports.identityWarpMesh = _chunkW3GXSUSQcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunkYGIMK4NXcjs.imageToCanvasPoint; exports.importPsd = _chunkYGIMK4NXcjs.importPsd; exports.inflate = _chunkPOGBUYWEcjs.inflate; exports.inflateRaw = _chunkPOGBUYWEcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkPOGBUYWEcjs.insertLayer; exports.instancesOf = _chunkYGIMK4NXcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkYGIMK4NXcjs.invertMatrix3; exports.invertSelection = _chunkYGIMK4NXcjs.invertSelection; exports.isActiveFilter = _chunkYGIMK4NXcjs.isActiveFilter; exports.isAdjustmentKind = _chunkYGIMK4NXcjs.isAdjustmentKind; exports.isBlendMode = _chunkXIOMMGPDcjs.isBlendMode; exports.isContentsDecoded = _chunkYGIMK4NXcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkYGIMK4NXcjs.isDefaultDepthMask; exports.isIdentityTransform = _chunkYGIMK4NXcjs.isIdentityTransform; exports.isInterpolation = _chunkPOGBUYWEcjs.isInterpolation; exports.isLayerEffectKind = _chunkPOGBUYWEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkPOGBUYWEcjs.isLayerLocked; exports.isLegacyShape = _chunkYGIMK4NXcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkXIOMMGPDcjs.isPainterlyBlendMode; exports.isPng = _chunkPOGBUYWEcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkYGIMK4NXcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkYGIMK4NXcjs.isRenderedLayer; exports.isSelectionEmpty = _chunkYGIMK4NXcjs.isSelectionEmpty; exports.isSelectionMode = _chunkYGIMK4NXcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkXIOMMGPDcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunkYGIMK4NXcjs.isSpatialFilter; exports.isTransformAnchor = _chunkYGIMK4NXcjs.isTransformAnchor; exports.isValidWarp = _chunkYGIMK4NXcjs.isValidWarp; exports.kelvinToTemperature = _chunkYGIMK4NXcjs.kelvinToTemperature; exports.keysWeight = _chunkPOGBUYWEcjs.keysWeight; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkPOGBUYWEcjs.layerEffectFields; exports.layerEffectLabel = _chunkPOGBUYWEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkYGIMK4NXcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkYGIMK4NXcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkYGIMK4NXcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkYGIMK4NXcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkYGIMK4NXcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkYGIMK4NXcjs.layerTree; exports.layerTypeLabel = _chunkYGIMK4NXcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkYGIMK4NXcjs.layersFromLegacy; exports.layoutText = _chunkYGIMK4NXcjs.layoutText; exports.legacyAdjustmentLayer = _chunkYGIMK4NXcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkYGIMK4NXcjs.legacyMaskOf; exports.legacyView = _chunkYGIMK4NXcjs.legacyView; exports.lerpPigment = _chunkXIOMMGPDcjs.lerpPigment; exports.lerpPigmentInto = _chunkXIOMMGPDcjs.lerpPigmentInto; exports.levelsValue = _chunkYGIMK4NXcjs.levelsValue; exports.linearSrgbToXy = _chunkYGIMK4NXcjs.linearSrgbToXy; exports.linearToSrgb = _chunkYGIMK4NXcjs.linearToSrgb; exports.liveComponent = _chunkYGIMK4NXcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkYGIMK4NXcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk7VOHOPLWcjs.loadMixer; exports.magicWand = magicWand; exports.mapCropHandle = _chunkYGIMK4NXcjs.mapCropHandle; exports.mapLayer = _chunkPOGBUYWEcjs.mapLayer; exports.mapSubpaths = _chunkYGIMK4NXcjs.mapSubpaths; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkYGIMK4NXcjs.matrixFromCorners; exports.matrixFromParams = _chunkYGIMK4NXcjs.matrixFromParams; exports.mergeLayerEffect = _chunkPOGBUYWEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkYGIMK4NXcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunkXIOMMGPDcjs.mixPigment8; exports.mixPigmentRgb = _chunkXIOMMGPDcjs.mixPigmentRgb; exports.mixPigments = _chunkXIOMMGPDcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk7VOHOPLWcjs.mixerRates; exports.modifySelection = _chunkYGIMK4NXcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkYGIMK4NXcjs.moveLayer; exports.moveSmartFilter = _chunkYGIMK4NXcjs.moveSmartFilter; exports.mulMatrix3 = _chunkYGIMK4NXcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkYGIMK4NXcjs.neutralHueRange; exports.newContentsId = _chunkYGIMK4NXcjs.newContentsId; exports.newEffectId = _chunkPOGBUYWEcjs.newEffectId; exports.newLayerId = _chunkYGIMK4NXcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkYGIMK4NXcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkYGIMK4NXcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkYGIMK4NXcjs.normalizeAngle; exports.normalizeBlendMode = _chunkXIOMMGPDcjs.normalizeBlendMode; exports.normalizeBlender = _chunk7VOHOPLWcjs.normalizeBlender; exports.normalizeBrush = _chunk7VOHOPLWcjs.normalizeBrush; exports.normalizeFilter = _chunkYGIMK4NXcjs.normalizeFilter; exports.normalizeLayerEffects = _chunkPOGBUYWEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkYGIMK4NXcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkYGIMK4NXcjs.normalizeLiveShape; exports.normalizeMixer = _chunk7VOHOPLWcjs.normalizeMixer; exports.normalizePlacement = _chunkYGIMK4NXcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkYGIMK4NXcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeShapePaint = _chunkYGIMK4NXcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkYGIMK4NXcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkYGIMK4NXcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk7VOHOPLWcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkYGIMK4NXcjs.normalizeSubpaths; exports.normalizeText = _chunkYGIMK4NXcjs.normalizeText; exports.offsetLayer = _chunkYGIMK4NXcjs.offsetLayer; exports.offsetShape = _chunkYGIMK4NXcjs.offsetShape; exports.offsetSmartObject = _chunkYGIMK4NXcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkXIOMMGPDcjs.packRgba; exports.paragraphRanges = _chunkYGIMK4NXcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkYGIMK4NXcjs.parseAdjustmentBlock; exports.parseBlend = _chunkYGIMK4NXcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkYGIMK4NXcjs.parseCssColor; exports.parseDataUrl = _chunkPOGBUYWEcjs.parseDataUrl; exports.parseEffectColor = _chunkPOGBUYWEcjs.parseEffectColor; exports.parseLfx2 = _chunkYGIMK4NXcjs.parseLfx2; exports.parseLrfx = _chunkYGIMK4NXcjs.parseLrfx; exports.parsePatternBlock = _chunkYGIMK4NXcjs.parsePatternBlock; exports.parseSelectionMode = _chunkYGIMK4NXcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkYGIMK4NXcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkYGIMK4NXcjs.patchParagraphStyle; exports.patchTextStyle = _chunkYGIMK4NXcjs.patchTextStyle; exports.photoFilterMatrix = _chunkYGIMK4NXcjs.photoFilterMatrix; exports.pigment8 = _chunkXIOMMGPDcjs.pigment8; exports.pixelLayerBounds = _chunkYGIMK4NXcjs.pixelLayerBounds; exports.pixelLayers = _chunkYGIMK4NXcjs.pixelLayers; exports.placeContents = _chunkYGIMK4NXcjs.placeContents; exports.placeLayer = _chunkYGIMK4NXcjs.placeLayer; exports.placementAt = _chunkYGIMK4NXcjs.placementAt; exports.placementBounds = _chunkYGIMK4NXcjs.placementBounds; exports.placementGeometry = _chunkYGIMK4NXcjs.placementGeometry; exports.pngDataUrl = _chunkPOGBUYWEcjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkYGIMK4NXcjs.posterizeValue; exports.presetWarp = _chunkYGIMK4NXcjs.presetWarp; exports.previewStep = previewStep; exports.projectImagePoint = _chunkYGIMK4NXcjs.projectImagePoint; exports.projectImageRect = _chunkYGIMK4NXcjs.projectImageRect; exports.projectMaskCoverage = _chunkYGIMK4NXcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkYGIMK4NXcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkYGIMK4NXcjs.psdToLayers; exports.pullWarpMesh = _chunkW3GXSUSQcjs.pullWarpMesh; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunkYGIMK4NXcjs.rangeLightness; exports.rasterContents = _chunkYGIMK4NXcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkYGIMK4NXcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkYGIMK4NXcjs.rasterizeCoverage; exports.rasterizeDab = _chunk7VOHOPLWcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkYGIMK4NXcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readPixel = _chunkXIOMMGPDcjs.readPixel; exports.readPsd = _chunkYGIMK4NXcjs.readPsd; exports.readRegion = _chunkXIOMMGPDcjs.readRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkPOGBUYWEcjs.reduceSurface; exports.referencePoint = _chunkYGIMK4NXcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkXIOMMGPDcjs.reflectanceToRgb; exports.removeAlpha = _chunkYGIMK4NXcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkYGIMK4NXcjs.removeLayer; exports.removeLayerEffect = _chunkYGIMK4NXcjs.removeLayerEffect; exports.removeLayerFilter = _chunkYGIMK4NXcjs.removeLayerFilter; exports.removeSmartFilter = _chunkYGIMK4NXcjs.removeSmartFilter; exports.renderLayerEffects = _chunkPOGBUYWEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkYGIMK4NXcjs.renderShape; exports.renderShapeRect = _chunkYGIMK4NXcjs.renderShapeRect; exports.renderSmartObject = _chunkYGIMK4NXcjs.renderSmartObject; exports.renderText = _chunkYGIMK4NXcjs.renderText; exports.replaceContents = _chunkYGIMK4NXcjs.replaceContents; exports.replaceTextRange = _chunkYGIMK4NXcjs.replaceTextRange; exports.requireLayer = _chunkYGIMK4NXcjs.requireLayer; exports.requireOperation = _chunkYGIMK4NXcjs.requireOperation; exports.requireShapeLayer = _chunkYGIMK4NXcjs.requireShapeLayer; exports.requireSmartObject = _chunkYGIMK4NXcjs.requireSmartObject; exports.requireTypeLayer = _chunkYGIMK4NXcjs.requireTypeLayer; exports.requireUnlocked = _chunkYGIMK4NXcjs.requireUnlocked; exports.rerender = _chunkYGIMK4NXcjs.rerender; exports.rerenderShape = _chunkYGIMK4NXcjs.rerenderShape; exports.rerenderText = _chunkYGIMK4NXcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkYGIMK4NXcjs.resizeSelection; exports.resizeWarpMesh = _chunkW3GXSUSQcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkYGIMK4NXcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.restyleRange = _chunkYGIMK4NXcjs.restyleRange; exports.rgbToGray = _chunkYGIMK4NXcjs.rgbToGray; exports.rgbToHsl = _chunkYGIMK4NXcjs.rgbToHsl; exports.rgbToReflectance = _chunkXIOMMGPDcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.runLayerFilters = _chunkYGIMK4NXcjs.runLayerFilters; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkYGIMK4NXcjs.sampleLut; exports.sampleToneLut = _chunkYGIMK4NXcjs.sampleToneLut; exports.scaleLayerEffect = _chunkPOGBUYWEcjs.scaleLayerEffect; exports.selectionArea = _chunkYGIMK4NXcjs.selectionArea; exports.selectionFromCoverage = _chunkYGIMK4NXcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkYGIMK4NXcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkYGIMK4NXcjs.selectionToCoverage; exports.selectionToPixels = _chunkYGIMK4NXcjs.selectionToPixels; exports.selectionValueAt = _chunkYGIMK4NXcjs.selectionValueAt; exports.serializeContents = _chunkYGIMK4NXcjs.serializeContents; exports.serializeEffects = _chunkYGIMK4NXcjs.serializeEffects; exports.serializeLayer = _chunkYGIMK4NXcjs.serializeLayer; exports.serializeLayers = _chunkYGIMK4NXcjs.serializeLayers; exports.serializeLayersExternal = _chunkYGIMK4NXcjs.serializeLayersExternal; exports.serializePatterns = _chunkYGIMK4NXcjs.serializePatterns; exports.serializeSelection = _chunkYGIMK4NXcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkYGIMK4NXcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkYGIMK4NXcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkYGIMK4NXcjs.setLayerMask; exports.setLayerProperties = _chunkYGIMK4NXcjs.setLayerProperties; exports.setLum = _chunkXIOMMGPDcjs.setLum; exports.setPigmentColor = _chunkXIOMMGPDcjs.setPigmentColor; exports.setSmartFilterMask = _chunkYGIMK4NXcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkYGIMK4NXcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkYGIMK4NXcjs.setSmartPlacement; exports.shapeAsPixelLayer = _chunkYGIMK4NXcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkYGIMK4NXcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkYGIMK4NXcjs.shapeGeometryBounds; exports.shapeLayers = _chunkYGIMK4NXcjs.shapeLayers; exports.shapeOutline = _chunkYGIMK4NXcjs.shapeOutline; exports.shapeRenderClip = _chunkYGIMK4NXcjs.shapeRenderClip; exports.shiftCoverage = _chunkYGIMK4NXcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkYGIMK4NXcjs.smartObjectLayers; exports.smoothCoverage = _chunkYGIMK4NXcjs.smoothCoverage; exports.smoothPoints = _chunk7VOHOPLWcjs.smoothPoints; exports.solidSurface = _chunkXIOMMGPDcjs.solidSurface; exports.spliceRuns = _chunkYGIMK4NXcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = _chunkYGIMK4NXcjs.srgbToLinear; exports.standardBlendMode = _chunkXIOMMGPDcjs.standardBlendMode; exports.styleAt = _chunkYGIMK4NXcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkXIOMMGPDcjs.surfaceBytes; exports.surfaceFromPixels = _chunkXIOMMGPDcjs.surfaceFromPixels; exports.surfacesEqual = _chunkXIOMMGPDcjs.surfacesEqual; exports.tempTintToXy = _chunkYGIMK4NXcjs.tempTintToXy; exports.temperatureToKelvin = _chunkYGIMK4NXcjs.temperatureToKelvin; exports.textIndexAt = _chunkYGIMK4NXcjs.textIndexAt; exports.textMatrix = _chunkYGIMK4NXcjs.textMatrix; exports.textOutlines = _chunkYGIMK4NXcjs.textOutlines; exports.textRange = _chunkYGIMK4NXcjs.textRange; exports.tileCoord = _chunkXIOMMGPDcjs.tileCoord; exports.tileKey = _chunkXIOMMGPDcjs.tileKey; exports.tileRect = _chunkXIOMMGPDcjs.tileRect; exports.tilesInRect = _chunkXIOMMGPDcjs.tilesInRect; exports.tipFalloff = _chunk7VOHOPLWcjs.tipFalloff; exports.tipReach = _chunk7VOHOPLWcjs.tipReach; exports.tipShape = _chunk7VOHOPLWcjs.tipShape; exports.toHex = toHex; exports.toTextSpace = _chunkYGIMK4NXcjs.toTextSpace; exports.toneCurve = _chunkYGIMK4NXcjs.toneCurve; exports.toneLuts = _chunkYGIMK4NXcjs.toneLuts; exports.toneRange = toneRange; exports.transformHomography = _chunkYGIMK4NXcjs.transformHomography; exports.transformMap = _chunkYGIMK4NXcjs.transformMap; exports.transformShapeComponents = _chunkYGIMK4NXcjs.transformShapeComponents; exports.transformSurface = _chunkPOGBUYWEcjs.transformSurface; exports.transformTypeLayer = _chunkYGIMK4NXcjs.transformTypeLayer; exports.transformedBounds = _chunkPOGBUYWEcjs.transformedBounds; exports.transformedBox = _chunkYGIMK4NXcjs.transformedBox; exports.transformedPoint = _chunkYGIMK4NXcjs.transformedPoint; exports.translateSurface = _chunkXIOMMGPDcjs.translateSurface; exports.typeAsPixelLayer = _chunkYGIMK4NXcjs.typeAsPixelLayer; exports.typeFrame = _chunkYGIMK4NXcjs.typeFrame; exports.typeFromAnnotation = _chunkYGIMK4NXcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkYGIMK4NXcjs.typeLayerName; exports.ungroupLayer = _chunkYGIMK4NXcjs.ungroupLayer; exports.uniformTile = _chunkXIOMMGPDcjs.uniformTile; exports.unionRect = _chunkYGIMK4NXcjs.unionRect; exports.unprojectCanvasPoint = _chunkYGIMK4NXcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkYGIMK4NXcjs.updateLayerEffect; exports.updateLayerFilter = _chunkYGIMK4NXcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkYGIMK4NXcjs.updateLayerMaskProps; exports.updateShapeLayer = _chunkYGIMK4NXcjs.updateShapeLayer; exports.updateSmartFilter = _chunkYGIMK4NXcjs.updateSmartFilter; exports.updateTypeLayer = _chunkYGIMK4NXcjs.updateTypeLayer; exports.uvToXy = _chunkYGIMK4NXcjs.uvToXy; exports.validateEffectGradient = _chunkPOGBUYWEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkPOGBUYWEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkPOGBUYWEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkYGIMK4NXcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkYGIMK4NXcjs.vibranceLinear; exports.vibrancePixel = _chunkYGIMK4NXcjs.vibrancePixel; exports.walkDabs = _chunk7VOHOPLWcjs.walkDabs; exports.warpMeshEditPoints = _chunkW3GXSUSQcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkW3GXSUSQcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkW3GXSUSQcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkW3GXSUSQcjs.warpPresetMesh; exports.warpSurface = _chunkPOGBUYWEcjs.warpSurface; exports.wbMatrix = _chunkYGIMK4NXcjs.wbMatrix; exports.whiteBalanceFromSample = _chunkYGIMK4NXcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkYGIMK4NXcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkYGIMK4NXcjs.withFilterMaskSurface; exports.withNewIds = _chunkYGIMK4NXcjs.withNewIds; exports.writeAdjustmentBlock = _chunkYGIMK4NXcjs.writeAdjustmentBlock; exports.writeLfx2 = _chunkYGIMK4NXcjs.writeLfx2; exports.writePatternBlock = _chunkYGIMK4NXcjs.writePatternBlock; exports.writePsd = _chunkYGIMK4NXcjs.writePsd; exports.writeRegion = _chunkXIOMMGPDcjs.writeRegion; exports.xyToTempTint = _chunkYGIMK4NXcjs.xyToTempTint; exports.xyToUv = _chunkYGIMK4NXcjs.xyToUv;
|
|
12896
13443
|
//# sourceMappingURL=index.cjs.map
|