@pixerate/editor 0.138.0 → 0.139.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation-editor/index.cjs +55 -55
- package/dist/animation-editor/index.d.cts +5 -4
- package/dist/animation-editor/index.d.ts +5 -4
- package/dist/animation-editor/index.js +2 -2
- package/dist/{bezier-DPmdGwgR.d.ts → bezier-B6cK8SR6.d.ts} +1 -1
- package/dist/{bezier-CUaH8hcK.d.cts → bezier-CEJ8Uw4O.d.cts} +1 -1
- package/dist/{grain-GCt_O2kv.d.cts → blending-D7jCmjO6.d.cts} +1 -58
- package/dist/{grain-COgYMMHv.d.ts → blending-NgF3qo3d.d.ts} +1 -58
- package/dist/{brushes-B1ABdDAs.d.ts → brushes-CQpL7_Lc.d.ts} +2 -1
- package/dist/{brushes-DnIdJYxN.d.cts → brushes-aEnjqoji.d.cts} +2 -1
- package/dist/canvas/index.d.cts +8 -7
- package/dist/canvas/index.d.ts +8 -7
- package/dist/{chunk-7MN75BXI.cjs → chunk-3QHPFSQM.cjs} +36 -36
- package/dist/{chunk-7MN75BXI.cjs.map → chunk-3QHPFSQM.cjs.map} +1 -1
- package/dist/{chunk-OV7253FC.js → chunk-NI6RORDS.js} +2 -2
- package/dist/{chunk-CM3LJPR3.cjs → chunk-PMEHFHSP.cjs} +82 -82
- package/dist/{chunk-CM3LJPR3.cjs.map → chunk-PMEHFHSP.cjs.map} +1 -1
- package/dist/{chunk-QBARQGSG.js → chunk-QEIN6JQO.js} +2 -2
- package/dist/{chunk-V45ZTW4R.js → chunk-TJBYBSTN.js} +49 -4
- package/dist/chunk-TJBYBSTN.js.map +1 -0
- package/dist/{chunk-SXOTFV3V.cjs → chunk-XFXHA5MU.cjs} +50 -5
- package/dist/chunk-XFXHA5MU.cjs.map +1 -0
- package/dist/effects/index.d.cts +5 -4
- package/dist/effects/index.d.ts +5 -4
- package/dist/{export-BwFRiItd.d.ts → export-0ZaTK__4.d.ts} +5 -5
- package/dist/{export-41rL6Cne.d.ts → export-C45v6MYq.d.ts} +1 -1
- package/dist/{export-DuN3dpCg.d.cts → export-D-7WCDJ9.d.cts} +5 -5
- package/dist/{export-D9mXp05Q.d.cts → export-DSdCfd6O.d.cts} +1 -1
- package/dist/grain-BWmGZxP4.d.cts +58 -0
- package/dist/grain-BWmGZxP4.d.ts +58 -0
- package/dist/{helpers-v6GMazzg.d.cts → helpers-Cavy1TB7.d.cts} +21 -1
- package/dist/{helpers-C-RgeyvH.d.ts → helpers-LZQ4cpg4.d.ts} +21 -1
- package/dist/image-editor/index.cjs +614 -614
- package/dist/image-editor/index.d.cts +12 -11
- package/dist/image-editor/index.d.ts +12 -11
- package/dist/image-editor/index.js +2 -2
- package/dist/{opentype-n99lqxEZ.d.cts → opentype-BpIJhGpj.d.cts} +1 -1
- package/dist/{opentype-T7bkbR2D.d.ts → opentype-CyxDScVz.d.ts} +1 -1
- package/dist/paint/index.d.cts +6 -4
- package/dist/paint/index.d.ts +6 -4
- package/dist/paint-editor/index.cjs +7 -7
- package/dist/paint-editor/index.d.cts +13 -11
- package/dist/paint-editor/index.d.ts +13 -11
- package/dist/paint-editor/index.js +2 -2
- package/dist/{pathfinder-CQlldanv.d.cts → pathfinder-BMQEcS0k.d.cts} +1 -1
- package/dist/{pathfinder-D-V6JLSw.d.ts → pathfinder-CQIxubuP.d.ts} +1 -1
- package/dist/{pool-CZQOrSXZ.d.ts → pool-Cynuj89K.d.ts} +1 -1
- package/dist/{pool-FjZZmZ80.d.cts → pool-DedjxDKo.d.cts} +1 -1
- package/dist/{rand-DJGxSq9d.d.ts → rand-COS4_E1g.d.ts} +1 -1
- package/dist/{rand-D7nfeD1p.d.cts → rand-D1JqpR-p.d.cts} +1 -1
- package/dist/{svg-DPJMUSNt.d.cts → svg-RcixtBFR.d.cts} +2 -2
- package/dist/{svg-CnDCpIy9.d.ts → svg-nWBJEpnk.d.ts} +2 -2
- package/dist/{tools-Ca0kI1qo.d.cts → tools-CL82d7nw.d.cts} +1 -1
- package/dist/{tools-B0wXP5cF.d.ts → tools-DrxgDnXY.d.ts} +1 -1
- package/dist/vector/index.cjs +994 -954
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +44 -18
- package/dist/vector/index.d.ts +44 -18
- package/dist/vector/index.js +54 -14
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.d.cts +5 -4
- package/dist/video-editor/index.d.ts +5 -4
- package/dist/{warp-C7rMWUgW.d.cts → warp-CHi_P_G6.d.cts} +1 -1
- package/dist/{warp-Doasjpyr.d.ts → warp-CPaHULUL.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-vector/SKILL.md +4 -2
- package/dist/chunk-SXOTFV3V.cjs.map +0 -1
- package/dist/chunk-V45ZTW4R.js.map +0 -1
- /package/dist/{chunk-OV7253FC.js.map → chunk-NI6RORDS.js.map} +0 -0
- /package/dist/{chunk-QBARQGSG.js.map → chunk-QEIN6JQO.js.map} +0 -0
|
@@ -363,7 +363,7 @@ var _chunk2OJACTPRcjs = require('../chunk-2OJACTPR.cjs');
|
|
|
363
363
|
|
|
364
364
|
|
|
365
365
|
|
|
366
|
-
var
|
|
366
|
+
var _chunkPMEHFHSPcjs = require('../chunk-PMEHFHSP.cjs');
|
|
367
367
|
|
|
368
368
|
|
|
369
369
|
var _chunk2YQONY6Gcjs = require('../chunk-2YQONY6G.cjs');
|
|
@@ -621,7 +621,7 @@ var _chunkG5NMLUVFcjs = require('../chunk-G5NMLUVF.cjs');
|
|
|
621
621
|
|
|
622
622
|
|
|
623
623
|
|
|
624
|
-
var
|
|
624
|
+
var _chunkXFXHA5MUcjs = require('../chunk-XFXHA5MU.cjs');
|
|
625
625
|
require('../chunk-C46AZEBE.cjs');
|
|
626
626
|
require('../chunk-Q6OUXEK3.cjs');
|
|
627
627
|
require('../chunk-BJTCSLF6.cjs');
|
|
@@ -937,7 +937,7 @@ function quickMaskPixels(mask, style = {}) {
|
|
|
937
937
|
|
|
938
938
|
// src/image-editor/layers/render.ts
|
|
939
939
|
function isQuarterTurn(rotate) {
|
|
940
|
-
return
|
|
940
|
+
return _chunkPMEHFHSPcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
|
|
941
941
|
}
|
|
942
942
|
function isIntegerRect(r) {
|
|
943
943
|
return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
|
|
@@ -945,7 +945,7 @@ function isIntegerRect(r) {
|
|
|
945
945
|
function baseProjection(region, transform, baseW, baseH) {
|
|
946
946
|
return {
|
|
947
947
|
region,
|
|
948
|
-
angle:
|
|
948
|
+
angle: _chunkPMEHFHSPcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
949
949
|
flipH: transform.flipH,
|
|
950
950
|
flipV: transform.flipV,
|
|
951
951
|
scale: 1,
|
|
@@ -954,14 +954,14 @@ function baseProjection(region, transform, baseW, baseH) {
|
|
|
954
954
|
};
|
|
955
955
|
}
|
|
956
956
|
function projectQuarterTurn(src, srcRect, region, transform) {
|
|
957
|
-
const rotated =
|
|
957
|
+
const rotated = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
958
958
|
const w = Math.max(1, Math.round(rotated.width));
|
|
959
959
|
const h = Math.max(1, Math.round(rotated.height));
|
|
960
960
|
const out = new Uint8ClampedArray(w * h * 4);
|
|
961
961
|
const p = baseProjection(region, transform, w, h);
|
|
962
|
-
const o =
|
|
963
|
-
const ox =
|
|
964
|
-
const oy =
|
|
962
|
+
const o = _chunkPMEHFHSPcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
|
|
963
|
+
const ox = _chunkPMEHFHSPcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
|
|
964
|
+
const oy = _chunkPMEHFHSPcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
|
|
965
965
|
const ux = Math.round(ox.x - o.x);
|
|
966
966
|
const vx = Math.round(ox.y - o.y);
|
|
967
967
|
const uy = Math.round(oy.x - o.x);
|
|
@@ -990,23 +990,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
|
|
|
990
990
|
const d = img.data;
|
|
991
991
|
for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
|
|
992
992
|
}
|
|
993
|
-
if (legacyOutputBlur && legacyOutputBlur > 0)
|
|
993
|
+
if (legacyOutputBlur && legacyOutputBlur > 0) _chunkPMEHFHSPcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
|
|
994
994
|
}
|
|
995
995
|
function needsLegacyBase(input) {
|
|
996
996
|
const { stack, region, canvas, transform } = input;
|
|
997
|
-
if (!
|
|
997
|
+
if (!_chunkPMEHFHSPcjs.isLegacyShape.call(void 0, stack)) return false;
|
|
998
998
|
const bg = stack.layers[0];
|
|
999
999
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
|
|
1000
1000
|
if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
|
|
1001
1001
|
if (stack.outputOpacity < 1) return true;
|
|
1002
|
-
const blur =
|
|
1002
|
+
const blur = _chunkPMEHFHSPcjs.blurFilter.call(void 0, bg);
|
|
1003
1003
|
if (blur && blur.enabled && blur.radius > 0) {
|
|
1004
1004
|
const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
|
|
1005
|
-
const angle =
|
|
1005
|
+
const angle = _chunkPMEHFHSPcjs.normalizeAngle.call(void 0, transform.rotate);
|
|
1006
1006
|
if (!full || angle === 90 || angle === 270) return true;
|
|
1007
1007
|
}
|
|
1008
1008
|
if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
|
|
1009
|
-
if (
|
|
1009
|
+
if (_chunkPMEHFHSPcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
|
|
1010
1010
|
return false;
|
|
1011
1011
|
}
|
|
1012
1012
|
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;
|
|
@@ -1038,7 +1038,7 @@ function coveringRect(region) {
|
|
|
1038
1038
|
const y = Math.floor(region.y);
|
|
1039
1039
|
return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
|
|
1040
1040
|
}
|
|
1041
|
-
function renderLayeredBase(stack, region, transform, sources, compositor = new (0,
|
|
1041
|
+
function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)()) {
|
|
1042
1042
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
|
|
1043
1043
|
throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
|
|
1044
1044
|
}
|
|
@@ -1172,8 +1172,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1172
1172
|
* The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
|
|
1173
1173
|
* trust dirty rectangles; exports use `exportCompositor`.
|
|
1174
1174
|
*/
|
|
1175
|
-
__init8() {this.compositor = new (0,
|
|
1176
|
-
__init9() {this.exportCompositor = new (0,
|
|
1175
|
+
__init8() {this.compositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)()}
|
|
1176
|
+
__init9() {this.exportCompositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
|
|
1177
1177
|
/** How the host resolves layer pixels (set by the controller). */
|
|
1178
1178
|
|
|
1179
1179
|
/**
|
|
@@ -1250,9 +1250,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1250
1250
|
return;
|
|
1251
1251
|
}
|
|
1252
1252
|
const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
|
|
1253
|
-
const projection =
|
|
1253
|
+
const projection = _chunkPMEHFHSPcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
|
|
1254
1254
|
const { region } = projection;
|
|
1255
|
-
const rotated =
|
|
1255
|
+
const rotated = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1256
1256
|
const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
|
|
1257
1257
|
let overlay = annotations;
|
|
1258
1258
|
if (route === "legacy") {
|
|
@@ -1262,8 +1262,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1262
1262
|
`${naturalWidth}x${naturalHeight}`,
|
|
1263
1263
|
`${region.x},${region.y},${region.width},${region.height}`,
|
|
1264
1264
|
`${projection.angle},${transform.flipH},${transform.flipV}`,
|
|
1265
|
-
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${
|
|
1266
|
-
|
|
1265
|
+
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
|
|
1266
|
+
_chunkPMEHFHSPcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
|
|
1267
1267
|
`${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}`,
|
|
1268
1268
|
`d${this.displayKey}`
|
|
1269
1269
|
].join("|");
|
|
@@ -1297,7 +1297,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1297
1297
|
}
|
|
1298
1298
|
if (overlay.length > 0 || options.draftAnnotation) {
|
|
1299
1299
|
ctx.save();
|
|
1300
|
-
|
|
1300
|
+
_chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1301
1301
|
ctx.beginPath();
|
|
1302
1302
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1303
1303
|
ctx.clip();
|
|
@@ -1320,7 +1320,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1320
1320
|
if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
|
|
1321
1321
|
ctx.save();
|
|
1322
1322
|
try {
|
|
1323
|
-
|
|
1323
|
+
_chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1324
1324
|
ctx.beginPath();
|
|
1325
1325
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1326
1326
|
ctx.clip();
|
|
@@ -1335,7 +1335,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1335
1335
|
const b = options.brushCursor;
|
|
1336
1336
|
ctx.save();
|
|
1337
1337
|
try {
|
|
1338
|
-
|
|
1338
|
+
_chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1339
1339
|
const px2 = 1 / (projection.scale || 1);
|
|
1340
1340
|
ctx.beginPath();
|
|
1341
1341
|
ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
|
|
@@ -1350,7 +1350,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1350
1350
|
ctx.restore();
|
|
1351
1351
|
}
|
|
1352
1352
|
if (options.cloneSourceMarker) {
|
|
1353
|
-
const m =
|
|
1353
|
+
const m = _chunkPMEHFHSPcjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
|
|
1354
1354
|
ctx.save();
|
|
1355
1355
|
try {
|
|
1356
1356
|
const r = 7;
|
|
@@ -1374,7 +1374,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1374
1374
|
const t = options.textEdit;
|
|
1375
1375
|
ctx.save();
|
|
1376
1376
|
try {
|
|
1377
|
-
const scr = (p) =>
|
|
1377
|
+
const scr = (p) => _chunkPMEHFHSPcjs.projectImagePoint.call(void 0, p, projection);
|
|
1378
1378
|
const poly = (pts) => {
|
|
1379
1379
|
ctx.beginPath();
|
|
1380
1380
|
pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
|
|
@@ -1413,7 +1413,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1413
1413
|
const t = options.freeTransform;
|
|
1414
1414
|
ctx.save();
|
|
1415
1415
|
try {
|
|
1416
|
-
const scr = (p) =>
|
|
1416
|
+
const scr = (p) => _chunkPMEHFHSPcjs.projectImagePoint.call(void 0, p, projection);
|
|
1417
1417
|
ctx.beginPath();
|
|
1418
1418
|
if (t.warp) {
|
|
1419
1419
|
for (const c of t.warp.curves) {
|
|
@@ -1471,7 +1471,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1471
1471
|
}
|
|
1472
1472
|
if (isActivelyCropping) {
|
|
1473
1473
|
const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
|
|
1474
|
-
this.drawCropOverlay(ctx,
|
|
1474
|
+
this.drawCropOverlay(ctx, _chunkPMEHFHSPcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
|
|
1475
1475
|
}
|
|
1476
1476
|
}
|
|
1477
1477
|
/**
|
|
@@ -1480,7 +1480,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1480
1480
|
*/
|
|
1481
1481
|
async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
|
|
1482
1482
|
const { adjustments, depthMask } = state;
|
|
1483
|
-
const rotated =
|
|
1483
|
+
const rotated = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1484
1484
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1485
1485
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1486
1486
|
const baseCanvas = this.createCanvas(baseW, baseH);
|
|
@@ -1488,7 +1488,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1488
1488
|
if (!baseCtx) return baseCanvas;
|
|
1489
1489
|
const projection = getBaseProjection(region, transform, baseW, baseH);
|
|
1490
1490
|
baseCtx.save();
|
|
1491
|
-
|
|
1491
|
+
_chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
|
|
1492
1492
|
baseCtx.drawImage(
|
|
1493
1493
|
img,
|
|
1494
1494
|
region.x,
|
|
@@ -1503,8 +1503,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1503
1503
|
baseCtx.restore();
|
|
1504
1504
|
const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
|
|
1505
1505
|
if (imageData) {
|
|
1506
|
-
const layerMasks =
|
|
1507
|
-
|
|
1506
|
+
const layerMasks = _chunkPMEHFHSPcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
|
|
1507
|
+
_chunkPMEHFHSPcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
|
|
1508
1508
|
if (depthMask.enabled && depthMask.maskSource) {
|
|
1509
1509
|
try {
|
|
1510
1510
|
const maskImg = await this.imageCache.get(depthMask.maskSource);
|
|
@@ -1515,7 +1515,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1515
1515
|
const maskCtx = maskCanvas.getContext("2d");
|
|
1516
1516
|
if (maskCtx) {
|
|
1517
1517
|
maskCtx.save();
|
|
1518
|
-
|
|
1518
|
+
_chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
|
|
1519
1519
|
maskCtx.drawImage(
|
|
1520
1520
|
maskImg,
|
|
1521
1521
|
region.x * sx,
|
|
@@ -1530,7 +1530,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1530
1530
|
maskCtx.restore();
|
|
1531
1531
|
const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
|
|
1532
1532
|
if (maskData) {
|
|
1533
|
-
|
|
1533
|
+
_chunkPMEHFHSPcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
|
|
1534
1534
|
}
|
|
1535
1535
|
}
|
|
1536
1536
|
} catch (e8) {
|
|
@@ -1549,7 +1549,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1549
1549
|
else if (this.baseRoute === "layers") route = "layers";
|
|
1550
1550
|
else {
|
|
1551
1551
|
const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
|
|
1552
|
-
const shaped = this.baseRoute === "legacy" &&
|
|
1552
|
+
const shaped = this.baseRoute === "legacy" && _chunkPMEHFHSPcjs.isLegacyShape.call(void 0, stack);
|
|
1553
1553
|
route = shaped || needsLegacyBase({
|
|
1554
1554
|
stack,
|
|
1555
1555
|
region,
|
|
@@ -1684,17 +1684,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1684
1684
|
if (!comp) return null;
|
|
1685
1685
|
const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
|
|
1686
1686
|
const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
|
|
1687
|
-
const rotated =
|
|
1687
|
+
const rotated = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1688
1688
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1689
1689
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1690
|
-
const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${
|
|
1690
|
+
const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkPMEHFHSPcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
|
|
1691
1691
|
if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
|
|
1692
1692
|
const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
|
|
1693
1693
|
const ctx = canvas.getContext("2d");
|
|
1694
1694
|
if (!ctx) return null;
|
|
1695
1695
|
ctx.clearRect(0, 0, baseW, baseH);
|
|
1696
1696
|
ctx.save();
|
|
1697
|
-
|
|
1697
|
+
_chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
|
|
1698
1698
|
ctx.beginPath();
|
|
1699
1699
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1700
1700
|
ctx.clip();
|
|
@@ -1966,7 +1966,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1966
1966
|
ctx.strokeStyle = "#3b82f6";
|
|
1967
1967
|
ctx.lineWidth = 1.5;
|
|
1968
1968
|
ctx.setLineDash([4, 4]);
|
|
1969
|
-
const bounds =
|
|
1969
|
+
const bounds = _chunkPMEHFHSPcjs.getAnnotationBounds.call(void 0, ann);
|
|
1970
1970
|
const pad = 4;
|
|
1971
1971
|
ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
|
|
1972
1972
|
ctx.fillStyle = "#ffffff";
|
|
@@ -1987,7 +1987,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1987
1987
|
}
|
|
1988
1988
|
/** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
|
|
1989
1989
|
getAnnotationBounds(ann) {
|
|
1990
|
-
return
|
|
1990
|
+
return _chunkPMEHFHSPcjs.getAnnotationBounds.call(void 0, ann);
|
|
1991
1991
|
}
|
|
1992
1992
|
/**
|
|
1993
1993
|
* Draws a rule-of-thirds crop grid overlay. All rectangles come from
|
|
@@ -2069,8 +2069,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2069
2069
|
}
|
|
2070
2070
|
const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
|
|
2071
2071
|
const { crop, transform, annotations } = state;
|
|
2072
|
-
const region = crop ?
|
|
2073
|
-
const rotated =
|
|
2072
|
+
const region = crop ? _chunkPMEHFHSPcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
|
|
2073
|
+
const rotated = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
2074
2074
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
2075
2075
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
2076
2076
|
const exportW = options.width || baseW;
|
|
@@ -2099,7 +2099,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2099
2099
|
const bctx = baseCanvas.getContext("2d");
|
|
2100
2100
|
if (bctx) {
|
|
2101
2101
|
bctx.save();
|
|
2102
|
-
|
|
2102
|
+
_chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
|
|
2103
2103
|
bctx.beginPath();
|
|
2104
2104
|
bctx.rect(region.x, region.y, region.width, region.height);
|
|
2105
2105
|
bctx.clip();
|
|
@@ -2112,7 +2112,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2112
2112
|
if (options.includeAnnotations !== false && overlay.length > 0) {
|
|
2113
2113
|
ctx.save();
|
|
2114
2114
|
ctx.scale(exportW / baseW, exportH / baseH);
|
|
2115
|
-
|
|
2115
|
+
_chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
|
|
2116
2116
|
for (const ann of overlay) {
|
|
2117
2117
|
await this.drawAnnotation(ctx, ann);
|
|
2118
2118
|
}
|
|
@@ -2202,7 +2202,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2202
2202
|
case "rect":
|
|
2203
2203
|
case "image":
|
|
2204
2204
|
case "text": {
|
|
2205
|
-
const b =
|
|
2205
|
+
const b = _chunkPMEHFHSPcjs.getAnnotationBounds.call(void 0, ann);
|
|
2206
2206
|
ctx.fillRect(b.x, b.y, b.width, b.height);
|
|
2207
2207
|
break;
|
|
2208
2208
|
}
|
|
@@ -2222,7 +2222,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
|
|
|
2222
2222
|
function getBaseProjection(region, transform, baseW, baseH) {
|
|
2223
2223
|
return {
|
|
2224
2224
|
region,
|
|
2225
|
-
angle:
|
|
2225
|
+
angle: _chunkPMEHFHSPcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
2226
2226
|
flipH: transform.flipH,
|
|
2227
2227
|
flipV: transform.flipV,
|
|
2228
2228
|
scale: 1,
|
|
@@ -2326,8 +2326,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
2326
2326
|
}
|
|
2327
2327
|
function toMask(width, height, coverage) {
|
|
2328
2328
|
const out = new Uint8Array(coverage.length);
|
|
2329
|
-
for (let i = 0; i < out.length; i++) out[i] =
|
|
2330
|
-
return
|
|
2329
|
+
for (let i = 0; i < out.length; i++) out[i] = _chunkPMEHFHSPcjs.coverageToByte.call(void 0, coverage[i]);
|
|
2330
|
+
return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, width, height, out);
|
|
2331
2331
|
}
|
|
2332
2332
|
function polygonSelection(width, height, points, options = {}) {
|
|
2333
2333
|
return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
|
|
@@ -2454,7 +2454,7 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2454
2454
|
const { width: w, height: h } = pixels;
|
|
2455
2455
|
const sx = Math.floor(seed.x);
|
|
2456
2456
|
const sy = Math.floor(seed.y);
|
|
2457
|
-
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return
|
|
2457
|
+
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, w, h);
|
|
2458
2458
|
const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
|
|
2459
2459
|
const marks = new Uint8Array(n);
|
|
2460
2460
|
let bx0 = w;
|
|
@@ -2502,9 +2502,9 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2502
2502
|
}
|
|
2503
2503
|
}
|
|
2504
2504
|
}
|
|
2505
|
-
if (bx1 < 0) return
|
|
2506
|
-
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return
|
|
2507
|
-
return
|
|
2505
|
+
if (bx1 < 0) return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, w, h);
|
|
2506
|
+
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, w, h, marks);
|
|
2507
|
+
return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0,
|
|
2508
2508
|
w,
|
|
2509
2509
|
h,
|
|
2510
2510
|
antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
|
|
@@ -2526,7 +2526,7 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2526
2526
|
const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
|
|
2527
2527
|
const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
|
|
2528
2528
|
const out = new Uint8Array(n);
|
|
2529
|
-
if (!parsed.length) return
|
|
2529
|
+
if (!parsed.length) return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2530
2530
|
for (let i = 0; i < n; i++) {
|
|
2531
2531
|
const p = i * 4;
|
|
2532
2532
|
if (data[p + 3] <= 0) continue;
|
|
@@ -2542,9 +2542,9 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2542
2542
|
}
|
|
2543
2543
|
if (k > best) best = k;
|
|
2544
2544
|
}
|
|
2545
|
-
out[i] =
|
|
2545
|
+
out[i] = _chunkPMEHFHSPcjs.coverageToByte.call(void 0, best);
|
|
2546
2546
|
}
|
|
2547
|
-
return
|
|
2547
|
+
return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2548
2548
|
}
|
|
2549
2549
|
var TONE_RANGE_PRESETS = {
|
|
2550
2550
|
shadows: [0, 65],
|
|
@@ -2562,9 +2562,9 @@ function toneRange(pixels, range, falloff = 20) {
|
|
|
2562
2562
|
if (d[p + 3] <= 0) continue;
|
|
2563
2563
|
const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
|
|
2564
2564
|
const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
|
|
2565
|
-
out[i] =
|
|
2565
|
+
out[i] = _chunkPMEHFHSPcjs.coverageToByte.call(void 0, 1 - outside / ramp);
|
|
2566
2566
|
}
|
|
2567
|
-
return
|
|
2567
|
+
return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2568
2568
|
}
|
|
2569
2569
|
function hueRange(pixels, center) {
|
|
2570
2570
|
const n = checkPixels(pixels);
|
|
@@ -2587,9 +2587,9 @@ function hueRange(pixels, center) {
|
|
|
2587
2587
|
hue *= 60;
|
|
2588
2588
|
let dh = ((hue - center) % 360 + 360) % 360;
|
|
2589
2589
|
dh = Math.min(dh, 360 - dh);
|
|
2590
|
-
out[i] =
|
|
2590
|
+
out[i] = _chunkPMEHFHSPcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
|
|
2591
2591
|
}
|
|
2592
|
-
return
|
|
2592
|
+
return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2593
2593
|
}
|
|
2594
2594
|
|
|
2595
2595
|
// src/image-editor/selection/refine.ts
|
|
@@ -2723,9 +2723,9 @@ function edgeWidth(guide, w, h, r) {
|
|
|
2723
2723
|
g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
|
|
2724
2724
|
}
|
|
2725
2725
|
}
|
|
2726
|
-
const gm =
|
|
2727
|
-
const hi =
|
|
2728
|
-
const lo =
|
|
2726
|
+
const gm = _chunkPMEHFHSPcjs.greyMorphology.call(void 0, g, w, h, r, true);
|
|
2727
|
+
const hi = _chunkPMEHFHSPcjs.greyMorphology.call(void 0, y, w, h, r, true);
|
|
2728
|
+
const lo = _chunkPMEHFHSPcjs.greyMorphology.call(void 0, y, w, h, r, false);
|
|
2729
2729
|
const out = new Float32Array(n);
|
|
2730
2730
|
for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
|
|
2731
2731
|
return out;
|
|
@@ -2749,7 +2749,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2749
2749
|
}
|
|
2750
2750
|
}
|
|
2751
2751
|
if (any) {
|
|
2752
|
-
const dist =
|
|
2752
|
+
const dist = _chunkPMEHFHSPcjs.distanceTransform.call(void 0, boundary, w, h);
|
|
2753
2753
|
const r = gfRadius(p);
|
|
2754
2754
|
const q = guidedFilterColor(guide, m, w, h, r);
|
|
2755
2755
|
const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
|
|
@@ -2775,7 +2775,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2775
2775
|
for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
|
|
2776
2776
|
}
|
|
2777
2777
|
const amount = shiftAmount(p);
|
|
2778
|
-
if (Math.abs(amount) >= 1e-4) a =
|
|
2778
|
+
if (Math.abs(amount) >= 1e-4) a = _chunkPMEHFHSPcjs.shiftCoverage.call(void 0, a, w, h, amount);
|
|
2779
2779
|
return a;
|
|
2780
2780
|
}
|
|
2781
2781
|
function guidePlanes(pixels, win) {
|
|
@@ -2819,9 +2819,9 @@ function refineSelection(pixels, mask, params = {}) {
|
|
|
2819
2819
|
const out = new Uint8Array(mask.width * mask.height);
|
|
2820
2820
|
for (let y = 0; y < wh; y++) {
|
|
2821
2821
|
const dst = (y0 + y) * mask.width + x0;
|
|
2822
|
-
for (let x = 0; x < ww; x++) out[dst + x] =
|
|
2822
|
+
for (let x = 0; x < ww; x++) out[dst + x] = _chunkPMEHFHSPcjs.coverageToByte.call(void 0, refined[y * ww + x]);
|
|
2823
2823
|
}
|
|
2824
|
-
return
|
|
2824
|
+
return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
|
|
2825
2825
|
}
|
|
2826
2826
|
|
|
2827
2827
|
// src/image-editor/effects.ts
|
|
@@ -2991,7 +2991,7 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
2991
2991
|
// src/image-editor/free-transform.ts
|
|
2992
2992
|
var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
|
|
2993
2993
|
var fail = (message) => {
|
|
2994
|
-
throw new (0,
|
|
2994
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(message);
|
|
2995
2995
|
};
|
|
2996
2996
|
var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
|
|
2997
2997
|
function previewStep(scale) {
|
|
@@ -3100,7 +3100,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3100
3100
|
} else {
|
|
3101
3101
|
const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
|
|
3102
3102
|
if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
|
|
3103
|
-
const layer =
|
|
3103
|
+
const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, layers, id).layer;
|
|
3104
3104
|
this.layerId = layer.id;
|
|
3105
3105
|
const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
|
|
3106
3106
|
const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
|
|
@@ -3111,20 +3111,20 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3111
3111
|
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.`);
|
|
3112
3112
|
if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
|
|
3113
3113
|
if (content !== "selection-copy") {
|
|
3114
|
-
|
|
3115
|
-
if (!maskAlone)
|
|
3114
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
|
|
3115
|
+
if (!maskAlone) _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
|
|
3116
3116
|
}
|
|
3117
3117
|
const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
3118
3118
|
const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
|
|
3119
3119
|
if (layer.type === "smart" && !maskAlone) {
|
|
3120
3120
|
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).`);
|
|
3121
|
-
if (!
|
|
3121
|
+
if (!_chunkPMEHFHSPcjs.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.`);
|
|
3122
3122
|
this.smart = layer;
|
|
3123
3123
|
this.smartObject = true;
|
|
3124
|
-
this.startGeometry =
|
|
3124
|
+
this.startGeometry = _chunkPMEHFHSPcjs.placementGeometry.call(void 0, layer);
|
|
3125
3125
|
if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
|
|
3126
3126
|
this.startInterp = this.interp;
|
|
3127
|
-
this.box =
|
|
3127
|
+
this.box = _chunkPMEHFHSPcjs.contentsBox.call(void 0, layer.contents);
|
|
3128
3128
|
this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
|
|
3129
3129
|
this.geometryValue = this.startGeometry;
|
|
3130
3130
|
this.shown = this.startLayers;
|
|
@@ -3132,8 +3132,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3132
3132
|
}
|
|
3133
3133
|
if (layer.type === "type" && !maskAlone) {
|
|
3134
3134
|
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).`);
|
|
3135
|
-
const frame =
|
|
3136
|
-
const m =
|
|
3135
|
+
const frame = _chunkPMEHFHSPcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
|
|
3136
|
+
const m = _chunkPMEHFHSPcjs.textMatrix.call(void 0, layer);
|
|
3137
3137
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
3138
3138
|
this.typeTarget = layer;
|
|
3139
3139
|
this.typeLayer = true;
|
|
@@ -3152,7 +3152,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3152
3152
|
}
|
|
3153
3153
|
if (layer.type === "shape" && !maskAlone) {
|
|
3154
3154
|
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).`);
|
|
3155
|
-
const g =
|
|
3155
|
+
const g = _chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, layer);
|
|
3156
3156
|
if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
|
|
3157
3157
|
const w = Math.max(g.width, 1);
|
|
3158
3158
|
const h = Math.max(g.height, 1);
|
|
@@ -3200,7 +3200,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3200
3200
|
if (box) {
|
|
3201
3201
|
const copy = {
|
|
3202
3202
|
type: "pixel",
|
|
3203
|
-
id:
|
|
3203
|
+
id: _chunkPMEHFHSPcjs.newLayerId.call(void 0, ),
|
|
3204
3204
|
name: `${layer.name || "Layer"} copy`,
|
|
3205
3205
|
visible: true,
|
|
3206
3206
|
opacity: 1,
|
|
@@ -3224,7 +3224,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3224
3224
|
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).");
|
|
3225
3225
|
this.box = box;
|
|
3226
3226
|
this.moves = moves;
|
|
3227
|
-
this.startGeometry =
|
|
3227
|
+
this.startGeometry = _chunkPMEHFHSPcjs.identityTransform.call(void 0, box);
|
|
3228
3228
|
this.startInterp = this.interp;
|
|
3229
3229
|
this.geometryValue = this.startGeometry;
|
|
3230
3230
|
this.shown = this.startLayers;
|
|
@@ -3302,8 +3302,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3302
3302
|
warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
|
|
3303
3303
|
};
|
|
3304
3304
|
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.");
|
|
3305
|
-
if (!
|
|
3306
|
-
if (this.typeTarget && (
|
|
3305
|
+
if (!_chunkPMEHFHSPcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
|
|
3306
|
+
if (this.typeTarget && (_chunkPMEHFHSPcjs.hasWarp.call(void 0, next) || !_chunkPMEHFHSPcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
|
|
3307
3307
|
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.");
|
|
3308
3308
|
}
|
|
3309
3309
|
this.geometryValue = next;
|
|
@@ -3315,10 +3315,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3315
3315
|
if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
|
|
3316
3316
|
if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
|
|
3317
3317
|
const g = this.geometryValue;
|
|
3318
|
-
const identity =
|
|
3319
|
-
const warp =
|
|
3320
|
-
const h = warp ? null :
|
|
3321
|
-
const f = warp ?
|
|
3318
|
+
const identity = _chunkPMEHFHSPcjs.isIdentityTransform.call(void 0, g);
|
|
3319
|
+
const warp = _chunkPMEHFHSPcjs.hasWarp.call(void 0, g);
|
|
3320
|
+
const h = warp ? null : _chunkPMEHFHSPcjs.geometryHomography.call(void 0, g);
|
|
3321
|
+
const f = warp ? _chunkPMEHFHSPcjs.transformMap.call(void 0, g) : null;
|
|
3322
3322
|
const step = final ? 1 : previewStep(preview.scale);
|
|
3323
3323
|
const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
|
|
3324
3324
|
let layers = this.startLayers;
|
|
@@ -3362,7 +3362,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3362
3362
|
if (part.what === "selection") {
|
|
3363
3363
|
const { width, height } = this.host.canvas();
|
|
3364
3364
|
const data = new Uint8Array(_chunkO7LUD7MHcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
|
|
3365
|
-
const next =
|
|
3365
|
+
const next = _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, width, height, data);
|
|
3366
3366
|
selection = next.bounds ? next : null;
|
|
3367
3367
|
} else if (part.what === "pixels") {
|
|
3368
3368
|
layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, targetId, (l) => {
|
|
@@ -3384,14 +3384,14 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3384
3384
|
resampleShape(final, preview, warpMap, h) {
|
|
3385
3385
|
const layer = this.shape;
|
|
3386
3386
|
let components = layer.components;
|
|
3387
|
-
if (!
|
|
3387
|
+
if (!_chunkPMEHFHSPcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
|
|
3388
3388
|
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;
|
|
3389
3389
|
const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p)));
|
|
3390
|
-
components =
|
|
3390
|
+
components = _chunkPMEHFHSPcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
|
|
3391
3391
|
}
|
|
3392
3392
|
const moved = { ...layer, components };
|
|
3393
3393
|
delete moved.annotation;
|
|
3394
|
-
const surface =
|
|
3394
|
+
const surface = _chunkPMEHFHSPcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
|
|
3395
3395
|
return _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
|
|
3396
3396
|
}
|
|
3397
3397
|
/**
|
|
@@ -3401,13 +3401,13 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3401
3401
|
resampleType() {
|
|
3402
3402
|
const layer = this.typeTarget;
|
|
3403
3403
|
const g = this.geometryValue;
|
|
3404
|
-
if (
|
|
3405
|
-
const m =
|
|
3404
|
+
if (_chunkPMEHFHSPcjs.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.");
|
|
3405
|
+
const m = _chunkPMEHFHSPcjs.matrixFromCorners.call(void 0, g.box, g.corners);
|
|
3406
3406
|
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.");
|
|
3407
3407
|
const next = { ...layer, transform: m };
|
|
3408
3408
|
delete next.annotation;
|
|
3409
|
-
let layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.startLayers, layer.id, () =>
|
|
3410
|
-
const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0,
|
|
3409
|
+
let layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkPMEHFHSPcjs.rerenderText.call(void 0, next, this.host.textEnv()));
|
|
3410
|
+
const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkXFXHA5MUcjs.invertMatrix.call(void 0, _chunkPMEHFHSPcjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
|
|
3411
3411
|
for (const part of this.parts) {
|
|
3412
3412
|
if (part.what !== "mask") continue;
|
|
3413
3413
|
const surface = _chunkAEAAN4ADcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
|
|
@@ -3423,12 +3423,12 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3423
3423
|
const canvas = this.host.canvas();
|
|
3424
3424
|
try {
|
|
3425
3425
|
if (final) {
|
|
3426
|
-
const res =
|
|
3426
|
+
const res = _chunkPMEHFHSPcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
|
|
3427
3427
|
this.smartMasksMoved = res.masksMoved;
|
|
3428
3428
|
return res.layers;
|
|
3429
3429
|
}
|
|
3430
3430
|
const step = previewStep(preview.scale);
|
|
3431
|
-
const surface =
|
|
3431
|
+
const surface = _chunkPMEHFHSPcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
|
|
3432
3432
|
return _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
|
|
3433
3433
|
} catch (e) {
|
|
3434
3434
|
if (e instanceof _chunkAEAAN4ADcjs.TransformTooLargeError) fail(e.message);
|
|
@@ -3438,10 +3438,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3438
3438
|
/** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
|
|
3439
3439
|
isChanged() {
|
|
3440
3440
|
const g = this.geometryValue;
|
|
3441
|
-
if (!this.smart && !this.typeTarget) return !
|
|
3441
|
+
if (!this.smart && !this.typeTarget) return !_chunkPMEHFHSPcjs.isIdentityTransform.call(void 0, g);
|
|
3442
3442
|
const a = this.startGeometry;
|
|
3443
3443
|
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);
|
|
3444
|
-
const warp = (w, box) => w &&
|
|
3444
|
+
const warp = (w, box) => w && _chunkPMEHFHSPcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
|
|
3445
3445
|
return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
|
|
3446
3446
|
}
|
|
3447
3447
|
render(preview) {
|
|
@@ -3701,7 +3701,7 @@ function convertSurfaceColors(surface, t) {
|
|
|
3701
3701
|
}
|
|
3702
3702
|
|
|
3703
3703
|
// src/image-editor/controller.ts
|
|
3704
|
-
var IMAGE_EDITOR_SCHEMA_VERSION =
|
|
3704
|
+
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION;
|
|
3705
3705
|
var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge", "blur", "sharpen", "history"];
|
|
3706
3706
|
var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
|
|
3707
3707
|
var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
|
|
@@ -3895,7 +3895,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3895
3895
|
for (const t of _chunkO7LUD7MHcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
|
|
3896
3896
|
const key = _chunkO7LUD7MHcjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3897
3897
|
const cur = regions.get(key);
|
|
3898
|
-
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ?
|
|
3898
|
+
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkPMEHFHSPcjs.unionRect.call(void 0, cur.r, r) : r });
|
|
3899
3899
|
}
|
|
3900
3900
|
}
|
|
3901
3901
|
for (const [key, { tx, ty, r }] of regions) {
|
|
@@ -3927,7 +3927,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3927
3927
|
}
|
|
3928
3928
|
/** Finishes the stroke (one undo step) and returns what changed. */
|
|
3929
3929
|
end() {
|
|
3930
|
-
if (this.closed) throw new (0,
|
|
3930
|
+
if (this.closed) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("This stroke has already ended.");
|
|
3931
3931
|
const last = _nullishCoalesce(this.last, () => ( void 0));
|
|
3932
3932
|
const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
|
|
3933
3933
|
_optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
|
|
@@ -4063,20 +4063,20 @@ function sameTile(a, b) {
|
|
|
4063
4063
|
for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
|
|
4064
4064
|
return true;
|
|
4065
4065
|
}
|
|
4066
|
-
var DEFAULT_ADJUSTMENTS =
|
|
4066
|
+
var DEFAULT_ADJUSTMENTS = _chunkPMEHFHSPcjs.DEFAULT_ADJUSTMENTS_VALUES;
|
|
4067
4067
|
function normalizeStoredAdjustments(stored) {
|
|
4068
4068
|
if (!stored) return { ...DEFAULT_ADJUSTMENTS };
|
|
4069
4069
|
const out = {
|
|
4070
4070
|
...DEFAULT_ADJUSTMENTS,
|
|
4071
4071
|
...stored,
|
|
4072
|
-
process:
|
|
4072
|
+
process: _chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, stored.process)
|
|
4073
4073
|
};
|
|
4074
|
-
const layers =
|
|
4074
|
+
const layers = _chunkPMEHFHSPcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
|
|
4075
4075
|
if (layers.length) out.layers = layers;
|
|
4076
4076
|
else delete out.layers;
|
|
4077
4077
|
return out;
|
|
4078
4078
|
}
|
|
4079
|
-
var isLayered = (data) => Boolean(data && data.version ===
|
|
4079
|
+
var isLayered = (data) => Boolean(data && data.version === _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
|
|
4080
4080
|
function migrateSerializedImageEditorState(data) {
|
|
4081
4081
|
if (isLayered(data)) {
|
|
4082
4082
|
const out = {
|
|
@@ -4108,10 +4108,10 @@ function migrateSerializedImageEditorState(data) {
|
|
|
4108
4108
|
function migrateToLayeredState(data, size) {
|
|
4109
4109
|
const clean = migrateSerializedImageEditorState(data);
|
|
4110
4110
|
if (isLayered(clean)) return clean;
|
|
4111
|
-
const stack =
|
|
4112
|
-
const { layers, assets } =
|
|
4111
|
+
const stack = _chunkPMEHFHSPcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
|
|
4112
|
+
const { layers, assets } = _chunkPMEHFHSPcjs.serializeLayers.call(void 0, stack.layers);
|
|
4113
4113
|
const out = {
|
|
4114
|
-
version:
|
|
4114
|
+
version: _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION,
|
|
4115
4115
|
width: Math.round(size.width),
|
|
4116
4116
|
height: Math.round(size.height),
|
|
4117
4117
|
layers,
|
|
@@ -4125,8 +4125,8 @@ function migrateToLayeredState(data, size) {
|
|
|
4125
4125
|
if (clean.selection) out.selection = clean.selection;
|
|
4126
4126
|
return out;
|
|
4127
4127
|
}
|
|
4128
|
-
var DEFAULT_TRANSFORM =
|
|
4129
|
-
var DEFAULT_DEPTH_MASK =
|
|
4128
|
+
var DEFAULT_TRANSFORM = _chunkPMEHFHSPcjs.DEFAULT_TRANSFORM_VALUES;
|
|
4129
|
+
var DEFAULT_DEPTH_MASK = _chunkPMEHFHSPcjs.DEFAULT_DEPTH_MASK_VALUES;
|
|
4130
4130
|
var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
|
|
4131
4131
|
var ImageEditorController = (_class7 = class {
|
|
4132
4132
|
|
|
@@ -4149,7 +4149,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4149
4149
|
__init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
|
|
4150
4150
|
__init63() {this.viewKey = []}
|
|
4151
4151
|
/** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
|
|
4152
|
-
__init64() {this.compositor = new (0,
|
|
4152
|
+
__init64() {this.compositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)()}
|
|
4153
4153
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
4154
4154
|
__init65() {this.effects = new (0, _chunkJODTP4DPcjs.EffectsSlot)()}
|
|
4155
4155
|
/** Renders provider effects: effect smart filter results and effect layers. */
|
|
@@ -4207,7 +4207,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4207
4207
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
4208
4208
|
if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
|
|
4209
4209
|
try {
|
|
4210
|
-
this.state.selection = normalizeSelection(
|
|
4210
|
+
this.state.selection = normalizeSelection(_chunkPMEHFHSPcjs.deserializeSelection.call(void 0, options.initialState.selection));
|
|
4211
4211
|
} catch (e15) {
|
|
4212
4212
|
}
|
|
4213
4213
|
}
|
|
@@ -4319,10 +4319,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
4319
4319
|
if (l.type === "group") {
|
|
4320
4320
|
const children = walk(l.children);
|
|
4321
4321
|
if (children !== l.children) next2 = { ...l, children };
|
|
4322
|
-
} else if (l.type === "smart" && _optionalChain([l, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters, 'access', _132 => _132.some, 'call', _133 => _133((f) => f.kind === "effect")]) && (all ||
|
|
4322
|
+
} else if (l.type === "smart" && _optionalChain([l, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters, 'access', _132 => _132.some, 'call', _133 => _133((f) => f.kind === "effect")]) && (all || _chunkPMEHFHSPcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
|
|
4323
4323
|
try {
|
|
4324
|
-
const r =
|
|
4325
|
-
if (all || !
|
|
4324
|
+
const r = _chunkPMEHFHSPcjs.rerender.call(void 0, l, canvas);
|
|
4325
|
+
if (all || !_chunkPMEHFHSPcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
|
|
4326
4326
|
} catch (e17) {
|
|
4327
4327
|
}
|
|
4328
4328
|
}
|
|
@@ -4378,19 +4378,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4378
4378
|
const d = await this.describeEffect(effect, "filter");
|
|
4379
4379
|
const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4380
4380
|
const found = _chunkAEAAN4ADcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4381
|
-
if (!found) throw new (0,
|
|
4381
|
+
if (!found) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
|
|
4382
4382
|
let layers = this.state.layers;
|
|
4383
4383
|
let id = layerId;
|
|
4384
4384
|
let converted = false;
|
|
4385
4385
|
if (found.layer.type !== "smart") {
|
|
4386
|
-
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0,
|
|
4387
|
-
const res2 =
|
|
4386
|
+
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
|
|
4387
|
+
const res2 = _chunkPMEHFHSPcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
|
|
4388
4388
|
layers = res2.layers;
|
|
4389
4389
|
id = res2.layer.id;
|
|
4390
4390
|
converted = true;
|
|
4391
4391
|
}
|
|
4392
|
-
const filter =
|
|
4393
|
-
const res =
|
|
4392
|
+
const filter = _chunkPMEHFHSPcjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
|
|
4393
|
+
const res = _chunkPMEHFHSPcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
|
|
4394
4394
|
this.commitLayers(res.layers);
|
|
4395
4395
|
return { layerId: id, filter: res.filter, converted };
|
|
4396
4396
|
}
|
|
@@ -4401,9 +4401,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4401
4401
|
* false, during a drag).
|
|
4402
4402
|
*/
|
|
4403
4403
|
async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
|
|
4404
|
-
const layer =
|
|
4404
|
+
const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
|
|
4405
4405
|
const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
|
|
4406
|
-
if (!was || was.kind !== "effect") throw new (0,
|
|
4406
|
+
if (!was || was.kind !== "effect") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _138 => _138.smartFilters, 'optionalAccess', _139 => _139.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
|
|
4407
4407
|
const update = {};
|
|
4408
4408
|
if (changes.values) {
|
|
4409
4409
|
const d = await this.describeEffect(was.effect);
|
|
@@ -4412,15 +4412,15 @@ var ImageEditorController = (_class7 = class {
|
|
|
4412
4412
|
for (const [k, v] of Object.entries(changes.values)) {
|
|
4413
4413
|
if (v !== null) given[k] = v;
|
|
4414
4414
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4415
|
-
else throw new (0,
|
|
4415
|
+
else throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4416
4416
|
}
|
|
4417
4417
|
update.values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4418
4418
|
}
|
|
4419
4419
|
for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
|
|
4420
|
-
let res =
|
|
4421
|
-
if (changes.index !== void 0) res = { ...res, layers:
|
|
4420
|
+
let res = _chunkPMEHFHSPcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
|
|
4421
|
+
if (changes.index !== void 0) res = { ...res, layers: _chunkPMEHFHSPcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
|
|
4422
4422
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4423
|
-
return
|
|
4423
|
+
return _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
|
|
4424
4424
|
}
|
|
4425
4425
|
/**
|
|
4426
4426
|
* Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
|
|
@@ -4432,12 +4432,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4432
4432
|
const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4433
4433
|
const { width, height } = this.naturalSize;
|
|
4434
4434
|
const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
|
|
4435
|
-
const blend =
|
|
4436
|
-
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0,
|
|
4435
|
+
const blend = _chunkPMEHFHSPcjs.parseBlend.call(void 0, options.blend);
|
|
4436
|
+
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4437
4437
|
const ids = new Set(_chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4438
4438
|
const layer = {
|
|
4439
4439
|
type: "pixel",
|
|
4440
|
-
id: options.id && !ids.has(options.id) ? options.id :
|
|
4440
|
+
id: options.id && !ids.has(options.id) ? options.id : _chunkPMEHFHSPcjs.newLayerId.call(void 0, ),
|
|
4441
4441
|
name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
|
|
4442
4442
|
visible: true,
|
|
4443
4443
|
opacity: _nullishCoalesce(options.opacity, () => ( 1)),
|
|
@@ -4446,7 +4446,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4446
4446
|
offset: { x: 0, y: 0 },
|
|
4447
4447
|
generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
|
|
4448
4448
|
};
|
|
4449
|
-
const next =
|
|
4449
|
+
const next = _chunkPMEHFHSPcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
|
|
4450
4450
|
this.commitLayers(next, () => {
|
|
4451
4451
|
this.state.activeLayerId = layer.id;
|
|
4452
4452
|
this.state.activeTarget = "pixels";
|
|
@@ -4461,8 +4461,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
4461
4461
|
async updateEffectLayer(layerId, changes, commitToHistory = true) {
|
|
4462
4462
|
const found = _chunkAEAAN4ADcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4463
4463
|
const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
|
|
4464
|
-
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0,
|
|
4465
|
-
|
|
4464
|
+
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
|
|
4465
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
|
|
4466
4466
|
const g = layer.generator;
|
|
4467
4467
|
const d = await this.describeEffect(g.effect);
|
|
4468
4468
|
const base = { ...g.values };
|
|
@@ -4470,7 +4470,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4470
4470
|
for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
|
|
4471
4471
|
if (v !== null) given[k] = v;
|
|
4472
4472
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4473
|
-
else throw new (0,
|
|
4473
|
+
else throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4474
4474
|
}
|
|
4475
4475
|
const values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4476
4476
|
const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
|
|
@@ -4485,7 +4485,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4485
4485
|
/** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
|
|
4486
4486
|
rasterizeEffectLayer(layerId) {
|
|
4487
4487
|
const found = _chunkAEAAN4ADcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4488
|
-
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0,
|
|
4488
|
+
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
|
|
4489
4489
|
this.commitLayers(
|
|
4490
4490
|
_chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
|
|
4491
4491
|
const { generator: _g, ...rest } = l;
|
|
@@ -4513,7 +4513,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4513
4513
|
if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
|
|
4514
4514
|
this.viewKey = key;
|
|
4515
4515
|
const { width, height } = this.naturalSize;
|
|
4516
|
-
const view =
|
|
4516
|
+
const view = _chunkPMEHFHSPcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
|
|
4517
4517
|
s.adjustments = view.adjustments;
|
|
4518
4518
|
s.depthMask = view.depthMask;
|
|
4519
4519
|
s.annotations = view.annotations;
|
|
@@ -4667,7 +4667,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4667
4667
|
applyCropPreset(ratio) {
|
|
4668
4668
|
this.recordHistory();
|
|
4669
4669
|
const { width, height } = this.state.imageDimensions;
|
|
4670
|
-
if (ratio &&
|
|
4670
|
+
if (ratio && _chunkPMEHFHSPcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
|
|
4671
4671
|
ratio = 1 / ratio;
|
|
4672
4672
|
}
|
|
4673
4673
|
if (!ratio) {
|
|
@@ -4749,7 +4749,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4749
4749
|
*/
|
|
4750
4750
|
getLayerPixels(id) {
|
|
4751
4751
|
const layer = this.getLayer(id);
|
|
4752
|
-
if (!layer || !
|
|
4752
|
+
if (!layer || !_chunkPMEHFHSPcjs.hasSurface.call(void 0, layer)) return null;
|
|
4753
4753
|
const surface = this.surfaceOf(layer);
|
|
4754
4754
|
const b = _chunkO7LUD7MHcjs.contentBounds.call(void 0, surface);
|
|
4755
4755
|
if (!b) return null;
|
|
@@ -4762,7 +4762,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4762
4762
|
*/
|
|
4763
4763
|
getLayerBounds(id) {
|
|
4764
4764
|
const layer = this.getLayer(id);
|
|
4765
|
-
if (!layer || !
|
|
4765
|
+
if (!layer || !_chunkPMEHFHSPcjs.hasSurface.call(void 0, layer)) return null;
|
|
4766
4766
|
const surface = this.surfaceOf(layer);
|
|
4767
4767
|
let b = this.boundsCache.get(surface);
|
|
4768
4768
|
if (b === void 0) {
|
|
@@ -4777,9 +4777,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4777
4777
|
*/
|
|
4778
4778
|
getLayerDataURL(id) {
|
|
4779
4779
|
const layer = this.getLayer(id);
|
|
4780
|
-
if (!layer || !
|
|
4780
|
+
if (!layer || !_chunkPMEHFHSPcjs.hasSurface.call(void 0, layer)) return null;
|
|
4781
4781
|
const surface = this.surfaceOf(layer);
|
|
4782
|
-
const enc =
|
|
4782
|
+
const enc = _chunkPMEHFHSPcjs.encodeSurface.call(void 0, surface);
|
|
4783
4783
|
return enc ? enc.url : null;
|
|
4784
4784
|
}
|
|
4785
4785
|
/**
|
|
@@ -4921,19 +4921,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4921
4921
|
if (init.pixels) {
|
|
4922
4922
|
const px2 = init.pixels;
|
|
4923
4923
|
if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
|
|
4924
|
-
throw new (0,
|
|
4924
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
|
|
4925
4925
|
}
|
|
4926
4926
|
surface = _chunkO7LUD7MHcjs.surfaceFromPixels.call(void 0, px2, 4);
|
|
4927
4927
|
} else if (init.color !== void 0) {
|
|
4928
4928
|
const c = parseColor(init.color);
|
|
4929
4929
|
surface = _chunkO7LUD7MHcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkO7LUD7MHcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
|
|
4930
4930
|
}
|
|
4931
|
-
const blend =
|
|
4932
|
-
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
4931
|
+
const blend = _chunkPMEHFHSPcjs.parseBlend.call(void 0, init.blend);
|
|
4932
|
+
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4933
4933
|
const ids = new Set(_chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4934
4934
|
const layer = {
|
|
4935
4935
|
type: "pixel",
|
|
4936
|
-
id: init.id && !ids.has(init.id) ? init.id :
|
|
4936
|
+
id: init.id && !ids.has(init.id) ? init.id : _chunkPMEHFHSPcjs.newLayerId.call(void 0, ),
|
|
4937
4937
|
name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
|
|
4938
4938
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
4939
4939
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
@@ -4942,7 +4942,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4942
4942
|
offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
|
|
4943
4943
|
};
|
|
4944
4944
|
if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
|
|
4945
|
-
const next =
|
|
4945
|
+
const next = _chunkPMEHFHSPcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
4946
4946
|
this.commitLayers(next, () => {
|
|
4947
4947
|
this.state.activeLayerId = layer.id;
|
|
4948
4948
|
this.state.activeTarget = "pixels";
|
|
@@ -4982,12 +4982,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4982
4982
|
try {
|
|
4983
4983
|
img = await this.renderer.imageCache.get(src);
|
|
4984
4984
|
} catch (e22) {
|
|
4985
|
-
throw new (0,
|
|
4985
|
+
throw new (0, _chunkPMEHFHSPcjs.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.");
|
|
4986
4986
|
}
|
|
4987
4987
|
const w = img.naturalWidth || img.width;
|
|
4988
4988
|
const h = img.naturalHeight || img.height;
|
|
4989
4989
|
const ctx = this.renderer.createCanvas(w, h).getContext("2d");
|
|
4990
|
-
if (!ctx || typeof ctx.getImageData !== "function") throw new (0,
|
|
4990
|
+
if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
|
|
4991
4991
|
ctx.drawImage(img, 0, 0, w, h);
|
|
4992
4992
|
const data = ctx.getImageData(0, 0, w, h);
|
|
4993
4993
|
return { width: w, height: h, data: data.data };
|
|
@@ -5000,7 +5000,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5000
5000
|
}
|
|
5001
5001
|
/** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
|
|
5002
5002
|
duplicateLayer(id, name) {
|
|
5003
|
-
const res =
|
|
5003
|
+
const res = _chunkPMEHFHSPcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
|
|
5004
5004
|
this.commitLayers(res.layers, () => {
|
|
5005
5005
|
this.state.activeLayerId = res.id;
|
|
5006
5006
|
});
|
|
@@ -5008,16 +5008,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5008
5008
|
}
|
|
5009
5009
|
/** Deletes a layer (refused when locked), as one undo step. */
|
|
5010
5010
|
removeLayer(id) {
|
|
5011
|
-
const next =
|
|
5011
|
+
const next = _chunkPMEHFHSPcjs.removeLayer.call(void 0, this.state.layers, id);
|
|
5012
5012
|
this.commitLayers(next, () => {
|
|
5013
|
-
if (this.state.selectedAnnotationId && !_chunkAEAAN4ADcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([
|
|
5013
|
+
if (this.state.selectedAnnotationId && !_chunkAEAAN4ADcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkPMEHFHSPcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
|
|
5014
5014
|
this.state.selectedAnnotationId = null;
|
|
5015
5015
|
}
|
|
5016
5016
|
});
|
|
5017
5017
|
}
|
|
5018
5018
|
/** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
|
|
5019
5019
|
moveLayer(id, placement) {
|
|
5020
|
-
const next =
|
|
5020
|
+
const next = _chunkPMEHFHSPcjs.moveLayer.call(void 0, this.state.layers, id, placement);
|
|
5021
5021
|
const loc = _chunkAEAAN4ADcjs.findLayer.call(void 0, next, id);
|
|
5022
5022
|
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
|
|
5023
5023
|
this.commitLayers(next);
|
|
@@ -5028,23 +5028,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
5028
5028
|
* one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
|
|
5029
5029
|
*/
|
|
5030
5030
|
setLayerProperties(id, props, commitToHistory = true) {
|
|
5031
|
-
const next =
|
|
5031
|
+
const next = _chunkPMEHFHSPcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
|
|
5032
5032
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5033
5033
|
return _chunkAEAAN4ADcjs.findLayer.call(void 0, next, id).layer;
|
|
5034
5034
|
}
|
|
5035
5035
|
/** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
|
|
5036
5036
|
addGroup(init = {}) {
|
|
5037
|
-
const blend = init.blend === void 0 ? "pass-through" :
|
|
5037
|
+
const blend = init.blend === void 0 ? "pass-through" : _chunkPMEHFHSPcjs.parseBlend.call(void 0, init.blend, true);
|
|
5038
5038
|
const group = {
|
|
5039
5039
|
type: "group",
|
|
5040
|
-
id:
|
|
5040
|
+
id: _chunkPMEHFHSPcjs.newLayerId.call(void 0, "group"),
|
|
5041
5041
|
name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
|
|
5042
5042
|
visible: true,
|
|
5043
5043
|
opacity: 1,
|
|
5044
5044
|
blend,
|
|
5045
5045
|
children: []
|
|
5046
5046
|
};
|
|
5047
|
-
const next =
|
|
5047
|
+
const next = _chunkPMEHFHSPcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
|
|
5048
5048
|
this.commitLayers(next, () => {
|
|
5049
5049
|
this.state.activeLayerId = group.id;
|
|
5050
5050
|
this.state.activeTarget = "pixels";
|
|
@@ -5053,7 +5053,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5053
5053
|
}
|
|
5054
5054
|
/** Puts sibling layers into a new group (one undo step). Returns the group id. */
|
|
5055
5055
|
groupLayers(ids, name) {
|
|
5056
|
-
const res =
|
|
5056
|
+
const res = _chunkPMEHFHSPcjs.groupLayers.call(void 0, this.state.layers, ids, name);
|
|
5057
5057
|
this.commitLayers(res.layers, () => {
|
|
5058
5058
|
this.state.activeLayerId = res.id;
|
|
5059
5059
|
});
|
|
@@ -5061,7 +5061,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5061
5061
|
}
|
|
5062
5062
|
/** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
|
|
5063
5063
|
ungroupLayer(id) {
|
|
5064
|
-
const res =
|
|
5064
|
+
const res = _chunkPMEHFHSPcjs.ungroupLayer.call(void 0, this.state.layers, id);
|
|
5065
5065
|
this.commitLayers(res.layers);
|
|
5066
5066
|
return res.ids;
|
|
5067
5067
|
}
|
|
@@ -5070,38 +5070,38 @@ var ImageEditorController = (_class7 = class {
|
|
|
5070
5070
|
* (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
|
|
5071
5071
|
*/
|
|
5072
5072
|
offsetLayer(id, move, commitToHistory = true) {
|
|
5073
|
-
const layer =
|
|
5073
|
+
const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5074
5074
|
if (layer.type === "smart") {
|
|
5075
5075
|
const tl = layer.placement.corners[0];
|
|
5076
5076
|
const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5077
5077
|
const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5078
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5079
|
-
this.commitLayers(
|
|
5078
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("x and y must be numbers.");
|
|
5079
|
+
this.commitLayers(_chunkPMEHFHSPcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
|
|
5080
5080
|
const moved = _chunkAEAAN4ADcjs.findLayer.call(void 0, this.state.layers, id).layer;
|
|
5081
5081
|
return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
|
|
5082
5082
|
}
|
|
5083
5083
|
if (layer.type === "shape") {
|
|
5084
|
-
const g = _nullishCoalesce(
|
|
5084
|
+
const g = _nullishCoalesce(_chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
|
|
5085
5085
|
const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5086
5086
|
const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5087
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5088
|
-
|
|
5089
|
-
let moved =
|
|
5087
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("x and y must be numbers.");
|
|
5088
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5089
|
+
let moved = _chunkPMEHFHSPcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
|
|
5090
5090
|
const mask = layer.mask;
|
|
5091
5091
|
if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkO7LUD7MHcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
|
|
5092
5092
|
this.commitLayers(_chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
5093
|
-
const b = _nullishCoalesce(
|
|
5093
|
+
const b = _nullishCoalesce(_chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
|
|
5094
5094
|
return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
|
|
5095
5095
|
}
|
|
5096
5096
|
if (layer.type === "type") {
|
|
5097
5097
|
const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
|
|
5098
5098
|
const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
|
|
5099
5099
|
const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
|
|
5100
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5101
|
-
|
|
5100
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("x and y must be numbers.");
|
|
5101
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5102
5102
|
const mx = Math.round(dx);
|
|
5103
5103
|
const my = Math.round(dy);
|
|
5104
|
-
let moved = { ...
|
|
5104
|
+
let moved = { ..._chunkPMEHFHSPcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkO7LUD7MHcjs.translateSurface.call(void 0, layer.surface, mx, my) };
|
|
5105
5105
|
const mask = layer.mask;
|
|
5106
5106
|
if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkO7LUD7MHcjs.translateSurface.call(void 0, mask.surface, mx, my) } };
|
|
5107
5107
|
this.commitLayers(_chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
@@ -5111,7 +5111,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5111
5111
|
const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
5112
5112
|
const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
|
|
5113
5113
|
const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
|
|
5114
|
-
const next =
|
|
5114
|
+
const next = _chunkPMEHFHSPcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
|
|
5115
5115
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5116
5116
|
return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
|
|
5117
5117
|
}
|
|
@@ -5121,11 +5121,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5121
5121
|
* target when the layer is active.
|
|
5122
5122
|
*/
|
|
5123
5123
|
addLayerMask(id, from = "reveal-all", props = {}) {
|
|
5124
|
-
const layer =
|
|
5124
|
+
const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5125
5125
|
let mask;
|
|
5126
5126
|
if (from === "selection") {
|
|
5127
5127
|
const sel = this.state.selection;
|
|
5128
|
-
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0,
|
|
5128
|
+
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5129
5129
|
mask = this.maskFromSelection(sel, props);
|
|
5130
5130
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
5131
5131
|
mask = { ...mask, surface: _chunkO7LUD7MHcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
@@ -5134,7 +5134,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5134
5134
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5135
5135
|
mask = withMaskProps({ surface: _chunkO7LUD7MHcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5136
5136
|
}
|
|
5137
|
-
const next =
|
|
5137
|
+
const next = _chunkPMEHFHSPcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
|
|
5138
5138
|
this.commitLayers(next, () => {
|
|
5139
5139
|
if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
|
|
5140
5140
|
});
|
|
@@ -5142,18 +5142,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
5142
5142
|
}
|
|
5143
5143
|
/** Removes a layer's mask (one undo step). */
|
|
5144
5144
|
removeLayerMask(id) {
|
|
5145
|
-
const layer =
|
|
5146
|
-
if (!layer.mask) throw new (0,
|
|
5147
|
-
this.commitLayers(
|
|
5145
|
+
const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5146
|
+
if (!layer.mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5147
|
+
this.commitLayers(_chunkPMEHFHSPcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
|
|
5148
5148
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
5149
5149
|
});
|
|
5150
5150
|
}
|
|
5151
5151
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
5152
5152
|
setLayerMaskProps(id, props, commitToHistory = true) {
|
|
5153
|
-
const layer =
|
|
5154
|
-
if (!layer.mask) throw new (0,
|
|
5153
|
+
const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5154
|
+
if (!layer.mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
5155
5155
|
const mask = withMaskProps(layer.mask, props);
|
|
5156
|
-
this.commitLayers(
|
|
5156
|
+
this.commitLayers(_chunkPMEHFHSPcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
|
|
5157
5157
|
return mask;
|
|
5158
5158
|
}
|
|
5159
5159
|
/**
|
|
@@ -5161,11 +5161,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5161
5161
|
* the depth map) and removes the mask, as one undo step.
|
|
5162
5162
|
*/
|
|
5163
5163
|
async applyLayerMask(id) {
|
|
5164
|
-
const loc =
|
|
5164
|
+
const loc = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5165
5165
|
const layer = loc.layer;
|
|
5166
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5167
|
-
if (!layer.mask) throw new (0,
|
|
5168
|
-
|
|
5166
|
+
if (layer.type !== "pixel") throw new (0, _chunkPMEHFHSPcjs.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.`);
|
|
5167
|
+
if (!layer.mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5168
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
|
|
5169
5169
|
const { width, height } = this.naturalSize;
|
|
5170
5170
|
await this.renderer.prepareLayerAssets([layer], width, height);
|
|
5171
5171
|
const sources = this.renderer.compositorSources(width, height);
|
|
@@ -5198,13 +5198,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
5198
5198
|
*/
|
|
5199
5199
|
layerViaCopy(options = {}) {
|
|
5200
5200
|
const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
|
|
5201
|
-
if (!id) throw new (0,
|
|
5202
|
-
const loc =
|
|
5201
|
+
if (!id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
|
|
5202
|
+
const loc = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5203
5203
|
const layer = loc.layer;
|
|
5204
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5204
|
+
if (layer.type !== "pixel") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
|
|
5205
5205
|
const sel = this.state.selection;
|
|
5206
|
-
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0,
|
|
5207
|
-
if (options.cut)
|
|
5206
|
+
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
|
|
5207
|
+
if (options.cut) _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
|
|
5208
5208
|
const surface = this.surfaceOf(layer);
|
|
5209
5209
|
const sb = sel.bounds;
|
|
5210
5210
|
const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
|
|
@@ -5220,7 +5220,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5220
5220
|
}
|
|
5221
5221
|
const copy = {
|
|
5222
5222
|
type: "pixel",
|
|
5223
|
-
id:
|
|
5223
|
+
id: _chunkPMEHFHSPcjs.newLayerId.call(void 0, ),
|
|
5224
5224
|
name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
5225
5225
|
visible: true,
|
|
5226
5226
|
opacity: 1,
|
|
@@ -5293,7 +5293,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5293
5293
|
* Refused while another transform is open.
|
|
5294
5294
|
*/
|
|
5295
5295
|
beginFreeTransform(init = {}) {
|
|
5296
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5296
|
+
if (this.getFreeTransform()) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
|
|
5297
5297
|
const session = new FreeTransformSession(this.transformHost(), init);
|
|
5298
5298
|
this.openTransform = session;
|
|
5299
5299
|
this.notify();
|
|
@@ -5307,26 +5307,26 @@ var ImageEditorController = (_class7 = class {
|
|
|
5307
5307
|
*/
|
|
5308
5308
|
transformLayer(spec) {
|
|
5309
5309
|
const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
|
|
5310
|
-
if (given > 1) throw new (0,
|
|
5311
|
-
if (!given && spec.warp === void 0) throw new (0,
|
|
5310
|
+
if (given > 1) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give only one of matrix, corners and params.");
|
|
5311
|
+
if (!given && spec.warp === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
|
|
5312
5312
|
if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
|
|
5313
|
-
throw new (0,
|
|
5313
|
+
throw new (0, _chunkPMEHFHSPcjs.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).");
|
|
5314
5314
|
}
|
|
5315
5315
|
if (spec.matrix) {
|
|
5316
5316
|
const [a, b, c, d] = spec.matrix;
|
|
5317
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5317
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5318
5318
|
}
|
|
5319
5319
|
const session = this.beginFreeTransform(spec);
|
|
5320
5320
|
try {
|
|
5321
5321
|
const g = session.startGeometry;
|
|
5322
|
-
const corners = spec.matrix ? g.corners.map((p) =>
|
|
5322
|
+
const corners = spec.matrix ? g.corners.map((p) => _chunkXFXHA5MUcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkPMEHFHSPcjs.applyParams.call(void 0, g, spec.params) : g.corners;
|
|
5323
5323
|
let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
|
|
5324
5324
|
if (spec.warp) {
|
|
5325
5325
|
if ("style" in spec.warp) {
|
|
5326
|
-
if (!
|
|
5327
|
-
warp =
|
|
5326
|
+
if (!_chunkXFXHA5MUcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkXFXHA5MUcjs.WARP_STYLES.join(", ")}.`);
|
|
5327
|
+
warp = _chunkPMEHFHSPcjs.presetWarp.call(void 0, session.box, spec.warp);
|
|
5328
5328
|
} else {
|
|
5329
|
-
if (!
|
|
5329
|
+
if (!_chunkPMEHFHSPcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkPMEHFHSPcjs.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.");
|
|
5330
5330
|
warp = spec.warp;
|
|
5331
5331
|
}
|
|
5332
5332
|
}
|
|
@@ -5339,10 +5339,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5339
5339
|
}
|
|
5340
5340
|
/** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
|
|
5341
5341
|
flipLayer(axis, init = {}) {
|
|
5342
|
-
if (axis !== "horizontal" && axis !== "vertical") throw new (0,
|
|
5342
|
+
if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
|
|
5343
5343
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5344
5344
|
try {
|
|
5345
|
-
session.update({ corners:
|
|
5345
|
+
session.update({ corners: _chunkPMEHFHSPcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
|
|
5346
5346
|
return session.commit();
|
|
5347
5347
|
} catch (e) {
|
|
5348
5348
|
session.cancel();
|
|
@@ -5354,16 +5354,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5354
5354
|
* centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
|
|
5355
5355
|
*/
|
|
5356
5356
|
rotateLayer90(turn, init = {}) {
|
|
5357
|
-
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0,
|
|
5357
|
+
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
|
|
5358
5358
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5359
5359
|
try {
|
|
5360
|
-
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(
|
|
5360
|
+
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkPMEHFHSPcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
|
|
5361
5361
|
const cx = b.x + b.width / 2;
|
|
5362
5362
|
const cy = b.y + b.height / 2;
|
|
5363
5363
|
const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
|
|
5364
5364
|
const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
|
|
5365
5365
|
const m = turn === 90 ? [0, 1, -1, 0, cx + cy + ox, cy - cx + oy] : turn === -90 ? [0, -1, 1, 0, cx - cy + ox, cy + cx + oy] : [-1, 0, 0, -1, 2 * cx, 2 * cy];
|
|
5366
|
-
session.update({ corners: session.startGeometry.corners.map((p) =>
|
|
5366
|
+
session.update({ corners: session.startGeometry.corners.map((p) => _chunkXFXHA5MUcjs.applyMatrix.call(void 0, m, p)) }, false);
|
|
5367
5367
|
return session.commit();
|
|
5368
5368
|
} catch (e) {
|
|
5369
5369
|
session.cancel();
|
|
@@ -5372,20 +5372,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5372
5372
|
}
|
|
5373
5373
|
/** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
|
|
5374
5374
|
addLayerFilter(id, filter) {
|
|
5375
|
-
const f =
|
|
5376
|
-
const next =
|
|
5375
|
+
const f = _chunkPMEHFHSPcjs.normalizeFilter.call(void 0, filter);
|
|
5376
|
+
const next = _chunkPMEHFHSPcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
|
|
5377
5377
|
this.commitLayers(next);
|
|
5378
5378
|
return _nullishCoalesce(_chunkAEAAN4ADcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5379
5379
|
}
|
|
5380
5380
|
/** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
|
|
5381
5381
|
updateLayerFilter(id, filterId, changes, commitToHistory = true) {
|
|
5382
|
-
const next =
|
|
5382
|
+
const next = _chunkPMEHFHSPcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
|
|
5383
5383
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5384
5384
|
return _nullishCoalesce(_chunkAEAAN4ADcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5385
5385
|
}
|
|
5386
5386
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
5387
5387
|
removeLayerFilter(id, filterId) {
|
|
5388
|
-
const next =
|
|
5388
|
+
const next = _chunkPMEHFHSPcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
|
|
5389
5389
|
this.commitLayers(next);
|
|
5390
5390
|
return _nullishCoalesce(_chunkAEAAN4ADcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5391
5391
|
}
|
|
@@ -5401,8 +5401,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5401
5401
|
*/
|
|
5402
5402
|
convertToSmartObject(ids, options = {}) {
|
|
5403
5403
|
const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
|
|
5404
|
-
if (!list.length) throw new (0,
|
|
5405
|
-
const res =
|
|
5404
|
+
if (!list.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
|
|
5405
|
+
const res = _chunkPMEHFHSPcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
|
|
5406
5406
|
this.commitLayers(res.layers, () => {
|
|
5407
5407
|
this.state.activeLayerId = res.layer.id;
|
|
5408
5408
|
this.state.activeTarget = "pixels";
|
|
@@ -5411,7 +5411,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5411
5411
|
}
|
|
5412
5412
|
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
5413
5413
|
rasterizeSmartObject(id) {
|
|
5414
|
-
const res =
|
|
5414
|
+
const res = _chunkPMEHFHSPcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
|
|
5415
5415
|
this.commitLayers(res.layers, () => {
|
|
5416
5416
|
if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
5417
5417
|
});
|
|
@@ -5419,10 +5419,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5419
5419
|
}
|
|
5420
5420
|
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
5421
5421
|
getSmartObject(id) {
|
|
5422
|
-
const layer =
|
|
5422
|
+
const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5423
5423
|
const c = layer.contents;
|
|
5424
|
-
const g =
|
|
5425
|
-
const readout =
|
|
5424
|
+
const g = _chunkPMEHFHSPcjs.placementGeometry.call(void 0, layer);
|
|
5425
|
+
const readout = _chunkPMEHFHSPcjs.describeTransform.call(void 0, g);
|
|
5426
5426
|
const stack = layer.smartFilters;
|
|
5427
5427
|
return {
|
|
5428
5428
|
layerId: layer.id,
|
|
@@ -5432,10 +5432,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5432
5432
|
kind: c.kind,
|
|
5433
5433
|
width: c.width,
|
|
5434
5434
|
height: c.height,
|
|
5435
|
-
decoded:
|
|
5435
|
+
decoded: _chunkPMEHFHSPcjs.isContentsDecoded.call(void 0, c),
|
|
5436
5436
|
fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
|
|
5437
5437
|
linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
|
|
5438
|
-
instances:
|
|
5438
|
+
instances: _chunkPMEHFHSPcjs.instancesOf.call(void 0, this.state.layers, c.id),
|
|
5439
5439
|
layerCount: c.document ? _chunkAEAAN4ADcjs.flattenLayers.call(void 0, c.document.layers).length : 0
|
|
5440
5440
|
},
|
|
5441
5441
|
placement: {
|
|
@@ -5447,8 +5447,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5447
5447
|
scaleY: readout.scaleY,
|
|
5448
5448
|
rotate: readout.rotate,
|
|
5449
5449
|
skewX: readout.skewX,
|
|
5450
|
-
center:
|
|
5451
|
-
bounds:
|
|
5450
|
+
center: _chunkPMEHFHSPcjs.anchorPoint.call(void 0, g, "center"),
|
|
5451
|
+
bounds: _chunkPMEHFHSPcjs.transformedBox.call(void 0, g)
|
|
5452
5452
|
},
|
|
5453
5453
|
smartFilters: {
|
|
5454
5454
|
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
|
|
@@ -5465,7 +5465,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5465
5465
|
* change. Returns the new placement summary.
|
|
5466
5466
|
*/
|
|
5467
5467
|
setSmartObjectPlacement(id, placement, commitToHistory = true) {
|
|
5468
|
-
const res =
|
|
5468
|
+
const res = _chunkPMEHFHSPcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
|
|
5469
5469
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5470
5470
|
return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
|
|
5471
5471
|
}
|
|
@@ -5478,23 +5478,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
5478
5478
|
* nothing is relative to the current transform.
|
|
5479
5479
|
*/
|
|
5480
5480
|
setSmartObjectTransform(id, spec) {
|
|
5481
|
-
const layer =
|
|
5482
|
-
const g =
|
|
5481
|
+
const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5482
|
+
const g = _chunkPMEHFHSPcjs.placementGeometry.call(void 0, layer);
|
|
5483
5483
|
const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
|
|
5484
5484
|
const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
|
|
5485
|
-
if (ways > 1) throw new (0,
|
|
5485
|
+
if (ways > 1) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
|
|
5486
5486
|
let corners = g.corners;
|
|
5487
5487
|
if (spec.corners) corners = spec.corners;
|
|
5488
5488
|
else if (spec.matrix) {
|
|
5489
|
-
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0,
|
|
5489
|
+
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkPMEHFHSPcjs.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).");
|
|
5490
5490
|
const [a, b, c, d] = spec.matrix;
|
|
5491
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5492
|
-
corners =
|
|
5491
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5492
|
+
corners = _chunkPMEHFHSPcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
|
|
5493
5493
|
} else if (numeric.length) {
|
|
5494
|
-
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0,
|
|
5495
|
-
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0,
|
|
5496
|
-
const now =
|
|
5497
|
-
const centre =
|
|
5494
|
+
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
|
|
5495
|
+
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`${k} must be a finite number.`);
|
|
5496
|
+
const now = _chunkPMEHFHSPcjs.describeTransform.call(void 0, g);
|
|
5497
|
+
const centre = _chunkPMEHFHSPcjs.anchorPoint.call(void 0, g, "center");
|
|
5498
5498
|
const params = {
|
|
5499
5499
|
scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
|
|
5500
5500
|
scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
|
|
@@ -5502,20 +5502,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5502
5502
|
skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
|
|
5503
5503
|
skewY: _nullishCoalesce(spec.skewY, () => ( 0))
|
|
5504
5504
|
};
|
|
5505
|
-
const m =
|
|
5505
|
+
const m = _chunkPMEHFHSPcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
|
|
5506
5506
|
const cx = g.box.width / 2;
|
|
5507
5507
|
const cy = g.box.height / 2;
|
|
5508
5508
|
const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
|
|
5509
|
-
corners =
|
|
5509
|
+
corners = _chunkPMEHFHSPcjs.cornersFromMatrix.call(void 0, g.box, _chunkXFXHA5MUcjs.multiplyMatrices.call(void 0, m, _chunkXFXHA5MUcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
|
|
5510
5510
|
}
|
|
5511
5511
|
let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
|
|
5512
5512
|
if (spec.warp === null) warp = null;
|
|
5513
5513
|
else if (spec.warp) {
|
|
5514
5514
|
if ("style" in spec.warp) {
|
|
5515
|
-
if (!
|
|
5516
|
-
warp =
|
|
5515
|
+
if (!_chunkXFXHA5MUcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkXFXHA5MUcjs.WARP_STYLES.join(", ")}.`);
|
|
5516
|
+
warp = _chunkPMEHFHSPcjs.presetWarp.call(void 0, g.box, spec.warp);
|
|
5517
5517
|
} else {
|
|
5518
|
-
if (!
|
|
5518
|
+
if (!_chunkPMEHFHSPcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkPMEHFHSPcjs.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.");
|
|
5519
5519
|
warp = spec.warp;
|
|
5520
5520
|
}
|
|
5521
5521
|
}
|
|
@@ -5529,16 +5529,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5529
5529
|
* the layers that changed.
|
|
5530
5530
|
*/
|
|
5531
5531
|
replaceSmartObjectContents(id, source) {
|
|
5532
|
-
const layer =
|
|
5532
|
+
const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5533
5533
|
let contents;
|
|
5534
5534
|
if ("contents" in source) contents = source.contents;
|
|
5535
|
-
else if ("pixels" in source) contents =
|
|
5535
|
+
else if ("pixels" in source) contents = _chunkPMEHFHSPcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
|
|
5536
5536
|
else {
|
|
5537
|
-
const psd =
|
|
5538
|
-
contents =
|
|
5537
|
+
const psd = _chunkPMEHFHSPcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkPMEHFHSPcjs.newLayerId.call(void 0, ) });
|
|
5538
|
+
contents = _chunkPMEHFHSPcjs.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`)));
|
|
5539
5539
|
contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
|
|
5540
5540
|
}
|
|
5541
|
-
const res =
|
|
5541
|
+
const res = _chunkPMEHFHSPcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
|
|
5542
5542
|
this.commitLayers(res.layers);
|
|
5543
5543
|
return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
|
|
5544
5544
|
}
|
|
@@ -5553,16 +5553,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5553
5553
|
* and bytes.
|
|
5554
5554
|
*/
|
|
5555
5555
|
exportSmartObjectContents(id) {
|
|
5556
|
-
const layer =
|
|
5556
|
+
const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5557
5557
|
const c = layer.contents;
|
|
5558
5558
|
const base = c.name.replace(/\.\w+$/, "") || "Contents";
|
|
5559
5559
|
if (c.file) {
|
|
5560
|
-
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ...
|
|
5560
|
+
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkPMEHFHSPcjs.BROWSER_IMAGE_TYPES };
|
|
5561
5561
|
const ext = c.file.type.toLowerCase();
|
|
5562
5562
|
return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
|
|
5563
5563
|
}
|
|
5564
|
-
if (!
|
|
5565
|
-
const f =
|
|
5564
|
+
if (!_chunkPMEHFHSPcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
|
|
5565
|
+
const f = _chunkPMEHFHSPcjs.smartContentsFile.call(void 0, c);
|
|
5566
5566
|
return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
|
|
5567
5567
|
}
|
|
5568
5568
|
/**
|
|
@@ -5571,7 +5571,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5571
5571
|
* undo step. Returns the copy's id.
|
|
5572
5572
|
*/
|
|
5573
5573
|
copySmartObject(id, linked = false, name) {
|
|
5574
|
-
const res =
|
|
5574
|
+
const res = _chunkPMEHFHSPcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
|
|
5575
5575
|
this.commitLayers(res.layers, () => {
|
|
5576
5576
|
this.state.activeLayerId = res.layer.id;
|
|
5577
5577
|
this.state.activeTarget = "pixels";
|
|
@@ -5580,31 +5580,31 @@ var ImageEditorController = (_class7 = class {
|
|
|
5580
5580
|
}
|
|
5581
5581
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
5582
5582
|
addSmartFilter(id, filter, index) {
|
|
5583
|
-
const res =
|
|
5583
|
+
const res = _chunkPMEHFHSPcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkPMEHFHSPcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
|
|
5584
5584
|
this.commitLayers(res.layers);
|
|
5585
5585
|
return res.filter;
|
|
5586
5586
|
}
|
|
5587
5587
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
5588
5588
|
updateSmartFilter(id, filterId, changes, commitToHistory = true) {
|
|
5589
|
-
const res =
|
|
5589
|
+
const res = _chunkPMEHFHSPcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
|
|
5590
5590
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5591
5591
|
return res.filter;
|
|
5592
5592
|
}
|
|
5593
5593
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
5594
5594
|
removeSmartFilter(id, filterId) {
|
|
5595
|
-
const res =
|
|
5595
|
+
const res = _chunkPMEHFHSPcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
|
|
5596
5596
|
this.commitLayers(res.layers);
|
|
5597
5597
|
return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
|
|
5598
5598
|
}
|
|
5599
5599
|
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
5600
5600
|
moveSmartFilter(id, filterId, index) {
|
|
5601
|
-
const res =
|
|
5601
|
+
const res = _chunkPMEHFHSPcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
|
|
5602
5602
|
this.commitLayers(res.layers);
|
|
5603
5603
|
return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
|
|
5604
5604
|
}
|
|
5605
5605
|
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
5606
5606
|
setSmartFiltersEnabled(id, enabled) {
|
|
5607
|
-
const res =
|
|
5607
|
+
const res = _chunkPMEHFHSPcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
|
|
5608
5608
|
this.commitLayers(res.layers);
|
|
5609
5609
|
return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
|
|
5610
5610
|
}
|
|
@@ -5614,21 +5614,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
5614
5614
|
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
5615
5615
|
*/
|
|
5616
5616
|
setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
|
|
5617
|
-
const layer =
|
|
5617
|
+
const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5618
5618
|
let mask;
|
|
5619
5619
|
if (from === "none") mask = null;
|
|
5620
5620
|
else if (from === "keep") {
|
|
5621
|
-
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0,
|
|
5621
|
+
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
|
|
5622
5622
|
mask = withMaskProps(layer.smartFilters.mask, props);
|
|
5623
5623
|
} else if (from === "selection") {
|
|
5624
5624
|
const sel = this.state.selection;
|
|
5625
|
-
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0,
|
|
5625
|
+
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5626
5626
|
mask = this.maskFromSelection(sel, props);
|
|
5627
5627
|
} else {
|
|
5628
5628
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5629
5629
|
mask = withMaskProps({ surface: _chunkO7LUD7MHcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5630
5630
|
}
|
|
5631
|
-
const res =
|
|
5631
|
+
const res = _chunkPMEHFHSPcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
|
|
5632
5632
|
this.commitLayers(res.layers, () => {
|
|
5633
5633
|
if (this.state.activeLayerId !== id) return;
|
|
5634
5634
|
if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
|
|
@@ -5644,14 +5644,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
5644
5644
|
async prepareSmartObjects() {
|
|
5645
5645
|
const pending = /* @__PURE__ */ new Map();
|
|
5646
5646
|
for (const l of _chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers)) {
|
|
5647
|
-
if (l.type === "smart" && !
|
|
5647
|
+
if (l.type === "smart" && !_chunkPMEHFHSPcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkPMEHFHSPcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
|
|
5648
5648
|
}
|
|
5649
5649
|
const left = [];
|
|
5650
5650
|
for (const [cid, c] of pending) {
|
|
5651
5651
|
try {
|
|
5652
|
-
const url = `data:${
|
|
5652
|
+
const url = `data:${_chunkPMEHFHSPcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkO7LUD7MHcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
|
|
5653
5653
|
const px2 = await this.decodeImage(url);
|
|
5654
|
-
const decoded = { ...c, kind: "raster", raster:
|
|
5654
|
+
const decoded = { ...c, kind: "raster", raster: _chunkPMEHFHSPcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
|
|
5655
5655
|
const swap = (layers) => {
|
|
5656
5656
|
let out = layers;
|
|
5657
5657
|
for (const l of _chunkAEAAN4ADcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkAEAAN4ADcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
|
|
@@ -5679,10 +5679,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5679
5679
|
* Contents can nest. Returns the contents' size and layer ids.
|
|
5680
5680
|
*/
|
|
5681
5681
|
editSmartObjectContents(id) {
|
|
5682
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5683
|
-
const layer =
|
|
5682
|
+
if (this.getFreeTransform()) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
|
|
5683
|
+
const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5684
5684
|
const c = layer.contents;
|
|
5685
|
-
if (!
|
|
5685
|
+
if (!_chunkPMEHFHSPcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _200 => _200.file, 'optionalAccess', _201 => _201.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
|
|
5686
5686
|
const saved = {
|
|
5687
5687
|
state: { ...this.state },
|
|
5688
5688
|
undo: this.undoStack,
|
|
@@ -5693,7 +5693,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5693
5693
|
samplePixelsOverride: this.samplePixelsOverride,
|
|
5694
5694
|
psdResolution: this.psdResolution
|
|
5695
5695
|
};
|
|
5696
|
-
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id:
|
|
5696
|
+
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkPMEHFHSPcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
|
|
5697
5697
|
this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
|
|
5698
5698
|
const s = this.state;
|
|
5699
5699
|
this.state = {
|
|
@@ -5701,7 +5701,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5701
5701
|
sourceUrl: null,
|
|
5702
5702
|
imageDimensions: { width: c.width, height: c.height },
|
|
5703
5703
|
crop: null,
|
|
5704
|
-
transform: { ...
|
|
5704
|
+
transform: { ..._chunkPMEHFHSPcjs.DEFAULT_TRANSFORM_VALUES },
|
|
5705
5705
|
layers,
|
|
5706
5706
|
activeLayerId: layers.length ? layers[layers.length - 1].id : null,
|
|
5707
5707
|
activeTarget: "pixels",
|
|
@@ -5734,7 +5734,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5734
5734
|
*/
|
|
5735
5735
|
closeSmartObjectContents(save = true) {
|
|
5736
5736
|
const top = this.contentsStack.pop();
|
|
5737
|
-
if (!top) throw new (0,
|
|
5737
|
+
if (!top) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
|
|
5738
5738
|
if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
|
|
5739
5739
|
this.openTransform = null;
|
|
5740
5740
|
const edited = this.state;
|
|
@@ -5748,10 +5748,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5748
5748
|
const plain3 = _optionalChain([only, 'optionalAccess', _211 => _211.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _212 => _212.filters, 'optionalAccess', _213 => _213.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
|
|
5749
5749
|
if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
|
|
5750
5750
|
const px2 = _chunkO7LUD7MHcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
|
|
5751
|
-
next =
|
|
5751
|
+
next = _chunkPMEHFHSPcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
|
|
5752
5752
|
} else {
|
|
5753
5753
|
const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
|
|
5754
|
-
next =
|
|
5754
|
+
next = _chunkPMEHFHSPcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _215 => _215.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _216 => _216.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
|
|
5755
5755
|
}
|
|
5756
5756
|
}
|
|
5757
5757
|
const saved = top.saved;
|
|
@@ -5770,7 +5770,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5770
5770
|
this.notify();
|
|
5771
5771
|
return { layerId: top.layerId, changed: false, layerIds: [] };
|
|
5772
5772
|
}
|
|
5773
|
-
const res =
|
|
5773
|
+
const res = _chunkPMEHFHSPcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
|
|
5774
5774
|
this.commitLayers(res.layers);
|
|
5775
5775
|
return { layerId: top.layerId, changed: true, layerIds: res.ids };
|
|
5776
5776
|
}
|
|
@@ -5785,35 +5785,35 @@ var ImageEditorController = (_class7 = class {
|
|
|
5785
5785
|
// --- Layer effects ---
|
|
5786
5786
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
5787
5787
|
getLayerEffects(id) {
|
|
5788
|
-
return
|
|
5788
|
+
return _chunkPMEHFHSPcjs.layerEffectsOf.call(void 0, _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer);
|
|
5789
5789
|
}
|
|
5790
5790
|
/**
|
|
5791
5791
|
* Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
|
|
5792
5792
|
* `index` in the layer's effect list (default the end). Returns the new effect and the effects.
|
|
5793
5793
|
*/
|
|
5794
5794
|
addLayerEffect(id, kind, params = {}, index) {
|
|
5795
|
-
const res =
|
|
5795
|
+
const res = _chunkPMEHFHSPcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
|
|
5796
5796
|
this.commitLayers(res.layers);
|
|
5797
5797
|
return { effect: res.effect, effects: this.getLayerEffects(id) };
|
|
5798
5798
|
}
|
|
5799
5799
|
/** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
|
|
5800
5800
|
updateLayerEffect(id, effectId, changes, commitToHistory = true) {
|
|
5801
|
-
this.commitLayers(
|
|
5801
|
+
this.commitLayers(_chunkPMEHFHSPcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
|
|
5802
5802
|
return this.getLayerEffects(id);
|
|
5803
5803
|
}
|
|
5804
5804
|
/** Removes one effect (one undo step). Returns the remaining effects. */
|
|
5805
5805
|
removeLayerEffect(id, effectId) {
|
|
5806
|
-
this.commitLayers(
|
|
5806
|
+
this.commitLayers(_chunkPMEHFHSPcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
|
|
5807
5807
|
return this.getLayerEffects(id);
|
|
5808
5808
|
}
|
|
5809
5809
|
/** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
|
|
5810
5810
|
setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
|
|
5811
|
-
this.commitLayers(
|
|
5811
|
+
this.commitLayers(_chunkPMEHFHSPcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
|
|
5812
5812
|
return this.getLayerEffects(id);
|
|
5813
5813
|
}
|
|
5814
5814
|
/** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
|
|
5815
5815
|
setLayerEffects(id, effects, commitToHistory = true) {
|
|
5816
|
-
this.commitLayers(
|
|
5816
|
+
this.commitLayers(_chunkPMEHFHSPcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
|
|
5817
5817
|
return this.getLayerEffects(id);
|
|
5818
5818
|
}
|
|
5819
5819
|
__init76() {this.patternIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -5839,8 +5839,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5839
5839
|
/** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
|
|
5840
5840
|
setGlobalLight(light, commitToHistory = true) {
|
|
5841
5841
|
const next = { ...this.getGlobalLight(), ...light };
|
|
5842
|
-
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0,
|
|
5843
|
-
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0,
|
|
5842
|
+
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
|
|
5843
|
+
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
|
|
5844
5844
|
if (commitToHistory) this.recordHistory();
|
|
5845
5845
|
if (next.angle === _chunkAEAAN4ADcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkAEAAN4ADcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
|
|
5846
5846
|
else this.state.globalLight = next;
|
|
@@ -5851,16 +5851,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5851
5851
|
async compositeToSurface(layers, rect) {
|
|
5852
5852
|
const { width, height } = this.naturalSize;
|
|
5853
5853
|
if (_chunkAEAAN4ADcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
|
|
5854
|
-
throw new (0,
|
|
5854
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
|
|
5855
5855
|
}
|
|
5856
5856
|
await this.renderer.prepareLayerAssets(layers, width, height);
|
|
5857
5857
|
const sources = this.renderer.compositorSources(width, height);
|
|
5858
5858
|
const depth = this.bitDepth;
|
|
5859
5859
|
if (depth !== 8) {
|
|
5860
|
-
const samples = _chunkAEAAN4ADcjs.workingToSamples.call(void 0,
|
|
5860
|
+
const samples = _chunkAEAAN4ADcjs.workingToSamples.call(void 0, _chunkPMEHFHSPcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
|
|
5861
5861
|
return _chunkO7LUD7MHcjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
|
|
5862
5862
|
}
|
|
5863
|
-
const data = new (0,
|
|
5863
|
+
const data = new (0, _chunkPMEHFHSPcjs.LayerCompositor)().composite(layers, rect, sources);
|
|
5864
5864
|
return _chunkO7LUD7MHcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
|
|
5865
5865
|
}
|
|
5866
5866
|
/**
|
|
@@ -5873,22 +5873,22 @@ var ImageEditorController = (_class7 = class {
|
|
|
5873
5873
|
const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
|
|
5874
5874
|
const depth = this.bitDepth;
|
|
5875
5875
|
if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkO7LUD7MHcjs.to16From8.call(void 0, this.compositePixels(r).data) };
|
|
5876
|
-
const data = _chunkAEAAN4ADcjs.workingToSamples.call(void 0,
|
|
5876
|
+
const data = _chunkAEAAN4ADcjs.workingToSamples.call(void 0, _chunkPMEHFHSPcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
|
|
5877
5877
|
return { width: r.width, height: r.height, depth, data };
|
|
5878
5878
|
}
|
|
5879
5879
|
/** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
|
|
5880
5880
|
paintBounds(layer) {
|
|
5881
5881
|
const { width, height } = this.naturalSize;
|
|
5882
5882
|
const canvas = { x: 0, y: 0, width, height };
|
|
5883
|
-
if (
|
|
5883
|
+
if (_chunkPMEHFHSPcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
5884
5884
|
if (layer.type === "annotation") {
|
|
5885
|
-
const b =
|
|
5885
|
+
const b = _chunkPMEHFHSPcjs.getAnnotationBounds.call(void 0, layer.annotation);
|
|
5886
5886
|
const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
|
|
5887
5887
|
return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
|
|
5888
5888
|
}
|
|
5889
5889
|
if (layer.type === "group") {
|
|
5890
5890
|
let r = null;
|
|
5891
|
-
for (const c of layer.children) r =
|
|
5891
|
+
for (const c of layer.children) r = _chunkPMEHFHSPcjs.unionRect.call(void 0, r, this.paintBounds(c));
|
|
5892
5892
|
return _nullishCoalesce(r, () => ( canvas));
|
|
5893
5893
|
}
|
|
5894
5894
|
return canvas;
|
|
@@ -5899,16 +5899,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5899
5899
|
* Returns the merged id.
|
|
5900
5900
|
*/
|
|
5901
5901
|
async mergeDown(id) {
|
|
5902
|
-
const loc =
|
|
5902
|
+
const loc = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5903
5903
|
const upper = loc.layer;
|
|
5904
5904
|
const siblings = loc.parent ? loc.parent.children : this.state.layers;
|
|
5905
5905
|
const lower = siblings[loc.index - 1];
|
|
5906
|
-
if (!lower) throw new (0,
|
|
5907
|
-
if (lower.type !== "pixel") throw new (0,
|
|
5908
|
-
if (!upper.visible) throw new (0,
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
let rect = _nullishCoalesce(
|
|
5906
|
+
if (!lower) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
|
|
5907
|
+
if (lower.type !== "pixel") throw new (0, _chunkPMEHFHSPcjs.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.`);
|
|
5908
|
+
if (!upper.visible) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
|
|
5909
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
|
|
5910
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
|
|
5911
|
+
let rect = _nullishCoalesce(_chunkPMEHFHSPcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
|
|
5912
5912
|
const reach = Math.max(_chunkAEAAN4ADcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkAEAAN4ADcjs.effectsMargin.call(void 0, upper.effects));
|
|
5913
5913
|
if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
|
|
5914
5914
|
const base = { ...lower, blend: "normal", opacity: 1 };
|
|
@@ -5934,12 +5934,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
5934
5934
|
*/
|
|
5935
5935
|
async mergeVisible() {
|
|
5936
5936
|
const visible = this.state.layers.filter((l) => l.visible);
|
|
5937
|
-
if (!visible.length) throw new (0,
|
|
5937
|
+
if (!visible.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("No layer is visible.");
|
|
5938
5938
|
const { width, height } = this.naturalSize;
|
|
5939
5939
|
const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
|
|
5940
5940
|
const merged = {
|
|
5941
5941
|
type: "pixel",
|
|
5942
|
-
id:
|
|
5942
|
+
id: _chunkPMEHFHSPcjs.newLayerId.call(void 0, ),
|
|
5943
5943
|
name: "Merged",
|
|
5944
5944
|
visible: true,
|
|
5945
5945
|
opacity: 1,
|
|
@@ -5963,8 +5963,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5963
5963
|
const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
|
|
5964
5964
|
const bg = {
|
|
5965
5965
|
type: "pixel",
|
|
5966
|
-
id:
|
|
5967
|
-
name:
|
|
5966
|
+
id: _chunkPMEHFHSPcjs.BACKGROUND_LAYER_ID,
|
|
5967
|
+
name: _chunkPMEHFHSPcjs.BACKGROUND_LAYER_NAME,
|
|
5968
5968
|
visible: true,
|
|
5969
5969
|
opacity: 1,
|
|
5970
5970
|
blend: "normal",
|
|
@@ -5991,7 +5991,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5991
5991
|
const k = Math.min(1, side / Math.max(width, height));
|
|
5992
5992
|
const tw = Math.max(1, Math.round(width * k));
|
|
5993
5993
|
const th = Math.max(1, Math.round(height * k));
|
|
5994
|
-
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null :
|
|
5994
|
+
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkPMEHFHSPcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
|
|
5995
5995
|
if (!surface) return null;
|
|
5996
5996
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
5997
5997
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
@@ -6087,7 +6087,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6087
6087
|
* pixels. The next stroke fixes the offset from its first point. View state, no undo.
|
|
6088
6088
|
*/
|
|
6089
6089
|
setCloneSource(point) {
|
|
6090
|
-
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0,
|
|
6090
|
+
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
|
|
6091
6091
|
const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
|
|
6092
6092
|
this.state.paint = { ...this.state.paint, cloneSource: source };
|
|
6093
6093
|
this.notify();
|
|
@@ -6103,9 +6103,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6103
6103
|
const next = t ? { ...cur, ...t } : { ..._chunkVEHVXRJUcjs.IDENTITY_CLONE_TRANSFORM };
|
|
6104
6104
|
for (const k of ["scaleX", "scaleY"]) {
|
|
6105
6105
|
const v = next[k];
|
|
6106
|
-
if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0,
|
|
6106
|
+
if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
|
|
6107
6107
|
}
|
|
6108
|
-
if (!Number.isFinite(next.rotate)) throw new (0,
|
|
6108
|
+
if (!Number.isFinite(next.rotate)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("rotate must be a number of degrees.");
|
|
6109
6109
|
next.rotate = ((next.rotate + 180) % 360 + 360) % 360 - 180;
|
|
6110
6110
|
this.state.paint = { ...this.state.paint, cloneTransform: next };
|
|
6111
6111
|
this.notify();
|
|
@@ -6123,27 +6123,27 @@ var ImageEditorController = (_class7 = class {
|
|
|
6123
6123
|
/** Resolves and validates what a stroke, fill or clear paints into. */
|
|
6124
6124
|
paintTarget(layerId, channel, action) {
|
|
6125
6125
|
const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
|
|
6126
|
-
if (!id) throw new (0,
|
|
6127
|
-
const layer =
|
|
6126
|
+
if (!id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
|
|
6127
|
+
const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
6128
6128
|
const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
|
|
6129
6129
|
if (ch === "mask") {
|
|
6130
|
-
if (!layer.mask) throw new (0,
|
|
6131
|
-
if (layer.mask.source) throw new (0,
|
|
6132
|
-
|
|
6130
|
+
if (!layer.mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
|
|
6131
|
+
if (layer.mask.source) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
|
|
6132
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6133
6133
|
} else if (ch === "filter-mask") {
|
|
6134
6134
|
if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
|
|
6135
|
-
throw new (0,
|
|
6135
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
|
|
6136
6136
|
}
|
|
6137
|
-
if (!
|
|
6138
|
-
|
|
6137
|
+
if (!_chunkPMEHFHSPcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
|
|
6138
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6139
6139
|
} else {
|
|
6140
|
-
if (layer.type === "smart") throw new (0,
|
|
6141
|
-
if (layer.type === "shape") throw new (0,
|
|
6142
|
-
if (layer.type === "type") throw new (0,
|
|
6143
|
-
if (layer.type !== "pixel") throw new (0,
|
|
6144
|
-
|
|
6140
|
+
if (layer.type === "smart") throw new (0, _chunkPMEHFHSPcjs.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.`);
|
|
6141
|
+
if (layer.type === "shape") throw new (0, _chunkPMEHFHSPcjs.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).`);
|
|
6142
|
+
if (layer.type === "type") throw new (0, _chunkPMEHFHSPcjs.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).`);
|
|
6143
|
+
if (layer.type !== "pixel") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
|
|
6144
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", action);
|
|
6145
6145
|
}
|
|
6146
|
-
if (!layer.visible) throw new (0,
|
|
6146
|
+
if (!layer.visible) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
|
|
6147
6147
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
6148
6148
|
const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
|
|
6149
6149
|
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
|
|
@@ -6152,7 +6152,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6152
6152
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
6153
6153
|
withSurface(layer, channel, surface) {
|
|
6154
6154
|
if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
|
|
6155
|
-
if (channel === "filter-mask") return
|
|
6155
|
+
if (channel === "filter-mask") return _chunkPMEHFHSPcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
|
|
6156
6156
|
const next = { ...layer, surface };
|
|
6157
6157
|
delete next.source;
|
|
6158
6158
|
return next;
|
|
@@ -6165,10 +6165,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6165
6165
|
*/
|
|
6166
6166
|
beginStroke(init = {}) {
|
|
6167
6167
|
const tool = _nullishCoalesce(init.tool, () => ( "brush"));
|
|
6168
|
-
if (!STROKE_TOOLS.includes(tool)) throw new (0,
|
|
6168
|
+
if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
|
|
6169
6169
|
const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
|
|
6170
6170
|
if (tool === "mixer" && target.channel !== "pixels") {
|
|
6171
|
-
throw new (0,
|
|
6171
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
|
|
6172
6172
|
}
|
|
6173
6173
|
const brush = _chunk3T5O225Tcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
|
|
6174
6174
|
let strokePaint = null;
|
|
@@ -6202,7 +6202,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6202
6202
|
retouchStroke(tool, init, brush, target, apply) {
|
|
6203
6203
|
const settings = _chunkVEHVXRJUcjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
|
|
6204
6204
|
const mask = target.channel !== "pixels";
|
|
6205
|
-
if (tool === "sponge" && mask) throw new (0,
|
|
6205
|
+
if (tool === "sponge" && mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
|
|
6206
6206
|
if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkVEHVXRJUcjs.RetouchDabStroke)(brush, pixels, _chunkVEHVXRJUcjs.smudgeEffect.call(void 0, brush, settings.strength)) };
|
|
6207
6207
|
if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunkVEHVXRJUcjs.RetouchDabStroke)(brush, pixels, _chunkVEHVXRJUcjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
|
|
6208
6208
|
const retouchApply = {
|
|
@@ -6241,11 +6241,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6241
6241
|
if (tool === "history") {
|
|
6242
6242
|
const steps = settings.historySteps;
|
|
6243
6243
|
const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
|
|
6244
|
-
if (!entry) throw new (0,
|
|
6244
|
+
if (!entry) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("There is no earlier state to paint from yet: the History Brush paints a layer as it was some undo steps back. Make a change first.");
|
|
6245
6245
|
const then = _optionalChain([_chunkAEAAN4ADcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _232 => _232.layer]);
|
|
6246
|
-
if (!then) throw new (0,
|
|
6246
|
+
if (!then) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
|
|
6247
6247
|
const surface = target.channel === "mask" ? _optionalChain([then, 'access', _233 => _233.mask, 'optionalAccess', _234 => _234.surface]) : then.type === "pixel" ? then.surface : void 0;
|
|
6248
|
-
if (!surface) throw new (0,
|
|
6248
|
+
if (!surface) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
|
|
6249
6249
|
const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
|
|
6250
6250
|
const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
|
|
6251
6251
|
const source2 = depth ? new (0, _chunkVEHVXRJUcjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkO7LUD7MHcjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
|
|
@@ -6290,7 +6290,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6290
6290
|
}
|
|
6291
6291
|
if (init.source) this.setCloneSource(init.source);
|
|
6292
6292
|
const cs = this.state.paint.cloneSource;
|
|
6293
|
-
if (!cs) throw new (0,
|
|
6293
|
+
if (!cs) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
|
|
6294
6294
|
let offset = { x: 0, y: 0 };
|
|
6295
6295
|
let first = { x: 0, y: 0 };
|
|
6296
6296
|
const xf = this.state.paint.cloneTransform;
|
|
@@ -6327,7 +6327,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6327
6327
|
const sources = this.compositorSources();
|
|
6328
6328
|
if (depth) {
|
|
6329
6329
|
return new (0, _chunkVEHVXRJUcjs.TilePixelSource)((tx, ty) => {
|
|
6330
|
-
const w =
|
|
6330
|
+
const w = _chunkPMEHFHSPcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkO7LUD7MHcjs.TILE, y: ty * _chunkO7LUD7MHcjs.TILE, width: _chunkO7LUD7MHcjs.TILE, height: _chunkO7LUD7MHcjs.TILE }, sources, depth);
|
|
6331
6331
|
for (let i = 0; i < w.length; i += 4) {
|
|
6332
6332
|
if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkO7LUD7MHcjs.srgbEncode.call(void 0, w[i + c]);
|
|
6333
6333
|
for (let c = 0; c < 4; c++) w[i + c] *= 255;
|
|
@@ -6335,7 +6335,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6335
6335
|
return w;
|
|
6336
6336
|
}, 4);
|
|
6337
6337
|
}
|
|
6338
|
-
const compositor = new (0,
|
|
6338
|
+
const compositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)();
|
|
6339
6339
|
return new (0, _chunkVEHVXRJUcjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
|
|
6340
6340
|
}
|
|
6341
6341
|
/** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
|
|
@@ -6385,9 +6385,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6385
6385
|
* document bounds and the number of dabs.
|
|
6386
6386
|
*/
|
|
6387
6387
|
paintStroke(init) {
|
|
6388
|
-
if (!Array.isArray(init.points) || !init.points.length) throw new (0,
|
|
6388
|
+
if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("points must hold at least one { x, y } point.");
|
|
6389
6389
|
for (const p of init.points) {
|
|
6390
|
-
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0,
|
|
6390
|
+
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
|
|
6391
6391
|
}
|
|
6392
6392
|
const session = this.beginStroke(init);
|
|
6393
6393
|
session.push(init.points);
|
|
@@ -6413,8 +6413,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6413
6413
|
const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
|
|
6414
6414
|
const { width, height } = this.naturalSize;
|
|
6415
6415
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
6416
|
-
if (!(opacity >= 0 && opacity <= 1)) throw new (0,
|
|
6417
|
-
const blend = _nullishCoalesce(
|
|
6416
|
+
if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
6417
|
+
const blend = _nullishCoalesce(_chunkPMEHFHSPcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
|
|
6418
6418
|
const sel = options.useSelection !== false && _optionalChain([this, 'access', _241 => _241.state, 'access', _242 => _242.selection, 'optionalAccess', _243 => _243.bounds]) ? this.state.selection : null;
|
|
6419
6419
|
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _244 => _244.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
6420
6420
|
const coverage = new (0, _chunk3T5O225Tcjs.CoverageMap)();
|
|
@@ -6450,7 +6450,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6450
6450
|
// --- Adjustments ---
|
|
6451
6451
|
/** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
|
|
6452
6452
|
developLayer() {
|
|
6453
|
-
return
|
|
6453
|
+
return _chunkPMEHFHSPcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
|
|
6454
6454
|
}
|
|
6455
6455
|
/**
|
|
6456
6456
|
* Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
|
|
@@ -6476,7 +6476,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6476
6476
|
this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
|
|
6477
6477
|
}
|
|
6478
6478
|
if ("layers" in partial) {
|
|
6479
|
-
layers = this.replaceAdjustmentNodes(layers,
|
|
6479
|
+
layers = this.replaceAdjustmentNodes(layers, _chunkPMEHFHSPcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
|
|
6480
6480
|
}
|
|
6481
6481
|
this.state.layers = layers;
|
|
6482
6482
|
this.notify();
|
|
@@ -6484,7 +6484,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6484
6484
|
/** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
|
|
6485
6485
|
get isProcessOutdated() {
|
|
6486
6486
|
this.syncViews();
|
|
6487
|
-
return
|
|
6487
|
+
return _chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkPMEHFHSPcjs.LATEST_PROCESS_VERSION;
|
|
6488
6488
|
}
|
|
6489
6489
|
/**
|
|
6490
6490
|
* Update to Current Process: re-interprets the current adjustment values with the latest
|
|
@@ -6492,7 +6492,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6492
6492
|
*/
|
|
6493
6493
|
upgradeProcess() {
|
|
6494
6494
|
if (!this.isProcessOutdated) return false;
|
|
6495
|
-
this.setAdjustments({ process:
|
|
6495
|
+
this.setAdjustments({ process: _chunkPMEHFHSPcjs.LATEST_PROCESS_VERSION });
|
|
6496
6496
|
return true;
|
|
6497
6497
|
}
|
|
6498
6498
|
/** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
|
|
@@ -6503,7 +6503,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6503
6503
|
this.state.layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0,
|
|
6504
6504
|
this.state.layers,
|
|
6505
6505
|
target.id,
|
|
6506
|
-
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process:
|
|
6506
|
+
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkPMEHFHSPcjs.LATEST_PROCESS_VERSION }), 0)
|
|
6507
6507
|
);
|
|
6508
6508
|
}
|
|
6509
6509
|
delete this.state.legacyOutputBlur;
|
|
@@ -6567,7 +6567,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6567
6567
|
const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
|
|
6568
6568
|
for (const l of next) {
|
|
6569
6569
|
if (existing.has(l.id)) continue;
|
|
6570
|
-
out = this.placeLayer(out,
|
|
6570
|
+
out = this.placeLayer(out, _chunkPMEHFHSPcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
|
|
6571
6571
|
}
|
|
6572
6572
|
const order = next.map((l) => l.id);
|
|
6573
6573
|
for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
|
|
@@ -6582,7 +6582,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6582
6582
|
addAdjustmentLayer(init, index) {
|
|
6583
6583
|
const spec = typeof init === "string" ? { kind: init } : init;
|
|
6584
6584
|
const ids = new Set(_chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
6585
|
-
const layer =
|
|
6585
|
+
const layer = _chunkPMEHFHSPcjs.createAdjustmentLayer.call(void 0, spec.kind, {
|
|
6586
6586
|
id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
|
|
6587
6587
|
name: spec.name,
|
|
6588
6588
|
params: spec.params,
|
|
@@ -6591,10 +6591,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6591
6591
|
blend: spec.blend,
|
|
6592
6592
|
mask: _nullishCoalesce(spec.mask, () => ( void 0))
|
|
6593
6593
|
});
|
|
6594
|
-
while (ids.has(layer.id)) layer.id =
|
|
6594
|
+
while (ids.has(layer.id)) layer.id = _chunkPMEHFHSPcjs.newLayerId.call(void 0, "adj");
|
|
6595
6595
|
const { width, height } = this.naturalSize;
|
|
6596
6596
|
this.recordHistory();
|
|
6597
|
-
const node =
|
|
6597
|
+
const node = _chunkPMEHFHSPcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
|
|
6598
6598
|
const positioned = Boolean(spec.aboveId || spec.parentId);
|
|
6599
6599
|
this.state.layers = this.placeLayer(this.state.layers, node, {
|
|
6600
6600
|
aboveId: spec.aboveId,
|
|
@@ -6614,7 +6614,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6614
6614
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
6615
6615
|
const { width, height } = this.naturalSize;
|
|
6616
6616
|
const node = loc.layer;
|
|
6617
|
-
const merged =
|
|
6617
|
+
const merged = _chunkPMEHFHSPcjs.normalizeAdjustmentLayer.call(void 0, {
|
|
6618
6618
|
id: node.id,
|
|
6619
6619
|
kind: node.kind,
|
|
6620
6620
|
enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
|
|
@@ -6634,7 +6634,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6634
6634
|
params: merged.params
|
|
6635
6635
|
};
|
|
6636
6636
|
if (update.mask !== void 0) {
|
|
6637
|
-
const mask = update.mask ?
|
|
6637
|
+
const mask = update.mask ? _chunkPMEHFHSPcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
|
|
6638
6638
|
if (mask) next.mask = mask;
|
|
6639
6639
|
else delete next.mask;
|
|
6640
6640
|
}
|
|
@@ -6721,8 +6721,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6721
6721
|
const { width, height } = this.naturalSize;
|
|
6722
6722
|
let next = null;
|
|
6723
6723
|
if (mask) {
|
|
6724
|
-
const sized = mask.width === width && mask.height === height ? mask :
|
|
6725
|
-
next =
|
|
6724
|
+
const sized = mask.width === width && mask.height === height ? mask : _chunkPMEHFHSPcjs.resizeSelection.call(void 0, mask, width, height);
|
|
6725
|
+
next = _chunkPMEHFHSPcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
|
|
6726
6726
|
} else if (mode !== "replace") {
|
|
6727
6727
|
return false;
|
|
6728
6728
|
}
|
|
@@ -6736,7 +6736,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6736
6736
|
/** Select › All. */
|
|
6737
6737
|
selectAll() {
|
|
6738
6738
|
const { width, height } = this.naturalSize;
|
|
6739
|
-
return this.setSelection(
|
|
6739
|
+
return this.setSelection(_chunkPMEHFHSPcjs.fullSelection.call(void 0, width, height));
|
|
6740
6740
|
}
|
|
6741
6741
|
/** Select › Deselect. */
|
|
6742
6742
|
deselect() {
|
|
@@ -6745,11 +6745,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6745
6745
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
6746
6746
|
invertSelection() {
|
|
6747
6747
|
const { width, height } = this.naturalSize;
|
|
6748
|
-
const current = _nullishCoalesce(this.state.selection, () => (
|
|
6749
|
-
return this.setSelection(
|
|
6748
|
+
const current = _nullishCoalesce(this.state.selection, () => ( _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, width, height)));
|
|
6749
|
+
return this.setSelection(_chunkPMEHFHSPcjs.invertSelection.call(void 0, current));
|
|
6750
6750
|
}
|
|
6751
6751
|
shapeCommand(mask, options) {
|
|
6752
|
-
const shaped = options.feather && options.feather > 0 ?
|
|
6752
|
+
const shaped = options.feather && options.feather > 0 ? _chunkPMEHFHSPcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
|
|
6753
6753
|
return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6754
6754
|
}
|
|
6755
6755
|
/** Rectangular marquee in natural image pixels. */
|
|
@@ -6803,11 +6803,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6803
6803
|
if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
|
|
6804
6804
|
return null;
|
|
6805
6805
|
}
|
|
6806
|
-
const legacy =
|
|
6806
|
+
const legacy = _chunkPMEHFHSPcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
|
|
6807
6807
|
if (options.sample === "active-layer") {
|
|
6808
6808
|
const layer = this.getActiveLayer();
|
|
6809
6809
|
if (!layer || layer.type !== "pixel") {
|
|
6810
|
-
throw new (0,
|
|
6810
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
|
|
6811
6811
|
}
|
|
6812
6812
|
const surface = layer.source === "document" && options.pixels ? _chunkO7LUD7MHcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
|
|
6813
6813
|
return { width, height, data: _chunkO7LUD7MHcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
|
|
@@ -6816,7 +6816,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6816
6816
|
this.syncViews();
|
|
6817
6817
|
if (legacy && !options.pixels) {
|
|
6818
6818
|
const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
|
|
6819
|
-
|
|
6819
|
+
_chunkPMEHFHSPcjs.applyAdjustments.call(void 0, copy, _chunkPMEHFHSPcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
|
|
6820
6820
|
return copy;
|
|
6821
6821
|
}
|
|
6822
6822
|
const pixels = options.pixels;
|
|
@@ -6828,7 +6828,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6828
6828
|
};
|
|
6829
6829
|
const stack = withoutAnnotations(this.state.layers);
|
|
6830
6830
|
const layers = options.sampleMerged ? stack : pixelsOnly(stack);
|
|
6831
|
-
const data = new (0,
|
|
6831
|
+
const data = new (0, _chunkPMEHFHSPcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
|
|
6832
6832
|
return { width, height, data };
|
|
6833
6833
|
}
|
|
6834
6834
|
async requirePixels(options) {
|
|
@@ -6855,7 +6855,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6855
6855
|
modifySelection(op, radius) {
|
|
6856
6856
|
const sel = this.state.selection;
|
|
6857
6857
|
if (!_optionalChain([sel, 'optionalAccess', _258 => _258.bounds])) return false;
|
|
6858
|
-
return this.setSelection(
|
|
6858
|
+
return this.setSelection(_chunkPMEHFHSPcjs.modifySelection.call(void 0, sel, op, radius));
|
|
6859
6859
|
}
|
|
6860
6860
|
/**
|
|
6861
6861
|
* Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
|
|
@@ -6886,7 +6886,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6886
6886
|
} else {
|
|
6887
6887
|
pixels = source;
|
|
6888
6888
|
}
|
|
6889
|
-
this.setSelection(
|
|
6889
|
+
this.setSelection(_chunkPMEHFHSPcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6890
6890
|
return this.getSelection();
|
|
6891
6891
|
}
|
|
6892
6892
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
@@ -6898,7 +6898,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6898
6898
|
// --- Layer masks ---
|
|
6899
6899
|
maskFromSelection(sel, props = {}) {
|
|
6900
6900
|
const { width, height } = this.naturalSize;
|
|
6901
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
6901
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkPMEHFHSPcjs.resizeSelection.call(void 0, sel, width, height);
|
|
6902
6902
|
const mask = { surface: _chunkO7LUD7MHcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
|
|
6903
6903
|
return withMaskProps(mask, props);
|
|
6904
6904
|
}
|
|
@@ -6944,7 +6944,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6944
6944
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
6945
6945
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
6946
6946
|
const data = _chunkO7LUD7MHcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
6947
|
-
const sel =
|
|
6947
|
+
const sel = _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
6948
6948
|
return this.setSelection(sel, mode);
|
|
6949
6949
|
}
|
|
6950
6950
|
// --- Histogram ---
|
|
@@ -6974,9 +6974,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6974
6974
|
merged.depthRange = [...merged.depthRange];
|
|
6975
6975
|
this.state.layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
6976
6976
|
const next = { ...l };
|
|
6977
|
-
if (
|
|
6977
|
+
if (_chunkPMEHFHSPcjs.isDefaultDepthMask.call(void 0, merged)) {
|
|
6978
6978
|
if (_optionalChain([next, 'access', _264 => _264.mask, 'optionalAccess', _265 => _265.source])) delete next.mask;
|
|
6979
|
-
} else next.mask =
|
|
6979
|
+
} else next.mask = _chunkPMEHFHSPcjs.depthRasterMask.call(void 0, merged);
|
|
6980
6980
|
return next;
|
|
6981
6981
|
});
|
|
6982
6982
|
}
|
|
@@ -6997,7 +6997,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6997
6997
|
// --- Annotations & Layers ---
|
|
6998
6998
|
/** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
|
|
6999
6999
|
annotationLayer(id) {
|
|
7000
|
-
return _chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([
|
|
7000
|
+
return _chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkPMEHFHSPcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
|
|
7001
7001
|
}
|
|
7002
7002
|
/** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
|
|
7003
7003
|
annotationEnv() {
|
|
@@ -7013,7 +7013,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7013
7013
|
this.recordHistory();
|
|
7014
7014
|
const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
|
|
7015
7015
|
const fullAnnotation = { ...annotation, id };
|
|
7016
|
-
const layer =
|
|
7016
|
+
const layer = _chunkPMEHFHSPcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
|
|
7017
7017
|
const loc = placement.aboveId ? _chunkAEAAN4ADcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
7018
7018
|
this.state.layers = loc ? _chunkAEAAN4ADcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _269 => _269.parent, 'optionalAccess', _270 => _270.id]), () => ( null)), loc.index + 1) : _chunkAEAAN4ADcjs.insertLayer.call(void 0, this.state.layers, layer, null);
|
|
7019
7019
|
this.state.selectedAnnotationId = id;
|
|
@@ -7025,17 +7025,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
7025
7025
|
this.recordHistory();
|
|
7026
7026
|
}
|
|
7027
7027
|
const layer = this.annotationLayer(id);
|
|
7028
|
-
const current = layer ?
|
|
7028
|
+
const current = layer ? _chunkPMEHFHSPcjs.annotationOfLayer.call(void 0, layer) : null;
|
|
7029
7029
|
if (layer && current) {
|
|
7030
7030
|
const annotation = { ...current, ...partial, id };
|
|
7031
|
-
const name = layer.name ===
|
|
7031
|
+
const name = layer.name === _chunkPMEHFHSPcjs.annotationLayerName.call(void 0, current) ? _chunkPMEHFHSPcjs.annotationLayerName.call(void 0, annotation) : layer.name;
|
|
7032
7032
|
this.state.layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
|
|
7033
7033
|
}
|
|
7034
7034
|
this.notify();
|
|
7035
7035
|
}
|
|
7036
7036
|
/** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
|
|
7037
7037
|
layerForAnnotation(layer, annotation, name) {
|
|
7038
|
-
const fresh =
|
|
7038
|
+
const fresh = _chunkPMEHFHSPcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
|
|
7039
7039
|
const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
|
|
7040
7040
|
for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
7041
7041
|
if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
|
|
@@ -7322,8 +7322,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7322
7322
|
return;
|
|
7323
7323
|
}
|
|
7324
7324
|
const target = this.developLayer();
|
|
7325
|
-
if (!target) throw new (0,
|
|
7326
|
-
|
|
7325
|
+
if (!target) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("There is no pixel layer to mask.");
|
|
7326
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, target, "all", "mask it");
|
|
7327
7327
|
const { width, height } = this.naturalSize;
|
|
7328
7328
|
let px2 = await this.decodeImage(newDataUrl);
|
|
7329
7329
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
@@ -7331,14 +7331,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7331
7331
|
for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
|
|
7332
7332
|
let surface = _chunkO7LUD7MHcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
|
|
7333
7333
|
if (target.offset.x || target.offset.y) surface = _chunkO7LUD7MHcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
|
|
7334
|
-
this.commitLayers(
|
|
7334
|
+
this.commitLayers(_chunkPMEHFHSPcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
|
|
7335
7335
|
return target.id;
|
|
7336
7336
|
}
|
|
7337
7337
|
// --- Type layers ---
|
|
7338
7338
|
|
|
7339
7339
|
/** The shaper that lays out and draws type layers (`null` when there is none here). */
|
|
7340
7340
|
getTextShaper() {
|
|
7341
|
-
if (this.textShaperValue === void 0) this.textShaperValue =
|
|
7341
|
+
if (this.textShaperValue === void 0) this.textShaperValue = _chunkXFXHA5MUcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
|
|
7342
7342
|
return this.textShaperValue;
|
|
7343
7343
|
}
|
|
7344
7344
|
/** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
|
|
@@ -7355,7 +7355,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7355
7355
|
return _nullishCoalesce(_optionalChain([this, 'access', _277 => _277.getTextShaper, 'call', _278 => _278(), 'optionalAccess', _279 => _279.families, 'optionalCall', _280 => _280()]), () => ( ["sans-serif", "serif", "monospace"]));
|
|
7356
7356
|
}
|
|
7357
7357
|
typeInfo(id) {
|
|
7358
|
-
const layer =
|
|
7358
|
+
const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7359
7359
|
const ranges = (runs) => {
|
|
7360
7360
|
let at = 0;
|
|
7361
7361
|
return runs.map((r) => {
|
|
@@ -7368,7 +7368,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7368
7368
|
let lines = [];
|
|
7369
7369
|
let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
|
|
7370
7370
|
if (shaper) {
|
|
7371
|
-
const layout =
|
|
7371
|
+
const layout = _chunkXFXHA5MUcjs.layoutText.call(void 0, layer, shaper);
|
|
7372
7372
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7373
7373
|
lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
|
|
7374
7374
|
if (layer.rendering === "stored") missing = layout.missingFonts;
|
|
@@ -7398,25 +7398,25 @@ var ImageEditorController = (_class7 = class {
|
|
|
7398
7398
|
* text wrapped in `box`. Refused without a text shaper. Returns its id.
|
|
7399
7399
|
*/
|
|
7400
7400
|
addTextLayer(init) {
|
|
7401
|
-
const text =
|
|
7402
|
-
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0,
|
|
7403
|
-
const style =
|
|
7404
|
-
const paragraph =
|
|
7401
|
+
const text = _chunkPMEHFHSPcjs.normalizeText.call(void 0, init.text);
|
|
7402
|
+
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("x and y must be numbers (document pixels).");
|
|
7403
|
+
const style = _chunkPMEHFHSPcjs.patchTextStyle.call(void 0, { ..._chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
|
|
7404
|
+
const paragraph = _chunkPMEHFHSPcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
|
|
7405
7405
|
let frame = { kind: "point" };
|
|
7406
7406
|
if (init.box) {
|
|
7407
7407
|
const { width, height } = init.box;
|
|
7408
|
-
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0,
|
|
7408
|
+
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
|
|
7409
7409
|
frame = { kind: "box", width, height };
|
|
7410
7410
|
}
|
|
7411
|
-
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0,
|
|
7412
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7413
|
-
if (init.blend !== void 0 && !_chunkO7LUD7MHcjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7411
|
+
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("rotation must be a number of degrees.");
|
|
7412
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7413
|
+
if (init.blend !== void 0 && !_chunkO7LUD7MHcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7414
7414
|
const t = [1, 0, 0, 1, init.x, init.y];
|
|
7415
|
-
const transform = init.rotation ?
|
|
7416
|
-
const layer =
|
|
7415
|
+
const transform = init.rotation ? _chunkXFXHA5MUcjs.multiplyMatrices.call(void 0, t, _chunkXFXHA5MUcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
|
|
7416
|
+
const layer = _chunkPMEHFHSPcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkPMEHFHSPcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
|
|
7417
7417
|
if (init.opacity !== void 0) layer.opacity = init.opacity;
|
|
7418
7418
|
if (init.blend !== void 0) layer.blend = init.blend;
|
|
7419
|
-
const next =
|
|
7419
|
+
const next = _chunkPMEHFHSPcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7420
7420
|
this.commitLayers(next, () => {
|
|
7421
7421
|
this.state.activeLayerId = layer.id;
|
|
7422
7422
|
this.state.activeTarget = "pixels";
|
|
@@ -7428,28 +7428,28 @@ var ImageEditorController = (_class7 = class {
|
|
|
7428
7428
|
* `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
|
|
7429
7429
|
*/
|
|
7430
7430
|
setText(id, text, range = {}, commitToHistory = true) {
|
|
7431
|
-
const layer =
|
|
7432
|
-
const insert =
|
|
7433
|
-
const [start, end] =
|
|
7434
|
-
const { layers } =
|
|
7431
|
+
const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7432
|
+
const insert = _chunkPMEHFHSPcjs.normalizeText.call(void 0, text);
|
|
7433
|
+
const [start, end] = _chunkPMEHFHSPcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7434
|
+
const { layers } = _chunkPMEHFHSPcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkPMEHFHSPcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
|
|
7435
7435
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7436
7436
|
return this.typeInfo(id);
|
|
7437
7437
|
}
|
|
7438
7438
|
/** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
|
|
7439
7439
|
setTextStyle(id, style, range = {}, commitToHistory = true) {
|
|
7440
|
-
const layer =
|
|
7441
|
-
const [start, end] =
|
|
7442
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7443
|
-
|
|
7444
|
-
const { layers } =
|
|
7440
|
+
const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7441
|
+
const [start, end] = _chunkPMEHFHSPcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7442
|
+
if (!Object.keys(style).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one style field to set.");
|
|
7443
|
+
_chunkPMEHFHSPcjs.patchTextStyle.call(void 0, _chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE, style);
|
|
7444
|
+
const { layers } = _chunkPMEHFHSPcjs.updateTypeLayer.call(void 0,
|
|
7445
7445
|
this.state.layers,
|
|
7446
7446
|
id,
|
|
7447
7447
|
(l) => {
|
|
7448
7448
|
if (start === end) {
|
|
7449
|
-
if (l.text.length) throw new (0,
|
|
7450
|
-
return { runs: [{ length: 0, style:
|
|
7449
|
+
if (l.text.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
|
|
7450
|
+
return { runs: [{ length: 0, style: _chunkPMEHFHSPcjs.patchTextStyle.call(void 0, _chunkXFXHA5MUcjs.styleAt.call(void 0, l.runs, 0, _chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE), style) }] };
|
|
7451
7451
|
}
|
|
7452
|
-
return { runs:
|
|
7452
|
+
return { runs: _chunkXFXHA5MUcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkPMEHFHSPcjs.patchTextStyle.call(void 0, s, style)) };
|
|
7453
7453
|
},
|
|
7454
7454
|
this.textEnv(),
|
|
7455
7455
|
"restyle its text"
|
|
@@ -7459,11 +7459,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7459
7459
|
}
|
|
7460
7460
|
/** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
|
|
7461
7461
|
setParagraphStyle(id, style, range = {}, commitToHistory = true) {
|
|
7462
|
-
const layer =
|
|
7463
|
-
const [start, end] =
|
|
7464
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7465
|
-
|
|
7466
|
-
const { layers } =
|
|
7462
|
+
const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7463
|
+
const [start, end] = _chunkPMEHFHSPcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7464
|
+
if (!Object.keys(style).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one paragraph field to set.");
|
|
7465
|
+
_chunkPMEHFHSPcjs.patchParagraphStyle.call(void 0, {}, style);
|
|
7466
|
+
const { layers } = _chunkPMEHFHSPcjs.updateTypeLayer.call(void 0,
|
|
7467
7467
|
this.state.layers,
|
|
7468
7468
|
id,
|
|
7469
7469
|
(l) => {
|
|
@@ -7472,7 +7472,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7472
7472
|
const a = at;
|
|
7473
7473
|
at += p.length;
|
|
7474
7474
|
const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
|
|
7475
|
-
return touches || !l.text.length ? { length: p.length, style:
|
|
7475
|
+
return touches || !l.text.length ? { length: p.length, style: _chunkPMEHFHSPcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
|
|
7476
7476
|
});
|
|
7477
7477
|
return { paragraphs };
|
|
7478
7478
|
},
|
|
@@ -7488,21 +7488,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7488
7488
|
* paragraph. Also resizes a box. One undo step.
|
|
7489
7489
|
*/
|
|
7490
7490
|
setTextFrame(id, frame, commitToHistory = true) {
|
|
7491
|
-
const layer =
|
|
7492
|
-
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0,
|
|
7493
|
-
if (frame.kind !== "box" && frame.kind !== "point") throw new (0,
|
|
7491
|
+
const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7492
|
+
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("width and height must be at least 1 pixel.");
|
|
7493
|
+
if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("kind must be point or box.");
|
|
7494
7494
|
const shaper = this.getTextShaper();
|
|
7495
|
-
const { layers } =
|
|
7495
|
+
const { layers } = _chunkPMEHFHSPcjs.updateTypeLayer.call(void 0,
|
|
7496
7496
|
this.state.layers,
|
|
7497
7497
|
id,
|
|
7498
7498
|
(l) => {
|
|
7499
7499
|
if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
|
|
7500
|
-
if (!shaper) throw new (0,
|
|
7501
|
-
const lines =
|
|
7500
|
+
if (!shaper) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
|
|
7501
|
+
const lines = _chunkXFXHA5MUcjs.layoutText.call(void 0, l, shaper).lines;
|
|
7502
7502
|
const first = lines[0];
|
|
7503
7503
|
const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
|
|
7504
7504
|
const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
|
|
7505
|
-
const m =
|
|
7505
|
+
const m = _chunkPMEHFHSPcjs.textMatrix.call(void 0, l);
|
|
7506
7506
|
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]];
|
|
7507
7507
|
const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
|
|
7508
7508
|
return { frame: nextFrame, transform: shifted };
|
|
@@ -7519,21 +7519,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7519
7519
|
* `warnings` says when other colours were dropped. One undo step.
|
|
7520
7520
|
*/
|
|
7521
7521
|
convertTextToShape(id) {
|
|
7522
|
-
const layer =
|
|
7523
|
-
|
|
7522
|
+
const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7523
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
|
|
7524
7524
|
const shaper = this.getTextShaper();
|
|
7525
|
-
if (!shaper) throw new (0,
|
|
7526
|
-
const parts =
|
|
7527
|
-
const subpaths = parts.flatMap((p) =>
|
|
7528
|
-
if (!subpaths.length) throw new (0,
|
|
7525
|
+
if (!shaper) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
|
|
7526
|
+
const parts = _chunkPMEHFHSPcjs.textOutlines.call(void 0, layer, shaper);
|
|
7527
|
+
const subpaths = parts.flatMap((p) => _chunkXFXHA5MUcjs.bezierToSubpaths.call(void 0, p.path));
|
|
7528
|
+
if (!subpaths.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
|
|
7529
7529
|
const warnings = [];
|
|
7530
7530
|
const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
|
|
7531
7531
|
if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
|
|
7532
|
-
const missing =
|
|
7532
|
+
const missing = _chunkXFXHA5MUcjs.layoutText.call(void 0, layer, shaper).missingFonts;
|
|
7533
7533
|
if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
|
|
7534
|
-
const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => (
|
|
7534
|
+
const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => ( _chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE));
|
|
7535
7535
|
const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
|
|
7536
|
-
const shape =
|
|
7536
|
+
const shape = _chunkPMEHFHSPcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
|
|
7537
7537
|
const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
|
|
7538
7538
|
for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
7539
7539
|
this.commitLayers(_chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
|
|
@@ -7541,23 +7541,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
7541
7541
|
}
|
|
7542
7542
|
/** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
|
|
7543
7543
|
getTextLayout(id) {
|
|
7544
|
-
const layer =
|
|
7544
|
+
const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7545
7545
|
const shaper = this.getTextShaper();
|
|
7546
|
-
return shaper ?
|
|
7546
|
+
return shaper ? _chunkXFXHA5MUcjs.layoutText.call(void 0, layer, shaper) : null;
|
|
7547
7547
|
}
|
|
7548
7548
|
/** The text index nearest a document point (for clicks on a type layer). */
|
|
7549
7549
|
textIndexAt(id, point) {
|
|
7550
|
-
const layer =
|
|
7550
|
+
const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7551
7551
|
const layout = this.getTextLayout(id);
|
|
7552
|
-
return layout ?
|
|
7552
|
+
return layout ? _chunkXFXHA5MUcjs.textIndexAt.call(void 0, layout, _chunkPMEHFHSPcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
|
|
7553
7553
|
}
|
|
7554
7554
|
/** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
|
|
7555
7555
|
textCaret(id, index) {
|
|
7556
|
-
const layer =
|
|
7556
|
+
const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7557
7557
|
const layout = this.getTextLayout(id);
|
|
7558
7558
|
if (!layout) return null;
|
|
7559
|
-
const c =
|
|
7560
|
-
const m =
|
|
7559
|
+
const c = _chunkXFXHA5MUcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
|
|
7560
|
+
const m = _chunkPMEHFHSPcjs.textMatrix.call(void 0, layer);
|
|
7561
7561
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
7562
7562
|
return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
|
|
7563
7563
|
}
|
|
@@ -7568,14 +7568,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7568
7568
|
}
|
|
7569
7569
|
/** One component from tool or UI input (validated). */
|
|
7570
7570
|
componentFrom(spec, path) {
|
|
7571
|
-
const op =
|
|
7572
|
-
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0,
|
|
7573
|
-
if (spec.shape !== void 0) return
|
|
7574
|
-
if (spec.subpaths !== void 0) return { op, subpaths:
|
|
7575
|
-
throw new (0,
|
|
7571
|
+
const op = _chunkPMEHFHSPcjs.requireOperation.call(void 0, spec.op, `${path}op`);
|
|
7572
|
+
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
|
|
7573
|
+
if (spec.shape !== void 0) return _chunkPMEHFHSPcjs.liveComponent.call(void 0, _chunkPMEHFHSPcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
|
|
7574
|
+
if (spec.subpaths !== void 0) return { op, subpaths: _chunkPMEHFHSPcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
|
|
7575
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
|
|
7576
7576
|
}
|
|
7577
7577
|
shapeInfo(id) {
|
|
7578
|
-
const layer =
|
|
7578
|
+
const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7579
7579
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7580
7580
|
const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
|
|
7581
7581
|
const info = {
|
|
@@ -7585,13 +7585,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
7585
7585
|
index,
|
|
7586
7586
|
op: c.op,
|
|
7587
7587
|
live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
|
|
7588
|
-
subpaths:
|
|
7589
|
-
bounds: box(
|
|
7588
|
+
subpaths: _chunkXFXHA5MUcjs.roundSubpaths.call(void 0, c.subpaths),
|
|
7589
|
+
bounds: box(_chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
|
|
7590
7590
|
})),
|
|
7591
7591
|
fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
|
|
7592
7592
|
fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
|
|
7593
7593
|
stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
|
|
7594
|
-
geometryBounds: box(
|
|
7594
|
+
geometryBounds: box(_chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, layer)),
|
|
7595
7595
|
bounds: this.getLayerBounds(id)
|
|
7596
7596
|
};
|
|
7597
7597
|
if (layer.annotation) info.annotationId = layer.annotation.id;
|
|
@@ -7608,17 +7608,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
7608
7608
|
*/
|
|
7609
7609
|
addShapeLayer(init) {
|
|
7610
7610
|
const specs = _optionalChain([init, 'access', _289 => _289.components, 'optionalAccess', _290 => _290.length]) ? init.components : [init];
|
|
7611
|
-
if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0,
|
|
7611
|
+
if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
|
|
7612
7612
|
const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _293 => _293.components, 'optionalAccess', _294 => _294.length]) ? `components[${i}].` : ""));
|
|
7613
|
-
const stroke = init.stroke ?
|
|
7613
|
+
const stroke = init.stroke ? _chunkPMEHFHSPcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
|
|
7614
7614
|
const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
|
|
7615
|
-
const fill = init.fill === void 0 ? stroke && openOnly ? null :
|
|
7616
|
-
if (!fill && !stroke) throw new (0,
|
|
7617
|
-
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0,
|
|
7618
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7619
|
-
if (init.blend !== void 0 && !_chunkO7LUD7MHcjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7620
|
-
const layer =
|
|
7621
|
-
const next =
|
|
7615
|
+
const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkPMEHFHSPcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkPMEHFHSPcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
|
|
7616
|
+
if (!fill && !stroke) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
|
|
7617
|
+
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7618
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7619
|
+
if (init.blend !== void 0 && !_chunkO7LUD7MHcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7620
|
+
const layer = _chunkPMEHFHSPcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
|
|
7621
|
+
const next = _chunkPMEHFHSPcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7622
7622
|
this.commitLayers(next, () => {
|
|
7623
7623
|
this.state.activeLayerId = layer.id;
|
|
7624
7624
|
this.state.activeTarget = "pixels";
|
|
@@ -7631,18 +7631,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
7631
7631
|
* only those settings of the current stroke. Returns the shape.
|
|
7632
7632
|
*/
|
|
7633
7633
|
setShapeStyle(id, changes, commitToHistory = true) {
|
|
7634
|
-
const layer =
|
|
7635
|
-
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null :
|
|
7636
|
-
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null :
|
|
7637
|
-
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0,
|
|
7634
|
+
const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7635
|
+
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkPMEHFHSPcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
|
|
7636
|
+
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkPMEHFHSPcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
|
|
7637
|
+
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7638
7638
|
const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
|
|
7639
|
-
const { layers } =
|
|
7639
|
+
const { layers } = _chunkPMEHFHSPcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
|
|
7640
7640
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7641
7641
|
return this.shapeInfo(id);
|
|
7642
7642
|
}
|
|
7643
7643
|
componentIndex(layer, index) {
|
|
7644
7644
|
if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
|
|
7645
|
-
throw new (0,
|
|
7645
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
|
|
7646
7646
|
}
|
|
7647
7647
|
return index;
|
|
7648
7648
|
}
|
|
@@ -7652,36 +7652,36 @@ var ImageEditorController = (_class7 = class {
|
|
|
7652
7652
|
* the live shape) or its operation. Returns the shape.
|
|
7653
7653
|
*/
|
|
7654
7654
|
setShapeComponent(id, index, change, commitToHistory = true) {
|
|
7655
|
-
const layer =
|
|
7655
|
+
const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7656
7656
|
const i = this.componentIndex(layer, index);
|
|
7657
7657
|
const current = layer.components[i];
|
|
7658
7658
|
let shape = change.shape;
|
|
7659
7659
|
if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
|
|
7660
7660
|
else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
|
|
7661
|
-
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op:
|
|
7661
|
+
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkPMEHFHSPcjs.requireOperation.call(void 0, change.op) };
|
|
7662
7662
|
const components = layer.components.map((c, k) => k === i ? next : c);
|
|
7663
|
-
const { layers } =
|
|
7663
|
+
const { layers } = _chunkPMEHFHSPcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7664
7664
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7665
7665
|
return this.shapeInfo(id);
|
|
7666
7666
|
}
|
|
7667
7667
|
/** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
|
|
7668
7668
|
addShapeComponent(id, spec, index) {
|
|
7669
|
-
const layer =
|
|
7669
|
+
const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7670
7670
|
const c = this.componentFrom(spec, "");
|
|
7671
7671
|
const at = index === void 0 ? layer.components.length : index;
|
|
7672
|
-
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0,
|
|
7672
|
+
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
|
|
7673
7673
|
const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
|
|
7674
|
-
const { layers } =
|
|
7674
|
+
const { layers } = _chunkPMEHFHSPcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7675
7675
|
this.commitLayers(layers);
|
|
7676
7676
|
return this.shapeInfo(id);
|
|
7677
7677
|
}
|
|
7678
7678
|
/** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
|
|
7679
7679
|
removeShapeComponent(id, index) {
|
|
7680
|
-
const layer =
|
|
7680
|
+
const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7681
7681
|
const i = this.componentIndex(layer, index);
|
|
7682
|
-
if (layer.components.length === 1) throw new (0,
|
|
7682
|
+
if (layer.components.length === 1) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
|
|
7683
7683
|
const components = layer.components.filter((_, k) => k !== i);
|
|
7684
|
-
const { layers } =
|
|
7684
|
+
const { layers } = _chunkPMEHFHSPcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7685
7685
|
this.commitLayers(layers);
|
|
7686
7686
|
return this.shapeInfo(id);
|
|
7687
7687
|
}
|
|
@@ -7690,10 +7690,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7690
7690
|
* shapes become paths), as one undo step. Returns the shape.
|
|
7691
7691
|
*/
|
|
7692
7692
|
mergeShapeComponents(id) {
|
|
7693
|
-
const layer =
|
|
7694
|
-
if (layer.components.length < 2) throw new (0,
|
|
7695
|
-
const components =
|
|
7696
|
-
const { layers } =
|
|
7693
|
+
const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7694
|
+
if (layer.components.length < 2) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
|
|
7695
|
+
const components = _chunkPMEHFHSPcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
|
|
7696
|
+
const { layers } = _chunkPMEHFHSPcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
|
|
7697
7697
|
this.commitLayers(layers);
|
|
7698
7698
|
return this.shapeInfo(id);
|
|
7699
7699
|
}
|
|
@@ -7703,8 +7703,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7703
7703
|
* step. Returns the layer id.
|
|
7704
7704
|
*/
|
|
7705
7705
|
async rasterizeLayer(id) {
|
|
7706
|
-
const layer =
|
|
7707
|
-
|
|
7706
|
+
const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
7707
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
|
|
7708
7708
|
const { width, height } = this.naturalSize;
|
|
7709
7709
|
const canvas = { x: 0, y: 0, width, height };
|
|
7710
7710
|
let next;
|
|
@@ -7720,8 +7720,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7720
7720
|
if (layer.locks) next.locks = layer.locks;
|
|
7721
7721
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
7722
7722
|
} else if (layer.type === "pixel") {
|
|
7723
|
-
if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0,
|
|
7724
|
-
|
|
7723
|
+
if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
|
|
7724
|
+
_chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
|
|
7725
7725
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
7726
7726
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
7727
7727
|
delete content.mask;
|
|
@@ -7738,10 +7738,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7738
7738
|
} else if (layer.type === "smart") {
|
|
7739
7739
|
return this.rasterizeSmartObject(id);
|
|
7740
7740
|
} else if (layer.type === "shape" || layer.type === "type") {
|
|
7741
|
-
next = layer.type === "shape" ?
|
|
7741
|
+
next = layer.type === "shape" ? _chunkPMEHFHSPcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkPMEHFHSPcjs.typeAsPixelLayer.call(void 0, layer);
|
|
7742
7742
|
if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _297 => _297.annotation, 'optionalAccess', _298 => _298.id])) this.state.selectedAnnotationId = null;
|
|
7743
7743
|
} else {
|
|
7744
|
-
throw new (0,
|
|
7744
|
+
throw new (0, _chunkPMEHFHSPcjs.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.`);
|
|
7745
7745
|
}
|
|
7746
7746
|
this.commitLayers(_chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
|
|
7747
7747
|
return id;
|
|
@@ -7766,7 +7766,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7766
7766
|
setColorMode(mode, options = {}) {
|
|
7767
7767
|
let next;
|
|
7768
7768
|
if (mode === "rgb") {
|
|
7769
|
-
if (options.profile !== void 0) throw new (0,
|
|
7769
|
+
if (options.profile !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
|
|
7770
7770
|
next = null;
|
|
7771
7771
|
} else if (mode === "lab") next = { mode: "lab" };
|
|
7772
7772
|
else if (mode === "cmyk") {
|
|
@@ -7774,14 +7774,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7774
7774
|
try {
|
|
7775
7775
|
doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
|
|
7776
7776
|
} catch (e) {
|
|
7777
|
-
throw new (0,
|
|
7777
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7778
7778
|
}
|
|
7779
7779
|
const cs = resolveProfile(doc).colorSpace;
|
|
7780
|
-
if (cs !== "cmyk") throw new (0,
|
|
7780
|
+
if (cs !== "cmyk") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
|
|
7781
7781
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7782
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7782
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7783
7783
|
next = { mode: "cmyk", profile: doc, intent };
|
|
7784
|
-
} else throw new (0,
|
|
7784
|
+
} else throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
|
|
7785
7785
|
this.recordHistory();
|
|
7786
7786
|
if (next) this.state.colorMode = next;
|
|
7787
7787
|
else delete this.state.colorMode;
|
|
@@ -7794,10 +7794,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7794
7794
|
try {
|
|
7795
7795
|
doc = documentProfile(profile);
|
|
7796
7796
|
} catch (e) {
|
|
7797
|
-
throw new (0,
|
|
7797
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7798
7798
|
}
|
|
7799
7799
|
const cs = resolveProfile(doc).colorSpace;
|
|
7800
|
-
if (cs !== "rgb") throw new (0,
|
|
7800
|
+
if (cs !== "rgb") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
|
|
7801
7801
|
return doc;
|
|
7802
7802
|
}
|
|
7803
7803
|
/**
|
|
@@ -7823,7 +7823,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7823
7823
|
convertToProfile(profile, options = {}) {
|
|
7824
7824
|
const doc = this.rgbProfileArg(profile, "Convert to Profile");
|
|
7825
7825
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7826
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7826
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7827
7827
|
const t = _chunkG5NMLUVFcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7828
7828
|
const converted = [];
|
|
7829
7829
|
const unconverted = [];
|
|
@@ -7853,11 +7853,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7853
7853
|
else if (l.type === "pixel") next2 = { ...next2, surface: convertSurfaceColors(this.surfaceOf(l), t), source: void 0 };
|
|
7854
7854
|
else if (l.type === "shape") {
|
|
7855
7855
|
const s = next2;
|
|
7856
|
-
next2 =
|
|
7856
|
+
next2 = _chunkPMEHFHSPcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
|
|
7857
7857
|
} else if (l.type === "type") {
|
|
7858
7858
|
const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
|
|
7859
7859
|
try {
|
|
7860
|
-
next2 =
|
|
7860
|
+
next2 = _chunkPMEHFHSPcjs.rerenderText.call(void 0, recoloured, textEnv);
|
|
7861
7861
|
} catch (e27) {
|
|
7862
7862
|
next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
|
|
7863
7863
|
}
|
|
@@ -7887,12 +7887,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
7887
7887
|
try {
|
|
7888
7888
|
doc = documentProfile(setup.profile);
|
|
7889
7889
|
} catch (e) {
|
|
7890
|
-
throw new (0,
|
|
7890
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7891
7891
|
}
|
|
7892
7892
|
const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
|
|
7893
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7893
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7894
7894
|
const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
|
|
7895
|
-
if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0,
|
|
7895
|
+
if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
|
|
7896
7896
|
this.state.proofSetup = next;
|
|
7897
7897
|
this.notify();
|
|
7898
7898
|
return next;
|
|
@@ -7909,14 +7909,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7909
7909
|
src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
|
|
7910
7910
|
dst = resolveProfile(documentProfile(to));
|
|
7911
7911
|
} catch (e) {
|
|
7912
|
-
throw new (0,
|
|
7912
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7913
7913
|
}
|
|
7914
|
-
if (src.colorSpace !== "rgb") throw new (0,
|
|
7914
|
+
if (src.colorSpace !== "rgb") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
|
|
7915
7915
|
const t = _chunkG5NMLUVFcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7916
7916
|
const toLab = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
|
|
7917
7917
|
return colors.map((input) => {
|
|
7918
7918
|
const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
|
|
7919
|
-
if (!m) throw new (0,
|
|
7919
|
+
if (!m) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
|
|
7920
7920
|
const n = parseInt(m[1], 16);
|
|
7921
7921
|
const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
|
|
7922
7922
|
const out = new Float32Array(16);
|
|
@@ -7942,7 +7942,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7942
7942
|
* the ids of the layers whose pixels changed.
|
|
7943
7943
|
*/
|
|
7944
7944
|
setBitDepth(depth) {
|
|
7945
|
-
if (!_chunkO7LUD7MHcjs.isBitDepth.call(void 0, depth)) throw new (0,
|
|
7945
|
+
if (!_chunkO7LUD7MHcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
|
|
7946
7946
|
const changed = [];
|
|
7947
7947
|
const withMask = (l) => {
|
|
7948
7948
|
const m = l.mask;
|
|
@@ -7991,7 +7991,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7991
7991
|
* Throws `PsdError` for files that cannot be read at all.
|
|
7992
7992
|
*/
|
|
7993
7993
|
loadPsd(bytes) {
|
|
7994
|
-
const result =
|
|
7994
|
+
const result = _chunkPMEHFHSPcjs.importPsd.call(void 0, bytes, { newId: () => _chunkPMEHFHSPcjs.newLayerId.call(void 0, ) });
|
|
7995
7995
|
this.abandonContents();
|
|
7996
7996
|
this.recordHistory();
|
|
7997
7997
|
const s = this.state;
|
|
@@ -8001,7 +8001,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8001
8001
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
8002
8002
|
s.layers = this.checkPsdFonts(result);
|
|
8003
8003
|
s.crop = null;
|
|
8004
|
-
s.transform = { ...
|
|
8004
|
+
s.transform = { ..._chunkPMEHFHSPcjs.DEFAULT_TRANSFORM_VALUES };
|
|
8005
8005
|
s.outputOpacity = 1;
|
|
8006
8006
|
delete s.legacyOutputBlur;
|
|
8007
8007
|
s.selection = null;
|
|
@@ -8052,7 +8052,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8052
8052
|
let layers = result.layers;
|
|
8053
8053
|
const missing = /* @__PURE__ */ new Map();
|
|
8054
8054
|
for (const l of types) {
|
|
8055
|
-
const fonts = shaper ?
|
|
8055
|
+
const fonts = shaper ? _chunkXFXHA5MUcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
|
|
8056
8056
|
if (!fonts.length) continue;
|
|
8057
8057
|
layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
|
|
8058
8058
|
for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
|
|
@@ -8080,7 +8080,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8080
8080
|
const canRasterize = this.renderer.canRasterize();
|
|
8081
8081
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
8082
8082
|
const sources = this.renderer.compositorSources(width, height);
|
|
8083
|
-
const compositor = new (0,
|
|
8083
|
+
const compositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)();
|
|
8084
8084
|
const bakeMask = (layer) => {
|
|
8085
8085
|
const mask = layer.mask;
|
|
8086
8086
|
if (!_optionalChain([mask, 'optionalAccess', _309 => _309.source])) return mask;
|
|
@@ -8162,7 +8162,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8162
8162
|
out.surface = this.surfaceOf(layer);
|
|
8163
8163
|
delete out.source;
|
|
8164
8164
|
}
|
|
8165
|
-
const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(
|
|
8165
|
+
const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunkPMEHFHSPcjs.isActiveFilter)]), () => ( []));
|
|
8166
8166
|
if (active.length) {
|
|
8167
8167
|
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
8168
8168
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -8195,8 +8195,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8195
8195
|
const color = this.psdColorOptions(warnings);
|
|
8196
8196
|
if (color.colorMode && this.bitDepth === 32) warnings.push(`${color.colorMode.toUpperCase()} files are written at 16 bits per channel at most; the 32-bit samples were converted (colour above 1 clipped).`);
|
|
8197
8197
|
const depth = color.colorMode && this.bitDepth === 32 ? 16 : this.bitDepth;
|
|
8198
|
-
const mergedDeep = depth === 8 ? void 0 : _chunkAEAAN4ADcjs.workingToSamples.call(void 0,
|
|
8199
|
-
const result =
|
|
8198
|
+
const mergedDeep = depth === 8 ? void 0 : _chunkAEAAN4ADcjs.workingToSamples.call(void 0, _chunkPMEHFHSPcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
|
|
8199
|
+
const result = _chunkPMEHFHSPcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
|
|
8200
8200
|
warnings.push(...result.warnings);
|
|
8201
8201
|
return { bytes: result.bytes, warnings, psb: result.psb, width, height };
|
|
8202
8202
|
}
|
|
@@ -8212,13 +8212,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
8212
8212
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
8213
8213
|
if (this.state.selection && (sx !== 1 || sy !== 1)) {
|
|
8214
8214
|
this.state.selection = normalizeSelection(
|
|
8215
|
-
|
|
8215
|
+
_chunkPMEHFHSPcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
|
|
8216
8216
|
);
|
|
8217
8217
|
}
|
|
8218
8218
|
let layers = this.state.layers;
|
|
8219
8219
|
if (sx !== 1 || sy !== 1) {
|
|
8220
8220
|
if (this.state.crop) {
|
|
8221
|
-
this.state.crop =
|
|
8221
|
+
this.state.crop = _chunkPMEHFHSPcjs.clampCropToImage.call(void 0,
|
|
8222
8222
|
{
|
|
8223
8223
|
x: Math.round(this.state.crop.x * sx),
|
|
8224
8224
|
y: Math.round(this.state.crop.y * sy),
|
|
@@ -8237,17 +8237,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
8237
8237
|
} else if (l.type === "shape") {
|
|
8238
8238
|
const a = l.annotation;
|
|
8239
8239
|
const scaled = a ? scaleAnnotation(a, sx, sy) : null;
|
|
8240
|
-
const fromAnnotation = scaled ?
|
|
8240
|
+
const fromAnnotation = scaled ? _chunkPMEHFHSPcjs.shapeFromAnnotation.call(void 0, scaled) : null;
|
|
8241
8241
|
const m = [sx, 0, 0, sy, 0, 0];
|
|
8242
|
-
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => (
|
|
8242
|
+
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunkPMEHFHSPcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
|
|
8243
8243
|
const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
|
|
8244
8244
|
if (scaled && fromAnnotation) moved.annotation = scaled;
|
|
8245
8245
|
else delete moved.annotation;
|
|
8246
|
-
layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, l.id, () =>
|
|
8246
|
+
layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, l.id, () => _chunkPMEHFHSPcjs.rerenderShape.call(void 0, moved, env));
|
|
8247
8247
|
}
|
|
8248
8248
|
}
|
|
8249
8249
|
}
|
|
8250
|
-
const bg =
|
|
8250
|
+
const bg = _chunkPMEHFHSPcjs.developTarget.call(void 0, layers, null);
|
|
8251
8251
|
if (bg && bg.source !== "document") layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
|
|
8252
8252
|
if (clearAnnotations) {
|
|
8253
8253
|
for (const l of _chunkAEAAN4ADcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, l.id, () => null);
|
|
@@ -8268,7 +8268,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8268
8268
|
let out;
|
|
8269
8269
|
try {
|
|
8270
8270
|
out = this.serializeState();
|
|
8271
|
-
if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection =
|
|
8271
|
+
if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunkPMEHFHSPcjs.serializeSelection.call(void 0, this.state.selection);
|
|
8272
8272
|
} finally {
|
|
8273
8273
|
if (root) {
|
|
8274
8274
|
this.state = current;
|
|
@@ -8276,8 +8276,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8276
8276
|
this.viewKey = [];
|
|
8277
8277
|
}
|
|
8278
8278
|
}
|
|
8279
|
-
if (!options || out.version !==
|
|
8280
|
-
return
|
|
8279
|
+
if (!options || out.version !== _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
|
|
8280
|
+
return _chunkPMEHFHSPcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
|
|
8281
8281
|
}
|
|
8282
8282
|
/**
|
|
8283
8283
|
* Loads a stored state whose v3 assets may live in an asset store (references other than data
|
|
@@ -8285,12 +8285,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
8285
8285
|
* out and listed in `lastLoadProblems`.
|
|
8286
8286
|
*/
|
|
8287
8287
|
async loadJSONAsync(data, options = {}) {
|
|
8288
|
-
if (data.version !==
|
|
8288
|
+
if (data.version !== _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
|
|
8289
8289
|
this.loadJSON(data);
|
|
8290
8290
|
return;
|
|
8291
8291
|
}
|
|
8292
8292
|
const problems = [];
|
|
8293
|
-
const assets = await
|
|
8293
|
+
const assets = await _chunkPMEHFHSPcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
|
|
8294
8294
|
this.loadJSON({ ...data, assets });
|
|
8295
8295
|
this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
|
|
8296
8296
|
}
|
|
@@ -8302,7 +8302,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8302
8302
|
let selection = null;
|
|
8303
8303
|
if (data.selection) {
|
|
8304
8304
|
try {
|
|
8305
|
-
selection = normalizeSelection(
|
|
8305
|
+
selection = normalizeSelection(_chunkPMEHFHSPcjs.deserializeSelection.call(void 0, data.selection));
|
|
8306
8306
|
} catch (e28) {
|
|
8307
8307
|
selection = null;
|
|
8308
8308
|
}
|
|
@@ -8320,8 +8320,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8320
8320
|
if (isLayered(data)) {
|
|
8321
8321
|
const problems = [];
|
|
8322
8322
|
const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
|
|
8323
|
-
const storedPatterns =
|
|
8324
|
-
s.layers =
|
|
8323
|
+
const storedPatterns = _chunkPMEHFHSPcjs.deserializePatterns.call(void 0, data.patterns, []);
|
|
8324
|
+
s.layers = _chunkPMEHFHSPcjs.deserializeLayers.call(void 0, data.layers, {
|
|
8325
8325
|
assets: _nullishCoalesce(data.assets, () => ( {})),
|
|
8326
8326
|
problems,
|
|
8327
8327
|
smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
|
|
@@ -8339,7 +8339,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8339
8339
|
const light = data.globalLight;
|
|
8340
8340
|
if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
|
|
8341
8341
|
else delete s.globalLight;
|
|
8342
|
-
const patterns =
|
|
8342
|
+
const patterns = _chunkPMEHFHSPcjs.deserializePatterns.call(void 0, data.patterns, problems);
|
|
8343
8343
|
if (patterns.length) s.patterns = patterns;
|
|
8344
8344
|
else delete s.patterns;
|
|
8345
8345
|
if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
|
|
@@ -8355,7 +8355,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8355
8355
|
}
|
|
8356
8356
|
} else {
|
|
8357
8357
|
const { width, height } = this.naturalSize;
|
|
8358
|
-
const stack =
|
|
8358
|
+
const stack = _chunkPMEHFHSPcjs.layersFromLegacy.call(void 0, data, width, height);
|
|
8359
8359
|
s.layers = stack.layers;
|
|
8360
8360
|
s.outputOpacity = stack.outputOpacity;
|
|
8361
8361
|
if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
|
|
@@ -8376,7 +8376,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8376
8376
|
}
|
|
8377
8377
|
serializeState() {
|
|
8378
8378
|
const { width, height } = this.naturalSize;
|
|
8379
|
-
const view =
|
|
8379
|
+
const view = _chunkPMEHFHSPcjs.legacyView.call(void 0, this.stack(), width, height, null);
|
|
8380
8380
|
if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _330 => _330.state, 'access', _331 => _331.patterns, 'optionalAccess', _332 => _332.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
|
|
8381
8381
|
return {
|
|
8382
8382
|
// States without adjustment layers keep schema 1, so they round-trip unchanged.
|
|
@@ -8391,9 +8391,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
8391
8391
|
annotations: JSON.parse(JSON.stringify(view.annotations))
|
|
8392
8392
|
};
|
|
8393
8393
|
}
|
|
8394
|
-
const { layers, assets, smartContents } =
|
|
8394
|
+
const { layers, assets, smartContents } = _chunkPMEHFHSPcjs.serializeLayers.call(void 0, this.state.layers);
|
|
8395
8395
|
const out = {
|
|
8396
|
-
version:
|
|
8396
|
+
version: _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION,
|
|
8397
8397
|
width,
|
|
8398
8398
|
height,
|
|
8399
8399
|
layers,
|
|
@@ -8405,7 +8405,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8405
8405
|
};
|
|
8406
8406
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
8407
8407
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
8408
|
-
if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns =
|
|
8408
|
+
if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunkPMEHFHSPcjs.serializePatterns.call(void 0, this.state.patterns);
|
|
8409
8409
|
if (smartContents) out.smartContents = smartContents;
|
|
8410
8410
|
if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
|
|
8411
8411
|
if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
|
|
@@ -8417,7 +8417,7 @@ function serializeAdjustments(adjustments) {
|
|
|
8417
8417
|
const out = { ...adjustments };
|
|
8418
8418
|
if (_optionalChain([out, 'access', _339 => _339.layers, 'optionalAccess', _340 => _340.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
8419
8419
|
else delete out.layers;
|
|
8420
|
-
if (
|
|
8420
|
+
if (_chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkPMEHFHSPcjs.LEGACY_PROCESS_VERSION) {
|
|
8421
8421
|
delete out.process;
|
|
8422
8422
|
if (!out.tint) delete out.tint;
|
|
8423
8423
|
}
|
|
@@ -8428,7 +8428,7 @@ function withDevelop(layer, partial) {
|
|
|
8428
8428
|
let i = filters.findIndex((f) => f.kind === "develop");
|
|
8429
8429
|
if (i === -1) {
|
|
8430
8430
|
filters.unshift({
|
|
8431
|
-
id: layer.source === "document" ?
|
|
8431
|
+
id: layer.source === "document" ? _chunkPMEHFHSPcjs.DEVELOP_FILTER_ID : _chunkPMEHFHSPcjs.newLayerId.call(void 0, "flt"),
|
|
8432
8432
|
kind: "develop",
|
|
8433
8433
|
enabled: true,
|
|
8434
8434
|
brightness: 0,
|
|
@@ -8437,7 +8437,7 @@ function withDevelop(layer, partial) {
|
|
|
8437
8437
|
exposure: 0,
|
|
8438
8438
|
temperature: 0,
|
|
8439
8439
|
tint: 0,
|
|
8440
|
-
process:
|
|
8440
|
+
process: _chunkPMEHFHSPcjs.LATEST_PROCESS_VERSION
|
|
8441
8441
|
});
|
|
8442
8442
|
i = 0;
|
|
8443
8443
|
}
|
|
@@ -8446,7 +8446,7 @@ function withDevelop(layer, partial) {
|
|
|
8446
8446
|
const v = partial[k];
|
|
8447
8447
|
if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
|
|
8448
8448
|
}
|
|
8449
|
-
if ("process" in partial) next.process =
|
|
8449
|
+
if ("process" in partial) next.process = _chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, partial.process);
|
|
8450
8450
|
filters[i] = next;
|
|
8451
8451
|
return { ...layer, filters };
|
|
8452
8452
|
}
|
|
@@ -8455,7 +8455,7 @@ function withBlur(layer, radius) {
|
|
|
8455
8455
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
8456
8456
|
if (radius > 0) {
|
|
8457
8457
|
filters.push({
|
|
8458
|
-
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ?
|
|
8458
|
+
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunkPMEHFHSPcjs.BLUR_FILTER_ID : _chunkPMEHFHSPcjs.newLayerId.call(void 0, "flt")))),
|
|
8459
8459
|
kind: "blur",
|
|
8460
8460
|
enabled: true,
|
|
8461
8461
|
radius
|
|
@@ -8479,7 +8479,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8479
8479
|
if (!update.mask) delete next.mask;
|
|
8480
8480
|
else {
|
|
8481
8481
|
const current = node.mask && !node.mask.source ? node.mask : null;
|
|
8482
|
-
const memo = current ?
|
|
8482
|
+
const memo = current ? _chunkPMEHFHSPcjs.legacyMaskOf.call(void 0, current, width, height) : null;
|
|
8483
8483
|
if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
|
|
8484
8484
|
next.mask = withMaskProps(current, {
|
|
8485
8485
|
density: _nullishCoalesce(update.mask.density, () => ( 1)),
|
|
@@ -8487,7 +8487,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8487
8487
|
enabled: update.mask.enabled !== false
|
|
8488
8488
|
});
|
|
8489
8489
|
} else {
|
|
8490
|
-
const m =
|
|
8490
|
+
const m = _chunkPMEHFHSPcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
|
|
8491
8491
|
if (m) next.mask = m;
|
|
8492
8492
|
else delete next.mask;
|
|
8493
8493
|
}
|
|
@@ -8526,7 +8526,7 @@ function resizeLegacyMasks(layers, from, to) {
|
|
|
8526
8526
|
for (const l of _chunkAEAAN4ADcjs.flattenLayers.call(void 0, layers)) {
|
|
8527
8527
|
if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
|
|
8528
8528
|
const old = l.mask;
|
|
8529
|
-
const mask =
|
|
8529
|
+
const mask = _chunkPMEHFHSPcjs.rasterMaskFromLegacy.call(void 0, _chunkPMEHFHSPcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
|
|
8530
8530
|
if (!mask) continue;
|
|
8531
8531
|
out = _chunkAEAAN4ADcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
|
|
8532
8532
|
}
|
|
@@ -8622,12 +8622,12 @@ function withoutAnnotations(layers) {
|
|
|
8622
8622
|
function parseColor(value) {
|
|
8623
8623
|
if (Array.isArray(value)) {
|
|
8624
8624
|
if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
|
|
8625
|
-
throw new (0,
|
|
8625
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
|
|
8626
8626
|
}
|
|
8627
8627
|
return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
|
|
8628
8628
|
}
|
|
8629
8629
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
|
|
8630
|
-
if (!m) throw new (0,
|
|
8630
|
+
if (!m) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
|
|
8631
8631
|
let hex = m[1];
|
|
8632
8632
|
if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
|
|
8633
8633
|
const n = (i) => parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -8637,7 +8637,7 @@ function readImagePaint(raw) {
|
|
|
8637
8637
|
try {
|
|
8638
8638
|
return _chunk3T5O225Tcjs.parsePaintSource.call(void 0, raw);
|
|
8639
8639
|
} catch (e) {
|
|
8640
|
-
if (e instanceof _chunk3T5O225Tcjs.PaintSourceError) throw new (0,
|
|
8640
|
+
if (e instanceof _chunk3T5O225Tcjs.PaintSourceError) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(e.message);
|
|
8641
8641
|
throw e;
|
|
8642
8642
|
}
|
|
8643
8643
|
}
|
|
@@ -8785,7 +8785,7 @@ function loadImageEditorDocument(input) {
|
|
|
8785
8785
|
// Optional: only present when something was selected when saving.
|
|
8786
8786
|
selection: {
|
|
8787
8787
|
parse: (value) => {
|
|
8788
|
-
const mask =
|
|
8788
|
+
const mask = _chunkPMEHFHSPcjs.deserializeSelection.call(void 0, value);
|
|
8789
8789
|
const v = value;
|
|
8790
8790
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8791
8791
|
},
|
|
@@ -8873,7 +8873,7 @@ function loadLayeredDocument(doc) {
|
|
|
8873
8873
|
},
|
|
8874
8874
|
selection: {
|
|
8875
8875
|
parse: (value) => {
|
|
8876
|
-
const mask =
|
|
8876
|
+
const mask = _chunkPMEHFHSPcjs.deserializeSelection.call(void 0, value);
|
|
8877
8877
|
const v = value;
|
|
8878
8878
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8879
8879
|
},
|
|
@@ -9267,14 +9267,14 @@ function describeSelection(mask) {
|
|
|
9267
9267
|
// src/image-editor/selection-tools.ts
|
|
9268
9268
|
var modeSchema = {
|
|
9269
9269
|
type: "string",
|
|
9270
|
-
enum: [...
|
|
9270
|
+
enum: [..._chunkPMEHFHSPcjs.SELECTION_MODES],
|
|
9271
9271
|
description: "How the result combines with the current selection (default replace)."
|
|
9272
9272
|
};
|
|
9273
9273
|
var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
|
|
9274
9274
|
function summary(controller) {
|
|
9275
9275
|
const sel = controller.getSelection();
|
|
9276
9276
|
const { width, height } = controller.getState().imageDimensions;
|
|
9277
|
-
const area =
|
|
9277
|
+
const area = _chunkPMEHFHSPcjs.selectionArea.call(void 0, sel);
|
|
9278
9278
|
return {
|
|
9279
9279
|
empty: !sel,
|
|
9280
9280
|
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _356 => _356.bounds]), () => ( null)),
|
|
@@ -9320,7 +9320,7 @@ function createImageSelectionTools(controller) {
|
|
|
9320
9320
|
},
|
|
9321
9321
|
annotations: writeAnnotations("Select a region", true),
|
|
9322
9322
|
handler: ({ shape, x, y, width, height, mode, feather }) => {
|
|
9323
|
-
const opts = { mode:
|
|
9323
|
+
const opts = { mode: _chunkPMEHFHSPcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
|
|
9324
9324
|
switch (shape) {
|
|
9325
9325
|
case "all":
|
|
9326
9326
|
controller.selectAll();
|
|
@@ -9373,7 +9373,7 @@ function createImageSelectionTools(controller) {
|
|
|
9373
9373
|
annotations: writeAnnotations("Select by colour", true),
|
|
9374
9374
|
handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
|
|
9375
9375
|
const common = {
|
|
9376
|
-
mode:
|
|
9376
|
+
mode: _chunkPMEHFHSPcjs.parseSelectionMode.call(void 0, mode),
|
|
9377
9377
|
sampleMerged: sampleMerged === true,
|
|
9378
9378
|
sample: _nullishCoalesce(sample, () => ( "composite"))
|
|
9379
9379
|
};
|
|
@@ -9394,7 +9394,7 @@ function createImageSelectionTools(controller) {
|
|
|
9394
9394
|
inputSchema: {
|
|
9395
9395
|
type: "object",
|
|
9396
9396
|
properties: {
|
|
9397
|
-
op: { type: "string", enum: [...
|
|
9397
|
+
op: { type: "string", enum: [..._chunkPMEHFHSPcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
|
|
9398
9398
|
radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
|
|
9399
9399
|
},
|
|
9400
9400
|
required: ["op", "radius"],
|
|
@@ -9402,7 +9402,7 @@ function createImageSelectionTools(controller) {
|
|
|
9402
9402
|
},
|
|
9403
9403
|
annotations: writeAnnotations("Modify the selection"),
|
|
9404
9404
|
handler: ({ op, radius }) => {
|
|
9405
|
-
if (!
|
|
9405
|
+
if (!_chunkPMEHFHSPcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
|
|
9406
9406
|
if (!controller.getSelection()) throw new Error("Nothing is selected.");
|
|
9407
9407
|
controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
|
|
9408
9408
|
return summary(controller);
|
|
@@ -9446,7 +9446,7 @@ function createImageSelectionTools(controller) {
|
|
|
9446
9446
|
type: "object",
|
|
9447
9447
|
properties: {
|
|
9448
9448
|
layerId: { type: "string", description: "Existing adjustment layer to mask." },
|
|
9449
|
-
kind: { type: "string", enum:
|
|
9449
|
+
kind: { type: "string", enum: _chunkPMEHFHSPcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
|
|
9450
9450
|
params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
|
|
9451
9451
|
density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
|
|
9452
9452
|
feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
|
|
@@ -9466,11 +9466,11 @@ function createImageSelectionTools(controller) {
|
|
|
9466
9466
|
if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
|
|
9467
9467
|
controller.applySelectionAsLayerMask(layerId, props);
|
|
9468
9468
|
id = layerId;
|
|
9469
|
-
} else if (
|
|
9469
|
+
} else if (_chunkPMEHFHSPcjs.isAdjustmentKind.call(void 0, kind)) {
|
|
9470
9470
|
id = controller.addAdjustmentLayer({
|
|
9471
9471
|
kind,
|
|
9472
9472
|
params,
|
|
9473
|
-
mask:
|
|
9473
|
+
mask: _chunkPMEHFHSPcjs.layerMaskFromSelection.call(void 0, sel, props)
|
|
9474
9474
|
});
|
|
9475
9475
|
} else {
|
|
9476
9476
|
throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
|
|
@@ -9607,11 +9607,11 @@ function createImageEditTools(controller) {
|
|
|
9607
9607
|
const geometry2 = () => {
|
|
9608
9608
|
const s = controller.getState();
|
|
9609
9609
|
const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
|
|
9610
|
-
const out =
|
|
9610
|
+
const out = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
|
|
9611
9611
|
return {
|
|
9612
9612
|
image: { ...s.imageDimensions },
|
|
9613
9613
|
crop: s.crop ? { ...s.crop } : null,
|
|
9614
|
-
rotation:
|
|
9614
|
+
rotation: _chunkPMEHFHSPcjs.normalizeAngle.call(void 0, s.transform.rotate),
|
|
9615
9615
|
flipH: s.transform.flipH,
|
|
9616
9616
|
flipV: s.transform.flipV,
|
|
9617
9617
|
output: { width: Math.round(out.width), height: Math.round(out.height) }
|
|
@@ -9846,7 +9846,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
9846
9846
|
const out = {
|
|
9847
9847
|
id: layer.id,
|
|
9848
9848
|
type: layer.type,
|
|
9849
|
-
name: layer.name || (layer.type === "adjustment" ?
|
|
9849
|
+
name: layer.name || (layer.type === "adjustment" ? _chunkPMEHFHSPcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
|
|
9850
9850
|
visible: layer.visible,
|
|
9851
9851
|
opacity: round3(layer.opacity),
|
|
9852
9852
|
blend: layer.blend,
|
|
@@ -9935,8 +9935,8 @@ function createImageLayerTools(controller) {
|
|
|
9935
9935
|
};
|
|
9936
9936
|
};
|
|
9937
9937
|
const exists = (id, what = "layerId") => {
|
|
9938
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
9939
|
-
|
|
9938
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
|
|
9939
|
+
_chunkPMEHFHSPcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
9940
9940
|
return id;
|
|
9941
9941
|
};
|
|
9942
9942
|
const listLayers = {
|
|
@@ -9972,7 +9972,7 @@ function createImageLayerTools(controller) {
|
|
|
9972
9972
|
handler: ({ layerId, target }) => {
|
|
9973
9973
|
const id = exists(layerId);
|
|
9974
9974
|
const layer = controller.getLayer(id);
|
|
9975
|
-
if (target === "mask" && !layer.mask) throw new (0,
|
|
9975
|
+
if (target === "mask" && !layer.mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
9976
9976
|
controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
|
|
9977
9977
|
return { layer: describe(id), activeTarget: controller.getState().activeTarget };
|
|
9978
9978
|
}
|
|
@@ -9997,7 +9997,7 @@ function createImageLayerTools(controller) {
|
|
|
9997
9997
|
},
|
|
9998
9998
|
annotations: { title: "Add a pixel layer", ...WRITE2 },
|
|
9999
9999
|
handler: async (args) => {
|
|
10000
|
-
if (args.color !== void 0 && args.image !== void 0) throw new (0,
|
|
10000
|
+
if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give color or image, not both.");
|
|
10001
10001
|
for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
|
|
10002
10002
|
const init = {
|
|
10003
10003
|
name: args.name,
|
|
@@ -10087,7 +10087,7 @@ function createImageLayerTools(controller) {
|
|
|
10087
10087
|
const id = exists(args.layerId);
|
|
10088
10088
|
const props = {};
|
|
10089
10089
|
for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
|
|
10090
|
-
if (!Object.keys(props).length) throw new (0,
|
|
10090
|
+
if (!Object.keys(props).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one property to change.");
|
|
10091
10091
|
controller.setLayerProperties(id, props);
|
|
10092
10092
|
return { layer: describe(id) };
|
|
10093
10093
|
}
|
|
@@ -10181,8 +10181,8 @@ function createImageLayerTools(controller) {
|
|
|
10181
10181
|
annotations: { title: "Move a layer's pixels", ...WRITE2 },
|
|
10182
10182
|
handler: ({ layerId, x, y, dx, dy }) => {
|
|
10183
10183
|
const id = exists(layerId);
|
|
10184
|
-
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0,
|
|
10185
|
-
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0,
|
|
10184
|
+
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give x and y, or dx and dy.");
|
|
10185
|
+
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
|
|
10186
10186
|
return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
|
|
10187
10187
|
}
|
|
10188
10188
|
};
|
|
@@ -10254,7 +10254,7 @@ function createImageLayerTools(controller) {
|
|
|
10254
10254
|
annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
|
|
10255
10255
|
handler: ({ layerId, density, feather, enabled, linked }) => {
|
|
10256
10256
|
const id = exists(layerId);
|
|
10257
|
-
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0,
|
|
10257
|
+
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give density, feather, enabled or linked.");
|
|
10258
10258
|
const mask = controller.setLayerMaskProps(id, {
|
|
10259
10259
|
density,
|
|
10260
10260
|
feather,
|
|
@@ -10337,7 +10337,7 @@ function createImageLayerTools(controller) {
|
|
|
10337
10337
|
handler: (args) => {
|
|
10338
10338
|
const id = exists(args.layerId);
|
|
10339
10339
|
const changes = filterValues(args);
|
|
10340
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10340
|
+
if (!Object.keys(changes).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one value to change.");
|
|
10341
10341
|
return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
|
|
10342
10342
|
}
|
|
10343
10343
|
};
|
|
@@ -10601,8 +10601,8 @@ function describeLayerEffects(effects) {
|
|
|
10601
10601
|
}
|
|
10602
10602
|
function createImageEffectTools(controller) {
|
|
10603
10603
|
const layerArg = (id) => {
|
|
10604
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10605
|
-
|
|
10604
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
|
|
10605
|
+
_chunkPMEHFHSPcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
10606
10606
|
return id;
|
|
10607
10607
|
};
|
|
10608
10608
|
const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
|
|
@@ -10633,7 +10633,7 @@ function createImageEffectTools(controller) {
|
|
|
10633
10633
|
annotations: { title: "Add a layer effect", ...WRITE3 },
|
|
10634
10634
|
handler: ({ layerId, kind, settings, index }) => {
|
|
10635
10635
|
const id = layerArg(layerId);
|
|
10636
|
-
if (!_chunkAEAAN4ADcjs.isLayerEffectKind.call(void 0, kind)) throw new (0,
|
|
10636
|
+
if (!_chunkAEAAN4ADcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`kind must be one of ${_chunkAEAAN4ADcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
|
|
10637
10637
|
const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
|
|
10638
10638
|
return result(id, { effectId: effect.id });
|
|
10639
10639
|
}
|
|
@@ -10653,7 +10653,7 @@ function createImageEffectTools(controller) {
|
|
|
10653
10653
|
handler: ({ layerId, effectId, settings }) => {
|
|
10654
10654
|
const id = layerArg(layerId);
|
|
10655
10655
|
const changes = _nullishCoalesce(settings, () => ( {}));
|
|
10656
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10656
|
+
if (!Object.keys(changes).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one setting to change.");
|
|
10657
10657
|
controller.updateLayerEffect(id, effectId, changes);
|
|
10658
10658
|
return result(id);
|
|
10659
10659
|
}
|
|
@@ -10705,7 +10705,7 @@ function createImageEffectTools(controller) {
|
|
|
10705
10705
|
},
|
|
10706
10706
|
annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
|
|
10707
10707
|
handler: ({ angle, altitude }) => {
|
|
10708
|
-
if (angle === void 0 && altitude === void 0) throw new (0,
|
|
10708
|
+
if (angle === void 0 && altitude === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give angle, altitude or both.");
|
|
10709
10709
|
const next = {};
|
|
10710
10710
|
if (angle !== void 0) next.angle = angle;
|
|
10711
10711
|
if (altitude !== void 0) next.altitude = altitude;
|
|
@@ -10918,7 +10918,7 @@ var PaintGesture = (_class8 = class {
|
|
|
10918
10918
|
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.`);
|
|
10919
10919
|
if (_optionalChain([layer, 'access', _370 => _370.locks, 'optionalAccess', _371 => _371.all]) || _optionalChain([layer, 'access', _372 => _372.locks, 'optionalAccess', _373 => _373.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
|
|
10920
10920
|
const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
|
|
10921
|
-
const b =
|
|
10921
|
+
const b = _chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, layer);
|
|
10922
10922
|
return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
|
|
10923
10923
|
})();
|
|
10924
10924
|
this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
|
|
@@ -11076,9 +11076,9 @@ function createImagePaintTools(controller) {
|
|
|
11076
11076
|
annotations: { title: "Paint a brush stroke", ...WRITE4 },
|
|
11077
11077
|
handler: (args) => {
|
|
11078
11078
|
const tool = args.tool;
|
|
11079
|
-
if (args.mixer !== void 0 && tool !== "mixer") throw new (0,
|
|
11080
|
-
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0,
|
|
11081
|
-
if (args.paint !== void 0 && args.color !== void 0) throw new (0,
|
|
11079
|
+
if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
|
|
11080
|
+
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
|
|
11081
|
+
if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give color or paint, not both.");
|
|
11082
11082
|
const result = controller.paintStroke({
|
|
11083
11083
|
tool,
|
|
11084
11084
|
points: args.points,
|
|
@@ -11209,7 +11209,7 @@ function profileArg(v) {
|
|
|
11209
11209
|
try {
|
|
11210
11210
|
return _chunkO7LUD7MHcjs.base64ToBytes.call(void 0, s.slice(4));
|
|
11211
11211
|
} catch (e30) {
|
|
11212
|
-
throw new (0,
|
|
11212
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The icc: value is not valid base64.");
|
|
11213
11213
|
}
|
|
11214
11214
|
}
|
|
11215
11215
|
return s;
|
|
@@ -11274,10 +11274,10 @@ function createImageColorTools(controller) {
|
|
|
11274
11274
|
annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11275
11275
|
handler: (args) => {
|
|
11276
11276
|
if (args.off === true) {
|
|
11277
|
-
if (args.profile !== void 0) throw new (0,
|
|
11277
|
+
if (args.profile !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give either off true or a profile, not both.");
|
|
11278
11278
|
return controller.setProofSetup(null);
|
|
11279
11279
|
}
|
|
11280
|
-
if (args.profile === void 0) throw new (0,
|
|
11280
|
+
if (args.profile === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
|
|
11281
11281
|
const s = controller.setProofSetup({
|
|
11282
11282
|
profile: profileArg(args.profile),
|
|
11283
11283
|
...args.intent !== void 0 ? { intent: args.intent } : {},
|
|
@@ -11329,7 +11329,7 @@ function createImageColorTools(controller) {
|
|
|
11329
11329
|
},
|
|
11330
11330
|
annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11331
11331
|
handler: (args) => {
|
|
11332
|
-
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0,
|
|
11332
|
+
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
|
|
11333
11333
|
return controller.setColorMode(args.mode, {
|
|
11334
11334
|
...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
|
|
11335
11335
|
...args.intent !== void 0 ? { intent: args.intent } : {}
|
|
@@ -11394,7 +11394,7 @@ function checkSource(controller, source) {
|
|
|
11394
11394
|
const p = source;
|
|
11395
11395
|
const { width, height } = controller.getState().imageDimensions;
|
|
11396
11396
|
if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
|
|
11397
|
-
throw new (0,
|
|
11397
|
+
throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
|
|
11398
11398
|
}
|
|
11399
11399
|
return p;
|
|
11400
11400
|
}
|
|
@@ -11634,10 +11634,10 @@ function createImageRetouchTools(controller) {
|
|
|
11634
11634
|
annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
|
|
11635
11635
|
handler: (args) => {
|
|
11636
11636
|
if (args.clear === true) {
|
|
11637
|
-
if (args.x !== void 0 || args.y !== void 0) throw new (0,
|
|
11637
|
+
if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give either clear true or x and y, not both.");
|
|
11638
11638
|
return controller.setCloneSource(null);
|
|
11639
11639
|
}
|
|
11640
|
-
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0,
|
|
11640
|
+
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
|
|
11641
11641
|
return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
|
|
11642
11642
|
}
|
|
11643
11643
|
};
|
|
@@ -11660,7 +11660,7 @@ function createImageRetouchTools(controller) {
|
|
|
11660
11660
|
annotations: { title: "Transform the clone source", ...WRITE5, idempotentHint: false },
|
|
11661
11661
|
handler: (args) => {
|
|
11662
11662
|
if (args.reset === true) {
|
|
11663
|
-
if (Object.keys(args).some((k) => k !== "reset")) throw new (0,
|
|
11663
|
+
if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give either reset true or transform values, not both.");
|
|
11664
11664
|
return controller.setCloneTransform(null);
|
|
11665
11665
|
}
|
|
11666
11666
|
const cur = controller.getState().paint.cloneTransform;
|
|
@@ -11670,7 +11670,7 @@ function createImageRetouchTools(controller) {
|
|
|
11670
11670
|
if (args.rotate !== void 0) next.rotate = args.rotate;
|
|
11671
11671
|
if (args.flipHorizontal === true) next.scaleX = -(_nullishCoalesce(next.scaleX, () => ( cur.scaleX)));
|
|
11672
11672
|
if (args.flipVertical === true) next.scaleY = -(_nullishCoalesce(next.scaleY, () => ( cur.scaleY)));
|
|
11673
|
-
if (!Object.keys(next).length) throw new (0,
|
|
11673
|
+
if (!Object.keys(next).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
|
|
11674
11674
|
return controller.setCloneTransform(next);
|
|
11675
11675
|
}
|
|
11676
11676
|
};
|
|
@@ -11691,11 +11691,11 @@ var DATA = {
|
|
|
11691
11691
|
description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
|
|
11692
11692
|
};
|
|
11693
11693
|
function psdBytesFromBase64(data) {
|
|
11694
|
-
if (typeof data !== "string" || !data.trim()) throw new (0,
|
|
11694
|
+
if (typeof data !== "string" || !data.trim()) throw new (0, _chunkPMEHFHSPcjs.PsdError)("data is required: the PSD file as base64.");
|
|
11695
11695
|
const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
|
|
11696
|
-
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0,
|
|
11696
|
+
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkPMEHFHSPcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
|
|
11697
11697
|
const bytes = _chunkO7LUD7MHcjs.base64ToBytes.call(void 0, body);
|
|
11698
|
-
if (bytes.length < 26) throw new (0,
|
|
11698
|
+
if (bytes.length < 26) throw new (0, _chunkPMEHFHSPcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
|
|
11699
11699
|
return bytes;
|
|
11700
11700
|
}
|
|
11701
11701
|
function createImagePsdTools(controller) {
|
|
@@ -11706,7 +11706,7 @@ function createImagePsdTools(controller) {
|
|
|
11706
11706
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
11707
11707
|
annotations: { title: "Inspect a PSD", ...READ7 },
|
|
11708
11708
|
handler: ({ data }) => {
|
|
11709
|
-
const res =
|
|
11709
|
+
const res = _chunkPMEHFHSPcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
|
|
11710
11710
|
return {
|
|
11711
11711
|
width: res.width,
|
|
11712
11712
|
height: res.height,
|
|
@@ -11793,7 +11793,7 @@ var GEOMETRY = {
|
|
|
11793
11793
|
dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
|
|
11794
11794
|
reference: {
|
|
11795
11795
|
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}.",
|
|
11796
|
-
anyOf: [{ type: "string", enum:
|
|
11796
|
+
anyOf: [{ type: "string", enum: _chunkPMEHFHSPcjs.TRANSFORM_ANCHORS }, POINT]
|
|
11797
11797
|
},
|
|
11798
11798
|
matrix: {
|
|
11799
11799
|
type: "array",
|
|
@@ -11814,14 +11814,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
|
|
|
11814
11814
|
function geometryFrom(args) {
|
|
11815
11815
|
const numeric = NUMERIC.filter((k) => args[k] !== void 0);
|
|
11816
11816
|
const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
|
|
11817
|
-
if (ways === 0) throw new (0,
|
|
11818
|
-
if (ways > 1) throw new (0,
|
|
11817
|
+
if (ways === 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
|
|
11818
|
+
if (ways > 1) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
|
|
11819
11819
|
if (args.matrix !== void 0) return { matrix: args.matrix };
|
|
11820
11820
|
if (args.corners !== void 0) return { corners: args.corners };
|
|
11821
11821
|
const params = {};
|
|
11822
11822
|
for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
|
|
11823
|
-
if (params.scaleX === 0 || params.scaleY === 0) throw new (0,
|
|
11824
|
-
if (typeof params.reference === "string" && !
|
|
11823
|
+
if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
|
|
11824
|
+
if (typeof params.reference === "string" && !_chunkPMEHFHSPcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkPMEHFHSPcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
|
|
11825
11825
|
return { params };
|
|
11826
11826
|
}
|
|
11827
11827
|
function targetFrom(args) {
|
|
@@ -11870,15 +11870,15 @@ function createImageTransformTools(controller) {
|
|
|
11870
11870
|
moved: [...s.moves],
|
|
11871
11871
|
frame: { ...s.box },
|
|
11872
11872
|
corners: s.startGeometry.corners.map(roundPoint),
|
|
11873
|
-
center: roundPoint(
|
|
11873
|
+
center: roundPoint(_chunkPMEHFHSPcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
|
|
11874
11874
|
};
|
|
11875
11875
|
if (s.smartObject) out.smartObject = true;
|
|
11876
11876
|
s.cancel();
|
|
11877
11877
|
if (args.meshColumns !== void 0) {
|
|
11878
11878
|
const cols = args.meshColumns;
|
|
11879
11879
|
const rows = _nullishCoalesce(args.meshRows, () => ( cols));
|
|
11880
|
-
const mesh =
|
|
11881
|
-
out.mesh = { columns: cols, rows, pointsPerRow:
|
|
11880
|
+
const mesh = _chunkXFXHA5MUcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
|
|
11881
|
+
out.mesh = { columns: cols, rows, pointsPerRow: _chunkXFXHA5MUcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkXFXHA5MUcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
|
|
11882
11882
|
}
|
|
11883
11883
|
return out;
|
|
11884
11884
|
}
|
|
@@ -11903,7 +11903,7 @@ function createImageTransformTools(controller) {
|
|
|
11903
11903
|
type: "object",
|
|
11904
11904
|
properties: {
|
|
11905
11905
|
...TARGET3,
|
|
11906
|
-
style: { type: "string", enum:
|
|
11906
|
+
style: { type: "string", enum: _chunkXFXHA5MUcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
|
|
11907
11907
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
|
|
11908
11908
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
|
|
11909
11909
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
|
|
@@ -11925,11 +11925,11 @@ function createImageTransformTools(controller) {
|
|
|
11925
11925
|
annotations: { title: "Warp a layer", ...WRITE6 },
|
|
11926
11926
|
handler: (args) => {
|
|
11927
11927
|
const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
|
|
11928
|
-
if (hasPreset && args.mesh !== void 0) throw new (0,
|
|
11929
|
-
if (!hasPreset && args.mesh === void 0) throw new (0,
|
|
11928
|
+
if (hasPreset && args.mesh !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
|
|
11929
|
+
if (!hasPreset && args.mesh === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give a preset style or a mesh.");
|
|
11930
11930
|
let warp;
|
|
11931
11931
|
if (hasPreset) {
|
|
11932
|
-
if (args.style === void 0) throw new (0,
|
|
11932
|
+
if (args.style === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkXFXHA5MUcjs.WARP_STYLES.join(", ")}.`);
|
|
11933
11933
|
warp = {
|
|
11934
11934
|
style: args.style,
|
|
11935
11935
|
bend: _nullishCoalesce(args.bend, () => ( 50)),
|
|
@@ -11940,7 +11940,7 @@ function createImageTransformTools(controller) {
|
|
|
11940
11940
|
} else {
|
|
11941
11941
|
const m = args.mesh;
|
|
11942
11942
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
11943
|
-
if (m.points.length !== want) throw new (0,
|
|
11943
|
+
if (m.points.length !== want) throw new (0, _chunkPMEHFHSPcjs.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}.`);
|
|
11944
11944
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
11945
11945
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
11946
11946
|
}
|
|
@@ -12035,13 +12035,13 @@ function settingsFrom(args) {
|
|
|
12035
12035
|
return out;
|
|
12036
12036
|
}
|
|
12037
12037
|
function imageArg(image) {
|
|
12038
|
-
if (typeof image !== "string" || !image.trim()) throw new (0,
|
|
12038
|
+
if (typeof image !== "string" || !image.trim()) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
|
|
12039
12039
|
return image.trim();
|
|
12040
12040
|
}
|
|
12041
12041
|
function createImageSmartObjectTools(controller) {
|
|
12042
12042
|
const smartId = (id) => {
|
|
12043
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12044
|
-
|
|
12043
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
|
|
12044
|
+
_chunkPMEHFHSPcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
|
|
12045
12045
|
return id;
|
|
12046
12046
|
};
|
|
12047
12047
|
const info = (id) => {
|
|
@@ -12078,7 +12078,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
12078
12078
|
},
|
|
12079
12079
|
annotations: { title: "Convert to Smart Object", ...WRITE7 },
|
|
12080
12080
|
handler: ({ layerIds, name }) => {
|
|
12081
|
-
for (const id2 of _nullishCoalesce(layerIds, () => ( [])))
|
|
12081
|
+
for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkPMEHFHSPcjs.requireLayer.call(void 0, controller.getLayers(), id2);
|
|
12082
12082
|
const id = controller.convertToSmartObject(layerIds, { name });
|
|
12083
12083
|
return { layer: layerSummary(id), smartObject: info(id) };
|
|
12084
12084
|
}
|
|
@@ -12115,7 +12115,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
12115
12115
|
{
|
|
12116
12116
|
type: "object",
|
|
12117
12117
|
properties: {
|
|
12118
|
-
style: { type: "string", enum:
|
|
12118
|
+
style: { type: "string", enum: _chunkXFXHA5MUcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
|
|
12119
12119
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
|
|
12120
12120
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
|
|
12121
12121
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
|
|
@@ -12151,12 +12151,12 @@ function createImageSmartObjectTools(controller) {
|
|
|
12151
12151
|
else if (w) {
|
|
12152
12152
|
const m = w;
|
|
12153
12153
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
12154
|
-
if (m.points.length !== want) throw new (0,
|
|
12154
|
+
if (m.points.length !== want) throw new (0, _chunkPMEHFHSPcjs.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}.`);
|
|
12155
12155
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
12156
12156
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
12157
12157
|
}
|
|
12158
12158
|
const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
|
|
12159
|
-
if (!keys.some((k) => args[k] !== void 0)) throw new (0,
|
|
12159
|
+
if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
|
|
12160
12160
|
const res = controller.setSmartObjectTransform(id, {
|
|
12161
12161
|
corners: args.corners,
|
|
12162
12162
|
matrix: args.matrix,
|
|
@@ -12281,7 +12281,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
12281
12281
|
handler: (args) => {
|
|
12282
12282
|
const id = smartId(args.layerId);
|
|
12283
12283
|
const changes = settingsFrom(args);
|
|
12284
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
12284
|
+
if (!Object.keys(changes).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one value to change.");
|
|
12285
12285
|
const filter = controller.updateSmartFilter(id, args.filterId, changes);
|
|
12286
12286
|
return { layerId: id, filter, smartFilters: info(id).smartFilters };
|
|
12287
12287
|
}
|
|
@@ -12602,8 +12602,8 @@ function geometry(args) {
|
|
|
12602
12602
|
}
|
|
12603
12603
|
function createImageShapeTools(controller) {
|
|
12604
12604
|
const shapeId = (id) => {
|
|
12605
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12606
|
-
|
|
12605
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
|
|
12606
|
+
_chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
|
|
12607
12607
|
return id;
|
|
12608
12608
|
};
|
|
12609
12609
|
const layerSummary = (id) => {
|
|
@@ -12678,7 +12678,7 @@ function createImageShapeTools(controller) {
|
|
|
12678
12678
|
annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
|
|
12679
12679
|
handler: ({ layerId, fill, stroke, fillRule }) => {
|
|
12680
12680
|
const id = shapeId(layerId);
|
|
12681
|
-
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0,
|
|
12681
|
+
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
|
|
12682
12682
|
return controller.setShapeStyle(id, { fill, stroke, fillRule });
|
|
12683
12683
|
}
|
|
12684
12684
|
};
|
|
@@ -12727,7 +12727,7 @@ function createImageShapeTools(controller) {
|
|
|
12727
12727
|
handler: ({ layerId, componentIndex, ...rest }) => {
|
|
12728
12728
|
const id = shapeId(layerId);
|
|
12729
12729
|
const change = geometry(rest);
|
|
12730
|
-
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0,
|
|
12730
|
+
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give shape, subpaths or op to change.");
|
|
12731
12731
|
return controller.setShapeComponent(id, componentIndex, change);
|
|
12732
12732
|
}
|
|
12733
12733
|
};
|
|
@@ -12801,8 +12801,8 @@ function pick2(args, keys) {
|
|
|
12801
12801
|
}
|
|
12802
12802
|
function createImageTypeTools(controller) {
|
|
12803
12803
|
const typeId = (id) => {
|
|
12804
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12805
|
-
|
|
12804
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
|
|
12805
|
+
_chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
|
|
12806
12806
|
return id;
|
|
12807
12807
|
};
|
|
12808
12808
|
const layerSummary = (id) => {
|
|
@@ -12882,7 +12882,7 @@ function createImageTypeTools(controller) {
|
|
|
12882
12882
|
annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
|
|
12883
12883
|
handler: (args) => {
|
|
12884
12884
|
const style = pick2(args, Object.keys(STYLE));
|
|
12885
|
-
if (!Object.keys(style).length) throw new (0,
|
|
12885
|
+
if (!Object.keys(style).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
|
|
12886
12886
|
return controller.setTextStyle(typeId(args.layerId), style, range(args));
|
|
12887
12887
|
}
|
|
12888
12888
|
};
|
|
@@ -12894,7 +12894,7 @@ function createImageTypeTools(controller) {
|
|
|
12894
12894
|
annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
|
|
12895
12895
|
handler: (args) => {
|
|
12896
12896
|
const style = pick2(args, Object.keys(PARAGRAPH));
|
|
12897
|
-
if (!Object.keys(style).length) throw new (0,
|
|
12897
|
+
if (!Object.keys(style).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
|
|
12898
12898
|
return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
|
|
12899
12899
|
}
|
|
12900
12900
|
};
|
|
@@ -12916,7 +12916,7 @@ function createImageTypeTools(controller) {
|
|
|
12916
12916
|
annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
|
|
12917
12917
|
handler: ({ layerId, kind, width, height }) => {
|
|
12918
12918
|
const id = typeId(layerId);
|
|
12919
|
-
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0,
|
|
12919
|
+
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("kind box needs width and height in pixels.");
|
|
12920
12920
|
return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
|
|
12921
12921
|
}
|
|
12922
12922
|
};
|
|
@@ -12938,7 +12938,7 @@ function createImageTypeTools(controller) {
|
|
|
12938
12938
|
var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
|
|
12939
12939
|
function adjustmentsSummary(adjustments) {
|
|
12940
12940
|
return {
|
|
12941
|
-
process:
|
|
12941
|
+
process: _chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, adjustments.process),
|
|
12942
12942
|
values: readAdjustmentControls(adjustments),
|
|
12943
12943
|
layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
|
|
12944
12944
|
};
|
|
@@ -12981,7 +12981,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12981
12981
|
default: def,
|
|
12982
12982
|
...requiresProcess ? { requiresProcess } : {}
|
|
12983
12983
|
})),
|
|
12984
|
-
layerKinds:
|
|
12984
|
+
layerKinds: _chunkPMEHFHSPcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
|
|
12985
12985
|
kind,
|
|
12986
12986
|
label,
|
|
12987
12987
|
controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
|
|
@@ -13067,7 +13067,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13067
13067
|
const result = { applied, clamped };
|
|
13068
13068
|
if (typeof label === "string" && label) result.label = label;
|
|
13069
13069
|
const notes = [];
|
|
13070
|
-
if ("tint" in applied &&
|
|
13070
|
+
if ("tint" in applied && _chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
|
|
13071
13071
|
notes.push("Tint has no effect on process 1 edits.");
|
|
13072
13072
|
}
|
|
13073
13073
|
if (notes.length) result.notes = notes;
|
|
@@ -13077,11 +13077,11 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13077
13077
|
const addLayer = {
|
|
13078
13078
|
name: "add_adjustment_layer",
|
|
13079
13079
|
title: "Add an adjustment layer",
|
|
13080
|
-
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " +
|
|
13080
|
+
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkPMEHFHSPcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
|
|
13081
13081
|
inputSchema: {
|
|
13082
13082
|
type: "object",
|
|
13083
13083
|
properties: {
|
|
13084
|
-
kind: { type: "string", enum:
|
|
13084
|
+
kind: { type: "string", enum: _chunkPMEHFHSPcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
|
|
13085
13085
|
params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
|
|
13086
13086
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
|
|
13087
13087
|
blend: { type: "string", enum: _chunkO7LUD7MHcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
|
|
@@ -13100,7 +13100,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13100
13100
|
openWorldHint: false
|
|
13101
13101
|
},
|
|
13102
13102
|
handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
|
|
13103
|
-
if (!
|
|
13103
|
+
if (!_chunkPMEHFHSPcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
|
|
13104
13104
|
if (blend !== void 0 && !_chunkO7LUD7MHcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
13105
13105
|
if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
|
|
13106
13106
|
for (const ref of [aboveId, parentId]) {
|
|
@@ -13194,7 +13194,7 @@ function boxToCurvePoint(x, y, width, height) {
|
|
|
13194
13194
|
return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
|
|
13195
13195
|
}
|
|
13196
13196
|
function curveSvgPath(points, width, height, samples = 64) {
|
|
13197
|
-
const lut =
|
|
13197
|
+
const lut = _chunkPMEHFHSPcjs.curveLutFromLevels.call(void 0, points);
|
|
13198
13198
|
const n = lut.length - 1;
|
|
13199
13199
|
let d = "";
|
|
13200
13200
|
for (let i = 0; i <= samples; i++) {
|
|
@@ -13704,7 +13704,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13704
13704
|
else {
|
|
13705
13705
|
const layout = this.layout();
|
|
13706
13706
|
if (layout && layout.lines.length) {
|
|
13707
|
-
const c =
|
|
13707
|
+
const c = _chunkXFXHA5MUcjs.caretAt.call(void 0, layout, f);
|
|
13708
13708
|
const line = layout.lines[c.line];
|
|
13709
13709
|
if (to === "home") f = line.start;
|
|
13710
13710
|
else if (to === "end") {
|
|
@@ -13799,7 +13799,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13799
13799
|
styleHere() {
|
|
13800
13800
|
const layer = this.layer;
|
|
13801
13801
|
const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
|
|
13802
|
-
return
|
|
13802
|
+
return _chunkXFXHA5MUcjs.styleAt.call(void 0, layer.runs, at, _chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE);
|
|
13803
13803
|
}
|
|
13804
13804
|
info() {
|
|
13805
13805
|
return this.controller.getTextLayer(this.layerId);
|
|
@@ -13808,8 +13808,8 @@ var TextEditSession = (_class11 = class {
|
|
|
13808
13808
|
overlay() {
|
|
13809
13809
|
const layer = this.layer;
|
|
13810
13810
|
const layout = this.layout();
|
|
13811
|
-
const m =
|
|
13812
|
-
const at = (x, y) =>
|
|
13811
|
+
const m = _chunkPMEHFHSPcjs.textMatrix.call(void 0, layer);
|
|
13812
|
+
const at = (x, y) => _chunkXFXHA5MUcjs.applyMatrix.call(void 0, m, { x, y });
|
|
13813
13813
|
let frame = null;
|
|
13814
13814
|
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)];
|
|
13815
13815
|
else if (layout) {
|
|
@@ -13829,7 +13829,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13829
13829
|
selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
|
|
13830
13830
|
}
|
|
13831
13831
|
}
|
|
13832
|
-
const c =
|
|
13832
|
+
const c = _chunkXFXHA5MUcjs.caretAt.call(void 0, layout, this.focus);
|
|
13833
13833
|
return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
|
|
13834
13834
|
}
|
|
13835
13835
|
/** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
|
|
@@ -13844,7 +13844,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13844
13844
|
}
|
|
13845
13845
|
if (this.layer.name === "Text" && this.changed) {
|
|
13846
13846
|
try {
|
|
13847
|
-
this.controller.setLayerProperties(this.layerId, { name:
|
|
13847
|
+
this.controller.setLayerProperties(this.layerId, { name: _chunkPMEHFHSPcjs.typeLayerName.call(void 0, this.text) }, false);
|
|
13848
13848
|
} catch (e32) {
|
|
13849
13849
|
}
|
|
13850
13850
|
}
|
|
@@ -13855,8 +13855,8 @@ function typeLayerAt(controller, p, slop = 4) {
|
|
|
13855
13855
|
const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
|
|
13856
13856
|
for (const l of layers) {
|
|
13857
13857
|
if (!l.visible) continue;
|
|
13858
|
-
const inv = invert(
|
|
13859
|
-
const q =
|
|
13858
|
+
const inv = invert(_chunkPMEHFHSPcjs.textMatrix.call(void 0, l));
|
|
13859
|
+
const q = _chunkXFXHA5MUcjs.applyMatrix.call(void 0, inv, p);
|
|
13860
13860
|
let b = null;
|
|
13861
13861
|
if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
|
|
13862
13862
|
else {
|
|
@@ -13966,7 +13966,7 @@ function layerPanelRows(layers, activeId) {
|
|
|
13966
13966
|
}
|
|
13967
13967
|
function layerLabel(layer) {
|
|
13968
13968
|
if (layer.name) return layer.name;
|
|
13969
|
-
if (layer.type === "adjustment") return
|
|
13969
|
+
if (layer.type === "adjustment") return _chunkPMEHFHSPcjs.adjustmentKindLabel.call(void 0, layer.kind);
|
|
13970
13970
|
return layer.type === "group" ? "Group" : "Layer";
|
|
13971
13971
|
}
|
|
13972
13972
|
function layerBadge(layer) {
|
|
@@ -14438,7 +14438,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
|
|
|
14438
14438
|
];
|
|
14439
14439
|
var WARP_STYLE_OPTIONS = [
|
|
14440
14440
|
{ id: "custom", label: "Custom" },
|
|
14441
|
-
...
|
|
14441
|
+
..._chunkXFXHA5MUcjs.WARP_STYLES.map((id) => ({ id, label: _chunkXFXHA5MUcjs.WARP_STYLE_LABELS[id] }))
|
|
14442
14442
|
];
|
|
14443
14443
|
var WARP_GRID_OPTIONS = [
|
|
14444
14444
|
{ id: "1x1", label: "Default", columns: 1, rows: 1 },
|
|
@@ -14574,7 +14574,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14574
14574
|
setMode(mode) {
|
|
14575
14575
|
this.modeValue = mode;
|
|
14576
14576
|
const s = this.session;
|
|
14577
|
-
if (mode === "warp" && s && !this.mesh) this.mesh =
|
|
14577
|
+
if (mode === "warp" && s && !this.mesh) this.mesh = _chunkXFXHA5MUcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
|
|
14578
14578
|
this.changed();
|
|
14579
14579
|
}
|
|
14580
14580
|
/** The Warp options bar's settings. */
|
|
@@ -14596,13 +14596,13 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14596
14596
|
this.modeValue = "warp";
|
|
14597
14597
|
const next = { ...this.warpSettings, ...changes };
|
|
14598
14598
|
this.warpSettings = next;
|
|
14599
|
-
let mesh = _nullishCoalesce(this.mesh, () => (
|
|
14599
|
+
let mesh = _nullishCoalesce(this.mesh, () => ( _chunkXFXHA5MUcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
|
|
14600
14600
|
if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
|
|
14601
14601
|
const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
|
|
14602
|
-
mesh = _nullishCoalesce(
|
|
14603
|
-
mesh =
|
|
14602
|
+
mesh = _nullishCoalesce(_chunkXFXHA5MUcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkXFXHA5MUcjs.identityWarpMesh.call(void 0, s.box)));
|
|
14603
|
+
mesh = _chunkXFXHA5MUcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14604
14604
|
}
|
|
14605
|
-
if ("columns" in changes || "rows" in changes) mesh =
|
|
14605
|
+
if ("columns" in changes || "rows" in changes) mesh = _chunkXFXHA5MUcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14606
14606
|
this.mesh = mesh;
|
|
14607
14607
|
this.changed();
|
|
14608
14608
|
this.preview();
|
|
@@ -14649,11 +14649,11 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14649
14649
|
const m = this.mesh;
|
|
14650
14650
|
const at = (p) => _nullishCoalesce(_chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p), () => ( p));
|
|
14651
14651
|
const pts = m.points.map(at);
|
|
14652
|
-
const edit =
|
|
14652
|
+
const edit = _chunkXFXHA5MUcjs.warpMeshEditPoints.call(void 0, m);
|
|
14653
14653
|
out.handles = [];
|
|
14654
|
-
out.outline =
|
|
14654
|
+
out.outline = _chunkXFXHA5MUcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
|
|
14655
14655
|
out.warp = {
|
|
14656
|
-
curves:
|
|
14656
|
+
curves: _chunkXFXHA5MUcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
|
|
14657
14657
|
anchors: edit.anchors.map((i) => pts[i]),
|
|
14658
14658
|
handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
|
|
14659
14659
|
};
|
|
@@ -14677,7 +14677,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14677
14677
|
if (!o) return null;
|
|
14678
14678
|
if (this.modeValue === "warp" && this.mesh) {
|
|
14679
14679
|
const h = this.homography();
|
|
14680
|
-
const edit =
|
|
14680
|
+
const edit = _chunkXFXHA5MUcjs.warpMeshEditPoints.call(void 0, this.mesh);
|
|
14681
14681
|
let best2 = -1;
|
|
14682
14682
|
let bestD2 = tolerance;
|
|
14683
14683
|
for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
|
|
@@ -14722,7 +14722,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14722
14722
|
if (this.modeValue === "warp" && this.mesh && handle === "inside") {
|
|
14723
14723
|
const q = this.toFrame(p, this.corners);
|
|
14724
14724
|
if (q) {
|
|
14725
|
-
const r =
|
|
14725
|
+
const r = _chunkXFXHA5MUcjs.warpMeshParamAt.call(void 0, this.mesh, q);
|
|
14726
14726
|
st = { s: r.s, t: r.t };
|
|
14727
14727
|
}
|
|
14728
14728
|
}
|
|
@@ -14755,8 +14755,8 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14755
14755
|
if (!a || !b) return;
|
|
14756
14756
|
const delta = { x: b.x - a.x, y: b.y - a.y };
|
|
14757
14757
|
const i = meshIndex(d.handle);
|
|
14758
|
-
if (i >= 0) this.mesh =
|
|
14759
|
-
else if (d.handle === "inside" && d.st) this.mesh =
|
|
14758
|
+
if (i >= 0) this.mesh = _chunkXFXHA5MUcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
|
|
14759
|
+
else if (d.handle === "inside" && d.st) this.mesh = _chunkXFXHA5MUcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
|
|
14760
14760
|
else return;
|
|
14761
14761
|
this.warpSettings = { ...this.warpSettings, style: "custom" };
|
|
14762
14762
|
this.changed();
|
|
@@ -14880,7 +14880,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14880
14880
|
bar() {
|
|
14881
14881
|
const s = this.session;
|
|
14882
14882
|
if (!s || !this.corners) return null;
|
|
14883
|
-
const read =
|
|
14883
|
+
const read = _chunkPMEHFHSPcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
|
|
14884
14884
|
return {
|
|
14885
14885
|
affine: read.affine,
|
|
14886
14886
|
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
@@ -14905,7 +14905,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14905
14905
|
this.changed();
|
|
14906
14906
|
return;
|
|
14907
14907
|
}
|
|
14908
|
-
const m =
|
|
14908
|
+
const m = _chunkPMEHFHSPcjs.matrixFromParams.call(void 0, s.box, {
|
|
14909
14909
|
scaleX: next.scaleX,
|
|
14910
14910
|
scaleY: next.scaleY,
|
|
14911
14911
|
rotate: next.rotate,
|
|
@@ -14915,7 +14915,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14915
14915
|
dx: next.x - this.refBox.x,
|
|
14916
14916
|
dy: next.y - this.refBox.y
|
|
14917
14917
|
});
|
|
14918
|
-
this.setCorners(
|
|
14918
|
+
this.setCorners(_chunkPMEHFHSPcjs.cornersFromMatrix.call(void 0, s.box, m));
|
|
14919
14919
|
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
14920
14920
|
this.changed();
|
|
14921
14921
|
}
|
|
@@ -16024,5 +16024,5 @@ function createImageEffectsToolProvider(controller, options = {}) {
|
|
|
16024
16024
|
|
|
16025
16025
|
|
|
16026
16026
|
|
|
16027
|
-
exports.ADJUSTMENT_KEYS = _chunkCM3LJPR3cjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkCM3LJPR3cjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkCM3LJPR3cjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkCM3LJPR3cjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkCM3LJPR3cjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkCM3LJPR3cjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkO7LUD7MHcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkO7LUD7MHcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkCM3LJPR3cjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkF2Y4E4GUcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunk3T5O225Tcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunk3T5O225Tcjs.CoverageMap; exports.D50 = _chunkCM3LJPR3cjs.D50; exports.D65 = _chunkCM3LJPR3cjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkSXOTFV3Vcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk3T5O225Tcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk3T5O225Tcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkF2Y4E4GUcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkAEAAN4ADcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkCM3LJPR3cjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk3T5O225Tcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunk3T5O225Tcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunk3T5O225Tcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkVEHVXRJUcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk3T5O225Tcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkSXOTFV3Vcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkF2Y4E4GUcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkF2Y4E4GUcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkCM3LJPR3cjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkAEAAN4ADcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkF2Y4E4GUcjs.DRY_EPS; exports.DabWalker = _chunk3T5O225Tcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkCM3LJPR3cjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk3T5O225Tcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkF2Y4E4GUcjs.EX; exports.EY = _chunkF2Y4E4GUcjs.EY; exports.FLAG_ALIVE = _chunkF2Y4E4GUcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkF2Y4E4GUcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkF2Y4E4GUcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkF2Y4E4GUcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkF2Y4E4GUcjs.FLAG_TOP; exports.FLAG_WET = _chunkF2Y4E4GUcjs.FLAG_WET; exports.FLAT = _chunkF2Y4E4GUcjs.FLAT; exports.FREE_INTERVAL = _chunkF2Y4E4GUcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkCM3LJPR3cjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunk3T5O225Tcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunk3T5O225Tcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkF2Y4E4GUcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkCM3LJPR3cjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunkVEHVXRJUcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkCM3LJPR3cjs.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_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkAEAAN4ADcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkCM3LJPR3cjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkCM3LJPR3cjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkAEAAN4ADcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkCM3LJPR3cjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkCM3LJPR3cjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkCM3LJPR3cjs.LUMA_709; exports.LayerCompositor = _chunkCM3LJPR3cjs.LayerCompositor; exports.LayerEffectError = _chunkAEAAN4ADcjs.LayerEffectError; exports.LayerOperationError = _chunkCM3LJPR3cjs.LayerOperationError; exports.MAX_BATCH = _chunkF2Y4E4GUcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunk3T5O225Tcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkAEAAN4ADcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkCM3LJPR3cjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkF2Y4E4GUcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkAEAAN4ADcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkF2Y4E4GUcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkF2Y4E4GUcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkCM3LJPR3cjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkCM3LJPR3cjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk3T5O225Tcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk3T5O225Tcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk3T5O225Tcjs.MIXING_MODELS; exports.MixerStroke = _chunk3T5O225Tcjs.MixerStroke; exports.OPP = _chunkF2Y4E4GUcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkO7LUD7MHcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunk3T5O225Tcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunk3T5O225Tcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunk3T5O225Tcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunk3T5O225Tcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunk3T5O225Tcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunk3T5O225Tcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunk3T5O225Tcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunk3T5O225Tcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunk3T5O225Tcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunk3T5O225Tcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunk3T5O225Tcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunk3T5O225Tcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkF2Y4E4GUcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkCM3LJPR3cjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkF2Y4E4GUcjs.PARAM; exports.PARAM_FLOATS = _chunkF2Y4E4GUcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkCM3LJPR3cjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkO7LUD7MHcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkF2Y4E4GUcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkO7LUD7MHcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkO7LUD7MHcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkF2Y4E4GUcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkO7LUD7MHcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkF2Y4E4GUcjs.PLANE; exports.PLANE_BYTES = _chunkF2Y4E4GUcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkCM3LJPR3cjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkF2Y4E4GUcjs.P_D0; exports.P_EDGE = _chunkF2Y4E4GUcjs.P_EDGE; exports.P_FX = _chunkF2Y4E4GUcjs.P_FX; exports.P_FY = _chunkF2Y4E4GUcjs.P_FY; exports.P_H = _chunkF2Y4E4GUcjs.P_H; exports.P_P0 = _chunkF2Y4E4GUcjs.P_P0; exports.P_RHO = _chunkF2Y4E4GUcjs.P_RHO; exports.P_SW = _chunkF2Y4E4GUcjs.P_SW; exports.P_UX = _chunkF2Y4E4GUcjs.P_UX; exports.P_UY = _chunkF2Y4E4GUcjs.P_UY; exports.PaintExchange = _chunk3T5O225Tcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunk3T5O225Tcjs.PaintGradientSampler; exports.PaintSourceError = _chunk3T5O225Tcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunk3T5O225Tcjs.PaperGrain; exports.PatternPlacement = _chunkAEAAN4ADcjs.PatternPlacement; exports.PatternTile = _chunkAEAAN4ADcjs.PatternTile; exports.PsdError = _chunkCM3LJPR3cjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkVEHVXRJUcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkVEHVXRJUcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkVEHVXRJUcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkCM3LJPR3cjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkCM3LJPR3cjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkF2Y4E4GUcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkO7LUD7MHcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkCM3LJPR3cjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkCM3LJPR3cjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkF2Y4E4GUcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkF2Y4E4GUcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkF2Y4E4GUcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkCM3LJPR3cjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkVEHVXRJUcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkF2Y4E4GUcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkF2Y4E4GUcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkCM3LJPR3cjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk3T5O225Tcjs.SmudgeTip; exports.StrokeCoverage = _chunk3T5O225Tcjs.StrokeCoverage; exports.SurfaceDraft = _chunkO7LUD7MHcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkCM3LJPR3cjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkCM3LJPR3cjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkCM3LJPR3cjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkO7LUD7MHcjs.TILE; exports.TILE_SHIFT = _chunkO7LUD7MHcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkCM3LJPR3cjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk3T5O225Tcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkCM3LJPR3cjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkVEHVXRJUcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkCM3LJPR3cjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunk3T5O225Tcjs.TileMedium; exports.TilePixelSource = _chunkVEHVXRJUcjs.TilePixelSource; exports.TileableNoise = _chunk3T5O225Tcjs.TileableNoise; exports.TiledSurface = _chunkO7LUD7MHcjs.TiledSurface; exports.TransformTooLargeError = _chunkAEAAN4ADcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkVEHVXRJUcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkF2Y4E4GUcjs.U_MAX; exports.VIBRANCE_GREY = _chunkCM3LJPR3cjs.VIBRANCE_GREY; exports.W9 = _chunkF2Y4E4GUcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkSXOTFV3Vcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkSXOTFV3Vcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkF2Y4E4GUcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkF2Y4E4GUcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkF2Y4E4GUcjs.WET_TILE; exports.WGSL_HALO = _chunkF2Y4E4GUcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkF2Y4E4GUcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkF2Y4E4GUcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkF2Y4E4GUcjs.WetGpuEngine; exports.WetMedium = _chunkF2Y4E4GUcjs.WetMedium; exports.WetWorkerPool = _chunkF2Y4E4GUcjs.WetWorkerPool; exports.WetWorld = _chunkF2Y4E4GUcjs.WetWorld; exports.WetWorldError = _chunkF2Y4E4GUcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkCM3LJPR3cjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkCM3LJPR3cjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkCM3LJPR3cjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkCM3LJPR3cjs.activeSmartFilters; exports.addLayerEffect = _chunkCM3LJPR3cjs.addLayerEffect; exports.addLayerFilter = _chunkCM3LJPR3cjs.addLayerFilter; exports.addPaintGradientStop = _chunk3T5O225Tcjs.addPaintGradientStop; exports.addSmartFilter = _chunkCM3LJPR3cjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkCM3LJPR3cjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkCM3LJPR3cjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkCM3LJPR3cjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkCM3LJPR3cjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkCM3LJPR3cjs.anchorPoint; exports.annotationBlend = _chunkCM3LJPR3cjs.annotationBlend; exports.annotationLayerFor = _chunkCM3LJPR3cjs.annotationLayerFor; exports.annotationLayerName = _chunkCM3LJPR3cjs.annotationLayerName; exports.annotationOfLayer = _chunkCM3LJPR3cjs.annotationOfLayer; exports.annotationOfShape = _chunkCM3LJPR3cjs.annotationOfShape; exports.annotationOfType = _chunkCM3LJPR3cjs.annotationOfType; exports.applyAdjustmentLayers = _chunkCM3LJPR3cjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkCM3LJPR3cjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkCM3LJPR3cjs.applyAdjustments; exports.applyBoxBlur = _chunkCM3LJPR3cjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkCM3LJPR3cjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkCM3LJPR3cjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkCM3LJPR3cjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkCM3LJPR3cjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkCM3LJPR3cjs.applyLegacyFloat; exports.applyMatrix3 = _chunkCM3LJPR3cjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkCM3LJPR3cjs.applyParams; exports.applyProcess2Adjustments = _chunkCM3LJPR3cjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkCM3LJPR3cjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkVEHVXRJUcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkCM3LJPR3cjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk3T5O225Tcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk3T5O225Tcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkVEHVXRJUcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkCM3LJPR3cjs.backgroundLayer; exports.base64ToBytes = _chunkO7LUD7MHcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkVEHVXRJUcjs.bestOffset; exports.blackWhiteGray = _chunkCM3LJPR3cjs.blackWhiteGray; exports.blendChannel = _chunkO7LUD7MHcjs.blendChannel; exports.blendImageData = _chunkO7LUD7MHcjs.blendImageData; exports.blendLum = _chunkO7LUD7MHcjs.blendLum; exports.blendPixel = _chunkO7LUD7MHcjs.blendPixel; exports.blendRadius = _chunk3T5O225Tcjs.blendRadius; exports.blendRgb = _chunkO7LUD7MHcjs.blendRgb; exports.blendTile = _chunkAEAAN4ADcjs.blendTile; exports.blenderDab = _chunk3T5O225Tcjs.blenderDab; exports.blurFilter = _chunkCM3LJPR3cjs.blurFilter; exports.borderCoverage = _chunkCM3LJPR3cjs.borderCoverage; exports.boxBlurPixels = _chunkVEHVXRJUcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkCM3LJPR3cjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkCM3LJPR3cjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunk3T5O225Tcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunk3T5O225Tcjs.brushstrokeKey; exports.brushstrokeSamples = _chunk3T5O225Tcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkSYPFUL5Bcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunk3T5O225Tcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunk3T5O225Tcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkCM3LJPR3cjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkCM3LJPR3cjs.buildToneLut; exports.builtinPattern = _chunkAEAAN4ADcjs.builtinPattern; exports.builtinPatternIds = _chunkAEAAN4ADcjs.builtinPatternIds; exports.bytesToBase64 = _chunkO7LUD7MHcjs.bytesToBase64; exports.calculateCropDrag = _chunkCM3LJPR3cjs.calculateCropDrag; exports.canShareMemory = _chunkF2Y4E4GUcjs.canShareMemory; exports.canvasCompositeOperation = _chunkO7LUD7MHcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkCM3LJPR3cjs.canvasToImagePoint; exports.caretAt = _chunkSXOTFV3Vcjs.caretAt; exports.changedTiles = _chunkAEAAN4ADcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkCM3LJPR3cjs.clampCropToImage; exports.cleanMixer = _chunk3T5O225Tcjs.cleanMixer; exports.cloneSamplePoint = _chunkVEHVXRJUcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkO7LUD7MHcjs.collectTiles; exports.colorBalanceChannel = _chunkCM3LJPR3cjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkCM3LJPR3cjs.combineSelections; exports.compileAdjustmentLayer = _chunkCM3LJPR3cjs.compileAdjustmentLayer; exports.componentPath = _chunkCM3LJPR3cjs.componentPath; exports.compositeDeep = _chunkCM3LJPR3cjs.compositeDeep; exports.compositeSurfaceOver = _chunkAEAAN4ADcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkCM3LJPR3cjs.computeSelectionBounds; exports.contentAwareFill = _chunkVEHVXRJUcjs.contentAwareFill; exports.contentBounds = _chunkO7LUD7MHcjs.contentBounds; exports.contentsBox = _chunkCM3LJPR3cjs.contentsBox; exports.contentsSurface = _chunkCM3LJPR3cjs.contentsSurface; exports.contractCoverage = _chunkCM3LJPR3cjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkO7LUD7MHcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkCM3LJPR3cjs.convertToSmartObject; exports.copySmartObject = _chunkCM3LJPR3cjs.copySmartObject; exports.cornersFromMatrix = _chunkCM3LJPR3cjs.cornersFromMatrix; exports.coverageTileCoord = _chunk3T5O225Tcjs.coverageTileCoord; exports.coverageToByte = _chunkCM3LJPR3cjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkCM3LJPR3cjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk3T5O225Tcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkSXOTFV3Vcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkSXOTFV3Vcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkSXOTFV3Vcjs.createOutlineTextShaper; exports.createPigment = _chunkO7LUD7MHcjs.createPigment; exports.createPigmentTools = _chunkF2Y4E4GUcjs.createPigmentTools; exports.createSelectionMask = _chunkCM3LJPR3cjs.createSelectionMask; exports.createShapeLayer = _chunkCM3LJPR3cjs.createShapeLayer; exports.createTypeLayer = _chunkCM3LJPR3cjs.createTypeLayer; exports.createWetGpuEngine = _chunkF2Y4E4GUcjs.createWetGpuEngine; exports.cssFont = _chunkSXOTFV3Vcjs.cssFont; exports.cssFontFamily = _chunkSXOTFV3Vcjs.cssFontFamily; exports.curveLut = _chunkAEAAN4ADcjs.curveLut; exports.curveLutFromLevels = _chunkCM3LJPR3cjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk3T5O225Tcjs.dabCoverage; exports.dabRect = _chunk3T5O225Tcjs.dabRect; exports.decodeDeepSurface = _chunkCM3LJPR3cjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkCM3LJPR3cjs.decodeLayerChannel; exports.decodeLayerMask = _chunkCM3LJPR3cjs.decodeLayerMask; exports.decodeMergedImage = _chunkCM3LJPR3cjs.decodeMergedImage; exports.decodePlanes = _chunkCM3LJPR3cjs.decodePlanes; exports.decodePng = _chunkO7LUD7MHcjs.decodePng; exports.decodePngDataUrl = _chunkCM3LJPR3cjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkCM3LJPR3cjs.decodeSelectionRle; exports.deepBytes = _chunkO7LUD7MHcjs.deepBytes; exports.deepTile = _chunkO7LUD7MHcjs.deepTile; exports.defaultAdjustmentParams = _chunkCM3LJPR3cjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkAEAAN4ADcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkAEAAN4ADcjs.defaultLayerEffect; exports.defaultShapeName = _chunkCM3LJPR3cjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkCM3LJPR3cjs.depthMaskAlpha; exports.depthOf = _chunkO7LUD7MHcjs.depthOf; exports.depthRasterMask = _chunkCM3LJPR3cjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkCM3LJPR3cjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkCM3LJPR3cjs.deserializeEffects; exports.deserializeLayer = _chunkCM3LJPR3cjs.deserializeLayer; exports.deserializeLayers = _chunkCM3LJPR3cjs.deserializeLayers; exports.deserializePatterns = _chunkCM3LJPR3cjs.deserializePatterns; exports.deserializeSelection = _chunkCM3LJPR3cjs.deserializeSelection; exports.developFilter = _chunkCM3LJPR3cjs.developFilter; exports.developFromAdjustments = _chunkCM3LJPR3cjs.developFromAdjustments; exports.developTarget = _chunkCM3LJPR3cjs.developTarget; exports.dexp = _chunkF2Y4E4GUcjs.dexp; exports.dilateMask = _chunkVEHVXRJUcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkCM3LJPR3cjs.distanceTransform; exports.dlog = _chunkF2Y4E4GUcjs.dlog; exports.documentContents = _chunkCM3LJPR3cjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkVEHVXRJUcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkVEHVXRJUcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkF2Y4E4GUcjs.dpow; exports.dragWarpMeshPoint = _chunkSXOTFV3Vcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkF2Y4E4GUcjs.dsincos; exports.duplicateLayer = _chunkCM3LJPR3cjs.duplicateLayer; exports.edgeBits = _chunkF2Y4E4GUcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkAEAAN4ADcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkAEAAN4ADcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkAEAAN4ADcjs.effectsFingerprint; exports.effectsMargin = _chunkAEAAN4ADcjs.effectsMargin; exports.effectsScale = _chunkAEAAN4ADcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkO7LUD7MHcjs.emptySurface; exports.encodeDeepSurface = _chunkCM3LJPR3cjs.encodeDeepSurface; exports.encodePng = _chunkO7LUD7MHcjs.encodePng; exports.encodeRle = _chunkCM3LJPR3cjs.encodeRle; exports.encodeSelectionRle = _chunkCM3LJPR3cjs.encodeSelectionRle; exports.encodeSurface = _chunkCM3LJPR3cjs.encodeSurface; exports.evalWarpMesh = _chunkSXOTFV3Vcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkCM3LJPR3cjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk3T5O225Tcjs.exchangeRates; exports.expNeg = _chunkF2Y4E4GUcjs.expNeg; exports.expandCoverage = _chunkCM3LJPR3cjs.expandCoverage; exports.exportPsd = _chunkCM3LJPR3cjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkCM3LJPR3cjs.featherCoverage; exports.fillRect = _chunkO7LUD7MHcjs.fillRect; exports.filmPixel = _chunkF2Y4E4GUcjs.filmPixel; exports.filmReflectance = _chunkF2Y4E4GUcjs.filmReflectance; exports.filterMaskCoverage = _chunkCM3LJPR3cjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkAEAAN4ADcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkF2Y4E4GUcjs.findWebGpu; exports.finishTile = _chunkO7LUD7MHcjs.finishTile; exports.fitParagraphRuns = _chunkSXOTFV3Vcjs.fitParagraphRuns; exports.fitRuns = _chunkSXOTFV3Vcjs.fitRuns; exports.flattenLayers = _chunkAEAAN4ADcjs.flattenLayers; exports.flattenPath = _chunkCM3LJPR3cjs.flattenPath; exports.flipCorners = _chunkCM3LJPR3cjs.flipCorners; exports.flowField = _chunkF2Y4E4GUcjs.flowField; exports.fontOf = _chunkSXOTFV3Vcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkCM3LJPR3cjs.fullSelection; exports.gaussianBlur = _chunkAEAAN4ADcjs.gaussianBlur; exports.geometryHomography = _chunkCM3LJPR3cjs.geometryHomography; exports.getAnnotationBounds = _chunkCM3LJPR3cjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkCM3LJPR3cjs.getCropCursor; exports.getRotatedSize = _chunkCM3LJPR3cjs.getRotatedSize; exports.getViewportMetrics = _chunkCM3LJPR3cjs.getViewportMetrics; exports.getViewportProjection = _chunkCM3LJPR3cjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk3T5O225Tcjs.gradientDabColor; exports.grainCatch = _chunk3T5O225Tcjs.grainCatch; exports.grainHeights = _chunk3T5O225Tcjs.grainHeights; exports.greyMorphology = _chunkCM3LJPR3cjs.greyMorphology; exports.groupLayers = _chunkCM3LJPR3cjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkAEAAN4ADcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkCM3LJPR3cjs.hasResampledLegacyMask; exports.hasSurface = _chunkCM3LJPR3cjs.hasSurface; exports.hasWarp = _chunkCM3LJPR3cjs.hasWarp; exports.hash2 = _chunk3T5O225Tcjs.hash2; exports.hashMaskContent = _chunkCM3LJPR3cjs.hashMaskContent; exports.hashNoise = _chunkAEAAN4ADcjs.hashNoise; exports.healPixels = _chunkVEHVXRJUcjs.healPixels; exports.hexToPaintRgb = _chunk3T5O225Tcjs.hexToPaintRgb; exports.hexToRgb = _chunkCM3LJPR3cjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkCM3LJPR3cjs.hitTestAnnotation; exports.hitTestCrop = _chunkCM3LJPR3cjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkCM3LJPR3cjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkCM3LJPR3cjs.hueRangeTables; exports.hueRangeWeight = _chunkCM3LJPR3cjs.hueRangeWeight; exports.hueSaturation = _chunkCM3LJPR3cjs.hueSaturation; exports.identityCurve = _chunkCM3LJPR3cjs.identityCurve; exports.identityLevels = _chunkCM3LJPR3cjs.identityLevels; exports.identityTransform = _chunkCM3LJPR3cjs.identityTransform; exports.identityWarpMesh = _chunkSXOTFV3Vcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkCM3LJPR3cjs.imageToCanvasPoint; exports.importPsd = _chunkCM3LJPR3cjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkAEAAN4ADcjs.insertLayer; exports.instancesOf = _chunkCM3LJPR3cjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkCM3LJPR3cjs.invertMatrix3; exports.invertSelection = _chunkCM3LJPR3cjs.invertSelection; exports.isActiveFilter = _chunkCM3LJPR3cjs.isActiveFilter; exports.isAdjustmentKind = _chunkCM3LJPR3cjs.isAdjustmentKind; exports.isBitDepth = _chunkO7LUD7MHcjs.isBitDepth; exports.isBlendMode = _chunkO7LUD7MHcjs.isBlendMode; exports.isBrushstrokeBrush = _chunk3T5O225Tcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkCM3LJPR3cjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkCM3LJPR3cjs.isDefaultDepthMask; exports.isGradientPaint = _chunk3T5O225Tcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkVEHVXRJUcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkCM3LJPR3cjs.isIdentityTransform; exports.isInterpolation = _chunkAEAAN4ADcjs.isInterpolation; exports.isLayerEffectKind = _chunkAEAAN4ADcjs.isLayerEffectKind; exports.isLayerLocked = _chunkAEAAN4ADcjs.isLayerLocked; exports.isLegacyShape = _chunkCM3LJPR3cjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkO7LUD7MHcjs.isPainterlyBlendMode; exports.isPng = _chunkO7LUD7MHcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkCM3LJPR3cjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkCM3LJPR3cjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkCM3LJPR3cjs.isSelectionEmpty; exports.isSelectionMode = _chunkCM3LJPR3cjs.isSelectionMode; exports.isSeparableBlendMode = _chunkO7LUD7MHcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkCM3LJPR3cjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkCM3LJPR3cjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkCM3LJPR3cjs.isTransformAnchor; exports.isValidWarp = _chunkCM3LJPR3cjs.isValidWarp; exports.keepDeepSamples = _chunkO7LUD7MHcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkCM3LJPR3cjs.kelvinToTemperature; exports.keysWeight = _chunkAEAAN4ADcjs.keysWeight; exports.latticeViscosity = _chunkF2Y4E4GUcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkAEAAN4ADcjs.layerEffectFields; exports.layerEffectLabel = _chunkAEAAN4ADcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkCM3LJPR3cjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkCM3LJPR3cjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkCM3LJPR3cjs.layerMaskFromSelection; exports.layerMaskKey = _chunkCM3LJPR3cjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkCM3LJPR3cjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkCM3LJPR3cjs.layerTree; exports.layerTypeLabel = _chunkCM3LJPR3cjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkCM3LJPR3cjs.layersFromLegacy; exports.layoutText = _chunkSXOTFV3Vcjs.layoutText; exports.legacyAdjustmentLayer = _chunkCM3LJPR3cjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkCM3LJPR3cjs.legacyMaskOf; exports.legacyView = _chunkCM3LJPR3cjs.legacyView; exports.lerpPigment = _chunkO7LUD7MHcjs.lerpPigment; exports.lerpPigmentInto = _chunkO7LUD7MHcjs.lerpPigmentInto; exports.levelsValue = _chunkCM3LJPR3cjs.levelsValue; exports.linearSrgbToXy = _chunkCM3LJPR3cjs.linearSrgbToXy; exports.linearToSrgb = _chunkCM3LJPR3cjs.linearToSrgb; exports.linearToSrgb8 = _chunkF2Y4E4GUcjs.linearToSrgb8; exports.liveComponent = _chunkCM3LJPR3cjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkCM3LJPR3cjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk3T5O225Tcjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkF2Y4E4GUcjs.loadWetKernel; exports.luma = _chunkVEHVXRJUcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkCM3LJPR3cjs.mapCropHandle; exports.mapLayer = _chunkAEAAN4ADcjs.mapLayer; exports.mapSubpaths = _chunkCM3LJPR3cjs.mapSubpaths; exports.maskBounds = _chunkVEHVXRJUcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkCM3LJPR3cjs.matrixFromCorners; exports.matrixFromParams = _chunkCM3LJPR3cjs.matrixFromParams; exports.membraneFill = _chunkVEHVXRJUcjs.membraneFill; exports.mergeLayerEffect = _chunkAEAAN4ADcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkCM3LJPR3cjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunk3T5O225Tcjs.mix32; exports.mixPigment8 = _chunkO7LUD7MHcjs.mixPigment8; exports.mixPigmentRgb = _chunkO7LUD7MHcjs.mixPigmentRgb; exports.mixPigments = _chunkO7LUD7MHcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk3T5O225Tcjs.mixerRates; exports.modifySelection = _chunkCM3LJPR3cjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkCM3LJPR3cjs.moveLayer; exports.moveSmartFilter = _chunkCM3LJPR3cjs.moveSmartFilter; exports.mulMatrix3 = _chunkCM3LJPR3cjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkCM3LJPR3cjs.neutralHueRange; exports.newContentsId = _chunkCM3LJPR3cjs.newContentsId; exports.newEffectId = _chunkAEAAN4ADcjs.newEffectId; exports.newLayerId = _chunkCM3LJPR3cjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkCM3LJPR3cjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkCM3LJPR3cjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkCM3LJPR3cjs.normalizeAngle; exports.normalizeBlendMode = _chunkO7LUD7MHcjs.normalizeBlendMode; exports.normalizeBlender = _chunk3T5O225Tcjs.normalizeBlender; exports.normalizeBrush = _chunk3T5O225Tcjs.normalizeBrush; exports.normalizeFilter = _chunkCM3LJPR3cjs.normalizeFilter; exports.normalizeFlow = _chunkF2Y4E4GUcjs.normalizeFlow; exports.normalizeHexColor = _chunk3T5O225Tcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkAEAAN4ADcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkCM3LJPR3cjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkCM3LJPR3cjs.normalizeLiveShape; exports.normalizeMixer = _chunk3T5O225Tcjs.normalizeMixer; exports.normalizePlacement = _chunkCM3LJPR3cjs.normalizePlacement; exports.normalizeProcessVersion = _chunkCM3LJPR3cjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkVEHVXRJUcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkCM3LJPR3cjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkCM3LJPR3cjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkCM3LJPR3cjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk3T5O225Tcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkCM3LJPR3cjs.normalizeSubpaths; exports.normalizeText = _chunkCM3LJPR3cjs.normalizeText; exports.normalizeTilt = _chunkF2Y4E4GUcjs.normalizeTilt; exports.normalizeWetParams = _chunkF2Y4E4GUcjs.normalizeWetParams; exports.offsetLayer = _chunkCM3LJPR3cjs.offsetLayer; exports.offsetShape = _chunkCM3LJPR3cjs.offsetShape; exports.offsetSmartObject = _chunkCM3LJPR3cjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkO7LUD7MHcjs.packRgba; exports.packWetParams = _chunkF2Y4E4GUcjs.packWetParams; exports.paintGradientMappingFor = _chunk3T5O225Tcjs.paintGradientMappingFor; exports.paintPathStroke = _chunk3T5O225Tcjs.paintPathStroke; exports.paintSourceColor = _chunk3T5O225Tcjs.paintSourceColor; exports.paintSourceCss = _chunk3T5O225Tcjs.paintSourceCss; exports.paragraphRanges = _chunkSXOTFV3Vcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkCM3LJPR3cjs.parseAdjustmentBlock; exports.parseBlend = _chunkCM3LJPR3cjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkO7LUD7MHcjs.parseDataUrl; exports.parseEffectColor = _chunkAEAAN4ADcjs.parseEffectColor; exports.parseLfx2 = _chunkCM3LJPR3cjs.parseLfx2; exports.parseLrfx = _chunkCM3LJPR3cjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk3T5O225Tcjs.parsePaintSource; exports.parsePatternBlock = _chunkCM3LJPR3cjs.parsePatternBlock; exports.parseSelectionMode = _chunkCM3LJPR3cjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkCM3LJPR3cjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkCM3LJPR3cjs.patchParagraphStyle; exports.patchTextStyle = _chunkCM3LJPR3cjs.patchTextStyle; exports.pathStrokeCoverage = _chunk3T5O225Tcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunk3T5O225Tcjs.pathStrokeDabs; exports.perDabStrength = _chunkVEHVXRJUcjs.perDabStrength; exports.photoFilterMatrix = _chunkCM3LJPR3cjs.photoFilterMatrix; exports.pigment8 = _chunkO7LUD7MHcjs.pigment8; exports.pigmentColor = _chunkF2Y4E4GUcjs.pigmentColor; exports.pigmentOf = _chunkF2Y4E4GUcjs.pigmentOf; exports.pixelLayerBounds = _chunkCM3LJPR3cjs.pixelLayerBounds; exports.pixelLayers = _chunkCM3LJPR3cjs.pixelLayers; exports.pixelPigment = _chunkF2Y4E4GUcjs.pixelPigment; exports.placeContents = _chunkCM3LJPR3cjs.placeContents; exports.placeLayer = _chunkCM3LJPR3cjs.placeLayer; exports.placementAt = _chunkCM3LJPR3cjs.placementAt; exports.placementBounds = _chunkCM3LJPR3cjs.placementBounds; exports.placementGeometry = _chunkCM3LJPR3cjs.placementGeometry; exports.pngDataUrl = _chunkO7LUD7MHcjs.pngDataUrl; exports.pointerPressure = _chunkF2Y4E4GUcjs.pointerPressure; exports.pointerStrokeSample = _chunkF2Y4E4GUcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkF2Y4E4GUcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkCM3LJPR3cjs.posterizeValue; exports.presetWarp = _chunkCM3LJPR3cjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkCM3LJPR3cjs.projectImagePoint; exports.projectImageRect = _chunkCM3LJPR3cjs.projectImageRect; exports.projectMaskCoverage = _chunkCM3LJPR3cjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkO7LUD7MHcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkCM3LJPR3cjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkCM3LJPR3cjs.psdToLayers; exports.pullWarpMesh = _chunkSXOTFV3Vcjs.pullWarpMesh; exports.put255 = _chunk3T5O225Tcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk3T5O225Tcjs.rand01; exports.randSigned = _chunk3T5O225Tcjs.randSigned; exports.rangeLightness = _chunkCM3LJPR3cjs.rangeLightness; exports.rasterContents = _chunkCM3LJPR3cjs.rasterContents; exports.rasterMaskFromLegacy = _chunkCM3LJPR3cjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkCM3LJPR3cjs.rasterizeCoverage; exports.rasterizeDab = _chunk3T5O225Tcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkCM3LJPR3cjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkO7LUD7MHcjs.readDeepRegion; exports.readPaintSource = _chunk3T5O225Tcjs.readPaintSource; exports.readPixel = _chunkO7LUD7MHcjs.readPixel; exports.readPsd = _chunkCM3LJPR3cjs.readPsd; exports.readRegion = _chunkO7LUD7MHcjs.readRegion; exports.readSourceRegion = _chunkVEHVXRJUcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkAEAAN4ADcjs.reduceSurface; exports.referencePoint = _chunkCM3LJPR3cjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkO7LUD7MHcjs.reflectanceToRgb; exports.removeAlpha = _chunkCM3LJPR3cjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkCM3LJPR3cjs.removeLayer; exports.removeLayerEffect = _chunkCM3LJPR3cjs.removeLayerEffect; exports.removeLayerFilter = _chunkCM3LJPR3cjs.removeLayerFilter; exports.removePaintGradientStop = _chunk3T5O225Tcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkCM3LJPR3cjs.removeSmartFilter; exports.renderBrushstroke = _chunk3T5O225Tcjs.renderBrushstroke; exports.renderLayerEffects = _chunkAEAAN4ADcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkCM3LJPR3cjs.renderShape; exports.renderShapeRect = _chunkCM3LJPR3cjs.renderShapeRect; exports.renderSmartObject = _chunkCM3LJPR3cjs.renderSmartObject; exports.renderText = _chunkCM3LJPR3cjs.renderText; exports.replaceContents = _chunkCM3LJPR3cjs.replaceContents; exports.replaceTextRange = _chunkCM3LJPR3cjs.replaceTextRange; exports.requireLayer = _chunkCM3LJPR3cjs.requireLayer; exports.requireOperation = _chunkCM3LJPR3cjs.requireOperation; exports.requireShapeLayer = _chunkCM3LJPR3cjs.requireShapeLayer; exports.requireSmartObject = _chunkCM3LJPR3cjs.requireSmartObject; exports.requireTypeLayer = _chunkCM3LJPR3cjs.requireTypeLayer; exports.requireUnlocked = _chunkCM3LJPR3cjs.requireUnlocked; exports.rerender = _chunkCM3LJPR3cjs.rerender; exports.rerenderShape = _chunkCM3LJPR3cjs.rerenderShape; exports.rerenderText = _chunkCM3LJPR3cjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkCM3LJPR3cjs.resizeSelection; exports.resizeWarpMesh = _chunkSXOTFV3Vcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkCM3LJPR3cjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk3T5O225Tcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkSXOTFV3Vcjs.restyleRange; exports.retouchFilter = _chunkVEHVXRJUcjs.retouchFilter; exports.reversePaintGradient = _chunk3T5O225Tcjs.reversePaintGradient; exports.rgbToGray = _chunkCM3LJPR3cjs.rgbToGray; exports.rgbToHsl = _chunkCM3LJPR3cjs.rgbToHsl; exports.rgbToReflectance = _chunkO7LUD7MHcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkVEHVXRJUcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkCM3LJPR3cjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkCM3LJPR3cjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkCM3LJPR3cjs.sampleLut; exports.sampleToneLut = _chunkCM3LJPR3cjs.sampleToneLut; exports.saturationOf = _chunkVEHVXRJUcjs.saturationOf; exports.scaleLayerEffect = _chunkAEAAN4ADcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk3T5O225Tcjs.scalePaintGradient; exports.seamlessClone = _chunkVEHVXRJUcjs.seamlessClone; exports.seedFromString = _chunk3T5O225Tcjs.seedFromString; exports.selectionArea = _chunkCM3LJPR3cjs.selectionArea; exports.selectionFromCoverage = _chunkCM3LJPR3cjs.selectionFromCoverage; exports.selectionFromPixels = _chunkCM3LJPR3cjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkCM3LJPR3cjs.selectionToCoverage; exports.selectionToPixels = _chunkCM3LJPR3cjs.selectionToPixels; exports.selectionValueAt = _chunkCM3LJPR3cjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkCM3LJPR3cjs.serializeContents; exports.serializeEffects = _chunkCM3LJPR3cjs.serializeEffects; exports.serializeLayer = _chunkCM3LJPR3cjs.serializeLayer; exports.serializeLayers = _chunkCM3LJPR3cjs.serializeLayers; exports.serializeLayersExternal = _chunkCM3LJPR3cjs.serializeLayersExternal; exports.serializePatterns = _chunkCM3LJPR3cjs.serializePatterns; exports.serializeSelection = _chunkCM3LJPR3cjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkCM3LJPR3cjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkCM3LJPR3cjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkCM3LJPR3cjs.setLayerMask; exports.setLayerProperties = _chunkCM3LJPR3cjs.setLayerProperties; exports.setLum = _chunkO7LUD7MHcjs.setLum; exports.setPigmentColor = _chunkO7LUD7MHcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkCM3LJPR3cjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkCM3LJPR3cjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkCM3LJPR3cjs.setSmartPlacement; exports.shadeTile = _chunkF2Y4E4GUcjs.shadeTile; exports.shapeAsPixelLayer = _chunkCM3LJPR3cjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkCM3LJPR3cjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkCM3LJPR3cjs.shapeGeometryBounds; exports.shapeLayers = _chunkCM3LJPR3cjs.shapeLayers; exports.shapeOutline = _chunkCM3LJPR3cjs.shapeOutline; exports.shapeRenderClip = _chunkCM3LJPR3cjs.shapeRenderClip; exports.shiftCoverage = _chunkCM3LJPR3cjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkCM3LJPR3cjs.smartObjectLayers; exports.smoothCoverage = _chunkCM3LJPR3cjs.smoothCoverage; exports.smoothPoints = _chunk3T5O225Tcjs.smoothPoints; exports.smudgeEffect = _chunkVEHVXRJUcjs.smudgeEffect; exports.solidPaint = _chunk3T5O225Tcjs.solidPaint; exports.solidSurface = _chunkO7LUD7MHcjs.solidSurface; exports.solveMembrane = _chunkVEHVXRJUcjs.solveMembrane; exports.spliceRuns = _chunkSXOTFV3Vcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkVEHVXRJUcjs.sponge; exports.spongeEffect = _chunkVEHVXRJUcjs.spongeEffect; exports.spotHealPixels = _chunkVEHVXRJUcjs.spotHealPixels; exports.spotHealWindow = _chunkVEHVXRJUcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkF2Y4E4GUcjs.srgbByteToLinear; exports.srgbDecode = _chunkO7LUD7MHcjs.srgbDecode; exports.srgbEncode = _chunkO7LUD7MHcjs.srgbEncode; exports.srgbToLinear = _chunkCM3LJPR3cjs.srgbToLinear; exports.standardBlendMode = _chunkO7LUD7MHcjs.standardBlendMode; exports.stepSlotTs = _chunkF2Y4E4GUcjs.stepSlotTs; exports.strokeGrainCatch = _chunk3T5O225Tcjs.strokeGrainCatch; exports.styleAt = _chunkSXOTFV3Vcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkO7LUD7MHcjs.surfaceBytes; exports.surfaceDepth = _chunkO7LUD7MHcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkO7LUD7MHcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkO7LUD7MHcjs.surfaceFromPixels; exports.surfacesEqual = _chunkO7LUD7MHcjs.surfacesEqual; exports.tempTintToXy = _chunkCM3LJPR3cjs.tempTintToXy; exports.temperatureToKelvin = _chunkCM3LJPR3cjs.temperatureToKelvin; exports.textIndexAt = _chunkSXOTFV3Vcjs.textIndexAt; exports.textMatrix = _chunkCM3LJPR3cjs.textMatrix; exports.textOutlines = _chunkCM3LJPR3cjs.textOutlines; exports.textRange = _chunkCM3LJPR3cjs.textRange; exports.tileCoord = _chunkO7LUD7MHcjs.tileCoord; exports.tileKey = _chunkO7LUD7MHcjs.tileKey; exports.tileRect = _chunkO7LUD7MHcjs.tileRect; exports.tileSamples = _chunkO7LUD7MHcjs.tileSamples; exports.tileSamples16 = _chunkO7LUD7MHcjs.tileSamples16; exports.tileSamples32 = _chunkO7LUD7MHcjs.tileSamples32; exports.tilesInRect = _chunkO7LUD7MHcjs.tilesInRect; exports.tipFalloff = _chunk3T5O225Tcjs.tipFalloff; exports.tipReach = _chunk3T5O225Tcjs.tipReach; exports.tipShape = _chunk3T5O225Tcjs.tipShape; exports.to16From32 = _chunkO7LUD7MHcjs.to16From32; exports.to16From8 = _chunkO7LUD7MHcjs.to16From8; exports.to32From16 = _chunkO7LUD7MHcjs.to32From16; exports.to32From8 = _chunkO7LUD7MHcjs.to32From8; exports.to8From16 = _chunkO7LUD7MHcjs.to8From16; exports.to8From32 = _chunkO7LUD7MHcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkCM3LJPR3cjs.toTextSpace; exports.toneCurve = _chunkCM3LJPR3cjs.toneCurve; exports.toneLuts = _chunkCM3LJPR3cjs.toneLuts; exports.toneOf = _chunkVEHVXRJUcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkCM3LJPR3cjs.transformHomography; exports.transformMap = _chunkCM3LJPR3cjs.transformMap; exports.transformShapeComponents = _chunkCM3LJPR3cjs.transformShapeComponents; exports.transformSurface = _chunkAEAAN4ADcjs.transformSurface; exports.transformTypeLayer = _chunkCM3LJPR3cjs.transformTypeLayer; exports.transformedBounds = _chunkAEAAN4ADcjs.transformedBounds; exports.transformedBox = _chunkCM3LJPR3cjs.transformedBox; exports.transformedPoint = _chunkCM3LJPR3cjs.transformedPoint; exports.translateSurface = _chunkO7LUD7MHcjs.translateSurface; exports.typeAsPixelLayer = _chunkCM3LJPR3cjs.typeAsPixelLayer; exports.typeFrame = _chunkCM3LJPR3cjs.typeFrame; exports.typeFromAnnotation = _chunkCM3LJPR3cjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkCM3LJPR3cjs.typeLayerName; exports.ungroupLayer = _chunkCM3LJPR3cjs.ungroupLayer; exports.uniformTile = _chunkO7LUD7MHcjs.uniformTile; exports.unionRect = _chunkCM3LJPR3cjs.unionRect; exports.unprojectCanvasPoint = _chunkCM3LJPR3cjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkCM3LJPR3cjs.updateLayerEffect; exports.updateLayerFilter = _chunkCM3LJPR3cjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkCM3LJPR3cjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk3T5O225Tcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkCM3LJPR3cjs.updateShapeLayer; exports.updateSmartFilter = _chunkCM3LJPR3cjs.updateSmartFilter; exports.updateTypeLayer = _chunkCM3LJPR3cjs.updateTypeLayer; exports.uvToXy = _chunkCM3LJPR3cjs.uvToXy; exports.validateEffectGradient = _chunkAEAAN4ADcjs.validateEffectGradient; exports.validateLayerEffect = _chunkAEAAN4ADcjs.validateLayerEffect; exports.validateLayerEffects = _chunkAEAAN4ADcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkCM3LJPR3cjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkCM3LJPR3cjs.vibranceLinear; exports.vibrancePixel = _chunkCM3LJPR3cjs.vibrancePixel; exports.walkDabs = _chunk3T5O225Tcjs.walkDabs; exports.warpMeshEditPoints = _chunkSXOTFV3Vcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkSXOTFV3Vcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkSXOTFV3Vcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkSXOTFV3Vcjs.warpPresetMesh; exports.warpSurface = _chunkAEAAN4ADcjs.warpSurface; exports.wbMatrix = _chunkCM3LJPR3cjs.wbMatrix; exports.wetGpuSupport = _chunkF2Y4E4GUcjs.wetGpuSupport; exports.wetSimdSupported = _chunkF2Y4E4GUcjs.wetSimdSupported; exports.wetSupport = _chunkF2Y4E4GUcjs.wetSupport; exports.whiteBalanceFromSample = _chunkCM3LJPR3cjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkCM3LJPR3cjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkCM3LJPR3cjs.withFilterMaskSurface; exports.withNewIds = _chunkCM3LJPR3cjs.withNewIds; exports.writeAdjustmentBlock = _chunkCM3LJPR3cjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkO7LUD7MHcjs.writeDeepRegion; exports.writeLfx2 = _chunkCM3LJPR3cjs.writeLfx2; exports.writePatternBlock = _chunkCM3LJPR3cjs.writePatternBlock; exports.writePsd = _chunkCM3LJPR3cjs.writePsd; exports.writeRegion = _chunkO7LUD7MHcjs.writeRegion; exports.xyToTempTint = _chunkCM3LJPR3cjs.xyToTempTint; exports.xyToUv = _chunkCM3LJPR3cjs.xyToUv;
|
|
16027
|
+
exports.ADJUSTMENT_KEYS = _chunkPMEHFHSPcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkPMEHFHSPcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkPMEHFHSPcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkPMEHFHSPcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkPMEHFHSPcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkPMEHFHSPcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkO7LUD7MHcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkO7LUD7MHcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkPMEHFHSPcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkF2Y4E4GUcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunk3T5O225Tcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunk3T5O225Tcjs.CoverageMap; exports.D50 = _chunkPMEHFHSPcjs.D50; exports.D65 = _chunkPMEHFHSPcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkXFXHA5MUcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk3T5O225Tcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk3T5O225Tcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkF2Y4E4GUcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkAEAAN4ADcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkPMEHFHSPcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk3T5O225Tcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunk3T5O225Tcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunk3T5O225Tcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkVEHVXRJUcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk3T5O225Tcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkF2Y4E4GUcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkF2Y4E4GUcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkPMEHFHSPcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkAEAAN4ADcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkF2Y4E4GUcjs.DRY_EPS; exports.DabWalker = _chunk3T5O225Tcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkPMEHFHSPcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk3T5O225Tcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkF2Y4E4GUcjs.EX; exports.EY = _chunkF2Y4E4GUcjs.EY; exports.FLAG_ALIVE = _chunkF2Y4E4GUcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkF2Y4E4GUcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkF2Y4E4GUcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkF2Y4E4GUcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkF2Y4E4GUcjs.FLAG_TOP; exports.FLAG_WET = _chunkF2Y4E4GUcjs.FLAG_WET; exports.FLAT = _chunkF2Y4E4GUcjs.FLAT; exports.FREE_INTERVAL = _chunkF2Y4E4GUcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkPMEHFHSPcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunk3T5O225Tcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunk3T5O225Tcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkF2Y4E4GUcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkPMEHFHSPcjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunkVEHVXRJUcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkPMEHFHSPcjs.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_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkAEAAN4ADcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkPMEHFHSPcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkAEAAN4ADcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkPMEHFHSPcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkPMEHFHSPcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkPMEHFHSPcjs.LUMA_709; exports.LayerCompositor = _chunkPMEHFHSPcjs.LayerCompositor; exports.LayerEffectError = _chunkAEAAN4ADcjs.LayerEffectError; exports.LayerOperationError = _chunkPMEHFHSPcjs.LayerOperationError; exports.MAX_BATCH = _chunkF2Y4E4GUcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunk3T5O225Tcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkAEAAN4ADcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkPMEHFHSPcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkF2Y4E4GUcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkAEAAN4ADcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkF2Y4E4GUcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkF2Y4E4GUcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkPMEHFHSPcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkPMEHFHSPcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk3T5O225Tcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk3T5O225Tcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk3T5O225Tcjs.MIXING_MODELS; exports.MixerStroke = _chunk3T5O225Tcjs.MixerStroke; exports.OPP = _chunkF2Y4E4GUcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkO7LUD7MHcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunk3T5O225Tcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunk3T5O225Tcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunk3T5O225Tcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunk3T5O225Tcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunk3T5O225Tcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunk3T5O225Tcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunk3T5O225Tcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunk3T5O225Tcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunk3T5O225Tcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunk3T5O225Tcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunk3T5O225Tcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunk3T5O225Tcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkF2Y4E4GUcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkPMEHFHSPcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkF2Y4E4GUcjs.PARAM; exports.PARAM_FLOATS = _chunkF2Y4E4GUcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkPMEHFHSPcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkO7LUD7MHcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkF2Y4E4GUcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkO7LUD7MHcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkO7LUD7MHcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkF2Y4E4GUcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkO7LUD7MHcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkF2Y4E4GUcjs.PLANE; exports.PLANE_BYTES = _chunkF2Y4E4GUcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkPMEHFHSPcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkF2Y4E4GUcjs.P_D0; exports.P_EDGE = _chunkF2Y4E4GUcjs.P_EDGE; exports.P_FX = _chunkF2Y4E4GUcjs.P_FX; exports.P_FY = _chunkF2Y4E4GUcjs.P_FY; exports.P_H = _chunkF2Y4E4GUcjs.P_H; exports.P_P0 = _chunkF2Y4E4GUcjs.P_P0; exports.P_RHO = _chunkF2Y4E4GUcjs.P_RHO; exports.P_SW = _chunkF2Y4E4GUcjs.P_SW; exports.P_UX = _chunkF2Y4E4GUcjs.P_UX; exports.P_UY = _chunkF2Y4E4GUcjs.P_UY; exports.PaintExchange = _chunk3T5O225Tcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunk3T5O225Tcjs.PaintGradientSampler; exports.PaintSourceError = _chunk3T5O225Tcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunk3T5O225Tcjs.PaperGrain; exports.PatternPlacement = _chunkAEAAN4ADcjs.PatternPlacement; exports.PatternTile = _chunkAEAAN4ADcjs.PatternTile; exports.PsdError = _chunkPMEHFHSPcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkVEHVXRJUcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkVEHVXRJUcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkVEHVXRJUcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkPMEHFHSPcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkPMEHFHSPcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkF2Y4E4GUcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkO7LUD7MHcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkPMEHFHSPcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkPMEHFHSPcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkF2Y4E4GUcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkF2Y4E4GUcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkF2Y4E4GUcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkPMEHFHSPcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkVEHVXRJUcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkF2Y4E4GUcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkF2Y4E4GUcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkPMEHFHSPcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk3T5O225Tcjs.SmudgeTip; exports.StrokeCoverage = _chunk3T5O225Tcjs.StrokeCoverage; exports.SurfaceDraft = _chunkO7LUD7MHcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkPMEHFHSPcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkPMEHFHSPcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkPMEHFHSPcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkO7LUD7MHcjs.TILE; exports.TILE_SHIFT = _chunkO7LUD7MHcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkPMEHFHSPcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk3T5O225Tcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkPMEHFHSPcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkVEHVXRJUcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkPMEHFHSPcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunk3T5O225Tcjs.TileMedium; exports.TilePixelSource = _chunkVEHVXRJUcjs.TilePixelSource; exports.TileableNoise = _chunk3T5O225Tcjs.TileableNoise; exports.TiledSurface = _chunkO7LUD7MHcjs.TiledSurface; exports.TransformTooLargeError = _chunkAEAAN4ADcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkVEHVXRJUcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkF2Y4E4GUcjs.U_MAX; exports.VIBRANCE_GREY = _chunkPMEHFHSPcjs.VIBRANCE_GREY; exports.W9 = _chunkF2Y4E4GUcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkXFXHA5MUcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkXFXHA5MUcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkF2Y4E4GUcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkF2Y4E4GUcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkF2Y4E4GUcjs.WET_TILE; exports.WGSL_HALO = _chunkF2Y4E4GUcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkF2Y4E4GUcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkF2Y4E4GUcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkF2Y4E4GUcjs.WetGpuEngine; exports.WetMedium = _chunkF2Y4E4GUcjs.WetMedium; exports.WetWorkerPool = _chunkF2Y4E4GUcjs.WetWorkerPool; exports.WetWorld = _chunkF2Y4E4GUcjs.WetWorld; exports.WetWorldError = _chunkF2Y4E4GUcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkPMEHFHSPcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkPMEHFHSPcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkPMEHFHSPcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkPMEHFHSPcjs.activeSmartFilters; exports.addLayerEffect = _chunkPMEHFHSPcjs.addLayerEffect; exports.addLayerFilter = _chunkPMEHFHSPcjs.addLayerFilter; exports.addPaintGradientStop = _chunk3T5O225Tcjs.addPaintGradientStop; exports.addSmartFilter = _chunkPMEHFHSPcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkPMEHFHSPcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkPMEHFHSPcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkPMEHFHSPcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkPMEHFHSPcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkPMEHFHSPcjs.anchorPoint; exports.annotationBlend = _chunkPMEHFHSPcjs.annotationBlend; exports.annotationLayerFor = _chunkPMEHFHSPcjs.annotationLayerFor; exports.annotationLayerName = _chunkPMEHFHSPcjs.annotationLayerName; exports.annotationOfLayer = _chunkPMEHFHSPcjs.annotationOfLayer; exports.annotationOfShape = _chunkPMEHFHSPcjs.annotationOfShape; exports.annotationOfType = _chunkPMEHFHSPcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkPMEHFHSPcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkPMEHFHSPcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkPMEHFHSPcjs.applyAdjustments; exports.applyBoxBlur = _chunkPMEHFHSPcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkPMEHFHSPcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkPMEHFHSPcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkPMEHFHSPcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkPMEHFHSPcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkPMEHFHSPcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkPMEHFHSPcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkPMEHFHSPcjs.applyParams; exports.applyProcess2Adjustments = _chunkPMEHFHSPcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkPMEHFHSPcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkVEHVXRJUcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkPMEHFHSPcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk3T5O225Tcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk3T5O225Tcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkVEHVXRJUcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkPMEHFHSPcjs.backgroundLayer; exports.base64ToBytes = _chunkO7LUD7MHcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkVEHVXRJUcjs.bestOffset; exports.blackWhiteGray = _chunkPMEHFHSPcjs.blackWhiteGray; exports.blendChannel = _chunkO7LUD7MHcjs.blendChannel; exports.blendImageData = _chunkO7LUD7MHcjs.blendImageData; exports.blendLum = _chunkO7LUD7MHcjs.blendLum; exports.blendPixel = _chunkO7LUD7MHcjs.blendPixel; exports.blendRadius = _chunk3T5O225Tcjs.blendRadius; exports.blendRgb = _chunkO7LUD7MHcjs.blendRgb; exports.blendTile = _chunkAEAAN4ADcjs.blendTile; exports.blenderDab = _chunk3T5O225Tcjs.blenderDab; exports.blurFilter = _chunkPMEHFHSPcjs.blurFilter; exports.borderCoverage = _chunkPMEHFHSPcjs.borderCoverage; exports.boxBlurPixels = _chunkVEHVXRJUcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkPMEHFHSPcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkPMEHFHSPcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunk3T5O225Tcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunk3T5O225Tcjs.brushstrokeKey; exports.brushstrokeSamples = _chunk3T5O225Tcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkSYPFUL5Bcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunk3T5O225Tcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunk3T5O225Tcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkPMEHFHSPcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkPMEHFHSPcjs.buildToneLut; exports.builtinPattern = _chunkAEAAN4ADcjs.builtinPattern; exports.builtinPatternIds = _chunkAEAAN4ADcjs.builtinPatternIds; exports.bytesToBase64 = _chunkO7LUD7MHcjs.bytesToBase64; exports.calculateCropDrag = _chunkPMEHFHSPcjs.calculateCropDrag; exports.canShareMemory = _chunkF2Y4E4GUcjs.canShareMemory; exports.canvasCompositeOperation = _chunkO7LUD7MHcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkPMEHFHSPcjs.canvasToImagePoint; exports.caretAt = _chunkXFXHA5MUcjs.caretAt; exports.changedTiles = _chunkAEAAN4ADcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkPMEHFHSPcjs.clampCropToImage; exports.cleanMixer = _chunk3T5O225Tcjs.cleanMixer; exports.cloneSamplePoint = _chunkVEHVXRJUcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkO7LUD7MHcjs.collectTiles; exports.colorBalanceChannel = _chunkPMEHFHSPcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkPMEHFHSPcjs.combineSelections; exports.compileAdjustmentLayer = _chunkPMEHFHSPcjs.compileAdjustmentLayer; exports.componentPath = _chunkPMEHFHSPcjs.componentPath; exports.compositeDeep = _chunkPMEHFHSPcjs.compositeDeep; exports.compositeSurfaceOver = _chunkAEAAN4ADcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkPMEHFHSPcjs.computeSelectionBounds; exports.contentAwareFill = _chunkVEHVXRJUcjs.contentAwareFill; exports.contentBounds = _chunkO7LUD7MHcjs.contentBounds; exports.contentsBox = _chunkPMEHFHSPcjs.contentsBox; exports.contentsSurface = _chunkPMEHFHSPcjs.contentsSurface; exports.contractCoverage = _chunkPMEHFHSPcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkO7LUD7MHcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkPMEHFHSPcjs.convertToSmartObject; exports.copySmartObject = _chunkPMEHFHSPcjs.copySmartObject; exports.cornersFromMatrix = _chunkPMEHFHSPcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk3T5O225Tcjs.coverageTileCoord; exports.coverageToByte = _chunkPMEHFHSPcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkPMEHFHSPcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk3T5O225Tcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkXFXHA5MUcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkXFXHA5MUcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkXFXHA5MUcjs.createOutlineTextShaper; exports.createPigment = _chunkO7LUD7MHcjs.createPigment; exports.createPigmentTools = _chunkF2Y4E4GUcjs.createPigmentTools; exports.createSelectionMask = _chunkPMEHFHSPcjs.createSelectionMask; exports.createShapeLayer = _chunkPMEHFHSPcjs.createShapeLayer; exports.createTypeLayer = _chunkPMEHFHSPcjs.createTypeLayer; exports.createWetGpuEngine = _chunkF2Y4E4GUcjs.createWetGpuEngine; exports.cssFont = _chunkXFXHA5MUcjs.cssFont; exports.cssFontFamily = _chunkXFXHA5MUcjs.cssFontFamily; exports.curveLut = _chunkAEAAN4ADcjs.curveLut; exports.curveLutFromLevels = _chunkPMEHFHSPcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk3T5O225Tcjs.dabCoverage; exports.dabRect = _chunk3T5O225Tcjs.dabRect; exports.decodeDeepSurface = _chunkPMEHFHSPcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkPMEHFHSPcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkPMEHFHSPcjs.decodeLayerMask; exports.decodeMergedImage = _chunkPMEHFHSPcjs.decodeMergedImage; exports.decodePlanes = _chunkPMEHFHSPcjs.decodePlanes; exports.decodePng = _chunkO7LUD7MHcjs.decodePng; exports.decodePngDataUrl = _chunkPMEHFHSPcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkPMEHFHSPcjs.decodeSelectionRle; exports.deepBytes = _chunkO7LUD7MHcjs.deepBytes; exports.deepTile = _chunkO7LUD7MHcjs.deepTile; exports.defaultAdjustmentParams = _chunkPMEHFHSPcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkAEAAN4ADcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkAEAAN4ADcjs.defaultLayerEffect; exports.defaultShapeName = _chunkPMEHFHSPcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkPMEHFHSPcjs.depthMaskAlpha; exports.depthOf = _chunkO7LUD7MHcjs.depthOf; exports.depthRasterMask = _chunkPMEHFHSPcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkPMEHFHSPcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkPMEHFHSPcjs.deserializeEffects; exports.deserializeLayer = _chunkPMEHFHSPcjs.deserializeLayer; exports.deserializeLayers = _chunkPMEHFHSPcjs.deserializeLayers; exports.deserializePatterns = _chunkPMEHFHSPcjs.deserializePatterns; exports.deserializeSelection = _chunkPMEHFHSPcjs.deserializeSelection; exports.developFilter = _chunkPMEHFHSPcjs.developFilter; exports.developFromAdjustments = _chunkPMEHFHSPcjs.developFromAdjustments; exports.developTarget = _chunkPMEHFHSPcjs.developTarget; exports.dexp = _chunkF2Y4E4GUcjs.dexp; exports.dilateMask = _chunkVEHVXRJUcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkPMEHFHSPcjs.distanceTransform; exports.dlog = _chunkF2Y4E4GUcjs.dlog; exports.documentContents = _chunkPMEHFHSPcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkVEHVXRJUcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkVEHVXRJUcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkF2Y4E4GUcjs.dpow; exports.dragWarpMeshPoint = _chunkXFXHA5MUcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkF2Y4E4GUcjs.dsincos; exports.duplicateLayer = _chunkPMEHFHSPcjs.duplicateLayer; exports.edgeBits = _chunkF2Y4E4GUcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkAEAAN4ADcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkAEAAN4ADcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkAEAAN4ADcjs.effectsFingerprint; exports.effectsMargin = _chunkAEAAN4ADcjs.effectsMargin; exports.effectsScale = _chunkAEAAN4ADcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkO7LUD7MHcjs.emptySurface; exports.encodeDeepSurface = _chunkPMEHFHSPcjs.encodeDeepSurface; exports.encodePng = _chunkO7LUD7MHcjs.encodePng; exports.encodeRle = _chunkPMEHFHSPcjs.encodeRle; exports.encodeSelectionRle = _chunkPMEHFHSPcjs.encodeSelectionRle; exports.encodeSurface = _chunkPMEHFHSPcjs.encodeSurface; exports.evalWarpMesh = _chunkXFXHA5MUcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkPMEHFHSPcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk3T5O225Tcjs.exchangeRates; exports.expNeg = _chunkF2Y4E4GUcjs.expNeg; exports.expandCoverage = _chunkPMEHFHSPcjs.expandCoverage; exports.exportPsd = _chunkPMEHFHSPcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkPMEHFHSPcjs.featherCoverage; exports.fillRect = _chunkO7LUD7MHcjs.fillRect; exports.filmPixel = _chunkF2Y4E4GUcjs.filmPixel; exports.filmReflectance = _chunkF2Y4E4GUcjs.filmReflectance; exports.filterMaskCoverage = _chunkPMEHFHSPcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkAEAAN4ADcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkF2Y4E4GUcjs.findWebGpu; exports.finishTile = _chunkO7LUD7MHcjs.finishTile; exports.fitParagraphRuns = _chunkXFXHA5MUcjs.fitParagraphRuns; exports.fitRuns = _chunkXFXHA5MUcjs.fitRuns; exports.flattenLayers = _chunkAEAAN4ADcjs.flattenLayers; exports.flattenPath = _chunkPMEHFHSPcjs.flattenPath; exports.flipCorners = _chunkPMEHFHSPcjs.flipCorners; exports.flowField = _chunkF2Y4E4GUcjs.flowField; exports.fontOf = _chunkXFXHA5MUcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkPMEHFHSPcjs.fullSelection; exports.gaussianBlur = _chunkAEAAN4ADcjs.gaussianBlur; exports.geometryHomography = _chunkPMEHFHSPcjs.geometryHomography; exports.getAnnotationBounds = _chunkPMEHFHSPcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkPMEHFHSPcjs.getCropCursor; exports.getRotatedSize = _chunkPMEHFHSPcjs.getRotatedSize; exports.getViewportMetrics = _chunkPMEHFHSPcjs.getViewportMetrics; exports.getViewportProjection = _chunkPMEHFHSPcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk3T5O225Tcjs.gradientDabColor; exports.grainCatch = _chunk3T5O225Tcjs.grainCatch; exports.grainHeights = _chunk3T5O225Tcjs.grainHeights; exports.greyMorphology = _chunkPMEHFHSPcjs.greyMorphology; exports.groupLayers = _chunkPMEHFHSPcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkAEAAN4ADcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkPMEHFHSPcjs.hasResampledLegacyMask; exports.hasSurface = _chunkPMEHFHSPcjs.hasSurface; exports.hasWarp = _chunkPMEHFHSPcjs.hasWarp; exports.hash2 = _chunk3T5O225Tcjs.hash2; exports.hashMaskContent = _chunkPMEHFHSPcjs.hashMaskContent; exports.hashNoise = _chunkAEAAN4ADcjs.hashNoise; exports.healPixels = _chunkVEHVXRJUcjs.healPixels; exports.hexToPaintRgb = _chunk3T5O225Tcjs.hexToPaintRgb; exports.hexToRgb = _chunkPMEHFHSPcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkPMEHFHSPcjs.hitTestAnnotation; exports.hitTestCrop = _chunkPMEHFHSPcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkPMEHFHSPcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkPMEHFHSPcjs.hueRangeTables; exports.hueRangeWeight = _chunkPMEHFHSPcjs.hueRangeWeight; exports.hueSaturation = _chunkPMEHFHSPcjs.hueSaturation; exports.identityCurve = _chunkPMEHFHSPcjs.identityCurve; exports.identityLevels = _chunkPMEHFHSPcjs.identityLevels; exports.identityTransform = _chunkPMEHFHSPcjs.identityTransform; exports.identityWarpMesh = _chunkXFXHA5MUcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkPMEHFHSPcjs.imageToCanvasPoint; exports.importPsd = _chunkPMEHFHSPcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkAEAAN4ADcjs.insertLayer; exports.instancesOf = _chunkPMEHFHSPcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkPMEHFHSPcjs.invertMatrix3; exports.invertSelection = _chunkPMEHFHSPcjs.invertSelection; exports.isActiveFilter = _chunkPMEHFHSPcjs.isActiveFilter; exports.isAdjustmentKind = _chunkPMEHFHSPcjs.isAdjustmentKind; exports.isBitDepth = _chunkO7LUD7MHcjs.isBitDepth; exports.isBlendMode = _chunkO7LUD7MHcjs.isBlendMode; exports.isBrushstrokeBrush = _chunk3T5O225Tcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkPMEHFHSPcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkPMEHFHSPcjs.isDefaultDepthMask; exports.isGradientPaint = _chunk3T5O225Tcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkVEHVXRJUcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkPMEHFHSPcjs.isIdentityTransform; exports.isInterpolation = _chunkAEAAN4ADcjs.isInterpolation; exports.isLayerEffectKind = _chunkAEAAN4ADcjs.isLayerEffectKind; exports.isLayerLocked = _chunkAEAAN4ADcjs.isLayerLocked; exports.isLegacyShape = _chunkPMEHFHSPcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkO7LUD7MHcjs.isPainterlyBlendMode; exports.isPng = _chunkO7LUD7MHcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkPMEHFHSPcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkPMEHFHSPcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkPMEHFHSPcjs.isSelectionEmpty; exports.isSelectionMode = _chunkPMEHFHSPcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkO7LUD7MHcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkPMEHFHSPcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkPMEHFHSPcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkPMEHFHSPcjs.isTransformAnchor; exports.isValidWarp = _chunkPMEHFHSPcjs.isValidWarp; exports.keepDeepSamples = _chunkO7LUD7MHcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkPMEHFHSPcjs.kelvinToTemperature; exports.keysWeight = _chunkAEAAN4ADcjs.keysWeight; exports.latticeViscosity = _chunkF2Y4E4GUcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkAEAAN4ADcjs.layerEffectFields; exports.layerEffectLabel = _chunkAEAAN4ADcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkPMEHFHSPcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkPMEHFHSPcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkPMEHFHSPcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkPMEHFHSPcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkPMEHFHSPcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkPMEHFHSPcjs.layerTree; exports.layerTypeLabel = _chunkPMEHFHSPcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkPMEHFHSPcjs.layersFromLegacy; exports.layoutText = _chunkXFXHA5MUcjs.layoutText; exports.legacyAdjustmentLayer = _chunkPMEHFHSPcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkPMEHFHSPcjs.legacyMaskOf; exports.legacyView = _chunkPMEHFHSPcjs.legacyView; exports.lerpPigment = _chunkO7LUD7MHcjs.lerpPigment; exports.lerpPigmentInto = _chunkO7LUD7MHcjs.lerpPigmentInto; exports.levelsValue = _chunkPMEHFHSPcjs.levelsValue; exports.linearSrgbToXy = _chunkPMEHFHSPcjs.linearSrgbToXy; exports.linearToSrgb = _chunkPMEHFHSPcjs.linearToSrgb; exports.linearToSrgb8 = _chunkF2Y4E4GUcjs.linearToSrgb8; exports.liveComponent = _chunkPMEHFHSPcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkPMEHFHSPcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk3T5O225Tcjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkF2Y4E4GUcjs.loadWetKernel; exports.luma = _chunkVEHVXRJUcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkPMEHFHSPcjs.mapCropHandle; exports.mapLayer = _chunkAEAAN4ADcjs.mapLayer; exports.mapSubpaths = _chunkPMEHFHSPcjs.mapSubpaths; exports.maskBounds = _chunkVEHVXRJUcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkPMEHFHSPcjs.matrixFromCorners; exports.matrixFromParams = _chunkPMEHFHSPcjs.matrixFromParams; exports.membraneFill = _chunkVEHVXRJUcjs.membraneFill; exports.mergeLayerEffect = _chunkAEAAN4ADcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkPMEHFHSPcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunk3T5O225Tcjs.mix32; exports.mixPigment8 = _chunkO7LUD7MHcjs.mixPigment8; exports.mixPigmentRgb = _chunkO7LUD7MHcjs.mixPigmentRgb; exports.mixPigments = _chunkO7LUD7MHcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk3T5O225Tcjs.mixerRates; exports.modifySelection = _chunkPMEHFHSPcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkPMEHFHSPcjs.moveLayer; exports.moveSmartFilter = _chunkPMEHFHSPcjs.moveSmartFilter; exports.mulMatrix3 = _chunkPMEHFHSPcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkPMEHFHSPcjs.neutralHueRange; exports.newContentsId = _chunkPMEHFHSPcjs.newContentsId; exports.newEffectId = _chunkAEAAN4ADcjs.newEffectId; exports.newLayerId = _chunkPMEHFHSPcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkPMEHFHSPcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkPMEHFHSPcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkPMEHFHSPcjs.normalizeAngle; exports.normalizeBlendMode = _chunkO7LUD7MHcjs.normalizeBlendMode; exports.normalizeBlender = _chunk3T5O225Tcjs.normalizeBlender; exports.normalizeBrush = _chunk3T5O225Tcjs.normalizeBrush; exports.normalizeFilter = _chunkPMEHFHSPcjs.normalizeFilter; exports.normalizeFlow = _chunkF2Y4E4GUcjs.normalizeFlow; exports.normalizeHexColor = _chunk3T5O225Tcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkAEAAN4ADcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkPMEHFHSPcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkPMEHFHSPcjs.normalizeLiveShape; exports.normalizeMixer = _chunk3T5O225Tcjs.normalizeMixer; exports.normalizePlacement = _chunkPMEHFHSPcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkPMEHFHSPcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkVEHVXRJUcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkPMEHFHSPcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkPMEHFHSPcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkPMEHFHSPcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk3T5O225Tcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkPMEHFHSPcjs.normalizeSubpaths; exports.normalizeText = _chunkPMEHFHSPcjs.normalizeText; exports.normalizeTilt = _chunkF2Y4E4GUcjs.normalizeTilt; exports.normalizeWetParams = _chunkF2Y4E4GUcjs.normalizeWetParams; exports.offsetLayer = _chunkPMEHFHSPcjs.offsetLayer; exports.offsetShape = _chunkPMEHFHSPcjs.offsetShape; exports.offsetSmartObject = _chunkPMEHFHSPcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkO7LUD7MHcjs.packRgba; exports.packWetParams = _chunkF2Y4E4GUcjs.packWetParams; exports.paintGradientMappingFor = _chunk3T5O225Tcjs.paintGradientMappingFor; exports.paintPathStroke = _chunk3T5O225Tcjs.paintPathStroke; exports.paintSourceColor = _chunk3T5O225Tcjs.paintSourceColor; exports.paintSourceCss = _chunk3T5O225Tcjs.paintSourceCss; exports.paragraphRanges = _chunkXFXHA5MUcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkPMEHFHSPcjs.parseAdjustmentBlock; exports.parseBlend = _chunkPMEHFHSPcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkO7LUD7MHcjs.parseDataUrl; exports.parseEffectColor = _chunkAEAAN4ADcjs.parseEffectColor; exports.parseLfx2 = _chunkPMEHFHSPcjs.parseLfx2; exports.parseLrfx = _chunkPMEHFHSPcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk3T5O225Tcjs.parsePaintSource; exports.parsePatternBlock = _chunkPMEHFHSPcjs.parsePatternBlock; exports.parseSelectionMode = _chunkPMEHFHSPcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkPMEHFHSPcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkPMEHFHSPcjs.patchParagraphStyle; exports.patchTextStyle = _chunkPMEHFHSPcjs.patchTextStyle; exports.pathStrokeCoverage = _chunk3T5O225Tcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunk3T5O225Tcjs.pathStrokeDabs; exports.perDabStrength = _chunkVEHVXRJUcjs.perDabStrength; exports.photoFilterMatrix = _chunkPMEHFHSPcjs.photoFilterMatrix; exports.pigment8 = _chunkO7LUD7MHcjs.pigment8; exports.pigmentColor = _chunkF2Y4E4GUcjs.pigmentColor; exports.pigmentOf = _chunkF2Y4E4GUcjs.pigmentOf; exports.pixelLayerBounds = _chunkPMEHFHSPcjs.pixelLayerBounds; exports.pixelLayers = _chunkPMEHFHSPcjs.pixelLayers; exports.pixelPigment = _chunkF2Y4E4GUcjs.pixelPigment; exports.placeContents = _chunkPMEHFHSPcjs.placeContents; exports.placeLayer = _chunkPMEHFHSPcjs.placeLayer; exports.placementAt = _chunkPMEHFHSPcjs.placementAt; exports.placementBounds = _chunkPMEHFHSPcjs.placementBounds; exports.placementGeometry = _chunkPMEHFHSPcjs.placementGeometry; exports.pngDataUrl = _chunkO7LUD7MHcjs.pngDataUrl; exports.pointerPressure = _chunkF2Y4E4GUcjs.pointerPressure; exports.pointerStrokeSample = _chunkF2Y4E4GUcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkF2Y4E4GUcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkPMEHFHSPcjs.posterizeValue; exports.presetWarp = _chunkPMEHFHSPcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkPMEHFHSPcjs.projectImagePoint; exports.projectImageRect = _chunkPMEHFHSPcjs.projectImageRect; exports.projectMaskCoverage = _chunkPMEHFHSPcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkO7LUD7MHcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkPMEHFHSPcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkPMEHFHSPcjs.psdToLayers; exports.pullWarpMesh = _chunkXFXHA5MUcjs.pullWarpMesh; exports.put255 = _chunk3T5O225Tcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk3T5O225Tcjs.rand01; exports.randSigned = _chunk3T5O225Tcjs.randSigned; exports.rangeLightness = _chunkPMEHFHSPcjs.rangeLightness; exports.rasterContents = _chunkPMEHFHSPcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkPMEHFHSPcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkPMEHFHSPcjs.rasterizeCoverage; exports.rasterizeDab = _chunk3T5O225Tcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkPMEHFHSPcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkO7LUD7MHcjs.readDeepRegion; exports.readPaintSource = _chunk3T5O225Tcjs.readPaintSource; exports.readPixel = _chunkO7LUD7MHcjs.readPixel; exports.readPsd = _chunkPMEHFHSPcjs.readPsd; exports.readRegion = _chunkO7LUD7MHcjs.readRegion; exports.readSourceRegion = _chunkVEHVXRJUcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkAEAAN4ADcjs.reduceSurface; exports.referencePoint = _chunkPMEHFHSPcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkO7LUD7MHcjs.reflectanceToRgb; exports.removeAlpha = _chunkPMEHFHSPcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkPMEHFHSPcjs.removeLayer; exports.removeLayerEffect = _chunkPMEHFHSPcjs.removeLayerEffect; exports.removeLayerFilter = _chunkPMEHFHSPcjs.removeLayerFilter; exports.removePaintGradientStop = _chunk3T5O225Tcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkPMEHFHSPcjs.removeSmartFilter; exports.renderBrushstroke = _chunk3T5O225Tcjs.renderBrushstroke; exports.renderLayerEffects = _chunkAEAAN4ADcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkPMEHFHSPcjs.renderShape; exports.renderShapeRect = _chunkPMEHFHSPcjs.renderShapeRect; exports.renderSmartObject = _chunkPMEHFHSPcjs.renderSmartObject; exports.renderText = _chunkPMEHFHSPcjs.renderText; exports.replaceContents = _chunkPMEHFHSPcjs.replaceContents; exports.replaceTextRange = _chunkPMEHFHSPcjs.replaceTextRange; exports.requireLayer = _chunkPMEHFHSPcjs.requireLayer; exports.requireOperation = _chunkPMEHFHSPcjs.requireOperation; exports.requireShapeLayer = _chunkPMEHFHSPcjs.requireShapeLayer; exports.requireSmartObject = _chunkPMEHFHSPcjs.requireSmartObject; exports.requireTypeLayer = _chunkPMEHFHSPcjs.requireTypeLayer; exports.requireUnlocked = _chunkPMEHFHSPcjs.requireUnlocked; exports.rerender = _chunkPMEHFHSPcjs.rerender; exports.rerenderShape = _chunkPMEHFHSPcjs.rerenderShape; exports.rerenderText = _chunkPMEHFHSPcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkPMEHFHSPcjs.resizeSelection; exports.resizeWarpMesh = _chunkXFXHA5MUcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkPMEHFHSPcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk3T5O225Tcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkXFXHA5MUcjs.restyleRange; exports.retouchFilter = _chunkVEHVXRJUcjs.retouchFilter; exports.reversePaintGradient = _chunk3T5O225Tcjs.reversePaintGradient; exports.rgbToGray = _chunkPMEHFHSPcjs.rgbToGray; exports.rgbToHsl = _chunkPMEHFHSPcjs.rgbToHsl; exports.rgbToReflectance = _chunkO7LUD7MHcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkVEHVXRJUcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkPMEHFHSPcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkPMEHFHSPcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkPMEHFHSPcjs.sampleLut; exports.sampleToneLut = _chunkPMEHFHSPcjs.sampleToneLut; exports.saturationOf = _chunkVEHVXRJUcjs.saturationOf; exports.scaleLayerEffect = _chunkAEAAN4ADcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk3T5O225Tcjs.scalePaintGradient; exports.seamlessClone = _chunkVEHVXRJUcjs.seamlessClone; exports.seedFromString = _chunk3T5O225Tcjs.seedFromString; exports.selectionArea = _chunkPMEHFHSPcjs.selectionArea; exports.selectionFromCoverage = _chunkPMEHFHSPcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkPMEHFHSPcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkPMEHFHSPcjs.selectionToCoverage; exports.selectionToPixels = _chunkPMEHFHSPcjs.selectionToPixels; exports.selectionValueAt = _chunkPMEHFHSPcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkPMEHFHSPcjs.serializeContents; exports.serializeEffects = _chunkPMEHFHSPcjs.serializeEffects; exports.serializeLayer = _chunkPMEHFHSPcjs.serializeLayer; exports.serializeLayers = _chunkPMEHFHSPcjs.serializeLayers; exports.serializeLayersExternal = _chunkPMEHFHSPcjs.serializeLayersExternal; exports.serializePatterns = _chunkPMEHFHSPcjs.serializePatterns; exports.serializeSelection = _chunkPMEHFHSPcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkPMEHFHSPcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkPMEHFHSPcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkPMEHFHSPcjs.setLayerMask; exports.setLayerProperties = _chunkPMEHFHSPcjs.setLayerProperties; exports.setLum = _chunkO7LUD7MHcjs.setLum; exports.setPigmentColor = _chunkO7LUD7MHcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkPMEHFHSPcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkPMEHFHSPcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkPMEHFHSPcjs.setSmartPlacement; exports.shadeTile = _chunkF2Y4E4GUcjs.shadeTile; exports.shapeAsPixelLayer = _chunkPMEHFHSPcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkPMEHFHSPcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkPMEHFHSPcjs.shapeGeometryBounds; exports.shapeLayers = _chunkPMEHFHSPcjs.shapeLayers; exports.shapeOutline = _chunkPMEHFHSPcjs.shapeOutline; exports.shapeRenderClip = _chunkPMEHFHSPcjs.shapeRenderClip; exports.shiftCoverage = _chunkPMEHFHSPcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkPMEHFHSPcjs.smartObjectLayers; exports.smoothCoverage = _chunkPMEHFHSPcjs.smoothCoverage; exports.smoothPoints = _chunk3T5O225Tcjs.smoothPoints; exports.smudgeEffect = _chunkVEHVXRJUcjs.smudgeEffect; exports.solidPaint = _chunk3T5O225Tcjs.solidPaint; exports.solidSurface = _chunkO7LUD7MHcjs.solidSurface; exports.solveMembrane = _chunkVEHVXRJUcjs.solveMembrane; exports.spliceRuns = _chunkXFXHA5MUcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkVEHVXRJUcjs.sponge; exports.spongeEffect = _chunkVEHVXRJUcjs.spongeEffect; exports.spotHealPixels = _chunkVEHVXRJUcjs.spotHealPixels; exports.spotHealWindow = _chunkVEHVXRJUcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkF2Y4E4GUcjs.srgbByteToLinear; exports.srgbDecode = _chunkO7LUD7MHcjs.srgbDecode; exports.srgbEncode = _chunkO7LUD7MHcjs.srgbEncode; exports.srgbToLinear = _chunkPMEHFHSPcjs.srgbToLinear; exports.standardBlendMode = _chunkO7LUD7MHcjs.standardBlendMode; exports.stepSlotTs = _chunkF2Y4E4GUcjs.stepSlotTs; exports.strokeGrainCatch = _chunk3T5O225Tcjs.strokeGrainCatch; exports.styleAt = _chunkXFXHA5MUcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkO7LUD7MHcjs.surfaceBytes; exports.surfaceDepth = _chunkO7LUD7MHcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkO7LUD7MHcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkO7LUD7MHcjs.surfaceFromPixels; exports.surfacesEqual = _chunkO7LUD7MHcjs.surfacesEqual; exports.tempTintToXy = _chunkPMEHFHSPcjs.tempTintToXy; exports.temperatureToKelvin = _chunkPMEHFHSPcjs.temperatureToKelvin; exports.textIndexAt = _chunkXFXHA5MUcjs.textIndexAt; exports.textMatrix = _chunkPMEHFHSPcjs.textMatrix; exports.textOutlines = _chunkPMEHFHSPcjs.textOutlines; exports.textRange = _chunkPMEHFHSPcjs.textRange; exports.tileCoord = _chunkO7LUD7MHcjs.tileCoord; exports.tileKey = _chunkO7LUD7MHcjs.tileKey; exports.tileRect = _chunkO7LUD7MHcjs.tileRect; exports.tileSamples = _chunkO7LUD7MHcjs.tileSamples; exports.tileSamples16 = _chunkO7LUD7MHcjs.tileSamples16; exports.tileSamples32 = _chunkO7LUD7MHcjs.tileSamples32; exports.tilesInRect = _chunkO7LUD7MHcjs.tilesInRect; exports.tipFalloff = _chunk3T5O225Tcjs.tipFalloff; exports.tipReach = _chunk3T5O225Tcjs.tipReach; exports.tipShape = _chunk3T5O225Tcjs.tipShape; exports.to16From32 = _chunkO7LUD7MHcjs.to16From32; exports.to16From8 = _chunkO7LUD7MHcjs.to16From8; exports.to32From16 = _chunkO7LUD7MHcjs.to32From16; exports.to32From8 = _chunkO7LUD7MHcjs.to32From8; exports.to8From16 = _chunkO7LUD7MHcjs.to8From16; exports.to8From32 = _chunkO7LUD7MHcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkPMEHFHSPcjs.toTextSpace; exports.toneCurve = _chunkPMEHFHSPcjs.toneCurve; exports.toneLuts = _chunkPMEHFHSPcjs.toneLuts; exports.toneOf = _chunkVEHVXRJUcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkPMEHFHSPcjs.transformHomography; exports.transformMap = _chunkPMEHFHSPcjs.transformMap; exports.transformShapeComponents = _chunkPMEHFHSPcjs.transformShapeComponents; exports.transformSurface = _chunkAEAAN4ADcjs.transformSurface; exports.transformTypeLayer = _chunkPMEHFHSPcjs.transformTypeLayer; exports.transformedBounds = _chunkAEAAN4ADcjs.transformedBounds; exports.transformedBox = _chunkPMEHFHSPcjs.transformedBox; exports.transformedPoint = _chunkPMEHFHSPcjs.transformedPoint; exports.translateSurface = _chunkO7LUD7MHcjs.translateSurface; exports.typeAsPixelLayer = _chunkPMEHFHSPcjs.typeAsPixelLayer; exports.typeFrame = _chunkPMEHFHSPcjs.typeFrame; exports.typeFromAnnotation = _chunkPMEHFHSPcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkPMEHFHSPcjs.typeLayerName; exports.ungroupLayer = _chunkPMEHFHSPcjs.ungroupLayer; exports.uniformTile = _chunkO7LUD7MHcjs.uniformTile; exports.unionRect = _chunkPMEHFHSPcjs.unionRect; exports.unprojectCanvasPoint = _chunkPMEHFHSPcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkPMEHFHSPcjs.updateLayerEffect; exports.updateLayerFilter = _chunkPMEHFHSPcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkPMEHFHSPcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk3T5O225Tcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkPMEHFHSPcjs.updateShapeLayer; exports.updateSmartFilter = _chunkPMEHFHSPcjs.updateSmartFilter; exports.updateTypeLayer = _chunkPMEHFHSPcjs.updateTypeLayer; exports.uvToXy = _chunkPMEHFHSPcjs.uvToXy; exports.validateEffectGradient = _chunkAEAAN4ADcjs.validateEffectGradient; exports.validateLayerEffect = _chunkAEAAN4ADcjs.validateLayerEffect; exports.validateLayerEffects = _chunkAEAAN4ADcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkPMEHFHSPcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkPMEHFHSPcjs.vibranceLinear; exports.vibrancePixel = _chunkPMEHFHSPcjs.vibrancePixel; exports.walkDabs = _chunk3T5O225Tcjs.walkDabs; exports.warpMeshEditPoints = _chunkXFXHA5MUcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkXFXHA5MUcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkXFXHA5MUcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkXFXHA5MUcjs.warpPresetMesh; exports.warpSurface = _chunkAEAAN4ADcjs.warpSurface; exports.wbMatrix = _chunkPMEHFHSPcjs.wbMatrix; exports.wetGpuSupport = _chunkF2Y4E4GUcjs.wetGpuSupport; exports.wetSimdSupported = _chunkF2Y4E4GUcjs.wetSimdSupported; exports.wetSupport = _chunkF2Y4E4GUcjs.wetSupport; exports.whiteBalanceFromSample = _chunkPMEHFHSPcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkPMEHFHSPcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkPMEHFHSPcjs.withFilterMaskSurface; exports.withNewIds = _chunkPMEHFHSPcjs.withNewIds; exports.writeAdjustmentBlock = _chunkPMEHFHSPcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkO7LUD7MHcjs.writeDeepRegion; exports.writeLfx2 = _chunkPMEHFHSPcjs.writeLfx2; exports.writePatternBlock = _chunkPMEHFHSPcjs.writePatternBlock; exports.writePsd = _chunkPMEHFHSPcjs.writePsd; exports.writeRegion = _chunkO7LUD7MHcjs.writeRegion; exports.xyToTempTint = _chunkPMEHFHSPcjs.xyToTempTint; exports.xyToUv = _chunkPMEHFHSPcjs.xyToUv;
|
|
16028
16028
|
//# sourceMappingURL=index.cjs.map
|