@pixerate/editor 0.125.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 +71 -73
- 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 +11 -13
- package/dist/animation-editor/index.js.map +1 -1
- 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-G6WXWS4Y.js → chunk-FICSDDDF.js} +2 -2
- 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-QDJKUBWE.cjs → chunk-JODTP4DP.cjs} +176 -5
- package/dist/chunk-JODTP4DP.cjs.map +1 -0
- 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-XZWOLXWA.js → chunk-QFSTQHZY.js} +174 -3
- package/dist/chunk-QFSTQHZY.js.map +1 -0
- package/dist/{chunk-FPRIUR4T.js → chunk-ROZFX4QI.js} +3 -3
- package/dist/{chunk-UXFI3CDZ.cjs → chunk-SFCPGMCT.cjs} +8 -8
- package/dist/{chunk-UXFI3CDZ.cjs.map → chunk-SFCPGMCT.cjs.map} +1 -1
- 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.cjs +32 -34
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/index.d.cts +6 -38
- package/dist/effects/index.d.ts +6 -38
- package/dist/effects/index.js +3 -5
- package/dist/effects/index.js.map +1 -1
- 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 +619 -621
- 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 +6 -8
- package/dist/image-editor/index.js.map +1 -1
- 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 +737 -117
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +248 -13
- package/dist/paint-editor/index.d.ts +248 -13
- package/dist/paint-editor/index.js +635 -15
- package/dist/paint-editor/index.js.map +1 -1
- 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 +923 -925
- 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 -13
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.cjs +269 -271
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +6 -8
- package/dist/video-editor/index.d.ts +6 -8
- package/dist/video-editor/index.js +3 -5
- package/dist/video-editor/index.js.map +1 -1
- 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/skills/pixerate-paint-editor/SKILL.md +40 -1
- 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/chunk-IOXKXQNW.cjs +0 -178
- package/dist/chunk-IOXKXQNW.cjs.map +0 -1
- package/dist/chunk-QDJKUBWE.cjs.map +0 -1
- package/dist/chunk-TGKT5QAB.js +0 -178
- package/dist/chunk-TGKT5QAB.js.map +0 -1
- package/dist/chunk-XZWOLXWA.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-G6WXWS4Y.js.map → chunk-FICSDDDF.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,19 +802,17 @@ 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
|
-
var _chunkQDJKUBWEcjs = require('../chunk-QDJKUBWE.cjs');
|
|
809
810
|
|
|
810
811
|
|
|
811
812
|
|
|
812
813
|
|
|
813
814
|
|
|
814
|
-
|
|
815
|
-
var _chunkIOXKXQNWcjs = require('../chunk-IOXKXQNW.cjs');
|
|
816
|
-
require('../chunk-N3FVUOZD.cjs');
|
|
817
|
-
require('../chunk-GUZ47CJM.cjs');
|
|
815
|
+
var _chunkJODTP4DPcjs = require('../chunk-JODTP4DP.cjs');
|
|
818
816
|
require('../chunk-RIWPYSKU.cjs');
|
|
819
817
|
require('../chunk-MR3Z4OQI.cjs');
|
|
820
818
|
require('../chunk-A6PHCAGX.cjs');
|
|
@@ -922,7 +920,7 @@ function quickMaskPixels(mask, style = {}) {
|
|
|
922
920
|
|
|
923
921
|
// src/image-editor/layers/render.ts
|
|
924
922
|
function isQuarterTurn(rotate) {
|
|
925
|
-
return
|
|
923
|
+
return _chunkXLUYXUBDcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
|
|
926
924
|
}
|
|
927
925
|
function isIntegerRect(r) {
|
|
928
926
|
return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
|
|
@@ -930,7 +928,7 @@ function isIntegerRect(r) {
|
|
|
930
928
|
function baseProjection(region, transform, baseW, baseH) {
|
|
931
929
|
return {
|
|
932
930
|
region,
|
|
933
|
-
angle:
|
|
931
|
+
angle: _chunkXLUYXUBDcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
934
932
|
flipH: transform.flipH,
|
|
935
933
|
flipV: transform.flipV,
|
|
936
934
|
scale: 1,
|
|
@@ -939,14 +937,14 @@ function baseProjection(region, transform, baseW, baseH) {
|
|
|
939
937
|
};
|
|
940
938
|
}
|
|
941
939
|
function projectQuarterTurn(src, srcRect, region, transform) {
|
|
942
|
-
const rotated =
|
|
940
|
+
const rotated = _chunkXLUYXUBDcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
943
941
|
const w = Math.max(1, Math.round(rotated.width));
|
|
944
942
|
const h = Math.max(1, Math.round(rotated.height));
|
|
945
943
|
const out = new Uint8ClampedArray(w * h * 4);
|
|
946
944
|
const p = baseProjection(region, transform, w, h);
|
|
947
|
-
const o =
|
|
948
|
-
const ox =
|
|
949
|
-
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);
|
|
950
948
|
const ux = Math.round(ox.x - o.x);
|
|
951
949
|
const vx = Math.round(ox.y - o.y);
|
|
952
950
|
const uy = Math.round(oy.x - o.x);
|
|
@@ -975,23 +973,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
|
|
|
975
973
|
const d = img.data;
|
|
976
974
|
for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
|
|
977
975
|
}
|
|
978
|
-
if (legacyOutputBlur && legacyOutputBlur > 0)
|
|
976
|
+
if (legacyOutputBlur && legacyOutputBlur > 0) _chunkXLUYXUBDcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
|
|
979
977
|
}
|
|
980
978
|
function needsLegacyBase(input) {
|
|
981
979
|
const { stack, region, canvas, transform } = input;
|
|
982
|
-
if (!
|
|
980
|
+
if (!_chunkXLUYXUBDcjs.isLegacyShape.call(void 0, stack)) return false;
|
|
983
981
|
const bg = stack.layers[0];
|
|
984
982
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
|
|
985
983
|
if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
|
|
986
984
|
if (stack.outputOpacity < 1) return true;
|
|
987
|
-
const blur =
|
|
985
|
+
const blur = _chunkXLUYXUBDcjs.blurFilter.call(void 0, bg);
|
|
988
986
|
if (blur && blur.enabled && blur.radius > 0) {
|
|
989
987
|
const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
|
|
990
|
-
const angle =
|
|
988
|
+
const angle = _chunkXLUYXUBDcjs.normalizeAngle.call(void 0, transform.rotate);
|
|
991
989
|
if (!full || angle === 90 || angle === 270) return true;
|
|
992
990
|
}
|
|
993
991
|
if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
|
|
994
|
-
if (
|
|
992
|
+
if (_chunkXLUYXUBDcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
|
|
995
993
|
return false;
|
|
996
994
|
}
|
|
997
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;
|
|
@@ -1023,7 +1021,7 @@ function coveringRect(region) {
|
|
|
1023
1021
|
const y = Math.floor(region.y);
|
|
1024
1022
|
return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
|
|
1025
1023
|
}
|
|
1026
|
-
function renderLayeredBase(stack, region, transform, sources, compositor = new (0,
|
|
1024
|
+
function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkXLUYXUBDcjs.LayerCompositor)()) {
|
|
1027
1025
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
|
|
1028
1026
|
throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
|
|
1029
1027
|
}
|
|
@@ -1157,8 +1155,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1157
1155
|
* The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
|
|
1158
1156
|
* trust dirty rectangles; exports use `exportCompositor`.
|
|
1159
1157
|
*/
|
|
1160
|
-
__init8() {this.compositor = new (0,
|
|
1161
|
-
__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 })}
|
|
1162
1160
|
/** How the host resolves layer pixels (set by the controller). */
|
|
1163
1161
|
|
|
1164
1162
|
/**
|
|
@@ -1235,9 +1233,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1235
1233
|
return;
|
|
1236
1234
|
}
|
|
1237
1235
|
const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
|
|
1238
|
-
const projection =
|
|
1236
|
+
const projection = _chunkXLUYXUBDcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
|
|
1239
1237
|
const { region } = projection;
|
|
1240
|
-
const rotated =
|
|
1238
|
+
const rotated = _chunkXLUYXUBDcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1241
1239
|
const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
|
|
1242
1240
|
let overlay = annotations;
|
|
1243
1241
|
if (route === "legacy") {
|
|
@@ -1247,8 +1245,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1247
1245
|
`${naturalWidth}x${naturalHeight}`,
|
|
1248
1246
|
`${region.x},${region.y},${region.width},${region.height}`,
|
|
1249
1247
|
`${projection.angle},${transform.flipH},${transform.flipV}`,
|
|
1250
|
-
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${
|
|
1251
|
-
|
|
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),
|
|
1252
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}`,
|
|
1253
1251
|
`d${this.displayKey}`
|
|
1254
1252
|
].join("|");
|
|
@@ -1282,7 +1280,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1282
1280
|
}
|
|
1283
1281
|
if (overlay.length > 0 || options.draftAnnotation) {
|
|
1284
1282
|
ctx.save();
|
|
1285
|
-
|
|
1283
|
+
_chunkXLUYXUBDcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1286
1284
|
ctx.beginPath();
|
|
1287
1285
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1288
1286
|
ctx.clip();
|
|
@@ -1305,7 +1303,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1305
1303
|
if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
|
|
1306
1304
|
ctx.save();
|
|
1307
1305
|
try {
|
|
1308
|
-
|
|
1306
|
+
_chunkXLUYXUBDcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1309
1307
|
ctx.beginPath();
|
|
1310
1308
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1311
1309
|
ctx.clip();
|
|
@@ -1320,7 +1318,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1320
1318
|
const b = options.brushCursor;
|
|
1321
1319
|
ctx.save();
|
|
1322
1320
|
try {
|
|
1323
|
-
|
|
1321
|
+
_chunkXLUYXUBDcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1324
1322
|
const px2 = 1 / (projection.scale || 1);
|
|
1325
1323
|
ctx.beginPath();
|
|
1326
1324
|
ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
|
|
@@ -1338,7 +1336,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1338
1336
|
const t = options.textEdit;
|
|
1339
1337
|
ctx.save();
|
|
1340
1338
|
try {
|
|
1341
|
-
const scr = (p) =>
|
|
1339
|
+
const scr = (p) => _chunkXLUYXUBDcjs.projectImagePoint.call(void 0, p, projection);
|
|
1342
1340
|
const poly = (pts) => {
|
|
1343
1341
|
ctx.beginPath();
|
|
1344
1342
|
pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
|
|
@@ -1377,7 +1375,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1377
1375
|
const t = options.freeTransform;
|
|
1378
1376
|
ctx.save();
|
|
1379
1377
|
try {
|
|
1380
|
-
const scr = (p) =>
|
|
1378
|
+
const scr = (p) => _chunkXLUYXUBDcjs.projectImagePoint.call(void 0, p, projection);
|
|
1381
1379
|
ctx.beginPath();
|
|
1382
1380
|
if (t.warp) {
|
|
1383
1381
|
for (const c of t.warp.curves) {
|
|
@@ -1435,7 +1433,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1435
1433
|
}
|
|
1436
1434
|
if (isActivelyCropping) {
|
|
1437
1435
|
const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
|
|
1438
|
-
this.drawCropOverlay(ctx,
|
|
1436
|
+
this.drawCropOverlay(ctx, _chunkXLUYXUBDcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
|
|
1439
1437
|
}
|
|
1440
1438
|
}
|
|
1441
1439
|
/**
|
|
@@ -1444,7 +1442,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1444
1442
|
*/
|
|
1445
1443
|
async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
|
|
1446
1444
|
const { adjustments, depthMask } = state;
|
|
1447
|
-
const rotated =
|
|
1445
|
+
const rotated = _chunkXLUYXUBDcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1448
1446
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1449
1447
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1450
1448
|
const baseCanvas = this.createCanvas(baseW, baseH);
|
|
@@ -1452,7 +1450,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1452
1450
|
if (!baseCtx) return baseCanvas;
|
|
1453
1451
|
const projection = getBaseProjection(region, transform, baseW, baseH);
|
|
1454
1452
|
baseCtx.save();
|
|
1455
|
-
|
|
1453
|
+
_chunkXLUYXUBDcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
|
|
1456
1454
|
baseCtx.drawImage(
|
|
1457
1455
|
img,
|
|
1458
1456
|
region.x,
|
|
@@ -1467,8 +1465,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1467
1465
|
baseCtx.restore();
|
|
1468
1466
|
const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
|
|
1469
1467
|
if (imageData) {
|
|
1470
|
-
const layerMasks =
|
|
1471
|
-
|
|
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 } : {});
|
|
1472
1470
|
if (depthMask.enabled && depthMask.maskSource) {
|
|
1473
1471
|
try {
|
|
1474
1472
|
const maskImg = await this.imageCache.get(depthMask.maskSource);
|
|
@@ -1479,7 +1477,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1479
1477
|
const maskCtx = maskCanvas.getContext("2d");
|
|
1480
1478
|
if (maskCtx) {
|
|
1481
1479
|
maskCtx.save();
|
|
1482
|
-
|
|
1480
|
+
_chunkXLUYXUBDcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
|
|
1483
1481
|
maskCtx.drawImage(
|
|
1484
1482
|
maskImg,
|
|
1485
1483
|
region.x * sx,
|
|
@@ -1494,7 +1492,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1494
1492
|
maskCtx.restore();
|
|
1495
1493
|
const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
|
|
1496
1494
|
if (maskData) {
|
|
1497
|
-
|
|
1495
|
+
_chunkXLUYXUBDcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
|
|
1498
1496
|
}
|
|
1499
1497
|
}
|
|
1500
1498
|
} catch (e7) {
|
|
@@ -1513,7 +1511,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1513
1511
|
else if (this.baseRoute === "layers") route = "layers";
|
|
1514
1512
|
else {
|
|
1515
1513
|
const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
|
|
1516
|
-
const shaped = this.baseRoute === "legacy" &&
|
|
1514
|
+
const shaped = this.baseRoute === "legacy" && _chunkXLUYXUBDcjs.isLegacyShape.call(void 0, stack);
|
|
1517
1515
|
route = shaped || needsLegacyBase({
|
|
1518
1516
|
stack,
|
|
1519
1517
|
region,
|
|
@@ -1648,17 +1646,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1648
1646
|
if (!comp) return null;
|
|
1649
1647
|
const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
|
|
1650
1648
|
const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
|
|
1651
|
-
const rotated =
|
|
1649
|
+
const rotated = _chunkXLUYXUBDcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1652
1650
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1653
1651
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1654
|
-
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}`;
|
|
1655
1653
|
if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
|
|
1656
1654
|
const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
|
|
1657
1655
|
const ctx = canvas.getContext("2d");
|
|
1658
1656
|
if (!ctx) return null;
|
|
1659
1657
|
ctx.clearRect(0, 0, baseW, baseH);
|
|
1660
1658
|
ctx.save();
|
|
1661
|
-
|
|
1659
|
+
_chunkXLUYXUBDcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
|
|
1662
1660
|
ctx.beginPath();
|
|
1663
1661
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1664
1662
|
ctx.clip();
|
|
@@ -1930,7 +1928,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1930
1928
|
ctx.strokeStyle = "#3b82f6";
|
|
1931
1929
|
ctx.lineWidth = 1.5;
|
|
1932
1930
|
ctx.setLineDash([4, 4]);
|
|
1933
|
-
const bounds =
|
|
1931
|
+
const bounds = _chunkXLUYXUBDcjs.getAnnotationBounds.call(void 0, ann);
|
|
1934
1932
|
const pad = 4;
|
|
1935
1933
|
ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
|
|
1936
1934
|
ctx.fillStyle = "#ffffff";
|
|
@@ -1951,7 +1949,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1951
1949
|
}
|
|
1952
1950
|
/** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
|
|
1953
1951
|
getAnnotationBounds(ann) {
|
|
1954
|
-
return
|
|
1952
|
+
return _chunkXLUYXUBDcjs.getAnnotationBounds.call(void 0, ann);
|
|
1955
1953
|
}
|
|
1956
1954
|
/**
|
|
1957
1955
|
* Draws a rule-of-thirds crop grid overlay. All rectangles come from
|
|
@@ -2033,8 +2031,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2033
2031
|
}
|
|
2034
2032
|
const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
|
|
2035
2033
|
const { crop, transform, annotations } = state;
|
|
2036
|
-
const region = crop ?
|
|
2037
|
-
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);
|
|
2038
2036
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
2039
2037
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
2040
2038
|
const exportW = options.width || baseW;
|
|
@@ -2063,7 +2061,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2063
2061
|
const bctx = baseCanvas.getContext("2d");
|
|
2064
2062
|
if (bctx) {
|
|
2065
2063
|
bctx.save();
|
|
2066
|
-
|
|
2064
|
+
_chunkXLUYXUBDcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
|
|
2067
2065
|
bctx.beginPath();
|
|
2068
2066
|
bctx.rect(region.x, region.y, region.width, region.height);
|
|
2069
2067
|
bctx.clip();
|
|
@@ -2076,7 +2074,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2076
2074
|
if (options.includeAnnotations !== false && overlay.length > 0) {
|
|
2077
2075
|
ctx.save();
|
|
2078
2076
|
ctx.scale(exportW / baseW, exportH / baseH);
|
|
2079
|
-
|
|
2077
|
+
_chunkXLUYXUBDcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
|
|
2080
2078
|
for (const ann of overlay) {
|
|
2081
2079
|
await this.drawAnnotation(ctx, ann);
|
|
2082
2080
|
}
|
|
@@ -2166,7 +2164,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2166
2164
|
case "rect":
|
|
2167
2165
|
case "image":
|
|
2168
2166
|
case "text": {
|
|
2169
|
-
const b =
|
|
2167
|
+
const b = _chunkXLUYXUBDcjs.getAnnotationBounds.call(void 0, ann);
|
|
2170
2168
|
ctx.fillRect(b.x, b.y, b.width, b.height);
|
|
2171
2169
|
break;
|
|
2172
2170
|
}
|
|
@@ -2186,7 +2184,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
|
|
|
2186
2184
|
function getBaseProjection(region, transform, baseW, baseH) {
|
|
2187
2185
|
return {
|
|
2188
2186
|
region,
|
|
2189
|
-
angle:
|
|
2187
|
+
angle: _chunkXLUYXUBDcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
2190
2188
|
flipH: transform.flipH,
|
|
2191
2189
|
flipV: transform.flipV,
|
|
2192
2190
|
scale: 1,
|
|
@@ -2290,8 +2288,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
2290
2288
|
}
|
|
2291
2289
|
function toMask(width, height, coverage) {
|
|
2292
2290
|
const out = new Uint8Array(coverage.length);
|
|
2293
|
-
for (let i = 0; i < out.length; i++) out[i] =
|
|
2294
|
-
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);
|
|
2295
2293
|
}
|
|
2296
2294
|
function polygonSelection(width, height, points, options = {}) {
|
|
2297
2295
|
return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
|
|
@@ -2418,7 +2416,7 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2418
2416
|
const { width: w, height: h } = pixels;
|
|
2419
2417
|
const sx = Math.floor(seed.x);
|
|
2420
2418
|
const sy = Math.floor(seed.y);
|
|
2421
|
-
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);
|
|
2422
2420
|
const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
|
|
2423
2421
|
const marks = new Uint8Array(n);
|
|
2424
2422
|
let bx0 = w;
|
|
@@ -2466,9 +2464,9 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2466
2464
|
}
|
|
2467
2465
|
}
|
|
2468
2466
|
}
|
|
2469
|
-
if (bx1 < 0) return
|
|
2470
|
-
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return
|
|
2471
|
-
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,
|
|
2472
2470
|
w,
|
|
2473
2471
|
h,
|
|
2474
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))
|
|
@@ -2490,7 +2488,7 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2490
2488
|
const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
|
|
2491
2489
|
const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
|
|
2492
2490
|
const out = new Uint8Array(n);
|
|
2493
|
-
if (!parsed.length) return
|
|
2491
|
+
if (!parsed.length) return _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2494
2492
|
for (let i = 0; i < n; i++) {
|
|
2495
2493
|
const p = i * 4;
|
|
2496
2494
|
if (data[p + 3] <= 0) continue;
|
|
@@ -2506,9 +2504,9 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2506
2504
|
}
|
|
2507
2505
|
if (k > best) best = k;
|
|
2508
2506
|
}
|
|
2509
|
-
out[i] =
|
|
2507
|
+
out[i] = _chunkXLUYXUBDcjs.coverageToByte.call(void 0, best);
|
|
2510
2508
|
}
|
|
2511
|
-
return
|
|
2509
|
+
return _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2512
2510
|
}
|
|
2513
2511
|
var TONE_RANGE_PRESETS = {
|
|
2514
2512
|
shadows: [0, 65],
|
|
@@ -2526,9 +2524,9 @@ function toneRange(pixels, range, falloff = 20) {
|
|
|
2526
2524
|
if (d[p + 3] <= 0) continue;
|
|
2527
2525
|
const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
|
|
2528
2526
|
const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
|
|
2529
|
-
out[i] =
|
|
2527
|
+
out[i] = _chunkXLUYXUBDcjs.coverageToByte.call(void 0, 1 - outside / ramp);
|
|
2530
2528
|
}
|
|
2531
|
-
return
|
|
2529
|
+
return _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2532
2530
|
}
|
|
2533
2531
|
function hueRange(pixels, center) {
|
|
2534
2532
|
const n = checkPixels(pixels);
|
|
@@ -2551,9 +2549,9 @@ function hueRange(pixels, center) {
|
|
|
2551
2549
|
hue *= 60;
|
|
2552
2550
|
let dh = ((hue - center) % 360 + 360) % 360;
|
|
2553
2551
|
dh = Math.min(dh, 360 - dh);
|
|
2554
|
-
out[i] =
|
|
2552
|
+
out[i] = _chunkXLUYXUBDcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
|
|
2555
2553
|
}
|
|
2556
|
-
return
|
|
2554
|
+
return _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2557
2555
|
}
|
|
2558
2556
|
|
|
2559
2557
|
// src/image-editor/selection/refine.ts
|
|
@@ -2687,9 +2685,9 @@ function edgeWidth(guide, w, h, r) {
|
|
|
2687
2685
|
g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
|
|
2688
2686
|
}
|
|
2689
2687
|
}
|
|
2690
|
-
const gm =
|
|
2691
|
-
const hi =
|
|
2692
|
-
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);
|
|
2693
2691
|
const out = new Float32Array(n);
|
|
2694
2692
|
for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
|
|
2695
2693
|
return out;
|
|
@@ -2713,7 +2711,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2713
2711
|
}
|
|
2714
2712
|
}
|
|
2715
2713
|
if (any) {
|
|
2716
|
-
const dist =
|
|
2714
|
+
const dist = _chunkXLUYXUBDcjs.distanceTransform.call(void 0, boundary, w, h);
|
|
2717
2715
|
const r = gfRadius(p);
|
|
2718
2716
|
const q = guidedFilterColor(guide, m, w, h, r);
|
|
2719
2717
|
const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
|
|
@@ -2739,7 +2737,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2739
2737
|
for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
|
|
2740
2738
|
}
|
|
2741
2739
|
const amount = shiftAmount(p);
|
|
2742
|
-
if (Math.abs(amount) >= 1e-4) a =
|
|
2740
|
+
if (Math.abs(amount) >= 1e-4) a = _chunkXLUYXUBDcjs.shiftCoverage.call(void 0, a, w, h, amount);
|
|
2743
2741
|
return a;
|
|
2744
2742
|
}
|
|
2745
2743
|
function guidePlanes(pixels, win) {
|
|
@@ -2783,9 +2781,9 @@ function refineSelection(pixels, mask, params = {}) {
|
|
|
2783
2781
|
const out = new Uint8Array(mask.width * mask.height);
|
|
2784
2782
|
for (let y = 0; y < wh; y++) {
|
|
2785
2783
|
const dst = (y0 + y) * mask.width + x0;
|
|
2786
|
-
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]);
|
|
2787
2785
|
}
|
|
2788
|
-
return
|
|
2786
|
+
return _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
|
|
2789
2787
|
}
|
|
2790
2788
|
|
|
2791
2789
|
// src/image-editor/effects.ts
|
|
@@ -2799,7 +2797,7 @@ function checkImageEffectPlace(d, place) {
|
|
|
2799
2797
|
const allowed = IMAGE_EFFECT_PLACES[place];
|
|
2800
2798
|
if (d.kind === "motion" || !d.uses.some((u) => allowed.includes(u))) {
|
|
2801
2799
|
const instead = place === "filter" && d.uses.some((u) => IMAGE_EFFECT_PLACES.layer.includes(u)) ? "; add it as an effect layer with add_effect_layer instead" : place === "layer" && d.uses.includes("filter") ? "; apply it to a layer as a smart filter with apply_effect instead" : "";
|
|
2802
|
-
throw new (0,
|
|
2800
|
+
throw new (0, _chunkJODTP4DPcjs.EffectUnsupportedError)(
|
|
2803
2801
|
`"${d.id}" (${d.name}) is a ${d.uses.join(" / ")} effect, and ${place === "filter" ? "a smart filter takes filter effects" : "an effect layer takes generator, overlay or title effects"}${instead}.`,
|
|
2804
2802
|
d.id
|
|
2805
2803
|
);
|
|
@@ -2823,9 +2821,9 @@ function effectPixelsToSurface(p, depth) {
|
|
|
2823
2821
|
const d = new Uint16Array(f.length);
|
|
2824
2822
|
const code = (v) => v > 0 ? v < 1 ? Math.round(v * 65535) : 65535 : 0;
|
|
2825
2823
|
for (let i = 0; i < f.length; i += 4) {
|
|
2826
|
-
d[i] = code(
|
|
2827
|
-
d[i + 1] = code(
|
|
2828
|
-
d[i + 2] = code(
|
|
2824
|
+
d[i] = code(_chunkJODTP4DPcjs.linearToSrgb.call(void 0, f[i]));
|
|
2825
|
+
d[i + 1] = code(_chunkJODTP4DPcjs.linearToSrgb.call(void 0, f[i + 1]));
|
|
2826
|
+
d[i + 2] = code(_chunkJODTP4DPcjs.linearToSrgb.call(void 0, f[i + 2]));
|
|
2829
2827
|
d[i + 3] = code(f[i + 3]);
|
|
2830
2828
|
}
|
|
2831
2829
|
return _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels.call(void 0, { width: p.width, height: p.height, data: d }, 4);
|
|
@@ -2842,7 +2840,7 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
2842
2840
|
__init31() {this.generation = 0}
|
|
2843
2841
|
|
|
2844
2842
|
constructor(options = {}) {;_class4.prototype.__init26.call(this);_class4.prototype.__init27.call(this);_class4.prototype.__init28.call(this);_class4.prototype.__init29.call(this);_class4.prototype.__init30.call(this);_class4.prototype.__init31.call(this);
|
|
2845
|
-
this.slot = _nullishCoalesce(options.slot, () => ( new (0,
|
|
2843
|
+
this.slot = _nullishCoalesce(options.slot, () => ( new (0, _chunkJODTP4DPcjs.EffectsSlot)()));
|
|
2846
2844
|
this.maxEntries = _nullishCoalesce(options.maxEntries, () => ( 24));
|
|
2847
2845
|
this.pool = new (0, _chunkW6QTLHZ3cjs.EffectRendererPool)({ maxRenderers: options.maxRenderers });
|
|
2848
2846
|
this.detach = this.slot.subscribe(() => {
|
|
@@ -2902,7 +2900,7 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
2902
2900
|
const provider = this.slot.require();
|
|
2903
2901
|
const depth = _nullishCoalesce(size.depth, () => ( 8));
|
|
2904
2902
|
const out = await this.render(provider, effect, size.width, size.height, depth, { time: _nullishCoalesce(size.time, () => ( 0)), values });
|
|
2905
|
-
return out.width === size.width && out.height === size.height ? out :
|
|
2903
|
+
return out.width === size.width && out.height === size.height ? out : _chunkJODTP4DPcjs.createEffectPixels.call(void 0, size.width, size.height);
|
|
2906
2904
|
}
|
|
2907
2905
|
/** Why the result for `key` failed, if it did. */
|
|
2908
2906
|
failure(key) {
|
|
@@ -2955,7 +2953,7 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
2955
2953
|
// src/image-editor/free-transform.ts
|
|
2956
2954
|
var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
|
|
2957
2955
|
var fail = (message) => {
|
|
2958
|
-
throw new (0,
|
|
2956
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(message);
|
|
2959
2957
|
};
|
|
2960
2958
|
var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
|
|
2961
2959
|
function previewStep(scale) {
|
|
@@ -3064,7 +3062,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3064
3062
|
} else {
|
|
3065
3063
|
const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
|
|
3066
3064
|
if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
|
|
3067
|
-
const layer =
|
|
3065
|
+
const layer = _chunkXLUYXUBDcjs.requireLayer.call(void 0, layers, id).layer;
|
|
3068
3066
|
this.layerId = layer.id;
|
|
3069
3067
|
const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
|
|
3070
3068
|
const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
|
|
@@ -3075,20 +3073,20 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3075
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.`);
|
|
3076
3074
|
if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
|
|
3077
3075
|
if (content !== "selection-copy") {
|
|
3078
|
-
|
|
3079
|
-
if (!maskAlone)
|
|
3076
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
|
|
3077
|
+
if (!maskAlone) _chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
|
|
3080
3078
|
}
|
|
3081
3079
|
const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
3082
3080
|
const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
|
|
3083
3081
|
if (layer.type === "smart" && !maskAlone) {
|
|
3084
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).`);
|
|
3085
|
-
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.`);
|
|
3086
3084
|
this.smart = layer;
|
|
3087
3085
|
this.smartObject = true;
|
|
3088
|
-
this.startGeometry =
|
|
3086
|
+
this.startGeometry = _chunkXLUYXUBDcjs.placementGeometry.call(void 0, layer);
|
|
3089
3087
|
if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
|
|
3090
3088
|
this.startInterp = this.interp;
|
|
3091
|
-
this.box =
|
|
3089
|
+
this.box = _chunkXLUYXUBDcjs.contentsBox.call(void 0, layer.contents);
|
|
3092
3090
|
this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
|
|
3093
3091
|
this.geometryValue = this.startGeometry;
|
|
3094
3092
|
this.shown = this.startLayers;
|
|
@@ -3096,8 +3094,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3096
3094
|
}
|
|
3097
3095
|
if (layer.type === "type" && !maskAlone) {
|
|
3098
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).`);
|
|
3099
|
-
const frame =
|
|
3100
|
-
const m =
|
|
3097
|
+
const frame = _chunkXLUYXUBDcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
|
|
3098
|
+
const m = _chunkXLUYXUBDcjs.textMatrix.call(void 0, layer);
|
|
3101
3099
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
3102
3100
|
this.typeTarget = layer;
|
|
3103
3101
|
this.typeLayer = true;
|
|
@@ -3116,7 +3114,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3116
3114
|
}
|
|
3117
3115
|
if (layer.type === "shape" && !maskAlone) {
|
|
3118
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).`);
|
|
3119
|
-
const g =
|
|
3117
|
+
const g = _chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, layer);
|
|
3120
3118
|
if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
|
|
3121
3119
|
const w = Math.max(g.width, 1);
|
|
3122
3120
|
const h = Math.max(g.height, 1);
|
|
@@ -3164,7 +3162,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3164
3162
|
if (box) {
|
|
3165
3163
|
const copy = {
|
|
3166
3164
|
type: "pixel",
|
|
3167
|
-
id:
|
|
3165
|
+
id: _chunkXLUYXUBDcjs.newLayerId.call(void 0, ),
|
|
3168
3166
|
name: `${layer.name || "Layer"} copy`,
|
|
3169
3167
|
visible: true,
|
|
3170
3168
|
opacity: 1,
|
|
@@ -3188,7 +3186,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3188
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).");
|
|
3189
3187
|
this.box = box;
|
|
3190
3188
|
this.moves = moves;
|
|
3191
|
-
this.startGeometry =
|
|
3189
|
+
this.startGeometry = _chunkXLUYXUBDcjs.identityTransform.call(void 0, box);
|
|
3192
3190
|
this.startInterp = this.interp;
|
|
3193
3191
|
this.geometryValue = this.startGeometry;
|
|
3194
3192
|
this.shown = this.startLayers;
|
|
@@ -3266,8 +3264,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3266
3264
|
warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
|
|
3267
3265
|
};
|
|
3268
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.");
|
|
3269
|
-
if (!
|
|
3270
|
-
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))) {
|
|
3271
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.");
|
|
3272
3270
|
}
|
|
3273
3271
|
this.geometryValue = next;
|
|
@@ -3279,10 +3277,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3279
3277
|
if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
|
|
3280
3278
|
if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
|
|
3281
3279
|
const g = this.geometryValue;
|
|
3282
|
-
const identity =
|
|
3283
|
-
const warp =
|
|
3284
|
-
const h = warp ? null :
|
|
3285
|
-
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;
|
|
3286
3284
|
const step = final ? 1 : previewStep(preview.scale);
|
|
3287
3285
|
const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
|
|
3288
3286
|
let layers = this.startLayers;
|
|
@@ -3326,7 +3324,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3326
3324
|
if (part.what === "selection") {
|
|
3327
3325
|
const { width, height } = this.host.canvas();
|
|
3328
3326
|
const data = new Uint8Array(_chunkJ5BA3BQ6cjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
|
|
3329
|
-
const next =
|
|
3327
|
+
const next = _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, width, height, data);
|
|
3330
3328
|
selection = next.bounds ? next : null;
|
|
3331
3329
|
} else if (part.what === "pixels") {
|
|
3332
3330
|
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, targetId, (l) => {
|
|
@@ -3348,14 +3346,14 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3348
3346
|
resampleShape(final, preview, warpMap, h) {
|
|
3349
3347
|
const layer = this.shape;
|
|
3350
3348
|
let components = layer.components;
|
|
3351
|
-
if (!
|
|
3349
|
+
if (!_chunkXLUYXUBDcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
|
|
3352
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;
|
|
3353
3351
|
const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p)));
|
|
3354
|
-
components =
|
|
3352
|
+
components = _chunkXLUYXUBDcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
|
|
3355
3353
|
}
|
|
3356
3354
|
const moved = { ...layer, components };
|
|
3357
3355
|
delete moved.annotation;
|
|
3358
|
-
const surface =
|
|
3356
|
+
const surface = _chunkXLUYXUBDcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
|
|
3359
3357
|
return _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
|
|
3360
3358
|
}
|
|
3361
3359
|
/**
|
|
@@ -3365,13 +3363,13 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3365
3363
|
resampleType() {
|
|
3366
3364
|
const layer = this.typeTarget;
|
|
3367
3365
|
const g = this.geometryValue;
|
|
3368
|
-
if (
|
|
3369
|
-
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);
|
|
3370
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.");
|
|
3371
3369
|
const next = { ...layer, transform: m };
|
|
3372
3370
|
delete next.annotation;
|
|
3373
|
-
let layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, () =>
|
|
3374
|
-
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));
|
|
3375
3373
|
for (const part of this.parts) {
|
|
3376
3374
|
if (part.what !== "mask") continue;
|
|
3377
3375
|
const surface = _chunkMZXQTKUMcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
|
|
@@ -3387,12 +3385,12 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3387
3385
|
const canvas = this.host.canvas();
|
|
3388
3386
|
try {
|
|
3389
3387
|
if (final) {
|
|
3390
|
-
const res =
|
|
3388
|
+
const res = _chunkXLUYXUBDcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
|
|
3391
3389
|
this.smartMasksMoved = res.masksMoved;
|
|
3392
3390
|
return res.layers;
|
|
3393
3391
|
}
|
|
3394
3392
|
const step = previewStep(preview.scale);
|
|
3395
|
-
const surface =
|
|
3393
|
+
const surface = _chunkXLUYXUBDcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
|
|
3396
3394
|
return _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
|
|
3397
3395
|
} catch (e) {
|
|
3398
3396
|
if (e instanceof _chunkMZXQTKUMcjs.TransformTooLargeError) fail(e.message);
|
|
@@ -3402,10 +3400,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3402
3400
|
/** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
|
|
3403
3401
|
isChanged() {
|
|
3404
3402
|
const g = this.geometryValue;
|
|
3405
|
-
if (!this.smart && !this.typeTarget) return !
|
|
3403
|
+
if (!this.smart && !this.typeTarget) return !_chunkXLUYXUBDcjs.isIdentityTransform.call(void 0, g);
|
|
3406
3404
|
const a = this.startGeometry;
|
|
3407
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);
|
|
3408
|
-
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) : "";
|
|
3409
3407
|
return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
|
|
3410
3408
|
}
|
|
3411
3409
|
render(preview) {
|
|
@@ -3628,7 +3626,7 @@ function convertSurfaceColors(surface, t) {
|
|
|
3628
3626
|
}
|
|
3629
3627
|
|
|
3630
3628
|
// src/image-editor/controller.ts
|
|
3631
|
-
var IMAGE_EDITOR_SCHEMA_VERSION =
|
|
3629
|
+
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION;
|
|
3632
3630
|
var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge"];
|
|
3633
3631
|
var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
|
|
3634
3632
|
var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
|
|
@@ -3822,7 +3820,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3822
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 })) {
|
|
3823
3821
|
const key = _chunkJ5BA3BQ6cjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3824
3822
|
const cur = regions.get(key);
|
|
3825
|
-
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 });
|
|
3826
3824
|
}
|
|
3827
3825
|
}
|
|
3828
3826
|
for (const [key, { tx, ty, r }] of regions) {
|
|
@@ -3854,7 +3852,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3854
3852
|
}
|
|
3855
3853
|
/** Finishes the stroke (one undo step) and returns what changed. */
|
|
3856
3854
|
end() {
|
|
3857
|
-
if (this.closed) throw new (0,
|
|
3855
|
+
if (this.closed) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("This stroke has already ended.");
|
|
3858
3856
|
const last = _nullishCoalesce(this.last, () => ( void 0));
|
|
3859
3857
|
const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
|
|
3860
3858
|
_optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
|
|
@@ -3978,20 +3976,20 @@ function sameTile(a, b) {
|
|
|
3978
3976
|
for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
|
|
3979
3977
|
return true;
|
|
3980
3978
|
}
|
|
3981
|
-
var DEFAULT_ADJUSTMENTS =
|
|
3979
|
+
var DEFAULT_ADJUSTMENTS = _chunkXLUYXUBDcjs.DEFAULT_ADJUSTMENTS_VALUES;
|
|
3982
3980
|
function normalizeStoredAdjustments(stored) {
|
|
3983
3981
|
if (!stored) return { ...DEFAULT_ADJUSTMENTS };
|
|
3984
3982
|
const out = {
|
|
3985
3983
|
...DEFAULT_ADJUSTMENTS,
|
|
3986
3984
|
...stored,
|
|
3987
|
-
process:
|
|
3985
|
+
process: _chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, stored.process)
|
|
3988
3986
|
};
|
|
3989
|
-
const layers =
|
|
3987
|
+
const layers = _chunkXLUYXUBDcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
|
|
3990
3988
|
if (layers.length) out.layers = layers;
|
|
3991
3989
|
else delete out.layers;
|
|
3992
3990
|
return out;
|
|
3993
3991
|
}
|
|
3994
|
-
var isLayered = (data) => Boolean(data && data.version ===
|
|
3992
|
+
var isLayered = (data) => Boolean(data && data.version === _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
|
|
3995
3993
|
function migrateSerializedImageEditorState(data) {
|
|
3996
3994
|
if (isLayered(data)) {
|
|
3997
3995
|
const out = {
|
|
@@ -4023,10 +4021,10 @@ function migrateSerializedImageEditorState(data) {
|
|
|
4023
4021
|
function migrateToLayeredState(data, size) {
|
|
4024
4022
|
const clean = migrateSerializedImageEditorState(data);
|
|
4025
4023
|
if (isLayered(clean)) return clean;
|
|
4026
|
-
const stack =
|
|
4027
|
-
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);
|
|
4028
4026
|
const out = {
|
|
4029
|
-
version:
|
|
4027
|
+
version: _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION,
|
|
4030
4028
|
width: Math.round(size.width),
|
|
4031
4029
|
height: Math.round(size.height),
|
|
4032
4030
|
layers,
|
|
@@ -4040,8 +4038,8 @@ function migrateToLayeredState(data, size) {
|
|
|
4040
4038
|
if (clean.selection) out.selection = clean.selection;
|
|
4041
4039
|
return out;
|
|
4042
4040
|
}
|
|
4043
|
-
var DEFAULT_TRANSFORM =
|
|
4044
|
-
var DEFAULT_DEPTH_MASK =
|
|
4041
|
+
var DEFAULT_TRANSFORM = _chunkXLUYXUBDcjs.DEFAULT_TRANSFORM_VALUES;
|
|
4042
|
+
var DEFAULT_DEPTH_MASK = _chunkXLUYXUBDcjs.DEFAULT_DEPTH_MASK_VALUES;
|
|
4045
4043
|
var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
|
|
4046
4044
|
var ImageEditorController = (_class7 = class {
|
|
4047
4045
|
|
|
@@ -4064,9 +4062,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4064
4062
|
__init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
|
|
4065
4063
|
__init63() {this.viewKey = []}
|
|
4066
4064
|
/** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
|
|
4067
|
-
__init64() {this.compositor = new (0,
|
|
4065
|
+
__init64() {this.compositor = new (0, _chunkXLUYXUBDcjs.LayerCompositor)()}
|
|
4068
4066
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
4069
|
-
__init65() {this.effects = new (0,
|
|
4067
|
+
__init65() {this.effects = new (0, _chunkJODTP4DPcjs.EffectsSlot)()}
|
|
4070
4068
|
/** Renders provider effects: effect smart filter results and effect layers. */
|
|
4071
4069
|
__init66() {this.effectsEngine = new ImageEffectsEngine({ slot: this.effects })}
|
|
4072
4070
|
__init67() {this.effectRefresh = "none"}
|
|
@@ -4122,7 +4120,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4122
4120
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
4123
4121
|
if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
|
|
4124
4122
|
try {
|
|
4125
|
-
this.state.selection = normalizeSelection(
|
|
4123
|
+
this.state.selection = normalizeSelection(_chunkXLUYXUBDcjs.deserializeSelection.call(void 0, options.initialState.selection));
|
|
4126
4124
|
} catch (e14) {
|
|
4127
4125
|
}
|
|
4128
4126
|
}
|
|
@@ -4234,10 +4232,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
4234
4232
|
if (l.type === "group") {
|
|
4235
4233
|
const children = walk(l.children);
|
|
4236
4234
|
if (children !== l.children) next2 = { ...l, children };
|
|
4237
|
-
} 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))) {
|
|
4238
4236
|
try {
|
|
4239
|
-
const r =
|
|
4240
|
-
if (all || !
|
|
4237
|
+
const r = _chunkXLUYXUBDcjs.rerender.call(void 0, l, canvas);
|
|
4238
|
+
if (all || !_chunkXLUYXUBDcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
|
|
4241
4239
|
} catch (e16) {
|
|
4242
4240
|
}
|
|
4243
4241
|
}
|
|
@@ -4291,21 +4289,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
4291
4289
|
*/
|
|
4292
4290
|
async applyEffectFilter(layerId, effect, options = {}) {
|
|
4293
4291
|
const d = await this.describeEffect(effect, "filter");
|
|
4294
|
-
const values =
|
|
4292
|
+
const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4295
4293
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4296
|
-
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.`);
|
|
4297
4295
|
let layers = this.state.layers;
|
|
4298
4296
|
let id = layerId;
|
|
4299
4297
|
let converted = false;
|
|
4300
4298
|
if (found.layer.type !== "smart") {
|
|
4301
|
-
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0,
|
|
4302
|
-
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) });
|
|
4303
4301
|
layers = res2.layers;
|
|
4304
4302
|
id = res2.layer.id;
|
|
4305
4303
|
converted = true;
|
|
4306
4304
|
}
|
|
4307
|
-
const filter =
|
|
4308
|
-
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);
|
|
4309
4307
|
this.commitLayers(res.layers);
|
|
4310
4308
|
return { layerId: id, filter: res.filter, converted };
|
|
4311
4309
|
}
|
|
@@ -4316,9 +4314,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4316
4314
|
* false, during a drag).
|
|
4317
4315
|
*/
|
|
4318
4316
|
async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
|
|
4319
|
-
const layer =
|
|
4317
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
|
|
4320
4318
|
const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
|
|
4321
|
-
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"}.`);
|
|
4322
4320
|
const update = {};
|
|
4323
4321
|
if (changes.values) {
|
|
4324
4322
|
const d = await this.describeEffect(was.effect);
|
|
@@ -4327,15 +4325,15 @@ var ImageEditorController = (_class7 = class {
|
|
|
4327
4325
|
for (const [k, v] of Object.entries(changes.values)) {
|
|
4328
4326
|
if (v !== null) given[k] = v;
|
|
4329
4327
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4330
|
-
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(", ")}.`);
|
|
4331
4329
|
}
|
|
4332
|
-
update.values = { ...base, ...
|
|
4330
|
+
update.values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4333
4331
|
}
|
|
4334
4332
|
for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
|
|
4335
|
-
let res =
|
|
4336
|
-
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 };
|
|
4337
4335
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4338
|
-
return
|
|
4336
|
+
return _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
|
|
4339
4337
|
}
|
|
4340
4338
|
/**
|
|
4341
4339
|
* Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
|
|
@@ -4344,15 +4342,15 @@ var ImageEditorController = (_class7 = class {
|
|
|
4344
4342
|
*/
|
|
4345
4343
|
async addEffectLayer(effect, options = {}) {
|
|
4346
4344
|
const d = await this.describeEffect(effect, "layer");
|
|
4347
|
-
const values =
|
|
4345
|
+
const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4348
4346
|
const { width, height } = this.naturalSize;
|
|
4349
4347
|
const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
|
|
4350
|
-
const blend =
|
|
4351
|
-
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.");
|
|
4352
4350
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4353
4351
|
const layer = {
|
|
4354
4352
|
type: "pixel",
|
|
4355
|
-
id: options.id && !ids.has(options.id) ? options.id :
|
|
4353
|
+
id: options.id && !ids.has(options.id) ? options.id : _chunkXLUYXUBDcjs.newLayerId.call(void 0, ),
|
|
4356
4354
|
name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
|
|
4357
4355
|
visible: true,
|
|
4358
4356
|
opacity: _nullishCoalesce(options.opacity, () => ( 1)),
|
|
@@ -4361,7 +4359,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4361
4359
|
offset: { x: 0, y: 0 },
|
|
4362
4360
|
generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
|
|
4363
4361
|
};
|
|
4364
|
-
const next =
|
|
4362
|
+
const next = _chunkXLUYXUBDcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
|
|
4365
4363
|
this.commitLayers(next, () => {
|
|
4366
4364
|
this.state.activeLayerId = layer.id;
|
|
4367
4365
|
this.state.activeTarget = "pixels";
|
|
@@ -4376,8 +4374,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
4376
4374
|
async updateEffectLayer(layerId, changes, commitToHistory = true) {
|
|
4377
4375
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4378
4376
|
const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
|
|
4379
|
-
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0,
|
|
4380
|
-
|
|
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");
|
|
4381
4379
|
const g = layer.generator;
|
|
4382
4380
|
const d = await this.describeEffect(g.effect);
|
|
4383
4381
|
const base = { ...g.values };
|
|
@@ -4385,9 +4383,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4385
4383
|
for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
|
|
4386
4384
|
if (v !== null) given[k] = v;
|
|
4387
4385
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4388
|
-
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(", ")}.`);
|
|
4389
4387
|
}
|
|
4390
|
-
const values = { ...base, ...
|
|
4388
|
+
const values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4391
4389
|
const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
|
|
4392
4390
|
const { width, height } = this.naturalSize;
|
|
4393
4391
|
const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time });
|
|
@@ -4400,7 +4398,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4400
4398
|
/** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
|
|
4401
4399
|
rasterizeEffectLayer(layerId) {
|
|
4402
4400
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4403
|
-
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.`);
|
|
4404
4402
|
this.commitLayers(
|
|
4405
4403
|
_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
|
|
4406
4404
|
const { generator: _g, ...rest } = l;
|
|
@@ -4428,7 +4426,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4428
4426
|
if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
|
|
4429
4427
|
this.viewKey = key;
|
|
4430
4428
|
const { width, height } = this.naturalSize;
|
|
4431
|
-
const view =
|
|
4429
|
+
const view = _chunkXLUYXUBDcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
|
|
4432
4430
|
s.adjustments = view.adjustments;
|
|
4433
4431
|
s.depthMask = view.depthMask;
|
|
4434
4432
|
s.annotations = view.annotations;
|
|
@@ -4582,7 +4580,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4582
4580
|
applyCropPreset(ratio) {
|
|
4583
4581
|
this.recordHistory();
|
|
4584
4582
|
const { width, height } = this.state.imageDimensions;
|
|
4585
|
-
if (ratio &&
|
|
4583
|
+
if (ratio && _chunkXLUYXUBDcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
|
|
4586
4584
|
ratio = 1 / ratio;
|
|
4587
4585
|
}
|
|
4588
4586
|
if (!ratio) {
|
|
@@ -4664,7 +4662,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4664
4662
|
*/
|
|
4665
4663
|
getLayerPixels(id) {
|
|
4666
4664
|
const layer = this.getLayer(id);
|
|
4667
|
-
if (!layer || !
|
|
4665
|
+
if (!layer || !_chunkXLUYXUBDcjs.hasSurface.call(void 0, layer)) return null;
|
|
4668
4666
|
const surface = this.surfaceOf(layer);
|
|
4669
4667
|
const b = _chunkJ5BA3BQ6cjs.contentBounds.call(void 0, surface);
|
|
4670
4668
|
if (!b) return null;
|
|
@@ -4677,7 +4675,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4677
4675
|
*/
|
|
4678
4676
|
getLayerBounds(id) {
|
|
4679
4677
|
const layer = this.getLayer(id);
|
|
4680
|
-
if (!layer || !
|
|
4678
|
+
if (!layer || !_chunkXLUYXUBDcjs.hasSurface.call(void 0, layer)) return null;
|
|
4681
4679
|
const surface = this.surfaceOf(layer);
|
|
4682
4680
|
let b = this.boundsCache.get(surface);
|
|
4683
4681
|
if (b === void 0) {
|
|
@@ -4692,9 +4690,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4692
4690
|
*/
|
|
4693
4691
|
getLayerDataURL(id) {
|
|
4694
4692
|
const layer = this.getLayer(id);
|
|
4695
|
-
if (!layer || !
|
|
4693
|
+
if (!layer || !_chunkXLUYXUBDcjs.hasSurface.call(void 0, layer)) return null;
|
|
4696
4694
|
const surface = this.surfaceOf(layer);
|
|
4697
|
-
const enc =
|
|
4695
|
+
const enc = _chunkXLUYXUBDcjs.encodeSurface.call(void 0, surface);
|
|
4698
4696
|
return enc ? enc.url : null;
|
|
4699
4697
|
}
|
|
4700
4698
|
/**
|
|
@@ -4836,19 +4834,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4836
4834
|
if (init.pixels) {
|
|
4837
4835
|
const px2 = init.pixels;
|
|
4838
4836
|
if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
|
|
4839
|
-
throw new (0,
|
|
4837
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
|
|
4840
4838
|
}
|
|
4841
4839
|
surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, px2, 4);
|
|
4842
4840
|
} else if (init.color !== void 0) {
|
|
4843
4841
|
const c = parseColor(init.color);
|
|
4844
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]));
|
|
4845
4843
|
}
|
|
4846
|
-
const blend =
|
|
4847
|
-
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.");
|
|
4848
4846
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4849
4847
|
const layer = {
|
|
4850
4848
|
type: "pixel",
|
|
4851
|
-
id: init.id && !ids.has(init.id) ? init.id :
|
|
4849
|
+
id: init.id && !ids.has(init.id) ? init.id : _chunkXLUYXUBDcjs.newLayerId.call(void 0, ),
|
|
4852
4850
|
name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
|
|
4853
4851
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
4854
4852
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
@@ -4857,7 +4855,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4857
4855
|
offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
|
|
4858
4856
|
};
|
|
4859
4857
|
if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
|
|
4860
|
-
const next =
|
|
4858
|
+
const next = _chunkXLUYXUBDcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
4861
4859
|
this.commitLayers(next, () => {
|
|
4862
4860
|
this.state.activeLayerId = layer.id;
|
|
4863
4861
|
this.state.activeTarget = "pixels";
|
|
@@ -4897,12 +4895,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4897
4895
|
try {
|
|
4898
4896
|
img = await this.renderer.imageCache.get(src);
|
|
4899
4897
|
} catch (e21) {
|
|
4900
|
-
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.");
|
|
4901
4899
|
}
|
|
4902
4900
|
const w = img.naturalWidth || img.width;
|
|
4903
4901
|
const h = img.naturalHeight || img.height;
|
|
4904
4902
|
const ctx = this.renderer.createCanvas(w, h).getContext("2d");
|
|
4905
|
-
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.");
|
|
4906
4904
|
ctx.drawImage(img, 0, 0, w, h);
|
|
4907
4905
|
const data = ctx.getImageData(0, 0, w, h);
|
|
4908
4906
|
return { width: w, height: h, data: data.data };
|
|
@@ -4915,7 +4913,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4915
4913
|
}
|
|
4916
4914
|
/** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
|
|
4917
4915
|
duplicateLayer(id, name) {
|
|
4918
|
-
const res =
|
|
4916
|
+
const res = _chunkXLUYXUBDcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
|
|
4919
4917
|
this.commitLayers(res.layers, () => {
|
|
4920
4918
|
this.state.activeLayerId = res.id;
|
|
4921
4919
|
});
|
|
@@ -4923,16 +4921,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
4923
4921
|
}
|
|
4924
4922
|
/** Deletes a layer (refused when locked), as one undo step. */
|
|
4925
4923
|
removeLayer(id) {
|
|
4926
|
-
const next =
|
|
4924
|
+
const next = _chunkXLUYXUBDcjs.removeLayer.call(void 0, this.state.layers, id);
|
|
4927
4925
|
this.commitLayers(next, () => {
|
|
4928
|
-
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)) {
|
|
4929
4927
|
this.state.selectedAnnotationId = null;
|
|
4930
4928
|
}
|
|
4931
4929
|
});
|
|
4932
4930
|
}
|
|
4933
4931
|
/** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
|
|
4934
4932
|
moveLayer(id, placement) {
|
|
4935
|
-
const next =
|
|
4933
|
+
const next = _chunkXLUYXUBDcjs.moveLayer.call(void 0, this.state.layers, id, placement);
|
|
4936
4934
|
const loc = _chunkMZXQTKUMcjs.findLayer.call(void 0, next, id);
|
|
4937
4935
|
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
|
|
4938
4936
|
this.commitLayers(next);
|
|
@@ -4943,23 +4941,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
4943
4941
|
* one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
|
|
4944
4942
|
*/
|
|
4945
4943
|
setLayerProperties(id, props, commitToHistory = true) {
|
|
4946
|
-
const next =
|
|
4944
|
+
const next = _chunkXLUYXUBDcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
|
|
4947
4945
|
this.commitLayers(next, void 0, commitToHistory);
|
|
4948
4946
|
return _chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer;
|
|
4949
4947
|
}
|
|
4950
4948
|
/** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
|
|
4951
4949
|
addGroup(init = {}) {
|
|
4952
|
-
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);
|
|
4953
4951
|
const group = {
|
|
4954
4952
|
type: "group",
|
|
4955
|
-
id:
|
|
4953
|
+
id: _chunkXLUYXUBDcjs.newLayerId.call(void 0, "group"),
|
|
4956
4954
|
name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
|
|
4957
4955
|
visible: true,
|
|
4958
4956
|
opacity: 1,
|
|
4959
4957
|
blend,
|
|
4960
4958
|
children: []
|
|
4961
4959
|
};
|
|
4962
|
-
const next =
|
|
4960
|
+
const next = _chunkXLUYXUBDcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
|
|
4963
4961
|
this.commitLayers(next, () => {
|
|
4964
4962
|
this.state.activeLayerId = group.id;
|
|
4965
4963
|
this.state.activeTarget = "pixels";
|
|
@@ -4968,7 +4966,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4968
4966
|
}
|
|
4969
4967
|
/** Puts sibling layers into a new group (one undo step). Returns the group id. */
|
|
4970
4968
|
groupLayers(ids, name) {
|
|
4971
|
-
const res =
|
|
4969
|
+
const res = _chunkXLUYXUBDcjs.groupLayers.call(void 0, this.state.layers, ids, name);
|
|
4972
4970
|
this.commitLayers(res.layers, () => {
|
|
4973
4971
|
this.state.activeLayerId = res.id;
|
|
4974
4972
|
});
|
|
@@ -4976,7 +4974,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4976
4974
|
}
|
|
4977
4975
|
/** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
|
|
4978
4976
|
ungroupLayer(id) {
|
|
4979
|
-
const res =
|
|
4977
|
+
const res = _chunkXLUYXUBDcjs.ungroupLayer.call(void 0, this.state.layers, id);
|
|
4980
4978
|
this.commitLayers(res.layers);
|
|
4981
4979
|
return res.ids;
|
|
4982
4980
|
}
|
|
@@ -4985,38 +4983,38 @@ var ImageEditorController = (_class7 = class {
|
|
|
4985
4983
|
* (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
|
|
4986
4984
|
*/
|
|
4987
4985
|
offsetLayer(id, move, commitToHistory = true) {
|
|
4988
|
-
const layer =
|
|
4986
|
+
const layer = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
4989
4987
|
if (layer.type === "smart") {
|
|
4990
4988
|
const tl = layer.placement.corners[0];
|
|
4991
4989
|
const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
4992
4990
|
const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
4993
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
4994
|
-
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);
|
|
4995
4993
|
const moved = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, id).layer;
|
|
4996
4994
|
return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
|
|
4997
4995
|
}
|
|
4998
4996
|
if (layer.type === "shape") {
|
|
4999
|
-
const g = _nullishCoalesce(
|
|
4997
|
+
const g = _nullishCoalesce(_chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
|
|
5000
4998
|
const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5001
4999
|
const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5002
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5003
|
-
|
|
5004
|
-
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());
|
|
5005
5003
|
const mask = layer.mask;
|
|
5006
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)) } };
|
|
5007
5005
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
5008
|
-
const b = _nullishCoalesce(
|
|
5006
|
+
const b = _nullishCoalesce(_chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
|
|
5009
5007
|
return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
|
|
5010
5008
|
}
|
|
5011
5009
|
if (layer.type === "type") {
|
|
5012
5010
|
const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
|
|
5013
5011
|
const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
|
|
5014
5012
|
const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
|
|
5015
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5016
|
-
|
|
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");
|
|
5017
5015
|
const mx = Math.round(dx);
|
|
5018
5016
|
const my = Math.round(dy);
|
|
5019
|
-
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) };
|
|
5020
5018
|
const mask = layer.mask;
|
|
5021
5019
|
if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, mx, my) } };
|
|
5022
5020
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
@@ -5026,7 +5024,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5026
5024
|
const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
5027
5025
|
const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
|
|
5028
5026
|
const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
|
|
5029
|
-
const next =
|
|
5027
|
+
const next = _chunkXLUYXUBDcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
|
|
5030
5028
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5031
5029
|
return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
|
|
5032
5030
|
}
|
|
@@ -5036,11 +5034,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5036
5034
|
* target when the layer is active.
|
|
5037
5035
|
*/
|
|
5038
5036
|
addLayerMask(id, from = "reveal-all", props = {}) {
|
|
5039
|
-
const layer =
|
|
5037
|
+
const layer = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5040
5038
|
let mask;
|
|
5041
5039
|
if (from === "selection") {
|
|
5042
5040
|
const sel = this.state.selection;
|
|
5043
|
-
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.");
|
|
5044
5042
|
mask = this.maskFromSelection(sel, props);
|
|
5045
5043
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
5046
5044
|
mask = { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
@@ -5049,7 +5047,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5049
5047
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5050
5048
|
mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5051
5049
|
}
|
|
5052
|
-
const next =
|
|
5050
|
+
const next = _chunkXLUYXUBDcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
|
|
5053
5051
|
this.commitLayers(next, () => {
|
|
5054
5052
|
if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
|
|
5055
5053
|
});
|
|
@@ -5057,18 +5055,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
5057
5055
|
}
|
|
5058
5056
|
/** Removes a layer's mask (one undo step). */
|
|
5059
5057
|
removeLayerMask(id) {
|
|
5060
|
-
const layer =
|
|
5061
|
-
if (!layer.mask) throw new (0,
|
|
5062
|
-
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), () => {
|
|
5063
5061
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
5064
5062
|
});
|
|
5065
5063
|
}
|
|
5066
5064
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
5067
5065
|
setLayerMaskProps(id, props, commitToHistory = true) {
|
|
5068
|
-
const layer =
|
|
5069
|
-
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.`);
|
|
5070
5068
|
const mask = withMaskProps(layer.mask, props);
|
|
5071
|
-
this.commitLayers(
|
|
5069
|
+
this.commitLayers(_chunkXLUYXUBDcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
|
|
5072
5070
|
return mask;
|
|
5073
5071
|
}
|
|
5074
5072
|
/**
|
|
@@ -5076,11 +5074,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5076
5074
|
* the depth map) and removes the mask, as one undo step.
|
|
5077
5075
|
*/
|
|
5078
5076
|
async applyLayerMask(id) {
|
|
5079
|
-
const loc =
|
|
5077
|
+
const loc = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5080
5078
|
const layer = loc.layer;
|
|
5081
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5082
|
-
if (!layer.mask) throw new (0,
|
|
5083
|
-
|
|
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");
|
|
5084
5082
|
const { width, height } = this.naturalSize;
|
|
5085
5083
|
await this.renderer.prepareLayerAssets([layer], width, height);
|
|
5086
5084
|
const sources = this.renderer.compositorSources(width, height);
|
|
@@ -5113,13 +5111,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
5113
5111
|
*/
|
|
5114
5112
|
layerViaCopy(options = {}) {
|
|
5115
5113
|
const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
|
|
5116
|
-
if (!id) throw new (0,
|
|
5117
|
-
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);
|
|
5118
5116
|
const layer = loc.layer;
|
|
5119
|
-
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.`);
|
|
5120
5118
|
const sel = this.state.selection;
|
|
5121
|
-
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0,
|
|
5122
|
-
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");
|
|
5123
5121
|
const surface = this.surfaceOf(layer);
|
|
5124
5122
|
const sb = sel.bounds;
|
|
5125
5123
|
const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
|
|
@@ -5135,7 +5133,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5135
5133
|
}
|
|
5136
5134
|
const copy = {
|
|
5137
5135
|
type: "pixel",
|
|
5138
|
-
id:
|
|
5136
|
+
id: _chunkXLUYXUBDcjs.newLayerId.call(void 0, ),
|
|
5139
5137
|
name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
5140
5138
|
visible: true,
|
|
5141
5139
|
opacity: 1,
|
|
@@ -5208,7 +5206,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5208
5206
|
* Refused while another transform is open.
|
|
5209
5207
|
*/
|
|
5210
5208
|
beginFreeTransform(init = {}) {
|
|
5211
|
-
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.");
|
|
5212
5210
|
const session = new FreeTransformSession(this.transformHost(), init);
|
|
5213
5211
|
this.openTransform = session;
|
|
5214
5212
|
this.notify();
|
|
@@ -5222,26 +5220,26 @@ var ImageEditorController = (_class7 = class {
|
|
|
5222
5220
|
*/
|
|
5223
5221
|
transformLayer(spec) {
|
|
5224
5222
|
const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
|
|
5225
|
-
if (given > 1) throw new (0,
|
|
5226
|
-
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).");
|
|
5227
5225
|
if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
|
|
5228
|
-
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).");
|
|
5229
5227
|
}
|
|
5230
5228
|
if (spec.matrix) {
|
|
5231
5229
|
const [a, b, c, d] = spec.matrix;
|
|
5232
|
-
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.");
|
|
5233
5231
|
}
|
|
5234
5232
|
const session = this.beginFreeTransform(spec);
|
|
5235
5233
|
try {
|
|
5236
5234
|
const g = session.startGeometry;
|
|
5237
|
-
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;
|
|
5238
5236
|
let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
|
|
5239
5237
|
if (spec.warp) {
|
|
5240
5238
|
if ("style" in spec.warp) {
|
|
5241
|
-
if (!
|
|
5242
|
-
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);
|
|
5243
5241
|
} else {
|
|
5244
|
-
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.");
|
|
5245
5243
|
warp = spec.warp;
|
|
5246
5244
|
}
|
|
5247
5245
|
}
|
|
@@ -5254,10 +5252,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5254
5252
|
}
|
|
5255
5253
|
/** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
|
|
5256
5254
|
flipLayer(axis, init = {}) {
|
|
5257
|
-
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)}".`);
|
|
5258
5256
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5259
5257
|
try {
|
|
5260
|
-
session.update({ corners:
|
|
5258
|
+
session.update({ corners: _chunkXLUYXUBDcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
|
|
5261
5259
|
return session.commit();
|
|
5262
5260
|
} catch (e) {
|
|
5263
5261
|
session.cancel();
|
|
@@ -5269,16 +5267,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5269
5267
|
* centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
|
|
5270
5268
|
*/
|
|
5271
5269
|
rotateLayer90(turn, init = {}) {
|
|
5272
|
-
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)}.`);
|
|
5273
5271
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5274
5272
|
try {
|
|
5275
|
-
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;
|
|
5276
5274
|
const cx = b.x + b.width / 2;
|
|
5277
5275
|
const cy = b.y + b.height / 2;
|
|
5278
5276
|
const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
|
|
5279
5277
|
const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
|
|
5280
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];
|
|
5281
|
-
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);
|
|
5282
5280
|
return session.commit();
|
|
5283
5281
|
} catch (e) {
|
|
5284
5282
|
session.cancel();
|
|
@@ -5287,20 +5285,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5287
5285
|
}
|
|
5288
5286
|
/** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
|
|
5289
5287
|
addLayerFilter(id, filter) {
|
|
5290
|
-
const f =
|
|
5291
|
-
const next =
|
|
5288
|
+
const f = _chunkXLUYXUBDcjs.normalizeFilter.call(void 0, filter);
|
|
5289
|
+
const next = _chunkXLUYXUBDcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
|
|
5292
5290
|
this.commitLayers(next);
|
|
5293
5291
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5294
5292
|
}
|
|
5295
5293
|
/** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
|
|
5296
5294
|
updateLayerFilter(id, filterId, changes, commitToHistory = true) {
|
|
5297
|
-
const next =
|
|
5295
|
+
const next = _chunkXLUYXUBDcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
|
|
5298
5296
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5299
5297
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5300
5298
|
}
|
|
5301
5299
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
5302
5300
|
removeLayerFilter(id, filterId) {
|
|
5303
|
-
const next =
|
|
5301
|
+
const next = _chunkXLUYXUBDcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
|
|
5304
5302
|
this.commitLayers(next);
|
|
5305
5303
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5306
5304
|
}
|
|
@@ -5316,8 +5314,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5316
5314
|
*/
|
|
5317
5315
|
convertToSmartObject(ids, options = {}) {
|
|
5318
5316
|
const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
|
|
5319
|
-
if (!list.length) throw new (0,
|
|
5320
|
-
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 });
|
|
5321
5319
|
this.commitLayers(res.layers, () => {
|
|
5322
5320
|
this.state.activeLayerId = res.layer.id;
|
|
5323
5321
|
this.state.activeTarget = "pixels";
|
|
@@ -5326,7 +5324,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5326
5324
|
}
|
|
5327
5325
|
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
5328
5326
|
rasterizeSmartObject(id) {
|
|
5329
|
-
const res =
|
|
5327
|
+
const res = _chunkXLUYXUBDcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
|
|
5330
5328
|
this.commitLayers(res.layers, () => {
|
|
5331
5329
|
if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
5332
5330
|
});
|
|
@@ -5334,10 +5332,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5334
5332
|
}
|
|
5335
5333
|
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
5336
5334
|
getSmartObject(id) {
|
|
5337
|
-
const layer =
|
|
5335
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5338
5336
|
const c = layer.contents;
|
|
5339
|
-
const g =
|
|
5340
|
-
const readout =
|
|
5337
|
+
const g = _chunkXLUYXUBDcjs.placementGeometry.call(void 0, layer);
|
|
5338
|
+
const readout = _chunkXLUYXUBDcjs.describeTransform.call(void 0, g);
|
|
5341
5339
|
const stack = layer.smartFilters;
|
|
5342
5340
|
return {
|
|
5343
5341
|
layerId: layer.id,
|
|
@@ -5347,10 +5345,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5347
5345
|
kind: c.kind,
|
|
5348
5346
|
width: c.width,
|
|
5349
5347
|
height: c.height,
|
|
5350
|
-
decoded:
|
|
5348
|
+
decoded: _chunkXLUYXUBDcjs.isContentsDecoded.call(void 0, c),
|
|
5351
5349
|
fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
|
|
5352
5350
|
linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
|
|
5353
|
-
instances:
|
|
5351
|
+
instances: _chunkXLUYXUBDcjs.instancesOf.call(void 0, this.state.layers, c.id),
|
|
5354
5352
|
layerCount: c.document ? _chunkMZXQTKUMcjs.flattenLayers.call(void 0, c.document.layers).length : 0
|
|
5355
5353
|
},
|
|
5356
5354
|
placement: {
|
|
@@ -5362,8 +5360,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5362
5360
|
scaleY: readout.scaleY,
|
|
5363
5361
|
rotate: readout.rotate,
|
|
5364
5362
|
skewX: readout.skewX,
|
|
5365
|
-
center:
|
|
5366
|
-
bounds:
|
|
5363
|
+
center: _chunkXLUYXUBDcjs.anchorPoint.call(void 0, g, "center"),
|
|
5364
|
+
bounds: _chunkXLUYXUBDcjs.transformedBox.call(void 0, g)
|
|
5367
5365
|
},
|
|
5368
5366
|
smartFilters: {
|
|
5369
5367
|
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
|
|
@@ -5380,7 +5378,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5380
5378
|
* change. Returns the new placement summary.
|
|
5381
5379
|
*/
|
|
5382
5380
|
setSmartObjectPlacement(id, placement, commitToHistory = true) {
|
|
5383
|
-
const res =
|
|
5381
|
+
const res = _chunkXLUYXUBDcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
|
|
5384
5382
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5385
5383
|
return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
|
|
5386
5384
|
}
|
|
@@ -5393,23 +5391,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
5393
5391
|
* nothing is relative to the current transform.
|
|
5394
5392
|
*/
|
|
5395
5393
|
setSmartObjectTransform(id, spec) {
|
|
5396
|
-
const layer =
|
|
5397
|
-
const g =
|
|
5394
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5395
|
+
const g = _chunkXLUYXUBDcjs.placementGeometry.call(void 0, layer);
|
|
5398
5396
|
const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
|
|
5399
5397
|
const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
|
|
5400
|
-
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).");
|
|
5401
5399
|
let corners = g.corners;
|
|
5402
5400
|
if (spec.corners) corners = spec.corners;
|
|
5403
5401
|
else if (spec.matrix) {
|
|
5404
|
-
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).");
|
|
5405
5403
|
const [a, b, c, d] = spec.matrix;
|
|
5406
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5407
|
-
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);
|
|
5408
5406
|
} else if (numeric.length) {
|
|
5409
|
-
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0,
|
|
5410
|
-
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0,
|
|
5411
|
-
const now =
|
|
5412
|
-
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");
|
|
5413
5411
|
const params = {
|
|
5414
5412
|
scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
|
|
5415
5413
|
scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
|
|
@@ -5417,20 +5415,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5417
5415
|
skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
|
|
5418
5416
|
skewY: _nullishCoalesce(spec.skewY, () => ( 0))
|
|
5419
5417
|
};
|
|
5420
|
-
const m =
|
|
5418
|
+
const m = _chunkXLUYXUBDcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
|
|
5421
5419
|
const cx = g.box.width / 2;
|
|
5422
5420
|
const cy = g.box.height / 2;
|
|
5423
5421
|
const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
|
|
5424
|
-
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)));
|
|
5425
5423
|
}
|
|
5426
5424
|
let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
|
|
5427
5425
|
if (spec.warp === null) warp = null;
|
|
5428
5426
|
else if (spec.warp) {
|
|
5429
5427
|
if ("style" in spec.warp) {
|
|
5430
|
-
if (!
|
|
5431
|
-
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);
|
|
5432
5430
|
} else {
|
|
5433
|
-
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.");
|
|
5434
5432
|
warp = spec.warp;
|
|
5435
5433
|
}
|
|
5436
5434
|
}
|
|
@@ -5444,16 +5442,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5444
5442
|
* the layers that changed.
|
|
5445
5443
|
*/
|
|
5446
5444
|
replaceSmartObjectContents(id, source) {
|
|
5447
|
-
const layer =
|
|
5445
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5448
5446
|
let contents;
|
|
5449
5447
|
if ("contents" in source) contents = source.contents;
|
|
5450
|
-
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"))));
|
|
5451
5449
|
else {
|
|
5452
|
-
const psd =
|
|
5453
|
-
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`)));
|
|
5454
5452
|
contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
|
|
5455
5453
|
}
|
|
5456
|
-
const res =
|
|
5454
|
+
const res = _chunkXLUYXUBDcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
|
|
5457
5455
|
this.commitLayers(res.layers);
|
|
5458
5456
|
return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
|
|
5459
5457
|
}
|
|
@@ -5468,16 +5466,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5468
5466
|
* and bytes.
|
|
5469
5467
|
*/
|
|
5470
5468
|
exportSmartObjectContents(id) {
|
|
5471
|
-
const layer =
|
|
5469
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5472
5470
|
const c = layer.contents;
|
|
5473
5471
|
const base = c.name.replace(/\.\w+$/, "") || "Contents";
|
|
5474
5472
|
if (c.file) {
|
|
5475
|
-
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 };
|
|
5476
5474
|
const ext = c.file.type.toLowerCase();
|
|
5477
5475
|
return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
|
|
5478
5476
|
}
|
|
5479
|
-
if (!
|
|
5480
|
-
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);
|
|
5481
5479
|
return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
|
|
5482
5480
|
}
|
|
5483
5481
|
/**
|
|
@@ -5486,7 +5484,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5486
5484
|
* undo step. Returns the copy's id.
|
|
5487
5485
|
*/
|
|
5488
5486
|
copySmartObject(id, linked = false, name) {
|
|
5489
|
-
const res =
|
|
5487
|
+
const res = _chunkXLUYXUBDcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
|
|
5490
5488
|
this.commitLayers(res.layers, () => {
|
|
5491
5489
|
this.state.activeLayerId = res.layer.id;
|
|
5492
5490
|
this.state.activeTarget = "pixels";
|
|
@@ -5495,31 +5493,31 @@ var ImageEditorController = (_class7 = class {
|
|
|
5495
5493
|
}
|
|
5496
5494
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
5497
5495
|
addSmartFilter(id, filter, index) {
|
|
5498
|
-
const res =
|
|
5496
|
+
const res = _chunkXLUYXUBDcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkXLUYXUBDcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
|
|
5499
5497
|
this.commitLayers(res.layers);
|
|
5500
5498
|
return res.filter;
|
|
5501
5499
|
}
|
|
5502
5500
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
5503
5501
|
updateSmartFilter(id, filterId, changes, commitToHistory = true) {
|
|
5504
|
-
const res =
|
|
5502
|
+
const res = _chunkXLUYXUBDcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
|
|
5505
5503
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5506
5504
|
return res.filter;
|
|
5507
5505
|
}
|
|
5508
5506
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
5509
5507
|
removeSmartFilter(id, filterId) {
|
|
5510
|
-
const res =
|
|
5508
|
+
const res = _chunkXLUYXUBDcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
|
|
5511
5509
|
this.commitLayers(res.layers);
|
|
5512
5510
|
return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
|
|
5513
5511
|
}
|
|
5514
5512
|
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
5515
5513
|
moveSmartFilter(id, filterId, index) {
|
|
5516
|
-
const res =
|
|
5514
|
+
const res = _chunkXLUYXUBDcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
|
|
5517
5515
|
this.commitLayers(res.layers);
|
|
5518
5516
|
return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
|
|
5519
5517
|
}
|
|
5520
5518
|
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
5521
5519
|
setSmartFiltersEnabled(id, enabled) {
|
|
5522
|
-
const res =
|
|
5520
|
+
const res = _chunkXLUYXUBDcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
|
|
5523
5521
|
this.commitLayers(res.layers);
|
|
5524
5522
|
return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
|
|
5525
5523
|
}
|
|
@@ -5529,21 +5527,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
5529
5527
|
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
5530
5528
|
*/
|
|
5531
5529
|
setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
|
|
5532
|
-
const layer =
|
|
5530
|
+
const layer = _chunkXLUYXUBDcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5533
5531
|
let mask;
|
|
5534
5532
|
if (from === "none") mask = null;
|
|
5535
5533
|
else if (from === "keep") {
|
|
5536
|
-
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.`);
|
|
5537
5535
|
mask = withMaskProps(layer.smartFilters.mask, props);
|
|
5538
5536
|
} else if (from === "selection") {
|
|
5539
5537
|
const sel = this.state.selection;
|
|
5540
|
-
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.");
|
|
5541
5539
|
mask = this.maskFromSelection(sel, props);
|
|
5542
5540
|
} else {
|
|
5543
5541
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5544
5542
|
mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5545
5543
|
}
|
|
5546
|
-
const res =
|
|
5544
|
+
const res = _chunkXLUYXUBDcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
|
|
5547
5545
|
this.commitLayers(res.layers, () => {
|
|
5548
5546
|
if (this.state.activeLayerId !== id) return;
|
|
5549
5547
|
if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
|
|
@@ -5559,14 +5557,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
5559
5557
|
async prepareSmartObjects() {
|
|
5560
5558
|
const pending = /* @__PURE__ */ new Map();
|
|
5561
5559
|
for (const l of _chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers)) {
|
|
5562
|
-
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);
|
|
5563
5561
|
}
|
|
5564
5562
|
const left = [];
|
|
5565
5563
|
for (const [cid, c] of pending) {
|
|
5566
5564
|
try {
|
|
5567
|
-
const url = `data:${
|
|
5565
|
+
const url = `data:${_chunkXLUYXUBDcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes)}`;
|
|
5568
5566
|
const px2 = await this.decodeImage(url);
|
|
5569
|
-
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 };
|
|
5570
5568
|
const swap = (layers) => {
|
|
5571
5569
|
let out = layers;
|
|
5572
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 }));
|
|
@@ -5594,10 +5592,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5594
5592
|
* Contents can nest. Returns the contents' size and layer ids.
|
|
5595
5593
|
*/
|
|
5596
5594
|
editSmartObjectContents(id) {
|
|
5597
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5598
|
-
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);
|
|
5599
5597
|
const c = layer.contents;
|
|
5600
|
-
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.`);
|
|
5601
5599
|
const saved = {
|
|
5602
5600
|
state: { ...this.state },
|
|
5603
5601
|
undo: this.undoStack,
|
|
@@ -5608,7 +5606,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5608
5606
|
samplePixelsOverride: this.samplePixelsOverride,
|
|
5609
5607
|
psdResolution: this.psdResolution
|
|
5610
5608
|
};
|
|
5611
|
-
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 } }];
|
|
5612
5610
|
this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
|
|
5613
5611
|
const s = this.state;
|
|
5614
5612
|
this.state = {
|
|
@@ -5616,7 +5614,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5616
5614
|
sourceUrl: null,
|
|
5617
5615
|
imageDimensions: { width: c.width, height: c.height },
|
|
5618
5616
|
crop: null,
|
|
5619
|
-
transform: { ...
|
|
5617
|
+
transform: { ..._chunkXLUYXUBDcjs.DEFAULT_TRANSFORM_VALUES },
|
|
5620
5618
|
layers,
|
|
5621
5619
|
activeLayerId: layers.length ? layers[layers.length - 1].id : null,
|
|
5622
5620
|
activeTarget: "pixels",
|
|
@@ -5649,7 +5647,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5649
5647
|
*/
|
|
5650
5648
|
closeSmartObjectContents(save = true) {
|
|
5651
5649
|
const top = this.contentsStack.pop();
|
|
5652
|
-
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.");
|
|
5653
5651
|
if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
|
|
5654
5652
|
this.openTransform = null;
|
|
5655
5653
|
const edited = this.state;
|
|
@@ -5663,10 +5661,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5663
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";
|
|
5664
5662
|
if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
|
|
5665
5663
|
const px2 = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
|
|
5666
|
-
next =
|
|
5664
|
+
next = _chunkXLUYXUBDcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
|
|
5667
5665
|
} else {
|
|
5668
5666
|
const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
|
|
5669
|
-
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);
|
|
5670
5668
|
}
|
|
5671
5669
|
}
|
|
5672
5670
|
const saved = top.saved;
|
|
@@ -5685,7 +5683,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5685
5683
|
this.notify();
|
|
5686
5684
|
return { layerId: top.layerId, changed: false, layerIds: [] };
|
|
5687
5685
|
}
|
|
5688
|
-
const res =
|
|
5686
|
+
const res = _chunkXLUYXUBDcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
|
|
5689
5687
|
this.commitLayers(res.layers);
|
|
5690
5688
|
return { layerId: top.layerId, changed: true, layerIds: res.ids };
|
|
5691
5689
|
}
|
|
@@ -5700,35 +5698,35 @@ var ImageEditorController = (_class7 = class {
|
|
|
5700
5698
|
// --- Layer effects ---
|
|
5701
5699
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
5702
5700
|
getLayerEffects(id) {
|
|
5703
|
-
return
|
|
5701
|
+
return _chunkXLUYXUBDcjs.layerEffectsOf.call(void 0, _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer);
|
|
5704
5702
|
}
|
|
5705
5703
|
/**
|
|
5706
5704
|
* Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
|
|
5707
5705
|
* `index` in the layer's effect list (default the end). Returns the new effect and the effects.
|
|
5708
5706
|
*/
|
|
5709
5707
|
addLayerEffect(id, kind, params = {}, index) {
|
|
5710
|
-
const res =
|
|
5708
|
+
const res = _chunkXLUYXUBDcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
|
|
5711
5709
|
this.commitLayers(res.layers);
|
|
5712
5710
|
return { effect: res.effect, effects: this.getLayerEffects(id) };
|
|
5713
5711
|
}
|
|
5714
5712
|
/** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
|
|
5715
5713
|
updateLayerEffect(id, effectId, changes, commitToHistory = true) {
|
|
5716
|
-
this.commitLayers(
|
|
5714
|
+
this.commitLayers(_chunkXLUYXUBDcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
|
|
5717
5715
|
return this.getLayerEffects(id);
|
|
5718
5716
|
}
|
|
5719
5717
|
/** Removes one effect (one undo step). Returns the remaining effects. */
|
|
5720
5718
|
removeLayerEffect(id, effectId) {
|
|
5721
|
-
this.commitLayers(
|
|
5719
|
+
this.commitLayers(_chunkXLUYXUBDcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
|
|
5722
5720
|
return this.getLayerEffects(id);
|
|
5723
5721
|
}
|
|
5724
5722
|
/** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
|
|
5725
5723
|
setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
|
|
5726
|
-
this.commitLayers(
|
|
5724
|
+
this.commitLayers(_chunkXLUYXUBDcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
|
|
5727
5725
|
return this.getLayerEffects(id);
|
|
5728
5726
|
}
|
|
5729
5727
|
/** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
|
|
5730
5728
|
setLayerEffects(id, effects, commitToHistory = true) {
|
|
5731
|
-
this.commitLayers(
|
|
5729
|
+
this.commitLayers(_chunkXLUYXUBDcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
|
|
5732
5730
|
return this.getLayerEffects(id);
|
|
5733
5731
|
}
|
|
5734
5732
|
__init76() {this.patternIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -5754,8 +5752,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5754
5752
|
/** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
|
|
5755
5753
|
setGlobalLight(light, commitToHistory = true) {
|
|
5756
5754
|
const next = { ...this.getGlobalLight(), ...light };
|
|
5757
|
-
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0,
|
|
5758
|
-
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}.`);
|
|
5759
5757
|
if (commitToHistory) this.recordHistory();
|
|
5760
5758
|
if (next.angle === _chunkMZXQTKUMcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkMZXQTKUMcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
|
|
5761
5759
|
else this.state.globalLight = next;
|
|
@@ -5766,16 +5764,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5766
5764
|
async compositeToSurface(layers, rect) {
|
|
5767
5765
|
const { width, height } = this.naturalSize;
|
|
5768
5766
|
if (_chunkMZXQTKUMcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
|
|
5769
|
-
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.");
|
|
5770
5768
|
}
|
|
5771
5769
|
await this.renderer.prepareLayerAssets(layers, width, height);
|
|
5772
5770
|
const sources = this.renderer.compositorSources(width, height);
|
|
5773
5771
|
const depth = this.bitDepth;
|
|
5774
5772
|
if (depth !== 8) {
|
|
5775
|
-
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);
|
|
5776
5774
|
return _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
|
|
5777
5775
|
}
|
|
5778
|
-
const data = new (0,
|
|
5776
|
+
const data = new (0, _chunkXLUYXUBDcjs.LayerCompositor)().composite(layers, rect, sources);
|
|
5779
5777
|
return _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
|
|
5780
5778
|
}
|
|
5781
5779
|
/**
|
|
@@ -5788,22 +5786,22 @@ var ImageEditorController = (_class7 = class {
|
|
|
5788
5786
|
const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
|
|
5789
5787
|
const depth = this.bitDepth;
|
|
5790
5788
|
if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkJ5BA3BQ6cjs.to16From8.call(void 0, this.compositePixels(r).data) };
|
|
5791
|
-
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);
|
|
5792
5790
|
return { width: r.width, height: r.height, depth, data };
|
|
5793
5791
|
}
|
|
5794
5792
|
/** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
|
|
5795
5793
|
paintBounds(layer) {
|
|
5796
5794
|
const { width, height } = this.naturalSize;
|
|
5797
5795
|
const canvas = { x: 0, y: 0, width, height };
|
|
5798
|
-
if (
|
|
5796
|
+
if (_chunkXLUYXUBDcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
5799
5797
|
if (layer.type === "annotation") {
|
|
5800
|
-
const b =
|
|
5798
|
+
const b = _chunkXLUYXUBDcjs.getAnnotationBounds.call(void 0, layer.annotation);
|
|
5801
5799
|
const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
|
|
5802
5800
|
return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
|
|
5803
5801
|
}
|
|
5804
5802
|
if (layer.type === "group") {
|
|
5805
5803
|
let r = null;
|
|
5806
|
-
for (const c of layer.children) r =
|
|
5804
|
+
for (const c of layer.children) r = _chunkXLUYXUBDcjs.unionRect.call(void 0, r, this.paintBounds(c));
|
|
5807
5805
|
return _nullishCoalesce(r, () => ( canvas));
|
|
5808
5806
|
}
|
|
5809
5807
|
return canvas;
|
|
@@ -5814,16 +5812,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5814
5812
|
* Returns the merged id.
|
|
5815
5813
|
*/
|
|
5816
5814
|
async mergeDown(id) {
|
|
5817
|
-
const loc =
|
|
5815
|
+
const loc = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5818
5816
|
const upper = loc.layer;
|
|
5819
5817
|
const siblings = loc.parent ? loc.parent.children : this.state.layers;
|
|
5820
5818
|
const lower = siblings[loc.index - 1];
|
|
5821
|
-
if (!lower) throw new (0,
|
|
5822
|
-
if (lower.type !== "pixel") throw new (0,
|
|
5823
|
-
if (!upper.visible) throw new (0,
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
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 }));
|
|
5827
5825
|
const reach = Math.max(_chunkMZXQTKUMcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkMZXQTKUMcjs.effectsMargin.call(void 0, upper.effects));
|
|
5828
5826
|
if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
|
|
5829
5827
|
const base = { ...lower, blend: "normal", opacity: 1 };
|
|
@@ -5849,12 +5847,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
5849
5847
|
*/
|
|
5850
5848
|
async mergeVisible() {
|
|
5851
5849
|
const visible = this.state.layers.filter((l) => l.visible);
|
|
5852
|
-
if (!visible.length) throw new (0,
|
|
5850
|
+
if (!visible.length) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("No layer is visible.");
|
|
5853
5851
|
const { width, height } = this.naturalSize;
|
|
5854
5852
|
const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
|
|
5855
5853
|
const merged = {
|
|
5856
5854
|
type: "pixel",
|
|
5857
|
-
id:
|
|
5855
|
+
id: _chunkXLUYXUBDcjs.newLayerId.call(void 0, ),
|
|
5858
5856
|
name: "Merged",
|
|
5859
5857
|
visible: true,
|
|
5860
5858
|
opacity: 1,
|
|
@@ -5878,8 +5876,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5878
5876
|
const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
|
|
5879
5877
|
const bg = {
|
|
5880
5878
|
type: "pixel",
|
|
5881
|
-
id:
|
|
5882
|
-
name:
|
|
5879
|
+
id: _chunkXLUYXUBDcjs.BACKGROUND_LAYER_ID,
|
|
5880
|
+
name: _chunkXLUYXUBDcjs.BACKGROUND_LAYER_NAME,
|
|
5883
5881
|
visible: true,
|
|
5884
5882
|
opacity: 1,
|
|
5885
5883
|
blend: "normal",
|
|
@@ -5906,7 +5904,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5906
5904
|
const k = Math.min(1, side / Math.max(width, height));
|
|
5907
5905
|
const tw = Math.max(1, Math.round(width * k));
|
|
5908
5906
|
const th = Math.max(1, Math.round(height * k));
|
|
5909
|
-
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;
|
|
5910
5908
|
if (!surface) return null;
|
|
5911
5909
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
5912
5910
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
@@ -6001,7 +5999,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6001
5999
|
* pixels. The next stroke fixes the offset from its first point. View state, no undo.
|
|
6002
6000
|
*/
|
|
6003
6001
|
setCloneSource(point) {
|
|
6004
|
-
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).");
|
|
6005
6003
|
const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
|
|
6006
6004
|
this.state.paint = { ...this.state.paint, cloneSource: source };
|
|
6007
6005
|
this.notify();
|
|
@@ -6019,27 +6017,27 @@ var ImageEditorController = (_class7 = class {
|
|
|
6019
6017
|
/** Resolves and validates what a stroke, fill or clear paints into. */
|
|
6020
6018
|
paintTarget(layerId, channel, action) {
|
|
6021
6019
|
const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
|
|
6022
|
-
if (!id) throw new (0,
|
|
6023
|
-
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;
|
|
6024
6022
|
const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
|
|
6025
6023
|
if (ch === "mask") {
|
|
6026
|
-
if (!layer.mask) throw new (0,
|
|
6027
|
-
if (layer.mask.source) throw new (0,
|
|
6028
|
-
|
|
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);
|
|
6029
6027
|
} else if (ch === "filter-mask") {
|
|
6030
6028
|
if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
|
|
6031
|
-
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.`);
|
|
6032
6030
|
}
|
|
6033
|
-
if (!
|
|
6034
|
-
|
|
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);
|
|
6035
6033
|
} else {
|
|
6036
|
-
if (layer.type === "smart") throw new (0,
|
|
6037
|
-
if (layer.type === "shape") throw new (0,
|
|
6038
|
-
if (layer.type === "type") throw new (0,
|
|
6039
|
-
if (layer.type !== "pixel") throw new (0,
|
|
6040
|
-
|
|
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);
|
|
6041
6039
|
}
|
|
6042
|
-
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}.`);
|
|
6043
6041
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
6044
6042
|
const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
|
|
6045
6043
|
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
|
|
@@ -6048,7 +6046,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6048
6046
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
6049
6047
|
withSurface(layer, channel, surface) {
|
|
6050
6048
|
if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
|
|
6051
|
-
if (channel === "filter-mask") return
|
|
6049
|
+
if (channel === "filter-mask") return _chunkXLUYXUBDcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
|
|
6052
6050
|
const next = { ...layer, surface };
|
|
6053
6051
|
delete next.source;
|
|
6054
6052
|
return next;
|
|
@@ -6061,10 +6059,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6061
6059
|
*/
|
|
6062
6060
|
beginStroke(init = {}) {
|
|
6063
6061
|
const tool = _nullishCoalesce(init.tool, () => ( "brush"));
|
|
6064
|
-
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(", ")}.`);
|
|
6065
6063
|
const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
|
|
6066
6064
|
if (tool === "mixer" && target.channel !== "pixels") {
|
|
6067
|
-
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.");
|
|
6068
6066
|
}
|
|
6069
6067
|
const brush = _chunk6GFRKLLScjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
|
|
6070
6068
|
let strokePaint = null;
|
|
@@ -6098,7 +6096,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6098
6096
|
retouchStroke(tool, init, brush, target, apply) {
|
|
6099
6097
|
const settings = _chunkW6M7C7R3cjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
|
|
6100
6098
|
const mask = target.channel !== "pixels";
|
|
6101
|
-
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.");
|
|
6102
6100
|
if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkW6M7C7R3cjs.RetouchDabStroke)(brush, pixels, _chunkW6M7C7R3cjs.smudgeEffect.call(void 0, brush, settings.strength)) };
|
|
6103
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)) };
|
|
6104
6102
|
const retouchApply = {
|
|
@@ -6151,7 +6149,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6151
6149
|
}
|
|
6152
6150
|
if (init.source) this.setCloneSource(init.source);
|
|
6153
6151
|
const cs = this.state.paint.cloneSource;
|
|
6154
|
-
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 }.`);
|
|
6155
6153
|
let offset = { x: 0, y: 0 };
|
|
6156
6154
|
let first = { x: 0, y: 0 };
|
|
6157
6155
|
const paint = () => ({ kind: "source", source, dx: offset.x, dy: offset.y });
|
|
@@ -6186,7 +6184,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6186
6184
|
const sources = this.compositorSources();
|
|
6187
6185
|
if (depth) {
|
|
6188
6186
|
return new (0, _chunkW6M7C7R3cjs.TilePixelSource)((tx, ty) => {
|
|
6189
|
-
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);
|
|
6190
6188
|
for (let i = 0; i < w.length; i += 4) {
|
|
6191
6189
|
if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkJ5BA3BQ6cjs.srgbEncode.call(void 0, w[i + c]);
|
|
6192
6190
|
for (let c = 0; c < 4; c++) w[i + c] *= 255;
|
|
@@ -6194,7 +6192,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6194
6192
|
return w;
|
|
6195
6193
|
}, 4);
|
|
6196
6194
|
}
|
|
6197
|
-
const compositor = new (0,
|
|
6195
|
+
const compositor = new (0, _chunkXLUYXUBDcjs.LayerCompositor)();
|
|
6198
6196
|
return new (0, _chunkW6M7C7R3cjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
|
|
6199
6197
|
}
|
|
6200
6198
|
/** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
|
|
@@ -6244,9 +6242,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6244
6242
|
* document bounds and the number of dabs.
|
|
6245
6243
|
*/
|
|
6246
6244
|
paintStroke(init) {
|
|
6247
|
-
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.");
|
|
6248
6246
|
for (const p of init.points) {
|
|
6249
|
-
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).");
|
|
6250
6248
|
}
|
|
6251
6249
|
const session = this.beginStroke(init);
|
|
6252
6250
|
session.push(init.points);
|
|
@@ -6272,8 +6270,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6272
6270
|
const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
|
|
6273
6271
|
const { width, height } = this.naturalSize;
|
|
6274
6272
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
6275
|
-
if (!(opacity >= 0 && opacity <= 1)) throw new (0,
|
|
6276
|
-
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"));
|
|
6277
6275
|
const sel = options.useSelection !== false && _optionalChain([this, 'access', _238 => _238.state, 'access', _239 => _239.selection, 'optionalAccess', _240 => _240.bounds]) ? this.state.selection : null;
|
|
6278
6276
|
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _241 => _241.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
6279
6277
|
const coverage = new (0, _chunk6GFRKLLScjs.CoverageMap)();
|
|
@@ -6309,7 +6307,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6309
6307
|
// --- Adjustments ---
|
|
6310
6308
|
/** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
|
|
6311
6309
|
developLayer() {
|
|
6312
|
-
return
|
|
6310
|
+
return _chunkXLUYXUBDcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
|
|
6313
6311
|
}
|
|
6314
6312
|
/**
|
|
6315
6313
|
* Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
|
|
@@ -6335,7 +6333,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6335
6333
|
this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
|
|
6336
6334
|
}
|
|
6337
6335
|
if ("layers" in partial) {
|
|
6338
|
-
layers = this.replaceAdjustmentNodes(layers,
|
|
6336
|
+
layers = this.replaceAdjustmentNodes(layers, _chunkXLUYXUBDcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
|
|
6339
6337
|
}
|
|
6340
6338
|
this.state.layers = layers;
|
|
6341
6339
|
this.notify();
|
|
@@ -6343,7 +6341,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6343
6341
|
/** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
|
|
6344
6342
|
get isProcessOutdated() {
|
|
6345
6343
|
this.syncViews();
|
|
6346
|
-
return
|
|
6344
|
+
return _chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkXLUYXUBDcjs.LATEST_PROCESS_VERSION;
|
|
6347
6345
|
}
|
|
6348
6346
|
/**
|
|
6349
6347
|
* Update to Current Process: re-interprets the current adjustment values with the latest
|
|
@@ -6351,7 +6349,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6351
6349
|
*/
|
|
6352
6350
|
upgradeProcess() {
|
|
6353
6351
|
if (!this.isProcessOutdated) return false;
|
|
6354
|
-
this.setAdjustments({ process:
|
|
6352
|
+
this.setAdjustments({ process: _chunkXLUYXUBDcjs.LATEST_PROCESS_VERSION });
|
|
6355
6353
|
return true;
|
|
6356
6354
|
}
|
|
6357
6355
|
/** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
|
|
@@ -6362,7 +6360,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6362
6360
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0,
|
|
6363
6361
|
this.state.layers,
|
|
6364
6362
|
target.id,
|
|
6365
|
-
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process:
|
|
6363
|
+
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkXLUYXUBDcjs.LATEST_PROCESS_VERSION }), 0)
|
|
6366
6364
|
);
|
|
6367
6365
|
}
|
|
6368
6366
|
delete this.state.legacyOutputBlur;
|
|
@@ -6426,7 +6424,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6426
6424
|
const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
|
|
6427
6425
|
for (const l of next) {
|
|
6428
6426
|
if (existing.has(l.id)) continue;
|
|
6429
|
-
out = this.placeLayer(out,
|
|
6427
|
+
out = this.placeLayer(out, _chunkXLUYXUBDcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
|
|
6430
6428
|
}
|
|
6431
6429
|
const order = next.map((l) => l.id);
|
|
6432
6430
|
for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
|
|
@@ -6441,7 +6439,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6441
6439
|
addAdjustmentLayer(init, index) {
|
|
6442
6440
|
const spec = typeof init === "string" ? { kind: init } : init;
|
|
6443
6441
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
6444
|
-
const layer =
|
|
6442
|
+
const layer = _chunkXLUYXUBDcjs.createAdjustmentLayer.call(void 0, spec.kind, {
|
|
6445
6443
|
id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
|
|
6446
6444
|
name: spec.name,
|
|
6447
6445
|
params: spec.params,
|
|
@@ -6450,10 +6448,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6450
6448
|
blend: spec.blend,
|
|
6451
6449
|
mask: _nullishCoalesce(spec.mask, () => ( void 0))
|
|
6452
6450
|
});
|
|
6453
|
-
while (ids.has(layer.id)) layer.id =
|
|
6451
|
+
while (ids.has(layer.id)) layer.id = _chunkXLUYXUBDcjs.newLayerId.call(void 0, "adj");
|
|
6454
6452
|
const { width, height } = this.naturalSize;
|
|
6455
6453
|
this.recordHistory();
|
|
6456
|
-
const node =
|
|
6454
|
+
const node = _chunkXLUYXUBDcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
|
|
6457
6455
|
const positioned = Boolean(spec.aboveId || spec.parentId);
|
|
6458
6456
|
this.state.layers = this.placeLayer(this.state.layers, node, {
|
|
6459
6457
|
aboveId: spec.aboveId,
|
|
@@ -6473,7 +6471,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6473
6471
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
6474
6472
|
const { width, height } = this.naturalSize;
|
|
6475
6473
|
const node = loc.layer;
|
|
6476
|
-
const merged =
|
|
6474
|
+
const merged = _chunkXLUYXUBDcjs.normalizeAdjustmentLayer.call(void 0, {
|
|
6477
6475
|
id: node.id,
|
|
6478
6476
|
kind: node.kind,
|
|
6479
6477
|
enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
|
|
@@ -6493,7 +6491,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6493
6491
|
params: merged.params
|
|
6494
6492
|
};
|
|
6495
6493
|
if (update.mask !== void 0) {
|
|
6496
|
-
const mask = update.mask ?
|
|
6494
|
+
const mask = update.mask ? _chunkXLUYXUBDcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
|
|
6497
6495
|
if (mask) next.mask = mask;
|
|
6498
6496
|
else delete next.mask;
|
|
6499
6497
|
}
|
|
@@ -6580,8 +6578,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6580
6578
|
const { width, height } = this.naturalSize;
|
|
6581
6579
|
let next = null;
|
|
6582
6580
|
if (mask) {
|
|
6583
|
-
const sized = mask.width === width && mask.height === height ? mask :
|
|
6584
|
-
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);
|
|
6585
6583
|
} else if (mode !== "replace") {
|
|
6586
6584
|
return false;
|
|
6587
6585
|
}
|
|
@@ -6595,7 +6593,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6595
6593
|
/** Select › All. */
|
|
6596
6594
|
selectAll() {
|
|
6597
6595
|
const { width, height } = this.naturalSize;
|
|
6598
|
-
return this.setSelection(
|
|
6596
|
+
return this.setSelection(_chunkXLUYXUBDcjs.fullSelection.call(void 0, width, height));
|
|
6599
6597
|
}
|
|
6600
6598
|
/** Select › Deselect. */
|
|
6601
6599
|
deselect() {
|
|
@@ -6604,11 +6602,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6604
6602
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
6605
6603
|
invertSelection() {
|
|
6606
6604
|
const { width, height } = this.naturalSize;
|
|
6607
|
-
const current = _nullishCoalesce(this.state.selection, () => (
|
|
6608
|
-
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));
|
|
6609
6607
|
}
|
|
6610
6608
|
shapeCommand(mask, options) {
|
|
6611
|
-
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;
|
|
6612
6610
|
return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6613
6611
|
}
|
|
6614
6612
|
/** Rectangular marquee in natural image pixels. */
|
|
@@ -6662,11 +6660,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6662
6660
|
if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
|
|
6663
6661
|
return null;
|
|
6664
6662
|
}
|
|
6665
|
-
const legacy =
|
|
6663
|
+
const legacy = _chunkXLUYXUBDcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
|
|
6666
6664
|
if (options.sample === "active-layer") {
|
|
6667
6665
|
const layer = this.getActiveLayer();
|
|
6668
6666
|
if (!layer || layer.type !== "pixel") {
|
|
6669
|
-
throw new (0,
|
|
6667
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
|
|
6670
6668
|
}
|
|
6671
6669
|
const surface = layer.source === "document" && options.pixels ? _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
|
|
6672
6670
|
return { width, height, data: _chunkJ5BA3BQ6cjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
|
|
@@ -6675,7 +6673,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6675
6673
|
this.syncViews();
|
|
6676
6674
|
if (legacy && !options.pixels) {
|
|
6677
6675
|
const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
|
|
6678
|
-
|
|
6676
|
+
_chunkXLUYXUBDcjs.applyAdjustments.call(void 0, copy, _chunkXLUYXUBDcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
|
|
6679
6677
|
return copy;
|
|
6680
6678
|
}
|
|
6681
6679
|
const pixels = options.pixels;
|
|
@@ -6687,7 +6685,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6687
6685
|
};
|
|
6688
6686
|
const stack = withoutAnnotations(this.state.layers);
|
|
6689
6687
|
const layers = options.sampleMerged ? stack : pixelsOnly(stack);
|
|
6690
|
-
const data = new (0,
|
|
6688
|
+
const data = new (0, _chunkXLUYXUBDcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
|
|
6691
6689
|
return { width, height, data };
|
|
6692
6690
|
}
|
|
6693
6691
|
async requirePixels(options) {
|
|
@@ -6714,7 +6712,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6714
6712
|
modifySelection(op, radius) {
|
|
6715
6713
|
const sel = this.state.selection;
|
|
6716
6714
|
if (!_optionalChain([sel, 'optionalAccess', _255 => _255.bounds])) return false;
|
|
6717
|
-
return this.setSelection(
|
|
6715
|
+
return this.setSelection(_chunkXLUYXUBDcjs.modifySelection.call(void 0, sel, op, radius));
|
|
6718
6716
|
}
|
|
6719
6717
|
/**
|
|
6720
6718
|
* Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
|
|
@@ -6745,7 +6743,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6745
6743
|
} else {
|
|
6746
6744
|
pixels = source;
|
|
6747
6745
|
}
|
|
6748
|
-
this.setSelection(
|
|
6746
|
+
this.setSelection(_chunkXLUYXUBDcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6749
6747
|
return this.getSelection();
|
|
6750
6748
|
}
|
|
6751
6749
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
@@ -6757,7 +6755,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6757
6755
|
// --- Layer masks ---
|
|
6758
6756
|
maskFromSelection(sel, props = {}) {
|
|
6759
6757
|
const { width, height } = this.naturalSize;
|
|
6760
|
-
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);
|
|
6761
6759
|
const mask = { surface: _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
|
|
6762
6760
|
return withMaskProps(mask, props);
|
|
6763
6761
|
}
|
|
@@ -6803,7 +6801,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6803
6801
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
6804
6802
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
6805
6803
|
const data = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
6806
|
-
const sel =
|
|
6804
|
+
const sel = _chunkXLUYXUBDcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
6807
6805
|
return this.setSelection(sel, mode);
|
|
6808
6806
|
}
|
|
6809
6807
|
// --- Histogram ---
|
|
@@ -6833,9 +6831,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6833
6831
|
merged.depthRange = [...merged.depthRange];
|
|
6834
6832
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
6835
6833
|
const next = { ...l };
|
|
6836
|
-
if (
|
|
6834
|
+
if (_chunkXLUYXUBDcjs.isDefaultDepthMask.call(void 0, merged)) {
|
|
6837
6835
|
if (_optionalChain([next, 'access', _261 => _261.mask, 'optionalAccess', _262 => _262.source])) delete next.mask;
|
|
6838
|
-
} else next.mask =
|
|
6836
|
+
} else next.mask = _chunkXLUYXUBDcjs.depthRasterMask.call(void 0, merged);
|
|
6839
6837
|
return next;
|
|
6840
6838
|
});
|
|
6841
6839
|
}
|
|
@@ -6856,7 +6854,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6856
6854
|
// --- Annotations & Layers ---
|
|
6857
6855
|
/** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
|
|
6858
6856
|
annotationLayer(id) {
|
|
6859
|
-
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);
|
|
6860
6858
|
}
|
|
6861
6859
|
/** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
|
|
6862
6860
|
annotationEnv() {
|
|
@@ -6872,7 +6870,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6872
6870
|
this.recordHistory();
|
|
6873
6871
|
const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
|
|
6874
6872
|
const fullAnnotation = { ...annotation, id };
|
|
6875
|
-
const layer =
|
|
6873
|
+
const layer = _chunkXLUYXUBDcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
|
|
6876
6874
|
const loc = placement.aboveId ? _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
6877
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);
|
|
6878
6876
|
this.state.selectedAnnotationId = id;
|
|
@@ -6884,17 +6882,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
6884
6882
|
this.recordHistory();
|
|
6885
6883
|
}
|
|
6886
6884
|
const layer = this.annotationLayer(id);
|
|
6887
|
-
const current = layer ?
|
|
6885
|
+
const current = layer ? _chunkXLUYXUBDcjs.annotationOfLayer.call(void 0, layer) : null;
|
|
6888
6886
|
if (layer && current) {
|
|
6889
6887
|
const annotation = { ...current, ...partial, id };
|
|
6890
|
-
const name = layer.name ===
|
|
6888
|
+
const name = layer.name === _chunkXLUYXUBDcjs.annotationLayerName.call(void 0, current) ? _chunkXLUYXUBDcjs.annotationLayerName.call(void 0, annotation) : layer.name;
|
|
6891
6889
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
|
|
6892
6890
|
}
|
|
6893
6891
|
this.notify();
|
|
6894
6892
|
}
|
|
6895
6893
|
/** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
|
|
6896
6894
|
layerForAnnotation(layer, annotation, name) {
|
|
6897
|
-
const fresh =
|
|
6895
|
+
const fresh = _chunkXLUYXUBDcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
|
|
6898
6896
|
const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
|
|
6899
6897
|
for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
6900
6898
|
if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
|
|
@@ -7162,8 +7160,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7162
7160
|
return;
|
|
7163
7161
|
}
|
|
7164
7162
|
const target = this.developLayer();
|
|
7165
|
-
if (!target) throw new (0,
|
|
7166
|
-
|
|
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");
|
|
7167
7165
|
const { width, height } = this.naturalSize;
|
|
7168
7166
|
let px2 = await this.decodeImage(newDataUrl);
|
|
7169
7167
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
@@ -7171,14 +7169,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7171
7169
|
for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
|
|
7172
7170
|
let surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
|
|
7173
7171
|
if (target.offset.x || target.offset.y) surface = _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
|
|
7174
|
-
this.commitLayers(
|
|
7172
|
+
this.commitLayers(_chunkXLUYXUBDcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
|
|
7175
7173
|
return target.id;
|
|
7176
7174
|
}
|
|
7177
7175
|
// --- Type layers ---
|
|
7178
7176
|
|
|
7179
7177
|
/** The shaper that lays out and draws type layers (`null` when there is none here). */
|
|
7180
7178
|
getTextShaper() {
|
|
7181
|
-
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) });
|
|
7182
7180
|
return this.textShaperValue;
|
|
7183
7181
|
}
|
|
7184
7182
|
/** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
|
|
@@ -7195,7 +7193,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7195
7193
|
return _nullishCoalesce(_optionalChain([this, 'access', _272 => _272.getTextShaper, 'call', _273 => _273(), 'optionalAccess', _274 => _274.families, 'optionalCall', _275 => _275()]), () => ( ["sans-serif", "serif", "monospace"]));
|
|
7196
7194
|
}
|
|
7197
7195
|
typeInfo(id) {
|
|
7198
|
-
const layer =
|
|
7196
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7199
7197
|
const ranges = (runs) => {
|
|
7200
7198
|
let at = 0;
|
|
7201
7199
|
return runs.map((r) => {
|
|
@@ -7208,7 +7206,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7208
7206
|
let lines = [];
|
|
7209
7207
|
let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
|
|
7210
7208
|
if (shaper) {
|
|
7211
|
-
const layout =
|
|
7209
|
+
const layout = _chunkORE334I6cjs.layoutText.call(void 0, layer, shaper);
|
|
7212
7210
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7213
7211
|
lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
|
|
7214
7212
|
if (layer.rendering === "stored") missing = layout.missingFonts;
|
|
@@ -7238,25 +7236,25 @@ var ImageEditorController = (_class7 = class {
|
|
|
7238
7236
|
* text wrapped in `box`. Refused without a text shaper. Returns its id.
|
|
7239
7237
|
*/
|
|
7240
7238
|
addTextLayer(init) {
|
|
7241
|
-
const text =
|
|
7242
|
-
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0,
|
|
7243
|
-
const style =
|
|
7244
|
-
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, () => ( {})));
|
|
7245
7243
|
let frame = { kind: "point" };
|
|
7246
7244
|
if (init.box) {
|
|
7247
7245
|
const { width, height } = init.box;
|
|
7248
|
-
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.");
|
|
7249
7247
|
frame = { kind: "box", width, height };
|
|
7250
7248
|
}
|
|
7251
|
-
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0,
|
|
7252
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7253
|
-
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)}".`);
|
|
7254
7252
|
const t = [1, 0, 0, 1, init.x, init.y];
|
|
7255
|
-
const transform = init.rotation ?
|
|
7256
|
-
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());
|
|
7257
7255
|
if (init.opacity !== void 0) layer.opacity = init.opacity;
|
|
7258
7256
|
if (init.blend !== void 0) layer.blend = init.blend;
|
|
7259
|
-
const next =
|
|
7257
|
+
const next = _chunkXLUYXUBDcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7260
7258
|
this.commitLayers(next, () => {
|
|
7261
7259
|
this.state.activeLayerId = layer.id;
|
|
7262
7260
|
this.state.activeTarget = "pixels";
|
|
@@ -7268,28 +7266,28 @@ var ImageEditorController = (_class7 = class {
|
|
|
7268
7266
|
* `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
|
|
7269
7267
|
*/
|
|
7270
7268
|
setText(id, text, range = {}, commitToHistory = true) {
|
|
7271
|
-
const layer =
|
|
7272
|
-
const insert =
|
|
7273
|
-
const [start, end] =
|
|
7274
|
-
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");
|
|
7275
7273
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7276
7274
|
return this.typeInfo(id);
|
|
7277
7275
|
}
|
|
7278
7276
|
/** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
|
|
7279
7277
|
setTextStyle(id, style, range = {}, commitToHistory = true) {
|
|
7280
|
-
const layer =
|
|
7281
|
-
const [start, end] =
|
|
7282
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7283
|
-
|
|
7284
|
-
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,
|
|
7285
7283
|
this.state.layers,
|
|
7286
7284
|
id,
|
|
7287
7285
|
(l) => {
|
|
7288
7286
|
if (start === end) {
|
|
7289
|
-
if (l.text.length) throw new (0,
|
|
7290
|
-
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) }] };
|
|
7291
7289
|
}
|
|
7292
|
-
return { runs:
|
|
7290
|
+
return { runs: _chunkORE334I6cjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkXLUYXUBDcjs.patchTextStyle.call(void 0, s, style)) };
|
|
7293
7291
|
},
|
|
7294
7292
|
this.textEnv(),
|
|
7295
7293
|
"restyle its text"
|
|
@@ -7299,11 +7297,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7299
7297
|
}
|
|
7300
7298
|
/** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
|
|
7301
7299
|
setParagraphStyle(id, style, range = {}, commitToHistory = true) {
|
|
7302
|
-
const layer =
|
|
7303
|
-
const [start, end] =
|
|
7304
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7305
|
-
|
|
7306
|
-
const { layers } =
|
|
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,
|
|
7307
7305
|
this.state.layers,
|
|
7308
7306
|
id,
|
|
7309
7307
|
(l) => {
|
|
@@ -7312,7 +7310,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7312
7310
|
const a = at;
|
|
7313
7311
|
at += p.length;
|
|
7314
7312
|
const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
|
|
7315
|
-
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;
|
|
7316
7314
|
});
|
|
7317
7315
|
return { paragraphs };
|
|
7318
7316
|
},
|
|
@@ -7328,21 +7326,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7328
7326
|
* paragraph. Also resizes a box. One undo step.
|
|
7329
7327
|
*/
|
|
7330
7328
|
setTextFrame(id, frame, commitToHistory = true) {
|
|
7331
|
-
const layer =
|
|
7332
|
-
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0,
|
|
7333
|
-
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.");
|
|
7334
7332
|
const shaper = this.getTextShaper();
|
|
7335
|
-
const { layers } =
|
|
7333
|
+
const { layers } = _chunkXLUYXUBDcjs.updateTypeLayer.call(void 0,
|
|
7336
7334
|
this.state.layers,
|
|
7337
7335
|
id,
|
|
7338
7336
|
(l) => {
|
|
7339
7337
|
if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
|
|
7340
|
-
if (!shaper) throw new (0,
|
|
7341
|
-
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;
|
|
7342
7340
|
const first = lines[0];
|
|
7343
7341
|
const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
|
|
7344
7342
|
const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
|
|
7345
|
-
const m =
|
|
7343
|
+
const m = _chunkXLUYXUBDcjs.textMatrix.call(void 0, l);
|
|
7346
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]];
|
|
7347
7345
|
const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
|
|
7348
7346
|
return { frame: nextFrame, transform: shifted };
|
|
@@ -7359,21 +7357,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7359
7357
|
* `warnings` says when other colours were dropped. One undo step.
|
|
7360
7358
|
*/
|
|
7361
7359
|
convertTextToShape(id) {
|
|
7362
|
-
const layer =
|
|
7363
|
-
|
|
7360
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7361
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
|
|
7364
7362
|
const shaper = this.getTextShaper();
|
|
7365
|
-
if (!shaper) throw new (0,
|
|
7366
|
-
const parts =
|
|
7367
|
-
const subpaths = parts.flatMap((p) =>
|
|
7368
|
-
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.");
|
|
7369
7367
|
const warnings = [];
|
|
7370
7368
|
const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
|
|
7371
7369
|
if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
|
|
7372
|
-
const missing =
|
|
7370
|
+
const missing = _chunkORE334I6cjs.layoutText.call(void 0, layer, shaper).missingFonts;
|
|
7373
7371
|
if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
|
|
7374
|
-
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));
|
|
7375
7373
|
const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
|
|
7376
|
-
const shape =
|
|
7374
|
+
const shape = _chunkXLUYXUBDcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
|
|
7377
7375
|
const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
|
|
7378
7376
|
for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
7379
7377
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
|
|
@@ -7381,23 +7379,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
7381
7379
|
}
|
|
7382
7380
|
/** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
|
|
7383
7381
|
getTextLayout(id) {
|
|
7384
|
-
const layer =
|
|
7382
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7385
7383
|
const shaper = this.getTextShaper();
|
|
7386
|
-
return shaper ?
|
|
7384
|
+
return shaper ? _chunkORE334I6cjs.layoutText.call(void 0, layer, shaper) : null;
|
|
7387
7385
|
}
|
|
7388
7386
|
/** The text index nearest a document point (for clicks on a type layer). */
|
|
7389
7387
|
textIndexAt(id, point) {
|
|
7390
|
-
const layer =
|
|
7388
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7391
7389
|
const layout = this.getTextLayout(id);
|
|
7392
|
-
return layout ?
|
|
7390
|
+
return layout ? _chunkORE334I6cjs.textIndexAt.call(void 0, layout, _chunkXLUYXUBDcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
|
|
7393
7391
|
}
|
|
7394
7392
|
/** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
|
|
7395
7393
|
textCaret(id, index) {
|
|
7396
|
-
const layer =
|
|
7394
|
+
const layer = _chunkXLUYXUBDcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7397
7395
|
const layout = this.getTextLayout(id);
|
|
7398
7396
|
if (!layout) return null;
|
|
7399
|
-
const c =
|
|
7400
|
-
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);
|
|
7401
7399
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
7402
7400
|
return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
|
|
7403
7401
|
}
|
|
@@ -7408,14 +7406,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7408
7406
|
}
|
|
7409
7407
|
/** One component from tool or UI input (validated). */
|
|
7410
7408
|
componentFrom(spec, path) {
|
|
7411
|
-
const op =
|
|
7412
|
-
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0,
|
|
7413
|
-
if (spec.shape !== void 0) return
|
|
7414
|
-
if (spec.subpaths !== void 0) return { op, subpaths:
|
|
7415
|
-
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.`);
|
|
7416
7414
|
}
|
|
7417
7415
|
shapeInfo(id) {
|
|
7418
|
-
const layer =
|
|
7416
|
+
const layer = _chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7419
7417
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7420
7418
|
const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
|
|
7421
7419
|
const info = {
|
|
@@ -7425,13 +7423,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
7425
7423
|
index,
|
|
7426
7424
|
op: c.op,
|
|
7427
7425
|
live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
|
|
7428
|
-
subpaths:
|
|
7429
|
-
bounds: box(
|
|
7426
|
+
subpaths: _chunkORE334I6cjs.roundSubpaths.call(void 0, c.subpaths),
|
|
7427
|
+
bounds: box(_chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
|
|
7430
7428
|
})),
|
|
7431
7429
|
fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
|
|
7432
7430
|
fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
|
|
7433
7431
|
stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
|
|
7434
|
-
geometryBounds: box(
|
|
7432
|
+
geometryBounds: box(_chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, layer)),
|
|
7435
7433
|
bounds: this.getLayerBounds(id)
|
|
7436
7434
|
};
|
|
7437
7435
|
if (layer.annotation) info.annotationId = layer.annotation.id;
|
|
@@ -7448,17 +7446,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
7448
7446
|
*/
|
|
7449
7447
|
addShapeLayer(init) {
|
|
7450
7448
|
const specs = _optionalChain([init, 'access', _284 => _284.components, 'optionalAccess', _285 => _285.length]) ? init.components : [init];
|
|
7451
|
-
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.");
|
|
7452
7450
|
const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _288 => _288.components, 'optionalAccess', _289 => _289.length]) ? `components[${i}].` : ""));
|
|
7453
|
-
const stroke = init.stroke ?
|
|
7451
|
+
const stroke = init.stroke ? _chunkXLUYXUBDcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
|
|
7454
7452
|
const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
|
|
7455
|
-
const fill = init.fill === void 0 ? stroke && openOnly ? null :
|
|
7456
|
-
if (!fill && !stroke) throw new (0,
|
|
7457
|
-
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0,
|
|
7458
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7459
|
-
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7460
|
-
const layer =
|
|
7461
|
-
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));
|
|
7462
7460
|
this.commitLayers(next, () => {
|
|
7463
7461
|
this.state.activeLayerId = layer.id;
|
|
7464
7462
|
this.state.activeTarget = "pixels";
|
|
@@ -7471,18 +7469,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
7471
7469
|
* only those settings of the current stroke. Returns the shape.
|
|
7472
7470
|
*/
|
|
7473
7471
|
setShapeStyle(id, changes, commitToHistory = true) {
|
|
7474
|
-
const layer =
|
|
7475
|
-
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null :
|
|
7476
|
-
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null :
|
|
7477
|
-
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.");
|
|
7478
7476
|
const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
|
|
7479
|
-
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");
|
|
7480
7478
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7481
7479
|
return this.shapeInfo(id);
|
|
7482
7480
|
}
|
|
7483
7481
|
componentIndex(layer, index) {
|
|
7484
7482
|
if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
|
|
7485
|
-
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)}.`);
|
|
7486
7484
|
}
|
|
7487
7485
|
return index;
|
|
7488
7486
|
}
|
|
@@ -7492,36 +7490,36 @@ var ImageEditorController = (_class7 = class {
|
|
|
7492
7490
|
* the live shape) or its operation. Returns the shape.
|
|
7493
7491
|
*/
|
|
7494
7492
|
setShapeComponent(id, index, change, commitToHistory = true) {
|
|
7495
|
-
const layer =
|
|
7493
|
+
const layer = _chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7496
7494
|
const i = this.componentIndex(layer, index);
|
|
7497
7495
|
const current = layer.components[i];
|
|
7498
7496
|
let shape = change.shape;
|
|
7499
7497
|
if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
|
|
7500
7498
|
else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
|
|
7501
|
-
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) };
|
|
7502
7500
|
const components = layer.components.map((c, k) => k === i ? next : c);
|
|
7503
|
-
const { layers } =
|
|
7501
|
+
const { layers } = _chunkXLUYXUBDcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7504
7502
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7505
7503
|
return this.shapeInfo(id);
|
|
7506
7504
|
}
|
|
7507
7505
|
/** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
|
|
7508
7506
|
addShapeComponent(id, spec, index) {
|
|
7509
|
-
const layer =
|
|
7507
|
+
const layer = _chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7510
7508
|
const c = this.componentFrom(spec, "");
|
|
7511
7509
|
const at = index === void 0 ? layer.components.length : index;
|
|
7512
|
-
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)}.`);
|
|
7513
7511
|
const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
|
|
7514
|
-
const { layers } =
|
|
7512
|
+
const { layers } = _chunkXLUYXUBDcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7515
7513
|
this.commitLayers(layers);
|
|
7516
7514
|
return this.shapeInfo(id);
|
|
7517
7515
|
}
|
|
7518
7516
|
/** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
|
|
7519
7517
|
removeShapeComponent(id, index) {
|
|
7520
|
-
const layer =
|
|
7518
|
+
const layer = _chunkXLUYXUBDcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7521
7519
|
const i = this.componentIndex(layer, index);
|
|
7522
|
-
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).");
|
|
7523
7521
|
const components = layer.components.filter((_, k) => k !== i);
|
|
7524
|
-
const { layers } =
|
|
7522
|
+
const { layers } = _chunkXLUYXUBDcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7525
7523
|
this.commitLayers(layers);
|
|
7526
7524
|
return this.shapeInfo(id);
|
|
7527
7525
|
}
|
|
@@ -7530,10 +7528,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7530
7528
|
* shapes become paths), as one undo step. Returns the shape.
|
|
7531
7529
|
*/
|
|
7532
7530
|
mergeShapeComponents(id) {
|
|
7533
|
-
const layer =
|
|
7534
|
-
if (layer.components.length < 2) throw new (0,
|
|
7535
|
-
const components =
|
|
7536
|
-
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");
|
|
7537
7535
|
this.commitLayers(layers);
|
|
7538
7536
|
return this.shapeInfo(id);
|
|
7539
7537
|
}
|
|
@@ -7543,8 +7541,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7543
7541
|
* step. Returns the layer id.
|
|
7544
7542
|
*/
|
|
7545
7543
|
async rasterizeLayer(id) {
|
|
7546
|
-
const layer =
|
|
7547
|
-
|
|
7544
|
+
const layer = _chunkXLUYXUBDcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
7545
|
+
_chunkXLUYXUBDcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
|
|
7548
7546
|
const { width, height } = this.naturalSize;
|
|
7549
7547
|
const canvas = { x: 0, y: 0, width, height };
|
|
7550
7548
|
let next;
|
|
@@ -7560,8 +7558,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7560
7558
|
if (layer.locks) next.locks = layer.locks;
|
|
7561
7559
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
7562
7560
|
} else if (layer.type === "pixel") {
|
|
7563
|
-
if (!_optionalChain([layer, 'access', _290 => _290.filters, 'optionalAccess', _291 => _291.length])) throw new (0,
|
|
7564
|
-
|
|
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");
|
|
7565
7563
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
7566
7564
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
7567
7565
|
delete content.mask;
|
|
@@ -7578,10 +7576,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7578
7576
|
} else if (layer.type === "smart") {
|
|
7579
7577
|
return this.rasterizeSmartObject(id);
|
|
7580
7578
|
} else if (layer.type === "shape" || layer.type === "type") {
|
|
7581
|
-
next = layer.type === "shape" ?
|
|
7579
|
+
next = layer.type === "shape" ? _chunkXLUYXUBDcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkXLUYXUBDcjs.typeAsPixelLayer.call(void 0, layer);
|
|
7582
7580
|
if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _292 => _292.annotation, 'optionalAccess', _293 => _293.id])) this.state.selectedAnnotationId = null;
|
|
7583
7581
|
} else {
|
|
7584
|
-
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.`);
|
|
7585
7583
|
}
|
|
7586
7584
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
|
|
7587
7585
|
return id;
|
|
@@ -7606,7 +7604,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7606
7604
|
setColorMode(mode, options = {}) {
|
|
7607
7605
|
let next;
|
|
7608
7606
|
if (mode === "rgb") {
|
|
7609
|
-
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.");
|
|
7610
7608
|
next = null;
|
|
7611
7609
|
} else if (mode === "lab") next = { mode: "lab" };
|
|
7612
7610
|
else if (mode === "cmyk") {
|
|
@@ -7614,14 +7612,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7614
7612
|
try {
|
|
7615
7613
|
doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
|
|
7616
7614
|
} catch (e) {
|
|
7617
|
-
throw new (0,
|
|
7615
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7618
7616
|
}
|
|
7619
7617
|
const cs = resolveProfile(doc).colorSpace;
|
|
7620
|
-
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()}.`);
|
|
7621
7619
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7622
|
-
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(", ")}.`);
|
|
7623
7621
|
next = { mode: "cmyk", profile: doc, intent };
|
|
7624
|
-
} else throw new (0,
|
|
7622
|
+
} else throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
|
|
7625
7623
|
this.recordHistory();
|
|
7626
7624
|
if (next) this.state.colorMode = next;
|
|
7627
7625
|
else delete this.state.colorMode;
|
|
@@ -7634,10 +7632,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7634
7632
|
try {
|
|
7635
7633
|
doc = documentProfile(profile);
|
|
7636
7634
|
} catch (e) {
|
|
7637
|
-
throw new (0,
|
|
7635
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7638
7636
|
}
|
|
7639
7637
|
const cs = resolveProfile(doc).colorSpace;
|
|
7640
|
-
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.`);
|
|
7641
7639
|
return doc;
|
|
7642
7640
|
}
|
|
7643
7641
|
/**
|
|
@@ -7663,7 +7661,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7663
7661
|
convertToProfile(profile, options = {}) {
|
|
7664
7662
|
const doc = this.rgbProfileArg(profile, "Convert to Profile");
|
|
7665
7663
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7666
|
-
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(", ")}.`);
|
|
7667
7665
|
const t = _chunkG5NMLUVFcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7668
7666
|
const converted = [];
|
|
7669
7667
|
const unconverted = [];
|
|
@@ -7701,12 +7699,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
7701
7699
|
try {
|
|
7702
7700
|
doc = documentProfile(setup.profile);
|
|
7703
7701
|
} catch (e) {
|
|
7704
|
-
throw new (0,
|
|
7702
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7705
7703
|
}
|
|
7706
7704
|
const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
|
|
7707
|
-
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(", ")}.`);
|
|
7708
7706
|
const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
|
|
7709
|
-
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.`);
|
|
7710
7708
|
this.state.proofSetup = next;
|
|
7711
7709
|
this.notify();
|
|
7712
7710
|
return next;
|
|
@@ -7723,14 +7721,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7723
7721
|
src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
|
|
7724
7722
|
dst = resolveProfile(documentProfile(to));
|
|
7725
7723
|
} catch (e) {
|
|
7726
|
-
throw new (0,
|
|
7724
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7727
7725
|
}
|
|
7728
|
-
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.");
|
|
7729
7727
|
const t = _chunkG5NMLUVFcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7730
7728
|
const toLab = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
|
|
7731
7729
|
return colors.map((input) => {
|
|
7732
7730
|
const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
|
|
7733
|
-
if (!m) throw new (0,
|
|
7731
|
+
if (!m) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
|
|
7734
7732
|
const n = parseInt(m[1], 16);
|
|
7735
7733
|
const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
|
|
7736
7734
|
const out = new Float32Array(16);
|
|
@@ -7756,7 +7754,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7756
7754
|
* the ids of the layers whose pixels changed.
|
|
7757
7755
|
*/
|
|
7758
7756
|
setBitDepth(depth) {
|
|
7759
|
-
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)}.`);
|
|
7760
7758
|
const changed = [];
|
|
7761
7759
|
const withMask = (l) => {
|
|
7762
7760
|
const m = l.mask;
|
|
@@ -7804,7 +7802,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7804
7802
|
* Throws `PsdError` for files that cannot be read at all.
|
|
7805
7803
|
*/
|
|
7806
7804
|
loadPsd(bytes) {
|
|
7807
|
-
const result =
|
|
7805
|
+
const result = _chunkXLUYXUBDcjs.importPsd.call(void 0, bytes, { newId: () => _chunkXLUYXUBDcjs.newLayerId.call(void 0, ) });
|
|
7808
7806
|
this.abandonContents();
|
|
7809
7807
|
this.recordHistory();
|
|
7810
7808
|
const s = this.state;
|
|
@@ -7814,7 +7812,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7814
7812
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
7815
7813
|
s.layers = this.checkPsdFonts(result);
|
|
7816
7814
|
s.crop = null;
|
|
7817
|
-
s.transform = { ...
|
|
7815
|
+
s.transform = { ..._chunkXLUYXUBDcjs.DEFAULT_TRANSFORM_VALUES };
|
|
7818
7816
|
s.outputOpacity = 1;
|
|
7819
7817
|
delete s.legacyOutputBlur;
|
|
7820
7818
|
s.selection = null;
|
|
@@ -7865,7 +7863,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7865
7863
|
let layers = result.layers;
|
|
7866
7864
|
const missing = /* @__PURE__ */ new Map();
|
|
7867
7865
|
for (const l of types) {
|
|
7868
|
-
const fonts = shaper ?
|
|
7866
|
+
const fonts = shaper ? _chunkORE334I6cjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
|
|
7869
7867
|
if (!fonts.length) continue;
|
|
7870
7868
|
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
|
|
7871
7869
|
for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
|
|
@@ -7893,7 +7891,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7893
7891
|
const canRasterize = this.renderer.canRasterize();
|
|
7894
7892
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
7895
7893
|
const sources = this.renderer.compositorSources(width, height);
|
|
7896
|
-
const compositor = new (0,
|
|
7894
|
+
const compositor = new (0, _chunkXLUYXUBDcjs.LayerCompositor)();
|
|
7897
7895
|
const bakeMask = (layer) => {
|
|
7898
7896
|
const mask = layer.mask;
|
|
7899
7897
|
if (!_optionalChain([mask, 'optionalAccess', _304 => _304.source])) return mask;
|
|
@@ -7975,7 +7973,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7975
7973
|
out.surface = this.surfaceOf(layer);
|
|
7976
7974
|
delete out.source;
|
|
7977
7975
|
}
|
|
7978
|
-
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)]), () => ( []));
|
|
7979
7977
|
if (active.length) {
|
|
7980
7978
|
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
7981
7979
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -8008,8 +8006,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8008
8006
|
const color = this.psdColorOptions(warnings);
|
|
8009
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.`);
|
|
8010
8008
|
const depth = color.colorMode ? 8 : this.bitDepth;
|
|
8011
|
-
const mergedDeep = depth === 8 ? void 0 : _chunkMZXQTKUMcjs.workingToSamples.call(void 0,
|
|
8012
|
-
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 });
|
|
8013
8011
|
warnings.push(...result.warnings);
|
|
8014
8012
|
return { bytes: result.bytes, warnings, psb: result.psb, width, height };
|
|
8015
8013
|
}
|
|
@@ -8025,13 +8023,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
8025
8023
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
8026
8024
|
if (this.state.selection && (sx !== 1 || sy !== 1)) {
|
|
8027
8025
|
this.state.selection = normalizeSelection(
|
|
8028
|
-
|
|
8026
|
+
_chunkXLUYXUBDcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
|
|
8029
8027
|
);
|
|
8030
8028
|
}
|
|
8031
8029
|
let layers = this.state.layers;
|
|
8032
8030
|
if (sx !== 1 || sy !== 1) {
|
|
8033
8031
|
if (this.state.crop) {
|
|
8034
|
-
this.state.crop =
|
|
8032
|
+
this.state.crop = _chunkXLUYXUBDcjs.clampCropToImage.call(void 0,
|
|
8035
8033
|
{
|
|
8036
8034
|
x: Math.round(this.state.crop.x * sx),
|
|
8037
8035
|
y: Math.round(this.state.crop.y * sy),
|
|
@@ -8050,17 +8048,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
8050
8048
|
} else if (l.type === "shape") {
|
|
8051
8049
|
const a = l.annotation;
|
|
8052
8050
|
const scaled = a ? scaleAnnotation(a, sx, sy) : null;
|
|
8053
|
-
const fromAnnotation = scaled ?
|
|
8051
|
+
const fromAnnotation = scaled ? _chunkXLUYXUBDcjs.shapeFromAnnotation.call(void 0, scaled) : null;
|
|
8054
8052
|
const m = [sx, 0, 0, sy, 0, 0];
|
|
8055
|
-
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)));
|
|
8056
8054
|
const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
|
|
8057
8055
|
if (scaled && fromAnnotation) moved.annotation = scaled;
|
|
8058
8056
|
else delete moved.annotation;
|
|
8059
|
-
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));
|
|
8060
8058
|
}
|
|
8061
8059
|
}
|
|
8062
8060
|
}
|
|
8063
|
-
const bg =
|
|
8061
|
+
const bg = _chunkXLUYXUBDcjs.developTarget.call(void 0, layers, null);
|
|
8064
8062
|
if (bg && bg.source !== "document") layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
|
|
8065
8063
|
if (clearAnnotations) {
|
|
8066
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);
|
|
@@ -8081,7 +8079,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8081
8079
|
let out;
|
|
8082
8080
|
try {
|
|
8083
8081
|
out = this.serializeState();
|
|
8084
|
-
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);
|
|
8085
8083
|
} finally {
|
|
8086
8084
|
if (root) {
|
|
8087
8085
|
this.state = current;
|
|
@@ -8089,8 +8087,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8089
8087
|
this.viewKey = [];
|
|
8090
8088
|
}
|
|
8091
8089
|
}
|
|
8092
|
-
if (!options || out.version !==
|
|
8093
|
-
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 });
|
|
8094
8092
|
}
|
|
8095
8093
|
/**
|
|
8096
8094
|
* Loads a stored state whose v3 assets may live in an asset store (references other than data
|
|
@@ -8098,12 +8096,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
8098
8096
|
* out and listed in `lastLoadProblems`.
|
|
8099
8097
|
*/
|
|
8100
8098
|
async loadJSONAsync(data, options = {}) {
|
|
8101
|
-
if (data.version !==
|
|
8099
|
+
if (data.version !== _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
|
|
8102
8100
|
this.loadJSON(data);
|
|
8103
8101
|
return;
|
|
8104
8102
|
}
|
|
8105
8103
|
const problems = [];
|
|
8106
|
-
const assets = await
|
|
8104
|
+
const assets = await _chunkXLUYXUBDcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
|
|
8107
8105
|
this.loadJSON({ ...data, assets });
|
|
8108
8106
|
this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
|
|
8109
8107
|
}
|
|
@@ -8115,7 +8113,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8115
8113
|
let selection = null;
|
|
8116
8114
|
if (data.selection) {
|
|
8117
8115
|
try {
|
|
8118
|
-
selection = normalizeSelection(
|
|
8116
|
+
selection = normalizeSelection(_chunkXLUYXUBDcjs.deserializeSelection.call(void 0, data.selection));
|
|
8119
8117
|
} catch (e26) {
|
|
8120
8118
|
selection = null;
|
|
8121
8119
|
}
|
|
@@ -8133,8 +8131,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8133
8131
|
if (isLayered(data)) {
|
|
8134
8132
|
const problems = [];
|
|
8135
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;
|
|
8136
|
-
const storedPatterns =
|
|
8137
|
-
s.layers =
|
|
8134
|
+
const storedPatterns = _chunkXLUYXUBDcjs.deserializePatterns.call(void 0, data.patterns, []);
|
|
8135
|
+
s.layers = _chunkXLUYXUBDcjs.deserializeLayers.call(void 0, data.layers, {
|
|
8138
8136
|
assets: _nullishCoalesce(data.assets, () => ( {})),
|
|
8139
8137
|
problems,
|
|
8140
8138
|
smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
|
|
@@ -8152,7 +8150,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8152
8150
|
const light = data.globalLight;
|
|
8153
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)) };
|
|
8154
8152
|
else delete s.globalLight;
|
|
8155
|
-
const patterns =
|
|
8153
|
+
const patterns = _chunkXLUYXUBDcjs.deserializePatterns.call(void 0, data.patterns, problems);
|
|
8156
8154
|
if (patterns.length) s.patterns = patterns;
|
|
8157
8155
|
else delete s.patterns;
|
|
8158
8156
|
if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
|
|
@@ -8168,7 +8166,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8168
8166
|
}
|
|
8169
8167
|
} else {
|
|
8170
8168
|
const { width, height } = this.naturalSize;
|
|
8171
|
-
const stack =
|
|
8169
|
+
const stack = _chunkXLUYXUBDcjs.layersFromLegacy.call(void 0, data, width, height);
|
|
8172
8170
|
s.layers = stack.layers;
|
|
8173
8171
|
s.outputOpacity = stack.outputOpacity;
|
|
8174
8172
|
if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
|
|
@@ -8189,7 +8187,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8189
8187
|
}
|
|
8190
8188
|
serializeState() {
|
|
8191
8189
|
const { width, height } = this.naturalSize;
|
|
8192
|
-
const view =
|
|
8190
|
+
const view = _chunkXLUYXUBDcjs.legacyView.call(void 0, this.stack(), width, height, null);
|
|
8193
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) {
|
|
8194
8192
|
return {
|
|
8195
8193
|
// States without adjustment layers keep schema 1, so they round-trip unchanged.
|
|
@@ -8204,9 +8202,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
8204
8202
|
annotations: JSON.parse(JSON.stringify(view.annotations))
|
|
8205
8203
|
};
|
|
8206
8204
|
}
|
|
8207
|
-
const { layers, assets, smartContents } =
|
|
8205
|
+
const { layers, assets, smartContents } = _chunkXLUYXUBDcjs.serializeLayers.call(void 0, this.state.layers);
|
|
8208
8206
|
const out = {
|
|
8209
|
-
version:
|
|
8207
|
+
version: _chunkXLUYXUBDcjs.LAYERED_SCHEMA_VERSION,
|
|
8210
8208
|
width,
|
|
8211
8209
|
height,
|
|
8212
8210
|
layers,
|
|
@@ -8218,7 +8216,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8218
8216
|
};
|
|
8219
8217
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
8220
8218
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
8221
|
-
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);
|
|
8222
8220
|
if (smartContents) out.smartContents = smartContents;
|
|
8223
8221
|
if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
|
|
8224
8222
|
if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
|
|
@@ -8230,7 +8228,7 @@ function serializeAdjustments(adjustments) {
|
|
|
8230
8228
|
const out = { ...adjustments };
|
|
8231
8229
|
if (_optionalChain([out, 'access', _334 => _334.layers, 'optionalAccess', _335 => _335.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
8232
8230
|
else delete out.layers;
|
|
8233
|
-
if (
|
|
8231
|
+
if (_chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkXLUYXUBDcjs.LEGACY_PROCESS_VERSION) {
|
|
8234
8232
|
delete out.process;
|
|
8235
8233
|
if (!out.tint) delete out.tint;
|
|
8236
8234
|
}
|
|
@@ -8241,7 +8239,7 @@ function withDevelop(layer, partial) {
|
|
|
8241
8239
|
let i = filters.findIndex((f) => f.kind === "develop");
|
|
8242
8240
|
if (i === -1) {
|
|
8243
8241
|
filters.unshift({
|
|
8244
|
-
id: layer.source === "document" ?
|
|
8242
|
+
id: layer.source === "document" ? _chunkXLUYXUBDcjs.DEVELOP_FILTER_ID : _chunkXLUYXUBDcjs.newLayerId.call(void 0, "flt"),
|
|
8245
8243
|
kind: "develop",
|
|
8246
8244
|
enabled: true,
|
|
8247
8245
|
brightness: 0,
|
|
@@ -8250,7 +8248,7 @@ function withDevelop(layer, partial) {
|
|
|
8250
8248
|
exposure: 0,
|
|
8251
8249
|
temperature: 0,
|
|
8252
8250
|
tint: 0,
|
|
8253
|
-
process:
|
|
8251
|
+
process: _chunkXLUYXUBDcjs.LATEST_PROCESS_VERSION
|
|
8254
8252
|
});
|
|
8255
8253
|
i = 0;
|
|
8256
8254
|
}
|
|
@@ -8259,7 +8257,7 @@ function withDevelop(layer, partial) {
|
|
|
8259
8257
|
const v = partial[k];
|
|
8260
8258
|
if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
|
|
8261
8259
|
}
|
|
8262
|
-
if ("process" in partial) next.process =
|
|
8260
|
+
if ("process" in partial) next.process = _chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, partial.process);
|
|
8263
8261
|
filters[i] = next;
|
|
8264
8262
|
return { ...layer, filters };
|
|
8265
8263
|
}
|
|
@@ -8268,7 +8266,7 @@ function withBlur(layer, radius) {
|
|
|
8268
8266
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
8269
8267
|
if (radius > 0) {
|
|
8270
8268
|
filters.push({
|
|
8271
|
-
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")))),
|
|
8272
8270
|
kind: "blur",
|
|
8273
8271
|
enabled: true,
|
|
8274
8272
|
radius
|
|
@@ -8292,7 +8290,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8292
8290
|
if (!update.mask) delete next.mask;
|
|
8293
8291
|
else {
|
|
8294
8292
|
const current = node.mask && !node.mask.source ? node.mask : null;
|
|
8295
|
-
const memo = current ?
|
|
8293
|
+
const memo = current ? _chunkXLUYXUBDcjs.legacyMaskOf.call(void 0, current, width, height) : null;
|
|
8296
8294
|
if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
|
|
8297
8295
|
next.mask = withMaskProps(current, {
|
|
8298
8296
|
density: _nullishCoalesce(update.mask.density, () => ( 1)),
|
|
@@ -8300,7 +8298,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8300
8298
|
enabled: update.mask.enabled !== false
|
|
8301
8299
|
});
|
|
8302
8300
|
} else {
|
|
8303
|
-
const m =
|
|
8301
|
+
const m = _chunkXLUYXUBDcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
|
|
8304
8302
|
if (m) next.mask = m;
|
|
8305
8303
|
else delete next.mask;
|
|
8306
8304
|
}
|
|
@@ -8339,7 +8337,7 @@ function resizeLegacyMasks(layers, from, to) {
|
|
|
8339
8337
|
for (const l of _chunkMZXQTKUMcjs.flattenLayers.call(void 0, layers)) {
|
|
8340
8338
|
if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
|
|
8341
8339
|
const old = l.mask;
|
|
8342
|
-
const mask =
|
|
8340
|
+
const mask = _chunkXLUYXUBDcjs.rasterMaskFromLegacy.call(void 0, _chunkXLUYXUBDcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
|
|
8343
8341
|
if (!mask) continue;
|
|
8344
8342
|
out = _chunkMZXQTKUMcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
|
|
8345
8343
|
}
|
|
@@ -8435,12 +8433,12 @@ function withoutAnnotations(layers) {
|
|
|
8435
8433
|
function parseColor(value) {
|
|
8436
8434
|
if (Array.isArray(value)) {
|
|
8437
8435
|
if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
|
|
8438
|
-
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.");
|
|
8439
8437
|
}
|
|
8440
8438
|
return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
|
|
8441
8439
|
}
|
|
8442
8440
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
|
|
8443
|
-
if (!m) throw new (0,
|
|
8441
|
+
if (!m) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
|
|
8444
8442
|
let hex = m[1];
|
|
8445
8443
|
if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
|
|
8446
8444
|
const n = (i) => parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -8450,7 +8448,7 @@ function readImagePaint(raw) {
|
|
|
8450
8448
|
try {
|
|
8451
8449
|
return _chunk6GFRKLLScjs.parsePaintSource.call(void 0, raw);
|
|
8452
8450
|
} catch (e) {
|
|
8453
|
-
if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0,
|
|
8451
|
+
if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)(e.message);
|
|
8454
8452
|
throw e;
|
|
8455
8453
|
}
|
|
8456
8454
|
}
|
|
@@ -8598,7 +8596,7 @@ function loadImageEditorDocument(input) {
|
|
|
8598
8596
|
// Optional: only present when something was selected when saving.
|
|
8599
8597
|
selection: {
|
|
8600
8598
|
parse: (value) => {
|
|
8601
|
-
const mask =
|
|
8599
|
+
const mask = _chunkXLUYXUBDcjs.deserializeSelection.call(void 0, value);
|
|
8602
8600
|
const v = value;
|
|
8603
8601
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8604
8602
|
},
|
|
@@ -8686,7 +8684,7 @@ function loadLayeredDocument(doc) {
|
|
|
8686
8684
|
},
|
|
8687
8685
|
selection: {
|
|
8688
8686
|
parse: (value) => {
|
|
8689
|
-
const mask =
|
|
8687
|
+
const mask = _chunkXLUYXUBDcjs.deserializeSelection.call(void 0, value);
|
|
8690
8688
|
const v = value;
|
|
8691
8689
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8692
8690
|
},
|
|
@@ -9080,14 +9078,14 @@ function describeSelection(mask) {
|
|
|
9080
9078
|
// src/image-editor/selection-tools.ts
|
|
9081
9079
|
var modeSchema = {
|
|
9082
9080
|
type: "string",
|
|
9083
|
-
enum: [...
|
|
9081
|
+
enum: [..._chunkXLUYXUBDcjs.SELECTION_MODES],
|
|
9084
9082
|
description: "How the result combines with the current selection (default replace)."
|
|
9085
9083
|
};
|
|
9086
9084
|
var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
|
|
9087
9085
|
function summary(controller) {
|
|
9088
9086
|
const sel = controller.getSelection();
|
|
9089
9087
|
const { width, height } = controller.getState().imageDimensions;
|
|
9090
|
-
const area =
|
|
9088
|
+
const area = _chunkXLUYXUBDcjs.selectionArea.call(void 0, sel);
|
|
9091
9089
|
return {
|
|
9092
9090
|
empty: !sel,
|
|
9093
9091
|
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _351 => _351.bounds]), () => ( null)),
|
|
@@ -9133,7 +9131,7 @@ function createImageSelectionTools(controller) {
|
|
|
9133
9131
|
},
|
|
9134
9132
|
annotations: writeAnnotations("Select a region", true),
|
|
9135
9133
|
handler: ({ shape, x, y, width, height, mode, feather }) => {
|
|
9136
|
-
const opts = { mode:
|
|
9134
|
+
const opts = { mode: _chunkXLUYXUBDcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
|
|
9137
9135
|
switch (shape) {
|
|
9138
9136
|
case "all":
|
|
9139
9137
|
controller.selectAll();
|
|
@@ -9186,7 +9184,7 @@ function createImageSelectionTools(controller) {
|
|
|
9186
9184
|
annotations: writeAnnotations("Select by colour", true),
|
|
9187
9185
|
handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
|
|
9188
9186
|
const common = {
|
|
9189
|
-
mode:
|
|
9187
|
+
mode: _chunkXLUYXUBDcjs.parseSelectionMode.call(void 0, mode),
|
|
9190
9188
|
sampleMerged: sampleMerged === true,
|
|
9191
9189
|
sample: _nullishCoalesce(sample, () => ( "composite"))
|
|
9192
9190
|
};
|
|
@@ -9207,7 +9205,7 @@ function createImageSelectionTools(controller) {
|
|
|
9207
9205
|
inputSchema: {
|
|
9208
9206
|
type: "object",
|
|
9209
9207
|
properties: {
|
|
9210
|
-
op: { type: "string", enum: [...
|
|
9208
|
+
op: { type: "string", enum: [..._chunkXLUYXUBDcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
|
|
9211
9209
|
radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
|
|
9212
9210
|
},
|
|
9213
9211
|
required: ["op", "radius"],
|
|
@@ -9215,7 +9213,7 @@ function createImageSelectionTools(controller) {
|
|
|
9215
9213
|
},
|
|
9216
9214
|
annotations: writeAnnotations("Modify the selection"),
|
|
9217
9215
|
handler: ({ op, radius }) => {
|
|
9218
|
-
if (!
|
|
9216
|
+
if (!_chunkXLUYXUBDcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
|
|
9219
9217
|
if (!controller.getSelection()) throw new Error("Nothing is selected.");
|
|
9220
9218
|
controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
|
|
9221
9219
|
return summary(controller);
|
|
@@ -9259,7 +9257,7 @@ function createImageSelectionTools(controller) {
|
|
|
9259
9257
|
type: "object",
|
|
9260
9258
|
properties: {
|
|
9261
9259
|
layerId: { type: "string", description: "Existing adjustment layer to mask." },
|
|
9262
|
-
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)." },
|
|
9263
9261
|
params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
|
|
9264
9262
|
density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
|
|
9265
9263
|
feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
|
|
@@ -9279,11 +9277,11 @@ function createImageSelectionTools(controller) {
|
|
|
9279
9277
|
if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
|
|
9280
9278
|
controller.applySelectionAsLayerMask(layerId, props);
|
|
9281
9279
|
id = layerId;
|
|
9282
|
-
} else if (
|
|
9280
|
+
} else if (_chunkXLUYXUBDcjs.isAdjustmentKind.call(void 0, kind)) {
|
|
9283
9281
|
id = controller.addAdjustmentLayer({
|
|
9284
9282
|
kind,
|
|
9285
9283
|
params,
|
|
9286
|
-
mask:
|
|
9284
|
+
mask: _chunkXLUYXUBDcjs.layerMaskFromSelection.call(void 0, sel, props)
|
|
9287
9285
|
});
|
|
9288
9286
|
} else {
|
|
9289
9287
|
throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
|
|
@@ -9420,11 +9418,11 @@ function createImageEditTools(controller) {
|
|
|
9420
9418
|
const geometry2 = () => {
|
|
9421
9419
|
const s = controller.getState();
|
|
9422
9420
|
const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
|
|
9423
|
-
const out =
|
|
9421
|
+
const out = _chunkXLUYXUBDcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
|
|
9424
9422
|
return {
|
|
9425
9423
|
image: { ...s.imageDimensions },
|
|
9426
9424
|
crop: s.crop ? { ...s.crop } : null,
|
|
9427
|
-
rotation:
|
|
9425
|
+
rotation: _chunkXLUYXUBDcjs.normalizeAngle.call(void 0, s.transform.rotate),
|
|
9428
9426
|
flipH: s.transform.flipH,
|
|
9429
9427
|
flipV: s.transform.flipV,
|
|
9430
9428
|
output: { width: Math.round(out.width), height: Math.round(out.height) }
|
|
@@ -9659,7 +9657,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
9659
9657
|
const out = {
|
|
9660
9658
|
id: layer.id,
|
|
9661
9659
|
type: layer.type,
|
|
9662
|
-
name: layer.name || (layer.type === "adjustment" ?
|
|
9660
|
+
name: layer.name || (layer.type === "adjustment" ? _chunkXLUYXUBDcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
|
|
9663
9661
|
visible: layer.visible,
|
|
9664
9662
|
opacity: round3(layer.opacity),
|
|
9665
9663
|
blend: layer.blend,
|
|
@@ -9748,8 +9746,8 @@ function createImageLayerTools(controller) {
|
|
|
9748
9746
|
};
|
|
9749
9747
|
};
|
|
9750
9748
|
const exists = (id, what = "layerId") => {
|
|
9751
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
9752
|
-
|
|
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);
|
|
9753
9751
|
return id;
|
|
9754
9752
|
};
|
|
9755
9753
|
const listLayers = {
|
|
@@ -9785,7 +9783,7 @@ function createImageLayerTools(controller) {
|
|
|
9785
9783
|
handler: ({ layerId, target }) => {
|
|
9786
9784
|
const id = exists(layerId);
|
|
9787
9785
|
const layer = controller.getLayer(id);
|
|
9788
|
-
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.`);
|
|
9789
9787
|
controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
|
|
9790
9788
|
return { layer: describe(id), activeTarget: controller.getState().activeTarget };
|
|
9791
9789
|
}
|
|
@@ -9810,7 +9808,7 @@ function createImageLayerTools(controller) {
|
|
|
9810
9808
|
},
|
|
9811
9809
|
annotations: { title: "Add a pixel layer", ...WRITE2 },
|
|
9812
9810
|
handler: async (args) => {
|
|
9813
|
-
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.");
|
|
9814
9812
|
for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
|
|
9815
9813
|
const init = {
|
|
9816
9814
|
name: args.name,
|
|
@@ -9900,7 +9898,7 @@ function createImageLayerTools(controller) {
|
|
|
9900
9898
|
const id = exists(args.layerId);
|
|
9901
9899
|
const props = {};
|
|
9902
9900
|
for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
|
|
9903
|
-
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.");
|
|
9904
9902
|
controller.setLayerProperties(id, props);
|
|
9905
9903
|
return { layer: describe(id) };
|
|
9906
9904
|
}
|
|
@@ -9994,8 +9992,8 @@ function createImageLayerTools(controller) {
|
|
|
9994
9992
|
annotations: { title: "Move a layer's pixels", ...WRITE2 },
|
|
9995
9993
|
handler: ({ layerId, x, y, dx, dy }) => {
|
|
9996
9994
|
const id = exists(layerId);
|
|
9997
|
-
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0,
|
|
9998
|
-
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.");
|
|
9999
9997
|
return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
|
|
10000
9998
|
}
|
|
10001
9999
|
};
|
|
@@ -10067,7 +10065,7 @@ function createImageLayerTools(controller) {
|
|
|
10067
10065
|
annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
|
|
10068
10066
|
handler: ({ layerId, density, feather, enabled, linked }) => {
|
|
10069
10067
|
const id = exists(layerId);
|
|
10070
|
-
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.");
|
|
10071
10069
|
const mask = controller.setLayerMaskProps(id, {
|
|
10072
10070
|
density,
|
|
10073
10071
|
feather,
|
|
@@ -10150,7 +10148,7 @@ function createImageLayerTools(controller) {
|
|
|
10150
10148
|
handler: (args) => {
|
|
10151
10149
|
const id = exists(args.layerId);
|
|
10152
10150
|
const changes = filterValues(args);
|
|
10153
|
-
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.");
|
|
10154
10152
|
return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
|
|
10155
10153
|
}
|
|
10156
10154
|
};
|
|
@@ -10414,8 +10412,8 @@ function describeLayerEffects(effects) {
|
|
|
10414
10412
|
}
|
|
10415
10413
|
function createImageEffectTools(controller) {
|
|
10416
10414
|
const layerArg = (id) => {
|
|
10417
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10418
|
-
|
|
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);
|
|
10419
10417
|
return id;
|
|
10420
10418
|
};
|
|
10421
10419
|
const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
|
|
@@ -10446,7 +10444,7 @@ function createImageEffectTools(controller) {
|
|
|
10446
10444
|
annotations: { title: "Add a layer effect", ...WRITE3 },
|
|
10447
10445
|
handler: ({ layerId, kind, settings, index }) => {
|
|
10448
10446
|
const id = layerArg(layerId);
|
|
10449
|
-
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(", ")}.`);
|
|
10450
10448
|
const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
|
|
10451
10449
|
return result(id, { effectId: effect.id });
|
|
10452
10450
|
}
|
|
@@ -10466,7 +10464,7 @@ function createImageEffectTools(controller) {
|
|
|
10466
10464
|
handler: ({ layerId, effectId, settings }) => {
|
|
10467
10465
|
const id = layerArg(layerId);
|
|
10468
10466
|
const changes = _nullishCoalesce(settings, () => ( {}));
|
|
10469
|
-
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.");
|
|
10470
10468
|
controller.updateLayerEffect(id, effectId, changes);
|
|
10471
10469
|
return result(id);
|
|
10472
10470
|
}
|
|
@@ -10518,7 +10516,7 @@ function createImageEffectTools(controller) {
|
|
|
10518
10516
|
},
|
|
10519
10517
|
annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
|
|
10520
10518
|
handler: ({ angle, altitude }) => {
|
|
10521
|
-
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.");
|
|
10522
10520
|
const next = {};
|
|
10523
10521
|
if (angle !== void 0) next.angle = angle;
|
|
10524
10522
|
if (altitude !== void 0) next.altitude = altitude;
|
|
@@ -10699,7 +10697,7 @@ var PaintGesture = (_class8 = class {
|
|
|
10699
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.`);
|
|
10700
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.`);
|
|
10701
10699
|
const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
|
|
10702
|
-
const b =
|
|
10700
|
+
const b = _chunkXLUYXUBDcjs.shapeGeometryBounds.call(void 0, layer);
|
|
10703
10701
|
return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
|
|
10704
10702
|
})();
|
|
10705
10703
|
this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
|
|
@@ -10857,9 +10855,9 @@ function createImagePaintTools(controller) {
|
|
|
10857
10855
|
annotations: { title: "Paint a brush stroke", ...WRITE4 },
|
|
10858
10856
|
handler: (args) => {
|
|
10859
10857
|
const tool = args.tool;
|
|
10860
|
-
if (args.mixer !== void 0 && tool !== "mixer") throw new (0,
|
|
10861
|
-
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0,
|
|
10862
|
-
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.");
|
|
10863
10861
|
const result = controller.paintStroke({
|
|
10864
10862
|
tool,
|
|
10865
10863
|
points: args.points,
|
|
@@ -10990,7 +10988,7 @@ function profileArg(v) {
|
|
|
10990
10988
|
try {
|
|
10991
10989
|
return _chunkDCLJNVZScjs.base64ToBytes.call(void 0, s.slice(4));
|
|
10992
10990
|
} catch (e28) {
|
|
10993
|
-
throw new (0,
|
|
10991
|
+
throw new (0, _chunkXLUYXUBDcjs.LayerOperationError)("The icc: value is not valid base64.");
|
|
10994
10992
|
}
|
|
10995
10993
|
}
|
|
10996
10994
|
return s;
|
|
@@ -11055,10 +11053,10 @@ function createImageColorTools(controller) {
|
|
|
11055
11053
|
annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11056
11054
|
handler: (args) => {
|
|
11057
11055
|
if (args.off === true) {
|
|
11058
|
-
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.");
|
|
11059
11057
|
return controller.setProofSetup(null);
|
|
11060
11058
|
}
|
|
11061
|
-
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.");
|
|
11062
11060
|
const s = controller.setProofSetup({
|
|
11063
11061
|
profile: profileArg(args.profile),
|
|
11064
11062
|
...args.intent !== void 0 ? { intent: args.intent } : {},
|
|
@@ -11110,7 +11108,7 @@ function createImageColorTools(controller) {
|
|
|
11110
11108
|
},
|
|
11111
11109
|
annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11112
11110
|
handler: (args) => {
|
|
11113
|
-
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.");
|
|
11114
11112
|
return controller.setColorMode(args.mode, {
|
|
11115
11113
|
...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
|
|
11116
11114
|
...args.intent !== void 0 ? { intent: args.intent } : {}
|
|
@@ -11175,7 +11173,7 @@ function checkSource(controller, source) {
|
|
|
11175
11173
|
const p = source;
|
|
11176
11174
|
const { width, height } = controller.getState().imageDimensions;
|
|
11177
11175
|
if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
|
|
11178
|
-
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.`);
|
|
11179
11177
|
}
|
|
11180
11178
|
return p;
|
|
11181
11179
|
}
|
|
@@ -11369,10 +11367,10 @@ function createImageRetouchTools(controller) {
|
|
|
11369
11367
|
annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
|
|
11370
11368
|
handler: (args) => {
|
|
11371
11369
|
if (args.clear === true) {
|
|
11372
|
-
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.");
|
|
11373
11371
|
return controller.setCloneSource(null);
|
|
11374
11372
|
}
|
|
11375
|
-
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.");
|
|
11376
11374
|
return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
|
|
11377
11375
|
}
|
|
11378
11376
|
};
|
|
@@ -11393,11 +11391,11 @@ var DATA = {
|
|
|
11393
11391
|
description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
|
|
11394
11392
|
};
|
|
11395
11393
|
function psdBytesFromBase64(data) {
|
|
11396
|
-
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.");
|
|
11397
11395
|
const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
|
|
11398
|
-
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.");
|
|
11399
11397
|
const bytes = _chunkDCLJNVZScjs.base64ToBytes.call(void 0, body);
|
|
11400
|
-
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).`);
|
|
11401
11399
|
return bytes;
|
|
11402
11400
|
}
|
|
11403
11401
|
function createImagePsdTools(controller) {
|
|
@@ -11408,7 +11406,7 @@ function createImagePsdTools(controller) {
|
|
|
11408
11406
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
11409
11407
|
annotations: { title: "Inspect a PSD", ...READ7 },
|
|
11410
11408
|
handler: ({ data }) => {
|
|
11411
|
-
const res =
|
|
11409
|
+
const res = _chunkXLUYXUBDcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
|
|
11412
11410
|
return {
|
|
11413
11411
|
width: res.width,
|
|
11414
11412
|
height: res.height,
|
|
@@ -11495,7 +11493,7 @@ var GEOMETRY = {
|
|
|
11495
11493
|
dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
|
|
11496
11494
|
reference: {
|
|
11497
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}.",
|
|
11498
|
-
anyOf: [{ type: "string", enum:
|
|
11496
|
+
anyOf: [{ type: "string", enum: _chunkXLUYXUBDcjs.TRANSFORM_ANCHORS }, POINT]
|
|
11499
11497
|
},
|
|
11500
11498
|
matrix: {
|
|
11501
11499
|
type: "array",
|
|
@@ -11516,14 +11514,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
|
|
|
11516
11514
|
function geometryFrom(args) {
|
|
11517
11515
|
const numeric = NUMERIC.filter((k) => args[k] !== void 0);
|
|
11518
11516
|
const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
|
|
11519
|
-
if (ways === 0) throw new (0,
|
|
11520
|
-
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.");
|
|
11521
11519
|
if (args.matrix !== void 0) return { matrix: args.matrix };
|
|
11522
11520
|
if (args.corners !== void 0) return { corners: args.corners };
|
|
11523
11521
|
const params = {};
|
|
11524
11522
|
for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
|
|
11525
|
-
if (params.scaleX === 0 || params.scaleY === 0) throw new (0,
|
|
11526
|
-
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}.`);
|
|
11527
11525
|
return { params };
|
|
11528
11526
|
}
|
|
11529
11527
|
function targetFrom(args) {
|
|
@@ -11572,15 +11570,15 @@ function createImageTransformTools(controller) {
|
|
|
11572
11570
|
moved: [...s.moves],
|
|
11573
11571
|
frame: { ...s.box },
|
|
11574
11572
|
corners: s.startGeometry.corners.map(roundPoint),
|
|
11575
|
-
center: roundPoint(
|
|
11573
|
+
center: roundPoint(_chunkXLUYXUBDcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
|
|
11576
11574
|
};
|
|
11577
11575
|
if (s.smartObject) out.smartObject = true;
|
|
11578
11576
|
s.cancel();
|
|
11579
11577
|
if (args.meshColumns !== void 0) {
|
|
11580
11578
|
const cols = args.meshColumns;
|
|
11581
11579
|
const rows = _nullishCoalesce(args.meshRows, () => ( cols));
|
|
11582
|
-
const mesh =
|
|
11583
|
-
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) };
|
|
11584
11582
|
}
|
|
11585
11583
|
return out;
|
|
11586
11584
|
}
|
|
@@ -11605,7 +11603,7 @@ function createImageTransformTools(controller) {
|
|
|
11605
11603
|
type: "object",
|
|
11606
11604
|
properties: {
|
|
11607
11605
|
...TARGET3,
|
|
11608
|
-
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." },
|
|
11609
11607
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
|
|
11610
11608
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
|
|
11611
11609
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
|
|
@@ -11627,11 +11625,11 @@ function createImageTransformTools(controller) {
|
|
|
11627
11625
|
annotations: { title: "Warp a layer", ...WRITE6 },
|
|
11628
11626
|
handler: (args) => {
|
|
11629
11627
|
const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
|
|
11630
|
-
if (hasPreset && args.mesh !== void 0) throw new (0,
|
|
11631
|
-
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.");
|
|
11632
11630
|
let warp;
|
|
11633
11631
|
if (hasPreset) {
|
|
11634
|
-
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(", ")}.`);
|
|
11635
11633
|
warp = {
|
|
11636
11634
|
style: args.style,
|
|
11637
11635
|
bend: _nullishCoalesce(args.bend, () => ( 50)),
|
|
@@ -11642,7 +11640,7 @@ function createImageTransformTools(controller) {
|
|
|
11642
11640
|
} else {
|
|
11643
11641
|
const m = args.mesh;
|
|
11644
11642
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
11645
|
-
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}.`);
|
|
11646
11644
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
11647
11645
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
11648
11646
|
}
|
|
@@ -11737,13 +11735,13 @@ function settingsFrom(args) {
|
|
|
11737
11735
|
return out;
|
|
11738
11736
|
}
|
|
11739
11737
|
function imageArg(image) {
|
|
11740
|
-
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).");
|
|
11741
11739
|
return image.trim();
|
|
11742
11740
|
}
|
|
11743
11741
|
function createImageSmartObjectTools(controller) {
|
|
11744
11742
|
const smartId = (id) => {
|
|
11745
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
11746
|
-
|
|
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);
|
|
11747
11745
|
return id;
|
|
11748
11746
|
};
|
|
11749
11747
|
const info = (id) => {
|
|
@@ -11780,7 +11778,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11780
11778
|
},
|
|
11781
11779
|
annotations: { title: "Convert to Smart Object", ...WRITE7 },
|
|
11782
11780
|
handler: ({ layerIds, name }) => {
|
|
11783
|
-
for (const id2 of _nullishCoalesce(layerIds, () => ( [])))
|
|
11781
|
+
for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkXLUYXUBDcjs.requireLayer.call(void 0, controller.getLayers(), id2);
|
|
11784
11782
|
const id = controller.convertToSmartObject(layerIds, { name });
|
|
11785
11783
|
return { layer: layerSummary(id), smartObject: info(id) };
|
|
11786
11784
|
}
|
|
@@ -11817,7 +11815,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11817
11815
|
{
|
|
11818
11816
|
type: "object",
|
|
11819
11817
|
properties: {
|
|
11820
|
-
style: { type: "string", enum:
|
|
11818
|
+
style: { type: "string", enum: _chunkORE334I6cjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
|
|
11821
11819
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
|
|
11822
11820
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
|
|
11823
11821
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
|
|
@@ -11853,12 +11851,12 @@ function createImageSmartObjectTools(controller) {
|
|
|
11853
11851
|
else if (w) {
|
|
11854
11852
|
const m = w;
|
|
11855
11853
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
11856
|
-
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}.`);
|
|
11857
11855
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
11858
11856
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
11859
11857
|
}
|
|
11860
11858
|
const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
|
|
11861
|
-
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(", ")}.`);
|
|
11862
11860
|
const res = controller.setSmartObjectTransform(id, {
|
|
11863
11861
|
corners: args.corners,
|
|
11864
11862
|
matrix: args.matrix,
|
|
@@ -11983,7 +11981,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11983
11981
|
handler: (args) => {
|
|
11984
11982
|
const id = smartId(args.layerId);
|
|
11985
11983
|
const changes = settingsFrom(args);
|
|
11986
|
-
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.");
|
|
11987
11985
|
const filter = controller.updateSmartFilter(id, args.filterId, changes);
|
|
11988
11986
|
return { layerId: id, filter, smartFilters: info(id).smartFilters };
|
|
11989
11987
|
}
|
|
@@ -12304,8 +12302,8 @@ function geometry(args) {
|
|
|
12304
12302
|
}
|
|
12305
12303
|
function createImageShapeTools(controller) {
|
|
12306
12304
|
const shapeId = (id) => {
|
|
12307
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12308
|
-
|
|
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);
|
|
12309
12307
|
return id;
|
|
12310
12308
|
};
|
|
12311
12309
|
const layerSummary = (id) => {
|
|
@@ -12380,7 +12378,7 @@ function createImageShapeTools(controller) {
|
|
|
12380
12378
|
annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
|
|
12381
12379
|
handler: ({ layerId, fill, stroke, fillRule }) => {
|
|
12382
12380
|
const id = shapeId(layerId);
|
|
12383
|
-
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.");
|
|
12384
12382
|
return controller.setShapeStyle(id, { fill, stroke, fillRule });
|
|
12385
12383
|
}
|
|
12386
12384
|
};
|
|
@@ -12429,7 +12427,7 @@ function createImageShapeTools(controller) {
|
|
|
12429
12427
|
handler: ({ layerId, componentIndex, ...rest }) => {
|
|
12430
12428
|
const id = shapeId(layerId);
|
|
12431
12429
|
const change = geometry(rest);
|
|
12432
|
-
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.");
|
|
12433
12431
|
return controller.setShapeComponent(id, componentIndex, change);
|
|
12434
12432
|
}
|
|
12435
12433
|
};
|
|
@@ -12503,8 +12501,8 @@ function pick2(args, keys) {
|
|
|
12503
12501
|
}
|
|
12504
12502
|
function createImageTypeTools(controller) {
|
|
12505
12503
|
const typeId = (id) => {
|
|
12506
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12507
|
-
|
|
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);
|
|
12508
12506
|
return id;
|
|
12509
12507
|
};
|
|
12510
12508
|
const layerSummary = (id) => {
|
|
@@ -12584,7 +12582,7 @@ function createImageTypeTools(controller) {
|
|
|
12584
12582
|
annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
|
|
12585
12583
|
handler: (args) => {
|
|
12586
12584
|
const style = pick2(args, Object.keys(STYLE));
|
|
12587
|
-
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(", ")}.`);
|
|
12588
12586
|
return controller.setTextStyle(typeId(args.layerId), style, range(args));
|
|
12589
12587
|
}
|
|
12590
12588
|
};
|
|
@@ -12596,7 +12594,7 @@ function createImageTypeTools(controller) {
|
|
|
12596
12594
|
annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
|
|
12597
12595
|
handler: (args) => {
|
|
12598
12596
|
const style = pick2(args, Object.keys(PARAGRAPH));
|
|
12599
|
-
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(", ")}.`);
|
|
12600
12598
|
return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
|
|
12601
12599
|
}
|
|
12602
12600
|
};
|
|
@@ -12618,7 +12616,7 @@ function createImageTypeTools(controller) {
|
|
|
12618
12616
|
annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
|
|
12619
12617
|
handler: ({ layerId, kind, width, height }) => {
|
|
12620
12618
|
const id = typeId(layerId);
|
|
12621
|
-
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.");
|
|
12622
12620
|
return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
|
|
12623
12621
|
}
|
|
12624
12622
|
};
|
|
@@ -12640,7 +12638,7 @@ function createImageTypeTools(controller) {
|
|
|
12640
12638
|
var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
|
|
12641
12639
|
function adjustmentsSummary(adjustments) {
|
|
12642
12640
|
return {
|
|
12643
|
-
process:
|
|
12641
|
+
process: _chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, adjustments.process),
|
|
12644
12642
|
values: readAdjustmentControls(adjustments),
|
|
12645
12643
|
layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
|
|
12646
12644
|
};
|
|
@@ -12683,7 +12681,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12683
12681
|
default: def,
|
|
12684
12682
|
...requiresProcess ? { requiresProcess } : {}
|
|
12685
12683
|
})),
|
|
12686
|
-
layerKinds:
|
|
12684
|
+
layerKinds: _chunkXLUYXUBDcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
|
|
12687
12685
|
kind,
|
|
12688
12686
|
label,
|
|
12689
12687
|
controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
|
|
@@ -12769,7 +12767,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12769
12767
|
const result = { applied, clamped };
|
|
12770
12768
|
if (typeof label === "string" && label) result.label = label;
|
|
12771
12769
|
const notes = [];
|
|
12772
|
-
if ("tint" in applied &&
|
|
12770
|
+
if ("tint" in applied && _chunkXLUYXUBDcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
|
|
12773
12771
|
notes.push("Tint has no effect on process 1 edits.");
|
|
12774
12772
|
}
|
|
12775
12773
|
if (notes.length) result.notes = notes;
|
|
@@ -12779,11 +12777,11 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12779
12777
|
const addLayer = {
|
|
12780
12778
|
name: "add_adjustment_layer",
|
|
12781
12779
|
title: "Add an adjustment layer",
|
|
12782
|
-
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.",
|
|
12783
12781
|
inputSchema: {
|
|
12784
12782
|
type: "object",
|
|
12785
12783
|
properties: {
|
|
12786
|
-
kind: { type: "string", enum:
|
|
12784
|
+
kind: { type: "string", enum: _chunkXLUYXUBDcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
|
|
12787
12785
|
params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
|
|
12788
12786
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
|
|
12789
12787
|
blend: { type: "string", enum: _chunkJ5BA3BQ6cjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
|
|
@@ -12802,7 +12800,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12802
12800
|
openWorldHint: false
|
|
12803
12801
|
},
|
|
12804
12802
|
handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
|
|
12805
|
-
if (!
|
|
12803
|
+
if (!_chunkXLUYXUBDcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
|
|
12806
12804
|
if (blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
12807
12805
|
if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
|
|
12808
12806
|
for (const ref of [aboveId, parentId]) {
|
|
@@ -12896,7 +12894,7 @@ function boxToCurvePoint(x, y, width, height) {
|
|
|
12896
12894
|
return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
|
|
12897
12895
|
}
|
|
12898
12896
|
function curveSvgPath(points, width, height, samples = 64) {
|
|
12899
|
-
const lut =
|
|
12897
|
+
const lut = _chunkXLUYXUBDcjs.curveLutFromLevels.call(void 0, points);
|
|
12900
12898
|
const n = lut.length - 1;
|
|
12901
12899
|
let d = "";
|
|
12902
12900
|
for (let i = 0; i <= samples; i++) {
|
|
@@ -13406,7 +13404,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13406
13404
|
else {
|
|
13407
13405
|
const layout = this.layout();
|
|
13408
13406
|
if (layout && layout.lines.length) {
|
|
13409
|
-
const c =
|
|
13407
|
+
const c = _chunkORE334I6cjs.caretAt.call(void 0, layout, f);
|
|
13410
13408
|
const line = layout.lines[c.line];
|
|
13411
13409
|
if (to === "home") f = line.start;
|
|
13412
13410
|
else if (to === "end") {
|
|
@@ -13501,7 +13499,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13501
13499
|
styleHere() {
|
|
13502
13500
|
const layer = this.layer;
|
|
13503
13501
|
const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
|
|
13504
|
-
return
|
|
13502
|
+
return _chunkORE334I6cjs.styleAt.call(void 0, layer.runs, at, _chunkORE334I6cjs.DEFAULT_TEXT_STYLE);
|
|
13505
13503
|
}
|
|
13506
13504
|
info() {
|
|
13507
13505
|
return this.controller.getTextLayer(this.layerId);
|
|
@@ -13510,8 +13508,8 @@ var TextEditSession = (_class11 = class {
|
|
|
13510
13508
|
overlay() {
|
|
13511
13509
|
const layer = this.layer;
|
|
13512
13510
|
const layout = this.layout();
|
|
13513
|
-
const m =
|
|
13514
|
-
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 });
|
|
13515
13513
|
let frame = null;
|
|
13516
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)];
|
|
13517
13515
|
else if (layout) {
|
|
@@ -13531,7 +13529,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13531
13529
|
selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
|
|
13532
13530
|
}
|
|
13533
13531
|
}
|
|
13534
|
-
const c =
|
|
13532
|
+
const c = _chunkORE334I6cjs.caretAt.call(void 0, layout, this.focus);
|
|
13535
13533
|
return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
|
|
13536
13534
|
}
|
|
13537
13535
|
/** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
|
|
@@ -13546,7 +13544,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13546
13544
|
}
|
|
13547
13545
|
if (this.layer.name === "Text" && this.changed) {
|
|
13548
13546
|
try {
|
|
13549
|
-
this.controller.setLayerProperties(this.layerId, { name:
|
|
13547
|
+
this.controller.setLayerProperties(this.layerId, { name: _chunkXLUYXUBDcjs.typeLayerName.call(void 0, this.text) }, false);
|
|
13550
13548
|
} catch (e30) {
|
|
13551
13549
|
}
|
|
13552
13550
|
}
|
|
@@ -13557,8 +13555,8 @@ function typeLayerAt(controller, p, slop = 4) {
|
|
|
13557
13555
|
const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
|
|
13558
13556
|
for (const l of layers) {
|
|
13559
13557
|
if (!l.visible) continue;
|
|
13560
|
-
const inv = invert(
|
|
13561
|
-
const q =
|
|
13558
|
+
const inv = invert(_chunkXLUYXUBDcjs.textMatrix.call(void 0, l));
|
|
13559
|
+
const q = _chunkORE334I6cjs.applyMatrix.call(void 0, inv, p);
|
|
13562
13560
|
let b = null;
|
|
13563
13561
|
if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
|
|
13564
13562
|
else {
|
|
@@ -13668,7 +13666,7 @@ function layerPanelRows(layers, activeId) {
|
|
|
13668
13666
|
}
|
|
13669
13667
|
function layerLabel(layer) {
|
|
13670
13668
|
if (layer.name) return layer.name;
|
|
13671
|
-
if (layer.type === "adjustment") return
|
|
13669
|
+
if (layer.type === "adjustment") return _chunkXLUYXUBDcjs.adjustmentKindLabel.call(void 0, layer.kind);
|
|
13672
13670
|
return layer.type === "group" ? "Group" : "Layer";
|
|
13673
13671
|
}
|
|
13674
13672
|
function layerBadge(layer) {
|
|
@@ -14140,7 +14138,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
|
|
|
14140
14138
|
];
|
|
14141
14139
|
var WARP_STYLE_OPTIONS = [
|
|
14142
14140
|
{ id: "custom", label: "Custom" },
|
|
14143
|
-
...
|
|
14141
|
+
..._chunkORE334I6cjs.WARP_STYLES.map((id) => ({ id, label: _chunkORE334I6cjs.WARP_STYLE_LABELS[id] }))
|
|
14144
14142
|
];
|
|
14145
14143
|
var WARP_GRID_OPTIONS = [
|
|
14146
14144
|
{ id: "1x1", label: "Default", columns: 1, rows: 1 },
|
|
@@ -14276,7 +14274,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14276
14274
|
setMode(mode) {
|
|
14277
14275
|
this.modeValue = mode;
|
|
14278
14276
|
const s = this.session;
|
|
14279
|
-
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);
|
|
14280
14278
|
this.changed();
|
|
14281
14279
|
}
|
|
14282
14280
|
/** The Warp options bar's settings. */
|
|
@@ -14298,13 +14296,13 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14298
14296
|
this.modeValue = "warp";
|
|
14299
14297
|
const next = { ...this.warpSettings, ...changes };
|
|
14300
14298
|
this.warpSettings = next;
|
|
14301
|
-
let mesh = _nullishCoalesce(this.mesh, () => (
|
|
14299
|
+
let mesh = _nullishCoalesce(this.mesh, () => ( _chunkORE334I6cjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
|
|
14302
14300
|
if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
|
|
14303
14301
|
const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
|
|
14304
|
-
mesh = _nullishCoalesce(
|
|
14305
|
-
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);
|
|
14306
14304
|
}
|
|
14307
|
-
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);
|
|
14308
14306
|
this.mesh = mesh;
|
|
14309
14307
|
this.changed();
|
|
14310
14308
|
this.preview();
|
|
@@ -14351,11 +14349,11 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14351
14349
|
const m = this.mesh;
|
|
14352
14350
|
const at = (p) => _nullishCoalesce(_chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p), () => ( p));
|
|
14353
14351
|
const pts = m.points.map(at);
|
|
14354
|
-
const edit =
|
|
14352
|
+
const edit = _chunkORE334I6cjs.warpMeshEditPoints.call(void 0, m);
|
|
14355
14353
|
out.handles = [];
|
|
14356
|
-
out.outline =
|
|
14354
|
+
out.outline = _chunkORE334I6cjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
|
|
14357
14355
|
out.warp = {
|
|
14358
|
-
curves:
|
|
14356
|
+
curves: _chunkORE334I6cjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
|
|
14359
14357
|
anchors: edit.anchors.map((i) => pts[i]),
|
|
14360
14358
|
handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
|
|
14361
14359
|
};
|
|
@@ -14379,7 +14377,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14379
14377
|
if (!o) return null;
|
|
14380
14378
|
if (this.modeValue === "warp" && this.mesh) {
|
|
14381
14379
|
const h = this.homography();
|
|
14382
|
-
const edit =
|
|
14380
|
+
const edit = _chunkORE334I6cjs.warpMeshEditPoints.call(void 0, this.mesh);
|
|
14383
14381
|
let best2 = -1;
|
|
14384
14382
|
let bestD2 = tolerance;
|
|
14385
14383
|
for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
|
|
@@ -14424,7 +14422,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14424
14422
|
if (this.modeValue === "warp" && this.mesh && handle === "inside") {
|
|
14425
14423
|
const q = this.toFrame(p, this.corners);
|
|
14426
14424
|
if (q) {
|
|
14427
|
-
const r =
|
|
14425
|
+
const r = _chunkORE334I6cjs.warpMeshParamAt.call(void 0, this.mesh, q);
|
|
14428
14426
|
st = { s: r.s, t: r.t };
|
|
14429
14427
|
}
|
|
14430
14428
|
}
|
|
@@ -14457,8 +14455,8 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14457
14455
|
if (!a || !b) return;
|
|
14458
14456
|
const delta = { x: b.x - a.x, y: b.y - a.y };
|
|
14459
14457
|
const i = meshIndex(d.handle);
|
|
14460
|
-
if (i >= 0) this.mesh =
|
|
14461
|
-
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);
|
|
14462
14460
|
else return;
|
|
14463
14461
|
this.warpSettings = { ...this.warpSettings, style: "custom" };
|
|
14464
14462
|
this.changed();
|
|
@@ -14582,7 +14580,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14582
14580
|
bar() {
|
|
14583
14581
|
const s = this.session;
|
|
14584
14582
|
if (!s || !this.corners) return null;
|
|
14585
|
-
const read =
|
|
14583
|
+
const read = _chunkXLUYXUBDcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
|
|
14586
14584
|
return {
|
|
14587
14585
|
affine: read.affine,
|
|
14588
14586
|
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
@@ -14607,7 +14605,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14607
14605
|
this.changed();
|
|
14608
14606
|
return;
|
|
14609
14607
|
}
|
|
14610
|
-
const m =
|
|
14608
|
+
const m = _chunkXLUYXUBDcjs.matrixFromParams.call(void 0, s.box, {
|
|
14611
14609
|
scaleX: next.scaleX,
|
|
14612
14610
|
scaleY: next.scaleY,
|
|
14613
14611
|
rotate: next.rotate,
|
|
@@ -14617,7 +14615,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14617
14615
|
dx: next.x - this.refBox.x,
|
|
14618
14616
|
dy: next.y - this.refBox.y
|
|
14619
14617
|
});
|
|
14620
|
-
this.setCorners(
|
|
14618
|
+
this.setCorners(_chunkXLUYXUBDcjs.cornersFromMatrix.call(void 0, s.box, m));
|
|
14621
14619
|
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
14622
14620
|
this.changed();
|
|
14623
14621
|
}
|
|
@@ -14713,7 +14711,7 @@ function createImageEffectsToolProvider(controller, options = {}) {
|
|
|
14713
14711
|
return { target, effect: _nullishCoalesce(effects.find((e) => e.id === instance), () => ( effects[effects.length - 1])), effects, ...extra };
|
|
14714
14712
|
};
|
|
14715
14713
|
const plainValues = (v) => v;
|
|
14716
|
-
return
|
|
14714
|
+
return _chunkJODTP4DPcjs.createEffectToolProvider.call(void 0, {
|
|
14717
14715
|
id: _nullishCoalesce(options.id, () => ( "image-effects")),
|
|
14718
14716
|
namespace: options.namespace,
|
|
14719
14717
|
target: { noun: "layer", id: "A layer id from list_layers." },
|
|
@@ -15704,5 +15702,5 @@ function createImageEffectsToolProvider(controller, options = {}) {
|
|
|
15704
15702
|
|
|
15705
15703
|
|
|
15706
15704
|
|
|
15707
|
-
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;
|
|
15708
15706
|
//# sourceMappingURL=index.cjs.map
|