@pixerate/editor 0.126.0 → 0.127.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/index.d.cts +2 -3
- package/dist/animation/index.d.ts +2 -3
- package/dist/animation-editor/index.cjs +63 -63
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +6 -8
- package/dist/animation-editor/index.d.ts +6 -8
- package/dist/animation-editor/index.js +10 -10
- package/dist/{bezier-CBzKKDjl.d.cts → bezier-DBz0IgEt.d.cts} +22 -2
- package/dist/{bezier-CWv6LQal.d.ts → bezier-DWI5MEkI.d.ts} +22 -2
- package/dist/{brushstrokeRender-LRV7GXGD.js → brushstrokeRender-7RUITO42.js} +3 -3
- package/dist/{brushstrokeRender-EELTV7U4.cjs → brushstrokeRender-OW6ENCZG.cjs} +7 -7
- package/dist/{brushstrokeRender-EELTV7U4.cjs.map → brushstrokeRender-OW6ENCZG.cjs.map} +1 -1
- package/dist/canvas/index.cjs +423 -37
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +189 -11
- package/dist/canvas/index.d.ts +189 -11
- package/dist/canvas/index.js +395 -9
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-7LQO6OHH.cjs → chunk-33SO3QWP.cjs} +4 -4
- package/dist/{chunk-7LQO6OHH.cjs.map → chunk-33SO3QWP.cjs.map} +1 -1
- package/dist/{chunk-MPQAO33O.js → chunk-A6KHMKI4.js} +3 -3
- package/dist/{chunk-V5YGPRCZ.cjs → chunk-BEGEWQHD.cjs} +41 -41
- package/dist/{chunk-V5YGPRCZ.cjs.map → chunk-BEGEWQHD.cjs.map} +1 -1
- package/dist/{chunk-N3FVUOZD.cjs → chunk-BJTCSLF6.cjs} +7 -7
- package/dist/{chunk-N3FVUOZD.cjs.map → chunk-BJTCSLF6.cjs.map} +1 -1
- package/dist/{chunk-WUDPFWAN.js → chunk-F7Q2NE2Y.js} +3 -3
- package/dist/{chunk-GUZ47CJM.cjs → chunk-IZ4WRXZA.cjs} +1 -1
- package/dist/{chunk-GUZ47CJM.cjs.map → chunk-IZ4WRXZA.cjs.map} +1 -1
- package/dist/{chunk-GLWZXQ4Q.js → chunk-KHNZ6MOU.js} +1 -1
- package/dist/chunk-KHNZ6MOU.js.map +1 -0
- package/dist/{chunk-GCJWMEYW.cjs → chunk-KSJLDRHK.cjs} +46 -46
- package/dist/{chunk-GCJWMEYW.cjs.map → chunk-KSJLDRHK.cjs.map} +1 -1
- package/dist/{chunk-QQKTOA4U.cjs → chunk-ORE334I6.cjs} +132 -132
- package/dist/{chunk-QQKTOA4U.cjs.map → chunk-ORE334I6.cjs.map} +1 -1
- package/dist/{chunk-X6KTSFAE.js → chunk-Q4NBEVV5.js} +2 -2
- package/dist/{chunk-FPRIUR4T.js → chunk-ROZFX4QI.js} +3 -3
- package/dist/{chunk-J67OLQUQ.js → chunk-UABQTYQF.js} +3 -3
- package/dist/{chunk-O5RVCDEC.cjs → chunk-XLUYXUBD.cjs} +88 -88
- package/dist/{chunk-O5RVCDEC.cjs.map → chunk-XLUYXUBD.cjs.map} +1 -1
- package/dist/{chunk-FG274FYT.js → chunk-YGJIER2R.js} +2 -2
- package/dist/effects/index.d.cts +6 -38
- package/dist/effects/index.d.ts +6 -38
- package/dist/evaluate-BbCeF6pt.d.ts +114 -0
- package/dist/evaluate-BsxYieLN.d.cts +114 -0
- package/dist/{export-DVl4fWy5.d.cts → export-Cbr9IqpJ.d.cts} +1 -1
- package/dist/{export-Bp7ji2r4.d.cts → export-CcldobdN.d.cts} +3 -3
- package/dist/{export-C1s4eolZ.d.ts → export-ClPKUB-v.d.ts} +1 -1
- package/dist/{export-DAyPY94f.d.ts → export-PGhOpDmz.d.ts} +3 -3
- package/dist/{helpers-i95Ob6Vi.d.cts → helpers-C5aAd44p.d.cts} +67 -4
- package/dist/{helpers-BBLlekuM.d.ts → helpers-CPWcK504.d.ts} +67 -4
- package/dist/image-editor/index.cjs +606 -606
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +9 -11
- package/dist/image-editor/index.d.ts +9 -11
- package/dist/image-editor/index.js +4 -4
- package/dist/{opentype-14PDI5D2.d.ts → opentype-01rMIuQR.d.ts} +1 -1
- package/dist/{opentype-D80AVmMu.d.cts → opentype-BgqvmGT-.d.cts} +1 -1
- package/dist/paint-editor/index.cjs +9 -9
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +6 -8
- package/dist/paint-editor/index.d.ts +6 -8
- package/dist/paint-editor/index.js +4 -4
- package/dist/{pathfinder-DjISxkUv.d.ts → pathfinder-D-h0Imus.d.ts} +1 -1
- package/dist/{pathfinder-C0UoFypx.d.cts → pathfinder-DgG0Z9Lr.d.cts} +1 -1
- package/dist/{player-cGLrngL_.d.ts → player-BK2kKbfd.d.ts} +1 -1
- package/dist/{player-CBtEoU2x.d.cts → player-CmbY3218.d.cts} +1 -1
- package/dist/pool-C7GtrL34.d.cts +34 -0
- package/dist/pool-CTrtciaN.d.ts +34 -0
- package/dist/{svg-DJKriJ4A.d.ts → svg-BRLwcibA.d.ts} +2 -3
- package/dist/{svg-BkRL-fZJ.d.cts → svg-DLBBPQP9.d.cts} +2 -3
- package/dist/{tools-CM8Oe8F3.d.ts → tools-AugT22z3.d.ts} +1 -1
- package/dist/{tools-DZCv2kX1.d.cts → tools-BpCmUNxb.d.cts} +1 -1
- package/dist/vector/index.cjs +918 -918
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +10 -12
- package/dist/vector/index.d.ts +10 -12
- package/dist/vector/index.js +11 -11
- package/dist/video-editor/index.d.cts +6 -8
- package/dist/video-editor/index.d.ts +6 -8
- package/dist/{warp-CH9MM435.d.cts → warp-C13L_GRn.d.cts} +1 -1
- package/dist/{warp-k_PdtXOG.d.ts → warp-q8FK5HHi.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-canvas/SKILL.md +19 -0
- package/dist/behavior-Ymbld6jL.d.cts +0 -60
- package/dist/behavior-Ymbld6jL.d.ts +0 -60
- package/dist/chunk-GLWZXQ4Q.js.map +0 -1
- package/dist/evaluate-2S3vSPLy.d.cts +0 -55
- package/dist/evaluate-CfmT6xA3.d.ts +0 -55
- package/dist/gradient-KDfCvhuj.d.cts +0 -66
- package/dist/gradient-KDfCvhuj.d.ts +0 -66
- /package/dist/{brushstrokeRender-LRV7GXGD.js.map → brushstrokeRender-7RUITO42.js.map} +0 -0
- /package/dist/{chunk-MPQAO33O.js.map → chunk-A6KHMKI4.js.map} +0 -0
- /package/dist/{chunk-WUDPFWAN.js.map → chunk-F7Q2NE2Y.js.map} +0 -0
- /package/dist/{chunk-X6KTSFAE.js.map → chunk-Q4NBEVV5.js.map} +0 -0
- /package/dist/{chunk-FPRIUR4T.js.map → chunk-ROZFX4QI.js.map} +0 -0
- /package/dist/{chunk-J67OLQUQ.js.map → chunk-UABQTYQF.js.map} +0 -0
- /package/dist/{chunk-FG274FYT.js.map → chunk-YGJIER2R.js.map} +0 -0
|
@@ -362,7 +362,7 @@ var _chunk2OJACTPRcjs = require('../chunk-2OJACTPR.cjs');
|
|
|
362
362
|
|
|
363
363
|
|
|
364
364
|
|
|
365
|
-
var
|
|
365
|
+
var _chunkXLUYXUBDcjs = require('../chunk-XLUYXUBD.cjs');
|
|
366
366
|
|
|
367
367
|
|
|
368
368
|
var _chunk2YQONY6Gcjs = require('../chunk-2YQONY6G.cjs');
|
|
@@ -802,7 +802,9 @@ var _chunk643B2HKCcjs = require('../chunk-643B2HKC.cjs');
|
|
|
802
802
|
|
|
803
803
|
|
|
804
804
|
|
|
805
|
-
var
|
|
805
|
+
var _chunkORE334I6cjs = require('../chunk-ORE334I6.cjs');
|
|
806
|
+
require('../chunk-BJTCSLF6.cjs');
|
|
807
|
+
require('../chunk-IZ4WRXZA.cjs');
|
|
806
808
|
|
|
807
809
|
|
|
808
810
|
|
|
@@ -811,8 +813,6 @@ var _chunkQQKTOA4Ucjs = require('../chunk-QQKTOA4U.cjs');
|
|
|
811
813
|
|
|
812
814
|
|
|
813
815
|
var _chunkJODTP4DPcjs = require('../chunk-JODTP4DP.cjs');
|
|
814
|
-
require('../chunk-N3FVUOZD.cjs');
|
|
815
|
-
require('../chunk-GUZ47CJM.cjs');
|
|
816
816
|
require('../chunk-RIWPYSKU.cjs');
|
|
817
817
|
require('../chunk-MR3Z4OQI.cjs');
|
|
818
818
|
require('../chunk-A6PHCAGX.cjs');
|
|
@@ -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 _chunkXLUYXUBDcjs.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: _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
|
|
946
|
+
const ox = _chunkXLUYXUBDcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
|
|
947
|
+
const oy = _chunkXLUYXUBDcjs.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) _chunkXLUYXUBDcjs.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 (!_chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 (_chunkXLUYXUBDcjs.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, _chunkXLUYXUBDcjs.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, _chunkXLUYXUBDcjs.LayerCompositor)()}
|
|
1159
|
+
__init9() {this.exportCompositor = new (0, _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
|
|
1237
1237
|
const { region } = projection;
|
|
1238
|
-
const rotated =
|
|
1238
|
+
const rotated = _chunkXLUYXUBDcjs.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${_chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
|
|
1249
|
+
_chunkXLUYXUBDcjs.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
|
+
_chunkXLUYXUBDcjs.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
|
+
_chunkXLUYXUBDcjs.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
|
+
_chunkXLUYXUBDcjs.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) => _chunkXLUYXUBDcjs.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) => _chunkXLUYXUBDcjs.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, _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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
|
+
_chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
|
|
1469
|
+
_chunkXLUYXUBDcjs.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
|
+
_chunkXLUYXUBDcjs.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
|
+
_chunkXLUYXUBDcjs.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" && _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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}|${_chunkXLUYXUBDcjs.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
|
+
_chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 _chunkXLUYXUBDcjs.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 ? _chunkXLUYXUBDcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
|
|
2035
|
+
const rotated = _chunkXLUYXUBDcjs.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
|
+
_chunkXLUYXUBDcjs.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
|
+
_chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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: _chunkXLUYXUBDcjs.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] = _chunkXLUYXUBDcjs.coverageToByte.call(void 0, coverage[i]);
|
|
2292
|
+
return _chunkXLUYXUBDcjs.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 _chunkXLUYXUBDcjs.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 _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, w, h);
|
|
2468
|
+
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, w, h, marks);
|
|
2469
|
+
return _chunkXLUYXUBDcjs.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 _chunkXLUYXUBDcjs.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] = _chunkXLUYXUBDcjs.coverageToByte.call(void 0, best);
|
|
2508
2508
|
}
|
|
2509
|
-
return
|
|
2509
|
+
return _chunkXLUYXUBDcjs.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] = _chunkXLUYXUBDcjs.coverageToByte.call(void 0, 1 - outside / ramp);
|
|
2528
2528
|
}
|
|
2529
|
-
return
|
|
2529
|
+
return _chunkXLUYXUBDcjs.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] = _chunkXLUYXUBDcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
|
|
2553
2553
|
}
|
|
2554
|
-
return
|
|
2554
|
+
return _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.greyMorphology.call(void 0, g, w, h, r, true);
|
|
2689
|
+
const hi = _chunkXLUYXUBDcjs.greyMorphology.call(void 0, y, w, h, r, true);
|
|
2690
|
+
const lo = _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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] = _chunkXLUYXUBDcjs.coverageToByte.call(void 0, refined[y * ww + x]);
|
|
2785
2785
|
}
|
|
2786
|
-
return
|
|
2786
|
+
return _chunkXLUYXUBDcjs.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, _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
|
|
3077
|
+
if (!maskAlone) _chunkXLUYXUBDcjs.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 (!_chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
|
|
3098
|
+
const m = _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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: _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 (!_chunkXLUYXUBDcjs.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 && (_chunkXLUYXUBDcjs.hasWarp.call(void 0, next) || !_chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.isIdentityTransform.call(void 0, g);
|
|
3281
|
+
const warp = _chunkXLUYXUBDcjs.hasWarp.call(void 0, g);
|
|
3282
|
+
const h = warp ? null : _chunkXLUYXUBDcjs.geometryHomography.call(void 0, g);
|
|
3283
|
+
const f = warp ? _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 (!_chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 (_chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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, () => _chunkXLUYXUBDcjs.rerenderText.call(void 0, next, this.host.textEnv()));
|
|
3372
|
+
const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkORE334I6cjs.invertMatrix.call(void 0, _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 = _chunkXLUYXUBDcjs.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 !_chunkXLUYXUBDcjs.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 && _chunkXLUYXUBDcjs.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) {
|
|
@@ -3626,7 +3626,7 @@ function convertSurfaceColors(surface, t) {
|
|
|
3626
3626
|
}
|
|
3627
3627
|
|
|
3628
3628
|
// src/image-editor/controller.ts
|
|
3629
|
-
var IMAGE_EDITOR_SCHEMA_VERSION =
|
|
3629
|
+
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION;
|
|
3630
3630
|
var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge"];
|
|
3631
3631
|
var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
|
|
3632
3632
|
var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
|
|
@@ -3820,7 +3820,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3820
3820
|
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 })) {
|
|
3821
3821
|
const key = _chunkJ5BA3BQ6cjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3822
3822
|
const cur = regions.get(key);
|
|
3823
|
-
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ?
|
|
3823
|
+
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkXLUYXUBDcjs.unionRect.call(void 0, cur.r, r) : r });
|
|
3824
3824
|
}
|
|
3825
3825
|
}
|
|
3826
3826
|
for (const [key, { tx, ty, r }] of regions) {
|
|
@@ -3852,7 +3852,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3852
3852
|
}
|
|
3853
3853
|
/** Finishes the stroke (one undo step) and returns what changed. */
|
|
3854
3854
|
end() {
|
|
3855
|
-
if (this.closed) throw new (0,
|
|
3855
|
+
if (this.closed) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("This stroke has already ended.");
|
|
3856
3856
|
const last = _nullishCoalesce(this.last, () => ( void 0));
|
|
3857
3857
|
const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
|
|
3858
3858
|
_optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
|
|
@@ -3976,20 +3976,20 @@ function sameTile(a, b) {
|
|
|
3976
3976
|
for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
|
|
3977
3977
|
return true;
|
|
3978
3978
|
}
|
|
3979
|
-
var DEFAULT_ADJUSTMENTS =
|
|
3979
|
+
var DEFAULT_ADJUSTMENTS = _chunkXLUYXUBDcjs.DEFAULT_ADJUSTMENTS_VALUES;
|
|
3980
3980
|
function normalizeStoredAdjustments(stored) {
|
|
3981
3981
|
if (!stored) return { ...DEFAULT_ADJUSTMENTS };
|
|
3982
3982
|
const out = {
|
|
3983
3983
|
...DEFAULT_ADJUSTMENTS,
|
|
3984
3984
|
...stored,
|
|
3985
|
-
process:
|
|
3985
|
+
process: _chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, stored.process)
|
|
3986
3986
|
};
|
|
3987
|
-
const layers =
|
|
3987
|
+
const layers = _chunkXLUYXUBDcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
|
|
3988
3988
|
if (layers.length) out.layers = layers;
|
|
3989
3989
|
else delete out.layers;
|
|
3990
3990
|
return out;
|
|
3991
3991
|
}
|
|
3992
|
-
var isLayered = (data) => Boolean(data && data.version ===
|
|
3992
|
+
var isLayered = (data) => Boolean(data && data.version === _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
|
|
3993
3993
|
function migrateSerializedImageEditorState(data) {
|
|
3994
3994
|
if (isLayered(data)) {
|
|
3995
3995
|
const out = {
|
|
@@ -4021,10 +4021,10 @@ function migrateSerializedImageEditorState(data) {
|
|
|
4021
4021
|
function migrateToLayeredState(data, size) {
|
|
4022
4022
|
const clean = migrateSerializedImageEditorState(data);
|
|
4023
4023
|
if (isLayered(clean)) return clean;
|
|
4024
|
-
const stack =
|
|
4025
|
-
const { layers, assets } =
|
|
4024
|
+
const stack = _chunkXLUYXUBDcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
|
|
4025
|
+
const { layers, assets } = _chunkXLUYXUBDcjs.serializeLayers.call(void 0, stack.layers);
|
|
4026
4026
|
const out = {
|
|
4027
|
-
version:
|
|
4027
|
+
version: _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION,
|
|
4028
4028
|
width: Math.round(size.width),
|
|
4029
4029
|
height: Math.round(size.height),
|
|
4030
4030
|
layers,
|
|
@@ -4038,8 +4038,8 @@ function migrateToLayeredState(data, size) {
|
|
|
4038
4038
|
if (clean.selection) out.selection = clean.selection;
|
|
4039
4039
|
return out;
|
|
4040
4040
|
}
|
|
4041
|
-
var DEFAULT_TRANSFORM =
|
|
4042
|
-
var DEFAULT_DEPTH_MASK =
|
|
4041
|
+
var DEFAULT_TRANSFORM = _chunkXLUYXUBDcjs.DEFAULT_TRANSFORM_VALUES;
|
|
4042
|
+
var DEFAULT_DEPTH_MASK = _chunkXLUYXUBDcjs.DEFAULT_DEPTH_MASK_VALUES;
|
|
4043
4043
|
var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
|
|
4044
4044
|
var ImageEditorController = (_class7 = class {
|
|
4045
4045
|
|
|
@@ -4062,7 +4062,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4062
4062
|
__init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
|
|
4063
4063
|
__init63() {this.viewKey = []}
|
|
4064
4064
|
/** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
|
|
4065
|
-
__init64() {this.compositor = new (0,
|
|
4065
|
+
__init64() {this.compositor = new (0, _chunkXLUYXUBDcjs.LayerCompositor)()}
|
|
4066
4066
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
4067
4067
|
__init65() {this.effects = new (0, _chunkJODTP4DPcjs.EffectsSlot)()}
|
|
4068
4068
|
/** Renders provider effects: effect smart filter results and effect layers. */
|
|
@@ -4120,7 +4120,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4120
4120
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
4121
4121
|
if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
|
|
4122
4122
|
try {
|
|
4123
|
-
this.state.selection = normalizeSelection(
|
|
4123
|
+
this.state.selection = normalizeSelection(_chunkXLUYXUBDcjs.deserializeSelection.call(void 0, options.initialState.selection));
|
|
4124
4124
|
} catch (e14) {
|
|
4125
4125
|
}
|
|
4126
4126
|
}
|
|
@@ -4232,10 +4232,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
4232
4232
|
if (l.type === "group") {
|
|
4233
4233
|
const children = walk(l.children);
|
|
4234
4234
|
if (children !== l.children) next2 = { ...l, children };
|
|
4235
|
-
} 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 ||
|
|
4235
|
+
} 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 || _chunkXLUYXUBDcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
|
|
4236
4236
|
try {
|
|
4237
|
-
const r =
|
|
4238
|
-
if (all || !
|
|
4237
|
+
const r = _chunkXLUYXUBDcjs.rerender.call(void 0, l, canvas);
|
|
4238
|
+
if (all || !_chunkXLUYXUBDcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
|
|
4239
4239
|
} catch (e16) {
|
|
4240
4240
|
}
|
|
4241
4241
|
}
|
|
@@ -4291,19 +4291,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4291
4291
|
const d = await this.describeEffect(effect, "filter");
|
|
4292
4292
|
const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4293
4293
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4294
|
-
if (!found) throw new (0,
|
|
4294
|
+
if (!found) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
|
|
4295
4295
|
let layers = this.state.layers;
|
|
4296
4296
|
let id = layerId;
|
|
4297
4297
|
let converted = false;
|
|
4298
4298
|
if (found.layer.type !== "smart") {
|
|
4299
|
-
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0,
|
|
4300
|
-
const res2 =
|
|
4299
|
+
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkXLUYXUBDcjs.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.`);
|
|
4300
|
+
const res2 = _chunkXLUYXUBDcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
|
|
4301
4301
|
layers = res2.layers;
|
|
4302
4302
|
id = res2.layer.id;
|
|
4303
4303
|
converted = true;
|
|
4304
4304
|
}
|
|
4305
|
-
const filter =
|
|
4306
|
-
const res =
|
|
4305
|
+
const filter = _chunkXLUYXUBDcjs.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 });
|
|
4306
|
+
const res = _chunkXLUYXUBDcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
|
|
4307
4307
|
this.commitLayers(res.layers);
|
|
4308
4308
|
return { layerId: id, filter: res.filter, converted };
|
|
4309
4309
|
}
|
|
@@ -4314,9 +4314,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4314
4314
|
* false, during a drag).
|
|
4315
4315
|
*/
|
|
4316
4316
|
async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
|
|
4317
|
-
const layer =
|
|
4317
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
|
|
4318
4318
|
const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
|
|
4319
|
-
if (!was || was.kind !== "effect") throw new (0,
|
|
4319
|
+
if (!was || was.kind !== "effect") throw new (0, _chunkXLUYXUBDcjs.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"}.`);
|
|
4320
4320
|
const update = {};
|
|
4321
4321
|
if (changes.values) {
|
|
4322
4322
|
const d = await this.describeEffect(was.effect);
|
|
@@ -4325,15 +4325,15 @@ var ImageEditorController = (_class7 = class {
|
|
|
4325
4325
|
for (const [k, v] of Object.entries(changes.values)) {
|
|
4326
4326
|
if (v !== null) given[k] = v;
|
|
4327
4327
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4328
|
-
else throw new (0,
|
|
4328
|
+
else throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4329
4329
|
}
|
|
4330
4330
|
update.values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4331
4331
|
}
|
|
4332
4332
|
for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
|
|
4333
|
-
let res =
|
|
4334
|
-
if (changes.index !== void 0) res = { ...res, layers:
|
|
4333
|
+
let res = _chunkXLUYXUBDcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
|
|
4334
|
+
if (changes.index !== void 0) res = { ...res, layers: _chunkXLUYXUBDcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
|
|
4335
4335
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4336
|
-
return
|
|
4336
|
+
return _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
|
|
4337
4337
|
}
|
|
4338
4338
|
/**
|
|
4339
4339
|
* Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
|
|
@@ -4345,12 +4345,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4345
4345
|
const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4346
4346
|
const { width, height } = this.naturalSize;
|
|
4347
4347
|
const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
|
|
4348
|
-
const blend =
|
|
4349
|
-
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0,
|
|
4348
|
+
const blend = _chunkXLUYXUBDcjs.parseBlend.call(void 0, options.blend);
|
|
4349
|
+
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4350
4350
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4351
4351
|
const layer = {
|
|
4352
4352
|
type: "pixel",
|
|
4353
|
-
id: options.id && !ids.has(options.id) ? options.id :
|
|
4353
|
+
id: options.id && !ids.has(options.id) ? options.id : _chunkXLUYXUBDcjs.newLayerId.call(void 0, ),
|
|
4354
4354
|
name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
|
|
4355
4355
|
visible: true,
|
|
4356
4356
|
opacity: _nullishCoalesce(options.opacity, () => ( 1)),
|
|
@@ -4359,7 +4359,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4359
4359
|
offset: { x: 0, y: 0 },
|
|
4360
4360
|
generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
|
|
4361
4361
|
};
|
|
4362
|
-
const next =
|
|
4362
|
+
const next = _chunkXLUYXUBDcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
|
|
4363
4363
|
this.commitLayers(next, () => {
|
|
4364
4364
|
this.state.activeLayerId = layer.id;
|
|
4365
4365
|
this.state.activeTarget = "pixels";
|
|
@@ -4374,8 +4374,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
4374
4374
|
async updateEffectLayer(layerId, changes, commitToHistory = true) {
|
|
4375
4375
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4376
4376
|
const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
|
|
4377
|
-
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0,
|
|
4378
|
-
|
|
4377
|
+
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
|
|
4378
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
|
|
4379
4379
|
const g = layer.generator;
|
|
4380
4380
|
const d = await this.describeEffect(g.effect);
|
|
4381
4381
|
const base = { ...g.values };
|
|
@@ -4383,7 +4383,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4383
4383
|
for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
|
|
4384
4384
|
if (v !== null) given[k] = v;
|
|
4385
4385
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4386
|
-
else throw new (0,
|
|
4386
|
+
else throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4387
4387
|
}
|
|
4388
4388
|
const values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4389
4389
|
const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
|
|
@@ -4398,7 +4398,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4398
4398
|
/** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
|
|
4399
4399
|
rasterizeEffectLayer(layerId) {
|
|
4400
4400
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4401
|
-
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0,
|
|
4401
|
+
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
|
|
4402
4402
|
this.commitLayers(
|
|
4403
4403
|
_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
|
|
4404
4404
|
const { generator: _g, ...rest } = l;
|
|
@@ -4426,7 +4426,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4426
4426
|
if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
|
|
4427
4427
|
this.viewKey = key;
|
|
4428
4428
|
const { width, height } = this.naturalSize;
|
|
4429
|
-
const view =
|
|
4429
|
+
const view = _chunkXLUYXUBDcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
|
|
4430
4430
|
s.adjustments = view.adjustments;
|
|
4431
4431
|
s.depthMask = view.depthMask;
|
|
4432
4432
|
s.annotations = view.annotations;
|
|
@@ -4580,7 +4580,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4580
4580
|
applyCropPreset(ratio) {
|
|
4581
4581
|
this.recordHistory();
|
|
4582
4582
|
const { width, height } = this.state.imageDimensions;
|
|
4583
|
-
if (ratio &&
|
|
4583
|
+
if (ratio && _chunkXLUYXUBDcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
|
|
4584
4584
|
ratio = 1 / ratio;
|
|
4585
4585
|
}
|
|
4586
4586
|
if (!ratio) {
|
|
@@ -4662,7 +4662,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4662
4662
|
*/
|
|
4663
4663
|
getLayerPixels(id) {
|
|
4664
4664
|
const layer = this.getLayer(id);
|
|
4665
|
-
if (!layer || !
|
|
4665
|
+
if (!layer || !_chunkXLUYXUBDcjs.hasSurface.call(void 0, layer)) return null;
|
|
4666
4666
|
const surface = this.surfaceOf(layer);
|
|
4667
4667
|
const b = _chunkJ5BA3BQ6cjs.contentBounds.call(void 0, surface);
|
|
4668
4668
|
if (!b) return null;
|
|
@@ -4675,7 +4675,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4675
4675
|
*/
|
|
4676
4676
|
getLayerBounds(id) {
|
|
4677
4677
|
const layer = this.getLayer(id);
|
|
4678
|
-
if (!layer || !
|
|
4678
|
+
if (!layer || !_chunkXLUYXUBDcjs.hasSurface.call(void 0, layer)) return null;
|
|
4679
4679
|
const surface = this.surfaceOf(layer);
|
|
4680
4680
|
let b = this.boundsCache.get(surface);
|
|
4681
4681
|
if (b === void 0) {
|
|
@@ -4690,9 +4690,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4690
4690
|
*/
|
|
4691
4691
|
getLayerDataURL(id) {
|
|
4692
4692
|
const layer = this.getLayer(id);
|
|
4693
|
-
if (!layer || !
|
|
4693
|
+
if (!layer || !_chunkXLUYXUBDcjs.hasSurface.call(void 0, layer)) return null;
|
|
4694
4694
|
const surface = this.surfaceOf(layer);
|
|
4695
|
-
const enc =
|
|
4695
|
+
const enc = _chunkXLUYXUBDcjs.encodeSurface.call(void 0, surface);
|
|
4696
4696
|
return enc ? enc.url : null;
|
|
4697
4697
|
}
|
|
4698
4698
|
/**
|
|
@@ -4834,19 +4834,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4834
4834
|
if (init.pixels) {
|
|
4835
4835
|
const px2 = init.pixels;
|
|
4836
4836
|
if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
|
|
4837
|
-
throw new (0,
|
|
4837
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
|
|
4838
4838
|
}
|
|
4839
4839
|
surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, px2, 4);
|
|
4840
4840
|
} else if (init.color !== void 0) {
|
|
4841
4841
|
const c = parseColor(init.color);
|
|
4842
4842
|
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]));
|
|
4843
4843
|
}
|
|
4844
|
-
const blend =
|
|
4845
|
-
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
4844
|
+
const blend = _chunkXLUYXUBDcjs.parseBlend.call(void 0, init.blend);
|
|
4845
|
+
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4846
4846
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4847
4847
|
const layer = {
|
|
4848
4848
|
type: "pixel",
|
|
4849
|
-
id: init.id && !ids.has(init.id) ? init.id :
|
|
4849
|
+
id: init.id && !ids.has(init.id) ? init.id : _chunkXLUYXUBDcjs.newLayerId.call(void 0, ),
|
|
4850
4850
|
name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
|
|
4851
4851
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
4852
4852
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
@@ -4855,7 +4855,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4855
4855
|
offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
|
|
4856
4856
|
};
|
|
4857
4857
|
if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
|
|
4858
|
-
const next =
|
|
4858
|
+
const next = _chunkXLUYXUBDcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
4859
4859
|
this.commitLayers(next, () => {
|
|
4860
4860
|
this.state.activeLayerId = layer.id;
|
|
4861
4861
|
this.state.activeTarget = "pixels";
|
|
@@ -4895,12 +4895,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4895
4895
|
try {
|
|
4896
4896
|
img = await this.renderer.imageCache.get(src);
|
|
4897
4897
|
} catch (e21) {
|
|
4898
|
-
throw new (0,
|
|
4898
|
+
throw new (0, _chunkXLUYXUBDcjs.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.");
|
|
4899
4899
|
}
|
|
4900
4900
|
const w = img.naturalWidth || img.width;
|
|
4901
4901
|
const h = img.naturalHeight || img.height;
|
|
4902
4902
|
const ctx = this.renderer.createCanvas(w, h).getContext("2d");
|
|
4903
|
-
if (!ctx || typeof ctx.getImageData !== "function") throw new (0,
|
|
4903
|
+
if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
|
|
4904
4904
|
ctx.drawImage(img, 0, 0, w, h);
|
|
4905
4905
|
const data = ctx.getImageData(0, 0, w, h);
|
|
4906
4906
|
return { width: w, height: h, data: data.data };
|
|
@@ -4913,7 +4913,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4913
4913
|
}
|
|
4914
4914
|
/** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
|
|
4915
4915
|
duplicateLayer(id, name) {
|
|
4916
|
-
const res =
|
|
4916
|
+
const res = _chunkXLUYXUBDcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
|
|
4917
4917
|
this.commitLayers(res.layers, () => {
|
|
4918
4918
|
this.state.activeLayerId = res.id;
|
|
4919
4919
|
});
|
|
@@ -4921,16 +4921,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
4921
4921
|
}
|
|
4922
4922
|
/** Deletes a layer (refused when locked), as one undo step. */
|
|
4923
4923
|
removeLayer(id) {
|
|
4924
|
-
const next =
|
|
4924
|
+
const next = _chunkXLUYXUBDcjs.removeLayer.call(void 0, this.state.layers, id);
|
|
4925
4925
|
this.commitLayers(next, () => {
|
|
4926
|
-
if (this.state.selectedAnnotationId && !_chunkMZXQTKUMcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([
|
|
4926
|
+
if (this.state.selectedAnnotationId && !_chunkMZXQTKUMcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkXLUYXUBDcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
|
|
4927
4927
|
this.state.selectedAnnotationId = null;
|
|
4928
4928
|
}
|
|
4929
4929
|
});
|
|
4930
4930
|
}
|
|
4931
4931
|
/** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
|
|
4932
4932
|
moveLayer(id, placement) {
|
|
4933
|
-
const next =
|
|
4933
|
+
const next = _chunkXLUYXUBDcjs.moveLayer.call(void 0, this.state.layers, id, placement);
|
|
4934
4934
|
const loc = _chunkMZXQTKUMcjs.findLayer.call(void 0, next, id);
|
|
4935
4935
|
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
|
|
4936
4936
|
this.commitLayers(next);
|
|
@@ -4941,23 +4941,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
4941
4941
|
* one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
|
|
4942
4942
|
*/
|
|
4943
4943
|
setLayerProperties(id, props, commitToHistory = true) {
|
|
4944
|
-
const next =
|
|
4944
|
+
const next = _chunkXLUYXUBDcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
|
|
4945
4945
|
this.commitLayers(next, void 0, commitToHistory);
|
|
4946
4946
|
return _chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer;
|
|
4947
4947
|
}
|
|
4948
4948
|
/** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
|
|
4949
4949
|
addGroup(init = {}) {
|
|
4950
|
-
const blend = init.blend === void 0 ? "pass-through" :
|
|
4950
|
+
const blend = init.blend === void 0 ? "pass-through" : _chunkXLUYXUBDcjs.parseBlend.call(void 0, init.blend, true);
|
|
4951
4951
|
const group = {
|
|
4952
4952
|
type: "group",
|
|
4953
|
-
id:
|
|
4953
|
+
id: _chunkXLUYXUBDcjs.newLayerId.call(void 0, "group"),
|
|
4954
4954
|
name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
|
|
4955
4955
|
visible: true,
|
|
4956
4956
|
opacity: 1,
|
|
4957
4957
|
blend,
|
|
4958
4958
|
children: []
|
|
4959
4959
|
};
|
|
4960
|
-
const next =
|
|
4960
|
+
const next = _chunkXLUYXUBDcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
|
|
4961
4961
|
this.commitLayers(next, () => {
|
|
4962
4962
|
this.state.activeLayerId = group.id;
|
|
4963
4963
|
this.state.activeTarget = "pixels";
|
|
@@ -4966,7 +4966,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4966
4966
|
}
|
|
4967
4967
|
/** Puts sibling layers into a new group (one undo step). Returns the group id. */
|
|
4968
4968
|
groupLayers(ids, name) {
|
|
4969
|
-
const res =
|
|
4969
|
+
const res = _chunkXLUYXUBDcjs.groupLayers.call(void 0, this.state.layers, ids, name);
|
|
4970
4970
|
this.commitLayers(res.layers, () => {
|
|
4971
4971
|
this.state.activeLayerId = res.id;
|
|
4972
4972
|
});
|
|
@@ -4974,7 +4974,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4974
4974
|
}
|
|
4975
4975
|
/** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
|
|
4976
4976
|
ungroupLayer(id) {
|
|
4977
|
-
const res =
|
|
4977
|
+
const res = _chunkXLUYXUBDcjs.ungroupLayer.call(void 0, this.state.layers, id);
|
|
4978
4978
|
this.commitLayers(res.layers);
|
|
4979
4979
|
return res.ids;
|
|
4980
4980
|
}
|
|
@@ -4983,38 +4983,38 @@ var ImageEditorController = (_class7 = class {
|
|
|
4983
4983
|
* (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
|
|
4984
4984
|
*/
|
|
4985
4985
|
offsetLayer(id, move, commitToHistory = true) {
|
|
4986
|
-
const layer =
|
|
4986
|
+
const layer = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
4987
4987
|
if (layer.type === "smart") {
|
|
4988
4988
|
const tl = layer.placement.corners[0];
|
|
4989
4989
|
const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
4990
4990
|
const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
4991
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
4992
|
-
this.commitLayers(
|
|
4991
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("x and y must be numbers.");
|
|
4992
|
+
this.commitLayers(_chunkXLUYXUBDcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
|
|
4993
4993
|
const moved = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, id).layer;
|
|
4994
4994
|
return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
|
|
4995
4995
|
}
|
|
4996
4996
|
if (layer.type === "shape") {
|
|
4997
|
-
const g = _nullishCoalesce(
|
|
4997
|
+
const g = _nullishCoalesce(_chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
|
|
4998
4998
|
const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
4999
4999
|
const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5000
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5001
|
-
|
|
5002
|
-
let moved =
|
|
5000
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("x and y must be numbers.");
|
|
5001
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5002
|
+
let moved = _chunkXLUYXUBDcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
|
|
5003
5003
|
const mask = layer.mask;
|
|
5004
5004
|
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)) } };
|
|
5005
5005
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
5006
|
-
const b = _nullishCoalesce(
|
|
5006
|
+
const b = _nullishCoalesce(_chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
|
|
5007
5007
|
return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
|
|
5008
5008
|
}
|
|
5009
5009
|
if (layer.type === "type") {
|
|
5010
5010
|
const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
|
|
5011
5011
|
const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
|
|
5012
5012
|
const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
|
|
5013
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5014
|
-
|
|
5013
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("x and y must be numbers.");
|
|
5014
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5015
5015
|
const mx = Math.round(dx);
|
|
5016
5016
|
const my = Math.round(dy);
|
|
5017
|
-
let moved = { ...
|
|
5017
|
+
let moved = { ..._chunkXLUYXUBDcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, layer.surface, mx, my) };
|
|
5018
5018
|
const mask = layer.mask;
|
|
5019
5019
|
if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, mx, my) } };
|
|
5020
5020
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
@@ -5024,7 +5024,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5024
5024
|
const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
5025
5025
|
const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
|
|
5026
5026
|
const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
|
|
5027
|
-
const next =
|
|
5027
|
+
const next = _chunkXLUYXUBDcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
|
|
5028
5028
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5029
5029
|
return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
|
|
5030
5030
|
}
|
|
@@ -5034,11 +5034,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5034
5034
|
* target when the layer is active.
|
|
5035
5035
|
*/
|
|
5036
5036
|
addLayerMask(id, from = "reveal-all", props = {}) {
|
|
5037
|
-
const layer =
|
|
5037
|
+
const layer = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5038
5038
|
let mask;
|
|
5039
5039
|
if (from === "selection") {
|
|
5040
5040
|
const sel = this.state.selection;
|
|
5041
|
-
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0,
|
|
5041
|
+
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5042
5042
|
mask = this.maskFromSelection(sel, props);
|
|
5043
5043
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
5044
5044
|
mask = { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
@@ -5047,7 +5047,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5047
5047
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5048
5048
|
mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5049
5049
|
}
|
|
5050
|
-
const next =
|
|
5050
|
+
const next = _chunkXLUYXUBDcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
|
|
5051
5051
|
this.commitLayers(next, () => {
|
|
5052
5052
|
if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
|
|
5053
5053
|
});
|
|
@@ -5055,18 +5055,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
5055
5055
|
}
|
|
5056
5056
|
/** Removes a layer's mask (one undo step). */
|
|
5057
5057
|
removeLayerMask(id) {
|
|
5058
|
-
const layer =
|
|
5059
|
-
if (!layer.mask) throw new (0,
|
|
5060
|
-
this.commitLayers(
|
|
5058
|
+
const layer = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5059
|
+
if (!layer.mask) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5060
|
+
this.commitLayers(_chunkXLUYXUBDcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
|
|
5061
5061
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
5062
5062
|
});
|
|
5063
5063
|
}
|
|
5064
5064
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
5065
5065
|
setLayerMaskProps(id, props, commitToHistory = true) {
|
|
5066
|
-
const layer =
|
|
5067
|
-
if (!layer.mask) throw new (0,
|
|
5066
|
+
const layer = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5067
|
+
if (!layer.mask) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
5068
5068
|
const mask = withMaskProps(layer.mask, props);
|
|
5069
|
-
this.commitLayers(
|
|
5069
|
+
this.commitLayers(_chunkXLUYXUBDcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
|
|
5070
5070
|
return mask;
|
|
5071
5071
|
}
|
|
5072
5072
|
/**
|
|
@@ -5074,11 +5074,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5074
5074
|
* the depth map) and removes the mask, as one undo step.
|
|
5075
5075
|
*/
|
|
5076
5076
|
async applyLayerMask(id) {
|
|
5077
|
-
const loc =
|
|
5077
|
+
const loc = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5078
5078
|
const layer = loc.layer;
|
|
5079
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5080
|
-
if (!layer.mask) throw new (0,
|
|
5081
|
-
|
|
5079
|
+
if (layer.type !== "pixel") throw new (0, _chunkXLUYXUBDcjs.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.`);
|
|
5080
|
+
if (!layer.mask) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5081
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
|
|
5082
5082
|
const { width, height } = this.naturalSize;
|
|
5083
5083
|
await this.renderer.prepareLayerAssets([layer], width, height);
|
|
5084
5084
|
const sources = this.renderer.compositorSources(width, height);
|
|
@@ -5111,13 +5111,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
5111
5111
|
*/
|
|
5112
5112
|
layerViaCopy(options = {}) {
|
|
5113
5113
|
const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
|
|
5114
|
-
if (!id) throw new (0,
|
|
5115
|
-
const loc =
|
|
5114
|
+
if (!id) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
|
|
5115
|
+
const loc = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5116
5116
|
const layer = loc.layer;
|
|
5117
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5117
|
+
if (layer.type !== "pixel") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
|
|
5118
5118
|
const sel = this.state.selection;
|
|
5119
|
-
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0,
|
|
5120
|
-
if (options.cut)
|
|
5119
|
+
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
|
|
5120
|
+
if (options.cut) _chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
|
|
5121
5121
|
const surface = this.surfaceOf(layer);
|
|
5122
5122
|
const sb = sel.bounds;
|
|
5123
5123
|
const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
|
|
@@ -5133,7 +5133,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5133
5133
|
}
|
|
5134
5134
|
const copy = {
|
|
5135
5135
|
type: "pixel",
|
|
5136
|
-
id:
|
|
5136
|
+
id: _chunkXLUYXUBDcjs.newLayerId.call(void 0, ),
|
|
5137
5137
|
name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
5138
5138
|
visible: true,
|
|
5139
5139
|
opacity: 1,
|
|
@@ -5206,7 +5206,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5206
5206
|
* Refused while another transform is open.
|
|
5207
5207
|
*/
|
|
5208
5208
|
beginFreeTransform(init = {}) {
|
|
5209
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5209
|
+
if (this.getFreeTransform()) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
|
|
5210
5210
|
const session = new FreeTransformSession(this.transformHost(), init);
|
|
5211
5211
|
this.openTransform = session;
|
|
5212
5212
|
this.notify();
|
|
@@ -5220,26 +5220,26 @@ var ImageEditorController = (_class7 = class {
|
|
|
5220
5220
|
*/
|
|
5221
5221
|
transformLayer(spec) {
|
|
5222
5222
|
const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
|
|
5223
|
-
if (given > 1) throw new (0,
|
|
5224
|
-
if (!given && spec.warp === void 0) throw new (0,
|
|
5223
|
+
if (given > 1) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give only one of matrix, corners and params.");
|
|
5224
|
+
if (!given && spec.warp === void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
|
|
5225
5225
|
if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
|
|
5226
|
-
throw new (0,
|
|
5226
|
+
throw new (0, _chunkXLUYXUBDcjs.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).");
|
|
5227
5227
|
}
|
|
5228
5228
|
if (spec.matrix) {
|
|
5229
5229
|
const [a, b, c, d] = spec.matrix;
|
|
5230
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5230
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5231
5231
|
}
|
|
5232
5232
|
const session = this.beginFreeTransform(spec);
|
|
5233
5233
|
try {
|
|
5234
5234
|
const g = session.startGeometry;
|
|
5235
|
-
const corners = spec.matrix ? g.corners.map((p) =>
|
|
5235
|
+
const corners = spec.matrix ? g.corners.map((p) => _chunkORE334I6cjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkXLUYXUBDcjs.applyParams.call(void 0, g, spec.params) : g.corners;
|
|
5236
5236
|
let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
|
|
5237
5237
|
if (spec.warp) {
|
|
5238
5238
|
if ("style" in spec.warp) {
|
|
5239
|
-
if (!
|
|
5240
|
-
warp =
|
|
5239
|
+
if (!_chunkORE334I6cjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkORE334I6cjs.WARP_STYLES.join(", ")}.`);
|
|
5240
|
+
warp = _chunkXLUYXUBDcjs.presetWarp.call(void 0, session.box, spec.warp);
|
|
5241
5241
|
} else {
|
|
5242
|
-
if (!
|
|
5242
|
+
if (!_chunkXLUYXUBDcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkXLUYXUBDcjs.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.");
|
|
5243
5243
|
warp = spec.warp;
|
|
5244
5244
|
}
|
|
5245
5245
|
}
|
|
@@ -5252,10 +5252,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5252
5252
|
}
|
|
5253
5253
|
/** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
|
|
5254
5254
|
flipLayer(axis, init = {}) {
|
|
5255
|
-
if (axis !== "horizontal" && axis !== "vertical") throw new (0,
|
|
5255
|
+
if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
|
|
5256
5256
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5257
5257
|
try {
|
|
5258
|
-
session.update({ corners:
|
|
5258
|
+
session.update({ corners: _chunkXLUYXUBDcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
|
|
5259
5259
|
return session.commit();
|
|
5260
5260
|
} catch (e) {
|
|
5261
5261
|
session.cancel();
|
|
@@ -5267,16 +5267,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5267
5267
|
* centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
|
|
5268
5268
|
*/
|
|
5269
5269
|
rotateLayer90(turn, init = {}) {
|
|
5270
|
-
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0,
|
|
5270
|
+
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
|
|
5271
5271
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5272
5272
|
try {
|
|
5273
|
-
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(
|
|
5273
|
+
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkXLUYXUBDcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
|
|
5274
5274
|
const cx = b.x + b.width / 2;
|
|
5275
5275
|
const cy = b.y + b.height / 2;
|
|
5276
5276
|
const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
|
|
5277
5277
|
const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
|
|
5278
5278
|
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];
|
|
5279
|
-
session.update({ corners: session.startGeometry.corners.map((p) =>
|
|
5279
|
+
session.update({ corners: session.startGeometry.corners.map((p) => _chunkORE334I6cjs.applyMatrix.call(void 0, m, p)) }, false);
|
|
5280
5280
|
return session.commit();
|
|
5281
5281
|
} catch (e) {
|
|
5282
5282
|
session.cancel();
|
|
@@ -5285,20 +5285,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5285
5285
|
}
|
|
5286
5286
|
/** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
|
|
5287
5287
|
addLayerFilter(id, filter) {
|
|
5288
|
-
const f =
|
|
5289
|
-
const next =
|
|
5288
|
+
const f = _chunkXLUYXUBDcjs.normalizeFilter.call(void 0, filter);
|
|
5289
|
+
const next = _chunkXLUYXUBDcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
|
|
5290
5290
|
this.commitLayers(next);
|
|
5291
5291
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5292
5292
|
}
|
|
5293
5293
|
/** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
|
|
5294
5294
|
updateLayerFilter(id, filterId, changes, commitToHistory = true) {
|
|
5295
|
-
const next =
|
|
5295
|
+
const next = _chunkXLUYXUBDcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
|
|
5296
5296
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5297
5297
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5298
5298
|
}
|
|
5299
5299
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
5300
5300
|
removeLayerFilter(id, filterId) {
|
|
5301
|
-
const next =
|
|
5301
|
+
const next = _chunkXLUYXUBDcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
|
|
5302
5302
|
this.commitLayers(next);
|
|
5303
5303
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5304
5304
|
}
|
|
@@ -5314,8 +5314,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5314
5314
|
*/
|
|
5315
5315
|
convertToSmartObject(ids, options = {}) {
|
|
5316
5316
|
const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
|
|
5317
|
-
if (!list.length) throw new (0,
|
|
5318
|
-
const res =
|
|
5317
|
+
if (!list.length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
|
|
5318
|
+
const res = _chunkXLUYXUBDcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
|
|
5319
5319
|
this.commitLayers(res.layers, () => {
|
|
5320
5320
|
this.state.activeLayerId = res.layer.id;
|
|
5321
5321
|
this.state.activeTarget = "pixels";
|
|
@@ -5324,7 +5324,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5324
5324
|
}
|
|
5325
5325
|
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
5326
5326
|
rasterizeSmartObject(id) {
|
|
5327
|
-
const res =
|
|
5327
|
+
const res = _chunkXLUYXUBDcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
|
|
5328
5328
|
this.commitLayers(res.layers, () => {
|
|
5329
5329
|
if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
5330
5330
|
});
|
|
@@ -5332,10 +5332,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5332
5332
|
}
|
|
5333
5333
|
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
5334
5334
|
getSmartObject(id) {
|
|
5335
|
-
const layer =
|
|
5335
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5336
5336
|
const c = layer.contents;
|
|
5337
|
-
const g =
|
|
5338
|
-
const readout =
|
|
5337
|
+
const g = _chunkXLUYXUBDcjs.placementGeometry.call(void 0, layer);
|
|
5338
|
+
const readout = _chunkXLUYXUBDcjs.describeTransform.call(void 0, g);
|
|
5339
5339
|
const stack = layer.smartFilters;
|
|
5340
5340
|
return {
|
|
5341
5341
|
layerId: layer.id,
|
|
@@ -5345,10 +5345,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5345
5345
|
kind: c.kind,
|
|
5346
5346
|
width: c.width,
|
|
5347
5347
|
height: c.height,
|
|
5348
|
-
decoded:
|
|
5348
|
+
decoded: _chunkXLUYXUBDcjs.isContentsDecoded.call(void 0, c),
|
|
5349
5349
|
fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
|
|
5350
5350
|
linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
|
|
5351
|
-
instances:
|
|
5351
|
+
instances: _chunkXLUYXUBDcjs.instancesOf.call(void 0, this.state.layers, c.id),
|
|
5352
5352
|
layerCount: c.document ? _chunkMZXQTKUMcjs.flattenLayers.call(void 0, c.document.layers).length : 0
|
|
5353
5353
|
},
|
|
5354
5354
|
placement: {
|
|
@@ -5360,8 +5360,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5360
5360
|
scaleY: readout.scaleY,
|
|
5361
5361
|
rotate: readout.rotate,
|
|
5362
5362
|
skewX: readout.skewX,
|
|
5363
|
-
center:
|
|
5364
|
-
bounds:
|
|
5363
|
+
center: _chunkXLUYXUBDcjs.anchorPoint.call(void 0, g, "center"),
|
|
5364
|
+
bounds: _chunkXLUYXUBDcjs.transformedBox.call(void 0, g)
|
|
5365
5365
|
},
|
|
5366
5366
|
smartFilters: {
|
|
5367
5367
|
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
|
|
@@ -5378,7 +5378,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5378
5378
|
* change. Returns the new placement summary.
|
|
5379
5379
|
*/
|
|
5380
5380
|
setSmartObjectPlacement(id, placement, commitToHistory = true) {
|
|
5381
|
-
const res =
|
|
5381
|
+
const res = _chunkXLUYXUBDcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
|
|
5382
5382
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5383
5383
|
return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
|
|
5384
5384
|
}
|
|
@@ -5391,23 +5391,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
5391
5391
|
* nothing is relative to the current transform.
|
|
5392
5392
|
*/
|
|
5393
5393
|
setSmartObjectTransform(id, spec) {
|
|
5394
|
-
const layer =
|
|
5395
|
-
const g =
|
|
5394
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5395
|
+
const g = _chunkXLUYXUBDcjs.placementGeometry.call(void 0, layer);
|
|
5396
5396
|
const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
|
|
5397
5397
|
const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
|
|
5398
|
-
if (ways > 1) throw new (0,
|
|
5398
|
+
if (ways > 1) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
|
|
5399
5399
|
let corners = g.corners;
|
|
5400
5400
|
if (spec.corners) corners = spec.corners;
|
|
5401
5401
|
else if (spec.matrix) {
|
|
5402
|
-
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0,
|
|
5402
|
+
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkXLUYXUBDcjs.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).");
|
|
5403
5403
|
const [a, b, c, d] = spec.matrix;
|
|
5404
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5405
|
-
corners =
|
|
5404
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5405
|
+
corners = _chunkXLUYXUBDcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
|
|
5406
5406
|
} else if (numeric.length) {
|
|
5407
|
-
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0,
|
|
5408
|
-
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0,
|
|
5409
|
-
const now =
|
|
5410
|
-
const centre =
|
|
5407
|
+
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
|
|
5408
|
+
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`${k} must be a finite number.`);
|
|
5409
|
+
const now = _chunkXLUYXUBDcjs.describeTransform.call(void 0, g);
|
|
5410
|
+
const centre = _chunkXLUYXUBDcjs.anchorPoint.call(void 0, g, "center");
|
|
5411
5411
|
const params = {
|
|
5412
5412
|
scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
|
|
5413
5413
|
scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
|
|
@@ -5415,20 +5415,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5415
5415
|
skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
|
|
5416
5416
|
skewY: _nullishCoalesce(spec.skewY, () => ( 0))
|
|
5417
5417
|
};
|
|
5418
|
-
const m =
|
|
5418
|
+
const m = _chunkXLUYXUBDcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
|
|
5419
5419
|
const cx = g.box.width / 2;
|
|
5420
5420
|
const cy = g.box.height / 2;
|
|
5421
5421
|
const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
|
|
5422
|
-
corners =
|
|
5422
|
+
corners = _chunkXLUYXUBDcjs.cornersFromMatrix.call(void 0, g.box, _chunkORE334I6cjs.multiplyMatrices.call(void 0, m, _chunkORE334I6cjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
|
|
5423
5423
|
}
|
|
5424
5424
|
let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
|
|
5425
5425
|
if (spec.warp === null) warp = null;
|
|
5426
5426
|
else if (spec.warp) {
|
|
5427
5427
|
if ("style" in spec.warp) {
|
|
5428
|
-
if (!
|
|
5429
|
-
warp =
|
|
5428
|
+
if (!_chunkORE334I6cjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkORE334I6cjs.WARP_STYLES.join(", ")}.`);
|
|
5429
|
+
warp = _chunkXLUYXUBDcjs.presetWarp.call(void 0, g.box, spec.warp);
|
|
5430
5430
|
} else {
|
|
5431
|
-
if (!
|
|
5431
|
+
if (!_chunkXLUYXUBDcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkXLUYXUBDcjs.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.");
|
|
5432
5432
|
warp = spec.warp;
|
|
5433
5433
|
}
|
|
5434
5434
|
}
|
|
@@ -5442,16 +5442,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5442
5442
|
* the layers that changed.
|
|
5443
5443
|
*/
|
|
5444
5444
|
replaceSmartObjectContents(id, source) {
|
|
5445
|
-
const layer =
|
|
5445
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5446
5446
|
let contents;
|
|
5447
5447
|
if ("contents" in source) contents = source.contents;
|
|
5448
|
-
else if ("pixels" in source) contents =
|
|
5448
|
+
else if ("pixels" in source) contents = _chunkXLUYXUBDcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
|
|
5449
5449
|
else {
|
|
5450
|
-
const psd =
|
|
5451
|
-
contents =
|
|
5450
|
+
const psd = _chunkXLUYXUBDcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkXLUYXUBDcjs.newLayerId.call(void 0, ) });
|
|
5451
|
+
contents = _chunkXLUYXUBDcjs.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`)));
|
|
5452
5452
|
contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
|
|
5453
5453
|
}
|
|
5454
|
-
const res =
|
|
5454
|
+
const res = _chunkXLUYXUBDcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
|
|
5455
5455
|
this.commitLayers(res.layers);
|
|
5456
5456
|
return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
|
|
5457
5457
|
}
|
|
@@ -5466,16 +5466,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5466
5466
|
* and bytes.
|
|
5467
5467
|
*/
|
|
5468
5468
|
exportSmartObjectContents(id) {
|
|
5469
|
-
const layer =
|
|
5469
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5470
5470
|
const c = layer.contents;
|
|
5471
5471
|
const base = c.name.replace(/\.\w+$/, "") || "Contents";
|
|
5472
5472
|
if (c.file) {
|
|
5473
|
-
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ...
|
|
5473
|
+
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkXLUYXUBDcjs.BROWSER_IMAGE_TYPES };
|
|
5474
5474
|
const ext = c.file.type.toLowerCase();
|
|
5475
5475
|
return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
|
|
5476
5476
|
}
|
|
5477
|
-
if (!
|
|
5478
|
-
const f =
|
|
5477
|
+
if (!_chunkXLUYXUBDcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
|
|
5478
|
+
const f = _chunkXLUYXUBDcjs.smartContentsFile.call(void 0, c);
|
|
5479
5479
|
return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
|
|
5480
5480
|
}
|
|
5481
5481
|
/**
|
|
@@ -5484,7 +5484,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5484
5484
|
* undo step. Returns the copy's id.
|
|
5485
5485
|
*/
|
|
5486
5486
|
copySmartObject(id, linked = false, name) {
|
|
5487
|
-
const res =
|
|
5487
|
+
const res = _chunkXLUYXUBDcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
|
|
5488
5488
|
this.commitLayers(res.layers, () => {
|
|
5489
5489
|
this.state.activeLayerId = res.layer.id;
|
|
5490
5490
|
this.state.activeTarget = "pixels";
|
|
@@ -5493,31 +5493,31 @@ var ImageEditorController = (_class7 = class {
|
|
|
5493
5493
|
}
|
|
5494
5494
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
5495
5495
|
addSmartFilter(id, filter, index) {
|
|
5496
|
-
const res =
|
|
5496
|
+
const res = _chunkXLUYXUBDcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkXLUYXUBDcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
|
|
5497
5497
|
this.commitLayers(res.layers);
|
|
5498
5498
|
return res.filter;
|
|
5499
5499
|
}
|
|
5500
5500
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
5501
5501
|
updateSmartFilter(id, filterId, changes, commitToHistory = true) {
|
|
5502
|
-
const res =
|
|
5502
|
+
const res = _chunkXLUYXUBDcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
|
|
5503
5503
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5504
5504
|
return res.filter;
|
|
5505
5505
|
}
|
|
5506
5506
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
5507
5507
|
removeSmartFilter(id, filterId) {
|
|
5508
|
-
const res =
|
|
5508
|
+
const res = _chunkXLUYXUBDcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
|
|
5509
5509
|
this.commitLayers(res.layers);
|
|
5510
5510
|
return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
|
|
5511
5511
|
}
|
|
5512
5512
|
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
5513
5513
|
moveSmartFilter(id, filterId, index) {
|
|
5514
|
-
const res =
|
|
5514
|
+
const res = _chunkXLUYXUBDcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
|
|
5515
5515
|
this.commitLayers(res.layers);
|
|
5516
5516
|
return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
|
|
5517
5517
|
}
|
|
5518
5518
|
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
5519
5519
|
setSmartFiltersEnabled(id, enabled) {
|
|
5520
|
-
const res =
|
|
5520
|
+
const res = _chunkXLUYXUBDcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
|
|
5521
5521
|
this.commitLayers(res.layers);
|
|
5522
5522
|
return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
|
|
5523
5523
|
}
|
|
@@ -5527,21 +5527,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
5527
5527
|
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
5528
5528
|
*/
|
|
5529
5529
|
setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
|
|
5530
|
-
const layer =
|
|
5530
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5531
5531
|
let mask;
|
|
5532
5532
|
if (from === "none") mask = null;
|
|
5533
5533
|
else if (from === "keep") {
|
|
5534
|
-
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0,
|
|
5534
|
+
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
|
|
5535
5535
|
mask = withMaskProps(layer.smartFilters.mask, props);
|
|
5536
5536
|
} else if (from === "selection") {
|
|
5537
5537
|
const sel = this.state.selection;
|
|
5538
|
-
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0,
|
|
5538
|
+
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5539
5539
|
mask = this.maskFromSelection(sel, props);
|
|
5540
5540
|
} else {
|
|
5541
5541
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5542
5542
|
mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5543
5543
|
}
|
|
5544
|
-
const res =
|
|
5544
|
+
const res = _chunkXLUYXUBDcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
|
|
5545
5545
|
this.commitLayers(res.layers, () => {
|
|
5546
5546
|
if (this.state.activeLayerId !== id) return;
|
|
5547
5547
|
if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
|
|
@@ -5557,14 +5557,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
5557
5557
|
async prepareSmartObjects() {
|
|
5558
5558
|
const pending = /* @__PURE__ */ new Map();
|
|
5559
5559
|
for (const l of _chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers)) {
|
|
5560
|
-
if (l.type === "smart" && !
|
|
5560
|
+
if (l.type === "smart" && !_chunkXLUYXUBDcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkXLUYXUBDcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
|
|
5561
5561
|
}
|
|
5562
5562
|
const left = [];
|
|
5563
5563
|
for (const [cid, c] of pending) {
|
|
5564
5564
|
try {
|
|
5565
|
-
const url = `data:${
|
|
5565
|
+
const url = `data:${_chunkXLUYXUBDcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes)}`;
|
|
5566
5566
|
const px2 = await this.decodeImage(url);
|
|
5567
|
-
const decoded = { ...c, kind: "raster", raster:
|
|
5567
|
+
const decoded = { ...c, kind: "raster", raster: _chunkXLUYXUBDcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
|
|
5568
5568
|
const swap = (layers) => {
|
|
5569
5569
|
let out = layers;
|
|
5570
5570
|
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 }));
|
|
@@ -5592,10 +5592,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5592
5592
|
* Contents can nest. Returns the contents' size and layer ids.
|
|
5593
5593
|
*/
|
|
5594
5594
|
editSmartObjectContents(id) {
|
|
5595
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5596
|
-
const layer =
|
|
5595
|
+
if (this.getFreeTransform()) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
|
|
5596
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5597
5597
|
const c = layer.contents;
|
|
5598
|
-
if (!
|
|
5598
|
+
if (!_chunkXLUYXUBDcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkXLUYXUBDcjs.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.`);
|
|
5599
5599
|
const saved = {
|
|
5600
5600
|
state: { ...this.state },
|
|
5601
5601
|
undo: this.undoStack,
|
|
@@ -5606,7 +5606,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5606
5606
|
samplePixelsOverride: this.samplePixelsOverride,
|
|
5607
5607
|
psdResolution: this.psdResolution
|
|
5608
5608
|
};
|
|
5609
|
-
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id:
|
|
5609
|
+
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkXLUYXUBDcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
|
|
5610
5610
|
this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
|
|
5611
5611
|
const s = this.state;
|
|
5612
5612
|
this.state = {
|
|
@@ -5614,7 +5614,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5614
5614
|
sourceUrl: null,
|
|
5615
5615
|
imageDimensions: { width: c.width, height: c.height },
|
|
5616
5616
|
crop: null,
|
|
5617
|
-
transform: { ...
|
|
5617
|
+
transform: { ..._chunkXLUYXUBDcjs.DEFAULT_TRANSFORM_VALUES },
|
|
5618
5618
|
layers,
|
|
5619
5619
|
activeLayerId: layers.length ? layers[layers.length - 1].id : null,
|
|
5620
5620
|
activeTarget: "pixels",
|
|
@@ -5647,7 +5647,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5647
5647
|
*/
|
|
5648
5648
|
closeSmartObjectContents(save = true) {
|
|
5649
5649
|
const top = this.contentsStack.pop();
|
|
5650
|
-
if (!top) throw new (0,
|
|
5650
|
+
if (!top) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
|
|
5651
5651
|
if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
|
|
5652
5652
|
this.openTransform = null;
|
|
5653
5653
|
const edited = this.state;
|
|
@@ -5661,10 +5661,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5661
5661
|
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";
|
|
5662
5662
|
if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
|
|
5663
5663
|
const px2 = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
|
|
5664
|
-
next =
|
|
5664
|
+
next = _chunkXLUYXUBDcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
|
|
5665
5665
|
} else {
|
|
5666
5666
|
const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
|
|
5667
|
-
next =
|
|
5667
|
+
next = _chunkXLUYXUBDcjs.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);
|
|
5668
5668
|
}
|
|
5669
5669
|
}
|
|
5670
5670
|
const saved = top.saved;
|
|
@@ -5683,7 +5683,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5683
5683
|
this.notify();
|
|
5684
5684
|
return { layerId: top.layerId, changed: false, layerIds: [] };
|
|
5685
5685
|
}
|
|
5686
|
-
const res =
|
|
5686
|
+
const res = _chunkXLUYXUBDcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
|
|
5687
5687
|
this.commitLayers(res.layers);
|
|
5688
5688
|
return { layerId: top.layerId, changed: true, layerIds: res.ids };
|
|
5689
5689
|
}
|
|
@@ -5698,35 +5698,35 @@ var ImageEditorController = (_class7 = class {
|
|
|
5698
5698
|
// --- Layer effects ---
|
|
5699
5699
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
5700
5700
|
getLayerEffects(id) {
|
|
5701
|
-
return
|
|
5701
|
+
return _chunkXLUYXUBDcjs.layerEffectsOf.call(void 0, _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer);
|
|
5702
5702
|
}
|
|
5703
5703
|
/**
|
|
5704
5704
|
* Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
|
|
5705
5705
|
* `index` in the layer's effect list (default the end). Returns the new effect and the effects.
|
|
5706
5706
|
*/
|
|
5707
5707
|
addLayerEffect(id, kind, params = {}, index) {
|
|
5708
|
-
const res =
|
|
5708
|
+
const res = _chunkXLUYXUBDcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
|
|
5709
5709
|
this.commitLayers(res.layers);
|
|
5710
5710
|
return { effect: res.effect, effects: this.getLayerEffects(id) };
|
|
5711
5711
|
}
|
|
5712
5712
|
/** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
|
|
5713
5713
|
updateLayerEffect(id, effectId, changes, commitToHistory = true) {
|
|
5714
|
-
this.commitLayers(
|
|
5714
|
+
this.commitLayers(_chunkXLUYXUBDcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
|
|
5715
5715
|
return this.getLayerEffects(id);
|
|
5716
5716
|
}
|
|
5717
5717
|
/** Removes one effect (one undo step). Returns the remaining effects. */
|
|
5718
5718
|
removeLayerEffect(id, effectId) {
|
|
5719
|
-
this.commitLayers(
|
|
5719
|
+
this.commitLayers(_chunkXLUYXUBDcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
|
|
5720
5720
|
return this.getLayerEffects(id);
|
|
5721
5721
|
}
|
|
5722
5722
|
/** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
|
|
5723
5723
|
setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
|
|
5724
|
-
this.commitLayers(
|
|
5724
|
+
this.commitLayers(_chunkXLUYXUBDcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
|
|
5725
5725
|
return this.getLayerEffects(id);
|
|
5726
5726
|
}
|
|
5727
5727
|
/** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
|
|
5728
5728
|
setLayerEffects(id, effects, commitToHistory = true) {
|
|
5729
|
-
this.commitLayers(
|
|
5729
|
+
this.commitLayers(_chunkXLUYXUBDcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
|
|
5730
5730
|
return this.getLayerEffects(id);
|
|
5731
5731
|
}
|
|
5732
5732
|
__init76() {this.patternIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -5752,8 +5752,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5752
5752
|
/** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
|
|
5753
5753
|
setGlobalLight(light, commitToHistory = true) {
|
|
5754
5754
|
const next = { ...this.getGlobalLight(), ...light };
|
|
5755
|
-
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0,
|
|
5756
|
-
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0,
|
|
5755
|
+
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
|
|
5756
|
+
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
|
|
5757
5757
|
if (commitToHistory) this.recordHistory();
|
|
5758
5758
|
if (next.angle === _chunkMZXQTKUMcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkMZXQTKUMcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
|
|
5759
5759
|
else this.state.globalLight = next;
|
|
@@ -5764,16 +5764,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5764
5764
|
async compositeToSurface(layers, rect) {
|
|
5765
5765
|
const { width, height } = this.naturalSize;
|
|
5766
5766
|
if (_chunkMZXQTKUMcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
|
|
5767
|
-
throw new (0,
|
|
5767
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
|
|
5768
5768
|
}
|
|
5769
5769
|
await this.renderer.prepareLayerAssets(layers, width, height);
|
|
5770
5770
|
const sources = this.renderer.compositorSources(width, height);
|
|
5771
5771
|
const depth = this.bitDepth;
|
|
5772
5772
|
if (depth !== 8) {
|
|
5773
|
-
const samples = _chunkMZXQTKUMcjs.workingToSamples.call(void 0,
|
|
5773
|
+
const samples = _chunkMZXQTKUMcjs.workingToSamples.call(void 0, _chunkXLUYXUBDcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
|
|
5774
5774
|
return _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
|
|
5775
5775
|
}
|
|
5776
|
-
const data = new (0,
|
|
5776
|
+
const data = new (0, _chunkXLUYXUBDcjs.LayerCompositor)().composite(layers, rect, sources);
|
|
5777
5777
|
return _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
|
|
5778
5778
|
}
|
|
5779
5779
|
/**
|
|
@@ -5786,22 +5786,22 @@ var ImageEditorController = (_class7 = class {
|
|
|
5786
5786
|
const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
|
|
5787
5787
|
const depth = this.bitDepth;
|
|
5788
5788
|
if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkJ5BA3BQ6cjs.to16From8.call(void 0, this.compositePixels(r).data) };
|
|
5789
|
-
const data = _chunkMZXQTKUMcjs.workingToSamples.call(void 0,
|
|
5789
|
+
const data = _chunkMZXQTKUMcjs.workingToSamples.call(void 0, _chunkXLUYXUBDcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
|
|
5790
5790
|
return { width: r.width, height: r.height, depth, data };
|
|
5791
5791
|
}
|
|
5792
5792
|
/** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
|
|
5793
5793
|
paintBounds(layer) {
|
|
5794
5794
|
const { width, height } = this.naturalSize;
|
|
5795
5795
|
const canvas = { x: 0, y: 0, width, height };
|
|
5796
|
-
if (
|
|
5796
|
+
if (_chunkXLUYXUBDcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
5797
5797
|
if (layer.type === "annotation") {
|
|
5798
|
-
const b =
|
|
5798
|
+
const b = _chunkXLUYXUBDcjs.getAnnotationBounds.call(void 0, layer.annotation);
|
|
5799
5799
|
const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
|
|
5800
5800
|
return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
|
|
5801
5801
|
}
|
|
5802
5802
|
if (layer.type === "group") {
|
|
5803
5803
|
let r = null;
|
|
5804
|
-
for (const c of layer.children) r =
|
|
5804
|
+
for (const c of layer.children) r = _chunkXLUYXUBDcjs.unionRect.call(void 0, r, this.paintBounds(c));
|
|
5805
5805
|
return _nullishCoalesce(r, () => ( canvas));
|
|
5806
5806
|
}
|
|
5807
5807
|
return canvas;
|
|
@@ -5812,16 +5812,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5812
5812
|
* Returns the merged id.
|
|
5813
5813
|
*/
|
|
5814
5814
|
async mergeDown(id) {
|
|
5815
|
-
const loc =
|
|
5815
|
+
const loc = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5816
5816
|
const upper = loc.layer;
|
|
5817
5817
|
const siblings = loc.parent ? loc.parent.children : this.state.layers;
|
|
5818
5818
|
const lower = siblings[loc.index - 1];
|
|
5819
|
-
if (!lower) throw new (0,
|
|
5820
|
-
if (lower.type !== "pixel") throw new (0,
|
|
5821
|
-
if (!upper.visible) throw new (0,
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
let rect = _nullishCoalesce(
|
|
5819
|
+
if (!lower) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
|
|
5820
|
+
if (lower.type !== "pixel") throw new (0, _chunkXLUYXUBDcjs.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.`);
|
|
5821
|
+
if (!upper.visible) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
|
|
5822
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
|
|
5823
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
|
|
5824
|
+
let rect = _nullishCoalesce(_chunkXLUYXUBDcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
|
|
5825
5825
|
const reach = Math.max(_chunkMZXQTKUMcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkMZXQTKUMcjs.effectsMargin.call(void 0, upper.effects));
|
|
5826
5826
|
if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
|
|
5827
5827
|
const base = { ...lower, blend: "normal", opacity: 1 };
|
|
@@ -5847,12 +5847,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
5847
5847
|
*/
|
|
5848
5848
|
async mergeVisible() {
|
|
5849
5849
|
const visible = this.state.layers.filter((l) => l.visible);
|
|
5850
|
-
if (!visible.length) throw new (0,
|
|
5850
|
+
if (!visible.length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("No layer is visible.");
|
|
5851
5851
|
const { width, height } = this.naturalSize;
|
|
5852
5852
|
const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
|
|
5853
5853
|
const merged = {
|
|
5854
5854
|
type: "pixel",
|
|
5855
|
-
id:
|
|
5855
|
+
id: _chunkXLUYXUBDcjs.newLayerId.call(void 0, ),
|
|
5856
5856
|
name: "Merged",
|
|
5857
5857
|
visible: true,
|
|
5858
5858
|
opacity: 1,
|
|
@@ -5876,8 +5876,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5876
5876
|
const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
|
|
5877
5877
|
const bg = {
|
|
5878
5878
|
type: "pixel",
|
|
5879
|
-
id:
|
|
5880
|
-
name:
|
|
5879
|
+
id: _chunkXLUYXUBDcjs.BACKGROUND_LAYER_ID,
|
|
5880
|
+
name: _chunkXLUYXUBDcjs.BACKGROUND_LAYER_NAME,
|
|
5881
5881
|
visible: true,
|
|
5882
5882
|
opacity: 1,
|
|
5883
5883
|
blend: "normal",
|
|
@@ -5904,7 +5904,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5904
5904
|
const k = Math.min(1, side / Math.max(width, height));
|
|
5905
5905
|
const tw = Math.max(1, Math.round(width * k));
|
|
5906
5906
|
const th = Math.max(1, Math.round(height * k));
|
|
5907
|
-
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null :
|
|
5907
|
+
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkXLUYXUBDcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
|
|
5908
5908
|
if (!surface) return null;
|
|
5909
5909
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
5910
5910
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
@@ -5999,7 +5999,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5999
5999
|
* pixels. The next stroke fixes the offset from its first point. View state, no undo.
|
|
6000
6000
|
*/
|
|
6001
6001
|
setCloneSource(point) {
|
|
6002
|
-
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0,
|
|
6002
|
+
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
|
|
6003
6003
|
const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
|
|
6004
6004
|
this.state.paint = { ...this.state.paint, cloneSource: source };
|
|
6005
6005
|
this.notify();
|
|
@@ -6017,27 +6017,27 @@ var ImageEditorController = (_class7 = class {
|
|
|
6017
6017
|
/** Resolves and validates what a stroke, fill or clear paints into. */
|
|
6018
6018
|
paintTarget(layerId, channel, action) {
|
|
6019
6019
|
const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
|
|
6020
|
-
if (!id) throw new (0,
|
|
6021
|
-
const layer =
|
|
6020
|
+
if (!id) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
|
|
6021
|
+
const layer = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
6022
6022
|
const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
|
|
6023
6023
|
if (ch === "mask") {
|
|
6024
|
-
if (!layer.mask) throw new (0,
|
|
6025
|
-
if (layer.mask.source) throw new (0,
|
|
6026
|
-
|
|
6024
|
+
if (!layer.mask) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
|
|
6025
|
+
if (layer.mask.source) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
|
|
6026
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6027
6027
|
} else if (ch === "filter-mask") {
|
|
6028
6028
|
if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
|
|
6029
|
-
throw new (0,
|
|
6029
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
|
|
6030
6030
|
}
|
|
6031
|
-
if (!
|
|
6032
|
-
|
|
6031
|
+
if (!_chunkXLUYXUBDcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
|
|
6032
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6033
6033
|
} else {
|
|
6034
|
-
if (layer.type === "smart") throw new (0,
|
|
6035
|
-
if (layer.type === "shape") throw new (0,
|
|
6036
|
-
if (layer.type === "type") throw new (0,
|
|
6037
|
-
if (layer.type !== "pixel") throw new (0,
|
|
6038
|
-
|
|
6034
|
+
if (layer.type === "smart") throw new (0, _chunkXLUYXUBDcjs.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.`);
|
|
6035
|
+
if (layer.type === "shape") throw new (0, _chunkXLUYXUBDcjs.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).`);
|
|
6036
|
+
if (layer.type === "type") throw new (0, _chunkXLUYXUBDcjs.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).`);
|
|
6037
|
+
if (layer.type !== "pixel") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
|
|
6038
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "pixels", action);
|
|
6039
6039
|
}
|
|
6040
|
-
if (!layer.visible) throw new (0,
|
|
6040
|
+
if (!layer.visible) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
|
|
6041
6041
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
6042
6042
|
const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
|
|
6043
6043
|
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
|
|
@@ -6046,7 +6046,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6046
6046
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
6047
6047
|
withSurface(layer, channel, surface) {
|
|
6048
6048
|
if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
|
|
6049
|
-
if (channel === "filter-mask") return
|
|
6049
|
+
if (channel === "filter-mask") return _chunkXLUYXUBDcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
|
|
6050
6050
|
const next = { ...layer, surface };
|
|
6051
6051
|
delete next.source;
|
|
6052
6052
|
return next;
|
|
@@ -6059,10 +6059,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6059
6059
|
*/
|
|
6060
6060
|
beginStroke(init = {}) {
|
|
6061
6061
|
const tool = _nullishCoalesce(init.tool, () => ( "brush"));
|
|
6062
|
-
if (!STROKE_TOOLS.includes(tool)) throw new (0,
|
|
6062
|
+
if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
|
|
6063
6063
|
const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
|
|
6064
6064
|
if (tool === "mixer" && target.channel !== "pixels") {
|
|
6065
|
-
throw new (0,
|
|
6065
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
|
|
6066
6066
|
}
|
|
6067
6067
|
const brush = _chunk6GFRKLLScjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
|
|
6068
6068
|
let strokePaint = null;
|
|
@@ -6096,7 +6096,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6096
6096
|
retouchStroke(tool, init, brush, target, apply) {
|
|
6097
6097
|
const settings = _chunkW6M7C7R3cjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
|
|
6098
6098
|
const mask = target.channel !== "pixels";
|
|
6099
|
-
if (tool === "sponge" && mask) throw new (0,
|
|
6099
|
+
if (tool === "sponge" && mask) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
|
|
6100
6100
|
if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkW6M7C7R3cjs.RetouchDabStroke)(brush, pixels, _chunkW6M7C7R3cjs.smudgeEffect.call(void 0, brush, settings.strength)) };
|
|
6101
6101
|
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)) };
|
|
6102
6102
|
const retouchApply = {
|
|
@@ -6149,7 +6149,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6149
6149
|
}
|
|
6150
6150
|
if (init.source) this.setCloneSource(init.source);
|
|
6151
6151
|
const cs = this.state.paint.cloneSource;
|
|
6152
|
-
if (!cs) throw new (0,
|
|
6152
|
+
if (!cs) throw new (0, _chunkXLUYXUBDcjs.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 }.`);
|
|
6153
6153
|
let offset = { x: 0, y: 0 };
|
|
6154
6154
|
let first = { x: 0, y: 0 };
|
|
6155
6155
|
const paint = () => ({ kind: "source", source, dx: offset.x, dy: offset.y });
|
|
@@ -6184,7 +6184,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6184
6184
|
const sources = this.compositorSources();
|
|
6185
6185
|
if (depth) {
|
|
6186
6186
|
return new (0, _chunkW6M7C7R3cjs.TilePixelSource)((tx, ty) => {
|
|
6187
|
-
const w =
|
|
6187
|
+
const w = _chunkXLUYXUBDcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkJ5BA3BQ6cjs.TILE, y: ty * _chunkJ5BA3BQ6cjs.TILE, width: _chunkJ5BA3BQ6cjs.TILE, height: _chunkJ5BA3BQ6cjs.TILE }, sources, depth);
|
|
6188
6188
|
for (let i = 0; i < w.length; i += 4) {
|
|
6189
6189
|
if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkJ5BA3BQ6cjs.srgbEncode.call(void 0, w[i + c]);
|
|
6190
6190
|
for (let c = 0; c < 4; c++) w[i + c] *= 255;
|
|
@@ -6192,7 +6192,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6192
6192
|
return w;
|
|
6193
6193
|
}, 4);
|
|
6194
6194
|
}
|
|
6195
|
-
const compositor = new (0,
|
|
6195
|
+
const compositor = new (0, _chunkXLUYXUBDcjs.LayerCompositor)();
|
|
6196
6196
|
return new (0, _chunkW6M7C7R3cjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
|
|
6197
6197
|
}
|
|
6198
6198
|
/** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
|
|
@@ -6242,9 +6242,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6242
6242
|
* document bounds and the number of dabs.
|
|
6243
6243
|
*/
|
|
6244
6244
|
paintStroke(init) {
|
|
6245
|
-
if (!Array.isArray(init.points) || !init.points.length) throw new (0,
|
|
6245
|
+
if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("points must hold at least one { x, y } point.");
|
|
6246
6246
|
for (const p of init.points) {
|
|
6247
|
-
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _236 => _236.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _237 => _237.y]))) throw new (0,
|
|
6247
|
+
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _236 => _236.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _237 => _237.y]))) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
|
|
6248
6248
|
}
|
|
6249
6249
|
const session = this.beginStroke(init);
|
|
6250
6250
|
session.push(init.points);
|
|
@@ -6270,8 +6270,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6270
6270
|
const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
|
|
6271
6271
|
const { width, height } = this.naturalSize;
|
|
6272
6272
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
6273
|
-
if (!(opacity >= 0 && opacity <= 1)) throw new (0,
|
|
6274
|
-
const blend = _nullishCoalesce(
|
|
6273
|
+
if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
6274
|
+
const blend = _nullishCoalesce(_chunkXLUYXUBDcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
|
|
6275
6275
|
const sel = options.useSelection !== false && _optionalChain([this, 'access', _238 => _238.state, 'access', _239 => _239.selection, 'optionalAccess', _240 => _240.bounds]) ? this.state.selection : null;
|
|
6276
6276
|
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _241 => _241.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
6277
6277
|
const coverage = new (0, _chunk6GFRKLLScjs.CoverageMap)();
|
|
@@ -6307,7 +6307,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6307
6307
|
// --- Adjustments ---
|
|
6308
6308
|
/** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
|
|
6309
6309
|
developLayer() {
|
|
6310
|
-
return
|
|
6310
|
+
return _chunkXLUYXUBDcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
|
|
6311
6311
|
}
|
|
6312
6312
|
/**
|
|
6313
6313
|
* Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
|
|
@@ -6333,7 +6333,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6333
6333
|
this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
|
|
6334
6334
|
}
|
|
6335
6335
|
if ("layers" in partial) {
|
|
6336
|
-
layers = this.replaceAdjustmentNodes(layers,
|
|
6336
|
+
layers = this.replaceAdjustmentNodes(layers, _chunkXLUYXUBDcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
|
|
6337
6337
|
}
|
|
6338
6338
|
this.state.layers = layers;
|
|
6339
6339
|
this.notify();
|
|
@@ -6341,7 +6341,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6341
6341
|
/** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
|
|
6342
6342
|
get isProcessOutdated() {
|
|
6343
6343
|
this.syncViews();
|
|
6344
|
-
return
|
|
6344
|
+
return _chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkXLUYXUBDcjs.LATEST_PROCESS_VERSION;
|
|
6345
6345
|
}
|
|
6346
6346
|
/**
|
|
6347
6347
|
* Update to Current Process: re-interprets the current adjustment values with the latest
|
|
@@ -6349,7 +6349,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6349
6349
|
*/
|
|
6350
6350
|
upgradeProcess() {
|
|
6351
6351
|
if (!this.isProcessOutdated) return false;
|
|
6352
|
-
this.setAdjustments({ process:
|
|
6352
|
+
this.setAdjustments({ process: _chunkXLUYXUBDcjs.LATEST_PROCESS_VERSION });
|
|
6353
6353
|
return true;
|
|
6354
6354
|
}
|
|
6355
6355
|
/** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
|
|
@@ -6360,7 +6360,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6360
6360
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0,
|
|
6361
6361
|
this.state.layers,
|
|
6362
6362
|
target.id,
|
|
6363
|
-
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process:
|
|
6363
|
+
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkXLUYXUBDcjs.LATEST_PROCESS_VERSION }), 0)
|
|
6364
6364
|
);
|
|
6365
6365
|
}
|
|
6366
6366
|
delete this.state.legacyOutputBlur;
|
|
@@ -6424,7 +6424,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6424
6424
|
const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
|
|
6425
6425
|
for (const l of next) {
|
|
6426
6426
|
if (existing.has(l.id)) continue;
|
|
6427
|
-
out = this.placeLayer(out,
|
|
6427
|
+
out = this.placeLayer(out, _chunkXLUYXUBDcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
|
|
6428
6428
|
}
|
|
6429
6429
|
const order = next.map((l) => l.id);
|
|
6430
6430
|
for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
|
|
@@ -6439,7 +6439,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6439
6439
|
addAdjustmentLayer(init, index) {
|
|
6440
6440
|
const spec = typeof init === "string" ? { kind: init } : init;
|
|
6441
6441
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
6442
|
-
const layer =
|
|
6442
|
+
const layer = _chunkXLUYXUBDcjs.createAdjustmentLayer.call(void 0, spec.kind, {
|
|
6443
6443
|
id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
|
|
6444
6444
|
name: spec.name,
|
|
6445
6445
|
params: spec.params,
|
|
@@ -6448,10 +6448,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6448
6448
|
blend: spec.blend,
|
|
6449
6449
|
mask: _nullishCoalesce(spec.mask, () => ( void 0))
|
|
6450
6450
|
});
|
|
6451
|
-
while (ids.has(layer.id)) layer.id =
|
|
6451
|
+
while (ids.has(layer.id)) layer.id = _chunkXLUYXUBDcjs.newLayerId.call(void 0, "adj");
|
|
6452
6452
|
const { width, height } = this.naturalSize;
|
|
6453
6453
|
this.recordHistory();
|
|
6454
|
-
const node =
|
|
6454
|
+
const node = _chunkXLUYXUBDcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
|
|
6455
6455
|
const positioned = Boolean(spec.aboveId || spec.parentId);
|
|
6456
6456
|
this.state.layers = this.placeLayer(this.state.layers, node, {
|
|
6457
6457
|
aboveId: spec.aboveId,
|
|
@@ -6471,7 +6471,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6471
6471
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
6472
6472
|
const { width, height } = this.naturalSize;
|
|
6473
6473
|
const node = loc.layer;
|
|
6474
|
-
const merged =
|
|
6474
|
+
const merged = _chunkXLUYXUBDcjs.normalizeAdjustmentLayer.call(void 0, {
|
|
6475
6475
|
id: node.id,
|
|
6476
6476
|
kind: node.kind,
|
|
6477
6477
|
enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
|
|
@@ -6491,7 +6491,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6491
6491
|
params: merged.params
|
|
6492
6492
|
};
|
|
6493
6493
|
if (update.mask !== void 0) {
|
|
6494
|
-
const mask = update.mask ?
|
|
6494
|
+
const mask = update.mask ? _chunkXLUYXUBDcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
|
|
6495
6495
|
if (mask) next.mask = mask;
|
|
6496
6496
|
else delete next.mask;
|
|
6497
6497
|
}
|
|
@@ -6578,8 +6578,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6578
6578
|
const { width, height } = this.naturalSize;
|
|
6579
6579
|
let next = null;
|
|
6580
6580
|
if (mask) {
|
|
6581
|
-
const sized = mask.width === width && mask.height === height ? mask :
|
|
6582
|
-
next =
|
|
6581
|
+
const sized = mask.width === width && mask.height === height ? mask : _chunkXLUYXUBDcjs.resizeSelection.call(void 0, mask, width, height);
|
|
6582
|
+
next = _chunkXLUYXUBDcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
|
|
6583
6583
|
} else if (mode !== "replace") {
|
|
6584
6584
|
return false;
|
|
6585
6585
|
}
|
|
@@ -6593,7 +6593,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6593
6593
|
/** Select › All. */
|
|
6594
6594
|
selectAll() {
|
|
6595
6595
|
const { width, height } = this.naturalSize;
|
|
6596
|
-
return this.setSelection(
|
|
6596
|
+
return this.setSelection(_chunkXLUYXUBDcjs.fullSelection.call(void 0, width, height));
|
|
6597
6597
|
}
|
|
6598
6598
|
/** Select › Deselect. */
|
|
6599
6599
|
deselect() {
|
|
@@ -6602,11 +6602,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6602
6602
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
6603
6603
|
invertSelection() {
|
|
6604
6604
|
const { width, height } = this.naturalSize;
|
|
6605
|
-
const current = _nullishCoalesce(this.state.selection, () => (
|
|
6606
|
-
return this.setSelection(
|
|
6605
|
+
const current = _nullishCoalesce(this.state.selection, () => ( _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, width, height)));
|
|
6606
|
+
return this.setSelection(_chunkXLUYXUBDcjs.invertSelection.call(void 0, current));
|
|
6607
6607
|
}
|
|
6608
6608
|
shapeCommand(mask, options) {
|
|
6609
|
-
const shaped = options.feather && options.feather > 0 ?
|
|
6609
|
+
const shaped = options.feather && options.feather > 0 ? _chunkXLUYXUBDcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
|
|
6610
6610
|
return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6611
6611
|
}
|
|
6612
6612
|
/** Rectangular marquee in natural image pixels. */
|
|
@@ -6660,11 +6660,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6660
6660
|
if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
|
|
6661
6661
|
return null;
|
|
6662
6662
|
}
|
|
6663
|
-
const legacy =
|
|
6663
|
+
const legacy = _chunkXLUYXUBDcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
|
|
6664
6664
|
if (options.sample === "active-layer") {
|
|
6665
6665
|
const layer = this.getActiveLayer();
|
|
6666
6666
|
if (!layer || layer.type !== "pixel") {
|
|
6667
|
-
throw new (0,
|
|
6667
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
|
|
6668
6668
|
}
|
|
6669
6669
|
const surface = layer.source === "document" && options.pixels ? _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
|
|
6670
6670
|
return { width, height, data: _chunkJ5BA3BQ6cjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
|
|
@@ -6673,7 +6673,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6673
6673
|
this.syncViews();
|
|
6674
6674
|
if (legacy && !options.pixels) {
|
|
6675
6675
|
const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
|
|
6676
|
-
|
|
6676
|
+
_chunkXLUYXUBDcjs.applyAdjustments.call(void 0, copy, _chunkXLUYXUBDcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
|
|
6677
6677
|
return copy;
|
|
6678
6678
|
}
|
|
6679
6679
|
const pixels = options.pixels;
|
|
@@ -6685,7 +6685,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6685
6685
|
};
|
|
6686
6686
|
const stack = withoutAnnotations(this.state.layers);
|
|
6687
6687
|
const layers = options.sampleMerged ? stack : pixelsOnly(stack);
|
|
6688
|
-
const data = new (0,
|
|
6688
|
+
const data = new (0, _chunkXLUYXUBDcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
|
|
6689
6689
|
return { width, height, data };
|
|
6690
6690
|
}
|
|
6691
6691
|
async requirePixels(options) {
|
|
@@ -6712,7 +6712,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6712
6712
|
modifySelection(op, radius) {
|
|
6713
6713
|
const sel = this.state.selection;
|
|
6714
6714
|
if (!_optionalChain([sel, 'optionalAccess', _255 => _255.bounds])) return false;
|
|
6715
|
-
return this.setSelection(
|
|
6715
|
+
return this.setSelection(_chunkXLUYXUBDcjs.modifySelection.call(void 0, sel, op, radius));
|
|
6716
6716
|
}
|
|
6717
6717
|
/**
|
|
6718
6718
|
* Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
|
|
@@ -6743,7 +6743,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6743
6743
|
} else {
|
|
6744
6744
|
pixels = source;
|
|
6745
6745
|
}
|
|
6746
|
-
this.setSelection(
|
|
6746
|
+
this.setSelection(_chunkXLUYXUBDcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6747
6747
|
return this.getSelection();
|
|
6748
6748
|
}
|
|
6749
6749
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
@@ -6755,7 +6755,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6755
6755
|
// --- Layer masks ---
|
|
6756
6756
|
maskFromSelection(sel, props = {}) {
|
|
6757
6757
|
const { width, height } = this.naturalSize;
|
|
6758
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
6758
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkXLUYXUBDcjs.resizeSelection.call(void 0, sel, width, height);
|
|
6759
6759
|
const mask = { surface: _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
|
|
6760
6760
|
return withMaskProps(mask, props);
|
|
6761
6761
|
}
|
|
@@ -6801,7 +6801,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6801
6801
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
6802
6802
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
6803
6803
|
const data = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
6804
|
-
const sel =
|
|
6804
|
+
const sel = _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
6805
6805
|
return this.setSelection(sel, mode);
|
|
6806
6806
|
}
|
|
6807
6807
|
// --- Histogram ---
|
|
@@ -6831,9 +6831,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6831
6831
|
merged.depthRange = [...merged.depthRange];
|
|
6832
6832
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
6833
6833
|
const next = { ...l };
|
|
6834
|
-
if (
|
|
6834
|
+
if (_chunkXLUYXUBDcjs.isDefaultDepthMask.call(void 0, merged)) {
|
|
6835
6835
|
if (_optionalChain([next, 'access', _261 => _261.mask, 'optionalAccess', _262 => _262.source])) delete next.mask;
|
|
6836
|
-
} else next.mask =
|
|
6836
|
+
} else next.mask = _chunkXLUYXUBDcjs.depthRasterMask.call(void 0, merged);
|
|
6837
6837
|
return next;
|
|
6838
6838
|
});
|
|
6839
6839
|
}
|
|
@@ -6854,7 +6854,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6854
6854
|
// --- Annotations & Layers ---
|
|
6855
6855
|
/** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
|
|
6856
6856
|
annotationLayer(id) {
|
|
6857
|
-
return _chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([
|
|
6857
|
+
return _chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkXLUYXUBDcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _265 => _265.id]) === id);
|
|
6858
6858
|
}
|
|
6859
6859
|
/** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
|
|
6860
6860
|
annotationEnv() {
|
|
@@ -6870,7 +6870,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6870
6870
|
this.recordHistory();
|
|
6871
6871
|
const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
|
|
6872
6872
|
const fullAnnotation = { ...annotation, id };
|
|
6873
|
-
const layer =
|
|
6873
|
+
const layer = _chunkXLUYXUBDcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
|
|
6874
6874
|
const loc = placement.aboveId ? _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
6875
6875
|
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);
|
|
6876
6876
|
this.state.selectedAnnotationId = id;
|
|
@@ -6882,17 +6882,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
6882
6882
|
this.recordHistory();
|
|
6883
6883
|
}
|
|
6884
6884
|
const layer = this.annotationLayer(id);
|
|
6885
|
-
const current = layer ?
|
|
6885
|
+
const current = layer ? _chunkXLUYXUBDcjs.annotationOfLayer.call(void 0, layer) : null;
|
|
6886
6886
|
if (layer && current) {
|
|
6887
6887
|
const annotation = { ...current, ...partial, id };
|
|
6888
|
-
const name = layer.name ===
|
|
6888
|
+
const name = layer.name === _chunkXLUYXUBDcjs.annotationLayerName.call(void 0, current) ? _chunkXLUYXUBDcjs.annotationLayerName.call(void 0, annotation) : layer.name;
|
|
6889
6889
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
|
|
6890
6890
|
}
|
|
6891
6891
|
this.notify();
|
|
6892
6892
|
}
|
|
6893
6893
|
/** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
|
|
6894
6894
|
layerForAnnotation(layer, annotation, name) {
|
|
6895
|
-
const fresh =
|
|
6895
|
+
const fresh = _chunkXLUYXUBDcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
|
|
6896
6896
|
const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
|
|
6897
6897
|
for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
6898
6898
|
if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
|
|
@@ -7160,8 +7160,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7160
7160
|
return;
|
|
7161
7161
|
}
|
|
7162
7162
|
const target = this.developLayer();
|
|
7163
|
-
if (!target) throw new (0,
|
|
7164
|
-
|
|
7163
|
+
if (!target) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("There is no pixel layer to mask.");
|
|
7164
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, target, "all", "mask it");
|
|
7165
7165
|
const { width, height } = this.naturalSize;
|
|
7166
7166
|
let px2 = await this.decodeImage(newDataUrl);
|
|
7167
7167
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
@@ -7169,14 +7169,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7169
7169
|
for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
|
|
7170
7170
|
let surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
|
|
7171
7171
|
if (target.offset.x || target.offset.y) surface = _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
|
|
7172
|
-
this.commitLayers(
|
|
7172
|
+
this.commitLayers(_chunkXLUYXUBDcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
|
|
7173
7173
|
return target.id;
|
|
7174
7174
|
}
|
|
7175
7175
|
// --- Type layers ---
|
|
7176
7176
|
|
|
7177
7177
|
/** The shaper that lays out and draws type layers (`null` when there is none here). */
|
|
7178
7178
|
getTextShaper() {
|
|
7179
|
-
if (this.textShaperValue === void 0) this.textShaperValue =
|
|
7179
|
+
if (this.textShaperValue === void 0) this.textShaperValue = _chunkORE334I6cjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
|
|
7180
7180
|
return this.textShaperValue;
|
|
7181
7181
|
}
|
|
7182
7182
|
/** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
|
|
@@ -7193,7 +7193,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7193
7193
|
return _nullishCoalesce(_optionalChain([this, 'access', _272 => _272.getTextShaper, 'call', _273 => _273(), 'optionalAccess', _274 => _274.families, 'optionalCall', _275 => _275()]), () => ( ["sans-serif", "serif", "monospace"]));
|
|
7194
7194
|
}
|
|
7195
7195
|
typeInfo(id) {
|
|
7196
|
-
const layer =
|
|
7196
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7197
7197
|
const ranges = (runs) => {
|
|
7198
7198
|
let at = 0;
|
|
7199
7199
|
return runs.map((r) => {
|
|
@@ -7206,7 +7206,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7206
7206
|
let lines = [];
|
|
7207
7207
|
let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
|
|
7208
7208
|
if (shaper) {
|
|
7209
|
-
const layout =
|
|
7209
|
+
const layout = _chunkORE334I6cjs.layoutText.call(void 0, layer, shaper);
|
|
7210
7210
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7211
7211
|
lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
|
|
7212
7212
|
if (layer.rendering === "stored") missing = layout.missingFonts;
|
|
@@ -7236,25 +7236,25 @@ var ImageEditorController = (_class7 = class {
|
|
|
7236
7236
|
* text wrapped in `box`. Refused without a text shaper. Returns its id.
|
|
7237
7237
|
*/
|
|
7238
7238
|
addTextLayer(init) {
|
|
7239
|
-
const text =
|
|
7240
|
-
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0,
|
|
7241
|
-
const style =
|
|
7242
|
-
const paragraph =
|
|
7239
|
+
const text = _chunkXLUYXUBDcjs.normalizeText.call(void 0, init.text);
|
|
7240
|
+
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("x and y must be numbers (document pixels).");
|
|
7241
|
+
const style = _chunkXLUYXUBDcjs.patchTextStyle.call(void 0, { ..._chunkORE334I6cjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
|
|
7242
|
+
const paragraph = _chunkXLUYXUBDcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
|
|
7243
7243
|
let frame = { kind: "point" };
|
|
7244
7244
|
if (init.box) {
|
|
7245
7245
|
const { width, height } = init.box;
|
|
7246
|
-
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0,
|
|
7246
|
+
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
|
|
7247
7247
|
frame = { kind: "box", width, height };
|
|
7248
7248
|
}
|
|
7249
|
-
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0,
|
|
7250
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7251
|
-
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7249
|
+
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("rotation must be a number of degrees.");
|
|
7250
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7251
|
+
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7252
7252
|
const t = [1, 0, 0, 1, init.x, init.y];
|
|
7253
|
-
const transform = init.rotation ?
|
|
7254
|
-
const layer =
|
|
7253
|
+
const transform = init.rotation ? _chunkORE334I6cjs.multiplyMatrices.call(void 0, t, _chunkORE334I6cjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
|
|
7254
|
+
const layer = _chunkXLUYXUBDcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkXLUYXUBDcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
|
|
7255
7255
|
if (init.opacity !== void 0) layer.opacity = init.opacity;
|
|
7256
7256
|
if (init.blend !== void 0) layer.blend = init.blend;
|
|
7257
|
-
const next =
|
|
7257
|
+
const next = _chunkXLUYXUBDcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7258
7258
|
this.commitLayers(next, () => {
|
|
7259
7259
|
this.state.activeLayerId = layer.id;
|
|
7260
7260
|
this.state.activeTarget = "pixels";
|
|
@@ -7266,28 +7266,28 @@ var ImageEditorController = (_class7 = class {
|
|
|
7266
7266
|
* `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
|
|
7267
7267
|
*/
|
|
7268
7268
|
setText(id, text, range = {}, commitToHistory = true) {
|
|
7269
|
-
const layer =
|
|
7270
|
-
const insert =
|
|
7271
|
-
const [start, end] =
|
|
7272
|
-
const { layers } =
|
|
7269
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7270
|
+
const insert = _chunkXLUYXUBDcjs.normalizeText.call(void 0, text);
|
|
7271
|
+
const [start, end] = _chunkXLUYXUBDcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7272
|
+
const { layers } = _chunkXLUYXUBDcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkXLUYXUBDcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
|
|
7273
7273
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7274
7274
|
return this.typeInfo(id);
|
|
7275
7275
|
}
|
|
7276
7276
|
/** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
|
|
7277
7277
|
setTextStyle(id, style, range = {}, commitToHistory = true) {
|
|
7278
|
-
const layer =
|
|
7279
|
-
const [start, end] =
|
|
7280
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7281
|
-
|
|
7282
|
-
const { layers } =
|
|
7278
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7279
|
+
const [start, end] = _chunkXLUYXUBDcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7280
|
+
if (!Object.keys(style).length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give at least one style field to set.");
|
|
7281
|
+
_chunkXLUYXUBDcjs.patchTextStyle.call(void 0, _chunkORE334I6cjs.DEFAULT_TEXT_STYLE, style);
|
|
7282
|
+
const { layers } = _chunkXLUYXUBDcjs.updateTypeLayer.call(void 0,
|
|
7283
7283
|
this.state.layers,
|
|
7284
7284
|
id,
|
|
7285
7285
|
(l) => {
|
|
7286
7286
|
if (start === end) {
|
|
7287
|
-
if (l.text.length) throw new (0,
|
|
7288
|
-
return { runs: [{ length: 0, style:
|
|
7287
|
+
if (l.text.length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
|
|
7288
|
+
return { runs: [{ length: 0, style: _chunkXLUYXUBDcjs.patchTextStyle.call(void 0, _chunkORE334I6cjs.styleAt.call(void 0, l.runs, 0, _chunkORE334I6cjs.DEFAULT_TEXT_STYLE), style) }] };
|
|
7289
7289
|
}
|
|
7290
|
-
return { runs:
|
|
7290
|
+
return { runs: _chunkORE334I6cjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkXLUYXUBDcjs.patchTextStyle.call(void 0, s, style)) };
|
|
7291
7291
|
},
|
|
7292
7292
|
this.textEnv(),
|
|
7293
7293
|
"restyle its text"
|
|
@@ -7297,11 +7297,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7297
7297
|
}
|
|
7298
7298
|
/** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
|
|
7299
7299
|
setParagraphStyle(id, style, range = {}, commitToHistory = true) {
|
|
7300
|
-
const layer =
|
|
7301
|
-
const [start, end] =
|
|
7302
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7303
|
-
|
|
7304
|
-
const { layers } =
|
|
7300
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7301
|
+
const [start, end] = _chunkXLUYXUBDcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7302
|
+
if (!Object.keys(style).length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give at least one paragraph field to set.");
|
|
7303
|
+
_chunkXLUYXUBDcjs.patchParagraphStyle.call(void 0, {}, style);
|
|
7304
|
+
const { layers } = _chunkXLUYXUBDcjs.updateTypeLayer.call(void 0,
|
|
7305
7305
|
this.state.layers,
|
|
7306
7306
|
id,
|
|
7307
7307
|
(l) => {
|
|
@@ -7310,7 +7310,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7310
7310
|
const a = at;
|
|
7311
7311
|
at += p.length;
|
|
7312
7312
|
const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
|
|
7313
|
-
return touches || !l.text.length ? { length: p.length, style:
|
|
7313
|
+
return touches || !l.text.length ? { length: p.length, style: _chunkXLUYXUBDcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
|
|
7314
7314
|
});
|
|
7315
7315
|
return { paragraphs };
|
|
7316
7316
|
},
|
|
@@ -7326,21 +7326,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7326
7326
|
* paragraph. Also resizes a box. One undo step.
|
|
7327
7327
|
*/
|
|
7328
7328
|
setTextFrame(id, frame, commitToHistory = true) {
|
|
7329
|
-
const layer =
|
|
7330
|
-
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0,
|
|
7331
|
-
if (frame.kind !== "box" && frame.kind !== "point") throw new (0,
|
|
7329
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7330
|
+
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("width and height must be at least 1 pixel.");
|
|
7331
|
+
if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("kind must be point or box.");
|
|
7332
7332
|
const shaper = this.getTextShaper();
|
|
7333
|
-
const { layers } =
|
|
7333
|
+
const { layers } = _chunkXLUYXUBDcjs.updateTypeLayer.call(void 0,
|
|
7334
7334
|
this.state.layers,
|
|
7335
7335
|
id,
|
|
7336
7336
|
(l) => {
|
|
7337
7337
|
if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
|
|
7338
|
-
if (!shaper) throw new (0,
|
|
7339
|
-
const lines =
|
|
7338
|
+
if (!shaper) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
|
|
7339
|
+
const lines = _chunkORE334I6cjs.layoutText.call(void 0, l, shaper).lines;
|
|
7340
7340
|
const first = lines[0];
|
|
7341
7341
|
const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
|
|
7342
7342
|
const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
|
|
7343
|
-
const m =
|
|
7343
|
+
const m = _chunkXLUYXUBDcjs.textMatrix.call(void 0, l);
|
|
7344
7344
|
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]];
|
|
7345
7345
|
const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
|
|
7346
7346
|
return { frame: nextFrame, transform: shifted };
|
|
@@ -7357,21 +7357,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7357
7357
|
* `warnings` says when other colours were dropped. One undo step.
|
|
7358
7358
|
*/
|
|
7359
7359
|
convertTextToShape(id) {
|
|
7360
|
-
const layer =
|
|
7361
|
-
|
|
7360
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7361
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
|
|
7362
7362
|
const shaper = this.getTextShaper();
|
|
7363
|
-
if (!shaper) throw new (0,
|
|
7364
|
-
const parts =
|
|
7365
|
-
const subpaths = parts.flatMap((p) =>
|
|
7366
|
-
if (!subpaths.length) throw new (0,
|
|
7363
|
+
if (!shaper) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
|
|
7364
|
+
const parts = _chunkXLUYXUBDcjs.textOutlines.call(void 0, layer, shaper);
|
|
7365
|
+
const subpaths = parts.flatMap((p) => _chunkORE334I6cjs.bezierToSubpaths.call(void 0, p.path));
|
|
7366
|
+
if (!subpaths.length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
|
|
7367
7367
|
const warnings = [];
|
|
7368
7368
|
const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
|
|
7369
7369
|
if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
|
|
7370
|
-
const missing =
|
|
7370
|
+
const missing = _chunkORE334I6cjs.layoutText.call(void 0, layer, shaper).missingFonts;
|
|
7371
7371
|
if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
|
|
7372
|
-
const first = _nullishCoalesce(_optionalChain([layer, 'access', _276 => _276.runs, 'access', _277 => _277.find, 'call', _278 => _278((r) => r.length > 0), 'optionalAccess', _279 => _279.style]), () => (
|
|
7372
|
+
const first = _nullishCoalesce(_optionalChain([layer, 'access', _276 => _276.runs, 'access', _277 => _277.find, 'call', _278 => _278((r) => r.length > 0), 'optionalAccess', _279 => _279.style]), () => ( _chunkORE334I6cjs.DEFAULT_TEXT_STYLE));
|
|
7373
7373
|
const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
|
|
7374
|
-
const shape =
|
|
7374
|
+
const shape = _chunkXLUYXUBDcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
|
|
7375
7375
|
const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
|
|
7376
7376
|
for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
7377
7377
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
|
|
@@ -7379,23 +7379,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
7379
7379
|
}
|
|
7380
7380
|
/** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
|
|
7381
7381
|
getTextLayout(id) {
|
|
7382
|
-
const layer =
|
|
7382
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7383
7383
|
const shaper = this.getTextShaper();
|
|
7384
|
-
return shaper ?
|
|
7384
|
+
return shaper ? _chunkORE334I6cjs.layoutText.call(void 0, layer, shaper) : null;
|
|
7385
7385
|
}
|
|
7386
7386
|
/** The text index nearest a document point (for clicks on a type layer). */
|
|
7387
7387
|
textIndexAt(id, point) {
|
|
7388
|
-
const layer =
|
|
7388
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7389
7389
|
const layout = this.getTextLayout(id);
|
|
7390
|
-
return layout ?
|
|
7390
|
+
return layout ? _chunkORE334I6cjs.textIndexAt.call(void 0, layout, _chunkXLUYXUBDcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
|
|
7391
7391
|
}
|
|
7392
7392
|
/** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
|
|
7393
7393
|
textCaret(id, index) {
|
|
7394
|
-
const layer =
|
|
7394
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7395
7395
|
const layout = this.getTextLayout(id);
|
|
7396
7396
|
if (!layout) return null;
|
|
7397
|
-
const c =
|
|
7398
|
-
const m =
|
|
7397
|
+
const c = _chunkORE334I6cjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
|
|
7398
|
+
const m = _chunkXLUYXUBDcjs.textMatrix.call(void 0, layer);
|
|
7399
7399
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
7400
7400
|
return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
|
|
7401
7401
|
}
|
|
@@ -7406,14 +7406,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7406
7406
|
}
|
|
7407
7407
|
/** One component from tool or UI input (validated). */
|
|
7408
7408
|
componentFrom(spec, path) {
|
|
7409
|
-
const op =
|
|
7410
|
-
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0,
|
|
7411
|
-
if (spec.shape !== void 0) return
|
|
7412
|
-
if (spec.subpaths !== void 0) return { op, subpaths:
|
|
7413
|
-
throw new (0,
|
|
7409
|
+
const op = _chunkXLUYXUBDcjs.requireOperation.call(void 0, spec.op, `${path}op`);
|
|
7410
|
+
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
|
|
7411
|
+
if (spec.shape !== void 0) return _chunkXLUYXUBDcjs.liveComponent.call(void 0, _chunkXLUYXUBDcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
|
|
7412
|
+
if (spec.subpaths !== void 0) return { op, subpaths: _chunkXLUYXUBDcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
|
|
7413
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
|
|
7414
7414
|
}
|
|
7415
7415
|
shapeInfo(id) {
|
|
7416
|
-
const layer =
|
|
7416
|
+
const layer = _chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7417
7417
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7418
7418
|
const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
|
|
7419
7419
|
const info = {
|
|
@@ -7423,13 +7423,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
7423
7423
|
index,
|
|
7424
7424
|
op: c.op,
|
|
7425
7425
|
live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
|
|
7426
|
-
subpaths:
|
|
7427
|
-
bounds: box(
|
|
7426
|
+
subpaths: _chunkORE334I6cjs.roundSubpaths.call(void 0, c.subpaths),
|
|
7427
|
+
bounds: box(_chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
|
|
7428
7428
|
})),
|
|
7429
7429
|
fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
|
|
7430
7430
|
fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
|
|
7431
7431
|
stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
|
|
7432
|
-
geometryBounds: box(
|
|
7432
|
+
geometryBounds: box(_chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, layer)),
|
|
7433
7433
|
bounds: this.getLayerBounds(id)
|
|
7434
7434
|
};
|
|
7435
7435
|
if (layer.annotation) info.annotationId = layer.annotation.id;
|
|
@@ -7446,17 +7446,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
7446
7446
|
*/
|
|
7447
7447
|
addShapeLayer(init) {
|
|
7448
7448
|
const specs = _optionalChain([init, 'access', _284 => _284.components, 'optionalAccess', _285 => _285.length]) ? init.components : [init];
|
|
7449
|
-
if (_optionalChain([init, 'access', _286 => _286.components, 'optionalAccess', _287 => _287.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0,
|
|
7449
|
+
if (_optionalChain([init, 'access', _286 => _286.components, 'optionalAccess', _287 => _287.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
|
|
7450
7450
|
const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _288 => _288.components, 'optionalAccess', _289 => _289.length]) ? `components[${i}].` : ""));
|
|
7451
|
-
const stroke = init.stroke ?
|
|
7451
|
+
const stroke = init.stroke ? _chunkXLUYXUBDcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
|
|
7452
7452
|
const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
|
|
7453
|
-
const fill = init.fill === void 0 ? stroke && openOnly ? null :
|
|
7454
|
-
if (!fill && !stroke) throw new (0,
|
|
7455
|
-
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0,
|
|
7456
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7457
|
-
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7458
|
-
const layer =
|
|
7459
|
-
const next =
|
|
7453
|
+
const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkXLUYXUBDcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkXLUYXUBDcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
|
|
7454
|
+
if (!fill && !stroke) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
|
|
7455
|
+
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7456
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7457
|
+
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7458
|
+
const layer = _chunkXLUYXUBDcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
|
|
7459
|
+
const next = _chunkXLUYXUBDcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7460
7460
|
this.commitLayers(next, () => {
|
|
7461
7461
|
this.state.activeLayerId = layer.id;
|
|
7462
7462
|
this.state.activeTarget = "pixels";
|
|
@@ -7469,18 +7469,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
7469
7469
|
* only those settings of the current stroke. Returns the shape.
|
|
7470
7470
|
*/
|
|
7471
7471
|
setShapeStyle(id, changes, commitToHistory = true) {
|
|
7472
|
-
const layer =
|
|
7473
|
-
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null :
|
|
7474
|
-
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null :
|
|
7475
|
-
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0,
|
|
7472
|
+
const layer = _chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7473
|
+
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkXLUYXUBDcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
|
|
7474
|
+
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkXLUYXUBDcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
|
|
7475
|
+
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7476
7476
|
const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
|
|
7477
|
-
const { layers } =
|
|
7477
|
+
const { layers } = _chunkXLUYXUBDcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
|
|
7478
7478
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7479
7479
|
return this.shapeInfo(id);
|
|
7480
7480
|
}
|
|
7481
7481
|
componentIndex(layer, index) {
|
|
7482
7482
|
if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
|
|
7483
|
-
throw new (0,
|
|
7483
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
|
|
7484
7484
|
}
|
|
7485
7485
|
return index;
|
|
7486
7486
|
}
|
|
@@ -7490,36 +7490,36 @@ var ImageEditorController = (_class7 = class {
|
|
|
7490
7490
|
* the live shape) or its operation. Returns the shape.
|
|
7491
7491
|
*/
|
|
7492
7492
|
setShapeComponent(id, index, change, commitToHistory = true) {
|
|
7493
|
-
const layer =
|
|
7493
|
+
const layer = _chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7494
7494
|
const i = this.componentIndex(layer, index);
|
|
7495
7495
|
const current = layer.components[i];
|
|
7496
7496
|
let shape = change.shape;
|
|
7497
7497
|
if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
|
|
7498
7498
|
else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
|
|
7499
|
-
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op:
|
|
7499
|
+
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkXLUYXUBDcjs.requireOperation.call(void 0, change.op) };
|
|
7500
7500
|
const components = layer.components.map((c, k) => k === i ? next : c);
|
|
7501
|
-
const { layers } =
|
|
7501
|
+
const { layers } = _chunkXLUYXUBDcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7502
7502
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7503
7503
|
return this.shapeInfo(id);
|
|
7504
7504
|
}
|
|
7505
7505
|
/** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
|
|
7506
7506
|
addShapeComponent(id, spec, index) {
|
|
7507
|
-
const layer =
|
|
7507
|
+
const layer = _chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7508
7508
|
const c = this.componentFrom(spec, "");
|
|
7509
7509
|
const at = index === void 0 ? layer.components.length : index;
|
|
7510
|
-
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0,
|
|
7510
|
+
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
|
|
7511
7511
|
const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
|
|
7512
|
-
const { layers } =
|
|
7512
|
+
const { layers } = _chunkXLUYXUBDcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7513
7513
|
this.commitLayers(layers);
|
|
7514
7514
|
return this.shapeInfo(id);
|
|
7515
7515
|
}
|
|
7516
7516
|
/** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
|
|
7517
7517
|
removeShapeComponent(id, index) {
|
|
7518
|
-
const layer =
|
|
7518
|
+
const layer = _chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7519
7519
|
const i = this.componentIndex(layer, index);
|
|
7520
|
-
if (layer.components.length === 1) throw new (0,
|
|
7520
|
+
if (layer.components.length === 1) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
|
|
7521
7521
|
const components = layer.components.filter((_, k) => k !== i);
|
|
7522
|
-
const { layers } =
|
|
7522
|
+
const { layers } = _chunkXLUYXUBDcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7523
7523
|
this.commitLayers(layers);
|
|
7524
7524
|
return this.shapeInfo(id);
|
|
7525
7525
|
}
|
|
@@ -7528,10 +7528,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7528
7528
|
* shapes become paths), as one undo step. Returns the shape.
|
|
7529
7529
|
*/
|
|
7530
7530
|
mergeShapeComponents(id) {
|
|
7531
|
-
const layer =
|
|
7532
|
-
if (layer.components.length < 2) throw new (0,
|
|
7533
|
-
const components =
|
|
7534
|
-
const { layers } =
|
|
7531
|
+
const layer = _chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7532
|
+
if (layer.components.length < 2) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
|
|
7533
|
+
const components = _chunkXLUYXUBDcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
|
|
7534
|
+
const { layers } = _chunkXLUYXUBDcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
|
|
7535
7535
|
this.commitLayers(layers);
|
|
7536
7536
|
return this.shapeInfo(id);
|
|
7537
7537
|
}
|
|
@@ -7541,8 +7541,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7541
7541
|
* step. Returns the layer id.
|
|
7542
7542
|
*/
|
|
7543
7543
|
async rasterizeLayer(id) {
|
|
7544
|
-
const layer =
|
|
7545
|
-
|
|
7544
|
+
const layer = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
7545
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
|
|
7546
7546
|
const { width, height } = this.naturalSize;
|
|
7547
7547
|
const canvas = { x: 0, y: 0, width, height };
|
|
7548
7548
|
let next;
|
|
@@ -7558,8 +7558,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7558
7558
|
if (layer.locks) next.locks = layer.locks;
|
|
7559
7559
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
7560
7560
|
} else if (layer.type === "pixel") {
|
|
7561
|
-
if (!_optionalChain([layer, 'access', _290 => _290.filters, 'optionalAccess', _291 => _291.length])) throw new (0,
|
|
7562
|
-
|
|
7561
|
+
if (!_optionalChain([layer, 'access', _290 => _290.filters, 'optionalAccess', _291 => _291.length])) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
|
|
7562
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
|
|
7563
7563
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
7564
7564
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
7565
7565
|
delete content.mask;
|
|
@@ -7576,10 +7576,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7576
7576
|
} else if (layer.type === "smart") {
|
|
7577
7577
|
return this.rasterizeSmartObject(id);
|
|
7578
7578
|
} else if (layer.type === "shape" || layer.type === "type") {
|
|
7579
|
-
next = layer.type === "shape" ?
|
|
7579
|
+
next = layer.type === "shape" ? _chunkXLUYXUBDcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkXLUYXUBDcjs.typeAsPixelLayer.call(void 0, layer);
|
|
7580
7580
|
if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _292 => _292.annotation, 'optionalAccess', _293 => _293.id])) this.state.selectedAnnotationId = null;
|
|
7581
7581
|
} else {
|
|
7582
|
-
throw new (0,
|
|
7582
|
+
throw new (0, _chunkXLUYXUBDcjs.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.`);
|
|
7583
7583
|
}
|
|
7584
7584
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
|
|
7585
7585
|
return id;
|
|
@@ -7604,7 +7604,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7604
7604
|
setColorMode(mode, options = {}) {
|
|
7605
7605
|
let next;
|
|
7606
7606
|
if (mode === "rgb") {
|
|
7607
|
-
if (options.profile !== void 0) throw new (0,
|
|
7607
|
+
if (options.profile !== void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
|
|
7608
7608
|
next = null;
|
|
7609
7609
|
} else if (mode === "lab") next = { mode: "lab" };
|
|
7610
7610
|
else if (mode === "cmyk") {
|
|
@@ -7612,14 +7612,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7612
7612
|
try {
|
|
7613
7613
|
doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
|
|
7614
7614
|
} catch (e) {
|
|
7615
|
-
throw new (0,
|
|
7615
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7616
7616
|
}
|
|
7617
7617
|
const cs = resolveProfile(doc).colorSpace;
|
|
7618
|
-
if (cs !== "cmyk") throw new (0,
|
|
7618
|
+
if (cs !== "cmyk") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
|
|
7619
7619
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7620
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7620
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7621
7621
|
next = { mode: "cmyk", profile: doc, intent };
|
|
7622
|
-
} else throw new (0,
|
|
7622
|
+
} else throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
|
|
7623
7623
|
this.recordHistory();
|
|
7624
7624
|
if (next) this.state.colorMode = next;
|
|
7625
7625
|
else delete this.state.colorMode;
|
|
@@ -7632,10 +7632,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7632
7632
|
try {
|
|
7633
7633
|
doc = documentProfile(profile);
|
|
7634
7634
|
} catch (e) {
|
|
7635
|
-
throw new (0,
|
|
7635
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7636
7636
|
}
|
|
7637
7637
|
const cs = resolveProfile(doc).colorSpace;
|
|
7638
|
-
if (cs !== "rgb") throw new (0,
|
|
7638
|
+
if (cs !== "rgb") throw new (0, _chunkXLUYXUBDcjs.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.`);
|
|
7639
7639
|
return doc;
|
|
7640
7640
|
}
|
|
7641
7641
|
/**
|
|
@@ -7661,7 +7661,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7661
7661
|
convertToProfile(profile, options = {}) {
|
|
7662
7662
|
const doc = this.rgbProfileArg(profile, "Convert to Profile");
|
|
7663
7663
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7664
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7664
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7665
7665
|
const t = _chunkG5NMLUVFcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7666
7666
|
const converted = [];
|
|
7667
7667
|
const unconverted = [];
|
|
@@ -7699,12 +7699,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
7699
7699
|
try {
|
|
7700
7700
|
doc = documentProfile(setup.profile);
|
|
7701
7701
|
} catch (e) {
|
|
7702
|
-
throw new (0,
|
|
7702
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7703
7703
|
}
|
|
7704
7704
|
const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
|
|
7705
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7705
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7706
7706
|
const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
|
|
7707
|
-
if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0,
|
|
7707
|
+
if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
|
|
7708
7708
|
this.state.proofSetup = next;
|
|
7709
7709
|
this.notify();
|
|
7710
7710
|
return next;
|
|
@@ -7721,14 +7721,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7721
7721
|
src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
|
|
7722
7722
|
dst = resolveProfile(documentProfile(to));
|
|
7723
7723
|
} catch (e) {
|
|
7724
|
-
throw new (0,
|
|
7724
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7725
7725
|
}
|
|
7726
|
-
if (src.colorSpace !== "rgb") throw new (0,
|
|
7726
|
+
if (src.colorSpace !== "rgb") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
|
|
7727
7727
|
const t = _chunkG5NMLUVFcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7728
7728
|
const toLab = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
|
|
7729
7729
|
return colors.map((input) => {
|
|
7730
7730
|
const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
|
|
7731
|
-
if (!m) throw new (0,
|
|
7731
|
+
if (!m) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
|
|
7732
7732
|
const n = parseInt(m[1], 16);
|
|
7733
7733
|
const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
|
|
7734
7734
|
const out = new Float32Array(16);
|
|
@@ -7754,7 +7754,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7754
7754
|
* the ids of the layers whose pixels changed.
|
|
7755
7755
|
*/
|
|
7756
7756
|
setBitDepth(depth) {
|
|
7757
|
-
if (!_chunkJ5BA3BQ6cjs.isBitDepth.call(void 0, depth)) throw new (0,
|
|
7757
|
+
if (!_chunkJ5BA3BQ6cjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
|
|
7758
7758
|
const changed = [];
|
|
7759
7759
|
const withMask = (l) => {
|
|
7760
7760
|
const m = l.mask;
|
|
@@ -7802,7 +7802,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7802
7802
|
* Throws `PsdError` for files that cannot be read at all.
|
|
7803
7803
|
*/
|
|
7804
7804
|
loadPsd(bytes) {
|
|
7805
|
-
const result =
|
|
7805
|
+
const result = _chunkXLUYXUBDcjs.importPsd.call(void 0, bytes, { newId: () => _chunkXLUYXUBDcjs.newLayerId.call(void 0, ) });
|
|
7806
7806
|
this.abandonContents();
|
|
7807
7807
|
this.recordHistory();
|
|
7808
7808
|
const s = this.state;
|
|
@@ -7812,7 +7812,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7812
7812
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
7813
7813
|
s.layers = this.checkPsdFonts(result);
|
|
7814
7814
|
s.crop = null;
|
|
7815
|
-
s.transform = { ...
|
|
7815
|
+
s.transform = { ..._chunkXLUYXUBDcjs.DEFAULT_TRANSFORM_VALUES };
|
|
7816
7816
|
s.outputOpacity = 1;
|
|
7817
7817
|
delete s.legacyOutputBlur;
|
|
7818
7818
|
s.selection = null;
|
|
@@ -7863,7 +7863,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7863
7863
|
let layers = result.layers;
|
|
7864
7864
|
const missing = /* @__PURE__ */ new Map();
|
|
7865
7865
|
for (const l of types) {
|
|
7866
|
-
const fonts = shaper ?
|
|
7866
|
+
const fonts = shaper ? _chunkORE334I6cjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
|
|
7867
7867
|
if (!fonts.length) continue;
|
|
7868
7868
|
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
|
|
7869
7869
|
for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
|
|
@@ -7891,7 +7891,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7891
7891
|
const canRasterize = this.renderer.canRasterize();
|
|
7892
7892
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
7893
7893
|
const sources = this.renderer.compositorSources(width, height);
|
|
7894
|
-
const compositor = new (0,
|
|
7894
|
+
const compositor = new (0, _chunkXLUYXUBDcjs.LayerCompositor)();
|
|
7895
7895
|
const bakeMask = (layer) => {
|
|
7896
7896
|
const mask = layer.mask;
|
|
7897
7897
|
if (!_optionalChain([mask, 'optionalAccess', _304 => _304.source])) return mask;
|
|
@@ -7973,7 +7973,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7973
7973
|
out.surface = this.surfaceOf(layer);
|
|
7974
7974
|
delete out.source;
|
|
7975
7975
|
}
|
|
7976
|
-
const active = _nullishCoalesce(_optionalChain([layer, 'access', _308 => _308.filters, 'optionalAccess', _309 => _309.filter, 'call', _310 => _310(
|
|
7976
|
+
const active = _nullishCoalesce(_optionalChain([layer, 'access', _308 => _308.filters, 'optionalAccess', _309 => _309.filter, 'call', _310 => _310(_chunkXLUYXUBDcjs.isActiveFilter)]), () => ( []));
|
|
7977
7977
|
if (active.length) {
|
|
7978
7978
|
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
7979
7979
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -8006,8 +8006,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8006
8006
|
const color = this.psdColorOptions(warnings);
|
|
8007
8007
|
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.`);
|
|
8008
8008
|
const depth = color.colorMode ? 8 : this.bitDepth;
|
|
8009
|
-
const mergedDeep = depth === 8 ? void 0 : _chunkMZXQTKUMcjs.workingToSamples.call(void 0,
|
|
8010
|
-
const result =
|
|
8009
|
+
const mergedDeep = depth === 8 ? void 0 : _chunkMZXQTKUMcjs.workingToSamples.call(void 0, _chunkXLUYXUBDcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
|
|
8010
|
+
const result = _chunkXLUYXUBDcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
|
|
8011
8011
|
warnings.push(...result.warnings);
|
|
8012
8012
|
return { bytes: result.bytes, warnings, psb: result.psb, width, height };
|
|
8013
8013
|
}
|
|
@@ -8023,13 +8023,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
8023
8023
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
8024
8024
|
if (this.state.selection && (sx !== 1 || sy !== 1)) {
|
|
8025
8025
|
this.state.selection = normalizeSelection(
|
|
8026
|
-
|
|
8026
|
+
_chunkXLUYXUBDcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
|
|
8027
8027
|
);
|
|
8028
8028
|
}
|
|
8029
8029
|
let layers = this.state.layers;
|
|
8030
8030
|
if (sx !== 1 || sy !== 1) {
|
|
8031
8031
|
if (this.state.crop) {
|
|
8032
|
-
this.state.crop =
|
|
8032
|
+
this.state.crop = _chunkXLUYXUBDcjs.clampCropToImage.call(void 0,
|
|
8033
8033
|
{
|
|
8034
8034
|
x: Math.round(this.state.crop.x * sx),
|
|
8035
8035
|
y: Math.round(this.state.crop.y * sy),
|
|
@@ -8048,17 +8048,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
8048
8048
|
} else if (l.type === "shape") {
|
|
8049
8049
|
const a = l.annotation;
|
|
8050
8050
|
const scaled = a ? scaleAnnotation(a, sx, sy) : null;
|
|
8051
|
-
const fromAnnotation = scaled ?
|
|
8051
|
+
const fromAnnotation = scaled ? _chunkXLUYXUBDcjs.shapeFromAnnotation.call(void 0, scaled) : null;
|
|
8052
8052
|
const m = [sx, 0, 0, sy, 0, 0];
|
|
8053
|
-
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _318 => _318.components]), () => (
|
|
8053
|
+
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _318 => _318.components]), () => ( _chunkXLUYXUBDcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
|
|
8054
8054
|
const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
|
|
8055
8055
|
if (scaled && fromAnnotation) moved.annotation = scaled;
|
|
8056
8056
|
else delete moved.annotation;
|
|
8057
|
-
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () =>
|
|
8057
|
+
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () => _chunkXLUYXUBDcjs.rerenderShape.call(void 0, moved, env));
|
|
8058
8058
|
}
|
|
8059
8059
|
}
|
|
8060
8060
|
}
|
|
8061
|
-
const bg =
|
|
8061
|
+
const bg = _chunkXLUYXUBDcjs.developTarget.call(void 0, layers, null);
|
|
8062
8062
|
if (bg && bg.source !== "document") layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
|
|
8063
8063
|
if (clearAnnotations) {
|
|
8064
8064
|
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);
|
|
@@ -8079,7 +8079,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8079
8079
|
let out;
|
|
8080
8080
|
try {
|
|
8081
8081
|
out = this.serializeState();
|
|
8082
|
-
if (_optionalChain([this, 'access', _322 => _322.state, 'access', _323 => _323.selection, 'optionalAccess', _324 => _324.bounds])) out.selection =
|
|
8082
|
+
if (_optionalChain([this, 'access', _322 => _322.state, 'access', _323 => _323.selection, 'optionalAccess', _324 => _324.bounds])) out.selection = _chunkXLUYXUBDcjs.serializeSelection.call(void 0, this.state.selection);
|
|
8083
8083
|
} finally {
|
|
8084
8084
|
if (root) {
|
|
8085
8085
|
this.state = current;
|
|
@@ -8087,8 +8087,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8087
8087
|
this.viewKey = [];
|
|
8088
8088
|
}
|
|
8089
8089
|
}
|
|
8090
|
-
if (!options || out.version !==
|
|
8091
|
-
return
|
|
8090
|
+
if (!options || out.version !== _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
|
|
8091
|
+
return _chunkXLUYXUBDcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
|
|
8092
8092
|
}
|
|
8093
8093
|
/**
|
|
8094
8094
|
* Loads a stored state whose v3 assets may live in an asset store (references other than data
|
|
@@ -8096,12 +8096,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
8096
8096
|
* out and listed in `lastLoadProblems`.
|
|
8097
8097
|
*/
|
|
8098
8098
|
async loadJSONAsync(data, options = {}) {
|
|
8099
|
-
if (data.version !==
|
|
8099
|
+
if (data.version !== _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
|
|
8100
8100
|
this.loadJSON(data);
|
|
8101
8101
|
return;
|
|
8102
8102
|
}
|
|
8103
8103
|
const problems = [];
|
|
8104
|
-
const assets = await
|
|
8104
|
+
const assets = await _chunkXLUYXUBDcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
|
|
8105
8105
|
this.loadJSON({ ...data, assets });
|
|
8106
8106
|
this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
|
|
8107
8107
|
}
|
|
@@ -8113,7 +8113,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8113
8113
|
let selection = null;
|
|
8114
8114
|
if (data.selection) {
|
|
8115
8115
|
try {
|
|
8116
|
-
selection = normalizeSelection(
|
|
8116
|
+
selection = normalizeSelection(_chunkXLUYXUBDcjs.deserializeSelection.call(void 0, data.selection));
|
|
8117
8117
|
} catch (e26) {
|
|
8118
8118
|
selection = null;
|
|
8119
8119
|
}
|
|
@@ -8131,8 +8131,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8131
8131
|
if (isLayered(data)) {
|
|
8132
8132
|
const problems = [];
|
|
8133
8133
|
const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
|
|
8134
|
-
const storedPatterns =
|
|
8135
|
-
s.layers =
|
|
8134
|
+
const storedPatterns = _chunkXLUYXUBDcjs.deserializePatterns.call(void 0, data.patterns, []);
|
|
8135
|
+
s.layers = _chunkXLUYXUBDcjs.deserializeLayers.call(void 0, data.layers, {
|
|
8136
8136
|
assets: _nullishCoalesce(data.assets, () => ( {})),
|
|
8137
8137
|
problems,
|
|
8138
8138
|
smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
|
|
@@ -8150,7 +8150,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8150
8150
|
const light = data.globalLight;
|
|
8151
8151
|
if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
|
|
8152
8152
|
else delete s.globalLight;
|
|
8153
|
-
const patterns =
|
|
8153
|
+
const patterns = _chunkXLUYXUBDcjs.deserializePatterns.call(void 0, data.patterns, problems);
|
|
8154
8154
|
if (patterns.length) s.patterns = patterns;
|
|
8155
8155
|
else delete s.patterns;
|
|
8156
8156
|
if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
|
|
@@ -8166,7 +8166,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8166
8166
|
}
|
|
8167
8167
|
} else {
|
|
8168
8168
|
const { width, height } = this.naturalSize;
|
|
8169
|
-
const stack =
|
|
8169
|
+
const stack = _chunkXLUYXUBDcjs.layersFromLegacy.call(void 0, data, width, height);
|
|
8170
8170
|
s.layers = stack.layers;
|
|
8171
8171
|
s.outputOpacity = stack.outputOpacity;
|
|
8172
8172
|
if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
|
|
@@ -8187,7 +8187,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8187
8187
|
}
|
|
8188
8188
|
serializeState() {
|
|
8189
8189
|
const { width, height } = this.naturalSize;
|
|
8190
|
-
const view =
|
|
8190
|
+
const view = _chunkXLUYXUBDcjs.legacyView.call(void 0, this.stack(), width, height, null);
|
|
8191
8191
|
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) {
|
|
8192
8192
|
return {
|
|
8193
8193
|
// States without adjustment layers keep schema 1, so they round-trip unchanged.
|
|
@@ -8202,9 +8202,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
8202
8202
|
annotations: JSON.parse(JSON.stringify(view.annotations))
|
|
8203
8203
|
};
|
|
8204
8204
|
}
|
|
8205
|
-
const { layers, assets, smartContents } =
|
|
8205
|
+
const { layers, assets, smartContents } = _chunkXLUYXUBDcjs.serializeLayers.call(void 0, this.state.layers);
|
|
8206
8206
|
const out = {
|
|
8207
|
-
version:
|
|
8207
|
+
version: _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION,
|
|
8208
8208
|
width,
|
|
8209
8209
|
height,
|
|
8210
8210
|
layers,
|
|
@@ -8216,7 +8216,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8216
8216
|
};
|
|
8217
8217
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
8218
8218
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
8219
|
-
if (_optionalChain([this, 'access', _331 => _331.state, 'access', _332 => _332.patterns, 'optionalAccess', _333 => _333.length])) out.patterns =
|
|
8219
|
+
if (_optionalChain([this, 'access', _331 => _331.state, 'access', _332 => _332.patterns, 'optionalAccess', _333 => _333.length])) out.patterns = _chunkXLUYXUBDcjs.serializePatterns.call(void 0, this.state.patterns);
|
|
8220
8220
|
if (smartContents) out.smartContents = smartContents;
|
|
8221
8221
|
if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
|
|
8222
8222
|
if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
|
|
@@ -8228,7 +8228,7 @@ function serializeAdjustments(adjustments) {
|
|
|
8228
8228
|
const out = { ...adjustments };
|
|
8229
8229
|
if (_optionalChain([out, 'access', _334 => _334.layers, 'optionalAccess', _335 => _335.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
8230
8230
|
else delete out.layers;
|
|
8231
|
-
if (
|
|
8231
|
+
if (_chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkXLUYXUBDcjs.LEGACY_PROCESS_VERSION) {
|
|
8232
8232
|
delete out.process;
|
|
8233
8233
|
if (!out.tint) delete out.tint;
|
|
8234
8234
|
}
|
|
@@ -8239,7 +8239,7 @@ function withDevelop(layer, partial) {
|
|
|
8239
8239
|
let i = filters.findIndex((f) => f.kind === "develop");
|
|
8240
8240
|
if (i === -1) {
|
|
8241
8241
|
filters.unshift({
|
|
8242
|
-
id: layer.source === "document" ?
|
|
8242
|
+
id: layer.source === "document" ? _chunkXLUYXUBDcjs.DEVELOP_FILTER_ID : _chunkXLUYXUBDcjs.newLayerId.call(void 0, "flt"),
|
|
8243
8243
|
kind: "develop",
|
|
8244
8244
|
enabled: true,
|
|
8245
8245
|
brightness: 0,
|
|
@@ -8248,7 +8248,7 @@ function withDevelop(layer, partial) {
|
|
|
8248
8248
|
exposure: 0,
|
|
8249
8249
|
temperature: 0,
|
|
8250
8250
|
tint: 0,
|
|
8251
|
-
process:
|
|
8251
|
+
process: _chunkXLUYXUBDcjs.LATEST_PROCESS_VERSION
|
|
8252
8252
|
});
|
|
8253
8253
|
i = 0;
|
|
8254
8254
|
}
|
|
@@ -8257,7 +8257,7 @@ function withDevelop(layer, partial) {
|
|
|
8257
8257
|
const v = partial[k];
|
|
8258
8258
|
if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
|
|
8259
8259
|
}
|
|
8260
|
-
if ("process" in partial) next.process =
|
|
8260
|
+
if ("process" in partial) next.process = _chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, partial.process);
|
|
8261
8261
|
filters[i] = next;
|
|
8262
8262
|
return { ...layer, filters };
|
|
8263
8263
|
}
|
|
@@ -8266,7 +8266,7 @@ function withBlur(layer, radius) {
|
|
|
8266
8266
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
8267
8267
|
if (radius > 0) {
|
|
8268
8268
|
filters.push({
|
|
8269
|
-
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _339 => _339.id]), () => ( (layer.source === "document" ?
|
|
8269
|
+
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _339 => _339.id]), () => ( (layer.source === "document" ? _chunkXLUYXUBDcjs.BLUR_FILTER_ID : _chunkXLUYXUBDcjs.newLayerId.call(void 0, "flt")))),
|
|
8270
8270
|
kind: "blur",
|
|
8271
8271
|
enabled: true,
|
|
8272
8272
|
radius
|
|
@@ -8290,7 +8290,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8290
8290
|
if (!update.mask) delete next.mask;
|
|
8291
8291
|
else {
|
|
8292
8292
|
const current = node.mask && !node.mask.source ? node.mask : null;
|
|
8293
|
-
const memo = current ?
|
|
8293
|
+
const memo = current ? _chunkXLUYXUBDcjs.legacyMaskOf.call(void 0, current, width, height) : null;
|
|
8294
8294
|
if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
|
|
8295
8295
|
next.mask = withMaskProps(current, {
|
|
8296
8296
|
density: _nullishCoalesce(update.mask.density, () => ( 1)),
|
|
@@ -8298,7 +8298,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8298
8298
|
enabled: update.mask.enabled !== false
|
|
8299
8299
|
});
|
|
8300
8300
|
} else {
|
|
8301
|
-
const m =
|
|
8301
|
+
const m = _chunkXLUYXUBDcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
|
|
8302
8302
|
if (m) next.mask = m;
|
|
8303
8303
|
else delete next.mask;
|
|
8304
8304
|
}
|
|
@@ -8337,7 +8337,7 @@ function resizeLegacyMasks(layers, from, to) {
|
|
|
8337
8337
|
for (const l of _chunkMZXQTKUMcjs.flattenLayers.call(void 0, layers)) {
|
|
8338
8338
|
if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
|
|
8339
8339
|
const old = l.mask;
|
|
8340
|
-
const mask =
|
|
8340
|
+
const mask = _chunkXLUYXUBDcjs.rasterMaskFromLegacy.call(void 0, _chunkXLUYXUBDcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
|
|
8341
8341
|
if (!mask) continue;
|
|
8342
8342
|
out = _chunkMZXQTKUMcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
|
|
8343
8343
|
}
|
|
@@ -8433,12 +8433,12 @@ function withoutAnnotations(layers) {
|
|
|
8433
8433
|
function parseColor(value) {
|
|
8434
8434
|
if (Array.isArray(value)) {
|
|
8435
8435
|
if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
|
|
8436
|
-
throw new (0,
|
|
8436
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
|
|
8437
8437
|
}
|
|
8438
8438
|
return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
|
|
8439
8439
|
}
|
|
8440
8440
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
|
|
8441
|
-
if (!m) throw new (0,
|
|
8441
|
+
if (!m) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
|
|
8442
8442
|
let hex = m[1];
|
|
8443
8443
|
if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
|
|
8444
8444
|
const n = (i) => parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -8448,7 +8448,7 @@ function readImagePaint(raw) {
|
|
|
8448
8448
|
try {
|
|
8449
8449
|
return _chunk6GFRKLLScjs.parsePaintSource.call(void 0, raw);
|
|
8450
8450
|
} catch (e) {
|
|
8451
|
-
if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0,
|
|
8451
|
+
if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(e.message);
|
|
8452
8452
|
throw e;
|
|
8453
8453
|
}
|
|
8454
8454
|
}
|
|
@@ -8596,7 +8596,7 @@ function loadImageEditorDocument(input) {
|
|
|
8596
8596
|
// Optional: only present when something was selected when saving.
|
|
8597
8597
|
selection: {
|
|
8598
8598
|
parse: (value) => {
|
|
8599
|
-
const mask =
|
|
8599
|
+
const mask = _chunkXLUYXUBDcjs.deserializeSelection.call(void 0, value);
|
|
8600
8600
|
const v = value;
|
|
8601
8601
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8602
8602
|
},
|
|
@@ -8684,7 +8684,7 @@ function loadLayeredDocument(doc) {
|
|
|
8684
8684
|
},
|
|
8685
8685
|
selection: {
|
|
8686
8686
|
parse: (value) => {
|
|
8687
|
-
const mask =
|
|
8687
|
+
const mask = _chunkXLUYXUBDcjs.deserializeSelection.call(void 0, value);
|
|
8688
8688
|
const v = value;
|
|
8689
8689
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8690
8690
|
},
|
|
@@ -9078,14 +9078,14 @@ function describeSelection(mask) {
|
|
|
9078
9078
|
// src/image-editor/selection-tools.ts
|
|
9079
9079
|
var modeSchema = {
|
|
9080
9080
|
type: "string",
|
|
9081
|
-
enum: [...
|
|
9081
|
+
enum: [..._chunkXLUYXUBDcjs.SELECTION_MODES],
|
|
9082
9082
|
description: "How the result combines with the current selection (default replace)."
|
|
9083
9083
|
};
|
|
9084
9084
|
var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
|
|
9085
9085
|
function summary(controller) {
|
|
9086
9086
|
const sel = controller.getSelection();
|
|
9087
9087
|
const { width, height } = controller.getState().imageDimensions;
|
|
9088
|
-
const area =
|
|
9088
|
+
const area = _chunkXLUYXUBDcjs.selectionArea.call(void 0, sel);
|
|
9089
9089
|
return {
|
|
9090
9090
|
empty: !sel,
|
|
9091
9091
|
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _351 => _351.bounds]), () => ( null)),
|
|
@@ -9131,7 +9131,7 @@ function createImageSelectionTools(controller) {
|
|
|
9131
9131
|
},
|
|
9132
9132
|
annotations: writeAnnotations("Select a region", true),
|
|
9133
9133
|
handler: ({ shape, x, y, width, height, mode, feather }) => {
|
|
9134
|
-
const opts = { mode:
|
|
9134
|
+
const opts = { mode: _chunkXLUYXUBDcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
|
|
9135
9135
|
switch (shape) {
|
|
9136
9136
|
case "all":
|
|
9137
9137
|
controller.selectAll();
|
|
@@ -9184,7 +9184,7 @@ function createImageSelectionTools(controller) {
|
|
|
9184
9184
|
annotations: writeAnnotations("Select by colour", true),
|
|
9185
9185
|
handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
|
|
9186
9186
|
const common = {
|
|
9187
|
-
mode:
|
|
9187
|
+
mode: _chunkXLUYXUBDcjs.parseSelectionMode.call(void 0, mode),
|
|
9188
9188
|
sampleMerged: sampleMerged === true,
|
|
9189
9189
|
sample: _nullishCoalesce(sample, () => ( "composite"))
|
|
9190
9190
|
};
|
|
@@ -9205,7 +9205,7 @@ function createImageSelectionTools(controller) {
|
|
|
9205
9205
|
inputSchema: {
|
|
9206
9206
|
type: "object",
|
|
9207
9207
|
properties: {
|
|
9208
|
-
op: { type: "string", enum: [...
|
|
9208
|
+
op: { type: "string", enum: [..._chunkXLUYXUBDcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
|
|
9209
9209
|
radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
|
|
9210
9210
|
},
|
|
9211
9211
|
required: ["op", "radius"],
|
|
@@ -9213,7 +9213,7 @@ function createImageSelectionTools(controller) {
|
|
|
9213
9213
|
},
|
|
9214
9214
|
annotations: writeAnnotations("Modify the selection"),
|
|
9215
9215
|
handler: ({ op, radius }) => {
|
|
9216
|
-
if (!
|
|
9216
|
+
if (!_chunkXLUYXUBDcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
|
|
9217
9217
|
if (!controller.getSelection()) throw new Error("Nothing is selected.");
|
|
9218
9218
|
controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
|
|
9219
9219
|
return summary(controller);
|
|
@@ -9257,7 +9257,7 @@ function createImageSelectionTools(controller) {
|
|
|
9257
9257
|
type: "object",
|
|
9258
9258
|
properties: {
|
|
9259
9259
|
layerId: { type: "string", description: "Existing adjustment layer to mask." },
|
|
9260
|
-
kind: { type: "string", enum:
|
|
9260
|
+
kind: { type: "string", enum: _chunkXLUYXUBDcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
|
|
9261
9261
|
params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
|
|
9262
9262
|
density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
|
|
9263
9263
|
feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
|
|
@@ -9277,11 +9277,11 @@ function createImageSelectionTools(controller) {
|
|
|
9277
9277
|
if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
|
|
9278
9278
|
controller.applySelectionAsLayerMask(layerId, props);
|
|
9279
9279
|
id = layerId;
|
|
9280
|
-
} else if (
|
|
9280
|
+
} else if (_chunkXLUYXUBDcjs.isAdjustmentKind.call(void 0, kind)) {
|
|
9281
9281
|
id = controller.addAdjustmentLayer({
|
|
9282
9282
|
kind,
|
|
9283
9283
|
params,
|
|
9284
|
-
mask:
|
|
9284
|
+
mask: _chunkXLUYXUBDcjs.layerMaskFromSelection.call(void 0, sel, props)
|
|
9285
9285
|
});
|
|
9286
9286
|
} else {
|
|
9287
9287
|
throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
|
|
@@ -9418,11 +9418,11 @@ function createImageEditTools(controller) {
|
|
|
9418
9418
|
const geometry2 = () => {
|
|
9419
9419
|
const s = controller.getState();
|
|
9420
9420
|
const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
|
|
9421
|
-
const out =
|
|
9421
|
+
const out = _chunkXLUYXUBDcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
|
|
9422
9422
|
return {
|
|
9423
9423
|
image: { ...s.imageDimensions },
|
|
9424
9424
|
crop: s.crop ? { ...s.crop } : null,
|
|
9425
|
-
rotation:
|
|
9425
|
+
rotation: _chunkXLUYXUBDcjs.normalizeAngle.call(void 0, s.transform.rotate),
|
|
9426
9426
|
flipH: s.transform.flipH,
|
|
9427
9427
|
flipV: s.transform.flipV,
|
|
9428
9428
|
output: { width: Math.round(out.width), height: Math.round(out.height) }
|
|
@@ -9657,7 +9657,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
9657
9657
|
const out = {
|
|
9658
9658
|
id: layer.id,
|
|
9659
9659
|
type: layer.type,
|
|
9660
|
-
name: layer.name || (layer.type === "adjustment" ?
|
|
9660
|
+
name: layer.name || (layer.type === "adjustment" ? _chunkXLUYXUBDcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
|
|
9661
9661
|
visible: layer.visible,
|
|
9662
9662
|
opacity: round3(layer.opacity),
|
|
9663
9663
|
blend: layer.blend,
|
|
@@ -9746,8 +9746,8 @@ function createImageLayerTools(controller) {
|
|
|
9746
9746
|
};
|
|
9747
9747
|
};
|
|
9748
9748
|
const exists = (id, what = "layerId") => {
|
|
9749
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
9750
|
-
|
|
9749
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
|
|
9750
|
+
_chunkXLUYXUBDcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
9751
9751
|
return id;
|
|
9752
9752
|
};
|
|
9753
9753
|
const listLayers = {
|
|
@@ -9783,7 +9783,7 @@ function createImageLayerTools(controller) {
|
|
|
9783
9783
|
handler: ({ layerId, target }) => {
|
|
9784
9784
|
const id = exists(layerId);
|
|
9785
9785
|
const layer = controller.getLayer(id);
|
|
9786
|
-
if (target === "mask" && !layer.mask) throw new (0,
|
|
9786
|
+
if (target === "mask" && !layer.mask) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
9787
9787
|
controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
|
|
9788
9788
|
return { layer: describe(id), activeTarget: controller.getState().activeTarget };
|
|
9789
9789
|
}
|
|
@@ -9808,7 +9808,7 @@ function createImageLayerTools(controller) {
|
|
|
9808
9808
|
},
|
|
9809
9809
|
annotations: { title: "Add a pixel layer", ...WRITE2 },
|
|
9810
9810
|
handler: async (args) => {
|
|
9811
|
-
if (args.color !== void 0 && args.image !== void 0) throw new (0,
|
|
9811
|
+
if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give color or image, not both.");
|
|
9812
9812
|
for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
|
|
9813
9813
|
const init = {
|
|
9814
9814
|
name: args.name,
|
|
@@ -9898,7 +9898,7 @@ function createImageLayerTools(controller) {
|
|
|
9898
9898
|
const id = exists(args.layerId);
|
|
9899
9899
|
const props = {};
|
|
9900
9900
|
for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
|
|
9901
|
-
if (!Object.keys(props).length) throw new (0,
|
|
9901
|
+
if (!Object.keys(props).length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give at least one property to change.");
|
|
9902
9902
|
controller.setLayerProperties(id, props);
|
|
9903
9903
|
return { layer: describe(id) };
|
|
9904
9904
|
}
|
|
@@ -9992,8 +9992,8 @@ function createImageLayerTools(controller) {
|
|
|
9992
9992
|
annotations: { title: "Move a layer's pixels", ...WRITE2 },
|
|
9993
9993
|
handler: ({ layerId, x, y, dx, dy }) => {
|
|
9994
9994
|
const id = exists(layerId);
|
|
9995
|
-
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0,
|
|
9996
|
-
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0,
|
|
9995
|
+
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give x and y, or dx and dy.");
|
|
9996
|
+
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
|
|
9997
9997
|
return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
|
|
9998
9998
|
}
|
|
9999
9999
|
};
|
|
@@ -10065,7 +10065,7 @@ function createImageLayerTools(controller) {
|
|
|
10065
10065
|
annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
|
|
10066
10066
|
handler: ({ layerId, density, feather, enabled, linked }) => {
|
|
10067
10067
|
const id = exists(layerId);
|
|
10068
|
-
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0,
|
|
10068
|
+
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give density, feather, enabled or linked.");
|
|
10069
10069
|
const mask = controller.setLayerMaskProps(id, {
|
|
10070
10070
|
density,
|
|
10071
10071
|
feather,
|
|
@@ -10148,7 +10148,7 @@ function createImageLayerTools(controller) {
|
|
|
10148
10148
|
handler: (args) => {
|
|
10149
10149
|
const id = exists(args.layerId);
|
|
10150
10150
|
const changes = filterValues(args);
|
|
10151
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10151
|
+
if (!Object.keys(changes).length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give at least one value to change.");
|
|
10152
10152
|
return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
|
|
10153
10153
|
}
|
|
10154
10154
|
};
|
|
@@ -10412,8 +10412,8 @@ function describeLayerEffects(effects) {
|
|
|
10412
10412
|
}
|
|
10413
10413
|
function createImageEffectTools(controller) {
|
|
10414
10414
|
const layerArg = (id) => {
|
|
10415
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10416
|
-
|
|
10415
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
|
|
10416
|
+
_chunkXLUYXUBDcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
10417
10417
|
return id;
|
|
10418
10418
|
};
|
|
10419
10419
|
const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
|
|
@@ -10444,7 +10444,7 @@ function createImageEffectTools(controller) {
|
|
|
10444
10444
|
annotations: { title: "Add a layer effect", ...WRITE3 },
|
|
10445
10445
|
handler: ({ layerId, kind, settings, index }) => {
|
|
10446
10446
|
const id = layerArg(layerId);
|
|
10447
|
-
if (!_chunkMZXQTKUMcjs.isLayerEffectKind.call(void 0, kind)) throw new (0,
|
|
10447
|
+
if (!_chunkMZXQTKUMcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`kind must be one of ${_chunkMZXQTKUMcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
|
|
10448
10448
|
const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
|
|
10449
10449
|
return result(id, { effectId: effect.id });
|
|
10450
10450
|
}
|
|
@@ -10464,7 +10464,7 @@ function createImageEffectTools(controller) {
|
|
|
10464
10464
|
handler: ({ layerId, effectId, settings }) => {
|
|
10465
10465
|
const id = layerArg(layerId);
|
|
10466
10466
|
const changes = _nullishCoalesce(settings, () => ( {}));
|
|
10467
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10467
|
+
if (!Object.keys(changes).length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give at least one setting to change.");
|
|
10468
10468
|
controller.updateLayerEffect(id, effectId, changes);
|
|
10469
10469
|
return result(id);
|
|
10470
10470
|
}
|
|
@@ -10516,7 +10516,7 @@ function createImageEffectTools(controller) {
|
|
|
10516
10516
|
},
|
|
10517
10517
|
annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
|
|
10518
10518
|
handler: ({ angle, altitude }) => {
|
|
10519
|
-
if (angle === void 0 && altitude === void 0) throw new (0,
|
|
10519
|
+
if (angle === void 0 && altitude === void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give angle, altitude or both.");
|
|
10520
10520
|
const next = {};
|
|
10521
10521
|
if (angle !== void 0) next.angle = angle;
|
|
10522
10522
|
if (altitude !== void 0) next.altitude = altitude;
|
|
@@ -10697,7 +10697,7 @@ var PaintGesture = (_class8 = class {
|
|
|
10697
10697
|
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.`);
|
|
10698
10698
|
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.`);
|
|
10699
10699
|
const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
|
|
10700
|
-
const b =
|
|
10700
|
+
const b = _chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, layer);
|
|
10701
10701
|
return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
|
|
10702
10702
|
})();
|
|
10703
10703
|
this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
|
|
@@ -10855,9 +10855,9 @@ function createImagePaintTools(controller) {
|
|
|
10855
10855
|
annotations: { title: "Paint a brush stroke", ...WRITE4 },
|
|
10856
10856
|
handler: (args) => {
|
|
10857
10857
|
const tool = args.tool;
|
|
10858
|
-
if (args.mixer !== void 0 && tool !== "mixer") throw new (0,
|
|
10859
|
-
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0,
|
|
10860
|
-
if (args.paint !== void 0 && args.color !== void 0) throw new (0,
|
|
10858
|
+
if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
|
|
10859
|
+
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
|
|
10860
|
+
if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give color or paint, not both.");
|
|
10861
10861
|
const result = controller.paintStroke({
|
|
10862
10862
|
tool,
|
|
10863
10863
|
points: args.points,
|
|
@@ -10988,7 +10988,7 @@ function profileArg(v) {
|
|
|
10988
10988
|
try {
|
|
10989
10989
|
return _chunkDCLJNVZScjs.base64ToBytes.call(void 0, s.slice(4));
|
|
10990
10990
|
} catch (e28) {
|
|
10991
|
-
throw new (0,
|
|
10991
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("The icc: value is not valid base64.");
|
|
10992
10992
|
}
|
|
10993
10993
|
}
|
|
10994
10994
|
return s;
|
|
@@ -11053,10 +11053,10 @@ function createImageColorTools(controller) {
|
|
|
11053
11053
|
annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11054
11054
|
handler: (args) => {
|
|
11055
11055
|
if (args.off === true) {
|
|
11056
|
-
if (args.profile !== void 0) throw new (0,
|
|
11056
|
+
if (args.profile !== void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give either off true or a profile, not both.");
|
|
11057
11057
|
return controller.setProofSetup(null);
|
|
11058
11058
|
}
|
|
11059
|
-
if (args.profile === void 0) throw new (0,
|
|
11059
|
+
if (args.profile === void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
|
|
11060
11060
|
const s = controller.setProofSetup({
|
|
11061
11061
|
profile: profileArg(args.profile),
|
|
11062
11062
|
...args.intent !== void 0 ? { intent: args.intent } : {},
|
|
@@ -11108,7 +11108,7 @@ function createImageColorTools(controller) {
|
|
|
11108
11108
|
},
|
|
11109
11109
|
annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11110
11110
|
handler: (args) => {
|
|
11111
|
-
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0,
|
|
11111
|
+
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
|
|
11112
11112
|
return controller.setColorMode(args.mode, {
|
|
11113
11113
|
...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
|
|
11114
11114
|
...args.intent !== void 0 ? { intent: args.intent } : {}
|
|
@@ -11173,7 +11173,7 @@ function checkSource(controller, source) {
|
|
|
11173
11173
|
const p = source;
|
|
11174
11174
|
const { width, height } = controller.getState().imageDimensions;
|
|
11175
11175
|
if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
|
|
11176
|
-
throw new (0,
|
|
11176
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
|
|
11177
11177
|
}
|
|
11178
11178
|
return p;
|
|
11179
11179
|
}
|
|
@@ -11367,10 +11367,10 @@ function createImageRetouchTools(controller) {
|
|
|
11367
11367
|
annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
|
|
11368
11368
|
handler: (args) => {
|
|
11369
11369
|
if (args.clear === true) {
|
|
11370
|
-
if (args.x !== void 0 || args.y !== void 0) throw new (0,
|
|
11370
|
+
if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give either clear true or x and y, not both.");
|
|
11371
11371
|
return controller.setCloneSource(null);
|
|
11372
11372
|
}
|
|
11373
|
-
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0,
|
|
11373
|
+
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
|
|
11374
11374
|
return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
|
|
11375
11375
|
}
|
|
11376
11376
|
};
|
|
@@ -11391,11 +11391,11 @@ var DATA = {
|
|
|
11391
11391
|
description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
|
|
11392
11392
|
};
|
|
11393
11393
|
function psdBytesFromBase64(data) {
|
|
11394
|
-
if (typeof data !== "string" || !data.trim()) throw new (0,
|
|
11394
|
+
if (typeof data !== "string" || !data.trim()) throw new (0, _chunkXLUYXUBDcjs.PsdError)("data is required: the PSD file as base64.");
|
|
11395
11395
|
const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
|
|
11396
|
-
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0,
|
|
11396
|
+
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkXLUYXUBDcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
|
|
11397
11397
|
const bytes = _chunkDCLJNVZScjs.base64ToBytes.call(void 0, body);
|
|
11398
|
-
if (bytes.length < 26) throw new (0,
|
|
11398
|
+
if (bytes.length < 26) throw new (0, _chunkXLUYXUBDcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
|
|
11399
11399
|
return bytes;
|
|
11400
11400
|
}
|
|
11401
11401
|
function createImagePsdTools(controller) {
|
|
@@ -11406,7 +11406,7 @@ function createImagePsdTools(controller) {
|
|
|
11406
11406
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
11407
11407
|
annotations: { title: "Inspect a PSD", ...READ7 },
|
|
11408
11408
|
handler: ({ data }) => {
|
|
11409
|
-
const res =
|
|
11409
|
+
const res = _chunkXLUYXUBDcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
|
|
11410
11410
|
return {
|
|
11411
11411
|
width: res.width,
|
|
11412
11412
|
height: res.height,
|
|
@@ -11493,7 +11493,7 @@ var GEOMETRY = {
|
|
|
11493
11493
|
dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
|
|
11494
11494
|
reference: {
|
|
11495
11495
|
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}.",
|
|
11496
|
-
anyOf: [{ type: "string", enum:
|
|
11496
|
+
anyOf: [{ type: "string", enum: _chunkXLUYXUBDcjs.TRANSFORM_ANCHORS }, POINT]
|
|
11497
11497
|
},
|
|
11498
11498
|
matrix: {
|
|
11499
11499
|
type: "array",
|
|
@@ -11514,14 +11514,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
|
|
|
11514
11514
|
function geometryFrom(args) {
|
|
11515
11515
|
const numeric = NUMERIC.filter((k) => args[k] !== void 0);
|
|
11516
11516
|
const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
|
|
11517
|
-
if (ways === 0) throw new (0,
|
|
11518
|
-
if (ways > 1) throw new (0,
|
|
11517
|
+
if (ways === 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
|
|
11518
|
+
if (ways > 1) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
|
|
11519
11519
|
if (args.matrix !== void 0) return { matrix: args.matrix };
|
|
11520
11520
|
if (args.corners !== void 0) return { corners: args.corners };
|
|
11521
11521
|
const params = {};
|
|
11522
11522
|
for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
|
|
11523
|
-
if (params.scaleX === 0 || params.scaleY === 0) throw new (0,
|
|
11524
|
-
if (typeof params.reference === "string" && !
|
|
11523
|
+
if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
|
|
11524
|
+
if (typeof params.reference === "string" && !_chunkXLUYXUBDcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkXLUYXUBDcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
|
|
11525
11525
|
return { params };
|
|
11526
11526
|
}
|
|
11527
11527
|
function targetFrom(args) {
|
|
@@ -11570,15 +11570,15 @@ function createImageTransformTools(controller) {
|
|
|
11570
11570
|
moved: [...s.moves],
|
|
11571
11571
|
frame: { ...s.box },
|
|
11572
11572
|
corners: s.startGeometry.corners.map(roundPoint),
|
|
11573
|
-
center: roundPoint(
|
|
11573
|
+
center: roundPoint(_chunkXLUYXUBDcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
|
|
11574
11574
|
};
|
|
11575
11575
|
if (s.smartObject) out.smartObject = true;
|
|
11576
11576
|
s.cancel();
|
|
11577
11577
|
if (args.meshColumns !== void 0) {
|
|
11578
11578
|
const cols = args.meshColumns;
|
|
11579
11579
|
const rows = _nullishCoalesce(args.meshRows, () => ( cols));
|
|
11580
|
-
const mesh =
|
|
11581
|
-
out.mesh = { columns: cols, rows, pointsPerRow:
|
|
11580
|
+
const mesh = _chunkORE334I6cjs.identityWarpMesh.call(void 0, s.box, cols, rows);
|
|
11581
|
+
out.mesh = { columns: cols, rows, pointsPerRow: _chunkORE334I6cjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkORE334I6cjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
|
|
11582
11582
|
}
|
|
11583
11583
|
return out;
|
|
11584
11584
|
}
|
|
@@ -11603,7 +11603,7 @@ function createImageTransformTools(controller) {
|
|
|
11603
11603
|
type: "object",
|
|
11604
11604
|
properties: {
|
|
11605
11605
|
...TARGET3,
|
|
11606
|
-
style: { type: "string", enum:
|
|
11606
|
+
style: { type: "string", enum: _chunkORE334I6cjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
|
|
11607
11607
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
|
|
11608
11608
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
|
|
11609
11609
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
|
|
@@ -11625,11 +11625,11 @@ function createImageTransformTools(controller) {
|
|
|
11625
11625
|
annotations: { title: "Warp a layer", ...WRITE6 },
|
|
11626
11626
|
handler: (args) => {
|
|
11627
11627
|
const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
|
|
11628
|
-
if (hasPreset && args.mesh !== void 0) throw new (0,
|
|
11629
|
-
if (!hasPreset && args.mesh === void 0) throw new (0,
|
|
11628
|
+
if (hasPreset && args.mesh !== void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
|
|
11629
|
+
if (!hasPreset && args.mesh === void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give a preset style or a mesh.");
|
|
11630
11630
|
let warp;
|
|
11631
11631
|
if (hasPreset) {
|
|
11632
|
-
if (args.style === void 0) throw new (0,
|
|
11632
|
+
if (args.style === void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkORE334I6cjs.WARP_STYLES.join(", ")}.`);
|
|
11633
11633
|
warp = {
|
|
11634
11634
|
style: args.style,
|
|
11635
11635
|
bend: _nullishCoalesce(args.bend, () => ( 50)),
|
|
@@ -11640,7 +11640,7 @@ function createImageTransformTools(controller) {
|
|
|
11640
11640
|
} else {
|
|
11641
11641
|
const m = args.mesh;
|
|
11642
11642
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
11643
|
-
if (m.points.length !== want) throw new (0,
|
|
11643
|
+
if (m.points.length !== want) throw new (0, _chunkXLUYXUBDcjs.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}.`);
|
|
11644
11644
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
11645
11645
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
11646
11646
|
}
|
|
@@ -11735,13 +11735,13 @@ function settingsFrom(args) {
|
|
|
11735
11735
|
return out;
|
|
11736
11736
|
}
|
|
11737
11737
|
function imageArg(image) {
|
|
11738
|
-
if (typeof image !== "string" || !image.trim()) throw new (0,
|
|
11738
|
+
if (typeof image !== "string" || !image.trim()) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
|
|
11739
11739
|
return image.trim();
|
|
11740
11740
|
}
|
|
11741
11741
|
function createImageSmartObjectTools(controller) {
|
|
11742
11742
|
const smartId = (id) => {
|
|
11743
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
11744
|
-
|
|
11743
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
|
|
11744
|
+
_chunkXLUYXUBDcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
|
|
11745
11745
|
return id;
|
|
11746
11746
|
};
|
|
11747
11747
|
const info = (id) => {
|
|
@@ -11778,7 +11778,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11778
11778
|
},
|
|
11779
11779
|
annotations: { title: "Convert to Smart Object", ...WRITE7 },
|
|
11780
11780
|
handler: ({ layerIds, name }) => {
|
|
11781
|
-
for (const id2 of _nullishCoalesce(layerIds, () => ( [])))
|
|
11781
|
+
for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkXLUYXUBDcjs.requireLayer.call(void 0, controller.getLayers(), id2);
|
|
11782
11782
|
const id = controller.convertToSmartObject(layerIds, { name });
|
|
11783
11783
|
return { layer: layerSummary(id), smartObject: info(id) };
|
|
11784
11784
|
}
|
|
@@ -11815,7 +11815,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11815
11815
|
{
|
|
11816
11816
|
type: "object",
|
|
11817
11817
|
properties: {
|
|
11818
|
-
style: { type: "string", enum:
|
|
11818
|
+
style: { type: "string", enum: _chunkORE334I6cjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
|
|
11819
11819
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
|
|
11820
11820
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
|
|
11821
11821
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
|
|
@@ -11851,12 +11851,12 @@ function createImageSmartObjectTools(controller) {
|
|
|
11851
11851
|
else if (w) {
|
|
11852
11852
|
const m = w;
|
|
11853
11853
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
11854
|
-
if (m.points.length !== want) throw new (0,
|
|
11854
|
+
if (m.points.length !== want) throw new (0, _chunkXLUYXUBDcjs.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}.`);
|
|
11855
11855
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
11856
11856
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
11857
11857
|
}
|
|
11858
11858
|
const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
|
|
11859
|
-
if (!keys.some((k) => args[k] !== void 0)) throw new (0,
|
|
11859
|
+
if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
|
|
11860
11860
|
const res = controller.setSmartObjectTransform(id, {
|
|
11861
11861
|
corners: args.corners,
|
|
11862
11862
|
matrix: args.matrix,
|
|
@@ -11981,7 +11981,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11981
11981
|
handler: (args) => {
|
|
11982
11982
|
const id = smartId(args.layerId);
|
|
11983
11983
|
const changes = settingsFrom(args);
|
|
11984
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
11984
|
+
if (!Object.keys(changes).length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give at least one value to change.");
|
|
11985
11985
|
const filter = controller.updateSmartFilter(id, args.filterId, changes);
|
|
11986
11986
|
return { layerId: id, filter, smartFilters: info(id).smartFilters };
|
|
11987
11987
|
}
|
|
@@ -12302,8 +12302,8 @@ function geometry(args) {
|
|
|
12302
12302
|
}
|
|
12303
12303
|
function createImageShapeTools(controller) {
|
|
12304
12304
|
const shapeId = (id) => {
|
|
12305
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12306
|
-
|
|
12305
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
|
|
12306
|
+
_chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
|
|
12307
12307
|
return id;
|
|
12308
12308
|
};
|
|
12309
12309
|
const layerSummary = (id) => {
|
|
@@ -12378,7 +12378,7 @@ function createImageShapeTools(controller) {
|
|
|
12378
12378
|
annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
|
|
12379
12379
|
handler: ({ layerId, fill, stroke, fillRule }) => {
|
|
12380
12380
|
const id = shapeId(layerId);
|
|
12381
|
-
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0,
|
|
12381
|
+
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
|
|
12382
12382
|
return controller.setShapeStyle(id, { fill, stroke, fillRule });
|
|
12383
12383
|
}
|
|
12384
12384
|
};
|
|
@@ -12427,7 +12427,7 @@ function createImageShapeTools(controller) {
|
|
|
12427
12427
|
handler: ({ layerId, componentIndex, ...rest }) => {
|
|
12428
12428
|
const id = shapeId(layerId);
|
|
12429
12429
|
const change = geometry(rest);
|
|
12430
|
-
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0,
|
|
12430
|
+
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Give shape, subpaths or op to change.");
|
|
12431
12431
|
return controller.setShapeComponent(id, componentIndex, change);
|
|
12432
12432
|
}
|
|
12433
12433
|
};
|
|
@@ -12501,8 +12501,8 @@ function pick2(args, keys) {
|
|
|
12501
12501
|
}
|
|
12502
12502
|
function createImageTypeTools(controller) {
|
|
12503
12503
|
const typeId = (id) => {
|
|
12504
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12505
|
-
|
|
12504
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
|
|
12505
|
+
_chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
|
|
12506
12506
|
return id;
|
|
12507
12507
|
};
|
|
12508
12508
|
const layerSummary = (id) => {
|
|
@@ -12582,7 +12582,7 @@ function createImageTypeTools(controller) {
|
|
|
12582
12582
|
annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
|
|
12583
12583
|
handler: (args) => {
|
|
12584
12584
|
const style = pick2(args, Object.keys(STYLE));
|
|
12585
|
-
if (!Object.keys(style).length) throw new (0,
|
|
12585
|
+
if (!Object.keys(style).length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
|
|
12586
12586
|
return controller.setTextStyle(typeId(args.layerId), style, range(args));
|
|
12587
12587
|
}
|
|
12588
12588
|
};
|
|
@@ -12594,7 +12594,7 @@ function createImageTypeTools(controller) {
|
|
|
12594
12594
|
annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
|
|
12595
12595
|
handler: (args) => {
|
|
12596
12596
|
const style = pick2(args, Object.keys(PARAGRAPH));
|
|
12597
|
-
if (!Object.keys(style).length) throw new (0,
|
|
12597
|
+
if (!Object.keys(style).length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
|
|
12598
12598
|
return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
|
|
12599
12599
|
}
|
|
12600
12600
|
};
|
|
@@ -12616,7 +12616,7 @@ function createImageTypeTools(controller) {
|
|
|
12616
12616
|
annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
|
|
12617
12617
|
handler: ({ layerId, kind, width, height }) => {
|
|
12618
12618
|
const id = typeId(layerId);
|
|
12619
|
-
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0,
|
|
12619
|
+
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("kind box needs width and height in pixels.");
|
|
12620
12620
|
return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
|
|
12621
12621
|
}
|
|
12622
12622
|
};
|
|
@@ -12638,7 +12638,7 @@ function createImageTypeTools(controller) {
|
|
|
12638
12638
|
var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
|
|
12639
12639
|
function adjustmentsSummary(adjustments) {
|
|
12640
12640
|
return {
|
|
12641
|
-
process:
|
|
12641
|
+
process: _chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, adjustments.process),
|
|
12642
12642
|
values: readAdjustmentControls(adjustments),
|
|
12643
12643
|
layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
|
|
12644
12644
|
};
|
|
@@ -12681,7 +12681,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12681
12681
|
default: def,
|
|
12682
12682
|
...requiresProcess ? { requiresProcess } : {}
|
|
12683
12683
|
})),
|
|
12684
|
-
layerKinds:
|
|
12684
|
+
layerKinds: _chunkXLUYXUBDcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
|
|
12685
12685
|
kind,
|
|
12686
12686
|
label,
|
|
12687
12687
|
controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
|
|
@@ -12767,7 +12767,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12767
12767
|
const result = { applied, clamped };
|
|
12768
12768
|
if (typeof label === "string" && label) result.label = label;
|
|
12769
12769
|
const notes = [];
|
|
12770
|
-
if ("tint" in applied &&
|
|
12770
|
+
if ("tint" in applied && _chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
|
|
12771
12771
|
notes.push("Tint has no effect on process 1 edits.");
|
|
12772
12772
|
}
|
|
12773
12773
|
if (notes.length) result.notes = notes;
|
|
@@ -12777,11 +12777,11 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12777
12777
|
const addLayer = {
|
|
12778
12778
|
name: "add_adjustment_layer",
|
|
12779
12779
|
title: "Add an adjustment layer",
|
|
12780
|
-
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " +
|
|
12780
|
+
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkXLUYXUBDcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
|
|
12781
12781
|
inputSchema: {
|
|
12782
12782
|
type: "object",
|
|
12783
12783
|
properties: {
|
|
12784
|
-
kind: { type: "string", enum:
|
|
12784
|
+
kind: { type: "string", enum: _chunkXLUYXUBDcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
|
|
12785
12785
|
params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
|
|
12786
12786
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
|
|
12787
12787
|
blend: { type: "string", enum: _chunkJ5BA3BQ6cjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
|
|
@@ -12800,7 +12800,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12800
12800
|
openWorldHint: false
|
|
12801
12801
|
},
|
|
12802
12802
|
handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
|
|
12803
|
-
if (!
|
|
12803
|
+
if (!_chunkXLUYXUBDcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
|
|
12804
12804
|
if (blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
12805
12805
|
if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
|
|
12806
12806
|
for (const ref of [aboveId, parentId]) {
|
|
@@ -12894,7 +12894,7 @@ function boxToCurvePoint(x, y, width, height) {
|
|
|
12894
12894
|
return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
|
|
12895
12895
|
}
|
|
12896
12896
|
function curveSvgPath(points, width, height, samples = 64) {
|
|
12897
|
-
const lut =
|
|
12897
|
+
const lut = _chunkXLUYXUBDcjs.curveLutFromLevels.call(void 0, points);
|
|
12898
12898
|
const n = lut.length - 1;
|
|
12899
12899
|
let d = "";
|
|
12900
12900
|
for (let i = 0; i <= samples; i++) {
|
|
@@ -13404,7 +13404,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13404
13404
|
else {
|
|
13405
13405
|
const layout = this.layout();
|
|
13406
13406
|
if (layout && layout.lines.length) {
|
|
13407
|
-
const c =
|
|
13407
|
+
const c = _chunkORE334I6cjs.caretAt.call(void 0, layout, f);
|
|
13408
13408
|
const line = layout.lines[c.line];
|
|
13409
13409
|
if (to === "home") f = line.start;
|
|
13410
13410
|
else if (to === "end") {
|
|
@@ -13499,7 +13499,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13499
13499
|
styleHere() {
|
|
13500
13500
|
const layer = this.layer;
|
|
13501
13501
|
const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
|
|
13502
|
-
return
|
|
13502
|
+
return _chunkORE334I6cjs.styleAt.call(void 0, layer.runs, at, _chunkORE334I6cjs.DEFAULT_TEXT_STYLE);
|
|
13503
13503
|
}
|
|
13504
13504
|
info() {
|
|
13505
13505
|
return this.controller.getTextLayer(this.layerId);
|
|
@@ -13508,8 +13508,8 @@ var TextEditSession = (_class11 = class {
|
|
|
13508
13508
|
overlay() {
|
|
13509
13509
|
const layer = this.layer;
|
|
13510
13510
|
const layout = this.layout();
|
|
13511
|
-
const m =
|
|
13512
|
-
const at = (x, y) =>
|
|
13511
|
+
const m = _chunkXLUYXUBDcjs.textMatrix.call(void 0, layer);
|
|
13512
|
+
const at = (x, y) => _chunkORE334I6cjs.applyMatrix.call(void 0, m, { x, y });
|
|
13513
13513
|
let frame = null;
|
|
13514
13514
|
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)];
|
|
13515
13515
|
else if (layout) {
|
|
@@ -13529,7 +13529,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13529
13529
|
selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
|
|
13530
13530
|
}
|
|
13531
13531
|
}
|
|
13532
|
-
const c =
|
|
13532
|
+
const c = _chunkORE334I6cjs.caretAt.call(void 0, layout, this.focus);
|
|
13533
13533
|
return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
|
|
13534
13534
|
}
|
|
13535
13535
|
/** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
|
|
@@ -13544,7 +13544,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13544
13544
|
}
|
|
13545
13545
|
if (this.layer.name === "Text" && this.changed) {
|
|
13546
13546
|
try {
|
|
13547
|
-
this.controller.setLayerProperties(this.layerId, { name:
|
|
13547
|
+
this.controller.setLayerProperties(this.layerId, { name: _chunkXLUYXUBDcjs.typeLayerName.call(void 0, this.text) }, false);
|
|
13548
13548
|
} catch (e30) {
|
|
13549
13549
|
}
|
|
13550
13550
|
}
|
|
@@ -13555,8 +13555,8 @@ function typeLayerAt(controller, p, slop = 4) {
|
|
|
13555
13555
|
const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
|
|
13556
13556
|
for (const l of layers) {
|
|
13557
13557
|
if (!l.visible) continue;
|
|
13558
|
-
const inv = invert(
|
|
13559
|
-
const q =
|
|
13558
|
+
const inv = invert(_chunkXLUYXUBDcjs.textMatrix.call(void 0, l));
|
|
13559
|
+
const q = _chunkORE334I6cjs.applyMatrix.call(void 0, inv, p);
|
|
13560
13560
|
let b = null;
|
|
13561
13561
|
if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
|
|
13562
13562
|
else {
|
|
@@ -13666,7 +13666,7 @@ function layerPanelRows(layers, activeId) {
|
|
|
13666
13666
|
}
|
|
13667
13667
|
function layerLabel(layer) {
|
|
13668
13668
|
if (layer.name) return layer.name;
|
|
13669
|
-
if (layer.type === "adjustment") return
|
|
13669
|
+
if (layer.type === "adjustment") return _chunkXLUYXUBDcjs.adjustmentKindLabel.call(void 0, layer.kind);
|
|
13670
13670
|
return layer.type === "group" ? "Group" : "Layer";
|
|
13671
13671
|
}
|
|
13672
13672
|
function layerBadge(layer) {
|
|
@@ -14138,7 +14138,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
|
|
|
14138
14138
|
];
|
|
14139
14139
|
var WARP_STYLE_OPTIONS = [
|
|
14140
14140
|
{ id: "custom", label: "Custom" },
|
|
14141
|
-
...
|
|
14141
|
+
..._chunkORE334I6cjs.WARP_STYLES.map((id) => ({ id, label: _chunkORE334I6cjs.WARP_STYLE_LABELS[id] }))
|
|
14142
14142
|
];
|
|
14143
14143
|
var WARP_GRID_OPTIONS = [
|
|
14144
14144
|
{ id: "1x1", label: "Default", columns: 1, rows: 1 },
|
|
@@ -14274,7 +14274,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14274
14274
|
setMode(mode) {
|
|
14275
14275
|
this.modeValue = mode;
|
|
14276
14276
|
const s = this.session;
|
|
14277
|
-
if (mode === "warp" && s && !this.mesh) this.mesh =
|
|
14277
|
+
if (mode === "warp" && s && !this.mesh) this.mesh = _chunkORE334I6cjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
|
|
14278
14278
|
this.changed();
|
|
14279
14279
|
}
|
|
14280
14280
|
/** The Warp options bar's settings. */
|
|
@@ -14296,13 +14296,13 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14296
14296
|
this.modeValue = "warp";
|
|
14297
14297
|
const next = { ...this.warpSettings, ...changes };
|
|
14298
14298
|
this.warpSettings = next;
|
|
14299
|
-
let mesh = _nullishCoalesce(this.mesh, () => (
|
|
14299
|
+
let mesh = _nullishCoalesce(this.mesh, () => ( _chunkORE334I6cjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
|
|
14300
14300
|
if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
|
|
14301
14301
|
const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
|
|
14302
|
-
mesh = _nullishCoalesce(
|
|
14303
|
-
mesh =
|
|
14302
|
+
mesh = _nullishCoalesce(_chunkORE334I6cjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkORE334I6cjs.identityWarpMesh.call(void 0, s.box)));
|
|
14303
|
+
mesh = _chunkORE334I6cjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14304
14304
|
}
|
|
14305
|
-
if ("columns" in changes || "rows" in changes) mesh =
|
|
14305
|
+
if ("columns" in changes || "rows" in changes) mesh = _chunkORE334I6cjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14306
14306
|
this.mesh = mesh;
|
|
14307
14307
|
this.changed();
|
|
14308
14308
|
this.preview();
|
|
@@ -14349,11 +14349,11 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14349
14349
|
const m = this.mesh;
|
|
14350
14350
|
const at = (p) => _nullishCoalesce(_chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p), () => ( p));
|
|
14351
14351
|
const pts = m.points.map(at);
|
|
14352
|
-
const edit =
|
|
14352
|
+
const edit = _chunkORE334I6cjs.warpMeshEditPoints.call(void 0, m);
|
|
14353
14353
|
out.handles = [];
|
|
14354
|
-
out.outline =
|
|
14354
|
+
out.outline = _chunkORE334I6cjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
|
|
14355
14355
|
out.warp = {
|
|
14356
|
-
curves:
|
|
14356
|
+
curves: _chunkORE334I6cjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
|
|
14357
14357
|
anchors: edit.anchors.map((i) => pts[i]),
|
|
14358
14358
|
handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
|
|
14359
14359
|
};
|
|
@@ -14377,7 +14377,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14377
14377
|
if (!o) return null;
|
|
14378
14378
|
if (this.modeValue === "warp" && this.mesh) {
|
|
14379
14379
|
const h = this.homography();
|
|
14380
|
-
const edit =
|
|
14380
|
+
const edit = _chunkORE334I6cjs.warpMeshEditPoints.call(void 0, this.mesh);
|
|
14381
14381
|
let best2 = -1;
|
|
14382
14382
|
let bestD2 = tolerance;
|
|
14383
14383
|
for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
|
|
@@ -14422,7 +14422,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14422
14422
|
if (this.modeValue === "warp" && this.mesh && handle === "inside") {
|
|
14423
14423
|
const q = this.toFrame(p, this.corners);
|
|
14424
14424
|
if (q) {
|
|
14425
|
-
const r =
|
|
14425
|
+
const r = _chunkORE334I6cjs.warpMeshParamAt.call(void 0, this.mesh, q);
|
|
14426
14426
|
st = { s: r.s, t: r.t };
|
|
14427
14427
|
}
|
|
14428
14428
|
}
|
|
@@ -14455,8 +14455,8 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14455
14455
|
if (!a || !b) return;
|
|
14456
14456
|
const delta = { x: b.x - a.x, y: b.y - a.y };
|
|
14457
14457
|
const i = meshIndex(d.handle);
|
|
14458
|
-
if (i >= 0) this.mesh =
|
|
14459
|
-
else if (d.handle === "inside" && d.st) this.mesh =
|
|
14458
|
+
if (i >= 0) this.mesh = _chunkORE334I6cjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
|
|
14459
|
+
else if (d.handle === "inside" && d.st) this.mesh = _chunkORE334I6cjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
|
|
14460
14460
|
else return;
|
|
14461
14461
|
this.warpSettings = { ...this.warpSettings, style: "custom" };
|
|
14462
14462
|
this.changed();
|
|
@@ -14580,7 +14580,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14580
14580
|
bar() {
|
|
14581
14581
|
const s = this.session;
|
|
14582
14582
|
if (!s || !this.corners) return null;
|
|
14583
|
-
const read =
|
|
14583
|
+
const read = _chunkXLUYXUBDcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
|
|
14584
14584
|
return {
|
|
14585
14585
|
affine: read.affine,
|
|
14586
14586
|
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
@@ -14605,7 +14605,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14605
14605
|
this.changed();
|
|
14606
14606
|
return;
|
|
14607
14607
|
}
|
|
14608
|
-
const m =
|
|
14608
|
+
const m = _chunkXLUYXUBDcjs.matrixFromParams.call(void 0, s.box, {
|
|
14609
14609
|
scaleX: next.scaleX,
|
|
14610
14610
|
scaleY: next.scaleY,
|
|
14611
14611
|
rotate: next.rotate,
|
|
@@ -14615,7 +14615,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14615
14615
|
dx: next.x - this.refBox.x,
|
|
14616
14616
|
dy: next.y - this.refBox.y
|
|
14617
14617
|
});
|
|
14618
|
-
this.setCorners(
|
|
14618
|
+
this.setCorners(_chunkXLUYXUBDcjs.cornersFromMatrix.call(void 0, s.box, m));
|
|
14619
14619
|
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
14620
14620
|
this.changed();
|
|
14621
14621
|
}
|
|
@@ -15702,5 +15702,5 @@ function createImageEffectsToolProvider(controller, options = {}) {
|
|
|
15702
15702
|
|
|
15703
15703
|
|
|
15704
15704
|
|
|
15705
|
-
exports.ADJUSTMENT_KEYS = _chunkO5RVCDECcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkO5RVCDECcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkO5RVCDECcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkO5RVCDECcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkO5RVCDECcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.D50; exports.D65 = _chunkO5RVCDECcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkQQKTOA4Ucjs.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 = _chunkO5RVCDECcjs.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 = _chunkQQKTOA4Ucjs.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 = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkO5RVCDECcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkMZXQTKUMcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkO5RVCDECcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkO5RVCDECcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkO5RVCDECcjs.LUMA_709; exports.LayerCompositor = _chunkO5RVCDECcjs.LayerCompositor; exports.LayerEffectError = _chunkMZXQTKUMcjs.LayerEffectError; exports.LayerOperationError = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkFHPVDTI2cjs.PARAM; exports.PARAM_FLOATS = _chunkFHPVDTI2cjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk6GFRKLLScjs.SmudgeTip; exports.StrokeCoverage = _chunk6GFRKLLScjs.StrokeCoverage; exports.SurfaceDraft = _chunkJ5BA3BQ6cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkO5RVCDECcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkO5RVCDECcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkO5RVCDECcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkJ5BA3BQ6cjs.TILE; exports.TILE_SHIFT = _chunkJ5BA3BQ6cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkO5RVCDECcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk6GFRKLLScjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkO5RVCDECcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkW6M7C7R3cjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.VIBRANCE_GREY; exports.W9 = _chunkFHPVDTI2cjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkQQKTOA4Ucjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkQQKTOA4Ucjs.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 = _chunkO5RVCDECcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkO5RVCDECcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkO5RVCDECcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkO5RVCDECcjs.activeSmartFilters; exports.addLayerEffect = _chunkO5RVCDECcjs.addLayerEffect; exports.addLayerFilter = _chunkO5RVCDECcjs.addLayerFilter; exports.addPaintGradientStop = _chunk6GFRKLLScjs.addPaintGradientStop; exports.addSmartFilter = _chunkO5RVCDECcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkO5RVCDECcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkO5RVCDECcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkO5RVCDECcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkO5RVCDECcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkO5RVCDECcjs.anchorPoint; exports.annotationBlend = _chunkO5RVCDECcjs.annotationBlend; exports.annotationLayerFor = _chunkO5RVCDECcjs.annotationLayerFor; exports.annotationLayerName = _chunkO5RVCDECcjs.annotationLayerName; exports.annotationOfLayer = _chunkO5RVCDECcjs.annotationOfLayer; exports.annotationOfShape = _chunkO5RVCDECcjs.annotationOfShape; exports.annotationOfType = _chunkO5RVCDECcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkO5RVCDECcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkO5RVCDECcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkO5RVCDECcjs.applyAdjustments; exports.applyBoxBlur = _chunkO5RVCDECcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkO5RVCDECcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkO5RVCDECcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkO5RVCDECcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkO5RVCDECcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkO5RVCDECcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkO5RVCDECcjs.applyParams; exports.applyProcess2Adjustments = _chunkO5RVCDECcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkO5RVCDECcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkW6M7C7R3cjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkO5RVCDECcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk6GFRKLLScjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk6GFRKLLScjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkW6M7C7R3cjs.applyToneToDeepTile; exports.backgroundLayer = _chunkO5RVCDECcjs.backgroundLayer; exports.base64ToBytes = _chunkDCLJNVZScjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkW6M7C7R3cjs.bestOffset; exports.blackWhiteGray = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.blurFilter; exports.borderCoverage = _chunkO5RVCDECcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkO5RVCDECcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkO5RVCDECcjs.buildToneLut; exports.builtinPattern = _chunkMZXQTKUMcjs.builtinPattern; exports.builtinPatternIds = _chunkMZXQTKUMcjs.builtinPatternIds; exports.bytesToBase64 = _chunkDCLJNVZScjs.bytesToBase64; exports.calculateCropDrag = _chunkO5RVCDECcjs.calculateCropDrag; exports.canShareMemory = _chunkFHPVDTI2cjs.canShareMemory; exports.canvasCompositeOperation = _chunkJ5BA3BQ6cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkO5RVCDECcjs.canvasToImagePoint; exports.caretAt = _chunkQQKTOA4Ucjs.caretAt; exports.changedTiles = _chunkMZXQTKUMcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkO5RVCDECcjs.clampCropToImage; exports.cleanMixer = _chunk6GFRKLLScjs.cleanMixer; exports.cloneSourceLabel = cloneSourceLabel; exports.collectTiles = _chunkJ5BA3BQ6cjs.collectTiles; exports.colorBalanceChannel = _chunkO5RVCDECcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkO5RVCDECcjs.combineSelections; exports.compileAdjustmentLayer = _chunkO5RVCDECcjs.compileAdjustmentLayer; exports.componentPath = _chunkO5RVCDECcjs.componentPath; exports.compositeDeep = _chunkO5RVCDECcjs.compositeDeep; exports.compositeSurfaceOver = _chunkMZXQTKUMcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkO5RVCDECcjs.computeSelectionBounds; exports.contentBounds = _chunkJ5BA3BQ6cjs.contentBounds; exports.contentsBox = _chunkO5RVCDECcjs.contentsBox; exports.contentsSurface = _chunkO5RVCDECcjs.contentsSurface; exports.contractCoverage = _chunkO5RVCDECcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkJ5BA3BQ6cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkO5RVCDECcjs.convertToSmartObject; exports.copySmartObject = _chunkO5RVCDECcjs.copySmartObject; exports.cornersFromMatrix = _chunkO5RVCDECcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk6GFRKLLScjs.coverageTileCoord; exports.coverageToByte = _chunkO5RVCDECcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkO5RVCDECcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk6GFRKLLScjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkQQKTOA4Ucjs.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 = _chunkQQKTOA4Ucjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkQQKTOA4Ucjs.createOutlineTextShaper; exports.createPigment = _chunkJ5BA3BQ6cjs.createPigment; exports.createPigmentTools = _chunkFHPVDTI2cjs.createPigmentTools; exports.createSelectionMask = _chunkO5RVCDECcjs.createSelectionMask; exports.createShapeLayer = _chunkO5RVCDECcjs.createShapeLayer; exports.createTypeLayer = _chunkO5RVCDECcjs.createTypeLayer; exports.createWetGpuEngine = _chunkFHPVDTI2cjs.createWetGpuEngine; exports.cssFont = _chunkQQKTOA4Ucjs.cssFont; exports.cssFontFamily = _chunkQQKTOA4Ucjs.cssFontFamily; exports.curveLut = _chunkMZXQTKUMcjs.curveLut; exports.curveLutFromLevels = _chunkO5RVCDECcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk6GFRKLLScjs.dabCoverage; exports.dabRect = _chunk6GFRKLLScjs.dabRect; exports.decodeDeepSurface = _chunkO5RVCDECcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkO5RVCDECcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkO5RVCDECcjs.decodeLayerMask; exports.decodeMergedImage = _chunkO5RVCDECcjs.decodeMergedImage; exports.decodePlanes = _chunkO5RVCDECcjs.decodePlanes; exports.decodePng = _chunkDCLJNVZScjs.decodePng; exports.decodePngDataUrl = _chunkO5RVCDECcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkO5RVCDECcjs.decodeSelectionRle; exports.deepBytes = _chunkJ5BA3BQ6cjs.deepBytes; exports.deepTile = _chunkJ5BA3BQ6cjs.deepTile; exports.defaultAdjustmentParams = _chunkO5RVCDECcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkMZXQTKUMcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkMZXQTKUMcjs.defaultLayerEffect; exports.defaultShapeName = _chunkO5RVCDECcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkO5RVCDECcjs.depthMaskAlpha; exports.depthOf = _chunkJ5BA3BQ6cjs.depthOf; exports.depthRasterMask = _chunkO5RVCDECcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkO5RVCDECcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkO5RVCDECcjs.deserializeEffects; exports.deserializeLayer = _chunkO5RVCDECcjs.deserializeLayer; exports.deserializeLayers = _chunkO5RVCDECcjs.deserializeLayers; exports.deserializePatterns = _chunkO5RVCDECcjs.deserializePatterns; exports.deserializeSelection = _chunkO5RVCDECcjs.deserializeSelection; exports.developFilter = _chunkO5RVCDECcjs.developFilter; exports.developFromAdjustments = _chunkO5RVCDECcjs.developFromAdjustments; exports.developTarget = _chunkO5RVCDECcjs.developTarget; exports.dexp = _chunkFHPVDTI2cjs.dexp; exports.dilateMask = _chunkW6M7C7R3cjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkO5RVCDECcjs.distanceTransform; exports.dlog = _chunkFHPVDTI2cjs.dlog; exports.documentContents = _chunkO5RVCDECcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkW6M7C7R3cjs.dodgeBurn; exports.dodgeBurnCurve = _chunkW6M7C7R3cjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkFHPVDTI2cjs.dpow; exports.dragWarpMeshPoint = _chunkQQKTOA4Ucjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkFHPVDTI2cjs.dsincos; exports.duplicateLayer = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.encodeDeepSurface; exports.encodePng = _chunkDCLJNVZScjs.encodePng; exports.encodeRle = _chunkO5RVCDECcjs.encodeRle; exports.encodeSelectionRle = _chunkO5RVCDECcjs.encodeSelectionRle; exports.encodeSurface = _chunkO5RVCDECcjs.encodeSurface; exports.evalWarpMesh = _chunkQQKTOA4Ucjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkO5RVCDECcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk6GFRKLLScjs.exchangeRates; exports.expNeg = _chunkFHPVDTI2cjs.expNeg; exports.expandCoverage = _chunkO5RVCDECcjs.expandCoverage; exports.exportPsd = _chunkO5RVCDECcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkO5RVCDECcjs.featherCoverage; exports.fillRect = _chunkJ5BA3BQ6cjs.fillRect; exports.filmPixel = _chunkFHPVDTI2cjs.filmPixel; exports.filmReflectance = _chunkFHPVDTI2cjs.filmReflectance; exports.filterMaskCoverage = _chunkO5RVCDECcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkMZXQTKUMcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkFHPVDTI2cjs.findWebGpu; exports.finishTile = _chunkJ5BA3BQ6cjs.finishTile; exports.fitParagraphRuns = _chunkQQKTOA4Ucjs.fitParagraphRuns; exports.fitRuns = _chunkQQKTOA4Ucjs.fitRuns; exports.flattenLayers = _chunkMZXQTKUMcjs.flattenLayers; exports.flattenPath = _chunkO5RVCDECcjs.flattenPath; exports.flipCorners = _chunkO5RVCDECcjs.flipCorners; exports.flowField = _chunkFHPVDTI2cjs.flowField; exports.fontOf = _chunkQQKTOA4Ucjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkO5RVCDECcjs.fullSelection; exports.gaussianBlur = _chunkMZXQTKUMcjs.gaussianBlur; exports.geometryHomography = _chunkO5RVCDECcjs.geometryHomography; exports.getAnnotationBounds = _chunkO5RVCDECcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkO5RVCDECcjs.getCropCursor; exports.getRotatedSize = _chunkO5RVCDECcjs.getRotatedSize; exports.getViewportMetrics = _chunkO5RVCDECcjs.getViewportMetrics; exports.getViewportProjection = _chunkO5RVCDECcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk6GFRKLLScjs.gradientDabColor; exports.greyMorphology = _chunkO5RVCDECcjs.greyMorphology; exports.groupLayers = _chunkO5RVCDECcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkMZXQTKUMcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkO5RVCDECcjs.hasResampledLegacyMask; exports.hasSurface = _chunkO5RVCDECcjs.hasSurface; exports.hasWarp = _chunkO5RVCDECcjs.hasWarp; exports.hash2 = _chunk6GFRKLLScjs.hash2; exports.hashMaskContent = _chunkO5RVCDECcjs.hashMaskContent; exports.hashNoise = _chunkMZXQTKUMcjs.hashNoise; exports.healPixels = _chunkW6M7C7R3cjs.healPixels; exports.hexToPaintRgb = _chunk6GFRKLLScjs.hexToPaintRgb; exports.hexToRgb = _chunkO5RVCDECcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkO5RVCDECcjs.hitTestAnnotation; exports.hitTestCrop = _chunkO5RVCDECcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkO5RVCDECcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkO5RVCDECcjs.hueRangeTables; exports.hueRangeWeight = _chunkO5RVCDECcjs.hueRangeWeight; exports.hueSaturation = _chunkO5RVCDECcjs.hueSaturation; exports.identityCurve = _chunkO5RVCDECcjs.identityCurve; exports.identityLevels = _chunkO5RVCDECcjs.identityLevels; exports.identityTransform = _chunkO5RVCDECcjs.identityTransform; exports.identityWarpMesh = _chunkQQKTOA4Ucjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkO5RVCDECcjs.imageToCanvasPoint; exports.importPsd = _chunkO5RVCDECcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkMZXQTKUMcjs.insertLayer; exports.instancesOf = _chunkO5RVCDECcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkO5RVCDECcjs.invertMatrix3; exports.invertSelection = _chunkO5RVCDECcjs.invertSelection; exports.isActiveFilter = _chunkO5RVCDECcjs.isActiveFilter; exports.isAdjustmentKind = _chunkO5RVCDECcjs.isAdjustmentKind; exports.isBitDepth = _chunkJ5BA3BQ6cjs.isBitDepth; exports.isBlendMode = _chunkJ5BA3BQ6cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkZ6OUCS2Kcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkO5RVCDECcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkO5RVCDECcjs.isDefaultDepthMask; exports.isGradientPaint = _chunk6GFRKLLScjs.isGradientPaint; exports.isIdentityTransform = _chunkO5RVCDECcjs.isIdentityTransform; exports.isInterpolation = _chunkMZXQTKUMcjs.isInterpolation; exports.isLayerEffectKind = _chunkMZXQTKUMcjs.isLayerEffectKind; exports.isLayerLocked = _chunkMZXQTKUMcjs.isLayerLocked; exports.isLegacyShape = _chunkO5RVCDECcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkJ5BA3BQ6cjs.isPainterlyBlendMode; exports.isPng = _chunkDCLJNVZScjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkO5RVCDECcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkO5RVCDECcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkO5RVCDECcjs.isSelectionEmpty; exports.isSelectionMode = _chunkO5RVCDECcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkJ5BA3BQ6cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkO5RVCDECcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkO5RVCDECcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkO5RVCDECcjs.isTransformAnchor; exports.isValidWarp = _chunkO5RVCDECcjs.isValidWarp; exports.keepDeepSamples = _chunkJ5BA3BQ6cjs.keepDeepSamples; exports.kelvinToTemperature = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkO5RVCDECcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkO5RVCDECcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkO5RVCDECcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkO5RVCDECcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkO5RVCDECcjs.layerTree; exports.layerTypeLabel = _chunkO5RVCDECcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkO5RVCDECcjs.layersFromLegacy; exports.layoutText = _chunkQQKTOA4Ucjs.layoutText; exports.legacyAdjustmentLayer = _chunkO5RVCDECcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkO5RVCDECcjs.legacyMaskOf; exports.legacyView = _chunkO5RVCDECcjs.legacyView; exports.lerpPigment = _chunkJ5BA3BQ6cjs.lerpPigment; exports.lerpPigmentInto = _chunkJ5BA3BQ6cjs.lerpPigmentInto; exports.levelsValue = _chunkO5RVCDECcjs.levelsValue; exports.linearSrgbToXy = _chunkO5RVCDECcjs.linearSrgbToXy; exports.linearToSrgb = _chunkO5RVCDECcjs.linearToSrgb; exports.linearToSrgb8 = _chunkFHPVDTI2cjs.linearToSrgb8; exports.liveComponent = _chunkO5RVCDECcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.mapCropHandle; exports.mapLayer = _chunkMZXQTKUMcjs.mapLayer; exports.mapSubpaths = _chunkO5RVCDECcjs.mapSubpaths; exports.maskBounds = _chunkW6M7C7R3cjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkO5RVCDECcjs.matrixFromCorners; exports.matrixFromParams = _chunkO5RVCDECcjs.matrixFromParams; exports.membraneFill = _chunkW6M7C7R3cjs.membraneFill; exports.mergeLayerEffect = _chunkMZXQTKUMcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkO5RVCDECcjs.moveLayer; exports.moveSmartFilter = _chunkO5RVCDECcjs.moveSmartFilter; exports.mulMatrix3 = _chunkO5RVCDECcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkO5RVCDECcjs.neutralHueRange; exports.newContentsId = _chunkO5RVCDECcjs.newContentsId; exports.newEffectId = _chunkMZXQTKUMcjs.newEffectId; exports.newLayerId = _chunkO5RVCDECcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkO5RVCDECcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkO5RVCDECcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkO5RVCDECcjs.normalizeAngle; exports.normalizeBlendMode = _chunkJ5BA3BQ6cjs.normalizeBlendMode; exports.normalizeBlender = _chunk6GFRKLLScjs.normalizeBlender; exports.normalizeBrush = _chunk6GFRKLLScjs.normalizeBrush; exports.normalizeFilter = _chunkO5RVCDECcjs.normalizeFilter; exports.normalizeFlow = _chunkFHPVDTI2cjs.normalizeFlow; exports.normalizeHexColor = _chunk6GFRKLLScjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkMZXQTKUMcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkO5RVCDECcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkO5RVCDECcjs.normalizeLiveShape; exports.normalizeMixer = _chunk6GFRKLLScjs.normalizeMixer; exports.normalizePlacement = _chunkO5RVCDECcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkO5RVCDECcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkW6M7C7R3cjs.normalizeRetouch; exports.normalizeShapePaint = _chunkO5RVCDECcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkO5RVCDECcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkO5RVCDECcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk6GFRKLLScjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkO5RVCDECcjs.normalizeSubpaths; exports.normalizeText = _chunkO5RVCDECcjs.normalizeText; exports.normalizeTilt = _chunkFHPVDTI2cjs.normalizeTilt; exports.normalizeWetParams = _chunkFHPVDTI2cjs.normalizeWetParams; exports.offsetLayer = _chunkO5RVCDECcjs.offsetLayer; exports.offsetShape = _chunkO5RVCDECcjs.offsetShape; exports.offsetSmartObject = _chunkO5RVCDECcjs.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 = _chunkQQKTOA4Ucjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkO5RVCDECcjs.parseAdjustmentBlock; exports.parseBlend = _chunkO5RVCDECcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkDCLJNVZScjs.parseDataUrl; exports.parseEffectColor = _chunkMZXQTKUMcjs.parseEffectColor; exports.parseLfx2 = _chunkO5RVCDECcjs.parseLfx2; exports.parseLrfx = _chunkO5RVCDECcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk6GFRKLLScjs.parsePaintSource; exports.parsePatternBlock = _chunkO5RVCDECcjs.parsePatternBlock; exports.parseSelectionMode = _chunkO5RVCDECcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkO5RVCDECcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkO5RVCDECcjs.patchParagraphStyle; exports.patchTextStyle = _chunkO5RVCDECcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkZ6OUCS2Kcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkZ6OUCS2Kcjs.pathStrokeDabs; exports.perDabStrength = _chunkW6M7C7R3cjs.perDabStrength; exports.photoFilterMatrix = _chunkO5RVCDECcjs.photoFilterMatrix; exports.pigment8 = _chunkJ5BA3BQ6cjs.pigment8; exports.pigmentColor = _chunkFHPVDTI2cjs.pigmentColor; exports.pigmentOf = _chunkFHPVDTI2cjs.pigmentOf; exports.pixelLayerBounds = _chunkO5RVCDECcjs.pixelLayerBounds; exports.pixelLayers = _chunkO5RVCDECcjs.pixelLayers; exports.pixelPigment = _chunkFHPVDTI2cjs.pixelPigment; exports.placeContents = _chunkO5RVCDECcjs.placeContents; exports.placeLayer = _chunkO5RVCDECcjs.placeLayer; exports.placementAt = _chunkO5RVCDECcjs.placementAt; exports.placementBounds = _chunkO5RVCDECcjs.placementBounds; exports.placementGeometry = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.posterizeValue; exports.presetWarp = _chunkO5RVCDECcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkO5RVCDECcjs.projectImagePoint; exports.projectImageRect = _chunkO5RVCDECcjs.projectImageRect; exports.projectMaskCoverage = _chunkO5RVCDECcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkJ5BA3BQ6cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkO5RVCDECcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkO5RVCDECcjs.psdToLayers; exports.pullWarpMesh = _chunkQQKTOA4Ucjs.pullWarpMesh; exports.put255 = _chunk6GFRKLLScjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk6GFRKLLScjs.rand01; exports.rangeLightness = _chunkO5RVCDECcjs.rangeLightness; exports.rasterContents = _chunkO5RVCDECcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkO5RVCDECcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkO5RVCDECcjs.rasterizeCoverage; exports.rasterizeDab = _chunk6GFRKLLScjs.rasterizeDab; exports.rasterizeSmartObject = _chunkO5RVCDECcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkJ5BA3BQ6cjs.readDeepRegion; exports.readPaintSource = _chunk6GFRKLLScjs.readPaintSource; exports.readPixel = _chunkJ5BA3BQ6cjs.readPixel; exports.readPsd = _chunkO5RVCDECcjs.readPsd; exports.readRegion = _chunkJ5BA3BQ6cjs.readRegion; exports.readSourceRegion = _chunkW6M7C7R3cjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkMZXQTKUMcjs.reduceSurface; exports.referencePoint = _chunkO5RVCDECcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkJ5BA3BQ6cjs.reflectanceToRgb; exports.removeAlpha = _chunkO5RVCDECcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkO5RVCDECcjs.removeLayer; exports.removeLayerEffect = _chunkO5RVCDECcjs.removeLayerEffect; exports.removeLayerFilter = _chunkO5RVCDECcjs.removeLayerFilter; exports.removePaintGradientStop = _chunk6GFRKLLScjs.removePaintGradientStop; exports.removeSmartFilter = _chunkO5RVCDECcjs.removeSmartFilter; exports.renderBrushstroke = _chunkZ6OUCS2Kcjs.renderBrushstroke; exports.renderLayerEffects = _chunkMZXQTKUMcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkO5RVCDECcjs.renderShape; exports.renderShapeRect = _chunkO5RVCDECcjs.renderShapeRect; exports.renderSmartObject = _chunkO5RVCDECcjs.renderSmartObject; exports.renderText = _chunkO5RVCDECcjs.renderText; exports.replaceContents = _chunkO5RVCDECcjs.replaceContents; exports.replaceTextRange = _chunkO5RVCDECcjs.replaceTextRange; exports.requireLayer = _chunkO5RVCDECcjs.requireLayer; exports.requireOperation = _chunkO5RVCDECcjs.requireOperation; exports.requireShapeLayer = _chunkO5RVCDECcjs.requireShapeLayer; exports.requireSmartObject = _chunkO5RVCDECcjs.requireSmartObject; exports.requireTypeLayer = _chunkO5RVCDECcjs.requireTypeLayer; exports.requireUnlocked = _chunkO5RVCDECcjs.requireUnlocked; exports.rerender = _chunkO5RVCDECcjs.rerender; exports.rerenderShape = _chunkO5RVCDECcjs.rerenderShape; exports.rerenderText = _chunkO5RVCDECcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkO5RVCDECcjs.resizeSelection; exports.resizeWarpMesh = _chunkQQKTOA4Ucjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkO5RVCDECcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk6GFRKLLScjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkQQKTOA4Ucjs.restyleRange; exports.reversePaintGradient = _chunk6GFRKLLScjs.reversePaintGradient; exports.rgbToGray = _chunkO5RVCDECcjs.rgbToGray; exports.rgbToHsl = _chunkO5RVCDECcjs.rgbToHsl; exports.rgbToReflectance = _chunkJ5BA3BQ6cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkW6M7C7R3cjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkO5RVCDECcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkO5RVCDECcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkO5RVCDECcjs.sampleLut; exports.sampleToneLut = _chunkO5RVCDECcjs.sampleToneLut; exports.saturationOf = _chunkW6M7C7R3cjs.saturationOf; exports.scaleLayerEffect = _chunkMZXQTKUMcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk6GFRKLLScjs.scalePaintGradient; exports.seamlessClone = _chunkW6M7C7R3cjs.seamlessClone; exports.selectionArea = _chunkO5RVCDECcjs.selectionArea; exports.selectionFromCoverage = _chunkO5RVCDECcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkO5RVCDECcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkO5RVCDECcjs.selectionToCoverage; exports.selectionToPixels = _chunkO5RVCDECcjs.selectionToPixels; exports.selectionValueAt = _chunkO5RVCDECcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkO5RVCDECcjs.serializeContents; exports.serializeEffects = _chunkO5RVCDECcjs.serializeEffects; exports.serializeLayer = _chunkO5RVCDECcjs.serializeLayer; exports.serializeLayers = _chunkO5RVCDECcjs.serializeLayers; exports.serializeLayersExternal = _chunkO5RVCDECcjs.serializeLayersExternal; exports.serializePatterns = _chunkO5RVCDECcjs.serializePatterns; exports.serializeSelection = _chunkO5RVCDECcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkO5RVCDECcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkO5RVCDECcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkO5RVCDECcjs.setLayerMask; exports.setLayerProperties = _chunkO5RVCDECcjs.setLayerProperties; exports.setLum = _chunkJ5BA3BQ6cjs.setLum; exports.setPigmentColor = _chunkJ5BA3BQ6cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkO5RVCDECcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkO5RVCDECcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkO5RVCDECcjs.setSmartPlacement; exports.shadeTile = _chunkFHPVDTI2cjs.shadeTile; exports.shapeAsPixelLayer = _chunkO5RVCDECcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkO5RVCDECcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkO5RVCDECcjs.shapeGeometryBounds; exports.shapeLayers = _chunkO5RVCDECcjs.shapeLayers; exports.shapeOutline = _chunkO5RVCDECcjs.shapeOutline; exports.shapeRenderClip = _chunkO5RVCDECcjs.shapeRenderClip; exports.shiftCoverage = _chunkO5RVCDECcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkO5RVCDECcjs.smartObjectLayers; exports.smoothCoverage = _chunkO5RVCDECcjs.smoothCoverage; exports.smoothPoints = _chunk6GFRKLLScjs.smoothPoints; exports.smudgeEffect = _chunkW6M7C7R3cjs.smudgeEffect; exports.solidPaint = _chunk6GFRKLLScjs.solidPaint; exports.solidSurface = _chunkJ5BA3BQ6cjs.solidSurface; exports.solveMembrane = _chunkW6M7C7R3cjs.solveMembrane; exports.spliceRuns = _chunkQQKTOA4Ucjs.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 = _chunkO5RVCDECcjs.srgbToLinear; exports.standardBlendMode = _chunkJ5BA3BQ6cjs.standardBlendMode; exports.stepSlotTs = _chunkFHPVDTI2cjs.stepSlotTs; exports.styleAt = _chunkQQKTOA4Ucjs.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 = _chunkO5RVCDECcjs.tempTintToXy; exports.temperatureToKelvin = _chunkO5RVCDECcjs.temperatureToKelvin; exports.textIndexAt = _chunkQQKTOA4Ucjs.textIndexAt; exports.textMatrix = _chunkO5RVCDECcjs.textMatrix; exports.textOutlines = _chunkO5RVCDECcjs.textOutlines; exports.textRange = _chunkO5RVCDECcjs.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 = _chunkO5RVCDECcjs.toTextSpace; exports.toneCurve = _chunkO5RVCDECcjs.toneCurve; exports.toneLuts = _chunkO5RVCDECcjs.toneLuts; exports.toneOf = _chunkW6M7C7R3cjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkO5RVCDECcjs.transformHomography; exports.transformMap = _chunkO5RVCDECcjs.transformMap; exports.transformShapeComponents = _chunkO5RVCDECcjs.transformShapeComponents; exports.transformSurface = _chunkMZXQTKUMcjs.transformSurface; exports.transformTypeLayer = _chunkO5RVCDECcjs.transformTypeLayer; exports.transformedBounds = _chunkMZXQTKUMcjs.transformedBounds; exports.transformedBox = _chunkO5RVCDECcjs.transformedBox; exports.transformedPoint = _chunkO5RVCDECcjs.transformedPoint; exports.translateSurface = _chunkJ5BA3BQ6cjs.translateSurface; exports.typeAsPixelLayer = _chunkO5RVCDECcjs.typeAsPixelLayer; exports.typeFrame = _chunkO5RVCDECcjs.typeFrame; exports.typeFromAnnotation = _chunkO5RVCDECcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkO5RVCDECcjs.typeLayerName; exports.ungroupLayer = _chunkO5RVCDECcjs.ungroupLayer; exports.uniformTile = _chunkJ5BA3BQ6cjs.uniformTile; exports.unionRect = _chunkO5RVCDECcjs.unionRect; exports.unprojectCanvasPoint = _chunkO5RVCDECcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkO5RVCDECcjs.updateLayerEffect; exports.updateLayerFilter = _chunkO5RVCDECcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkO5RVCDECcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk6GFRKLLScjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkO5RVCDECcjs.updateShapeLayer; exports.updateSmartFilter = _chunkO5RVCDECcjs.updateSmartFilter; exports.updateTypeLayer = _chunkO5RVCDECcjs.updateTypeLayer; exports.uvToXy = _chunkO5RVCDECcjs.uvToXy; exports.validateEffectGradient = _chunkMZXQTKUMcjs.validateEffectGradient; exports.validateLayerEffect = _chunkMZXQTKUMcjs.validateLayerEffect; exports.validateLayerEffects = _chunkMZXQTKUMcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkO5RVCDECcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkO5RVCDECcjs.vibranceLinear; exports.vibrancePixel = _chunkO5RVCDECcjs.vibrancePixel; exports.walkDabs = _chunk6GFRKLLScjs.walkDabs; exports.warpMeshEditPoints = _chunkQQKTOA4Ucjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkQQKTOA4Ucjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkQQKTOA4Ucjs.warpMeshParamAt; exports.warpPresetMesh = _chunkQQKTOA4Ucjs.warpPresetMesh; exports.warpSurface = _chunkMZXQTKUMcjs.warpSurface; exports.wbMatrix = _chunkO5RVCDECcjs.wbMatrix; exports.wetGpuSupport = _chunkFHPVDTI2cjs.wetGpuSupport; exports.wetSimdSupported = _chunkFHPVDTI2cjs.wetSimdSupported; exports.wetSupport = _chunkFHPVDTI2cjs.wetSupport; exports.whiteBalanceFromSample = _chunkO5RVCDECcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkO5RVCDECcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkO5RVCDECcjs.withFilterMaskSurface; exports.withNewIds = _chunkO5RVCDECcjs.withNewIds; exports.writeAdjustmentBlock = _chunkO5RVCDECcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkJ5BA3BQ6cjs.writeDeepRegion; exports.writeLfx2 = _chunkO5RVCDECcjs.writeLfx2; exports.writePatternBlock = _chunkO5RVCDECcjs.writePatternBlock; exports.writePsd = _chunkO5RVCDECcjs.writePsd; exports.writeRegion = _chunkJ5BA3BQ6cjs.writeRegion; exports.xyToTempTint = _chunkO5RVCDECcjs.xyToTempTint; exports.xyToUv = _chunkO5RVCDECcjs.xyToUv;
|
|
15705
|
+
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.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;
|
|
15706
15706
|
//# sourceMappingURL=index.cjs.map
|