@pixerate/editor 0.155.0 → 0.157.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/agent/index.cjs +34 -34
- package/dist/agent/index.js +5 -5
- package/dist/animation-editor/index.cjs +58 -58
- package/dist/animation-editor/index.js +4 -4
- package/dist/{brushstrokeRender-YAZVQUXY.cjs → brushstrokeRender-5WANQIG4.cjs} +10 -10
- package/dist/{brushstrokeRender-EUDQTDYS.js → brushstrokeRender-Q4LI22QV.js} +3 -3
- package/dist/canvas/index.cjs +14 -14
- package/dist/canvas/index.js +3 -3
- package/dist/chart/index.cjs +90 -88
- package/dist/chart/index.js +9 -7
- package/dist/chart/spec.d.cts +2 -1
- package/dist/chart/spec.d.ts +2 -1
- package/dist/chart/types.d.cts +5 -0
- package/dist/chart/types.d.ts +5 -0
- package/dist/{chunk-AGZ47XY2.js → chunk-2N2QPO3H.js} +6 -2
- package/dist/{chunk-NMXPOKF3.js → chunk-45XXVHVG.js} +1 -1
- package/dist/{chunk-2WDZI6QD.cjs → chunk-4T44CJ5K.cjs} +15 -15
- package/dist/{chunk-XTU6QO2W.cjs → chunk-4YWAEV4W.cjs} +36 -27
- package/dist/{chunk-4YQKRHMI.cjs → chunk-57JLBGJ5.cjs} +8 -8
- package/dist/{chunk-SVINJIGK.js → chunk-5QBRAIVK.js} +3 -3
- package/dist/{chunk-R3PECGTQ.cjs → chunk-6LUYFHHN.cjs} +51 -51
- package/dist/{chunk-FLOGD3QB.js → chunk-6UPGM3JB.js} +2 -2
- package/dist/{chunk-6FUAHCVI.cjs → chunk-7NW46N7I.cjs} +16 -16
- package/dist/{chunk-ORDXMBD4.js → chunk-A5UCR2TO.js} +10 -3
- package/dist/{chunk-ML2II3Y3.cjs → chunk-AKDWAWSY.cjs} +58 -46
- package/dist/{chunk-PI45JMP7.cjs → chunk-CD7PLU77.cjs} +81 -81
- package/dist/{chunk-EQ4SF4X4.js → chunk-DBIVICAO.js} +1 -1
- package/dist/{chunk-LRRCMRSL.cjs → chunk-EBDCRTZI.cjs} +20 -16
- package/dist/{chunk-OLCYQLFE.js → chunk-EL5PAHNP.js} +1 -1
- package/dist/{chunk-PUC43JPT.cjs → chunk-EYVVIZJ3.cjs} +1 -1
- package/dist/{chunk-SUVZJ2CP.js → chunk-H5XX4KHB.js} +11 -1
- package/dist/{chunk-BXMIBMVG.cjs → chunk-JGKCC5OF.cjs} +65 -58
- package/dist/{chunk-LIXLD433.cjs → chunk-MHEXLG3M.cjs} +35 -35
- package/dist/{chunk-37RLSNQ3.js → chunk-Q6PA362P.js} +2 -2
- package/dist/{chunk-RHXW4TA5.cjs → chunk-QMI5HZWA.cjs} +7 -7
- package/dist/{chunk-DSZCDNTM.js → chunk-R3QY7PPL.js} +11 -2
- package/dist/{chunk-4RF2H3N3.js → chunk-SSCL7QQ4.js} +15 -3
- package/dist/{chunk-TLMRGLQQ.cjs → chunk-TVO6W2Q6.cjs} +20 -17
- package/dist/{chunk-EIUTJPEL.js → chunk-UM3RPYC5.js} +5 -2
- package/dist/{chunk-UILRJQFD.js → chunk-WNAAWLZ5.js} +1 -1
- package/dist/{chunk-I4AHLP7F.cjs → chunk-WPPJH6X4.cjs} +12 -2
- package/dist/{chunk-RZJCYJWO.cjs → chunk-XNQ5EFB4.cjs} +16 -16
- package/dist/{chunk-R6HNWN7B.js → chunk-YABNLNY7.js} +3 -3
- package/dist/{chunk-Y64YPIFT.js → chunk-ZQWLWDZI.js} +1 -1
- package/dist/export/index.cjs +4 -4
- package/dist/export/index.js +3 -3
- package/dist/extensions/index.cjs +7 -7
- package/dist/extensions/index.js +6 -6
- package/dist/image-editor/index.cjs +686 -686
- package/dist/image-editor/index.js +5 -5
- package/dist/index.cjs +13 -13
- package/dist/index.js +7 -7
- package/dist/paint/grain.d.cts +7 -0
- package/dist/paint/grain.d.ts +7 -0
- package/dist/paint/index.cjs +3 -3
- package/dist/paint/index.js +2 -2
- package/dist/paint-editor/controller.d.cts +30 -0
- package/dist/paint-editor/controller.d.ts +30 -0
- package/dist/paint-editor/document.d.cts +8 -0
- package/dist/paint-editor/document.d.ts +8 -0
- package/dist/paint-editor/index.cjs +403 -256
- package/dist/paint-editor/index.js +158 -11
- package/dist/paint-editor/paper.d.cts +8 -0
- package/dist/paint-editor/paper.d.ts +8 -0
- package/dist/paint-editor/stencils.d.cts +2 -0
- package/dist/paint-editor/stencils.d.ts +2 -0
- package/dist/paint-editor/wet.d.cts +1 -0
- package/dist/paint-editor/wet.d.ts +1 -0
- package/dist/vector/index.cjs +950 -950
- package/dist/vector/index.js +4 -4
- package/package.json +1 -1
- package/skills/pixerate-chart/SKILL.md +4 -1
- package/skills/pixerate-paint-editor/SKILL.md +9 -1
|
@@ -367,7 +367,7 @@ var _chunk5UEFNX24cjs = require('../chunk-5UEFNX24.cjs');
|
|
|
367
367
|
|
|
368
368
|
|
|
369
369
|
|
|
370
|
-
var
|
|
370
|
+
var _chunkCD7PLU77cjs = require('../chunk-CD7PLU77.cjs');
|
|
371
371
|
|
|
372
372
|
|
|
373
373
|
var _chunkA2IS7EHEcjs = require('../chunk-A2IS7EHE.cjs');
|
|
@@ -476,7 +476,7 @@ var _chunkQT26RHKKcjs = require('../chunk-QT26RHKK.cjs');
|
|
|
476
476
|
|
|
477
477
|
|
|
478
478
|
|
|
479
|
-
var
|
|
479
|
+
var _chunk7NW46N7Icjs = require('../chunk-7NW46N7I.cjs');
|
|
480
480
|
|
|
481
481
|
|
|
482
482
|
|
|
@@ -622,8 +622,8 @@ var _chunkBROJYMWUcjs = require('../chunk-BROJYMWU.cjs');
|
|
|
622
622
|
|
|
623
623
|
|
|
624
624
|
|
|
625
|
-
var
|
|
626
|
-
require('../chunk-
|
|
625
|
+
var _chunkQMI5HZWAcjs = require('../chunk-QMI5HZWA.cjs');
|
|
626
|
+
require('../chunk-JGKCC5OF.cjs');
|
|
627
627
|
require('../chunk-CVFAAZXE.cjs');
|
|
628
628
|
require('../chunk-GF2RBSDM.cjs');
|
|
629
629
|
require('../chunk-NM3G4VQT.cjs');
|
|
@@ -732,7 +732,7 @@ require('../chunk-WOFXZ3XU.cjs');
|
|
|
732
732
|
|
|
733
733
|
|
|
734
734
|
|
|
735
|
-
var
|
|
735
|
+
var _chunkEBDCRTZIcjs = require('../chunk-EBDCRTZI.cjs');
|
|
736
736
|
|
|
737
737
|
|
|
738
738
|
|
|
@@ -946,7 +946,7 @@ function quickMaskPixels(mask, style = {}) {
|
|
|
946
946
|
|
|
947
947
|
// src/image-editor/layers/render.ts
|
|
948
948
|
function isQuarterTurn(rotate) {
|
|
949
|
-
return
|
|
949
|
+
return _chunkCD7PLU77cjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
|
|
950
950
|
}
|
|
951
951
|
function isIntegerRect(r) {
|
|
952
952
|
return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
|
|
@@ -954,7 +954,7 @@ function isIntegerRect(r) {
|
|
|
954
954
|
function baseProjection(region, transform, baseW, baseH) {
|
|
955
955
|
return {
|
|
956
956
|
region,
|
|
957
|
-
angle:
|
|
957
|
+
angle: _chunkCD7PLU77cjs.normalizeAngle.call(void 0, transform.rotate),
|
|
958
958
|
flipH: transform.flipH,
|
|
959
959
|
flipV: transform.flipV,
|
|
960
960
|
scale: 1,
|
|
@@ -963,14 +963,14 @@ function baseProjection(region, transform, baseW, baseH) {
|
|
|
963
963
|
};
|
|
964
964
|
}
|
|
965
965
|
function projectQuarterTurn(src, srcRect, region, transform) {
|
|
966
|
-
const rotated =
|
|
966
|
+
const rotated = _chunkCD7PLU77cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
967
967
|
const w = Math.max(1, Math.round(rotated.width));
|
|
968
968
|
const h = Math.max(1, Math.round(rotated.height));
|
|
969
969
|
const out = new Uint8ClampedArray(w * h * 4);
|
|
970
970
|
const p = baseProjection(region, transform, w, h);
|
|
971
|
-
const o =
|
|
972
|
-
const ox =
|
|
973
|
-
const oy =
|
|
971
|
+
const o = _chunkCD7PLU77cjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
|
|
972
|
+
const ox = _chunkCD7PLU77cjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
|
|
973
|
+
const oy = _chunkCD7PLU77cjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
|
|
974
974
|
const ux = Math.round(ox.x - o.x);
|
|
975
975
|
const vx = Math.round(ox.y - o.y);
|
|
976
976
|
const uy = Math.round(oy.x - o.x);
|
|
@@ -999,23 +999,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
|
|
|
999
999
|
const d = img.data;
|
|
1000
1000
|
for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
|
|
1001
1001
|
}
|
|
1002
|
-
if (legacyOutputBlur && legacyOutputBlur > 0)
|
|
1002
|
+
if (legacyOutputBlur && legacyOutputBlur > 0) _chunkCD7PLU77cjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
|
|
1003
1003
|
}
|
|
1004
1004
|
function needsLegacyBase(input) {
|
|
1005
1005
|
const { stack, region, canvas, transform } = input;
|
|
1006
|
-
if (!
|
|
1006
|
+
if (!_chunkCD7PLU77cjs.isLegacyShape.call(void 0, stack)) return false;
|
|
1007
1007
|
const bg = stack.layers[0];
|
|
1008
1008
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
|
|
1009
1009
|
if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
|
|
1010
1010
|
if (stack.outputOpacity < 1) return true;
|
|
1011
|
-
const blur =
|
|
1011
|
+
const blur = _chunkCD7PLU77cjs.blurFilter.call(void 0, bg);
|
|
1012
1012
|
if (blur && blur.enabled && blur.radius > 0) {
|
|
1013
1013
|
const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
|
|
1014
|
-
const angle =
|
|
1014
|
+
const angle = _chunkCD7PLU77cjs.normalizeAngle.call(void 0, transform.rotate);
|
|
1015
1015
|
if (!full || angle === 90 || angle === 270) return true;
|
|
1016
1016
|
}
|
|
1017
1017
|
if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
|
|
1018
|
-
if (
|
|
1018
|
+
if (_chunkCD7PLU77cjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
|
|
1019
1019
|
return false;
|
|
1020
1020
|
}
|
|
1021
1021
|
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;
|
|
@@ -1047,7 +1047,7 @@ function coveringRect(region) {
|
|
|
1047
1047
|
const y = Math.floor(region.y);
|
|
1048
1048
|
return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
|
|
1049
1049
|
}
|
|
1050
|
-
function renderLayeredBase(stack, region, transform, sources, compositor = new (0,
|
|
1050
|
+
function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkCD7PLU77cjs.LayerCompositor)()) {
|
|
1051
1051
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
|
|
1052
1052
|
throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
|
|
1053
1053
|
}
|
|
@@ -1181,8 +1181,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1181
1181
|
* The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
|
|
1182
1182
|
* trust dirty rectangles; exports use `exportCompositor`.
|
|
1183
1183
|
*/
|
|
1184
|
-
__init8() {this.compositor = new (0,
|
|
1185
|
-
__init9() {this.exportCompositor = new (0,
|
|
1184
|
+
__init8() {this.compositor = new (0, _chunkCD7PLU77cjs.LayerCompositor)()}
|
|
1185
|
+
__init9() {this.exportCompositor = new (0, _chunkCD7PLU77cjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
|
|
1186
1186
|
/** How the host resolves layer pixels (set by the controller). */
|
|
1187
1187
|
|
|
1188
1188
|
/**
|
|
@@ -1261,9 +1261,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1261
1261
|
return;
|
|
1262
1262
|
}
|
|
1263
1263
|
const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
|
|
1264
|
-
const projection =
|
|
1264
|
+
const projection = _chunkCD7PLU77cjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
|
|
1265
1265
|
const { region } = projection;
|
|
1266
|
-
const rotated =
|
|
1266
|
+
const rotated = _chunkCD7PLU77cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1267
1267
|
const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
|
|
1268
1268
|
let overlay = annotations;
|
|
1269
1269
|
if (route === "legacy") {
|
|
@@ -1273,8 +1273,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1273
1273
|
`${naturalWidth}x${naturalHeight}`,
|
|
1274
1274
|
`${region.x},${region.y},${region.width},${region.height}`,
|
|
1275
1275
|
`${projection.angle},${transform.flipH},${transform.flipV}`,
|
|
1276
|
-
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${
|
|
1277
|
-
|
|
1276
|
+
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkCD7PLU77cjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
|
|
1277
|
+
_chunkCD7PLU77cjs.adjustmentLayersKey.call(void 0, adjustments.layers),
|
|
1278
1278
|
`${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}`,
|
|
1279
1279
|
`d${this.displayKey}`
|
|
1280
1280
|
].join("|");
|
|
@@ -1308,7 +1308,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1308
1308
|
}
|
|
1309
1309
|
if (overlay.length > 0 || options.draftAnnotation) {
|
|
1310
1310
|
ctx.save();
|
|
1311
|
-
|
|
1311
|
+
_chunkCD7PLU77cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1312
1312
|
ctx.beginPath();
|
|
1313
1313
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1314
1314
|
ctx.clip();
|
|
@@ -1331,7 +1331,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1331
1331
|
if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
|
|
1332
1332
|
ctx.save();
|
|
1333
1333
|
try {
|
|
1334
|
-
|
|
1334
|
+
_chunkCD7PLU77cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1335
1335
|
ctx.beginPath();
|
|
1336
1336
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1337
1337
|
ctx.clip();
|
|
@@ -1346,7 +1346,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1346
1346
|
const b = options.brushCursor;
|
|
1347
1347
|
ctx.save();
|
|
1348
1348
|
try {
|
|
1349
|
-
|
|
1349
|
+
_chunkCD7PLU77cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1350
1350
|
const px2 = 1 / (projection.scale || 1);
|
|
1351
1351
|
ctx.beginPath();
|
|
1352
1352
|
ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
|
|
@@ -1361,7 +1361,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1361
1361
|
ctx.restore();
|
|
1362
1362
|
}
|
|
1363
1363
|
if (options.cloneSourceMarker) {
|
|
1364
|
-
const m =
|
|
1364
|
+
const m = _chunkCD7PLU77cjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
|
|
1365
1365
|
ctx.save();
|
|
1366
1366
|
try {
|
|
1367
1367
|
const r = 7;
|
|
@@ -1385,7 +1385,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1385
1385
|
const t = options.textEdit;
|
|
1386
1386
|
ctx.save();
|
|
1387
1387
|
try {
|
|
1388
|
-
const scr = (p) =>
|
|
1388
|
+
const scr = (p) => _chunkCD7PLU77cjs.projectImagePoint.call(void 0, p, projection);
|
|
1389
1389
|
const poly = (pts) => {
|
|
1390
1390
|
ctx.beginPath();
|
|
1391
1391
|
pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
|
|
@@ -1424,7 +1424,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1424
1424
|
const t = options.freeTransform;
|
|
1425
1425
|
ctx.save();
|
|
1426
1426
|
try {
|
|
1427
|
-
const scr = (p) =>
|
|
1427
|
+
const scr = (p) => _chunkCD7PLU77cjs.projectImagePoint.call(void 0, p, projection);
|
|
1428
1428
|
ctx.beginPath();
|
|
1429
1429
|
if (t.warp) {
|
|
1430
1430
|
for (const c of t.warp.curves) {
|
|
@@ -1482,7 +1482,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1482
1482
|
}
|
|
1483
1483
|
if (isActivelyCropping) {
|
|
1484
1484
|
const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
|
|
1485
|
-
this.drawCropOverlay(ctx,
|
|
1485
|
+
this.drawCropOverlay(ctx, _chunkCD7PLU77cjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
1488
|
/**
|
|
@@ -1491,7 +1491,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1491
1491
|
*/
|
|
1492
1492
|
async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
|
|
1493
1493
|
const { adjustments, depthMask } = state;
|
|
1494
|
-
const rotated =
|
|
1494
|
+
const rotated = _chunkCD7PLU77cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1495
1495
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1496
1496
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1497
1497
|
const baseCanvas = this.createCanvas(baseW, baseH);
|
|
@@ -1499,7 +1499,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1499
1499
|
if (!baseCtx) return baseCanvas;
|
|
1500
1500
|
const projection = getBaseProjection(region, transform, baseW, baseH);
|
|
1501
1501
|
baseCtx.save();
|
|
1502
|
-
|
|
1502
|
+
_chunkCD7PLU77cjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
|
|
1503
1503
|
baseCtx.drawImage(
|
|
1504
1504
|
img,
|
|
1505
1505
|
region.x,
|
|
@@ -1514,8 +1514,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1514
1514
|
baseCtx.restore();
|
|
1515
1515
|
const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
|
|
1516
1516
|
if (imageData) {
|
|
1517
|
-
const layerMasks =
|
|
1518
|
-
|
|
1517
|
+
const layerMasks = _chunkCD7PLU77cjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
|
|
1518
|
+
_chunkCD7PLU77cjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
|
|
1519
1519
|
if (depthMask.enabled && depthMask.maskSource) {
|
|
1520
1520
|
try {
|
|
1521
1521
|
const maskImg = await this.imageCache.get(depthMask.maskSource);
|
|
@@ -1526,7 +1526,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1526
1526
|
const maskCtx = maskCanvas.getContext("2d");
|
|
1527
1527
|
if (maskCtx) {
|
|
1528
1528
|
maskCtx.save();
|
|
1529
|
-
|
|
1529
|
+
_chunkCD7PLU77cjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
|
|
1530
1530
|
maskCtx.drawImage(
|
|
1531
1531
|
maskImg,
|
|
1532
1532
|
region.x * sx,
|
|
@@ -1541,7 +1541,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1541
1541
|
maskCtx.restore();
|
|
1542
1542
|
const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
|
|
1543
1543
|
if (maskData) {
|
|
1544
|
-
|
|
1544
|
+
_chunkCD7PLU77cjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
} catch (e8) {
|
|
@@ -1560,7 +1560,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1560
1560
|
else if (this.baseRoute === "layers") route = "layers";
|
|
1561
1561
|
else {
|
|
1562
1562
|
const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
|
|
1563
|
-
const shaped = this.baseRoute === "legacy" &&
|
|
1563
|
+
const shaped = this.baseRoute === "legacy" && _chunkCD7PLU77cjs.isLegacyShape.call(void 0, stack);
|
|
1564
1564
|
route = shaped || needsLegacyBase({
|
|
1565
1565
|
stack,
|
|
1566
1566
|
region,
|
|
@@ -1695,17 +1695,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1695
1695
|
if (!comp) return null;
|
|
1696
1696
|
const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
|
|
1697
1697
|
const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
|
|
1698
|
-
const rotated =
|
|
1698
|
+
const rotated = _chunkCD7PLU77cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1699
1699
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1700
1700
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1701
|
-
const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${
|
|
1701
|
+
const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkCD7PLU77cjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
|
|
1702
1702
|
if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
|
|
1703
1703
|
const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
|
|
1704
1704
|
const ctx = canvas.getContext("2d");
|
|
1705
1705
|
if (!ctx) return null;
|
|
1706
1706
|
ctx.clearRect(0, 0, baseW, baseH);
|
|
1707
1707
|
ctx.save();
|
|
1708
|
-
|
|
1708
|
+
_chunkCD7PLU77cjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
|
|
1709
1709
|
ctx.beginPath();
|
|
1710
1710
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1711
1711
|
ctx.clip();
|
|
@@ -1977,7 +1977,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1977
1977
|
ctx.strokeStyle = "#3b82f6";
|
|
1978
1978
|
ctx.lineWidth = 1.5;
|
|
1979
1979
|
ctx.setLineDash([4, 4]);
|
|
1980
|
-
const bounds =
|
|
1980
|
+
const bounds = _chunkCD7PLU77cjs.getAnnotationBounds.call(void 0, ann);
|
|
1981
1981
|
const pad = 4;
|
|
1982
1982
|
ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
|
|
1983
1983
|
ctx.fillStyle = "#ffffff";
|
|
@@ -1998,7 +1998,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1998
1998
|
}
|
|
1999
1999
|
/** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
|
|
2000
2000
|
getAnnotationBounds(ann) {
|
|
2001
|
-
return
|
|
2001
|
+
return _chunkCD7PLU77cjs.getAnnotationBounds.call(void 0, ann);
|
|
2002
2002
|
}
|
|
2003
2003
|
/**
|
|
2004
2004
|
* Draws a rule-of-thirds crop grid overlay. All rectangles come from
|
|
@@ -2080,8 +2080,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2080
2080
|
}
|
|
2081
2081
|
const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
|
|
2082
2082
|
const { crop, transform, annotations } = state;
|
|
2083
|
-
const region = crop ?
|
|
2084
|
-
const rotated =
|
|
2083
|
+
const region = crop ? _chunkCD7PLU77cjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
|
|
2084
|
+
const rotated = _chunkCD7PLU77cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
2085
2085
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
2086
2086
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
2087
2087
|
const exportW = options.width || baseW;
|
|
@@ -2110,7 +2110,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2110
2110
|
const bctx = baseCanvas.getContext("2d");
|
|
2111
2111
|
if (bctx) {
|
|
2112
2112
|
bctx.save();
|
|
2113
|
-
|
|
2113
|
+
_chunkCD7PLU77cjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
|
|
2114
2114
|
bctx.beginPath();
|
|
2115
2115
|
bctx.rect(region.x, region.y, region.width, region.height);
|
|
2116
2116
|
bctx.clip();
|
|
@@ -2123,7 +2123,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2123
2123
|
if (options.includeAnnotations !== false && overlay.length > 0) {
|
|
2124
2124
|
ctx.save();
|
|
2125
2125
|
ctx.scale(exportW / baseW, exportH / baseH);
|
|
2126
|
-
|
|
2126
|
+
_chunkCD7PLU77cjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
|
|
2127
2127
|
for (const ann of overlay) {
|
|
2128
2128
|
await this.drawAnnotation(ctx, ann);
|
|
2129
2129
|
}
|
|
@@ -2213,7 +2213,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2213
2213
|
case "rect":
|
|
2214
2214
|
case "image":
|
|
2215
2215
|
case "text": {
|
|
2216
|
-
const b =
|
|
2216
|
+
const b = _chunkCD7PLU77cjs.getAnnotationBounds.call(void 0, ann);
|
|
2217
2217
|
ctx.fillRect(b.x, b.y, b.width, b.height);
|
|
2218
2218
|
break;
|
|
2219
2219
|
}
|
|
@@ -2233,7 +2233,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
|
|
|
2233
2233
|
function getBaseProjection(region, transform, baseW, baseH) {
|
|
2234
2234
|
return {
|
|
2235
2235
|
region,
|
|
2236
|
-
angle:
|
|
2236
|
+
angle: _chunkCD7PLU77cjs.normalizeAngle.call(void 0, transform.rotate),
|
|
2237
2237
|
flipH: transform.flipH,
|
|
2238
2238
|
flipV: transform.flipV,
|
|
2239
2239
|
scale: 1,
|
|
@@ -2337,8 +2337,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
2337
2337
|
}
|
|
2338
2338
|
function toMask(width, height, coverage) {
|
|
2339
2339
|
const out = new Uint8Array(coverage.length);
|
|
2340
|
-
for (let i = 0; i < out.length; i++) out[i] =
|
|
2341
|
-
return
|
|
2340
|
+
for (let i = 0; i < out.length; i++) out[i] = _chunkCD7PLU77cjs.coverageToByte.call(void 0, coverage[i]);
|
|
2341
|
+
return _chunkCD7PLU77cjs.createSelectionMask.call(void 0, width, height, out);
|
|
2342
2342
|
}
|
|
2343
2343
|
function polygonSelection(width, height, points, options = {}) {
|
|
2344
2344
|
return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
|
|
@@ -2465,7 +2465,7 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2465
2465
|
const { width: w, height: h } = pixels;
|
|
2466
2466
|
const sx = Math.floor(seed.x);
|
|
2467
2467
|
const sy = Math.floor(seed.y);
|
|
2468
|
-
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return
|
|
2468
|
+
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkCD7PLU77cjs.createSelectionMask.call(void 0, w, h);
|
|
2469
2469
|
const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
|
|
2470
2470
|
const marks = new Uint8Array(n);
|
|
2471
2471
|
let bx0 = w;
|
|
@@ -2513,9 +2513,9 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2513
2513
|
}
|
|
2514
2514
|
}
|
|
2515
2515
|
}
|
|
2516
|
-
if (bx1 < 0) return
|
|
2517
|
-
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return
|
|
2518
|
-
return
|
|
2516
|
+
if (bx1 < 0) return _chunkCD7PLU77cjs.createSelectionMask.call(void 0, w, h);
|
|
2517
|
+
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkCD7PLU77cjs.createSelectionMask.call(void 0, w, h, marks);
|
|
2518
|
+
return _chunkCD7PLU77cjs.createSelectionMask.call(void 0,
|
|
2519
2519
|
w,
|
|
2520
2520
|
h,
|
|
2521
2521
|
antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
|
|
@@ -2537,7 +2537,7 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2537
2537
|
const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
|
|
2538
2538
|
const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
|
|
2539
2539
|
const out = new Uint8Array(n);
|
|
2540
|
-
if (!parsed.length) return
|
|
2540
|
+
if (!parsed.length) return _chunkCD7PLU77cjs.createSelectionMask.call(void 0, w, h, out);
|
|
2541
2541
|
for (let i = 0; i < n; i++) {
|
|
2542
2542
|
const p = i * 4;
|
|
2543
2543
|
if (data[p + 3] <= 0) continue;
|
|
@@ -2553,9 +2553,9 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2553
2553
|
}
|
|
2554
2554
|
if (k > best) best = k;
|
|
2555
2555
|
}
|
|
2556
|
-
out[i] =
|
|
2556
|
+
out[i] = _chunkCD7PLU77cjs.coverageToByte.call(void 0, best);
|
|
2557
2557
|
}
|
|
2558
|
-
return
|
|
2558
|
+
return _chunkCD7PLU77cjs.createSelectionMask.call(void 0, w, h, out);
|
|
2559
2559
|
}
|
|
2560
2560
|
var TONE_RANGE_PRESETS = {
|
|
2561
2561
|
shadows: [0, 65],
|
|
@@ -2573,9 +2573,9 @@ function toneRange(pixels, range, falloff = 20) {
|
|
|
2573
2573
|
if (d[p + 3] <= 0) continue;
|
|
2574
2574
|
const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
|
|
2575
2575
|
const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
|
|
2576
|
-
out[i] =
|
|
2576
|
+
out[i] = _chunkCD7PLU77cjs.coverageToByte.call(void 0, 1 - outside / ramp);
|
|
2577
2577
|
}
|
|
2578
|
-
return
|
|
2578
|
+
return _chunkCD7PLU77cjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2579
2579
|
}
|
|
2580
2580
|
function hueRange(pixels, center) {
|
|
2581
2581
|
const n = checkPixels(pixels);
|
|
@@ -2598,9 +2598,9 @@ function hueRange(pixels, center) {
|
|
|
2598
2598
|
hue *= 60;
|
|
2599
2599
|
let dh = ((hue - center) % 360 + 360) % 360;
|
|
2600
2600
|
dh = Math.min(dh, 360 - dh);
|
|
2601
|
-
out[i] =
|
|
2601
|
+
out[i] = _chunkCD7PLU77cjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
|
|
2602
2602
|
}
|
|
2603
|
-
return
|
|
2603
|
+
return _chunkCD7PLU77cjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2604
2604
|
}
|
|
2605
2605
|
|
|
2606
2606
|
// src/image-editor/selection/refine.ts
|
|
@@ -2734,9 +2734,9 @@ function edgeWidth(guide, w, h, r) {
|
|
|
2734
2734
|
g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
|
|
2735
2735
|
}
|
|
2736
2736
|
}
|
|
2737
|
-
const gm =
|
|
2738
|
-
const hi =
|
|
2739
|
-
const lo =
|
|
2737
|
+
const gm = _chunkCD7PLU77cjs.greyMorphology.call(void 0, g, w, h, r, true);
|
|
2738
|
+
const hi = _chunkCD7PLU77cjs.greyMorphology.call(void 0, y, w, h, r, true);
|
|
2739
|
+
const lo = _chunkCD7PLU77cjs.greyMorphology.call(void 0, y, w, h, r, false);
|
|
2740
2740
|
const out = new Float32Array(n);
|
|
2741
2741
|
for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
|
|
2742
2742
|
return out;
|
|
@@ -2760,7 +2760,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2760
2760
|
}
|
|
2761
2761
|
}
|
|
2762
2762
|
if (any) {
|
|
2763
|
-
const dist =
|
|
2763
|
+
const dist = _chunkCD7PLU77cjs.distanceTransform.call(void 0, boundary, w, h);
|
|
2764
2764
|
const r = gfRadius(p);
|
|
2765
2765
|
const q = guidedFilterColor(guide, m, w, h, r);
|
|
2766
2766
|
const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
|
|
@@ -2786,7 +2786,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2786
2786
|
for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
|
|
2787
2787
|
}
|
|
2788
2788
|
const amount = shiftAmount(p);
|
|
2789
|
-
if (Math.abs(amount) >= 1e-4) a =
|
|
2789
|
+
if (Math.abs(amount) >= 1e-4) a = _chunkCD7PLU77cjs.shiftCoverage.call(void 0, a, w, h, amount);
|
|
2790
2790
|
return a;
|
|
2791
2791
|
}
|
|
2792
2792
|
function guidePlanes(pixels, win) {
|
|
@@ -2830,9 +2830,9 @@ function refineSelection(pixels, mask, params = {}) {
|
|
|
2830
2830
|
const out = new Uint8Array(mask.width * mask.height);
|
|
2831
2831
|
for (let y = 0; y < wh; y++) {
|
|
2832
2832
|
const dst = (y0 + y) * mask.width + x0;
|
|
2833
|
-
for (let x = 0; x < ww; x++) out[dst + x] =
|
|
2833
|
+
for (let x = 0; x < ww; x++) out[dst + x] = _chunkCD7PLU77cjs.coverageToByte.call(void 0, refined[y * ww + x]);
|
|
2834
2834
|
}
|
|
2835
|
-
return
|
|
2835
|
+
return _chunkCD7PLU77cjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
|
|
2836
2836
|
}
|
|
2837
2837
|
|
|
2838
2838
|
// src/image-editor/effects.ts
|
|
@@ -3002,7 +3002,7 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
3002
3002
|
// src/image-editor/free-transform.ts
|
|
3003
3003
|
var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
|
|
3004
3004
|
var fail = (message) => {
|
|
3005
|
-
throw new (0,
|
|
3005
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(message);
|
|
3006
3006
|
};
|
|
3007
3007
|
var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
|
|
3008
3008
|
function previewStep(scale) {
|
|
@@ -3111,7 +3111,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3111
3111
|
} else {
|
|
3112
3112
|
const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
|
|
3113
3113
|
if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
|
|
3114
|
-
const layer =
|
|
3114
|
+
const layer = _chunkCD7PLU77cjs.requireLayer.call(void 0, layers, id).layer;
|
|
3115
3115
|
this.layerId = layer.id;
|
|
3116
3116
|
const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
|
|
3117
3117
|
const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
|
|
@@ -3122,20 +3122,20 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3122
3122
|
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.`);
|
|
3123
3123
|
if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
|
|
3124
3124
|
if (content !== "selection-copy") {
|
|
3125
|
-
|
|
3126
|
-
if (!maskAlone)
|
|
3125
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "position", "transform it");
|
|
3126
|
+
if (!maskAlone) _chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
|
|
3127
3127
|
}
|
|
3128
3128
|
const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
3129
3129
|
const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
|
|
3130
3130
|
if (layer.type === "smart" && !maskAlone) {
|
|
3131
3131
|
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).`);
|
|
3132
|
-
if (!
|
|
3132
|
+
if (!_chunkCD7PLU77cjs.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.`);
|
|
3133
3133
|
this.smart = layer;
|
|
3134
3134
|
this.smartObject = true;
|
|
3135
|
-
this.startGeometry =
|
|
3135
|
+
this.startGeometry = _chunkCD7PLU77cjs.placementGeometry.call(void 0, layer);
|
|
3136
3136
|
if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
|
|
3137
3137
|
this.startInterp = this.interp;
|
|
3138
|
-
this.box =
|
|
3138
|
+
this.box = _chunkCD7PLU77cjs.contentsBox.call(void 0, layer.contents);
|
|
3139
3139
|
this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
|
|
3140
3140
|
this.geometryValue = this.startGeometry;
|
|
3141
3141
|
this.shown = this.startLayers;
|
|
@@ -3143,8 +3143,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3143
3143
|
}
|
|
3144
3144
|
if (layer.type === "type" && !maskAlone) {
|
|
3145
3145
|
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).`);
|
|
3146
|
-
const frame =
|
|
3147
|
-
const m =
|
|
3146
|
+
const frame = _chunkCD7PLU77cjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
|
|
3147
|
+
const m = _chunkCD7PLU77cjs.textMatrix.call(void 0, layer);
|
|
3148
3148
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
3149
3149
|
this.typeTarget = layer;
|
|
3150
3150
|
this.typeLayer = true;
|
|
@@ -3163,7 +3163,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3163
3163
|
}
|
|
3164
3164
|
if (layer.type === "shape" && !maskAlone) {
|
|
3165
3165
|
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).`);
|
|
3166
|
-
const g =
|
|
3166
|
+
const g = _chunkCD7PLU77cjs.shapeGeometryBounds.call(void 0, layer);
|
|
3167
3167
|
if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
|
|
3168
3168
|
const w = Math.max(g.width, 1);
|
|
3169
3169
|
const h = Math.max(g.height, 1);
|
|
@@ -3211,7 +3211,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3211
3211
|
if (box) {
|
|
3212
3212
|
const copy = {
|
|
3213
3213
|
type: "pixel",
|
|
3214
|
-
id:
|
|
3214
|
+
id: _chunkCD7PLU77cjs.newLayerId.call(void 0, ),
|
|
3215
3215
|
name: `${layer.name || "Layer"} copy`,
|
|
3216
3216
|
visible: true,
|
|
3217
3217
|
opacity: 1,
|
|
@@ -3235,7 +3235,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3235
3235
|
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).");
|
|
3236
3236
|
this.box = box;
|
|
3237
3237
|
this.moves = moves;
|
|
3238
|
-
this.startGeometry =
|
|
3238
|
+
this.startGeometry = _chunkCD7PLU77cjs.identityTransform.call(void 0, box);
|
|
3239
3239
|
this.startInterp = this.interp;
|
|
3240
3240
|
this.geometryValue = this.startGeometry;
|
|
3241
3241
|
this.shown = this.startLayers;
|
|
@@ -3313,8 +3313,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3313
3313
|
warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
|
|
3314
3314
|
};
|
|
3315
3315
|
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.");
|
|
3316
|
-
if (!
|
|
3317
|
-
if (this.typeTarget && (
|
|
3316
|
+
if (!_chunkCD7PLU77cjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
|
|
3317
|
+
if (this.typeTarget && (_chunkCD7PLU77cjs.hasWarp.call(void 0, next) || !_chunkCD7PLU77cjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
|
|
3318
3318
|
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.");
|
|
3319
3319
|
}
|
|
3320
3320
|
this.geometryValue = next;
|
|
@@ -3326,10 +3326,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3326
3326
|
if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
|
|
3327
3327
|
if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
|
|
3328
3328
|
const g = this.geometryValue;
|
|
3329
|
-
const identity =
|
|
3330
|
-
const warp =
|
|
3331
|
-
const h = warp ? null :
|
|
3332
|
-
const f = warp ?
|
|
3329
|
+
const identity = _chunkCD7PLU77cjs.isIdentityTransform.call(void 0, g);
|
|
3330
|
+
const warp = _chunkCD7PLU77cjs.hasWarp.call(void 0, g);
|
|
3331
|
+
const h = warp ? null : _chunkCD7PLU77cjs.geometryHomography.call(void 0, g);
|
|
3332
|
+
const f = warp ? _chunkCD7PLU77cjs.transformMap.call(void 0, g) : null;
|
|
3333
3333
|
const step = final ? 1 : previewStep(preview.scale);
|
|
3334
3334
|
const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
|
|
3335
3335
|
let layers = this.startLayers;
|
|
@@ -3373,7 +3373,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3373
3373
|
if (part.what === "selection") {
|
|
3374
3374
|
const { width, height } = this.host.canvas();
|
|
3375
3375
|
const data = new Uint8Array(_chunkCWM3CUUXcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
|
|
3376
|
-
const next =
|
|
3376
|
+
const next = _chunkCD7PLU77cjs.createSelectionMask.call(void 0, width, height, data);
|
|
3377
3377
|
selection = next.bounds ? next : null;
|
|
3378
3378
|
} else if (part.what === "pixels") {
|
|
3379
3379
|
layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, targetId, (l) => {
|
|
@@ -3395,14 +3395,14 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3395
3395
|
resampleShape(final, preview, warpMap, h) {
|
|
3396
3396
|
const layer = this.shape;
|
|
3397
3397
|
let components = layer.components;
|
|
3398
|
-
if (!
|
|
3398
|
+
if (!_chunkCD7PLU77cjs.isIdentityTransform.call(void 0, this.geometryValue)) {
|
|
3399
3399
|
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;
|
|
3400
3400
|
const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkQT26RHKKcjs.applyHomography.call(void 0, h, p) : p)));
|
|
3401
|
-
components =
|
|
3401
|
+
components = _chunkCD7PLU77cjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
|
|
3402
3402
|
}
|
|
3403
3403
|
const moved = { ...layer, components };
|
|
3404
3404
|
delete moved.annotation;
|
|
3405
|
-
const surface =
|
|
3405
|
+
const surface = _chunkCD7PLU77cjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
|
|
3406
3406
|
return _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
|
|
3407
3407
|
}
|
|
3408
3408
|
/**
|
|
@@ -3412,13 +3412,13 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3412
3412
|
resampleType() {
|
|
3413
3413
|
const layer = this.typeTarget;
|
|
3414
3414
|
const g = this.geometryValue;
|
|
3415
|
-
if (
|
|
3416
|
-
const m =
|
|
3415
|
+
if (_chunkCD7PLU77cjs.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.");
|
|
3416
|
+
const m = _chunkCD7PLU77cjs.matrixFromCorners.call(void 0, g.box, g.corners);
|
|
3417
3417
|
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.");
|
|
3418
3418
|
const next = { ...layer, transform: m };
|
|
3419
3419
|
delete next.annotation;
|
|
3420
|
-
let layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () =>
|
|
3421
|
-
const change = _chunkQT26RHKKcjs.multiplyHomographies.call(void 0, _chunkQT26RHKKcjs.homographyFromAffine.call(void 0,
|
|
3420
|
+
let layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkCD7PLU77cjs.rerenderText.call(void 0, next, this.host.textEnv()));
|
|
3421
|
+
const change = _chunkQT26RHKKcjs.multiplyHomographies.call(void 0, _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, _chunkQMI5HZWAcjs.invertMatrix.call(void 0, _chunkCD7PLU77cjs.textMatrix.call(void 0, layer))), _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, m));
|
|
3422
3422
|
for (const part of this.parts) {
|
|
3423
3423
|
if (part.what !== "mask") continue;
|
|
3424
3424
|
const surface = _chunkHGTDMKNEcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
|
|
@@ -3434,12 +3434,12 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3434
3434
|
const canvas = this.host.canvas();
|
|
3435
3435
|
try {
|
|
3436
3436
|
if (final) {
|
|
3437
|
-
const res =
|
|
3437
|
+
const res = _chunkCD7PLU77cjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
|
|
3438
3438
|
this.smartMasksMoved = res.masksMoved;
|
|
3439
3439
|
return res.layers;
|
|
3440
3440
|
}
|
|
3441
3441
|
const step = previewStep(preview.scale);
|
|
3442
|
-
const surface =
|
|
3442
|
+
const surface = _chunkCD7PLU77cjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
|
|
3443
3443
|
return _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
|
|
3444
3444
|
} catch (e) {
|
|
3445
3445
|
if (e instanceof _chunkHGTDMKNEcjs.TransformTooLargeError) fail(e.message);
|
|
@@ -3449,10 +3449,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3449
3449
|
/** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
|
|
3450
3450
|
isChanged() {
|
|
3451
3451
|
const g = this.geometryValue;
|
|
3452
|
-
if (!this.smart && !this.typeTarget) return !
|
|
3452
|
+
if (!this.smart && !this.typeTarget) return !_chunkCD7PLU77cjs.isIdentityTransform.call(void 0, g);
|
|
3453
3453
|
const a = this.startGeometry;
|
|
3454
3454
|
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);
|
|
3455
|
-
const warp = (w, box) => w &&
|
|
3455
|
+
const warp = (w, box) => w && _chunkCD7PLU77cjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
|
|
3456
3456
|
return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
|
|
3457
3457
|
}
|
|
3458
3458
|
render(preview) {
|
|
@@ -3712,7 +3712,7 @@ function convertSurfaceColors(surface, t) {
|
|
|
3712
3712
|
}
|
|
3713
3713
|
|
|
3714
3714
|
// src/image-editor/controller.ts
|
|
3715
|
-
var IMAGE_EDITOR_SCHEMA_VERSION =
|
|
3715
|
+
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkCD7PLU77cjs.LAYERED_SCHEMA_VERSION;
|
|
3716
3716
|
var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge", "blur", "sharpen", "history"];
|
|
3717
3717
|
var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
|
|
3718
3718
|
var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
|
|
@@ -3726,14 +3726,14 @@ function paintCoverageInto(base, coverage, apply, rects, depth = null) {
|
|
|
3726
3726
|
done.add(key);
|
|
3727
3727
|
if (depth) {
|
|
3728
3728
|
const ch = base.channels;
|
|
3729
|
-
const d =
|
|
3729
|
+
const d = _chunkEBDCRTZIcjs.applyStrokeToDeepTile.call(void 0, coverage, _chunkCWM3CUUXcjs.tileSamples.call(void 0, base.tiles.get(key), ch, depth, base.defaultValue), t.tx, t.ty, apply, { channels: ch });
|
|
3730
3730
|
const tile2 = _chunkCWM3CUUXcjs.deepTile.call(void 0, d, ch, base.defaultValue);
|
|
3731
3731
|
if (tile2) tiles.set(key, tile2);
|
|
3732
3732
|
else tiles.delete(key);
|
|
3733
3733
|
continue;
|
|
3734
3734
|
}
|
|
3735
3735
|
const src = _nullishCoalesce(_optionalChain([base, 'access', _77 => _77.tiles, 'access', _78 => _78.get, 'call', _79 => _79(key), 'optionalAccess', _80 => _80.data]), () => ( defaultTile(base)));
|
|
3736
|
-
const data =
|
|
3736
|
+
const data = _chunkEBDCRTZIcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
|
|
3737
3737
|
const tile = _chunkCWM3CUUXcjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
|
|
3738
3738
|
if (tile) tiles.set(key, tile);
|
|
3739
3739
|
else tiles.delete(key);
|
|
@@ -3751,13 +3751,13 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3751
3751
|
this.controller = controller;
|
|
3752
3752
|
this.target = target;
|
|
3753
3753
|
this.apply = apply;
|
|
3754
|
-
const coverage = stroke instanceof
|
|
3755
|
-
this.deep = depth && coverage && (target.surface.channels === 4 || stroke instanceof
|
|
3754
|
+
const coverage = stroke instanceof _chunkEBDCRTZIcjs.StrokeCoverage || "kind" in stroke && stroke.kind === "coverage";
|
|
3755
|
+
this.deep = depth && coverage && (target.surface.channels === 4 || stroke instanceof _chunkEBDCRTZIcjs.StrokeCoverage) ? depth : null;
|
|
3756
3756
|
this.dabDeep = depth && !coverage && target.surface.channels === 4 ? depth : null;
|
|
3757
3757
|
this.before = controller._captureForStroke();
|
|
3758
3758
|
this.base = target.surface;
|
|
3759
3759
|
this.live = new Map(this.base.tiles);
|
|
3760
|
-
if (stroke instanceof
|
|
3760
|
+
if (stroke instanceof _chunkEBDCRTZIcjs.StrokeCoverage) {
|
|
3761
3761
|
this.stroke = stroke;
|
|
3762
3762
|
this.mixer = null;
|
|
3763
3763
|
} else if ("kind" in stroke && stroke.kind === "coverage") {
|
|
@@ -3768,7 +3768,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3768
3768
|
this.stroke = null;
|
|
3769
3769
|
this.retouch = stroke;
|
|
3770
3770
|
if (this.base.channels === 1) {
|
|
3771
|
-
const view =
|
|
3771
|
+
const view = _chunk7NW46N7Icjs.rgbaViewOfGrey.call(void 0, this.mixerPixels());
|
|
3772
3772
|
this.mixer = stroke.create(view.target);
|
|
3773
3773
|
this.flushView = view.flush;
|
|
3774
3774
|
} else this.mixer = stroke.create(this.mixerPixels());
|
|
@@ -3815,7 +3815,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3815
3815
|
retouchDeepTile(key, tx, ty, paint, options) {
|
|
3816
3816
|
const r = this.retouch;
|
|
3817
3817
|
const read = this.readWork(key);
|
|
3818
|
-
const out =
|
|
3818
|
+
const out = _chunk7NW46N7Icjs.applyRetouchToTile.call(void 0, this.stroke.coverage, _nullishCoalesce(read, () => ( new Float32Array(_chunkCWM3CUUXcjs.TILE * _chunkCWM3CUUXcjs.TILE * 4))), 4, tx, ty, paint, r.apply, options);
|
|
3819
3819
|
this.work.set(key, out);
|
|
3820
3820
|
const d = deepOfWorkTile(out, this.deep, read, this.base.tiles.get(key));
|
|
3821
3821
|
this.liveDeep.set(key, d);
|
|
@@ -3825,8 +3825,8 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3825
3825
|
/** The new tile of a coverage stroke over the pre-stroke tile `src`. */
|
|
3826
3826
|
compositeTile(src, tx, ty, options = {}, paint) {
|
|
3827
3827
|
const r = this.retouch;
|
|
3828
|
-
if (r && r.kind === "coverage") return
|
|
3829
|
-
return
|
|
3828
|
+
if (r && r.kind === "coverage") return _chunk7NW46N7Icjs.applyRetouchToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, _nullishCoalesce(paint, () => ( r.paint())), r.apply, options);
|
|
3829
|
+
return _chunkEBDCRTZIcjs.applyStrokeToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, this.apply, options);
|
|
3830
3830
|
}
|
|
3831
3831
|
/** The live pixels a mixer stroke reads and writes; base tiles are copied on first write. */
|
|
3832
3832
|
mixerPixels() {
|
|
@@ -3906,7 +3906,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3906
3906
|
for (const t of _chunkCWM3CUUXcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
|
|
3907
3907
|
const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3908
3908
|
const cur = regions.get(key);
|
|
3909
|
-
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ?
|
|
3909
|
+
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkCD7PLU77cjs.unionRect.call(void 0, cur.r, r) : r });
|
|
3910
3910
|
}
|
|
3911
3911
|
}
|
|
3912
3912
|
for (const [key, { tx, ty, r }] of regions) {
|
|
@@ -3923,7 +3923,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3923
3923
|
const prev2 = this.touched.has(key) ? this.liveDeep.get(key) : void 0;
|
|
3924
3924
|
this.touched.add(key);
|
|
3925
3925
|
const opts = prev2 ? { into: prev2, region: r, channels: ch } : { channels: ch };
|
|
3926
|
-
const d = _optionalChain([rt, 'optionalAccess', _98 => _98.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _99 => _99.kind]) === "tone" ?
|
|
3926
|
+
const d = _optionalChain([rt, 'optionalAccess', _98 => _98.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _99 => _99.kind]) === "tone" ? _chunk7NW46N7Icjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunkEBDCRTZIcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
|
|
3927
3927
|
this.liveDeep.set(key, d);
|
|
3928
3928
|
this.live.set(key, { data: _chunkCWM3CUUXcjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
|
|
3929
3929
|
continue;
|
|
@@ -3938,7 +3938,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3938
3938
|
}
|
|
3939
3939
|
/** Finishes the stroke (one undo step) and returns what changed. */
|
|
3940
3940
|
end() {
|
|
3941
|
-
if (this.closed) throw new (0,
|
|
3941
|
+
if (this.closed) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("This stroke has already ended.");
|
|
3942
3942
|
const last = _nullishCoalesce(this.last, () => ( void 0));
|
|
3943
3943
|
const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
|
|
3944
3944
|
_optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
|
|
@@ -4074,20 +4074,20 @@ function sameTile(a, b) {
|
|
|
4074
4074
|
for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
|
|
4075
4075
|
return true;
|
|
4076
4076
|
}
|
|
4077
|
-
var DEFAULT_ADJUSTMENTS =
|
|
4077
|
+
var DEFAULT_ADJUSTMENTS = _chunkCD7PLU77cjs.DEFAULT_ADJUSTMENTS_VALUES;
|
|
4078
4078
|
function normalizeStoredAdjustments(stored) {
|
|
4079
4079
|
if (!stored) return { ...DEFAULT_ADJUSTMENTS };
|
|
4080
4080
|
const out = {
|
|
4081
4081
|
...DEFAULT_ADJUSTMENTS,
|
|
4082
4082
|
...stored,
|
|
4083
|
-
process:
|
|
4083
|
+
process: _chunkCD7PLU77cjs.normalizeProcessVersion.call(void 0, stored.process)
|
|
4084
4084
|
};
|
|
4085
|
-
const layers =
|
|
4085
|
+
const layers = _chunkCD7PLU77cjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
|
|
4086
4086
|
if (layers.length) out.layers = layers;
|
|
4087
4087
|
else delete out.layers;
|
|
4088
4088
|
return out;
|
|
4089
4089
|
}
|
|
4090
|
-
var isLayered = (data) => Boolean(data && data.version ===
|
|
4090
|
+
var isLayered = (data) => Boolean(data && data.version === _chunkCD7PLU77cjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
|
|
4091
4091
|
function migrateSerializedImageEditorState(data) {
|
|
4092
4092
|
if (isLayered(data)) {
|
|
4093
4093
|
const out = {
|
|
@@ -4119,10 +4119,10 @@ function migrateSerializedImageEditorState(data) {
|
|
|
4119
4119
|
function migrateToLayeredState(data, size) {
|
|
4120
4120
|
const clean = migrateSerializedImageEditorState(data);
|
|
4121
4121
|
if (isLayered(clean)) return clean;
|
|
4122
|
-
const stack =
|
|
4123
|
-
const { layers, assets } =
|
|
4122
|
+
const stack = _chunkCD7PLU77cjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
|
|
4123
|
+
const { layers, assets } = _chunkCD7PLU77cjs.serializeLayers.call(void 0, stack.layers);
|
|
4124
4124
|
const out = {
|
|
4125
|
-
version:
|
|
4125
|
+
version: _chunkCD7PLU77cjs.LAYERED_SCHEMA_VERSION,
|
|
4126
4126
|
width: Math.round(size.width),
|
|
4127
4127
|
height: Math.round(size.height),
|
|
4128
4128
|
layers,
|
|
@@ -4136,8 +4136,8 @@ function migrateToLayeredState(data, size) {
|
|
|
4136
4136
|
if (clean.selection) out.selection = clean.selection;
|
|
4137
4137
|
return out;
|
|
4138
4138
|
}
|
|
4139
|
-
var DEFAULT_TRANSFORM =
|
|
4140
|
-
var DEFAULT_DEPTH_MASK =
|
|
4139
|
+
var DEFAULT_TRANSFORM = _chunkCD7PLU77cjs.DEFAULT_TRANSFORM_VALUES;
|
|
4140
|
+
var DEFAULT_DEPTH_MASK = _chunkCD7PLU77cjs.DEFAULT_DEPTH_MASK_VALUES;
|
|
4141
4141
|
var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
|
|
4142
4142
|
var ImageEditorController = (_class7 = class {
|
|
4143
4143
|
|
|
@@ -4160,7 +4160,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4160
4160
|
__init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
|
|
4161
4161
|
__init63() {this.viewKey = []}
|
|
4162
4162
|
/** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
|
|
4163
|
-
__init64() {this.compositor = new (0,
|
|
4163
|
+
__init64() {this.compositor = new (0, _chunkCD7PLU77cjs.LayerCompositor)()}
|
|
4164
4164
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
4165
4165
|
__init65() {this.effects = new (0, _chunkRUZQMYXHcjs.EffectsSlot)()}
|
|
4166
4166
|
/** Renders provider effects: effect smart filter results and effect layers. */
|
|
@@ -4204,7 +4204,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4204
4204
|
activeLayerId: null,
|
|
4205
4205
|
activeTarget: "pixels",
|
|
4206
4206
|
outputOpacity: 1,
|
|
4207
|
-
paint: { brush: { ...
|
|
4207
|
+
paint: { brush: { ..._chunkEBDCRTZIcjs.DEFAULT_BRUSH }, foreground: "#000000", background: "#ffffff", paint: { type: "color", color: "#000000" }, mixer: { ..._chunkEBDCRTZIcjs.DEFAULT_MIXER }, mixerLoad: _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD, retouch: { ..._chunk7NW46N7Icjs.DEFAULT_RETOUCH }, cloneSource: null, cloneTransform: { ..._chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM } },
|
|
4208
4208
|
fit: _nullishCoalesce(options.fit, () => ( "margin"))
|
|
4209
4209
|
};
|
|
4210
4210
|
if (options.image instanceof Object && "width" in options.image) {
|
|
@@ -4218,7 +4218,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4218
4218
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
4219
4219
|
if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
|
|
4220
4220
|
try {
|
|
4221
|
-
this.state.selection = normalizeSelection(
|
|
4221
|
+
this.state.selection = normalizeSelection(_chunkCD7PLU77cjs.deserializeSelection.call(void 0, options.initialState.selection));
|
|
4222
4222
|
} catch (e15) {
|
|
4223
4223
|
}
|
|
4224
4224
|
}
|
|
@@ -4331,10 +4331,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
4331
4331
|
if (l.type === "group") {
|
|
4332
4332
|
const children = walk(l.children);
|
|
4333
4333
|
if (children !== l.children) next2 = { ...l, children };
|
|
4334
|
-
} 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 ||
|
|
4334
|
+
} 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 || _chunkCD7PLU77cjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
|
|
4335
4335
|
try {
|
|
4336
|
-
const r =
|
|
4337
|
-
if (all || !
|
|
4336
|
+
const r = _chunkCD7PLU77cjs.rerender.call(void 0, l, canvas);
|
|
4337
|
+
if (all || !_chunkCD7PLU77cjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
|
|
4338
4338
|
} catch (e17) {
|
|
4339
4339
|
}
|
|
4340
4340
|
}
|
|
@@ -4390,19 +4390,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4390
4390
|
const d = await this.describeEffect(effect, "filter");
|
|
4391
4391
|
const values = _chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4392
4392
|
const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4393
|
-
if (!found) throw new (0,
|
|
4393
|
+
if (!found) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
|
|
4394
4394
|
let layers = this.state.layers;
|
|
4395
4395
|
let id = layerId;
|
|
4396
4396
|
let converted = false;
|
|
4397
4397
|
if (found.layer.type !== "smart") {
|
|
4398
|
-
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0,
|
|
4399
|
-
const res2 =
|
|
4398
|
+
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkCD7PLU77cjs.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.`);
|
|
4399
|
+
const res2 = _chunkCD7PLU77cjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
|
|
4400
4400
|
layers = res2.layers;
|
|
4401
4401
|
id = res2.layer.id;
|
|
4402
4402
|
converted = true;
|
|
4403
4403
|
}
|
|
4404
|
-
const filter =
|
|
4405
|
-
const res =
|
|
4404
|
+
const filter = _chunkCD7PLU77cjs.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 });
|
|
4405
|
+
const res = _chunkCD7PLU77cjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
|
|
4406
4406
|
this.commitLayers(res.layers);
|
|
4407
4407
|
return { layerId: id, filter: res.filter, converted };
|
|
4408
4408
|
}
|
|
@@ -4413,9 +4413,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4413
4413
|
* false, during a drag).
|
|
4414
4414
|
*/
|
|
4415
4415
|
async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
|
|
4416
|
-
const layer =
|
|
4416
|
+
const layer = _chunkCD7PLU77cjs.requireSmartObject.call(void 0, this.state.layers, layerId);
|
|
4417
4417
|
const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
|
|
4418
|
-
if (!was || was.kind !== "effect") throw new (0,
|
|
4418
|
+
if (!was || was.kind !== "effect") throw new (0, _chunkCD7PLU77cjs.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"}.`);
|
|
4419
4419
|
const update = {};
|
|
4420
4420
|
if (changes.values) {
|
|
4421
4421
|
const d = await this.describeEffect(was.effect);
|
|
@@ -4424,15 +4424,15 @@ var ImageEditorController = (_class7 = class {
|
|
|
4424
4424
|
for (const [k, v] of Object.entries(changes.values)) {
|
|
4425
4425
|
if (v !== null) given[k] = v;
|
|
4426
4426
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4427
|
-
else throw new (0,
|
|
4427
|
+
else throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4428
4428
|
}
|
|
4429
4429
|
update.values = { ...base, ..._chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4430
4430
|
}
|
|
4431
4431
|
for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
|
|
4432
|
-
let res =
|
|
4433
|
-
if (changes.index !== void 0) res = { ...res, layers:
|
|
4432
|
+
let res = _chunkCD7PLU77cjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
|
|
4433
|
+
if (changes.index !== void 0) res = { ...res, layers: _chunkCD7PLU77cjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
|
|
4434
4434
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4435
|
-
return
|
|
4435
|
+
return _chunkCD7PLU77cjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
|
|
4436
4436
|
}
|
|
4437
4437
|
/**
|
|
4438
4438
|
* Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
|
|
@@ -4444,12 +4444,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4444
4444
|
const values = _chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4445
4445
|
const { width, height } = this.naturalSize;
|
|
4446
4446
|
const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
|
|
4447
|
-
const blend =
|
|
4448
|
-
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0,
|
|
4447
|
+
const blend = _chunkCD7PLU77cjs.parseBlend.call(void 0, options.blend);
|
|
4448
|
+
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4449
4449
|
const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4450
4450
|
const layer = {
|
|
4451
4451
|
type: "pixel",
|
|
4452
|
-
id: options.id && !ids.has(options.id) ? options.id :
|
|
4452
|
+
id: options.id && !ids.has(options.id) ? options.id : _chunkCD7PLU77cjs.newLayerId.call(void 0, ),
|
|
4453
4453
|
name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
|
|
4454
4454
|
visible: true,
|
|
4455
4455
|
opacity: _nullishCoalesce(options.opacity, () => ( 1)),
|
|
@@ -4458,7 +4458,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4458
4458
|
offset: { x: 0, y: 0 },
|
|
4459
4459
|
generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
|
|
4460
4460
|
};
|
|
4461
|
-
const next =
|
|
4461
|
+
const next = _chunkCD7PLU77cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
|
|
4462
4462
|
this.commitLayers(next, () => {
|
|
4463
4463
|
this.state.activeLayerId = layer.id;
|
|
4464
4464
|
this.state.activeTarget = "pixels";
|
|
@@ -4473,8 +4473,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
4473
4473
|
async updateEffectLayer(layerId, changes, commitToHistory = true) {
|
|
4474
4474
|
const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4475
4475
|
const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
|
|
4476
|
-
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0,
|
|
4477
|
-
|
|
4476
|
+
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
|
|
4477
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
|
|
4478
4478
|
const g = layer.generator;
|
|
4479
4479
|
const d = await this.describeEffect(g.effect);
|
|
4480
4480
|
const base = { ...g.values };
|
|
@@ -4482,7 +4482,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4482
4482
|
for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
|
|
4483
4483
|
if (v !== null) given[k] = v;
|
|
4484
4484
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4485
|
-
else throw new (0,
|
|
4485
|
+
else throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4486
4486
|
}
|
|
4487
4487
|
const values = { ...base, ..._chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4488
4488
|
const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
|
|
@@ -4497,7 +4497,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4497
4497
|
/** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
|
|
4498
4498
|
rasterizeEffectLayer(layerId) {
|
|
4499
4499
|
const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4500
|
-
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0,
|
|
4500
|
+
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
|
|
4501
4501
|
this.commitLayers(
|
|
4502
4502
|
_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
|
|
4503
4503
|
const { generator: _g, ...rest } = l;
|
|
@@ -4525,7 +4525,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4525
4525
|
if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
|
|
4526
4526
|
this.viewKey = key;
|
|
4527
4527
|
const { width, height } = this.naturalSize;
|
|
4528
|
-
const view =
|
|
4528
|
+
const view = _chunkCD7PLU77cjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
|
|
4529
4529
|
s.adjustments = view.adjustments;
|
|
4530
4530
|
s.depthMask = view.depthMask;
|
|
4531
4531
|
s.annotations = view.annotations;
|
|
@@ -4696,7 +4696,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4696
4696
|
applyCropPreset(ratio) {
|
|
4697
4697
|
this.recordHistory();
|
|
4698
4698
|
const { width, height } = this.state.imageDimensions;
|
|
4699
|
-
if (ratio &&
|
|
4699
|
+
if (ratio && _chunkCD7PLU77cjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
|
|
4700
4700
|
ratio = 1 / ratio;
|
|
4701
4701
|
}
|
|
4702
4702
|
if (!ratio) {
|
|
@@ -4778,7 +4778,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4778
4778
|
*/
|
|
4779
4779
|
getLayerPixels(id) {
|
|
4780
4780
|
const layer = this.getLayer(id);
|
|
4781
|
-
if (!layer || !
|
|
4781
|
+
if (!layer || !_chunkCD7PLU77cjs.hasSurface.call(void 0, layer)) return null;
|
|
4782
4782
|
const surface = this.surfaceOf(layer);
|
|
4783
4783
|
const b = _chunkCWM3CUUXcjs.contentBounds.call(void 0, surface);
|
|
4784
4784
|
if (!b) return null;
|
|
@@ -4791,7 +4791,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4791
4791
|
*/
|
|
4792
4792
|
getLayerBounds(id) {
|
|
4793
4793
|
const layer = this.getLayer(id);
|
|
4794
|
-
if (!layer || !
|
|
4794
|
+
if (!layer || !_chunkCD7PLU77cjs.hasSurface.call(void 0, layer)) return null;
|
|
4795
4795
|
const surface = this.surfaceOf(layer);
|
|
4796
4796
|
let b = this.boundsCache.get(surface);
|
|
4797
4797
|
if (b === void 0) {
|
|
@@ -4806,9 +4806,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4806
4806
|
*/
|
|
4807
4807
|
getLayerDataURL(id) {
|
|
4808
4808
|
const layer = this.getLayer(id);
|
|
4809
|
-
if (!layer || !
|
|
4809
|
+
if (!layer || !_chunkCD7PLU77cjs.hasSurface.call(void 0, layer)) return null;
|
|
4810
4810
|
const surface = this.surfaceOf(layer);
|
|
4811
|
-
const enc =
|
|
4811
|
+
const enc = _chunkCD7PLU77cjs.encodeSurface.call(void 0, surface);
|
|
4812
4812
|
return enc ? enc.url : null;
|
|
4813
4813
|
}
|
|
4814
4814
|
/**
|
|
@@ -4928,7 +4928,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4928
4928
|
_optionalChain([extra, 'optionalCall', _154 => _154()]);
|
|
4929
4929
|
if (depth !== 8 && this.bitDepth === depth) this.state.layers = keepDeepLayers(prev, this.state.layers);
|
|
4930
4930
|
if (this.state.activeLayerId && !_chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId)) {
|
|
4931
|
-
this.state.activeLayerId =
|
|
4931
|
+
this.state.activeLayerId = _chunkCD7PLU77cjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, this.state.activeLayerId);
|
|
4932
4932
|
this.state.activeTarget = "pixels";
|
|
4933
4933
|
}
|
|
4934
4934
|
this.notify();
|
|
@@ -4950,19 +4950,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4950
4950
|
if (init.pixels) {
|
|
4951
4951
|
const px2 = init.pixels;
|
|
4952
4952
|
if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
|
|
4953
|
-
throw new (0,
|
|
4953
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
|
|
4954
4954
|
}
|
|
4955
4955
|
surface = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, px2, 4);
|
|
4956
4956
|
} else if (init.color !== void 0) {
|
|
4957
4957
|
const c = parseColor(init.color);
|
|
4958
4958
|
surface = _chunkCWM3CUUXcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkCWM3CUUXcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
|
|
4959
4959
|
}
|
|
4960
|
-
const blend =
|
|
4961
|
-
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
4960
|
+
const blend = _chunkCD7PLU77cjs.parseBlend.call(void 0, init.blend);
|
|
4961
|
+
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4962
4962
|
const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4963
4963
|
const layer = {
|
|
4964
4964
|
type: "pixel",
|
|
4965
|
-
id: init.id && !ids.has(init.id) ? init.id :
|
|
4965
|
+
id: init.id && !ids.has(init.id) ? init.id : _chunkCD7PLU77cjs.newLayerId.call(void 0, ),
|
|
4966
4966
|
name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
|
|
4967
4967
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
4968
4968
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
@@ -4971,7 +4971,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4971
4971
|
offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
|
|
4972
4972
|
};
|
|
4973
4973
|
if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
|
|
4974
|
-
const next =
|
|
4974
|
+
const next = _chunkCD7PLU77cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
4975
4975
|
this.commitLayers(next, () => {
|
|
4976
4976
|
this.state.activeLayerId = layer.id;
|
|
4977
4977
|
this.state.activeTarget = "pixels";
|
|
@@ -5011,12 +5011,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
5011
5011
|
try {
|
|
5012
5012
|
img = await this.renderer.imageCache.get(src);
|
|
5013
5013
|
} catch (e22) {
|
|
5014
|
-
throw new (0,
|
|
5014
|
+
throw new (0, _chunkCD7PLU77cjs.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.");
|
|
5015
5015
|
}
|
|
5016
5016
|
const w = img.naturalWidth || img.width;
|
|
5017
5017
|
const h = img.naturalHeight || img.height;
|
|
5018
5018
|
const ctx = this.renderer.createCanvas(w, h).getContext("2d");
|
|
5019
|
-
if (!ctx || typeof ctx.getImageData !== "function") throw new (0,
|
|
5019
|
+
if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
|
|
5020
5020
|
ctx.drawImage(img, 0, 0, w, h);
|
|
5021
5021
|
const data = ctx.getImageData(0, 0, w, h);
|
|
5022
5022
|
return { width: w, height: h, data: data.data };
|
|
@@ -5029,7 +5029,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5029
5029
|
}
|
|
5030
5030
|
/** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
|
|
5031
5031
|
duplicateLayer(id, name) {
|
|
5032
|
-
const res =
|
|
5032
|
+
const res = _chunkCD7PLU77cjs.duplicateLayer.call(void 0, this.state.layers, id, name);
|
|
5033
5033
|
this.commitLayers(res.layers, () => {
|
|
5034
5034
|
this.state.activeLayerId = res.id;
|
|
5035
5035
|
});
|
|
@@ -5037,16 +5037,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5037
5037
|
}
|
|
5038
5038
|
/** Deletes a layer (refused when locked), as one undo step. */
|
|
5039
5039
|
removeLayer(id) {
|
|
5040
|
-
const next =
|
|
5040
|
+
const next = _chunkCD7PLU77cjs.removeLayer.call(void 0, this.state.layers, id);
|
|
5041
5041
|
this.commitLayers(next, () => {
|
|
5042
|
-
if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([
|
|
5042
|
+
if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkCD7PLU77cjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
|
|
5043
5043
|
this.state.selectedAnnotationId = null;
|
|
5044
5044
|
}
|
|
5045
5045
|
});
|
|
5046
5046
|
}
|
|
5047
5047
|
/** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
|
|
5048
5048
|
moveLayer(id, placement) {
|
|
5049
|
-
const next =
|
|
5049
|
+
const next = _chunkCD7PLU77cjs.moveLayer.call(void 0, this.state.layers, id, placement);
|
|
5050
5050
|
const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id);
|
|
5051
5051
|
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
|
|
5052
5052
|
this.commitLayers(next);
|
|
@@ -5057,23 +5057,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
5057
5057
|
* one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
|
|
5058
5058
|
*/
|
|
5059
5059
|
setLayerProperties(id, props, commitToHistory = true) {
|
|
5060
|
-
const next =
|
|
5060
|
+
const next = _chunkCD7PLU77cjs.setLayerProperties.call(void 0, this.state.layers, id, props);
|
|
5061
5061
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5062
5062
|
return _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer;
|
|
5063
5063
|
}
|
|
5064
5064
|
/** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
|
|
5065
5065
|
addGroup(init = {}) {
|
|
5066
|
-
const blend = init.blend === void 0 ? "pass-through" :
|
|
5066
|
+
const blend = init.blend === void 0 ? "pass-through" : _chunkCD7PLU77cjs.parseBlend.call(void 0, init.blend, true);
|
|
5067
5067
|
const group = {
|
|
5068
5068
|
type: "group",
|
|
5069
|
-
id:
|
|
5069
|
+
id: _chunkCD7PLU77cjs.newLayerId.call(void 0, "group"),
|
|
5070
5070
|
name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
|
|
5071
5071
|
visible: true,
|
|
5072
5072
|
opacity: 1,
|
|
5073
5073
|
blend,
|
|
5074
5074
|
children: []
|
|
5075
5075
|
};
|
|
5076
|
-
const next =
|
|
5076
|
+
const next = _chunkCD7PLU77cjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
|
|
5077
5077
|
this.commitLayers(next, () => {
|
|
5078
5078
|
this.state.activeLayerId = group.id;
|
|
5079
5079
|
this.state.activeTarget = "pixels";
|
|
@@ -5082,7 +5082,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5082
5082
|
}
|
|
5083
5083
|
/** Puts sibling layers into a new group (one undo step). Returns the group id. */
|
|
5084
5084
|
groupLayers(ids, name) {
|
|
5085
|
-
const res =
|
|
5085
|
+
const res = _chunkCD7PLU77cjs.groupLayers.call(void 0, this.state.layers, ids, name);
|
|
5086
5086
|
this.commitLayers(res.layers, () => {
|
|
5087
5087
|
this.state.activeLayerId = res.id;
|
|
5088
5088
|
});
|
|
@@ -5090,7 +5090,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5090
5090
|
}
|
|
5091
5091
|
/** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
|
|
5092
5092
|
ungroupLayer(id) {
|
|
5093
|
-
const res =
|
|
5093
|
+
const res = _chunkCD7PLU77cjs.ungroupLayer.call(void 0, this.state.layers, id);
|
|
5094
5094
|
this.commitLayers(res.layers);
|
|
5095
5095
|
return res.ids;
|
|
5096
5096
|
}
|
|
@@ -5099,38 +5099,38 @@ var ImageEditorController = (_class7 = class {
|
|
|
5099
5099
|
* (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
|
|
5100
5100
|
*/
|
|
5101
5101
|
offsetLayer(id, move, commitToHistory = true) {
|
|
5102
|
-
const layer =
|
|
5102
|
+
const layer = _chunkCD7PLU77cjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5103
5103
|
if (layer.type === "smart") {
|
|
5104
5104
|
const tl = layer.placement.corners[0];
|
|
5105
5105
|
const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5106
5106
|
const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5107
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5108
|
-
this.commitLayers(
|
|
5107
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("x and y must be numbers.");
|
|
5108
|
+
this.commitLayers(_chunkCD7PLU77cjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
|
|
5109
5109
|
const moved = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, id).layer;
|
|
5110
5110
|
return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
|
|
5111
5111
|
}
|
|
5112
5112
|
if (layer.type === "shape") {
|
|
5113
|
-
const g = _nullishCoalesce(
|
|
5113
|
+
const g = _nullishCoalesce(_chunkCD7PLU77cjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
|
|
5114
5114
|
const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5115
5115
|
const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5116
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5117
|
-
|
|
5118
|
-
let moved =
|
|
5116
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("x and y must be numbers.");
|
|
5117
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5118
|
+
let moved = _chunkCD7PLU77cjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
|
|
5119
5119
|
const mask = layer.mask;
|
|
5120
5120
|
if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
|
|
5121
5121
|
this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
5122
|
-
const b = _nullishCoalesce(
|
|
5122
|
+
const b = _nullishCoalesce(_chunkCD7PLU77cjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
|
|
5123
5123
|
return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
|
|
5124
5124
|
}
|
|
5125
5125
|
if (layer.type === "type") {
|
|
5126
5126
|
const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
|
|
5127
5127
|
const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
|
|
5128
5128
|
const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
|
|
5129
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5130
|
-
|
|
5129
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("x and y must be numbers.");
|
|
5130
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5131
5131
|
const mx = Math.round(dx);
|
|
5132
5132
|
const my = Math.round(dy);
|
|
5133
|
-
let moved = { ...
|
|
5133
|
+
let moved = { ..._chunkCD7PLU77cjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, mx, my) };
|
|
5134
5134
|
const mask = layer.mask;
|
|
5135
5135
|
if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, mx, my) } };
|
|
5136
5136
|
this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
@@ -5140,7 +5140,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5140
5140
|
const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
5141
5141
|
const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
|
|
5142
5142
|
const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
|
|
5143
|
-
const next =
|
|
5143
|
+
const next = _chunkCD7PLU77cjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
|
|
5144
5144
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5145
5145
|
return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
|
|
5146
5146
|
}
|
|
@@ -5150,11 +5150,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5150
5150
|
* target when the layer is active.
|
|
5151
5151
|
*/
|
|
5152
5152
|
addLayerMask(id, from = "reveal-all", props = {}) {
|
|
5153
|
-
const layer =
|
|
5153
|
+
const layer = _chunkCD7PLU77cjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5154
5154
|
let mask;
|
|
5155
5155
|
if (from === "selection") {
|
|
5156
5156
|
const sel = this.state.selection;
|
|
5157
|
-
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0,
|
|
5157
|
+
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5158
5158
|
mask = this.maskFromSelection(sel, props);
|
|
5159
5159
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
5160
5160
|
mask = { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
@@ -5163,7 +5163,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5163
5163
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5164
5164
|
mask = withMaskProps({ surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5165
5165
|
}
|
|
5166
|
-
const next =
|
|
5166
|
+
const next = _chunkCD7PLU77cjs.setLayerMask.call(void 0, this.state.layers, id, mask);
|
|
5167
5167
|
this.commitLayers(next, () => {
|
|
5168
5168
|
if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
|
|
5169
5169
|
});
|
|
@@ -5171,18 +5171,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
5171
5171
|
}
|
|
5172
5172
|
/** Removes a layer's mask (one undo step). */
|
|
5173
5173
|
removeLayerMask(id) {
|
|
5174
|
-
const layer =
|
|
5175
|
-
if (!layer.mask) throw new (0,
|
|
5176
|
-
this.commitLayers(
|
|
5174
|
+
const layer = _chunkCD7PLU77cjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5175
|
+
if (!layer.mask) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5176
|
+
this.commitLayers(_chunkCD7PLU77cjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
|
|
5177
5177
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
5178
5178
|
});
|
|
5179
5179
|
}
|
|
5180
5180
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
5181
5181
|
setLayerMaskProps(id, props, commitToHistory = true) {
|
|
5182
|
-
const layer =
|
|
5183
|
-
if (!layer.mask) throw new (0,
|
|
5182
|
+
const layer = _chunkCD7PLU77cjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5183
|
+
if (!layer.mask) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
5184
5184
|
const mask = withMaskProps(layer.mask, props);
|
|
5185
|
-
this.commitLayers(
|
|
5185
|
+
this.commitLayers(_chunkCD7PLU77cjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
|
|
5186
5186
|
return mask;
|
|
5187
5187
|
}
|
|
5188
5188
|
/**
|
|
@@ -5190,11 +5190,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5190
5190
|
* the depth map) and removes the mask, as one undo step.
|
|
5191
5191
|
*/
|
|
5192
5192
|
async applyLayerMask(id) {
|
|
5193
|
-
const loc =
|
|
5193
|
+
const loc = _chunkCD7PLU77cjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5194
5194
|
const layer = loc.layer;
|
|
5195
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5196
|
-
if (!layer.mask) throw new (0,
|
|
5197
|
-
|
|
5195
|
+
if (layer.type !== "pixel") throw new (0, _chunkCD7PLU77cjs.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.`);
|
|
5196
|
+
if (!layer.mask) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5197
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
|
|
5198
5198
|
const { width, height } = this.naturalSize;
|
|
5199
5199
|
await this.renderer.prepareLayerAssets([layer], width, height);
|
|
5200
5200
|
const sources = this.renderer.compositorSources(width, height);
|
|
@@ -5227,13 +5227,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
5227
5227
|
*/
|
|
5228
5228
|
layerViaCopy(options = {}) {
|
|
5229
5229
|
const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
|
|
5230
|
-
if (!id) throw new (0,
|
|
5231
|
-
const loc =
|
|
5230
|
+
if (!id) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
|
|
5231
|
+
const loc = _chunkCD7PLU77cjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5232
5232
|
const layer = loc.layer;
|
|
5233
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5233
|
+
if (layer.type !== "pixel") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
|
|
5234
5234
|
const sel = this.state.selection;
|
|
5235
|
-
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0,
|
|
5236
|
-
if (options.cut)
|
|
5235
|
+
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
|
|
5236
|
+
if (options.cut) _chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
|
|
5237
5237
|
const surface = this.surfaceOf(layer);
|
|
5238
5238
|
const sb = sel.bounds;
|
|
5239
5239
|
const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
|
|
@@ -5249,7 +5249,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5249
5249
|
}
|
|
5250
5250
|
const copy = {
|
|
5251
5251
|
type: "pixel",
|
|
5252
|
-
id:
|
|
5252
|
+
id: _chunkCD7PLU77cjs.newLayerId.call(void 0, ),
|
|
5253
5253
|
name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
5254
5254
|
visible: true,
|
|
5255
5255
|
opacity: 1,
|
|
@@ -5322,7 +5322,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5322
5322
|
* Refused while another transform is open.
|
|
5323
5323
|
*/
|
|
5324
5324
|
beginFreeTransform(init = {}) {
|
|
5325
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5325
|
+
if (this.getFreeTransform()) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
|
|
5326
5326
|
const session = new FreeTransformSession(this.transformHost(), init);
|
|
5327
5327
|
this.openTransform = session;
|
|
5328
5328
|
this.notify();
|
|
@@ -5336,26 +5336,26 @@ var ImageEditorController = (_class7 = class {
|
|
|
5336
5336
|
*/
|
|
5337
5337
|
transformLayer(spec) {
|
|
5338
5338
|
const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
|
|
5339
|
-
if (given > 1) throw new (0,
|
|
5340
|
-
if (!given && spec.warp === void 0) throw new (0,
|
|
5339
|
+
if (given > 1) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give only one of matrix, corners and params.");
|
|
5340
|
+
if (!given && spec.warp === void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
|
|
5341
5341
|
if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
|
|
5342
|
-
throw new (0,
|
|
5342
|
+
throw new (0, _chunkCD7PLU77cjs.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).");
|
|
5343
5343
|
}
|
|
5344
5344
|
if (spec.matrix) {
|
|
5345
5345
|
const [a, b, c, d] = spec.matrix;
|
|
5346
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5346
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5347
5347
|
}
|
|
5348
5348
|
const session = this.beginFreeTransform(spec);
|
|
5349
5349
|
try {
|
|
5350
5350
|
const g = session.startGeometry;
|
|
5351
|
-
const corners = spec.matrix ? g.corners.map((p) =>
|
|
5351
|
+
const corners = spec.matrix ? g.corners.map((p) => _chunkQMI5HZWAcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkCD7PLU77cjs.applyParams.call(void 0, g, spec.params) : g.corners;
|
|
5352
5352
|
let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
|
|
5353
5353
|
if (spec.warp) {
|
|
5354
5354
|
if ("style" in spec.warp) {
|
|
5355
|
-
if (!
|
|
5356
|
-
warp =
|
|
5355
|
+
if (!_chunkQMI5HZWAcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkQMI5HZWAcjs.WARP_STYLES.join(", ")}.`);
|
|
5356
|
+
warp = _chunkCD7PLU77cjs.presetWarp.call(void 0, session.box, spec.warp);
|
|
5357
5357
|
} else {
|
|
5358
|
-
if (!
|
|
5358
|
+
if (!_chunkCD7PLU77cjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkCD7PLU77cjs.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.");
|
|
5359
5359
|
warp = spec.warp;
|
|
5360
5360
|
}
|
|
5361
5361
|
}
|
|
@@ -5368,10 +5368,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5368
5368
|
}
|
|
5369
5369
|
/** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
|
|
5370
5370
|
flipLayer(axis, init = {}) {
|
|
5371
|
-
if (axis !== "horizontal" && axis !== "vertical") throw new (0,
|
|
5371
|
+
if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
|
|
5372
5372
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5373
5373
|
try {
|
|
5374
|
-
session.update({ corners:
|
|
5374
|
+
session.update({ corners: _chunkCD7PLU77cjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
|
|
5375
5375
|
return session.commit();
|
|
5376
5376
|
} catch (e) {
|
|
5377
5377
|
session.cancel();
|
|
@@ -5383,16 +5383,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5383
5383
|
* centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
|
|
5384
5384
|
*/
|
|
5385
5385
|
rotateLayer90(turn, init = {}) {
|
|
5386
|
-
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0,
|
|
5386
|
+
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
|
|
5387
5387
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5388
5388
|
try {
|
|
5389
|
-
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(
|
|
5389
|
+
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkCD7PLU77cjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
|
|
5390
5390
|
const cx = b.x + b.width / 2;
|
|
5391
5391
|
const cy = b.y + b.height / 2;
|
|
5392
5392
|
const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
|
|
5393
5393
|
const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
|
|
5394
5394
|
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];
|
|
5395
|
-
session.update({ corners: session.startGeometry.corners.map((p) =>
|
|
5395
|
+
session.update({ corners: session.startGeometry.corners.map((p) => _chunkQMI5HZWAcjs.applyMatrix.call(void 0, m, p)) }, false);
|
|
5396
5396
|
return session.commit();
|
|
5397
5397
|
} catch (e) {
|
|
5398
5398
|
session.cancel();
|
|
@@ -5401,20 +5401,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5401
5401
|
}
|
|
5402
5402
|
/** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
|
|
5403
5403
|
addLayerFilter(id, filter) {
|
|
5404
|
-
const f =
|
|
5405
|
-
const next =
|
|
5404
|
+
const f = _chunkCD7PLU77cjs.normalizeFilter.call(void 0, filter);
|
|
5405
|
+
const next = _chunkCD7PLU77cjs.addLayerFilter.call(void 0, this.state.layers, id, f);
|
|
5406
5406
|
this.commitLayers(next);
|
|
5407
5407
|
return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5408
5408
|
}
|
|
5409
5409
|
/** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
|
|
5410
5410
|
updateLayerFilter(id, filterId, changes, commitToHistory = true) {
|
|
5411
|
-
const next =
|
|
5411
|
+
const next = _chunkCD7PLU77cjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
|
|
5412
5412
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5413
5413
|
return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5414
5414
|
}
|
|
5415
5415
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
5416
5416
|
removeLayerFilter(id, filterId) {
|
|
5417
|
-
const next =
|
|
5417
|
+
const next = _chunkCD7PLU77cjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
|
|
5418
5418
|
this.commitLayers(next);
|
|
5419
5419
|
return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5420
5420
|
}
|
|
@@ -5430,8 +5430,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5430
5430
|
*/
|
|
5431
5431
|
convertToSmartObject(ids, options = {}) {
|
|
5432
5432
|
const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
|
|
5433
|
-
if (!list.length) throw new (0,
|
|
5434
|
-
const res =
|
|
5433
|
+
if (!list.length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
|
|
5434
|
+
const res = _chunkCD7PLU77cjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
|
|
5435
5435
|
this.commitLayers(res.layers, () => {
|
|
5436
5436
|
this.state.activeLayerId = res.layer.id;
|
|
5437
5437
|
this.state.activeTarget = "pixels";
|
|
@@ -5440,7 +5440,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5440
5440
|
}
|
|
5441
5441
|
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
5442
5442
|
rasterizeSmartObject(id) {
|
|
5443
|
-
const res =
|
|
5443
|
+
const res = _chunkCD7PLU77cjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
|
|
5444
5444
|
this.commitLayers(res.layers, () => {
|
|
5445
5445
|
if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
5446
5446
|
});
|
|
@@ -5448,10 +5448,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5448
5448
|
}
|
|
5449
5449
|
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
5450
5450
|
getSmartObject(id) {
|
|
5451
|
-
const layer =
|
|
5451
|
+
const layer = _chunkCD7PLU77cjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5452
5452
|
const c = layer.contents;
|
|
5453
|
-
const g =
|
|
5454
|
-
const readout =
|
|
5453
|
+
const g = _chunkCD7PLU77cjs.placementGeometry.call(void 0, layer);
|
|
5454
|
+
const readout = _chunkCD7PLU77cjs.describeTransform.call(void 0, g);
|
|
5455
5455
|
const stack = layer.smartFilters;
|
|
5456
5456
|
return {
|
|
5457
5457
|
layerId: layer.id,
|
|
@@ -5461,10 +5461,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5461
5461
|
kind: c.kind,
|
|
5462
5462
|
width: c.width,
|
|
5463
5463
|
height: c.height,
|
|
5464
|
-
decoded:
|
|
5464
|
+
decoded: _chunkCD7PLU77cjs.isContentsDecoded.call(void 0, c),
|
|
5465
5465
|
fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
|
|
5466
5466
|
linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
|
|
5467
|
-
instances:
|
|
5467
|
+
instances: _chunkCD7PLU77cjs.instancesOf.call(void 0, this.state.layers, c.id),
|
|
5468
5468
|
layerCount: c.document ? _chunkHGTDMKNEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
|
|
5469
5469
|
},
|
|
5470
5470
|
placement: {
|
|
@@ -5476,8 +5476,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5476
5476
|
scaleY: readout.scaleY,
|
|
5477
5477
|
rotate: readout.rotate,
|
|
5478
5478
|
skewX: readout.skewX,
|
|
5479
|
-
center:
|
|
5480
|
-
bounds:
|
|
5479
|
+
center: _chunkCD7PLU77cjs.anchorPoint.call(void 0, g, "center"),
|
|
5480
|
+
bounds: _chunkCD7PLU77cjs.transformedBox.call(void 0, g)
|
|
5481
5481
|
},
|
|
5482
5482
|
smartFilters: {
|
|
5483
5483
|
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
|
|
@@ -5494,7 +5494,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5494
5494
|
* change. Returns the new placement summary.
|
|
5495
5495
|
*/
|
|
5496
5496
|
setSmartObjectPlacement(id, placement, commitToHistory = true) {
|
|
5497
|
-
const res =
|
|
5497
|
+
const res = _chunkCD7PLU77cjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
|
|
5498
5498
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5499
5499
|
return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
|
|
5500
5500
|
}
|
|
@@ -5507,23 +5507,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
5507
5507
|
* nothing is relative to the current transform.
|
|
5508
5508
|
*/
|
|
5509
5509
|
setSmartObjectTransform(id, spec) {
|
|
5510
|
-
const layer =
|
|
5511
|
-
const g =
|
|
5510
|
+
const layer = _chunkCD7PLU77cjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5511
|
+
const g = _chunkCD7PLU77cjs.placementGeometry.call(void 0, layer);
|
|
5512
5512
|
const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
|
|
5513
5513
|
const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
|
|
5514
|
-
if (ways > 1) throw new (0,
|
|
5514
|
+
if (ways > 1) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
|
|
5515
5515
|
let corners = g.corners;
|
|
5516
5516
|
if (spec.corners) corners = spec.corners;
|
|
5517
5517
|
else if (spec.matrix) {
|
|
5518
|
-
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0,
|
|
5518
|
+
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkCD7PLU77cjs.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).");
|
|
5519
5519
|
const [a, b, c, d] = spec.matrix;
|
|
5520
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5521
|
-
corners =
|
|
5520
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5521
|
+
corners = _chunkCD7PLU77cjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
|
|
5522
5522
|
} else if (numeric.length) {
|
|
5523
|
-
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0,
|
|
5524
|
-
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0,
|
|
5525
|
-
const now =
|
|
5526
|
-
const centre =
|
|
5523
|
+
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
|
|
5524
|
+
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`${k} must be a finite number.`);
|
|
5525
|
+
const now = _chunkCD7PLU77cjs.describeTransform.call(void 0, g);
|
|
5526
|
+
const centre = _chunkCD7PLU77cjs.anchorPoint.call(void 0, g, "center");
|
|
5527
5527
|
const params = {
|
|
5528
5528
|
scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
|
|
5529
5529
|
scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
|
|
@@ -5531,20 +5531,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5531
5531
|
skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
|
|
5532
5532
|
skewY: _nullishCoalesce(spec.skewY, () => ( 0))
|
|
5533
5533
|
};
|
|
5534
|
-
const m =
|
|
5534
|
+
const m = _chunkCD7PLU77cjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
|
|
5535
5535
|
const cx = g.box.width / 2;
|
|
5536
5536
|
const cy = g.box.height / 2;
|
|
5537
5537
|
const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
|
|
5538
|
-
corners =
|
|
5538
|
+
corners = _chunkCD7PLU77cjs.cornersFromMatrix.call(void 0, g.box, _chunkQMI5HZWAcjs.multiplyMatrices.call(void 0, m, _chunkQMI5HZWAcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
|
|
5539
5539
|
}
|
|
5540
5540
|
let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
|
|
5541
5541
|
if (spec.warp === null) warp = null;
|
|
5542
5542
|
else if (spec.warp) {
|
|
5543
5543
|
if ("style" in spec.warp) {
|
|
5544
|
-
if (!
|
|
5545
|
-
warp =
|
|
5544
|
+
if (!_chunkQMI5HZWAcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkQMI5HZWAcjs.WARP_STYLES.join(", ")}.`);
|
|
5545
|
+
warp = _chunkCD7PLU77cjs.presetWarp.call(void 0, g.box, spec.warp);
|
|
5546
5546
|
} else {
|
|
5547
|
-
if (!
|
|
5547
|
+
if (!_chunkCD7PLU77cjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkCD7PLU77cjs.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.");
|
|
5548
5548
|
warp = spec.warp;
|
|
5549
5549
|
}
|
|
5550
5550
|
}
|
|
@@ -5558,16 +5558,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5558
5558
|
* the layers that changed.
|
|
5559
5559
|
*/
|
|
5560
5560
|
replaceSmartObjectContents(id, source) {
|
|
5561
|
-
const layer =
|
|
5561
|
+
const layer = _chunkCD7PLU77cjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5562
5562
|
let contents;
|
|
5563
5563
|
if ("contents" in source) contents = source.contents;
|
|
5564
|
-
else if ("pixels" in source) contents =
|
|
5564
|
+
else if ("pixels" in source) contents = _chunkCD7PLU77cjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
|
|
5565
5565
|
else {
|
|
5566
|
-
const psd =
|
|
5567
|
-
contents =
|
|
5566
|
+
const psd = _chunkCD7PLU77cjs.importPsd.call(void 0, source.psd, { newId: () => _chunkCD7PLU77cjs.newLayerId.call(void 0, ) });
|
|
5567
|
+
contents = _chunkCD7PLU77cjs.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`)));
|
|
5568
5568
|
contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
|
|
5569
5569
|
}
|
|
5570
|
-
const res =
|
|
5570
|
+
const res = _chunkCD7PLU77cjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
|
|
5571
5571
|
this.commitLayers(res.layers);
|
|
5572
5572
|
return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
|
|
5573
5573
|
}
|
|
@@ -5582,16 +5582,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5582
5582
|
* and bytes.
|
|
5583
5583
|
*/
|
|
5584
5584
|
exportSmartObjectContents(id) {
|
|
5585
|
-
const layer =
|
|
5585
|
+
const layer = _chunkCD7PLU77cjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5586
5586
|
const c = layer.contents;
|
|
5587
5587
|
const base = c.name.replace(/\.\w+$/, "") || "Contents";
|
|
5588
5588
|
if (c.file) {
|
|
5589
|
-
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ...
|
|
5589
|
+
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkCD7PLU77cjs.BROWSER_IMAGE_TYPES };
|
|
5590
5590
|
const ext = c.file.type.toLowerCase();
|
|
5591
5591
|
return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
|
|
5592
5592
|
}
|
|
5593
|
-
if (!
|
|
5594
|
-
const f =
|
|
5593
|
+
if (!_chunkCD7PLU77cjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
|
|
5594
|
+
const f = _chunkCD7PLU77cjs.smartContentsFile.call(void 0, c);
|
|
5595
5595
|
return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
|
|
5596
5596
|
}
|
|
5597
5597
|
/**
|
|
@@ -5600,7 +5600,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5600
5600
|
* undo step. Returns the copy's id.
|
|
5601
5601
|
*/
|
|
5602
5602
|
copySmartObject(id, linked = false, name) {
|
|
5603
|
-
const res =
|
|
5603
|
+
const res = _chunkCD7PLU77cjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
|
|
5604
5604
|
this.commitLayers(res.layers, () => {
|
|
5605
5605
|
this.state.activeLayerId = res.layer.id;
|
|
5606
5606
|
this.state.activeTarget = "pixels";
|
|
@@ -5609,31 +5609,31 @@ var ImageEditorController = (_class7 = class {
|
|
|
5609
5609
|
}
|
|
5610
5610
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
5611
5611
|
addSmartFilter(id, filter, index) {
|
|
5612
|
-
const res =
|
|
5612
|
+
const res = _chunkCD7PLU77cjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkCD7PLU77cjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
|
|
5613
5613
|
this.commitLayers(res.layers);
|
|
5614
5614
|
return res.filter;
|
|
5615
5615
|
}
|
|
5616
5616
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
5617
5617
|
updateSmartFilter(id, filterId, changes, commitToHistory = true) {
|
|
5618
|
-
const res =
|
|
5618
|
+
const res = _chunkCD7PLU77cjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
|
|
5619
5619
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5620
5620
|
return res.filter;
|
|
5621
5621
|
}
|
|
5622
5622
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
5623
5623
|
removeSmartFilter(id, filterId) {
|
|
5624
|
-
const res =
|
|
5624
|
+
const res = _chunkCD7PLU77cjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
|
|
5625
5625
|
this.commitLayers(res.layers);
|
|
5626
5626
|
return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
|
|
5627
5627
|
}
|
|
5628
5628
|
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
5629
5629
|
moveSmartFilter(id, filterId, index) {
|
|
5630
|
-
const res =
|
|
5630
|
+
const res = _chunkCD7PLU77cjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
|
|
5631
5631
|
this.commitLayers(res.layers);
|
|
5632
5632
|
return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
|
|
5633
5633
|
}
|
|
5634
5634
|
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
5635
5635
|
setSmartFiltersEnabled(id, enabled) {
|
|
5636
|
-
const res =
|
|
5636
|
+
const res = _chunkCD7PLU77cjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
|
|
5637
5637
|
this.commitLayers(res.layers);
|
|
5638
5638
|
return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
|
|
5639
5639
|
}
|
|
@@ -5643,21 +5643,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
5643
5643
|
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
5644
5644
|
*/
|
|
5645
5645
|
setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
|
|
5646
|
-
const layer =
|
|
5646
|
+
const layer = _chunkCD7PLU77cjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5647
5647
|
let mask;
|
|
5648
5648
|
if (from === "none") mask = null;
|
|
5649
5649
|
else if (from === "keep") {
|
|
5650
|
-
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0,
|
|
5650
|
+
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
|
|
5651
5651
|
mask = withMaskProps(layer.smartFilters.mask, props);
|
|
5652
5652
|
} else if (from === "selection") {
|
|
5653
5653
|
const sel = this.state.selection;
|
|
5654
|
-
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0,
|
|
5654
|
+
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5655
5655
|
mask = this.maskFromSelection(sel, props);
|
|
5656
5656
|
} else {
|
|
5657
5657
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5658
5658
|
mask = withMaskProps({ surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5659
5659
|
}
|
|
5660
|
-
const res =
|
|
5660
|
+
const res = _chunkCD7PLU77cjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
|
|
5661
5661
|
this.commitLayers(res.layers, () => {
|
|
5662
5662
|
if (this.state.activeLayerId !== id) return;
|
|
5663
5663
|
if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
|
|
@@ -5673,14 +5673,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
5673
5673
|
async prepareSmartObjects() {
|
|
5674
5674
|
const pending = /* @__PURE__ */ new Map();
|
|
5675
5675
|
for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers)) {
|
|
5676
|
-
if (l.type === "smart" && !
|
|
5676
|
+
if (l.type === "smart" && !_chunkCD7PLU77cjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkCD7PLU77cjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
|
|
5677
5677
|
}
|
|
5678
5678
|
const left = [];
|
|
5679
5679
|
for (const [cid, c] of pending) {
|
|
5680
5680
|
try {
|
|
5681
|
-
const url = `data:${
|
|
5681
|
+
const url = `data:${_chunkCD7PLU77cjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkCWM3CUUXcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
|
|
5682
5682
|
const px2 = await this.decodeImage(url);
|
|
5683
|
-
const decoded = { ...c, kind: "raster", raster:
|
|
5683
|
+
const decoded = { ...c, kind: "raster", raster: _chunkCD7PLU77cjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
|
|
5684
5684
|
const swap = (layers) => {
|
|
5685
5685
|
let out = layers;
|
|
5686
5686
|
for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
|
|
@@ -5708,10 +5708,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5708
5708
|
* Contents can nest. Returns the contents' size and layer ids.
|
|
5709
5709
|
*/
|
|
5710
5710
|
editSmartObjectContents(id) {
|
|
5711
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5712
|
-
const layer =
|
|
5711
|
+
if (this.getFreeTransform()) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
|
|
5712
|
+
const layer = _chunkCD7PLU77cjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5713
5713
|
const c = layer.contents;
|
|
5714
|
-
if (!
|
|
5714
|
+
if (!_chunkCD7PLU77cjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkCD7PLU77cjs.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.`);
|
|
5715
5715
|
const saved = {
|
|
5716
5716
|
state: { ...this.state },
|
|
5717
5717
|
undo: this.undoStack,
|
|
@@ -5722,7 +5722,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5722
5722
|
samplePixelsOverride: this.samplePixelsOverride,
|
|
5723
5723
|
psdResolution: this.psdResolution
|
|
5724
5724
|
};
|
|
5725
|
-
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id:
|
|
5725
|
+
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkCD7PLU77cjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
|
|
5726
5726
|
this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
|
|
5727
5727
|
const s = this.state;
|
|
5728
5728
|
this.state = {
|
|
@@ -5730,7 +5730,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5730
5730
|
sourceUrl: null,
|
|
5731
5731
|
imageDimensions: { width: c.width, height: c.height },
|
|
5732
5732
|
crop: null,
|
|
5733
|
-
transform: { ...
|
|
5733
|
+
transform: { ..._chunkCD7PLU77cjs.DEFAULT_TRANSFORM_VALUES },
|
|
5734
5734
|
layers,
|
|
5735
5735
|
activeLayerId: layers.length ? layers[layers.length - 1].id : null,
|
|
5736
5736
|
activeTarget: "pixels",
|
|
@@ -5763,7 +5763,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5763
5763
|
*/
|
|
5764
5764
|
closeSmartObjectContents(save = true) {
|
|
5765
5765
|
const top = this.contentsStack.pop();
|
|
5766
|
-
if (!top) throw new (0,
|
|
5766
|
+
if (!top) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
|
|
5767
5767
|
if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
|
|
5768
5768
|
this.openTransform = null;
|
|
5769
5769
|
const edited = this.state;
|
|
@@ -5777,10 +5777,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5777
5777
|
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";
|
|
5778
5778
|
if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
|
|
5779
5779
|
const px2 = _chunkCWM3CUUXcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
|
|
5780
|
-
next =
|
|
5780
|
+
next = _chunkCD7PLU77cjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
|
|
5781
5781
|
} else {
|
|
5782
5782
|
const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
|
|
5783
|
-
next =
|
|
5783
|
+
next = _chunkCD7PLU77cjs.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);
|
|
5784
5784
|
}
|
|
5785
5785
|
}
|
|
5786
5786
|
const saved = top.saved;
|
|
@@ -5799,7 +5799,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5799
5799
|
this.notify();
|
|
5800
5800
|
return { layerId: top.layerId, changed: false, layerIds: [] };
|
|
5801
5801
|
}
|
|
5802
|
-
const res =
|
|
5802
|
+
const res = _chunkCD7PLU77cjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
|
|
5803
5803
|
this.commitLayers(res.layers);
|
|
5804
5804
|
return { layerId: top.layerId, changed: true, layerIds: res.ids };
|
|
5805
5805
|
}
|
|
@@ -5814,35 +5814,35 @@ var ImageEditorController = (_class7 = class {
|
|
|
5814
5814
|
// --- Layer effects ---
|
|
5815
5815
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
5816
5816
|
getLayerEffects(id) {
|
|
5817
|
-
return
|
|
5817
|
+
return _chunkCD7PLU77cjs.layerEffectsOf.call(void 0, _chunkCD7PLU77cjs.requireLayer.call(void 0, this.state.layers, id).layer);
|
|
5818
5818
|
}
|
|
5819
5819
|
/**
|
|
5820
5820
|
* Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
|
|
5821
5821
|
* `index` in the layer's effect list (default the end). Returns the new effect and the effects.
|
|
5822
5822
|
*/
|
|
5823
5823
|
addLayerEffect(id, kind, params = {}, index) {
|
|
5824
|
-
const res =
|
|
5824
|
+
const res = _chunkCD7PLU77cjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
|
|
5825
5825
|
this.commitLayers(res.layers);
|
|
5826
5826
|
return { effect: res.effect, effects: this.getLayerEffects(id) };
|
|
5827
5827
|
}
|
|
5828
5828
|
/** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
|
|
5829
5829
|
updateLayerEffect(id, effectId, changes, commitToHistory = true) {
|
|
5830
|
-
this.commitLayers(
|
|
5830
|
+
this.commitLayers(_chunkCD7PLU77cjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
|
|
5831
5831
|
return this.getLayerEffects(id);
|
|
5832
5832
|
}
|
|
5833
5833
|
/** Removes one effect (one undo step). Returns the remaining effects. */
|
|
5834
5834
|
removeLayerEffect(id, effectId) {
|
|
5835
|
-
this.commitLayers(
|
|
5835
|
+
this.commitLayers(_chunkCD7PLU77cjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
|
|
5836
5836
|
return this.getLayerEffects(id);
|
|
5837
5837
|
}
|
|
5838
5838
|
/** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
|
|
5839
5839
|
setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
|
|
5840
|
-
this.commitLayers(
|
|
5840
|
+
this.commitLayers(_chunkCD7PLU77cjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
|
|
5841
5841
|
return this.getLayerEffects(id);
|
|
5842
5842
|
}
|
|
5843
5843
|
/** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
|
|
5844
5844
|
setLayerEffects(id, effects, commitToHistory = true) {
|
|
5845
|
-
this.commitLayers(
|
|
5845
|
+
this.commitLayers(_chunkCD7PLU77cjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
|
|
5846
5846
|
return this.getLayerEffects(id);
|
|
5847
5847
|
}
|
|
5848
5848
|
__init77() {this.patternIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -5868,8 +5868,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5868
5868
|
/** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
|
|
5869
5869
|
setGlobalLight(light, commitToHistory = true) {
|
|
5870
5870
|
const next = { ...this.getGlobalLight(), ...light };
|
|
5871
|
-
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0,
|
|
5872
|
-
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0,
|
|
5871
|
+
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
|
|
5872
|
+
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
|
|
5873
5873
|
if (commitToHistory) this.recordHistory();
|
|
5874
5874
|
if (next.angle === _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
|
|
5875
5875
|
else this.state.globalLight = next;
|
|
@@ -5880,16 +5880,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5880
5880
|
async compositeToSurface(layers, rect) {
|
|
5881
5881
|
const { width, height } = this.naturalSize;
|
|
5882
5882
|
if (_chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
|
|
5883
|
-
throw new (0,
|
|
5883
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
|
|
5884
5884
|
}
|
|
5885
5885
|
await this.renderer.prepareLayerAssets(layers, width, height);
|
|
5886
5886
|
const sources = this.renderer.compositorSources(width, height);
|
|
5887
5887
|
const depth = this.bitDepth;
|
|
5888
5888
|
if (depth !== 8) {
|
|
5889
|
-
const samples = _chunkHGTDMKNEcjs.workingToSamples.call(void 0,
|
|
5889
|
+
const samples = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkCD7PLU77cjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
|
|
5890
5890
|
return _chunkCWM3CUUXcjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
|
|
5891
5891
|
}
|
|
5892
|
-
const data = new (0,
|
|
5892
|
+
const data = new (0, _chunkCD7PLU77cjs.LayerCompositor)().composite(layers, rect, sources);
|
|
5893
5893
|
return _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
|
|
5894
5894
|
}
|
|
5895
5895
|
/**
|
|
@@ -5902,22 +5902,22 @@ var ImageEditorController = (_class7 = class {
|
|
|
5902
5902
|
const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
|
|
5903
5903
|
const depth = this.bitDepth;
|
|
5904
5904
|
if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkCWM3CUUXcjs.to16From8.call(void 0, this.compositePixels(r).data) };
|
|
5905
|
-
const data = _chunkHGTDMKNEcjs.workingToSamples.call(void 0,
|
|
5905
|
+
const data = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkCD7PLU77cjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
|
|
5906
5906
|
return { width: r.width, height: r.height, depth, data };
|
|
5907
5907
|
}
|
|
5908
5908
|
/** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
|
|
5909
5909
|
paintBounds(layer) {
|
|
5910
5910
|
const { width, height } = this.naturalSize;
|
|
5911
5911
|
const canvas = { x: 0, y: 0, width, height };
|
|
5912
|
-
if (
|
|
5912
|
+
if (_chunkCD7PLU77cjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
5913
5913
|
if (layer.type === "annotation") {
|
|
5914
|
-
const b =
|
|
5914
|
+
const b = _chunkCD7PLU77cjs.getAnnotationBounds.call(void 0, layer.annotation);
|
|
5915
5915
|
const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
|
|
5916
5916
|
return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
|
|
5917
5917
|
}
|
|
5918
5918
|
if (layer.type === "group") {
|
|
5919
5919
|
let r = null;
|
|
5920
|
-
for (const c of layer.children) r =
|
|
5920
|
+
for (const c of layer.children) r = _chunkCD7PLU77cjs.unionRect.call(void 0, r, this.paintBounds(c));
|
|
5921
5921
|
return _nullishCoalesce(r, () => ( canvas));
|
|
5922
5922
|
}
|
|
5923
5923
|
return canvas;
|
|
@@ -5928,16 +5928,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5928
5928
|
* Returns the merged id.
|
|
5929
5929
|
*/
|
|
5930
5930
|
async mergeDown(id) {
|
|
5931
|
-
const loc =
|
|
5931
|
+
const loc = _chunkCD7PLU77cjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5932
5932
|
const upper = loc.layer;
|
|
5933
5933
|
const siblings = loc.parent ? loc.parent.children : this.state.layers;
|
|
5934
5934
|
const lower = siblings[loc.index - 1];
|
|
5935
|
-
if (!lower) throw new (0,
|
|
5936
|
-
if (lower.type !== "pixel") throw new (0,
|
|
5937
|
-
if (!upper.visible) throw new (0,
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
let rect = _nullishCoalesce(
|
|
5935
|
+
if (!lower) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
|
|
5936
|
+
if (lower.type !== "pixel") throw new (0, _chunkCD7PLU77cjs.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.`);
|
|
5937
|
+
if (!upper.visible) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
|
|
5938
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, upper, "all", "merge it");
|
|
5939
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
|
|
5940
|
+
let rect = _nullishCoalesce(_chunkCD7PLU77cjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
|
|
5941
5941
|
const reach = Math.max(_chunkHGTDMKNEcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkHGTDMKNEcjs.effectsMargin.call(void 0, upper.effects));
|
|
5942
5942
|
if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
|
|
5943
5943
|
const base = { ...lower, blend: "normal", opacity: 1 };
|
|
@@ -5963,12 +5963,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
5963
5963
|
*/
|
|
5964
5964
|
async mergeVisible() {
|
|
5965
5965
|
const visible = this.state.layers.filter((l) => l.visible);
|
|
5966
|
-
if (!visible.length) throw new (0,
|
|
5966
|
+
if (!visible.length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("No layer is visible.");
|
|
5967
5967
|
const { width, height } = this.naturalSize;
|
|
5968
5968
|
const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
|
|
5969
5969
|
const merged = {
|
|
5970
5970
|
type: "pixel",
|
|
5971
|
-
id:
|
|
5971
|
+
id: _chunkCD7PLU77cjs.newLayerId.call(void 0, ),
|
|
5972
5972
|
name: "Merged",
|
|
5973
5973
|
visible: true,
|
|
5974
5974
|
opacity: 1,
|
|
@@ -5992,8 +5992,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5992
5992
|
const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
|
|
5993
5993
|
const bg = {
|
|
5994
5994
|
type: "pixel",
|
|
5995
|
-
id:
|
|
5996
|
-
name:
|
|
5995
|
+
id: _chunkCD7PLU77cjs.BACKGROUND_LAYER_ID,
|
|
5996
|
+
name: _chunkCD7PLU77cjs.BACKGROUND_LAYER_NAME,
|
|
5997
5997
|
visible: true,
|
|
5998
5998
|
opacity: 1,
|
|
5999
5999
|
blend: "normal",
|
|
@@ -6020,7 +6020,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6020
6020
|
const k = Math.min(1, side / Math.max(width, height));
|
|
6021
6021
|
const tw = Math.max(1, Math.round(width * k));
|
|
6022
6022
|
const th = Math.max(1, Math.round(height * k));
|
|
6023
|
-
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null :
|
|
6023
|
+
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkCD7PLU77cjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
|
|
6024
6024
|
if (!surface) return null;
|
|
6025
6025
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
6026
6026
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
@@ -6062,7 +6062,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6062
6062
|
/** Brush settings, colours and tool options of the paint tools (view state, no undo). */
|
|
6063
6063
|
setPaintOptions(options) {
|
|
6064
6064
|
const cur = this.state.paint;
|
|
6065
|
-
const retouch = options.retouch ?
|
|
6065
|
+
const retouch = options.retouch ? _chunk7NW46N7Icjs.normalizeRetouch.call(void 0, options.retouch, cur.retouch) : cur.retouch;
|
|
6066
6066
|
const cloneSource = cur.cloneSource && retouch.aligned !== cur.retouch.aligned ? { ...cur.cloneSource, offset: null } : cur.cloneSource;
|
|
6067
6067
|
let source = cur.paint;
|
|
6068
6068
|
let foreground = options.foreground !== void 0 ? toHex(parseColor(options.foreground)) : cur.foreground;
|
|
@@ -6073,11 +6073,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6073
6073
|
}
|
|
6074
6074
|
if (source.type === "color" || options.foreground !== void 0) source = { type: "color", color: foreground };
|
|
6075
6075
|
const next = {
|
|
6076
|
-
brush: options.brush ?
|
|
6076
|
+
brush: options.brush ? _chunkEBDCRTZIcjs.normalizeBrush.call(void 0, { ...cur.brush, ...options.brush }) : cur.brush,
|
|
6077
6077
|
foreground,
|
|
6078
6078
|
background: options.background !== void 0 ? toHex(parseColor(options.background)) : cur.background,
|
|
6079
6079
|
paint: source,
|
|
6080
|
-
mixer: options.mixer ?
|
|
6080
|
+
mixer: options.mixer ? _chunkEBDCRTZIcjs.normalizeMixer.call(void 0, { ...cur.mixer, ...options.mixer }) : cur.mixer,
|
|
6081
6081
|
mixerLoad: cur.mixerLoad,
|
|
6082
6082
|
retouch,
|
|
6083
6083
|
cloneSource,
|
|
@@ -6093,30 +6093,30 @@ var ImageEditorController = (_class7 = class {
|
|
|
6093
6093
|
*/
|
|
6094
6094
|
loadMixerBrush(color) {
|
|
6095
6095
|
const c = parseColor(_nullishCoalesce(color, () => ( this.state.paint.foreground)));
|
|
6096
|
-
const load =
|
|
6096
|
+
const load = _chunkEBDCRTZIcjs.loadMixer.call(void 0, this.state.paint.mixerLoad, [c[0] / 255, c[1] / 255, c[2] / 255]);
|
|
6097
6097
|
this.state.paint = { ...this.state.paint, mixerLoad: load };
|
|
6098
6098
|
this.notify();
|
|
6099
6099
|
return load;
|
|
6100
6100
|
}
|
|
6101
6101
|
/** Cleans the Mixer Brush: empties the pickup well (the reservoir is kept). Returns the brush load. */
|
|
6102
6102
|
cleanMixerBrush() {
|
|
6103
|
-
const load =
|
|
6103
|
+
const load = _chunkEBDCRTZIcjs.cleanMixer.call(void 0, this.state.paint.mixerLoad);
|
|
6104
6104
|
this.state.paint = { ...this.state.paint, mixerLoad: load };
|
|
6105
6105
|
this.notify();
|
|
6106
6106
|
return load;
|
|
6107
6107
|
}
|
|
6108
6108
|
/** Empties the Mixer Brush entirely (no reservoir, nothing picked up). Returns the brush load. */
|
|
6109
6109
|
emptyMixerBrush() {
|
|
6110
|
-
this.state.paint = { ...this.state.paint, mixerLoad:
|
|
6110
|
+
this.state.paint = { ...this.state.paint, mixerLoad: _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD };
|
|
6111
6111
|
this.notify();
|
|
6112
|
-
return
|
|
6112
|
+
return _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD;
|
|
6113
6113
|
}
|
|
6114
6114
|
/**
|
|
6115
6115
|
* Sets (Alt-click) or clears the Clone Stamp and Healing Brush source point, in document
|
|
6116
6116
|
* pixels. The next stroke fixes the offset from its first point. View state, no undo.
|
|
6117
6117
|
*/
|
|
6118
6118
|
setCloneSource(point) {
|
|
6119
|
-
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0,
|
|
6119
|
+
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
|
|
6120
6120
|
const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
|
|
6121
6121
|
this.state.paint = { ...this.state.paint, cloneSource: source };
|
|
6122
6122
|
this.notify();
|
|
@@ -6129,12 +6129,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
6129
6129
|
*/
|
|
6130
6130
|
setCloneTransform(t) {
|
|
6131
6131
|
const cur = this.state.paint.cloneTransform;
|
|
6132
|
-
const next = t ? { ...cur, ...t } : { ...
|
|
6132
|
+
const next = t ? { ...cur, ...t } : { ..._chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM };
|
|
6133
6133
|
for (const k of ["scaleX", "scaleY"]) {
|
|
6134
6134
|
const v = next[k];
|
|
6135
|
-
if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0,
|
|
6135
|
+
if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
|
|
6136
6136
|
}
|
|
6137
|
-
if (!Number.isFinite(next.rotate)) throw new (0,
|
|
6137
|
+
if (!Number.isFinite(next.rotate)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("rotate must be a number of degrees.");
|
|
6138
6138
|
next.rotate = ((next.rotate + 180) % 360 + 360) % 360 - 180;
|
|
6139
6139
|
this.state.paint = { ...this.state.paint, cloneTransform: next };
|
|
6140
6140
|
this.notify();
|
|
@@ -6152,28 +6152,28 @@ var ImageEditorController = (_class7 = class {
|
|
|
6152
6152
|
/** Resolves and validates what a stroke, fill or clear paints into. */
|
|
6153
6153
|
paintTarget(layerId, channel, action) {
|
|
6154
6154
|
const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
|
|
6155
|
-
if (!id) throw new (0,
|
|
6156
|
-
const layer =
|
|
6155
|
+
if (!id) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`, `Pick a layer to ${action} on in the Layers panel.`);
|
|
6156
|
+
const layer = _chunkCD7PLU77cjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
6157
6157
|
const name = layer.name || id;
|
|
6158
6158
|
const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
|
|
6159
6159
|
if (ch === "mask") {
|
|
6160
|
-
if (!layer.mask) throw new (0,
|
|
6161
|
-
if (layer.mask.source) throw new (0,
|
|
6162
|
-
|
|
6160
|
+
if (!layer.mask) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${name}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`, `Layer "${name}" has no mask; add a mask or ${action} on its pixels.`);
|
|
6161
|
+
if (layer.mask.source) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
|
|
6162
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6163
6163
|
} else if (ch === "filter-mask") {
|
|
6164
6164
|
if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
|
|
6165
|
-
throw new (0,
|
|
6165
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${name}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`, `Layer "${name}" has no smart filter mask to ${action}.`);
|
|
6166
6166
|
}
|
|
6167
|
-
if (!
|
|
6168
|
-
|
|
6167
|
+
if (!_chunkCD7PLU77cjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`The contents of "${name}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`, `The smart object "${name}" is still loading; try again in a moment.`);
|
|
6168
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6169
6169
|
} else {
|
|
6170
|
-
if (layer.type === "smart") throw new (0,
|
|
6171
|
-
if (layer.type === "shape") throw new (0,
|
|
6172
|
-
if (layer.type === "type") throw new (0,
|
|
6173
|
-
if (layer.type !== "pixel") throw new (0,
|
|
6174
|
-
|
|
6170
|
+
if (layer.type === "smart") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${name}" 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.`, `"${name}" is a smart object; rasterize it or edit its contents to ${action} on it.`);
|
|
6171
|
+
if (layer.type === "shape") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${name}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a shape layer; rasterize it to ${action} on it.`);
|
|
6172
|
+
if (layer.type === "type") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${name}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a type layer; rasterize it to ${action} on it.`);
|
|
6173
|
+
if (layer.type !== "pixel") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${name}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`, `"${name}" is not a pixel layer; pick a pixel layer to ${action} on.`);
|
|
6174
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "pixels", action);
|
|
6175
6175
|
}
|
|
6176
|
-
if (!layer.visible) throw new (0,
|
|
6176
|
+
if (!layer.visible) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
|
|
6177
6177
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
6178
6178
|
const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
|
|
6179
6179
|
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
|
|
@@ -6182,7 +6182,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6182
6182
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
6183
6183
|
withSurface(layer, channel, surface) {
|
|
6184
6184
|
if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
|
|
6185
|
-
if (channel === "filter-mask") return
|
|
6185
|
+
if (channel === "filter-mask") return _chunkCD7PLU77cjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
|
|
6186
6186
|
const next = { ...layer, surface };
|
|
6187
6187
|
delete next.source;
|
|
6188
6188
|
return next;
|
|
@@ -6195,12 +6195,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
6195
6195
|
*/
|
|
6196
6196
|
beginStroke(init = {}) {
|
|
6197
6197
|
const tool = _nullishCoalesce(init.tool, () => ( "brush"));
|
|
6198
|
-
if (!STROKE_TOOLS.includes(tool)) throw new (0,
|
|
6198
|
+
if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
|
|
6199
6199
|
const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
|
|
6200
6200
|
if (tool === "mixer" && target.channel !== "pixels") {
|
|
6201
|
-
throw new (0,
|
|
6201
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.", "The Mixer Brush paints on pixels, not masks; target the layer's pixels, or paint the mask with the Brush.");
|
|
6202
6202
|
}
|
|
6203
|
-
const brush =
|
|
6203
|
+
const brush = _chunkEBDCRTZIcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
|
|
6204
6204
|
let strokePaint = null;
|
|
6205
6205
|
if (init.paint !== void 0) {
|
|
6206
6206
|
strokePaint = readImagePaint(init.paint);
|
|
@@ -6225,16 +6225,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
6225
6225
|
const depth = target.channel !== "filter-mask" && this.bitDepth !== 8 ? this.bitDepth : null;
|
|
6226
6226
|
if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply, depth);
|
|
6227
6227
|
if (isRetouchTool(tool)) return new PaintStrokeSession(this, target, this.retouchStroke(tool, init, brush, target, apply), apply, depth);
|
|
6228
|
-
const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _231 => _231.type]) === "gradient" ?
|
|
6229
|
-
return new PaintStrokeSession(this, target, new (0,
|
|
6228
|
+
const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _231 => _231.type]) === "gradient" ? _chunkEBDCRTZIcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
|
|
6229
|
+
return new PaintStrokeSession(this, target, new (0, _chunkEBDCRTZIcjs.StrokeCoverage)(brush, gradient, _nullishCoalesce(init.seed, () => ( 0))), apply, depth);
|
|
6230
6230
|
}
|
|
6231
6231
|
/** A retouching stroke's start: its settings, what it samples and how it composites. */
|
|
6232
6232
|
retouchStroke(tool, init, brush, target, apply) {
|
|
6233
|
-
const settings =
|
|
6233
|
+
const settings = _chunk7NW46N7Icjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
|
|
6234
6234
|
const mask = target.channel !== "pixels";
|
|
6235
|
-
if (tool === "sponge" && mask) throw new (0,
|
|
6236
|
-
if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0,
|
|
6237
|
-
if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0,
|
|
6235
|
+
if (tool === "sponge" && mask) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
|
|
6236
|
+
if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunk7NW46N7Icjs.RetouchDabStroke)(brush, pixels, _chunk7NW46N7Icjs.smudgeEffect.call(void 0, brush, settings.strength)) };
|
|
6237
|
+
if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunk7NW46N7Icjs.RetouchDabStroke)(brush, pixels, _chunk7NW46N7Icjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
|
|
6238
6238
|
const retouchApply = {
|
|
6239
6239
|
opacity: tool === "clone" || tool === "heal" || tool === "history" ? brush.opacity : tool === "blur" || tool === "sharpen" ? brush.opacity * settings.strength : 1,
|
|
6240
6240
|
blend: tool === "clone" && !mask ? brush.blend : "normal",
|
|
@@ -6242,9 +6242,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6242
6242
|
selection: apply.selection,
|
|
6243
6243
|
offset: target.offset
|
|
6244
6244
|
};
|
|
6245
|
-
const coverage = new (0,
|
|
6245
|
+
const coverage = new (0, _chunkEBDCRTZIcjs.StrokeCoverage)(brush);
|
|
6246
6246
|
if (tool === "dodge" || tool === "burn") {
|
|
6247
|
-
const paint2 = { kind: "tone", tone:
|
|
6247
|
+
const paint2 = { kind: "tone", tone: _chunk7NW46N7Icjs.toneOf.call(void 0, tool, settings) };
|
|
6248
6248
|
return { kind: "coverage", coverage, apply: retouchApply, start: () => {
|
|
6249
6249
|
}, paint: () => paint2 };
|
|
6250
6250
|
}
|
|
@@ -6252,11 +6252,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6252
6252
|
const n = target.surface.channels;
|
|
6253
6253
|
const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
|
|
6254
6254
|
const m = 6;
|
|
6255
|
-
const filtered = new (0,
|
|
6255
|
+
const filtered = new (0, _chunk7NW46N7Icjs.TilePixelSource)(
|
|
6256
6256
|
(tx, ty) => {
|
|
6257
6257
|
const r = { x: tx * _chunkCWM3CUUXcjs.TILE - m, y: ty * _chunkCWM3CUUXcjs.TILE - m, width: _chunkCWM3CUUXcjs.TILE + 2 * m, height: _chunkCWM3CUUXcjs.TILE + 2 * m };
|
|
6258
6258
|
const d = workRegionOf(target.surface, r, depth);
|
|
6259
|
-
|
|
6259
|
+
_chunk7NW46N7Icjs.retouchFilter.call(void 0, d, r.width, r.height, n, tool, 2, 1.2);
|
|
6260
6260
|
const out = new Float32Array(_chunkCWM3CUUXcjs.TILE * _chunkCWM3CUUXcjs.TILE * n);
|
|
6261
6261
|
for (let y = 0; y < _chunkCWM3CUUXcjs.TILE; y++) out.set(d.subarray(((y + m) * r.width + m) * n, ((y + m) * r.width + m + _chunkCWM3CUUXcjs.TILE) * n), y * _chunkCWM3CUUXcjs.TILE * n);
|
|
6262
6262
|
return out;
|
|
@@ -6271,21 +6271,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
6271
6271
|
if (tool === "history") {
|
|
6272
6272
|
const steps = settings.historySteps;
|
|
6273
6273
|
const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
|
|
6274
|
-
if (!entry) throw new (0,
|
|
6274
|
+
if (!entry) throw new (0, _chunkCD7PLU77cjs.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.");
|
|
6275
6275
|
const then = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _232 => _232.layer]);
|
|
6276
|
-
if (!then) throw new (0,
|
|
6276
|
+
if (!then) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
|
|
6277
6277
|
const surface = target.channel === "mask" ? _optionalChain([then, 'access', _233 => _233.mask, 'optionalAccess', _234 => _234.surface]) : then.type === "pixel" ? then.surface : void 0;
|
|
6278
|
-
if (!surface) throw new (0,
|
|
6278
|
+
if (!surface) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
|
|
6279
6279
|
const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
|
|
6280
6280
|
const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
|
|
6281
|
-
const source2 = depth ? new (0,
|
|
6281
|
+
const source2 = depth ? new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
|
|
6282
6282
|
const paint2 = { kind: "source", source: source2, dx: 0, dy: 0 };
|
|
6283
6283
|
return { kind: "coverage", coverage, apply: retouchApply, start: () => {
|
|
6284
6284
|
}, paint: () => paint2 };
|
|
6285
6285
|
}
|
|
6286
6286
|
const sample = mask ? "current" : settings.sample;
|
|
6287
6287
|
const deep = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
|
|
6288
|
-
const own = deep ? new (0,
|
|
6288
|
+
const own = deep ? new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => workTileOf(target.surface.tiles.get(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty))), 4, target.offset) : this.surfaceSource(target.surface, target.offset);
|
|
6289
6289
|
const source = sample === "current" ? own : this.compositeSource(sample === "all" ? null : target.id, deep);
|
|
6290
6290
|
const pad = (r, m) => ({ x: r.x - m, y: r.y - m, width: r.width + 2 * m, height: r.height + 2 * m });
|
|
6291
6291
|
const covered = (cov, r) => {
|
|
@@ -6306,25 +6306,25 @@ var ImageEditorController = (_class7 = class {
|
|
|
6306
6306
|
paint: () => trail,
|
|
6307
6307
|
finalPaint: (cov) => {
|
|
6308
6308
|
if (!cov.bounds) return null;
|
|
6309
|
-
const win =
|
|
6309
|
+
const win = _chunk7NW46N7Icjs.spotHealWindow.call(void 0, cov.bounds, { width, height });
|
|
6310
6310
|
if (win.width <= 0 || win.height <= 0) return null;
|
|
6311
|
-
const img =
|
|
6311
|
+
const img = _chunk7NW46N7Icjs.readSourceRegion.call(void 0, source, win);
|
|
6312
6312
|
const hole = covered(cov, win);
|
|
6313
|
-
const healed =
|
|
6313
|
+
const healed = _chunk7NW46N7Icjs.spotHealPixels.call(void 0, win.width, win.height, img, hole, brush.size, settings.spotType, (off) => {
|
|
6314
6314
|
patch = off ? { x: off[0], y: off[1] } : null;
|
|
6315
6315
|
});
|
|
6316
|
-
return { kind: "source", source: new (0,
|
|
6316
|
+
return { kind: "source", source: new (0, _chunk7NW46N7Icjs.RegionPixelSource)(win, healed), dx: 0, dy: 0 };
|
|
6317
6317
|
},
|
|
6318
6318
|
result: () => ({ spotHeal: { offset: patch } })
|
|
6319
6319
|
};
|
|
6320
6320
|
}
|
|
6321
6321
|
if (init.source) this.setCloneSource(init.source);
|
|
6322
6322
|
const cs = this.state.paint.cloneSource;
|
|
6323
|
-
if (!cs) throw new (0,
|
|
6323
|
+
if (!cs) throw new (0, _chunkCD7PLU77cjs.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 }.`);
|
|
6324
6324
|
let offset = { x: 0, y: 0 };
|
|
6325
6325
|
let first = { x: 0, y: 0 };
|
|
6326
6326
|
const xf = this.state.paint.cloneTransform;
|
|
6327
|
-
const transformed =
|
|
6327
|
+
const transformed = _chunk7NW46N7Icjs.isIdentityCloneTransform.call(void 0, xf) ? null : new (0, _chunk7NW46N7Icjs.TransformedPixelSource)(source, (x, y) => _chunk7NW46N7Icjs.cloneSamplePoint.call(void 0, xf, cs, { x: cs.x - offset.x, y: cs.y - offset.y }, x, y));
|
|
6328
6328
|
const paint = () => transformed ? { kind: "source", source: transformed, dx: 0, dy: 0 } : { kind: "source", source, dx: offset.x, dy: offset.y };
|
|
6329
6329
|
return {
|
|
6330
6330
|
kind: "coverage",
|
|
@@ -6339,16 +6339,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
6339
6339
|
finalPaint: tool === "heal" ? (cov) => {
|
|
6340
6340
|
if (!cov.bounds) return null;
|
|
6341
6341
|
const g = pad(cov.bounds, 2);
|
|
6342
|
-
const src = transformed ?
|
|
6343
|
-
const dst =
|
|
6344
|
-
return { kind: "source", source: new (0,
|
|
6342
|
+
const src = transformed ? _chunk7NW46N7Icjs.readSourceRegion.call(void 0, transformed, g) : _chunk7NW46N7Icjs.readSourceRegion.call(void 0, source, g, offset.x, offset.y);
|
|
6343
|
+
const dst = _chunk7NW46N7Icjs.readSourceRegion.call(void 0, source, g);
|
|
6344
|
+
return { kind: "source", source: new (0, _chunk7NW46N7Icjs.RegionPixelSource)(g, _chunk7NW46N7Icjs.healPixels.call(void 0, g.width, g.height, src, dst, covered(cov, g))), dx: 0, dy: 0 };
|
|
6345
6345
|
} : void 0,
|
|
6346
6346
|
result: () => ({ clone: { offset: { ...offset }, source: { x: first.x + offset.x, y: first.y + offset.y }, aligned: settings.aligned } })
|
|
6347
6347
|
};
|
|
6348
6348
|
}
|
|
6349
6349
|
/** A pixel source over a surface (layer pixels or a mask) in layer space at `offset`. */
|
|
6350
6350
|
surfaceSource(surface, offset) {
|
|
6351
|
-
return new (0,
|
|
6351
|
+
return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _235 => _235.tiles, 'access', _236 => _236.get, 'call', _237 => _237(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _238 => _238.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
|
|
6352
6352
|
}
|
|
6353
6353
|
/** A pixel source over the composite of the current layers (through `throughId` and below, or all of them), as it is now. */
|
|
6354
6354
|
compositeSource(throughId, depth = null) {
|
|
@@ -6356,8 +6356,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6356
6356
|
const layers = throughId ? layersThrough(stack, throughId) : stack;
|
|
6357
6357
|
const sources = this.compositorSources();
|
|
6358
6358
|
if (depth) {
|
|
6359
|
-
return new (0,
|
|
6360
|
-
const w =
|
|
6359
|
+
return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => {
|
|
6360
|
+
const w = _chunkCD7PLU77cjs.compositeDeep.call(void 0, layers, { x: tx * _chunkCWM3CUUXcjs.TILE, y: ty * _chunkCWM3CUUXcjs.TILE, width: _chunkCWM3CUUXcjs.TILE, height: _chunkCWM3CUUXcjs.TILE }, sources, depth);
|
|
6361
6361
|
for (let i = 0; i < w.length; i += 4) {
|
|
6362
6362
|
if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkCWM3CUUXcjs.srgbEncode.call(void 0, w[i + c]);
|
|
6363
6363
|
for (let c = 0; c < 4; c++) w[i + c] *= 255;
|
|
@@ -6365,21 +6365,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
6365
6365
|
return w;
|
|
6366
6366
|
}, 4);
|
|
6367
6367
|
}
|
|
6368
|
-
const compositor = new (0,
|
|
6369
|
-
return new (0,
|
|
6368
|
+
const compositor = new (0, _chunkCD7PLU77cjs.LayerCompositor)();
|
|
6369
|
+
return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
|
|
6370
6370
|
}
|
|
6371
6371
|
/** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
|
|
6372
6372
|
mixerStroke(init, brush) {
|
|
6373
|
-
const settings =
|
|
6373
|
+
const settings = _chunkEBDCRTZIcjs.normalizeMixer.call(void 0, { ...this.state.paint.mixer, ..._nullishCoalesce(init.mixer, () => ( {})) });
|
|
6374
6374
|
let load = this.state.paint.mixerLoad;
|
|
6375
6375
|
if (init.color !== void 0 || settings.loadEachStroke) {
|
|
6376
6376
|
const c = parseColor(_nullishCoalesce(init.color, () => ( this.state.paint.foreground)));
|
|
6377
|
-
load =
|
|
6377
|
+
load = _chunkEBDCRTZIcjs.loadMixer.call(void 0, load, [c[0] / 255, c[1] / 255, c[2] / 255]);
|
|
6378
6378
|
}
|
|
6379
6379
|
return {
|
|
6380
|
-
create: (pixels) => new (0,
|
|
6380
|
+
create: (pixels) => new (0, _chunkEBDCRTZIcjs.MixerStroke)(brush, settings, load, pixels),
|
|
6381
6381
|
end: (after) => {
|
|
6382
|
-
const next = settings.cleanEachStroke ?
|
|
6382
|
+
const next = settings.cleanEachStroke ? _chunkEBDCRTZIcjs.cleanMixer.call(void 0, after) : after;
|
|
6383
6383
|
this.state.paint = { ...this.state.paint, mixerLoad: next };
|
|
6384
6384
|
return next;
|
|
6385
6385
|
}
|
|
@@ -6415,9 +6415,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6415
6415
|
* document bounds and the number of dabs.
|
|
6416
6416
|
*/
|
|
6417
6417
|
paintStroke(init) {
|
|
6418
|
-
if (!Array.isArray(init.points) || !init.points.length) throw new (0,
|
|
6418
|
+
if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("points must hold at least one { x, y } point.");
|
|
6419
6419
|
for (const p of init.points) {
|
|
6420
|
-
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0,
|
|
6420
|
+
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
|
|
6421
6421
|
}
|
|
6422
6422
|
const session = this.beginStroke(init);
|
|
6423
6423
|
session.push(init.points);
|
|
@@ -6443,11 +6443,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6443
6443
|
const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
|
|
6444
6444
|
const { width, height } = this.naturalSize;
|
|
6445
6445
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
6446
|
-
if (!(opacity >= 0 && opacity <= 1)) throw new (0,
|
|
6447
|
-
const blend = _nullishCoalesce(
|
|
6446
|
+
if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
6447
|
+
const blend = _nullishCoalesce(_chunkCD7PLU77cjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
|
|
6448
6448
|
const sel = options.useSelection !== false && _optionalChain([this, 'access', _241 => _241.state, 'access', _242 => _242.selection, 'optionalAccess', _243 => _243.bounds]) ? this.state.selection : null;
|
|
6449
6449
|
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _244 => _244.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
6450
|
-
const coverage = new (0,
|
|
6450
|
+
const coverage = new (0, _chunkEBDCRTZIcjs.CoverageMap)();
|
|
6451
6451
|
const ones = new Float32Array(region.width * region.height);
|
|
6452
6452
|
if (sel) {
|
|
6453
6453
|
for (let y = 0; y < region.height; y++) {
|
|
@@ -6480,7 +6480,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6480
6480
|
// --- Adjustments ---
|
|
6481
6481
|
/** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
|
|
6482
6482
|
developLayer() {
|
|
6483
|
-
return
|
|
6483
|
+
return _chunkCD7PLU77cjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
|
|
6484
6484
|
}
|
|
6485
6485
|
/**
|
|
6486
6486
|
* Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
|
|
@@ -6506,7 +6506,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6506
6506
|
this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
|
|
6507
6507
|
}
|
|
6508
6508
|
if ("layers" in partial) {
|
|
6509
|
-
layers = this.replaceAdjustmentNodes(layers,
|
|
6509
|
+
layers = this.replaceAdjustmentNodes(layers, _chunkCD7PLU77cjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
|
|
6510
6510
|
}
|
|
6511
6511
|
this.state.layers = layers;
|
|
6512
6512
|
this.notify();
|
|
@@ -6514,7 +6514,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6514
6514
|
/** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
|
|
6515
6515
|
get isProcessOutdated() {
|
|
6516
6516
|
this.syncViews();
|
|
6517
|
-
return
|
|
6517
|
+
return _chunkCD7PLU77cjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkCD7PLU77cjs.LATEST_PROCESS_VERSION;
|
|
6518
6518
|
}
|
|
6519
6519
|
/**
|
|
6520
6520
|
* Update to Current Process: re-interprets the current adjustment values with the latest
|
|
@@ -6522,7 +6522,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6522
6522
|
*/
|
|
6523
6523
|
upgradeProcess() {
|
|
6524
6524
|
if (!this.isProcessOutdated) return false;
|
|
6525
|
-
this.setAdjustments({ process:
|
|
6525
|
+
this.setAdjustments({ process: _chunkCD7PLU77cjs.LATEST_PROCESS_VERSION });
|
|
6526
6526
|
return true;
|
|
6527
6527
|
}
|
|
6528
6528
|
/** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
|
|
@@ -6533,7 +6533,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6533
6533
|
this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0,
|
|
6534
6534
|
this.state.layers,
|
|
6535
6535
|
target.id,
|
|
6536
|
-
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process:
|
|
6536
|
+
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkCD7PLU77cjs.LATEST_PROCESS_VERSION }), 0)
|
|
6537
6537
|
);
|
|
6538
6538
|
}
|
|
6539
6539
|
delete this.state.legacyOutputBlur;
|
|
@@ -6597,7 +6597,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6597
6597
|
const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
|
|
6598
6598
|
for (const l of next) {
|
|
6599
6599
|
if (existing.has(l.id)) continue;
|
|
6600
|
-
out = this.placeLayer(out,
|
|
6600
|
+
out = this.placeLayer(out, _chunkCD7PLU77cjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
|
|
6601
6601
|
}
|
|
6602
6602
|
const order = next.map((l) => l.id);
|
|
6603
6603
|
for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
|
|
@@ -6612,7 +6612,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6612
6612
|
addAdjustmentLayer(init, index) {
|
|
6613
6613
|
const spec = typeof init === "string" ? { kind: init } : init;
|
|
6614
6614
|
const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
6615
|
-
const layer =
|
|
6615
|
+
const layer = _chunkCD7PLU77cjs.createAdjustmentLayer.call(void 0, spec.kind, {
|
|
6616
6616
|
id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
|
|
6617
6617
|
name: spec.name,
|
|
6618
6618
|
params: spec.params,
|
|
@@ -6621,10 +6621,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6621
6621
|
blend: spec.blend,
|
|
6622
6622
|
mask: _nullishCoalesce(spec.mask, () => ( void 0))
|
|
6623
6623
|
});
|
|
6624
|
-
while (ids.has(layer.id)) layer.id =
|
|
6624
|
+
while (ids.has(layer.id)) layer.id = _chunkCD7PLU77cjs.newLayerId.call(void 0, "adj");
|
|
6625
6625
|
const { width, height } = this.naturalSize;
|
|
6626
6626
|
this.recordHistory();
|
|
6627
|
-
const node =
|
|
6627
|
+
const node = _chunkCD7PLU77cjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
|
|
6628
6628
|
const positioned = Boolean(spec.aboveId || spec.parentId);
|
|
6629
6629
|
this.state.layers = this.placeLayer(this.state.layers, node, {
|
|
6630
6630
|
aboveId: spec.aboveId,
|
|
@@ -6644,7 +6644,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6644
6644
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
6645
6645
|
const { width, height } = this.naturalSize;
|
|
6646
6646
|
const node = loc.layer;
|
|
6647
|
-
const merged =
|
|
6647
|
+
const merged = _chunkCD7PLU77cjs.normalizeAdjustmentLayer.call(void 0, {
|
|
6648
6648
|
id: node.id,
|
|
6649
6649
|
kind: node.kind,
|
|
6650
6650
|
enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
|
|
@@ -6664,7 +6664,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6664
6664
|
params: merged.params
|
|
6665
6665
|
};
|
|
6666
6666
|
if (update.mask !== void 0) {
|
|
6667
|
-
const mask = update.mask ?
|
|
6667
|
+
const mask = update.mask ? _chunkCD7PLU77cjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
|
|
6668
6668
|
if (mask) next.mask = mask;
|
|
6669
6669
|
else delete next.mask;
|
|
6670
6670
|
}
|
|
@@ -6680,7 +6680,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6680
6680
|
const prev = this.state.layers;
|
|
6681
6681
|
this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, prev, id, () => null);
|
|
6682
6682
|
if (this.state.activeLayerId === id) {
|
|
6683
|
-
this.state.activeLayerId =
|
|
6683
|
+
this.state.activeLayerId = _chunkCD7PLU77cjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, id);
|
|
6684
6684
|
this.state.activeTarget = "pixels";
|
|
6685
6685
|
}
|
|
6686
6686
|
this.notify();
|
|
@@ -6726,7 +6726,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6726
6726
|
this.state.layers = layers;
|
|
6727
6727
|
const active = this.state.activeLayerId;
|
|
6728
6728
|
if (active && nodes.some((n) => n.id === active)) {
|
|
6729
|
-
this.state.activeLayerId =
|
|
6729
|
+
this.state.activeLayerId = _chunkCD7PLU77cjs.activeLayerAfterRemoval.call(void 0, prev, layers, active);
|
|
6730
6730
|
this.state.activeTarget = "pixels";
|
|
6731
6731
|
}
|
|
6732
6732
|
this.notify();
|
|
@@ -6760,8 +6760,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6760
6760
|
const { width, height } = this.naturalSize;
|
|
6761
6761
|
let next = null;
|
|
6762
6762
|
if (mask) {
|
|
6763
|
-
const sized = mask.width === width && mask.height === height ? mask :
|
|
6764
|
-
next =
|
|
6763
|
+
const sized = mask.width === width && mask.height === height ? mask : _chunkCD7PLU77cjs.resizeSelection.call(void 0, mask, width, height);
|
|
6764
|
+
next = _chunkCD7PLU77cjs.combineSelections.call(void 0, this.state.selection, sized, mode);
|
|
6765
6765
|
} else if (mode !== "replace") {
|
|
6766
6766
|
return false;
|
|
6767
6767
|
}
|
|
@@ -6775,7 +6775,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6775
6775
|
/** Select › All. */
|
|
6776
6776
|
selectAll() {
|
|
6777
6777
|
const { width, height } = this.naturalSize;
|
|
6778
|
-
return this.setSelection(
|
|
6778
|
+
return this.setSelection(_chunkCD7PLU77cjs.fullSelection.call(void 0, width, height));
|
|
6779
6779
|
}
|
|
6780
6780
|
/** Select › Deselect. */
|
|
6781
6781
|
deselect() {
|
|
@@ -6784,11 +6784,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6784
6784
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
6785
6785
|
invertSelection() {
|
|
6786
6786
|
const { width, height } = this.naturalSize;
|
|
6787
|
-
const current = _nullishCoalesce(this.state.selection, () => (
|
|
6788
|
-
return this.setSelection(
|
|
6787
|
+
const current = _nullishCoalesce(this.state.selection, () => ( _chunkCD7PLU77cjs.createSelectionMask.call(void 0, width, height)));
|
|
6788
|
+
return this.setSelection(_chunkCD7PLU77cjs.invertSelection.call(void 0, current));
|
|
6789
6789
|
}
|
|
6790
6790
|
shapeCommand(mask, options) {
|
|
6791
|
-
const shaped = options.feather && options.feather > 0 ?
|
|
6791
|
+
const shaped = options.feather && options.feather > 0 ? _chunkCD7PLU77cjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
|
|
6792
6792
|
return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6793
6793
|
}
|
|
6794
6794
|
/** Rectangular marquee in natural image pixels. */
|
|
@@ -6842,11 +6842,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6842
6842
|
if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
|
|
6843
6843
|
return null;
|
|
6844
6844
|
}
|
|
6845
|
-
const legacy =
|
|
6845
|
+
const legacy = _chunkCD7PLU77cjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
|
|
6846
6846
|
if (options.sample === "active-layer") {
|
|
6847
6847
|
const layer = this.getActiveLayer();
|
|
6848
6848
|
if (!layer || layer.type !== "pixel") {
|
|
6849
|
-
throw new (0,
|
|
6849
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
|
|
6850
6850
|
}
|
|
6851
6851
|
const surface = layer.source === "document" && options.pixels ? _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
|
|
6852
6852
|
return { width, height, data: _chunkCWM3CUUXcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
|
|
@@ -6855,7 +6855,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6855
6855
|
this.syncViews();
|
|
6856
6856
|
if (legacy && !options.pixels) {
|
|
6857
6857
|
const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
|
|
6858
|
-
|
|
6858
|
+
_chunkCD7PLU77cjs.applyAdjustments.call(void 0, copy, _chunkCD7PLU77cjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
|
|
6859
6859
|
return copy;
|
|
6860
6860
|
}
|
|
6861
6861
|
const pixels = options.pixels;
|
|
@@ -6867,7 +6867,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6867
6867
|
};
|
|
6868
6868
|
const stack = withoutAnnotations(this.state.layers);
|
|
6869
6869
|
const layers = options.sampleMerged ? stack : pixelsOnly(stack);
|
|
6870
|
-
const data = new (0,
|
|
6870
|
+
const data = new (0, _chunkCD7PLU77cjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
|
|
6871
6871
|
return { width, height, data };
|
|
6872
6872
|
}
|
|
6873
6873
|
async requirePixels(options) {
|
|
@@ -6894,7 +6894,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6894
6894
|
modifySelection(op, radius) {
|
|
6895
6895
|
const sel = this.state.selection;
|
|
6896
6896
|
if (!_optionalChain([sel, 'optionalAccess', _258 => _258.bounds])) return false;
|
|
6897
|
-
return this.setSelection(
|
|
6897
|
+
return this.setSelection(_chunkCD7PLU77cjs.modifySelection.call(void 0, sel, op, radius));
|
|
6898
6898
|
}
|
|
6899
6899
|
/**
|
|
6900
6900
|
* Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
|
|
@@ -6925,7 +6925,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6925
6925
|
} else {
|
|
6926
6926
|
pixels = source;
|
|
6927
6927
|
}
|
|
6928
|
-
this.setSelection(
|
|
6928
|
+
this.setSelection(_chunkCD7PLU77cjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6929
6929
|
return this.getSelection();
|
|
6930
6930
|
}
|
|
6931
6931
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
@@ -6937,7 +6937,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6937
6937
|
// --- Layer masks ---
|
|
6938
6938
|
maskFromSelection(sel, props = {}) {
|
|
6939
6939
|
const { width, height } = this.naturalSize;
|
|
6940
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
6940
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkCD7PLU77cjs.resizeSelection.call(void 0, sel, width, height);
|
|
6941
6941
|
const mask = { surface: _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
|
|
6942
6942
|
return withMaskProps(mask, props);
|
|
6943
6943
|
}
|
|
@@ -6983,7 +6983,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6983
6983
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
6984
6984
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
6985
6985
|
const data = _chunkCWM3CUUXcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
6986
|
-
const sel =
|
|
6986
|
+
const sel = _chunkCD7PLU77cjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
6987
6987
|
return this.setSelection(sel, mode);
|
|
6988
6988
|
}
|
|
6989
6989
|
// --- Histogram ---
|
|
@@ -7013,9 +7013,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
7013
7013
|
merged.depthRange = [...merged.depthRange];
|
|
7014
7014
|
this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
7015
7015
|
const next = { ...l };
|
|
7016
|
-
if (
|
|
7016
|
+
if (_chunkCD7PLU77cjs.isDefaultDepthMask.call(void 0, merged)) {
|
|
7017
7017
|
if (_optionalChain([next, 'access', _264 => _264.mask, 'optionalAccess', _265 => _265.source])) delete next.mask;
|
|
7018
|
-
} else next.mask =
|
|
7018
|
+
} else next.mask = _chunkCD7PLU77cjs.depthRasterMask.call(void 0, merged);
|
|
7019
7019
|
return next;
|
|
7020
7020
|
});
|
|
7021
7021
|
}
|
|
@@ -7036,7 +7036,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7036
7036
|
// --- Annotations & Layers ---
|
|
7037
7037
|
/** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
|
|
7038
7038
|
annotationLayer(id) {
|
|
7039
|
-
return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([
|
|
7039
|
+
return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkCD7PLU77cjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
|
|
7040
7040
|
}
|
|
7041
7041
|
/** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
|
|
7042
7042
|
annotationEnv() {
|
|
@@ -7052,7 +7052,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7052
7052
|
this.recordHistory();
|
|
7053
7053
|
const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
|
|
7054
7054
|
const fullAnnotation = { ...annotation, id };
|
|
7055
|
-
const layer =
|
|
7055
|
+
const layer = _chunkCD7PLU77cjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
|
|
7056
7056
|
const loc = placement.aboveId ? _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
7057
7057
|
this.state.layers = loc ? _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _269 => _269.parent, 'optionalAccess', _270 => _270.id]), () => ( null)), loc.index + 1) : _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
|
|
7058
7058
|
this.state.selectedAnnotationId = id;
|
|
@@ -7064,17 +7064,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
7064
7064
|
this.recordHistory();
|
|
7065
7065
|
}
|
|
7066
7066
|
const layer = this.annotationLayer(id);
|
|
7067
|
-
const current = layer ?
|
|
7067
|
+
const current = layer ? _chunkCD7PLU77cjs.annotationOfLayer.call(void 0, layer) : null;
|
|
7068
7068
|
if (layer && current) {
|
|
7069
7069
|
const annotation = { ...current, ...partial, id };
|
|
7070
|
-
const name = layer.name ===
|
|
7070
|
+
const name = layer.name === _chunkCD7PLU77cjs.annotationLayerName.call(void 0, current) ? _chunkCD7PLU77cjs.annotationLayerName.call(void 0, annotation) : layer.name;
|
|
7071
7071
|
this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
|
|
7072
7072
|
}
|
|
7073
7073
|
this.notify();
|
|
7074
7074
|
}
|
|
7075
7075
|
/** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
|
|
7076
7076
|
layerForAnnotation(layer, annotation, name) {
|
|
7077
|
-
const fresh =
|
|
7077
|
+
const fresh = _chunkCD7PLU77cjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
|
|
7078
7078
|
const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
|
|
7079
7079
|
for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
7080
7080
|
if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
|
|
@@ -7162,7 +7162,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7162
7162
|
const cs = s.paint.cloneSource;
|
|
7163
7163
|
if (!cs) return null;
|
|
7164
7164
|
if (cursor && cs.offset && s.paint.retouch.aligned) {
|
|
7165
|
-
const [x, y] =
|
|
7165
|
+
const [x, y] = _chunk7NW46N7Icjs.cloneSamplePoint.call(void 0, s.paint.cloneTransform, cs, { x: cs.x - cs.offset.x, y: cs.y - cs.offset.y }, cursor.x, cursor.y);
|
|
7166
7166
|
return { x, y };
|
|
7167
7167
|
}
|
|
7168
7168
|
return { x: cs.x, y: cs.y };
|
|
@@ -7361,8 +7361,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7361
7361
|
return;
|
|
7362
7362
|
}
|
|
7363
7363
|
const target = this.developLayer();
|
|
7364
|
-
if (!target) throw new (0,
|
|
7365
|
-
|
|
7364
|
+
if (!target) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("There is no pixel layer to mask.");
|
|
7365
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, target, "all", "mask it");
|
|
7366
7366
|
const { width, height } = this.naturalSize;
|
|
7367
7367
|
let px2 = await this.decodeImage(newDataUrl);
|
|
7368
7368
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
@@ -7370,14 +7370,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7370
7370
|
for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
|
|
7371
7371
|
let surface = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
|
|
7372
7372
|
if (target.offset.x || target.offset.y) surface = _chunkCWM3CUUXcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
|
|
7373
|
-
this.commitLayers(
|
|
7373
|
+
this.commitLayers(_chunkCD7PLU77cjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
|
|
7374
7374
|
return target.id;
|
|
7375
7375
|
}
|
|
7376
7376
|
// --- Type layers ---
|
|
7377
7377
|
|
|
7378
7378
|
/** The shaper that lays out and draws type layers (`null` when there is none here). */
|
|
7379
7379
|
getTextShaper() {
|
|
7380
|
-
if (this.textShaperValue === void 0) this.textShaperValue =
|
|
7380
|
+
if (this.textShaperValue === void 0) this.textShaperValue = _chunkQMI5HZWAcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
|
|
7381
7381
|
return this.textShaperValue;
|
|
7382
7382
|
}
|
|
7383
7383
|
/** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
|
|
@@ -7394,7 +7394,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7394
7394
|
return _nullishCoalesce(_optionalChain([this, 'access', _277 => _277.getTextShaper, 'call', _278 => _278(), 'optionalAccess', _279 => _279.families, 'optionalCall', _280 => _280()]), () => ( ["sans-serif", "serif", "monospace"]));
|
|
7395
7395
|
}
|
|
7396
7396
|
typeInfo(id) {
|
|
7397
|
-
const layer =
|
|
7397
|
+
const layer = _chunkCD7PLU77cjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7398
7398
|
const ranges = (runs) => {
|
|
7399
7399
|
let at = 0;
|
|
7400
7400
|
return runs.map((r) => {
|
|
@@ -7407,7 +7407,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7407
7407
|
let lines = [];
|
|
7408
7408
|
let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
|
|
7409
7409
|
if (shaper) {
|
|
7410
|
-
const layout =
|
|
7410
|
+
const layout = _chunkQMI5HZWAcjs.layoutText.call(void 0, layer, shaper);
|
|
7411
7411
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7412
7412
|
lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
|
|
7413
7413
|
if (layer.rendering === "stored") missing = layout.missingFonts;
|
|
@@ -7437,25 +7437,25 @@ var ImageEditorController = (_class7 = class {
|
|
|
7437
7437
|
* text wrapped in `box`. Refused without a text shaper. Returns its id.
|
|
7438
7438
|
*/
|
|
7439
7439
|
addTextLayer(init) {
|
|
7440
|
-
const text =
|
|
7441
|
-
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0,
|
|
7442
|
-
const style =
|
|
7443
|
-
const paragraph =
|
|
7440
|
+
const text = _chunkCD7PLU77cjs.normalizeText.call(void 0, init.text);
|
|
7441
|
+
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("x and y must be numbers (document pixels).");
|
|
7442
|
+
const style = _chunkCD7PLU77cjs.patchTextStyle.call(void 0, { ..._chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
|
|
7443
|
+
const paragraph = _chunkCD7PLU77cjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
|
|
7444
7444
|
let frame = { kind: "point" };
|
|
7445
7445
|
if (init.box) {
|
|
7446
7446
|
const { width, height } = init.box;
|
|
7447
|
-
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0,
|
|
7447
|
+
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
|
|
7448
7448
|
frame = { kind: "box", width, height };
|
|
7449
7449
|
}
|
|
7450
|
-
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0,
|
|
7451
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7452
|
-
if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7450
|
+
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("rotation must be a number of degrees.");
|
|
7451
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7452
|
+
if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7453
7453
|
const t = [1, 0, 0, 1, init.x, init.y];
|
|
7454
|
-
const transform = init.rotation ?
|
|
7455
|
-
const layer =
|
|
7454
|
+
const transform = init.rotation ? _chunkQMI5HZWAcjs.multiplyMatrices.call(void 0, t, _chunkQMI5HZWAcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
|
|
7455
|
+
const layer = _chunkCD7PLU77cjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkCD7PLU77cjs.typeLayerName.call(void 0, text))) }, this.textEnv());
|
|
7456
7456
|
if (init.opacity !== void 0) layer.opacity = init.opacity;
|
|
7457
7457
|
if (init.blend !== void 0) layer.blend = init.blend;
|
|
7458
|
-
const next =
|
|
7458
|
+
const next = _chunkCD7PLU77cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7459
7459
|
this.commitLayers(next, () => {
|
|
7460
7460
|
this.state.activeLayerId = layer.id;
|
|
7461
7461
|
this.state.activeTarget = "pixels";
|
|
@@ -7467,28 +7467,28 @@ var ImageEditorController = (_class7 = class {
|
|
|
7467
7467
|
* `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
|
|
7468
7468
|
*/
|
|
7469
7469
|
setText(id, text, range = {}, commitToHistory = true) {
|
|
7470
|
-
const layer =
|
|
7471
|
-
const insert =
|
|
7472
|
-
const [start, end] =
|
|
7473
|
-
const { layers } =
|
|
7470
|
+
const layer = _chunkCD7PLU77cjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7471
|
+
const insert = _chunkCD7PLU77cjs.normalizeText.call(void 0, text);
|
|
7472
|
+
const [start, end] = _chunkCD7PLU77cjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7473
|
+
const { layers } = _chunkCD7PLU77cjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkCD7PLU77cjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
|
|
7474
7474
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7475
7475
|
return this.typeInfo(id);
|
|
7476
7476
|
}
|
|
7477
7477
|
/** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
|
|
7478
7478
|
setTextStyle(id, style, range = {}, commitToHistory = true) {
|
|
7479
|
-
const layer =
|
|
7480
|
-
const [start, end] =
|
|
7481
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7482
|
-
|
|
7483
|
-
const { layers } =
|
|
7479
|
+
const layer = _chunkCD7PLU77cjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7480
|
+
const [start, end] = _chunkCD7PLU77cjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7481
|
+
if (!Object.keys(style).length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give at least one style field to set.");
|
|
7482
|
+
_chunkCD7PLU77cjs.patchTextStyle.call(void 0, _chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE, style);
|
|
7483
|
+
const { layers } = _chunkCD7PLU77cjs.updateTypeLayer.call(void 0,
|
|
7484
7484
|
this.state.layers,
|
|
7485
7485
|
id,
|
|
7486
7486
|
(l) => {
|
|
7487
7487
|
if (start === end) {
|
|
7488
|
-
if (l.text.length) throw new (0,
|
|
7489
|
-
return { runs: [{ length: 0, style:
|
|
7488
|
+
if (l.text.length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
|
|
7489
|
+
return { runs: [{ length: 0, style: _chunkCD7PLU77cjs.patchTextStyle.call(void 0, _chunkQMI5HZWAcjs.styleAt.call(void 0, l.runs, 0, _chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE), style) }] };
|
|
7490
7490
|
}
|
|
7491
|
-
return { runs:
|
|
7491
|
+
return { runs: _chunkQMI5HZWAcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkCD7PLU77cjs.patchTextStyle.call(void 0, s, style)) };
|
|
7492
7492
|
},
|
|
7493
7493
|
this.textEnv(),
|
|
7494
7494
|
"restyle its text"
|
|
@@ -7498,11 +7498,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7498
7498
|
}
|
|
7499
7499
|
/** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
|
|
7500
7500
|
setParagraphStyle(id, style, range = {}, commitToHistory = true) {
|
|
7501
|
-
const layer =
|
|
7502
|
-
const [start, end] =
|
|
7503
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7504
|
-
|
|
7505
|
-
const { layers } =
|
|
7501
|
+
const layer = _chunkCD7PLU77cjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7502
|
+
const [start, end] = _chunkCD7PLU77cjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7503
|
+
if (!Object.keys(style).length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give at least one paragraph field to set.");
|
|
7504
|
+
_chunkCD7PLU77cjs.patchParagraphStyle.call(void 0, {}, style);
|
|
7505
|
+
const { layers } = _chunkCD7PLU77cjs.updateTypeLayer.call(void 0,
|
|
7506
7506
|
this.state.layers,
|
|
7507
7507
|
id,
|
|
7508
7508
|
(l) => {
|
|
@@ -7511,7 +7511,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7511
7511
|
const a = at;
|
|
7512
7512
|
at += p.length;
|
|
7513
7513
|
const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
|
|
7514
|
-
return touches || !l.text.length ? { length: p.length, style:
|
|
7514
|
+
return touches || !l.text.length ? { length: p.length, style: _chunkCD7PLU77cjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
|
|
7515
7515
|
});
|
|
7516
7516
|
return { paragraphs };
|
|
7517
7517
|
},
|
|
@@ -7527,21 +7527,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7527
7527
|
* paragraph. Also resizes a box. One undo step.
|
|
7528
7528
|
*/
|
|
7529
7529
|
setTextFrame(id, frame, commitToHistory = true) {
|
|
7530
|
-
const layer =
|
|
7531
|
-
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0,
|
|
7532
|
-
if (frame.kind !== "box" && frame.kind !== "point") throw new (0,
|
|
7530
|
+
const layer = _chunkCD7PLU77cjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7531
|
+
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("width and height must be at least 1 pixel.");
|
|
7532
|
+
if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("kind must be point or box.");
|
|
7533
7533
|
const shaper = this.getTextShaper();
|
|
7534
|
-
const { layers } =
|
|
7534
|
+
const { layers } = _chunkCD7PLU77cjs.updateTypeLayer.call(void 0,
|
|
7535
7535
|
this.state.layers,
|
|
7536
7536
|
id,
|
|
7537
7537
|
(l) => {
|
|
7538
7538
|
if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
|
|
7539
|
-
if (!shaper) throw new (0,
|
|
7540
|
-
const lines =
|
|
7539
|
+
if (!shaper) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
|
|
7540
|
+
const lines = _chunkQMI5HZWAcjs.layoutText.call(void 0, l, shaper).lines;
|
|
7541
7541
|
const first = lines[0];
|
|
7542
7542
|
const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
|
|
7543
7543
|
const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
|
|
7544
|
-
const m =
|
|
7544
|
+
const m = _chunkCD7PLU77cjs.textMatrix.call(void 0, l);
|
|
7545
7545
|
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]];
|
|
7546
7546
|
const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
|
|
7547
7547
|
return { frame: nextFrame, transform: shifted };
|
|
@@ -7558,21 +7558,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7558
7558
|
* `warnings` says when other colours were dropped. One undo step.
|
|
7559
7559
|
*/
|
|
7560
7560
|
convertTextToShape(id) {
|
|
7561
|
-
const layer =
|
|
7562
|
-
|
|
7561
|
+
const layer = _chunkCD7PLU77cjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7562
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "all", "convert it");
|
|
7563
7563
|
const shaper = this.getTextShaper();
|
|
7564
|
-
if (!shaper) throw new (0,
|
|
7565
|
-
const parts =
|
|
7566
|
-
const subpaths = parts.flatMap((p) =>
|
|
7567
|
-
if (!subpaths.length) throw new (0,
|
|
7564
|
+
if (!shaper) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
|
|
7565
|
+
const parts = _chunkCD7PLU77cjs.textOutlines.call(void 0, layer, shaper);
|
|
7566
|
+
const subpaths = parts.flatMap((p) => _chunkQMI5HZWAcjs.bezierToSubpaths.call(void 0, p.path));
|
|
7567
|
+
if (!subpaths.length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
|
|
7568
7568
|
const warnings = [];
|
|
7569
7569
|
const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
|
|
7570
7570
|
if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
|
|
7571
|
-
const missing =
|
|
7571
|
+
const missing = _chunkQMI5HZWAcjs.layoutText.call(void 0, layer, shaper).missingFonts;
|
|
7572
7572
|
if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
|
|
7573
|
-
const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => (
|
|
7573
|
+
const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => ( _chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE));
|
|
7574
7574
|
const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
|
|
7575
|
-
const shape =
|
|
7575
|
+
const shape = _chunkCD7PLU77cjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
|
|
7576
7576
|
const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
|
|
7577
7577
|
for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
7578
7578
|
this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
|
|
@@ -7580,23 +7580,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
7580
7580
|
}
|
|
7581
7581
|
/** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
|
|
7582
7582
|
getTextLayout(id) {
|
|
7583
|
-
const layer =
|
|
7583
|
+
const layer = _chunkCD7PLU77cjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7584
7584
|
const shaper = this.getTextShaper();
|
|
7585
|
-
return shaper ?
|
|
7585
|
+
return shaper ? _chunkQMI5HZWAcjs.layoutText.call(void 0, layer, shaper) : null;
|
|
7586
7586
|
}
|
|
7587
7587
|
/** The text index nearest a document point (for clicks on a type layer). */
|
|
7588
7588
|
textIndexAt(id, point) {
|
|
7589
|
-
const layer =
|
|
7589
|
+
const layer = _chunkCD7PLU77cjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7590
7590
|
const layout = this.getTextLayout(id);
|
|
7591
|
-
return layout ?
|
|
7591
|
+
return layout ? _chunkQMI5HZWAcjs.textIndexAt.call(void 0, layout, _chunkCD7PLU77cjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
|
|
7592
7592
|
}
|
|
7593
7593
|
/** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
|
|
7594
7594
|
textCaret(id, index) {
|
|
7595
|
-
const layer =
|
|
7595
|
+
const layer = _chunkCD7PLU77cjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7596
7596
|
const layout = this.getTextLayout(id);
|
|
7597
7597
|
if (!layout) return null;
|
|
7598
|
-
const c =
|
|
7599
|
-
const m =
|
|
7598
|
+
const c = _chunkQMI5HZWAcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
|
|
7599
|
+
const m = _chunkCD7PLU77cjs.textMatrix.call(void 0, layer);
|
|
7600
7600
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
7601
7601
|
return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
|
|
7602
7602
|
}
|
|
@@ -7607,14 +7607,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7607
7607
|
}
|
|
7608
7608
|
/** One component from tool or UI input (validated). */
|
|
7609
7609
|
componentFrom(spec, path) {
|
|
7610
|
-
const op =
|
|
7611
|
-
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0,
|
|
7612
|
-
if (spec.shape !== void 0) return
|
|
7613
|
-
if (spec.subpaths !== void 0) return { op, subpaths:
|
|
7614
|
-
throw new (0,
|
|
7610
|
+
const op = _chunkCD7PLU77cjs.requireOperation.call(void 0, spec.op, `${path}op`);
|
|
7611
|
+
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
|
|
7612
|
+
if (spec.shape !== void 0) return _chunkCD7PLU77cjs.liveComponent.call(void 0, _chunkCD7PLU77cjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
|
|
7613
|
+
if (spec.subpaths !== void 0) return { op, subpaths: _chunkCD7PLU77cjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
|
|
7614
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
|
|
7615
7615
|
}
|
|
7616
7616
|
shapeInfo(id) {
|
|
7617
|
-
const layer =
|
|
7617
|
+
const layer = _chunkCD7PLU77cjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7618
7618
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7619
7619
|
const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
|
|
7620
7620
|
const info = {
|
|
@@ -7624,13 +7624,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
7624
7624
|
index,
|
|
7625
7625
|
op: c.op,
|
|
7626
7626
|
live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
|
|
7627
|
-
subpaths:
|
|
7628
|
-
bounds: box(
|
|
7627
|
+
subpaths: _chunkQMI5HZWAcjs.roundSubpaths.call(void 0, c.subpaths),
|
|
7628
|
+
bounds: box(_chunkCD7PLU77cjs.shapeGeometryBounds.call(void 0, { components: [c] }))
|
|
7629
7629
|
})),
|
|
7630
7630
|
fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
|
|
7631
7631
|
fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
|
|
7632
7632
|
stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
|
|
7633
|
-
geometryBounds: box(
|
|
7633
|
+
geometryBounds: box(_chunkCD7PLU77cjs.shapeGeometryBounds.call(void 0, layer)),
|
|
7634
7634
|
bounds: this.getLayerBounds(id)
|
|
7635
7635
|
};
|
|
7636
7636
|
if (layer.annotation) info.annotationId = layer.annotation.id;
|
|
@@ -7647,17 +7647,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
7647
7647
|
*/
|
|
7648
7648
|
addShapeLayer(init) {
|
|
7649
7649
|
const specs = _optionalChain([init, 'access', _289 => _289.components, 'optionalAccess', _290 => _290.length]) ? init.components : [init];
|
|
7650
|
-
if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0,
|
|
7650
|
+
if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
|
|
7651
7651
|
const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _293 => _293.components, 'optionalAccess', _294 => _294.length]) ? `components[${i}].` : ""));
|
|
7652
|
-
const stroke = init.stroke ?
|
|
7652
|
+
const stroke = init.stroke ? _chunkCD7PLU77cjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
|
|
7653
7653
|
const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
|
|
7654
|
-
const fill = init.fill === void 0 ? stroke && openOnly ? null :
|
|
7655
|
-
if (!fill && !stroke) throw new (0,
|
|
7656
|
-
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0,
|
|
7657
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7658
|
-
if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7659
|
-
const layer =
|
|
7660
|
-
const next =
|
|
7654
|
+
const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkCD7PLU77cjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkCD7PLU77cjs.normalizeShapePaint.call(void 0, init.fill, "fill");
|
|
7655
|
+
if (!fill && !stroke) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
|
|
7656
|
+
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7657
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7658
|
+
if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7659
|
+
const layer = _chunkCD7PLU77cjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
|
|
7660
|
+
const next = _chunkCD7PLU77cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7661
7661
|
this.commitLayers(next, () => {
|
|
7662
7662
|
this.state.activeLayerId = layer.id;
|
|
7663
7663
|
this.state.activeTarget = "pixels";
|
|
@@ -7670,18 +7670,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
7670
7670
|
* only those settings of the current stroke. Returns the shape.
|
|
7671
7671
|
*/
|
|
7672
7672
|
setShapeStyle(id, changes, commitToHistory = true) {
|
|
7673
|
-
const layer =
|
|
7674
|
-
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null :
|
|
7675
|
-
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null :
|
|
7676
|
-
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0,
|
|
7673
|
+
const layer = _chunkCD7PLU77cjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7674
|
+
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkCD7PLU77cjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
|
|
7675
|
+
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkCD7PLU77cjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
|
|
7676
|
+
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7677
7677
|
const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
|
|
7678
|
-
const { layers } =
|
|
7678
|
+
const { layers } = _chunkCD7PLU77cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
|
|
7679
7679
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7680
7680
|
return this.shapeInfo(id);
|
|
7681
7681
|
}
|
|
7682
7682
|
componentIndex(layer, index) {
|
|
7683
7683
|
if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
|
|
7684
|
-
throw new (0,
|
|
7684
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
|
|
7685
7685
|
}
|
|
7686
7686
|
return index;
|
|
7687
7687
|
}
|
|
@@ -7691,36 +7691,36 @@ var ImageEditorController = (_class7 = class {
|
|
|
7691
7691
|
* the live shape) or its operation. Returns the shape.
|
|
7692
7692
|
*/
|
|
7693
7693
|
setShapeComponent(id, index, change, commitToHistory = true) {
|
|
7694
|
-
const layer =
|
|
7694
|
+
const layer = _chunkCD7PLU77cjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7695
7695
|
const i = this.componentIndex(layer, index);
|
|
7696
7696
|
const current = layer.components[i];
|
|
7697
7697
|
let shape = change.shape;
|
|
7698
7698
|
if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
|
|
7699
7699
|
else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
|
|
7700
|
-
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op:
|
|
7700
|
+
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkCD7PLU77cjs.requireOperation.call(void 0, change.op) };
|
|
7701
7701
|
const components = layer.components.map((c, k) => k === i ? next : c);
|
|
7702
|
-
const { layers } =
|
|
7702
|
+
const { layers } = _chunkCD7PLU77cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7703
7703
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7704
7704
|
return this.shapeInfo(id);
|
|
7705
7705
|
}
|
|
7706
7706
|
/** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
|
|
7707
7707
|
addShapeComponent(id, spec, index) {
|
|
7708
|
-
const layer =
|
|
7708
|
+
const layer = _chunkCD7PLU77cjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7709
7709
|
const c = this.componentFrom(spec, "");
|
|
7710
7710
|
const at = index === void 0 ? layer.components.length : index;
|
|
7711
|
-
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0,
|
|
7711
|
+
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
|
|
7712
7712
|
const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
|
|
7713
|
-
const { layers } =
|
|
7713
|
+
const { layers } = _chunkCD7PLU77cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7714
7714
|
this.commitLayers(layers);
|
|
7715
7715
|
return this.shapeInfo(id);
|
|
7716
7716
|
}
|
|
7717
7717
|
/** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
|
|
7718
7718
|
removeShapeComponent(id, index) {
|
|
7719
|
-
const layer =
|
|
7719
|
+
const layer = _chunkCD7PLU77cjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7720
7720
|
const i = this.componentIndex(layer, index);
|
|
7721
|
-
if (layer.components.length === 1) throw new (0,
|
|
7721
|
+
if (layer.components.length === 1) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
|
|
7722
7722
|
const components = layer.components.filter((_, k) => k !== i);
|
|
7723
|
-
const { layers } =
|
|
7723
|
+
const { layers } = _chunkCD7PLU77cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7724
7724
|
this.commitLayers(layers);
|
|
7725
7725
|
return this.shapeInfo(id);
|
|
7726
7726
|
}
|
|
@@ -7729,10 +7729,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7729
7729
|
* shapes become paths), as one undo step. Returns the shape.
|
|
7730
7730
|
*/
|
|
7731
7731
|
mergeShapeComponents(id) {
|
|
7732
|
-
const layer =
|
|
7733
|
-
if (layer.components.length < 2) throw new (0,
|
|
7734
|
-
const components =
|
|
7735
|
-
const { layers } =
|
|
7732
|
+
const layer = _chunkCD7PLU77cjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7733
|
+
if (layer.components.length < 2) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
|
|
7734
|
+
const components = _chunkCD7PLU77cjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
|
|
7735
|
+
const { layers } = _chunkCD7PLU77cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
|
|
7736
7736
|
this.commitLayers(layers);
|
|
7737
7737
|
return this.shapeInfo(id);
|
|
7738
7738
|
}
|
|
@@ -7742,8 +7742,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7742
7742
|
* step. Returns the layer id.
|
|
7743
7743
|
*/
|
|
7744
7744
|
async rasterizeLayer(id) {
|
|
7745
|
-
const layer =
|
|
7746
|
-
|
|
7745
|
+
const layer = _chunkCD7PLU77cjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
7746
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
|
|
7747
7747
|
const { width, height } = this.naturalSize;
|
|
7748
7748
|
const canvas = { x: 0, y: 0, width, height };
|
|
7749
7749
|
let next;
|
|
@@ -7759,8 +7759,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7759
7759
|
if (layer.locks) next.locks = layer.locks;
|
|
7760
7760
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
7761
7761
|
} else if (layer.type === "pixel") {
|
|
7762
|
-
if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0,
|
|
7763
|
-
|
|
7762
|
+
if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
|
|
7763
|
+
_chunkCD7PLU77cjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
|
|
7764
7764
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
7765
7765
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
7766
7766
|
delete content.mask;
|
|
@@ -7777,10 +7777,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7777
7777
|
} else if (layer.type === "smart") {
|
|
7778
7778
|
return this.rasterizeSmartObject(id);
|
|
7779
7779
|
} else if (layer.type === "shape" || layer.type === "type") {
|
|
7780
|
-
next = layer.type === "shape" ?
|
|
7780
|
+
next = layer.type === "shape" ? _chunkCD7PLU77cjs.shapeAsPixelLayer.call(void 0, layer) : _chunkCD7PLU77cjs.typeAsPixelLayer.call(void 0, layer);
|
|
7781
7781
|
if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _297 => _297.annotation, 'optionalAccess', _298 => _298.id])) this.state.selectedAnnotationId = null;
|
|
7782
7782
|
} else {
|
|
7783
|
-
throw new (0,
|
|
7783
|
+
throw new (0, _chunkCD7PLU77cjs.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.`);
|
|
7784
7784
|
}
|
|
7785
7785
|
this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
|
|
7786
7786
|
return id;
|
|
@@ -7805,7 +7805,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7805
7805
|
setColorMode(mode, options = {}) {
|
|
7806
7806
|
let next;
|
|
7807
7807
|
if (mode === "rgb") {
|
|
7808
|
-
if (options.profile !== void 0) throw new (0,
|
|
7808
|
+
if (options.profile !== void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
|
|
7809
7809
|
next = null;
|
|
7810
7810
|
} else if (mode === "lab") next = { mode: "lab" };
|
|
7811
7811
|
else if (mode === "cmyk") {
|
|
@@ -7813,14 +7813,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7813
7813
|
try {
|
|
7814
7814
|
doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
|
|
7815
7815
|
} catch (e) {
|
|
7816
|
-
throw new (0,
|
|
7816
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7817
7817
|
}
|
|
7818
7818
|
const cs = resolveProfile(doc).colorSpace;
|
|
7819
|
-
if (cs !== "cmyk") throw new (0,
|
|
7819
|
+
if (cs !== "cmyk") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
|
|
7820
7820
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7821
|
-
if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0,
|
|
7821
|
+
if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
|
|
7822
7822
|
next = { mode: "cmyk", profile: doc, intent };
|
|
7823
|
-
} else throw new (0,
|
|
7823
|
+
} else throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
|
|
7824
7824
|
this.recordHistory();
|
|
7825
7825
|
if (next) this.state.colorMode = next;
|
|
7826
7826
|
else delete this.state.colorMode;
|
|
@@ -7833,10 +7833,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7833
7833
|
try {
|
|
7834
7834
|
doc = documentProfile(profile);
|
|
7835
7835
|
} catch (e) {
|
|
7836
|
-
throw new (0,
|
|
7836
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7837
7837
|
}
|
|
7838
7838
|
const cs = resolveProfile(doc).colorSpace;
|
|
7839
|
-
if (cs !== "rgb") throw new (0,
|
|
7839
|
+
if (cs !== "rgb") throw new (0, _chunkCD7PLU77cjs.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.`);
|
|
7840
7840
|
return doc;
|
|
7841
7841
|
}
|
|
7842
7842
|
/**
|
|
@@ -7862,7 +7862,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7862
7862
|
convertToProfile(profile, options = {}) {
|
|
7863
7863
|
const doc = this.rgbProfileArg(profile, "Convert to Profile");
|
|
7864
7864
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7865
|
-
if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0,
|
|
7865
|
+
if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
|
|
7866
7866
|
const t = _chunkBROJYMWUcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7867
7867
|
const converted = [];
|
|
7868
7868
|
const unconverted = [];
|
|
@@ -7892,11 +7892,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7892
7892
|
else if (l.type === "pixel") next2 = { ...next2, surface: convertSurfaceColors(this.surfaceOf(l), t), source: void 0 };
|
|
7893
7893
|
else if (l.type === "shape") {
|
|
7894
7894
|
const s = next2;
|
|
7895
|
-
next2 =
|
|
7895
|
+
next2 = _chunkCD7PLU77cjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
|
|
7896
7896
|
} else if (l.type === "type") {
|
|
7897
7897
|
const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
|
|
7898
7898
|
try {
|
|
7899
|
-
next2 =
|
|
7899
|
+
next2 = _chunkCD7PLU77cjs.rerenderText.call(void 0, recoloured, textEnv);
|
|
7900
7900
|
} catch (e27) {
|
|
7901
7901
|
next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
|
|
7902
7902
|
}
|
|
@@ -7926,12 +7926,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
7926
7926
|
try {
|
|
7927
7927
|
doc = documentProfile(setup.profile);
|
|
7928
7928
|
} catch (e) {
|
|
7929
|
-
throw new (0,
|
|
7929
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7930
7930
|
}
|
|
7931
7931
|
const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
|
|
7932
|
-
if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0,
|
|
7932
|
+
if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
|
|
7933
7933
|
const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
|
|
7934
|
-
if (!_chunkBROJYMWUcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0,
|
|
7934
|
+
if (!_chunkBROJYMWUcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
|
|
7935
7935
|
this.state.proofSetup = next;
|
|
7936
7936
|
this.notify();
|
|
7937
7937
|
return next;
|
|
@@ -7948,14 +7948,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7948
7948
|
src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
|
|
7949
7949
|
dst = resolveProfile(documentProfile(to));
|
|
7950
7950
|
} catch (e) {
|
|
7951
|
-
throw new (0,
|
|
7951
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7952
7952
|
}
|
|
7953
|
-
if (src.colorSpace !== "rgb") throw new (0,
|
|
7953
|
+
if (src.colorSpace !== "rgb") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
|
|
7954
7954
|
const t = _chunkBROJYMWUcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7955
7955
|
const toLab = _chunkBROJYMWUcjs.Transform.create(src, _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
|
|
7956
7956
|
return colors.map((input) => {
|
|
7957
7957
|
const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
|
|
7958
|
-
if (!m) throw new (0,
|
|
7958
|
+
if (!m) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
|
|
7959
7959
|
const n = parseInt(m[1], 16);
|
|
7960
7960
|
const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
|
|
7961
7961
|
const out = new Float32Array(16);
|
|
@@ -7981,7 +7981,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7981
7981
|
* the ids of the layers whose pixels changed.
|
|
7982
7982
|
*/
|
|
7983
7983
|
setBitDepth(depth) {
|
|
7984
|
-
if (!_chunkCWM3CUUXcjs.isBitDepth.call(void 0, depth)) throw new (0,
|
|
7984
|
+
if (!_chunkCWM3CUUXcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
|
|
7985
7985
|
const changed = [];
|
|
7986
7986
|
const withMask = (l) => {
|
|
7987
7987
|
const m = l.mask;
|
|
@@ -8030,7 +8030,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8030
8030
|
* Throws `PsdError` for files that cannot be read at all.
|
|
8031
8031
|
*/
|
|
8032
8032
|
loadPsd(bytes) {
|
|
8033
|
-
const result =
|
|
8033
|
+
const result = _chunkCD7PLU77cjs.importPsd.call(void 0, bytes, { newId: () => _chunkCD7PLU77cjs.newLayerId.call(void 0, ) });
|
|
8034
8034
|
this.abandonContents();
|
|
8035
8035
|
this.recordHistory();
|
|
8036
8036
|
const s = this.state;
|
|
@@ -8040,12 +8040,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
8040
8040
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
8041
8041
|
s.layers = this.checkPsdFonts(result);
|
|
8042
8042
|
s.crop = null;
|
|
8043
|
-
s.transform = { ...
|
|
8043
|
+
s.transform = { ..._chunkCD7PLU77cjs.DEFAULT_TRANSFORM_VALUES };
|
|
8044
8044
|
s.outputOpacity = 1;
|
|
8045
8045
|
delete s.legacyOutputBlur;
|
|
8046
8046
|
s.selection = null;
|
|
8047
8047
|
s.selectedAnnotationId = null;
|
|
8048
|
-
s.activeLayerId =
|
|
8048
|
+
s.activeLayerId = _chunkCD7PLU77cjs.defaultActiveLayerId.call(void 0, s.layers);
|
|
8049
8049
|
s.activeTarget = "pixels";
|
|
8050
8050
|
this.psdResolution = result.resolution;
|
|
8051
8051
|
if (result.patterns.length) s.patterns = result.patterns;
|
|
@@ -8090,7 +8090,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8090
8090
|
let layers = result.layers;
|
|
8091
8091
|
const missing = /* @__PURE__ */ new Map();
|
|
8092
8092
|
for (const l of types) {
|
|
8093
|
-
const fonts = shaper ?
|
|
8093
|
+
const fonts = shaper ? _chunkQMI5HZWAcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
|
|
8094
8094
|
if (!fonts.length) continue;
|
|
8095
8095
|
layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
|
|
8096
8096
|
for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
|
|
@@ -8118,7 +8118,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8118
8118
|
const canRasterize = this.renderer.canRasterize();
|
|
8119
8119
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
8120
8120
|
const sources = this.renderer.compositorSources(width, height);
|
|
8121
|
-
const compositor = new (0,
|
|
8121
|
+
const compositor = new (0, _chunkCD7PLU77cjs.LayerCompositor)();
|
|
8122
8122
|
const bakeMask = (layer) => {
|
|
8123
8123
|
const mask = layer.mask;
|
|
8124
8124
|
if (!_optionalChain([mask, 'optionalAccess', _309 => _309.source])) return mask;
|
|
@@ -8200,7 +8200,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8200
8200
|
out.surface = this.surfaceOf(layer);
|
|
8201
8201
|
delete out.source;
|
|
8202
8202
|
}
|
|
8203
|
-
const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(
|
|
8203
|
+
const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunkCD7PLU77cjs.isActiveFilter)]), () => ( []));
|
|
8204
8204
|
if (active.length) {
|
|
8205
8205
|
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
8206
8206
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -8233,8 +8233,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8233
8233
|
const color = this.psdColorOptions(warnings);
|
|
8234
8234
|
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).`);
|
|
8235
8235
|
const depth = color.colorMode && this.bitDepth === 32 ? 16 : this.bitDepth;
|
|
8236
|
-
const mergedDeep = depth === 8 ? void 0 : _chunkHGTDMKNEcjs.workingToSamples.call(void 0,
|
|
8237
|
-
const result =
|
|
8236
|
+
const mergedDeep = depth === 8 ? void 0 : _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkCD7PLU77cjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
|
|
8237
|
+
const result = _chunkCD7PLU77cjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
|
|
8238
8238
|
warnings.push(...result.warnings);
|
|
8239
8239
|
return { bytes: result.bytes, warnings, psb: result.psb, width, height };
|
|
8240
8240
|
}
|
|
@@ -8250,13 +8250,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
8250
8250
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
8251
8251
|
if (this.state.selection && (sx !== 1 || sy !== 1)) {
|
|
8252
8252
|
this.state.selection = normalizeSelection(
|
|
8253
|
-
|
|
8253
|
+
_chunkCD7PLU77cjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
|
|
8254
8254
|
);
|
|
8255
8255
|
}
|
|
8256
8256
|
let layers = this.state.layers;
|
|
8257
8257
|
if (sx !== 1 || sy !== 1) {
|
|
8258
8258
|
if (this.state.crop) {
|
|
8259
|
-
this.state.crop =
|
|
8259
|
+
this.state.crop = _chunkCD7PLU77cjs.clampCropToImage.call(void 0,
|
|
8260
8260
|
{
|
|
8261
8261
|
x: Math.round(this.state.crop.x * sx),
|
|
8262
8262
|
y: Math.round(this.state.crop.y * sy),
|
|
@@ -8275,17 +8275,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
8275
8275
|
} else if (l.type === "shape") {
|
|
8276
8276
|
const a = l.annotation;
|
|
8277
8277
|
const scaled = a ? scaleAnnotation(a, sx, sy) : null;
|
|
8278
|
-
const fromAnnotation = scaled ?
|
|
8278
|
+
const fromAnnotation = scaled ? _chunkCD7PLU77cjs.shapeFromAnnotation.call(void 0, scaled) : null;
|
|
8279
8279
|
const m = [sx, 0, 0, sy, 0, 0];
|
|
8280
|
-
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => (
|
|
8280
|
+
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunkCD7PLU77cjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
|
|
8281
8281
|
const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
|
|
8282
8282
|
if (scaled && fromAnnotation) moved.annotation = scaled;
|
|
8283
8283
|
else delete moved.annotation;
|
|
8284
|
-
layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () =>
|
|
8284
|
+
layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkCD7PLU77cjs.rerenderShape.call(void 0, moved, env));
|
|
8285
8285
|
}
|
|
8286
8286
|
}
|
|
8287
8287
|
}
|
|
8288
|
-
const bg =
|
|
8288
|
+
const bg = _chunkCD7PLU77cjs.developTarget.call(void 0, layers, null);
|
|
8289
8289
|
if (bg && bg.source !== "document") layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
|
|
8290
8290
|
if (clearAnnotations) {
|
|
8291
8291
|
for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => null);
|
|
@@ -8306,7 +8306,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8306
8306
|
let out;
|
|
8307
8307
|
try {
|
|
8308
8308
|
out = this.serializeState();
|
|
8309
|
-
if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection =
|
|
8309
|
+
if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunkCD7PLU77cjs.serializeSelection.call(void 0, this.state.selection);
|
|
8310
8310
|
} finally {
|
|
8311
8311
|
if (root) {
|
|
8312
8312
|
this.state = current;
|
|
@@ -8314,8 +8314,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8314
8314
|
this.viewKey = [];
|
|
8315
8315
|
}
|
|
8316
8316
|
}
|
|
8317
|
-
if (!options || out.version !==
|
|
8318
|
-
return
|
|
8317
|
+
if (!options || out.version !== _chunkCD7PLU77cjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
|
|
8318
|
+
return _chunkCD7PLU77cjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
|
|
8319
8319
|
}
|
|
8320
8320
|
/**
|
|
8321
8321
|
* Loads a stored state whose v3 assets may live in an asset store (references other than data
|
|
@@ -8323,12 +8323,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
8323
8323
|
* out and listed in `lastLoadProblems`.
|
|
8324
8324
|
*/
|
|
8325
8325
|
async loadJSONAsync(data, options = {}) {
|
|
8326
|
-
if (data.version !==
|
|
8326
|
+
if (data.version !== _chunkCD7PLU77cjs.LAYERED_SCHEMA_VERSION || !data.assets) {
|
|
8327
8327
|
this.loadJSON(data);
|
|
8328
8328
|
return;
|
|
8329
8329
|
}
|
|
8330
8330
|
const problems = [];
|
|
8331
|
-
const assets = await
|
|
8331
|
+
const assets = await _chunkCD7PLU77cjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
|
|
8332
8332
|
this.loadJSON({ ...data, assets });
|
|
8333
8333
|
this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
|
|
8334
8334
|
}
|
|
@@ -8340,7 +8340,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8340
8340
|
let selection = null;
|
|
8341
8341
|
if (data.selection) {
|
|
8342
8342
|
try {
|
|
8343
|
-
selection = normalizeSelection(
|
|
8343
|
+
selection = normalizeSelection(_chunkCD7PLU77cjs.deserializeSelection.call(void 0, data.selection));
|
|
8344
8344
|
} catch (e28) {
|
|
8345
8345
|
selection = null;
|
|
8346
8346
|
}
|
|
@@ -8358,8 +8358,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8358
8358
|
if (isLayered(data)) {
|
|
8359
8359
|
const problems = [];
|
|
8360
8360
|
const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
|
|
8361
|
-
const storedPatterns =
|
|
8362
|
-
s.layers =
|
|
8361
|
+
const storedPatterns = _chunkCD7PLU77cjs.deserializePatterns.call(void 0, data.patterns, []);
|
|
8362
|
+
s.layers = _chunkCD7PLU77cjs.deserializeLayers.call(void 0, data.layers, {
|
|
8363
8363
|
assets: _nullishCoalesce(data.assets, () => ( {})),
|
|
8364
8364
|
problems,
|
|
8365
8365
|
smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
|
|
@@ -8373,11 +8373,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
8373
8373
|
s.outputOpacity = data.opacity;
|
|
8374
8374
|
if (typeof data.legacyOutputBlur === "number" && data.legacyOutputBlur >= 0) s.legacyOutputBlur = data.legacyOutputBlur;
|
|
8375
8375
|
else delete s.legacyOutputBlur;
|
|
8376
|
-
s.activeLayerId = data.activeLayerId && _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId :
|
|
8376
|
+
s.activeLayerId = data.activeLayerId && _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : _chunkCD7PLU77cjs.defaultActiveLayerId.call(void 0, s.layers);
|
|
8377
8377
|
const light = data.globalLight;
|
|
8378
8378
|
if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
|
|
8379
8379
|
else delete s.globalLight;
|
|
8380
|
-
const patterns =
|
|
8380
|
+
const patterns = _chunkCD7PLU77cjs.deserializePatterns.call(void 0, data.patterns, problems);
|
|
8381
8381
|
if (patterns.length) s.patterns = patterns;
|
|
8382
8382
|
else delete s.patterns;
|
|
8383
8383
|
if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
|
|
@@ -8393,14 +8393,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
8393
8393
|
}
|
|
8394
8394
|
} else {
|
|
8395
8395
|
const { width, height } = this.naturalSize;
|
|
8396
|
-
const stack =
|
|
8396
|
+
const stack = _chunkCD7PLU77cjs.layersFromLegacy.call(void 0, data, width, height);
|
|
8397
8397
|
s.layers = stack.layers;
|
|
8398
8398
|
s.outputOpacity = stack.outputOpacity;
|
|
8399
8399
|
if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
|
|
8400
8400
|
else delete s.legacyOutputBlur;
|
|
8401
8401
|
s.crop = data.crop ? { ...data.crop } : null;
|
|
8402
8402
|
s.transform = { ...data.transform };
|
|
8403
|
-
s.activeLayerId =
|
|
8403
|
+
s.activeLayerId = _chunkCD7PLU77cjs.defaultActiveLayerId.call(void 0, s.layers);
|
|
8404
8404
|
delete s.globalLight;
|
|
8405
8405
|
delete s.patterns;
|
|
8406
8406
|
delete s.bitDepth;
|
|
@@ -8414,7 +8414,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8414
8414
|
}
|
|
8415
8415
|
serializeState() {
|
|
8416
8416
|
const { width, height } = this.naturalSize;
|
|
8417
|
-
const view =
|
|
8417
|
+
const view = _chunkCD7PLU77cjs.legacyView.call(void 0, this.stack(), width, height, null);
|
|
8418
8418
|
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) {
|
|
8419
8419
|
return {
|
|
8420
8420
|
// States without adjustment layers keep schema 1, so they round-trip unchanged.
|
|
@@ -8429,9 +8429,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
8429
8429
|
annotations: JSON.parse(JSON.stringify(view.annotations))
|
|
8430
8430
|
};
|
|
8431
8431
|
}
|
|
8432
|
-
const { layers, assets, smartContents } =
|
|
8432
|
+
const { layers, assets, smartContents } = _chunkCD7PLU77cjs.serializeLayers.call(void 0, this.state.layers);
|
|
8433
8433
|
const out = {
|
|
8434
|
-
version:
|
|
8434
|
+
version: _chunkCD7PLU77cjs.LAYERED_SCHEMA_VERSION,
|
|
8435
8435
|
width,
|
|
8436
8436
|
height,
|
|
8437
8437
|
layers,
|
|
@@ -8443,7 +8443,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8443
8443
|
};
|
|
8444
8444
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
8445
8445
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
8446
|
-
if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns =
|
|
8446
|
+
if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunkCD7PLU77cjs.serializePatterns.call(void 0, this.state.patterns);
|
|
8447
8447
|
if (smartContents) out.smartContents = smartContents;
|
|
8448
8448
|
if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
|
|
8449
8449
|
if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
|
|
@@ -8455,7 +8455,7 @@ function serializeAdjustments(adjustments) {
|
|
|
8455
8455
|
const out = { ...adjustments };
|
|
8456
8456
|
if (_optionalChain([out, 'access', _339 => _339.layers, 'optionalAccess', _340 => _340.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
8457
8457
|
else delete out.layers;
|
|
8458
|
-
if (
|
|
8458
|
+
if (_chunkCD7PLU77cjs.normalizeProcessVersion.call(void 0, out.process) === _chunkCD7PLU77cjs.LEGACY_PROCESS_VERSION) {
|
|
8459
8459
|
delete out.process;
|
|
8460
8460
|
if (!out.tint) delete out.tint;
|
|
8461
8461
|
}
|
|
@@ -8466,7 +8466,7 @@ function withDevelop(layer, partial) {
|
|
|
8466
8466
|
let i = filters.findIndex((f) => f.kind === "develop");
|
|
8467
8467
|
if (i === -1) {
|
|
8468
8468
|
filters.unshift({
|
|
8469
|
-
id: layer.source === "document" ?
|
|
8469
|
+
id: layer.source === "document" ? _chunkCD7PLU77cjs.DEVELOP_FILTER_ID : _chunkCD7PLU77cjs.newLayerId.call(void 0, "flt"),
|
|
8470
8470
|
kind: "develop",
|
|
8471
8471
|
enabled: true,
|
|
8472
8472
|
brightness: 0,
|
|
@@ -8475,7 +8475,7 @@ function withDevelop(layer, partial) {
|
|
|
8475
8475
|
exposure: 0,
|
|
8476
8476
|
temperature: 0,
|
|
8477
8477
|
tint: 0,
|
|
8478
|
-
process:
|
|
8478
|
+
process: _chunkCD7PLU77cjs.LATEST_PROCESS_VERSION
|
|
8479
8479
|
});
|
|
8480
8480
|
i = 0;
|
|
8481
8481
|
}
|
|
@@ -8484,7 +8484,7 @@ function withDevelop(layer, partial) {
|
|
|
8484
8484
|
const v = partial[k];
|
|
8485
8485
|
if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
|
|
8486
8486
|
}
|
|
8487
|
-
if ("process" in partial) next.process =
|
|
8487
|
+
if ("process" in partial) next.process = _chunkCD7PLU77cjs.normalizeProcessVersion.call(void 0, partial.process);
|
|
8488
8488
|
filters[i] = next;
|
|
8489
8489
|
return { ...layer, filters };
|
|
8490
8490
|
}
|
|
@@ -8493,7 +8493,7 @@ function withBlur(layer, radius) {
|
|
|
8493
8493
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
8494
8494
|
if (radius > 0) {
|
|
8495
8495
|
filters.push({
|
|
8496
|
-
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ?
|
|
8496
|
+
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunkCD7PLU77cjs.BLUR_FILTER_ID : _chunkCD7PLU77cjs.newLayerId.call(void 0, "flt")))),
|
|
8497
8497
|
kind: "blur",
|
|
8498
8498
|
enabled: true,
|
|
8499
8499
|
radius
|
|
@@ -8517,7 +8517,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8517
8517
|
if (!update.mask) delete next.mask;
|
|
8518
8518
|
else {
|
|
8519
8519
|
const current = node.mask && !node.mask.source ? node.mask : null;
|
|
8520
|
-
const memo = current ?
|
|
8520
|
+
const memo = current ? _chunkCD7PLU77cjs.legacyMaskOf.call(void 0, current, width, height) : null;
|
|
8521
8521
|
if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
|
|
8522
8522
|
next.mask = withMaskProps(current, {
|
|
8523
8523
|
density: _nullishCoalesce(update.mask.density, () => ( 1)),
|
|
@@ -8525,7 +8525,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8525
8525
|
enabled: update.mask.enabled !== false
|
|
8526
8526
|
});
|
|
8527
8527
|
} else {
|
|
8528
|
-
const m =
|
|
8528
|
+
const m = _chunkCD7PLU77cjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
|
|
8529
8529
|
if (m) next.mask = m;
|
|
8530
8530
|
else delete next.mask;
|
|
8531
8531
|
}
|
|
@@ -8564,7 +8564,7 @@ function resizeLegacyMasks(layers, from, to) {
|
|
|
8564
8564
|
for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) {
|
|
8565
8565
|
if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
|
|
8566
8566
|
const old = l.mask;
|
|
8567
|
-
const mask =
|
|
8567
|
+
const mask = _chunkCD7PLU77cjs.rasterMaskFromLegacy.call(void 0, _chunkCD7PLU77cjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
|
|
8568
8568
|
if (!mask) continue;
|
|
8569
8569
|
out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
|
|
8570
8570
|
}
|
|
@@ -8660,12 +8660,12 @@ function withoutAnnotations(layers) {
|
|
|
8660
8660
|
function parseColor(value) {
|
|
8661
8661
|
if (Array.isArray(value)) {
|
|
8662
8662
|
if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
|
|
8663
|
-
throw new (0,
|
|
8663
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
|
|
8664
8664
|
}
|
|
8665
8665
|
return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
|
|
8666
8666
|
}
|
|
8667
8667
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
|
|
8668
|
-
if (!m) throw new (0,
|
|
8668
|
+
if (!m) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
|
|
8669
8669
|
let hex = m[1];
|
|
8670
8670
|
if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
|
|
8671
8671
|
const n = (i) => parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -8673,9 +8673,9 @@ function parseColor(value) {
|
|
|
8673
8673
|
}
|
|
8674
8674
|
function readImagePaint(raw) {
|
|
8675
8675
|
try {
|
|
8676
|
-
return
|
|
8676
|
+
return _chunkEBDCRTZIcjs.parsePaintSource.call(void 0, raw);
|
|
8677
8677
|
} catch (e) {
|
|
8678
|
-
if (e instanceof
|
|
8678
|
+
if (e instanceof _chunkEBDCRTZIcjs.PaintSourceError) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(e.message);
|
|
8679
8679
|
throw e;
|
|
8680
8680
|
}
|
|
8681
8681
|
}
|
|
@@ -8866,7 +8866,7 @@ function loadImageEditorDocument(input) {
|
|
|
8866
8866
|
// Optional: only present when something was selected when saving.
|
|
8867
8867
|
selection: {
|
|
8868
8868
|
parse: (value) => {
|
|
8869
|
-
const mask =
|
|
8869
|
+
const mask = _chunkCD7PLU77cjs.deserializeSelection.call(void 0, value);
|
|
8870
8870
|
const v = value;
|
|
8871
8871
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8872
8872
|
},
|
|
@@ -8954,7 +8954,7 @@ function loadLayeredDocument(doc) {
|
|
|
8954
8954
|
},
|
|
8955
8955
|
selection: {
|
|
8956
8956
|
parse: (value) => {
|
|
8957
|
-
const mask =
|
|
8957
|
+
const mask = _chunkCD7PLU77cjs.deserializeSelection.call(void 0, value);
|
|
8958
8958
|
const v = value;
|
|
8959
8959
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8960
8960
|
},
|
|
@@ -9458,14 +9458,14 @@ function describeSelection(mask) {
|
|
|
9458
9458
|
// src/image-editor/selection-tools.ts
|
|
9459
9459
|
var modeSchema = {
|
|
9460
9460
|
type: "string",
|
|
9461
|
-
enum: [...
|
|
9461
|
+
enum: [..._chunkCD7PLU77cjs.SELECTION_MODES],
|
|
9462
9462
|
description: "How the result combines with the current selection (default replace)."
|
|
9463
9463
|
};
|
|
9464
9464
|
var num2 = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
|
|
9465
9465
|
function summary(controller) {
|
|
9466
9466
|
const sel = controller.getSelection();
|
|
9467
9467
|
const { width, height } = controller.getState().imageDimensions;
|
|
9468
|
-
const area =
|
|
9468
|
+
const area = _chunkCD7PLU77cjs.selectionArea.call(void 0, sel);
|
|
9469
9469
|
return {
|
|
9470
9470
|
empty: !sel,
|
|
9471
9471
|
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _356 => _356.bounds]), () => ( null)),
|
|
@@ -9511,7 +9511,7 @@ function createImageSelectionTools(controller) {
|
|
|
9511
9511
|
},
|
|
9512
9512
|
annotations: writeAnnotations("Select a region", true),
|
|
9513
9513
|
handler: ({ shape, x, y, width, height, mode, feather }) => {
|
|
9514
|
-
const opts = { mode:
|
|
9514
|
+
const opts = { mode: _chunkCD7PLU77cjs.parseSelectionMode.call(void 0, mode), feather: num2(feather, 0) };
|
|
9515
9515
|
switch (shape) {
|
|
9516
9516
|
case "all":
|
|
9517
9517
|
controller.selectAll();
|
|
@@ -9564,7 +9564,7 @@ function createImageSelectionTools(controller) {
|
|
|
9564
9564
|
annotations: writeAnnotations("Select by colour", true),
|
|
9565
9565
|
handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
|
|
9566
9566
|
const common = {
|
|
9567
|
-
mode:
|
|
9567
|
+
mode: _chunkCD7PLU77cjs.parseSelectionMode.call(void 0, mode),
|
|
9568
9568
|
sampleMerged: sampleMerged === true,
|
|
9569
9569
|
sample: _nullishCoalesce(sample, () => ( "composite"))
|
|
9570
9570
|
};
|
|
@@ -9585,7 +9585,7 @@ function createImageSelectionTools(controller) {
|
|
|
9585
9585
|
inputSchema: {
|
|
9586
9586
|
type: "object",
|
|
9587
9587
|
properties: {
|
|
9588
|
-
op: { type: "string", enum: [...
|
|
9588
|
+
op: { type: "string", enum: [..._chunkCD7PLU77cjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
|
|
9589
9589
|
radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
|
|
9590
9590
|
},
|
|
9591
9591
|
required: ["op", "radius"],
|
|
@@ -9593,7 +9593,7 @@ function createImageSelectionTools(controller) {
|
|
|
9593
9593
|
},
|
|
9594
9594
|
annotations: writeAnnotations("Modify the selection"),
|
|
9595
9595
|
handler: ({ op, radius }) => {
|
|
9596
|
-
if (!
|
|
9596
|
+
if (!_chunkCD7PLU77cjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
|
|
9597
9597
|
if (!controller.getSelection()) throw new Error("Nothing is selected.");
|
|
9598
9598
|
controller.modifySelection(op, Math.min(500, Math.max(0, num2(radius, 0))));
|
|
9599
9599
|
return summary(controller);
|
|
@@ -9637,7 +9637,7 @@ function createImageSelectionTools(controller) {
|
|
|
9637
9637
|
type: "object",
|
|
9638
9638
|
properties: {
|
|
9639
9639
|
layerId: { type: "string", description: "Existing adjustment layer to mask." },
|
|
9640
|
-
kind: { type: "string", enum:
|
|
9640
|
+
kind: { type: "string", enum: _chunkCD7PLU77cjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
|
|
9641
9641
|
params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
|
|
9642
9642
|
density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
|
|
9643
9643
|
feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
|
|
@@ -9657,11 +9657,11 @@ function createImageSelectionTools(controller) {
|
|
|
9657
9657
|
if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
|
|
9658
9658
|
controller.applySelectionAsLayerMask(layerId, props);
|
|
9659
9659
|
id = layerId;
|
|
9660
|
-
} else if (
|
|
9660
|
+
} else if (_chunkCD7PLU77cjs.isAdjustmentKind.call(void 0, kind)) {
|
|
9661
9661
|
id = controller.addAdjustmentLayer({
|
|
9662
9662
|
kind,
|
|
9663
9663
|
params,
|
|
9664
|
-
mask:
|
|
9664
|
+
mask: _chunkCD7PLU77cjs.layerMaskFromSelection.call(void 0, sel, props)
|
|
9665
9665
|
});
|
|
9666
9666
|
} else {
|
|
9667
9667
|
throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
|
|
@@ -9798,11 +9798,11 @@ function createImageEditTools(controller) {
|
|
|
9798
9798
|
const geometry2 = () => {
|
|
9799
9799
|
const s = controller.getState();
|
|
9800
9800
|
const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
|
|
9801
|
-
const out =
|
|
9801
|
+
const out = _chunkCD7PLU77cjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
|
|
9802
9802
|
return {
|
|
9803
9803
|
image: { ...s.imageDimensions },
|
|
9804
9804
|
crop: s.crop ? { ...s.crop } : null,
|
|
9805
|
-
rotation:
|
|
9805
|
+
rotation: _chunkCD7PLU77cjs.normalizeAngle.call(void 0, s.transform.rotate),
|
|
9806
9806
|
flipH: s.transform.flipH,
|
|
9807
9807
|
flipV: s.transform.flipV,
|
|
9808
9808
|
output: { width: Math.round(out.width), height: Math.round(out.height) }
|
|
@@ -10037,7 +10037,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
10037
10037
|
const out = {
|
|
10038
10038
|
id: layer.id,
|
|
10039
10039
|
type: layer.type,
|
|
10040
|
-
name: layer.name || (layer.type === "adjustment" ?
|
|
10040
|
+
name: layer.name || (layer.type === "adjustment" ? _chunkCD7PLU77cjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
|
|
10041
10041
|
visible: layer.visible,
|
|
10042
10042
|
opacity: round3(layer.opacity),
|
|
10043
10043
|
blend: layer.blend,
|
|
@@ -10126,8 +10126,8 @@ function createImageLayerTools(controller) {
|
|
|
10126
10126
|
};
|
|
10127
10127
|
};
|
|
10128
10128
|
const exists = (id, what = "layerId") => {
|
|
10129
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10130
|
-
|
|
10129
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
|
|
10130
|
+
_chunkCD7PLU77cjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
10131
10131
|
return id;
|
|
10132
10132
|
};
|
|
10133
10133
|
const listLayers = {
|
|
@@ -10163,7 +10163,7 @@ function createImageLayerTools(controller) {
|
|
|
10163
10163
|
handler: ({ layerId, target }) => {
|
|
10164
10164
|
const id = exists(layerId);
|
|
10165
10165
|
const layer = controller.getLayer(id);
|
|
10166
|
-
if (target === "mask" && !layer.mask) throw new (0,
|
|
10166
|
+
if (target === "mask" && !layer.mask) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
10167
10167
|
controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
|
|
10168
10168
|
return { layer: describe(id), activeTarget: controller.getState().activeTarget };
|
|
10169
10169
|
}
|
|
@@ -10188,7 +10188,7 @@ function createImageLayerTools(controller) {
|
|
|
10188
10188
|
},
|
|
10189
10189
|
annotations: { title: "Add a pixel layer", ...WRITE2 },
|
|
10190
10190
|
handler: async (args) => {
|
|
10191
|
-
if (args.color !== void 0 && args.image !== void 0) throw new (0,
|
|
10191
|
+
if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give color or image, not both.");
|
|
10192
10192
|
for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
|
|
10193
10193
|
const init = {
|
|
10194
10194
|
name: args.name,
|
|
@@ -10278,7 +10278,7 @@ function createImageLayerTools(controller) {
|
|
|
10278
10278
|
const id = exists(args.layerId);
|
|
10279
10279
|
const props = {};
|
|
10280
10280
|
for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
|
|
10281
|
-
if (!Object.keys(props).length) throw new (0,
|
|
10281
|
+
if (!Object.keys(props).length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give at least one property to change.");
|
|
10282
10282
|
controller.setLayerProperties(id, props);
|
|
10283
10283
|
return { layer: describe(id) };
|
|
10284
10284
|
}
|
|
@@ -10372,8 +10372,8 @@ function createImageLayerTools(controller) {
|
|
|
10372
10372
|
annotations: { title: "Move a layer's pixels", ...WRITE2 },
|
|
10373
10373
|
handler: ({ layerId, x, y, dx, dy }) => {
|
|
10374
10374
|
const id = exists(layerId);
|
|
10375
|
-
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0,
|
|
10376
|
-
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0,
|
|
10375
|
+
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give x and y, or dx and dy.");
|
|
10376
|
+
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give x / y or dx / dy, not both.");
|
|
10377
10377
|
return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
|
|
10378
10378
|
}
|
|
10379
10379
|
};
|
|
@@ -10445,7 +10445,7 @@ function createImageLayerTools(controller) {
|
|
|
10445
10445
|
annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
|
|
10446
10446
|
handler: ({ layerId, density, feather, enabled, linked }) => {
|
|
10447
10447
|
const id = exists(layerId);
|
|
10448
|
-
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0,
|
|
10448
|
+
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give density, feather, enabled or linked.");
|
|
10449
10449
|
const mask = controller.setLayerMaskProps(id, {
|
|
10450
10450
|
density,
|
|
10451
10451
|
feather,
|
|
@@ -10528,7 +10528,7 @@ function createImageLayerTools(controller) {
|
|
|
10528
10528
|
handler: (args) => {
|
|
10529
10529
|
const id = exists(args.layerId);
|
|
10530
10530
|
const changes = filterValues(args);
|
|
10531
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10531
|
+
if (!Object.keys(changes).length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give at least one value to change.");
|
|
10532
10532
|
return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
|
|
10533
10533
|
}
|
|
10534
10534
|
};
|
|
@@ -10792,8 +10792,8 @@ function describeLayerEffects(effects) {
|
|
|
10792
10792
|
}
|
|
10793
10793
|
function createImageEffectTools(controller) {
|
|
10794
10794
|
const layerArg = (id) => {
|
|
10795
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10796
|
-
|
|
10795
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
|
|
10796
|
+
_chunkCD7PLU77cjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
10797
10797
|
return id;
|
|
10798
10798
|
};
|
|
10799
10799
|
const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
|
|
@@ -10824,7 +10824,7 @@ function createImageEffectTools(controller) {
|
|
|
10824
10824
|
annotations: { title: "Add a layer effect", ...WRITE3 },
|
|
10825
10825
|
handler: ({ layerId, kind, settings, index }) => {
|
|
10826
10826
|
const id = layerArg(layerId);
|
|
10827
|
-
if (!_chunkHGTDMKNEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0,
|
|
10827
|
+
if (!_chunkHGTDMKNEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`kind must be one of ${_chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
|
|
10828
10828
|
const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
|
|
10829
10829
|
return result(id, { effectId: effect.id });
|
|
10830
10830
|
}
|
|
@@ -10844,7 +10844,7 @@ function createImageEffectTools(controller) {
|
|
|
10844
10844
|
handler: ({ layerId, effectId, settings }) => {
|
|
10845
10845
|
const id = layerArg(layerId);
|
|
10846
10846
|
const changes = _nullishCoalesce(settings, () => ( {}));
|
|
10847
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10847
|
+
if (!Object.keys(changes).length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give at least one setting to change.");
|
|
10848
10848
|
controller.updateLayerEffect(id, effectId, changes);
|
|
10849
10849
|
return result(id);
|
|
10850
10850
|
}
|
|
@@ -10896,7 +10896,7 @@ function createImageEffectTools(controller) {
|
|
|
10896
10896
|
},
|
|
10897
10897
|
annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
|
|
10898
10898
|
handler: ({ angle, altitude }) => {
|
|
10899
|
-
if (angle === void 0 && altitude === void 0) throw new (0,
|
|
10899
|
+
if (angle === void 0 && altitude === void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give angle, altitude or both.");
|
|
10900
10900
|
const next = {};
|
|
10901
10901
|
if (angle !== void 0) next.angle = angle;
|
|
10902
10902
|
if (altitude !== void 0) next.altitude = altitude;
|
|
@@ -11078,7 +11078,7 @@ function handlePaintShortcut(controller, e) {
|
|
|
11078
11078
|
}
|
|
11079
11079
|
if (key === "]" || key === "}") {
|
|
11080
11080
|
if (e.shiftKey || key === "}") set({ hardness: Math.min(1, Math.round((brush.hardness + 0.25) * 4) / 4) });
|
|
11081
|
-
else set({ size: Math.min(
|
|
11081
|
+
else set({ size: Math.min(_chunkEBDCRTZIcjs.MAX_BRUSH_SIZE, brush.size + sizeStep(brush.size)) });
|
|
11082
11082
|
return true;
|
|
11083
11083
|
}
|
|
11084
11084
|
if (/^[0-9]$/.test(key) && isPaintTool(controller.getState().activeTool)) {
|
|
@@ -11109,7 +11109,7 @@ var PaintGesture = (_class8 = class {
|
|
|
11109
11109
|
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.`);
|
|
11110
11110
|
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.`);
|
|
11111
11111
|
const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
|
|
11112
|
-
const b =
|
|
11112
|
+
const b = _chunkCD7PLU77cjs.shapeGeometryBounds.call(void 0, layer);
|
|
11113
11113
|
return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
|
|
11114
11114
|
})();
|
|
11115
11115
|
this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
|
|
@@ -11125,7 +11125,7 @@ var PaintGesture = (_class8 = class {
|
|
|
11125
11125
|
return null;
|
|
11126
11126
|
}
|
|
11127
11127
|
} catch (err) {
|
|
11128
|
-
this.error =
|
|
11128
|
+
this.error = _chunkCD7PLU77cjs.userErrorMessage.call(void 0, err);
|
|
11129
11129
|
this.stroke = null;
|
|
11130
11130
|
this.move = null;
|
|
11131
11131
|
}
|
|
@@ -11147,7 +11147,7 @@ var PaintGesture = (_class8 = class {
|
|
|
11147
11147
|
this.controller.offsetLayer(m.id, { x, y }, !m.moved);
|
|
11148
11148
|
m.moved = true;
|
|
11149
11149
|
} catch (err) {
|
|
11150
|
-
this.error =
|
|
11150
|
+
this.error = _chunkCD7PLU77cjs.userErrorMessage.call(void 0, err);
|
|
11151
11151
|
this.move = null;
|
|
11152
11152
|
}
|
|
11153
11153
|
}
|
|
@@ -11157,7 +11157,7 @@ var PaintGesture = (_class8 = class {
|
|
|
11157
11157
|
try {
|
|
11158
11158
|
this.stroke.end();
|
|
11159
11159
|
} catch (err) {
|
|
11160
|
-
this.error =
|
|
11160
|
+
this.error = _chunkCD7PLU77cjs.userErrorMessage.call(void 0, err);
|
|
11161
11161
|
}
|
|
11162
11162
|
}
|
|
11163
11163
|
this.stroke = null;
|
|
@@ -11187,7 +11187,7 @@ var BRUSH = {
|
|
|
11187
11187
|
type: "object",
|
|
11188
11188
|
description: "Brush settings; missing fields use the current paint options (default round, hard, 20 px).",
|
|
11189
11189
|
properties: {
|
|
11190
|
-
size: { type: "number", minimum: 1, maximum:
|
|
11190
|
+
size: { type: "number", minimum: 1, maximum: _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE, description: "Diameter in px (default 20)." },
|
|
11191
11191
|
hardness: { type: "number", minimum: 0, maximum: 1, description: "Edge hardness 0 (soft) .. 1 (hard, default)." },
|
|
11192
11192
|
spacing: { type: "number", minimum: 0.01, maximum: 10, description: "Dab spacing as a fraction of the diameter (default 0.1)." },
|
|
11193
11193
|
angle: { type: "number", minimum: -360, maximum: 360, description: "Tip angle in degrees (default 0)." },
|
|
@@ -11210,7 +11210,7 @@ var MIXER = {
|
|
|
11210
11210
|
mix: { type: "number", minimum: 0, maximum: 1, description: "How far each dab's paint moves from the reservoir towards the picked-up colour, 0 .. 1 (default 0.5)." },
|
|
11211
11211
|
loadEachStroke: { type: "boolean", description: "Refill the reservoir with `color` (or the foreground) before the stroke (default true). Off, the brush keeps what is left of its last load." },
|
|
11212
11212
|
cleanEachStroke: { type: "boolean", description: "Empty the pickup well after the stroke (default true). Off, the next stroke starts with the colour this one picked up." },
|
|
11213
|
-
mixing: { type: "string", enum: [...
|
|
11213
|
+
mixing: { type: "string", enum: [..._chunkEBDCRTZIcjs.MIXING_MODELS], description: "rgb (default): RGB averages. pigment: mixes like paint (Kubelka-Munk), so blue dragged through yellow makes green." }
|
|
11214
11214
|
},
|
|
11215
11215
|
additionalProperties: false
|
|
11216
11216
|
};
|
|
@@ -11254,7 +11254,7 @@ function createImagePaintTools(controller) {
|
|
|
11254
11254
|
description: "Paint colour #rrggbb (default the foreground). On a mask its grey value: #000000 hides, #ffffff reveals. For the mixer, the colour its reservoir is loaded with before the stroke (given, it loads even with loadEachStroke false)."
|
|
11255
11255
|
},
|
|
11256
11256
|
paint: {
|
|
11257
|
-
...
|
|
11257
|
+
..._chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA,
|
|
11258
11258
|
description: "Brush only: what this stroke paints with instead of the paint options' paint (set_paint): a colour, or gradient paint that changes colour as the stroke goes (by distance, pressure, velocity, direction, time, across the tip or at random). On a mask each colour's grey value."
|
|
11259
11259
|
},
|
|
11260
11260
|
brush: BRUSH,
|
|
@@ -11267,9 +11267,9 @@ function createImagePaintTools(controller) {
|
|
|
11267
11267
|
annotations: { title: "Paint a brush stroke", ...WRITE4 },
|
|
11268
11268
|
handler: (args) => {
|
|
11269
11269
|
const tool = args.tool;
|
|
11270
|
-
if (args.mixer !== void 0 && tool !== "mixer") throw new (0,
|
|
11271
|
-
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0,
|
|
11272
|
-
if (args.paint !== void 0 && args.color !== void 0) throw new (0,
|
|
11270
|
+
if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
|
|
11271
|
+
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
|
|
11272
|
+
if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give color or paint, not both.");
|
|
11273
11273
|
const result = controller.paintStroke({
|
|
11274
11274
|
tool,
|
|
11275
11275
|
points: args.points,
|
|
@@ -11365,7 +11365,7 @@ function createImagePaintTools(controller) {
|
|
|
11365
11365
|
name: "set_paint",
|
|
11366
11366
|
title: "Set the paint (colour or gradient)",
|
|
11367
11367
|
description: `Sets what the brush paints: one colour (it becomes the foreground), or gradient paint that changes colour as the stroke goes. Gradient paint: 2..16 stops sorted by offset (#rrggbb, or "paint" / "secondary" for the foreground and background colours), space pigment (default: mixes like paint) / oklab / srgb, and map: distance (default: the colour changes as the stroke is dragged out, 300 px then mirrored back), pressure, tilt, velocity, direction, time, across-tip or random. paint_stroke with tool brush samples it per dab (on a mask, each colour's grey); the eraser and the Mixer Brush ignore it, and Fill uses the foreground. View state, not an undo step. Returns paint, foreground, background and brush.`,
|
|
11368
|
-
inputSchema: { type: "object", properties: { paint:
|
|
11368
|
+
inputSchema: { type: "object", properties: { paint: _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA }, required: ["paint"], additionalProperties: false },
|
|
11369
11369
|
annotations: { title: "Set the paint (colour or gradient)", ...SET },
|
|
11370
11370
|
handler: ({ paint }) => {
|
|
11371
11371
|
controller.setPaintOptions({ paint });
|
|
@@ -11400,7 +11400,7 @@ function profileArg(v) {
|
|
|
11400
11400
|
try {
|
|
11401
11401
|
return _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, s.slice(4));
|
|
11402
11402
|
} catch (e30) {
|
|
11403
|
-
throw new (0,
|
|
11403
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("The icc: value is not valid base64.");
|
|
11404
11404
|
}
|
|
11405
11405
|
}
|
|
11406
11406
|
return s;
|
|
@@ -11465,10 +11465,10 @@ function createImageColorTools(controller) {
|
|
|
11465
11465
|
annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11466
11466
|
handler: (args) => {
|
|
11467
11467
|
if (args.off === true) {
|
|
11468
|
-
if (args.profile !== void 0) throw new (0,
|
|
11468
|
+
if (args.profile !== void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give either off true or a profile, not both.");
|
|
11469
11469
|
return controller.setProofSetup(null);
|
|
11470
11470
|
}
|
|
11471
|
-
if (args.profile === void 0) throw new (0,
|
|
11471
|
+
if (args.profile === void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
|
|
11472
11472
|
const s = controller.setProofSetup({
|
|
11473
11473
|
profile: profileArg(args.profile),
|
|
11474
11474
|
...args.intent !== void 0 ? { intent: args.intent } : {},
|
|
@@ -11520,7 +11520,7 @@ function createImageColorTools(controller) {
|
|
|
11520
11520
|
},
|
|
11521
11521
|
annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11522
11522
|
handler: (args) => {
|
|
11523
|
-
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0,
|
|
11523
|
+
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
|
|
11524
11524
|
return controller.setColorMode(args.mode, {
|
|
11525
11525
|
...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
|
|
11526
11526
|
...args.intent !== void 0 ? { intent: args.intent } : {}
|
|
@@ -11553,7 +11553,7 @@ var BRUSH2 = {
|
|
|
11553
11553
|
type: "object",
|
|
11554
11554
|
description: "Brush tip; missing fields use the current paint options (default round, hard, 20 px).",
|
|
11555
11555
|
properties: {
|
|
11556
|
-
size: { type: "number", minimum: 1, maximum:
|
|
11556
|
+
size: { type: "number", minimum: 1, maximum: _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE, description: "Diameter in px (default 20)." },
|
|
11557
11557
|
hardness: { type: "number", minimum: 0, maximum: 1, description: "Edge hardness 0 (soft) .. 1 (hard, default). Retouching usually wants a soft tip (0..0.5)." },
|
|
11558
11558
|
spacing: { type: "number", minimum: 0.01, maximum: 10, description: "Dab spacing as a fraction of the diameter (default 0.1)." },
|
|
11559
11559
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Stroke opacity (Clone Stamp and Healing Brush only; default 1)." },
|
|
@@ -11574,7 +11574,7 @@ var TARGET2 = {
|
|
|
11574
11574
|
};
|
|
11575
11575
|
var SAMPLE = {
|
|
11576
11576
|
type: "string",
|
|
11577
|
-
enum: [...
|
|
11577
|
+
enum: [..._chunk7NW46N7Icjs.RETOUCH_SAMPLES],
|
|
11578
11578
|
description: "What is sampled: current (default: the target layer), current-below (the composite of this layer and everything under it), or all (the composite of every layer). Sample current-below or all to retouch onto an empty layer above the image."
|
|
11579
11579
|
};
|
|
11580
11580
|
function readTarget2(args) {
|
|
@@ -11585,7 +11585,7 @@ function checkSource(controller, source) {
|
|
|
11585
11585
|
const p = source;
|
|
11586
11586
|
const { width, height } = controller.getState().imageDimensions;
|
|
11587
11587
|
if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
|
|
11588
|
-
throw new (0,
|
|
11588
|
+
throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
|
|
11589
11589
|
}
|
|
11590
11590
|
return p;
|
|
11591
11591
|
}
|
|
@@ -11653,7 +11653,7 @@ function createImageRetouchTools(controller) {
|
|
|
11653
11653
|
type: "object",
|
|
11654
11654
|
properties: {
|
|
11655
11655
|
points: POINTS,
|
|
11656
|
-
type: { type: "string", enum: [...
|
|
11656
|
+
type: { type: "string", enum: [..._chunk7NW46N7Icjs.SPOT_HEAL_TYPES], description: "proximity-match (default the current option), content-aware or smooth." },
|
|
11657
11657
|
sample: SAMPLE,
|
|
11658
11658
|
brush: BRUSH2,
|
|
11659
11659
|
...TARGET2
|
|
@@ -11686,7 +11686,7 @@ function createImageRetouchTools(controller) {
|
|
|
11686
11686
|
type: "object",
|
|
11687
11687
|
properties: {
|
|
11688
11688
|
points: POINTS,
|
|
11689
|
-
range: { type: "string", enum: [...
|
|
11689
|
+
range: { type: "string", enum: [..._chunk7NW46N7Icjs.TONE_RANGES], description: `Which tones to ${verb} most: shadows, midtones (default the current option, midtones) or highlights.` },
|
|
11690
11690
|
exposure: { type: "number", minimum: 0, maximum: 1, description: "Strength 0..1 (default the current option, 0.5). Overlapping dabs in one stroke never go past it; another stroke builds on it." },
|
|
11691
11691
|
protectTones: { type: "boolean", description: "Change luma only, keeping hue and saturation (default true)." },
|
|
11692
11692
|
brush: BRUSH2,
|
|
@@ -11795,8 +11795,8 @@ function createImageRetouchTools(controller) {
|
|
|
11795
11795
|
properties: {
|
|
11796
11796
|
aligned: { type: "boolean", description: "Clone / heal: keep the offset from stroke to stroke (default true)." },
|
|
11797
11797
|
sample: SAMPLE,
|
|
11798
|
-
spotType: { type: "string", enum: [...
|
|
11799
|
-
range: { type: "string", enum: [...
|
|
11798
|
+
spotType: { type: "string", enum: [..._chunk7NW46N7Icjs.SPOT_HEAL_TYPES], description: "Spot heal: proximity-match (default), content-aware or smooth." },
|
|
11799
|
+
range: { type: "string", enum: [..._chunk7NW46N7Icjs.TONE_RANGES], description: "Dodge / burn: shadows, midtones (default) or highlights." },
|
|
11800
11800
|
exposure: { type: "number", minimum: 0, maximum: 1, description: "Dodge / burn strength 0..1 (default 0.5)." },
|
|
11801
11801
|
protectTones: { type: "boolean", description: "Dodge / burn: keep hue and saturation (default true)." },
|
|
11802
11802
|
spongeMode: { type: "string", enum: ["desaturate", "saturate"], description: "Sponge: desaturate (default) or saturate." },
|
|
@@ -11825,10 +11825,10 @@ function createImageRetouchTools(controller) {
|
|
|
11825
11825
|
annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
|
|
11826
11826
|
handler: (args) => {
|
|
11827
11827
|
if (args.clear === true) {
|
|
11828
|
-
if (args.x !== void 0 || args.y !== void 0) throw new (0,
|
|
11828
|
+
if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give either clear true or x and y, not both.");
|
|
11829
11829
|
return controller.setCloneSource(null);
|
|
11830
11830
|
}
|
|
11831
|
-
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0,
|
|
11831
|
+
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
|
|
11832
11832
|
return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
|
|
11833
11833
|
}
|
|
11834
11834
|
};
|
|
@@ -11851,7 +11851,7 @@ function createImageRetouchTools(controller) {
|
|
|
11851
11851
|
annotations: { title: "Transform the clone source", ...WRITE5, idempotentHint: false },
|
|
11852
11852
|
handler: (args) => {
|
|
11853
11853
|
if (args.reset === true) {
|
|
11854
|
-
if (Object.keys(args).some((k) => k !== "reset")) throw new (0,
|
|
11854
|
+
if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give either reset true or transform values, not both.");
|
|
11855
11855
|
return controller.setCloneTransform(null);
|
|
11856
11856
|
}
|
|
11857
11857
|
const cur = controller.getState().paint.cloneTransform;
|
|
@@ -11861,7 +11861,7 @@ function createImageRetouchTools(controller) {
|
|
|
11861
11861
|
if (args.rotate !== void 0) next.rotate = args.rotate;
|
|
11862
11862
|
if (args.flipHorizontal === true) next.scaleX = -(_nullishCoalesce(next.scaleX, () => ( cur.scaleX)));
|
|
11863
11863
|
if (args.flipVertical === true) next.scaleY = -(_nullishCoalesce(next.scaleY, () => ( cur.scaleY)));
|
|
11864
|
-
if (!Object.keys(next).length) throw new (0,
|
|
11864
|
+
if (!Object.keys(next).length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
|
|
11865
11865
|
return controller.setCloneTransform(next);
|
|
11866
11866
|
}
|
|
11867
11867
|
};
|
|
@@ -11882,11 +11882,11 @@ var DATA = {
|
|
|
11882
11882
|
description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
|
|
11883
11883
|
};
|
|
11884
11884
|
function psdBytesFromBase64(data) {
|
|
11885
|
-
if (typeof data !== "string" || !data.trim()) throw new (0,
|
|
11885
|
+
if (typeof data !== "string" || !data.trim()) throw new (0, _chunkCD7PLU77cjs.PsdError)("data is required: the PSD file as base64.");
|
|
11886
11886
|
const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
|
|
11887
|
-
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0,
|
|
11887
|
+
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkCD7PLU77cjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
|
|
11888
11888
|
const bytes = _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, body);
|
|
11889
|
-
if (bytes.length < 26) throw new (0,
|
|
11889
|
+
if (bytes.length < 26) throw new (0, _chunkCD7PLU77cjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
|
|
11890
11890
|
return bytes;
|
|
11891
11891
|
}
|
|
11892
11892
|
function createImagePsdTools(controller) {
|
|
@@ -11897,7 +11897,7 @@ function createImagePsdTools(controller) {
|
|
|
11897
11897
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
11898
11898
|
annotations: { title: "Inspect a PSD", ...READ7 },
|
|
11899
11899
|
handler: ({ data }) => {
|
|
11900
|
-
const res =
|
|
11900
|
+
const res = _chunkCD7PLU77cjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
|
|
11901
11901
|
return {
|
|
11902
11902
|
width: res.width,
|
|
11903
11903
|
height: res.height,
|
|
@@ -11984,7 +11984,7 @@ var GEOMETRY = {
|
|
|
11984
11984
|
dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
|
|
11985
11985
|
reference: {
|
|
11986
11986
|
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}.",
|
|
11987
|
-
anyOf: [{ type: "string", enum:
|
|
11987
|
+
anyOf: [{ type: "string", enum: _chunkCD7PLU77cjs.TRANSFORM_ANCHORS }, POINT]
|
|
11988
11988
|
},
|
|
11989
11989
|
matrix: {
|
|
11990
11990
|
type: "array",
|
|
@@ -12005,14 +12005,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
|
|
|
12005
12005
|
function geometryFrom(args) {
|
|
12006
12006
|
const numeric = NUMERIC.filter((k) => args[k] !== void 0);
|
|
12007
12007
|
const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
|
|
12008
|
-
if (ways === 0) throw new (0,
|
|
12009
|
-
if (ways > 1) throw new (0,
|
|
12008
|
+
if (ways === 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
|
|
12009
|
+
if (ways > 1) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
|
|
12010
12010
|
if (args.matrix !== void 0) return { matrix: args.matrix };
|
|
12011
12011
|
if (args.corners !== void 0) return { corners: args.corners };
|
|
12012
12012
|
const params = {};
|
|
12013
12013
|
for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
|
|
12014
|
-
if (params.scaleX === 0 || params.scaleY === 0) throw new (0,
|
|
12015
|
-
if (typeof params.reference === "string" && !
|
|
12014
|
+
if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
|
|
12015
|
+
if (typeof params.reference === "string" && !_chunkCD7PLU77cjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkCD7PLU77cjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
|
|
12016
12016
|
return { params };
|
|
12017
12017
|
}
|
|
12018
12018
|
function targetFrom(args) {
|
|
@@ -12061,15 +12061,15 @@ function createImageTransformTools(controller) {
|
|
|
12061
12061
|
moved: [...s.moves],
|
|
12062
12062
|
frame: { ...s.box },
|
|
12063
12063
|
corners: s.startGeometry.corners.map(roundPoint),
|
|
12064
|
-
center: roundPoint(
|
|
12064
|
+
center: roundPoint(_chunkCD7PLU77cjs.anchorPoint.call(void 0, s.startGeometry, "center"))
|
|
12065
12065
|
};
|
|
12066
12066
|
if (s.smartObject) out.smartObject = true;
|
|
12067
12067
|
s.cancel();
|
|
12068
12068
|
if (args.meshColumns !== void 0) {
|
|
12069
12069
|
const cols = args.meshColumns;
|
|
12070
12070
|
const rows = _nullishCoalesce(args.meshRows, () => ( cols));
|
|
12071
|
-
const mesh =
|
|
12072
|
-
out.mesh = { columns: cols, rows, pointsPerRow:
|
|
12071
|
+
const mesh = _chunkQMI5HZWAcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
|
|
12072
|
+
out.mesh = { columns: cols, rows, pointsPerRow: _chunkQMI5HZWAcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkQMI5HZWAcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
|
|
12073
12073
|
}
|
|
12074
12074
|
return out;
|
|
12075
12075
|
}
|
|
@@ -12094,7 +12094,7 @@ function createImageTransformTools(controller) {
|
|
|
12094
12094
|
type: "object",
|
|
12095
12095
|
properties: {
|
|
12096
12096
|
...TARGET3,
|
|
12097
|
-
style: { type: "string", enum:
|
|
12097
|
+
style: { type: "string", enum: _chunkQMI5HZWAcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
|
|
12098
12098
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
|
|
12099
12099
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
|
|
12100
12100
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
|
|
@@ -12116,11 +12116,11 @@ function createImageTransformTools(controller) {
|
|
|
12116
12116
|
annotations: { title: "Warp a layer", ...WRITE6 },
|
|
12117
12117
|
handler: (args) => {
|
|
12118
12118
|
const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
|
|
12119
|
-
if (hasPreset && args.mesh !== void 0) throw new (0,
|
|
12120
|
-
if (!hasPreset && args.mesh === void 0) throw new (0,
|
|
12119
|
+
if (hasPreset && args.mesh !== void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
|
|
12120
|
+
if (!hasPreset && args.mesh === void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give a preset style or a mesh.");
|
|
12121
12121
|
let warp;
|
|
12122
12122
|
if (hasPreset) {
|
|
12123
|
-
if (args.style === void 0) throw new (0,
|
|
12123
|
+
if (args.style === void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkQMI5HZWAcjs.WARP_STYLES.join(", ")}.`);
|
|
12124
12124
|
warp = {
|
|
12125
12125
|
style: args.style,
|
|
12126
12126
|
bend: _nullishCoalesce(args.bend, () => ( 50)),
|
|
@@ -12131,7 +12131,7 @@ function createImageTransformTools(controller) {
|
|
|
12131
12131
|
} else {
|
|
12132
12132
|
const m = args.mesh;
|
|
12133
12133
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
12134
|
-
if (m.points.length !== want) throw new (0,
|
|
12134
|
+
if (m.points.length !== want) throw new (0, _chunkCD7PLU77cjs.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}.`);
|
|
12135
12135
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
12136
12136
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
12137
12137
|
}
|
|
@@ -12226,13 +12226,13 @@ function settingsFrom(args) {
|
|
|
12226
12226
|
return out;
|
|
12227
12227
|
}
|
|
12228
12228
|
function imageArg(image) {
|
|
12229
|
-
if (typeof image !== "string" || !image.trim()) throw new (0,
|
|
12229
|
+
if (typeof image !== "string" || !image.trim()) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
|
|
12230
12230
|
return image.trim();
|
|
12231
12231
|
}
|
|
12232
12232
|
function createImageSmartObjectTools(controller) {
|
|
12233
12233
|
const smartId = (id) => {
|
|
12234
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12235
|
-
|
|
12234
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
|
|
12235
|
+
_chunkCD7PLU77cjs.requireSmartObject.call(void 0, controller.getLayers(), id);
|
|
12236
12236
|
return id;
|
|
12237
12237
|
};
|
|
12238
12238
|
const info = (id) => {
|
|
@@ -12269,7 +12269,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
12269
12269
|
},
|
|
12270
12270
|
annotations: { title: "Convert to Smart Object", ...WRITE7 },
|
|
12271
12271
|
handler: ({ layerIds, name }) => {
|
|
12272
|
-
for (const id2 of _nullishCoalesce(layerIds, () => ( [])))
|
|
12272
|
+
for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkCD7PLU77cjs.requireLayer.call(void 0, controller.getLayers(), id2);
|
|
12273
12273
|
const id = controller.convertToSmartObject(layerIds, { name });
|
|
12274
12274
|
return { layer: layerSummary(id), smartObject: info(id) };
|
|
12275
12275
|
}
|
|
@@ -12306,7 +12306,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
12306
12306
|
{
|
|
12307
12307
|
type: "object",
|
|
12308
12308
|
properties: {
|
|
12309
|
-
style: { type: "string", enum:
|
|
12309
|
+
style: { type: "string", enum: _chunkQMI5HZWAcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
|
|
12310
12310
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
|
|
12311
12311
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
|
|
12312
12312
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
|
|
@@ -12342,12 +12342,12 @@ function createImageSmartObjectTools(controller) {
|
|
|
12342
12342
|
else if (w) {
|
|
12343
12343
|
const m = w;
|
|
12344
12344
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
12345
|
-
if (m.points.length !== want) throw new (0,
|
|
12345
|
+
if (m.points.length !== want) throw new (0, _chunkCD7PLU77cjs.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}.`);
|
|
12346
12346
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
12347
12347
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
12348
12348
|
}
|
|
12349
12349
|
const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
|
|
12350
|
-
if (!keys.some((k) => args[k] !== void 0)) throw new (0,
|
|
12350
|
+
if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
|
|
12351
12351
|
const res = controller.setSmartObjectTransform(id, {
|
|
12352
12352
|
corners: args.corners,
|
|
12353
12353
|
matrix: args.matrix,
|
|
@@ -12472,7 +12472,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
12472
12472
|
handler: (args) => {
|
|
12473
12473
|
const id = smartId(args.layerId);
|
|
12474
12474
|
const changes = settingsFrom(args);
|
|
12475
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
12475
|
+
if (!Object.keys(changes).length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give at least one value to change.");
|
|
12476
12476
|
const filter = controller.updateSmartFilter(id, args.filterId, changes);
|
|
12477
12477
|
return { layerId: id, filter, smartFilters: info(id).smartFilters };
|
|
12478
12478
|
}
|
|
@@ -12793,8 +12793,8 @@ function geometry(args) {
|
|
|
12793
12793
|
}
|
|
12794
12794
|
function createImageShapeTools(controller) {
|
|
12795
12795
|
const shapeId = (id) => {
|
|
12796
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12797
|
-
|
|
12796
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
|
|
12797
|
+
_chunkCD7PLU77cjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
|
|
12798
12798
|
return id;
|
|
12799
12799
|
};
|
|
12800
12800
|
const layerSummary = (id) => {
|
|
@@ -12869,7 +12869,7 @@ function createImageShapeTools(controller) {
|
|
|
12869
12869
|
annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
|
|
12870
12870
|
handler: ({ layerId, fill, stroke, fillRule }) => {
|
|
12871
12871
|
const id = shapeId(layerId);
|
|
12872
|
-
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0,
|
|
12872
|
+
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
|
|
12873
12873
|
return controller.setShapeStyle(id, { fill, stroke, fillRule });
|
|
12874
12874
|
}
|
|
12875
12875
|
};
|
|
@@ -12918,7 +12918,7 @@ function createImageShapeTools(controller) {
|
|
|
12918
12918
|
handler: ({ layerId, componentIndex, ...rest }) => {
|
|
12919
12919
|
const id = shapeId(layerId);
|
|
12920
12920
|
const change = geometry(rest);
|
|
12921
|
-
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0,
|
|
12921
|
+
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("Give shape, subpaths or op to change.");
|
|
12922
12922
|
return controller.setShapeComponent(id, componentIndex, change);
|
|
12923
12923
|
}
|
|
12924
12924
|
};
|
|
@@ -12992,8 +12992,8 @@ function pick2(args, keys) {
|
|
|
12992
12992
|
}
|
|
12993
12993
|
function createImageTypeTools(controller) {
|
|
12994
12994
|
const typeId = (id) => {
|
|
12995
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12996
|
-
|
|
12995
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
|
|
12996
|
+
_chunkCD7PLU77cjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
|
|
12997
12997
|
return id;
|
|
12998
12998
|
};
|
|
12999
12999
|
const layerSummary = (id) => {
|
|
@@ -13073,7 +13073,7 @@ function createImageTypeTools(controller) {
|
|
|
13073
13073
|
annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
|
|
13074
13074
|
handler: (args) => {
|
|
13075
13075
|
const style = pick2(args, Object.keys(STYLE));
|
|
13076
|
-
if (!Object.keys(style).length) throw new (0,
|
|
13076
|
+
if (!Object.keys(style).length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
|
|
13077
13077
|
return controller.setTextStyle(typeId(args.layerId), style, range(args));
|
|
13078
13078
|
}
|
|
13079
13079
|
};
|
|
@@ -13085,7 +13085,7 @@ function createImageTypeTools(controller) {
|
|
|
13085
13085
|
annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
|
|
13086
13086
|
handler: (args) => {
|
|
13087
13087
|
const style = pick2(args, Object.keys(PARAGRAPH));
|
|
13088
|
-
if (!Object.keys(style).length) throw new (0,
|
|
13088
|
+
if (!Object.keys(style).length) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
|
|
13089
13089
|
return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
|
|
13090
13090
|
}
|
|
13091
13091
|
};
|
|
@@ -13107,7 +13107,7 @@ function createImageTypeTools(controller) {
|
|
|
13107
13107
|
annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
|
|
13108
13108
|
handler: ({ layerId, kind, width, height }) => {
|
|
13109
13109
|
const id = typeId(layerId);
|
|
13110
|
-
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0,
|
|
13110
|
+
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkCD7PLU77cjs.LayerOperationError)("kind box needs width and height in pixels.");
|
|
13111
13111
|
return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
|
|
13112
13112
|
}
|
|
13113
13113
|
};
|
|
@@ -13129,7 +13129,7 @@ function createImageTypeTools(controller) {
|
|
|
13129
13129
|
var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
|
|
13130
13130
|
function adjustmentsSummary(adjustments) {
|
|
13131
13131
|
return {
|
|
13132
|
-
process:
|
|
13132
|
+
process: _chunkCD7PLU77cjs.normalizeProcessVersion.call(void 0, adjustments.process),
|
|
13133
13133
|
values: readAdjustmentControls(adjustments),
|
|
13134
13134
|
layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
|
|
13135
13135
|
};
|
|
@@ -13172,7 +13172,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13172
13172
|
default: def,
|
|
13173
13173
|
...requiresProcess ? { requiresProcess } : {}
|
|
13174
13174
|
})),
|
|
13175
|
-
layerKinds:
|
|
13175
|
+
layerKinds: _chunkCD7PLU77cjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
|
|
13176
13176
|
kind,
|
|
13177
13177
|
label,
|
|
13178
13178
|
controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
|
|
@@ -13258,7 +13258,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13258
13258
|
const result = { applied, clamped };
|
|
13259
13259
|
if (typeof label === "string" && label) result.label = label;
|
|
13260
13260
|
const notes = [];
|
|
13261
|
-
if ("tint" in applied &&
|
|
13261
|
+
if ("tint" in applied && _chunkCD7PLU77cjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
|
|
13262
13262
|
notes.push("Tint has no effect on process 1 edits.");
|
|
13263
13263
|
}
|
|
13264
13264
|
if (notes.length) result.notes = notes;
|
|
@@ -13268,11 +13268,11 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13268
13268
|
const addLayer = {
|
|
13269
13269
|
name: "add_adjustment_layer",
|
|
13270
13270
|
title: "Add an adjustment layer",
|
|
13271
|
-
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " +
|
|
13271
|
+
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkCD7PLU77cjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
|
|
13272
13272
|
inputSchema: {
|
|
13273
13273
|
type: "object",
|
|
13274
13274
|
properties: {
|
|
13275
|
-
kind: { type: "string", enum:
|
|
13275
|
+
kind: { type: "string", enum: _chunkCD7PLU77cjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
|
|
13276
13276
|
params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
|
|
13277
13277
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
|
|
13278
13278
|
blend: { type: "string", enum: _chunkCWM3CUUXcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
|
|
@@ -13291,7 +13291,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13291
13291
|
openWorldHint: false
|
|
13292
13292
|
},
|
|
13293
13293
|
handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
|
|
13294
|
-
if (!
|
|
13294
|
+
if (!_chunkCD7PLU77cjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
|
|
13295
13295
|
if (blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
13296
13296
|
if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
|
|
13297
13297
|
for (const ref of [aboveId, parentId]) {
|
|
@@ -13388,7 +13388,7 @@ function boxToCurvePoint(x, y, width, height) {
|
|
|
13388
13388
|
return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
|
|
13389
13389
|
}
|
|
13390
13390
|
function curveSvgPath(points, width, height, samples = 64) {
|
|
13391
|
-
const lut =
|
|
13391
|
+
const lut = _chunkCD7PLU77cjs.curveLutFromLevels.call(void 0, points);
|
|
13392
13392
|
const n = lut.length - 1;
|
|
13393
13393
|
let d = "";
|
|
13394
13394
|
for (let i = 0; i <= samples; i++) {
|
|
@@ -13898,7 +13898,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13898
13898
|
else {
|
|
13899
13899
|
const layout = this.layout();
|
|
13900
13900
|
if (layout && layout.lines.length) {
|
|
13901
|
-
const c =
|
|
13901
|
+
const c = _chunkQMI5HZWAcjs.caretAt.call(void 0, layout, f);
|
|
13902
13902
|
const line = layout.lines[c.line];
|
|
13903
13903
|
if (to === "home") f = line.start;
|
|
13904
13904
|
else if (to === "end") {
|
|
@@ -13993,7 +13993,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13993
13993
|
styleHere() {
|
|
13994
13994
|
const layer = this.layer;
|
|
13995
13995
|
const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
|
|
13996
|
-
return
|
|
13996
|
+
return _chunkQMI5HZWAcjs.styleAt.call(void 0, layer.runs, at, _chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE);
|
|
13997
13997
|
}
|
|
13998
13998
|
info() {
|
|
13999
13999
|
return this.controller.getTextLayer(this.layerId);
|
|
@@ -14002,8 +14002,8 @@ var TextEditSession = (_class11 = class {
|
|
|
14002
14002
|
overlay() {
|
|
14003
14003
|
const layer = this.layer;
|
|
14004
14004
|
const layout = this.layout();
|
|
14005
|
-
const m =
|
|
14006
|
-
const at = (x, y) =>
|
|
14005
|
+
const m = _chunkCD7PLU77cjs.textMatrix.call(void 0, layer);
|
|
14006
|
+
const at = (x, y) => _chunkQMI5HZWAcjs.applyMatrix.call(void 0, m, { x, y });
|
|
14007
14007
|
let frame = null;
|
|
14008
14008
|
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)];
|
|
14009
14009
|
else if (layout) {
|
|
@@ -14023,7 +14023,7 @@ var TextEditSession = (_class11 = class {
|
|
|
14023
14023
|
selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
|
|
14024
14024
|
}
|
|
14025
14025
|
}
|
|
14026
|
-
const c =
|
|
14026
|
+
const c = _chunkQMI5HZWAcjs.caretAt.call(void 0, layout, this.focus);
|
|
14027
14027
|
return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
|
|
14028
14028
|
}
|
|
14029
14029
|
/** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
|
|
@@ -14038,7 +14038,7 @@ var TextEditSession = (_class11 = class {
|
|
|
14038
14038
|
}
|
|
14039
14039
|
if (this.layer.name === "Text" && this.changed) {
|
|
14040
14040
|
try {
|
|
14041
|
-
this.controller.setLayerProperties(this.layerId, { name:
|
|
14041
|
+
this.controller.setLayerProperties(this.layerId, { name: _chunkCD7PLU77cjs.typeLayerName.call(void 0, this.text) }, false);
|
|
14042
14042
|
} catch (e32) {
|
|
14043
14043
|
}
|
|
14044
14044
|
}
|
|
@@ -14049,8 +14049,8 @@ function typeLayerAt(controller, p, slop = 4) {
|
|
|
14049
14049
|
const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
|
|
14050
14050
|
for (const l of layers) {
|
|
14051
14051
|
if (!l.visible) continue;
|
|
14052
|
-
const inv = invert(
|
|
14053
|
-
const q =
|
|
14052
|
+
const inv = invert(_chunkCD7PLU77cjs.textMatrix.call(void 0, l));
|
|
14053
|
+
const q = _chunkQMI5HZWAcjs.applyMatrix.call(void 0, inv, p);
|
|
14054
14054
|
let b = null;
|
|
14055
14055
|
if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
|
|
14056
14056
|
else {
|
|
@@ -14160,7 +14160,7 @@ function layerPanelRows(layers, activeId) {
|
|
|
14160
14160
|
}
|
|
14161
14161
|
function layerLabel(layer) {
|
|
14162
14162
|
if (layer.name) return layer.name;
|
|
14163
|
-
if (layer.type === "adjustment") return
|
|
14163
|
+
if (layer.type === "adjustment") return _chunkCD7PLU77cjs.adjustmentKindLabel.call(void 0, layer.kind);
|
|
14164
14164
|
return layer.type === "group" ? "Group" : "Layer";
|
|
14165
14165
|
}
|
|
14166
14166
|
function layerBadge(layer) {
|
|
@@ -14632,7 +14632,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
|
|
|
14632
14632
|
];
|
|
14633
14633
|
var WARP_STYLE_OPTIONS = [
|
|
14634
14634
|
{ id: "custom", label: "Custom" },
|
|
14635
|
-
...
|
|
14635
|
+
..._chunkQMI5HZWAcjs.WARP_STYLES.map((id) => ({ id, label: _chunkQMI5HZWAcjs.WARP_STYLE_LABELS[id] }))
|
|
14636
14636
|
];
|
|
14637
14637
|
var WARP_GRID_OPTIONS = [
|
|
14638
14638
|
{ id: "1x1", label: "Default", columns: 1, rows: 1 },
|
|
@@ -14768,7 +14768,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14768
14768
|
setMode(mode) {
|
|
14769
14769
|
this.modeValue = mode;
|
|
14770
14770
|
const s = this.session;
|
|
14771
|
-
if (mode === "warp" && s && !this.mesh) this.mesh =
|
|
14771
|
+
if (mode === "warp" && s && !this.mesh) this.mesh = _chunkQMI5HZWAcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
|
|
14772
14772
|
this.changed();
|
|
14773
14773
|
}
|
|
14774
14774
|
/** The Warp options bar's settings. */
|
|
@@ -14790,13 +14790,13 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14790
14790
|
this.modeValue = "warp";
|
|
14791
14791
|
const next = { ...this.warpSettings, ...changes };
|
|
14792
14792
|
this.warpSettings = next;
|
|
14793
|
-
let mesh = _nullishCoalesce(this.mesh, () => (
|
|
14793
|
+
let mesh = _nullishCoalesce(this.mesh, () => ( _chunkQMI5HZWAcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
|
|
14794
14794
|
if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
|
|
14795
14795
|
const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
|
|
14796
|
-
mesh = _nullishCoalesce(
|
|
14797
|
-
mesh =
|
|
14796
|
+
mesh = _nullishCoalesce(_chunkQMI5HZWAcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkQMI5HZWAcjs.identityWarpMesh.call(void 0, s.box)));
|
|
14797
|
+
mesh = _chunkQMI5HZWAcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14798
14798
|
}
|
|
14799
|
-
if ("columns" in changes || "rows" in changes) mesh =
|
|
14799
|
+
if ("columns" in changes || "rows" in changes) mesh = _chunkQMI5HZWAcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14800
14800
|
this.mesh = mesh;
|
|
14801
14801
|
this.changed();
|
|
14802
14802
|
this.preview();
|
|
@@ -14843,11 +14843,11 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14843
14843
|
const m = this.mesh;
|
|
14844
14844
|
const at = (p) => _nullishCoalesce(_chunkQT26RHKKcjs.applyHomography.call(void 0, h, p), () => ( p));
|
|
14845
14845
|
const pts = m.points.map(at);
|
|
14846
|
-
const edit =
|
|
14846
|
+
const edit = _chunkQMI5HZWAcjs.warpMeshEditPoints.call(void 0, m);
|
|
14847
14847
|
out.handles = [];
|
|
14848
|
-
out.outline =
|
|
14848
|
+
out.outline = _chunkQMI5HZWAcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
|
|
14849
14849
|
out.warp = {
|
|
14850
|
-
curves:
|
|
14850
|
+
curves: _chunkQMI5HZWAcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
|
|
14851
14851
|
anchors: edit.anchors.map((i) => pts[i]),
|
|
14852
14852
|
handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
|
|
14853
14853
|
};
|
|
@@ -14871,7 +14871,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14871
14871
|
if (!o) return null;
|
|
14872
14872
|
if (this.modeValue === "warp" && this.mesh) {
|
|
14873
14873
|
const h = this.homography();
|
|
14874
|
-
const edit =
|
|
14874
|
+
const edit = _chunkQMI5HZWAcjs.warpMeshEditPoints.call(void 0, this.mesh);
|
|
14875
14875
|
let best2 = -1;
|
|
14876
14876
|
let bestD2 = tolerance;
|
|
14877
14877
|
for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
|
|
@@ -14916,7 +14916,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14916
14916
|
if (this.modeValue === "warp" && this.mesh && handle === "inside") {
|
|
14917
14917
|
const q = this.toFrame(p, this.corners);
|
|
14918
14918
|
if (q) {
|
|
14919
|
-
const r =
|
|
14919
|
+
const r = _chunkQMI5HZWAcjs.warpMeshParamAt.call(void 0, this.mesh, q);
|
|
14920
14920
|
st = { s: r.s, t: r.t };
|
|
14921
14921
|
}
|
|
14922
14922
|
}
|
|
@@ -14949,8 +14949,8 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14949
14949
|
if (!a || !b) return;
|
|
14950
14950
|
const delta = { x: b.x - a.x, y: b.y - a.y };
|
|
14951
14951
|
const i = meshIndex(d.handle);
|
|
14952
|
-
if (i >= 0) this.mesh =
|
|
14953
|
-
else if (d.handle === "inside" && d.st) this.mesh =
|
|
14952
|
+
if (i >= 0) this.mesh = _chunkQMI5HZWAcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
|
|
14953
|
+
else if (d.handle === "inside" && d.st) this.mesh = _chunkQMI5HZWAcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
|
|
14954
14954
|
else return;
|
|
14955
14955
|
this.warpSettings = { ...this.warpSettings, style: "custom" };
|
|
14956
14956
|
this.changed();
|
|
@@ -15074,7 +15074,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
15074
15074
|
bar() {
|
|
15075
15075
|
const s = this.session;
|
|
15076
15076
|
if (!s || !this.corners) return null;
|
|
15077
|
-
const read =
|
|
15077
|
+
const read = _chunkCD7PLU77cjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
|
|
15078
15078
|
return {
|
|
15079
15079
|
affine: read.affine,
|
|
15080
15080
|
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
@@ -15099,7 +15099,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
15099
15099
|
this.changed();
|
|
15100
15100
|
return;
|
|
15101
15101
|
}
|
|
15102
|
-
const m =
|
|
15102
|
+
const m = _chunkCD7PLU77cjs.matrixFromParams.call(void 0, s.box, {
|
|
15103
15103
|
scaleX: next.scaleX,
|
|
15104
15104
|
scaleY: next.scaleY,
|
|
15105
15105
|
rotate: next.rotate,
|
|
@@ -15109,7 +15109,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
15109
15109
|
dx: next.x - this.refBox.x,
|
|
15110
15110
|
dy: next.y - this.refBox.y
|
|
15111
15111
|
});
|
|
15112
|
-
this.setCorners(
|
|
15112
|
+
this.setCorners(_chunkCD7PLU77cjs.cornersFromMatrix.call(void 0, s.box, m));
|
|
15113
15113
|
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
15114
15114
|
this.changed();
|
|
15115
15115
|
}
|
|
@@ -16266,4 +16266,4 @@ function createImageEditorDocument(controller, options = {}) {
|
|
|
16266
16266
|
|
|
16267
16267
|
|
|
16268
16268
|
|
|
16269
|
-
exports.ADJUSTMENT_KEYS = _chunkPI45JMP7cjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkPI45JMP7cjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkPI45JMP7cjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkPI45JMP7cjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkPI45JMP7cjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkPI45JMP7cjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkPI45JMP7cjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkGNK7SESQcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkLRRCMRSLcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkLRRCMRSLcjs.CoverageMap; exports.D50 = _chunkPI45JMP7cjs.D50; exports.D65 = _chunkPI45JMP7cjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkRHXW4TA5cjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkLRRCMRSLcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkLRRCMRSLcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkGNK7SESQcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkPI45JMP7cjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkLRRCMRSLcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkLRRCMRSLcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkLRRCMRSLcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk6FUAHCVIcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkLRRCMRSLcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkGNK7SESQcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkGNK7SESQcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkPI45JMP7cjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkGNK7SESQcjs.DRY_EPS; exports.DabWalker = _chunkLRRCMRSLcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkPI45JMP7cjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkLRRCMRSLcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkGNK7SESQcjs.EX; exports.EY = _chunkGNK7SESQcjs.EY; exports.FLAG_ALIVE = _chunkGNK7SESQcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkGNK7SESQcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkGNK7SESQcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkGNK7SESQcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkGNK7SESQcjs.FLAG_TOP; exports.FLAG_WET = _chunkGNK7SESQcjs.FLAG_WET; exports.FLAT = _chunkGNK7SESQcjs.FLAT; exports.FREE_INTERVAL = _chunkGNK7SESQcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkPI45JMP7cjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkLRRCMRSLcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkLRRCMRSLcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkGNK7SESQcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkPI45JMP7cjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunk6FUAHCVIcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkPI45JMP7cjs.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.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkPI45JMP7cjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkPI45JMP7cjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkPI45JMP7cjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkPI45JMP7cjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkPI45JMP7cjs.LUMA_709; exports.LayerCompositor = _chunkPI45JMP7cjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkPI45JMP7cjs.LayerOperationError; exports.MAX_BATCH = _chunkGNK7SESQcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkLRRCMRSLcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkPI45JMP7cjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkGNK7SESQcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkGNK7SESQcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkGNK7SESQcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkPI45JMP7cjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkPI45JMP7cjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkLRRCMRSLcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkLRRCMRSLcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkLRRCMRSLcjs.MIXING_MODELS; exports.MixerStroke = _chunkLRRCMRSLcjs.MixerStroke; exports.OPP = _chunkGNK7SESQcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkLRRCMRSLcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkLRRCMRSLcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkLRRCMRSLcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkGNK7SESQcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkPI45JMP7cjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkGNK7SESQcjs.PARAM; exports.PARAM_FLOATS = _chunkGNK7SESQcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkPI45JMP7cjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkGNK7SESQcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkGNK7SESQcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkGNK7SESQcjs.PLANE; exports.PLANE_BYTES = _chunkGNK7SESQcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkPI45JMP7cjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkGNK7SESQcjs.P_D0; exports.P_EDGE = _chunkGNK7SESQcjs.P_EDGE; exports.P_FX = _chunkGNK7SESQcjs.P_FX; exports.P_FY = _chunkGNK7SESQcjs.P_FY; exports.P_H = _chunkGNK7SESQcjs.P_H; exports.P_P0 = _chunkGNK7SESQcjs.P_P0; exports.P_RHO = _chunkGNK7SESQcjs.P_RHO; exports.P_SW = _chunkGNK7SESQcjs.P_SW; exports.P_UX = _chunkGNK7SESQcjs.P_UX; exports.P_UY = _chunkGNK7SESQcjs.P_UY; exports.PaintExchange = _chunkLRRCMRSLcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkLRRCMRSLcjs.PaintGradientSampler; exports.PaintSourceError = _chunkLRRCMRSLcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkLRRCMRSLcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkPI45JMP7cjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk6FUAHCVIcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk6FUAHCVIcjs.RegionPixelSource; exports.RetouchDabStroke = _chunk6FUAHCVIcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkPI45JMP7cjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkPI45JMP7cjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkGNK7SESQcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkPI45JMP7cjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkPI45JMP7cjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkGNK7SESQcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkGNK7SESQcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkGNK7SESQcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkPI45JMP7cjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk6FUAHCVIcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkGNK7SESQcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkGNK7SESQcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkPI45JMP7cjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkLRRCMRSLcjs.SmudgeTip; exports.StrokeCoverage = _chunkLRRCMRSLcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkPI45JMP7cjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkPI45JMP7cjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkPI45JMP7cjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkPI45JMP7cjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkLRRCMRSLcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkPI45JMP7cjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk6FUAHCVIcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkPI45JMP7cjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkLRRCMRSLcjs.TileMedium; exports.TilePixelSource = _chunk6FUAHCVIcjs.TilePixelSource; exports.TileableNoise = _chunkLRRCMRSLcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk6FUAHCVIcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkGNK7SESQcjs.U_MAX; exports.VIBRANCE_GREY = _chunkPI45JMP7cjs.VIBRANCE_GREY; exports.W9 = _chunkGNK7SESQcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkRHXW4TA5cjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkRHXW4TA5cjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkGNK7SESQcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkGNK7SESQcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkGNK7SESQcjs.WET_TILE; exports.WGSL_HALO = _chunkGNK7SESQcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkGNK7SESQcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkGNK7SESQcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkGNK7SESQcjs.WetGpuEngine; exports.WetMedium = _chunkGNK7SESQcjs.WetMedium; exports.WetWorkerPool = _chunkGNK7SESQcjs.WetWorkerPool; exports.WetWorld = _chunkGNK7SESQcjs.WetWorld; exports.WetWorldError = _chunkGNK7SESQcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkPI45JMP7cjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkPI45JMP7cjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkPI45JMP7cjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkPI45JMP7cjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkPI45JMP7cjs.activeSmartFilters; exports.addLayerEffect = _chunkPI45JMP7cjs.addLayerEffect; exports.addLayerFilter = _chunkPI45JMP7cjs.addLayerFilter; exports.addPaintGradientStop = _chunkLRRCMRSLcjs.addPaintGradientStop; exports.addSmartFilter = _chunkPI45JMP7cjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkPI45JMP7cjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkPI45JMP7cjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkPI45JMP7cjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkPI45JMP7cjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkPI45JMP7cjs.anchorPoint; exports.annotationBlend = _chunkPI45JMP7cjs.annotationBlend; exports.annotationLayerFor = _chunkPI45JMP7cjs.annotationLayerFor; exports.annotationLayerName = _chunkPI45JMP7cjs.annotationLayerName; exports.annotationOfLayer = _chunkPI45JMP7cjs.annotationOfLayer; exports.annotationOfShape = _chunkPI45JMP7cjs.annotationOfShape; exports.annotationOfType = _chunkPI45JMP7cjs.annotationOfType; exports.applyAdjustmentLayers = _chunkPI45JMP7cjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkPI45JMP7cjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkPI45JMP7cjs.applyAdjustments; exports.applyBoxBlur = _chunkPI45JMP7cjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkPI45JMP7cjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkPI45JMP7cjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkPI45JMP7cjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkPI45JMP7cjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkPI45JMP7cjs.applyLegacyFloat; exports.applyMatrix3 = _chunkPI45JMP7cjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkPI45JMP7cjs.applyParams; exports.applyProcess2Adjustments = _chunkPI45JMP7cjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkPI45JMP7cjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk6FUAHCVIcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkPI45JMP7cjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkLRRCMRSLcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkLRRCMRSLcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk6FUAHCVIcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkPI45JMP7cjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk6FUAHCVIcjs.bestOffset; exports.blackWhiteGray = _chunkPI45JMP7cjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkLRRCMRSLcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkLRRCMRSLcjs.blenderDab; exports.blurFilter = _chunkPI45JMP7cjs.blurFilter; exports.borderCoverage = _chunkPI45JMP7cjs.borderCoverage; exports.boxBlurPixels = _chunk6FUAHCVIcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkPI45JMP7cjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkPI45JMP7cjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkLRRCMRSLcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkLRRCMRSLcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkLRRCMRSLcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkLRRCMRSLcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkLRRCMRSLcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkPI45JMP7cjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkPI45JMP7cjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkPI45JMP7cjs.calculateCropDrag; exports.canShareMemory = _chunkGNK7SESQcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkPI45JMP7cjs.canvasToImagePoint; exports.caretAt = _chunkRHXW4TA5cjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkPI45JMP7cjs.clampCropToImage; exports.cleanMixer = _chunkLRRCMRSLcjs.cleanMixer; exports.cloneSamplePoint = _chunk6FUAHCVIcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkPI45JMP7cjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkPI45JMP7cjs.combineSelections; exports.compileAdjustmentLayer = _chunkPI45JMP7cjs.compileAdjustmentLayer; exports.componentPath = _chunkPI45JMP7cjs.componentPath; exports.compositeDeep = _chunkPI45JMP7cjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkPI45JMP7cjs.computeSelectionBounds; exports.contentAwareFill = _chunk6FUAHCVIcjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkPI45JMP7cjs.contentsBox; exports.contentsSurface = _chunkPI45JMP7cjs.contentsSurface; exports.contractCoverage = _chunkPI45JMP7cjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkPI45JMP7cjs.convertToSmartObject; exports.copySmartObject = _chunkPI45JMP7cjs.copySmartObject; exports.cornersFromMatrix = _chunkPI45JMP7cjs.cornersFromMatrix; exports.coverageTileCoord = _chunkLRRCMRSLcjs.coverageTileCoord; exports.coverageToByte = _chunkPI45JMP7cjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkPI45JMP7cjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkLRRCMRSLcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkRHXW4TA5cjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorDocument = createImageEditorDocument; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkRHXW4TA5cjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkRHXW4TA5cjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkGNK7SESQcjs.createPigmentTools; exports.createSelectionMask = _chunkPI45JMP7cjs.createSelectionMask; exports.createShapeLayer = _chunkPI45JMP7cjs.createShapeLayer; exports.createTypeLayer = _chunkPI45JMP7cjs.createTypeLayer; exports.createWetGpuEngine = _chunkGNK7SESQcjs.createWetGpuEngine; exports.cssFont = _chunkRHXW4TA5cjs.cssFont; exports.cssFontFamily = _chunkRHXW4TA5cjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkPI45JMP7cjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkLRRCMRSLcjs.dabCoverage; exports.dabRect = _chunkLRRCMRSLcjs.dabRect; exports.decodeDeepSurface = _chunkPI45JMP7cjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkPI45JMP7cjs.decodeLayerChannel; exports.decodeLayerMask = _chunkPI45JMP7cjs.decodeLayerMask; exports.decodeMergedImage = _chunkPI45JMP7cjs.decodeMergedImage; exports.decodePlanes = _chunkPI45JMP7cjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkPI45JMP7cjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkPI45JMP7cjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunkPI45JMP7cjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkPI45JMP7cjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkPI45JMP7cjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkPI45JMP7cjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkPI45JMP7cjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkPI45JMP7cjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkPI45JMP7cjs.deserializeEffects; exports.deserializeLayer = _chunkPI45JMP7cjs.deserializeLayer; exports.deserializeLayers = _chunkPI45JMP7cjs.deserializeLayers; exports.deserializePatterns = _chunkPI45JMP7cjs.deserializePatterns; exports.deserializeSelection = _chunkPI45JMP7cjs.deserializeSelection; exports.developFilter = _chunkPI45JMP7cjs.developFilter; exports.developFromAdjustments = _chunkPI45JMP7cjs.developFromAdjustments; exports.developTarget = _chunkPI45JMP7cjs.developTarget; exports.dexp = _chunkGNK7SESQcjs.dexp; exports.dilateMask = _chunk6FUAHCVIcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkPI45JMP7cjs.distanceTransform; exports.dlog = _chunkGNK7SESQcjs.dlog; exports.documentContents = _chunkPI45JMP7cjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk6FUAHCVIcjs.dodgeBurn; exports.dodgeBurnCurve = _chunk6FUAHCVIcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkGNK7SESQcjs.dpow; exports.dragWarpMeshPoint = _chunkRHXW4TA5cjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkGNK7SESQcjs.dsincos; exports.duplicateLayer = _chunkPI45JMP7cjs.duplicateLayer; exports.edgeBits = _chunkGNK7SESQcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkPI45JMP7cjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkPI45JMP7cjs.encodeRle; exports.encodeSelectionRle = _chunkPI45JMP7cjs.encodeSelectionRle; exports.encodeSurface = _chunkPI45JMP7cjs.encodeSurface; exports.evalWarpMesh = _chunkRHXW4TA5cjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkPI45JMP7cjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkLRRCMRSLcjs.exchangeRates; exports.expNeg = _chunkGNK7SESQcjs.expNeg; exports.expandCoverage = _chunkPI45JMP7cjs.expandCoverage; exports.exportPsd = _chunkPI45JMP7cjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkPI45JMP7cjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkGNK7SESQcjs.filmPixel; exports.filmReflectance = _chunkGNK7SESQcjs.filmReflectance; exports.filterMaskCoverage = _chunkPI45JMP7cjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkGNK7SESQcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkRHXW4TA5cjs.fitParagraphRuns; exports.fitRuns = _chunkRHXW4TA5cjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkPI45JMP7cjs.flattenPath; exports.flipCorners = _chunkPI45JMP7cjs.flipCorners; exports.flowField = _chunkGNK7SESQcjs.flowField; exports.fontOf = _chunkRHXW4TA5cjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkPI45JMP7cjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkPI45JMP7cjs.geometryHomography; exports.getAnnotationBounds = _chunkPI45JMP7cjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkPI45JMP7cjs.getCropCursor; exports.getRotatedSize = _chunkPI45JMP7cjs.getRotatedSize; exports.getViewportMetrics = _chunkPI45JMP7cjs.getViewportMetrics; exports.getViewportProjection = _chunkPI45JMP7cjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkLRRCMRSLcjs.gradientDabColor; exports.grainCatch = _chunkLRRCMRSLcjs.grainCatch; exports.grainHeights = _chunkLRRCMRSLcjs.grainHeights; exports.greyMorphology = _chunkPI45JMP7cjs.greyMorphology; exports.groupLayers = _chunkPI45JMP7cjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkPI45JMP7cjs.hasResampledLegacyMask; exports.hasSurface = _chunkPI45JMP7cjs.hasSurface; exports.hasWarp = _chunkPI45JMP7cjs.hasWarp; exports.hash2 = _chunkLRRCMRSLcjs.hash2; exports.hashMaskContent = _chunkPI45JMP7cjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk6FUAHCVIcjs.healPixels; exports.hexToPaintRgb = _chunkLRRCMRSLcjs.hexToPaintRgb; exports.hexToRgb = _chunkPI45JMP7cjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkPI45JMP7cjs.hitTestAnnotation; exports.hitTestCrop = _chunkPI45JMP7cjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkPI45JMP7cjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkPI45JMP7cjs.hueRangeTables; exports.hueRangeWeight = _chunkPI45JMP7cjs.hueRangeWeight; exports.hueSaturation = _chunkPI45JMP7cjs.hueSaturation; exports.identityCurve = _chunkPI45JMP7cjs.identityCurve; exports.identityLevels = _chunkPI45JMP7cjs.identityLevels; exports.identityTransform = _chunkPI45JMP7cjs.identityTransform; exports.identityWarpMesh = _chunkRHXW4TA5cjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkPI45JMP7cjs.imageToCanvasPoint; exports.importPsd = _chunkPI45JMP7cjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkPI45JMP7cjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkPI45JMP7cjs.invertMatrix3; exports.invertSelection = _chunkPI45JMP7cjs.invertSelection; exports.isActiveFilter = _chunkPI45JMP7cjs.isActiveFilter; exports.isAdjustmentKind = _chunkPI45JMP7cjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkLRRCMRSLcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkPI45JMP7cjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkPI45JMP7cjs.isDefaultDepthMask; exports.isGradientPaint = _chunkLRRCMRSLcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk6FUAHCVIcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkPI45JMP7cjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkPI45JMP7cjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkPI45JMP7cjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkPI45JMP7cjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkPI45JMP7cjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkPI45JMP7cjs.isSelectionEmpty; exports.isSelectionMode = _chunkPI45JMP7cjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkPI45JMP7cjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkPI45JMP7cjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkPI45JMP7cjs.isTransformAnchor; exports.isValidWarp = _chunkPI45JMP7cjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkPI45JMP7cjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkGNK7SESQcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkPI45JMP7cjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkPI45JMP7cjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkPI45JMP7cjs.layerMaskFromSelection; exports.layerMaskKey = _chunkPI45JMP7cjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkPI45JMP7cjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkPI45JMP7cjs.layerTree; exports.layerTypeLabel = _chunkPI45JMP7cjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkPI45JMP7cjs.layersFromLegacy; exports.layoutText = _chunkRHXW4TA5cjs.layoutText; exports.legacyAdjustmentLayer = _chunkPI45JMP7cjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkPI45JMP7cjs.legacyMaskOf; exports.legacyView = _chunkPI45JMP7cjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkPI45JMP7cjs.levelsValue; exports.linearSrgbToXy = _chunkPI45JMP7cjs.linearSrgbToXy; exports.linearToSrgb = _chunkPI45JMP7cjs.linearToSrgb; exports.linearToSrgb8 = _chunkGNK7SESQcjs.linearToSrgb8; exports.liveComponent = _chunkPI45JMP7cjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkPI45JMP7cjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkLRRCMRSLcjs.loadMixer; exports.loadOpenTypeFont = _chunk5UEFNX24cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkGNK7SESQcjs.loadWetKernel; exports.luma = _chunk6FUAHCVIcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkPI45JMP7cjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkPI45JMP7cjs.mapSubpaths; exports.maskBounds = _chunk6FUAHCVIcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkPI45JMP7cjs.matrixFromCorners; exports.matrixFromParams = _chunkPI45JMP7cjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk6FUAHCVIcjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkPI45JMP7cjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkLRRCMRSLcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkLRRCMRSLcjs.mixerRates; exports.modifySelection = _chunkPI45JMP7cjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkPI45JMP7cjs.moveLayer; exports.moveSmartFilter = _chunkPI45JMP7cjs.moveSmartFilter; exports.mulMatrix3 = _chunkPI45JMP7cjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkPI45JMP7cjs.neutralHueRange; exports.newContentsId = _chunkPI45JMP7cjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkPI45JMP7cjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkPI45JMP7cjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkPI45JMP7cjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkPI45JMP7cjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkLRRCMRSLcjs.normalizeBlender; exports.normalizeBrush = _chunkLRRCMRSLcjs.normalizeBrush; exports.normalizeFilter = _chunkPI45JMP7cjs.normalizeFilter; exports.normalizeFlow = _chunkGNK7SESQcjs.normalizeFlow; exports.normalizeHexColor = _chunkLRRCMRSLcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkPI45JMP7cjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkPI45JMP7cjs.normalizeLiveShape; exports.normalizeMixer = _chunkLRRCMRSLcjs.normalizeMixer; exports.normalizePlacement = _chunkPI45JMP7cjs.normalizePlacement; exports.normalizeProcessVersion = _chunkPI45JMP7cjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk6FUAHCVIcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkPI45JMP7cjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkPI45JMP7cjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkPI45JMP7cjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkLRRCMRSLcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkPI45JMP7cjs.normalizeSubpaths; exports.normalizeText = _chunkPI45JMP7cjs.normalizeText; exports.normalizeTilt = _chunkGNK7SESQcjs.normalizeTilt; exports.normalizeWetParams = _chunkGNK7SESQcjs.normalizeWetParams; exports.offsetLayer = _chunkPI45JMP7cjs.offsetLayer; exports.offsetShape = _chunkPI45JMP7cjs.offsetShape; exports.offsetSmartObject = _chunkPI45JMP7cjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkGNK7SESQcjs.packWetParams; exports.paintGradientMappingFor = _chunkLRRCMRSLcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkLRRCMRSLcjs.paintPathStroke; exports.paintSourceColor = _chunkLRRCMRSLcjs.paintSourceColor; exports.paintSourceCss = _chunkLRRCMRSLcjs.paintSourceCss; exports.paragraphRanges = _chunkRHXW4TA5cjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkPI45JMP7cjs.parseAdjustmentBlock; exports.parseBlend = _chunkPI45JMP7cjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkPI45JMP7cjs.parseLfx2; exports.parseLrfx = _chunkPI45JMP7cjs.parseLrfx; exports.parseOpenTypeFont = _chunk5UEFNX24cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkLRRCMRSLcjs.parsePaintSource; exports.parsePatternBlock = _chunkPI45JMP7cjs.parsePatternBlock; exports.parseSelectionMode = _chunkPI45JMP7cjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkPI45JMP7cjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkPI45JMP7cjs.patchParagraphStyle; exports.patchTextStyle = _chunkPI45JMP7cjs.patchTextStyle; exports.pathStrokeCoverage = _chunkLRRCMRSLcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkLRRCMRSLcjs.pathStrokeDabs; exports.perDabStrength = _chunk6FUAHCVIcjs.perDabStrength; exports.photoFilterMatrix = _chunkPI45JMP7cjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkGNK7SESQcjs.pigmentColor; exports.pigmentOf = _chunkGNK7SESQcjs.pigmentOf; exports.pixelLayerBounds = _chunkPI45JMP7cjs.pixelLayerBounds; exports.pixelLayers = _chunkPI45JMP7cjs.pixelLayers; exports.pixelPigment = _chunkGNK7SESQcjs.pixelPigment; exports.placeContents = _chunkPI45JMP7cjs.placeContents; exports.placeLayer = _chunkPI45JMP7cjs.placeLayer; exports.placementAt = _chunkPI45JMP7cjs.placementAt; exports.placementBounds = _chunkPI45JMP7cjs.placementBounds; exports.placementGeometry = _chunkPI45JMP7cjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkGNK7SESQcjs.pointerPressure; exports.pointerStrokeSample = _chunkGNK7SESQcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkGNK7SESQcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkPI45JMP7cjs.posterizeValue; exports.presetWarp = _chunkPI45JMP7cjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkPI45JMP7cjs.projectImagePoint; exports.projectImageRect = _chunkPI45JMP7cjs.projectImageRect; exports.projectMaskCoverage = _chunkPI45JMP7cjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkPI45JMP7cjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkPI45JMP7cjs.psdToLayers; exports.pullWarpMesh = _chunkRHXW4TA5cjs.pullWarpMesh; exports.put255 = _chunkLRRCMRSLcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkLRRCMRSLcjs.rand01; exports.randSigned = _chunkLRRCMRSLcjs.randSigned; exports.rangeLightness = _chunkPI45JMP7cjs.rangeLightness; exports.rasterContents = _chunkPI45JMP7cjs.rasterContents; exports.rasterMaskFromLegacy = _chunkPI45JMP7cjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkPI45JMP7cjs.rasterizeCoverage; exports.rasterizeDab = _chunkLRRCMRSLcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkPI45JMP7cjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkLRRCMRSLcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkPI45JMP7cjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk6FUAHCVIcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkPI45JMP7cjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkPI45JMP7cjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkPI45JMP7cjs.removeLayer; exports.removeLayerEffect = _chunkPI45JMP7cjs.removeLayerEffect; exports.removeLayerFilter = _chunkPI45JMP7cjs.removeLayerFilter; exports.removePaintGradientStop = _chunkLRRCMRSLcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkPI45JMP7cjs.removeSmartFilter; exports.renderBrushstroke = _chunkLRRCMRSLcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkPI45JMP7cjs.renderShape; exports.renderShapeRect = _chunkPI45JMP7cjs.renderShapeRect; exports.renderSmartObject = _chunkPI45JMP7cjs.renderSmartObject; exports.renderText = _chunkPI45JMP7cjs.renderText; exports.replaceContents = _chunkPI45JMP7cjs.replaceContents; exports.replaceTextRange = _chunkPI45JMP7cjs.replaceTextRange; exports.requireLayer = _chunkPI45JMP7cjs.requireLayer; exports.requireOperation = _chunkPI45JMP7cjs.requireOperation; exports.requireShapeLayer = _chunkPI45JMP7cjs.requireShapeLayer; exports.requireSmartObject = _chunkPI45JMP7cjs.requireSmartObject; exports.requireTypeLayer = _chunkPI45JMP7cjs.requireTypeLayer; exports.requireUnlocked = _chunkPI45JMP7cjs.requireUnlocked; exports.rerender = _chunkPI45JMP7cjs.rerender; exports.rerenderShape = _chunkPI45JMP7cjs.rerenderShape; exports.rerenderText = _chunkPI45JMP7cjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkPI45JMP7cjs.resizeSelection; exports.resizeWarpMesh = _chunkRHXW4TA5cjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkPI45JMP7cjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkLRRCMRSLcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkRHXW4TA5cjs.restyleRange; exports.retouchFilter = _chunk6FUAHCVIcjs.retouchFilter; exports.reversePaintGradient = _chunkLRRCMRSLcjs.reversePaintGradient; exports.rgbToGray = _chunkPI45JMP7cjs.rgbToGray; exports.rgbToHsl = _chunkPI45JMP7cjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk6FUAHCVIcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkPI45JMP7cjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkPI45JMP7cjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkPI45JMP7cjs.sampleLut; exports.sampleToneLut = _chunkPI45JMP7cjs.sampleToneLut; exports.saturationOf = _chunk6FUAHCVIcjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkLRRCMRSLcjs.scalePaintGradient; exports.seamlessClone = _chunk6FUAHCVIcjs.seamlessClone; exports.seedFromString = _chunkLRRCMRSLcjs.seedFromString; exports.selectionArea = _chunkPI45JMP7cjs.selectionArea; exports.selectionFromCoverage = _chunkPI45JMP7cjs.selectionFromCoverage; exports.selectionFromPixels = _chunkPI45JMP7cjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkPI45JMP7cjs.selectionToCoverage; exports.selectionToPixels = _chunkPI45JMP7cjs.selectionToPixels; exports.selectionValueAt = _chunkPI45JMP7cjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkPI45JMP7cjs.serializeContents; exports.serializeEffects = _chunkPI45JMP7cjs.serializeEffects; exports.serializeLayer = _chunkPI45JMP7cjs.serializeLayer; exports.serializeLayers = _chunkPI45JMP7cjs.serializeLayers; exports.serializeLayersExternal = _chunkPI45JMP7cjs.serializeLayersExternal; exports.serializePatterns = _chunkPI45JMP7cjs.serializePatterns; exports.serializeSelection = _chunkPI45JMP7cjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkPI45JMP7cjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkPI45JMP7cjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkPI45JMP7cjs.setLayerMask; exports.setLayerProperties = _chunkPI45JMP7cjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkPI45JMP7cjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkPI45JMP7cjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkPI45JMP7cjs.setSmartPlacement; exports.shadeTile = _chunkGNK7SESQcjs.shadeTile; exports.shapeAsPixelLayer = _chunkPI45JMP7cjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkPI45JMP7cjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkPI45JMP7cjs.shapeGeometryBounds; exports.shapeLayers = _chunkPI45JMP7cjs.shapeLayers; exports.shapeOutline = _chunkPI45JMP7cjs.shapeOutline; exports.shapeRenderClip = _chunkPI45JMP7cjs.shapeRenderClip; exports.shiftCoverage = _chunkPI45JMP7cjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkPI45JMP7cjs.smartObjectLayers; exports.smoothCoverage = _chunkPI45JMP7cjs.smoothCoverage; exports.smoothPoints = _chunkLRRCMRSLcjs.smoothPoints; exports.smudgeEffect = _chunk6FUAHCVIcjs.smudgeEffect; exports.solidPaint = _chunkLRRCMRSLcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk6FUAHCVIcjs.solveMembrane; exports.spliceRuns = _chunkRHXW4TA5cjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk6FUAHCVIcjs.sponge; exports.spongeEffect = _chunk6FUAHCVIcjs.spongeEffect; exports.spotHealPixels = _chunk6FUAHCVIcjs.spotHealPixels; exports.spotHealWindow = _chunk6FUAHCVIcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkGNK7SESQcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkPI45JMP7cjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.stepSlotTs = _chunkGNK7SESQcjs.stepSlotTs; exports.strokeGrainCatch = _chunkLRRCMRSLcjs.strokeGrainCatch; exports.styleAt = _chunkRHXW4TA5cjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkPI45JMP7cjs.tempTintToXy; exports.temperatureToKelvin = _chunkPI45JMP7cjs.temperatureToKelvin; exports.textIndexAt = _chunkRHXW4TA5cjs.textIndexAt; exports.textMatrix = _chunkPI45JMP7cjs.textMatrix; exports.textOutlines = _chunkPI45JMP7cjs.textOutlines; exports.textRange = _chunkPI45JMP7cjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkLRRCMRSLcjs.tipFalloff; exports.tipReach = _chunkLRRCMRSLcjs.tipReach; exports.tipShape = _chunkLRRCMRSLcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkPI45JMP7cjs.toTextSpace; exports.toneCurve = _chunkPI45JMP7cjs.toneCurve; exports.toneLuts = _chunkPI45JMP7cjs.toneLuts; exports.toneOf = _chunk6FUAHCVIcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkPI45JMP7cjs.transformHomography; exports.transformMap = _chunkPI45JMP7cjs.transformMap; exports.transformShapeComponents = _chunkPI45JMP7cjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkPI45JMP7cjs.transformTypeLayer; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkPI45JMP7cjs.transformedBox; exports.transformedPoint = _chunkPI45JMP7cjs.transformedPoint; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkPI45JMP7cjs.typeAsPixelLayer; exports.typeFrame = _chunkPI45JMP7cjs.typeFrame; exports.typeFromAnnotation = _chunkPI45JMP7cjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkPI45JMP7cjs.typeLayerName; exports.ungroupLayer = _chunkPI45JMP7cjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkPI45JMP7cjs.unionRect; exports.unprojectCanvasPoint = _chunkPI45JMP7cjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkPI45JMP7cjs.updateLayerEffect; exports.updateLayerFilter = _chunkPI45JMP7cjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkPI45JMP7cjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkLRRCMRSLcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkPI45JMP7cjs.updateShapeLayer; exports.updateSmartFilter = _chunkPI45JMP7cjs.updateSmartFilter; exports.updateTypeLayer = _chunkPI45JMP7cjs.updateTypeLayer; exports.userErrorMessage = _chunkPI45JMP7cjs.userErrorMessage; exports.uvToXy = _chunkPI45JMP7cjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkPI45JMP7cjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkPI45JMP7cjs.vibranceLinear; exports.vibrancePixel = _chunkPI45JMP7cjs.vibrancePixel; exports.walkDabs = _chunkLRRCMRSLcjs.walkDabs; exports.warpMeshEditPoints = _chunkRHXW4TA5cjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkRHXW4TA5cjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkRHXW4TA5cjs.warpMeshParamAt; exports.warpPresetMesh = _chunkRHXW4TA5cjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkPI45JMP7cjs.wbMatrix; exports.wetGpuSupport = _chunkGNK7SESQcjs.wetGpuSupport; exports.wetSimdSupported = _chunkGNK7SESQcjs.wetSimdSupported; exports.wetSupport = _chunkGNK7SESQcjs.wetSupport; exports.whiteBalanceFromSample = _chunkPI45JMP7cjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkPI45JMP7cjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkPI45JMP7cjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkPI45JMP7cjs.withNewIds; exports.writeAdjustmentBlock = _chunkPI45JMP7cjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkPI45JMP7cjs.writeLfx2; exports.writePatternBlock = _chunkPI45JMP7cjs.writePatternBlock; exports.writePsd = _chunkPI45JMP7cjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkPI45JMP7cjs.xyToTempTint; exports.xyToUv = _chunkPI45JMP7cjs.xyToUv;
|
|
16269
|
+
exports.ADJUSTMENT_KEYS = _chunkCD7PLU77cjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkCD7PLU77cjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkCD7PLU77cjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkCD7PLU77cjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkCD7PLU77cjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkCD7PLU77cjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkCD7PLU77cjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkGNK7SESQcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkEBDCRTZIcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkEBDCRTZIcjs.CoverageMap; exports.D50 = _chunkCD7PLU77cjs.D50; exports.D65 = _chunkCD7PLU77cjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkQMI5HZWAcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkEBDCRTZIcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkEBDCRTZIcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkGNK7SESQcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkCD7PLU77cjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkEBDCRTZIcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk7NW46N7Icjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkEBDCRTZIcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkGNK7SESQcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkGNK7SESQcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkCD7PLU77cjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkGNK7SESQcjs.DRY_EPS; exports.DabWalker = _chunkEBDCRTZIcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkCD7PLU77cjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkGNK7SESQcjs.EX; exports.EY = _chunkGNK7SESQcjs.EY; exports.FLAG_ALIVE = _chunkGNK7SESQcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkGNK7SESQcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkGNK7SESQcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkGNK7SESQcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkGNK7SESQcjs.FLAG_TOP; exports.FLAG_WET = _chunkGNK7SESQcjs.FLAG_WET; exports.FLAT = _chunkGNK7SESQcjs.FLAT; exports.FREE_INTERVAL = _chunkGNK7SESQcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkCD7PLU77cjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkEBDCRTZIcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkEBDCRTZIcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkGNK7SESQcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkCD7PLU77cjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkCD7PLU77cjs.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.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkCD7PLU77cjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkCD7PLU77cjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkCD7PLU77cjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkCD7PLU77cjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkCD7PLU77cjs.LUMA_709; exports.LayerCompositor = _chunkCD7PLU77cjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkCD7PLU77cjs.LayerOperationError; exports.MAX_BATCH = _chunkGNK7SESQcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkCD7PLU77cjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkGNK7SESQcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkGNK7SESQcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkGNK7SESQcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkCD7PLU77cjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkCD7PLU77cjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkEBDCRTZIcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkEBDCRTZIcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkEBDCRTZIcjs.MIXING_MODELS; exports.MixerStroke = _chunkEBDCRTZIcjs.MixerStroke; exports.OPP = _chunkGNK7SESQcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkEBDCRTZIcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkEBDCRTZIcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkGNK7SESQcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkCD7PLU77cjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkGNK7SESQcjs.PARAM; exports.PARAM_FLOATS = _chunkGNK7SESQcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkCD7PLU77cjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkGNK7SESQcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkGNK7SESQcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkGNK7SESQcjs.PLANE; exports.PLANE_BYTES = _chunkGNK7SESQcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkCD7PLU77cjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkGNK7SESQcjs.P_D0; exports.P_EDGE = _chunkGNK7SESQcjs.P_EDGE; exports.P_FX = _chunkGNK7SESQcjs.P_FX; exports.P_FY = _chunkGNK7SESQcjs.P_FY; exports.P_H = _chunkGNK7SESQcjs.P_H; exports.P_P0 = _chunkGNK7SESQcjs.P_P0; exports.P_RHO = _chunkGNK7SESQcjs.P_RHO; exports.P_SW = _chunkGNK7SESQcjs.P_SW; exports.P_UX = _chunkGNK7SESQcjs.P_UX; exports.P_UY = _chunkGNK7SESQcjs.P_UY; exports.PaintExchange = _chunkEBDCRTZIcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkEBDCRTZIcjs.PaintGradientSampler; exports.PaintSourceError = _chunkEBDCRTZIcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkEBDCRTZIcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkCD7PLU77cjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk7NW46N7Icjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk7NW46N7Icjs.RegionPixelSource; exports.RetouchDabStroke = _chunk7NW46N7Icjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkCD7PLU77cjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkCD7PLU77cjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkGNK7SESQcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkCD7PLU77cjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkCD7PLU77cjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkGNK7SESQcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkGNK7SESQcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkGNK7SESQcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkCD7PLU77cjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk7NW46N7Icjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkGNK7SESQcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkGNK7SESQcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkCD7PLU77cjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkEBDCRTZIcjs.SmudgeTip; exports.StrokeCoverage = _chunkEBDCRTZIcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkCD7PLU77cjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkCD7PLU77cjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkCD7PLU77cjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkCD7PLU77cjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkEBDCRTZIcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkCD7PLU77cjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk7NW46N7Icjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkCD7PLU77cjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkEBDCRTZIcjs.TileMedium; exports.TilePixelSource = _chunk7NW46N7Icjs.TilePixelSource; exports.TileableNoise = _chunkEBDCRTZIcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk7NW46N7Icjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkGNK7SESQcjs.U_MAX; exports.VIBRANCE_GREY = _chunkCD7PLU77cjs.VIBRANCE_GREY; exports.W9 = _chunkGNK7SESQcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkQMI5HZWAcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkQMI5HZWAcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkGNK7SESQcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkGNK7SESQcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkGNK7SESQcjs.WET_TILE; exports.WGSL_HALO = _chunkGNK7SESQcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkGNK7SESQcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkGNK7SESQcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkGNK7SESQcjs.WetGpuEngine; exports.WetMedium = _chunkGNK7SESQcjs.WetMedium; exports.WetWorkerPool = _chunkGNK7SESQcjs.WetWorkerPool; exports.WetWorld = _chunkGNK7SESQcjs.WetWorld; exports.WetWorldError = _chunkGNK7SESQcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkCD7PLU77cjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkCD7PLU77cjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkCD7PLU77cjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkCD7PLU77cjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkCD7PLU77cjs.activeSmartFilters; exports.addLayerEffect = _chunkCD7PLU77cjs.addLayerEffect; exports.addLayerFilter = _chunkCD7PLU77cjs.addLayerFilter; exports.addPaintGradientStop = _chunkEBDCRTZIcjs.addPaintGradientStop; exports.addSmartFilter = _chunkCD7PLU77cjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkCD7PLU77cjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkCD7PLU77cjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkCD7PLU77cjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkCD7PLU77cjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkCD7PLU77cjs.anchorPoint; exports.annotationBlend = _chunkCD7PLU77cjs.annotationBlend; exports.annotationLayerFor = _chunkCD7PLU77cjs.annotationLayerFor; exports.annotationLayerName = _chunkCD7PLU77cjs.annotationLayerName; exports.annotationOfLayer = _chunkCD7PLU77cjs.annotationOfLayer; exports.annotationOfShape = _chunkCD7PLU77cjs.annotationOfShape; exports.annotationOfType = _chunkCD7PLU77cjs.annotationOfType; exports.applyAdjustmentLayers = _chunkCD7PLU77cjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkCD7PLU77cjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkCD7PLU77cjs.applyAdjustments; exports.applyBoxBlur = _chunkCD7PLU77cjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkCD7PLU77cjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkCD7PLU77cjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkCD7PLU77cjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkCD7PLU77cjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkCD7PLU77cjs.applyLegacyFloat; exports.applyMatrix3 = _chunkCD7PLU77cjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkCD7PLU77cjs.applyParams; exports.applyProcess2Adjustments = _chunkCD7PLU77cjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkCD7PLU77cjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk7NW46N7Icjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkCD7PLU77cjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkEBDCRTZIcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkEBDCRTZIcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk7NW46N7Icjs.applyToneToDeepTile; exports.backgroundLayer = _chunkCD7PLU77cjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk7NW46N7Icjs.bestOffset; exports.blackWhiteGray = _chunkCD7PLU77cjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkEBDCRTZIcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkEBDCRTZIcjs.blenderDab; exports.blurFilter = _chunkCD7PLU77cjs.blurFilter; exports.borderCoverage = _chunkCD7PLU77cjs.borderCoverage; exports.boxBlurPixels = _chunk7NW46N7Icjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkCD7PLU77cjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkCD7PLU77cjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkEBDCRTZIcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkEBDCRTZIcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkEBDCRTZIcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkEBDCRTZIcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkEBDCRTZIcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkCD7PLU77cjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkCD7PLU77cjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkCD7PLU77cjs.calculateCropDrag; exports.canShareMemory = _chunkGNK7SESQcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkCD7PLU77cjs.canvasToImagePoint; exports.caretAt = _chunkQMI5HZWAcjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkCD7PLU77cjs.clampCropToImage; exports.cleanMixer = _chunkEBDCRTZIcjs.cleanMixer; exports.cloneSamplePoint = _chunk7NW46N7Icjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkCD7PLU77cjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkCD7PLU77cjs.combineSelections; exports.compileAdjustmentLayer = _chunkCD7PLU77cjs.compileAdjustmentLayer; exports.componentPath = _chunkCD7PLU77cjs.componentPath; exports.compositeDeep = _chunkCD7PLU77cjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkCD7PLU77cjs.computeSelectionBounds; exports.contentAwareFill = _chunk7NW46N7Icjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkCD7PLU77cjs.contentsBox; exports.contentsSurface = _chunkCD7PLU77cjs.contentsSurface; exports.contractCoverage = _chunkCD7PLU77cjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkCD7PLU77cjs.convertToSmartObject; exports.copySmartObject = _chunkCD7PLU77cjs.copySmartObject; exports.cornersFromMatrix = _chunkCD7PLU77cjs.cornersFromMatrix; exports.coverageTileCoord = _chunkEBDCRTZIcjs.coverageTileCoord; exports.coverageToByte = _chunkCD7PLU77cjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkCD7PLU77cjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkEBDCRTZIcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkQMI5HZWAcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorDocument = createImageEditorDocument; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkQMI5HZWAcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkQMI5HZWAcjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkGNK7SESQcjs.createPigmentTools; exports.createSelectionMask = _chunkCD7PLU77cjs.createSelectionMask; exports.createShapeLayer = _chunkCD7PLU77cjs.createShapeLayer; exports.createTypeLayer = _chunkCD7PLU77cjs.createTypeLayer; exports.createWetGpuEngine = _chunkGNK7SESQcjs.createWetGpuEngine; exports.cssFont = _chunkQMI5HZWAcjs.cssFont; exports.cssFontFamily = _chunkQMI5HZWAcjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkCD7PLU77cjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkEBDCRTZIcjs.dabCoverage; exports.dabRect = _chunkEBDCRTZIcjs.dabRect; exports.decodeDeepSurface = _chunkCD7PLU77cjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkCD7PLU77cjs.decodeLayerChannel; exports.decodeLayerMask = _chunkCD7PLU77cjs.decodeLayerMask; exports.decodeMergedImage = _chunkCD7PLU77cjs.decodeMergedImage; exports.decodePlanes = _chunkCD7PLU77cjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkCD7PLU77cjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkCD7PLU77cjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunkCD7PLU77cjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkCD7PLU77cjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkCD7PLU77cjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkCD7PLU77cjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkCD7PLU77cjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkCD7PLU77cjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkCD7PLU77cjs.deserializeEffects; exports.deserializeLayer = _chunkCD7PLU77cjs.deserializeLayer; exports.deserializeLayers = _chunkCD7PLU77cjs.deserializeLayers; exports.deserializePatterns = _chunkCD7PLU77cjs.deserializePatterns; exports.deserializeSelection = _chunkCD7PLU77cjs.deserializeSelection; exports.developFilter = _chunkCD7PLU77cjs.developFilter; exports.developFromAdjustments = _chunkCD7PLU77cjs.developFromAdjustments; exports.developTarget = _chunkCD7PLU77cjs.developTarget; exports.dexp = _chunkGNK7SESQcjs.dexp; exports.dilateMask = _chunk7NW46N7Icjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkCD7PLU77cjs.distanceTransform; exports.dlog = _chunkGNK7SESQcjs.dlog; exports.documentContents = _chunkCD7PLU77cjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk7NW46N7Icjs.dodgeBurn; exports.dodgeBurnCurve = _chunk7NW46N7Icjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkGNK7SESQcjs.dpow; exports.dragWarpMeshPoint = _chunkQMI5HZWAcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkGNK7SESQcjs.dsincos; exports.duplicateLayer = _chunkCD7PLU77cjs.duplicateLayer; exports.edgeBits = _chunkGNK7SESQcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkCD7PLU77cjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkCD7PLU77cjs.encodeRle; exports.encodeSelectionRle = _chunkCD7PLU77cjs.encodeSelectionRle; exports.encodeSurface = _chunkCD7PLU77cjs.encodeSurface; exports.evalWarpMesh = _chunkQMI5HZWAcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkCD7PLU77cjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkEBDCRTZIcjs.exchangeRates; exports.expNeg = _chunkGNK7SESQcjs.expNeg; exports.expandCoverage = _chunkCD7PLU77cjs.expandCoverage; exports.exportPsd = _chunkCD7PLU77cjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkCD7PLU77cjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkGNK7SESQcjs.filmPixel; exports.filmReflectance = _chunkGNK7SESQcjs.filmReflectance; exports.filterMaskCoverage = _chunkCD7PLU77cjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkGNK7SESQcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkQMI5HZWAcjs.fitParagraphRuns; exports.fitRuns = _chunkQMI5HZWAcjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkCD7PLU77cjs.flattenPath; exports.flipCorners = _chunkCD7PLU77cjs.flipCorners; exports.flowField = _chunkGNK7SESQcjs.flowField; exports.fontOf = _chunkQMI5HZWAcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkCD7PLU77cjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkCD7PLU77cjs.geometryHomography; exports.getAnnotationBounds = _chunkCD7PLU77cjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkCD7PLU77cjs.getCropCursor; exports.getRotatedSize = _chunkCD7PLU77cjs.getRotatedSize; exports.getViewportMetrics = _chunkCD7PLU77cjs.getViewportMetrics; exports.getViewportProjection = _chunkCD7PLU77cjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkEBDCRTZIcjs.gradientDabColor; exports.grainCatch = _chunkEBDCRTZIcjs.grainCatch; exports.grainHeights = _chunkEBDCRTZIcjs.grainHeights; exports.greyMorphology = _chunkCD7PLU77cjs.greyMorphology; exports.groupLayers = _chunkCD7PLU77cjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkCD7PLU77cjs.hasResampledLegacyMask; exports.hasSurface = _chunkCD7PLU77cjs.hasSurface; exports.hasWarp = _chunkCD7PLU77cjs.hasWarp; exports.hash2 = _chunkEBDCRTZIcjs.hash2; exports.hashMaskContent = _chunkCD7PLU77cjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk7NW46N7Icjs.healPixels; exports.hexToPaintRgb = _chunkEBDCRTZIcjs.hexToPaintRgb; exports.hexToRgb = _chunkCD7PLU77cjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkCD7PLU77cjs.hitTestAnnotation; exports.hitTestCrop = _chunkCD7PLU77cjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkCD7PLU77cjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkCD7PLU77cjs.hueRangeTables; exports.hueRangeWeight = _chunkCD7PLU77cjs.hueRangeWeight; exports.hueSaturation = _chunkCD7PLU77cjs.hueSaturation; exports.identityCurve = _chunkCD7PLU77cjs.identityCurve; exports.identityLevels = _chunkCD7PLU77cjs.identityLevels; exports.identityTransform = _chunkCD7PLU77cjs.identityTransform; exports.identityWarpMesh = _chunkQMI5HZWAcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkCD7PLU77cjs.imageToCanvasPoint; exports.importPsd = _chunkCD7PLU77cjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkCD7PLU77cjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkCD7PLU77cjs.invertMatrix3; exports.invertSelection = _chunkCD7PLU77cjs.invertSelection; exports.isActiveFilter = _chunkCD7PLU77cjs.isActiveFilter; exports.isAdjustmentKind = _chunkCD7PLU77cjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkEBDCRTZIcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkCD7PLU77cjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkCD7PLU77cjs.isDefaultDepthMask; exports.isGradientPaint = _chunkEBDCRTZIcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk7NW46N7Icjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkCD7PLU77cjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkCD7PLU77cjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkCD7PLU77cjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkCD7PLU77cjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkCD7PLU77cjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkCD7PLU77cjs.isSelectionEmpty; exports.isSelectionMode = _chunkCD7PLU77cjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkCD7PLU77cjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkCD7PLU77cjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkCD7PLU77cjs.isTransformAnchor; exports.isValidWarp = _chunkCD7PLU77cjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkCD7PLU77cjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkGNK7SESQcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkCD7PLU77cjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkCD7PLU77cjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkCD7PLU77cjs.layerMaskFromSelection; exports.layerMaskKey = _chunkCD7PLU77cjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkCD7PLU77cjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkCD7PLU77cjs.layerTree; exports.layerTypeLabel = _chunkCD7PLU77cjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkCD7PLU77cjs.layersFromLegacy; exports.layoutText = _chunkQMI5HZWAcjs.layoutText; exports.legacyAdjustmentLayer = _chunkCD7PLU77cjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkCD7PLU77cjs.legacyMaskOf; exports.legacyView = _chunkCD7PLU77cjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkCD7PLU77cjs.levelsValue; exports.linearSrgbToXy = _chunkCD7PLU77cjs.linearSrgbToXy; exports.linearToSrgb = _chunkCD7PLU77cjs.linearToSrgb; exports.linearToSrgb8 = _chunkGNK7SESQcjs.linearToSrgb8; exports.liveComponent = _chunkCD7PLU77cjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkCD7PLU77cjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkEBDCRTZIcjs.loadMixer; exports.loadOpenTypeFont = _chunk5UEFNX24cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkGNK7SESQcjs.loadWetKernel; exports.luma = _chunk7NW46N7Icjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkCD7PLU77cjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkCD7PLU77cjs.mapSubpaths; exports.maskBounds = _chunk7NW46N7Icjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkCD7PLU77cjs.matrixFromCorners; exports.matrixFromParams = _chunkCD7PLU77cjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk7NW46N7Icjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkCD7PLU77cjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkEBDCRTZIcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkEBDCRTZIcjs.mixerRates; exports.modifySelection = _chunkCD7PLU77cjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkCD7PLU77cjs.moveLayer; exports.moveSmartFilter = _chunkCD7PLU77cjs.moveSmartFilter; exports.mulMatrix3 = _chunkCD7PLU77cjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkCD7PLU77cjs.neutralHueRange; exports.newContentsId = _chunkCD7PLU77cjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkCD7PLU77cjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkCD7PLU77cjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkCD7PLU77cjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkCD7PLU77cjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkEBDCRTZIcjs.normalizeBlender; exports.normalizeBrush = _chunkEBDCRTZIcjs.normalizeBrush; exports.normalizeFilter = _chunkCD7PLU77cjs.normalizeFilter; exports.normalizeFlow = _chunkGNK7SESQcjs.normalizeFlow; exports.normalizeHexColor = _chunkEBDCRTZIcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkCD7PLU77cjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkCD7PLU77cjs.normalizeLiveShape; exports.normalizeMixer = _chunkEBDCRTZIcjs.normalizeMixer; exports.normalizePlacement = _chunkCD7PLU77cjs.normalizePlacement; exports.normalizeProcessVersion = _chunkCD7PLU77cjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk7NW46N7Icjs.normalizeRetouch; exports.normalizeShapePaint = _chunkCD7PLU77cjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkCD7PLU77cjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkCD7PLU77cjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkEBDCRTZIcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkCD7PLU77cjs.normalizeSubpaths; exports.normalizeText = _chunkCD7PLU77cjs.normalizeText; exports.normalizeTilt = _chunkGNK7SESQcjs.normalizeTilt; exports.normalizeWetParams = _chunkGNK7SESQcjs.normalizeWetParams; exports.offsetLayer = _chunkCD7PLU77cjs.offsetLayer; exports.offsetShape = _chunkCD7PLU77cjs.offsetShape; exports.offsetSmartObject = _chunkCD7PLU77cjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkGNK7SESQcjs.packWetParams; exports.paintGradientMappingFor = _chunkEBDCRTZIcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkEBDCRTZIcjs.paintPathStroke; exports.paintSourceColor = _chunkEBDCRTZIcjs.paintSourceColor; exports.paintSourceCss = _chunkEBDCRTZIcjs.paintSourceCss; exports.paragraphRanges = _chunkQMI5HZWAcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkCD7PLU77cjs.parseAdjustmentBlock; exports.parseBlend = _chunkCD7PLU77cjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkCD7PLU77cjs.parseLfx2; exports.parseLrfx = _chunkCD7PLU77cjs.parseLrfx; exports.parseOpenTypeFont = _chunk5UEFNX24cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkEBDCRTZIcjs.parsePaintSource; exports.parsePatternBlock = _chunkCD7PLU77cjs.parsePatternBlock; exports.parseSelectionMode = _chunkCD7PLU77cjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkCD7PLU77cjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkCD7PLU77cjs.patchParagraphStyle; exports.patchTextStyle = _chunkCD7PLU77cjs.patchTextStyle; exports.pathStrokeCoverage = _chunkEBDCRTZIcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkEBDCRTZIcjs.pathStrokeDabs; exports.perDabStrength = _chunk7NW46N7Icjs.perDabStrength; exports.photoFilterMatrix = _chunkCD7PLU77cjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkGNK7SESQcjs.pigmentColor; exports.pigmentOf = _chunkGNK7SESQcjs.pigmentOf; exports.pixelLayerBounds = _chunkCD7PLU77cjs.pixelLayerBounds; exports.pixelLayers = _chunkCD7PLU77cjs.pixelLayers; exports.pixelPigment = _chunkGNK7SESQcjs.pixelPigment; exports.placeContents = _chunkCD7PLU77cjs.placeContents; exports.placeLayer = _chunkCD7PLU77cjs.placeLayer; exports.placementAt = _chunkCD7PLU77cjs.placementAt; exports.placementBounds = _chunkCD7PLU77cjs.placementBounds; exports.placementGeometry = _chunkCD7PLU77cjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkGNK7SESQcjs.pointerPressure; exports.pointerStrokeSample = _chunkGNK7SESQcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkGNK7SESQcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkCD7PLU77cjs.posterizeValue; exports.presetWarp = _chunkCD7PLU77cjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkCD7PLU77cjs.projectImagePoint; exports.projectImageRect = _chunkCD7PLU77cjs.projectImageRect; exports.projectMaskCoverage = _chunkCD7PLU77cjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkCD7PLU77cjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkCD7PLU77cjs.psdToLayers; exports.pullWarpMesh = _chunkQMI5HZWAcjs.pullWarpMesh; exports.put255 = _chunkEBDCRTZIcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkEBDCRTZIcjs.rand01; exports.randSigned = _chunkEBDCRTZIcjs.randSigned; exports.rangeLightness = _chunkCD7PLU77cjs.rangeLightness; exports.rasterContents = _chunkCD7PLU77cjs.rasterContents; exports.rasterMaskFromLegacy = _chunkCD7PLU77cjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkCD7PLU77cjs.rasterizeCoverage; exports.rasterizeDab = _chunkEBDCRTZIcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkCD7PLU77cjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkEBDCRTZIcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkCD7PLU77cjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk7NW46N7Icjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkCD7PLU77cjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkCD7PLU77cjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkCD7PLU77cjs.removeLayer; exports.removeLayerEffect = _chunkCD7PLU77cjs.removeLayerEffect; exports.removeLayerFilter = _chunkCD7PLU77cjs.removeLayerFilter; exports.removePaintGradientStop = _chunkEBDCRTZIcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkCD7PLU77cjs.removeSmartFilter; exports.renderBrushstroke = _chunkEBDCRTZIcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkCD7PLU77cjs.renderShape; exports.renderShapeRect = _chunkCD7PLU77cjs.renderShapeRect; exports.renderSmartObject = _chunkCD7PLU77cjs.renderSmartObject; exports.renderText = _chunkCD7PLU77cjs.renderText; exports.replaceContents = _chunkCD7PLU77cjs.replaceContents; exports.replaceTextRange = _chunkCD7PLU77cjs.replaceTextRange; exports.requireLayer = _chunkCD7PLU77cjs.requireLayer; exports.requireOperation = _chunkCD7PLU77cjs.requireOperation; exports.requireShapeLayer = _chunkCD7PLU77cjs.requireShapeLayer; exports.requireSmartObject = _chunkCD7PLU77cjs.requireSmartObject; exports.requireTypeLayer = _chunkCD7PLU77cjs.requireTypeLayer; exports.requireUnlocked = _chunkCD7PLU77cjs.requireUnlocked; exports.rerender = _chunkCD7PLU77cjs.rerender; exports.rerenderShape = _chunkCD7PLU77cjs.rerenderShape; exports.rerenderText = _chunkCD7PLU77cjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkCD7PLU77cjs.resizeSelection; exports.resizeWarpMesh = _chunkQMI5HZWAcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkCD7PLU77cjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkEBDCRTZIcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkQMI5HZWAcjs.restyleRange; exports.retouchFilter = _chunk7NW46N7Icjs.retouchFilter; exports.reversePaintGradient = _chunkEBDCRTZIcjs.reversePaintGradient; exports.rgbToGray = _chunkCD7PLU77cjs.rgbToGray; exports.rgbToHsl = _chunkCD7PLU77cjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk7NW46N7Icjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkCD7PLU77cjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkCD7PLU77cjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkCD7PLU77cjs.sampleLut; exports.sampleToneLut = _chunkCD7PLU77cjs.sampleToneLut; exports.saturationOf = _chunk7NW46N7Icjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkEBDCRTZIcjs.scalePaintGradient; exports.seamlessClone = _chunk7NW46N7Icjs.seamlessClone; exports.seedFromString = _chunkEBDCRTZIcjs.seedFromString; exports.selectionArea = _chunkCD7PLU77cjs.selectionArea; exports.selectionFromCoverage = _chunkCD7PLU77cjs.selectionFromCoverage; exports.selectionFromPixels = _chunkCD7PLU77cjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkCD7PLU77cjs.selectionToCoverage; exports.selectionToPixels = _chunkCD7PLU77cjs.selectionToPixels; exports.selectionValueAt = _chunkCD7PLU77cjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkCD7PLU77cjs.serializeContents; exports.serializeEffects = _chunkCD7PLU77cjs.serializeEffects; exports.serializeLayer = _chunkCD7PLU77cjs.serializeLayer; exports.serializeLayers = _chunkCD7PLU77cjs.serializeLayers; exports.serializeLayersExternal = _chunkCD7PLU77cjs.serializeLayersExternal; exports.serializePatterns = _chunkCD7PLU77cjs.serializePatterns; exports.serializeSelection = _chunkCD7PLU77cjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkCD7PLU77cjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkCD7PLU77cjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkCD7PLU77cjs.setLayerMask; exports.setLayerProperties = _chunkCD7PLU77cjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkCD7PLU77cjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkCD7PLU77cjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkCD7PLU77cjs.setSmartPlacement; exports.shadeTile = _chunkGNK7SESQcjs.shadeTile; exports.shapeAsPixelLayer = _chunkCD7PLU77cjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkCD7PLU77cjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkCD7PLU77cjs.shapeGeometryBounds; exports.shapeLayers = _chunkCD7PLU77cjs.shapeLayers; exports.shapeOutline = _chunkCD7PLU77cjs.shapeOutline; exports.shapeRenderClip = _chunkCD7PLU77cjs.shapeRenderClip; exports.shiftCoverage = _chunkCD7PLU77cjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkCD7PLU77cjs.smartObjectLayers; exports.smoothCoverage = _chunkCD7PLU77cjs.smoothCoverage; exports.smoothPoints = _chunkEBDCRTZIcjs.smoothPoints; exports.smudgeEffect = _chunk7NW46N7Icjs.smudgeEffect; exports.solidPaint = _chunkEBDCRTZIcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk7NW46N7Icjs.solveMembrane; exports.spliceRuns = _chunkQMI5HZWAcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk7NW46N7Icjs.sponge; exports.spongeEffect = _chunk7NW46N7Icjs.spongeEffect; exports.spotHealPixels = _chunk7NW46N7Icjs.spotHealPixels; exports.spotHealWindow = _chunk7NW46N7Icjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkGNK7SESQcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkCD7PLU77cjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.stepSlotTs = _chunkGNK7SESQcjs.stepSlotTs; exports.strokeGrainCatch = _chunkEBDCRTZIcjs.strokeGrainCatch; exports.styleAt = _chunkQMI5HZWAcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkCD7PLU77cjs.tempTintToXy; exports.temperatureToKelvin = _chunkCD7PLU77cjs.temperatureToKelvin; exports.textIndexAt = _chunkQMI5HZWAcjs.textIndexAt; exports.textMatrix = _chunkCD7PLU77cjs.textMatrix; exports.textOutlines = _chunkCD7PLU77cjs.textOutlines; exports.textRange = _chunkCD7PLU77cjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkEBDCRTZIcjs.tipFalloff; exports.tipReach = _chunkEBDCRTZIcjs.tipReach; exports.tipShape = _chunkEBDCRTZIcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkCD7PLU77cjs.toTextSpace; exports.toneCurve = _chunkCD7PLU77cjs.toneCurve; exports.toneLuts = _chunkCD7PLU77cjs.toneLuts; exports.toneOf = _chunk7NW46N7Icjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkCD7PLU77cjs.transformHomography; exports.transformMap = _chunkCD7PLU77cjs.transformMap; exports.transformShapeComponents = _chunkCD7PLU77cjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkCD7PLU77cjs.transformTypeLayer; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkCD7PLU77cjs.transformedBox; exports.transformedPoint = _chunkCD7PLU77cjs.transformedPoint; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkCD7PLU77cjs.typeAsPixelLayer; exports.typeFrame = _chunkCD7PLU77cjs.typeFrame; exports.typeFromAnnotation = _chunkCD7PLU77cjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkCD7PLU77cjs.typeLayerName; exports.ungroupLayer = _chunkCD7PLU77cjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkCD7PLU77cjs.unionRect; exports.unprojectCanvasPoint = _chunkCD7PLU77cjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkCD7PLU77cjs.updateLayerEffect; exports.updateLayerFilter = _chunkCD7PLU77cjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkCD7PLU77cjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkEBDCRTZIcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkCD7PLU77cjs.updateShapeLayer; exports.updateSmartFilter = _chunkCD7PLU77cjs.updateSmartFilter; exports.updateTypeLayer = _chunkCD7PLU77cjs.updateTypeLayer; exports.userErrorMessage = _chunkCD7PLU77cjs.userErrorMessage; exports.uvToXy = _chunkCD7PLU77cjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkCD7PLU77cjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkCD7PLU77cjs.vibranceLinear; exports.vibrancePixel = _chunkCD7PLU77cjs.vibrancePixel; exports.walkDabs = _chunkEBDCRTZIcjs.walkDabs; exports.warpMeshEditPoints = _chunkQMI5HZWAcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkQMI5HZWAcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkQMI5HZWAcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkQMI5HZWAcjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkCD7PLU77cjs.wbMatrix; exports.wetGpuSupport = _chunkGNK7SESQcjs.wetGpuSupport; exports.wetSimdSupported = _chunkGNK7SESQcjs.wetSimdSupported; exports.wetSupport = _chunkGNK7SESQcjs.wetSupport; exports.whiteBalanceFromSample = _chunkCD7PLU77cjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkCD7PLU77cjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkCD7PLU77cjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkCD7PLU77cjs.withNewIds; exports.writeAdjustmentBlock = _chunkCD7PLU77cjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkCD7PLU77cjs.writeLfx2; exports.writePatternBlock = _chunkCD7PLU77cjs.writePatternBlock; exports.writePsd = _chunkCD7PLU77cjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkCD7PLU77cjs.xyToTempTint; exports.xyToUv = _chunkCD7PLU77cjs.xyToUv;
|