@pixerate/editor 0.129.0 → 0.130.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation-editor/index.cjs +55 -55
- package/dist/animation-editor/index.d.cts +5 -5
- package/dist/animation-editor/index.d.ts +5 -5
- package/dist/animation-editor/index.js +2 -2
- package/dist/{bezier-CvgQiYRg.d.cts → bezier-CdoGygwG.d.cts} +1 -1
- package/dist/{bezier-DP4NnJp3.d.ts → bezier-CigmusV_.d.ts} +1 -1
- package/dist/canvas/index.d.cts +7 -7
- package/dist/canvas/index.d.ts +7 -7
- package/dist/{chunk-BEGEWQHD.cjs → chunk-2PXRKMOH.cjs} +36 -36
- package/dist/{chunk-BEGEWQHD.cjs.map → chunk-2PXRKMOH.cjs.map} +1 -1
- package/dist/{chunk-F7Q2NE2Y.js → chunk-ERYGCA72.js} +2 -2
- package/dist/{chunk-A6KHMKI4.js → chunk-L5OTIYOO.js} +2 -2
- package/dist/{chunk-ORE334I6.cjs → chunk-LXGOYRPE.cjs} +366 -68
- package/dist/chunk-LXGOYRPE.cjs.map +1 -0
- package/dist/{chunk-XLUYXUBD.cjs → chunk-PMHPXCJC.cjs} +82 -82
- package/dist/{chunk-XLUYXUBD.cjs.map → chunk-PMHPXCJC.cjs.map} +1 -1
- package/dist/{chunk-ROZFX4QI.js → chunk-PRYMC442.js} +302 -4
- package/dist/chunk-PRYMC442.js.map +1 -0
- package/dist/effects/index.d.cts +4 -4
- package/dist/effects/index.d.ts +4 -4
- package/dist/{export-Cbr9IqpJ.d.cts → export-5WDKJqTy.d.cts} +1 -1
- package/dist/{export-DotEEyXj.d.ts → export-B4r8b9Ft.d.ts} +3 -3
- package/dist/{export-ClPKUB-v.d.ts → export-CU_ARP3A.d.ts} +1 -1
- package/dist/{export-DRzNhrdx.d.cts → export-CejjC2iI.d.cts} +3 -3
- package/dist/{helpers-C5aAd44p.d.cts → helpers-CzZu51eI.d.cts} +33 -2
- package/dist/{helpers-CPWcK504.d.ts → helpers-X_rycLNJ.d.ts} +33 -2
- package/dist/image-editor/index.cjs +606 -606
- package/dist/image-editor/index.d.cts +8 -8
- package/dist/image-editor/index.d.ts +8 -8
- package/dist/image-editor/index.js +2 -2
- package/dist/{opentype-sQrF3Ry1.d.ts → opentype-CrHAsKh3.d.ts} +2 -2
- package/dist/{opentype-BOewaGQx.d.cts → opentype-DlRMYcCW.d.cts} +2 -2
- package/dist/paint-editor/index.cjs +7 -7
- package/dist/paint-editor/index.d.cts +5 -5
- package/dist/paint-editor/index.d.ts +5 -5
- package/dist/paint-editor/index.js +2 -2
- package/dist/{pathfinder-CnkW7zLI.d.cts → pathfinder-CKfKOVP4.d.cts} +1 -1
- package/dist/{pathfinder-BwJx0_zM.d.ts → pathfinder-Dlss70hL.d.ts} +1 -1
- package/dist/{pool-CTrtciaN.d.ts → pool-DDOo0xJH.d.ts} +1 -1
- package/dist/{pool-C7GtrL34.d.cts → pool-DKic69LD.d.cts} +1 -1
- package/dist/{svg-C4LlFnEw.d.cts → svg-BRaii3pI.d.cts} +2 -2
- package/dist/{svg-CUzZa0EO.d.ts → svg-BYVZeVo0.d.ts} +2 -2
- package/dist/{tools-BpCmUNxb.d.cts → tools-CtheDLDr.d.cts} +1 -1
- package/dist/{tools-AugT22z3.d.ts → tools-D8bZ-7YG.d.ts} +1 -1
- package/dist/vector/index.cjs +884 -874
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +53 -10
- package/dist/vector/index.d.ts +53 -10
- package/dist/vector/index.js +15 -5
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.d.cts +4 -4
- package/dist/video-editor/index.d.ts +4 -4
- package/dist/{warp-D62N_5VK.d.cts → warp-BFoYxy_s.d.cts} +2 -2
- package/dist/{warp-CIsO617e.d.ts → warp-CZVC8pB5.d.ts} +2 -2
- package/package.json +1 -1
- package/skills/pixerate-vector/SKILL.md +1 -1
- package/skills/pixerate-vector/references/commands.md +1 -0
- package/dist/chunk-ORE334I6.cjs.map +0 -1
- package/dist/chunk-ROZFX4QI.js.map +0 -1
- /package/dist/{chunk-F7Q2NE2Y.js.map → chunk-ERYGCA72.js.map} +0 -0
- /package/dist/{chunk-A6KHMKI4.js.map → chunk-L5OTIYOO.js.map} +0 -0
|
@@ -362,7 +362,7 @@ var _chunk2OJACTPRcjs = require('../chunk-2OJACTPR.cjs');
|
|
|
362
362
|
|
|
363
363
|
|
|
364
364
|
|
|
365
|
-
var
|
|
365
|
+
var _chunkPMHPXCJCcjs = require('../chunk-PMHPXCJC.cjs');
|
|
366
366
|
|
|
367
367
|
|
|
368
368
|
var _chunk2YQONY6Gcjs = require('../chunk-2YQONY6G.cjs');
|
|
@@ -802,7 +802,7 @@ var _chunk643B2HKCcjs = require('../chunk-643B2HKC.cjs');
|
|
|
802
802
|
|
|
803
803
|
|
|
804
804
|
|
|
805
|
-
var
|
|
805
|
+
var _chunkLXGOYRPEcjs = require('../chunk-LXGOYRPE.cjs');
|
|
806
806
|
require('../chunk-BJTCSLF6.cjs');
|
|
807
807
|
require('../chunk-IZ4WRXZA.cjs');
|
|
808
808
|
|
|
@@ -920,7 +920,7 @@ function quickMaskPixels(mask, style = {}) {
|
|
|
920
920
|
|
|
921
921
|
// src/image-editor/layers/render.ts
|
|
922
922
|
function isQuarterTurn(rotate) {
|
|
923
|
-
return
|
|
923
|
+
return _chunkPMHPXCJCcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
|
|
924
924
|
}
|
|
925
925
|
function isIntegerRect(r) {
|
|
926
926
|
return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
|
|
@@ -928,7 +928,7 @@ function isIntegerRect(r) {
|
|
|
928
928
|
function baseProjection(region, transform, baseW, baseH) {
|
|
929
929
|
return {
|
|
930
930
|
region,
|
|
931
|
-
angle:
|
|
931
|
+
angle: _chunkPMHPXCJCcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
932
932
|
flipH: transform.flipH,
|
|
933
933
|
flipV: transform.flipV,
|
|
934
934
|
scale: 1,
|
|
@@ -937,14 +937,14 @@ function baseProjection(region, transform, baseW, baseH) {
|
|
|
937
937
|
};
|
|
938
938
|
}
|
|
939
939
|
function projectQuarterTurn(src, srcRect, region, transform) {
|
|
940
|
-
const rotated =
|
|
940
|
+
const rotated = _chunkPMHPXCJCcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
941
941
|
const w = Math.max(1, Math.round(rotated.width));
|
|
942
942
|
const h = Math.max(1, Math.round(rotated.height));
|
|
943
943
|
const out = new Uint8ClampedArray(w * h * 4);
|
|
944
944
|
const p = baseProjection(region, transform, w, h);
|
|
945
|
-
const o =
|
|
946
|
-
const ox =
|
|
947
|
-
const oy =
|
|
945
|
+
const o = _chunkPMHPXCJCcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
|
|
946
|
+
const ox = _chunkPMHPXCJCcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
|
|
947
|
+
const oy = _chunkPMHPXCJCcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
|
|
948
948
|
const ux = Math.round(ox.x - o.x);
|
|
949
949
|
const vx = Math.round(ox.y - o.y);
|
|
950
950
|
const uy = Math.round(oy.x - o.x);
|
|
@@ -973,23 +973,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
|
|
|
973
973
|
const d = img.data;
|
|
974
974
|
for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
|
|
975
975
|
}
|
|
976
|
-
if (legacyOutputBlur && legacyOutputBlur > 0)
|
|
976
|
+
if (legacyOutputBlur && legacyOutputBlur > 0) _chunkPMHPXCJCcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
|
|
977
977
|
}
|
|
978
978
|
function needsLegacyBase(input) {
|
|
979
979
|
const { stack, region, canvas, transform } = input;
|
|
980
|
-
if (!
|
|
980
|
+
if (!_chunkPMHPXCJCcjs.isLegacyShape.call(void 0, stack)) return false;
|
|
981
981
|
const bg = stack.layers[0];
|
|
982
982
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
|
|
983
983
|
if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
|
|
984
984
|
if (stack.outputOpacity < 1) return true;
|
|
985
|
-
const blur =
|
|
985
|
+
const blur = _chunkPMHPXCJCcjs.blurFilter.call(void 0, bg);
|
|
986
986
|
if (blur && blur.enabled && blur.radius > 0) {
|
|
987
987
|
const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
|
|
988
|
-
const angle =
|
|
988
|
+
const angle = _chunkPMHPXCJCcjs.normalizeAngle.call(void 0, transform.rotate);
|
|
989
989
|
if (!full || angle === 90 || angle === 270) return true;
|
|
990
990
|
}
|
|
991
991
|
if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
|
|
992
|
-
if (
|
|
992
|
+
if (_chunkPMHPXCJCcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
|
|
993
993
|
return false;
|
|
994
994
|
}
|
|
995
995
|
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;
|
|
@@ -1021,7 +1021,7 @@ function coveringRect(region) {
|
|
|
1021
1021
|
const y = Math.floor(region.y);
|
|
1022
1022
|
return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
|
|
1023
1023
|
}
|
|
1024
|
-
function renderLayeredBase(stack, region, transform, sources, compositor = new (0,
|
|
1024
|
+
function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkPMHPXCJCcjs.LayerCompositor)()) {
|
|
1025
1025
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
|
|
1026
1026
|
throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
|
|
1027
1027
|
}
|
|
@@ -1155,8 +1155,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1155
1155
|
* The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
|
|
1156
1156
|
* trust dirty rectangles; exports use `exportCompositor`.
|
|
1157
1157
|
*/
|
|
1158
|
-
__init8() {this.compositor = new (0,
|
|
1159
|
-
__init9() {this.exportCompositor = new (0,
|
|
1158
|
+
__init8() {this.compositor = new (0, _chunkPMHPXCJCcjs.LayerCompositor)()}
|
|
1159
|
+
__init9() {this.exportCompositor = new (0, _chunkPMHPXCJCcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
|
|
1160
1160
|
/** How the host resolves layer pixels (set by the controller). */
|
|
1161
1161
|
|
|
1162
1162
|
/**
|
|
@@ -1233,9 +1233,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1233
1233
|
return;
|
|
1234
1234
|
}
|
|
1235
1235
|
const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
|
|
1236
|
-
const projection =
|
|
1236
|
+
const projection = _chunkPMHPXCJCcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
|
|
1237
1237
|
const { region } = projection;
|
|
1238
|
-
const rotated =
|
|
1238
|
+
const rotated = _chunkPMHPXCJCcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1239
1239
|
const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
|
|
1240
1240
|
let overlay = annotations;
|
|
1241
1241
|
if (route === "legacy") {
|
|
@@ -1245,8 +1245,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1245
1245
|
`${naturalWidth}x${naturalHeight}`,
|
|
1246
1246
|
`${region.x},${region.y},${region.width},${region.height}`,
|
|
1247
1247
|
`${projection.angle},${transform.flipH},${transform.flipV}`,
|
|
1248
|
-
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${
|
|
1249
|
-
|
|
1248
|
+
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkPMHPXCJCcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
|
|
1249
|
+
_chunkPMHPXCJCcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
|
|
1250
1250
|
`${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}`,
|
|
1251
1251
|
`d${this.displayKey}`
|
|
1252
1252
|
].join("|");
|
|
@@ -1280,7 +1280,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1280
1280
|
}
|
|
1281
1281
|
if (overlay.length > 0 || options.draftAnnotation) {
|
|
1282
1282
|
ctx.save();
|
|
1283
|
-
|
|
1283
|
+
_chunkPMHPXCJCcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1284
1284
|
ctx.beginPath();
|
|
1285
1285
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1286
1286
|
ctx.clip();
|
|
@@ -1303,7 +1303,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1303
1303
|
if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
|
|
1304
1304
|
ctx.save();
|
|
1305
1305
|
try {
|
|
1306
|
-
|
|
1306
|
+
_chunkPMHPXCJCcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1307
1307
|
ctx.beginPath();
|
|
1308
1308
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1309
1309
|
ctx.clip();
|
|
@@ -1318,7 +1318,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1318
1318
|
const b = options.brushCursor;
|
|
1319
1319
|
ctx.save();
|
|
1320
1320
|
try {
|
|
1321
|
-
|
|
1321
|
+
_chunkPMHPXCJCcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1322
1322
|
const px2 = 1 / (projection.scale || 1);
|
|
1323
1323
|
ctx.beginPath();
|
|
1324
1324
|
ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
|
|
@@ -1336,7 +1336,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1336
1336
|
const t = options.textEdit;
|
|
1337
1337
|
ctx.save();
|
|
1338
1338
|
try {
|
|
1339
|
-
const scr = (p) =>
|
|
1339
|
+
const scr = (p) => _chunkPMHPXCJCcjs.projectImagePoint.call(void 0, p, projection);
|
|
1340
1340
|
const poly = (pts) => {
|
|
1341
1341
|
ctx.beginPath();
|
|
1342
1342
|
pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
|
|
@@ -1375,7 +1375,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1375
1375
|
const t = options.freeTransform;
|
|
1376
1376
|
ctx.save();
|
|
1377
1377
|
try {
|
|
1378
|
-
const scr = (p) =>
|
|
1378
|
+
const scr = (p) => _chunkPMHPXCJCcjs.projectImagePoint.call(void 0, p, projection);
|
|
1379
1379
|
ctx.beginPath();
|
|
1380
1380
|
if (t.warp) {
|
|
1381
1381
|
for (const c of t.warp.curves) {
|
|
@@ -1433,7 +1433,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1433
1433
|
}
|
|
1434
1434
|
if (isActivelyCropping) {
|
|
1435
1435
|
const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
|
|
1436
|
-
this.drawCropOverlay(ctx,
|
|
1436
|
+
this.drawCropOverlay(ctx, _chunkPMHPXCJCcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
1439
|
/**
|
|
@@ -1442,7 +1442,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1442
1442
|
*/
|
|
1443
1443
|
async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
|
|
1444
1444
|
const { adjustments, depthMask } = state;
|
|
1445
|
-
const rotated =
|
|
1445
|
+
const rotated = _chunkPMHPXCJCcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1446
1446
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1447
1447
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1448
1448
|
const baseCanvas = this.createCanvas(baseW, baseH);
|
|
@@ -1450,7 +1450,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1450
1450
|
if (!baseCtx) return baseCanvas;
|
|
1451
1451
|
const projection = getBaseProjection(region, transform, baseW, baseH);
|
|
1452
1452
|
baseCtx.save();
|
|
1453
|
-
|
|
1453
|
+
_chunkPMHPXCJCcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
|
|
1454
1454
|
baseCtx.drawImage(
|
|
1455
1455
|
img,
|
|
1456
1456
|
region.x,
|
|
@@ -1465,8 +1465,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1465
1465
|
baseCtx.restore();
|
|
1466
1466
|
const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
|
|
1467
1467
|
if (imageData) {
|
|
1468
|
-
const layerMasks =
|
|
1469
|
-
|
|
1468
|
+
const layerMasks = _chunkPMHPXCJCcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
|
|
1469
|
+
_chunkPMHPXCJCcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
|
|
1470
1470
|
if (depthMask.enabled && depthMask.maskSource) {
|
|
1471
1471
|
try {
|
|
1472
1472
|
const maskImg = await this.imageCache.get(depthMask.maskSource);
|
|
@@ -1477,7 +1477,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1477
1477
|
const maskCtx = maskCanvas.getContext("2d");
|
|
1478
1478
|
if (maskCtx) {
|
|
1479
1479
|
maskCtx.save();
|
|
1480
|
-
|
|
1480
|
+
_chunkPMHPXCJCcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
|
|
1481
1481
|
maskCtx.drawImage(
|
|
1482
1482
|
maskImg,
|
|
1483
1483
|
region.x * sx,
|
|
@@ -1492,7 +1492,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1492
1492
|
maskCtx.restore();
|
|
1493
1493
|
const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
|
|
1494
1494
|
if (maskData) {
|
|
1495
|
-
|
|
1495
|
+
_chunkPMHPXCJCcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
|
|
1496
1496
|
}
|
|
1497
1497
|
}
|
|
1498
1498
|
} catch (e7) {
|
|
@@ -1511,7 +1511,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1511
1511
|
else if (this.baseRoute === "layers") route = "layers";
|
|
1512
1512
|
else {
|
|
1513
1513
|
const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
|
|
1514
|
-
const shaped = this.baseRoute === "legacy" &&
|
|
1514
|
+
const shaped = this.baseRoute === "legacy" && _chunkPMHPXCJCcjs.isLegacyShape.call(void 0, stack);
|
|
1515
1515
|
route = shaped || needsLegacyBase({
|
|
1516
1516
|
stack,
|
|
1517
1517
|
region,
|
|
@@ -1646,17 +1646,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1646
1646
|
if (!comp) return null;
|
|
1647
1647
|
const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
|
|
1648
1648
|
const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
|
|
1649
|
-
const rotated =
|
|
1649
|
+
const rotated = _chunkPMHPXCJCcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1650
1650
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1651
1651
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1652
|
-
const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${
|
|
1652
|
+
const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkPMHPXCJCcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
|
|
1653
1653
|
if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
|
|
1654
1654
|
const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
|
|
1655
1655
|
const ctx = canvas.getContext("2d");
|
|
1656
1656
|
if (!ctx) return null;
|
|
1657
1657
|
ctx.clearRect(0, 0, baseW, baseH);
|
|
1658
1658
|
ctx.save();
|
|
1659
|
-
|
|
1659
|
+
_chunkPMHPXCJCcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
|
|
1660
1660
|
ctx.beginPath();
|
|
1661
1661
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1662
1662
|
ctx.clip();
|
|
@@ -1928,7 +1928,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1928
1928
|
ctx.strokeStyle = "#3b82f6";
|
|
1929
1929
|
ctx.lineWidth = 1.5;
|
|
1930
1930
|
ctx.setLineDash([4, 4]);
|
|
1931
|
-
const bounds =
|
|
1931
|
+
const bounds = _chunkPMHPXCJCcjs.getAnnotationBounds.call(void 0, ann);
|
|
1932
1932
|
const pad = 4;
|
|
1933
1933
|
ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
|
|
1934
1934
|
ctx.fillStyle = "#ffffff";
|
|
@@ -1949,7 +1949,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1949
1949
|
}
|
|
1950
1950
|
/** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
|
|
1951
1951
|
getAnnotationBounds(ann) {
|
|
1952
|
-
return
|
|
1952
|
+
return _chunkPMHPXCJCcjs.getAnnotationBounds.call(void 0, ann);
|
|
1953
1953
|
}
|
|
1954
1954
|
/**
|
|
1955
1955
|
* Draws a rule-of-thirds crop grid overlay. All rectangles come from
|
|
@@ -2031,8 +2031,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2031
2031
|
}
|
|
2032
2032
|
const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
|
|
2033
2033
|
const { crop, transform, annotations } = state;
|
|
2034
|
-
const region = crop ?
|
|
2035
|
-
const rotated =
|
|
2034
|
+
const region = crop ? _chunkPMHPXCJCcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
|
|
2035
|
+
const rotated = _chunkPMHPXCJCcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
2036
2036
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
2037
2037
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
2038
2038
|
const exportW = options.width || baseW;
|
|
@@ -2061,7 +2061,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2061
2061
|
const bctx = baseCanvas.getContext("2d");
|
|
2062
2062
|
if (bctx) {
|
|
2063
2063
|
bctx.save();
|
|
2064
|
-
|
|
2064
|
+
_chunkPMHPXCJCcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
|
|
2065
2065
|
bctx.beginPath();
|
|
2066
2066
|
bctx.rect(region.x, region.y, region.width, region.height);
|
|
2067
2067
|
bctx.clip();
|
|
@@ -2074,7 +2074,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2074
2074
|
if (options.includeAnnotations !== false && overlay.length > 0) {
|
|
2075
2075
|
ctx.save();
|
|
2076
2076
|
ctx.scale(exportW / baseW, exportH / baseH);
|
|
2077
|
-
|
|
2077
|
+
_chunkPMHPXCJCcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
|
|
2078
2078
|
for (const ann of overlay) {
|
|
2079
2079
|
await this.drawAnnotation(ctx, ann);
|
|
2080
2080
|
}
|
|
@@ -2164,7 +2164,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2164
2164
|
case "rect":
|
|
2165
2165
|
case "image":
|
|
2166
2166
|
case "text": {
|
|
2167
|
-
const b =
|
|
2167
|
+
const b = _chunkPMHPXCJCcjs.getAnnotationBounds.call(void 0, ann);
|
|
2168
2168
|
ctx.fillRect(b.x, b.y, b.width, b.height);
|
|
2169
2169
|
break;
|
|
2170
2170
|
}
|
|
@@ -2184,7 +2184,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
|
|
|
2184
2184
|
function getBaseProjection(region, transform, baseW, baseH) {
|
|
2185
2185
|
return {
|
|
2186
2186
|
region,
|
|
2187
|
-
angle:
|
|
2187
|
+
angle: _chunkPMHPXCJCcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
2188
2188
|
flipH: transform.flipH,
|
|
2189
2189
|
flipV: transform.flipV,
|
|
2190
2190
|
scale: 1,
|
|
@@ -2288,8 +2288,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
2288
2288
|
}
|
|
2289
2289
|
function toMask(width, height, coverage) {
|
|
2290
2290
|
const out = new Uint8Array(coverage.length);
|
|
2291
|
-
for (let i = 0; i < out.length; i++) out[i] =
|
|
2292
|
-
return
|
|
2291
|
+
for (let i = 0; i < out.length; i++) out[i] = _chunkPMHPXCJCcjs.coverageToByte.call(void 0, coverage[i]);
|
|
2292
|
+
return _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, width, height, out);
|
|
2293
2293
|
}
|
|
2294
2294
|
function polygonSelection(width, height, points, options = {}) {
|
|
2295
2295
|
return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
|
|
@@ -2416,7 +2416,7 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2416
2416
|
const { width: w, height: h } = pixels;
|
|
2417
2417
|
const sx = Math.floor(seed.x);
|
|
2418
2418
|
const sy = Math.floor(seed.y);
|
|
2419
|
-
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return
|
|
2419
|
+
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, w, h);
|
|
2420
2420
|
const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
|
|
2421
2421
|
const marks = new Uint8Array(n);
|
|
2422
2422
|
let bx0 = w;
|
|
@@ -2464,9 +2464,9 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2464
2464
|
}
|
|
2465
2465
|
}
|
|
2466
2466
|
}
|
|
2467
|
-
if (bx1 < 0) return
|
|
2468
|
-
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return
|
|
2469
|
-
return
|
|
2467
|
+
if (bx1 < 0) return _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, w, h);
|
|
2468
|
+
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, w, h, marks);
|
|
2469
|
+
return _chunkPMHPXCJCcjs.createSelectionMask.call(void 0,
|
|
2470
2470
|
w,
|
|
2471
2471
|
h,
|
|
2472
2472
|
antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
|
|
@@ -2488,7 +2488,7 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2488
2488
|
const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
|
|
2489
2489
|
const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
|
|
2490
2490
|
const out = new Uint8Array(n);
|
|
2491
|
-
if (!parsed.length) return
|
|
2491
|
+
if (!parsed.length) return _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2492
2492
|
for (let i = 0; i < n; i++) {
|
|
2493
2493
|
const p = i * 4;
|
|
2494
2494
|
if (data[p + 3] <= 0) continue;
|
|
@@ -2504,9 +2504,9 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2504
2504
|
}
|
|
2505
2505
|
if (k > best) best = k;
|
|
2506
2506
|
}
|
|
2507
|
-
out[i] =
|
|
2507
|
+
out[i] = _chunkPMHPXCJCcjs.coverageToByte.call(void 0, best);
|
|
2508
2508
|
}
|
|
2509
|
-
return
|
|
2509
|
+
return _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2510
2510
|
}
|
|
2511
2511
|
var TONE_RANGE_PRESETS = {
|
|
2512
2512
|
shadows: [0, 65],
|
|
@@ -2524,9 +2524,9 @@ function toneRange(pixels, range, falloff = 20) {
|
|
|
2524
2524
|
if (d[p + 3] <= 0) continue;
|
|
2525
2525
|
const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
|
|
2526
2526
|
const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
|
|
2527
|
-
out[i] =
|
|
2527
|
+
out[i] = _chunkPMHPXCJCcjs.coverageToByte.call(void 0, 1 - outside / ramp);
|
|
2528
2528
|
}
|
|
2529
|
-
return
|
|
2529
|
+
return _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2530
2530
|
}
|
|
2531
2531
|
function hueRange(pixels, center) {
|
|
2532
2532
|
const n = checkPixels(pixels);
|
|
@@ -2549,9 +2549,9 @@ function hueRange(pixels, center) {
|
|
|
2549
2549
|
hue *= 60;
|
|
2550
2550
|
let dh = ((hue - center) % 360 + 360) % 360;
|
|
2551
2551
|
dh = Math.min(dh, 360 - dh);
|
|
2552
|
-
out[i] =
|
|
2552
|
+
out[i] = _chunkPMHPXCJCcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
|
|
2553
2553
|
}
|
|
2554
|
-
return
|
|
2554
|
+
return _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2555
2555
|
}
|
|
2556
2556
|
|
|
2557
2557
|
// src/image-editor/selection/refine.ts
|
|
@@ -2685,9 +2685,9 @@ function edgeWidth(guide, w, h, r) {
|
|
|
2685
2685
|
g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
|
|
2686
2686
|
}
|
|
2687
2687
|
}
|
|
2688
|
-
const gm =
|
|
2689
|
-
const hi =
|
|
2690
|
-
const lo =
|
|
2688
|
+
const gm = _chunkPMHPXCJCcjs.greyMorphology.call(void 0, g, w, h, r, true);
|
|
2689
|
+
const hi = _chunkPMHPXCJCcjs.greyMorphology.call(void 0, y, w, h, r, true);
|
|
2690
|
+
const lo = _chunkPMHPXCJCcjs.greyMorphology.call(void 0, y, w, h, r, false);
|
|
2691
2691
|
const out = new Float32Array(n);
|
|
2692
2692
|
for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
|
|
2693
2693
|
return out;
|
|
@@ -2711,7 +2711,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2711
2711
|
}
|
|
2712
2712
|
}
|
|
2713
2713
|
if (any) {
|
|
2714
|
-
const dist =
|
|
2714
|
+
const dist = _chunkPMHPXCJCcjs.distanceTransform.call(void 0, boundary, w, h);
|
|
2715
2715
|
const r = gfRadius(p);
|
|
2716
2716
|
const q = guidedFilterColor(guide, m, w, h, r);
|
|
2717
2717
|
const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
|
|
@@ -2737,7 +2737,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2737
2737
|
for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
|
|
2738
2738
|
}
|
|
2739
2739
|
const amount = shiftAmount(p);
|
|
2740
|
-
if (Math.abs(amount) >= 1e-4) a =
|
|
2740
|
+
if (Math.abs(amount) >= 1e-4) a = _chunkPMHPXCJCcjs.shiftCoverage.call(void 0, a, w, h, amount);
|
|
2741
2741
|
return a;
|
|
2742
2742
|
}
|
|
2743
2743
|
function guidePlanes(pixels, win) {
|
|
@@ -2781,9 +2781,9 @@ function refineSelection(pixels, mask, params = {}) {
|
|
|
2781
2781
|
const out = new Uint8Array(mask.width * mask.height);
|
|
2782
2782
|
for (let y = 0; y < wh; y++) {
|
|
2783
2783
|
const dst = (y0 + y) * mask.width + x0;
|
|
2784
|
-
for (let x = 0; x < ww; x++) out[dst + x] =
|
|
2784
|
+
for (let x = 0; x < ww; x++) out[dst + x] = _chunkPMHPXCJCcjs.coverageToByte.call(void 0, refined[y * ww + x]);
|
|
2785
2785
|
}
|
|
2786
|
-
return
|
|
2786
|
+
return _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
|
|
2787
2787
|
}
|
|
2788
2788
|
|
|
2789
2789
|
// src/image-editor/effects.ts
|
|
@@ -2953,7 +2953,7 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
2953
2953
|
// src/image-editor/free-transform.ts
|
|
2954
2954
|
var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
|
|
2955
2955
|
var fail = (message) => {
|
|
2956
|
-
throw new (0,
|
|
2956
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(message);
|
|
2957
2957
|
};
|
|
2958
2958
|
var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
|
|
2959
2959
|
function previewStep(scale) {
|
|
@@ -3062,7 +3062,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3062
3062
|
} else {
|
|
3063
3063
|
const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
|
|
3064
3064
|
if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
|
|
3065
|
-
const layer =
|
|
3065
|
+
const layer = _chunkPMHPXCJCcjs.requireLayer.call(void 0, layers, id).layer;
|
|
3066
3066
|
this.layerId = layer.id;
|
|
3067
3067
|
const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
|
|
3068
3068
|
const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
|
|
@@ -3073,20 +3073,20 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3073
3073
|
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.`);
|
|
3074
3074
|
if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
|
|
3075
3075
|
if (content !== "selection-copy") {
|
|
3076
|
-
|
|
3077
|
-
if (!maskAlone)
|
|
3076
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
|
|
3077
|
+
if (!maskAlone) _chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
|
|
3078
3078
|
}
|
|
3079
3079
|
const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
3080
3080
|
const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
|
|
3081
3081
|
if (layer.type === "smart" && !maskAlone) {
|
|
3082
3082
|
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).`);
|
|
3083
|
-
if (!
|
|
3083
|
+
if (!_chunkPMHPXCJCcjs.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.`);
|
|
3084
3084
|
this.smart = layer;
|
|
3085
3085
|
this.smartObject = true;
|
|
3086
|
-
this.startGeometry =
|
|
3086
|
+
this.startGeometry = _chunkPMHPXCJCcjs.placementGeometry.call(void 0, layer);
|
|
3087
3087
|
if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
|
|
3088
3088
|
this.startInterp = this.interp;
|
|
3089
|
-
this.box =
|
|
3089
|
+
this.box = _chunkPMHPXCJCcjs.contentsBox.call(void 0, layer.contents);
|
|
3090
3090
|
this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
|
|
3091
3091
|
this.geometryValue = this.startGeometry;
|
|
3092
3092
|
this.shown = this.startLayers;
|
|
@@ -3094,8 +3094,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3094
3094
|
}
|
|
3095
3095
|
if (layer.type === "type" && !maskAlone) {
|
|
3096
3096
|
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).`);
|
|
3097
|
-
const frame =
|
|
3098
|
-
const m =
|
|
3097
|
+
const frame = _chunkPMHPXCJCcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
|
|
3098
|
+
const m = _chunkPMHPXCJCcjs.textMatrix.call(void 0, layer);
|
|
3099
3099
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
3100
3100
|
this.typeTarget = layer;
|
|
3101
3101
|
this.typeLayer = true;
|
|
@@ -3114,7 +3114,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3114
3114
|
}
|
|
3115
3115
|
if (layer.type === "shape" && !maskAlone) {
|
|
3116
3116
|
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).`);
|
|
3117
|
-
const g =
|
|
3117
|
+
const g = _chunkPMHPXCJCcjs.shapeGeometryBounds.call(void 0, layer);
|
|
3118
3118
|
if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
|
|
3119
3119
|
const w = Math.max(g.width, 1);
|
|
3120
3120
|
const h = Math.max(g.height, 1);
|
|
@@ -3162,7 +3162,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3162
3162
|
if (box) {
|
|
3163
3163
|
const copy = {
|
|
3164
3164
|
type: "pixel",
|
|
3165
|
-
id:
|
|
3165
|
+
id: _chunkPMHPXCJCcjs.newLayerId.call(void 0, ),
|
|
3166
3166
|
name: `${layer.name || "Layer"} copy`,
|
|
3167
3167
|
visible: true,
|
|
3168
3168
|
opacity: 1,
|
|
@@ -3186,7 +3186,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3186
3186
|
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).");
|
|
3187
3187
|
this.box = box;
|
|
3188
3188
|
this.moves = moves;
|
|
3189
|
-
this.startGeometry =
|
|
3189
|
+
this.startGeometry = _chunkPMHPXCJCcjs.identityTransform.call(void 0, box);
|
|
3190
3190
|
this.startInterp = this.interp;
|
|
3191
3191
|
this.geometryValue = this.startGeometry;
|
|
3192
3192
|
this.shown = this.startLayers;
|
|
@@ -3264,8 +3264,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3264
3264
|
warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
|
|
3265
3265
|
};
|
|
3266
3266
|
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.");
|
|
3267
|
-
if (!
|
|
3268
|
-
if (this.typeTarget && (
|
|
3267
|
+
if (!_chunkPMHPXCJCcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
|
|
3268
|
+
if (this.typeTarget && (_chunkPMHPXCJCcjs.hasWarp.call(void 0, next) || !_chunkPMHPXCJCcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
|
|
3269
3269
|
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.");
|
|
3270
3270
|
}
|
|
3271
3271
|
this.geometryValue = next;
|
|
@@ -3277,10 +3277,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3277
3277
|
if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
|
|
3278
3278
|
if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
|
|
3279
3279
|
const g = this.geometryValue;
|
|
3280
|
-
const identity =
|
|
3281
|
-
const warp =
|
|
3282
|
-
const h = warp ? null :
|
|
3283
|
-
const f = warp ?
|
|
3280
|
+
const identity = _chunkPMHPXCJCcjs.isIdentityTransform.call(void 0, g);
|
|
3281
|
+
const warp = _chunkPMHPXCJCcjs.hasWarp.call(void 0, g);
|
|
3282
|
+
const h = warp ? null : _chunkPMHPXCJCcjs.geometryHomography.call(void 0, g);
|
|
3283
|
+
const f = warp ? _chunkPMHPXCJCcjs.transformMap.call(void 0, g) : null;
|
|
3284
3284
|
const step = final ? 1 : previewStep(preview.scale);
|
|
3285
3285
|
const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
|
|
3286
3286
|
let layers = this.startLayers;
|
|
@@ -3324,7 +3324,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3324
3324
|
if (part.what === "selection") {
|
|
3325
3325
|
const { width, height } = this.host.canvas();
|
|
3326
3326
|
const data = new Uint8Array(_chunkJ5BA3BQ6cjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
|
|
3327
|
-
const next =
|
|
3327
|
+
const next = _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, width, height, data);
|
|
3328
3328
|
selection = next.bounds ? next : null;
|
|
3329
3329
|
} else if (part.what === "pixels") {
|
|
3330
3330
|
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, targetId, (l) => {
|
|
@@ -3346,14 +3346,14 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3346
3346
|
resampleShape(final, preview, warpMap, h) {
|
|
3347
3347
|
const layer = this.shape;
|
|
3348
3348
|
let components = layer.components;
|
|
3349
|
-
if (!
|
|
3349
|
+
if (!_chunkPMHPXCJCcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
|
|
3350
3350
|
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;
|
|
3351
3351
|
const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p)));
|
|
3352
|
-
components =
|
|
3352
|
+
components = _chunkPMHPXCJCcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
|
|
3353
3353
|
}
|
|
3354
3354
|
const moved = { ...layer, components };
|
|
3355
3355
|
delete moved.annotation;
|
|
3356
|
-
const surface =
|
|
3356
|
+
const surface = _chunkPMHPXCJCcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
|
|
3357
3357
|
return _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
|
|
3358
3358
|
}
|
|
3359
3359
|
/**
|
|
@@ -3363,13 +3363,13 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3363
3363
|
resampleType() {
|
|
3364
3364
|
const layer = this.typeTarget;
|
|
3365
3365
|
const g = this.geometryValue;
|
|
3366
|
-
if (
|
|
3367
|
-
const m =
|
|
3366
|
+
if (_chunkPMHPXCJCcjs.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.");
|
|
3367
|
+
const m = _chunkPMHPXCJCcjs.matrixFromCorners.call(void 0, g.box, g.corners);
|
|
3368
3368
|
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.");
|
|
3369
3369
|
const next = { ...layer, transform: m };
|
|
3370
3370
|
delete next.annotation;
|
|
3371
|
-
let layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, () =>
|
|
3372
|
-
const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0,
|
|
3371
|
+
let layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkPMHPXCJCcjs.rerenderText.call(void 0, next, this.host.textEnv()));
|
|
3372
|
+
const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkLXGOYRPEcjs.invertMatrix.call(void 0, _chunkPMHPXCJCcjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
|
|
3373
3373
|
for (const part of this.parts) {
|
|
3374
3374
|
if (part.what !== "mask") continue;
|
|
3375
3375
|
const surface = _chunkMZXQTKUMcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
|
|
@@ -3385,12 +3385,12 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3385
3385
|
const canvas = this.host.canvas();
|
|
3386
3386
|
try {
|
|
3387
3387
|
if (final) {
|
|
3388
|
-
const res =
|
|
3388
|
+
const res = _chunkPMHPXCJCcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
|
|
3389
3389
|
this.smartMasksMoved = res.masksMoved;
|
|
3390
3390
|
return res.layers;
|
|
3391
3391
|
}
|
|
3392
3392
|
const step = previewStep(preview.scale);
|
|
3393
|
-
const surface =
|
|
3393
|
+
const surface = _chunkPMHPXCJCcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
|
|
3394
3394
|
return _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
|
|
3395
3395
|
} catch (e) {
|
|
3396
3396
|
if (e instanceof _chunkMZXQTKUMcjs.TransformTooLargeError) fail(e.message);
|
|
@@ -3400,10 +3400,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3400
3400
|
/** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
|
|
3401
3401
|
isChanged() {
|
|
3402
3402
|
const g = this.geometryValue;
|
|
3403
|
-
if (!this.smart && !this.typeTarget) return !
|
|
3403
|
+
if (!this.smart && !this.typeTarget) return !_chunkPMHPXCJCcjs.isIdentityTransform.call(void 0, g);
|
|
3404
3404
|
const a = this.startGeometry;
|
|
3405
3405
|
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);
|
|
3406
|
-
const warp = (w, box) => w &&
|
|
3406
|
+
const warp = (w, box) => w && _chunkPMHPXCJCcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
|
|
3407
3407
|
return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
|
|
3408
3408
|
}
|
|
3409
3409
|
render(preview) {
|
|
@@ -3650,7 +3650,7 @@ function convertSurfaceColors(surface, t) {
|
|
|
3650
3650
|
}
|
|
3651
3651
|
|
|
3652
3652
|
// src/image-editor/controller.ts
|
|
3653
|
-
var IMAGE_EDITOR_SCHEMA_VERSION =
|
|
3653
|
+
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkPMHPXCJCcjs.LAYERED_SCHEMA_VERSION;
|
|
3654
3654
|
var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge"];
|
|
3655
3655
|
var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
|
|
3656
3656
|
var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
|
|
@@ -3844,7 +3844,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3844
3844
|
for (const t of _chunkJ5BA3BQ6cjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
|
|
3845
3845
|
const key = _chunkJ5BA3BQ6cjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3846
3846
|
const cur = regions.get(key);
|
|
3847
|
-
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ?
|
|
3847
|
+
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkPMHPXCJCcjs.unionRect.call(void 0, cur.r, r) : r });
|
|
3848
3848
|
}
|
|
3849
3849
|
}
|
|
3850
3850
|
for (const [key, { tx, ty, r }] of regions) {
|
|
@@ -3876,7 +3876,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3876
3876
|
}
|
|
3877
3877
|
/** Finishes the stroke (one undo step) and returns what changed. */
|
|
3878
3878
|
end() {
|
|
3879
|
-
if (this.closed) throw new (0,
|
|
3879
|
+
if (this.closed) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("This stroke has already ended.");
|
|
3880
3880
|
const last = _nullishCoalesce(this.last, () => ( void 0));
|
|
3881
3881
|
const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
|
|
3882
3882
|
_optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
|
|
@@ -4000,20 +4000,20 @@ function sameTile(a, b) {
|
|
|
4000
4000
|
for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
|
|
4001
4001
|
return true;
|
|
4002
4002
|
}
|
|
4003
|
-
var DEFAULT_ADJUSTMENTS =
|
|
4003
|
+
var DEFAULT_ADJUSTMENTS = _chunkPMHPXCJCcjs.DEFAULT_ADJUSTMENTS_VALUES;
|
|
4004
4004
|
function normalizeStoredAdjustments(stored) {
|
|
4005
4005
|
if (!stored) return { ...DEFAULT_ADJUSTMENTS };
|
|
4006
4006
|
const out = {
|
|
4007
4007
|
...DEFAULT_ADJUSTMENTS,
|
|
4008
4008
|
...stored,
|
|
4009
|
-
process:
|
|
4009
|
+
process: _chunkPMHPXCJCcjs.normalizeProcessVersion.call(void 0, stored.process)
|
|
4010
4010
|
};
|
|
4011
|
-
const layers =
|
|
4011
|
+
const layers = _chunkPMHPXCJCcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
|
|
4012
4012
|
if (layers.length) out.layers = layers;
|
|
4013
4013
|
else delete out.layers;
|
|
4014
4014
|
return out;
|
|
4015
4015
|
}
|
|
4016
|
-
var isLayered = (data) => Boolean(data && data.version ===
|
|
4016
|
+
var isLayered = (data) => Boolean(data && data.version === _chunkPMHPXCJCcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
|
|
4017
4017
|
function migrateSerializedImageEditorState(data) {
|
|
4018
4018
|
if (isLayered(data)) {
|
|
4019
4019
|
const out = {
|
|
@@ -4045,10 +4045,10 @@ function migrateSerializedImageEditorState(data) {
|
|
|
4045
4045
|
function migrateToLayeredState(data, size) {
|
|
4046
4046
|
const clean = migrateSerializedImageEditorState(data);
|
|
4047
4047
|
if (isLayered(clean)) return clean;
|
|
4048
|
-
const stack =
|
|
4049
|
-
const { layers, assets } =
|
|
4048
|
+
const stack = _chunkPMHPXCJCcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
|
|
4049
|
+
const { layers, assets } = _chunkPMHPXCJCcjs.serializeLayers.call(void 0, stack.layers);
|
|
4050
4050
|
const out = {
|
|
4051
|
-
version:
|
|
4051
|
+
version: _chunkPMHPXCJCcjs.LAYERED_SCHEMA_VERSION,
|
|
4052
4052
|
width: Math.round(size.width),
|
|
4053
4053
|
height: Math.round(size.height),
|
|
4054
4054
|
layers,
|
|
@@ -4062,8 +4062,8 @@ function migrateToLayeredState(data, size) {
|
|
|
4062
4062
|
if (clean.selection) out.selection = clean.selection;
|
|
4063
4063
|
return out;
|
|
4064
4064
|
}
|
|
4065
|
-
var DEFAULT_TRANSFORM =
|
|
4066
|
-
var DEFAULT_DEPTH_MASK =
|
|
4065
|
+
var DEFAULT_TRANSFORM = _chunkPMHPXCJCcjs.DEFAULT_TRANSFORM_VALUES;
|
|
4066
|
+
var DEFAULT_DEPTH_MASK = _chunkPMHPXCJCcjs.DEFAULT_DEPTH_MASK_VALUES;
|
|
4067
4067
|
var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
|
|
4068
4068
|
var ImageEditorController = (_class7 = class {
|
|
4069
4069
|
|
|
@@ -4086,7 +4086,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4086
4086
|
__init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
|
|
4087
4087
|
__init63() {this.viewKey = []}
|
|
4088
4088
|
/** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
|
|
4089
|
-
__init64() {this.compositor = new (0,
|
|
4089
|
+
__init64() {this.compositor = new (0, _chunkPMHPXCJCcjs.LayerCompositor)()}
|
|
4090
4090
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
4091
4091
|
__init65() {this.effects = new (0, _chunkJODTP4DPcjs.EffectsSlot)()}
|
|
4092
4092
|
/** Renders provider effects: effect smart filter results and effect layers. */
|
|
@@ -4144,7 +4144,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4144
4144
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
4145
4145
|
if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
|
|
4146
4146
|
try {
|
|
4147
|
-
this.state.selection = normalizeSelection(
|
|
4147
|
+
this.state.selection = normalizeSelection(_chunkPMHPXCJCcjs.deserializeSelection.call(void 0, options.initialState.selection));
|
|
4148
4148
|
} catch (e14) {
|
|
4149
4149
|
}
|
|
4150
4150
|
}
|
|
@@ -4256,10 +4256,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
4256
4256
|
if (l.type === "group") {
|
|
4257
4257
|
const children = walk(l.children);
|
|
4258
4258
|
if (children !== l.children) next2 = { ...l, children };
|
|
4259
|
-
} 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 ||
|
|
4259
|
+
} 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 || _chunkPMHPXCJCcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
|
|
4260
4260
|
try {
|
|
4261
|
-
const r =
|
|
4262
|
-
if (all || !
|
|
4261
|
+
const r = _chunkPMHPXCJCcjs.rerender.call(void 0, l, canvas);
|
|
4262
|
+
if (all || !_chunkPMHPXCJCcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
|
|
4263
4263
|
} catch (e16) {
|
|
4264
4264
|
}
|
|
4265
4265
|
}
|
|
@@ -4315,19 +4315,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4315
4315
|
const d = await this.describeEffect(effect, "filter");
|
|
4316
4316
|
const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4317
4317
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4318
|
-
if (!found) throw new (0,
|
|
4318
|
+
if (!found) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
|
|
4319
4319
|
let layers = this.state.layers;
|
|
4320
4320
|
let id = layerId;
|
|
4321
4321
|
let converted = false;
|
|
4322
4322
|
if (found.layer.type !== "smart") {
|
|
4323
|
-
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0,
|
|
4324
|
-
const res2 =
|
|
4323
|
+
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkPMHPXCJCcjs.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.`);
|
|
4324
|
+
const res2 = _chunkPMHPXCJCcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
|
|
4325
4325
|
layers = res2.layers;
|
|
4326
4326
|
id = res2.layer.id;
|
|
4327
4327
|
converted = true;
|
|
4328
4328
|
}
|
|
4329
|
-
const filter =
|
|
4330
|
-
const res =
|
|
4329
|
+
const filter = _chunkPMHPXCJCcjs.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 });
|
|
4330
|
+
const res = _chunkPMHPXCJCcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
|
|
4331
4331
|
this.commitLayers(res.layers);
|
|
4332
4332
|
return { layerId: id, filter: res.filter, converted };
|
|
4333
4333
|
}
|
|
@@ -4338,9 +4338,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4338
4338
|
* false, during a drag).
|
|
4339
4339
|
*/
|
|
4340
4340
|
async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
|
|
4341
|
-
const layer =
|
|
4341
|
+
const layer = _chunkPMHPXCJCcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
|
|
4342
4342
|
const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
|
|
4343
|
-
if (!was || was.kind !== "effect") throw new (0,
|
|
4343
|
+
if (!was || was.kind !== "effect") throw new (0, _chunkPMHPXCJCcjs.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"}.`);
|
|
4344
4344
|
const update = {};
|
|
4345
4345
|
if (changes.values) {
|
|
4346
4346
|
const d = await this.describeEffect(was.effect);
|
|
@@ -4349,15 +4349,15 @@ var ImageEditorController = (_class7 = class {
|
|
|
4349
4349
|
for (const [k, v] of Object.entries(changes.values)) {
|
|
4350
4350
|
if (v !== null) given[k] = v;
|
|
4351
4351
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4352
|
-
else throw new (0,
|
|
4352
|
+
else throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4353
4353
|
}
|
|
4354
4354
|
update.values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4355
4355
|
}
|
|
4356
4356
|
for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
|
|
4357
|
-
let res =
|
|
4358
|
-
if (changes.index !== void 0) res = { ...res, layers:
|
|
4357
|
+
let res = _chunkPMHPXCJCcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
|
|
4358
|
+
if (changes.index !== void 0) res = { ...res, layers: _chunkPMHPXCJCcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
|
|
4359
4359
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4360
|
-
return
|
|
4360
|
+
return _chunkPMHPXCJCcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
|
|
4361
4361
|
}
|
|
4362
4362
|
/**
|
|
4363
4363
|
* Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
|
|
@@ -4369,12 +4369,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4369
4369
|
const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4370
4370
|
const { width, height } = this.naturalSize;
|
|
4371
4371
|
const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
|
|
4372
|
-
const blend =
|
|
4373
|
-
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0,
|
|
4372
|
+
const blend = _chunkPMHPXCJCcjs.parseBlend.call(void 0, options.blend);
|
|
4373
|
+
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4374
4374
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4375
4375
|
const layer = {
|
|
4376
4376
|
type: "pixel",
|
|
4377
|
-
id: options.id && !ids.has(options.id) ? options.id :
|
|
4377
|
+
id: options.id && !ids.has(options.id) ? options.id : _chunkPMHPXCJCcjs.newLayerId.call(void 0, ),
|
|
4378
4378
|
name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
|
|
4379
4379
|
visible: true,
|
|
4380
4380
|
opacity: _nullishCoalesce(options.opacity, () => ( 1)),
|
|
@@ -4383,7 +4383,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4383
4383
|
offset: { x: 0, y: 0 },
|
|
4384
4384
|
generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
|
|
4385
4385
|
};
|
|
4386
|
-
const next =
|
|
4386
|
+
const next = _chunkPMHPXCJCcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
|
|
4387
4387
|
this.commitLayers(next, () => {
|
|
4388
4388
|
this.state.activeLayerId = layer.id;
|
|
4389
4389
|
this.state.activeTarget = "pixels";
|
|
@@ -4398,8 +4398,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
4398
4398
|
async updateEffectLayer(layerId, changes, commitToHistory = true) {
|
|
4399
4399
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4400
4400
|
const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
|
|
4401
|
-
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0,
|
|
4402
|
-
|
|
4401
|
+
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
|
|
4402
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
|
|
4403
4403
|
const g = layer.generator;
|
|
4404
4404
|
const d = await this.describeEffect(g.effect);
|
|
4405
4405
|
const base = { ...g.values };
|
|
@@ -4407,7 +4407,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4407
4407
|
for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
|
|
4408
4408
|
if (v !== null) given[k] = v;
|
|
4409
4409
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4410
|
-
else throw new (0,
|
|
4410
|
+
else throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4411
4411
|
}
|
|
4412
4412
|
const values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4413
4413
|
const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
|
|
@@ -4422,7 +4422,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4422
4422
|
/** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
|
|
4423
4423
|
rasterizeEffectLayer(layerId) {
|
|
4424
4424
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4425
|
-
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0,
|
|
4425
|
+
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
|
|
4426
4426
|
this.commitLayers(
|
|
4427
4427
|
_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
|
|
4428
4428
|
const { generator: _g, ...rest } = l;
|
|
@@ -4450,7 +4450,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4450
4450
|
if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
|
|
4451
4451
|
this.viewKey = key;
|
|
4452
4452
|
const { width, height } = this.naturalSize;
|
|
4453
|
-
const view =
|
|
4453
|
+
const view = _chunkPMHPXCJCcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
|
|
4454
4454
|
s.adjustments = view.adjustments;
|
|
4455
4455
|
s.depthMask = view.depthMask;
|
|
4456
4456
|
s.annotations = view.annotations;
|
|
@@ -4604,7 +4604,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4604
4604
|
applyCropPreset(ratio) {
|
|
4605
4605
|
this.recordHistory();
|
|
4606
4606
|
const { width, height } = this.state.imageDimensions;
|
|
4607
|
-
if (ratio &&
|
|
4607
|
+
if (ratio && _chunkPMHPXCJCcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
|
|
4608
4608
|
ratio = 1 / ratio;
|
|
4609
4609
|
}
|
|
4610
4610
|
if (!ratio) {
|
|
@@ -4686,7 +4686,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4686
4686
|
*/
|
|
4687
4687
|
getLayerPixels(id) {
|
|
4688
4688
|
const layer = this.getLayer(id);
|
|
4689
|
-
if (!layer || !
|
|
4689
|
+
if (!layer || !_chunkPMHPXCJCcjs.hasSurface.call(void 0, layer)) return null;
|
|
4690
4690
|
const surface = this.surfaceOf(layer);
|
|
4691
4691
|
const b = _chunkJ5BA3BQ6cjs.contentBounds.call(void 0, surface);
|
|
4692
4692
|
if (!b) return null;
|
|
@@ -4699,7 +4699,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4699
4699
|
*/
|
|
4700
4700
|
getLayerBounds(id) {
|
|
4701
4701
|
const layer = this.getLayer(id);
|
|
4702
|
-
if (!layer || !
|
|
4702
|
+
if (!layer || !_chunkPMHPXCJCcjs.hasSurface.call(void 0, layer)) return null;
|
|
4703
4703
|
const surface = this.surfaceOf(layer);
|
|
4704
4704
|
let b = this.boundsCache.get(surface);
|
|
4705
4705
|
if (b === void 0) {
|
|
@@ -4714,9 +4714,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4714
4714
|
*/
|
|
4715
4715
|
getLayerDataURL(id) {
|
|
4716
4716
|
const layer = this.getLayer(id);
|
|
4717
|
-
if (!layer || !
|
|
4717
|
+
if (!layer || !_chunkPMHPXCJCcjs.hasSurface.call(void 0, layer)) return null;
|
|
4718
4718
|
const surface = this.surfaceOf(layer);
|
|
4719
|
-
const enc =
|
|
4719
|
+
const enc = _chunkPMHPXCJCcjs.encodeSurface.call(void 0, surface);
|
|
4720
4720
|
return enc ? enc.url : null;
|
|
4721
4721
|
}
|
|
4722
4722
|
/**
|
|
@@ -4858,19 +4858,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4858
4858
|
if (init.pixels) {
|
|
4859
4859
|
const px2 = init.pixels;
|
|
4860
4860
|
if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
|
|
4861
|
-
throw new (0,
|
|
4861
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
|
|
4862
4862
|
}
|
|
4863
4863
|
surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, px2, 4);
|
|
4864
4864
|
} else if (init.color !== void 0) {
|
|
4865
4865
|
const c = parseColor(init.color);
|
|
4866
4866
|
surface = _chunkJ5BA3BQ6cjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkJ5BA3BQ6cjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
|
|
4867
4867
|
}
|
|
4868
|
-
const blend =
|
|
4869
|
-
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
4868
|
+
const blend = _chunkPMHPXCJCcjs.parseBlend.call(void 0, init.blend);
|
|
4869
|
+
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4870
4870
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4871
4871
|
const layer = {
|
|
4872
4872
|
type: "pixel",
|
|
4873
|
-
id: init.id && !ids.has(init.id) ? init.id :
|
|
4873
|
+
id: init.id && !ids.has(init.id) ? init.id : _chunkPMHPXCJCcjs.newLayerId.call(void 0, ),
|
|
4874
4874
|
name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
|
|
4875
4875
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
4876
4876
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
@@ -4879,7 +4879,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4879
4879
|
offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
|
|
4880
4880
|
};
|
|
4881
4881
|
if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
|
|
4882
|
-
const next =
|
|
4882
|
+
const next = _chunkPMHPXCJCcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
4883
4883
|
this.commitLayers(next, () => {
|
|
4884
4884
|
this.state.activeLayerId = layer.id;
|
|
4885
4885
|
this.state.activeTarget = "pixels";
|
|
@@ -4919,12 +4919,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4919
4919
|
try {
|
|
4920
4920
|
img = await this.renderer.imageCache.get(src);
|
|
4921
4921
|
} catch (e21) {
|
|
4922
|
-
throw new (0,
|
|
4922
|
+
throw new (0, _chunkPMHPXCJCcjs.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.");
|
|
4923
4923
|
}
|
|
4924
4924
|
const w = img.naturalWidth || img.width;
|
|
4925
4925
|
const h = img.naturalHeight || img.height;
|
|
4926
4926
|
const ctx = this.renderer.createCanvas(w, h).getContext("2d");
|
|
4927
|
-
if (!ctx || typeof ctx.getImageData !== "function") throw new (0,
|
|
4927
|
+
if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
|
|
4928
4928
|
ctx.drawImage(img, 0, 0, w, h);
|
|
4929
4929
|
const data = ctx.getImageData(0, 0, w, h);
|
|
4930
4930
|
return { width: w, height: h, data: data.data };
|
|
@@ -4937,7 +4937,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4937
4937
|
}
|
|
4938
4938
|
/** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
|
|
4939
4939
|
duplicateLayer(id, name) {
|
|
4940
|
-
const res =
|
|
4940
|
+
const res = _chunkPMHPXCJCcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
|
|
4941
4941
|
this.commitLayers(res.layers, () => {
|
|
4942
4942
|
this.state.activeLayerId = res.id;
|
|
4943
4943
|
});
|
|
@@ -4945,16 +4945,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
4945
4945
|
}
|
|
4946
4946
|
/** Deletes a layer (refused when locked), as one undo step. */
|
|
4947
4947
|
removeLayer(id) {
|
|
4948
|
-
const next =
|
|
4948
|
+
const next = _chunkPMHPXCJCcjs.removeLayer.call(void 0, this.state.layers, id);
|
|
4949
4949
|
this.commitLayers(next, () => {
|
|
4950
|
-
if (this.state.selectedAnnotationId && !_chunkMZXQTKUMcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([
|
|
4950
|
+
if (this.state.selectedAnnotationId && !_chunkMZXQTKUMcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkPMHPXCJCcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
|
|
4951
4951
|
this.state.selectedAnnotationId = null;
|
|
4952
4952
|
}
|
|
4953
4953
|
});
|
|
4954
4954
|
}
|
|
4955
4955
|
/** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
|
|
4956
4956
|
moveLayer(id, placement) {
|
|
4957
|
-
const next =
|
|
4957
|
+
const next = _chunkPMHPXCJCcjs.moveLayer.call(void 0, this.state.layers, id, placement);
|
|
4958
4958
|
const loc = _chunkMZXQTKUMcjs.findLayer.call(void 0, next, id);
|
|
4959
4959
|
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
|
|
4960
4960
|
this.commitLayers(next);
|
|
@@ -4965,23 +4965,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
4965
4965
|
* one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
|
|
4966
4966
|
*/
|
|
4967
4967
|
setLayerProperties(id, props, commitToHistory = true) {
|
|
4968
|
-
const next =
|
|
4968
|
+
const next = _chunkPMHPXCJCcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
|
|
4969
4969
|
this.commitLayers(next, void 0, commitToHistory);
|
|
4970
4970
|
return _chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer;
|
|
4971
4971
|
}
|
|
4972
4972
|
/** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
|
|
4973
4973
|
addGroup(init = {}) {
|
|
4974
|
-
const blend = init.blend === void 0 ? "pass-through" :
|
|
4974
|
+
const blend = init.blend === void 0 ? "pass-through" : _chunkPMHPXCJCcjs.parseBlend.call(void 0, init.blend, true);
|
|
4975
4975
|
const group = {
|
|
4976
4976
|
type: "group",
|
|
4977
|
-
id:
|
|
4977
|
+
id: _chunkPMHPXCJCcjs.newLayerId.call(void 0, "group"),
|
|
4978
4978
|
name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
|
|
4979
4979
|
visible: true,
|
|
4980
4980
|
opacity: 1,
|
|
4981
4981
|
blend,
|
|
4982
4982
|
children: []
|
|
4983
4983
|
};
|
|
4984
|
-
const next =
|
|
4984
|
+
const next = _chunkPMHPXCJCcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
|
|
4985
4985
|
this.commitLayers(next, () => {
|
|
4986
4986
|
this.state.activeLayerId = group.id;
|
|
4987
4987
|
this.state.activeTarget = "pixels";
|
|
@@ -4990,7 +4990,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4990
4990
|
}
|
|
4991
4991
|
/** Puts sibling layers into a new group (one undo step). Returns the group id. */
|
|
4992
4992
|
groupLayers(ids, name) {
|
|
4993
|
-
const res =
|
|
4993
|
+
const res = _chunkPMHPXCJCcjs.groupLayers.call(void 0, this.state.layers, ids, name);
|
|
4994
4994
|
this.commitLayers(res.layers, () => {
|
|
4995
4995
|
this.state.activeLayerId = res.id;
|
|
4996
4996
|
});
|
|
@@ -4998,7 +4998,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4998
4998
|
}
|
|
4999
4999
|
/** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
|
|
5000
5000
|
ungroupLayer(id) {
|
|
5001
|
-
const res =
|
|
5001
|
+
const res = _chunkPMHPXCJCcjs.ungroupLayer.call(void 0, this.state.layers, id);
|
|
5002
5002
|
this.commitLayers(res.layers);
|
|
5003
5003
|
return res.ids;
|
|
5004
5004
|
}
|
|
@@ -5007,38 +5007,38 @@ var ImageEditorController = (_class7 = class {
|
|
|
5007
5007
|
* (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
|
|
5008
5008
|
*/
|
|
5009
5009
|
offsetLayer(id, move, commitToHistory = true) {
|
|
5010
|
-
const layer =
|
|
5010
|
+
const layer = _chunkPMHPXCJCcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5011
5011
|
if (layer.type === "smart") {
|
|
5012
5012
|
const tl = layer.placement.corners[0];
|
|
5013
5013
|
const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5014
5014
|
const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5015
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5016
|
-
this.commitLayers(
|
|
5015
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("x and y must be numbers.");
|
|
5016
|
+
this.commitLayers(_chunkPMHPXCJCcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
|
|
5017
5017
|
const moved = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, id).layer;
|
|
5018
5018
|
return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
|
|
5019
5019
|
}
|
|
5020
5020
|
if (layer.type === "shape") {
|
|
5021
|
-
const g = _nullishCoalesce(
|
|
5021
|
+
const g = _nullishCoalesce(_chunkPMHPXCJCcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
|
|
5022
5022
|
const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5023
5023
|
const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5024
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5025
|
-
|
|
5026
|
-
let moved =
|
|
5024
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("x and y must be numbers.");
|
|
5025
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5026
|
+
let moved = _chunkPMHPXCJCcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
|
|
5027
5027
|
const mask = layer.mask;
|
|
5028
5028
|
if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
|
|
5029
5029
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
5030
|
-
const b = _nullishCoalesce(
|
|
5030
|
+
const b = _nullishCoalesce(_chunkPMHPXCJCcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
|
|
5031
5031
|
return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
|
|
5032
5032
|
}
|
|
5033
5033
|
if (layer.type === "type") {
|
|
5034
5034
|
const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
|
|
5035
5035
|
const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
|
|
5036
5036
|
const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
|
|
5037
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5038
|
-
|
|
5037
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("x and y must be numbers.");
|
|
5038
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5039
5039
|
const mx = Math.round(dx);
|
|
5040
5040
|
const my = Math.round(dy);
|
|
5041
|
-
let moved = { ...
|
|
5041
|
+
let moved = { ..._chunkPMHPXCJCcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, layer.surface, mx, my) };
|
|
5042
5042
|
const mask = layer.mask;
|
|
5043
5043
|
if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, mx, my) } };
|
|
5044
5044
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
@@ -5048,7 +5048,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5048
5048
|
const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
5049
5049
|
const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
|
|
5050
5050
|
const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
|
|
5051
|
-
const next =
|
|
5051
|
+
const next = _chunkPMHPXCJCcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
|
|
5052
5052
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5053
5053
|
return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
|
|
5054
5054
|
}
|
|
@@ -5058,11 +5058,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5058
5058
|
* target when the layer is active.
|
|
5059
5059
|
*/
|
|
5060
5060
|
addLayerMask(id, from = "reveal-all", props = {}) {
|
|
5061
|
-
const layer =
|
|
5061
|
+
const layer = _chunkPMHPXCJCcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5062
5062
|
let mask;
|
|
5063
5063
|
if (from === "selection") {
|
|
5064
5064
|
const sel = this.state.selection;
|
|
5065
|
-
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0,
|
|
5065
|
+
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5066
5066
|
mask = this.maskFromSelection(sel, props);
|
|
5067
5067
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
5068
5068
|
mask = { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
@@ -5071,7 +5071,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5071
5071
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5072
5072
|
mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5073
5073
|
}
|
|
5074
|
-
const next =
|
|
5074
|
+
const next = _chunkPMHPXCJCcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
|
|
5075
5075
|
this.commitLayers(next, () => {
|
|
5076
5076
|
if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
|
|
5077
5077
|
});
|
|
@@ -5079,18 +5079,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
5079
5079
|
}
|
|
5080
5080
|
/** Removes a layer's mask (one undo step). */
|
|
5081
5081
|
removeLayerMask(id) {
|
|
5082
|
-
const layer =
|
|
5083
|
-
if (!layer.mask) throw new (0,
|
|
5084
|
-
this.commitLayers(
|
|
5082
|
+
const layer = _chunkPMHPXCJCcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5083
|
+
if (!layer.mask) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5084
|
+
this.commitLayers(_chunkPMHPXCJCcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
|
|
5085
5085
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
5086
5086
|
});
|
|
5087
5087
|
}
|
|
5088
5088
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
5089
5089
|
setLayerMaskProps(id, props, commitToHistory = true) {
|
|
5090
|
-
const layer =
|
|
5091
|
-
if (!layer.mask) throw new (0,
|
|
5090
|
+
const layer = _chunkPMHPXCJCcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5091
|
+
if (!layer.mask) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
5092
5092
|
const mask = withMaskProps(layer.mask, props);
|
|
5093
|
-
this.commitLayers(
|
|
5093
|
+
this.commitLayers(_chunkPMHPXCJCcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
|
|
5094
5094
|
return mask;
|
|
5095
5095
|
}
|
|
5096
5096
|
/**
|
|
@@ -5098,11 +5098,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5098
5098
|
* the depth map) and removes the mask, as one undo step.
|
|
5099
5099
|
*/
|
|
5100
5100
|
async applyLayerMask(id) {
|
|
5101
|
-
const loc =
|
|
5101
|
+
const loc = _chunkPMHPXCJCcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5102
5102
|
const layer = loc.layer;
|
|
5103
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5104
|
-
if (!layer.mask) throw new (0,
|
|
5105
|
-
|
|
5103
|
+
if (layer.type !== "pixel") throw new (0, _chunkPMHPXCJCcjs.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.`);
|
|
5104
|
+
if (!layer.mask) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5105
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
|
|
5106
5106
|
const { width, height } = this.naturalSize;
|
|
5107
5107
|
await this.renderer.prepareLayerAssets([layer], width, height);
|
|
5108
5108
|
const sources = this.renderer.compositorSources(width, height);
|
|
@@ -5135,13 +5135,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
5135
5135
|
*/
|
|
5136
5136
|
layerViaCopy(options = {}) {
|
|
5137
5137
|
const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
|
|
5138
|
-
if (!id) throw new (0,
|
|
5139
|
-
const loc =
|
|
5138
|
+
if (!id) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
|
|
5139
|
+
const loc = _chunkPMHPXCJCcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5140
5140
|
const layer = loc.layer;
|
|
5141
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5141
|
+
if (layer.type !== "pixel") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
|
|
5142
5142
|
const sel = this.state.selection;
|
|
5143
|
-
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0,
|
|
5144
|
-
if (options.cut)
|
|
5143
|
+
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
|
|
5144
|
+
if (options.cut) _chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
|
|
5145
5145
|
const surface = this.surfaceOf(layer);
|
|
5146
5146
|
const sb = sel.bounds;
|
|
5147
5147
|
const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
|
|
@@ -5157,7 +5157,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5157
5157
|
}
|
|
5158
5158
|
const copy = {
|
|
5159
5159
|
type: "pixel",
|
|
5160
|
-
id:
|
|
5160
|
+
id: _chunkPMHPXCJCcjs.newLayerId.call(void 0, ),
|
|
5161
5161
|
name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
5162
5162
|
visible: true,
|
|
5163
5163
|
opacity: 1,
|
|
@@ -5230,7 +5230,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5230
5230
|
* Refused while another transform is open.
|
|
5231
5231
|
*/
|
|
5232
5232
|
beginFreeTransform(init = {}) {
|
|
5233
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5233
|
+
if (this.getFreeTransform()) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
|
|
5234
5234
|
const session = new FreeTransformSession(this.transformHost(), init);
|
|
5235
5235
|
this.openTransform = session;
|
|
5236
5236
|
this.notify();
|
|
@@ -5244,26 +5244,26 @@ var ImageEditorController = (_class7 = class {
|
|
|
5244
5244
|
*/
|
|
5245
5245
|
transformLayer(spec) {
|
|
5246
5246
|
const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
|
|
5247
|
-
if (given > 1) throw new (0,
|
|
5248
|
-
if (!given && spec.warp === void 0) throw new (0,
|
|
5247
|
+
if (given > 1) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give only one of matrix, corners and params.");
|
|
5248
|
+
if (!given && spec.warp === void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
|
|
5249
5249
|
if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
|
|
5250
|
-
throw new (0,
|
|
5250
|
+
throw new (0, _chunkPMHPXCJCcjs.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).");
|
|
5251
5251
|
}
|
|
5252
5252
|
if (spec.matrix) {
|
|
5253
5253
|
const [a, b, c, d] = spec.matrix;
|
|
5254
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5254
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5255
5255
|
}
|
|
5256
5256
|
const session = this.beginFreeTransform(spec);
|
|
5257
5257
|
try {
|
|
5258
5258
|
const g = session.startGeometry;
|
|
5259
|
-
const corners = spec.matrix ? g.corners.map((p) =>
|
|
5259
|
+
const corners = spec.matrix ? g.corners.map((p) => _chunkLXGOYRPEcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkPMHPXCJCcjs.applyParams.call(void 0, g, spec.params) : g.corners;
|
|
5260
5260
|
let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
|
|
5261
5261
|
if (spec.warp) {
|
|
5262
5262
|
if ("style" in spec.warp) {
|
|
5263
|
-
if (!
|
|
5264
|
-
warp =
|
|
5263
|
+
if (!_chunkLXGOYRPEcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkLXGOYRPEcjs.WARP_STYLES.join(", ")}.`);
|
|
5264
|
+
warp = _chunkPMHPXCJCcjs.presetWarp.call(void 0, session.box, spec.warp);
|
|
5265
5265
|
} else {
|
|
5266
|
-
if (!
|
|
5266
|
+
if (!_chunkPMHPXCJCcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkPMHPXCJCcjs.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.");
|
|
5267
5267
|
warp = spec.warp;
|
|
5268
5268
|
}
|
|
5269
5269
|
}
|
|
@@ -5276,10 +5276,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5276
5276
|
}
|
|
5277
5277
|
/** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
|
|
5278
5278
|
flipLayer(axis, init = {}) {
|
|
5279
|
-
if (axis !== "horizontal" && axis !== "vertical") throw new (0,
|
|
5279
|
+
if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
|
|
5280
5280
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5281
5281
|
try {
|
|
5282
|
-
session.update({ corners:
|
|
5282
|
+
session.update({ corners: _chunkPMHPXCJCcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
|
|
5283
5283
|
return session.commit();
|
|
5284
5284
|
} catch (e) {
|
|
5285
5285
|
session.cancel();
|
|
@@ -5291,16 +5291,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5291
5291
|
* centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
|
|
5292
5292
|
*/
|
|
5293
5293
|
rotateLayer90(turn, init = {}) {
|
|
5294
|
-
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0,
|
|
5294
|
+
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
|
|
5295
5295
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5296
5296
|
try {
|
|
5297
|
-
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(
|
|
5297
|
+
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkPMHPXCJCcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
|
|
5298
5298
|
const cx = b.x + b.width / 2;
|
|
5299
5299
|
const cy = b.y + b.height / 2;
|
|
5300
5300
|
const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
|
|
5301
5301
|
const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
|
|
5302
5302
|
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];
|
|
5303
|
-
session.update({ corners: session.startGeometry.corners.map((p) =>
|
|
5303
|
+
session.update({ corners: session.startGeometry.corners.map((p) => _chunkLXGOYRPEcjs.applyMatrix.call(void 0, m, p)) }, false);
|
|
5304
5304
|
return session.commit();
|
|
5305
5305
|
} catch (e) {
|
|
5306
5306
|
session.cancel();
|
|
@@ -5309,20 +5309,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5309
5309
|
}
|
|
5310
5310
|
/** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
|
|
5311
5311
|
addLayerFilter(id, filter) {
|
|
5312
|
-
const f =
|
|
5313
|
-
const next =
|
|
5312
|
+
const f = _chunkPMHPXCJCcjs.normalizeFilter.call(void 0, filter);
|
|
5313
|
+
const next = _chunkPMHPXCJCcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
|
|
5314
5314
|
this.commitLayers(next);
|
|
5315
5315
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5316
5316
|
}
|
|
5317
5317
|
/** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
|
|
5318
5318
|
updateLayerFilter(id, filterId, changes, commitToHistory = true) {
|
|
5319
|
-
const next =
|
|
5319
|
+
const next = _chunkPMHPXCJCcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
|
|
5320
5320
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5321
5321
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5322
5322
|
}
|
|
5323
5323
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
5324
5324
|
removeLayerFilter(id, filterId) {
|
|
5325
|
-
const next =
|
|
5325
|
+
const next = _chunkPMHPXCJCcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
|
|
5326
5326
|
this.commitLayers(next);
|
|
5327
5327
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5328
5328
|
}
|
|
@@ -5338,8 +5338,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5338
5338
|
*/
|
|
5339
5339
|
convertToSmartObject(ids, options = {}) {
|
|
5340
5340
|
const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
|
|
5341
|
-
if (!list.length) throw new (0,
|
|
5342
|
-
const res =
|
|
5341
|
+
if (!list.length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
|
|
5342
|
+
const res = _chunkPMHPXCJCcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
|
|
5343
5343
|
this.commitLayers(res.layers, () => {
|
|
5344
5344
|
this.state.activeLayerId = res.layer.id;
|
|
5345
5345
|
this.state.activeTarget = "pixels";
|
|
@@ -5348,7 +5348,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5348
5348
|
}
|
|
5349
5349
|
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
5350
5350
|
rasterizeSmartObject(id) {
|
|
5351
|
-
const res =
|
|
5351
|
+
const res = _chunkPMHPXCJCcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
|
|
5352
5352
|
this.commitLayers(res.layers, () => {
|
|
5353
5353
|
if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
5354
5354
|
});
|
|
@@ -5356,10 +5356,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5356
5356
|
}
|
|
5357
5357
|
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
5358
5358
|
getSmartObject(id) {
|
|
5359
|
-
const layer =
|
|
5359
|
+
const layer = _chunkPMHPXCJCcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5360
5360
|
const c = layer.contents;
|
|
5361
|
-
const g =
|
|
5362
|
-
const readout =
|
|
5361
|
+
const g = _chunkPMHPXCJCcjs.placementGeometry.call(void 0, layer);
|
|
5362
|
+
const readout = _chunkPMHPXCJCcjs.describeTransform.call(void 0, g);
|
|
5363
5363
|
const stack = layer.smartFilters;
|
|
5364
5364
|
return {
|
|
5365
5365
|
layerId: layer.id,
|
|
@@ -5369,10 +5369,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5369
5369
|
kind: c.kind,
|
|
5370
5370
|
width: c.width,
|
|
5371
5371
|
height: c.height,
|
|
5372
|
-
decoded:
|
|
5372
|
+
decoded: _chunkPMHPXCJCcjs.isContentsDecoded.call(void 0, c),
|
|
5373
5373
|
fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
|
|
5374
5374
|
linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
|
|
5375
|
-
instances:
|
|
5375
|
+
instances: _chunkPMHPXCJCcjs.instancesOf.call(void 0, this.state.layers, c.id),
|
|
5376
5376
|
layerCount: c.document ? _chunkMZXQTKUMcjs.flattenLayers.call(void 0, c.document.layers).length : 0
|
|
5377
5377
|
},
|
|
5378
5378
|
placement: {
|
|
@@ -5384,8 +5384,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5384
5384
|
scaleY: readout.scaleY,
|
|
5385
5385
|
rotate: readout.rotate,
|
|
5386
5386
|
skewX: readout.skewX,
|
|
5387
|
-
center:
|
|
5388
|
-
bounds:
|
|
5387
|
+
center: _chunkPMHPXCJCcjs.anchorPoint.call(void 0, g, "center"),
|
|
5388
|
+
bounds: _chunkPMHPXCJCcjs.transformedBox.call(void 0, g)
|
|
5389
5389
|
},
|
|
5390
5390
|
smartFilters: {
|
|
5391
5391
|
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
|
|
@@ -5402,7 +5402,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5402
5402
|
* change. Returns the new placement summary.
|
|
5403
5403
|
*/
|
|
5404
5404
|
setSmartObjectPlacement(id, placement, commitToHistory = true) {
|
|
5405
|
-
const res =
|
|
5405
|
+
const res = _chunkPMHPXCJCcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
|
|
5406
5406
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5407
5407
|
return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
|
|
5408
5408
|
}
|
|
@@ -5415,23 +5415,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
5415
5415
|
* nothing is relative to the current transform.
|
|
5416
5416
|
*/
|
|
5417
5417
|
setSmartObjectTransform(id, spec) {
|
|
5418
|
-
const layer =
|
|
5419
|
-
const g =
|
|
5418
|
+
const layer = _chunkPMHPXCJCcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5419
|
+
const g = _chunkPMHPXCJCcjs.placementGeometry.call(void 0, layer);
|
|
5420
5420
|
const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
|
|
5421
5421
|
const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
|
|
5422
|
-
if (ways > 1) throw new (0,
|
|
5422
|
+
if (ways > 1) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
|
|
5423
5423
|
let corners = g.corners;
|
|
5424
5424
|
if (spec.corners) corners = spec.corners;
|
|
5425
5425
|
else if (spec.matrix) {
|
|
5426
|
-
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0,
|
|
5426
|
+
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkPMHPXCJCcjs.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).");
|
|
5427
5427
|
const [a, b, c, d] = spec.matrix;
|
|
5428
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5429
|
-
corners =
|
|
5428
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5429
|
+
corners = _chunkPMHPXCJCcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
|
|
5430
5430
|
} else if (numeric.length) {
|
|
5431
|
-
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0,
|
|
5432
|
-
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0,
|
|
5433
|
-
const now =
|
|
5434
|
-
const centre =
|
|
5431
|
+
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
|
|
5432
|
+
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`${k} must be a finite number.`);
|
|
5433
|
+
const now = _chunkPMHPXCJCcjs.describeTransform.call(void 0, g);
|
|
5434
|
+
const centre = _chunkPMHPXCJCcjs.anchorPoint.call(void 0, g, "center");
|
|
5435
5435
|
const params = {
|
|
5436
5436
|
scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
|
|
5437
5437
|
scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
|
|
@@ -5439,20 +5439,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5439
5439
|
skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
|
|
5440
5440
|
skewY: _nullishCoalesce(spec.skewY, () => ( 0))
|
|
5441
5441
|
};
|
|
5442
|
-
const m =
|
|
5442
|
+
const m = _chunkPMHPXCJCcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
|
|
5443
5443
|
const cx = g.box.width / 2;
|
|
5444
5444
|
const cy = g.box.height / 2;
|
|
5445
5445
|
const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
|
|
5446
|
-
corners =
|
|
5446
|
+
corners = _chunkPMHPXCJCcjs.cornersFromMatrix.call(void 0, g.box, _chunkLXGOYRPEcjs.multiplyMatrices.call(void 0, m, _chunkLXGOYRPEcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
|
|
5447
5447
|
}
|
|
5448
5448
|
let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
|
|
5449
5449
|
if (spec.warp === null) warp = null;
|
|
5450
5450
|
else if (spec.warp) {
|
|
5451
5451
|
if ("style" in spec.warp) {
|
|
5452
|
-
if (!
|
|
5453
|
-
warp =
|
|
5452
|
+
if (!_chunkLXGOYRPEcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkLXGOYRPEcjs.WARP_STYLES.join(", ")}.`);
|
|
5453
|
+
warp = _chunkPMHPXCJCcjs.presetWarp.call(void 0, g.box, spec.warp);
|
|
5454
5454
|
} else {
|
|
5455
|
-
if (!
|
|
5455
|
+
if (!_chunkPMHPXCJCcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkPMHPXCJCcjs.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.");
|
|
5456
5456
|
warp = spec.warp;
|
|
5457
5457
|
}
|
|
5458
5458
|
}
|
|
@@ -5466,16 +5466,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5466
5466
|
* the layers that changed.
|
|
5467
5467
|
*/
|
|
5468
5468
|
replaceSmartObjectContents(id, source) {
|
|
5469
|
-
const layer =
|
|
5469
|
+
const layer = _chunkPMHPXCJCcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5470
5470
|
let contents;
|
|
5471
5471
|
if ("contents" in source) contents = source.contents;
|
|
5472
|
-
else if ("pixels" in source) contents =
|
|
5472
|
+
else if ("pixels" in source) contents = _chunkPMHPXCJCcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
|
|
5473
5473
|
else {
|
|
5474
|
-
const psd =
|
|
5475
|
-
contents =
|
|
5474
|
+
const psd = _chunkPMHPXCJCcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkPMHPXCJCcjs.newLayerId.call(void 0, ) });
|
|
5475
|
+
contents = _chunkPMHPXCJCcjs.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`)));
|
|
5476
5476
|
contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
|
|
5477
5477
|
}
|
|
5478
|
-
const res =
|
|
5478
|
+
const res = _chunkPMHPXCJCcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
|
|
5479
5479
|
this.commitLayers(res.layers);
|
|
5480
5480
|
return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
|
|
5481
5481
|
}
|
|
@@ -5490,16 +5490,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5490
5490
|
* and bytes.
|
|
5491
5491
|
*/
|
|
5492
5492
|
exportSmartObjectContents(id) {
|
|
5493
|
-
const layer =
|
|
5493
|
+
const layer = _chunkPMHPXCJCcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5494
5494
|
const c = layer.contents;
|
|
5495
5495
|
const base = c.name.replace(/\.\w+$/, "") || "Contents";
|
|
5496
5496
|
if (c.file) {
|
|
5497
|
-
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ...
|
|
5497
|
+
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkPMHPXCJCcjs.BROWSER_IMAGE_TYPES };
|
|
5498
5498
|
const ext = c.file.type.toLowerCase();
|
|
5499
5499
|
return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
|
|
5500
5500
|
}
|
|
5501
|
-
if (!
|
|
5502
|
-
const f =
|
|
5501
|
+
if (!_chunkPMHPXCJCcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
|
|
5502
|
+
const f = _chunkPMHPXCJCcjs.smartContentsFile.call(void 0, c);
|
|
5503
5503
|
return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
|
|
5504
5504
|
}
|
|
5505
5505
|
/**
|
|
@@ -5508,7 +5508,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5508
5508
|
* undo step. Returns the copy's id.
|
|
5509
5509
|
*/
|
|
5510
5510
|
copySmartObject(id, linked = false, name) {
|
|
5511
|
-
const res =
|
|
5511
|
+
const res = _chunkPMHPXCJCcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
|
|
5512
5512
|
this.commitLayers(res.layers, () => {
|
|
5513
5513
|
this.state.activeLayerId = res.layer.id;
|
|
5514
5514
|
this.state.activeTarget = "pixels";
|
|
@@ -5517,31 +5517,31 @@ var ImageEditorController = (_class7 = class {
|
|
|
5517
5517
|
}
|
|
5518
5518
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
5519
5519
|
addSmartFilter(id, filter, index) {
|
|
5520
|
-
const res =
|
|
5520
|
+
const res = _chunkPMHPXCJCcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkPMHPXCJCcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
|
|
5521
5521
|
this.commitLayers(res.layers);
|
|
5522
5522
|
return res.filter;
|
|
5523
5523
|
}
|
|
5524
5524
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
5525
5525
|
updateSmartFilter(id, filterId, changes, commitToHistory = true) {
|
|
5526
|
-
const res =
|
|
5526
|
+
const res = _chunkPMHPXCJCcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
|
|
5527
5527
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5528
5528
|
return res.filter;
|
|
5529
5529
|
}
|
|
5530
5530
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
5531
5531
|
removeSmartFilter(id, filterId) {
|
|
5532
|
-
const res =
|
|
5532
|
+
const res = _chunkPMHPXCJCcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
|
|
5533
5533
|
this.commitLayers(res.layers);
|
|
5534
5534
|
return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
|
|
5535
5535
|
}
|
|
5536
5536
|
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
5537
5537
|
moveSmartFilter(id, filterId, index) {
|
|
5538
|
-
const res =
|
|
5538
|
+
const res = _chunkPMHPXCJCcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
|
|
5539
5539
|
this.commitLayers(res.layers);
|
|
5540
5540
|
return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
|
|
5541
5541
|
}
|
|
5542
5542
|
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
5543
5543
|
setSmartFiltersEnabled(id, enabled) {
|
|
5544
|
-
const res =
|
|
5544
|
+
const res = _chunkPMHPXCJCcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
|
|
5545
5545
|
this.commitLayers(res.layers);
|
|
5546
5546
|
return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
|
|
5547
5547
|
}
|
|
@@ -5551,21 +5551,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
5551
5551
|
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
5552
5552
|
*/
|
|
5553
5553
|
setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
|
|
5554
|
-
const layer =
|
|
5554
|
+
const layer = _chunkPMHPXCJCcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5555
5555
|
let mask;
|
|
5556
5556
|
if (from === "none") mask = null;
|
|
5557
5557
|
else if (from === "keep") {
|
|
5558
|
-
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0,
|
|
5558
|
+
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
|
|
5559
5559
|
mask = withMaskProps(layer.smartFilters.mask, props);
|
|
5560
5560
|
} else if (from === "selection") {
|
|
5561
5561
|
const sel = this.state.selection;
|
|
5562
|
-
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0,
|
|
5562
|
+
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5563
5563
|
mask = this.maskFromSelection(sel, props);
|
|
5564
5564
|
} else {
|
|
5565
5565
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5566
5566
|
mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5567
5567
|
}
|
|
5568
|
-
const res =
|
|
5568
|
+
const res = _chunkPMHPXCJCcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
|
|
5569
5569
|
this.commitLayers(res.layers, () => {
|
|
5570
5570
|
if (this.state.activeLayerId !== id) return;
|
|
5571
5571
|
if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
|
|
@@ -5581,14 +5581,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
5581
5581
|
async prepareSmartObjects() {
|
|
5582
5582
|
const pending = /* @__PURE__ */ new Map();
|
|
5583
5583
|
for (const l of _chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers)) {
|
|
5584
|
-
if (l.type === "smart" && !
|
|
5584
|
+
if (l.type === "smart" && !_chunkPMHPXCJCcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkPMHPXCJCcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
|
|
5585
5585
|
}
|
|
5586
5586
|
const left = [];
|
|
5587
5587
|
for (const [cid, c] of pending) {
|
|
5588
5588
|
try {
|
|
5589
|
-
const url = `data:${
|
|
5589
|
+
const url = `data:${_chunkPMHPXCJCcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes)}`;
|
|
5590
5590
|
const px2 = await this.decodeImage(url);
|
|
5591
|
-
const decoded = { ...c, kind: "raster", raster:
|
|
5591
|
+
const decoded = { ...c, kind: "raster", raster: _chunkPMHPXCJCcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
|
|
5592
5592
|
const swap = (layers) => {
|
|
5593
5593
|
let out = layers;
|
|
5594
5594
|
for (const l of _chunkMZXQTKUMcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkMZXQTKUMcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
|
|
@@ -5616,10 +5616,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5616
5616
|
* Contents can nest. Returns the contents' size and layer ids.
|
|
5617
5617
|
*/
|
|
5618
5618
|
editSmartObjectContents(id) {
|
|
5619
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5620
|
-
const layer =
|
|
5619
|
+
if (this.getFreeTransform()) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
|
|
5620
|
+
const layer = _chunkPMHPXCJCcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5621
5621
|
const c = layer.contents;
|
|
5622
|
-
if (!
|
|
5622
|
+
if (!_chunkPMHPXCJCcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkPMHPXCJCcjs.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.`);
|
|
5623
5623
|
const saved = {
|
|
5624
5624
|
state: { ...this.state },
|
|
5625
5625
|
undo: this.undoStack,
|
|
@@ -5630,7 +5630,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5630
5630
|
samplePixelsOverride: this.samplePixelsOverride,
|
|
5631
5631
|
psdResolution: this.psdResolution
|
|
5632
5632
|
};
|
|
5633
|
-
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id:
|
|
5633
|
+
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkPMHPXCJCcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
|
|
5634
5634
|
this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
|
|
5635
5635
|
const s = this.state;
|
|
5636
5636
|
this.state = {
|
|
@@ -5638,7 +5638,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5638
5638
|
sourceUrl: null,
|
|
5639
5639
|
imageDimensions: { width: c.width, height: c.height },
|
|
5640
5640
|
crop: null,
|
|
5641
|
-
transform: { ...
|
|
5641
|
+
transform: { ..._chunkPMHPXCJCcjs.DEFAULT_TRANSFORM_VALUES },
|
|
5642
5642
|
layers,
|
|
5643
5643
|
activeLayerId: layers.length ? layers[layers.length - 1].id : null,
|
|
5644
5644
|
activeTarget: "pixels",
|
|
@@ -5671,7 +5671,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5671
5671
|
*/
|
|
5672
5672
|
closeSmartObjectContents(save = true) {
|
|
5673
5673
|
const top = this.contentsStack.pop();
|
|
5674
|
-
if (!top) throw new (0,
|
|
5674
|
+
if (!top) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
|
|
5675
5675
|
if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
|
|
5676
5676
|
this.openTransform = null;
|
|
5677
5677
|
const edited = this.state;
|
|
@@ -5685,10 +5685,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5685
5685
|
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";
|
|
5686
5686
|
if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
|
|
5687
5687
|
const px2 = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
|
|
5688
|
-
next =
|
|
5688
|
+
next = _chunkPMHPXCJCcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
|
|
5689
5689
|
} else {
|
|
5690
5690
|
const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
|
|
5691
|
-
next =
|
|
5691
|
+
next = _chunkPMHPXCJCcjs.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);
|
|
5692
5692
|
}
|
|
5693
5693
|
}
|
|
5694
5694
|
const saved = top.saved;
|
|
@@ -5707,7 +5707,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5707
5707
|
this.notify();
|
|
5708
5708
|
return { layerId: top.layerId, changed: false, layerIds: [] };
|
|
5709
5709
|
}
|
|
5710
|
-
const res =
|
|
5710
|
+
const res = _chunkPMHPXCJCcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
|
|
5711
5711
|
this.commitLayers(res.layers);
|
|
5712
5712
|
return { layerId: top.layerId, changed: true, layerIds: res.ids };
|
|
5713
5713
|
}
|
|
@@ -5722,35 +5722,35 @@ var ImageEditorController = (_class7 = class {
|
|
|
5722
5722
|
// --- Layer effects ---
|
|
5723
5723
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
5724
5724
|
getLayerEffects(id) {
|
|
5725
|
-
return
|
|
5725
|
+
return _chunkPMHPXCJCcjs.layerEffectsOf.call(void 0, _chunkPMHPXCJCcjs.requireLayer.call(void 0, this.state.layers, id).layer);
|
|
5726
5726
|
}
|
|
5727
5727
|
/**
|
|
5728
5728
|
* Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
|
|
5729
5729
|
* `index` in the layer's effect list (default the end). Returns the new effect and the effects.
|
|
5730
5730
|
*/
|
|
5731
5731
|
addLayerEffect(id, kind, params = {}, index) {
|
|
5732
|
-
const res =
|
|
5732
|
+
const res = _chunkPMHPXCJCcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
|
|
5733
5733
|
this.commitLayers(res.layers);
|
|
5734
5734
|
return { effect: res.effect, effects: this.getLayerEffects(id) };
|
|
5735
5735
|
}
|
|
5736
5736
|
/** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
|
|
5737
5737
|
updateLayerEffect(id, effectId, changes, commitToHistory = true) {
|
|
5738
|
-
this.commitLayers(
|
|
5738
|
+
this.commitLayers(_chunkPMHPXCJCcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
|
|
5739
5739
|
return this.getLayerEffects(id);
|
|
5740
5740
|
}
|
|
5741
5741
|
/** Removes one effect (one undo step). Returns the remaining effects. */
|
|
5742
5742
|
removeLayerEffect(id, effectId) {
|
|
5743
|
-
this.commitLayers(
|
|
5743
|
+
this.commitLayers(_chunkPMHPXCJCcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
|
|
5744
5744
|
return this.getLayerEffects(id);
|
|
5745
5745
|
}
|
|
5746
5746
|
/** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
|
|
5747
5747
|
setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
|
|
5748
|
-
this.commitLayers(
|
|
5748
|
+
this.commitLayers(_chunkPMHPXCJCcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
|
|
5749
5749
|
return this.getLayerEffects(id);
|
|
5750
5750
|
}
|
|
5751
5751
|
/** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
|
|
5752
5752
|
setLayerEffects(id, effects, commitToHistory = true) {
|
|
5753
|
-
this.commitLayers(
|
|
5753
|
+
this.commitLayers(_chunkPMHPXCJCcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
|
|
5754
5754
|
return this.getLayerEffects(id);
|
|
5755
5755
|
}
|
|
5756
5756
|
__init76() {this.patternIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -5776,8 +5776,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5776
5776
|
/** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
|
|
5777
5777
|
setGlobalLight(light, commitToHistory = true) {
|
|
5778
5778
|
const next = { ...this.getGlobalLight(), ...light };
|
|
5779
|
-
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0,
|
|
5780
|
-
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0,
|
|
5779
|
+
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
|
|
5780
|
+
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
|
|
5781
5781
|
if (commitToHistory) this.recordHistory();
|
|
5782
5782
|
if (next.angle === _chunkMZXQTKUMcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkMZXQTKUMcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
|
|
5783
5783
|
else this.state.globalLight = next;
|
|
@@ -5788,16 +5788,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5788
5788
|
async compositeToSurface(layers, rect) {
|
|
5789
5789
|
const { width, height } = this.naturalSize;
|
|
5790
5790
|
if (_chunkMZXQTKUMcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
|
|
5791
|
-
throw new (0,
|
|
5791
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
|
|
5792
5792
|
}
|
|
5793
5793
|
await this.renderer.prepareLayerAssets(layers, width, height);
|
|
5794
5794
|
const sources = this.renderer.compositorSources(width, height);
|
|
5795
5795
|
const depth = this.bitDepth;
|
|
5796
5796
|
if (depth !== 8) {
|
|
5797
|
-
const samples = _chunkMZXQTKUMcjs.workingToSamples.call(void 0,
|
|
5797
|
+
const samples = _chunkMZXQTKUMcjs.workingToSamples.call(void 0, _chunkPMHPXCJCcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
|
|
5798
5798
|
return _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
|
|
5799
5799
|
}
|
|
5800
|
-
const data = new (0,
|
|
5800
|
+
const data = new (0, _chunkPMHPXCJCcjs.LayerCompositor)().composite(layers, rect, sources);
|
|
5801
5801
|
return _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
|
|
5802
5802
|
}
|
|
5803
5803
|
/**
|
|
@@ -5810,22 +5810,22 @@ var ImageEditorController = (_class7 = class {
|
|
|
5810
5810
|
const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
|
|
5811
5811
|
const depth = this.bitDepth;
|
|
5812
5812
|
if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkJ5BA3BQ6cjs.to16From8.call(void 0, this.compositePixels(r).data) };
|
|
5813
|
-
const data = _chunkMZXQTKUMcjs.workingToSamples.call(void 0,
|
|
5813
|
+
const data = _chunkMZXQTKUMcjs.workingToSamples.call(void 0, _chunkPMHPXCJCcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
|
|
5814
5814
|
return { width: r.width, height: r.height, depth, data };
|
|
5815
5815
|
}
|
|
5816
5816
|
/** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
|
|
5817
5817
|
paintBounds(layer) {
|
|
5818
5818
|
const { width, height } = this.naturalSize;
|
|
5819
5819
|
const canvas = { x: 0, y: 0, width, height };
|
|
5820
|
-
if (
|
|
5820
|
+
if (_chunkPMHPXCJCcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
5821
5821
|
if (layer.type === "annotation") {
|
|
5822
|
-
const b =
|
|
5822
|
+
const b = _chunkPMHPXCJCcjs.getAnnotationBounds.call(void 0, layer.annotation);
|
|
5823
5823
|
const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
|
|
5824
5824
|
return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
|
|
5825
5825
|
}
|
|
5826
5826
|
if (layer.type === "group") {
|
|
5827
5827
|
let r = null;
|
|
5828
|
-
for (const c of layer.children) r =
|
|
5828
|
+
for (const c of layer.children) r = _chunkPMHPXCJCcjs.unionRect.call(void 0, r, this.paintBounds(c));
|
|
5829
5829
|
return _nullishCoalesce(r, () => ( canvas));
|
|
5830
5830
|
}
|
|
5831
5831
|
return canvas;
|
|
@@ -5836,16 +5836,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5836
5836
|
* Returns the merged id.
|
|
5837
5837
|
*/
|
|
5838
5838
|
async mergeDown(id) {
|
|
5839
|
-
const loc =
|
|
5839
|
+
const loc = _chunkPMHPXCJCcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5840
5840
|
const upper = loc.layer;
|
|
5841
5841
|
const siblings = loc.parent ? loc.parent.children : this.state.layers;
|
|
5842
5842
|
const lower = siblings[loc.index - 1];
|
|
5843
|
-
if (!lower) throw new (0,
|
|
5844
|
-
if (lower.type !== "pixel") throw new (0,
|
|
5845
|
-
if (!upper.visible) throw new (0,
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
let rect = _nullishCoalesce(
|
|
5843
|
+
if (!lower) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
|
|
5844
|
+
if (lower.type !== "pixel") throw new (0, _chunkPMHPXCJCcjs.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.`);
|
|
5845
|
+
if (!upper.visible) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
|
|
5846
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
|
|
5847
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
|
|
5848
|
+
let rect = _nullishCoalesce(_chunkPMHPXCJCcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
|
|
5849
5849
|
const reach = Math.max(_chunkMZXQTKUMcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkMZXQTKUMcjs.effectsMargin.call(void 0, upper.effects));
|
|
5850
5850
|
if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
|
|
5851
5851
|
const base = { ...lower, blend: "normal", opacity: 1 };
|
|
@@ -5871,12 +5871,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
5871
5871
|
*/
|
|
5872
5872
|
async mergeVisible() {
|
|
5873
5873
|
const visible = this.state.layers.filter((l) => l.visible);
|
|
5874
|
-
if (!visible.length) throw new (0,
|
|
5874
|
+
if (!visible.length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("No layer is visible.");
|
|
5875
5875
|
const { width, height } = this.naturalSize;
|
|
5876
5876
|
const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
|
|
5877
5877
|
const merged = {
|
|
5878
5878
|
type: "pixel",
|
|
5879
|
-
id:
|
|
5879
|
+
id: _chunkPMHPXCJCcjs.newLayerId.call(void 0, ),
|
|
5880
5880
|
name: "Merged",
|
|
5881
5881
|
visible: true,
|
|
5882
5882
|
opacity: 1,
|
|
@@ -5900,8 +5900,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5900
5900
|
const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
|
|
5901
5901
|
const bg = {
|
|
5902
5902
|
type: "pixel",
|
|
5903
|
-
id:
|
|
5904
|
-
name:
|
|
5903
|
+
id: _chunkPMHPXCJCcjs.BACKGROUND_LAYER_ID,
|
|
5904
|
+
name: _chunkPMHPXCJCcjs.BACKGROUND_LAYER_NAME,
|
|
5905
5905
|
visible: true,
|
|
5906
5906
|
opacity: 1,
|
|
5907
5907
|
blend: "normal",
|
|
@@ -5928,7 +5928,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5928
5928
|
const k = Math.min(1, side / Math.max(width, height));
|
|
5929
5929
|
const tw = Math.max(1, Math.round(width * k));
|
|
5930
5930
|
const th = Math.max(1, Math.round(height * k));
|
|
5931
|
-
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null :
|
|
5931
|
+
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkPMHPXCJCcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
|
|
5932
5932
|
if (!surface) return null;
|
|
5933
5933
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
5934
5934
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
@@ -6023,7 +6023,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6023
6023
|
* pixels. The next stroke fixes the offset from its first point. View state, no undo.
|
|
6024
6024
|
*/
|
|
6025
6025
|
setCloneSource(point) {
|
|
6026
|
-
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0,
|
|
6026
|
+
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
|
|
6027
6027
|
const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
|
|
6028
6028
|
this.state.paint = { ...this.state.paint, cloneSource: source };
|
|
6029
6029
|
this.notify();
|
|
@@ -6041,27 +6041,27 @@ var ImageEditorController = (_class7 = class {
|
|
|
6041
6041
|
/** Resolves and validates what a stroke, fill or clear paints into. */
|
|
6042
6042
|
paintTarget(layerId, channel, action) {
|
|
6043
6043
|
const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
|
|
6044
|
-
if (!id) throw new (0,
|
|
6045
|
-
const layer =
|
|
6044
|
+
if (!id) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
|
|
6045
|
+
const layer = _chunkPMHPXCJCcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
6046
6046
|
const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
|
|
6047
6047
|
if (ch === "mask") {
|
|
6048
|
-
if (!layer.mask) throw new (0,
|
|
6049
|
-
if (layer.mask.source) throw new (0,
|
|
6050
|
-
|
|
6048
|
+
if (!layer.mask) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
|
|
6049
|
+
if (layer.mask.source) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
|
|
6050
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6051
6051
|
} else if (ch === "filter-mask") {
|
|
6052
6052
|
if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
|
|
6053
|
-
throw new (0,
|
|
6053
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
|
|
6054
6054
|
}
|
|
6055
|
-
if (!
|
|
6056
|
-
|
|
6055
|
+
if (!_chunkPMHPXCJCcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
|
|
6056
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6057
6057
|
} else {
|
|
6058
|
-
if (layer.type === "smart") throw new (0,
|
|
6059
|
-
if (layer.type === "shape") throw new (0,
|
|
6060
|
-
if (layer.type === "type") throw new (0,
|
|
6061
|
-
if (layer.type !== "pixel") throw new (0,
|
|
6062
|
-
|
|
6058
|
+
if (layer.type === "smart") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
|
|
6059
|
+
if (layer.type === "shape") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
|
|
6060
|
+
if (layer.type === "type") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
|
|
6061
|
+
if (layer.type !== "pixel") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
|
|
6062
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "pixels", action);
|
|
6063
6063
|
}
|
|
6064
|
-
if (!layer.visible) throw new (0,
|
|
6064
|
+
if (!layer.visible) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
|
|
6065
6065
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
6066
6066
|
const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
|
|
6067
6067
|
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
|
|
@@ -6070,7 +6070,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6070
6070
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
6071
6071
|
withSurface(layer, channel, surface) {
|
|
6072
6072
|
if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
|
|
6073
|
-
if (channel === "filter-mask") return
|
|
6073
|
+
if (channel === "filter-mask") return _chunkPMHPXCJCcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
|
|
6074
6074
|
const next = { ...layer, surface };
|
|
6075
6075
|
delete next.source;
|
|
6076
6076
|
return next;
|
|
@@ -6083,10 +6083,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6083
6083
|
*/
|
|
6084
6084
|
beginStroke(init = {}) {
|
|
6085
6085
|
const tool = _nullishCoalesce(init.tool, () => ( "brush"));
|
|
6086
|
-
if (!STROKE_TOOLS.includes(tool)) throw new (0,
|
|
6086
|
+
if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
|
|
6087
6087
|
const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
|
|
6088
6088
|
if (tool === "mixer" && target.channel !== "pixels") {
|
|
6089
|
-
throw new (0,
|
|
6089
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
|
|
6090
6090
|
}
|
|
6091
6091
|
const brush = _chunk6GFRKLLScjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
|
|
6092
6092
|
let strokePaint = null;
|
|
@@ -6120,7 +6120,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6120
6120
|
retouchStroke(tool, init, brush, target, apply) {
|
|
6121
6121
|
const settings = _chunkW6M7C7R3cjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
|
|
6122
6122
|
const mask = target.channel !== "pixels";
|
|
6123
|
-
if (tool === "sponge" && mask) throw new (0,
|
|
6123
|
+
if (tool === "sponge" && mask) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
|
|
6124
6124
|
if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkW6M7C7R3cjs.RetouchDabStroke)(brush, pixels, _chunkW6M7C7R3cjs.smudgeEffect.call(void 0, brush, settings.strength)) };
|
|
6125
6125
|
if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunkW6M7C7R3cjs.RetouchDabStroke)(brush, pixels, _chunkW6M7C7R3cjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
|
|
6126
6126
|
const retouchApply = {
|
|
@@ -6173,7 +6173,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6173
6173
|
}
|
|
6174
6174
|
if (init.source) this.setCloneSource(init.source);
|
|
6175
6175
|
const cs = this.state.paint.cloneSource;
|
|
6176
|
-
if (!cs) throw new (0,
|
|
6176
|
+
if (!cs) throw new (0, _chunkPMHPXCJCcjs.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 }.`);
|
|
6177
6177
|
let offset = { x: 0, y: 0 };
|
|
6178
6178
|
let first = { x: 0, y: 0 };
|
|
6179
6179
|
const paint = () => ({ kind: "source", source, dx: offset.x, dy: offset.y });
|
|
@@ -6208,7 +6208,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6208
6208
|
const sources = this.compositorSources();
|
|
6209
6209
|
if (depth) {
|
|
6210
6210
|
return new (0, _chunkW6M7C7R3cjs.TilePixelSource)((tx, ty) => {
|
|
6211
|
-
const w =
|
|
6211
|
+
const w = _chunkPMHPXCJCcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkJ5BA3BQ6cjs.TILE, y: ty * _chunkJ5BA3BQ6cjs.TILE, width: _chunkJ5BA3BQ6cjs.TILE, height: _chunkJ5BA3BQ6cjs.TILE }, sources, depth);
|
|
6212
6212
|
for (let i = 0; i < w.length; i += 4) {
|
|
6213
6213
|
if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkJ5BA3BQ6cjs.srgbEncode.call(void 0, w[i + c]);
|
|
6214
6214
|
for (let c = 0; c < 4; c++) w[i + c] *= 255;
|
|
@@ -6216,7 +6216,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6216
6216
|
return w;
|
|
6217
6217
|
}, 4);
|
|
6218
6218
|
}
|
|
6219
|
-
const compositor = new (0,
|
|
6219
|
+
const compositor = new (0, _chunkPMHPXCJCcjs.LayerCompositor)();
|
|
6220
6220
|
return new (0, _chunkW6M7C7R3cjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
|
|
6221
6221
|
}
|
|
6222
6222
|
/** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
|
|
@@ -6266,9 +6266,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6266
6266
|
* document bounds and the number of dabs.
|
|
6267
6267
|
*/
|
|
6268
6268
|
paintStroke(init) {
|
|
6269
|
-
if (!Array.isArray(init.points) || !init.points.length) throw new (0,
|
|
6269
|
+
if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("points must hold at least one { x, y } point.");
|
|
6270
6270
|
for (const p of init.points) {
|
|
6271
|
-
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _236 => _236.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _237 => _237.y]))) throw new (0,
|
|
6271
|
+
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _236 => _236.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _237 => _237.y]))) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
|
|
6272
6272
|
}
|
|
6273
6273
|
const session = this.beginStroke(init);
|
|
6274
6274
|
session.push(init.points);
|
|
@@ -6294,8 +6294,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6294
6294
|
const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
|
|
6295
6295
|
const { width, height } = this.naturalSize;
|
|
6296
6296
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
6297
|
-
if (!(opacity >= 0 && opacity <= 1)) throw new (0,
|
|
6298
|
-
const blend = _nullishCoalesce(
|
|
6297
|
+
if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
6298
|
+
const blend = _nullishCoalesce(_chunkPMHPXCJCcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
|
|
6299
6299
|
const sel = options.useSelection !== false && _optionalChain([this, 'access', _238 => _238.state, 'access', _239 => _239.selection, 'optionalAccess', _240 => _240.bounds]) ? this.state.selection : null;
|
|
6300
6300
|
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _241 => _241.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
6301
6301
|
const coverage = new (0, _chunk6GFRKLLScjs.CoverageMap)();
|
|
@@ -6331,7 +6331,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6331
6331
|
// --- Adjustments ---
|
|
6332
6332
|
/** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
|
|
6333
6333
|
developLayer() {
|
|
6334
|
-
return
|
|
6334
|
+
return _chunkPMHPXCJCcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
|
|
6335
6335
|
}
|
|
6336
6336
|
/**
|
|
6337
6337
|
* Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
|
|
@@ -6357,7 +6357,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6357
6357
|
this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
|
|
6358
6358
|
}
|
|
6359
6359
|
if ("layers" in partial) {
|
|
6360
|
-
layers = this.replaceAdjustmentNodes(layers,
|
|
6360
|
+
layers = this.replaceAdjustmentNodes(layers, _chunkPMHPXCJCcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
|
|
6361
6361
|
}
|
|
6362
6362
|
this.state.layers = layers;
|
|
6363
6363
|
this.notify();
|
|
@@ -6365,7 +6365,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6365
6365
|
/** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
|
|
6366
6366
|
get isProcessOutdated() {
|
|
6367
6367
|
this.syncViews();
|
|
6368
|
-
return
|
|
6368
|
+
return _chunkPMHPXCJCcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkPMHPXCJCcjs.LATEST_PROCESS_VERSION;
|
|
6369
6369
|
}
|
|
6370
6370
|
/**
|
|
6371
6371
|
* Update to Current Process: re-interprets the current adjustment values with the latest
|
|
@@ -6373,7 +6373,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6373
6373
|
*/
|
|
6374
6374
|
upgradeProcess() {
|
|
6375
6375
|
if (!this.isProcessOutdated) return false;
|
|
6376
|
-
this.setAdjustments({ process:
|
|
6376
|
+
this.setAdjustments({ process: _chunkPMHPXCJCcjs.LATEST_PROCESS_VERSION });
|
|
6377
6377
|
return true;
|
|
6378
6378
|
}
|
|
6379
6379
|
/** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
|
|
@@ -6384,7 +6384,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6384
6384
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0,
|
|
6385
6385
|
this.state.layers,
|
|
6386
6386
|
target.id,
|
|
6387
|
-
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process:
|
|
6387
|
+
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkPMHPXCJCcjs.LATEST_PROCESS_VERSION }), 0)
|
|
6388
6388
|
);
|
|
6389
6389
|
}
|
|
6390
6390
|
delete this.state.legacyOutputBlur;
|
|
@@ -6448,7 +6448,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6448
6448
|
const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
|
|
6449
6449
|
for (const l of next) {
|
|
6450
6450
|
if (existing.has(l.id)) continue;
|
|
6451
|
-
out = this.placeLayer(out,
|
|
6451
|
+
out = this.placeLayer(out, _chunkPMHPXCJCcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
|
|
6452
6452
|
}
|
|
6453
6453
|
const order = next.map((l) => l.id);
|
|
6454
6454
|
for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
|
|
@@ -6463,7 +6463,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6463
6463
|
addAdjustmentLayer(init, index) {
|
|
6464
6464
|
const spec = typeof init === "string" ? { kind: init } : init;
|
|
6465
6465
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
6466
|
-
const layer =
|
|
6466
|
+
const layer = _chunkPMHPXCJCcjs.createAdjustmentLayer.call(void 0, spec.kind, {
|
|
6467
6467
|
id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
|
|
6468
6468
|
name: spec.name,
|
|
6469
6469
|
params: spec.params,
|
|
@@ -6472,10 +6472,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6472
6472
|
blend: spec.blend,
|
|
6473
6473
|
mask: _nullishCoalesce(spec.mask, () => ( void 0))
|
|
6474
6474
|
});
|
|
6475
|
-
while (ids.has(layer.id)) layer.id =
|
|
6475
|
+
while (ids.has(layer.id)) layer.id = _chunkPMHPXCJCcjs.newLayerId.call(void 0, "adj");
|
|
6476
6476
|
const { width, height } = this.naturalSize;
|
|
6477
6477
|
this.recordHistory();
|
|
6478
|
-
const node =
|
|
6478
|
+
const node = _chunkPMHPXCJCcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
|
|
6479
6479
|
const positioned = Boolean(spec.aboveId || spec.parentId);
|
|
6480
6480
|
this.state.layers = this.placeLayer(this.state.layers, node, {
|
|
6481
6481
|
aboveId: spec.aboveId,
|
|
@@ -6495,7 +6495,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6495
6495
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
6496
6496
|
const { width, height } = this.naturalSize;
|
|
6497
6497
|
const node = loc.layer;
|
|
6498
|
-
const merged =
|
|
6498
|
+
const merged = _chunkPMHPXCJCcjs.normalizeAdjustmentLayer.call(void 0, {
|
|
6499
6499
|
id: node.id,
|
|
6500
6500
|
kind: node.kind,
|
|
6501
6501
|
enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
|
|
@@ -6515,7 +6515,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6515
6515
|
params: merged.params
|
|
6516
6516
|
};
|
|
6517
6517
|
if (update.mask !== void 0) {
|
|
6518
|
-
const mask = update.mask ?
|
|
6518
|
+
const mask = update.mask ? _chunkPMHPXCJCcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
|
|
6519
6519
|
if (mask) next.mask = mask;
|
|
6520
6520
|
else delete next.mask;
|
|
6521
6521
|
}
|
|
@@ -6602,8 +6602,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6602
6602
|
const { width, height } = this.naturalSize;
|
|
6603
6603
|
let next = null;
|
|
6604
6604
|
if (mask) {
|
|
6605
|
-
const sized = mask.width === width && mask.height === height ? mask :
|
|
6606
|
-
next =
|
|
6605
|
+
const sized = mask.width === width && mask.height === height ? mask : _chunkPMHPXCJCcjs.resizeSelection.call(void 0, mask, width, height);
|
|
6606
|
+
next = _chunkPMHPXCJCcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
|
|
6607
6607
|
} else if (mode !== "replace") {
|
|
6608
6608
|
return false;
|
|
6609
6609
|
}
|
|
@@ -6617,7 +6617,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6617
6617
|
/** Select › All. */
|
|
6618
6618
|
selectAll() {
|
|
6619
6619
|
const { width, height } = this.naturalSize;
|
|
6620
|
-
return this.setSelection(
|
|
6620
|
+
return this.setSelection(_chunkPMHPXCJCcjs.fullSelection.call(void 0, width, height));
|
|
6621
6621
|
}
|
|
6622
6622
|
/** Select › Deselect. */
|
|
6623
6623
|
deselect() {
|
|
@@ -6626,11 +6626,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6626
6626
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
6627
6627
|
invertSelection() {
|
|
6628
6628
|
const { width, height } = this.naturalSize;
|
|
6629
|
-
const current = _nullishCoalesce(this.state.selection, () => (
|
|
6630
|
-
return this.setSelection(
|
|
6629
|
+
const current = _nullishCoalesce(this.state.selection, () => ( _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, width, height)));
|
|
6630
|
+
return this.setSelection(_chunkPMHPXCJCcjs.invertSelection.call(void 0, current));
|
|
6631
6631
|
}
|
|
6632
6632
|
shapeCommand(mask, options) {
|
|
6633
|
-
const shaped = options.feather && options.feather > 0 ?
|
|
6633
|
+
const shaped = options.feather && options.feather > 0 ? _chunkPMHPXCJCcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
|
|
6634
6634
|
return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6635
6635
|
}
|
|
6636
6636
|
/** Rectangular marquee in natural image pixels. */
|
|
@@ -6684,11 +6684,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6684
6684
|
if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
|
|
6685
6685
|
return null;
|
|
6686
6686
|
}
|
|
6687
|
-
const legacy =
|
|
6687
|
+
const legacy = _chunkPMHPXCJCcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
|
|
6688
6688
|
if (options.sample === "active-layer") {
|
|
6689
6689
|
const layer = this.getActiveLayer();
|
|
6690
6690
|
if (!layer || layer.type !== "pixel") {
|
|
6691
|
-
throw new (0,
|
|
6691
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
|
|
6692
6692
|
}
|
|
6693
6693
|
const surface = layer.source === "document" && options.pixels ? _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
|
|
6694
6694
|
return { width, height, data: _chunkJ5BA3BQ6cjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
|
|
@@ -6697,7 +6697,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6697
6697
|
this.syncViews();
|
|
6698
6698
|
if (legacy && !options.pixels) {
|
|
6699
6699
|
const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
|
|
6700
|
-
|
|
6700
|
+
_chunkPMHPXCJCcjs.applyAdjustments.call(void 0, copy, _chunkPMHPXCJCcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
|
|
6701
6701
|
return copy;
|
|
6702
6702
|
}
|
|
6703
6703
|
const pixels = options.pixels;
|
|
@@ -6709,7 +6709,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6709
6709
|
};
|
|
6710
6710
|
const stack = withoutAnnotations(this.state.layers);
|
|
6711
6711
|
const layers = options.sampleMerged ? stack : pixelsOnly(stack);
|
|
6712
|
-
const data = new (0,
|
|
6712
|
+
const data = new (0, _chunkPMHPXCJCcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
|
|
6713
6713
|
return { width, height, data };
|
|
6714
6714
|
}
|
|
6715
6715
|
async requirePixels(options) {
|
|
@@ -6736,7 +6736,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6736
6736
|
modifySelection(op, radius) {
|
|
6737
6737
|
const sel = this.state.selection;
|
|
6738
6738
|
if (!_optionalChain([sel, 'optionalAccess', _255 => _255.bounds])) return false;
|
|
6739
|
-
return this.setSelection(
|
|
6739
|
+
return this.setSelection(_chunkPMHPXCJCcjs.modifySelection.call(void 0, sel, op, radius));
|
|
6740
6740
|
}
|
|
6741
6741
|
/**
|
|
6742
6742
|
* Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
|
|
@@ -6767,7 +6767,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6767
6767
|
} else {
|
|
6768
6768
|
pixels = source;
|
|
6769
6769
|
}
|
|
6770
|
-
this.setSelection(
|
|
6770
|
+
this.setSelection(_chunkPMHPXCJCcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6771
6771
|
return this.getSelection();
|
|
6772
6772
|
}
|
|
6773
6773
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
@@ -6779,7 +6779,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6779
6779
|
// --- Layer masks ---
|
|
6780
6780
|
maskFromSelection(sel, props = {}) {
|
|
6781
6781
|
const { width, height } = this.naturalSize;
|
|
6782
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
6782
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkPMHPXCJCcjs.resizeSelection.call(void 0, sel, width, height);
|
|
6783
6783
|
const mask = { surface: _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
|
|
6784
6784
|
return withMaskProps(mask, props);
|
|
6785
6785
|
}
|
|
@@ -6825,7 +6825,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6825
6825
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
6826
6826
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
6827
6827
|
const data = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
6828
|
-
const sel =
|
|
6828
|
+
const sel = _chunkPMHPXCJCcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
6829
6829
|
return this.setSelection(sel, mode);
|
|
6830
6830
|
}
|
|
6831
6831
|
// --- Histogram ---
|
|
@@ -6855,9 +6855,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6855
6855
|
merged.depthRange = [...merged.depthRange];
|
|
6856
6856
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
6857
6857
|
const next = { ...l };
|
|
6858
|
-
if (
|
|
6858
|
+
if (_chunkPMHPXCJCcjs.isDefaultDepthMask.call(void 0, merged)) {
|
|
6859
6859
|
if (_optionalChain([next, 'access', _261 => _261.mask, 'optionalAccess', _262 => _262.source])) delete next.mask;
|
|
6860
|
-
} else next.mask =
|
|
6860
|
+
} else next.mask = _chunkPMHPXCJCcjs.depthRasterMask.call(void 0, merged);
|
|
6861
6861
|
return next;
|
|
6862
6862
|
});
|
|
6863
6863
|
}
|
|
@@ -6878,7 +6878,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6878
6878
|
// --- Annotations & Layers ---
|
|
6879
6879
|
/** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
|
|
6880
6880
|
annotationLayer(id) {
|
|
6881
|
-
return _chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([
|
|
6881
|
+
return _chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkPMHPXCJCcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _265 => _265.id]) === id);
|
|
6882
6882
|
}
|
|
6883
6883
|
/** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
|
|
6884
6884
|
annotationEnv() {
|
|
@@ -6894,7 +6894,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6894
6894
|
this.recordHistory();
|
|
6895
6895
|
const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
|
|
6896
6896
|
const fullAnnotation = { ...annotation, id };
|
|
6897
|
-
const layer =
|
|
6897
|
+
const layer = _chunkPMHPXCJCcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
|
|
6898
6898
|
const loc = placement.aboveId ? _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
6899
6899
|
this.state.layers = loc ? _chunkMZXQTKUMcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _266 => _266.parent, 'optionalAccess', _267 => _267.id]), () => ( null)), loc.index + 1) : _chunkMZXQTKUMcjs.insertLayer.call(void 0, this.state.layers, layer, null);
|
|
6900
6900
|
this.state.selectedAnnotationId = id;
|
|
@@ -6906,17 +6906,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
6906
6906
|
this.recordHistory();
|
|
6907
6907
|
}
|
|
6908
6908
|
const layer = this.annotationLayer(id);
|
|
6909
|
-
const current = layer ?
|
|
6909
|
+
const current = layer ? _chunkPMHPXCJCcjs.annotationOfLayer.call(void 0, layer) : null;
|
|
6910
6910
|
if (layer && current) {
|
|
6911
6911
|
const annotation = { ...current, ...partial, id };
|
|
6912
|
-
const name = layer.name ===
|
|
6912
|
+
const name = layer.name === _chunkPMHPXCJCcjs.annotationLayerName.call(void 0, current) ? _chunkPMHPXCJCcjs.annotationLayerName.call(void 0, annotation) : layer.name;
|
|
6913
6913
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
|
|
6914
6914
|
}
|
|
6915
6915
|
this.notify();
|
|
6916
6916
|
}
|
|
6917
6917
|
/** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
|
|
6918
6918
|
layerForAnnotation(layer, annotation, name) {
|
|
6919
|
-
const fresh =
|
|
6919
|
+
const fresh = _chunkPMHPXCJCcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
|
|
6920
6920
|
const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
|
|
6921
6921
|
for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
6922
6922
|
if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
|
|
@@ -7184,8 +7184,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7184
7184
|
return;
|
|
7185
7185
|
}
|
|
7186
7186
|
const target = this.developLayer();
|
|
7187
|
-
if (!target) throw new (0,
|
|
7188
|
-
|
|
7187
|
+
if (!target) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("There is no pixel layer to mask.");
|
|
7188
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, target, "all", "mask it");
|
|
7189
7189
|
const { width, height } = this.naturalSize;
|
|
7190
7190
|
let px2 = await this.decodeImage(newDataUrl);
|
|
7191
7191
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
@@ -7193,14 +7193,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7193
7193
|
for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
|
|
7194
7194
|
let surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
|
|
7195
7195
|
if (target.offset.x || target.offset.y) surface = _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
|
|
7196
|
-
this.commitLayers(
|
|
7196
|
+
this.commitLayers(_chunkPMHPXCJCcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
|
|
7197
7197
|
return target.id;
|
|
7198
7198
|
}
|
|
7199
7199
|
// --- Type layers ---
|
|
7200
7200
|
|
|
7201
7201
|
/** The shaper that lays out and draws type layers (`null` when there is none here). */
|
|
7202
7202
|
getTextShaper() {
|
|
7203
|
-
if (this.textShaperValue === void 0) this.textShaperValue =
|
|
7203
|
+
if (this.textShaperValue === void 0) this.textShaperValue = _chunkLXGOYRPEcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
|
|
7204
7204
|
return this.textShaperValue;
|
|
7205
7205
|
}
|
|
7206
7206
|
/** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
|
|
@@ -7217,7 +7217,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7217
7217
|
return _nullishCoalesce(_optionalChain([this, 'access', _272 => _272.getTextShaper, 'call', _273 => _273(), 'optionalAccess', _274 => _274.families, 'optionalCall', _275 => _275()]), () => ( ["sans-serif", "serif", "monospace"]));
|
|
7218
7218
|
}
|
|
7219
7219
|
typeInfo(id) {
|
|
7220
|
-
const layer =
|
|
7220
|
+
const layer = _chunkPMHPXCJCcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7221
7221
|
const ranges = (runs) => {
|
|
7222
7222
|
let at = 0;
|
|
7223
7223
|
return runs.map((r) => {
|
|
@@ -7230,7 +7230,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7230
7230
|
let lines = [];
|
|
7231
7231
|
let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
|
|
7232
7232
|
if (shaper) {
|
|
7233
|
-
const layout =
|
|
7233
|
+
const layout = _chunkLXGOYRPEcjs.layoutText.call(void 0, layer, shaper);
|
|
7234
7234
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7235
7235
|
lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
|
|
7236
7236
|
if (layer.rendering === "stored") missing = layout.missingFonts;
|
|
@@ -7260,25 +7260,25 @@ var ImageEditorController = (_class7 = class {
|
|
|
7260
7260
|
* text wrapped in `box`. Refused without a text shaper. Returns its id.
|
|
7261
7261
|
*/
|
|
7262
7262
|
addTextLayer(init) {
|
|
7263
|
-
const text =
|
|
7264
|
-
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0,
|
|
7265
|
-
const style =
|
|
7266
|
-
const paragraph =
|
|
7263
|
+
const text = _chunkPMHPXCJCcjs.normalizeText.call(void 0, init.text);
|
|
7264
|
+
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("x and y must be numbers (document pixels).");
|
|
7265
|
+
const style = _chunkPMHPXCJCcjs.patchTextStyle.call(void 0, { ..._chunkLXGOYRPEcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
|
|
7266
|
+
const paragraph = _chunkPMHPXCJCcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
|
|
7267
7267
|
let frame = { kind: "point" };
|
|
7268
7268
|
if (init.box) {
|
|
7269
7269
|
const { width, height } = init.box;
|
|
7270
|
-
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0,
|
|
7270
|
+
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
|
|
7271
7271
|
frame = { kind: "box", width, height };
|
|
7272
7272
|
}
|
|
7273
|
-
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0,
|
|
7274
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7275
|
-
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7273
|
+
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("rotation must be a number of degrees.");
|
|
7274
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7275
|
+
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7276
7276
|
const t = [1, 0, 0, 1, init.x, init.y];
|
|
7277
|
-
const transform = init.rotation ?
|
|
7278
|
-
const layer =
|
|
7277
|
+
const transform = init.rotation ? _chunkLXGOYRPEcjs.multiplyMatrices.call(void 0, t, _chunkLXGOYRPEcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
|
|
7278
|
+
const layer = _chunkPMHPXCJCcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkPMHPXCJCcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
|
|
7279
7279
|
if (init.opacity !== void 0) layer.opacity = init.opacity;
|
|
7280
7280
|
if (init.blend !== void 0) layer.blend = init.blend;
|
|
7281
|
-
const next =
|
|
7281
|
+
const next = _chunkPMHPXCJCcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7282
7282
|
this.commitLayers(next, () => {
|
|
7283
7283
|
this.state.activeLayerId = layer.id;
|
|
7284
7284
|
this.state.activeTarget = "pixels";
|
|
@@ -7290,28 +7290,28 @@ var ImageEditorController = (_class7 = class {
|
|
|
7290
7290
|
* `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
|
|
7291
7291
|
*/
|
|
7292
7292
|
setText(id, text, range = {}, commitToHistory = true) {
|
|
7293
|
-
const layer =
|
|
7294
|
-
const insert =
|
|
7295
|
-
const [start, end] =
|
|
7296
|
-
const { layers } =
|
|
7293
|
+
const layer = _chunkPMHPXCJCcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7294
|
+
const insert = _chunkPMHPXCJCcjs.normalizeText.call(void 0, text);
|
|
7295
|
+
const [start, end] = _chunkPMHPXCJCcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7296
|
+
const { layers } = _chunkPMHPXCJCcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkPMHPXCJCcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
|
|
7297
7297
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7298
7298
|
return this.typeInfo(id);
|
|
7299
7299
|
}
|
|
7300
7300
|
/** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
|
|
7301
7301
|
setTextStyle(id, style, range = {}, commitToHistory = true) {
|
|
7302
|
-
const layer =
|
|
7303
|
-
const [start, end] =
|
|
7304
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7305
|
-
|
|
7306
|
-
const { layers } =
|
|
7302
|
+
const layer = _chunkPMHPXCJCcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7303
|
+
const [start, end] = _chunkPMHPXCJCcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7304
|
+
if (!Object.keys(style).length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give at least one style field to set.");
|
|
7305
|
+
_chunkPMHPXCJCcjs.patchTextStyle.call(void 0, _chunkLXGOYRPEcjs.DEFAULT_TEXT_STYLE, style);
|
|
7306
|
+
const { layers } = _chunkPMHPXCJCcjs.updateTypeLayer.call(void 0,
|
|
7307
7307
|
this.state.layers,
|
|
7308
7308
|
id,
|
|
7309
7309
|
(l) => {
|
|
7310
7310
|
if (start === end) {
|
|
7311
|
-
if (l.text.length) throw new (0,
|
|
7312
|
-
return { runs: [{ length: 0, style:
|
|
7311
|
+
if (l.text.length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
|
|
7312
|
+
return { runs: [{ length: 0, style: _chunkPMHPXCJCcjs.patchTextStyle.call(void 0, _chunkLXGOYRPEcjs.styleAt.call(void 0, l.runs, 0, _chunkLXGOYRPEcjs.DEFAULT_TEXT_STYLE), style) }] };
|
|
7313
7313
|
}
|
|
7314
|
-
return { runs:
|
|
7314
|
+
return { runs: _chunkLXGOYRPEcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkPMHPXCJCcjs.patchTextStyle.call(void 0, s, style)) };
|
|
7315
7315
|
},
|
|
7316
7316
|
this.textEnv(),
|
|
7317
7317
|
"restyle its text"
|
|
@@ -7321,11 +7321,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7321
7321
|
}
|
|
7322
7322
|
/** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
|
|
7323
7323
|
setParagraphStyle(id, style, range = {}, commitToHistory = true) {
|
|
7324
|
-
const layer =
|
|
7325
|
-
const [start, end] =
|
|
7326
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7327
|
-
|
|
7328
|
-
const { layers } =
|
|
7324
|
+
const layer = _chunkPMHPXCJCcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7325
|
+
const [start, end] = _chunkPMHPXCJCcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7326
|
+
if (!Object.keys(style).length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give at least one paragraph field to set.");
|
|
7327
|
+
_chunkPMHPXCJCcjs.patchParagraphStyle.call(void 0, {}, style);
|
|
7328
|
+
const { layers } = _chunkPMHPXCJCcjs.updateTypeLayer.call(void 0,
|
|
7329
7329
|
this.state.layers,
|
|
7330
7330
|
id,
|
|
7331
7331
|
(l) => {
|
|
@@ -7334,7 +7334,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7334
7334
|
const a = at;
|
|
7335
7335
|
at += p.length;
|
|
7336
7336
|
const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
|
|
7337
|
-
return touches || !l.text.length ? { length: p.length, style:
|
|
7337
|
+
return touches || !l.text.length ? { length: p.length, style: _chunkPMHPXCJCcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
|
|
7338
7338
|
});
|
|
7339
7339
|
return { paragraphs };
|
|
7340
7340
|
},
|
|
@@ -7350,21 +7350,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7350
7350
|
* paragraph. Also resizes a box. One undo step.
|
|
7351
7351
|
*/
|
|
7352
7352
|
setTextFrame(id, frame, commitToHistory = true) {
|
|
7353
|
-
const layer =
|
|
7354
|
-
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0,
|
|
7355
|
-
if (frame.kind !== "box" && frame.kind !== "point") throw new (0,
|
|
7353
|
+
const layer = _chunkPMHPXCJCcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7354
|
+
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("width and height must be at least 1 pixel.");
|
|
7355
|
+
if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("kind must be point or box.");
|
|
7356
7356
|
const shaper = this.getTextShaper();
|
|
7357
|
-
const { layers } =
|
|
7357
|
+
const { layers } = _chunkPMHPXCJCcjs.updateTypeLayer.call(void 0,
|
|
7358
7358
|
this.state.layers,
|
|
7359
7359
|
id,
|
|
7360
7360
|
(l) => {
|
|
7361
7361
|
if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
|
|
7362
|
-
if (!shaper) throw new (0,
|
|
7363
|
-
const lines =
|
|
7362
|
+
if (!shaper) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
|
|
7363
|
+
const lines = _chunkLXGOYRPEcjs.layoutText.call(void 0, l, shaper).lines;
|
|
7364
7364
|
const first = lines[0];
|
|
7365
7365
|
const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
|
|
7366
7366
|
const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
|
|
7367
|
-
const m =
|
|
7367
|
+
const m = _chunkPMHPXCJCcjs.textMatrix.call(void 0, l);
|
|
7368
7368
|
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]];
|
|
7369
7369
|
const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
|
|
7370
7370
|
return { frame: nextFrame, transform: shifted };
|
|
@@ -7381,21 +7381,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7381
7381
|
* `warnings` says when other colours were dropped. One undo step.
|
|
7382
7382
|
*/
|
|
7383
7383
|
convertTextToShape(id) {
|
|
7384
|
-
const layer =
|
|
7385
|
-
|
|
7384
|
+
const layer = _chunkPMHPXCJCcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7385
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
|
|
7386
7386
|
const shaper = this.getTextShaper();
|
|
7387
|
-
if (!shaper) throw new (0,
|
|
7388
|
-
const parts =
|
|
7389
|
-
const subpaths = parts.flatMap((p) =>
|
|
7390
|
-
if (!subpaths.length) throw new (0,
|
|
7387
|
+
if (!shaper) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
|
|
7388
|
+
const parts = _chunkPMHPXCJCcjs.textOutlines.call(void 0, layer, shaper);
|
|
7389
|
+
const subpaths = parts.flatMap((p) => _chunkLXGOYRPEcjs.bezierToSubpaths.call(void 0, p.path));
|
|
7390
|
+
if (!subpaths.length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
|
|
7391
7391
|
const warnings = [];
|
|
7392
7392
|
const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
|
|
7393
7393
|
if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
|
|
7394
|
-
const missing =
|
|
7394
|
+
const missing = _chunkLXGOYRPEcjs.layoutText.call(void 0, layer, shaper).missingFonts;
|
|
7395
7395
|
if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
|
|
7396
|
-
const first = _nullishCoalesce(_optionalChain([layer, 'access', _276 => _276.runs, 'access', _277 => _277.find, 'call', _278 => _278((r) => r.length > 0), 'optionalAccess', _279 => _279.style]), () => (
|
|
7396
|
+
const first = _nullishCoalesce(_optionalChain([layer, 'access', _276 => _276.runs, 'access', _277 => _277.find, 'call', _278 => _278((r) => r.length > 0), 'optionalAccess', _279 => _279.style]), () => ( _chunkLXGOYRPEcjs.DEFAULT_TEXT_STYLE));
|
|
7397
7397
|
const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
|
|
7398
|
-
const shape =
|
|
7398
|
+
const shape = _chunkPMHPXCJCcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
|
|
7399
7399
|
const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
|
|
7400
7400
|
for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
7401
7401
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
|
|
@@ -7403,23 +7403,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
7403
7403
|
}
|
|
7404
7404
|
/** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
|
|
7405
7405
|
getTextLayout(id) {
|
|
7406
|
-
const layer =
|
|
7406
|
+
const layer = _chunkPMHPXCJCcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7407
7407
|
const shaper = this.getTextShaper();
|
|
7408
|
-
return shaper ?
|
|
7408
|
+
return shaper ? _chunkLXGOYRPEcjs.layoutText.call(void 0, layer, shaper) : null;
|
|
7409
7409
|
}
|
|
7410
7410
|
/** The text index nearest a document point (for clicks on a type layer). */
|
|
7411
7411
|
textIndexAt(id, point) {
|
|
7412
|
-
const layer =
|
|
7412
|
+
const layer = _chunkPMHPXCJCcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7413
7413
|
const layout = this.getTextLayout(id);
|
|
7414
|
-
return layout ?
|
|
7414
|
+
return layout ? _chunkLXGOYRPEcjs.textIndexAt.call(void 0, layout, _chunkPMHPXCJCcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
|
|
7415
7415
|
}
|
|
7416
7416
|
/** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
|
|
7417
7417
|
textCaret(id, index) {
|
|
7418
|
-
const layer =
|
|
7418
|
+
const layer = _chunkPMHPXCJCcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7419
7419
|
const layout = this.getTextLayout(id);
|
|
7420
7420
|
if (!layout) return null;
|
|
7421
|
-
const c =
|
|
7422
|
-
const m =
|
|
7421
|
+
const c = _chunkLXGOYRPEcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
|
|
7422
|
+
const m = _chunkPMHPXCJCcjs.textMatrix.call(void 0, layer);
|
|
7423
7423
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
7424
7424
|
return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
|
|
7425
7425
|
}
|
|
@@ -7430,14 +7430,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7430
7430
|
}
|
|
7431
7431
|
/** One component from tool or UI input (validated). */
|
|
7432
7432
|
componentFrom(spec, path) {
|
|
7433
|
-
const op =
|
|
7434
|
-
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0,
|
|
7435
|
-
if (spec.shape !== void 0) return
|
|
7436
|
-
if (spec.subpaths !== void 0) return { op, subpaths:
|
|
7437
|
-
throw new (0,
|
|
7433
|
+
const op = _chunkPMHPXCJCcjs.requireOperation.call(void 0, spec.op, `${path}op`);
|
|
7434
|
+
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
|
|
7435
|
+
if (spec.shape !== void 0) return _chunkPMHPXCJCcjs.liveComponent.call(void 0, _chunkPMHPXCJCcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
|
|
7436
|
+
if (spec.subpaths !== void 0) return { op, subpaths: _chunkPMHPXCJCcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
|
|
7437
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
|
|
7438
7438
|
}
|
|
7439
7439
|
shapeInfo(id) {
|
|
7440
|
-
const layer =
|
|
7440
|
+
const layer = _chunkPMHPXCJCcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7441
7441
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7442
7442
|
const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
|
|
7443
7443
|
const info = {
|
|
@@ -7447,13 +7447,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
7447
7447
|
index,
|
|
7448
7448
|
op: c.op,
|
|
7449
7449
|
live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
|
|
7450
|
-
subpaths:
|
|
7451
|
-
bounds: box(
|
|
7450
|
+
subpaths: _chunkLXGOYRPEcjs.roundSubpaths.call(void 0, c.subpaths),
|
|
7451
|
+
bounds: box(_chunkPMHPXCJCcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
|
|
7452
7452
|
})),
|
|
7453
7453
|
fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
|
|
7454
7454
|
fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
|
|
7455
7455
|
stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
|
|
7456
|
-
geometryBounds: box(
|
|
7456
|
+
geometryBounds: box(_chunkPMHPXCJCcjs.shapeGeometryBounds.call(void 0, layer)),
|
|
7457
7457
|
bounds: this.getLayerBounds(id)
|
|
7458
7458
|
};
|
|
7459
7459
|
if (layer.annotation) info.annotationId = layer.annotation.id;
|
|
@@ -7470,17 +7470,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
7470
7470
|
*/
|
|
7471
7471
|
addShapeLayer(init) {
|
|
7472
7472
|
const specs = _optionalChain([init, 'access', _284 => _284.components, 'optionalAccess', _285 => _285.length]) ? init.components : [init];
|
|
7473
|
-
if (_optionalChain([init, 'access', _286 => _286.components, 'optionalAccess', _287 => _287.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0,
|
|
7473
|
+
if (_optionalChain([init, 'access', _286 => _286.components, 'optionalAccess', _287 => _287.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
|
|
7474
7474
|
const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _288 => _288.components, 'optionalAccess', _289 => _289.length]) ? `components[${i}].` : ""));
|
|
7475
|
-
const stroke = init.stroke ?
|
|
7475
|
+
const stroke = init.stroke ? _chunkPMHPXCJCcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
|
|
7476
7476
|
const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
|
|
7477
|
-
const fill = init.fill === void 0 ? stroke && openOnly ? null :
|
|
7478
|
-
if (!fill && !stroke) throw new (0,
|
|
7479
|
-
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0,
|
|
7480
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7481
|
-
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7482
|
-
const layer =
|
|
7483
|
-
const next =
|
|
7477
|
+
const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkPMHPXCJCcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkPMHPXCJCcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
|
|
7478
|
+
if (!fill && !stroke) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
|
|
7479
|
+
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7480
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7481
|
+
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7482
|
+
const layer = _chunkPMHPXCJCcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
|
|
7483
|
+
const next = _chunkPMHPXCJCcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7484
7484
|
this.commitLayers(next, () => {
|
|
7485
7485
|
this.state.activeLayerId = layer.id;
|
|
7486
7486
|
this.state.activeTarget = "pixels";
|
|
@@ -7493,18 +7493,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
7493
7493
|
* only those settings of the current stroke. Returns the shape.
|
|
7494
7494
|
*/
|
|
7495
7495
|
setShapeStyle(id, changes, commitToHistory = true) {
|
|
7496
|
-
const layer =
|
|
7497
|
-
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null :
|
|
7498
|
-
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null :
|
|
7499
|
-
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0,
|
|
7496
|
+
const layer = _chunkPMHPXCJCcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7497
|
+
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkPMHPXCJCcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
|
|
7498
|
+
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkPMHPXCJCcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
|
|
7499
|
+
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7500
7500
|
const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
|
|
7501
|
-
const { layers } =
|
|
7501
|
+
const { layers } = _chunkPMHPXCJCcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
|
|
7502
7502
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7503
7503
|
return this.shapeInfo(id);
|
|
7504
7504
|
}
|
|
7505
7505
|
componentIndex(layer, index) {
|
|
7506
7506
|
if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
|
|
7507
|
-
throw new (0,
|
|
7507
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
|
|
7508
7508
|
}
|
|
7509
7509
|
return index;
|
|
7510
7510
|
}
|
|
@@ -7514,36 +7514,36 @@ var ImageEditorController = (_class7 = class {
|
|
|
7514
7514
|
* the live shape) or its operation. Returns the shape.
|
|
7515
7515
|
*/
|
|
7516
7516
|
setShapeComponent(id, index, change, commitToHistory = true) {
|
|
7517
|
-
const layer =
|
|
7517
|
+
const layer = _chunkPMHPXCJCcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7518
7518
|
const i = this.componentIndex(layer, index);
|
|
7519
7519
|
const current = layer.components[i];
|
|
7520
7520
|
let shape = change.shape;
|
|
7521
7521
|
if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
|
|
7522
7522
|
else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
|
|
7523
|
-
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op:
|
|
7523
|
+
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkPMHPXCJCcjs.requireOperation.call(void 0, change.op) };
|
|
7524
7524
|
const components = layer.components.map((c, k) => k === i ? next : c);
|
|
7525
|
-
const { layers } =
|
|
7525
|
+
const { layers } = _chunkPMHPXCJCcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7526
7526
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7527
7527
|
return this.shapeInfo(id);
|
|
7528
7528
|
}
|
|
7529
7529
|
/** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
|
|
7530
7530
|
addShapeComponent(id, spec, index) {
|
|
7531
|
-
const layer =
|
|
7531
|
+
const layer = _chunkPMHPXCJCcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7532
7532
|
const c = this.componentFrom(spec, "");
|
|
7533
7533
|
const at = index === void 0 ? layer.components.length : index;
|
|
7534
|
-
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0,
|
|
7534
|
+
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
|
|
7535
7535
|
const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
|
|
7536
|
-
const { layers } =
|
|
7536
|
+
const { layers } = _chunkPMHPXCJCcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7537
7537
|
this.commitLayers(layers);
|
|
7538
7538
|
return this.shapeInfo(id);
|
|
7539
7539
|
}
|
|
7540
7540
|
/** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
|
|
7541
7541
|
removeShapeComponent(id, index) {
|
|
7542
|
-
const layer =
|
|
7542
|
+
const layer = _chunkPMHPXCJCcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7543
7543
|
const i = this.componentIndex(layer, index);
|
|
7544
|
-
if (layer.components.length === 1) throw new (0,
|
|
7544
|
+
if (layer.components.length === 1) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
|
|
7545
7545
|
const components = layer.components.filter((_, k) => k !== i);
|
|
7546
|
-
const { layers } =
|
|
7546
|
+
const { layers } = _chunkPMHPXCJCcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7547
7547
|
this.commitLayers(layers);
|
|
7548
7548
|
return this.shapeInfo(id);
|
|
7549
7549
|
}
|
|
@@ -7552,10 +7552,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7552
7552
|
* shapes become paths), as one undo step. Returns the shape.
|
|
7553
7553
|
*/
|
|
7554
7554
|
mergeShapeComponents(id) {
|
|
7555
|
-
const layer =
|
|
7556
|
-
if (layer.components.length < 2) throw new (0,
|
|
7557
|
-
const components =
|
|
7558
|
-
const { layers } =
|
|
7555
|
+
const layer = _chunkPMHPXCJCcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7556
|
+
if (layer.components.length < 2) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
|
|
7557
|
+
const components = _chunkPMHPXCJCcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
|
|
7558
|
+
const { layers } = _chunkPMHPXCJCcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
|
|
7559
7559
|
this.commitLayers(layers);
|
|
7560
7560
|
return this.shapeInfo(id);
|
|
7561
7561
|
}
|
|
@@ -7565,8 +7565,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7565
7565
|
* step. Returns the layer id.
|
|
7566
7566
|
*/
|
|
7567
7567
|
async rasterizeLayer(id) {
|
|
7568
|
-
const layer =
|
|
7569
|
-
|
|
7568
|
+
const layer = _chunkPMHPXCJCcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
7569
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
|
|
7570
7570
|
const { width, height } = this.naturalSize;
|
|
7571
7571
|
const canvas = { x: 0, y: 0, width, height };
|
|
7572
7572
|
let next;
|
|
@@ -7582,8 +7582,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7582
7582
|
if (layer.locks) next.locks = layer.locks;
|
|
7583
7583
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
7584
7584
|
} else if (layer.type === "pixel") {
|
|
7585
|
-
if (!_optionalChain([layer, 'access', _290 => _290.filters, 'optionalAccess', _291 => _291.length])) throw new (0,
|
|
7586
|
-
|
|
7585
|
+
if (!_optionalChain([layer, 'access', _290 => _290.filters, 'optionalAccess', _291 => _291.length])) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
|
|
7586
|
+
_chunkPMHPXCJCcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
|
|
7587
7587
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
7588
7588
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
7589
7589
|
delete content.mask;
|
|
@@ -7600,10 +7600,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7600
7600
|
} else if (layer.type === "smart") {
|
|
7601
7601
|
return this.rasterizeSmartObject(id);
|
|
7602
7602
|
} else if (layer.type === "shape" || layer.type === "type") {
|
|
7603
|
-
next = layer.type === "shape" ?
|
|
7603
|
+
next = layer.type === "shape" ? _chunkPMHPXCJCcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkPMHPXCJCcjs.typeAsPixelLayer.call(void 0, layer);
|
|
7604
7604
|
if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _292 => _292.annotation, 'optionalAccess', _293 => _293.id])) this.state.selectedAnnotationId = null;
|
|
7605
7605
|
} else {
|
|
7606
|
-
throw new (0,
|
|
7606
|
+
throw new (0, _chunkPMHPXCJCcjs.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.`);
|
|
7607
7607
|
}
|
|
7608
7608
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
|
|
7609
7609
|
return id;
|
|
@@ -7628,7 +7628,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7628
7628
|
setColorMode(mode, options = {}) {
|
|
7629
7629
|
let next;
|
|
7630
7630
|
if (mode === "rgb") {
|
|
7631
|
-
if (options.profile !== void 0) throw new (0,
|
|
7631
|
+
if (options.profile !== void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
|
|
7632
7632
|
next = null;
|
|
7633
7633
|
} else if (mode === "lab") next = { mode: "lab" };
|
|
7634
7634
|
else if (mode === "cmyk") {
|
|
@@ -7636,14 +7636,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7636
7636
|
try {
|
|
7637
7637
|
doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
|
|
7638
7638
|
} catch (e) {
|
|
7639
|
-
throw new (0,
|
|
7639
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7640
7640
|
}
|
|
7641
7641
|
const cs = resolveProfile(doc).colorSpace;
|
|
7642
|
-
if (cs !== "cmyk") throw new (0,
|
|
7642
|
+
if (cs !== "cmyk") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
|
|
7643
7643
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7644
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7644
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7645
7645
|
next = { mode: "cmyk", profile: doc, intent };
|
|
7646
|
-
} else throw new (0,
|
|
7646
|
+
} else throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
|
|
7647
7647
|
this.recordHistory();
|
|
7648
7648
|
if (next) this.state.colorMode = next;
|
|
7649
7649
|
else delete this.state.colorMode;
|
|
@@ -7656,10 +7656,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7656
7656
|
try {
|
|
7657
7657
|
doc = documentProfile(profile);
|
|
7658
7658
|
} catch (e) {
|
|
7659
|
-
throw new (0,
|
|
7659
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7660
7660
|
}
|
|
7661
7661
|
const cs = resolveProfile(doc).colorSpace;
|
|
7662
|
-
if (cs !== "rgb") throw new (0,
|
|
7662
|
+
if (cs !== "rgb") throw new (0, _chunkPMHPXCJCcjs.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.`);
|
|
7663
7663
|
return doc;
|
|
7664
7664
|
}
|
|
7665
7665
|
/**
|
|
@@ -7685,7 +7685,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7685
7685
|
convertToProfile(profile, options = {}) {
|
|
7686
7686
|
const doc = this.rgbProfileArg(profile, "Convert to Profile");
|
|
7687
7687
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7688
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7688
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7689
7689
|
const t = _chunkG5NMLUVFcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7690
7690
|
const converted = [];
|
|
7691
7691
|
const unconverted = [];
|
|
@@ -7715,11 +7715,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7715
7715
|
else if (l.type === "pixel") next2 = { ...next2, surface: convertSurfaceColors(this.surfaceOf(l), t), source: void 0 };
|
|
7716
7716
|
else if (l.type === "shape") {
|
|
7717
7717
|
const s = next2;
|
|
7718
|
-
next2 =
|
|
7718
|
+
next2 = _chunkPMHPXCJCcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
|
|
7719
7719
|
} else if (l.type === "type") {
|
|
7720
7720
|
const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
|
|
7721
7721
|
try {
|
|
7722
|
-
next2 =
|
|
7722
|
+
next2 = _chunkPMHPXCJCcjs.rerenderText.call(void 0, recoloured, textEnv);
|
|
7723
7723
|
} catch (e26) {
|
|
7724
7724
|
next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
|
|
7725
7725
|
}
|
|
@@ -7749,12 +7749,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
7749
7749
|
try {
|
|
7750
7750
|
doc = documentProfile(setup.profile);
|
|
7751
7751
|
} catch (e) {
|
|
7752
|
-
throw new (0,
|
|
7752
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7753
7753
|
}
|
|
7754
7754
|
const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
|
|
7755
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7755
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7756
7756
|
const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
|
|
7757
|
-
if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0,
|
|
7757
|
+
if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
|
|
7758
7758
|
this.state.proofSetup = next;
|
|
7759
7759
|
this.notify();
|
|
7760
7760
|
return next;
|
|
@@ -7771,14 +7771,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7771
7771
|
src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
|
|
7772
7772
|
dst = resolveProfile(documentProfile(to));
|
|
7773
7773
|
} catch (e) {
|
|
7774
|
-
throw new (0,
|
|
7774
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7775
7775
|
}
|
|
7776
|
-
if (src.colorSpace !== "rgb") throw new (0,
|
|
7776
|
+
if (src.colorSpace !== "rgb") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
|
|
7777
7777
|
const t = _chunkG5NMLUVFcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7778
7778
|
const toLab = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
|
|
7779
7779
|
return colors.map((input) => {
|
|
7780
7780
|
const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
|
|
7781
|
-
if (!m) throw new (0,
|
|
7781
|
+
if (!m) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
|
|
7782
7782
|
const n = parseInt(m[1], 16);
|
|
7783
7783
|
const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
|
|
7784
7784
|
const out = new Float32Array(16);
|
|
@@ -7804,7 +7804,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7804
7804
|
* the ids of the layers whose pixels changed.
|
|
7805
7805
|
*/
|
|
7806
7806
|
setBitDepth(depth) {
|
|
7807
|
-
if (!_chunkJ5BA3BQ6cjs.isBitDepth.call(void 0, depth)) throw new (0,
|
|
7807
|
+
if (!_chunkJ5BA3BQ6cjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
|
|
7808
7808
|
const changed = [];
|
|
7809
7809
|
const withMask = (l) => {
|
|
7810
7810
|
const m = l.mask;
|
|
@@ -7852,7 +7852,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7852
7852
|
* Throws `PsdError` for files that cannot be read at all.
|
|
7853
7853
|
*/
|
|
7854
7854
|
loadPsd(bytes) {
|
|
7855
|
-
const result =
|
|
7855
|
+
const result = _chunkPMHPXCJCcjs.importPsd.call(void 0, bytes, { newId: () => _chunkPMHPXCJCcjs.newLayerId.call(void 0, ) });
|
|
7856
7856
|
this.abandonContents();
|
|
7857
7857
|
this.recordHistory();
|
|
7858
7858
|
const s = this.state;
|
|
@@ -7862,7 +7862,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7862
7862
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
7863
7863
|
s.layers = this.checkPsdFonts(result);
|
|
7864
7864
|
s.crop = null;
|
|
7865
|
-
s.transform = { ...
|
|
7865
|
+
s.transform = { ..._chunkPMHPXCJCcjs.DEFAULT_TRANSFORM_VALUES };
|
|
7866
7866
|
s.outputOpacity = 1;
|
|
7867
7867
|
delete s.legacyOutputBlur;
|
|
7868
7868
|
s.selection = null;
|
|
@@ -7913,7 +7913,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7913
7913
|
let layers = result.layers;
|
|
7914
7914
|
const missing = /* @__PURE__ */ new Map();
|
|
7915
7915
|
for (const l of types) {
|
|
7916
|
-
const fonts = shaper ?
|
|
7916
|
+
const fonts = shaper ? _chunkLXGOYRPEcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
|
|
7917
7917
|
if (!fonts.length) continue;
|
|
7918
7918
|
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
|
|
7919
7919
|
for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
|
|
@@ -7941,7 +7941,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7941
7941
|
const canRasterize = this.renderer.canRasterize();
|
|
7942
7942
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
7943
7943
|
const sources = this.renderer.compositorSources(width, height);
|
|
7944
|
-
const compositor = new (0,
|
|
7944
|
+
const compositor = new (0, _chunkPMHPXCJCcjs.LayerCompositor)();
|
|
7945
7945
|
const bakeMask = (layer) => {
|
|
7946
7946
|
const mask = layer.mask;
|
|
7947
7947
|
if (!_optionalChain([mask, 'optionalAccess', _304 => _304.source])) return mask;
|
|
@@ -8023,7 +8023,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8023
8023
|
out.surface = this.surfaceOf(layer);
|
|
8024
8024
|
delete out.source;
|
|
8025
8025
|
}
|
|
8026
|
-
const active = _nullishCoalesce(_optionalChain([layer, 'access', _308 => _308.filters, 'optionalAccess', _309 => _309.filter, 'call', _310 => _310(
|
|
8026
|
+
const active = _nullishCoalesce(_optionalChain([layer, 'access', _308 => _308.filters, 'optionalAccess', _309 => _309.filter, 'call', _310 => _310(_chunkPMHPXCJCcjs.isActiveFilter)]), () => ( []));
|
|
8027
8027
|
if (active.length) {
|
|
8028
8028
|
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
8029
8029
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -8056,8 +8056,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8056
8056
|
const color = this.psdColorOptions(warnings);
|
|
8057
8057
|
if (color.colorMode && this.bitDepth !== 8) warnings.push(`${color.colorMode.toUpperCase()} files are written at 8 bits per channel; the ${this.bitDepth}-bit samples were rounded.`);
|
|
8058
8058
|
const depth = color.colorMode ? 8 : this.bitDepth;
|
|
8059
|
-
const mergedDeep = depth === 8 ? void 0 : _chunkMZXQTKUMcjs.workingToSamples.call(void 0,
|
|
8060
|
-
const result =
|
|
8059
|
+
const mergedDeep = depth === 8 ? void 0 : _chunkMZXQTKUMcjs.workingToSamples.call(void 0, _chunkPMHPXCJCcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
|
|
8060
|
+
const result = _chunkPMHPXCJCcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
|
|
8061
8061
|
warnings.push(...result.warnings);
|
|
8062
8062
|
return { bytes: result.bytes, warnings, psb: result.psb, width, height };
|
|
8063
8063
|
}
|
|
@@ -8073,13 +8073,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
8073
8073
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
8074
8074
|
if (this.state.selection && (sx !== 1 || sy !== 1)) {
|
|
8075
8075
|
this.state.selection = normalizeSelection(
|
|
8076
|
-
|
|
8076
|
+
_chunkPMHPXCJCcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
|
|
8077
8077
|
);
|
|
8078
8078
|
}
|
|
8079
8079
|
let layers = this.state.layers;
|
|
8080
8080
|
if (sx !== 1 || sy !== 1) {
|
|
8081
8081
|
if (this.state.crop) {
|
|
8082
|
-
this.state.crop =
|
|
8082
|
+
this.state.crop = _chunkPMHPXCJCcjs.clampCropToImage.call(void 0,
|
|
8083
8083
|
{
|
|
8084
8084
|
x: Math.round(this.state.crop.x * sx),
|
|
8085
8085
|
y: Math.round(this.state.crop.y * sy),
|
|
@@ -8098,17 +8098,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
8098
8098
|
} else if (l.type === "shape") {
|
|
8099
8099
|
const a = l.annotation;
|
|
8100
8100
|
const scaled = a ? scaleAnnotation(a, sx, sy) : null;
|
|
8101
|
-
const fromAnnotation = scaled ?
|
|
8101
|
+
const fromAnnotation = scaled ? _chunkPMHPXCJCcjs.shapeFromAnnotation.call(void 0, scaled) : null;
|
|
8102
8102
|
const m = [sx, 0, 0, sy, 0, 0];
|
|
8103
|
-
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _318 => _318.components]), () => (
|
|
8103
|
+
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _318 => _318.components]), () => ( _chunkPMHPXCJCcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
|
|
8104
8104
|
const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
|
|
8105
8105
|
if (scaled && fromAnnotation) moved.annotation = scaled;
|
|
8106
8106
|
else delete moved.annotation;
|
|
8107
|
-
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () =>
|
|
8107
|
+
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () => _chunkPMHPXCJCcjs.rerenderShape.call(void 0, moved, env));
|
|
8108
8108
|
}
|
|
8109
8109
|
}
|
|
8110
8110
|
}
|
|
8111
|
-
const bg =
|
|
8111
|
+
const bg = _chunkPMHPXCJCcjs.developTarget.call(void 0, layers, null);
|
|
8112
8112
|
if (bg && bg.source !== "document") layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
|
|
8113
8113
|
if (clearAnnotations) {
|
|
8114
8114
|
for (const l of _chunkMZXQTKUMcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () => null);
|
|
@@ -8129,7 +8129,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8129
8129
|
let out;
|
|
8130
8130
|
try {
|
|
8131
8131
|
out = this.serializeState();
|
|
8132
|
-
if (_optionalChain([this, 'access', _322 => _322.state, 'access', _323 => _323.selection, 'optionalAccess', _324 => _324.bounds])) out.selection =
|
|
8132
|
+
if (_optionalChain([this, 'access', _322 => _322.state, 'access', _323 => _323.selection, 'optionalAccess', _324 => _324.bounds])) out.selection = _chunkPMHPXCJCcjs.serializeSelection.call(void 0, this.state.selection);
|
|
8133
8133
|
} finally {
|
|
8134
8134
|
if (root) {
|
|
8135
8135
|
this.state = current;
|
|
@@ -8137,8 +8137,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8137
8137
|
this.viewKey = [];
|
|
8138
8138
|
}
|
|
8139
8139
|
}
|
|
8140
|
-
if (!options || out.version !==
|
|
8141
|
-
return
|
|
8140
|
+
if (!options || out.version !== _chunkPMHPXCJCcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
|
|
8141
|
+
return _chunkPMHPXCJCcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
|
|
8142
8142
|
}
|
|
8143
8143
|
/**
|
|
8144
8144
|
* Loads a stored state whose v3 assets may live in an asset store (references other than data
|
|
@@ -8146,12 +8146,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
8146
8146
|
* out and listed in `lastLoadProblems`.
|
|
8147
8147
|
*/
|
|
8148
8148
|
async loadJSONAsync(data, options = {}) {
|
|
8149
|
-
if (data.version !==
|
|
8149
|
+
if (data.version !== _chunkPMHPXCJCcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
|
|
8150
8150
|
this.loadJSON(data);
|
|
8151
8151
|
return;
|
|
8152
8152
|
}
|
|
8153
8153
|
const problems = [];
|
|
8154
|
-
const assets = await
|
|
8154
|
+
const assets = await _chunkPMHPXCJCcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
|
|
8155
8155
|
this.loadJSON({ ...data, assets });
|
|
8156
8156
|
this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
|
|
8157
8157
|
}
|
|
@@ -8163,7 +8163,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8163
8163
|
let selection = null;
|
|
8164
8164
|
if (data.selection) {
|
|
8165
8165
|
try {
|
|
8166
|
-
selection = normalizeSelection(
|
|
8166
|
+
selection = normalizeSelection(_chunkPMHPXCJCcjs.deserializeSelection.call(void 0, data.selection));
|
|
8167
8167
|
} catch (e27) {
|
|
8168
8168
|
selection = null;
|
|
8169
8169
|
}
|
|
@@ -8181,8 +8181,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8181
8181
|
if (isLayered(data)) {
|
|
8182
8182
|
const problems = [];
|
|
8183
8183
|
const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
|
|
8184
|
-
const storedPatterns =
|
|
8185
|
-
s.layers =
|
|
8184
|
+
const storedPatterns = _chunkPMHPXCJCcjs.deserializePatterns.call(void 0, data.patterns, []);
|
|
8185
|
+
s.layers = _chunkPMHPXCJCcjs.deserializeLayers.call(void 0, data.layers, {
|
|
8186
8186
|
assets: _nullishCoalesce(data.assets, () => ( {})),
|
|
8187
8187
|
problems,
|
|
8188
8188
|
smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
|
|
@@ -8200,7 +8200,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8200
8200
|
const light = data.globalLight;
|
|
8201
8201
|
if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
|
|
8202
8202
|
else delete s.globalLight;
|
|
8203
|
-
const patterns =
|
|
8203
|
+
const patterns = _chunkPMHPXCJCcjs.deserializePatterns.call(void 0, data.patterns, problems);
|
|
8204
8204
|
if (patterns.length) s.patterns = patterns;
|
|
8205
8205
|
else delete s.patterns;
|
|
8206
8206
|
if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
|
|
@@ -8216,7 +8216,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8216
8216
|
}
|
|
8217
8217
|
} else {
|
|
8218
8218
|
const { width, height } = this.naturalSize;
|
|
8219
|
-
const stack =
|
|
8219
|
+
const stack = _chunkPMHPXCJCcjs.layersFromLegacy.call(void 0, data, width, height);
|
|
8220
8220
|
s.layers = stack.layers;
|
|
8221
8221
|
s.outputOpacity = stack.outputOpacity;
|
|
8222
8222
|
if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
|
|
@@ -8237,7 +8237,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8237
8237
|
}
|
|
8238
8238
|
serializeState() {
|
|
8239
8239
|
const { width, height } = this.naturalSize;
|
|
8240
|
-
const view =
|
|
8240
|
+
const view = _chunkPMHPXCJCcjs.legacyView.call(void 0, this.stack(), width, height, null);
|
|
8241
8241
|
if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _325 => _325.state, 'access', _326 => _326.patterns, 'optionalAccess', _327 => _327.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
|
|
8242
8242
|
return {
|
|
8243
8243
|
// States without adjustment layers keep schema 1, so they round-trip unchanged.
|
|
@@ -8252,9 +8252,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
8252
8252
|
annotations: JSON.parse(JSON.stringify(view.annotations))
|
|
8253
8253
|
};
|
|
8254
8254
|
}
|
|
8255
|
-
const { layers, assets, smartContents } =
|
|
8255
|
+
const { layers, assets, smartContents } = _chunkPMHPXCJCcjs.serializeLayers.call(void 0, this.state.layers);
|
|
8256
8256
|
const out = {
|
|
8257
|
-
version:
|
|
8257
|
+
version: _chunkPMHPXCJCcjs.LAYERED_SCHEMA_VERSION,
|
|
8258
8258
|
width,
|
|
8259
8259
|
height,
|
|
8260
8260
|
layers,
|
|
@@ -8266,7 +8266,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8266
8266
|
};
|
|
8267
8267
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
8268
8268
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
8269
|
-
if (_optionalChain([this, 'access', _331 => _331.state, 'access', _332 => _332.patterns, 'optionalAccess', _333 => _333.length])) out.patterns =
|
|
8269
|
+
if (_optionalChain([this, 'access', _331 => _331.state, 'access', _332 => _332.patterns, 'optionalAccess', _333 => _333.length])) out.patterns = _chunkPMHPXCJCcjs.serializePatterns.call(void 0, this.state.patterns);
|
|
8270
8270
|
if (smartContents) out.smartContents = smartContents;
|
|
8271
8271
|
if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
|
|
8272
8272
|
if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
|
|
@@ -8278,7 +8278,7 @@ function serializeAdjustments(adjustments) {
|
|
|
8278
8278
|
const out = { ...adjustments };
|
|
8279
8279
|
if (_optionalChain([out, 'access', _334 => _334.layers, 'optionalAccess', _335 => _335.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
8280
8280
|
else delete out.layers;
|
|
8281
|
-
if (
|
|
8281
|
+
if (_chunkPMHPXCJCcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkPMHPXCJCcjs.LEGACY_PROCESS_VERSION) {
|
|
8282
8282
|
delete out.process;
|
|
8283
8283
|
if (!out.tint) delete out.tint;
|
|
8284
8284
|
}
|
|
@@ -8289,7 +8289,7 @@ function withDevelop(layer, partial) {
|
|
|
8289
8289
|
let i = filters.findIndex((f) => f.kind === "develop");
|
|
8290
8290
|
if (i === -1) {
|
|
8291
8291
|
filters.unshift({
|
|
8292
|
-
id: layer.source === "document" ?
|
|
8292
|
+
id: layer.source === "document" ? _chunkPMHPXCJCcjs.DEVELOP_FILTER_ID : _chunkPMHPXCJCcjs.newLayerId.call(void 0, "flt"),
|
|
8293
8293
|
kind: "develop",
|
|
8294
8294
|
enabled: true,
|
|
8295
8295
|
brightness: 0,
|
|
@@ -8298,7 +8298,7 @@ function withDevelop(layer, partial) {
|
|
|
8298
8298
|
exposure: 0,
|
|
8299
8299
|
temperature: 0,
|
|
8300
8300
|
tint: 0,
|
|
8301
|
-
process:
|
|
8301
|
+
process: _chunkPMHPXCJCcjs.LATEST_PROCESS_VERSION
|
|
8302
8302
|
});
|
|
8303
8303
|
i = 0;
|
|
8304
8304
|
}
|
|
@@ -8307,7 +8307,7 @@ function withDevelop(layer, partial) {
|
|
|
8307
8307
|
const v = partial[k];
|
|
8308
8308
|
if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
|
|
8309
8309
|
}
|
|
8310
|
-
if ("process" in partial) next.process =
|
|
8310
|
+
if ("process" in partial) next.process = _chunkPMHPXCJCcjs.normalizeProcessVersion.call(void 0, partial.process);
|
|
8311
8311
|
filters[i] = next;
|
|
8312
8312
|
return { ...layer, filters };
|
|
8313
8313
|
}
|
|
@@ -8316,7 +8316,7 @@ function withBlur(layer, radius) {
|
|
|
8316
8316
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
8317
8317
|
if (radius > 0) {
|
|
8318
8318
|
filters.push({
|
|
8319
|
-
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _339 => _339.id]), () => ( (layer.source === "document" ?
|
|
8319
|
+
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _339 => _339.id]), () => ( (layer.source === "document" ? _chunkPMHPXCJCcjs.BLUR_FILTER_ID : _chunkPMHPXCJCcjs.newLayerId.call(void 0, "flt")))),
|
|
8320
8320
|
kind: "blur",
|
|
8321
8321
|
enabled: true,
|
|
8322
8322
|
radius
|
|
@@ -8340,7 +8340,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8340
8340
|
if (!update.mask) delete next.mask;
|
|
8341
8341
|
else {
|
|
8342
8342
|
const current = node.mask && !node.mask.source ? node.mask : null;
|
|
8343
|
-
const memo = current ?
|
|
8343
|
+
const memo = current ? _chunkPMHPXCJCcjs.legacyMaskOf.call(void 0, current, width, height) : null;
|
|
8344
8344
|
if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
|
|
8345
8345
|
next.mask = withMaskProps(current, {
|
|
8346
8346
|
density: _nullishCoalesce(update.mask.density, () => ( 1)),
|
|
@@ -8348,7 +8348,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8348
8348
|
enabled: update.mask.enabled !== false
|
|
8349
8349
|
});
|
|
8350
8350
|
} else {
|
|
8351
|
-
const m =
|
|
8351
|
+
const m = _chunkPMHPXCJCcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
|
|
8352
8352
|
if (m) next.mask = m;
|
|
8353
8353
|
else delete next.mask;
|
|
8354
8354
|
}
|
|
@@ -8387,7 +8387,7 @@ function resizeLegacyMasks(layers, from, to) {
|
|
|
8387
8387
|
for (const l of _chunkMZXQTKUMcjs.flattenLayers.call(void 0, layers)) {
|
|
8388
8388
|
if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
|
|
8389
8389
|
const old = l.mask;
|
|
8390
|
-
const mask =
|
|
8390
|
+
const mask = _chunkPMHPXCJCcjs.rasterMaskFromLegacy.call(void 0, _chunkPMHPXCJCcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
|
|
8391
8391
|
if (!mask) continue;
|
|
8392
8392
|
out = _chunkMZXQTKUMcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
|
|
8393
8393
|
}
|
|
@@ -8483,12 +8483,12 @@ function withoutAnnotations(layers) {
|
|
|
8483
8483
|
function parseColor(value) {
|
|
8484
8484
|
if (Array.isArray(value)) {
|
|
8485
8485
|
if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
|
|
8486
|
-
throw new (0,
|
|
8486
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
|
|
8487
8487
|
}
|
|
8488
8488
|
return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
|
|
8489
8489
|
}
|
|
8490
8490
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
|
|
8491
|
-
if (!m) throw new (0,
|
|
8491
|
+
if (!m) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
|
|
8492
8492
|
let hex = m[1];
|
|
8493
8493
|
if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
|
|
8494
8494
|
const n = (i) => parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -8498,7 +8498,7 @@ function readImagePaint(raw) {
|
|
|
8498
8498
|
try {
|
|
8499
8499
|
return _chunk6GFRKLLScjs.parsePaintSource.call(void 0, raw);
|
|
8500
8500
|
} catch (e) {
|
|
8501
|
-
if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0,
|
|
8501
|
+
if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(e.message);
|
|
8502
8502
|
throw e;
|
|
8503
8503
|
}
|
|
8504
8504
|
}
|
|
@@ -8646,7 +8646,7 @@ function loadImageEditorDocument(input) {
|
|
|
8646
8646
|
// Optional: only present when something was selected when saving.
|
|
8647
8647
|
selection: {
|
|
8648
8648
|
parse: (value) => {
|
|
8649
|
-
const mask =
|
|
8649
|
+
const mask = _chunkPMHPXCJCcjs.deserializeSelection.call(void 0, value);
|
|
8650
8650
|
const v = value;
|
|
8651
8651
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8652
8652
|
},
|
|
@@ -8734,7 +8734,7 @@ function loadLayeredDocument(doc) {
|
|
|
8734
8734
|
},
|
|
8735
8735
|
selection: {
|
|
8736
8736
|
parse: (value) => {
|
|
8737
|
-
const mask =
|
|
8737
|
+
const mask = _chunkPMHPXCJCcjs.deserializeSelection.call(void 0, value);
|
|
8738
8738
|
const v = value;
|
|
8739
8739
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8740
8740
|
},
|
|
@@ -9128,14 +9128,14 @@ function describeSelection(mask) {
|
|
|
9128
9128
|
// src/image-editor/selection-tools.ts
|
|
9129
9129
|
var modeSchema = {
|
|
9130
9130
|
type: "string",
|
|
9131
|
-
enum: [...
|
|
9131
|
+
enum: [..._chunkPMHPXCJCcjs.SELECTION_MODES],
|
|
9132
9132
|
description: "How the result combines with the current selection (default replace)."
|
|
9133
9133
|
};
|
|
9134
9134
|
var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
|
|
9135
9135
|
function summary(controller) {
|
|
9136
9136
|
const sel = controller.getSelection();
|
|
9137
9137
|
const { width, height } = controller.getState().imageDimensions;
|
|
9138
|
-
const area =
|
|
9138
|
+
const area = _chunkPMHPXCJCcjs.selectionArea.call(void 0, sel);
|
|
9139
9139
|
return {
|
|
9140
9140
|
empty: !sel,
|
|
9141
9141
|
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _351 => _351.bounds]), () => ( null)),
|
|
@@ -9181,7 +9181,7 @@ function createImageSelectionTools(controller) {
|
|
|
9181
9181
|
},
|
|
9182
9182
|
annotations: writeAnnotations("Select a region", true),
|
|
9183
9183
|
handler: ({ shape, x, y, width, height, mode, feather }) => {
|
|
9184
|
-
const opts = { mode:
|
|
9184
|
+
const opts = { mode: _chunkPMHPXCJCcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
|
|
9185
9185
|
switch (shape) {
|
|
9186
9186
|
case "all":
|
|
9187
9187
|
controller.selectAll();
|
|
@@ -9234,7 +9234,7 @@ function createImageSelectionTools(controller) {
|
|
|
9234
9234
|
annotations: writeAnnotations("Select by colour", true),
|
|
9235
9235
|
handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
|
|
9236
9236
|
const common = {
|
|
9237
|
-
mode:
|
|
9237
|
+
mode: _chunkPMHPXCJCcjs.parseSelectionMode.call(void 0, mode),
|
|
9238
9238
|
sampleMerged: sampleMerged === true,
|
|
9239
9239
|
sample: _nullishCoalesce(sample, () => ( "composite"))
|
|
9240
9240
|
};
|
|
@@ -9255,7 +9255,7 @@ function createImageSelectionTools(controller) {
|
|
|
9255
9255
|
inputSchema: {
|
|
9256
9256
|
type: "object",
|
|
9257
9257
|
properties: {
|
|
9258
|
-
op: { type: "string", enum: [...
|
|
9258
|
+
op: { type: "string", enum: [..._chunkPMHPXCJCcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
|
|
9259
9259
|
radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
|
|
9260
9260
|
},
|
|
9261
9261
|
required: ["op", "radius"],
|
|
@@ -9263,7 +9263,7 @@ function createImageSelectionTools(controller) {
|
|
|
9263
9263
|
},
|
|
9264
9264
|
annotations: writeAnnotations("Modify the selection"),
|
|
9265
9265
|
handler: ({ op, radius }) => {
|
|
9266
|
-
if (!
|
|
9266
|
+
if (!_chunkPMHPXCJCcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
|
|
9267
9267
|
if (!controller.getSelection()) throw new Error("Nothing is selected.");
|
|
9268
9268
|
controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
|
|
9269
9269
|
return summary(controller);
|
|
@@ -9307,7 +9307,7 @@ function createImageSelectionTools(controller) {
|
|
|
9307
9307
|
type: "object",
|
|
9308
9308
|
properties: {
|
|
9309
9309
|
layerId: { type: "string", description: "Existing adjustment layer to mask." },
|
|
9310
|
-
kind: { type: "string", enum:
|
|
9310
|
+
kind: { type: "string", enum: _chunkPMHPXCJCcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
|
|
9311
9311
|
params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
|
|
9312
9312
|
density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
|
|
9313
9313
|
feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
|
|
@@ -9327,11 +9327,11 @@ function createImageSelectionTools(controller) {
|
|
|
9327
9327
|
if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
|
|
9328
9328
|
controller.applySelectionAsLayerMask(layerId, props);
|
|
9329
9329
|
id = layerId;
|
|
9330
|
-
} else if (
|
|
9330
|
+
} else if (_chunkPMHPXCJCcjs.isAdjustmentKind.call(void 0, kind)) {
|
|
9331
9331
|
id = controller.addAdjustmentLayer({
|
|
9332
9332
|
kind,
|
|
9333
9333
|
params,
|
|
9334
|
-
mask:
|
|
9334
|
+
mask: _chunkPMHPXCJCcjs.layerMaskFromSelection.call(void 0, sel, props)
|
|
9335
9335
|
});
|
|
9336
9336
|
} else {
|
|
9337
9337
|
throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
|
|
@@ -9468,11 +9468,11 @@ function createImageEditTools(controller) {
|
|
|
9468
9468
|
const geometry2 = () => {
|
|
9469
9469
|
const s = controller.getState();
|
|
9470
9470
|
const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
|
|
9471
|
-
const out =
|
|
9471
|
+
const out = _chunkPMHPXCJCcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
|
|
9472
9472
|
return {
|
|
9473
9473
|
image: { ...s.imageDimensions },
|
|
9474
9474
|
crop: s.crop ? { ...s.crop } : null,
|
|
9475
|
-
rotation:
|
|
9475
|
+
rotation: _chunkPMHPXCJCcjs.normalizeAngle.call(void 0, s.transform.rotate),
|
|
9476
9476
|
flipH: s.transform.flipH,
|
|
9477
9477
|
flipV: s.transform.flipV,
|
|
9478
9478
|
output: { width: Math.round(out.width), height: Math.round(out.height) }
|
|
@@ -9707,7 +9707,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
9707
9707
|
const out = {
|
|
9708
9708
|
id: layer.id,
|
|
9709
9709
|
type: layer.type,
|
|
9710
|
-
name: layer.name || (layer.type === "adjustment" ?
|
|
9710
|
+
name: layer.name || (layer.type === "adjustment" ? _chunkPMHPXCJCcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
|
|
9711
9711
|
visible: layer.visible,
|
|
9712
9712
|
opacity: round3(layer.opacity),
|
|
9713
9713
|
blend: layer.blend,
|
|
@@ -9796,8 +9796,8 @@ function createImageLayerTools(controller) {
|
|
|
9796
9796
|
};
|
|
9797
9797
|
};
|
|
9798
9798
|
const exists = (id, what = "layerId") => {
|
|
9799
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
9800
|
-
|
|
9799
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
|
|
9800
|
+
_chunkPMHPXCJCcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
9801
9801
|
return id;
|
|
9802
9802
|
};
|
|
9803
9803
|
const listLayers = {
|
|
@@ -9833,7 +9833,7 @@ function createImageLayerTools(controller) {
|
|
|
9833
9833
|
handler: ({ layerId, target }) => {
|
|
9834
9834
|
const id = exists(layerId);
|
|
9835
9835
|
const layer = controller.getLayer(id);
|
|
9836
|
-
if (target === "mask" && !layer.mask) throw new (0,
|
|
9836
|
+
if (target === "mask" && !layer.mask) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
9837
9837
|
controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
|
|
9838
9838
|
return { layer: describe(id), activeTarget: controller.getState().activeTarget };
|
|
9839
9839
|
}
|
|
@@ -9858,7 +9858,7 @@ function createImageLayerTools(controller) {
|
|
|
9858
9858
|
},
|
|
9859
9859
|
annotations: { title: "Add a pixel layer", ...WRITE2 },
|
|
9860
9860
|
handler: async (args) => {
|
|
9861
|
-
if (args.color !== void 0 && args.image !== void 0) throw new (0,
|
|
9861
|
+
if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give color or image, not both.");
|
|
9862
9862
|
for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
|
|
9863
9863
|
const init = {
|
|
9864
9864
|
name: args.name,
|
|
@@ -9948,7 +9948,7 @@ function createImageLayerTools(controller) {
|
|
|
9948
9948
|
const id = exists(args.layerId);
|
|
9949
9949
|
const props = {};
|
|
9950
9950
|
for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
|
|
9951
|
-
if (!Object.keys(props).length) throw new (0,
|
|
9951
|
+
if (!Object.keys(props).length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give at least one property to change.");
|
|
9952
9952
|
controller.setLayerProperties(id, props);
|
|
9953
9953
|
return { layer: describe(id) };
|
|
9954
9954
|
}
|
|
@@ -10042,8 +10042,8 @@ function createImageLayerTools(controller) {
|
|
|
10042
10042
|
annotations: { title: "Move a layer's pixels", ...WRITE2 },
|
|
10043
10043
|
handler: ({ layerId, x, y, dx, dy }) => {
|
|
10044
10044
|
const id = exists(layerId);
|
|
10045
|
-
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0,
|
|
10046
|
-
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0,
|
|
10045
|
+
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give x and y, or dx and dy.");
|
|
10046
|
+
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
|
|
10047
10047
|
return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
|
|
10048
10048
|
}
|
|
10049
10049
|
};
|
|
@@ -10115,7 +10115,7 @@ function createImageLayerTools(controller) {
|
|
|
10115
10115
|
annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
|
|
10116
10116
|
handler: ({ layerId, density, feather, enabled, linked }) => {
|
|
10117
10117
|
const id = exists(layerId);
|
|
10118
|
-
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0,
|
|
10118
|
+
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give density, feather, enabled or linked.");
|
|
10119
10119
|
const mask = controller.setLayerMaskProps(id, {
|
|
10120
10120
|
density,
|
|
10121
10121
|
feather,
|
|
@@ -10198,7 +10198,7 @@ function createImageLayerTools(controller) {
|
|
|
10198
10198
|
handler: (args) => {
|
|
10199
10199
|
const id = exists(args.layerId);
|
|
10200
10200
|
const changes = filterValues(args);
|
|
10201
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10201
|
+
if (!Object.keys(changes).length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give at least one value to change.");
|
|
10202
10202
|
return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
|
|
10203
10203
|
}
|
|
10204
10204
|
};
|
|
@@ -10462,8 +10462,8 @@ function describeLayerEffects(effects) {
|
|
|
10462
10462
|
}
|
|
10463
10463
|
function createImageEffectTools(controller) {
|
|
10464
10464
|
const layerArg = (id) => {
|
|
10465
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10466
|
-
|
|
10465
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
|
|
10466
|
+
_chunkPMHPXCJCcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
10467
10467
|
return id;
|
|
10468
10468
|
};
|
|
10469
10469
|
const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
|
|
@@ -10494,7 +10494,7 @@ function createImageEffectTools(controller) {
|
|
|
10494
10494
|
annotations: { title: "Add a layer effect", ...WRITE3 },
|
|
10495
10495
|
handler: ({ layerId, kind, settings, index }) => {
|
|
10496
10496
|
const id = layerArg(layerId);
|
|
10497
|
-
if (!_chunkMZXQTKUMcjs.isLayerEffectKind.call(void 0, kind)) throw new (0,
|
|
10497
|
+
if (!_chunkMZXQTKUMcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`kind must be one of ${_chunkMZXQTKUMcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
|
|
10498
10498
|
const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
|
|
10499
10499
|
return result(id, { effectId: effect.id });
|
|
10500
10500
|
}
|
|
@@ -10514,7 +10514,7 @@ function createImageEffectTools(controller) {
|
|
|
10514
10514
|
handler: ({ layerId, effectId, settings }) => {
|
|
10515
10515
|
const id = layerArg(layerId);
|
|
10516
10516
|
const changes = _nullishCoalesce(settings, () => ( {}));
|
|
10517
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10517
|
+
if (!Object.keys(changes).length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give at least one setting to change.");
|
|
10518
10518
|
controller.updateLayerEffect(id, effectId, changes);
|
|
10519
10519
|
return result(id);
|
|
10520
10520
|
}
|
|
@@ -10566,7 +10566,7 @@ function createImageEffectTools(controller) {
|
|
|
10566
10566
|
},
|
|
10567
10567
|
annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
|
|
10568
10568
|
handler: ({ angle, altitude }) => {
|
|
10569
|
-
if (angle === void 0 && altitude === void 0) throw new (0,
|
|
10569
|
+
if (angle === void 0 && altitude === void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give angle, altitude or both.");
|
|
10570
10570
|
const next = {};
|
|
10571
10571
|
if (angle !== void 0) next.angle = angle;
|
|
10572
10572
|
if (altitude !== void 0) next.altitude = altitude;
|
|
@@ -10747,7 +10747,7 @@ var PaintGesture = (_class8 = class {
|
|
|
10747
10747
|
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.`);
|
|
10748
10748
|
if (_optionalChain([layer, 'access', _365 => _365.locks, 'optionalAccess', _366 => _366.all]) || _optionalChain([layer, 'access', _367 => _367.locks, 'optionalAccess', _368 => _368.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
|
|
10749
10749
|
const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
|
|
10750
|
-
const b =
|
|
10750
|
+
const b = _chunkPMHPXCJCcjs.shapeGeometryBounds.call(void 0, layer);
|
|
10751
10751
|
return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
|
|
10752
10752
|
})();
|
|
10753
10753
|
this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
|
|
@@ -10905,9 +10905,9 @@ function createImagePaintTools(controller) {
|
|
|
10905
10905
|
annotations: { title: "Paint a brush stroke", ...WRITE4 },
|
|
10906
10906
|
handler: (args) => {
|
|
10907
10907
|
const tool = args.tool;
|
|
10908
|
-
if (args.mixer !== void 0 && tool !== "mixer") throw new (0,
|
|
10909
|
-
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0,
|
|
10910
|
-
if (args.paint !== void 0 && args.color !== void 0) throw new (0,
|
|
10908
|
+
if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
|
|
10909
|
+
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
|
|
10910
|
+
if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give color or paint, not both.");
|
|
10911
10911
|
const result = controller.paintStroke({
|
|
10912
10912
|
tool,
|
|
10913
10913
|
points: args.points,
|
|
@@ -11038,7 +11038,7 @@ function profileArg(v) {
|
|
|
11038
11038
|
try {
|
|
11039
11039
|
return _chunkDCLJNVZScjs.base64ToBytes.call(void 0, s.slice(4));
|
|
11040
11040
|
} catch (e29) {
|
|
11041
|
-
throw new (0,
|
|
11041
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("The icc: value is not valid base64.");
|
|
11042
11042
|
}
|
|
11043
11043
|
}
|
|
11044
11044
|
return s;
|
|
@@ -11103,10 +11103,10 @@ function createImageColorTools(controller) {
|
|
|
11103
11103
|
annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11104
11104
|
handler: (args) => {
|
|
11105
11105
|
if (args.off === true) {
|
|
11106
|
-
if (args.profile !== void 0) throw new (0,
|
|
11106
|
+
if (args.profile !== void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give either off true or a profile, not both.");
|
|
11107
11107
|
return controller.setProofSetup(null);
|
|
11108
11108
|
}
|
|
11109
|
-
if (args.profile === void 0) throw new (0,
|
|
11109
|
+
if (args.profile === void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
|
|
11110
11110
|
const s = controller.setProofSetup({
|
|
11111
11111
|
profile: profileArg(args.profile),
|
|
11112
11112
|
...args.intent !== void 0 ? { intent: args.intent } : {},
|
|
@@ -11158,7 +11158,7 @@ function createImageColorTools(controller) {
|
|
|
11158
11158
|
},
|
|
11159
11159
|
annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11160
11160
|
handler: (args) => {
|
|
11161
|
-
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0,
|
|
11161
|
+
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
|
|
11162
11162
|
return controller.setColorMode(args.mode, {
|
|
11163
11163
|
...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
|
|
11164
11164
|
...args.intent !== void 0 ? { intent: args.intent } : {}
|
|
@@ -11223,7 +11223,7 @@ function checkSource(controller, source) {
|
|
|
11223
11223
|
const p = source;
|
|
11224
11224
|
const { width, height } = controller.getState().imageDimensions;
|
|
11225
11225
|
if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
|
|
11226
|
-
throw new (0,
|
|
11226
|
+
throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
|
|
11227
11227
|
}
|
|
11228
11228
|
return p;
|
|
11229
11229
|
}
|
|
@@ -11417,10 +11417,10 @@ function createImageRetouchTools(controller) {
|
|
|
11417
11417
|
annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
|
|
11418
11418
|
handler: (args) => {
|
|
11419
11419
|
if (args.clear === true) {
|
|
11420
|
-
if (args.x !== void 0 || args.y !== void 0) throw new (0,
|
|
11420
|
+
if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give either clear true or x and y, not both.");
|
|
11421
11421
|
return controller.setCloneSource(null);
|
|
11422
11422
|
}
|
|
11423
|
-
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0,
|
|
11423
|
+
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
|
|
11424
11424
|
return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
|
|
11425
11425
|
}
|
|
11426
11426
|
};
|
|
@@ -11441,11 +11441,11 @@ var DATA = {
|
|
|
11441
11441
|
description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
|
|
11442
11442
|
};
|
|
11443
11443
|
function psdBytesFromBase64(data) {
|
|
11444
|
-
if (typeof data !== "string" || !data.trim()) throw new (0,
|
|
11444
|
+
if (typeof data !== "string" || !data.trim()) throw new (0, _chunkPMHPXCJCcjs.PsdError)("data is required: the PSD file as base64.");
|
|
11445
11445
|
const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
|
|
11446
|
-
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0,
|
|
11446
|
+
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkPMHPXCJCcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
|
|
11447
11447
|
const bytes = _chunkDCLJNVZScjs.base64ToBytes.call(void 0, body);
|
|
11448
|
-
if (bytes.length < 26) throw new (0,
|
|
11448
|
+
if (bytes.length < 26) throw new (0, _chunkPMHPXCJCcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
|
|
11449
11449
|
return bytes;
|
|
11450
11450
|
}
|
|
11451
11451
|
function createImagePsdTools(controller) {
|
|
@@ -11456,7 +11456,7 @@ function createImagePsdTools(controller) {
|
|
|
11456
11456
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
11457
11457
|
annotations: { title: "Inspect a PSD", ...READ7 },
|
|
11458
11458
|
handler: ({ data }) => {
|
|
11459
|
-
const res =
|
|
11459
|
+
const res = _chunkPMHPXCJCcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
|
|
11460
11460
|
return {
|
|
11461
11461
|
width: res.width,
|
|
11462
11462
|
height: res.height,
|
|
@@ -11543,7 +11543,7 @@ var GEOMETRY = {
|
|
|
11543
11543
|
dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
|
|
11544
11544
|
reference: {
|
|
11545
11545
|
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}.",
|
|
11546
|
-
anyOf: [{ type: "string", enum:
|
|
11546
|
+
anyOf: [{ type: "string", enum: _chunkPMHPXCJCcjs.TRANSFORM_ANCHORS }, POINT]
|
|
11547
11547
|
},
|
|
11548
11548
|
matrix: {
|
|
11549
11549
|
type: "array",
|
|
@@ -11564,14 +11564,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
|
|
|
11564
11564
|
function geometryFrom(args) {
|
|
11565
11565
|
const numeric = NUMERIC.filter((k) => args[k] !== void 0);
|
|
11566
11566
|
const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
|
|
11567
|
-
if (ways === 0) throw new (0,
|
|
11568
|
-
if (ways > 1) throw new (0,
|
|
11567
|
+
if (ways === 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
|
|
11568
|
+
if (ways > 1) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
|
|
11569
11569
|
if (args.matrix !== void 0) return { matrix: args.matrix };
|
|
11570
11570
|
if (args.corners !== void 0) return { corners: args.corners };
|
|
11571
11571
|
const params = {};
|
|
11572
11572
|
for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
|
|
11573
|
-
if (params.scaleX === 0 || params.scaleY === 0) throw new (0,
|
|
11574
|
-
if (typeof params.reference === "string" && !
|
|
11573
|
+
if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
|
|
11574
|
+
if (typeof params.reference === "string" && !_chunkPMHPXCJCcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkPMHPXCJCcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
|
|
11575
11575
|
return { params };
|
|
11576
11576
|
}
|
|
11577
11577
|
function targetFrom(args) {
|
|
@@ -11620,15 +11620,15 @@ function createImageTransformTools(controller) {
|
|
|
11620
11620
|
moved: [...s.moves],
|
|
11621
11621
|
frame: { ...s.box },
|
|
11622
11622
|
corners: s.startGeometry.corners.map(roundPoint),
|
|
11623
|
-
center: roundPoint(
|
|
11623
|
+
center: roundPoint(_chunkPMHPXCJCcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
|
|
11624
11624
|
};
|
|
11625
11625
|
if (s.smartObject) out.smartObject = true;
|
|
11626
11626
|
s.cancel();
|
|
11627
11627
|
if (args.meshColumns !== void 0) {
|
|
11628
11628
|
const cols = args.meshColumns;
|
|
11629
11629
|
const rows = _nullishCoalesce(args.meshRows, () => ( cols));
|
|
11630
|
-
const mesh =
|
|
11631
|
-
out.mesh = { columns: cols, rows, pointsPerRow:
|
|
11630
|
+
const mesh = _chunkLXGOYRPEcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
|
|
11631
|
+
out.mesh = { columns: cols, rows, pointsPerRow: _chunkLXGOYRPEcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkLXGOYRPEcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
|
|
11632
11632
|
}
|
|
11633
11633
|
return out;
|
|
11634
11634
|
}
|
|
@@ -11653,7 +11653,7 @@ function createImageTransformTools(controller) {
|
|
|
11653
11653
|
type: "object",
|
|
11654
11654
|
properties: {
|
|
11655
11655
|
...TARGET3,
|
|
11656
|
-
style: { type: "string", enum:
|
|
11656
|
+
style: { type: "string", enum: _chunkLXGOYRPEcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
|
|
11657
11657
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
|
|
11658
11658
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
|
|
11659
11659
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
|
|
@@ -11675,11 +11675,11 @@ function createImageTransformTools(controller) {
|
|
|
11675
11675
|
annotations: { title: "Warp a layer", ...WRITE6 },
|
|
11676
11676
|
handler: (args) => {
|
|
11677
11677
|
const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
|
|
11678
|
-
if (hasPreset && args.mesh !== void 0) throw new (0,
|
|
11679
|
-
if (!hasPreset && args.mesh === void 0) throw new (0,
|
|
11678
|
+
if (hasPreset && args.mesh !== void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
|
|
11679
|
+
if (!hasPreset && args.mesh === void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give a preset style or a mesh.");
|
|
11680
11680
|
let warp;
|
|
11681
11681
|
if (hasPreset) {
|
|
11682
|
-
if (args.style === void 0) throw new (0,
|
|
11682
|
+
if (args.style === void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkLXGOYRPEcjs.WARP_STYLES.join(", ")}.`);
|
|
11683
11683
|
warp = {
|
|
11684
11684
|
style: args.style,
|
|
11685
11685
|
bend: _nullishCoalesce(args.bend, () => ( 50)),
|
|
@@ -11690,7 +11690,7 @@ function createImageTransformTools(controller) {
|
|
|
11690
11690
|
} else {
|
|
11691
11691
|
const m = args.mesh;
|
|
11692
11692
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
11693
|
-
if (m.points.length !== want) throw new (0,
|
|
11693
|
+
if (m.points.length !== want) throw new (0, _chunkPMHPXCJCcjs.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}.`);
|
|
11694
11694
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
11695
11695
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
11696
11696
|
}
|
|
@@ -11785,13 +11785,13 @@ function settingsFrom(args) {
|
|
|
11785
11785
|
return out;
|
|
11786
11786
|
}
|
|
11787
11787
|
function imageArg(image) {
|
|
11788
|
-
if (typeof image !== "string" || !image.trim()) throw new (0,
|
|
11788
|
+
if (typeof image !== "string" || !image.trim()) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
|
|
11789
11789
|
return image.trim();
|
|
11790
11790
|
}
|
|
11791
11791
|
function createImageSmartObjectTools(controller) {
|
|
11792
11792
|
const smartId = (id) => {
|
|
11793
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
11794
|
-
|
|
11793
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
|
|
11794
|
+
_chunkPMHPXCJCcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
|
|
11795
11795
|
return id;
|
|
11796
11796
|
};
|
|
11797
11797
|
const info = (id) => {
|
|
@@ -11828,7 +11828,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11828
11828
|
},
|
|
11829
11829
|
annotations: { title: "Convert to Smart Object", ...WRITE7 },
|
|
11830
11830
|
handler: ({ layerIds, name }) => {
|
|
11831
|
-
for (const id2 of _nullishCoalesce(layerIds, () => ( [])))
|
|
11831
|
+
for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkPMHPXCJCcjs.requireLayer.call(void 0, controller.getLayers(), id2);
|
|
11832
11832
|
const id = controller.convertToSmartObject(layerIds, { name });
|
|
11833
11833
|
return { layer: layerSummary(id), smartObject: info(id) };
|
|
11834
11834
|
}
|
|
@@ -11865,7 +11865,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11865
11865
|
{
|
|
11866
11866
|
type: "object",
|
|
11867
11867
|
properties: {
|
|
11868
|
-
style: { type: "string", enum:
|
|
11868
|
+
style: { type: "string", enum: _chunkLXGOYRPEcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
|
|
11869
11869
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
|
|
11870
11870
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
|
|
11871
11871
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
|
|
@@ -11901,12 +11901,12 @@ function createImageSmartObjectTools(controller) {
|
|
|
11901
11901
|
else if (w) {
|
|
11902
11902
|
const m = w;
|
|
11903
11903
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
11904
|
-
if (m.points.length !== want) throw new (0,
|
|
11904
|
+
if (m.points.length !== want) throw new (0, _chunkPMHPXCJCcjs.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}.`);
|
|
11905
11905
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
11906
11906
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
11907
11907
|
}
|
|
11908
11908
|
const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
|
|
11909
|
-
if (!keys.some((k) => args[k] !== void 0)) throw new (0,
|
|
11909
|
+
if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
|
|
11910
11910
|
const res = controller.setSmartObjectTransform(id, {
|
|
11911
11911
|
corners: args.corners,
|
|
11912
11912
|
matrix: args.matrix,
|
|
@@ -12031,7 +12031,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
12031
12031
|
handler: (args) => {
|
|
12032
12032
|
const id = smartId(args.layerId);
|
|
12033
12033
|
const changes = settingsFrom(args);
|
|
12034
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
12034
|
+
if (!Object.keys(changes).length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give at least one value to change.");
|
|
12035
12035
|
const filter = controller.updateSmartFilter(id, args.filterId, changes);
|
|
12036
12036
|
return { layerId: id, filter, smartFilters: info(id).smartFilters };
|
|
12037
12037
|
}
|
|
@@ -12352,8 +12352,8 @@ function geometry(args) {
|
|
|
12352
12352
|
}
|
|
12353
12353
|
function createImageShapeTools(controller) {
|
|
12354
12354
|
const shapeId = (id) => {
|
|
12355
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12356
|
-
|
|
12355
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
|
|
12356
|
+
_chunkPMHPXCJCcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
|
|
12357
12357
|
return id;
|
|
12358
12358
|
};
|
|
12359
12359
|
const layerSummary = (id) => {
|
|
@@ -12428,7 +12428,7 @@ function createImageShapeTools(controller) {
|
|
|
12428
12428
|
annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
|
|
12429
12429
|
handler: ({ layerId, fill, stroke, fillRule }) => {
|
|
12430
12430
|
const id = shapeId(layerId);
|
|
12431
|
-
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0,
|
|
12431
|
+
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
|
|
12432
12432
|
return controller.setShapeStyle(id, { fill, stroke, fillRule });
|
|
12433
12433
|
}
|
|
12434
12434
|
};
|
|
@@ -12477,7 +12477,7 @@ function createImageShapeTools(controller) {
|
|
|
12477
12477
|
handler: ({ layerId, componentIndex, ...rest }) => {
|
|
12478
12478
|
const id = shapeId(layerId);
|
|
12479
12479
|
const change = geometry(rest);
|
|
12480
|
-
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0,
|
|
12480
|
+
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("Give shape, subpaths or op to change.");
|
|
12481
12481
|
return controller.setShapeComponent(id, componentIndex, change);
|
|
12482
12482
|
}
|
|
12483
12483
|
};
|
|
@@ -12551,8 +12551,8 @@ function pick2(args, keys) {
|
|
|
12551
12551
|
}
|
|
12552
12552
|
function createImageTypeTools(controller) {
|
|
12553
12553
|
const typeId = (id) => {
|
|
12554
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12555
|
-
|
|
12554
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
|
|
12555
|
+
_chunkPMHPXCJCcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
|
|
12556
12556
|
return id;
|
|
12557
12557
|
};
|
|
12558
12558
|
const layerSummary = (id) => {
|
|
@@ -12632,7 +12632,7 @@ function createImageTypeTools(controller) {
|
|
|
12632
12632
|
annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
|
|
12633
12633
|
handler: (args) => {
|
|
12634
12634
|
const style = pick2(args, Object.keys(STYLE));
|
|
12635
|
-
if (!Object.keys(style).length) throw new (0,
|
|
12635
|
+
if (!Object.keys(style).length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
|
|
12636
12636
|
return controller.setTextStyle(typeId(args.layerId), style, range(args));
|
|
12637
12637
|
}
|
|
12638
12638
|
};
|
|
@@ -12644,7 +12644,7 @@ function createImageTypeTools(controller) {
|
|
|
12644
12644
|
annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
|
|
12645
12645
|
handler: (args) => {
|
|
12646
12646
|
const style = pick2(args, Object.keys(PARAGRAPH));
|
|
12647
|
-
if (!Object.keys(style).length) throw new (0,
|
|
12647
|
+
if (!Object.keys(style).length) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
|
|
12648
12648
|
return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
|
|
12649
12649
|
}
|
|
12650
12650
|
};
|
|
@@ -12666,7 +12666,7 @@ function createImageTypeTools(controller) {
|
|
|
12666
12666
|
annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
|
|
12667
12667
|
handler: ({ layerId, kind, width, height }) => {
|
|
12668
12668
|
const id = typeId(layerId);
|
|
12669
|
-
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0,
|
|
12669
|
+
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkPMHPXCJCcjs.LayerOperationError)("kind box needs width and height in pixels.");
|
|
12670
12670
|
return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
|
|
12671
12671
|
}
|
|
12672
12672
|
};
|
|
@@ -12688,7 +12688,7 @@ function createImageTypeTools(controller) {
|
|
|
12688
12688
|
var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
|
|
12689
12689
|
function adjustmentsSummary(adjustments) {
|
|
12690
12690
|
return {
|
|
12691
|
-
process:
|
|
12691
|
+
process: _chunkPMHPXCJCcjs.normalizeProcessVersion.call(void 0, adjustments.process),
|
|
12692
12692
|
values: readAdjustmentControls(adjustments),
|
|
12693
12693
|
layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
|
|
12694
12694
|
};
|
|
@@ -12731,7 +12731,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12731
12731
|
default: def,
|
|
12732
12732
|
...requiresProcess ? { requiresProcess } : {}
|
|
12733
12733
|
})),
|
|
12734
|
-
layerKinds:
|
|
12734
|
+
layerKinds: _chunkPMHPXCJCcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
|
|
12735
12735
|
kind,
|
|
12736
12736
|
label,
|
|
12737
12737
|
controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
|
|
@@ -12817,7 +12817,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12817
12817
|
const result = { applied, clamped };
|
|
12818
12818
|
if (typeof label === "string" && label) result.label = label;
|
|
12819
12819
|
const notes = [];
|
|
12820
|
-
if ("tint" in applied &&
|
|
12820
|
+
if ("tint" in applied && _chunkPMHPXCJCcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
|
|
12821
12821
|
notes.push("Tint has no effect on process 1 edits.");
|
|
12822
12822
|
}
|
|
12823
12823
|
if (notes.length) result.notes = notes;
|
|
@@ -12827,11 +12827,11 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12827
12827
|
const addLayer = {
|
|
12828
12828
|
name: "add_adjustment_layer",
|
|
12829
12829
|
title: "Add an adjustment layer",
|
|
12830
|
-
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " +
|
|
12830
|
+
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkPMHPXCJCcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
|
|
12831
12831
|
inputSchema: {
|
|
12832
12832
|
type: "object",
|
|
12833
12833
|
properties: {
|
|
12834
|
-
kind: { type: "string", enum:
|
|
12834
|
+
kind: { type: "string", enum: _chunkPMHPXCJCcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
|
|
12835
12835
|
params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
|
|
12836
12836
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
|
|
12837
12837
|
blend: { type: "string", enum: _chunkJ5BA3BQ6cjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
|
|
@@ -12850,7 +12850,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12850
12850
|
openWorldHint: false
|
|
12851
12851
|
},
|
|
12852
12852
|
handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
|
|
12853
|
-
if (!
|
|
12853
|
+
if (!_chunkPMHPXCJCcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
|
|
12854
12854
|
if (blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
12855
12855
|
if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
|
|
12856
12856
|
for (const ref of [aboveId, parentId]) {
|
|
@@ -12944,7 +12944,7 @@ function boxToCurvePoint(x, y, width, height) {
|
|
|
12944
12944
|
return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
|
|
12945
12945
|
}
|
|
12946
12946
|
function curveSvgPath(points, width, height, samples = 64) {
|
|
12947
|
-
const lut =
|
|
12947
|
+
const lut = _chunkPMHPXCJCcjs.curveLutFromLevels.call(void 0, points);
|
|
12948
12948
|
const n = lut.length - 1;
|
|
12949
12949
|
let d = "";
|
|
12950
12950
|
for (let i = 0; i <= samples; i++) {
|
|
@@ -13454,7 +13454,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13454
13454
|
else {
|
|
13455
13455
|
const layout = this.layout();
|
|
13456
13456
|
if (layout && layout.lines.length) {
|
|
13457
|
-
const c =
|
|
13457
|
+
const c = _chunkLXGOYRPEcjs.caretAt.call(void 0, layout, f);
|
|
13458
13458
|
const line = layout.lines[c.line];
|
|
13459
13459
|
if (to === "home") f = line.start;
|
|
13460
13460
|
else if (to === "end") {
|
|
@@ -13549,7 +13549,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13549
13549
|
styleHere() {
|
|
13550
13550
|
const layer = this.layer;
|
|
13551
13551
|
const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
|
|
13552
|
-
return
|
|
13552
|
+
return _chunkLXGOYRPEcjs.styleAt.call(void 0, layer.runs, at, _chunkLXGOYRPEcjs.DEFAULT_TEXT_STYLE);
|
|
13553
13553
|
}
|
|
13554
13554
|
info() {
|
|
13555
13555
|
return this.controller.getTextLayer(this.layerId);
|
|
@@ -13558,8 +13558,8 @@ var TextEditSession = (_class11 = class {
|
|
|
13558
13558
|
overlay() {
|
|
13559
13559
|
const layer = this.layer;
|
|
13560
13560
|
const layout = this.layout();
|
|
13561
|
-
const m =
|
|
13562
|
-
const at = (x, y) =>
|
|
13561
|
+
const m = _chunkPMHPXCJCcjs.textMatrix.call(void 0, layer);
|
|
13562
|
+
const at = (x, y) => _chunkLXGOYRPEcjs.applyMatrix.call(void 0, m, { x, y });
|
|
13563
13563
|
let frame = null;
|
|
13564
13564
|
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)];
|
|
13565
13565
|
else if (layout) {
|
|
@@ -13579,7 +13579,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13579
13579
|
selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
|
|
13580
13580
|
}
|
|
13581
13581
|
}
|
|
13582
|
-
const c =
|
|
13582
|
+
const c = _chunkLXGOYRPEcjs.caretAt.call(void 0, layout, this.focus);
|
|
13583
13583
|
return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
|
|
13584
13584
|
}
|
|
13585
13585
|
/** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
|
|
@@ -13594,7 +13594,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13594
13594
|
}
|
|
13595
13595
|
if (this.layer.name === "Text" && this.changed) {
|
|
13596
13596
|
try {
|
|
13597
|
-
this.controller.setLayerProperties(this.layerId, { name:
|
|
13597
|
+
this.controller.setLayerProperties(this.layerId, { name: _chunkPMHPXCJCcjs.typeLayerName.call(void 0, this.text) }, false);
|
|
13598
13598
|
} catch (e31) {
|
|
13599
13599
|
}
|
|
13600
13600
|
}
|
|
@@ -13605,8 +13605,8 @@ function typeLayerAt(controller, p, slop = 4) {
|
|
|
13605
13605
|
const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
|
|
13606
13606
|
for (const l of layers) {
|
|
13607
13607
|
if (!l.visible) continue;
|
|
13608
|
-
const inv = invert(
|
|
13609
|
-
const q =
|
|
13608
|
+
const inv = invert(_chunkPMHPXCJCcjs.textMatrix.call(void 0, l));
|
|
13609
|
+
const q = _chunkLXGOYRPEcjs.applyMatrix.call(void 0, inv, p);
|
|
13610
13610
|
let b = null;
|
|
13611
13611
|
if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
|
|
13612
13612
|
else {
|
|
@@ -13716,7 +13716,7 @@ function layerPanelRows(layers, activeId) {
|
|
|
13716
13716
|
}
|
|
13717
13717
|
function layerLabel(layer) {
|
|
13718
13718
|
if (layer.name) return layer.name;
|
|
13719
|
-
if (layer.type === "adjustment") return
|
|
13719
|
+
if (layer.type === "adjustment") return _chunkPMHPXCJCcjs.adjustmentKindLabel.call(void 0, layer.kind);
|
|
13720
13720
|
return layer.type === "group" ? "Group" : "Layer";
|
|
13721
13721
|
}
|
|
13722
13722
|
function layerBadge(layer) {
|
|
@@ -14188,7 +14188,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
|
|
|
14188
14188
|
];
|
|
14189
14189
|
var WARP_STYLE_OPTIONS = [
|
|
14190
14190
|
{ id: "custom", label: "Custom" },
|
|
14191
|
-
...
|
|
14191
|
+
..._chunkLXGOYRPEcjs.WARP_STYLES.map((id) => ({ id, label: _chunkLXGOYRPEcjs.WARP_STYLE_LABELS[id] }))
|
|
14192
14192
|
];
|
|
14193
14193
|
var WARP_GRID_OPTIONS = [
|
|
14194
14194
|
{ id: "1x1", label: "Default", columns: 1, rows: 1 },
|
|
@@ -14324,7 +14324,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14324
14324
|
setMode(mode) {
|
|
14325
14325
|
this.modeValue = mode;
|
|
14326
14326
|
const s = this.session;
|
|
14327
|
-
if (mode === "warp" && s && !this.mesh) this.mesh =
|
|
14327
|
+
if (mode === "warp" && s && !this.mesh) this.mesh = _chunkLXGOYRPEcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
|
|
14328
14328
|
this.changed();
|
|
14329
14329
|
}
|
|
14330
14330
|
/** The Warp options bar's settings. */
|
|
@@ -14346,13 +14346,13 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14346
14346
|
this.modeValue = "warp";
|
|
14347
14347
|
const next = { ...this.warpSettings, ...changes };
|
|
14348
14348
|
this.warpSettings = next;
|
|
14349
|
-
let mesh = _nullishCoalesce(this.mesh, () => (
|
|
14349
|
+
let mesh = _nullishCoalesce(this.mesh, () => ( _chunkLXGOYRPEcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
|
|
14350
14350
|
if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
|
|
14351
14351
|
const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
|
|
14352
|
-
mesh = _nullishCoalesce(
|
|
14353
|
-
mesh =
|
|
14352
|
+
mesh = _nullishCoalesce(_chunkLXGOYRPEcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkLXGOYRPEcjs.identityWarpMesh.call(void 0, s.box)));
|
|
14353
|
+
mesh = _chunkLXGOYRPEcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14354
14354
|
}
|
|
14355
|
-
if ("columns" in changes || "rows" in changes) mesh =
|
|
14355
|
+
if ("columns" in changes || "rows" in changes) mesh = _chunkLXGOYRPEcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14356
14356
|
this.mesh = mesh;
|
|
14357
14357
|
this.changed();
|
|
14358
14358
|
this.preview();
|
|
@@ -14399,11 +14399,11 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14399
14399
|
const m = this.mesh;
|
|
14400
14400
|
const at = (p) => _nullishCoalesce(_chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p), () => ( p));
|
|
14401
14401
|
const pts = m.points.map(at);
|
|
14402
|
-
const edit =
|
|
14402
|
+
const edit = _chunkLXGOYRPEcjs.warpMeshEditPoints.call(void 0, m);
|
|
14403
14403
|
out.handles = [];
|
|
14404
|
-
out.outline =
|
|
14404
|
+
out.outline = _chunkLXGOYRPEcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
|
|
14405
14405
|
out.warp = {
|
|
14406
|
-
curves:
|
|
14406
|
+
curves: _chunkLXGOYRPEcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
|
|
14407
14407
|
anchors: edit.anchors.map((i) => pts[i]),
|
|
14408
14408
|
handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
|
|
14409
14409
|
};
|
|
@@ -14427,7 +14427,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14427
14427
|
if (!o) return null;
|
|
14428
14428
|
if (this.modeValue === "warp" && this.mesh) {
|
|
14429
14429
|
const h = this.homography();
|
|
14430
|
-
const edit =
|
|
14430
|
+
const edit = _chunkLXGOYRPEcjs.warpMeshEditPoints.call(void 0, this.mesh);
|
|
14431
14431
|
let best2 = -1;
|
|
14432
14432
|
let bestD2 = tolerance;
|
|
14433
14433
|
for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
|
|
@@ -14472,7 +14472,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14472
14472
|
if (this.modeValue === "warp" && this.mesh && handle === "inside") {
|
|
14473
14473
|
const q = this.toFrame(p, this.corners);
|
|
14474
14474
|
if (q) {
|
|
14475
|
-
const r =
|
|
14475
|
+
const r = _chunkLXGOYRPEcjs.warpMeshParamAt.call(void 0, this.mesh, q);
|
|
14476
14476
|
st = { s: r.s, t: r.t };
|
|
14477
14477
|
}
|
|
14478
14478
|
}
|
|
@@ -14505,8 +14505,8 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14505
14505
|
if (!a || !b) return;
|
|
14506
14506
|
const delta = { x: b.x - a.x, y: b.y - a.y };
|
|
14507
14507
|
const i = meshIndex(d.handle);
|
|
14508
|
-
if (i >= 0) this.mesh =
|
|
14509
|
-
else if (d.handle === "inside" && d.st) this.mesh =
|
|
14508
|
+
if (i >= 0) this.mesh = _chunkLXGOYRPEcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
|
|
14509
|
+
else if (d.handle === "inside" && d.st) this.mesh = _chunkLXGOYRPEcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
|
|
14510
14510
|
else return;
|
|
14511
14511
|
this.warpSettings = { ...this.warpSettings, style: "custom" };
|
|
14512
14512
|
this.changed();
|
|
@@ -14630,7 +14630,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14630
14630
|
bar() {
|
|
14631
14631
|
const s = this.session;
|
|
14632
14632
|
if (!s || !this.corners) return null;
|
|
14633
|
-
const read =
|
|
14633
|
+
const read = _chunkPMHPXCJCcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
|
|
14634
14634
|
return {
|
|
14635
14635
|
affine: read.affine,
|
|
14636
14636
|
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
@@ -14655,7 +14655,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14655
14655
|
this.changed();
|
|
14656
14656
|
return;
|
|
14657
14657
|
}
|
|
14658
|
-
const m =
|
|
14658
|
+
const m = _chunkPMHPXCJCcjs.matrixFromParams.call(void 0, s.box, {
|
|
14659
14659
|
scaleX: next.scaleX,
|
|
14660
14660
|
scaleY: next.scaleY,
|
|
14661
14661
|
rotate: next.rotate,
|
|
@@ -14665,7 +14665,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14665
14665
|
dx: next.x - this.refBox.x,
|
|
14666
14666
|
dy: next.y - this.refBox.y
|
|
14667
14667
|
});
|
|
14668
|
-
this.setCorners(
|
|
14668
|
+
this.setCorners(_chunkPMHPXCJCcjs.cornersFromMatrix.call(void 0, s.box, m));
|
|
14669
14669
|
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
14670
14670
|
this.changed();
|
|
14671
14671
|
}
|
|
@@ -15753,5 +15753,5 @@ function createImageEffectsToolProvider(controller, options = {}) {
|
|
|
15753
15753
|
|
|
15754
15754
|
|
|
15755
15755
|
|
|
15756
|
-
exports.ADJUSTMENT_KEYS = _chunkXLUYXUBDcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkXLUYXUBDcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkXLUYXUBDcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkXLUYXUBDcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkXLUYXUBDcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkXLUYXUBDcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkJ5BA3BQ6cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkJ5BA3BQ6cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkXLUYXUBDcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkFHPVDTI2cjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkZ6OUCS2Kcjs.BrushstrokeCache; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunk6GFRKLLScjs.CoverageMap; exports.D50 = _chunkXLUYXUBDcjs.D50; exports.D65 = _chunkXLUYXUBDcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkORE334I6cjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk6GFRKLLScjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk6GFRKLLScjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkFHPVDTI2cjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkMZXQTKUMcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkXLUYXUBDcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk6GFRKLLScjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkW6M7C7R3cjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk6GFRKLLScjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkORE334I6cjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkFHPVDTI2cjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkFHPVDTI2cjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkXLUYXUBDcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkMZXQTKUMcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkFHPVDTI2cjs.DRY_EPS; exports.DabWalker = _chunk6GFRKLLScjs.DabWalker; exports.EMPTY_DISTANCE = _chunkXLUYXUBDcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk6GFRKLLScjs.EMPTY_MIXER_LOAD; exports.EX = _chunkFHPVDTI2cjs.EX; exports.EY = _chunkFHPVDTI2cjs.EY; exports.FLAG_ALIVE = _chunkFHPVDTI2cjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkFHPVDTI2cjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkFHPVDTI2cjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkFHPVDTI2cjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkFHPVDTI2cjs.FLAG_TOP; exports.FLAG_WET = _chunkFHPVDTI2cjs.FLAG_WET; exports.FLAT = _chunkFHPVDTI2cjs.FLAT; exports.FREE_INTERVAL = _chunkFHPVDTI2cjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkXLUYXUBDcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkFHPVDTI2cjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkXLUYXUBDcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkXLUYXUBDcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkMZXQTKUMcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkXLUYXUBDcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkMZXQTKUMcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkXLUYXUBDcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkXLUYXUBDcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkXLUYXUBDcjs.LUMA_709; exports.LayerCompositor = _chunkXLUYXUBDcjs.LayerCompositor; exports.LayerEffectError = _chunkMZXQTKUMcjs.LayerEffectError; exports.LayerOperationError = _chunkXLUYXUBDcjs.LayerOperationError; exports.MAX_BATCH = _chunkFHPVDTI2cjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunk6GFRKLLScjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkMZXQTKUMcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkXLUYXUBDcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkFHPVDTI2cjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkMZXQTKUMcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkFHPVDTI2cjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkFHPVDTI2cjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkXLUYXUBDcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkXLUYXUBDcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk6GFRKLLScjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk6GFRKLLScjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk6GFRKLLScjs.MIXING_MODELS; exports.MixerStroke = _chunk6GFRKLLScjs.MixerStroke; exports.OPP = _chunkFHPVDTI2cjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkJ5BA3BQ6cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunk6GFRKLLScjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunk6GFRKLLScjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunk6GFRKLLScjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkFHPVDTI2cjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkXLUYXUBDcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkFHPVDTI2cjs.PARAM; exports.PARAM_FLOATS = _chunkFHPVDTI2cjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkXLUYXUBDcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkJ5BA3BQ6cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkFHPVDTI2cjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkFHPVDTI2cjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkJ5BA3BQ6cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkFHPVDTI2cjs.PLANE; exports.PLANE_BYTES = _chunkFHPVDTI2cjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkXLUYXUBDcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkFHPVDTI2cjs.P_D0; exports.P_EDGE = _chunkFHPVDTI2cjs.P_EDGE; exports.P_FX = _chunkFHPVDTI2cjs.P_FX; exports.P_FY = _chunkFHPVDTI2cjs.P_FY; exports.P_H = _chunkFHPVDTI2cjs.P_H; exports.P_P0 = _chunkFHPVDTI2cjs.P_P0; exports.P_RHO = _chunkFHPVDTI2cjs.P_RHO; exports.P_SW = _chunkFHPVDTI2cjs.P_SW; exports.P_UX = _chunkFHPVDTI2cjs.P_UX; exports.P_UY = _chunkFHPVDTI2cjs.P_UY; exports.PaintExchange = _chunk6GFRKLLScjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunk6GFRKLLScjs.PaintGradientSampler; exports.PaintSourceError = _chunk6GFRKLLScjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkMZXQTKUMcjs.PatternPlacement; exports.PatternTile = _chunkMZXQTKUMcjs.PatternTile; exports.PsdError = _chunkXLUYXUBDcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkW6M7C7R3cjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkW6M7C7R3cjs.RegionPixelSource; exports.RetouchDabStroke = _chunkW6M7C7R3cjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkXLUYXUBDcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkXLUYXUBDcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkFHPVDTI2cjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkJ5BA3BQ6cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkXLUYXUBDcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkXLUYXUBDcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkFHPVDTI2cjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkFHPVDTI2cjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkFHPVDTI2cjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkXLUYXUBDcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkW6M7C7R3cjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkFHPVDTI2cjs.SRGB_TO_LINEAR; exports.STRIP = _chunkFHPVDTI2cjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkXLUYXUBDcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk6GFRKLLScjs.SmudgeTip; exports.StrokeCoverage = _chunk6GFRKLLScjs.StrokeCoverage; exports.SurfaceDraft = _chunkJ5BA3BQ6cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkXLUYXUBDcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkXLUYXUBDcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkXLUYXUBDcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkJ5BA3BQ6cjs.TILE; exports.TILE_SHIFT = _chunkJ5BA3BQ6cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkXLUYXUBDcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk6GFRKLLScjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkXLUYXUBDcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkW6M7C7R3cjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkXLUYXUBDcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunk6GFRKLLScjs.TileMedium; exports.TilePixelSource = _chunkW6M7C7R3cjs.TilePixelSource; exports.TiledSurface = _chunkJ5BA3BQ6cjs.TiledSurface; exports.TransformTooLargeError = _chunkMZXQTKUMcjs.TransformTooLargeError; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkFHPVDTI2cjs.U_MAX; exports.VIBRANCE_GREY = _chunkXLUYXUBDcjs.VIBRANCE_GREY; exports.W9 = _chunkFHPVDTI2cjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkORE334I6cjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkORE334I6cjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkFHPVDTI2cjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkFHPVDTI2cjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkFHPVDTI2cjs.WET_TILE; exports.WGSL_HALO = _chunkFHPVDTI2cjs.WGSL_HALO; exports.WGSL_SHADE = _chunkFHPVDTI2cjs.WGSL_SHADE; exports.WGSL_STEP = _chunkFHPVDTI2cjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkFHPVDTI2cjs.WetGpuEngine; exports.WetMedium = _chunkFHPVDTI2cjs.WetMedium; exports.WetWorkerPool = _chunkFHPVDTI2cjs.WetWorkerPool; exports.WetWorld = _chunkFHPVDTI2cjs.WetWorld; exports.WetWorldError = _chunkFHPVDTI2cjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkXLUYXUBDcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkXLUYXUBDcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkXLUYXUBDcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkXLUYXUBDcjs.activeSmartFilters; exports.addLayerEffect = _chunkXLUYXUBDcjs.addLayerEffect; exports.addLayerFilter = _chunkXLUYXUBDcjs.addLayerFilter; exports.addPaintGradientStop = _chunk6GFRKLLScjs.addPaintGradientStop; exports.addSmartFilter = _chunkXLUYXUBDcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkXLUYXUBDcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkXLUYXUBDcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkXLUYXUBDcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkXLUYXUBDcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkXLUYXUBDcjs.anchorPoint; exports.annotationBlend = _chunkXLUYXUBDcjs.annotationBlend; exports.annotationLayerFor = _chunkXLUYXUBDcjs.annotationLayerFor; exports.annotationLayerName = _chunkXLUYXUBDcjs.annotationLayerName; exports.annotationOfLayer = _chunkXLUYXUBDcjs.annotationOfLayer; exports.annotationOfShape = _chunkXLUYXUBDcjs.annotationOfShape; exports.annotationOfType = _chunkXLUYXUBDcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkXLUYXUBDcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkXLUYXUBDcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkXLUYXUBDcjs.applyAdjustments; exports.applyBoxBlur = _chunkXLUYXUBDcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkXLUYXUBDcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkXLUYXUBDcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkXLUYXUBDcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkXLUYXUBDcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkXLUYXUBDcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkXLUYXUBDcjs.applyParams; exports.applyProcess2Adjustments = _chunkXLUYXUBDcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkXLUYXUBDcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkW6M7C7R3cjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkXLUYXUBDcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk6GFRKLLScjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk6GFRKLLScjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkW6M7C7R3cjs.applyToneToDeepTile; exports.backgroundLayer = _chunkXLUYXUBDcjs.backgroundLayer; exports.base64ToBytes = _chunkDCLJNVZScjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkW6M7C7R3cjs.bestOffset; exports.blackWhiteGray = _chunkXLUYXUBDcjs.blackWhiteGray; exports.blendChannel = _chunkJ5BA3BQ6cjs.blendChannel; exports.blendImageData = _chunkJ5BA3BQ6cjs.blendImageData; exports.blendLum = _chunkJ5BA3BQ6cjs.blendLum; exports.blendPixel = _chunkJ5BA3BQ6cjs.blendPixel; exports.blendRadius = _chunk6GFRKLLScjs.blendRadius; exports.blendRgb = _chunkJ5BA3BQ6cjs.blendRgb; exports.blendTile = _chunkMZXQTKUMcjs.blendTile; exports.blenderDab = _chunk6GFRKLLScjs.blenderDab; exports.blurFilter = _chunkXLUYXUBDcjs.blurFilter; exports.borderCoverage = _chunkXLUYXUBDcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkXLUYXUBDcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkXLUYXUBDcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkZ6OUCS2Kcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkZ6OUCS2Kcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkZ6OUCS2Kcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkSYPFUL5Bcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkZ6OUCS2Kcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkZ6OUCS2Kcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkXLUYXUBDcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkXLUYXUBDcjs.buildToneLut; exports.builtinPattern = _chunkMZXQTKUMcjs.builtinPattern; exports.builtinPatternIds = _chunkMZXQTKUMcjs.builtinPatternIds; exports.bytesToBase64 = _chunkDCLJNVZScjs.bytesToBase64; exports.calculateCropDrag = _chunkXLUYXUBDcjs.calculateCropDrag; exports.canShareMemory = _chunkFHPVDTI2cjs.canShareMemory; exports.canvasCompositeOperation = _chunkJ5BA3BQ6cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkXLUYXUBDcjs.canvasToImagePoint; exports.caretAt = _chunkORE334I6cjs.caretAt; exports.changedTiles = _chunkMZXQTKUMcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkXLUYXUBDcjs.clampCropToImage; exports.cleanMixer = _chunk6GFRKLLScjs.cleanMixer; exports.cloneSourceLabel = cloneSourceLabel; exports.collectTiles = _chunkJ5BA3BQ6cjs.collectTiles; exports.colorBalanceChannel = _chunkXLUYXUBDcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkXLUYXUBDcjs.combineSelections; exports.compileAdjustmentLayer = _chunkXLUYXUBDcjs.compileAdjustmentLayer; exports.componentPath = _chunkXLUYXUBDcjs.componentPath; exports.compositeDeep = _chunkXLUYXUBDcjs.compositeDeep; exports.compositeSurfaceOver = _chunkMZXQTKUMcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkXLUYXUBDcjs.computeSelectionBounds; exports.contentBounds = _chunkJ5BA3BQ6cjs.contentBounds; exports.contentsBox = _chunkXLUYXUBDcjs.contentsBox; exports.contentsSurface = _chunkXLUYXUBDcjs.contentsSurface; exports.contractCoverage = _chunkXLUYXUBDcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkJ5BA3BQ6cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkXLUYXUBDcjs.convertToSmartObject; exports.copySmartObject = _chunkXLUYXUBDcjs.copySmartObject; exports.cornersFromMatrix = _chunkXLUYXUBDcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk6GFRKLLScjs.coverageTileCoord; exports.coverageToByte = _chunkXLUYXUBDcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkXLUYXUBDcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk6GFRKLLScjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkORE334I6cjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkORE334I6cjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkORE334I6cjs.createOutlineTextShaper; exports.createPigment = _chunkJ5BA3BQ6cjs.createPigment; exports.createPigmentTools = _chunkFHPVDTI2cjs.createPigmentTools; exports.createSelectionMask = _chunkXLUYXUBDcjs.createSelectionMask; exports.createShapeLayer = _chunkXLUYXUBDcjs.createShapeLayer; exports.createTypeLayer = _chunkXLUYXUBDcjs.createTypeLayer; exports.createWetGpuEngine = _chunkFHPVDTI2cjs.createWetGpuEngine; exports.cssFont = _chunkORE334I6cjs.cssFont; exports.cssFontFamily = _chunkORE334I6cjs.cssFontFamily; exports.curveLut = _chunkMZXQTKUMcjs.curveLut; exports.curveLutFromLevels = _chunkXLUYXUBDcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk6GFRKLLScjs.dabCoverage; exports.dabRect = _chunk6GFRKLLScjs.dabRect; exports.decodeDeepSurface = _chunkXLUYXUBDcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkXLUYXUBDcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkXLUYXUBDcjs.decodeLayerMask; exports.decodeMergedImage = _chunkXLUYXUBDcjs.decodeMergedImage; exports.decodePlanes = _chunkXLUYXUBDcjs.decodePlanes; exports.decodePng = _chunkDCLJNVZScjs.decodePng; exports.decodePngDataUrl = _chunkXLUYXUBDcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkXLUYXUBDcjs.decodeSelectionRle; exports.deepBytes = _chunkJ5BA3BQ6cjs.deepBytes; exports.deepTile = _chunkJ5BA3BQ6cjs.deepTile; exports.defaultAdjustmentParams = _chunkXLUYXUBDcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkMZXQTKUMcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkMZXQTKUMcjs.defaultLayerEffect; exports.defaultShapeName = _chunkXLUYXUBDcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkXLUYXUBDcjs.depthMaskAlpha; exports.depthOf = _chunkJ5BA3BQ6cjs.depthOf; exports.depthRasterMask = _chunkXLUYXUBDcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkXLUYXUBDcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkXLUYXUBDcjs.deserializeEffects; exports.deserializeLayer = _chunkXLUYXUBDcjs.deserializeLayer; exports.deserializeLayers = _chunkXLUYXUBDcjs.deserializeLayers; exports.deserializePatterns = _chunkXLUYXUBDcjs.deserializePatterns; exports.deserializeSelection = _chunkXLUYXUBDcjs.deserializeSelection; exports.developFilter = _chunkXLUYXUBDcjs.developFilter; exports.developFromAdjustments = _chunkXLUYXUBDcjs.developFromAdjustments; exports.developTarget = _chunkXLUYXUBDcjs.developTarget; exports.dexp = _chunkFHPVDTI2cjs.dexp; exports.dilateMask = _chunkW6M7C7R3cjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkXLUYXUBDcjs.distanceTransform; exports.dlog = _chunkFHPVDTI2cjs.dlog; exports.documentContents = _chunkXLUYXUBDcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkW6M7C7R3cjs.dodgeBurn; exports.dodgeBurnCurve = _chunkW6M7C7R3cjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkFHPVDTI2cjs.dpow; exports.dragWarpMeshPoint = _chunkORE334I6cjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkFHPVDTI2cjs.dsincos; exports.duplicateLayer = _chunkXLUYXUBDcjs.duplicateLayer; exports.edgeBits = _chunkFHPVDTI2cjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkMZXQTKUMcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkMZXQTKUMcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkMZXQTKUMcjs.effectsFingerprint; exports.effectsMargin = _chunkMZXQTKUMcjs.effectsMargin; exports.effectsScale = _chunkMZXQTKUMcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkJ5BA3BQ6cjs.emptySurface; exports.encodeDeepSurface = _chunkXLUYXUBDcjs.encodeDeepSurface; exports.encodePng = _chunkDCLJNVZScjs.encodePng; exports.encodeRle = _chunkXLUYXUBDcjs.encodeRle; exports.encodeSelectionRle = _chunkXLUYXUBDcjs.encodeSelectionRle; exports.encodeSurface = _chunkXLUYXUBDcjs.encodeSurface; exports.evalWarpMesh = _chunkORE334I6cjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkXLUYXUBDcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk6GFRKLLScjs.exchangeRates; exports.expNeg = _chunkFHPVDTI2cjs.expNeg; exports.expandCoverage = _chunkXLUYXUBDcjs.expandCoverage; exports.exportPsd = _chunkXLUYXUBDcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkXLUYXUBDcjs.featherCoverage; exports.fillRect = _chunkJ5BA3BQ6cjs.fillRect; exports.filmPixel = _chunkFHPVDTI2cjs.filmPixel; exports.filmReflectance = _chunkFHPVDTI2cjs.filmReflectance; exports.filterMaskCoverage = _chunkXLUYXUBDcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkMZXQTKUMcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkFHPVDTI2cjs.findWebGpu; exports.finishTile = _chunkJ5BA3BQ6cjs.finishTile; exports.fitParagraphRuns = _chunkORE334I6cjs.fitParagraphRuns; exports.fitRuns = _chunkORE334I6cjs.fitRuns; exports.flattenLayers = _chunkMZXQTKUMcjs.flattenLayers; exports.flattenPath = _chunkXLUYXUBDcjs.flattenPath; exports.flipCorners = _chunkXLUYXUBDcjs.flipCorners; exports.flowField = _chunkFHPVDTI2cjs.flowField; exports.fontOf = _chunkORE334I6cjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkXLUYXUBDcjs.fullSelection; exports.gaussianBlur = _chunkMZXQTKUMcjs.gaussianBlur; exports.geometryHomography = _chunkXLUYXUBDcjs.geometryHomography; exports.getAnnotationBounds = _chunkXLUYXUBDcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkXLUYXUBDcjs.getCropCursor; exports.getRotatedSize = _chunkXLUYXUBDcjs.getRotatedSize; exports.getViewportMetrics = _chunkXLUYXUBDcjs.getViewportMetrics; exports.getViewportProjection = _chunkXLUYXUBDcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk6GFRKLLScjs.gradientDabColor; exports.greyMorphology = _chunkXLUYXUBDcjs.greyMorphology; exports.groupLayers = _chunkXLUYXUBDcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkMZXQTKUMcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkXLUYXUBDcjs.hasResampledLegacyMask; exports.hasSurface = _chunkXLUYXUBDcjs.hasSurface; exports.hasWarp = _chunkXLUYXUBDcjs.hasWarp; exports.hash2 = _chunk6GFRKLLScjs.hash2; exports.hashMaskContent = _chunkXLUYXUBDcjs.hashMaskContent; exports.hashNoise = _chunkMZXQTKUMcjs.hashNoise; exports.healPixels = _chunkW6M7C7R3cjs.healPixels; exports.hexToPaintRgb = _chunk6GFRKLLScjs.hexToPaintRgb; exports.hexToRgb = _chunkXLUYXUBDcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkXLUYXUBDcjs.hitTestAnnotation; exports.hitTestCrop = _chunkXLUYXUBDcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkXLUYXUBDcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkXLUYXUBDcjs.hueRangeTables; exports.hueRangeWeight = _chunkXLUYXUBDcjs.hueRangeWeight; exports.hueSaturation = _chunkXLUYXUBDcjs.hueSaturation; exports.identityCurve = _chunkXLUYXUBDcjs.identityCurve; exports.identityLevels = _chunkXLUYXUBDcjs.identityLevels; exports.identityTransform = _chunkXLUYXUBDcjs.identityTransform; exports.identityWarpMesh = _chunkORE334I6cjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkXLUYXUBDcjs.imageToCanvasPoint; exports.importPsd = _chunkXLUYXUBDcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkMZXQTKUMcjs.insertLayer; exports.instancesOf = _chunkXLUYXUBDcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkXLUYXUBDcjs.invertMatrix3; exports.invertSelection = _chunkXLUYXUBDcjs.invertSelection; exports.isActiveFilter = _chunkXLUYXUBDcjs.isActiveFilter; exports.isAdjustmentKind = _chunkXLUYXUBDcjs.isAdjustmentKind; exports.isBitDepth = _chunkJ5BA3BQ6cjs.isBitDepth; exports.isBlendMode = _chunkJ5BA3BQ6cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkZ6OUCS2Kcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkXLUYXUBDcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkXLUYXUBDcjs.isDefaultDepthMask; exports.isGradientPaint = _chunk6GFRKLLScjs.isGradientPaint; exports.isIdentityTransform = _chunkXLUYXUBDcjs.isIdentityTransform; exports.isInterpolation = _chunkMZXQTKUMcjs.isInterpolation; exports.isLayerEffectKind = _chunkMZXQTKUMcjs.isLayerEffectKind; exports.isLayerLocked = _chunkMZXQTKUMcjs.isLayerLocked; exports.isLegacyShape = _chunkXLUYXUBDcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkJ5BA3BQ6cjs.isPainterlyBlendMode; exports.isPng = _chunkDCLJNVZScjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkXLUYXUBDcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkXLUYXUBDcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkXLUYXUBDcjs.isSelectionEmpty; exports.isSelectionMode = _chunkXLUYXUBDcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkJ5BA3BQ6cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkXLUYXUBDcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkXLUYXUBDcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkXLUYXUBDcjs.isTransformAnchor; exports.isValidWarp = _chunkXLUYXUBDcjs.isValidWarp; exports.keepDeepSamples = _chunkJ5BA3BQ6cjs.keepDeepSamples; exports.kelvinToTemperature = _chunkXLUYXUBDcjs.kelvinToTemperature; exports.keysWeight = _chunkMZXQTKUMcjs.keysWeight; exports.latticeViscosity = _chunkFHPVDTI2cjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkMZXQTKUMcjs.layerEffectFields; exports.layerEffectLabel = _chunkMZXQTKUMcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkXLUYXUBDcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkXLUYXUBDcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkXLUYXUBDcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkXLUYXUBDcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkXLUYXUBDcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkXLUYXUBDcjs.layerTree; exports.layerTypeLabel = _chunkXLUYXUBDcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkXLUYXUBDcjs.layersFromLegacy; exports.layoutText = _chunkORE334I6cjs.layoutText; exports.legacyAdjustmentLayer = _chunkXLUYXUBDcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkXLUYXUBDcjs.legacyMaskOf; exports.legacyView = _chunkXLUYXUBDcjs.legacyView; exports.lerpPigment = _chunkJ5BA3BQ6cjs.lerpPigment; exports.lerpPigmentInto = _chunkJ5BA3BQ6cjs.lerpPigmentInto; exports.levelsValue = _chunkXLUYXUBDcjs.levelsValue; exports.linearSrgbToXy = _chunkXLUYXUBDcjs.linearSrgbToXy; exports.linearToSrgb = _chunkXLUYXUBDcjs.linearToSrgb; exports.linearToSrgb8 = _chunkFHPVDTI2cjs.linearToSrgb8; exports.liveComponent = _chunkXLUYXUBDcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkXLUYXUBDcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk6GFRKLLScjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkFHPVDTI2cjs.loadWetKernel; exports.luma = _chunkW6M7C7R3cjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkXLUYXUBDcjs.mapCropHandle; exports.mapLayer = _chunkMZXQTKUMcjs.mapLayer; exports.mapSubpaths = _chunkXLUYXUBDcjs.mapSubpaths; exports.maskBounds = _chunkW6M7C7R3cjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkXLUYXUBDcjs.matrixFromCorners; exports.matrixFromParams = _chunkXLUYXUBDcjs.matrixFromParams; exports.membraneFill = _chunkW6M7C7R3cjs.membraneFill; exports.mergeLayerEffect = _chunkMZXQTKUMcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkXLUYXUBDcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunk6GFRKLLScjs.mix32; exports.mixPigment8 = _chunkJ5BA3BQ6cjs.mixPigment8; exports.mixPigmentRgb = _chunkJ5BA3BQ6cjs.mixPigmentRgb; exports.mixPigments = _chunkJ5BA3BQ6cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk6GFRKLLScjs.mixerRates; exports.modifySelection = _chunkXLUYXUBDcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkXLUYXUBDcjs.moveLayer; exports.moveSmartFilter = _chunkXLUYXUBDcjs.moveSmartFilter; exports.mulMatrix3 = _chunkXLUYXUBDcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkXLUYXUBDcjs.neutralHueRange; exports.newContentsId = _chunkXLUYXUBDcjs.newContentsId; exports.newEffectId = _chunkMZXQTKUMcjs.newEffectId; exports.newLayerId = _chunkXLUYXUBDcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkXLUYXUBDcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkXLUYXUBDcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkXLUYXUBDcjs.normalizeAngle; exports.normalizeBlendMode = _chunkJ5BA3BQ6cjs.normalizeBlendMode; exports.normalizeBlender = _chunk6GFRKLLScjs.normalizeBlender; exports.normalizeBrush = _chunk6GFRKLLScjs.normalizeBrush; exports.normalizeFilter = _chunkXLUYXUBDcjs.normalizeFilter; exports.normalizeFlow = _chunkFHPVDTI2cjs.normalizeFlow; exports.normalizeHexColor = _chunk6GFRKLLScjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkMZXQTKUMcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkXLUYXUBDcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkXLUYXUBDcjs.normalizeLiveShape; exports.normalizeMixer = _chunk6GFRKLLScjs.normalizeMixer; exports.normalizePlacement = _chunkXLUYXUBDcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkXLUYXUBDcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkW6M7C7R3cjs.normalizeRetouch; exports.normalizeShapePaint = _chunkXLUYXUBDcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkXLUYXUBDcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkXLUYXUBDcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk6GFRKLLScjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkXLUYXUBDcjs.normalizeSubpaths; exports.normalizeText = _chunkXLUYXUBDcjs.normalizeText; exports.normalizeTilt = _chunkFHPVDTI2cjs.normalizeTilt; exports.normalizeWetParams = _chunkFHPVDTI2cjs.normalizeWetParams; exports.offsetLayer = _chunkXLUYXUBDcjs.offsetLayer; exports.offsetShape = _chunkXLUYXUBDcjs.offsetShape; exports.offsetSmartObject = _chunkXLUYXUBDcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkJ5BA3BQ6cjs.packRgba; exports.packWetParams = _chunkFHPVDTI2cjs.packWetParams; exports.paintGradientMappingFor = _chunk6GFRKLLScjs.paintGradientMappingFor; exports.paintPathStroke = _chunkZ6OUCS2Kcjs.paintPathStroke; exports.paintSourceColor = _chunk6GFRKLLScjs.paintSourceColor; exports.paintSourceCss = _chunk6GFRKLLScjs.paintSourceCss; exports.paragraphRanges = _chunkORE334I6cjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkXLUYXUBDcjs.parseAdjustmentBlock; exports.parseBlend = _chunkXLUYXUBDcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkDCLJNVZScjs.parseDataUrl; exports.parseEffectColor = _chunkMZXQTKUMcjs.parseEffectColor; exports.parseLfx2 = _chunkXLUYXUBDcjs.parseLfx2; exports.parseLrfx = _chunkXLUYXUBDcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk6GFRKLLScjs.parsePaintSource; exports.parsePatternBlock = _chunkXLUYXUBDcjs.parsePatternBlock; exports.parseSelectionMode = _chunkXLUYXUBDcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkXLUYXUBDcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkXLUYXUBDcjs.patchParagraphStyle; exports.patchTextStyle = _chunkXLUYXUBDcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkZ6OUCS2Kcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkZ6OUCS2Kcjs.pathStrokeDabs; exports.perDabStrength = _chunkW6M7C7R3cjs.perDabStrength; exports.photoFilterMatrix = _chunkXLUYXUBDcjs.photoFilterMatrix; exports.pigment8 = _chunkJ5BA3BQ6cjs.pigment8; exports.pigmentColor = _chunkFHPVDTI2cjs.pigmentColor; exports.pigmentOf = _chunkFHPVDTI2cjs.pigmentOf; exports.pixelLayerBounds = _chunkXLUYXUBDcjs.pixelLayerBounds; exports.pixelLayers = _chunkXLUYXUBDcjs.pixelLayers; exports.pixelPigment = _chunkFHPVDTI2cjs.pixelPigment; exports.placeContents = _chunkXLUYXUBDcjs.placeContents; exports.placeLayer = _chunkXLUYXUBDcjs.placeLayer; exports.placementAt = _chunkXLUYXUBDcjs.placementAt; exports.placementBounds = _chunkXLUYXUBDcjs.placementBounds; exports.placementGeometry = _chunkXLUYXUBDcjs.placementGeometry; exports.pngDataUrl = _chunkDCLJNVZScjs.pngDataUrl; exports.pointerPressure = _chunkFHPVDTI2cjs.pointerPressure; exports.pointerStrokeSample = _chunkFHPVDTI2cjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkFHPVDTI2cjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkXLUYXUBDcjs.posterizeValue; exports.presetWarp = _chunkXLUYXUBDcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkXLUYXUBDcjs.projectImagePoint; exports.projectImageRect = _chunkXLUYXUBDcjs.projectImageRect; exports.projectMaskCoverage = _chunkXLUYXUBDcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkJ5BA3BQ6cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkXLUYXUBDcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkXLUYXUBDcjs.psdToLayers; exports.pullWarpMesh = _chunkORE334I6cjs.pullWarpMesh; exports.put255 = _chunk6GFRKLLScjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk6GFRKLLScjs.rand01; exports.rangeLightness = _chunkXLUYXUBDcjs.rangeLightness; exports.rasterContents = _chunkXLUYXUBDcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkXLUYXUBDcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkXLUYXUBDcjs.rasterizeCoverage; exports.rasterizeDab = _chunk6GFRKLLScjs.rasterizeDab; exports.rasterizeSmartObject = _chunkXLUYXUBDcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkJ5BA3BQ6cjs.readDeepRegion; exports.readPaintSource = _chunk6GFRKLLScjs.readPaintSource; exports.readPixel = _chunkJ5BA3BQ6cjs.readPixel; exports.readPsd = _chunkXLUYXUBDcjs.readPsd; exports.readRegion = _chunkJ5BA3BQ6cjs.readRegion; exports.readSourceRegion = _chunkW6M7C7R3cjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkMZXQTKUMcjs.reduceSurface; exports.referencePoint = _chunkXLUYXUBDcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkJ5BA3BQ6cjs.reflectanceToRgb; exports.removeAlpha = _chunkXLUYXUBDcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkXLUYXUBDcjs.removeLayer; exports.removeLayerEffect = _chunkXLUYXUBDcjs.removeLayerEffect; exports.removeLayerFilter = _chunkXLUYXUBDcjs.removeLayerFilter; exports.removePaintGradientStop = _chunk6GFRKLLScjs.removePaintGradientStop; exports.removeSmartFilter = _chunkXLUYXUBDcjs.removeSmartFilter; exports.renderBrushstroke = _chunkZ6OUCS2Kcjs.renderBrushstroke; exports.renderLayerEffects = _chunkMZXQTKUMcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkXLUYXUBDcjs.renderShape; exports.renderShapeRect = _chunkXLUYXUBDcjs.renderShapeRect; exports.renderSmartObject = _chunkXLUYXUBDcjs.renderSmartObject; exports.renderText = _chunkXLUYXUBDcjs.renderText; exports.replaceContents = _chunkXLUYXUBDcjs.replaceContents; exports.replaceTextRange = _chunkXLUYXUBDcjs.replaceTextRange; exports.requireLayer = _chunkXLUYXUBDcjs.requireLayer; exports.requireOperation = _chunkXLUYXUBDcjs.requireOperation; exports.requireShapeLayer = _chunkXLUYXUBDcjs.requireShapeLayer; exports.requireSmartObject = _chunkXLUYXUBDcjs.requireSmartObject; exports.requireTypeLayer = _chunkXLUYXUBDcjs.requireTypeLayer; exports.requireUnlocked = _chunkXLUYXUBDcjs.requireUnlocked; exports.rerender = _chunkXLUYXUBDcjs.rerender; exports.rerenderShape = _chunkXLUYXUBDcjs.rerenderShape; exports.rerenderText = _chunkXLUYXUBDcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkXLUYXUBDcjs.resizeSelection; exports.resizeWarpMesh = _chunkORE334I6cjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkXLUYXUBDcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk6GFRKLLScjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkORE334I6cjs.restyleRange; exports.reversePaintGradient = _chunk6GFRKLLScjs.reversePaintGradient; exports.rgbToGray = _chunkXLUYXUBDcjs.rgbToGray; exports.rgbToHsl = _chunkXLUYXUBDcjs.rgbToHsl; exports.rgbToReflectance = _chunkJ5BA3BQ6cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkW6M7C7R3cjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkXLUYXUBDcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkXLUYXUBDcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkXLUYXUBDcjs.sampleLut; exports.sampleToneLut = _chunkXLUYXUBDcjs.sampleToneLut; exports.saturationOf = _chunkW6M7C7R3cjs.saturationOf; exports.scaleLayerEffect = _chunkMZXQTKUMcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk6GFRKLLScjs.scalePaintGradient; exports.seamlessClone = _chunkW6M7C7R3cjs.seamlessClone; exports.selectionArea = _chunkXLUYXUBDcjs.selectionArea; exports.selectionFromCoverage = _chunkXLUYXUBDcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkXLUYXUBDcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkXLUYXUBDcjs.selectionToCoverage; exports.selectionToPixels = _chunkXLUYXUBDcjs.selectionToPixels; exports.selectionValueAt = _chunkXLUYXUBDcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkXLUYXUBDcjs.serializeContents; exports.serializeEffects = _chunkXLUYXUBDcjs.serializeEffects; exports.serializeLayer = _chunkXLUYXUBDcjs.serializeLayer; exports.serializeLayers = _chunkXLUYXUBDcjs.serializeLayers; exports.serializeLayersExternal = _chunkXLUYXUBDcjs.serializeLayersExternal; exports.serializePatterns = _chunkXLUYXUBDcjs.serializePatterns; exports.serializeSelection = _chunkXLUYXUBDcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkXLUYXUBDcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkXLUYXUBDcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkXLUYXUBDcjs.setLayerMask; exports.setLayerProperties = _chunkXLUYXUBDcjs.setLayerProperties; exports.setLum = _chunkJ5BA3BQ6cjs.setLum; exports.setPigmentColor = _chunkJ5BA3BQ6cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkXLUYXUBDcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkXLUYXUBDcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkXLUYXUBDcjs.setSmartPlacement; exports.shadeTile = _chunkFHPVDTI2cjs.shadeTile; exports.shapeAsPixelLayer = _chunkXLUYXUBDcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkXLUYXUBDcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkXLUYXUBDcjs.shapeGeometryBounds; exports.shapeLayers = _chunkXLUYXUBDcjs.shapeLayers; exports.shapeOutline = _chunkXLUYXUBDcjs.shapeOutline; exports.shapeRenderClip = _chunkXLUYXUBDcjs.shapeRenderClip; exports.shiftCoverage = _chunkXLUYXUBDcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkXLUYXUBDcjs.smartObjectLayers; exports.smoothCoverage = _chunkXLUYXUBDcjs.smoothCoverage; exports.smoothPoints = _chunk6GFRKLLScjs.smoothPoints; exports.smudgeEffect = _chunkW6M7C7R3cjs.smudgeEffect; exports.solidPaint = _chunk6GFRKLLScjs.solidPaint; exports.solidSurface = _chunkJ5BA3BQ6cjs.solidSurface; exports.solveMembrane = _chunkW6M7C7R3cjs.solveMembrane; exports.spliceRuns = _chunkORE334I6cjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkW6M7C7R3cjs.sponge; exports.spongeEffect = _chunkW6M7C7R3cjs.spongeEffect; exports.spotHealPixels = _chunkW6M7C7R3cjs.spotHealPixels; exports.spotHealWindow = _chunkW6M7C7R3cjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkFHPVDTI2cjs.srgbByteToLinear; exports.srgbDecode = _chunkJ5BA3BQ6cjs.srgbDecode; exports.srgbEncode = _chunkJ5BA3BQ6cjs.srgbEncode; exports.srgbToLinear = _chunkXLUYXUBDcjs.srgbToLinear; exports.standardBlendMode = _chunkJ5BA3BQ6cjs.standardBlendMode; exports.stepSlotTs = _chunkFHPVDTI2cjs.stepSlotTs; exports.styleAt = _chunkORE334I6cjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkJ5BA3BQ6cjs.surfaceBytes; exports.surfaceDepth = _chunkJ5BA3BQ6cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkJ5BA3BQ6cjs.surfaceFromPixels; exports.surfacesEqual = _chunkJ5BA3BQ6cjs.surfacesEqual; exports.tempTintToXy = _chunkXLUYXUBDcjs.tempTintToXy; exports.temperatureToKelvin = _chunkXLUYXUBDcjs.temperatureToKelvin; exports.textIndexAt = _chunkORE334I6cjs.textIndexAt; exports.textMatrix = _chunkXLUYXUBDcjs.textMatrix; exports.textOutlines = _chunkXLUYXUBDcjs.textOutlines; exports.textRange = _chunkXLUYXUBDcjs.textRange; exports.tileCoord = _chunkJ5BA3BQ6cjs.tileCoord; exports.tileKey = _chunkJ5BA3BQ6cjs.tileKey; exports.tileRect = _chunkJ5BA3BQ6cjs.tileRect; exports.tileSamples = _chunkJ5BA3BQ6cjs.tileSamples; exports.tileSamples16 = _chunkJ5BA3BQ6cjs.tileSamples16; exports.tileSamples32 = _chunkJ5BA3BQ6cjs.tileSamples32; exports.tilesInRect = _chunkJ5BA3BQ6cjs.tilesInRect; exports.tipFalloff = _chunk6GFRKLLScjs.tipFalloff; exports.tipReach = _chunk6GFRKLLScjs.tipReach; exports.tipShape = _chunk6GFRKLLScjs.tipShape; exports.to16From32 = _chunkJ5BA3BQ6cjs.to16From32; exports.to16From8 = _chunkJ5BA3BQ6cjs.to16From8; exports.to32From16 = _chunkJ5BA3BQ6cjs.to32From16; exports.to32From8 = _chunkJ5BA3BQ6cjs.to32From8; exports.to8From16 = _chunkJ5BA3BQ6cjs.to8From16; exports.to8From32 = _chunkJ5BA3BQ6cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkXLUYXUBDcjs.toTextSpace; exports.toneCurve = _chunkXLUYXUBDcjs.toneCurve; exports.toneLuts = _chunkXLUYXUBDcjs.toneLuts; exports.toneOf = _chunkW6M7C7R3cjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkXLUYXUBDcjs.transformHomography; exports.transformMap = _chunkXLUYXUBDcjs.transformMap; exports.transformShapeComponents = _chunkXLUYXUBDcjs.transformShapeComponents; exports.transformSurface = _chunkMZXQTKUMcjs.transformSurface; exports.transformTypeLayer = _chunkXLUYXUBDcjs.transformTypeLayer; exports.transformedBounds = _chunkMZXQTKUMcjs.transformedBounds; exports.transformedBox = _chunkXLUYXUBDcjs.transformedBox; exports.transformedPoint = _chunkXLUYXUBDcjs.transformedPoint; exports.translateSurface = _chunkJ5BA3BQ6cjs.translateSurface; exports.typeAsPixelLayer = _chunkXLUYXUBDcjs.typeAsPixelLayer; exports.typeFrame = _chunkXLUYXUBDcjs.typeFrame; exports.typeFromAnnotation = _chunkXLUYXUBDcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkXLUYXUBDcjs.typeLayerName; exports.ungroupLayer = _chunkXLUYXUBDcjs.ungroupLayer; exports.uniformTile = _chunkJ5BA3BQ6cjs.uniformTile; exports.unionRect = _chunkXLUYXUBDcjs.unionRect; exports.unprojectCanvasPoint = _chunkXLUYXUBDcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkXLUYXUBDcjs.updateLayerEffect; exports.updateLayerFilter = _chunkXLUYXUBDcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkXLUYXUBDcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk6GFRKLLScjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkXLUYXUBDcjs.updateShapeLayer; exports.updateSmartFilter = _chunkXLUYXUBDcjs.updateSmartFilter; exports.updateTypeLayer = _chunkXLUYXUBDcjs.updateTypeLayer; exports.uvToXy = _chunkXLUYXUBDcjs.uvToXy; exports.validateEffectGradient = _chunkMZXQTKUMcjs.validateEffectGradient; exports.validateLayerEffect = _chunkMZXQTKUMcjs.validateLayerEffect; exports.validateLayerEffects = _chunkMZXQTKUMcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkXLUYXUBDcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkXLUYXUBDcjs.vibranceLinear; exports.vibrancePixel = _chunkXLUYXUBDcjs.vibrancePixel; exports.walkDabs = _chunk6GFRKLLScjs.walkDabs; exports.warpMeshEditPoints = _chunkORE334I6cjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkORE334I6cjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkORE334I6cjs.warpMeshParamAt; exports.warpPresetMesh = _chunkORE334I6cjs.warpPresetMesh; exports.warpSurface = _chunkMZXQTKUMcjs.warpSurface; exports.wbMatrix = _chunkXLUYXUBDcjs.wbMatrix; exports.wetGpuSupport = _chunkFHPVDTI2cjs.wetGpuSupport; exports.wetSimdSupported = _chunkFHPVDTI2cjs.wetSimdSupported; exports.wetSupport = _chunkFHPVDTI2cjs.wetSupport; exports.whiteBalanceFromSample = _chunkXLUYXUBDcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkXLUYXUBDcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkXLUYXUBDcjs.withFilterMaskSurface; exports.withNewIds = _chunkXLUYXUBDcjs.withNewIds; exports.writeAdjustmentBlock = _chunkXLUYXUBDcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkJ5BA3BQ6cjs.writeDeepRegion; exports.writeLfx2 = _chunkXLUYXUBDcjs.writeLfx2; exports.writePatternBlock = _chunkXLUYXUBDcjs.writePatternBlock; exports.writePsd = _chunkXLUYXUBDcjs.writePsd; exports.writeRegion = _chunkJ5BA3BQ6cjs.writeRegion; exports.xyToTempTint = _chunkXLUYXUBDcjs.xyToTempTint; exports.xyToUv = _chunkXLUYXUBDcjs.xyToUv;
|
|
15756
|
+
exports.ADJUSTMENT_KEYS = _chunkPMHPXCJCcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkPMHPXCJCcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkPMHPXCJCcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkPMHPXCJCcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkPMHPXCJCcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkPMHPXCJCcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkJ5BA3BQ6cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkJ5BA3BQ6cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkPMHPXCJCcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkFHPVDTI2cjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkZ6OUCS2Kcjs.BrushstrokeCache; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunk6GFRKLLScjs.CoverageMap; exports.D50 = _chunkPMHPXCJCcjs.D50; exports.D65 = _chunkPMHPXCJCcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkLXGOYRPEcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk6GFRKLLScjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk6GFRKLLScjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkFHPVDTI2cjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkMZXQTKUMcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkPMHPXCJCcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk6GFRKLLScjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkW6M7C7R3cjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk6GFRKLLScjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkLXGOYRPEcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkFHPVDTI2cjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkFHPVDTI2cjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkPMHPXCJCcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkMZXQTKUMcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkFHPVDTI2cjs.DRY_EPS; exports.DabWalker = _chunk6GFRKLLScjs.DabWalker; exports.EMPTY_DISTANCE = _chunkPMHPXCJCcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk6GFRKLLScjs.EMPTY_MIXER_LOAD; exports.EX = _chunkFHPVDTI2cjs.EX; exports.EY = _chunkFHPVDTI2cjs.EY; exports.FLAG_ALIVE = _chunkFHPVDTI2cjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkFHPVDTI2cjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkFHPVDTI2cjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkFHPVDTI2cjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkFHPVDTI2cjs.FLAG_TOP; exports.FLAG_WET = _chunkFHPVDTI2cjs.FLAG_WET; exports.FLAT = _chunkFHPVDTI2cjs.FLAT; exports.FREE_INTERVAL = _chunkFHPVDTI2cjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkPMHPXCJCcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkFHPVDTI2cjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkPMHPXCJCcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkPMHPXCJCcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkMZXQTKUMcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkPMHPXCJCcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkPMHPXCJCcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkMZXQTKUMcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkPMHPXCJCcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkPMHPXCJCcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkPMHPXCJCcjs.LUMA_709; exports.LayerCompositor = _chunkPMHPXCJCcjs.LayerCompositor; exports.LayerEffectError = _chunkMZXQTKUMcjs.LayerEffectError; exports.LayerOperationError = _chunkPMHPXCJCcjs.LayerOperationError; exports.MAX_BATCH = _chunkFHPVDTI2cjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunk6GFRKLLScjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkMZXQTKUMcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkPMHPXCJCcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkFHPVDTI2cjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkMZXQTKUMcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkFHPVDTI2cjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkFHPVDTI2cjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkPMHPXCJCcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkPMHPXCJCcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk6GFRKLLScjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk6GFRKLLScjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk6GFRKLLScjs.MIXING_MODELS; exports.MixerStroke = _chunk6GFRKLLScjs.MixerStroke; exports.OPP = _chunkFHPVDTI2cjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkJ5BA3BQ6cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunk6GFRKLLScjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunk6GFRKLLScjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunk6GFRKLLScjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkFHPVDTI2cjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkPMHPXCJCcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkFHPVDTI2cjs.PARAM; exports.PARAM_FLOATS = _chunkFHPVDTI2cjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkPMHPXCJCcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkJ5BA3BQ6cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkFHPVDTI2cjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkFHPVDTI2cjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkJ5BA3BQ6cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkFHPVDTI2cjs.PLANE; exports.PLANE_BYTES = _chunkFHPVDTI2cjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkPMHPXCJCcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkFHPVDTI2cjs.P_D0; exports.P_EDGE = _chunkFHPVDTI2cjs.P_EDGE; exports.P_FX = _chunkFHPVDTI2cjs.P_FX; exports.P_FY = _chunkFHPVDTI2cjs.P_FY; exports.P_H = _chunkFHPVDTI2cjs.P_H; exports.P_P0 = _chunkFHPVDTI2cjs.P_P0; exports.P_RHO = _chunkFHPVDTI2cjs.P_RHO; exports.P_SW = _chunkFHPVDTI2cjs.P_SW; exports.P_UX = _chunkFHPVDTI2cjs.P_UX; exports.P_UY = _chunkFHPVDTI2cjs.P_UY; exports.PaintExchange = _chunk6GFRKLLScjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunk6GFRKLLScjs.PaintGradientSampler; exports.PaintSourceError = _chunk6GFRKLLScjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkMZXQTKUMcjs.PatternPlacement; exports.PatternTile = _chunkMZXQTKUMcjs.PatternTile; exports.PsdError = _chunkPMHPXCJCcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkW6M7C7R3cjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkW6M7C7R3cjs.RegionPixelSource; exports.RetouchDabStroke = _chunkW6M7C7R3cjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkPMHPXCJCcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkPMHPXCJCcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkFHPVDTI2cjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkJ5BA3BQ6cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkPMHPXCJCcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkPMHPXCJCcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkFHPVDTI2cjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkFHPVDTI2cjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkFHPVDTI2cjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkPMHPXCJCcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkW6M7C7R3cjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkFHPVDTI2cjs.SRGB_TO_LINEAR; exports.STRIP = _chunkFHPVDTI2cjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkPMHPXCJCcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk6GFRKLLScjs.SmudgeTip; exports.StrokeCoverage = _chunk6GFRKLLScjs.StrokeCoverage; exports.SurfaceDraft = _chunkJ5BA3BQ6cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkPMHPXCJCcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkPMHPXCJCcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkPMHPXCJCcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkJ5BA3BQ6cjs.TILE; exports.TILE_SHIFT = _chunkJ5BA3BQ6cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkPMHPXCJCcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk6GFRKLLScjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkPMHPXCJCcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkW6M7C7R3cjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkPMHPXCJCcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunk6GFRKLLScjs.TileMedium; exports.TilePixelSource = _chunkW6M7C7R3cjs.TilePixelSource; exports.TiledSurface = _chunkJ5BA3BQ6cjs.TiledSurface; exports.TransformTooLargeError = _chunkMZXQTKUMcjs.TransformTooLargeError; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkFHPVDTI2cjs.U_MAX; exports.VIBRANCE_GREY = _chunkPMHPXCJCcjs.VIBRANCE_GREY; exports.W9 = _chunkFHPVDTI2cjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkLXGOYRPEcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkLXGOYRPEcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkFHPVDTI2cjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkFHPVDTI2cjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkFHPVDTI2cjs.WET_TILE; exports.WGSL_HALO = _chunkFHPVDTI2cjs.WGSL_HALO; exports.WGSL_SHADE = _chunkFHPVDTI2cjs.WGSL_SHADE; exports.WGSL_STEP = _chunkFHPVDTI2cjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkFHPVDTI2cjs.WetGpuEngine; exports.WetMedium = _chunkFHPVDTI2cjs.WetMedium; exports.WetWorkerPool = _chunkFHPVDTI2cjs.WetWorkerPool; exports.WetWorld = _chunkFHPVDTI2cjs.WetWorld; exports.WetWorldError = _chunkFHPVDTI2cjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkPMHPXCJCcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkPMHPXCJCcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkPMHPXCJCcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkPMHPXCJCcjs.activeSmartFilters; exports.addLayerEffect = _chunkPMHPXCJCcjs.addLayerEffect; exports.addLayerFilter = _chunkPMHPXCJCcjs.addLayerFilter; exports.addPaintGradientStop = _chunk6GFRKLLScjs.addPaintGradientStop; exports.addSmartFilter = _chunkPMHPXCJCcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkPMHPXCJCcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkPMHPXCJCcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkPMHPXCJCcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkPMHPXCJCcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkPMHPXCJCcjs.anchorPoint; exports.annotationBlend = _chunkPMHPXCJCcjs.annotationBlend; exports.annotationLayerFor = _chunkPMHPXCJCcjs.annotationLayerFor; exports.annotationLayerName = _chunkPMHPXCJCcjs.annotationLayerName; exports.annotationOfLayer = _chunkPMHPXCJCcjs.annotationOfLayer; exports.annotationOfShape = _chunkPMHPXCJCcjs.annotationOfShape; exports.annotationOfType = _chunkPMHPXCJCcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkPMHPXCJCcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkPMHPXCJCcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkPMHPXCJCcjs.applyAdjustments; exports.applyBoxBlur = _chunkPMHPXCJCcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkPMHPXCJCcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkPMHPXCJCcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkPMHPXCJCcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkPMHPXCJCcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkPMHPXCJCcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkPMHPXCJCcjs.applyParams; exports.applyProcess2Adjustments = _chunkPMHPXCJCcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkPMHPXCJCcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkW6M7C7R3cjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkPMHPXCJCcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk6GFRKLLScjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk6GFRKLLScjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkW6M7C7R3cjs.applyToneToDeepTile; exports.backgroundLayer = _chunkPMHPXCJCcjs.backgroundLayer; exports.base64ToBytes = _chunkDCLJNVZScjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkW6M7C7R3cjs.bestOffset; exports.blackWhiteGray = _chunkPMHPXCJCcjs.blackWhiteGray; exports.blendChannel = _chunkJ5BA3BQ6cjs.blendChannel; exports.blendImageData = _chunkJ5BA3BQ6cjs.blendImageData; exports.blendLum = _chunkJ5BA3BQ6cjs.blendLum; exports.blendPixel = _chunkJ5BA3BQ6cjs.blendPixel; exports.blendRadius = _chunk6GFRKLLScjs.blendRadius; exports.blendRgb = _chunkJ5BA3BQ6cjs.blendRgb; exports.blendTile = _chunkMZXQTKUMcjs.blendTile; exports.blenderDab = _chunk6GFRKLLScjs.blenderDab; exports.blurFilter = _chunkPMHPXCJCcjs.blurFilter; exports.borderCoverage = _chunkPMHPXCJCcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkPMHPXCJCcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkPMHPXCJCcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkZ6OUCS2Kcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkZ6OUCS2Kcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkZ6OUCS2Kcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkSYPFUL5Bcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkZ6OUCS2Kcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkZ6OUCS2Kcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkPMHPXCJCcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkPMHPXCJCcjs.buildToneLut; exports.builtinPattern = _chunkMZXQTKUMcjs.builtinPattern; exports.builtinPatternIds = _chunkMZXQTKUMcjs.builtinPatternIds; exports.bytesToBase64 = _chunkDCLJNVZScjs.bytesToBase64; exports.calculateCropDrag = _chunkPMHPXCJCcjs.calculateCropDrag; exports.canShareMemory = _chunkFHPVDTI2cjs.canShareMemory; exports.canvasCompositeOperation = _chunkJ5BA3BQ6cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkPMHPXCJCcjs.canvasToImagePoint; exports.caretAt = _chunkLXGOYRPEcjs.caretAt; exports.changedTiles = _chunkMZXQTKUMcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkPMHPXCJCcjs.clampCropToImage; exports.cleanMixer = _chunk6GFRKLLScjs.cleanMixer; exports.cloneSourceLabel = cloneSourceLabel; exports.collectTiles = _chunkJ5BA3BQ6cjs.collectTiles; exports.colorBalanceChannel = _chunkPMHPXCJCcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkPMHPXCJCcjs.combineSelections; exports.compileAdjustmentLayer = _chunkPMHPXCJCcjs.compileAdjustmentLayer; exports.componentPath = _chunkPMHPXCJCcjs.componentPath; exports.compositeDeep = _chunkPMHPXCJCcjs.compositeDeep; exports.compositeSurfaceOver = _chunkMZXQTKUMcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkPMHPXCJCcjs.computeSelectionBounds; exports.contentBounds = _chunkJ5BA3BQ6cjs.contentBounds; exports.contentsBox = _chunkPMHPXCJCcjs.contentsBox; exports.contentsSurface = _chunkPMHPXCJCcjs.contentsSurface; exports.contractCoverage = _chunkPMHPXCJCcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkJ5BA3BQ6cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkPMHPXCJCcjs.convertToSmartObject; exports.copySmartObject = _chunkPMHPXCJCcjs.copySmartObject; exports.cornersFromMatrix = _chunkPMHPXCJCcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk6GFRKLLScjs.coverageTileCoord; exports.coverageToByte = _chunkPMHPXCJCcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkPMHPXCJCcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk6GFRKLLScjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkLXGOYRPEcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkLXGOYRPEcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkLXGOYRPEcjs.createOutlineTextShaper; exports.createPigment = _chunkJ5BA3BQ6cjs.createPigment; exports.createPigmentTools = _chunkFHPVDTI2cjs.createPigmentTools; exports.createSelectionMask = _chunkPMHPXCJCcjs.createSelectionMask; exports.createShapeLayer = _chunkPMHPXCJCcjs.createShapeLayer; exports.createTypeLayer = _chunkPMHPXCJCcjs.createTypeLayer; exports.createWetGpuEngine = _chunkFHPVDTI2cjs.createWetGpuEngine; exports.cssFont = _chunkLXGOYRPEcjs.cssFont; exports.cssFontFamily = _chunkLXGOYRPEcjs.cssFontFamily; exports.curveLut = _chunkMZXQTKUMcjs.curveLut; exports.curveLutFromLevels = _chunkPMHPXCJCcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk6GFRKLLScjs.dabCoverage; exports.dabRect = _chunk6GFRKLLScjs.dabRect; exports.decodeDeepSurface = _chunkPMHPXCJCcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkPMHPXCJCcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkPMHPXCJCcjs.decodeLayerMask; exports.decodeMergedImage = _chunkPMHPXCJCcjs.decodeMergedImage; exports.decodePlanes = _chunkPMHPXCJCcjs.decodePlanes; exports.decodePng = _chunkDCLJNVZScjs.decodePng; exports.decodePngDataUrl = _chunkPMHPXCJCcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkPMHPXCJCcjs.decodeSelectionRle; exports.deepBytes = _chunkJ5BA3BQ6cjs.deepBytes; exports.deepTile = _chunkJ5BA3BQ6cjs.deepTile; exports.defaultAdjustmentParams = _chunkPMHPXCJCcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkMZXQTKUMcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkMZXQTKUMcjs.defaultLayerEffect; exports.defaultShapeName = _chunkPMHPXCJCcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkPMHPXCJCcjs.depthMaskAlpha; exports.depthOf = _chunkJ5BA3BQ6cjs.depthOf; exports.depthRasterMask = _chunkPMHPXCJCcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkPMHPXCJCcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkPMHPXCJCcjs.deserializeEffects; exports.deserializeLayer = _chunkPMHPXCJCcjs.deserializeLayer; exports.deserializeLayers = _chunkPMHPXCJCcjs.deserializeLayers; exports.deserializePatterns = _chunkPMHPXCJCcjs.deserializePatterns; exports.deserializeSelection = _chunkPMHPXCJCcjs.deserializeSelection; exports.developFilter = _chunkPMHPXCJCcjs.developFilter; exports.developFromAdjustments = _chunkPMHPXCJCcjs.developFromAdjustments; exports.developTarget = _chunkPMHPXCJCcjs.developTarget; exports.dexp = _chunkFHPVDTI2cjs.dexp; exports.dilateMask = _chunkW6M7C7R3cjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkPMHPXCJCcjs.distanceTransform; exports.dlog = _chunkFHPVDTI2cjs.dlog; exports.documentContents = _chunkPMHPXCJCcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkW6M7C7R3cjs.dodgeBurn; exports.dodgeBurnCurve = _chunkW6M7C7R3cjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkFHPVDTI2cjs.dpow; exports.dragWarpMeshPoint = _chunkLXGOYRPEcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkFHPVDTI2cjs.dsincos; exports.duplicateLayer = _chunkPMHPXCJCcjs.duplicateLayer; exports.edgeBits = _chunkFHPVDTI2cjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkMZXQTKUMcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkMZXQTKUMcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkMZXQTKUMcjs.effectsFingerprint; exports.effectsMargin = _chunkMZXQTKUMcjs.effectsMargin; exports.effectsScale = _chunkMZXQTKUMcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkJ5BA3BQ6cjs.emptySurface; exports.encodeDeepSurface = _chunkPMHPXCJCcjs.encodeDeepSurface; exports.encodePng = _chunkDCLJNVZScjs.encodePng; exports.encodeRle = _chunkPMHPXCJCcjs.encodeRle; exports.encodeSelectionRle = _chunkPMHPXCJCcjs.encodeSelectionRle; exports.encodeSurface = _chunkPMHPXCJCcjs.encodeSurface; exports.evalWarpMesh = _chunkLXGOYRPEcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkPMHPXCJCcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk6GFRKLLScjs.exchangeRates; exports.expNeg = _chunkFHPVDTI2cjs.expNeg; exports.expandCoverage = _chunkPMHPXCJCcjs.expandCoverage; exports.exportPsd = _chunkPMHPXCJCcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkPMHPXCJCcjs.featherCoverage; exports.fillRect = _chunkJ5BA3BQ6cjs.fillRect; exports.filmPixel = _chunkFHPVDTI2cjs.filmPixel; exports.filmReflectance = _chunkFHPVDTI2cjs.filmReflectance; exports.filterMaskCoverage = _chunkPMHPXCJCcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkMZXQTKUMcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkFHPVDTI2cjs.findWebGpu; exports.finishTile = _chunkJ5BA3BQ6cjs.finishTile; exports.fitParagraphRuns = _chunkLXGOYRPEcjs.fitParagraphRuns; exports.fitRuns = _chunkLXGOYRPEcjs.fitRuns; exports.flattenLayers = _chunkMZXQTKUMcjs.flattenLayers; exports.flattenPath = _chunkPMHPXCJCcjs.flattenPath; exports.flipCorners = _chunkPMHPXCJCcjs.flipCorners; exports.flowField = _chunkFHPVDTI2cjs.flowField; exports.fontOf = _chunkLXGOYRPEcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkPMHPXCJCcjs.fullSelection; exports.gaussianBlur = _chunkMZXQTKUMcjs.gaussianBlur; exports.geometryHomography = _chunkPMHPXCJCcjs.geometryHomography; exports.getAnnotationBounds = _chunkPMHPXCJCcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkPMHPXCJCcjs.getCropCursor; exports.getRotatedSize = _chunkPMHPXCJCcjs.getRotatedSize; exports.getViewportMetrics = _chunkPMHPXCJCcjs.getViewportMetrics; exports.getViewportProjection = _chunkPMHPXCJCcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk6GFRKLLScjs.gradientDabColor; exports.greyMorphology = _chunkPMHPXCJCcjs.greyMorphology; exports.groupLayers = _chunkPMHPXCJCcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkMZXQTKUMcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkPMHPXCJCcjs.hasResampledLegacyMask; exports.hasSurface = _chunkPMHPXCJCcjs.hasSurface; exports.hasWarp = _chunkPMHPXCJCcjs.hasWarp; exports.hash2 = _chunk6GFRKLLScjs.hash2; exports.hashMaskContent = _chunkPMHPXCJCcjs.hashMaskContent; exports.hashNoise = _chunkMZXQTKUMcjs.hashNoise; exports.healPixels = _chunkW6M7C7R3cjs.healPixels; exports.hexToPaintRgb = _chunk6GFRKLLScjs.hexToPaintRgb; exports.hexToRgb = _chunkPMHPXCJCcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkPMHPXCJCcjs.hitTestAnnotation; exports.hitTestCrop = _chunkPMHPXCJCcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkPMHPXCJCcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkPMHPXCJCcjs.hueRangeTables; exports.hueRangeWeight = _chunkPMHPXCJCcjs.hueRangeWeight; exports.hueSaturation = _chunkPMHPXCJCcjs.hueSaturation; exports.identityCurve = _chunkPMHPXCJCcjs.identityCurve; exports.identityLevels = _chunkPMHPXCJCcjs.identityLevels; exports.identityTransform = _chunkPMHPXCJCcjs.identityTransform; exports.identityWarpMesh = _chunkLXGOYRPEcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkPMHPXCJCcjs.imageToCanvasPoint; exports.importPsd = _chunkPMHPXCJCcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkMZXQTKUMcjs.insertLayer; exports.instancesOf = _chunkPMHPXCJCcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkPMHPXCJCcjs.invertMatrix3; exports.invertSelection = _chunkPMHPXCJCcjs.invertSelection; exports.isActiveFilter = _chunkPMHPXCJCcjs.isActiveFilter; exports.isAdjustmentKind = _chunkPMHPXCJCcjs.isAdjustmentKind; exports.isBitDepth = _chunkJ5BA3BQ6cjs.isBitDepth; exports.isBlendMode = _chunkJ5BA3BQ6cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkZ6OUCS2Kcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkPMHPXCJCcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkPMHPXCJCcjs.isDefaultDepthMask; exports.isGradientPaint = _chunk6GFRKLLScjs.isGradientPaint; exports.isIdentityTransform = _chunkPMHPXCJCcjs.isIdentityTransform; exports.isInterpolation = _chunkMZXQTKUMcjs.isInterpolation; exports.isLayerEffectKind = _chunkMZXQTKUMcjs.isLayerEffectKind; exports.isLayerLocked = _chunkMZXQTKUMcjs.isLayerLocked; exports.isLegacyShape = _chunkPMHPXCJCcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkJ5BA3BQ6cjs.isPainterlyBlendMode; exports.isPng = _chunkDCLJNVZScjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkPMHPXCJCcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkPMHPXCJCcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkPMHPXCJCcjs.isSelectionEmpty; exports.isSelectionMode = _chunkPMHPXCJCcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkJ5BA3BQ6cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkPMHPXCJCcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkPMHPXCJCcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkPMHPXCJCcjs.isTransformAnchor; exports.isValidWarp = _chunkPMHPXCJCcjs.isValidWarp; exports.keepDeepSamples = _chunkJ5BA3BQ6cjs.keepDeepSamples; exports.kelvinToTemperature = _chunkPMHPXCJCcjs.kelvinToTemperature; exports.keysWeight = _chunkMZXQTKUMcjs.keysWeight; exports.latticeViscosity = _chunkFHPVDTI2cjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkMZXQTKUMcjs.layerEffectFields; exports.layerEffectLabel = _chunkMZXQTKUMcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkPMHPXCJCcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkPMHPXCJCcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkPMHPXCJCcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkPMHPXCJCcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkPMHPXCJCcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkPMHPXCJCcjs.layerTree; exports.layerTypeLabel = _chunkPMHPXCJCcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkPMHPXCJCcjs.layersFromLegacy; exports.layoutText = _chunkLXGOYRPEcjs.layoutText; exports.legacyAdjustmentLayer = _chunkPMHPXCJCcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkPMHPXCJCcjs.legacyMaskOf; exports.legacyView = _chunkPMHPXCJCcjs.legacyView; exports.lerpPigment = _chunkJ5BA3BQ6cjs.lerpPigment; exports.lerpPigmentInto = _chunkJ5BA3BQ6cjs.lerpPigmentInto; exports.levelsValue = _chunkPMHPXCJCcjs.levelsValue; exports.linearSrgbToXy = _chunkPMHPXCJCcjs.linearSrgbToXy; exports.linearToSrgb = _chunkPMHPXCJCcjs.linearToSrgb; exports.linearToSrgb8 = _chunkFHPVDTI2cjs.linearToSrgb8; exports.liveComponent = _chunkPMHPXCJCcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkPMHPXCJCcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk6GFRKLLScjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkFHPVDTI2cjs.loadWetKernel; exports.luma = _chunkW6M7C7R3cjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkPMHPXCJCcjs.mapCropHandle; exports.mapLayer = _chunkMZXQTKUMcjs.mapLayer; exports.mapSubpaths = _chunkPMHPXCJCcjs.mapSubpaths; exports.maskBounds = _chunkW6M7C7R3cjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkPMHPXCJCcjs.matrixFromCorners; exports.matrixFromParams = _chunkPMHPXCJCcjs.matrixFromParams; exports.membraneFill = _chunkW6M7C7R3cjs.membraneFill; exports.mergeLayerEffect = _chunkMZXQTKUMcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkPMHPXCJCcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunk6GFRKLLScjs.mix32; exports.mixPigment8 = _chunkJ5BA3BQ6cjs.mixPigment8; exports.mixPigmentRgb = _chunkJ5BA3BQ6cjs.mixPigmentRgb; exports.mixPigments = _chunkJ5BA3BQ6cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk6GFRKLLScjs.mixerRates; exports.modifySelection = _chunkPMHPXCJCcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkPMHPXCJCcjs.moveLayer; exports.moveSmartFilter = _chunkPMHPXCJCcjs.moveSmartFilter; exports.mulMatrix3 = _chunkPMHPXCJCcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkPMHPXCJCcjs.neutralHueRange; exports.newContentsId = _chunkPMHPXCJCcjs.newContentsId; exports.newEffectId = _chunkMZXQTKUMcjs.newEffectId; exports.newLayerId = _chunkPMHPXCJCcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkPMHPXCJCcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkPMHPXCJCcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkPMHPXCJCcjs.normalizeAngle; exports.normalizeBlendMode = _chunkJ5BA3BQ6cjs.normalizeBlendMode; exports.normalizeBlender = _chunk6GFRKLLScjs.normalizeBlender; exports.normalizeBrush = _chunk6GFRKLLScjs.normalizeBrush; exports.normalizeFilter = _chunkPMHPXCJCcjs.normalizeFilter; exports.normalizeFlow = _chunkFHPVDTI2cjs.normalizeFlow; exports.normalizeHexColor = _chunk6GFRKLLScjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkMZXQTKUMcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkPMHPXCJCcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkPMHPXCJCcjs.normalizeLiveShape; exports.normalizeMixer = _chunk6GFRKLLScjs.normalizeMixer; exports.normalizePlacement = _chunkPMHPXCJCcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkPMHPXCJCcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkW6M7C7R3cjs.normalizeRetouch; exports.normalizeShapePaint = _chunkPMHPXCJCcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkPMHPXCJCcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkPMHPXCJCcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk6GFRKLLScjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkPMHPXCJCcjs.normalizeSubpaths; exports.normalizeText = _chunkPMHPXCJCcjs.normalizeText; exports.normalizeTilt = _chunkFHPVDTI2cjs.normalizeTilt; exports.normalizeWetParams = _chunkFHPVDTI2cjs.normalizeWetParams; exports.offsetLayer = _chunkPMHPXCJCcjs.offsetLayer; exports.offsetShape = _chunkPMHPXCJCcjs.offsetShape; exports.offsetSmartObject = _chunkPMHPXCJCcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkJ5BA3BQ6cjs.packRgba; exports.packWetParams = _chunkFHPVDTI2cjs.packWetParams; exports.paintGradientMappingFor = _chunk6GFRKLLScjs.paintGradientMappingFor; exports.paintPathStroke = _chunkZ6OUCS2Kcjs.paintPathStroke; exports.paintSourceColor = _chunk6GFRKLLScjs.paintSourceColor; exports.paintSourceCss = _chunk6GFRKLLScjs.paintSourceCss; exports.paragraphRanges = _chunkLXGOYRPEcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkPMHPXCJCcjs.parseAdjustmentBlock; exports.parseBlend = _chunkPMHPXCJCcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkDCLJNVZScjs.parseDataUrl; exports.parseEffectColor = _chunkMZXQTKUMcjs.parseEffectColor; exports.parseLfx2 = _chunkPMHPXCJCcjs.parseLfx2; exports.parseLrfx = _chunkPMHPXCJCcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk6GFRKLLScjs.parsePaintSource; exports.parsePatternBlock = _chunkPMHPXCJCcjs.parsePatternBlock; exports.parseSelectionMode = _chunkPMHPXCJCcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkPMHPXCJCcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkPMHPXCJCcjs.patchParagraphStyle; exports.patchTextStyle = _chunkPMHPXCJCcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkZ6OUCS2Kcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkZ6OUCS2Kcjs.pathStrokeDabs; exports.perDabStrength = _chunkW6M7C7R3cjs.perDabStrength; exports.photoFilterMatrix = _chunkPMHPXCJCcjs.photoFilterMatrix; exports.pigment8 = _chunkJ5BA3BQ6cjs.pigment8; exports.pigmentColor = _chunkFHPVDTI2cjs.pigmentColor; exports.pigmentOf = _chunkFHPVDTI2cjs.pigmentOf; exports.pixelLayerBounds = _chunkPMHPXCJCcjs.pixelLayerBounds; exports.pixelLayers = _chunkPMHPXCJCcjs.pixelLayers; exports.pixelPigment = _chunkFHPVDTI2cjs.pixelPigment; exports.placeContents = _chunkPMHPXCJCcjs.placeContents; exports.placeLayer = _chunkPMHPXCJCcjs.placeLayer; exports.placementAt = _chunkPMHPXCJCcjs.placementAt; exports.placementBounds = _chunkPMHPXCJCcjs.placementBounds; exports.placementGeometry = _chunkPMHPXCJCcjs.placementGeometry; exports.pngDataUrl = _chunkDCLJNVZScjs.pngDataUrl; exports.pointerPressure = _chunkFHPVDTI2cjs.pointerPressure; exports.pointerStrokeSample = _chunkFHPVDTI2cjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkFHPVDTI2cjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkPMHPXCJCcjs.posterizeValue; exports.presetWarp = _chunkPMHPXCJCcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkPMHPXCJCcjs.projectImagePoint; exports.projectImageRect = _chunkPMHPXCJCcjs.projectImageRect; exports.projectMaskCoverage = _chunkPMHPXCJCcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkJ5BA3BQ6cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkPMHPXCJCcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkPMHPXCJCcjs.psdToLayers; exports.pullWarpMesh = _chunkLXGOYRPEcjs.pullWarpMesh; exports.put255 = _chunk6GFRKLLScjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk6GFRKLLScjs.rand01; exports.rangeLightness = _chunkPMHPXCJCcjs.rangeLightness; exports.rasterContents = _chunkPMHPXCJCcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkPMHPXCJCcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkPMHPXCJCcjs.rasterizeCoverage; exports.rasterizeDab = _chunk6GFRKLLScjs.rasterizeDab; exports.rasterizeSmartObject = _chunkPMHPXCJCcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkJ5BA3BQ6cjs.readDeepRegion; exports.readPaintSource = _chunk6GFRKLLScjs.readPaintSource; exports.readPixel = _chunkJ5BA3BQ6cjs.readPixel; exports.readPsd = _chunkPMHPXCJCcjs.readPsd; exports.readRegion = _chunkJ5BA3BQ6cjs.readRegion; exports.readSourceRegion = _chunkW6M7C7R3cjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkMZXQTKUMcjs.reduceSurface; exports.referencePoint = _chunkPMHPXCJCcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkJ5BA3BQ6cjs.reflectanceToRgb; exports.removeAlpha = _chunkPMHPXCJCcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkPMHPXCJCcjs.removeLayer; exports.removeLayerEffect = _chunkPMHPXCJCcjs.removeLayerEffect; exports.removeLayerFilter = _chunkPMHPXCJCcjs.removeLayerFilter; exports.removePaintGradientStop = _chunk6GFRKLLScjs.removePaintGradientStop; exports.removeSmartFilter = _chunkPMHPXCJCcjs.removeSmartFilter; exports.renderBrushstroke = _chunkZ6OUCS2Kcjs.renderBrushstroke; exports.renderLayerEffects = _chunkMZXQTKUMcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkPMHPXCJCcjs.renderShape; exports.renderShapeRect = _chunkPMHPXCJCcjs.renderShapeRect; exports.renderSmartObject = _chunkPMHPXCJCcjs.renderSmartObject; exports.renderText = _chunkPMHPXCJCcjs.renderText; exports.replaceContents = _chunkPMHPXCJCcjs.replaceContents; exports.replaceTextRange = _chunkPMHPXCJCcjs.replaceTextRange; exports.requireLayer = _chunkPMHPXCJCcjs.requireLayer; exports.requireOperation = _chunkPMHPXCJCcjs.requireOperation; exports.requireShapeLayer = _chunkPMHPXCJCcjs.requireShapeLayer; exports.requireSmartObject = _chunkPMHPXCJCcjs.requireSmartObject; exports.requireTypeLayer = _chunkPMHPXCJCcjs.requireTypeLayer; exports.requireUnlocked = _chunkPMHPXCJCcjs.requireUnlocked; exports.rerender = _chunkPMHPXCJCcjs.rerender; exports.rerenderShape = _chunkPMHPXCJCcjs.rerenderShape; exports.rerenderText = _chunkPMHPXCJCcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkPMHPXCJCcjs.resizeSelection; exports.resizeWarpMesh = _chunkLXGOYRPEcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkPMHPXCJCcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk6GFRKLLScjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkLXGOYRPEcjs.restyleRange; exports.reversePaintGradient = _chunk6GFRKLLScjs.reversePaintGradient; exports.rgbToGray = _chunkPMHPXCJCcjs.rgbToGray; exports.rgbToHsl = _chunkPMHPXCJCcjs.rgbToHsl; exports.rgbToReflectance = _chunkJ5BA3BQ6cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkW6M7C7R3cjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkPMHPXCJCcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkPMHPXCJCcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkPMHPXCJCcjs.sampleLut; exports.sampleToneLut = _chunkPMHPXCJCcjs.sampleToneLut; exports.saturationOf = _chunkW6M7C7R3cjs.saturationOf; exports.scaleLayerEffect = _chunkMZXQTKUMcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk6GFRKLLScjs.scalePaintGradient; exports.seamlessClone = _chunkW6M7C7R3cjs.seamlessClone; exports.selectionArea = _chunkPMHPXCJCcjs.selectionArea; exports.selectionFromCoverage = _chunkPMHPXCJCcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkPMHPXCJCcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkPMHPXCJCcjs.selectionToCoverage; exports.selectionToPixels = _chunkPMHPXCJCcjs.selectionToPixels; exports.selectionValueAt = _chunkPMHPXCJCcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkPMHPXCJCcjs.serializeContents; exports.serializeEffects = _chunkPMHPXCJCcjs.serializeEffects; exports.serializeLayer = _chunkPMHPXCJCcjs.serializeLayer; exports.serializeLayers = _chunkPMHPXCJCcjs.serializeLayers; exports.serializeLayersExternal = _chunkPMHPXCJCcjs.serializeLayersExternal; exports.serializePatterns = _chunkPMHPXCJCcjs.serializePatterns; exports.serializeSelection = _chunkPMHPXCJCcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkPMHPXCJCcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkPMHPXCJCcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkPMHPXCJCcjs.setLayerMask; exports.setLayerProperties = _chunkPMHPXCJCcjs.setLayerProperties; exports.setLum = _chunkJ5BA3BQ6cjs.setLum; exports.setPigmentColor = _chunkJ5BA3BQ6cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkPMHPXCJCcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkPMHPXCJCcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkPMHPXCJCcjs.setSmartPlacement; exports.shadeTile = _chunkFHPVDTI2cjs.shadeTile; exports.shapeAsPixelLayer = _chunkPMHPXCJCcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkPMHPXCJCcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkPMHPXCJCcjs.shapeGeometryBounds; exports.shapeLayers = _chunkPMHPXCJCcjs.shapeLayers; exports.shapeOutline = _chunkPMHPXCJCcjs.shapeOutline; exports.shapeRenderClip = _chunkPMHPXCJCcjs.shapeRenderClip; exports.shiftCoverage = _chunkPMHPXCJCcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkPMHPXCJCcjs.smartObjectLayers; exports.smoothCoverage = _chunkPMHPXCJCcjs.smoothCoverage; exports.smoothPoints = _chunk6GFRKLLScjs.smoothPoints; exports.smudgeEffect = _chunkW6M7C7R3cjs.smudgeEffect; exports.solidPaint = _chunk6GFRKLLScjs.solidPaint; exports.solidSurface = _chunkJ5BA3BQ6cjs.solidSurface; exports.solveMembrane = _chunkW6M7C7R3cjs.solveMembrane; exports.spliceRuns = _chunkLXGOYRPEcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkW6M7C7R3cjs.sponge; exports.spongeEffect = _chunkW6M7C7R3cjs.spongeEffect; exports.spotHealPixels = _chunkW6M7C7R3cjs.spotHealPixels; exports.spotHealWindow = _chunkW6M7C7R3cjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkFHPVDTI2cjs.srgbByteToLinear; exports.srgbDecode = _chunkJ5BA3BQ6cjs.srgbDecode; exports.srgbEncode = _chunkJ5BA3BQ6cjs.srgbEncode; exports.srgbToLinear = _chunkPMHPXCJCcjs.srgbToLinear; exports.standardBlendMode = _chunkJ5BA3BQ6cjs.standardBlendMode; exports.stepSlotTs = _chunkFHPVDTI2cjs.stepSlotTs; exports.styleAt = _chunkLXGOYRPEcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkJ5BA3BQ6cjs.surfaceBytes; exports.surfaceDepth = _chunkJ5BA3BQ6cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkJ5BA3BQ6cjs.surfaceFromPixels; exports.surfacesEqual = _chunkJ5BA3BQ6cjs.surfacesEqual; exports.tempTintToXy = _chunkPMHPXCJCcjs.tempTintToXy; exports.temperatureToKelvin = _chunkPMHPXCJCcjs.temperatureToKelvin; exports.textIndexAt = _chunkLXGOYRPEcjs.textIndexAt; exports.textMatrix = _chunkPMHPXCJCcjs.textMatrix; exports.textOutlines = _chunkPMHPXCJCcjs.textOutlines; exports.textRange = _chunkPMHPXCJCcjs.textRange; exports.tileCoord = _chunkJ5BA3BQ6cjs.tileCoord; exports.tileKey = _chunkJ5BA3BQ6cjs.tileKey; exports.tileRect = _chunkJ5BA3BQ6cjs.tileRect; exports.tileSamples = _chunkJ5BA3BQ6cjs.tileSamples; exports.tileSamples16 = _chunkJ5BA3BQ6cjs.tileSamples16; exports.tileSamples32 = _chunkJ5BA3BQ6cjs.tileSamples32; exports.tilesInRect = _chunkJ5BA3BQ6cjs.tilesInRect; exports.tipFalloff = _chunk6GFRKLLScjs.tipFalloff; exports.tipReach = _chunk6GFRKLLScjs.tipReach; exports.tipShape = _chunk6GFRKLLScjs.tipShape; exports.to16From32 = _chunkJ5BA3BQ6cjs.to16From32; exports.to16From8 = _chunkJ5BA3BQ6cjs.to16From8; exports.to32From16 = _chunkJ5BA3BQ6cjs.to32From16; exports.to32From8 = _chunkJ5BA3BQ6cjs.to32From8; exports.to8From16 = _chunkJ5BA3BQ6cjs.to8From16; exports.to8From32 = _chunkJ5BA3BQ6cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkPMHPXCJCcjs.toTextSpace; exports.toneCurve = _chunkPMHPXCJCcjs.toneCurve; exports.toneLuts = _chunkPMHPXCJCcjs.toneLuts; exports.toneOf = _chunkW6M7C7R3cjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkPMHPXCJCcjs.transformHomography; exports.transformMap = _chunkPMHPXCJCcjs.transformMap; exports.transformShapeComponents = _chunkPMHPXCJCcjs.transformShapeComponents; exports.transformSurface = _chunkMZXQTKUMcjs.transformSurface; exports.transformTypeLayer = _chunkPMHPXCJCcjs.transformTypeLayer; exports.transformedBounds = _chunkMZXQTKUMcjs.transformedBounds; exports.transformedBox = _chunkPMHPXCJCcjs.transformedBox; exports.transformedPoint = _chunkPMHPXCJCcjs.transformedPoint; exports.translateSurface = _chunkJ5BA3BQ6cjs.translateSurface; exports.typeAsPixelLayer = _chunkPMHPXCJCcjs.typeAsPixelLayer; exports.typeFrame = _chunkPMHPXCJCcjs.typeFrame; exports.typeFromAnnotation = _chunkPMHPXCJCcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkPMHPXCJCcjs.typeLayerName; exports.ungroupLayer = _chunkPMHPXCJCcjs.ungroupLayer; exports.uniformTile = _chunkJ5BA3BQ6cjs.uniformTile; exports.unionRect = _chunkPMHPXCJCcjs.unionRect; exports.unprojectCanvasPoint = _chunkPMHPXCJCcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkPMHPXCJCcjs.updateLayerEffect; exports.updateLayerFilter = _chunkPMHPXCJCcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkPMHPXCJCcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk6GFRKLLScjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkPMHPXCJCcjs.updateShapeLayer; exports.updateSmartFilter = _chunkPMHPXCJCcjs.updateSmartFilter; exports.updateTypeLayer = _chunkPMHPXCJCcjs.updateTypeLayer; exports.uvToXy = _chunkPMHPXCJCcjs.uvToXy; exports.validateEffectGradient = _chunkMZXQTKUMcjs.validateEffectGradient; exports.validateLayerEffect = _chunkMZXQTKUMcjs.validateLayerEffect; exports.validateLayerEffects = _chunkMZXQTKUMcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkPMHPXCJCcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkPMHPXCJCcjs.vibranceLinear; exports.vibrancePixel = _chunkPMHPXCJCcjs.vibrancePixel; exports.walkDabs = _chunk6GFRKLLScjs.walkDabs; exports.warpMeshEditPoints = _chunkLXGOYRPEcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkLXGOYRPEcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkLXGOYRPEcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkLXGOYRPEcjs.warpPresetMesh; exports.warpSurface = _chunkMZXQTKUMcjs.warpSurface; exports.wbMatrix = _chunkPMHPXCJCcjs.wbMatrix; exports.wetGpuSupport = _chunkFHPVDTI2cjs.wetGpuSupport; exports.wetSimdSupported = _chunkFHPVDTI2cjs.wetSimdSupported; exports.wetSupport = _chunkFHPVDTI2cjs.wetSupport; exports.whiteBalanceFromSample = _chunkPMHPXCJCcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkPMHPXCJCcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkPMHPXCJCcjs.withFilterMaskSurface; exports.withNewIds = _chunkPMHPXCJCcjs.withNewIds; exports.writeAdjustmentBlock = _chunkPMHPXCJCcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkJ5BA3BQ6cjs.writeDeepRegion; exports.writeLfx2 = _chunkPMHPXCJCcjs.writeLfx2; exports.writePatternBlock = _chunkPMHPXCJCcjs.writePatternBlock; exports.writePsd = _chunkPMHPXCJCcjs.writePsd; exports.writeRegion = _chunkJ5BA3BQ6cjs.writeRegion; exports.xyToTempTint = _chunkPMHPXCJCcjs.xyToTempTint; exports.xyToUv = _chunkPMHPXCJCcjs.xyToUv;
|
|
15757
15757
|
//# sourceMappingURL=index.cjs.map
|