@pixerate/editor 0.124.0 → 0.125.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.cjs +3 -3
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.js +3 -3
- package/dist/animation-editor/index.cjs +424 -85
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +174 -7
- package/dist/animation-editor/index.d.ts +174 -7
- package/dist/animation-editor/index.js +348 -9
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/chunk-FJ3324TZ.js +59 -0
- package/dist/chunk-FJ3324TZ.js.map +1 -0
- package/dist/{chunk-5EO2IXQE.js → chunk-FPRIUR4T.js} +1 -1
- package/dist/chunk-FPRIUR4T.js.map +1 -0
- package/dist/{chunk-YVVSTD3B.js → chunk-G6WXWS4Y.js} +9 -18
- package/dist/chunk-G6WXWS4Y.js.map +1 -0
- package/dist/{chunk-NGYD3AMN.js → chunk-MPQAO33O.js} +2 -2
- package/dist/{chunk-PEHYWUVV.cjs → chunk-O5RVCDEC.cjs} +82 -82
- package/dist/{chunk-PEHYWUVV.cjs.map → chunk-O5RVCDEC.cjs.map} +1 -1
- package/dist/{chunk-TK53AB4Q.cjs → chunk-QDJKUBWE.cjs} +3 -3
- package/dist/{chunk-TK53AB4Q.cjs.map → chunk-QDJKUBWE.cjs.map} +1 -1
- package/dist/{chunk-5XXMLBH4.cjs → chunk-QQKTOA4U.cjs} +1 -1
- package/dist/chunk-QQKTOA4U.cjs.map +1 -0
- package/dist/{chunk-IWSMDQE5.cjs → chunk-UXFI3CDZ.cjs} +13 -22
- package/dist/chunk-UXFI3CDZ.cjs.map +1 -0
- package/dist/{chunk-WE25VLCO.cjs → chunk-V5YGPRCZ.cjs} +36 -36
- package/dist/{chunk-WE25VLCO.cjs.map → chunk-V5YGPRCZ.cjs.map} +1 -1
- package/dist/chunk-W6QTLHZ3.cjs +59 -0
- package/dist/chunk-W6QTLHZ3.cjs.map +1 -0
- package/dist/{chunk-WATAQ2Z2.js → chunk-WUDPFWAN.js} +2 -2
- package/dist/{chunk-VFAKN46Z.js → chunk-XZWOLXWA.js} +3 -3
- package/dist/{chunk-VFAKN46Z.js.map → chunk-XZWOLXWA.js.map} +1 -1
- package/dist/effects/index.cjs +51 -6
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/index.d.cts +39 -8
- package/dist/effects/index.d.ts +39 -8
- package/dist/effects/index.js +48 -3
- package/dist/effects/index.js.map +1 -1
- package/dist/{export-TqXMOlDt.d.cts → export-Bp7ji2r4.d.cts} +4 -3
- package/dist/{export-BzSRXyH6.d.cts → export-C1s4eolZ.d.ts} +5 -3
- package/dist/{export-8RnlngAv.d.ts → export-DAyPY94f.d.ts} +4 -3
- package/dist/{export-DM3h7QEI.d.ts → export-DVl4fWy5.d.cts} +5 -3
- package/dist/generation/index.cjs +3 -3
- package/dist/generation/index.cjs.map +1 -1
- package/dist/generation/index.js +3 -3
- package/dist/helpers-BBLlekuM.d.ts +2009 -0
- package/dist/helpers-i95Ob6Vi.d.cts +2009 -0
- package/dist/image-editor/index.cjs +712 -721
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +5 -7
- package/dist/image-editor/index.d.ts +5 -7
- package/dist/image-editor/index.js +19 -28
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint-editor/index.cjs +12 -11
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +3 -5
- package/dist/paint-editor/index.d.ts +3 -5
- package/dist/paint-editor/index.js +6 -5
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{svg-BDrjRnL1.d.cts → svg-BkRL-fZJ.d.cts} +1 -1
- package/dist/{svg-C-vZ3q50.d.ts → svg-DJKriJ4A.d.ts} +1 -1
- package/dist/tools/index.cjs +2 -2
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.js +3 -3
- package/dist/{tools-C7JtLYzo.d.ts → tools-CM8Oe8F3.d.ts} +1 -1
- package/dist/{tools-DHKGHiSK.d.cts → tools-DZCv2kX1.d.cts} +1 -1
- package/dist/vector/index.cjs +1032 -883
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +61 -6
- package/dist/vector/index.d.ts +61 -6
- package/dist/vector/index.js +155 -6
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.cjs +271 -270
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +4 -6
- package/dist/video-editor/index.d.ts +4 -6
- package/dist/video-editor/index.js +6 -5
- package/dist/video-editor/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-animation-editor/SKILL.md +24 -1
- package/skills/pixerate-vector/SKILL.md +15 -0
- package/dist/chunk-5EO2IXQE.js.map +0 -1
- package/dist/chunk-5XXMLBH4.cjs.map +0 -1
- package/dist/chunk-IWSMDQE5.cjs.map +0 -1
- package/dist/chunk-YVVSTD3B.js.map +0 -1
- package/dist/flair-CxB3fOcU.d.ts +0 -739
- package/dist/flair-D7BxyBwL.d.cts +0 -739
- package/dist/helpers-777mC6dc.d.cts +0 -253
- package/dist/helpers-DX2_7L5t.d.ts +0 -253
- package/dist/types-BcX7sCsn.d.ts +0 -993
- package/dist/types-CznabG7m.d.cts +0 -993
- /package/dist/{chunk-NGYD3AMN.js.map → chunk-MPQAO33O.js.map} +0 -0
- /package/dist/{chunk-WATAQ2Z2.js.map → chunk-WUDPFWAN.js.map} +0 -0
|
@@ -362,7 +362,7 @@ var _chunk2OJACTPRcjs = require('../chunk-2OJACTPR.cjs');
|
|
|
362
362
|
|
|
363
363
|
|
|
364
364
|
|
|
365
|
-
var
|
|
365
|
+
var _chunkO5RVCDECcjs = require('../chunk-O5RVCDEC.cjs');
|
|
366
366
|
|
|
367
367
|
|
|
368
368
|
var _chunk2YQONY6Gcjs = require('../chunk-2YQONY6G.cjs');
|
|
@@ -371,15 +371,7 @@ var _chunk2YQONY6Gcjs = require('../chunk-2YQONY6G.cjs');
|
|
|
371
371
|
var _chunkD6FH2YAXcjs = require('../chunk-D6FH2YAX.cjs');
|
|
372
372
|
|
|
373
373
|
|
|
374
|
-
var
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
var _chunkIOXKXQNWcjs = require('../chunk-IOXKXQNW.cjs');
|
|
382
|
-
require('../chunk-RIWPYSKU.cjs');
|
|
374
|
+
var _chunkW6QTLHZ3cjs = require('../chunk-W6QTLHZ3.cjs');
|
|
383
375
|
|
|
384
376
|
|
|
385
377
|
var _chunkVJUVNERTcjs = require('../chunk-VJUVNERT.cjs');
|
|
@@ -810,9 +802,20 @@ var _chunk643B2HKCcjs = require('../chunk-643B2HKC.cjs');
|
|
|
810
802
|
|
|
811
803
|
|
|
812
804
|
|
|
813
|
-
var
|
|
805
|
+
var _chunkQQKTOA4Ucjs = require('../chunk-QQKTOA4U.cjs');
|
|
806
|
+
|
|
807
|
+
|
|
808
|
+
var _chunkQDJKUBWEcjs = require('../chunk-QDJKUBWE.cjs');
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
var _chunkIOXKXQNWcjs = require('../chunk-IOXKXQNW.cjs');
|
|
814
816
|
require('../chunk-N3FVUOZD.cjs');
|
|
815
817
|
require('../chunk-GUZ47CJM.cjs');
|
|
818
|
+
require('../chunk-RIWPYSKU.cjs');
|
|
816
819
|
require('../chunk-MR3Z4OQI.cjs');
|
|
817
820
|
require('../chunk-A6PHCAGX.cjs');
|
|
818
821
|
|
|
@@ -919,7 +922,7 @@ function quickMaskPixels(mask, style = {}) {
|
|
|
919
922
|
|
|
920
923
|
// src/image-editor/layers/render.ts
|
|
921
924
|
function isQuarterTurn(rotate) {
|
|
922
|
-
return
|
|
925
|
+
return _chunkO5RVCDECcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
|
|
923
926
|
}
|
|
924
927
|
function isIntegerRect(r) {
|
|
925
928
|
return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
|
|
@@ -927,7 +930,7 @@ function isIntegerRect(r) {
|
|
|
927
930
|
function baseProjection(region, transform, baseW, baseH) {
|
|
928
931
|
return {
|
|
929
932
|
region,
|
|
930
|
-
angle:
|
|
933
|
+
angle: _chunkO5RVCDECcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
931
934
|
flipH: transform.flipH,
|
|
932
935
|
flipV: transform.flipV,
|
|
933
936
|
scale: 1,
|
|
@@ -936,14 +939,14 @@ function baseProjection(region, transform, baseW, baseH) {
|
|
|
936
939
|
};
|
|
937
940
|
}
|
|
938
941
|
function projectQuarterTurn(src, srcRect, region, transform) {
|
|
939
|
-
const rotated =
|
|
942
|
+
const rotated = _chunkO5RVCDECcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
940
943
|
const w = Math.max(1, Math.round(rotated.width));
|
|
941
944
|
const h = Math.max(1, Math.round(rotated.height));
|
|
942
945
|
const out = new Uint8ClampedArray(w * h * 4);
|
|
943
946
|
const p = baseProjection(region, transform, w, h);
|
|
944
|
-
const o =
|
|
945
|
-
const ox =
|
|
946
|
-
const oy =
|
|
947
|
+
const o = _chunkO5RVCDECcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
|
|
948
|
+
const ox = _chunkO5RVCDECcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
|
|
949
|
+
const oy = _chunkO5RVCDECcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
|
|
947
950
|
const ux = Math.round(ox.x - o.x);
|
|
948
951
|
const vx = Math.round(ox.y - o.y);
|
|
949
952
|
const uy = Math.round(oy.x - o.x);
|
|
@@ -972,23 +975,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
|
|
|
972
975
|
const d = img.data;
|
|
973
976
|
for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
|
|
974
977
|
}
|
|
975
|
-
if (legacyOutputBlur && legacyOutputBlur > 0)
|
|
978
|
+
if (legacyOutputBlur && legacyOutputBlur > 0) _chunkO5RVCDECcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
|
|
976
979
|
}
|
|
977
980
|
function needsLegacyBase(input) {
|
|
978
981
|
const { stack, region, canvas, transform } = input;
|
|
979
|
-
if (!
|
|
982
|
+
if (!_chunkO5RVCDECcjs.isLegacyShape.call(void 0, stack)) return false;
|
|
980
983
|
const bg = stack.layers[0];
|
|
981
984
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
|
|
982
985
|
if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
|
|
983
986
|
if (stack.outputOpacity < 1) return true;
|
|
984
|
-
const blur =
|
|
987
|
+
const blur = _chunkO5RVCDECcjs.blurFilter.call(void 0, bg);
|
|
985
988
|
if (blur && blur.enabled && blur.radius > 0) {
|
|
986
989
|
const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
|
|
987
|
-
const angle =
|
|
990
|
+
const angle = _chunkO5RVCDECcjs.normalizeAngle.call(void 0, transform.rotate);
|
|
988
991
|
if (!full || angle === 90 || angle === 270) return true;
|
|
989
992
|
}
|
|
990
993
|
if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
|
|
991
|
-
if (
|
|
994
|
+
if (_chunkO5RVCDECcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
|
|
992
995
|
return false;
|
|
993
996
|
}
|
|
994
997
|
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;
|
|
@@ -1020,7 +1023,7 @@ function coveringRect(region) {
|
|
|
1020
1023
|
const y = Math.floor(region.y);
|
|
1021
1024
|
return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
|
|
1022
1025
|
}
|
|
1023
|
-
function renderLayeredBase(stack, region, transform, sources, compositor = new (0,
|
|
1026
|
+
function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkO5RVCDECcjs.LayerCompositor)()) {
|
|
1024
1027
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
|
|
1025
1028
|
throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
|
|
1026
1029
|
}
|
|
@@ -1154,8 +1157,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1154
1157
|
* The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
|
|
1155
1158
|
* trust dirty rectangles; exports use `exportCompositor`.
|
|
1156
1159
|
*/
|
|
1157
|
-
__init8() {this.compositor = new (0,
|
|
1158
|
-
__init9() {this.exportCompositor = new (0,
|
|
1160
|
+
__init8() {this.compositor = new (0, _chunkO5RVCDECcjs.LayerCompositor)()}
|
|
1161
|
+
__init9() {this.exportCompositor = new (0, _chunkO5RVCDECcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
|
|
1159
1162
|
/** How the host resolves layer pixels (set by the controller). */
|
|
1160
1163
|
|
|
1161
1164
|
/**
|
|
@@ -1232,9 +1235,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1232
1235
|
return;
|
|
1233
1236
|
}
|
|
1234
1237
|
const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
|
|
1235
|
-
const projection =
|
|
1238
|
+
const projection = _chunkO5RVCDECcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
|
|
1236
1239
|
const { region } = projection;
|
|
1237
|
-
const rotated =
|
|
1240
|
+
const rotated = _chunkO5RVCDECcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1238
1241
|
const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
|
|
1239
1242
|
let overlay = annotations;
|
|
1240
1243
|
if (route === "legacy") {
|
|
@@ -1244,8 +1247,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1244
1247
|
`${naturalWidth}x${naturalHeight}`,
|
|
1245
1248
|
`${region.x},${region.y},${region.width},${region.height}`,
|
|
1246
1249
|
`${projection.angle},${transform.flipH},${transform.flipV}`,
|
|
1247
|
-
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${
|
|
1248
|
-
|
|
1250
|
+
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkO5RVCDECcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
|
|
1251
|
+
_chunkO5RVCDECcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
|
|
1249
1252
|
`${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}`,
|
|
1250
1253
|
`d${this.displayKey}`
|
|
1251
1254
|
].join("|");
|
|
@@ -1279,7 +1282,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1279
1282
|
}
|
|
1280
1283
|
if (overlay.length > 0 || options.draftAnnotation) {
|
|
1281
1284
|
ctx.save();
|
|
1282
|
-
|
|
1285
|
+
_chunkO5RVCDECcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1283
1286
|
ctx.beginPath();
|
|
1284
1287
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1285
1288
|
ctx.clip();
|
|
@@ -1302,7 +1305,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1302
1305
|
if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
|
|
1303
1306
|
ctx.save();
|
|
1304
1307
|
try {
|
|
1305
|
-
|
|
1308
|
+
_chunkO5RVCDECcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1306
1309
|
ctx.beginPath();
|
|
1307
1310
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1308
1311
|
ctx.clip();
|
|
@@ -1317,7 +1320,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1317
1320
|
const b = options.brushCursor;
|
|
1318
1321
|
ctx.save();
|
|
1319
1322
|
try {
|
|
1320
|
-
|
|
1323
|
+
_chunkO5RVCDECcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1321
1324
|
const px2 = 1 / (projection.scale || 1);
|
|
1322
1325
|
ctx.beginPath();
|
|
1323
1326
|
ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
|
|
@@ -1335,7 +1338,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1335
1338
|
const t = options.textEdit;
|
|
1336
1339
|
ctx.save();
|
|
1337
1340
|
try {
|
|
1338
|
-
const scr = (p) =>
|
|
1341
|
+
const scr = (p) => _chunkO5RVCDECcjs.projectImagePoint.call(void 0, p, projection);
|
|
1339
1342
|
const poly = (pts) => {
|
|
1340
1343
|
ctx.beginPath();
|
|
1341
1344
|
pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
|
|
@@ -1374,7 +1377,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1374
1377
|
const t = options.freeTransform;
|
|
1375
1378
|
ctx.save();
|
|
1376
1379
|
try {
|
|
1377
|
-
const scr = (p) =>
|
|
1380
|
+
const scr = (p) => _chunkO5RVCDECcjs.projectImagePoint.call(void 0, p, projection);
|
|
1378
1381
|
ctx.beginPath();
|
|
1379
1382
|
if (t.warp) {
|
|
1380
1383
|
for (const c of t.warp.curves) {
|
|
@@ -1432,7 +1435,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1432
1435
|
}
|
|
1433
1436
|
if (isActivelyCropping) {
|
|
1434
1437
|
const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
|
|
1435
|
-
this.drawCropOverlay(ctx,
|
|
1438
|
+
this.drawCropOverlay(ctx, _chunkO5RVCDECcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
|
|
1436
1439
|
}
|
|
1437
1440
|
}
|
|
1438
1441
|
/**
|
|
@@ -1441,7 +1444,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1441
1444
|
*/
|
|
1442
1445
|
async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
|
|
1443
1446
|
const { adjustments, depthMask } = state;
|
|
1444
|
-
const rotated =
|
|
1447
|
+
const rotated = _chunkO5RVCDECcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1445
1448
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1446
1449
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1447
1450
|
const baseCanvas = this.createCanvas(baseW, baseH);
|
|
@@ -1449,7 +1452,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1449
1452
|
if (!baseCtx) return baseCanvas;
|
|
1450
1453
|
const projection = getBaseProjection(region, transform, baseW, baseH);
|
|
1451
1454
|
baseCtx.save();
|
|
1452
|
-
|
|
1455
|
+
_chunkO5RVCDECcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
|
|
1453
1456
|
baseCtx.drawImage(
|
|
1454
1457
|
img,
|
|
1455
1458
|
region.x,
|
|
@@ -1464,8 +1467,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1464
1467
|
baseCtx.restore();
|
|
1465
1468
|
const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
|
|
1466
1469
|
if (imageData) {
|
|
1467
|
-
const layerMasks =
|
|
1468
|
-
|
|
1470
|
+
const layerMasks = _chunkO5RVCDECcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
|
|
1471
|
+
_chunkO5RVCDECcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
|
|
1469
1472
|
if (depthMask.enabled && depthMask.maskSource) {
|
|
1470
1473
|
try {
|
|
1471
1474
|
const maskImg = await this.imageCache.get(depthMask.maskSource);
|
|
@@ -1476,7 +1479,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1476
1479
|
const maskCtx = maskCanvas.getContext("2d");
|
|
1477
1480
|
if (maskCtx) {
|
|
1478
1481
|
maskCtx.save();
|
|
1479
|
-
|
|
1482
|
+
_chunkO5RVCDECcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
|
|
1480
1483
|
maskCtx.drawImage(
|
|
1481
1484
|
maskImg,
|
|
1482
1485
|
region.x * sx,
|
|
@@ -1491,7 +1494,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1491
1494
|
maskCtx.restore();
|
|
1492
1495
|
const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
|
|
1493
1496
|
if (maskData) {
|
|
1494
|
-
|
|
1497
|
+
_chunkO5RVCDECcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
|
|
1495
1498
|
}
|
|
1496
1499
|
}
|
|
1497
1500
|
} catch (e7) {
|
|
@@ -1510,7 +1513,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1510
1513
|
else if (this.baseRoute === "layers") route = "layers";
|
|
1511
1514
|
else {
|
|
1512
1515
|
const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
|
|
1513
|
-
const shaped = this.baseRoute === "legacy" &&
|
|
1516
|
+
const shaped = this.baseRoute === "legacy" && _chunkO5RVCDECcjs.isLegacyShape.call(void 0, stack);
|
|
1514
1517
|
route = shaped || needsLegacyBase({
|
|
1515
1518
|
stack,
|
|
1516
1519
|
region,
|
|
@@ -1645,17 +1648,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1645
1648
|
if (!comp) return null;
|
|
1646
1649
|
const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
|
|
1647
1650
|
const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
|
|
1648
|
-
const rotated =
|
|
1651
|
+
const rotated = _chunkO5RVCDECcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1649
1652
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1650
1653
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1651
|
-
const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${
|
|
1654
|
+
const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkO5RVCDECcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
|
|
1652
1655
|
if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
|
|
1653
1656
|
const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
|
|
1654
1657
|
const ctx = canvas.getContext("2d");
|
|
1655
1658
|
if (!ctx) return null;
|
|
1656
1659
|
ctx.clearRect(0, 0, baseW, baseH);
|
|
1657
1660
|
ctx.save();
|
|
1658
|
-
|
|
1661
|
+
_chunkO5RVCDECcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
|
|
1659
1662
|
ctx.beginPath();
|
|
1660
1663
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1661
1664
|
ctx.clip();
|
|
@@ -1927,7 +1930,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1927
1930
|
ctx.strokeStyle = "#3b82f6";
|
|
1928
1931
|
ctx.lineWidth = 1.5;
|
|
1929
1932
|
ctx.setLineDash([4, 4]);
|
|
1930
|
-
const bounds =
|
|
1933
|
+
const bounds = _chunkO5RVCDECcjs.getAnnotationBounds.call(void 0, ann);
|
|
1931
1934
|
const pad = 4;
|
|
1932
1935
|
ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
|
|
1933
1936
|
ctx.fillStyle = "#ffffff";
|
|
@@ -1948,7 +1951,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1948
1951
|
}
|
|
1949
1952
|
/** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
|
|
1950
1953
|
getAnnotationBounds(ann) {
|
|
1951
|
-
return
|
|
1954
|
+
return _chunkO5RVCDECcjs.getAnnotationBounds.call(void 0, ann);
|
|
1952
1955
|
}
|
|
1953
1956
|
/**
|
|
1954
1957
|
* Draws a rule-of-thirds crop grid overlay. All rectangles come from
|
|
@@ -2030,8 +2033,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2030
2033
|
}
|
|
2031
2034
|
const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
|
|
2032
2035
|
const { crop, transform, annotations } = state;
|
|
2033
|
-
const region = crop ?
|
|
2034
|
-
const rotated =
|
|
2036
|
+
const region = crop ? _chunkO5RVCDECcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
|
|
2037
|
+
const rotated = _chunkO5RVCDECcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
2035
2038
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
2036
2039
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
2037
2040
|
const exportW = options.width || baseW;
|
|
@@ -2060,7 +2063,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2060
2063
|
const bctx = baseCanvas.getContext("2d");
|
|
2061
2064
|
if (bctx) {
|
|
2062
2065
|
bctx.save();
|
|
2063
|
-
|
|
2066
|
+
_chunkO5RVCDECcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
|
|
2064
2067
|
bctx.beginPath();
|
|
2065
2068
|
bctx.rect(region.x, region.y, region.width, region.height);
|
|
2066
2069
|
bctx.clip();
|
|
@@ -2073,7 +2076,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2073
2076
|
if (options.includeAnnotations !== false && overlay.length > 0) {
|
|
2074
2077
|
ctx.save();
|
|
2075
2078
|
ctx.scale(exportW / baseW, exportH / baseH);
|
|
2076
|
-
|
|
2079
|
+
_chunkO5RVCDECcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
|
|
2077
2080
|
for (const ann of overlay) {
|
|
2078
2081
|
await this.drawAnnotation(ctx, ann);
|
|
2079
2082
|
}
|
|
@@ -2163,7 +2166,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2163
2166
|
case "rect":
|
|
2164
2167
|
case "image":
|
|
2165
2168
|
case "text": {
|
|
2166
|
-
const b =
|
|
2169
|
+
const b = _chunkO5RVCDECcjs.getAnnotationBounds.call(void 0, ann);
|
|
2167
2170
|
ctx.fillRect(b.x, b.y, b.width, b.height);
|
|
2168
2171
|
break;
|
|
2169
2172
|
}
|
|
@@ -2183,7 +2186,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
|
|
|
2183
2186
|
function getBaseProjection(region, transform, baseW, baseH) {
|
|
2184
2187
|
return {
|
|
2185
2188
|
region,
|
|
2186
|
-
angle:
|
|
2189
|
+
angle: _chunkO5RVCDECcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
2187
2190
|
flipH: transform.flipH,
|
|
2188
2191
|
flipV: transform.flipV,
|
|
2189
2192
|
scale: 1,
|
|
@@ -2287,8 +2290,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
2287
2290
|
}
|
|
2288
2291
|
function toMask(width, height, coverage) {
|
|
2289
2292
|
const out = new Uint8Array(coverage.length);
|
|
2290
|
-
for (let i = 0; i < out.length; i++) out[i] =
|
|
2291
|
-
return
|
|
2293
|
+
for (let i = 0; i < out.length; i++) out[i] = _chunkO5RVCDECcjs.coverageToByte.call(void 0, coverage[i]);
|
|
2294
|
+
return _chunkO5RVCDECcjs.createSelectionMask.call(void 0, width, height, out);
|
|
2292
2295
|
}
|
|
2293
2296
|
function polygonSelection(width, height, points, options = {}) {
|
|
2294
2297
|
return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
|
|
@@ -2415,7 +2418,7 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2415
2418
|
const { width: w, height: h } = pixels;
|
|
2416
2419
|
const sx = Math.floor(seed.x);
|
|
2417
2420
|
const sy = Math.floor(seed.y);
|
|
2418
|
-
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return
|
|
2421
|
+
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkO5RVCDECcjs.createSelectionMask.call(void 0, w, h);
|
|
2419
2422
|
const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
|
|
2420
2423
|
const marks = new Uint8Array(n);
|
|
2421
2424
|
let bx0 = w;
|
|
@@ -2463,9 +2466,9 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2463
2466
|
}
|
|
2464
2467
|
}
|
|
2465
2468
|
}
|
|
2466
|
-
if (bx1 < 0) return
|
|
2467
|
-
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return
|
|
2468
|
-
return
|
|
2469
|
+
if (bx1 < 0) return _chunkO5RVCDECcjs.createSelectionMask.call(void 0, w, h);
|
|
2470
|
+
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkO5RVCDECcjs.createSelectionMask.call(void 0, w, h, marks);
|
|
2471
|
+
return _chunkO5RVCDECcjs.createSelectionMask.call(void 0,
|
|
2469
2472
|
w,
|
|
2470
2473
|
h,
|
|
2471
2474
|
antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
|
|
@@ -2487,7 +2490,7 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2487
2490
|
const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
|
|
2488
2491
|
const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
|
|
2489
2492
|
const out = new Uint8Array(n);
|
|
2490
|
-
if (!parsed.length) return
|
|
2493
|
+
if (!parsed.length) return _chunkO5RVCDECcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2491
2494
|
for (let i = 0; i < n; i++) {
|
|
2492
2495
|
const p = i * 4;
|
|
2493
2496
|
if (data[p + 3] <= 0) continue;
|
|
@@ -2503,9 +2506,9 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2503
2506
|
}
|
|
2504
2507
|
if (k > best) best = k;
|
|
2505
2508
|
}
|
|
2506
|
-
out[i] =
|
|
2509
|
+
out[i] = _chunkO5RVCDECcjs.coverageToByte.call(void 0, best);
|
|
2507
2510
|
}
|
|
2508
|
-
return
|
|
2511
|
+
return _chunkO5RVCDECcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2509
2512
|
}
|
|
2510
2513
|
var TONE_RANGE_PRESETS = {
|
|
2511
2514
|
shadows: [0, 65],
|
|
@@ -2523,9 +2526,9 @@ function toneRange(pixels, range, falloff = 20) {
|
|
|
2523
2526
|
if (d[p + 3] <= 0) continue;
|
|
2524
2527
|
const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
|
|
2525
2528
|
const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
|
|
2526
|
-
out[i] =
|
|
2529
|
+
out[i] = _chunkO5RVCDECcjs.coverageToByte.call(void 0, 1 - outside / ramp);
|
|
2527
2530
|
}
|
|
2528
|
-
return
|
|
2531
|
+
return _chunkO5RVCDECcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2529
2532
|
}
|
|
2530
2533
|
function hueRange(pixels, center) {
|
|
2531
2534
|
const n = checkPixels(pixels);
|
|
@@ -2548,9 +2551,9 @@ function hueRange(pixels, center) {
|
|
|
2548
2551
|
hue *= 60;
|
|
2549
2552
|
let dh = ((hue - center) % 360 + 360) % 360;
|
|
2550
2553
|
dh = Math.min(dh, 360 - dh);
|
|
2551
|
-
out[i] =
|
|
2554
|
+
out[i] = _chunkO5RVCDECcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
|
|
2552
2555
|
}
|
|
2553
|
-
return
|
|
2556
|
+
return _chunkO5RVCDECcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2554
2557
|
}
|
|
2555
2558
|
|
|
2556
2559
|
// src/image-editor/selection/refine.ts
|
|
@@ -2684,9 +2687,9 @@ function edgeWidth(guide, w, h, r) {
|
|
|
2684
2687
|
g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
|
|
2685
2688
|
}
|
|
2686
2689
|
}
|
|
2687
|
-
const gm =
|
|
2688
|
-
const hi =
|
|
2689
|
-
const lo =
|
|
2690
|
+
const gm = _chunkO5RVCDECcjs.greyMorphology.call(void 0, g, w, h, r, true);
|
|
2691
|
+
const hi = _chunkO5RVCDECcjs.greyMorphology.call(void 0, y, w, h, r, true);
|
|
2692
|
+
const lo = _chunkO5RVCDECcjs.greyMorphology.call(void 0, y, w, h, r, false);
|
|
2690
2693
|
const out = new Float32Array(n);
|
|
2691
2694
|
for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
|
|
2692
2695
|
return out;
|
|
@@ -2710,7 +2713,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2710
2713
|
}
|
|
2711
2714
|
}
|
|
2712
2715
|
if (any) {
|
|
2713
|
-
const dist =
|
|
2716
|
+
const dist = _chunkO5RVCDECcjs.distanceTransform.call(void 0, boundary, w, h);
|
|
2714
2717
|
const r = gfRadius(p);
|
|
2715
2718
|
const q = guidedFilterColor(guide, m, w, h, r);
|
|
2716
2719
|
const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
|
|
@@ -2736,7 +2739,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2736
2739
|
for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
|
|
2737
2740
|
}
|
|
2738
2741
|
const amount = shiftAmount(p);
|
|
2739
|
-
if (Math.abs(amount) >= 1e-4) a =
|
|
2742
|
+
if (Math.abs(amount) >= 1e-4) a = _chunkO5RVCDECcjs.shiftCoverage.call(void 0, a, w, h, amount);
|
|
2740
2743
|
return a;
|
|
2741
2744
|
}
|
|
2742
2745
|
function guidePlanes(pixels, win) {
|
|
@@ -2780,9 +2783,9 @@ function refineSelection(pixels, mask, params = {}) {
|
|
|
2780
2783
|
const out = new Uint8Array(mask.width * mask.height);
|
|
2781
2784
|
for (let y = 0; y < wh; y++) {
|
|
2782
2785
|
const dst = (y0 + y) * mask.width + x0;
|
|
2783
|
-
for (let x = 0; x < ww; x++) out[dst + x] =
|
|
2786
|
+
for (let x = 0; x < ww; x++) out[dst + x] = _chunkO5RVCDECcjs.coverageToByte.call(void 0, refined[y * ww + x]);
|
|
2784
2787
|
}
|
|
2785
|
-
return
|
|
2788
|
+
return _chunkO5RVCDECcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
|
|
2786
2789
|
}
|
|
2787
2790
|
|
|
2788
2791
|
// src/image-editor/effects.ts
|
|
@@ -2832,15 +2835,16 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
2832
2835
|
__init26() {this.cache = /* @__PURE__ */ new Map()}
|
|
2833
2836
|
__init27() {this.pending = /* @__PURE__ */ new Map()}
|
|
2834
2837
|
__init28() {this.failures = /* @__PURE__ */ new Map()}
|
|
2835
|
-
__init29() {this.renderers = /* @__PURE__ */ new Map()}
|
|
2836
|
-
__init30() {this.descriptions = /* @__PURE__ */ new Map()}
|
|
2837
|
-
__init31() {this.listeners = /* @__PURE__ */ new Set()}
|
|
2838
2838
|
|
|
2839
|
-
|
|
2839
|
+
__init29() {this.descriptions = /* @__PURE__ */ new Map()}
|
|
2840
|
+
__init30() {this.listeners = /* @__PURE__ */ new Set()}
|
|
2841
|
+
|
|
2842
|
+
__init31() {this.generation = 0}
|
|
2840
2843
|
|
|
2841
|
-
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);
|
|
2844
|
+
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);
|
|
2842
2845
|
this.slot = _nullishCoalesce(options.slot, () => ( new (0, _chunkIOXKXQNWcjs.EffectsSlot)()));
|
|
2843
2846
|
this.maxEntries = _nullishCoalesce(options.maxEntries, () => ( 24));
|
|
2847
|
+
this.pool = new (0, _chunkW6QTLHZ3cjs.EffectRendererPool)({ maxRenderers: options.maxRenderers });
|
|
2844
2848
|
this.detach = this.slot.subscribe(() => {
|
|
2845
2849
|
this.reset();
|
|
2846
2850
|
this.notify();
|
|
@@ -2923,18 +2927,7 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
2923
2927
|
return d;
|
|
2924
2928
|
}
|
|
2925
2929
|
render(provider, id, width, height, depth, request) {
|
|
2926
|
-
|
|
2927
|
-
let r = this.renderers.get(k);
|
|
2928
|
-
if (!r) {
|
|
2929
|
-
const renderer = Promise.resolve().then(() => provider.createRenderer(id, { width, height, depth }));
|
|
2930
|
-
renderer.catch(() => this.renderers.delete(k));
|
|
2931
|
-
r = { renderer, queue: Promise.resolve() };
|
|
2932
|
-
this.renderers.set(k, r);
|
|
2933
|
-
}
|
|
2934
|
-
const entry = r;
|
|
2935
|
-
const next = entry.queue.then(() => entry.renderer).then((renderer) => renderer.render(request));
|
|
2936
|
-
entry.queue = next.catch(() => void 0);
|
|
2937
|
-
return next;
|
|
2930
|
+
return this.pool.render(provider, id, { width, height, depth }, request);
|
|
2938
2931
|
}
|
|
2939
2932
|
/** Forgets every result and failure and disposes the renderers. */
|
|
2940
2933
|
reset() {
|
|
@@ -2943,9 +2936,7 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
2943
2936
|
this.pending.clear();
|
|
2944
2937
|
this.failures.clear();
|
|
2945
2938
|
this.descriptions.clear();
|
|
2946
|
-
|
|
2947
|
-
});
|
|
2948
|
-
this.renderers.clear();
|
|
2939
|
+
this.pool.clear();
|
|
2949
2940
|
}
|
|
2950
2941
|
subscribe(listener) {
|
|
2951
2942
|
this.listeners.add(listener);
|
|
@@ -2964,7 +2955,7 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
2964
2955
|
// src/image-editor/free-transform.ts
|
|
2965
2956
|
var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
|
|
2966
2957
|
var fail = (message) => {
|
|
2967
|
-
throw new (0,
|
|
2958
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(message);
|
|
2968
2959
|
};
|
|
2969
2960
|
var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
|
|
2970
2961
|
function previewStep(scale) {
|
|
@@ -3042,7 +3033,7 @@ function liftMask(mask, sel, o) {
|
|
|
3042
3033
|
return { lifted: _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width: area.width, height: area.height, data: lifted }, 4, area.x, area.y), rest: _chunkJ5BA3BQ6cjs.writeRegion.call(void 0, mask, area, rest) };
|
|
3043
3034
|
}
|
|
3044
3035
|
var FreeTransformSession = (_class5 = class {
|
|
3045
|
-
constructor(host, init = {}) {;_class5.prototype.__init33.call(this);_class5.prototype.__init34.call(this);_class5.prototype.__init35.call(this);_class5.prototype.__init36.call(this);_class5.prototype.__init37.call(this);_class5.prototype.__init38.call(this);_class5.prototype.__init39.call(this);_class5.prototype.__init40.call(this);_class5.prototype.__init41.call(this);_class5.prototype.__init42.call(this);
|
|
3036
|
+
constructor(host, init = {}) {;_class5.prototype.__init32.call(this);_class5.prototype.__init33.call(this);_class5.prototype.__init34.call(this);_class5.prototype.__init35.call(this);_class5.prototype.__init36.call(this);_class5.prototype.__init37.call(this);_class5.prototype.__init38.call(this);_class5.prototype.__init39.call(this);_class5.prototype.__init40.call(this);_class5.prototype.__init41.call(this);_class5.prototype.__init42.call(this);
|
|
3046
3037
|
this.host = host;
|
|
3047
3038
|
if (init.interpolation !== void 0 && !_chunkMZXQTKUMcjs.isInterpolation.call(void 0, init.interpolation)) fail(`Unknown interpolation "${String(init.interpolation)}"; use nearest, bilinear or bicubic.`);
|
|
3048
3039
|
this.interp = _nullishCoalesce(init.interpolation, () => ( "bicubic"));
|
|
@@ -3073,7 +3064,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3073
3064
|
} else {
|
|
3074
3065
|
const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
|
|
3075
3066
|
if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
|
|
3076
|
-
const layer =
|
|
3067
|
+
const layer = _chunkO5RVCDECcjs.requireLayer.call(void 0, layers, id).layer;
|
|
3077
3068
|
this.layerId = layer.id;
|
|
3078
3069
|
const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
|
|
3079
3070
|
const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
|
|
@@ -3084,20 +3075,20 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3084
3075
|
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.`);
|
|
3085
3076
|
if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
|
|
3086
3077
|
if (content !== "selection-copy") {
|
|
3087
|
-
|
|
3088
|
-
if (!maskAlone)
|
|
3078
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
|
|
3079
|
+
if (!maskAlone) _chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
|
|
3089
3080
|
}
|
|
3090
3081
|
const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
3091
3082
|
const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
|
|
3092
3083
|
if (layer.type === "smart" && !maskAlone) {
|
|
3093
3084
|
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).`);
|
|
3094
|
-
if (!
|
|
3085
|
+
if (!_chunkO5RVCDECcjs.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.`);
|
|
3095
3086
|
this.smart = layer;
|
|
3096
3087
|
this.smartObject = true;
|
|
3097
|
-
this.startGeometry =
|
|
3088
|
+
this.startGeometry = _chunkO5RVCDECcjs.placementGeometry.call(void 0, layer);
|
|
3098
3089
|
if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
|
|
3099
3090
|
this.startInterp = this.interp;
|
|
3100
|
-
this.box =
|
|
3091
|
+
this.box = _chunkO5RVCDECcjs.contentsBox.call(void 0, layer.contents);
|
|
3101
3092
|
this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
|
|
3102
3093
|
this.geometryValue = this.startGeometry;
|
|
3103
3094
|
this.shown = this.startLayers;
|
|
@@ -3105,8 +3096,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3105
3096
|
}
|
|
3106
3097
|
if (layer.type === "type" && !maskAlone) {
|
|
3107
3098
|
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).`);
|
|
3108
|
-
const frame =
|
|
3109
|
-
const m =
|
|
3099
|
+
const frame = _chunkO5RVCDECcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
|
|
3100
|
+
const m = _chunkO5RVCDECcjs.textMatrix.call(void 0, layer);
|
|
3110
3101
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
3111
3102
|
this.typeTarget = layer;
|
|
3112
3103
|
this.typeLayer = true;
|
|
@@ -3125,7 +3116,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3125
3116
|
}
|
|
3126
3117
|
if (layer.type === "shape" && !maskAlone) {
|
|
3127
3118
|
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).`);
|
|
3128
|
-
const g =
|
|
3119
|
+
const g = _chunkO5RVCDECcjs.shapeGeometryBounds.call(void 0, layer);
|
|
3129
3120
|
if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
|
|
3130
3121
|
const w = Math.max(g.width, 1);
|
|
3131
3122
|
const h = Math.max(g.height, 1);
|
|
@@ -3173,7 +3164,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3173
3164
|
if (box) {
|
|
3174
3165
|
const copy = {
|
|
3175
3166
|
type: "pixel",
|
|
3176
|
-
id:
|
|
3167
|
+
id: _chunkO5RVCDECcjs.newLayerId.call(void 0, ),
|
|
3177
3168
|
name: `${layer.name || "Layer"} copy`,
|
|
3178
3169
|
visible: true,
|
|
3179
3170
|
opacity: 1,
|
|
@@ -3197,7 +3188,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3197
3188
|
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).");
|
|
3198
3189
|
this.box = box;
|
|
3199
3190
|
this.moves = moves;
|
|
3200
|
-
this.startGeometry =
|
|
3191
|
+
this.startGeometry = _chunkO5RVCDECcjs.identityTransform.call(void 0, box);
|
|
3201
3192
|
this.startInterp = this.interp;
|
|
3202
3193
|
this.geometryValue = this.startGeometry;
|
|
3203
3194
|
this.shown = this.startLayers;
|
|
@@ -3209,7 +3200,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3209
3200
|
/** The layer being transformed (`null` for `selection-outline`). */
|
|
3210
3201
|
|
|
3211
3202
|
/** The new layer of a `selection-copy`. */
|
|
3212
|
-
|
|
3203
|
+
__init32() {this.copyId = null}
|
|
3213
3204
|
/** The frame (document pixels). */
|
|
3214
3205
|
|
|
3215
3206
|
/** What moves. */
|
|
@@ -3221,27 +3212,27 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3221
3212
|
*/
|
|
3222
3213
|
|
|
3223
3214
|
/** True when the layer is a smart object (the transform sets its placement). */
|
|
3224
|
-
|
|
3215
|
+
__init33() {this.smartObject = false}
|
|
3225
3216
|
/** True when the layer is a shape layer (the transform maps its paths and renders them again). */
|
|
3226
|
-
|
|
3227
|
-
|
|
3217
|
+
__init34() {this.shapeLayer = false}
|
|
3218
|
+
__init35() {this.shape = null}
|
|
3228
3219
|
/** True when the layer is a type layer (the transform sets its text matrix; affine only). */
|
|
3229
|
-
|
|
3230
|
-
|
|
3220
|
+
__init36() {this.typeLayer = false}
|
|
3221
|
+
__init37() {this.typeTarget = null}
|
|
3231
3222
|
|
|
3232
|
-
|
|
3233
|
-
|
|
3223
|
+
__init38() {this.smart = null}
|
|
3224
|
+
__init39() {this.smartReduced = /* @__PURE__ */ new Map()}
|
|
3234
3225
|
|
|
3235
|
-
|
|
3226
|
+
__init40() {this.smartMasksMoved = false}
|
|
3236
3227
|
|
|
3237
|
-
|
|
3228
|
+
__init41() {this.parts = []}
|
|
3238
3229
|
|
|
3239
3230
|
|
|
3240
3231
|
|
|
3241
3232
|
|
|
3242
3233
|
/** The stack this session last showed: anything else means the document changed under it. */
|
|
3243
3234
|
|
|
3244
|
-
|
|
3235
|
+
__init42() {this.closed = false}
|
|
3245
3236
|
/** The current geometry. */
|
|
3246
3237
|
get geometry() {
|
|
3247
3238
|
return this.geometryValue;
|
|
@@ -3275,8 +3266,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3275
3266
|
warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
|
|
3276
3267
|
};
|
|
3277
3268
|
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.");
|
|
3278
|
-
if (!
|
|
3279
|
-
if (this.typeTarget && (
|
|
3269
|
+
if (!_chunkO5RVCDECcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
|
|
3270
|
+
if (this.typeTarget && (_chunkO5RVCDECcjs.hasWarp.call(void 0, next) || !_chunkO5RVCDECcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
|
|
3280
3271
|
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.");
|
|
3281
3272
|
}
|
|
3282
3273
|
this.geometryValue = next;
|
|
@@ -3288,10 +3279,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3288
3279
|
if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
|
|
3289
3280
|
if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
|
|
3290
3281
|
const g = this.geometryValue;
|
|
3291
|
-
const identity =
|
|
3292
|
-
const warp =
|
|
3293
|
-
const h = warp ? null :
|
|
3294
|
-
const f = warp ?
|
|
3282
|
+
const identity = _chunkO5RVCDECcjs.isIdentityTransform.call(void 0, g);
|
|
3283
|
+
const warp = _chunkO5RVCDECcjs.hasWarp.call(void 0, g);
|
|
3284
|
+
const h = warp ? null : _chunkO5RVCDECcjs.geometryHomography.call(void 0, g);
|
|
3285
|
+
const f = warp ? _chunkO5RVCDECcjs.transformMap.call(void 0, g) : null;
|
|
3295
3286
|
const step = final ? 1 : previewStep(preview.scale);
|
|
3296
3287
|
const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
|
|
3297
3288
|
let layers = this.startLayers;
|
|
@@ -3335,7 +3326,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3335
3326
|
if (part.what === "selection") {
|
|
3336
3327
|
const { width, height } = this.host.canvas();
|
|
3337
3328
|
const data = new Uint8Array(_chunkJ5BA3BQ6cjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
|
|
3338
|
-
const next =
|
|
3329
|
+
const next = _chunkO5RVCDECcjs.createSelectionMask.call(void 0, width, height, data);
|
|
3339
3330
|
selection = next.bounds ? next : null;
|
|
3340
3331
|
} else if (part.what === "pixels") {
|
|
3341
3332
|
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, targetId, (l) => {
|
|
@@ -3357,14 +3348,14 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3357
3348
|
resampleShape(final, preview, warpMap, h) {
|
|
3358
3349
|
const layer = this.shape;
|
|
3359
3350
|
let components = layer.components;
|
|
3360
|
-
if (!
|
|
3351
|
+
if (!_chunkO5RVCDECcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
|
|
3361
3352
|
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;
|
|
3362
3353
|
const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p)));
|
|
3363
|
-
components =
|
|
3354
|
+
components = _chunkO5RVCDECcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
|
|
3364
3355
|
}
|
|
3365
3356
|
const moved = { ...layer, components };
|
|
3366
3357
|
delete moved.annotation;
|
|
3367
|
-
const surface =
|
|
3358
|
+
const surface = _chunkO5RVCDECcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
|
|
3368
3359
|
return _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
|
|
3369
3360
|
}
|
|
3370
3361
|
/**
|
|
@@ -3374,13 +3365,13 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3374
3365
|
resampleType() {
|
|
3375
3366
|
const layer = this.typeTarget;
|
|
3376
3367
|
const g = this.geometryValue;
|
|
3377
|
-
if (
|
|
3378
|
-
const m =
|
|
3368
|
+
if (_chunkO5RVCDECcjs.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.");
|
|
3369
|
+
const m = _chunkO5RVCDECcjs.matrixFromCorners.call(void 0, g.box, g.corners);
|
|
3379
3370
|
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.");
|
|
3380
3371
|
const next = { ...layer, transform: m };
|
|
3381
3372
|
delete next.annotation;
|
|
3382
|
-
let layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, () =>
|
|
3383
|
-
const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0,
|
|
3373
|
+
let layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkO5RVCDECcjs.rerenderText.call(void 0, next, this.host.textEnv()));
|
|
3374
|
+
const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkQQKTOA4Ucjs.invertMatrix.call(void 0, _chunkO5RVCDECcjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
|
|
3384
3375
|
for (const part of this.parts) {
|
|
3385
3376
|
if (part.what !== "mask") continue;
|
|
3386
3377
|
const surface = _chunkMZXQTKUMcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
|
|
@@ -3396,12 +3387,12 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3396
3387
|
const canvas = this.host.canvas();
|
|
3397
3388
|
try {
|
|
3398
3389
|
if (final) {
|
|
3399
|
-
const res =
|
|
3390
|
+
const res = _chunkO5RVCDECcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
|
|
3400
3391
|
this.smartMasksMoved = res.masksMoved;
|
|
3401
3392
|
return res.layers;
|
|
3402
3393
|
}
|
|
3403
3394
|
const step = previewStep(preview.scale);
|
|
3404
|
-
const surface =
|
|
3395
|
+
const surface = _chunkO5RVCDECcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
|
|
3405
3396
|
return _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
|
|
3406
3397
|
} catch (e) {
|
|
3407
3398
|
if (e instanceof _chunkMZXQTKUMcjs.TransformTooLargeError) fail(e.message);
|
|
@@ -3411,10 +3402,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3411
3402
|
/** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
|
|
3412
3403
|
isChanged() {
|
|
3413
3404
|
const g = this.geometryValue;
|
|
3414
|
-
if (!this.smart && !this.typeTarget) return !
|
|
3405
|
+
if (!this.smart && !this.typeTarget) return !_chunkO5RVCDECcjs.isIdentityTransform.call(void 0, g);
|
|
3415
3406
|
const a = this.startGeometry;
|
|
3416
3407
|
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);
|
|
3417
|
-
const warp = (w, box) => w &&
|
|
3408
|
+
const warp = (w, box) => w && _chunkO5RVCDECcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
|
|
3418
3409
|
return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
|
|
3419
3410
|
}
|
|
3420
3411
|
render(preview) {
|
|
@@ -3637,7 +3628,7 @@ function convertSurfaceColors(surface, t) {
|
|
|
3637
3628
|
}
|
|
3638
3629
|
|
|
3639
3630
|
// src/image-editor/controller.ts
|
|
3640
|
-
var IMAGE_EDITOR_SCHEMA_VERSION =
|
|
3631
|
+
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkO5RVCDECcjs.LAYERED_SCHEMA_VERSION;
|
|
3641
3632
|
var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge"];
|
|
3642
3633
|
var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
|
|
3643
3634
|
var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
|
|
@@ -3672,7 +3663,7 @@ function defaultTile(s) {
|
|
|
3672
3663
|
return d;
|
|
3673
3664
|
}
|
|
3674
3665
|
var PaintStrokeSession = (_class6 = class {
|
|
3675
|
-
constructor(controller, target, stroke, apply, depth = null) {;_class6.prototype.__init44.call(this);_class6.prototype.__init45.call(this);_class6.prototype.__init46.call(this);_class6.prototype.__init47.call(this);_class6.prototype.__init48.call(this);_class6.prototype.__init49.call(this);_class6.prototype.__init50.call(this);_class6.prototype.__init51.call(this);_class6.prototype.__init52.call(this);_class6.prototype.__init53.call(this);
|
|
3666
|
+
constructor(controller, target, stroke, apply, depth = null) {;_class6.prototype.__init43.call(this);_class6.prototype.__init44.call(this);_class6.prototype.__init45.call(this);_class6.prototype.__init46.call(this);_class6.prototype.__init47.call(this);_class6.prototype.__init48.call(this);_class6.prototype.__init49.call(this);_class6.prototype.__init50.call(this);_class6.prototype.__init51.call(this);_class6.prototype.__init52.call(this);_class6.prototype.__init53.call(this);
|
|
3676
3667
|
this.controller = controller;
|
|
3677
3668
|
this.target = target;
|
|
3678
3669
|
this.apply = apply;
|
|
@@ -3709,28 +3700,28 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3709
3700
|
|
|
3710
3701
|
|
|
3711
3702
|
|
|
3712
|
-
|
|
3703
|
+
__init43() {this.touched = /* @__PURE__ */ new Set()}
|
|
3713
3704
|
|
|
3714
3705
|
|
|
3715
|
-
|
|
3716
|
-
|
|
3706
|
+
__init44() {this.mixerInit = null}
|
|
3707
|
+
__init45() {this.retouch = null}
|
|
3717
3708
|
/** Writes a mask's RGBA view back (sequential retouching on a mask). */
|
|
3718
|
-
|
|
3719
|
-
|
|
3709
|
+
__init46() {this.flushView = null}
|
|
3710
|
+
__init47() {this.started = false}
|
|
3720
3711
|
/** Mixer tiles written since the last update: they get new tile objects so the compositor sees them change. */
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3712
|
+
__init48() {this.fresh = /* @__PURE__ */ new Set()}
|
|
3713
|
+
__init49() {this.last = null}
|
|
3714
|
+
__init50() {this.closed = false}
|
|
3724
3715
|
/** Brush and eraser strokes on a 16- or 32-bit document: the deep samples of each touched tile. */
|
|
3725
3716
|
|
|
3726
|
-
|
|
3717
|
+
__init51() {this.liveDeep = /* @__PURE__ */ new Map()}
|
|
3727
3718
|
/**
|
|
3728
3719
|
* Mixer Brush, Smudge and Sponge on a 16- or 32-bit layer: they read and write float working
|
|
3729
3720
|
* tiles on the 8-bit 0..255 sRGB-encoded scale, which keep the fractions bytes would round away.
|
|
3730
3721
|
*/
|
|
3731
3722
|
|
|
3732
|
-
|
|
3733
|
-
|
|
3723
|
+
__init52() {this.work = /* @__PURE__ */ new Map()}
|
|
3724
|
+
__init53() {this.workRead = /* @__PURE__ */ new Map()}
|
|
3734
3725
|
/** The pre-stroke tile as a float working tile (cached; `null`: transparent). */
|
|
3735
3726
|
readWork(key) {
|
|
3736
3727
|
if (!this.workRead.has(key)) this.workRead.set(key, workTileOf(this.base.tiles.get(key)));
|
|
@@ -3831,7 +3822,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3831
3822
|
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 })) {
|
|
3832
3823
|
const key = _chunkJ5BA3BQ6cjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3833
3824
|
const cur = regions.get(key);
|
|
3834
|
-
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ?
|
|
3825
|
+
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkO5RVCDECcjs.unionRect.call(void 0, cur.r, r) : r });
|
|
3835
3826
|
}
|
|
3836
3827
|
}
|
|
3837
3828
|
for (const [key, { tx, ty, r }] of regions) {
|
|
@@ -3863,7 +3854,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3863
3854
|
}
|
|
3864
3855
|
/** Finishes the stroke (one undo step) and returns what changed. */
|
|
3865
3856
|
end() {
|
|
3866
|
-
if (this.closed) throw new (0,
|
|
3857
|
+
if (this.closed) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("This stroke has already ended.");
|
|
3867
3858
|
const last = _nullishCoalesce(this.last, () => ( void 0));
|
|
3868
3859
|
const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
|
|
3869
3860
|
_optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
|
|
@@ -3987,20 +3978,20 @@ function sameTile(a, b) {
|
|
|
3987
3978
|
for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
|
|
3988
3979
|
return true;
|
|
3989
3980
|
}
|
|
3990
|
-
var DEFAULT_ADJUSTMENTS =
|
|
3981
|
+
var DEFAULT_ADJUSTMENTS = _chunkO5RVCDECcjs.DEFAULT_ADJUSTMENTS_VALUES;
|
|
3991
3982
|
function normalizeStoredAdjustments(stored) {
|
|
3992
3983
|
if (!stored) return { ...DEFAULT_ADJUSTMENTS };
|
|
3993
3984
|
const out = {
|
|
3994
3985
|
...DEFAULT_ADJUSTMENTS,
|
|
3995
3986
|
...stored,
|
|
3996
|
-
process:
|
|
3987
|
+
process: _chunkO5RVCDECcjs.normalizeProcessVersion.call(void 0, stored.process)
|
|
3997
3988
|
};
|
|
3998
|
-
const layers =
|
|
3989
|
+
const layers = _chunkO5RVCDECcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
|
|
3999
3990
|
if (layers.length) out.layers = layers;
|
|
4000
3991
|
else delete out.layers;
|
|
4001
3992
|
return out;
|
|
4002
3993
|
}
|
|
4003
|
-
var isLayered = (data) => Boolean(data && data.version ===
|
|
3994
|
+
var isLayered = (data) => Boolean(data && data.version === _chunkO5RVCDECcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
|
|
4004
3995
|
function migrateSerializedImageEditorState(data) {
|
|
4005
3996
|
if (isLayered(data)) {
|
|
4006
3997
|
const out = {
|
|
@@ -4032,10 +4023,10 @@ function migrateSerializedImageEditorState(data) {
|
|
|
4032
4023
|
function migrateToLayeredState(data, size) {
|
|
4033
4024
|
const clean = migrateSerializedImageEditorState(data);
|
|
4034
4025
|
if (isLayered(clean)) return clean;
|
|
4035
|
-
const stack =
|
|
4036
|
-
const { layers, assets } =
|
|
4026
|
+
const stack = _chunkO5RVCDECcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
|
|
4027
|
+
const { layers, assets } = _chunkO5RVCDECcjs.serializeLayers.call(void 0, stack.layers);
|
|
4037
4028
|
const out = {
|
|
4038
|
-
version:
|
|
4029
|
+
version: _chunkO5RVCDECcjs.LAYERED_SCHEMA_VERSION,
|
|
4039
4030
|
width: Math.round(size.width),
|
|
4040
4031
|
height: Math.round(size.height),
|
|
4041
4032
|
layers,
|
|
@@ -4049,37 +4040,37 @@ function migrateToLayeredState(data, size) {
|
|
|
4049
4040
|
if (clean.selection) out.selection = clean.selection;
|
|
4050
4041
|
return out;
|
|
4051
4042
|
}
|
|
4052
|
-
var DEFAULT_TRANSFORM =
|
|
4053
|
-
var DEFAULT_DEPTH_MASK =
|
|
4043
|
+
var DEFAULT_TRANSFORM = _chunkO5RVCDECcjs.DEFAULT_TRANSFORM_VALUES;
|
|
4044
|
+
var DEFAULT_DEPTH_MASK = _chunkO5RVCDECcjs.DEFAULT_DEPTH_MASK_VALUES;
|
|
4054
4045
|
var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
|
|
4055
4046
|
var ImageEditorController = (_class7 = class {
|
|
4056
4047
|
|
|
4057
4048
|
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4049
|
+
__init54() {this.imageElement = null}
|
|
4050
|
+
__init55() {this.listeners = /* @__PURE__ */ new Set()}
|
|
4051
|
+
__init56() {this.histogramListeners = /* @__PURE__ */ new Set()}
|
|
4061
4052
|
|
|
4062
4053
|
// History stacks
|
|
4063
|
-
|
|
4064
|
-
|
|
4054
|
+
__init57() {this.undoStack = []}
|
|
4055
|
+
__init58() {this.redoStack = []}
|
|
4065
4056
|
|
|
4066
4057
|
|
|
4067
|
-
|
|
4058
|
+
__init59() {this.isApplyingHistory = false}
|
|
4068
4059
|
|
|
4069
4060
|
/** Pixels the selection tools sample (host-provided or read back from the source). */
|
|
4070
|
-
|
|
4071
|
-
|
|
4061
|
+
__init60() {this.samplePixels = null}
|
|
4062
|
+
__init61() {this.samplePixelsOverride = false}
|
|
4072
4063
|
/** Decoded source pixels (the Background's surface), by the buffer or element they came from. */
|
|
4073
|
-
|
|
4074
|
-
|
|
4064
|
+
__init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
|
|
4065
|
+
__init63() {this.viewKey = []}
|
|
4075
4066
|
/** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
|
|
4076
|
-
|
|
4067
|
+
__init64() {this.compositor = new (0, _chunkO5RVCDECcjs.LayerCompositor)()}
|
|
4077
4068
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
4078
|
-
|
|
4069
|
+
__init65() {this.effects = new (0, _chunkIOXKXQNWcjs.EffectsSlot)()}
|
|
4079
4070
|
/** Renders provider effects: effect smart filter results and effect layers. */
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
constructor(options = {}) {;_class7.prototype.__init55.call(this);_class7.prototype.__init56.call(this);_class7.prototype.__init57.call(this);_class7.prototype.__init58.call(this);_class7.prototype.__init59.call(this);_class7.prototype.__init60.call(this);_class7.prototype.__init61.call(this);_class7.prototype.__init62.call(this);_class7.prototype.__init63.call(this);_class7.prototype.__init64.call(this);_class7.prototype.__init65.call(this);_class7.prototype.__init66.call(this);_class7.prototype.__init67.call(this);_class7.prototype.__init68.call(this);_class7.prototype.__init69.call(this);_class7.prototype.__init70.call(this);_class7.prototype.__init71.call(this);_class7.prototype.__init72.call(this);_class7.prototype.__init73.call(this);_class7.prototype.__init74.call(this);_class7.prototype.__init75.call(this);_class7.prototype.__init76.call(this);_class7.prototype.__init77.call(this);_class7.prototype.__init78.call(this);_class7.prototype.__init79.call(this);
|
|
4071
|
+
__init66() {this.effectsEngine = new ImageEffectsEngine({ slot: this.effects })}
|
|
4072
|
+
__init67() {this.effectRefresh = "none"}
|
|
4073
|
+
constructor(options = {}) {;_class7.prototype.__init54.call(this);_class7.prototype.__init55.call(this);_class7.prototype.__init56.call(this);_class7.prototype.__init57.call(this);_class7.prototype.__init58.call(this);_class7.prototype.__init59.call(this);_class7.prototype.__init60.call(this);_class7.prototype.__init61.call(this);_class7.prototype.__init62.call(this);_class7.prototype.__init63.call(this);_class7.prototype.__init64.call(this);_class7.prototype.__init65.call(this);_class7.prototype.__init66.call(this);_class7.prototype.__init67.call(this);_class7.prototype.__init68.call(this);_class7.prototype.__init69.call(this);_class7.prototype.__init70.call(this);_class7.prototype.__init71.call(this);_class7.prototype.__init72.call(this);_class7.prototype.__init73.call(this);_class7.prototype.__init74.call(this);_class7.prototype.__init75.call(this);_class7.prototype.__init76.call(this);_class7.prototype.__init77.call(this);_class7.prototype.__init78.call(this);_class7.prototype.__init79.call(this);
|
|
4083
4074
|
this.effects.subscribe(() => this.queueEffectRefresh("all"));
|
|
4084
4075
|
this.effectsEngine.subscribe(() => this.queueEffectRefresh("incomplete"));
|
|
4085
4076
|
if (options.effects) this.effects.set(options.effects);
|
|
@@ -4131,7 +4122,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4131
4122
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
4132
4123
|
if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
|
|
4133
4124
|
try {
|
|
4134
|
-
this.state.selection = normalizeSelection(
|
|
4125
|
+
this.state.selection = normalizeSelection(_chunkO5RVCDECcjs.deserializeSelection.call(void 0, options.initialState.selection));
|
|
4135
4126
|
} catch (e14) {
|
|
4136
4127
|
}
|
|
4137
4128
|
}
|
|
@@ -4207,7 +4198,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4207
4198
|
* Where layer pixels changed since the last viewport render, when only strokes changed them
|
|
4208
4199
|
* (the renderer then recomposites just those rectangles); `'all'` after any other change.
|
|
4209
4200
|
*/
|
|
4210
|
-
|
|
4201
|
+
__init68() {this.pendingDirty = "all"}
|
|
4211
4202
|
notify(strokeRects) {
|
|
4212
4203
|
if (strokeRects && this.pendingDirty !== "all") this.pendingDirty.push(...strokeRects);
|
|
4213
4204
|
else if (!strokeRects) this.pendingDirty = "all";
|
|
@@ -4243,10 +4234,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
4243
4234
|
if (l.type === "group") {
|
|
4244
4235
|
const children = walk(l.children);
|
|
4245
4236
|
if (children !== l.children) next2 = { ...l, children };
|
|
4246
|
-
} 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 ||
|
|
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 || _chunkO5RVCDECcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
|
|
4247
4238
|
try {
|
|
4248
|
-
const r =
|
|
4249
|
-
if (all || !
|
|
4239
|
+
const r = _chunkO5RVCDECcjs.rerender.call(void 0, l, canvas);
|
|
4240
|
+
if (all || !_chunkO5RVCDECcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
|
|
4250
4241
|
} catch (e16) {
|
|
4251
4242
|
}
|
|
4252
4243
|
}
|
|
@@ -4302,19 +4293,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4302
4293
|
const d = await this.describeEffect(effect, "filter");
|
|
4303
4294
|
const values = _chunkIOXKXQNWcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4304
4295
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4305
|
-
if (!found) throw new (0,
|
|
4296
|
+
if (!found) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
|
|
4306
4297
|
let layers = this.state.layers;
|
|
4307
4298
|
let id = layerId;
|
|
4308
4299
|
let converted = false;
|
|
4309
4300
|
if (found.layer.type !== "smart") {
|
|
4310
|
-
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0,
|
|
4311
|
-
const res2 =
|
|
4301
|
+
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkO5RVCDECcjs.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.`);
|
|
4302
|
+
const res2 = _chunkO5RVCDECcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
|
|
4312
4303
|
layers = res2.layers;
|
|
4313
4304
|
id = res2.layer.id;
|
|
4314
4305
|
converted = true;
|
|
4315
4306
|
}
|
|
4316
|
-
const filter =
|
|
4317
|
-
const res =
|
|
4307
|
+
const filter = _chunkO5RVCDECcjs.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 });
|
|
4308
|
+
const res = _chunkO5RVCDECcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
|
|
4318
4309
|
this.commitLayers(res.layers);
|
|
4319
4310
|
return { layerId: id, filter: res.filter, converted };
|
|
4320
4311
|
}
|
|
@@ -4325,9 +4316,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4325
4316
|
* false, during a drag).
|
|
4326
4317
|
*/
|
|
4327
4318
|
async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
|
|
4328
|
-
const layer =
|
|
4319
|
+
const layer = _chunkO5RVCDECcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
|
|
4329
4320
|
const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
|
|
4330
|
-
if (!was || was.kind !== "effect") throw new (0,
|
|
4321
|
+
if (!was || was.kind !== "effect") throw new (0, _chunkO5RVCDECcjs.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"}.`);
|
|
4331
4322
|
const update = {};
|
|
4332
4323
|
if (changes.values) {
|
|
4333
4324
|
const d = await this.describeEffect(was.effect);
|
|
@@ -4336,15 +4327,15 @@ var ImageEditorController = (_class7 = class {
|
|
|
4336
4327
|
for (const [k, v] of Object.entries(changes.values)) {
|
|
4337
4328
|
if (v !== null) given[k] = v;
|
|
4338
4329
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4339
|
-
else throw new (0,
|
|
4330
|
+
else throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4340
4331
|
}
|
|
4341
4332
|
update.values = { ...base, ..._chunkIOXKXQNWcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4342
4333
|
}
|
|
4343
4334
|
for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
|
|
4344
|
-
let res =
|
|
4345
|
-
if (changes.index !== void 0) res = { ...res, layers:
|
|
4335
|
+
let res = _chunkO5RVCDECcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
|
|
4336
|
+
if (changes.index !== void 0) res = { ...res, layers: _chunkO5RVCDECcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
|
|
4346
4337
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4347
|
-
return
|
|
4338
|
+
return _chunkO5RVCDECcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
|
|
4348
4339
|
}
|
|
4349
4340
|
/**
|
|
4350
4341
|
* Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
|
|
@@ -4356,12 +4347,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4356
4347
|
const values = _chunkIOXKXQNWcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4357
4348
|
const { width, height } = this.naturalSize;
|
|
4358
4349
|
const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
|
|
4359
|
-
const blend =
|
|
4360
|
-
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0,
|
|
4350
|
+
const blend = _chunkO5RVCDECcjs.parseBlend.call(void 0, options.blend);
|
|
4351
|
+
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4361
4352
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4362
4353
|
const layer = {
|
|
4363
4354
|
type: "pixel",
|
|
4364
|
-
id: options.id && !ids.has(options.id) ? options.id :
|
|
4355
|
+
id: options.id && !ids.has(options.id) ? options.id : _chunkO5RVCDECcjs.newLayerId.call(void 0, ),
|
|
4365
4356
|
name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
|
|
4366
4357
|
visible: true,
|
|
4367
4358
|
opacity: _nullishCoalesce(options.opacity, () => ( 1)),
|
|
@@ -4370,7 +4361,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4370
4361
|
offset: { x: 0, y: 0 },
|
|
4371
4362
|
generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
|
|
4372
4363
|
};
|
|
4373
|
-
const next =
|
|
4364
|
+
const next = _chunkO5RVCDECcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
|
|
4374
4365
|
this.commitLayers(next, () => {
|
|
4375
4366
|
this.state.activeLayerId = layer.id;
|
|
4376
4367
|
this.state.activeTarget = "pixels";
|
|
@@ -4385,8 +4376,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
4385
4376
|
async updateEffectLayer(layerId, changes, commitToHistory = true) {
|
|
4386
4377
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4387
4378
|
const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
|
|
4388
|
-
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0,
|
|
4389
|
-
|
|
4379
|
+
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
|
|
4380
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
|
|
4390
4381
|
const g = layer.generator;
|
|
4391
4382
|
const d = await this.describeEffect(g.effect);
|
|
4392
4383
|
const base = { ...g.values };
|
|
@@ -4394,7 +4385,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4394
4385
|
for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
|
|
4395
4386
|
if (v !== null) given[k] = v;
|
|
4396
4387
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4397
|
-
else throw new (0,
|
|
4388
|
+
else throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4398
4389
|
}
|
|
4399
4390
|
const values = { ...base, ..._chunkIOXKXQNWcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4400
4391
|
const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
|
|
@@ -4409,7 +4400,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4409
4400
|
/** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
|
|
4410
4401
|
rasterizeEffectLayer(layerId) {
|
|
4411
4402
|
const found = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4412
|
-
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0,
|
|
4403
|
+
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
|
|
4413
4404
|
this.commitLayers(
|
|
4414
4405
|
_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
|
|
4415
4406
|
const { generator: _g, ...rest } = l;
|
|
@@ -4417,7 +4408,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4417
4408
|
})
|
|
4418
4409
|
);
|
|
4419
4410
|
}
|
|
4420
|
-
|
|
4411
|
+
__init69() {this.displayFor = null}
|
|
4421
4412
|
/** Keeps the renderer's display transform in step with the document profile, mode and Proof Setup. */
|
|
4422
4413
|
syncDisplay() {
|
|
4423
4414
|
const s = this.state;
|
|
@@ -4437,7 +4428,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4437
4428
|
if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
|
|
4438
4429
|
this.viewKey = key;
|
|
4439
4430
|
const { width, height } = this.naturalSize;
|
|
4440
|
-
const view =
|
|
4431
|
+
const view = _chunkO5RVCDECcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
|
|
4441
4432
|
s.adjustments = view.adjustments;
|
|
4442
4433
|
s.depthMask = view.depthMask;
|
|
4443
4434
|
s.annotations = view.annotations;
|
|
@@ -4591,7 +4582,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4591
4582
|
applyCropPreset(ratio) {
|
|
4592
4583
|
this.recordHistory();
|
|
4593
4584
|
const { width, height } = this.state.imageDimensions;
|
|
4594
|
-
if (ratio &&
|
|
4585
|
+
if (ratio && _chunkO5RVCDECcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
|
|
4595
4586
|
ratio = 1 / ratio;
|
|
4596
4587
|
}
|
|
4597
4588
|
if (!ratio) {
|
|
@@ -4673,20 +4664,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
4673
4664
|
*/
|
|
4674
4665
|
getLayerPixels(id) {
|
|
4675
4666
|
const layer = this.getLayer(id);
|
|
4676
|
-
if (!layer || !
|
|
4667
|
+
if (!layer || !_chunkO5RVCDECcjs.hasSurface.call(void 0, layer)) return null;
|
|
4677
4668
|
const surface = this.surfaceOf(layer);
|
|
4678
4669
|
const b = _chunkJ5BA3BQ6cjs.contentBounds.call(void 0, surface);
|
|
4679
4670
|
if (!b) return null;
|
|
4680
4671
|
return { x: b.x + layer.offset.x, y: b.y + layer.offset.y, width: b.width, height: b.height, data: _chunkJ5BA3BQ6cjs.readRegion.call(void 0, surface, b) };
|
|
4681
4672
|
}
|
|
4682
|
-
|
|
4673
|
+
__init70() {this.boundsCache = /* @__PURE__ */ new WeakMap()}
|
|
4683
4674
|
/**
|
|
4684
4675
|
* Document bounds of a layer's non-transparent pixels (pixel layers; the Background's source
|
|
4685
4676
|
* included), or `null` for an empty or non-pixel layer.
|
|
4686
4677
|
*/
|
|
4687
4678
|
getLayerBounds(id) {
|
|
4688
4679
|
const layer = this.getLayer(id);
|
|
4689
|
-
if (!layer || !
|
|
4680
|
+
if (!layer || !_chunkO5RVCDECcjs.hasSurface.call(void 0, layer)) return null;
|
|
4690
4681
|
const surface = this.surfaceOf(layer);
|
|
4691
4682
|
let b = this.boundsCache.get(surface);
|
|
4692
4683
|
if (b === void 0) {
|
|
@@ -4701,9 +4692,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4701
4692
|
*/
|
|
4702
4693
|
getLayerDataURL(id) {
|
|
4703
4694
|
const layer = this.getLayer(id);
|
|
4704
|
-
if (!layer || !
|
|
4695
|
+
if (!layer || !_chunkO5RVCDECcjs.hasSurface.call(void 0, layer)) return null;
|
|
4705
4696
|
const surface = this.surfaceOf(layer);
|
|
4706
|
-
const enc =
|
|
4697
|
+
const enc = _chunkO5RVCDECcjs.encodeSurface.call(void 0, surface);
|
|
4707
4698
|
return enc ? enc.url : null;
|
|
4708
4699
|
}
|
|
4709
4700
|
/**
|
|
@@ -4733,8 +4724,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
4733
4724
|
pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _149 => _149.state, 'access', _150 => _150.patterns, 'optionalAccess', _151 => _151.find, 'call', _152 => _152((p) => p.id === id)]), () => ( null))
|
|
4734
4725
|
};
|
|
4735
4726
|
}
|
|
4736
|
-
|
|
4737
|
-
|
|
4727
|
+
__init71() {this.sourceIds = /* @__PURE__ */ new WeakMap()}
|
|
4728
|
+
__init72() {this.nextSourceId = 1}
|
|
4738
4729
|
/** Changes whenever the Background's source pixels can have changed. */
|
|
4739
4730
|
sourceVersion() {
|
|
4740
4731
|
const key = this.samplePixelsOverride ? this.samplePixels : _nullishCoalesce(this.imageElement, () => ( this.samplePixels));
|
|
@@ -4783,7 +4774,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4783
4774
|
}
|
|
4784
4775
|
return fits ? fromPixels(px2) : null;
|
|
4785
4776
|
}
|
|
4786
|
-
|
|
4777
|
+
__init73() {this.opaqueCache = /* @__PURE__ */ new WeakMap()}
|
|
4787
4778
|
/** Whether every source pixel is opaque (some legacy renders depend on it). */
|
|
4788
4779
|
sourceIsOpaque() {
|
|
4789
4780
|
const s = this.sourceSurface();
|
|
@@ -4845,19 +4836,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4845
4836
|
if (init.pixels) {
|
|
4846
4837
|
const px2 = init.pixels;
|
|
4847
4838
|
if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
|
|
4848
|
-
throw new (0,
|
|
4839
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
|
|
4849
4840
|
}
|
|
4850
4841
|
surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, px2, 4);
|
|
4851
4842
|
} else if (init.color !== void 0) {
|
|
4852
4843
|
const c = parseColor(init.color);
|
|
4853
4844
|
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]));
|
|
4854
4845
|
}
|
|
4855
|
-
const blend =
|
|
4856
|
-
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
4846
|
+
const blend = _chunkO5RVCDECcjs.parseBlend.call(void 0, init.blend);
|
|
4847
|
+
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4857
4848
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4858
4849
|
const layer = {
|
|
4859
4850
|
type: "pixel",
|
|
4860
|
-
id: init.id && !ids.has(init.id) ? init.id :
|
|
4851
|
+
id: init.id && !ids.has(init.id) ? init.id : _chunkO5RVCDECcjs.newLayerId.call(void 0, ),
|
|
4861
4852
|
name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
|
|
4862
4853
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
4863
4854
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
@@ -4866,7 +4857,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4866
4857
|
offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
|
|
4867
4858
|
};
|
|
4868
4859
|
if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
|
|
4869
|
-
const next =
|
|
4860
|
+
const next = _chunkO5RVCDECcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
4870
4861
|
this.commitLayers(next, () => {
|
|
4871
4862
|
this.state.activeLayerId = layer.id;
|
|
4872
4863
|
this.state.activeTarget = "pixels";
|
|
@@ -4906,12 +4897,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4906
4897
|
try {
|
|
4907
4898
|
img = await this.renderer.imageCache.get(src);
|
|
4908
4899
|
} catch (e21) {
|
|
4909
|
-
throw new (0,
|
|
4900
|
+
throw new (0, _chunkO5RVCDECcjs.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.");
|
|
4910
4901
|
}
|
|
4911
4902
|
const w = img.naturalWidth || img.width;
|
|
4912
4903
|
const h = img.naturalHeight || img.height;
|
|
4913
4904
|
const ctx = this.renderer.createCanvas(w, h).getContext("2d");
|
|
4914
|
-
if (!ctx || typeof ctx.getImageData !== "function") throw new (0,
|
|
4905
|
+
if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
|
|
4915
4906
|
ctx.drawImage(img, 0, 0, w, h);
|
|
4916
4907
|
const data = ctx.getImageData(0, 0, w, h);
|
|
4917
4908
|
return { width: w, height: h, data: data.data };
|
|
@@ -4924,7 +4915,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4924
4915
|
}
|
|
4925
4916
|
/** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
|
|
4926
4917
|
duplicateLayer(id, name) {
|
|
4927
|
-
const res =
|
|
4918
|
+
const res = _chunkO5RVCDECcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
|
|
4928
4919
|
this.commitLayers(res.layers, () => {
|
|
4929
4920
|
this.state.activeLayerId = res.id;
|
|
4930
4921
|
});
|
|
@@ -4932,16 +4923,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
4932
4923
|
}
|
|
4933
4924
|
/** Deletes a layer (refused when locked), as one undo step. */
|
|
4934
4925
|
removeLayer(id) {
|
|
4935
|
-
const next =
|
|
4926
|
+
const next = _chunkO5RVCDECcjs.removeLayer.call(void 0, this.state.layers, id);
|
|
4936
4927
|
this.commitLayers(next, () => {
|
|
4937
|
-
if (this.state.selectedAnnotationId && !_chunkMZXQTKUMcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([
|
|
4928
|
+
if (this.state.selectedAnnotationId && !_chunkMZXQTKUMcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkO5RVCDECcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
|
|
4938
4929
|
this.state.selectedAnnotationId = null;
|
|
4939
4930
|
}
|
|
4940
4931
|
});
|
|
4941
4932
|
}
|
|
4942
4933
|
/** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
|
|
4943
4934
|
moveLayer(id, placement) {
|
|
4944
|
-
const next =
|
|
4935
|
+
const next = _chunkO5RVCDECcjs.moveLayer.call(void 0, this.state.layers, id, placement);
|
|
4945
4936
|
const loc = _chunkMZXQTKUMcjs.findLayer.call(void 0, next, id);
|
|
4946
4937
|
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
|
|
4947
4938
|
this.commitLayers(next);
|
|
@@ -4952,23 +4943,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
4952
4943
|
* one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
|
|
4953
4944
|
*/
|
|
4954
4945
|
setLayerProperties(id, props, commitToHistory = true) {
|
|
4955
|
-
const next =
|
|
4946
|
+
const next = _chunkO5RVCDECcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
|
|
4956
4947
|
this.commitLayers(next, void 0, commitToHistory);
|
|
4957
4948
|
return _chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer;
|
|
4958
4949
|
}
|
|
4959
4950
|
/** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
|
|
4960
4951
|
addGroup(init = {}) {
|
|
4961
|
-
const blend = init.blend === void 0 ? "pass-through" :
|
|
4952
|
+
const blend = init.blend === void 0 ? "pass-through" : _chunkO5RVCDECcjs.parseBlend.call(void 0, init.blend, true);
|
|
4962
4953
|
const group = {
|
|
4963
4954
|
type: "group",
|
|
4964
|
-
id:
|
|
4955
|
+
id: _chunkO5RVCDECcjs.newLayerId.call(void 0, "group"),
|
|
4965
4956
|
name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
|
|
4966
4957
|
visible: true,
|
|
4967
4958
|
opacity: 1,
|
|
4968
4959
|
blend,
|
|
4969
4960
|
children: []
|
|
4970
4961
|
};
|
|
4971
|
-
const next =
|
|
4962
|
+
const next = _chunkO5RVCDECcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
|
|
4972
4963
|
this.commitLayers(next, () => {
|
|
4973
4964
|
this.state.activeLayerId = group.id;
|
|
4974
4965
|
this.state.activeTarget = "pixels";
|
|
@@ -4977,7 +4968,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4977
4968
|
}
|
|
4978
4969
|
/** Puts sibling layers into a new group (one undo step). Returns the group id. */
|
|
4979
4970
|
groupLayers(ids, name) {
|
|
4980
|
-
const res =
|
|
4971
|
+
const res = _chunkO5RVCDECcjs.groupLayers.call(void 0, this.state.layers, ids, name);
|
|
4981
4972
|
this.commitLayers(res.layers, () => {
|
|
4982
4973
|
this.state.activeLayerId = res.id;
|
|
4983
4974
|
});
|
|
@@ -4985,7 +4976,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4985
4976
|
}
|
|
4986
4977
|
/** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
|
|
4987
4978
|
ungroupLayer(id) {
|
|
4988
|
-
const res =
|
|
4979
|
+
const res = _chunkO5RVCDECcjs.ungroupLayer.call(void 0, this.state.layers, id);
|
|
4989
4980
|
this.commitLayers(res.layers);
|
|
4990
4981
|
return res.ids;
|
|
4991
4982
|
}
|
|
@@ -4994,38 +4985,38 @@ var ImageEditorController = (_class7 = class {
|
|
|
4994
4985
|
* (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
|
|
4995
4986
|
*/
|
|
4996
4987
|
offsetLayer(id, move, commitToHistory = true) {
|
|
4997
|
-
const layer =
|
|
4988
|
+
const layer = _chunkO5RVCDECcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
4998
4989
|
if (layer.type === "smart") {
|
|
4999
4990
|
const tl = layer.placement.corners[0];
|
|
5000
4991
|
const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5001
4992
|
const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5002
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5003
|
-
this.commitLayers(
|
|
4993
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("x and y must be numbers.");
|
|
4994
|
+
this.commitLayers(_chunkO5RVCDECcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
|
|
5004
4995
|
const moved = _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, id).layer;
|
|
5005
4996
|
return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
|
|
5006
4997
|
}
|
|
5007
4998
|
if (layer.type === "shape") {
|
|
5008
|
-
const g = _nullishCoalesce(
|
|
4999
|
+
const g = _nullishCoalesce(_chunkO5RVCDECcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
|
|
5009
5000
|
const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5010
5001
|
const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5011
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5012
|
-
|
|
5013
|
-
let moved =
|
|
5002
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("x and y must be numbers.");
|
|
5003
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5004
|
+
let moved = _chunkO5RVCDECcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
|
|
5014
5005
|
const mask = layer.mask;
|
|
5015
5006
|
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)) } };
|
|
5016
5007
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
5017
|
-
const b = _nullishCoalesce(
|
|
5008
|
+
const b = _nullishCoalesce(_chunkO5RVCDECcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
|
|
5018
5009
|
return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
|
|
5019
5010
|
}
|
|
5020
5011
|
if (layer.type === "type") {
|
|
5021
5012
|
const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
|
|
5022
5013
|
const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
|
|
5023
5014
|
const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
|
|
5024
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5025
|
-
|
|
5015
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("x and y must be numbers.");
|
|
5016
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5026
5017
|
const mx = Math.round(dx);
|
|
5027
5018
|
const my = Math.round(dy);
|
|
5028
|
-
let moved = { ...
|
|
5019
|
+
let moved = { ..._chunkO5RVCDECcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, layer.surface, mx, my) };
|
|
5029
5020
|
const mask = layer.mask;
|
|
5030
5021
|
if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, mx, my) } };
|
|
5031
5022
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
@@ -5035,7 +5026,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5035
5026
|
const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
5036
5027
|
const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
|
|
5037
5028
|
const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
|
|
5038
|
-
const next =
|
|
5029
|
+
const next = _chunkO5RVCDECcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
|
|
5039
5030
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5040
5031
|
return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
|
|
5041
5032
|
}
|
|
@@ -5045,11 +5036,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5045
5036
|
* target when the layer is active.
|
|
5046
5037
|
*/
|
|
5047
5038
|
addLayerMask(id, from = "reveal-all", props = {}) {
|
|
5048
|
-
const layer =
|
|
5039
|
+
const layer = _chunkO5RVCDECcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5049
5040
|
let mask;
|
|
5050
5041
|
if (from === "selection") {
|
|
5051
5042
|
const sel = this.state.selection;
|
|
5052
|
-
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0,
|
|
5043
|
+
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5053
5044
|
mask = this.maskFromSelection(sel, props);
|
|
5054
5045
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
5055
5046
|
mask = { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
@@ -5058,7 +5049,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5058
5049
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5059
5050
|
mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5060
5051
|
}
|
|
5061
|
-
const next =
|
|
5052
|
+
const next = _chunkO5RVCDECcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
|
|
5062
5053
|
this.commitLayers(next, () => {
|
|
5063
5054
|
if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
|
|
5064
5055
|
});
|
|
@@ -5066,18 +5057,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
5066
5057
|
}
|
|
5067
5058
|
/** Removes a layer's mask (one undo step). */
|
|
5068
5059
|
removeLayerMask(id) {
|
|
5069
|
-
const layer =
|
|
5070
|
-
if (!layer.mask) throw new (0,
|
|
5071
|
-
this.commitLayers(
|
|
5060
|
+
const layer = _chunkO5RVCDECcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5061
|
+
if (!layer.mask) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5062
|
+
this.commitLayers(_chunkO5RVCDECcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
|
|
5072
5063
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
5073
5064
|
});
|
|
5074
5065
|
}
|
|
5075
5066
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
5076
5067
|
setLayerMaskProps(id, props, commitToHistory = true) {
|
|
5077
|
-
const layer =
|
|
5078
|
-
if (!layer.mask) throw new (0,
|
|
5068
|
+
const layer = _chunkO5RVCDECcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5069
|
+
if (!layer.mask) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
5079
5070
|
const mask = withMaskProps(layer.mask, props);
|
|
5080
|
-
this.commitLayers(
|
|
5071
|
+
this.commitLayers(_chunkO5RVCDECcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
|
|
5081
5072
|
return mask;
|
|
5082
5073
|
}
|
|
5083
5074
|
/**
|
|
@@ -5085,11 +5076,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5085
5076
|
* the depth map) and removes the mask, as one undo step.
|
|
5086
5077
|
*/
|
|
5087
5078
|
async applyLayerMask(id) {
|
|
5088
|
-
const loc =
|
|
5079
|
+
const loc = _chunkO5RVCDECcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5089
5080
|
const layer = loc.layer;
|
|
5090
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5091
|
-
if (!layer.mask) throw new (0,
|
|
5092
|
-
|
|
5081
|
+
if (layer.type !== "pixel") throw new (0, _chunkO5RVCDECcjs.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.`);
|
|
5082
|
+
if (!layer.mask) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5083
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
|
|
5093
5084
|
const { width, height } = this.naturalSize;
|
|
5094
5085
|
await this.renderer.prepareLayerAssets([layer], width, height);
|
|
5095
5086
|
const sources = this.renderer.compositorSources(width, height);
|
|
@@ -5122,13 +5113,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
5122
5113
|
*/
|
|
5123
5114
|
layerViaCopy(options = {}) {
|
|
5124
5115
|
const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
|
|
5125
|
-
if (!id) throw new (0,
|
|
5126
|
-
const loc =
|
|
5116
|
+
if (!id) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
|
|
5117
|
+
const loc = _chunkO5RVCDECcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5127
5118
|
const layer = loc.layer;
|
|
5128
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5119
|
+
if (layer.type !== "pixel") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
|
|
5129
5120
|
const sel = this.state.selection;
|
|
5130
|
-
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0,
|
|
5131
|
-
if (options.cut)
|
|
5121
|
+
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
|
|
5122
|
+
if (options.cut) _chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
|
|
5132
5123
|
const surface = this.surfaceOf(layer);
|
|
5133
5124
|
const sb = sel.bounds;
|
|
5134
5125
|
const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
|
|
@@ -5144,7 +5135,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5144
5135
|
}
|
|
5145
5136
|
const copy = {
|
|
5146
5137
|
type: "pixel",
|
|
5147
|
-
id:
|
|
5138
|
+
id: _chunkO5RVCDECcjs.newLayerId.call(void 0, ),
|
|
5148
5139
|
name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
5149
5140
|
visible: true,
|
|
5150
5141
|
opacity: 1,
|
|
@@ -5165,7 +5156,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5165
5156
|
return copy.id;
|
|
5166
5157
|
}
|
|
5167
5158
|
// --- Free Transform ---
|
|
5168
|
-
|
|
5159
|
+
__init74() {this.openTransform = null}
|
|
5169
5160
|
/** The Free Transform in progress (see `beginFreeTransform`), or `null`. */
|
|
5170
5161
|
getFreeTransform() {
|
|
5171
5162
|
if (this.openTransform && !this.openTransform.isOpen) this.openTransform = null;
|
|
@@ -5217,7 +5208,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5217
5208
|
* Refused while another transform is open.
|
|
5218
5209
|
*/
|
|
5219
5210
|
beginFreeTransform(init = {}) {
|
|
5220
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5211
|
+
if (this.getFreeTransform()) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
|
|
5221
5212
|
const session = new FreeTransformSession(this.transformHost(), init);
|
|
5222
5213
|
this.openTransform = session;
|
|
5223
5214
|
this.notify();
|
|
@@ -5231,26 +5222,26 @@ var ImageEditorController = (_class7 = class {
|
|
|
5231
5222
|
*/
|
|
5232
5223
|
transformLayer(spec) {
|
|
5233
5224
|
const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
|
|
5234
|
-
if (given > 1) throw new (0,
|
|
5235
|
-
if (!given && spec.warp === void 0) throw new (0,
|
|
5225
|
+
if (given > 1) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give only one of matrix, corners and params.");
|
|
5226
|
+
if (!given && spec.warp === void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
|
|
5236
5227
|
if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
|
|
5237
|
-
throw new (0,
|
|
5228
|
+
throw new (0, _chunkO5RVCDECcjs.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).");
|
|
5238
5229
|
}
|
|
5239
5230
|
if (spec.matrix) {
|
|
5240
5231
|
const [a, b, c, d] = spec.matrix;
|
|
5241
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5232
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5242
5233
|
}
|
|
5243
5234
|
const session = this.beginFreeTransform(spec);
|
|
5244
5235
|
try {
|
|
5245
5236
|
const g = session.startGeometry;
|
|
5246
|
-
const corners = spec.matrix ? g.corners.map((p) =>
|
|
5237
|
+
const corners = spec.matrix ? g.corners.map((p) => _chunkQQKTOA4Ucjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkO5RVCDECcjs.applyParams.call(void 0, g, spec.params) : g.corners;
|
|
5247
5238
|
let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
|
|
5248
5239
|
if (spec.warp) {
|
|
5249
5240
|
if ("style" in spec.warp) {
|
|
5250
|
-
if (!
|
|
5251
|
-
warp =
|
|
5241
|
+
if (!_chunkQQKTOA4Ucjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkQQKTOA4Ucjs.WARP_STYLES.join(", ")}.`);
|
|
5242
|
+
warp = _chunkO5RVCDECcjs.presetWarp.call(void 0, session.box, spec.warp);
|
|
5252
5243
|
} else {
|
|
5253
|
-
if (!
|
|
5244
|
+
if (!_chunkO5RVCDECcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkO5RVCDECcjs.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.");
|
|
5254
5245
|
warp = spec.warp;
|
|
5255
5246
|
}
|
|
5256
5247
|
}
|
|
@@ -5263,10 +5254,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5263
5254
|
}
|
|
5264
5255
|
/** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
|
|
5265
5256
|
flipLayer(axis, init = {}) {
|
|
5266
|
-
if (axis !== "horizontal" && axis !== "vertical") throw new (0,
|
|
5257
|
+
if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
|
|
5267
5258
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5268
5259
|
try {
|
|
5269
|
-
session.update({ corners:
|
|
5260
|
+
session.update({ corners: _chunkO5RVCDECcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
|
|
5270
5261
|
return session.commit();
|
|
5271
5262
|
} catch (e) {
|
|
5272
5263
|
session.cancel();
|
|
@@ -5278,16 +5269,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5278
5269
|
* centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
|
|
5279
5270
|
*/
|
|
5280
5271
|
rotateLayer90(turn, init = {}) {
|
|
5281
|
-
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0,
|
|
5272
|
+
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
|
|
5282
5273
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5283
5274
|
try {
|
|
5284
|
-
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(
|
|
5275
|
+
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkO5RVCDECcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
|
|
5285
5276
|
const cx = b.x + b.width / 2;
|
|
5286
5277
|
const cy = b.y + b.height / 2;
|
|
5287
5278
|
const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
|
|
5288
5279
|
const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
|
|
5289
5280
|
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];
|
|
5290
|
-
session.update({ corners: session.startGeometry.corners.map((p) =>
|
|
5281
|
+
session.update({ corners: session.startGeometry.corners.map((p) => _chunkQQKTOA4Ucjs.applyMatrix.call(void 0, m, p)) }, false);
|
|
5291
5282
|
return session.commit();
|
|
5292
5283
|
} catch (e) {
|
|
5293
5284
|
session.cancel();
|
|
@@ -5296,20 +5287,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5296
5287
|
}
|
|
5297
5288
|
/** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
|
|
5298
5289
|
addLayerFilter(id, filter) {
|
|
5299
|
-
const f =
|
|
5300
|
-
const next =
|
|
5290
|
+
const f = _chunkO5RVCDECcjs.normalizeFilter.call(void 0, filter);
|
|
5291
|
+
const next = _chunkO5RVCDECcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
|
|
5301
5292
|
this.commitLayers(next);
|
|
5302
5293
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5303
5294
|
}
|
|
5304
5295
|
/** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
|
|
5305
5296
|
updateLayerFilter(id, filterId, changes, commitToHistory = true) {
|
|
5306
|
-
const next =
|
|
5297
|
+
const next = _chunkO5RVCDECcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
|
|
5307
5298
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5308
5299
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5309
5300
|
}
|
|
5310
5301
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
5311
5302
|
removeLayerFilter(id, filterId) {
|
|
5312
|
-
const next =
|
|
5303
|
+
const next = _chunkO5RVCDECcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
|
|
5313
5304
|
this.commitLayers(next);
|
|
5314
5305
|
return _nullishCoalesce(_chunkMZXQTKUMcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5315
5306
|
}
|
|
@@ -5325,8 +5316,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5325
5316
|
*/
|
|
5326
5317
|
convertToSmartObject(ids, options = {}) {
|
|
5327
5318
|
const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
|
|
5328
|
-
if (!list.length) throw new (0,
|
|
5329
|
-
const res =
|
|
5319
|
+
if (!list.length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
|
|
5320
|
+
const res = _chunkO5RVCDECcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
|
|
5330
5321
|
this.commitLayers(res.layers, () => {
|
|
5331
5322
|
this.state.activeLayerId = res.layer.id;
|
|
5332
5323
|
this.state.activeTarget = "pixels";
|
|
@@ -5335,7 +5326,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5335
5326
|
}
|
|
5336
5327
|
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
5337
5328
|
rasterizeSmartObject(id) {
|
|
5338
|
-
const res =
|
|
5329
|
+
const res = _chunkO5RVCDECcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
|
|
5339
5330
|
this.commitLayers(res.layers, () => {
|
|
5340
5331
|
if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
5341
5332
|
});
|
|
@@ -5343,10 +5334,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5343
5334
|
}
|
|
5344
5335
|
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
5345
5336
|
getSmartObject(id) {
|
|
5346
|
-
const layer =
|
|
5337
|
+
const layer = _chunkO5RVCDECcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5347
5338
|
const c = layer.contents;
|
|
5348
|
-
const g =
|
|
5349
|
-
const readout =
|
|
5339
|
+
const g = _chunkO5RVCDECcjs.placementGeometry.call(void 0, layer);
|
|
5340
|
+
const readout = _chunkO5RVCDECcjs.describeTransform.call(void 0, g);
|
|
5350
5341
|
const stack = layer.smartFilters;
|
|
5351
5342
|
return {
|
|
5352
5343
|
layerId: layer.id,
|
|
@@ -5356,10 +5347,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5356
5347
|
kind: c.kind,
|
|
5357
5348
|
width: c.width,
|
|
5358
5349
|
height: c.height,
|
|
5359
|
-
decoded:
|
|
5350
|
+
decoded: _chunkO5RVCDECcjs.isContentsDecoded.call(void 0, c),
|
|
5360
5351
|
fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
|
|
5361
5352
|
linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
|
|
5362
|
-
instances:
|
|
5353
|
+
instances: _chunkO5RVCDECcjs.instancesOf.call(void 0, this.state.layers, c.id),
|
|
5363
5354
|
layerCount: c.document ? _chunkMZXQTKUMcjs.flattenLayers.call(void 0, c.document.layers).length : 0
|
|
5364
5355
|
},
|
|
5365
5356
|
placement: {
|
|
@@ -5371,8 +5362,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5371
5362
|
scaleY: readout.scaleY,
|
|
5372
5363
|
rotate: readout.rotate,
|
|
5373
5364
|
skewX: readout.skewX,
|
|
5374
|
-
center:
|
|
5375
|
-
bounds:
|
|
5365
|
+
center: _chunkO5RVCDECcjs.anchorPoint.call(void 0, g, "center"),
|
|
5366
|
+
bounds: _chunkO5RVCDECcjs.transformedBox.call(void 0, g)
|
|
5376
5367
|
},
|
|
5377
5368
|
smartFilters: {
|
|
5378
5369
|
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
|
|
@@ -5389,7 +5380,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5389
5380
|
* change. Returns the new placement summary.
|
|
5390
5381
|
*/
|
|
5391
5382
|
setSmartObjectPlacement(id, placement, commitToHistory = true) {
|
|
5392
|
-
const res =
|
|
5383
|
+
const res = _chunkO5RVCDECcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
|
|
5393
5384
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5394
5385
|
return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
|
|
5395
5386
|
}
|
|
@@ -5402,23 +5393,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
5402
5393
|
* nothing is relative to the current transform.
|
|
5403
5394
|
*/
|
|
5404
5395
|
setSmartObjectTransform(id, spec) {
|
|
5405
|
-
const layer =
|
|
5406
|
-
const g =
|
|
5396
|
+
const layer = _chunkO5RVCDECcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5397
|
+
const g = _chunkO5RVCDECcjs.placementGeometry.call(void 0, layer);
|
|
5407
5398
|
const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
|
|
5408
5399
|
const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
|
|
5409
|
-
if (ways > 1) throw new (0,
|
|
5400
|
+
if (ways > 1) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
|
|
5410
5401
|
let corners = g.corners;
|
|
5411
5402
|
if (spec.corners) corners = spec.corners;
|
|
5412
5403
|
else if (spec.matrix) {
|
|
5413
|
-
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0,
|
|
5404
|
+
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkO5RVCDECcjs.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).");
|
|
5414
5405
|
const [a, b, c, d] = spec.matrix;
|
|
5415
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5416
|
-
corners =
|
|
5406
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5407
|
+
corners = _chunkO5RVCDECcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
|
|
5417
5408
|
} else if (numeric.length) {
|
|
5418
|
-
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0,
|
|
5419
|
-
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0,
|
|
5420
|
-
const now =
|
|
5421
|
-
const centre =
|
|
5409
|
+
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
|
|
5410
|
+
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`${k} must be a finite number.`);
|
|
5411
|
+
const now = _chunkO5RVCDECcjs.describeTransform.call(void 0, g);
|
|
5412
|
+
const centre = _chunkO5RVCDECcjs.anchorPoint.call(void 0, g, "center");
|
|
5422
5413
|
const params = {
|
|
5423
5414
|
scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
|
|
5424
5415
|
scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
|
|
@@ -5426,20 +5417,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5426
5417
|
skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
|
|
5427
5418
|
skewY: _nullishCoalesce(spec.skewY, () => ( 0))
|
|
5428
5419
|
};
|
|
5429
|
-
const m =
|
|
5420
|
+
const m = _chunkO5RVCDECcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
|
|
5430
5421
|
const cx = g.box.width / 2;
|
|
5431
5422
|
const cy = g.box.height / 2;
|
|
5432
5423
|
const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
|
|
5433
|
-
corners =
|
|
5424
|
+
corners = _chunkO5RVCDECcjs.cornersFromMatrix.call(void 0, g.box, _chunkQQKTOA4Ucjs.multiplyMatrices.call(void 0, m, _chunkQQKTOA4Ucjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
|
|
5434
5425
|
}
|
|
5435
5426
|
let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
|
|
5436
5427
|
if (spec.warp === null) warp = null;
|
|
5437
5428
|
else if (spec.warp) {
|
|
5438
5429
|
if ("style" in spec.warp) {
|
|
5439
|
-
if (!
|
|
5440
|
-
warp =
|
|
5430
|
+
if (!_chunkQQKTOA4Ucjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkQQKTOA4Ucjs.WARP_STYLES.join(", ")}.`);
|
|
5431
|
+
warp = _chunkO5RVCDECcjs.presetWarp.call(void 0, g.box, spec.warp);
|
|
5441
5432
|
} else {
|
|
5442
|
-
if (!
|
|
5433
|
+
if (!_chunkO5RVCDECcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkO5RVCDECcjs.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.");
|
|
5443
5434
|
warp = spec.warp;
|
|
5444
5435
|
}
|
|
5445
5436
|
}
|
|
@@ -5453,16 +5444,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5453
5444
|
* the layers that changed.
|
|
5454
5445
|
*/
|
|
5455
5446
|
replaceSmartObjectContents(id, source) {
|
|
5456
|
-
const layer =
|
|
5447
|
+
const layer = _chunkO5RVCDECcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5457
5448
|
let contents;
|
|
5458
5449
|
if ("contents" in source) contents = source.contents;
|
|
5459
|
-
else if ("pixels" in source) contents =
|
|
5450
|
+
else if ("pixels" in source) contents = _chunkO5RVCDECcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
|
|
5460
5451
|
else {
|
|
5461
|
-
const psd =
|
|
5462
|
-
contents =
|
|
5452
|
+
const psd = _chunkO5RVCDECcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkO5RVCDECcjs.newLayerId.call(void 0, ) });
|
|
5453
|
+
contents = _chunkO5RVCDECcjs.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`)));
|
|
5463
5454
|
contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
|
|
5464
5455
|
}
|
|
5465
|
-
const res =
|
|
5456
|
+
const res = _chunkO5RVCDECcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
|
|
5466
5457
|
this.commitLayers(res.layers);
|
|
5467
5458
|
return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
|
|
5468
5459
|
}
|
|
@@ -5477,16 +5468,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5477
5468
|
* and bytes.
|
|
5478
5469
|
*/
|
|
5479
5470
|
exportSmartObjectContents(id) {
|
|
5480
|
-
const layer =
|
|
5471
|
+
const layer = _chunkO5RVCDECcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5481
5472
|
const c = layer.contents;
|
|
5482
5473
|
const base = c.name.replace(/\.\w+$/, "") || "Contents";
|
|
5483
5474
|
if (c.file) {
|
|
5484
|
-
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ...
|
|
5475
|
+
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkO5RVCDECcjs.BROWSER_IMAGE_TYPES };
|
|
5485
5476
|
const ext = c.file.type.toLowerCase();
|
|
5486
5477
|
return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
|
|
5487
5478
|
}
|
|
5488
|
-
if (!
|
|
5489
|
-
const f =
|
|
5479
|
+
if (!_chunkO5RVCDECcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
|
|
5480
|
+
const f = _chunkO5RVCDECcjs.smartContentsFile.call(void 0, c);
|
|
5490
5481
|
return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
|
|
5491
5482
|
}
|
|
5492
5483
|
/**
|
|
@@ -5495,7 +5486,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5495
5486
|
* undo step. Returns the copy's id.
|
|
5496
5487
|
*/
|
|
5497
5488
|
copySmartObject(id, linked = false, name) {
|
|
5498
|
-
const res =
|
|
5489
|
+
const res = _chunkO5RVCDECcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
|
|
5499
5490
|
this.commitLayers(res.layers, () => {
|
|
5500
5491
|
this.state.activeLayerId = res.layer.id;
|
|
5501
5492
|
this.state.activeTarget = "pixels";
|
|
@@ -5504,31 +5495,31 @@ var ImageEditorController = (_class7 = class {
|
|
|
5504
5495
|
}
|
|
5505
5496
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
5506
5497
|
addSmartFilter(id, filter, index) {
|
|
5507
|
-
const res =
|
|
5498
|
+
const res = _chunkO5RVCDECcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkO5RVCDECcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
|
|
5508
5499
|
this.commitLayers(res.layers);
|
|
5509
5500
|
return res.filter;
|
|
5510
5501
|
}
|
|
5511
5502
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
5512
5503
|
updateSmartFilter(id, filterId, changes, commitToHistory = true) {
|
|
5513
|
-
const res =
|
|
5504
|
+
const res = _chunkO5RVCDECcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
|
|
5514
5505
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5515
5506
|
return res.filter;
|
|
5516
5507
|
}
|
|
5517
5508
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
5518
5509
|
removeSmartFilter(id, filterId) {
|
|
5519
|
-
const res =
|
|
5510
|
+
const res = _chunkO5RVCDECcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
|
|
5520
5511
|
this.commitLayers(res.layers);
|
|
5521
5512
|
return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
|
|
5522
5513
|
}
|
|
5523
5514
|
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
5524
5515
|
moveSmartFilter(id, filterId, index) {
|
|
5525
|
-
const res =
|
|
5516
|
+
const res = _chunkO5RVCDECcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
|
|
5526
5517
|
this.commitLayers(res.layers);
|
|
5527
5518
|
return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
|
|
5528
5519
|
}
|
|
5529
5520
|
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
5530
5521
|
setSmartFiltersEnabled(id, enabled) {
|
|
5531
|
-
const res =
|
|
5522
|
+
const res = _chunkO5RVCDECcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
|
|
5532
5523
|
this.commitLayers(res.layers);
|
|
5533
5524
|
return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
|
|
5534
5525
|
}
|
|
@@ -5538,21 +5529,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
5538
5529
|
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
5539
5530
|
*/
|
|
5540
5531
|
setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
|
|
5541
|
-
const layer =
|
|
5532
|
+
const layer = _chunkO5RVCDECcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5542
5533
|
let mask;
|
|
5543
5534
|
if (from === "none") mask = null;
|
|
5544
5535
|
else if (from === "keep") {
|
|
5545
|
-
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0,
|
|
5536
|
+
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
|
|
5546
5537
|
mask = withMaskProps(layer.smartFilters.mask, props);
|
|
5547
5538
|
} else if (from === "selection") {
|
|
5548
5539
|
const sel = this.state.selection;
|
|
5549
|
-
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0,
|
|
5540
|
+
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5550
5541
|
mask = this.maskFromSelection(sel, props);
|
|
5551
5542
|
} else {
|
|
5552
5543
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5553
5544
|
mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5554
5545
|
}
|
|
5555
|
-
const res =
|
|
5546
|
+
const res = _chunkO5RVCDECcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
|
|
5556
5547
|
this.commitLayers(res.layers, () => {
|
|
5557
5548
|
if (this.state.activeLayerId !== id) return;
|
|
5558
5549
|
if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
|
|
@@ -5568,14 +5559,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
5568
5559
|
async prepareSmartObjects() {
|
|
5569
5560
|
const pending = /* @__PURE__ */ new Map();
|
|
5570
5561
|
for (const l of _chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers)) {
|
|
5571
|
-
if (l.type === "smart" && !
|
|
5562
|
+
if (l.type === "smart" && !_chunkO5RVCDECcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkO5RVCDECcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
|
|
5572
5563
|
}
|
|
5573
5564
|
const left = [];
|
|
5574
5565
|
for (const [cid, c] of pending) {
|
|
5575
5566
|
try {
|
|
5576
|
-
const url = `data:${
|
|
5567
|
+
const url = `data:${_chunkO5RVCDECcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes)}`;
|
|
5577
5568
|
const px2 = await this.decodeImage(url);
|
|
5578
|
-
const decoded = { ...c, kind: "raster", raster:
|
|
5569
|
+
const decoded = { ...c, kind: "raster", raster: _chunkO5RVCDECcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
|
|
5579
5570
|
const swap = (layers) => {
|
|
5580
5571
|
let out = layers;
|
|
5581
5572
|
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 }));
|
|
@@ -5591,7 +5582,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5591
5582
|
return left;
|
|
5592
5583
|
}
|
|
5593
5584
|
// --- Smart object contents (Edit Contents) ---
|
|
5594
|
-
|
|
5585
|
+
__init75() {this.contentsStack = []}
|
|
5595
5586
|
/** The smart objects whose contents are open (outermost first); empty when the document itself is shown. */
|
|
5596
5587
|
getEditingContents() {
|
|
5597
5588
|
return this.contentsStack.map((e) => ({ layerId: e.layerId, name: e.name }));
|
|
@@ -5603,10 +5594,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5603
5594
|
* Contents can nest. Returns the contents' size and layer ids.
|
|
5604
5595
|
*/
|
|
5605
5596
|
editSmartObjectContents(id) {
|
|
5606
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5607
|
-
const layer =
|
|
5597
|
+
if (this.getFreeTransform()) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
|
|
5598
|
+
const layer = _chunkO5RVCDECcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5608
5599
|
const c = layer.contents;
|
|
5609
|
-
if (!
|
|
5600
|
+
if (!_chunkO5RVCDECcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkO5RVCDECcjs.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.`);
|
|
5610
5601
|
const saved = {
|
|
5611
5602
|
state: { ...this.state },
|
|
5612
5603
|
undo: this.undoStack,
|
|
@@ -5617,7 +5608,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5617
5608
|
samplePixelsOverride: this.samplePixelsOverride,
|
|
5618
5609
|
psdResolution: this.psdResolution
|
|
5619
5610
|
};
|
|
5620
|
-
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id:
|
|
5611
|
+
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkO5RVCDECcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
|
|
5621
5612
|
this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
|
|
5622
5613
|
const s = this.state;
|
|
5623
5614
|
this.state = {
|
|
@@ -5625,7 +5616,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5625
5616
|
sourceUrl: null,
|
|
5626
5617
|
imageDimensions: { width: c.width, height: c.height },
|
|
5627
5618
|
crop: null,
|
|
5628
|
-
transform: { ...
|
|
5619
|
+
transform: { ..._chunkO5RVCDECcjs.DEFAULT_TRANSFORM_VALUES },
|
|
5629
5620
|
layers,
|
|
5630
5621
|
activeLayerId: layers.length ? layers[layers.length - 1].id : null,
|
|
5631
5622
|
activeTarget: "pixels",
|
|
@@ -5658,7 +5649,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5658
5649
|
*/
|
|
5659
5650
|
closeSmartObjectContents(save = true) {
|
|
5660
5651
|
const top = this.contentsStack.pop();
|
|
5661
|
-
if (!top) throw new (0,
|
|
5652
|
+
if (!top) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
|
|
5662
5653
|
if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
|
|
5663
5654
|
this.openTransform = null;
|
|
5664
5655
|
const edited = this.state;
|
|
@@ -5672,10 +5663,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5672
5663
|
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";
|
|
5673
5664
|
if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
|
|
5674
5665
|
const px2 = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
|
|
5675
|
-
next =
|
|
5666
|
+
next = _chunkO5RVCDECcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
|
|
5676
5667
|
} else {
|
|
5677
5668
|
const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
|
|
5678
|
-
next =
|
|
5669
|
+
next = _chunkO5RVCDECcjs.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);
|
|
5679
5670
|
}
|
|
5680
5671
|
}
|
|
5681
5672
|
const saved = top.saved;
|
|
@@ -5694,7 +5685,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5694
5685
|
this.notify();
|
|
5695
5686
|
return { layerId: top.layerId, changed: false, layerIds: [] };
|
|
5696
5687
|
}
|
|
5697
|
-
const res =
|
|
5688
|
+
const res = _chunkO5RVCDECcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
|
|
5698
5689
|
this.commitLayers(res.layers);
|
|
5699
5690
|
return { layerId: top.layerId, changed: true, layerIds: res.ids };
|
|
5700
5691
|
}
|
|
@@ -5709,38 +5700,38 @@ var ImageEditorController = (_class7 = class {
|
|
|
5709
5700
|
// --- Layer effects ---
|
|
5710
5701
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
5711
5702
|
getLayerEffects(id) {
|
|
5712
|
-
return
|
|
5703
|
+
return _chunkO5RVCDECcjs.layerEffectsOf.call(void 0, _chunkO5RVCDECcjs.requireLayer.call(void 0, this.state.layers, id).layer);
|
|
5713
5704
|
}
|
|
5714
5705
|
/**
|
|
5715
5706
|
* Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
|
|
5716
5707
|
* `index` in the layer's effect list (default the end). Returns the new effect and the effects.
|
|
5717
5708
|
*/
|
|
5718
5709
|
addLayerEffect(id, kind, params = {}, index) {
|
|
5719
|
-
const res =
|
|
5710
|
+
const res = _chunkO5RVCDECcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
|
|
5720
5711
|
this.commitLayers(res.layers);
|
|
5721
5712
|
return { effect: res.effect, effects: this.getLayerEffects(id) };
|
|
5722
5713
|
}
|
|
5723
5714
|
/** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
|
|
5724
5715
|
updateLayerEffect(id, effectId, changes, commitToHistory = true) {
|
|
5725
|
-
this.commitLayers(
|
|
5716
|
+
this.commitLayers(_chunkO5RVCDECcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
|
|
5726
5717
|
return this.getLayerEffects(id);
|
|
5727
5718
|
}
|
|
5728
5719
|
/** Removes one effect (one undo step). Returns the remaining effects. */
|
|
5729
5720
|
removeLayerEffect(id, effectId) {
|
|
5730
|
-
this.commitLayers(
|
|
5721
|
+
this.commitLayers(_chunkO5RVCDECcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
|
|
5731
5722
|
return this.getLayerEffects(id);
|
|
5732
5723
|
}
|
|
5733
5724
|
/** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
|
|
5734
5725
|
setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
|
|
5735
|
-
this.commitLayers(
|
|
5726
|
+
this.commitLayers(_chunkO5RVCDECcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
|
|
5736
5727
|
return this.getLayerEffects(id);
|
|
5737
5728
|
}
|
|
5738
5729
|
/** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
|
|
5739
5730
|
setLayerEffects(id, effects, commitToHistory = true) {
|
|
5740
|
-
this.commitLayers(
|
|
5731
|
+
this.commitLayers(_chunkO5RVCDECcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
|
|
5741
5732
|
return this.getLayerEffects(id);
|
|
5742
5733
|
}
|
|
5743
|
-
|
|
5734
|
+
__init76() {this.patternIds = /* @__PURE__ */ new WeakMap()}
|
|
5744
5735
|
/** Changes whenever the document's pattern list is replaced (the compositor then drops its caches). */
|
|
5745
5736
|
patternsVersion() {
|
|
5746
5737
|
const list = this.state.patterns;
|
|
@@ -5763,8 +5754,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5763
5754
|
/** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
|
|
5764
5755
|
setGlobalLight(light, commitToHistory = true) {
|
|
5765
5756
|
const next = { ...this.getGlobalLight(), ...light };
|
|
5766
|
-
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0,
|
|
5767
|
-
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0,
|
|
5757
|
+
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
|
|
5758
|
+
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
|
|
5768
5759
|
if (commitToHistory) this.recordHistory();
|
|
5769
5760
|
if (next.angle === _chunkMZXQTKUMcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkMZXQTKUMcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
|
|
5770
5761
|
else this.state.globalLight = next;
|
|
@@ -5775,16 +5766,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5775
5766
|
async compositeToSurface(layers, rect) {
|
|
5776
5767
|
const { width, height } = this.naturalSize;
|
|
5777
5768
|
if (_chunkMZXQTKUMcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
|
|
5778
|
-
throw new (0,
|
|
5769
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
|
|
5779
5770
|
}
|
|
5780
5771
|
await this.renderer.prepareLayerAssets(layers, width, height);
|
|
5781
5772
|
const sources = this.renderer.compositorSources(width, height);
|
|
5782
5773
|
const depth = this.bitDepth;
|
|
5783
5774
|
if (depth !== 8) {
|
|
5784
|
-
const samples = _chunkMZXQTKUMcjs.workingToSamples.call(void 0,
|
|
5775
|
+
const samples = _chunkMZXQTKUMcjs.workingToSamples.call(void 0, _chunkO5RVCDECcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
|
|
5785
5776
|
return _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
|
|
5786
5777
|
}
|
|
5787
|
-
const data = new (0,
|
|
5778
|
+
const data = new (0, _chunkO5RVCDECcjs.LayerCompositor)().composite(layers, rect, sources);
|
|
5788
5779
|
return _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
|
|
5789
5780
|
}
|
|
5790
5781
|
/**
|
|
@@ -5797,22 +5788,22 @@ var ImageEditorController = (_class7 = class {
|
|
|
5797
5788
|
const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
|
|
5798
5789
|
const depth = this.bitDepth;
|
|
5799
5790
|
if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkJ5BA3BQ6cjs.to16From8.call(void 0, this.compositePixels(r).data) };
|
|
5800
|
-
const data = _chunkMZXQTKUMcjs.workingToSamples.call(void 0,
|
|
5791
|
+
const data = _chunkMZXQTKUMcjs.workingToSamples.call(void 0, _chunkO5RVCDECcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
|
|
5801
5792
|
return { width: r.width, height: r.height, depth, data };
|
|
5802
5793
|
}
|
|
5803
5794
|
/** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
|
|
5804
5795
|
paintBounds(layer) {
|
|
5805
5796
|
const { width, height } = this.naturalSize;
|
|
5806
5797
|
const canvas = { x: 0, y: 0, width, height };
|
|
5807
|
-
if (
|
|
5798
|
+
if (_chunkO5RVCDECcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
5808
5799
|
if (layer.type === "annotation") {
|
|
5809
|
-
const b =
|
|
5800
|
+
const b = _chunkO5RVCDECcjs.getAnnotationBounds.call(void 0, layer.annotation);
|
|
5810
5801
|
const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
|
|
5811
5802
|
return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
|
|
5812
5803
|
}
|
|
5813
5804
|
if (layer.type === "group") {
|
|
5814
5805
|
let r = null;
|
|
5815
|
-
for (const c of layer.children) r =
|
|
5806
|
+
for (const c of layer.children) r = _chunkO5RVCDECcjs.unionRect.call(void 0, r, this.paintBounds(c));
|
|
5816
5807
|
return _nullishCoalesce(r, () => ( canvas));
|
|
5817
5808
|
}
|
|
5818
5809
|
return canvas;
|
|
@@ -5823,16 +5814,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5823
5814
|
* Returns the merged id.
|
|
5824
5815
|
*/
|
|
5825
5816
|
async mergeDown(id) {
|
|
5826
|
-
const loc =
|
|
5817
|
+
const loc = _chunkO5RVCDECcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5827
5818
|
const upper = loc.layer;
|
|
5828
5819
|
const siblings = loc.parent ? loc.parent.children : this.state.layers;
|
|
5829
5820
|
const lower = siblings[loc.index - 1];
|
|
5830
|
-
if (!lower) throw new (0,
|
|
5831
|
-
if (lower.type !== "pixel") throw new (0,
|
|
5832
|
-
if (!upper.visible) throw new (0,
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
let rect = _nullishCoalesce(
|
|
5821
|
+
if (!lower) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
|
|
5822
|
+
if (lower.type !== "pixel") throw new (0, _chunkO5RVCDECcjs.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.`);
|
|
5823
|
+
if (!upper.visible) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
|
|
5824
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
|
|
5825
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
|
|
5826
|
+
let rect = _nullishCoalesce(_chunkO5RVCDECcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
|
|
5836
5827
|
const reach = Math.max(_chunkMZXQTKUMcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkMZXQTKUMcjs.effectsMargin.call(void 0, upper.effects));
|
|
5837
5828
|
if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
|
|
5838
5829
|
const base = { ...lower, blend: "normal", opacity: 1 };
|
|
@@ -5858,12 +5849,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
5858
5849
|
*/
|
|
5859
5850
|
async mergeVisible() {
|
|
5860
5851
|
const visible = this.state.layers.filter((l) => l.visible);
|
|
5861
|
-
if (!visible.length) throw new (0,
|
|
5852
|
+
if (!visible.length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("No layer is visible.");
|
|
5862
5853
|
const { width, height } = this.naturalSize;
|
|
5863
5854
|
const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
|
|
5864
5855
|
const merged = {
|
|
5865
5856
|
type: "pixel",
|
|
5866
|
-
id:
|
|
5857
|
+
id: _chunkO5RVCDECcjs.newLayerId.call(void 0, ),
|
|
5867
5858
|
name: "Merged",
|
|
5868
5859
|
visible: true,
|
|
5869
5860
|
opacity: 1,
|
|
@@ -5887,8 +5878,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5887
5878
|
const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
|
|
5888
5879
|
const bg = {
|
|
5889
5880
|
type: "pixel",
|
|
5890
|
-
id:
|
|
5891
|
-
name:
|
|
5881
|
+
id: _chunkO5RVCDECcjs.BACKGROUND_LAYER_ID,
|
|
5882
|
+
name: _chunkO5RVCDECcjs.BACKGROUND_LAYER_NAME,
|
|
5892
5883
|
visible: true,
|
|
5893
5884
|
opacity: 1,
|
|
5894
5885
|
blend: "normal",
|
|
@@ -5902,7 +5893,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5902
5893
|
});
|
|
5903
5894
|
return bg.id;
|
|
5904
5895
|
}
|
|
5905
|
-
|
|
5896
|
+
__init77() {this.thumbCache = /* @__PURE__ */ new WeakMap()}
|
|
5906
5897
|
/**
|
|
5907
5898
|
* A small RGBA preview of a pixel layer over the canvas (or of its mask with `mask: true`),
|
|
5908
5899
|
* longest side `maxSide` px, point-sampled; `null` for layers without pixels.
|
|
@@ -5915,7 +5906,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5915
5906
|
const k = Math.min(1, side / Math.max(width, height));
|
|
5916
5907
|
const tw = Math.max(1, Math.round(width * k));
|
|
5917
5908
|
const th = Math.max(1, Math.round(height * k));
|
|
5918
|
-
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null :
|
|
5909
|
+
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkO5RVCDECcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
|
|
5919
5910
|
if (!surface) return null;
|
|
5920
5911
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
5921
5912
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
@@ -6010,7 +6001,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6010
6001
|
* pixels. The next stroke fixes the offset from its first point. View state, no undo.
|
|
6011
6002
|
*/
|
|
6012
6003
|
setCloneSource(point) {
|
|
6013
|
-
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0,
|
|
6004
|
+
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
|
|
6014
6005
|
const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
|
|
6015
6006
|
this.state.paint = { ...this.state.paint, cloneSource: source };
|
|
6016
6007
|
this.notify();
|
|
@@ -6028,27 +6019,27 @@ var ImageEditorController = (_class7 = class {
|
|
|
6028
6019
|
/** Resolves and validates what a stroke, fill or clear paints into. */
|
|
6029
6020
|
paintTarget(layerId, channel, action) {
|
|
6030
6021
|
const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
|
|
6031
|
-
if (!id) throw new (0,
|
|
6032
|
-
const layer =
|
|
6022
|
+
if (!id) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
|
|
6023
|
+
const layer = _chunkO5RVCDECcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
6033
6024
|
const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
|
|
6034
6025
|
if (ch === "mask") {
|
|
6035
|
-
if (!layer.mask) throw new (0,
|
|
6036
|
-
if (layer.mask.source) throw new (0,
|
|
6037
|
-
|
|
6026
|
+
if (!layer.mask) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
|
|
6027
|
+
if (layer.mask.source) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
|
|
6028
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6038
6029
|
} else if (ch === "filter-mask") {
|
|
6039
6030
|
if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
|
|
6040
|
-
throw new (0,
|
|
6031
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
|
|
6041
6032
|
}
|
|
6042
|
-
if (!
|
|
6043
|
-
|
|
6033
|
+
if (!_chunkO5RVCDECcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
|
|
6034
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6044
6035
|
} else {
|
|
6045
|
-
if (layer.type === "smart") throw new (0,
|
|
6046
|
-
if (layer.type === "shape") throw new (0,
|
|
6047
|
-
if (layer.type === "type") throw new (0,
|
|
6048
|
-
if (layer.type !== "pixel") throw new (0,
|
|
6049
|
-
|
|
6036
|
+
if (layer.type === "smart") throw new (0, _chunkO5RVCDECcjs.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.`);
|
|
6037
|
+
if (layer.type === "shape") throw new (0, _chunkO5RVCDECcjs.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).`);
|
|
6038
|
+
if (layer.type === "type") throw new (0, _chunkO5RVCDECcjs.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).`);
|
|
6039
|
+
if (layer.type !== "pixel") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
|
|
6040
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "pixels", action);
|
|
6050
6041
|
}
|
|
6051
|
-
if (!layer.visible) throw new (0,
|
|
6042
|
+
if (!layer.visible) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
|
|
6052
6043
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
6053
6044
|
const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
|
|
6054
6045
|
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
|
|
@@ -6057,7 +6048,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6057
6048
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
6058
6049
|
withSurface(layer, channel, surface) {
|
|
6059
6050
|
if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
|
|
6060
|
-
if (channel === "filter-mask") return
|
|
6051
|
+
if (channel === "filter-mask") return _chunkO5RVCDECcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
|
|
6061
6052
|
const next = { ...layer, surface };
|
|
6062
6053
|
delete next.source;
|
|
6063
6054
|
return next;
|
|
@@ -6070,10 +6061,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6070
6061
|
*/
|
|
6071
6062
|
beginStroke(init = {}) {
|
|
6072
6063
|
const tool = _nullishCoalesce(init.tool, () => ( "brush"));
|
|
6073
|
-
if (!STROKE_TOOLS.includes(tool)) throw new (0,
|
|
6064
|
+
if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
|
|
6074
6065
|
const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
|
|
6075
6066
|
if (tool === "mixer" && target.channel !== "pixels") {
|
|
6076
|
-
throw new (0,
|
|
6067
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
|
|
6077
6068
|
}
|
|
6078
6069
|
const brush = _chunk6GFRKLLScjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
|
|
6079
6070
|
let strokePaint = null;
|
|
@@ -6107,7 +6098,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6107
6098
|
retouchStroke(tool, init, brush, target, apply) {
|
|
6108
6099
|
const settings = _chunkW6M7C7R3cjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
|
|
6109
6100
|
const mask = target.channel !== "pixels";
|
|
6110
|
-
if (tool === "sponge" && mask) throw new (0,
|
|
6101
|
+
if (tool === "sponge" && mask) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
|
|
6111
6102
|
if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkW6M7C7R3cjs.RetouchDabStroke)(brush, pixels, _chunkW6M7C7R3cjs.smudgeEffect.call(void 0, brush, settings.strength)) };
|
|
6112
6103
|
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)) };
|
|
6113
6104
|
const retouchApply = {
|
|
@@ -6160,7 +6151,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6160
6151
|
}
|
|
6161
6152
|
if (init.source) this.setCloneSource(init.source);
|
|
6162
6153
|
const cs = this.state.paint.cloneSource;
|
|
6163
|
-
if (!cs) throw new (0,
|
|
6154
|
+
if (!cs) throw new (0, _chunkO5RVCDECcjs.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 }.`);
|
|
6164
6155
|
let offset = { x: 0, y: 0 };
|
|
6165
6156
|
let first = { x: 0, y: 0 };
|
|
6166
6157
|
const paint = () => ({ kind: "source", source, dx: offset.x, dy: offset.y });
|
|
@@ -6195,7 +6186,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6195
6186
|
const sources = this.compositorSources();
|
|
6196
6187
|
if (depth) {
|
|
6197
6188
|
return new (0, _chunkW6M7C7R3cjs.TilePixelSource)((tx, ty) => {
|
|
6198
|
-
const w =
|
|
6189
|
+
const w = _chunkO5RVCDECcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkJ5BA3BQ6cjs.TILE, y: ty * _chunkJ5BA3BQ6cjs.TILE, width: _chunkJ5BA3BQ6cjs.TILE, height: _chunkJ5BA3BQ6cjs.TILE }, sources, depth);
|
|
6199
6190
|
for (let i = 0; i < w.length; i += 4) {
|
|
6200
6191
|
if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkJ5BA3BQ6cjs.srgbEncode.call(void 0, w[i + c]);
|
|
6201
6192
|
for (let c = 0; c < 4; c++) w[i + c] *= 255;
|
|
@@ -6203,7 +6194,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6203
6194
|
return w;
|
|
6204
6195
|
}, 4);
|
|
6205
6196
|
}
|
|
6206
|
-
const compositor = new (0,
|
|
6197
|
+
const compositor = new (0, _chunkO5RVCDECcjs.LayerCompositor)();
|
|
6207
6198
|
return new (0, _chunkW6M7C7R3cjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
|
|
6208
6199
|
}
|
|
6209
6200
|
/** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
|
|
@@ -6253,9 +6244,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6253
6244
|
* document bounds and the number of dabs.
|
|
6254
6245
|
*/
|
|
6255
6246
|
paintStroke(init) {
|
|
6256
|
-
if (!Array.isArray(init.points) || !init.points.length) throw new (0,
|
|
6247
|
+
if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("points must hold at least one { x, y } point.");
|
|
6257
6248
|
for (const p of init.points) {
|
|
6258
|
-
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _236 => _236.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _237 => _237.y]))) throw new (0,
|
|
6249
|
+
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _236 => _236.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _237 => _237.y]))) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
|
|
6259
6250
|
}
|
|
6260
6251
|
const session = this.beginStroke(init);
|
|
6261
6252
|
session.push(init.points);
|
|
@@ -6281,8 +6272,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6281
6272
|
const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
|
|
6282
6273
|
const { width, height } = this.naturalSize;
|
|
6283
6274
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
6284
|
-
if (!(opacity >= 0 && opacity <= 1)) throw new (0,
|
|
6285
|
-
const blend = _nullishCoalesce(
|
|
6275
|
+
if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
6276
|
+
const blend = _nullishCoalesce(_chunkO5RVCDECcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
|
|
6286
6277
|
const sel = options.useSelection !== false && _optionalChain([this, 'access', _238 => _238.state, 'access', _239 => _239.selection, 'optionalAccess', _240 => _240.bounds]) ? this.state.selection : null;
|
|
6287
6278
|
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _241 => _241.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
6288
6279
|
const coverage = new (0, _chunk6GFRKLLScjs.CoverageMap)();
|
|
@@ -6318,7 +6309,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6318
6309
|
// --- Adjustments ---
|
|
6319
6310
|
/** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
|
|
6320
6311
|
developLayer() {
|
|
6321
|
-
return
|
|
6312
|
+
return _chunkO5RVCDECcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
|
|
6322
6313
|
}
|
|
6323
6314
|
/**
|
|
6324
6315
|
* Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
|
|
@@ -6344,7 +6335,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6344
6335
|
this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
|
|
6345
6336
|
}
|
|
6346
6337
|
if ("layers" in partial) {
|
|
6347
|
-
layers = this.replaceAdjustmentNodes(layers,
|
|
6338
|
+
layers = this.replaceAdjustmentNodes(layers, _chunkO5RVCDECcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
|
|
6348
6339
|
}
|
|
6349
6340
|
this.state.layers = layers;
|
|
6350
6341
|
this.notify();
|
|
@@ -6352,7 +6343,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6352
6343
|
/** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
|
|
6353
6344
|
get isProcessOutdated() {
|
|
6354
6345
|
this.syncViews();
|
|
6355
|
-
return
|
|
6346
|
+
return _chunkO5RVCDECcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkO5RVCDECcjs.LATEST_PROCESS_VERSION;
|
|
6356
6347
|
}
|
|
6357
6348
|
/**
|
|
6358
6349
|
* Update to Current Process: re-interprets the current adjustment values with the latest
|
|
@@ -6360,7 +6351,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6360
6351
|
*/
|
|
6361
6352
|
upgradeProcess() {
|
|
6362
6353
|
if (!this.isProcessOutdated) return false;
|
|
6363
|
-
this.setAdjustments({ process:
|
|
6354
|
+
this.setAdjustments({ process: _chunkO5RVCDECcjs.LATEST_PROCESS_VERSION });
|
|
6364
6355
|
return true;
|
|
6365
6356
|
}
|
|
6366
6357
|
/** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
|
|
@@ -6371,7 +6362,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6371
6362
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0,
|
|
6372
6363
|
this.state.layers,
|
|
6373
6364
|
target.id,
|
|
6374
|
-
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process:
|
|
6365
|
+
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkO5RVCDECcjs.LATEST_PROCESS_VERSION }), 0)
|
|
6375
6366
|
);
|
|
6376
6367
|
}
|
|
6377
6368
|
delete this.state.legacyOutputBlur;
|
|
@@ -6435,7 +6426,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6435
6426
|
const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
|
|
6436
6427
|
for (const l of next) {
|
|
6437
6428
|
if (existing.has(l.id)) continue;
|
|
6438
|
-
out = this.placeLayer(out,
|
|
6429
|
+
out = this.placeLayer(out, _chunkO5RVCDECcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
|
|
6439
6430
|
}
|
|
6440
6431
|
const order = next.map((l) => l.id);
|
|
6441
6432
|
for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
|
|
@@ -6450,7 +6441,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6450
6441
|
addAdjustmentLayer(init, index) {
|
|
6451
6442
|
const spec = typeof init === "string" ? { kind: init } : init;
|
|
6452
6443
|
const ids = new Set(_chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
6453
|
-
const layer =
|
|
6444
|
+
const layer = _chunkO5RVCDECcjs.createAdjustmentLayer.call(void 0, spec.kind, {
|
|
6454
6445
|
id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
|
|
6455
6446
|
name: spec.name,
|
|
6456
6447
|
params: spec.params,
|
|
@@ -6459,10 +6450,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6459
6450
|
blend: spec.blend,
|
|
6460
6451
|
mask: _nullishCoalesce(spec.mask, () => ( void 0))
|
|
6461
6452
|
});
|
|
6462
|
-
while (ids.has(layer.id)) layer.id =
|
|
6453
|
+
while (ids.has(layer.id)) layer.id = _chunkO5RVCDECcjs.newLayerId.call(void 0, "adj");
|
|
6463
6454
|
const { width, height } = this.naturalSize;
|
|
6464
6455
|
this.recordHistory();
|
|
6465
|
-
const node =
|
|
6456
|
+
const node = _chunkO5RVCDECcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
|
|
6466
6457
|
const positioned = Boolean(spec.aboveId || spec.parentId);
|
|
6467
6458
|
this.state.layers = this.placeLayer(this.state.layers, node, {
|
|
6468
6459
|
aboveId: spec.aboveId,
|
|
@@ -6482,7 +6473,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6482
6473
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
6483
6474
|
const { width, height } = this.naturalSize;
|
|
6484
6475
|
const node = loc.layer;
|
|
6485
|
-
const merged =
|
|
6476
|
+
const merged = _chunkO5RVCDECcjs.normalizeAdjustmentLayer.call(void 0, {
|
|
6486
6477
|
id: node.id,
|
|
6487
6478
|
kind: node.kind,
|
|
6488
6479
|
enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
|
|
@@ -6502,7 +6493,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6502
6493
|
params: merged.params
|
|
6503
6494
|
};
|
|
6504
6495
|
if (update.mask !== void 0) {
|
|
6505
|
-
const mask = update.mask ?
|
|
6496
|
+
const mask = update.mask ? _chunkO5RVCDECcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
|
|
6506
6497
|
if (mask) next.mask = mask;
|
|
6507
6498
|
else delete next.mask;
|
|
6508
6499
|
}
|
|
@@ -6589,8 +6580,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6589
6580
|
const { width, height } = this.naturalSize;
|
|
6590
6581
|
let next = null;
|
|
6591
6582
|
if (mask) {
|
|
6592
|
-
const sized = mask.width === width && mask.height === height ? mask :
|
|
6593
|
-
next =
|
|
6583
|
+
const sized = mask.width === width && mask.height === height ? mask : _chunkO5RVCDECcjs.resizeSelection.call(void 0, mask, width, height);
|
|
6584
|
+
next = _chunkO5RVCDECcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
|
|
6594
6585
|
} else if (mode !== "replace") {
|
|
6595
6586
|
return false;
|
|
6596
6587
|
}
|
|
@@ -6604,7 +6595,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6604
6595
|
/** Select › All. */
|
|
6605
6596
|
selectAll() {
|
|
6606
6597
|
const { width, height } = this.naturalSize;
|
|
6607
|
-
return this.setSelection(
|
|
6598
|
+
return this.setSelection(_chunkO5RVCDECcjs.fullSelection.call(void 0, width, height));
|
|
6608
6599
|
}
|
|
6609
6600
|
/** Select › Deselect. */
|
|
6610
6601
|
deselect() {
|
|
@@ -6613,11 +6604,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6613
6604
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
6614
6605
|
invertSelection() {
|
|
6615
6606
|
const { width, height } = this.naturalSize;
|
|
6616
|
-
const current = _nullishCoalesce(this.state.selection, () => (
|
|
6617
|
-
return this.setSelection(
|
|
6607
|
+
const current = _nullishCoalesce(this.state.selection, () => ( _chunkO5RVCDECcjs.createSelectionMask.call(void 0, width, height)));
|
|
6608
|
+
return this.setSelection(_chunkO5RVCDECcjs.invertSelection.call(void 0, current));
|
|
6618
6609
|
}
|
|
6619
6610
|
shapeCommand(mask, options) {
|
|
6620
|
-
const shaped = options.feather && options.feather > 0 ?
|
|
6611
|
+
const shaped = options.feather && options.feather > 0 ? _chunkO5RVCDECcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
|
|
6621
6612
|
return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6622
6613
|
}
|
|
6623
6614
|
/** Rectangular marquee in natural image pixels. */
|
|
@@ -6671,11 +6662,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6671
6662
|
if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
|
|
6672
6663
|
return null;
|
|
6673
6664
|
}
|
|
6674
|
-
const legacy =
|
|
6665
|
+
const legacy = _chunkO5RVCDECcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
|
|
6675
6666
|
if (options.sample === "active-layer") {
|
|
6676
6667
|
const layer = this.getActiveLayer();
|
|
6677
6668
|
if (!layer || layer.type !== "pixel") {
|
|
6678
|
-
throw new (0,
|
|
6669
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
|
|
6679
6670
|
}
|
|
6680
6671
|
const surface = layer.source === "document" && options.pixels ? _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
|
|
6681
6672
|
return { width, height, data: _chunkJ5BA3BQ6cjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
|
|
@@ -6684,7 +6675,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6684
6675
|
this.syncViews();
|
|
6685
6676
|
if (legacy && !options.pixels) {
|
|
6686
6677
|
const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
|
|
6687
|
-
|
|
6678
|
+
_chunkO5RVCDECcjs.applyAdjustments.call(void 0, copy, _chunkO5RVCDECcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
|
|
6688
6679
|
return copy;
|
|
6689
6680
|
}
|
|
6690
6681
|
const pixels = options.pixels;
|
|
@@ -6696,7 +6687,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6696
6687
|
};
|
|
6697
6688
|
const stack = withoutAnnotations(this.state.layers);
|
|
6698
6689
|
const layers = options.sampleMerged ? stack : pixelsOnly(stack);
|
|
6699
|
-
const data = new (0,
|
|
6690
|
+
const data = new (0, _chunkO5RVCDECcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
|
|
6700
6691
|
return { width, height, data };
|
|
6701
6692
|
}
|
|
6702
6693
|
async requirePixels(options) {
|
|
@@ -6723,7 +6714,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6723
6714
|
modifySelection(op, radius) {
|
|
6724
6715
|
const sel = this.state.selection;
|
|
6725
6716
|
if (!_optionalChain([sel, 'optionalAccess', _255 => _255.bounds])) return false;
|
|
6726
|
-
return this.setSelection(
|
|
6717
|
+
return this.setSelection(_chunkO5RVCDECcjs.modifySelection.call(void 0, sel, op, radius));
|
|
6727
6718
|
}
|
|
6728
6719
|
/**
|
|
6729
6720
|
* Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
|
|
@@ -6754,7 +6745,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6754
6745
|
} else {
|
|
6755
6746
|
pixels = source;
|
|
6756
6747
|
}
|
|
6757
|
-
this.setSelection(
|
|
6748
|
+
this.setSelection(_chunkO5RVCDECcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6758
6749
|
return this.getSelection();
|
|
6759
6750
|
}
|
|
6760
6751
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
@@ -6766,7 +6757,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6766
6757
|
// --- Layer masks ---
|
|
6767
6758
|
maskFromSelection(sel, props = {}) {
|
|
6768
6759
|
const { width, height } = this.naturalSize;
|
|
6769
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
6760
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkO5RVCDECcjs.resizeSelection.call(void 0, sel, width, height);
|
|
6770
6761
|
const mask = { surface: _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
|
|
6771
6762
|
return withMaskProps(mask, props);
|
|
6772
6763
|
}
|
|
@@ -6812,7 +6803,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6812
6803
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
6813
6804
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
6814
6805
|
const data = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
6815
|
-
const sel =
|
|
6806
|
+
const sel = _chunkO5RVCDECcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
6816
6807
|
return this.setSelection(sel, mode);
|
|
6817
6808
|
}
|
|
6818
6809
|
// --- Histogram ---
|
|
@@ -6842,9 +6833,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6842
6833
|
merged.depthRange = [...merged.depthRange];
|
|
6843
6834
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
6844
6835
|
const next = { ...l };
|
|
6845
|
-
if (
|
|
6836
|
+
if (_chunkO5RVCDECcjs.isDefaultDepthMask.call(void 0, merged)) {
|
|
6846
6837
|
if (_optionalChain([next, 'access', _261 => _261.mask, 'optionalAccess', _262 => _262.source])) delete next.mask;
|
|
6847
|
-
} else next.mask =
|
|
6838
|
+
} else next.mask = _chunkO5RVCDECcjs.depthRasterMask.call(void 0, merged);
|
|
6848
6839
|
return next;
|
|
6849
6840
|
});
|
|
6850
6841
|
}
|
|
@@ -6865,7 +6856,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6865
6856
|
// --- Annotations & Layers ---
|
|
6866
6857
|
/** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
|
|
6867
6858
|
annotationLayer(id) {
|
|
6868
|
-
return _chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([
|
|
6859
|
+
return _chunkMZXQTKUMcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkO5RVCDECcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _265 => _265.id]) === id);
|
|
6869
6860
|
}
|
|
6870
6861
|
/** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
|
|
6871
6862
|
annotationEnv() {
|
|
@@ -6881,7 +6872,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6881
6872
|
this.recordHistory();
|
|
6882
6873
|
const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
|
|
6883
6874
|
const fullAnnotation = { ...annotation, id };
|
|
6884
|
-
const layer =
|
|
6875
|
+
const layer = _chunkO5RVCDECcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
|
|
6885
6876
|
const loc = placement.aboveId ? _chunkMZXQTKUMcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
6886
6877
|
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);
|
|
6887
6878
|
this.state.selectedAnnotationId = id;
|
|
@@ -6893,17 +6884,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
6893
6884
|
this.recordHistory();
|
|
6894
6885
|
}
|
|
6895
6886
|
const layer = this.annotationLayer(id);
|
|
6896
|
-
const current = layer ?
|
|
6887
|
+
const current = layer ? _chunkO5RVCDECcjs.annotationOfLayer.call(void 0, layer) : null;
|
|
6897
6888
|
if (layer && current) {
|
|
6898
6889
|
const annotation = { ...current, ...partial, id };
|
|
6899
|
-
const name = layer.name ===
|
|
6890
|
+
const name = layer.name === _chunkO5RVCDECcjs.annotationLayerName.call(void 0, current) ? _chunkO5RVCDECcjs.annotationLayerName.call(void 0, annotation) : layer.name;
|
|
6900
6891
|
this.state.layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
|
|
6901
6892
|
}
|
|
6902
6893
|
this.notify();
|
|
6903
6894
|
}
|
|
6904
6895
|
/** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
|
|
6905
6896
|
layerForAnnotation(layer, annotation, name) {
|
|
6906
|
-
const fresh =
|
|
6897
|
+
const fresh = _chunkO5RVCDECcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
|
|
6907
6898
|
const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
|
|
6908
6899
|
for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
6909
6900
|
if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
|
|
@@ -6963,7 +6954,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6963
6954
|
this.notify();
|
|
6964
6955
|
}
|
|
6965
6956
|
// --- Rendering & Export ---
|
|
6966
|
-
|
|
6957
|
+
__init78() {this.blankSource = null}
|
|
6967
6958
|
/**
|
|
6968
6959
|
* What the renderer draws from: the source image, or, for a document without one (an opened
|
|
6969
6960
|
* PSD, a v3 document loaded on its own), a transparent canvas of the document size, since every
|
|
@@ -7171,8 +7162,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7171
7162
|
return;
|
|
7172
7163
|
}
|
|
7173
7164
|
const target = this.developLayer();
|
|
7174
|
-
if (!target) throw new (0,
|
|
7175
|
-
|
|
7165
|
+
if (!target) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("There is no pixel layer to mask.");
|
|
7166
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, target, "all", "mask it");
|
|
7176
7167
|
const { width, height } = this.naturalSize;
|
|
7177
7168
|
let px2 = await this.decodeImage(newDataUrl);
|
|
7178
7169
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
@@ -7180,14 +7171,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7180
7171
|
for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
|
|
7181
7172
|
let surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
|
|
7182
7173
|
if (target.offset.x || target.offset.y) surface = _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
|
|
7183
|
-
this.commitLayers(
|
|
7174
|
+
this.commitLayers(_chunkO5RVCDECcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
|
|
7184
7175
|
return target.id;
|
|
7185
7176
|
}
|
|
7186
7177
|
// --- Type layers ---
|
|
7187
7178
|
|
|
7188
7179
|
/** The shaper that lays out and draws type layers (`null` when there is none here). */
|
|
7189
7180
|
getTextShaper() {
|
|
7190
|
-
if (this.textShaperValue === void 0) this.textShaperValue =
|
|
7181
|
+
if (this.textShaperValue === void 0) this.textShaperValue = _chunkQQKTOA4Ucjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
|
|
7191
7182
|
return this.textShaperValue;
|
|
7192
7183
|
}
|
|
7193
7184
|
/** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
|
|
@@ -7204,7 +7195,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7204
7195
|
return _nullishCoalesce(_optionalChain([this, 'access', _272 => _272.getTextShaper, 'call', _273 => _273(), 'optionalAccess', _274 => _274.families, 'optionalCall', _275 => _275()]), () => ( ["sans-serif", "serif", "monospace"]));
|
|
7205
7196
|
}
|
|
7206
7197
|
typeInfo(id) {
|
|
7207
|
-
const layer =
|
|
7198
|
+
const layer = _chunkO5RVCDECcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7208
7199
|
const ranges = (runs) => {
|
|
7209
7200
|
let at = 0;
|
|
7210
7201
|
return runs.map((r) => {
|
|
@@ -7217,7 +7208,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7217
7208
|
let lines = [];
|
|
7218
7209
|
let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
|
|
7219
7210
|
if (shaper) {
|
|
7220
|
-
const layout =
|
|
7211
|
+
const layout = _chunkQQKTOA4Ucjs.layoutText.call(void 0, layer, shaper);
|
|
7221
7212
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7222
7213
|
lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
|
|
7223
7214
|
if (layer.rendering === "stored") missing = layout.missingFonts;
|
|
@@ -7247,25 +7238,25 @@ var ImageEditorController = (_class7 = class {
|
|
|
7247
7238
|
* text wrapped in `box`. Refused without a text shaper. Returns its id.
|
|
7248
7239
|
*/
|
|
7249
7240
|
addTextLayer(init) {
|
|
7250
|
-
const text =
|
|
7251
|
-
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0,
|
|
7252
|
-
const style =
|
|
7253
|
-
const paragraph =
|
|
7241
|
+
const text = _chunkO5RVCDECcjs.normalizeText.call(void 0, init.text);
|
|
7242
|
+
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("x and y must be numbers (document pixels).");
|
|
7243
|
+
const style = _chunkO5RVCDECcjs.patchTextStyle.call(void 0, { ..._chunkQQKTOA4Ucjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
|
|
7244
|
+
const paragraph = _chunkO5RVCDECcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
|
|
7254
7245
|
let frame = { kind: "point" };
|
|
7255
7246
|
if (init.box) {
|
|
7256
7247
|
const { width, height } = init.box;
|
|
7257
|
-
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0,
|
|
7248
|
+
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
|
|
7258
7249
|
frame = { kind: "box", width, height };
|
|
7259
7250
|
}
|
|
7260
|
-
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0,
|
|
7261
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7262
|
-
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7251
|
+
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("rotation must be a number of degrees.");
|
|
7252
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7253
|
+
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7263
7254
|
const t = [1, 0, 0, 1, init.x, init.y];
|
|
7264
|
-
const transform = init.rotation ?
|
|
7265
|
-
const layer =
|
|
7255
|
+
const transform = init.rotation ? _chunkQQKTOA4Ucjs.multiplyMatrices.call(void 0, t, _chunkQQKTOA4Ucjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
|
|
7256
|
+
const layer = _chunkO5RVCDECcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkO5RVCDECcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
|
|
7266
7257
|
if (init.opacity !== void 0) layer.opacity = init.opacity;
|
|
7267
7258
|
if (init.blend !== void 0) layer.blend = init.blend;
|
|
7268
|
-
const next =
|
|
7259
|
+
const next = _chunkO5RVCDECcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7269
7260
|
this.commitLayers(next, () => {
|
|
7270
7261
|
this.state.activeLayerId = layer.id;
|
|
7271
7262
|
this.state.activeTarget = "pixels";
|
|
@@ -7277,28 +7268,28 @@ var ImageEditorController = (_class7 = class {
|
|
|
7277
7268
|
* `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
|
|
7278
7269
|
*/
|
|
7279
7270
|
setText(id, text, range = {}, commitToHistory = true) {
|
|
7280
|
-
const layer =
|
|
7281
|
-
const insert =
|
|
7282
|
-
const [start, end] =
|
|
7283
|
-
const { layers } =
|
|
7271
|
+
const layer = _chunkO5RVCDECcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7272
|
+
const insert = _chunkO5RVCDECcjs.normalizeText.call(void 0, text);
|
|
7273
|
+
const [start, end] = _chunkO5RVCDECcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7274
|
+
const { layers } = _chunkO5RVCDECcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkO5RVCDECcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
|
|
7284
7275
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7285
7276
|
return this.typeInfo(id);
|
|
7286
7277
|
}
|
|
7287
7278
|
/** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
|
|
7288
7279
|
setTextStyle(id, style, range = {}, commitToHistory = true) {
|
|
7289
|
-
const layer =
|
|
7290
|
-
const [start, end] =
|
|
7291
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7292
|
-
|
|
7293
|
-
const { layers } =
|
|
7280
|
+
const layer = _chunkO5RVCDECcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7281
|
+
const [start, end] = _chunkO5RVCDECcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7282
|
+
if (!Object.keys(style).length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give at least one style field to set.");
|
|
7283
|
+
_chunkO5RVCDECcjs.patchTextStyle.call(void 0, _chunkQQKTOA4Ucjs.DEFAULT_TEXT_STYLE, style);
|
|
7284
|
+
const { layers } = _chunkO5RVCDECcjs.updateTypeLayer.call(void 0,
|
|
7294
7285
|
this.state.layers,
|
|
7295
7286
|
id,
|
|
7296
7287
|
(l) => {
|
|
7297
7288
|
if (start === end) {
|
|
7298
|
-
if (l.text.length) throw new (0,
|
|
7299
|
-
return { runs: [{ length: 0, style:
|
|
7289
|
+
if (l.text.length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
|
|
7290
|
+
return { runs: [{ length: 0, style: _chunkO5RVCDECcjs.patchTextStyle.call(void 0, _chunkQQKTOA4Ucjs.styleAt.call(void 0, l.runs, 0, _chunkQQKTOA4Ucjs.DEFAULT_TEXT_STYLE), style) }] };
|
|
7300
7291
|
}
|
|
7301
|
-
return { runs:
|
|
7292
|
+
return { runs: _chunkQQKTOA4Ucjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkO5RVCDECcjs.patchTextStyle.call(void 0, s, style)) };
|
|
7302
7293
|
},
|
|
7303
7294
|
this.textEnv(),
|
|
7304
7295
|
"restyle its text"
|
|
@@ -7308,11 +7299,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7308
7299
|
}
|
|
7309
7300
|
/** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
|
|
7310
7301
|
setParagraphStyle(id, style, range = {}, commitToHistory = true) {
|
|
7311
|
-
const layer =
|
|
7312
|
-
const [start, end] =
|
|
7313
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7314
|
-
|
|
7315
|
-
const { layers } =
|
|
7302
|
+
const layer = _chunkO5RVCDECcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7303
|
+
const [start, end] = _chunkO5RVCDECcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7304
|
+
if (!Object.keys(style).length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give at least one paragraph field to set.");
|
|
7305
|
+
_chunkO5RVCDECcjs.patchParagraphStyle.call(void 0, {}, style);
|
|
7306
|
+
const { layers } = _chunkO5RVCDECcjs.updateTypeLayer.call(void 0,
|
|
7316
7307
|
this.state.layers,
|
|
7317
7308
|
id,
|
|
7318
7309
|
(l) => {
|
|
@@ -7321,7 +7312,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7321
7312
|
const a = at;
|
|
7322
7313
|
at += p.length;
|
|
7323
7314
|
const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
|
|
7324
|
-
return touches || !l.text.length ? { length: p.length, style:
|
|
7315
|
+
return touches || !l.text.length ? { length: p.length, style: _chunkO5RVCDECcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
|
|
7325
7316
|
});
|
|
7326
7317
|
return { paragraphs };
|
|
7327
7318
|
},
|
|
@@ -7337,21 +7328,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7337
7328
|
* paragraph. Also resizes a box. One undo step.
|
|
7338
7329
|
*/
|
|
7339
7330
|
setTextFrame(id, frame, commitToHistory = true) {
|
|
7340
|
-
const layer =
|
|
7341
|
-
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0,
|
|
7342
|
-
if (frame.kind !== "box" && frame.kind !== "point") throw new (0,
|
|
7331
|
+
const layer = _chunkO5RVCDECcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7332
|
+
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("width and height must be at least 1 pixel.");
|
|
7333
|
+
if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("kind must be point or box.");
|
|
7343
7334
|
const shaper = this.getTextShaper();
|
|
7344
|
-
const { layers } =
|
|
7335
|
+
const { layers } = _chunkO5RVCDECcjs.updateTypeLayer.call(void 0,
|
|
7345
7336
|
this.state.layers,
|
|
7346
7337
|
id,
|
|
7347
7338
|
(l) => {
|
|
7348
7339
|
if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
|
|
7349
|
-
if (!shaper) throw new (0,
|
|
7350
|
-
const lines =
|
|
7340
|
+
if (!shaper) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
|
|
7341
|
+
const lines = _chunkQQKTOA4Ucjs.layoutText.call(void 0, l, shaper).lines;
|
|
7351
7342
|
const first = lines[0];
|
|
7352
7343
|
const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
|
|
7353
7344
|
const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
|
|
7354
|
-
const m =
|
|
7345
|
+
const m = _chunkO5RVCDECcjs.textMatrix.call(void 0, l);
|
|
7355
7346
|
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]];
|
|
7356
7347
|
const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
|
|
7357
7348
|
return { frame: nextFrame, transform: shifted };
|
|
@@ -7368,21 +7359,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7368
7359
|
* `warnings` says when other colours were dropped. One undo step.
|
|
7369
7360
|
*/
|
|
7370
7361
|
convertTextToShape(id) {
|
|
7371
|
-
const layer =
|
|
7372
|
-
|
|
7362
|
+
const layer = _chunkO5RVCDECcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7363
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
|
|
7373
7364
|
const shaper = this.getTextShaper();
|
|
7374
|
-
if (!shaper) throw new (0,
|
|
7375
|
-
const parts =
|
|
7376
|
-
const subpaths = parts.flatMap((p) =>
|
|
7377
|
-
if (!subpaths.length) throw new (0,
|
|
7365
|
+
if (!shaper) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
|
|
7366
|
+
const parts = _chunkO5RVCDECcjs.textOutlines.call(void 0, layer, shaper);
|
|
7367
|
+
const subpaths = parts.flatMap((p) => _chunkQQKTOA4Ucjs.bezierToSubpaths.call(void 0, p.path));
|
|
7368
|
+
if (!subpaths.length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
|
|
7378
7369
|
const warnings = [];
|
|
7379
7370
|
const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
|
|
7380
7371
|
if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
|
|
7381
|
-
const missing =
|
|
7372
|
+
const missing = _chunkQQKTOA4Ucjs.layoutText.call(void 0, layer, shaper).missingFonts;
|
|
7382
7373
|
if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
|
|
7383
|
-
const first = _nullishCoalesce(_optionalChain([layer, 'access', _276 => _276.runs, 'access', _277 => _277.find, 'call', _278 => _278((r) => r.length > 0), 'optionalAccess', _279 => _279.style]), () => (
|
|
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]), () => ( _chunkQQKTOA4Ucjs.DEFAULT_TEXT_STYLE));
|
|
7384
7375
|
const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
|
|
7385
|
-
const shape =
|
|
7376
|
+
const shape = _chunkO5RVCDECcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
|
|
7386
7377
|
const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
|
|
7387
7378
|
for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
7388
7379
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
|
|
@@ -7390,23 +7381,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
7390
7381
|
}
|
|
7391
7382
|
/** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
|
|
7392
7383
|
getTextLayout(id) {
|
|
7393
|
-
const layer =
|
|
7384
|
+
const layer = _chunkO5RVCDECcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7394
7385
|
const shaper = this.getTextShaper();
|
|
7395
|
-
return shaper ?
|
|
7386
|
+
return shaper ? _chunkQQKTOA4Ucjs.layoutText.call(void 0, layer, shaper) : null;
|
|
7396
7387
|
}
|
|
7397
7388
|
/** The text index nearest a document point (for clicks on a type layer). */
|
|
7398
7389
|
textIndexAt(id, point) {
|
|
7399
|
-
const layer =
|
|
7390
|
+
const layer = _chunkO5RVCDECcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7400
7391
|
const layout = this.getTextLayout(id);
|
|
7401
|
-
return layout ?
|
|
7392
|
+
return layout ? _chunkQQKTOA4Ucjs.textIndexAt.call(void 0, layout, _chunkO5RVCDECcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
|
|
7402
7393
|
}
|
|
7403
7394
|
/** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
|
|
7404
7395
|
textCaret(id, index) {
|
|
7405
|
-
const layer =
|
|
7396
|
+
const layer = _chunkO5RVCDECcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7406
7397
|
const layout = this.getTextLayout(id);
|
|
7407
7398
|
if (!layout) return null;
|
|
7408
|
-
const c =
|
|
7409
|
-
const m =
|
|
7399
|
+
const c = _chunkQQKTOA4Ucjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
|
|
7400
|
+
const m = _chunkO5RVCDECcjs.textMatrix.call(void 0, layer);
|
|
7410
7401
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
7411
7402
|
return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
|
|
7412
7403
|
}
|
|
@@ -7417,14 +7408,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7417
7408
|
}
|
|
7418
7409
|
/** One component from tool or UI input (validated). */
|
|
7419
7410
|
componentFrom(spec, path) {
|
|
7420
|
-
const op =
|
|
7421
|
-
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0,
|
|
7422
|
-
if (spec.shape !== void 0) return
|
|
7423
|
-
if (spec.subpaths !== void 0) return { op, subpaths:
|
|
7424
|
-
throw new (0,
|
|
7411
|
+
const op = _chunkO5RVCDECcjs.requireOperation.call(void 0, spec.op, `${path}op`);
|
|
7412
|
+
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
|
|
7413
|
+
if (spec.shape !== void 0) return _chunkO5RVCDECcjs.liveComponent.call(void 0, _chunkO5RVCDECcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
|
|
7414
|
+
if (spec.subpaths !== void 0) return { op, subpaths: _chunkO5RVCDECcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
|
|
7415
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
|
|
7425
7416
|
}
|
|
7426
7417
|
shapeInfo(id) {
|
|
7427
|
-
const layer =
|
|
7418
|
+
const layer = _chunkO5RVCDECcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7428
7419
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7429
7420
|
const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
|
|
7430
7421
|
const info = {
|
|
@@ -7434,13 +7425,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
7434
7425
|
index,
|
|
7435
7426
|
op: c.op,
|
|
7436
7427
|
live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
|
|
7437
|
-
subpaths:
|
|
7438
|
-
bounds: box(
|
|
7428
|
+
subpaths: _chunkQQKTOA4Ucjs.roundSubpaths.call(void 0, c.subpaths),
|
|
7429
|
+
bounds: box(_chunkO5RVCDECcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
|
|
7439
7430
|
})),
|
|
7440
7431
|
fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
|
|
7441
7432
|
fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
|
|
7442
7433
|
stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
|
|
7443
|
-
geometryBounds: box(
|
|
7434
|
+
geometryBounds: box(_chunkO5RVCDECcjs.shapeGeometryBounds.call(void 0, layer)),
|
|
7444
7435
|
bounds: this.getLayerBounds(id)
|
|
7445
7436
|
};
|
|
7446
7437
|
if (layer.annotation) info.annotationId = layer.annotation.id;
|
|
@@ -7457,17 +7448,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
7457
7448
|
*/
|
|
7458
7449
|
addShapeLayer(init) {
|
|
7459
7450
|
const specs = _optionalChain([init, 'access', _284 => _284.components, 'optionalAccess', _285 => _285.length]) ? init.components : [init];
|
|
7460
|
-
if (_optionalChain([init, 'access', _286 => _286.components, 'optionalAccess', _287 => _287.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0,
|
|
7451
|
+
if (_optionalChain([init, 'access', _286 => _286.components, 'optionalAccess', _287 => _287.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
|
|
7461
7452
|
const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _288 => _288.components, 'optionalAccess', _289 => _289.length]) ? `components[${i}].` : ""));
|
|
7462
|
-
const stroke = init.stroke ?
|
|
7453
|
+
const stroke = init.stroke ? _chunkO5RVCDECcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
|
|
7463
7454
|
const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
|
|
7464
|
-
const fill = init.fill === void 0 ? stroke && openOnly ? null :
|
|
7465
|
-
if (!fill && !stroke) throw new (0,
|
|
7466
|
-
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0,
|
|
7467
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7468
|
-
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7469
|
-
const layer =
|
|
7470
|
-
const next =
|
|
7455
|
+
const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkO5RVCDECcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkO5RVCDECcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
|
|
7456
|
+
if (!fill && !stroke) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
|
|
7457
|
+
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7458
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7459
|
+
if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7460
|
+
const layer = _chunkO5RVCDECcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
|
|
7461
|
+
const next = _chunkO5RVCDECcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7471
7462
|
this.commitLayers(next, () => {
|
|
7472
7463
|
this.state.activeLayerId = layer.id;
|
|
7473
7464
|
this.state.activeTarget = "pixels";
|
|
@@ -7480,18 +7471,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
7480
7471
|
* only those settings of the current stroke. Returns the shape.
|
|
7481
7472
|
*/
|
|
7482
7473
|
setShapeStyle(id, changes, commitToHistory = true) {
|
|
7483
|
-
const layer =
|
|
7484
|
-
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null :
|
|
7485
|
-
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null :
|
|
7486
|
-
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0,
|
|
7474
|
+
const layer = _chunkO5RVCDECcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7475
|
+
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkO5RVCDECcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
|
|
7476
|
+
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkO5RVCDECcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
|
|
7477
|
+
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7487
7478
|
const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
|
|
7488
|
-
const { layers } =
|
|
7479
|
+
const { layers } = _chunkO5RVCDECcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
|
|
7489
7480
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7490
7481
|
return this.shapeInfo(id);
|
|
7491
7482
|
}
|
|
7492
7483
|
componentIndex(layer, index) {
|
|
7493
7484
|
if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
|
|
7494
|
-
throw new (0,
|
|
7485
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
|
|
7495
7486
|
}
|
|
7496
7487
|
return index;
|
|
7497
7488
|
}
|
|
@@ -7501,36 +7492,36 @@ var ImageEditorController = (_class7 = class {
|
|
|
7501
7492
|
* the live shape) or its operation. Returns the shape.
|
|
7502
7493
|
*/
|
|
7503
7494
|
setShapeComponent(id, index, change, commitToHistory = true) {
|
|
7504
|
-
const layer =
|
|
7495
|
+
const layer = _chunkO5RVCDECcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7505
7496
|
const i = this.componentIndex(layer, index);
|
|
7506
7497
|
const current = layer.components[i];
|
|
7507
7498
|
let shape = change.shape;
|
|
7508
7499
|
if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
|
|
7509
7500
|
else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
|
|
7510
|
-
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op:
|
|
7501
|
+
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkO5RVCDECcjs.requireOperation.call(void 0, change.op) };
|
|
7511
7502
|
const components = layer.components.map((c, k) => k === i ? next : c);
|
|
7512
|
-
const { layers } =
|
|
7503
|
+
const { layers } = _chunkO5RVCDECcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7513
7504
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7514
7505
|
return this.shapeInfo(id);
|
|
7515
7506
|
}
|
|
7516
7507
|
/** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
|
|
7517
7508
|
addShapeComponent(id, spec, index) {
|
|
7518
|
-
const layer =
|
|
7509
|
+
const layer = _chunkO5RVCDECcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7519
7510
|
const c = this.componentFrom(spec, "");
|
|
7520
7511
|
const at = index === void 0 ? layer.components.length : index;
|
|
7521
|
-
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0,
|
|
7512
|
+
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
|
|
7522
7513
|
const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
|
|
7523
|
-
const { layers } =
|
|
7514
|
+
const { layers } = _chunkO5RVCDECcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7524
7515
|
this.commitLayers(layers);
|
|
7525
7516
|
return this.shapeInfo(id);
|
|
7526
7517
|
}
|
|
7527
7518
|
/** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
|
|
7528
7519
|
removeShapeComponent(id, index) {
|
|
7529
|
-
const layer =
|
|
7520
|
+
const layer = _chunkO5RVCDECcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7530
7521
|
const i = this.componentIndex(layer, index);
|
|
7531
|
-
if (layer.components.length === 1) throw new (0,
|
|
7522
|
+
if (layer.components.length === 1) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
|
|
7532
7523
|
const components = layer.components.filter((_, k) => k !== i);
|
|
7533
|
-
const { layers } =
|
|
7524
|
+
const { layers } = _chunkO5RVCDECcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7534
7525
|
this.commitLayers(layers);
|
|
7535
7526
|
return this.shapeInfo(id);
|
|
7536
7527
|
}
|
|
@@ -7539,10 +7530,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7539
7530
|
* shapes become paths), as one undo step. Returns the shape.
|
|
7540
7531
|
*/
|
|
7541
7532
|
mergeShapeComponents(id) {
|
|
7542
|
-
const layer =
|
|
7543
|
-
if (layer.components.length < 2) throw new (0,
|
|
7544
|
-
const components =
|
|
7545
|
-
const { layers } =
|
|
7533
|
+
const layer = _chunkO5RVCDECcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7534
|
+
if (layer.components.length < 2) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
|
|
7535
|
+
const components = _chunkO5RVCDECcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
|
|
7536
|
+
const { layers } = _chunkO5RVCDECcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
|
|
7546
7537
|
this.commitLayers(layers);
|
|
7547
7538
|
return this.shapeInfo(id);
|
|
7548
7539
|
}
|
|
@@ -7552,8 +7543,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7552
7543
|
* step. Returns the layer id.
|
|
7553
7544
|
*/
|
|
7554
7545
|
async rasterizeLayer(id) {
|
|
7555
|
-
const layer =
|
|
7556
|
-
|
|
7546
|
+
const layer = _chunkO5RVCDECcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
7547
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
|
|
7557
7548
|
const { width, height } = this.naturalSize;
|
|
7558
7549
|
const canvas = { x: 0, y: 0, width, height };
|
|
7559
7550
|
let next;
|
|
@@ -7569,8 +7560,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7569
7560
|
if (layer.locks) next.locks = layer.locks;
|
|
7570
7561
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
7571
7562
|
} else if (layer.type === "pixel") {
|
|
7572
|
-
if (!_optionalChain([layer, 'access', _290 => _290.filters, 'optionalAccess', _291 => _291.length])) throw new (0,
|
|
7573
|
-
|
|
7563
|
+
if (!_optionalChain([layer, 'access', _290 => _290.filters, 'optionalAccess', _291 => _291.length])) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
|
|
7564
|
+
_chunkO5RVCDECcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
|
|
7574
7565
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
7575
7566
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
7576
7567
|
delete content.mask;
|
|
@@ -7587,10 +7578,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7587
7578
|
} else if (layer.type === "smart") {
|
|
7588
7579
|
return this.rasterizeSmartObject(id);
|
|
7589
7580
|
} else if (layer.type === "shape" || layer.type === "type") {
|
|
7590
|
-
next = layer.type === "shape" ?
|
|
7581
|
+
next = layer.type === "shape" ? _chunkO5RVCDECcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkO5RVCDECcjs.typeAsPixelLayer.call(void 0, layer);
|
|
7591
7582
|
if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _292 => _292.annotation, 'optionalAccess', _293 => _293.id])) this.state.selectedAnnotationId = null;
|
|
7592
7583
|
} else {
|
|
7593
|
-
throw new (0,
|
|
7584
|
+
throw new (0, _chunkO5RVCDECcjs.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.`);
|
|
7594
7585
|
}
|
|
7595
7586
|
this.commitLayers(_chunkMZXQTKUMcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
|
|
7596
7587
|
return id;
|
|
@@ -7615,7 +7606,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7615
7606
|
setColorMode(mode, options = {}) {
|
|
7616
7607
|
let next;
|
|
7617
7608
|
if (mode === "rgb") {
|
|
7618
|
-
if (options.profile !== void 0) throw new (0,
|
|
7609
|
+
if (options.profile !== void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
|
|
7619
7610
|
next = null;
|
|
7620
7611
|
} else if (mode === "lab") next = { mode: "lab" };
|
|
7621
7612
|
else if (mode === "cmyk") {
|
|
@@ -7623,14 +7614,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7623
7614
|
try {
|
|
7624
7615
|
doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
|
|
7625
7616
|
} catch (e) {
|
|
7626
|
-
throw new (0,
|
|
7617
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7627
7618
|
}
|
|
7628
7619
|
const cs = resolveProfile(doc).colorSpace;
|
|
7629
|
-
if (cs !== "cmyk") throw new (0,
|
|
7620
|
+
if (cs !== "cmyk") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
|
|
7630
7621
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7631
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7622
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7632
7623
|
next = { mode: "cmyk", profile: doc, intent };
|
|
7633
|
-
} else throw new (0,
|
|
7624
|
+
} else throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
|
|
7634
7625
|
this.recordHistory();
|
|
7635
7626
|
if (next) this.state.colorMode = next;
|
|
7636
7627
|
else delete this.state.colorMode;
|
|
@@ -7643,10 +7634,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7643
7634
|
try {
|
|
7644
7635
|
doc = documentProfile(profile);
|
|
7645
7636
|
} catch (e) {
|
|
7646
|
-
throw new (0,
|
|
7637
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7647
7638
|
}
|
|
7648
7639
|
const cs = resolveProfile(doc).colorSpace;
|
|
7649
|
-
if (cs !== "rgb") throw new (0,
|
|
7640
|
+
if (cs !== "rgb") throw new (0, _chunkO5RVCDECcjs.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.`);
|
|
7650
7641
|
return doc;
|
|
7651
7642
|
}
|
|
7652
7643
|
/**
|
|
@@ -7672,7 +7663,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7672
7663
|
convertToProfile(profile, options = {}) {
|
|
7673
7664
|
const doc = this.rgbProfileArg(profile, "Convert to Profile");
|
|
7674
7665
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7675
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7666
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7676
7667
|
const t = _chunkG5NMLUVFcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7677
7668
|
const converted = [];
|
|
7678
7669
|
const unconverted = [];
|
|
@@ -7710,12 +7701,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
7710
7701
|
try {
|
|
7711
7702
|
doc = documentProfile(setup.profile);
|
|
7712
7703
|
} catch (e) {
|
|
7713
|
-
throw new (0,
|
|
7704
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7714
7705
|
}
|
|
7715
7706
|
const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
|
|
7716
|
-
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0,
|
|
7707
|
+
if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
|
|
7717
7708
|
const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
|
|
7718
|
-
if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0,
|
|
7709
|
+
if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
|
|
7719
7710
|
this.state.proofSetup = next;
|
|
7720
7711
|
this.notify();
|
|
7721
7712
|
return next;
|
|
@@ -7732,14 +7723,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7732
7723
|
src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
|
|
7733
7724
|
dst = resolveProfile(documentProfile(to));
|
|
7734
7725
|
} catch (e) {
|
|
7735
|
-
throw new (0,
|
|
7726
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7736
7727
|
}
|
|
7737
|
-
if (src.colorSpace !== "rgb") throw new (0,
|
|
7728
|
+
if (src.colorSpace !== "rgb") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
|
|
7738
7729
|
const t = _chunkG5NMLUVFcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7739
7730
|
const toLab = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
|
|
7740
7731
|
return colors.map((input) => {
|
|
7741
7732
|
const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
|
|
7742
|
-
if (!m) throw new (0,
|
|
7733
|
+
if (!m) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
|
|
7743
7734
|
const n = parseInt(m[1], 16);
|
|
7744
7735
|
const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
|
|
7745
7736
|
const out = new Float32Array(16);
|
|
@@ -7765,7 +7756,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7765
7756
|
* the ids of the layers whose pixels changed.
|
|
7766
7757
|
*/
|
|
7767
7758
|
setBitDepth(depth) {
|
|
7768
|
-
if (!_chunkJ5BA3BQ6cjs.isBitDepth.call(void 0, depth)) throw new (0,
|
|
7759
|
+
if (!_chunkJ5BA3BQ6cjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
|
|
7769
7760
|
const changed = [];
|
|
7770
7761
|
const withMask = (l) => {
|
|
7771
7762
|
const m = l.mask;
|
|
@@ -7813,7 +7804,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7813
7804
|
* Throws `PsdError` for files that cannot be read at all.
|
|
7814
7805
|
*/
|
|
7815
7806
|
loadPsd(bytes) {
|
|
7816
|
-
const result =
|
|
7807
|
+
const result = _chunkO5RVCDECcjs.importPsd.call(void 0, bytes, { newId: () => _chunkO5RVCDECcjs.newLayerId.call(void 0, ) });
|
|
7817
7808
|
this.abandonContents();
|
|
7818
7809
|
this.recordHistory();
|
|
7819
7810
|
const s = this.state;
|
|
@@ -7823,7 +7814,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7823
7814
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
7824
7815
|
s.layers = this.checkPsdFonts(result);
|
|
7825
7816
|
s.crop = null;
|
|
7826
|
-
s.transform = { ...
|
|
7817
|
+
s.transform = { ..._chunkO5RVCDECcjs.DEFAULT_TRANSFORM_VALUES };
|
|
7827
7818
|
s.outputOpacity = 1;
|
|
7828
7819
|
delete s.legacyOutputBlur;
|
|
7829
7820
|
s.selection = null;
|
|
@@ -7874,7 +7865,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7874
7865
|
let layers = result.layers;
|
|
7875
7866
|
const missing = /* @__PURE__ */ new Map();
|
|
7876
7867
|
for (const l of types) {
|
|
7877
|
-
const fonts = shaper ?
|
|
7868
|
+
const fonts = shaper ? _chunkQQKTOA4Ucjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
|
|
7878
7869
|
if (!fonts.length) continue;
|
|
7879
7870
|
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
|
|
7880
7871
|
for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
|
|
@@ -7902,7 +7893,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7902
7893
|
const canRasterize = this.renderer.canRasterize();
|
|
7903
7894
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
7904
7895
|
const sources = this.renderer.compositorSources(width, height);
|
|
7905
|
-
const compositor = new (0,
|
|
7896
|
+
const compositor = new (0, _chunkO5RVCDECcjs.LayerCompositor)();
|
|
7906
7897
|
const bakeMask = (layer) => {
|
|
7907
7898
|
const mask = layer.mask;
|
|
7908
7899
|
if (!_optionalChain([mask, 'optionalAccess', _304 => _304.source])) return mask;
|
|
@@ -7984,7 +7975,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7984
7975
|
out.surface = this.surfaceOf(layer);
|
|
7985
7976
|
delete out.source;
|
|
7986
7977
|
}
|
|
7987
|
-
const active = _nullishCoalesce(_optionalChain([layer, 'access', _308 => _308.filters, 'optionalAccess', _309 => _309.filter, 'call', _310 => _310(
|
|
7978
|
+
const active = _nullishCoalesce(_optionalChain([layer, 'access', _308 => _308.filters, 'optionalAccess', _309 => _309.filter, 'call', _310 => _310(_chunkO5RVCDECcjs.isActiveFilter)]), () => ( []));
|
|
7988
7979
|
if (active.length) {
|
|
7989
7980
|
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
7990
7981
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -8017,8 +8008,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8017
8008
|
const color = this.psdColorOptions(warnings);
|
|
8018
8009
|
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.`);
|
|
8019
8010
|
const depth = color.colorMode ? 8 : this.bitDepth;
|
|
8020
|
-
const mergedDeep = depth === 8 ? void 0 : _chunkMZXQTKUMcjs.workingToSamples.call(void 0,
|
|
8021
|
-
const result =
|
|
8011
|
+
const mergedDeep = depth === 8 ? void 0 : _chunkMZXQTKUMcjs.workingToSamples.call(void 0, _chunkO5RVCDECcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
|
|
8012
|
+
const result = _chunkO5RVCDECcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
|
|
8022
8013
|
warnings.push(...result.warnings);
|
|
8023
8014
|
return { bytes: result.bytes, warnings, psb: result.psb, width, height };
|
|
8024
8015
|
}
|
|
@@ -8034,13 +8025,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
8034
8025
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
8035
8026
|
if (this.state.selection && (sx !== 1 || sy !== 1)) {
|
|
8036
8027
|
this.state.selection = normalizeSelection(
|
|
8037
|
-
|
|
8028
|
+
_chunkO5RVCDECcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
|
|
8038
8029
|
);
|
|
8039
8030
|
}
|
|
8040
8031
|
let layers = this.state.layers;
|
|
8041
8032
|
if (sx !== 1 || sy !== 1) {
|
|
8042
8033
|
if (this.state.crop) {
|
|
8043
|
-
this.state.crop =
|
|
8034
|
+
this.state.crop = _chunkO5RVCDECcjs.clampCropToImage.call(void 0,
|
|
8044
8035
|
{
|
|
8045
8036
|
x: Math.round(this.state.crop.x * sx),
|
|
8046
8037
|
y: Math.round(this.state.crop.y * sy),
|
|
@@ -8059,17 +8050,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
8059
8050
|
} else if (l.type === "shape") {
|
|
8060
8051
|
const a = l.annotation;
|
|
8061
8052
|
const scaled = a ? scaleAnnotation(a, sx, sy) : null;
|
|
8062
|
-
const fromAnnotation = scaled ?
|
|
8053
|
+
const fromAnnotation = scaled ? _chunkO5RVCDECcjs.shapeFromAnnotation.call(void 0, scaled) : null;
|
|
8063
8054
|
const m = [sx, 0, 0, sy, 0, 0];
|
|
8064
|
-
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _318 => _318.components]), () => (
|
|
8055
|
+
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _318 => _318.components]), () => ( _chunkO5RVCDECcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
|
|
8065
8056
|
const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
|
|
8066
8057
|
if (scaled && fromAnnotation) moved.annotation = scaled;
|
|
8067
8058
|
else delete moved.annotation;
|
|
8068
|
-
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () =>
|
|
8059
|
+
layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, l.id, () => _chunkO5RVCDECcjs.rerenderShape.call(void 0, moved, env));
|
|
8069
8060
|
}
|
|
8070
8061
|
}
|
|
8071
8062
|
}
|
|
8072
|
-
const bg =
|
|
8063
|
+
const bg = _chunkO5RVCDECcjs.developTarget.call(void 0, layers, null);
|
|
8073
8064
|
if (bg && bg.source !== "document") layers = _chunkMZXQTKUMcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
|
|
8074
8065
|
if (clearAnnotations) {
|
|
8075
8066
|
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);
|
|
@@ -8090,7 +8081,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8090
8081
|
let out;
|
|
8091
8082
|
try {
|
|
8092
8083
|
out = this.serializeState();
|
|
8093
|
-
if (_optionalChain([this, 'access', _322 => _322.state, 'access', _323 => _323.selection, 'optionalAccess', _324 => _324.bounds])) out.selection =
|
|
8084
|
+
if (_optionalChain([this, 'access', _322 => _322.state, 'access', _323 => _323.selection, 'optionalAccess', _324 => _324.bounds])) out.selection = _chunkO5RVCDECcjs.serializeSelection.call(void 0, this.state.selection);
|
|
8094
8085
|
} finally {
|
|
8095
8086
|
if (root) {
|
|
8096
8087
|
this.state = current;
|
|
@@ -8098,8 +8089,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8098
8089
|
this.viewKey = [];
|
|
8099
8090
|
}
|
|
8100
8091
|
}
|
|
8101
|
-
if (!options || out.version !==
|
|
8102
|
-
return
|
|
8092
|
+
if (!options || out.version !== _chunkO5RVCDECcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
|
|
8093
|
+
return _chunkO5RVCDECcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
|
|
8103
8094
|
}
|
|
8104
8095
|
/**
|
|
8105
8096
|
* Loads a stored state whose v3 assets may live in an asset store (references other than data
|
|
@@ -8107,12 +8098,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
8107
8098
|
* out and listed in `lastLoadProblems`.
|
|
8108
8099
|
*/
|
|
8109
8100
|
async loadJSONAsync(data, options = {}) {
|
|
8110
|
-
if (data.version !==
|
|
8101
|
+
if (data.version !== _chunkO5RVCDECcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
|
|
8111
8102
|
this.loadJSON(data);
|
|
8112
8103
|
return;
|
|
8113
8104
|
}
|
|
8114
8105
|
const problems = [];
|
|
8115
|
-
const assets = await
|
|
8106
|
+
const assets = await _chunkO5RVCDECcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
|
|
8116
8107
|
this.loadJSON({ ...data, assets });
|
|
8117
8108
|
this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
|
|
8118
8109
|
}
|
|
@@ -8124,7 +8115,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8124
8115
|
let selection = null;
|
|
8125
8116
|
if (data.selection) {
|
|
8126
8117
|
try {
|
|
8127
|
-
selection = normalizeSelection(
|
|
8118
|
+
selection = normalizeSelection(_chunkO5RVCDECcjs.deserializeSelection.call(void 0, data.selection));
|
|
8128
8119
|
} catch (e26) {
|
|
8129
8120
|
selection = null;
|
|
8130
8121
|
}
|
|
@@ -8134,7 +8125,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8134
8125
|
this.notify();
|
|
8135
8126
|
}
|
|
8136
8127
|
/** Problems found by the last `loadJSON` / `initialState` of a v3 document (unreadable layers or assets). */
|
|
8137
|
-
|
|
8128
|
+
__init79() {this.lastLoadProblems = []}
|
|
8138
8129
|
applyStored(raw) {
|
|
8139
8130
|
const s = this.state;
|
|
8140
8131
|
const data = migrateSerializedImageEditorState(raw);
|
|
@@ -8142,8 +8133,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8142
8133
|
if (isLayered(data)) {
|
|
8143
8134
|
const problems = [];
|
|
8144
8135
|
const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
|
|
8145
|
-
const storedPatterns =
|
|
8146
|
-
s.layers =
|
|
8136
|
+
const storedPatterns = _chunkO5RVCDECcjs.deserializePatterns.call(void 0, data.patterns, []);
|
|
8137
|
+
s.layers = _chunkO5RVCDECcjs.deserializeLayers.call(void 0, data.layers, {
|
|
8147
8138
|
assets: _nullishCoalesce(data.assets, () => ( {})),
|
|
8148
8139
|
problems,
|
|
8149
8140
|
smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
|
|
@@ -8161,7 +8152,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8161
8152
|
const light = data.globalLight;
|
|
8162
8153
|
if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
|
|
8163
8154
|
else delete s.globalLight;
|
|
8164
|
-
const patterns =
|
|
8155
|
+
const patterns = _chunkO5RVCDECcjs.deserializePatterns.call(void 0, data.patterns, problems);
|
|
8165
8156
|
if (patterns.length) s.patterns = patterns;
|
|
8166
8157
|
else delete s.patterns;
|
|
8167
8158
|
if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
|
|
@@ -8177,7 +8168,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8177
8168
|
}
|
|
8178
8169
|
} else {
|
|
8179
8170
|
const { width, height } = this.naturalSize;
|
|
8180
|
-
const stack =
|
|
8171
|
+
const stack = _chunkO5RVCDECcjs.layersFromLegacy.call(void 0, data, width, height);
|
|
8181
8172
|
s.layers = stack.layers;
|
|
8182
8173
|
s.outputOpacity = stack.outputOpacity;
|
|
8183
8174
|
if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
|
|
@@ -8198,7 +8189,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8198
8189
|
}
|
|
8199
8190
|
serializeState() {
|
|
8200
8191
|
const { width, height } = this.naturalSize;
|
|
8201
|
-
const view =
|
|
8192
|
+
const view = _chunkO5RVCDECcjs.legacyView.call(void 0, this.stack(), width, height, null);
|
|
8202
8193
|
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) {
|
|
8203
8194
|
return {
|
|
8204
8195
|
// States without adjustment layers keep schema 1, so they round-trip unchanged.
|
|
@@ -8213,9 +8204,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
8213
8204
|
annotations: JSON.parse(JSON.stringify(view.annotations))
|
|
8214
8205
|
};
|
|
8215
8206
|
}
|
|
8216
|
-
const { layers, assets, smartContents } =
|
|
8207
|
+
const { layers, assets, smartContents } = _chunkO5RVCDECcjs.serializeLayers.call(void 0, this.state.layers);
|
|
8217
8208
|
const out = {
|
|
8218
|
-
version:
|
|
8209
|
+
version: _chunkO5RVCDECcjs.LAYERED_SCHEMA_VERSION,
|
|
8219
8210
|
width,
|
|
8220
8211
|
height,
|
|
8221
8212
|
layers,
|
|
@@ -8227,7 +8218,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8227
8218
|
};
|
|
8228
8219
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
8229
8220
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
8230
|
-
if (_optionalChain([this, 'access', _331 => _331.state, 'access', _332 => _332.patterns, 'optionalAccess', _333 => _333.length])) out.patterns =
|
|
8221
|
+
if (_optionalChain([this, 'access', _331 => _331.state, 'access', _332 => _332.patterns, 'optionalAccess', _333 => _333.length])) out.patterns = _chunkO5RVCDECcjs.serializePatterns.call(void 0, this.state.patterns);
|
|
8231
8222
|
if (smartContents) out.smartContents = smartContents;
|
|
8232
8223
|
if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
|
|
8233
8224
|
if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
|
|
@@ -8239,7 +8230,7 @@ function serializeAdjustments(adjustments) {
|
|
|
8239
8230
|
const out = { ...adjustments };
|
|
8240
8231
|
if (_optionalChain([out, 'access', _334 => _334.layers, 'optionalAccess', _335 => _335.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
8241
8232
|
else delete out.layers;
|
|
8242
|
-
if (
|
|
8233
|
+
if (_chunkO5RVCDECcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkO5RVCDECcjs.LEGACY_PROCESS_VERSION) {
|
|
8243
8234
|
delete out.process;
|
|
8244
8235
|
if (!out.tint) delete out.tint;
|
|
8245
8236
|
}
|
|
@@ -8250,7 +8241,7 @@ function withDevelop(layer, partial) {
|
|
|
8250
8241
|
let i = filters.findIndex((f) => f.kind === "develop");
|
|
8251
8242
|
if (i === -1) {
|
|
8252
8243
|
filters.unshift({
|
|
8253
|
-
id: layer.source === "document" ?
|
|
8244
|
+
id: layer.source === "document" ? _chunkO5RVCDECcjs.DEVELOP_FILTER_ID : _chunkO5RVCDECcjs.newLayerId.call(void 0, "flt"),
|
|
8254
8245
|
kind: "develop",
|
|
8255
8246
|
enabled: true,
|
|
8256
8247
|
brightness: 0,
|
|
@@ -8259,7 +8250,7 @@ function withDevelop(layer, partial) {
|
|
|
8259
8250
|
exposure: 0,
|
|
8260
8251
|
temperature: 0,
|
|
8261
8252
|
tint: 0,
|
|
8262
|
-
process:
|
|
8253
|
+
process: _chunkO5RVCDECcjs.LATEST_PROCESS_VERSION
|
|
8263
8254
|
});
|
|
8264
8255
|
i = 0;
|
|
8265
8256
|
}
|
|
@@ -8268,7 +8259,7 @@ function withDevelop(layer, partial) {
|
|
|
8268
8259
|
const v = partial[k];
|
|
8269
8260
|
if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
|
|
8270
8261
|
}
|
|
8271
|
-
if ("process" in partial) next.process =
|
|
8262
|
+
if ("process" in partial) next.process = _chunkO5RVCDECcjs.normalizeProcessVersion.call(void 0, partial.process);
|
|
8272
8263
|
filters[i] = next;
|
|
8273
8264
|
return { ...layer, filters };
|
|
8274
8265
|
}
|
|
@@ -8277,7 +8268,7 @@ function withBlur(layer, radius) {
|
|
|
8277
8268
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
8278
8269
|
if (radius > 0) {
|
|
8279
8270
|
filters.push({
|
|
8280
|
-
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _339 => _339.id]), () => ( (layer.source === "document" ?
|
|
8271
|
+
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _339 => _339.id]), () => ( (layer.source === "document" ? _chunkO5RVCDECcjs.BLUR_FILTER_ID : _chunkO5RVCDECcjs.newLayerId.call(void 0, "flt")))),
|
|
8281
8272
|
kind: "blur",
|
|
8282
8273
|
enabled: true,
|
|
8283
8274
|
radius
|
|
@@ -8301,7 +8292,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8301
8292
|
if (!update.mask) delete next.mask;
|
|
8302
8293
|
else {
|
|
8303
8294
|
const current = node.mask && !node.mask.source ? node.mask : null;
|
|
8304
|
-
const memo = current ?
|
|
8295
|
+
const memo = current ? _chunkO5RVCDECcjs.legacyMaskOf.call(void 0, current, width, height) : null;
|
|
8305
8296
|
if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
|
|
8306
8297
|
next.mask = withMaskProps(current, {
|
|
8307
8298
|
density: _nullishCoalesce(update.mask.density, () => ( 1)),
|
|
@@ -8309,7 +8300,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8309
8300
|
enabled: update.mask.enabled !== false
|
|
8310
8301
|
});
|
|
8311
8302
|
} else {
|
|
8312
|
-
const m =
|
|
8303
|
+
const m = _chunkO5RVCDECcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
|
|
8313
8304
|
if (m) next.mask = m;
|
|
8314
8305
|
else delete next.mask;
|
|
8315
8306
|
}
|
|
@@ -8348,7 +8339,7 @@ function resizeLegacyMasks(layers, from, to) {
|
|
|
8348
8339
|
for (const l of _chunkMZXQTKUMcjs.flattenLayers.call(void 0, layers)) {
|
|
8349
8340
|
if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
|
|
8350
8341
|
const old = l.mask;
|
|
8351
|
-
const mask =
|
|
8342
|
+
const mask = _chunkO5RVCDECcjs.rasterMaskFromLegacy.call(void 0, _chunkO5RVCDECcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
|
|
8352
8343
|
if (!mask) continue;
|
|
8353
8344
|
out = _chunkMZXQTKUMcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
|
|
8354
8345
|
}
|
|
@@ -8444,12 +8435,12 @@ function withoutAnnotations(layers) {
|
|
|
8444
8435
|
function parseColor(value) {
|
|
8445
8436
|
if (Array.isArray(value)) {
|
|
8446
8437
|
if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
|
|
8447
|
-
throw new (0,
|
|
8438
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
|
|
8448
8439
|
}
|
|
8449
8440
|
return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
|
|
8450
8441
|
}
|
|
8451
8442
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
|
|
8452
|
-
if (!m) throw new (0,
|
|
8443
|
+
if (!m) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
|
|
8453
8444
|
let hex = m[1];
|
|
8454
8445
|
if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
|
|
8455
8446
|
const n = (i) => parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -8459,7 +8450,7 @@ function readImagePaint(raw) {
|
|
|
8459
8450
|
try {
|
|
8460
8451
|
return _chunk6GFRKLLScjs.parsePaintSource.call(void 0, raw);
|
|
8461
8452
|
} catch (e) {
|
|
8462
|
-
if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0,
|
|
8453
|
+
if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(e.message);
|
|
8463
8454
|
throw e;
|
|
8464
8455
|
}
|
|
8465
8456
|
}
|
|
@@ -8607,7 +8598,7 @@ function loadImageEditorDocument(input) {
|
|
|
8607
8598
|
// Optional: only present when something was selected when saving.
|
|
8608
8599
|
selection: {
|
|
8609
8600
|
parse: (value) => {
|
|
8610
|
-
const mask =
|
|
8601
|
+
const mask = _chunkO5RVCDECcjs.deserializeSelection.call(void 0, value);
|
|
8611
8602
|
const v = value;
|
|
8612
8603
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8613
8604
|
},
|
|
@@ -8695,7 +8686,7 @@ function loadLayeredDocument(doc) {
|
|
|
8695
8686
|
},
|
|
8696
8687
|
selection: {
|
|
8697
8688
|
parse: (value) => {
|
|
8698
|
-
const mask =
|
|
8689
|
+
const mask = _chunkO5RVCDECcjs.deserializeSelection.call(void 0, value);
|
|
8699
8690
|
const v = value;
|
|
8700
8691
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8701
8692
|
},
|
|
@@ -9089,14 +9080,14 @@ function describeSelection(mask) {
|
|
|
9089
9080
|
// src/image-editor/selection-tools.ts
|
|
9090
9081
|
var modeSchema = {
|
|
9091
9082
|
type: "string",
|
|
9092
|
-
enum: [...
|
|
9083
|
+
enum: [..._chunkO5RVCDECcjs.SELECTION_MODES],
|
|
9093
9084
|
description: "How the result combines with the current selection (default replace)."
|
|
9094
9085
|
};
|
|
9095
9086
|
var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
|
|
9096
9087
|
function summary(controller) {
|
|
9097
9088
|
const sel = controller.getSelection();
|
|
9098
9089
|
const { width, height } = controller.getState().imageDimensions;
|
|
9099
|
-
const area =
|
|
9090
|
+
const area = _chunkO5RVCDECcjs.selectionArea.call(void 0, sel);
|
|
9100
9091
|
return {
|
|
9101
9092
|
empty: !sel,
|
|
9102
9093
|
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _351 => _351.bounds]), () => ( null)),
|
|
@@ -9142,7 +9133,7 @@ function createImageSelectionTools(controller) {
|
|
|
9142
9133
|
},
|
|
9143
9134
|
annotations: writeAnnotations("Select a region", true),
|
|
9144
9135
|
handler: ({ shape, x, y, width, height, mode, feather }) => {
|
|
9145
|
-
const opts = { mode:
|
|
9136
|
+
const opts = { mode: _chunkO5RVCDECcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
|
|
9146
9137
|
switch (shape) {
|
|
9147
9138
|
case "all":
|
|
9148
9139
|
controller.selectAll();
|
|
@@ -9195,7 +9186,7 @@ function createImageSelectionTools(controller) {
|
|
|
9195
9186
|
annotations: writeAnnotations("Select by colour", true),
|
|
9196
9187
|
handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
|
|
9197
9188
|
const common = {
|
|
9198
|
-
mode:
|
|
9189
|
+
mode: _chunkO5RVCDECcjs.parseSelectionMode.call(void 0, mode),
|
|
9199
9190
|
sampleMerged: sampleMerged === true,
|
|
9200
9191
|
sample: _nullishCoalesce(sample, () => ( "composite"))
|
|
9201
9192
|
};
|
|
@@ -9216,7 +9207,7 @@ function createImageSelectionTools(controller) {
|
|
|
9216
9207
|
inputSchema: {
|
|
9217
9208
|
type: "object",
|
|
9218
9209
|
properties: {
|
|
9219
|
-
op: { type: "string", enum: [...
|
|
9210
|
+
op: { type: "string", enum: [..._chunkO5RVCDECcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
|
|
9220
9211
|
radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
|
|
9221
9212
|
},
|
|
9222
9213
|
required: ["op", "radius"],
|
|
@@ -9224,7 +9215,7 @@ function createImageSelectionTools(controller) {
|
|
|
9224
9215
|
},
|
|
9225
9216
|
annotations: writeAnnotations("Modify the selection"),
|
|
9226
9217
|
handler: ({ op, radius }) => {
|
|
9227
|
-
if (!
|
|
9218
|
+
if (!_chunkO5RVCDECcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
|
|
9228
9219
|
if (!controller.getSelection()) throw new Error("Nothing is selected.");
|
|
9229
9220
|
controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
|
|
9230
9221
|
return summary(controller);
|
|
@@ -9268,7 +9259,7 @@ function createImageSelectionTools(controller) {
|
|
|
9268
9259
|
type: "object",
|
|
9269
9260
|
properties: {
|
|
9270
9261
|
layerId: { type: "string", description: "Existing adjustment layer to mask." },
|
|
9271
|
-
kind: { type: "string", enum:
|
|
9262
|
+
kind: { type: "string", enum: _chunkO5RVCDECcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
|
|
9272
9263
|
params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
|
|
9273
9264
|
density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
|
|
9274
9265
|
feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
|
|
@@ -9288,11 +9279,11 @@ function createImageSelectionTools(controller) {
|
|
|
9288
9279
|
if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
|
|
9289
9280
|
controller.applySelectionAsLayerMask(layerId, props);
|
|
9290
9281
|
id = layerId;
|
|
9291
|
-
} else if (
|
|
9282
|
+
} else if (_chunkO5RVCDECcjs.isAdjustmentKind.call(void 0, kind)) {
|
|
9292
9283
|
id = controller.addAdjustmentLayer({
|
|
9293
9284
|
kind,
|
|
9294
9285
|
params,
|
|
9295
|
-
mask:
|
|
9286
|
+
mask: _chunkO5RVCDECcjs.layerMaskFromSelection.call(void 0, sel, props)
|
|
9296
9287
|
});
|
|
9297
9288
|
} else {
|
|
9298
9289
|
throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
|
|
@@ -9429,11 +9420,11 @@ function createImageEditTools(controller) {
|
|
|
9429
9420
|
const geometry2 = () => {
|
|
9430
9421
|
const s = controller.getState();
|
|
9431
9422
|
const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
|
|
9432
|
-
const out =
|
|
9423
|
+
const out = _chunkO5RVCDECcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
|
|
9433
9424
|
return {
|
|
9434
9425
|
image: { ...s.imageDimensions },
|
|
9435
9426
|
crop: s.crop ? { ...s.crop } : null,
|
|
9436
|
-
rotation:
|
|
9427
|
+
rotation: _chunkO5RVCDECcjs.normalizeAngle.call(void 0, s.transform.rotate),
|
|
9437
9428
|
flipH: s.transform.flipH,
|
|
9438
9429
|
flipV: s.transform.flipV,
|
|
9439
9430
|
output: { width: Math.round(out.width), height: Math.round(out.height) }
|
|
@@ -9668,7 +9659,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
9668
9659
|
const out = {
|
|
9669
9660
|
id: layer.id,
|
|
9670
9661
|
type: layer.type,
|
|
9671
|
-
name: layer.name || (layer.type === "adjustment" ?
|
|
9662
|
+
name: layer.name || (layer.type === "adjustment" ? _chunkO5RVCDECcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
|
|
9672
9663
|
visible: layer.visible,
|
|
9673
9664
|
opacity: round3(layer.opacity),
|
|
9674
9665
|
blend: layer.blend,
|
|
@@ -9757,8 +9748,8 @@ function createImageLayerTools(controller) {
|
|
|
9757
9748
|
};
|
|
9758
9749
|
};
|
|
9759
9750
|
const exists = (id, what = "layerId") => {
|
|
9760
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
9761
|
-
|
|
9751
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
|
|
9752
|
+
_chunkO5RVCDECcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
9762
9753
|
return id;
|
|
9763
9754
|
};
|
|
9764
9755
|
const listLayers = {
|
|
@@ -9794,7 +9785,7 @@ function createImageLayerTools(controller) {
|
|
|
9794
9785
|
handler: ({ layerId, target }) => {
|
|
9795
9786
|
const id = exists(layerId);
|
|
9796
9787
|
const layer = controller.getLayer(id);
|
|
9797
|
-
if (target === "mask" && !layer.mask) throw new (0,
|
|
9788
|
+
if (target === "mask" && !layer.mask) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
9798
9789
|
controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
|
|
9799
9790
|
return { layer: describe(id), activeTarget: controller.getState().activeTarget };
|
|
9800
9791
|
}
|
|
@@ -9819,7 +9810,7 @@ function createImageLayerTools(controller) {
|
|
|
9819
9810
|
},
|
|
9820
9811
|
annotations: { title: "Add a pixel layer", ...WRITE2 },
|
|
9821
9812
|
handler: async (args) => {
|
|
9822
|
-
if (args.color !== void 0 && args.image !== void 0) throw new (0,
|
|
9813
|
+
if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give color or image, not both.");
|
|
9823
9814
|
for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
|
|
9824
9815
|
const init = {
|
|
9825
9816
|
name: args.name,
|
|
@@ -9909,7 +9900,7 @@ function createImageLayerTools(controller) {
|
|
|
9909
9900
|
const id = exists(args.layerId);
|
|
9910
9901
|
const props = {};
|
|
9911
9902
|
for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
|
|
9912
|
-
if (!Object.keys(props).length) throw new (0,
|
|
9903
|
+
if (!Object.keys(props).length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give at least one property to change.");
|
|
9913
9904
|
controller.setLayerProperties(id, props);
|
|
9914
9905
|
return { layer: describe(id) };
|
|
9915
9906
|
}
|
|
@@ -10003,8 +9994,8 @@ function createImageLayerTools(controller) {
|
|
|
10003
9994
|
annotations: { title: "Move a layer's pixels", ...WRITE2 },
|
|
10004
9995
|
handler: ({ layerId, x, y, dx, dy }) => {
|
|
10005
9996
|
const id = exists(layerId);
|
|
10006
|
-
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0,
|
|
10007
|
-
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0,
|
|
9997
|
+
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give x and y, or dx and dy.");
|
|
9998
|
+
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
|
|
10008
9999
|
return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
|
|
10009
10000
|
}
|
|
10010
10001
|
};
|
|
@@ -10076,7 +10067,7 @@ function createImageLayerTools(controller) {
|
|
|
10076
10067
|
annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
|
|
10077
10068
|
handler: ({ layerId, density, feather, enabled, linked }) => {
|
|
10078
10069
|
const id = exists(layerId);
|
|
10079
|
-
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0,
|
|
10070
|
+
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give density, feather, enabled or linked.");
|
|
10080
10071
|
const mask = controller.setLayerMaskProps(id, {
|
|
10081
10072
|
density,
|
|
10082
10073
|
feather,
|
|
@@ -10159,7 +10150,7 @@ function createImageLayerTools(controller) {
|
|
|
10159
10150
|
handler: (args) => {
|
|
10160
10151
|
const id = exists(args.layerId);
|
|
10161
10152
|
const changes = filterValues(args);
|
|
10162
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10153
|
+
if (!Object.keys(changes).length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give at least one value to change.");
|
|
10163
10154
|
return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
|
|
10164
10155
|
}
|
|
10165
10156
|
};
|
|
@@ -10423,8 +10414,8 @@ function describeLayerEffects(effects) {
|
|
|
10423
10414
|
}
|
|
10424
10415
|
function createImageEffectTools(controller) {
|
|
10425
10416
|
const layerArg = (id) => {
|
|
10426
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10427
|
-
|
|
10417
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
|
|
10418
|
+
_chunkO5RVCDECcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
10428
10419
|
return id;
|
|
10429
10420
|
};
|
|
10430
10421
|
const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
|
|
@@ -10455,7 +10446,7 @@ function createImageEffectTools(controller) {
|
|
|
10455
10446
|
annotations: { title: "Add a layer effect", ...WRITE3 },
|
|
10456
10447
|
handler: ({ layerId, kind, settings, index }) => {
|
|
10457
10448
|
const id = layerArg(layerId);
|
|
10458
|
-
if (!_chunkMZXQTKUMcjs.isLayerEffectKind.call(void 0, kind)) throw new (0,
|
|
10449
|
+
if (!_chunkMZXQTKUMcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`kind must be one of ${_chunkMZXQTKUMcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
|
|
10459
10450
|
const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
|
|
10460
10451
|
return result(id, { effectId: effect.id });
|
|
10461
10452
|
}
|
|
@@ -10475,7 +10466,7 @@ function createImageEffectTools(controller) {
|
|
|
10475
10466
|
handler: ({ layerId, effectId, settings }) => {
|
|
10476
10467
|
const id = layerArg(layerId);
|
|
10477
10468
|
const changes = _nullishCoalesce(settings, () => ( {}));
|
|
10478
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10469
|
+
if (!Object.keys(changes).length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give at least one setting to change.");
|
|
10479
10470
|
controller.updateLayerEffect(id, effectId, changes);
|
|
10480
10471
|
return result(id);
|
|
10481
10472
|
}
|
|
@@ -10527,7 +10518,7 @@ function createImageEffectTools(controller) {
|
|
|
10527
10518
|
},
|
|
10528
10519
|
annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
|
|
10529
10520
|
handler: ({ angle, altitude }) => {
|
|
10530
|
-
if (angle === void 0 && altitude === void 0) throw new (0,
|
|
10521
|
+
if (angle === void 0 && altitude === void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give angle, altitude or both.");
|
|
10531
10522
|
const next = {};
|
|
10532
10523
|
if (angle !== void 0) next.angle = angle;
|
|
10533
10524
|
if (altitude !== void 0) next.altitude = altitude;
|
|
@@ -10687,14 +10678,14 @@ function handlePaintShortcut(controller, e) {
|
|
|
10687
10678
|
return false;
|
|
10688
10679
|
}
|
|
10689
10680
|
var PaintGesture = (_class8 = class {
|
|
10690
|
-
constructor(controller) {;_class8.prototype.
|
|
10681
|
+
constructor(controller) {;_class8.prototype.__init80.call(this);_class8.prototype.__init81.call(this);_class8.prototype.__init82.call(this);
|
|
10691
10682
|
this.controller = controller;
|
|
10692
10683
|
}
|
|
10693
10684
|
|
|
10694
|
-
|
|
10695
|
-
|
|
10685
|
+
__init80() {this.stroke = null}
|
|
10686
|
+
__init81() {this.move = null}
|
|
10696
10687
|
/** The last refusal (e.g. "layer is locked"), for the editor to show. */
|
|
10697
|
-
|
|
10688
|
+
__init82() {this.error = null}
|
|
10698
10689
|
get active() {
|
|
10699
10690
|
return Boolean(this.stroke || this.move);
|
|
10700
10691
|
}
|
|
@@ -10708,7 +10699,7 @@ var PaintGesture = (_class8 = class {
|
|
|
10708
10699
|
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.`);
|
|
10709
10700
|
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.`);
|
|
10710
10701
|
const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
|
|
10711
|
-
const b =
|
|
10702
|
+
const b = _chunkO5RVCDECcjs.shapeGeometryBounds.call(void 0, layer);
|
|
10712
10703
|
return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
|
|
10713
10704
|
})();
|
|
10714
10705
|
this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
|
|
@@ -10866,9 +10857,9 @@ function createImagePaintTools(controller) {
|
|
|
10866
10857
|
annotations: { title: "Paint a brush stroke", ...WRITE4 },
|
|
10867
10858
|
handler: (args) => {
|
|
10868
10859
|
const tool = args.tool;
|
|
10869
|
-
if (args.mixer !== void 0 && tool !== "mixer") throw new (0,
|
|
10870
|
-
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0,
|
|
10871
|
-
if (args.paint !== void 0 && args.color !== void 0) throw new (0,
|
|
10860
|
+
if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
|
|
10861
|
+
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
|
|
10862
|
+
if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give color or paint, not both.");
|
|
10872
10863
|
const result = controller.paintStroke({
|
|
10873
10864
|
tool,
|
|
10874
10865
|
points: args.points,
|
|
@@ -10999,7 +10990,7 @@ function profileArg(v) {
|
|
|
10999
10990
|
try {
|
|
11000
10991
|
return _chunkDCLJNVZScjs.base64ToBytes.call(void 0, s.slice(4));
|
|
11001
10992
|
} catch (e28) {
|
|
11002
|
-
throw new (0,
|
|
10993
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("The icc: value is not valid base64.");
|
|
11003
10994
|
}
|
|
11004
10995
|
}
|
|
11005
10996
|
return s;
|
|
@@ -11064,10 +11055,10 @@ function createImageColorTools(controller) {
|
|
|
11064
11055
|
annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11065
11056
|
handler: (args) => {
|
|
11066
11057
|
if (args.off === true) {
|
|
11067
|
-
if (args.profile !== void 0) throw new (0,
|
|
11058
|
+
if (args.profile !== void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give either off true or a profile, not both.");
|
|
11068
11059
|
return controller.setProofSetup(null);
|
|
11069
11060
|
}
|
|
11070
|
-
if (args.profile === void 0) throw new (0,
|
|
11061
|
+
if (args.profile === void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
|
|
11071
11062
|
const s = controller.setProofSetup({
|
|
11072
11063
|
profile: profileArg(args.profile),
|
|
11073
11064
|
...args.intent !== void 0 ? { intent: args.intent } : {},
|
|
@@ -11119,7 +11110,7 @@ function createImageColorTools(controller) {
|
|
|
11119
11110
|
},
|
|
11120
11111
|
annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11121
11112
|
handler: (args) => {
|
|
11122
|
-
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0,
|
|
11113
|
+
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
|
|
11123
11114
|
return controller.setColorMode(args.mode, {
|
|
11124
11115
|
...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
|
|
11125
11116
|
...args.intent !== void 0 ? { intent: args.intent } : {}
|
|
@@ -11184,7 +11175,7 @@ function checkSource(controller, source) {
|
|
|
11184
11175
|
const p = source;
|
|
11185
11176
|
const { width, height } = controller.getState().imageDimensions;
|
|
11186
11177
|
if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
|
|
11187
|
-
throw new (0,
|
|
11178
|
+
throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
|
|
11188
11179
|
}
|
|
11189
11180
|
return p;
|
|
11190
11181
|
}
|
|
@@ -11378,10 +11369,10 @@ function createImageRetouchTools(controller) {
|
|
|
11378
11369
|
annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
|
|
11379
11370
|
handler: (args) => {
|
|
11380
11371
|
if (args.clear === true) {
|
|
11381
|
-
if (args.x !== void 0 || args.y !== void 0) throw new (0,
|
|
11372
|
+
if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give either clear true or x and y, not both.");
|
|
11382
11373
|
return controller.setCloneSource(null);
|
|
11383
11374
|
}
|
|
11384
|
-
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0,
|
|
11375
|
+
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
|
|
11385
11376
|
return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
|
|
11386
11377
|
}
|
|
11387
11378
|
};
|
|
@@ -11402,11 +11393,11 @@ var DATA = {
|
|
|
11402
11393
|
description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
|
|
11403
11394
|
};
|
|
11404
11395
|
function psdBytesFromBase64(data) {
|
|
11405
|
-
if (typeof data !== "string" || !data.trim()) throw new (0,
|
|
11396
|
+
if (typeof data !== "string" || !data.trim()) throw new (0, _chunkO5RVCDECcjs.PsdError)("data is required: the PSD file as base64.");
|
|
11406
11397
|
const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
|
|
11407
|
-
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0,
|
|
11398
|
+
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkO5RVCDECcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
|
|
11408
11399
|
const bytes = _chunkDCLJNVZScjs.base64ToBytes.call(void 0, body);
|
|
11409
|
-
if (bytes.length < 26) throw new (0,
|
|
11400
|
+
if (bytes.length < 26) throw new (0, _chunkO5RVCDECcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
|
|
11410
11401
|
return bytes;
|
|
11411
11402
|
}
|
|
11412
11403
|
function createImagePsdTools(controller) {
|
|
@@ -11417,7 +11408,7 @@ function createImagePsdTools(controller) {
|
|
|
11417
11408
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
11418
11409
|
annotations: { title: "Inspect a PSD", ...READ7 },
|
|
11419
11410
|
handler: ({ data }) => {
|
|
11420
|
-
const res =
|
|
11411
|
+
const res = _chunkO5RVCDECcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
|
|
11421
11412
|
return {
|
|
11422
11413
|
width: res.width,
|
|
11423
11414
|
height: res.height,
|
|
@@ -11504,7 +11495,7 @@ var GEOMETRY = {
|
|
|
11504
11495
|
dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
|
|
11505
11496
|
reference: {
|
|
11506
11497
|
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}.",
|
|
11507
|
-
anyOf: [{ type: "string", enum:
|
|
11498
|
+
anyOf: [{ type: "string", enum: _chunkO5RVCDECcjs.TRANSFORM_ANCHORS }, POINT]
|
|
11508
11499
|
},
|
|
11509
11500
|
matrix: {
|
|
11510
11501
|
type: "array",
|
|
@@ -11525,14 +11516,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
|
|
|
11525
11516
|
function geometryFrom(args) {
|
|
11526
11517
|
const numeric = NUMERIC.filter((k) => args[k] !== void 0);
|
|
11527
11518
|
const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
|
|
11528
|
-
if (ways === 0) throw new (0,
|
|
11529
|
-
if (ways > 1) throw new (0,
|
|
11519
|
+
if (ways === 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
|
|
11520
|
+
if (ways > 1) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
|
|
11530
11521
|
if (args.matrix !== void 0) return { matrix: args.matrix };
|
|
11531
11522
|
if (args.corners !== void 0) return { corners: args.corners };
|
|
11532
11523
|
const params = {};
|
|
11533
11524
|
for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
|
|
11534
|
-
if (params.scaleX === 0 || params.scaleY === 0) throw new (0,
|
|
11535
|
-
if (typeof params.reference === "string" && !
|
|
11525
|
+
if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
|
|
11526
|
+
if (typeof params.reference === "string" && !_chunkO5RVCDECcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkO5RVCDECcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
|
|
11536
11527
|
return { params };
|
|
11537
11528
|
}
|
|
11538
11529
|
function targetFrom(args) {
|
|
@@ -11581,15 +11572,15 @@ function createImageTransformTools(controller) {
|
|
|
11581
11572
|
moved: [...s.moves],
|
|
11582
11573
|
frame: { ...s.box },
|
|
11583
11574
|
corners: s.startGeometry.corners.map(roundPoint),
|
|
11584
|
-
center: roundPoint(
|
|
11575
|
+
center: roundPoint(_chunkO5RVCDECcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
|
|
11585
11576
|
};
|
|
11586
11577
|
if (s.smartObject) out.smartObject = true;
|
|
11587
11578
|
s.cancel();
|
|
11588
11579
|
if (args.meshColumns !== void 0) {
|
|
11589
11580
|
const cols = args.meshColumns;
|
|
11590
11581
|
const rows = _nullishCoalesce(args.meshRows, () => ( cols));
|
|
11591
|
-
const mesh =
|
|
11592
|
-
out.mesh = { columns: cols, rows, pointsPerRow:
|
|
11582
|
+
const mesh = _chunkQQKTOA4Ucjs.identityWarpMesh.call(void 0, s.box, cols, rows);
|
|
11583
|
+
out.mesh = { columns: cols, rows, pointsPerRow: _chunkQQKTOA4Ucjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkQQKTOA4Ucjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
|
|
11593
11584
|
}
|
|
11594
11585
|
return out;
|
|
11595
11586
|
}
|
|
@@ -11614,7 +11605,7 @@ function createImageTransformTools(controller) {
|
|
|
11614
11605
|
type: "object",
|
|
11615
11606
|
properties: {
|
|
11616
11607
|
...TARGET3,
|
|
11617
|
-
style: { type: "string", enum:
|
|
11608
|
+
style: { type: "string", enum: _chunkQQKTOA4Ucjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
|
|
11618
11609
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
|
|
11619
11610
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
|
|
11620
11611
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
|
|
@@ -11636,11 +11627,11 @@ function createImageTransformTools(controller) {
|
|
|
11636
11627
|
annotations: { title: "Warp a layer", ...WRITE6 },
|
|
11637
11628
|
handler: (args) => {
|
|
11638
11629
|
const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
|
|
11639
|
-
if (hasPreset && args.mesh !== void 0) throw new (0,
|
|
11640
|
-
if (!hasPreset && args.mesh === void 0) throw new (0,
|
|
11630
|
+
if (hasPreset && args.mesh !== void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
|
|
11631
|
+
if (!hasPreset && args.mesh === void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give a preset style or a mesh.");
|
|
11641
11632
|
let warp;
|
|
11642
11633
|
if (hasPreset) {
|
|
11643
|
-
if (args.style === void 0) throw new (0,
|
|
11634
|
+
if (args.style === void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkQQKTOA4Ucjs.WARP_STYLES.join(", ")}.`);
|
|
11644
11635
|
warp = {
|
|
11645
11636
|
style: args.style,
|
|
11646
11637
|
bend: _nullishCoalesce(args.bend, () => ( 50)),
|
|
@@ -11651,7 +11642,7 @@ function createImageTransformTools(controller) {
|
|
|
11651
11642
|
} else {
|
|
11652
11643
|
const m = args.mesh;
|
|
11653
11644
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
11654
|
-
if (m.points.length !== want) throw new (0,
|
|
11645
|
+
if (m.points.length !== want) throw new (0, _chunkO5RVCDECcjs.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}.`);
|
|
11655
11646
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
11656
11647
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
11657
11648
|
}
|
|
@@ -11746,13 +11737,13 @@ function settingsFrom(args) {
|
|
|
11746
11737
|
return out;
|
|
11747
11738
|
}
|
|
11748
11739
|
function imageArg(image) {
|
|
11749
|
-
if (typeof image !== "string" || !image.trim()) throw new (0,
|
|
11740
|
+
if (typeof image !== "string" || !image.trim()) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
|
|
11750
11741
|
return image.trim();
|
|
11751
11742
|
}
|
|
11752
11743
|
function createImageSmartObjectTools(controller) {
|
|
11753
11744
|
const smartId = (id) => {
|
|
11754
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
11755
|
-
|
|
11745
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
|
|
11746
|
+
_chunkO5RVCDECcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
|
|
11756
11747
|
return id;
|
|
11757
11748
|
};
|
|
11758
11749
|
const info = (id) => {
|
|
@@ -11789,7 +11780,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11789
11780
|
},
|
|
11790
11781
|
annotations: { title: "Convert to Smart Object", ...WRITE7 },
|
|
11791
11782
|
handler: ({ layerIds, name }) => {
|
|
11792
|
-
for (const id2 of _nullishCoalesce(layerIds, () => ( [])))
|
|
11783
|
+
for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkO5RVCDECcjs.requireLayer.call(void 0, controller.getLayers(), id2);
|
|
11793
11784
|
const id = controller.convertToSmartObject(layerIds, { name });
|
|
11794
11785
|
return { layer: layerSummary(id), smartObject: info(id) };
|
|
11795
11786
|
}
|
|
@@ -11826,7 +11817,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11826
11817
|
{
|
|
11827
11818
|
type: "object",
|
|
11828
11819
|
properties: {
|
|
11829
|
-
style: { type: "string", enum:
|
|
11820
|
+
style: { type: "string", enum: _chunkQQKTOA4Ucjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
|
|
11830
11821
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
|
|
11831
11822
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
|
|
11832
11823
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
|
|
@@ -11862,12 +11853,12 @@ function createImageSmartObjectTools(controller) {
|
|
|
11862
11853
|
else if (w) {
|
|
11863
11854
|
const m = w;
|
|
11864
11855
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
11865
|
-
if (m.points.length !== want) throw new (0,
|
|
11856
|
+
if (m.points.length !== want) throw new (0, _chunkO5RVCDECcjs.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}.`);
|
|
11866
11857
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
11867
11858
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
11868
11859
|
}
|
|
11869
11860
|
const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
|
|
11870
|
-
if (!keys.some((k) => args[k] !== void 0)) throw new (0,
|
|
11861
|
+
if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
|
|
11871
11862
|
const res = controller.setSmartObjectTransform(id, {
|
|
11872
11863
|
corners: args.corners,
|
|
11873
11864
|
matrix: args.matrix,
|
|
@@ -11992,7 +11983,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
11992
11983
|
handler: (args) => {
|
|
11993
11984
|
const id = smartId(args.layerId);
|
|
11994
11985
|
const changes = settingsFrom(args);
|
|
11995
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
11986
|
+
if (!Object.keys(changes).length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give at least one value to change.");
|
|
11996
11987
|
const filter = controller.updateSmartFilter(id, args.filterId, changes);
|
|
11997
11988
|
return { layerId: id, filter, smartFilters: info(id).smartFilters };
|
|
11998
11989
|
}
|
|
@@ -12313,8 +12304,8 @@ function geometry(args) {
|
|
|
12313
12304
|
}
|
|
12314
12305
|
function createImageShapeTools(controller) {
|
|
12315
12306
|
const shapeId = (id) => {
|
|
12316
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12317
|
-
|
|
12307
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
|
|
12308
|
+
_chunkO5RVCDECcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
|
|
12318
12309
|
return id;
|
|
12319
12310
|
};
|
|
12320
12311
|
const layerSummary = (id) => {
|
|
@@ -12389,7 +12380,7 @@ function createImageShapeTools(controller) {
|
|
|
12389
12380
|
annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
|
|
12390
12381
|
handler: ({ layerId, fill, stroke, fillRule }) => {
|
|
12391
12382
|
const id = shapeId(layerId);
|
|
12392
|
-
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0,
|
|
12383
|
+
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
|
|
12393
12384
|
return controller.setShapeStyle(id, { fill, stroke, fillRule });
|
|
12394
12385
|
}
|
|
12395
12386
|
};
|
|
@@ -12438,7 +12429,7 @@ function createImageShapeTools(controller) {
|
|
|
12438
12429
|
handler: ({ layerId, componentIndex, ...rest }) => {
|
|
12439
12430
|
const id = shapeId(layerId);
|
|
12440
12431
|
const change = geometry(rest);
|
|
12441
|
-
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0,
|
|
12432
|
+
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("Give shape, subpaths or op to change.");
|
|
12442
12433
|
return controller.setShapeComponent(id, componentIndex, change);
|
|
12443
12434
|
}
|
|
12444
12435
|
};
|
|
@@ -12512,8 +12503,8 @@ function pick2(args, keys) {
|
|
|
12512
12503
|
}
|
|
12513
12504
|
function createImageTypeTools(controller) {
|
|
12514
12505
|
const typeId = (id) => {
|
|
12515
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12516
|
-
|
|
12506
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
|
|
12507
|
+
_chunkO5RVCDECcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
|
|
12517
12508
|
return id;
|
|
12518
12509
|
};
|
|
12519
12510
|
const layerSummary = (id) => {
|
|
@@ -12593,7 +12584,7 @@ function createImageTypeTools(controller) {
|
|
|
12593
12584
|
annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
|
|
12594
12585
|
handler: (args) => {
|
|
12595
12586
|
const style = pick2(args, Object.keys(STYLE));
|
|
12596
|
-
if (!Object.keys(style).length) throw new (0,
|
|
12587
|
+
if (!Object.keys(style).length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
|
|
12597
12588
|
return controller.setTextStyle(typeId(args.layerId), style, range(args));
|
|
12598
12589
|
}
|
|
12599
12590
|
};
|
|
@@ -12605,7 +12596,7 @@ function createImageTypeTools(controller) {
|
|
|
12605
12596
|
annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
|
|
12606
12597
|
handler: (args) => {
|
|
12607
12598
|
const style = pick2(args, Object.keys(PARAGRAPH));
|
|
12608
|
-
if (!Object.keys(style).length) throw new (0,
|
|
12599
|
+
if (!Object.keys(style).length) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
|
|
12609
12600
|
return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
|
|
12610
12601
|
}
|
|
12611
12602
|
};
|
|
@@ -12627,7 +12618,7 @@ function createImageTypeTools(controller) {
|
|
|
12627
12618
|
annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
|
|
12628
12619
|
handler: ({ layerId, kind, width, height }) => {
|
|
12629
12620
|
const id = typeId(layerId);
|
|
12630
|
-
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0,
|
|
12621
|
+
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkO5RVCDECcjs.LayerOperationError)("kind box needs width and height in pixels.");
|
|
12631
12622
|
return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
|
|
12632
12623
|
}
|
|
12633
12624
|
};
|
|
@@ -12649,7 +12640,7 @@ function createImageTypeTools(controller) {
|
|
|
12649
12640
|
var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
|
|
12650
12641
|
function adjustmentsSummary(adjustments) {
|
|
12651
12642
|
return {
|
|
12652
|
-
process:
|
|
12643
|
+
process: _chunkO5RVCDECcjs.normalizeProcessVersion.call(void 0, adjustments.process),
|
|
12653
12644
|
values: readAdjustmentControls(adjustments),
|
|
12654
12645
|
layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
|
|
12655
12646
|
};
|
|
@@ -12692,7 +12683,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12692
12683
|
default: def,
|
|
12693
12684
|
...requiresProcess ? { requiresProcess } : {}
|
|
12694
12685
|
})),
|
|
12695
|
-
layerKinds:
|
|
12686
|
+
layerKinds: _chunkO5RVCDECcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
|
|
12696
12687
|
kind,
|
|
12697
12688
|
label,
|
|
12698
12689
|
controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
|
|
@@ -12778,7 +12769,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12778
12769
|
const result = { applied, clamped };
|
|
12779
12770
|
if (typeof label === "string" && label) result.label = label;
|
|
12780
12771
|
const notes = [];
|
|
12781
|
-
if ("tint" in applied &&
|
|
12772
|
+
if ("tint" in applied && _chunkO5RVCDECcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
|
|
12782
12773
|
notes.push("Tint has no effect on process 1 edits.");
|
|
12783
12774
|
}
|
|
12784
12775
|
if (notes.length) result.notes = notes;
|
|
@@ -12788,11 +12779,11 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12788
12779
|
const addLayer = {
|
|
12789
12780
|
name: "add_adjustment_layer",
|
|
12790
12781
|
title: "Add an adjustment layer",
|
|
12791
|
-
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " +
|
|
12782
|
+
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkO5RVCDECcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
|
|
12792
12783
|
inputSchema: {
|
|
12793
12784
|
type: "object",
|
|
12794
12785
|
properties: {
|
|
12795
|
-
kind: { type: "string", enum:
|
|
12786
|
+
kind: { type: "string", enum: _chunkO5RVCDECcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
|
|
12796
12787
|
params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
|
|
12797
12788
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
|
|
12798
12789
|
blend: { type: "string", enum: _chunkJ5BA3BQ6cjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
|
|
@@ -12811,7 +12802,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
12811
12802
|
openWorldHint: false
|
|
12812
12803
|
},
|
|
12813
12804
|
handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
|
|
12814
|
-
if (!
|
|
12805
|
+
if (!_chunkO5RVCDECcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
|
|
12815
12806
|
if (blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
12816
12807
|
if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
|
|
12817
12808
|
for (const ref of [aboveId, parentId]) {
|
|
@@ -12905,7 +12896,7 @@ function boxToCurvePoint(x, y, width, height) {
|
|
|
12905
12896
|
return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
|
|
12906
12897
|
}
|
|
12907
12898
|
function curveSvgPath(points, width, height, samples = 64) {
|
|
12908
|
-
const lut =
|
|
12899
|
+
const lut = _chunkO5RVCDECcjs.curveLutFromLevels.call(void 0, points);
|
|
12909
12900
|
const n = lut.length - 1;
|
|
12910
12901
|
let d = "";
|
|
12911
12902
|
for (let i = 0; i <= samples; i++) {
|
|
@@ -12952,18 +12943,18 @@ var round22 = (v) => Math.round(v * 100) / 100;
|
|
|
12952
12943
|
|
|
12953
12944
|
// src/image-editor/selection/gesture.ts
|
|
12954
12945
|
var SelectionGesture = (_class9 = class {
|
|
12955
|
-
constructor(controller, getOptions) {;_class9.prototype.
|
|
12946
|
+
constructor(controller, getOptions) {;_class9.prototype.__init83.call(this);_class9.prototype.__init84.call(this);_class9.prototype.__init85.call(this);_class9.prototype.__init86.call(this);_class9.prototype.__init87.call(this);
|
|
12956
12947
|
this.controller = controller;
|
|
12957
12948
|
this.getOptions = getOptions;
|
|
12958
12949
|
}
|
|
12959
12950
|
|
|
12960
12951
|
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12952
|
+
__init83() {this.start = null}
|
|
12953
|
+
__init84() {this.points = []}
|
|
12954
|
+
__init85() {this.current = null}
|
|
12955
|
+
__init86() {this.modifiers = {}}
|
|
12965
12956
|
/** The last error (e.g. pixels unavailable for the wand), for the UI to show. */
|
|
12966
|
-
|
|
12957
|
+
__init87() {this.error = null}
|
|
12967
12958
|
get active() {
|
|
12968
12959
|
return this.start !== null;
|
|
12969
12960
|
}
|
|
@@ -13249,15 +13240,15 @@ function liveShapeForDrag(o, a, b, mods = {}) {
|
|
|
13249
13240
|
return null;
|
|
13250
13241
|
}
|
|
13251
13242
|
var ShapeDrawGesture = (_class10 = class {
|
|
13252
|
-
constructor(controller, options) {;_class10.prototype.
|
|
13243
|
+
constructor(controller, options) {;_class10.prototype.__init88.call(this);_class10.prototype.__init89.call(this);_class10.prototype.__init90.call(this);
|
|
13253
13244
|
this.controller = controller;
|
|
13254
13245
|
this.options = options;
|
|
13255
13246
|
}
|
|
13256
13247
|
|
|
13257
13248
|
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
|
|
13249
|
+
__init88() {this.start = null}
|
|
13250
|
+
__init89() {this.layerId = null}
|
|
13251
|
+
__init90() {this.error = null}
|
|
13261
13252
|
get active() {
|
|
13262
13253
|
return this.start !== null;
|
|
13263
13254
|
}
|
|
@@ -13318,7 +13309,7 @@ function applyShapeOptions(controller, layerId, change) {
|
|
|
13318
13309
|
if (Object.keys(shape).length) controller.setShapeComponent(layerId, 0, { shape });
|
|
13319
13310
|
}
|
|
13320
13311
|
var TextEditSession = (_class11 = class {
|
|
13321
|
-
constructor(controller, layerId, index) {;_class11.prototype.
|
|
13312
|
+
constructor(controller, layerId, index) {;_class11.prototype.__init91.call(this);_class11.prototype.__init92.call(this);_class11.prototype.__init93.call(this);
|
|
13322
13313
|
this.controller = controller;
|
|
13323
13314
|
this.layerId = layerId;
|
|
13324
13315
|
const n = this.text.length;
|
|
@@ -13328,9 +13319,9 @@ var TextEditSession = (_class11 = class {
|
|
|
13328
13319
|
|
|
13329
13320
|
|
|
13330
13321
|
|
|
13331
|
-
|
|
13332
|
-
|
|
13333
|
-
|
|
13322
|
+
__init91() {this.changed = false}
|
|
13323
|
+
__init92() {this.listeners = /* @__PURE__ */ new Set()}
|
|
13324
|
+
__init93() {this.error = null}
|
|
13334
13325
|
get layer() {
|
|
13335
13326
|
const l = _optionalChain([_chunkMZXQTKUMcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _392 => _392.layer]);
|
|
13336
13327
|
if (!l || l.type !== "type") throw new Error("The type layer being edited is gone.");
|
|
@@ -13415,7 +13406,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13415
13406
|
else {
|
|
13416
13407
|
const layout = this.layout();
|
|
13417
13408
|
if (layout && layout.lines.length) {
|
|
13418
|
-
const c =
|
|
13409
|
+
const c = _chunkQQKTOA4Ucjs.caretAt.call(void 0, layout, f);
|
|
13419
13410
|
const line = layout.lines[c.line];
|
|
13420
13411
|
if (to === "home") f = line.start;
|
|
13421
13412
|
else if (to === "end") {
|
|
@@ -13510,7 +13501,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13510
13501
|
styleHere() {
|
|
13511
13502
|
const layer = this.layer;
|
|
13512
13503
|
const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
|
|
13513
|
-
return
|
|
13504
|
+
return _chunkQQKTOA4Ucjs.styleAt.call(void 0, layer.runs, at, _chunkQQKTOA4Ucjs.DEFAULT_TEXT_STYLE);
|
|
13514
13505
|
}
|
|
13515
13506
|
info() {
|
|
13516
13507
|
return this.controller.getTextLayer(this.layerId);
|
|
@@ -13519,8 +13510,8 @@ var TextEditSession = (_class11 = class {
|
|
|
13519
13510
|
overlay() {
|
|
13520
13511
|
const layer = this.layer;
|
|
13521
13512
|
const layout = this.layout();
|
|
13522
|
-
const m =
|
|
13523
|
-
const at = (x, y) =>
|
|
13513
|
+
const m = _chunkO5RVCDECcjs.textMatrix.call(void 0, layer);
|
|
13514
|
+
const at = (x, y) => _chunkQQKTOA4Ucjs.applyMatrix.call(void 0, m, { x, y });
|
|
13524
13515
|
let frame = null;
|
|
13525
13516
|
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)];
|
|
13526
13517
|
else if (layout) {
|
|
@@ -13540,7 +13531,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13540
13531
|
selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
|
|
13541
13532
|
}
|
|
13542
13533
|
}
|
|
13543
|
-
const c =
|
|
13534
|
+
const c = _chunkQQKTOA4Ucjs.caretAt.call(void 0, layout, this.focus);
|
|
13544
13535
|
return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
|
|
13545
13536
|
}
|
|
13546
13537
|
/** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
|
|
@@ -13555,7 +13546,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13555
13546
|
}
|
|
13556
13547
|
if (this.layer.name === "Text" && this.changed) {
|
|
13557
13548
|
try {
|
|
13558
|
-
this.controller.setLayerProperties(this.layerId, { name:
|
|
13549
|
+
this.controller.setLayerProperties(this.layerId, { name: _chunkO5RVCDECcjs.typeLayerName.call(void 0, this.text) }, false);
|
|
13559
13550
|
} catch (e30) {
|
|
13560
13551
|
}
|
|
13561
13552
|
}
|
|
@@ -13566,8 +13557,8 @@ function typeLayerAt(controller, p, slop = 4) {
|
|
|
13566
13557
|
const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
|
|
13567
13558
|
for (const l of layers) {
|
|
13568
13559
|
if (!l.visible) continue;
|
|
13569
|
-
const inv = invert(
|
|
13570
|
-
const q =
|
|
13560
|
+
const inv = invert(_chunkO5RVCDECcjs.textMatrix.call(void 0, l));
|
|
13561
|
+
const q = _chunkQQKTOA4Ucjs.applyMatrix.call(void 0, inv, p);
|
|
13571
13562
|
let b = null;
|
|
13572
13563
|
if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
|
|
13573
13564
|
else {
|
|
@@ -13595,15 +13586,15 @@ function invert(m) {
|
|
|
13595
13586
|
return [d / det, -b / det, -c / det, a / det, (c * f - d * e) / det, (b * e - a * f) / det];
|
|
13596
13587
|
}
|
|
13597
13588
|
var TypeToolGesture = (_class12 = class {
|
|
13598
|
-
constructor(controller, options) {;_class12.prototype.
|
|
13589
|
+
constructor(controller, options) {;_class12.prototype.__init94.call(this);_class12.prototype.__init95.call(this);_class12.prototype.__init96.call(this);
|
|
13599
13590
|
this.controller = controller;
|
|
13600
13591
|
this.options = options;
|
|
13601
13592
|
}
|
|
13602
13593
|
|
|
13603
13594
|
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
|
|
13595
|
+
__init94() {this.session = null}
|
|
13596
|
+
__init95() {this.dragStart = null}
|
|
13597
|
+
__init96() {this.error = null}
|
|
13607
13598
|
down(p, mods = {}) {
|
|
13608
13599
|
this.error = null;
|
|
13609
13600
|
const hit = typeLayerAt(this.controller, p);
|
|
@@ -13677,7 +13668,7 @@ function layerPanelRows(layers, activeId) {
|
|
|
13677
13668
|
}
|
|
13678
13669
|
function layerLabel(layer) {
|
|
13679
13670
|
if (layer.name) return layer.name;
|
|
13680
|
-
if (layer.type === "adjustment") return
|
|
13671
|
+
if (layer.type === "adjustment") return _chunkO5RVCDECcjs.adjustmentKindLabel.call(void 0, layer.kind);
|
|
13681
13672
|
return layer.type === "group" ? "Group" : "Layer";
|
|
13682
13673
|
}
|
|
13683
13674
|
function layerBadge(layer) {
|
|
@@ -14149,7 +14140,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
|
|
|
14149
14140
|
];
|
|
14150
14141
|
var WARP_STYLE_OPTIONS = [
|
|
14151
14142
|
{ id: "custom", label: "Custom" },
|
|
14152
|
-
...
|
|
14143
|
+
..._chunkQQKTOA4Ucjs.WARP_STYLES.map((id) => ({ id, label: _chunkQQKTOA4Ucjs.WARP_STYLE_LABELS[id] }))
|
|
14153
14144
|
];
|
|
14154
14145
|
var WARP_GRID_OPTIONS = [
|
|
14155
14146
|
{ id: "1x1", label: "Default", columns: 1, rows: 1 },
|
|
@@ -14211,30 +14202,30 @@ function insidePolygon(poly, p) {
|
|
|
14211
14202
|
return inside;
|
|
14212
14203
|
}
|
|
14213
14204
|
var FreeTransformTool = (_class13 = class {
|
|
14214
|
-
constructor(controller, options = {}) {;_class13.prototype.__init98.call(this);_class13.prototype.__init99.call(this);_class13.prototype.__init100.call(this);_class13.prototype.__init101.call(this);_class13.prototype.__init102.call(this);_class13.prototype.__init103.call(this);_class13.prototype.__init104.call(this);_class13.prototype.__init105.call(this);_class13.prototype.__init106.call(this);_class13.prototype.__init107.call(this);_class13.prototype.__init108.call(this);_class13.prototype.__init109.call(this);_class13.prototype.__init110.call(this);
|
|
14205
|
+
constructor(controller, options = {}) {;_class13.prototype.__init97.call(this);_class13.prototype.__init98.call(this);_class13.prototype.__init99.call(this);_class13.prototype.__init100.call(this);_class13.prototype.__init101.call(this);_class13.prototype.__init102.call(this);_class13.prototype.__init103.call(this);_class13.prototype.__init104.call(this);_class13.prototype.__init105.call(this);_class13.prototype.__init106.call(this);_class13.prototype.__init107.call(this);_class13.prototype.__init108.call(this);_class13.prototype.__init109.call(this);_class13.prototype.__init110.call(this);
|
|
14215
14206
|
this.controller = controller;
|
|
14216
14207
|
this.options = options;
|
|
14217
14208
|
}
|
|
14218
14209
|
|
|
14219
14210
|
|
|
14220
|
-
|
|
14221
|
-
|
|
14211
|
+
__init97() {this.sessionRef = null}
|
|
14212
|
+
__init98() {this.modeValue = "scale"}
|
|
14222
14213
|
/** The reference point in the untransformed frame's space (follows the transform). */
|
|
14223
|
-
|
|
14224
|
-
|
|
14225
|
-
|
|
14214
|
+
__init99() {this.refBox = { x: 0, y: 0 }}
|
|
14215
|
+
__init100() {this.corners = null}
|
|
14216
|
+
__init101() {this.drag = null}
|
|
14226
14217
|
/** The warp mesh in the frame's own space (null: no warp). */
|
|
14227
|
-
|
|
14228
|
-
|
|
14229
|
-
|
|
14230
|
-
|
|
14218
|
+
__init102() {this.mesh = null}
|
|
14219
|
+
__init103() {this.warpSettings = { style: "custom", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", columns: 1, rows: 1 }}
|
|
14220
|
+
__init104() {this.pending = false}
|
|
14221
|
+
__init105() {this.viewScale = 1}
|
|
14231
14222
|
|
|
14232
14223
|
/** Values typed into the options bar since the last drag (V skew is not recovered from the shape). */
|
|
14233
|
-
|
|
14224
|
+
__init106() {this.typed = {}}
|
|
14234
14225
|
/** Width and height scale together when typed (the chain icon). */
|
|
14235
|
-
|
|
14236
|
-
|
|
14237
|
-
|
|
14226
|
+
__init107() {this.proportional = true}
|
|
14227
|
+
__init108() {this.error = null}
|
|
14228
|
+
__init109() {this.lastResult = null}
|
|
14238
14229
|
get active() {
|
|
14239
14230
|
return Boolean(_optionalChain([this, 'access', _462 => _462.sessionRef, 'optionalAccess', _463 => _463.isOpen]));
|
|
14240
14231
|
}
|
|
@@ -14247,7 +14238,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14247
14238
|
get interpolation() {
|
|
14248
14239
|
return _nullishCoalesce(_optionalChain([this, 'access', _464 => _464.sessionRef, 'optionalAccess', _465 => _465.interpolation]), () => ( "bicubic"));
|
|
14249
14240
|
}
|
|
14250
|
-
|
|
14241
|
+
__init110() {this.listeners = /* @__PURE__ */ new Set()}
|
|
14251
14242
|
/** Calls `listener` whenever the overlay, readout, mode or error changes. Returns the unsubscribe. */
|
|
14252
14243
|
subscribe(listener) {
|
|
14253
14244
|
this.listeners.add(listener);
|
|
@@ -14285,7 +14276,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14285
14276
|
setMode(mode) {
|
|
14286
14277
|
this.modeValue = mode;
|
|
14287
14278
|
const s = this.session;
|
|
14288
|
-
if (mode === "warp" && s && !this.mesh) this.mesh =
|
|
14279
|
+
if (mode === "warp" && s && !this.mesh) this.mesh = _chunkQQKTOA4Ucjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
|
|
14289
14280
|
this.changed();
|
|
14290
14281
|
}
|
|
14291
14282
|
/** The Warp options bar's settings. */
|
|
@@ -14307,13 +14298,13 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14307
14298
|
this.modeValue = "warp";
|
|
14308
14299
|
const next = { ...this.warpSettings, ...changes };
|
|
14309
14300
|
this.warpSettings = next;
|
|
14310
|
-
let mesh = _nullishCoalesce(this.mesh, () => (
|
|
14301
|
+
let mesh = _nullishCoalesce(this.mesh, () => ( _chunkQQKTOA4Ucjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
|
|
14311
14302
|
if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
|
|
14312
14303
|
const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
|
|
14313
|
-
mesh = _nullishCoalesce(
|
|
14314
|
-
mesh =
|
|
14304
|
+
mesh = _nullishCoalesce(_chunkQQKTOA4Ucjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkQQKTOA4Ucjs.identityWarpMesh.call(void 0, s.box)));
|
|
14305
|
+
mesh = _chunkQQKTOA4Ucjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14315
14306
|
}
|
|
14316
|
-
if ("columns" in changes || "rows" in changes) mesh =
|
|
14307
|
+
if ("columns" in changes || "rows" in changes) mesh = _chunkQQKTOA4Ucjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14317
14308
|
this.mesh = mesh;
|
|
14318
14309
|
this.changed();
|
|
14319
14310
|
this.preview();
|
|
@@ -14360,11 +14351,11 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14360
14351
|
const m = this.mesh;
|
|
14361
14352
|
const at = (p) => _nullishCoalesce(_chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p), () => ( p));
|
|
14362
14353
|
const pts = m.points.map(at);
|
|
14363
|
-
const edit =
|
|
14354
|
+
const edit = _chunkQQKTOA4Ucjs.warpMeshEditPoints.call(void 0, m);
|
|
14364
14355
|
out.handles = [];
|
|
14365
|
-
out.outline =
|
|
14356
|
+
out.outline = _chunkQQKTOA4Ucjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
|
|
14366
14357
|
out.warp = {
|
|
14367
|
-
curves:
|
|
14358
|
+
curves: _chunkQQKTOA4Ucjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
|
|
14368
14359
|
anchors: edit.anchors.map((i) => pts[i]),
|
|
14369
14360
|
handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
|
|
14370
14361
|
};
|
|
@@ -14388,7 +14379,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14388
14379
|
if (!o) return null;
|
|
14389
14380
|
if (this.modeValue === "warp" && this.mesh) {
|
|
14390
14381
|
const h = this.homography();
|
|
14391
|
-
const edit =
|
|
14382
|
+
const edit = _chunkQQKTOA4Ucjs.warpMeshEditPoints.call(void 0, this.mesh);
|
|
14392
14383
|
let best2 = -1;
|
|
14393
14384
|
let bestD2 = tolerance;
|
|
14394
14385
|
for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
|
|
@@ -14433,7 +14424,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14433
14424
|
if (this.modeValue === "warp" && this.mesh && handle === "inside") {
|
|
14434
14425
|
const q = this.toFrame(p, this.corners);
|
|
14435
14426
|
if (q) {
|
|
14436
|
-
const r =
|
|
14427
|
+
const r = _chunkQQKTOA4Ucjs.warpMeshParamAt.call(void 0, this.mesh, q);
|
|
14437
14428
|
st = { s: r.s, t: r.t };
|
|
14438
14429
|
}
|
|
14439
14430
|
}
|
|
@@ -14466,8 +14457,8 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14466
14457
|
if (!a || !b) return;
|
|
14467
14458
|
const delta = { x: b.x - a.x, y: b.y - a.y };
|
|
14468
14459
|
const i = meshIndex(d.handle);
|
|
14469
|
-
if (i >= 0) this.mesh =
|
|
14470
|
-
else if (d.handle === "inside" && d.st) this.mesh =
|
|
14460
|
+
if (i >= 0) this.mesh = _chunkQQKTOA4Ucjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
|
|
14461
|
+
else if (d.handle === "inside" && d.st) this.mesh = _chunkQQKTOA4Ucjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
|
|
14471
14462
|
else return;
|
|
14472
14463
|
this.warpSettings = { ...this.warpSettings, style: "custom" };
|
|
14473
14464
|
this.changed();
|
|
@@ -14591,7 +14582,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14591
14582
|
bar() {
|
|
14592
14583
|
const s = this.session;
|
|
14593
14584
|
if (!s || !this.corners) return null;
|
|
14594
|
-
const read =
|
|
14585
|
+
const read = _chunkO5RVCDECcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
|
|
14595
14586
|
return {
|
|
14596
14587
|
affine: read.affine,
|
|
14597
14588
|
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
@@ -14616,7 +14607,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14616
14607
|
this.changed();
|
|
14617
14608
|
return;
|
|
14618
14609
|
}
|
|
14619
|
-
const m =
|
|
14610
|
+
const m = _chunkO5RVCDECcjs.matrixFromParams.call(void 0, s.box, {
|
|
14620
14611
|
scaleX: next.scaleX,
|
|
14621
14612
|
scaleY: next.scaleY,
|
|
14622
14613
|
rotate: next.rotate,
|
|
@@ -14626,7 +14617,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14626
14617
|
dx: next.x - this.refBox.x,
|
|
14627
14618
|
dy: next.y - this.refBox.y
|
|
14628
14619
|
});
|
|
14629
|
-
this.setCorners(
|
|
14620
|
+
this.setCorners(_chunkO5RVCDECcjs.cornersFromMatrix.call(void 0, s.box, m));
|
|
14630
14621
|
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
14631
14622
|
this.changed();
|
|
14632
14623
|
}
|
|
@@ -14722,7 +14713,7 @@ function createImageEffectsToolProvider(controller, options = {}) {
|
|
|
14722
14713
|
return { target, effect: _nullishCoalesce(effects.find((e) => e.id === instance), () => ( effects[effects.length - 1])), effects, ...extra };
|
|
14723
14714
|
};
|
|
14724
14715
|
const plainValues = (v) => v;
|
|
14725
|
-
return
|
|
14716
|
+
return _chunkQDJKUBWEcjs.createEffectToolProvider.call(void 0, {
|
|
14726
14717
|
id: _nullishCoalesce(options.id, () => ( "image-effects")),
|
|
14727
14718
|
namespace: options.namespace,
|
|
14728
14719
|
target: { noun: "layer", id: "A layer id from list_layers." },
|
|
@@ -15713,5 +15704,5 @@ function createImageEffectsToolProvider(controller, options = {}) {
|
|
|
15713
15704
|
|
|
15714
15705
|
|
|
15715
15706
|
|
|
15716
|
-
exports.ADJUSTMENT_KEYS = _chunkPEHYWUVVcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkPEHYWUVVcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkPEHYWUVVcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkPEHYWUVVcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkPEHYWUVVcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.D50; exports.D65 = _chunkPEHYWUVVcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunk5XXMLBH4cjs.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 = _chunkPEHYWUVVcjs.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 = _chunk5XXMLBH4cjs.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 = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkPEHYWUVVcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkMZXQTKUMcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkPEHYWUVVcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkPEHYWUVVcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkPEHYWUVVcjs.LUMA_709; exports.LayerCompositor = _chunkPEHYWUVVcjs.LayerCompositor; exports.LayerEffectError = _chunkMZXQTKUMcjs.LayerEffectError; exports.LayerOperationError = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkFHPVDTI2cjs.PARAM; exports.PARAM_FLOATS = _chunkFHPVDTI2cjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk6GFRKLLScjs.SmudgeTip; exports.StrokeCoverage = _chunk6GFRKLLScjs.StrokeCoverage; exports.SurfaceDraft = _chunkJ5BA3BQ6cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkPEHYWUVVcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkPEHYWUVVcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkPEHYWUVVcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkJ5BA3BQ6cjs.TILE; exports.TILE_SHIFT = _chunkJ5BA3BQ6cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkPEHYWUVVcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk6GFRKLLScjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkPEHYWUVVcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkW6M7C7R3cjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.VIBRANCE_GREY; exports.W9 = _chunkFHPVDTI2cjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunk5XXMLBH4cjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunk5XXMLBH4cjs.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 = _chunkPEHYWUVVcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkPEHYWUVVcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkPEHYWUVVcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkPEHYWUVVcjs.activeSmartFilters; exports.addLayerEffect = _chunkPEHYWUVVcjs.addLayerEffect; exports.addLayerFilter = _chunkPEHYWUVVcjs.addLayerFilter; exports.addPaintGradientStop = _chunk6GFRKLLScjs.addPaintGradientStop; exports.addSmartFilter = _chunkPEHYWUVVcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkPEHYWUVVcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkPEHYWUVVcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkPEHYWUVVcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkPEHYWUVVcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkPEHYWUVVcjs.anchorPoint; exports.annotationBlend = _chunkPEHYWUVVcjs.annotationBlend; exports.annotationLayerFor = _chunkPEHYWUVVcjs.annotationLayerFor; exports.annotationLayerName = _chunkPEHYWUVVcjs.annotationLayerName; exports.annotationOfLayer = _chunkPEHYWUVVcjs.annotationOfLayer; exports.annotationOfShape = _chunkPEHYWUVVcjs.annotationOfShape; exports.annotationOfType = _chunkPEHYWUVVcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkPEHYWUVVcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkPEHYWUVVcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkPEHYWUVVcjs.applyAdjustments; exports.applyBoxBlur = _chunkPEHYWUVVcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkPEHYWUVVcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkPEHYWUVVcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkPEHYWUVVcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkPEHYWUVVcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkPEHYWUVVcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkPEHYWUVVcjs.applyParams; exports.applyProcess2Adjustments = _chunkPEHYWUVVcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkPEHYWUVVcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkW6M7C7R3cjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkPEHYWUVVcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk6GFRKLLScjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk6GFRKLLScjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkW6M7C7R3cjs.applyToneToDeepTile; exports.backgroundLayer = _chunkPEHYWUVVcjs.backgroundLayer; exports.base64ToBytes = _chunkDCLJNVZScjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkW6M7C7R3cjs.bestOffset; exports.blackWhiteGray = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.blurFilter; exports.borderCoverage = _chunkPEHYWUVVcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkPEHYWUVVcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkPEHYWUVVcjs.buildToneLut; exports.builtinPattern = _chunkMZXQTKUMcjs.builtinPattern; exports.builtinPatternIds = _chunkMZXQTKUMcjs.builtinPatternIds; exports.bytesToBase64 = _chunkDCLJNVZScjs.bytesToBase64; exports.calculateCropDrag = _chunkPEHYWUVVcjs.calculateCropDrag; exports.canShareMemory = _chunkFHPVDTI2cjs.canShareMemory; exports.canvasCompositeOperation = _chunkJ5BA3BQ6cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkPEHYWUVVcjs.canvasToImagePoint; exports.caretAt = _chunk5XXMLBH4cjs.caretAt; exports.changedTiles = _chunkMZXQTKUMcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkPEHYWUVVcjs.clampCropToImage; exports.cleanMixer = _chunk6GFRKLLScjs.cleanMixer; exports.cloneSourceLabel = cloneSourceLabel; exports.collectTiles = _chunkJ5BA3BQ6cjs.collectTiles; exports.colorBalanceChannel = _chunkPEHYWUVVcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkPEHYWUVVcjs.combineSelections; exports.compileAdjustmentLayer = _chunkPEHYWUVVcjs.compileAdjustmentLayer; exports.componentPath = _chunkPEHYWUVVcjs.componentPath; exports.compositeDeep = _chunkPEHYWUVVcjs.compositeDeep; exports.compositeSurfaceOver = _chunkMZXQTKUMcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkPEHYWUVVcjs.computeSelectionBounds; exports.contentBounds = _chunkJ5BA3BQ6cjs.contentBounds; exports.contentsBox = _chunkPEHYWUVVcjs.contentsBox; exports.contentsSurface = _chunkPEHYWUVVcjs.contentsSurface; exports.contractCoverage = _chunkPEHYWUVVcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkJ5BA3BQ6cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkPEHYWUVVcjs.convertToSmartObject; exports.copySmartObject = _chunkPEHYWUVVcjs.copySmartObject; exports.cornersFromMatrix = _chunkPEHYWUVVcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk6GFRKLLScjs.coverageTileCoord; exports.coverageToByte = _chunkPEHYWUVVcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkPEHYWUVVcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk6GFRKLLScjs.createBlenderScratch; exports.createCanvasTextShaper = _chunk5XXMLBH4cjs.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 = _chunk5XXMLBH4cjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunk5XXMLBH4cjs.createOutlineTextShaper; exports.createPigment = _chunkJ5BA3BQ6cjs.createPigment; exports.createPigmentTools = _chunkFHPVDTI2cjs.createPigmentTools; exports.createSelectionMask = _chunkPEHYWUVVcjs.createSelectionMask; exports.createShapeLayer = _chunkPEHYWUVVcjs.createShapeLayer; exports.createTypeLayer = _chunkPEHYWUVVcjs.createTypeLayer; exports.createWetGpuEngine = _chunkFHPVDTI2cjs.createWetGpuEngine; exports.cssFont = _chunk5XXMLBH4cjs.cssFont; exports.cssFontFamily = _chunk5XXMLBH4cjs.cssFontFamily; exports.curveLut = _chunkMZXQTKUMcjs.curveLut; exports.curveLutFromLevels = _chunkPEHYWUVVcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk6GFRKLLScjs.dabCoverage; exports.dabRect = _chunk6GFRKLLScjs.dabRect; exports.decodeDeepSurface = _chunkPEHYWUVVcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkPEHYWUVVcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkPEHYWUVVcjs.decodeLayerMask; exports.decodeMergedImage = _chunkPEHYWUVVcjs.decodeMergedImage; exports.decodePlanes = _chunkPEHYWUVVcjs.decodePlanes; exports.decodePng = _chunkDCLJNVZScjs.decodePng; exports.decodePngDataUrl = _chunkPEHYWUVVcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkPEHYWUVVcjs.decodeSelectionRle; exports.deepBytes = _chunkJ5BA3BQ6cjs.deepBytes; exports.deepTile = _chunkJ5BA3BQ6cjs.deepTile; exports.defaultAdjustmentParams = _chunkPEHYWUVVcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkMZXQTKUMcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkMZXQTKUMcjs.defaultLayerEffect; exports.defaultShapeName = _chunkPEHYWUVVcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkPEHYWUVVcjs.depthMaskAlpha; exports.depthOf = _chunkJ5BA3BQ6cjs.depthOf; exports.depthRasterMask = _chunkPEHYWUVVcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkPEHYWUVVcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkPEHYWUVVcjs.deserializeEffects; exports.deserializeLayer = _chunkPEHYWUVVcjs.deserializeLayer; exports.deserializeLayers = _chunkPEHYWUVVcjs.deserializeLayers; exports.deserializePatterns = _chunkPEHYWUVVcjs.deserializePatterns; exports.deserializeSelection = _chunkPEHYWUVVcjs.deserializeSelection; exports.developFilter = _chunkPEHYWUVVcjs.developFilter; exports.developFromAdjustments = _chunkPEHYWUVVcjs.developFromAdjustments; exports.developTarget = _chunkPEHYWUVVcjs.developTarget; exports.dexp = _chunkFHPVDTI2cjs.dexp; exports.dilateMask = _chunkW6M7C7R3cjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkPEHYWUVVcjs.distanceTransform; exports.dlog = _chunkFHPVDTI2cjs.dlog; exports.documentContents = _chunkPEHYWUVVcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkW6M7C7R3cjs.dodgeBurn; exports.dodgeBurnCurve = _chunkW6M7C7R3cjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkFHPVDTI2cjs.dpow; exports.dragWarpMeshPoint = _chunk5XXMLBH4cjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkFHPVDTI2cjs.dsincos; exports.duplicateLayer = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.encodeDeepSurface; exports.encodePng = _chunkDCLJNVZScjs.encodePng; exports.encodeRle = _chunkPEHYWUVVcjs.encodeRle; exports.encodeSelectionRle = _chunkPEHYWUVVcjs.encodeSelectionRle; exports.encodeSurface = _chunkPEHYWUVVcjs.encodeSurface; exports.evalWarpMesh = _chunk5XXMLBH4cjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkPEHYWUVVcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk6GFRKLLScjs.exchangeRates; exports.expNeg = _chunkFHPVDTI2cjs.expNeg; exports.expandCoverage = _chunkPEHYWUVVcjs.expandCoverage; exports.exportPsd = _chunkPEHYWUVVcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkPEHYWUVVcjs.featherCoverage; exports.fillRect = _chunkJ5BA3BQ6cjs.fillRect; exports.filmPixel = _chunkFHPVDTI2cjs.filmPixel; exports.filmReflectance = _chunkFHPVDTI2cjs.filmReflectance; exports.filterMaskCoverage = _chunkPEHYWUVVcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkMZXQTKUMcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkFHPVDTI2cjs.findWebGpu; exports.finishTile = _chunkJ5BA3BQ6cjs.finishTile; exports.fitParagraphRuns = _chunk5XXMLBH4cjs.fitParagraphRuns; exports.fitRuns = _chunk5XXMLBH4cjs.fitRuns; exports.flattenLayers = _chunkMZXQTKUMcjs.flattenLayers; exports.flattenPath = _chunkPEHYWUVVcjs.flattenPath; exports.flipCorners = _chunkPEHYWUVVcjs.flipCorners; exports.flowField = _chunkFHPVDTI2cjs.flowField; exports.fontOf = _chunk5XXMLBH4cjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkPEHYWUVVcjs.fullSelection; exports.gaussianBlur = _chunkMZXQTKUMcjs.gaussianBlur; exports.geometryHomography = _chunkPEHYWUVVcjs.geometryHomography; exports.getAnnotationBounds = _chunkPEHYWUVVcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkPEHYWUVVcjs.getCropCursor; exports.getRotatedSize = _chunkPEHYWUVVcjs.getRotatedSize; exports.getViewportMetrics = _chunkPEHYWUVVcjs.getViewportMetrics; exports.getViewportProjection = _chunkPEHYWUVVcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk6GFRKLLScjs.gradientDabColor; exports.greyMorphology = _chunkPEHYWUVVcjs.greyMorphology; exports.groupLayers = _chunkPEHYWUVVcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkMZXQTKUMcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkPEHYWUVVcjs.hasResampledLegacyMask; exports.hasSurface = _chunkPEHYWUVVcjs.hasSurface; exports.hasWarp = _chunkPEHYWUVVcjs.hasWarp; exports.hash2 = _chunk6GFRKLLScjs.hash2; exports.hashMaskContent = _chunkPEHYWUVVcjs.hashMaskContent; exports.hashNoise = _chunkMZXQTKUMcjs.hashNoise; exports.healPixels = _chunkW6M7C7R3cjs.healPixels; exports.hexToPaintRgb = _chunk6GFRKLLScjs.hexToPaintRgb; exports.hexToRgb = _chunkPEHYWUVVcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkPEHYWUVVcjs.hitTestAnnotation; exports.hitTestCrop = _chunkPEHYWUVVcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkPEHYWUVVcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkPEHYWUVVcjs.hueRangeTables; exports.hueRangeWeight = _chunkPEHYWUVVcjs.hueRangeWeight; exports.hueSaturation = _chunkPEHYWUVVcjs.hueSaturation; exports.identityCurve = _chunkPEHYWUVVcjs.identityCurve; exports.identityLevels = _chunkPEHYWUVVcjs.identityLevels; exports.identityTransform = _chunkPEHYWUVVcjs.identityTransform; exports.identityWarpMesh = _chunk5XXMLBH4cjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkPEHYWUVVcjs.imageToCanvasPoint; exports.importPsd = _chunkPEHYWUVVcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkMZXQTKUMcjs.insertLayer; exports.instancesOf = _chunkPEHYWUVVcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkPEHYWUVVcjs.invertMatrix3; exports.invertSelection = _chunkPEHYWUVVcjs.invertSelection; exports.isActiveFilter = _chunkPEHYWUVVcjs.isActiveFilter; exports.isAdjustmentKind = _chunkPEHYWUVVcjs.isAdjustmentKind; exports.isBitDepth = _chunkJ5BA3BQ6cjs.isBitDepth; exports.isBlendMode = _chunkJ5BA3BQ6cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkZ6OUCS2Kcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkPEHYWUVVcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkPEHYWUVVcjs.isDefaultDepthMask; exports.isGradientPaint = _chunk6GFRKLLScjs.isGradientPaint; exports.isIdentityTransform = _chunkPEHYWUVVcjs.isIdentityTransform; exports.isInterpolation = _chunkMZXQTKUMcjs.isInterpolation; exports.isLayerEffectKind = _chunkMZXQTKUMcjs.isLayerEffectKind; exports.isLayerLocked = _chunkMZXQTKUMcjs.isLayerLocked; exports.isLegacyShape = _chunkPEHYWUVVcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkJ5BA3BQ6cjs.isPainterlyBlendMode; exports.isPng = _chunkDCLJNVZScjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkPEHYWUVVcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkPEHYWUVVcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkPEHYWUVVcjs.isSelectionEmpty; exports.isSelectionMode = _chunkPEHYWUVVcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkJ5BA3BQ6cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkPEHYWUVVcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkPEHYWUVVcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkPEHYWUVVcjs.isTransformAnchor; exports.isValidWarp = _chunkPEHYWUVVcjs.isValidWarp; exports.keepDeepSamples = _chunkJ5BA3BQ6cjs.keepDeepSamples; exports.kelvinToTemperature = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkPEHYWUVVcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkPEHYWUVVcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkPEHYWUVVcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkPEHYWUVVcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkPEHYWUVVcjs.layerTree; exports.layerTypeLabel = _chunkPEHYWUVVcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkPEHYWUVVcjs.layersFromLegacy; exports.layoutText = _chunk5XXMLBH4cjs.layoutText; exports.legacyAdjustmentLayer = _chunkPEHYWUVVcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkPEHYWUVVcjs.legacyMaskOf; exports.legacyView = _chunkPEHYWUVVcjs.legacyView; exports.lerpPigment = _chunkJ5BA3BQ6cjs.lerpPigment; exports.lerpPigmentInto = _chunkJ5BA3BQ6cjs.lerpPigmentInto; exports.levelsValue = _chunkPEHYWUVVcjs.levelsValue; exports.linearSrgbToXy = _chunkPEHYWUVVcjs.linearSrgbToXy; exports.linearToSrgb = _chunkPEHYWUVVcjs.linearToSrgb; exports.linearToSrgb8 = _chunkFHPVDTI2cjs.linearToSrgb8; exports.liveComponent = _chunkPEHYWUVVcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.mapCropHandle; exports.mapLayer = _chunkMZXQTKUMcjs.mapLayer; exports.mapSubpaths = _chunkPEHYWUVVcjs.mapSubpaths; exports.maskBounds = _chunkW6M7C7R3cjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkPEHYWUVVcjs.matrixFromCorners; exports.matrixFromParams = _chunkPEHYWUVVcjs.matrixFromParams; exports.membraneFill = _chunkW6M7C7R3cjs.membraneFill; exports.mergeLayerEffect = _chunkMZXQTKUMcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkPEHYWUVVcjs.moveLayer; exports.moveSmartFilter = _chunkPEHYWUVVcjs.moveSmartFilter; exports.mulMatrix3 = _chunkPEHYWUVVcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkPEHYWUVVcjs.neutralHueRange; exports.newContentsId = _chunkPEHYWUVVcjs.newContentsId; exports.newEffectId = _chunkMZXQTKUMcjs.newEffectId; exports.newLayerId = _chunkPEHYWUVVcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkPEHYWUVVcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkPEHYWUVVcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkPEHYWUVVcjs.normalizeAngle; exports.normalizeBlendMode = _chunkJ5BA3BQ6cjs.normalizeBlendMode; exports.normalizeBlender = _chunk6GFRKLLScjs.normalizeBlender; exports.normalizeBrush = _chunk6GFRKLLScjs.normalizeBrush; exports.normalizeFilter = _chunkPEHYWUVVcjs.normalizeFilter; exports.normalizeFlow = _chunkFHPVDTI2cjs.normalizeFlow; exports.normalizeHexColor = _chunk6GFRKLLScjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkMZXQTKUMcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkPEHYWUVVcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkPEHYWUVVcjs.normalizeLiveShape; exports.normalizeMixer = _chunk6GFRKLLScjs.normalizeMixer; exports.normalizePlacement = _chunkPEHYWUVVcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkPEHYWUVVcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkW6M7C7R3cjs.normalizeRetouch; exports.normalizeShapePaint = _chunkPEHYWUVVcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkPEHYWUVVcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkPEHYWUVVcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk6GFRKLLScjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkPEHYWUVVcjs.normalizeSubpaths; exports.normalizeText = _chunkPEHYWUVVcjs.normalizeText; exports.normalizeTilt = _chunkFHPVDTI2cjs.normalizeTilt; exports.normalizeWetParams = _chunkFHPVDTI2cjs.normalizeWetParams; exports.offsetLayer = _chunkPEHYWUVVcjs.offsetLayer; exports.offsetShape = _chunkPEHYWUVVcjs.offsetShape; exports.offsetSmartObject = _chunkPEHYWUVVcjs.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 = _chunk5XXMLBH4cjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkPEHYWUVVcjs.parseAdjustmentBlock; exports.parseBlend = _chunkPEHYWUVVcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkDCLJNVZScjs.parseDataUrl; exports.parseEffectColor = _chunkMZXQTKUMcjs.parseEffectColor; exports.parseLfx2 = _chunkPEHYWUVVcjs.parseLfx2; exports.parseLrfx = _chunkPEHYWUVVcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk6GFRKLLScjs.parsePaintSource; exports.parsePatternBlock = _chunkPEHYWUVVcjs.parsePatternBlock; exports.parseSelectionMode = _chunkPEHYWUVVcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkPEHYWUVVcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkPEHYWUVVcjs.patchParagraphStyle; exports.patchTextStyle = _chunkPEHYWUVVcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkZ6OUCS2Kcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkZ6OUCS2Kcjs.pathStrokeDabs; exports.perDabStrength = _chunkW6M7C7R3cjs.perDabStrength; exports.photoFilterMatrix = _chunkPEHYWUVVcjs.photoFilterMatrix; exports.pigment8 = _chunkJ5BA3BQ6cjs.pigment8; exports.pigmentColor = _chunkFHPVDTI2cjs.pigmentColor; exports.pigmentOf = _chunkFHPVDTI2cjs.pigmentOf; exports.pixelLayerBounds = _chunkPEHYWUVVcjs.pixelLayerBounds; exports.pixelLayers = _chunkPEHYWUVVcjs.pixelLayers; exports.pixelPigment = _chunkFHPVDTI2cjs.pixelPigment; exports.placeContents = _chunkPEHYWUVVcjs.placeContents; exports.placeLayer = _chunkPEHYWUVVcjs.placeLayer; exports.placementAt = _chunkPEHYWUVVcjs.placementAt; exports.placementBounds = _chunkPEHYWUVVcjs.placementBounds; exports.placementGeometry = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.posterizeValue; exports.presetWarp = _chunkPEHYWUVVcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkPEHYWUVVcjs.projectImagePoint; exports.projectImageRect = _chunkPEHYWUVVcjs.projectImageRect; exports.projectMaskCoverage = _chunkPEHYWUVVcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkJ5BA3BQ6cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkPEHYWUVVcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkPEHYWUVVcjs.psdToLayers; exports.pullWarpMesh = _chunk5XXMLBH4cjs.pullWarpMesh; exports.put255 = _chunk6GFRKLLScjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk6GFRKLLScjs.rand01; exports.rangeLightness = _chunkPEHYWUVVcjs.rangeLightness; exports.rasterContents = _chunkPEHYWUVVcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkPEHYWUVVcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkPEHYWUVVcjs.rasterizeCoverage; exports.rasterizeDab = _chunk6GFRKLLScjs.rasterizeDab; exports.rasterizeSmartObject = _chunkPEHYWUVVcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkJ5BA3BQ6cjs.readDeepRegion; exports.readPaintSource = _chunk6GFRKLLScjs.readPaintSource; exports.readPixel = _chunkJ5BA3BQ6cjs.readPixel; exports.readPsd = _chunkPEHYWUVVcjs.readPsd; exports.readRegion = _chunkJ5BA3BQ6cjs.readRegion; exports.readSourceRegion = _chunkW6M7C7R3cjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkMZXQTKUMcjs.reduceSurface; exports.referencePoint = _chunkPEHYWUVVcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkJ5BA3BQ6cjs.reflectanceToRgb; exports.removeAlpha = _chunkPEHYWUVVcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkPEHYWUVVcjs.removeLayer; exports.removeLayerEffect = _chunkPEHYWUVVcjs.removeLayerEffect; exports.removeLayerFilter = _chunkPEHYWUVVcjs.removeLayerFilter; exports.removePaintGradientStop = _chunk6GFRKLLScjs.removePaintGradientStop; exports.removeSmartFilter = _chunkPEHYWUVVcjs.removeSmartFilter; exports.renderBrushstroke = _chunkZ6OUCS2Kcjs.renderBrushstroke; exports.renderLayerEffects = _chunkMZXQTKUMcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkPEHYWUVVcjs.renderShape; exports.renderShapeRect = _chunkPEHYWUVVcjs.renderShapeRect; exports.renderSmartObject = _chunkPEHYWUVVcjs.renderSmartObject; exports.renderText = _chunkPEHYWUVVcjs.renderText; exports.replaceContents = _chunkPEHYWUVVcjs.replaceContents; exports.replaceTextRange = _chunkPEHYWUVVcjs.replaceTextRange; exports.requireLayer = _chunkPEHYWUVVcjs.requireLayer; exports.requireOperation = _chunkPEHYWUVVcjs.requireOperation; exports.requireShapeLayer = _chunkPEHYWUVVcjs.requireShapeLayer; exports.requireSmartObject = _chunkPEHYWUVVcjs.requireSmartObject; exports.requireTypeLayer = _chunkPEHYWUVVcjs.requireTypeLayer; exports.requireUnlocked = _chunkPEHYWUVVcjs.requireUnlocked; exports.rerender = _chunkPEHYWUVVcjs.rerender; exports.rerenderShape = _chunkPEHYWUVVcjs.rerenderShape; exports.rerenderText = _chunkPEHYWUVVcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkPEHYWUVVcjs.resizeSelection; exports.resizeWarpMesh = _chunk5XXMLBH4cjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkPEHYWUVVcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk6GFRKLLScjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunk5XXMLBH4cjs.restyleRange; exports.reversePaintGradient = _chunk6GFRKLLScjs.reversePaintGradient; exports.rgbToGray = _chunkPEHYWUVVcjs.rgbToGray; exports.rgbToHsl = _chunkPEHYWUVVcjs.rgbToHsl; exports.rgbToReflectance = _chunkJ5BA3BQ6cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkW6M7C7R3cjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkPEHYWUVVcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkPEHYWUVVcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkPEHYWUVVcjs.sampleLut; exports.sampleToneLut = _chunkPEHYWUVVcjs.sampleToneLut; exports.saturationOf = _chunkW6M7C7R3cjs.saturationOf; exports.scaleLayerEffect = _chunkMZXQTKUMcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk6GFRKLLScjs.scalePaintGradient; exports.seamlessClone = _chunkW6M7C7R3cjs.seamlessClone; exports.selectionArea = _chunkPEHYWUVVcjs.selectionArea; exports.selectionFromCoverage = _chunkPEHYWUVVcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkPEHYWUVVcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkPEHYWUVVcjs.selectionToCoverage; exports.selectionToPixels = _chunkPEHYWUVVcjs.selectionToPixels; exports.selectionValueAt = _chunkPEHYWUVVcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkPEHYWUVVcjs.serializeContents; exports.serializeEffects = _chunkPEHYWUVVcjs.serializeEffects; exports.serializeLayer = _chunkPEHYWUVVcjs.serializeLayer; exports.serializeLayers = _chunkPEHYWUVVcjs.serializeLayers; exports.serializeLayersExternal = _chunkPEHYWUVVcjs.serializeLayersExternal; exports.serializePatterns = _chunkPEHYWUVVcjs.serializePatterns; exports.serializeSelection = _chunkPEHYWUVVcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkPEHYWUVVcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkPEHYWUVVcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkPEHYWUVVcjs.setLayerMask; exports.setLayerProperties = _chunkPEHYWUVVcjs.setLayerProperties; exports.setLum = _chunkJ5BA3BQ6cjs.setLum; exports.setPigmentColor = _chunkJ5BA3BQ6cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkPEHYWUVVcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkPEHYWUVVcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkPEHYWUVVcjs.setSmartPlacement; exports.shadeTile = _chunkFHPVDTI2cjs.shadeTile; exports.shapeAsPixelLayer = _chunkPEHYWUVVcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkPEHYWUVVcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkPEHYWUVVcjs.shapeGeometryBounds; exports.shapeLayers = _chunkPEHYWUVVcjs.shapeLayers; exports.shapeOutline = _chunkPEHYWUVVcjs.shapeOutline; exports.shapeRenderClip = _chunkPEHYWUVVcjs.shapeRenderClip; exports.shiftCoverage = _chunkPEHYWUVVcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkPEHYWUVVcjs.smartObjectLayers; exports.smoothCoverage = _chunkPEHYWUVVcjs.smoothCoverage; exports.smoothPoints = _chunk6GFRKLLScjs.smoothPoints; exports.smudgeEffect = _chunkW6M7C7R3cjs.smudgeEffect; exports.solidPaint = _chunk6GFRKLLScjs.solidPaint; exports.solidSurface = _chunkJ5BA3BQ6cjs.solidSurface; exports.solveMembrane = _chunkW6M7C7R3cjs.solveMembrane; exports.spliceRuns = _chunk5XXMLBH4cjs.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 = _chunkPEHYWUVVcjs.srgbToLinear; exports.standardBlendMode = _chunkJ5BA3BQ6cjs.standardBlendMode; exports.stepSlotTs = _chunkFHPVDTI2cjs.stepSlotTs; exports.styleAt = _chunk5XXMLBH4cjs.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 = _chunkPEHYWUVVcjs.tempTintToXy; exports.temperatureToKelvin = _chunkPEHYWUVVcjs.temperatureToKelvin; exports.textIndexAt = _chunk5XXMLBH4cjs.textIndexAt; exports.textMatrix = _chunkPEHYWUVVcjs.textMatrix; exports.textOutlines = _chunkPEHYWUVVcjs.textOutlines; exports.textRange = _chunkPEHYWUVVcjs.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 = _chunkPEHYWUVVcjs.toTextSpace; exports.toneCurve = _chunkPEHYWUVVcjs.toneCurve; exports.toneLuts = _chunkPEHYWUVVcjs.toneLuts; exports.toneOf = _chunkW6M7C7R3cjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkPEHYWUVVcjs.transformHomography; exports.transformMap = _chunkPEHYWUVVcjs.transformMap; exports.transformShapeComponents = _chunkPEHYWUVVcjs.transformShapeComponents; exports.transformSurface = _chunkMZXQTKUMcjs.transformSurface; exports.transformTypeLayer = _chunkPEHYWUVVcjs.transformTypeLayer; exports.transformedBounds = _chunkMZXQTKUMcjs.transformedBounds; exports.transformedBox = _chunkPEHYWUVVcjs.transformedBox; exports.transformedPoint = _chunkPEHYWUVVcjs.transformedPoint; exports.translateSurface = _chunkJ5BA3BQ6cjs.translateSurface; exports.typeAsPixelLayer = _chunkPEHYWUVVcjs.typeAsPixelLayer; exports.typeFrame = _chunkPEHYWUVVcjs.typeFrame; exports.typeFromAnnotation = _chunkPEHYWUVVcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkPEHYWUVVcjs.typeLayerName; exports.ungroupLayer = _chunkPEHYWUVVcjs.ungroupLayer; exports.uniformTile = _chunkJ5BA3BQ6cjs.uniformTile; exports.unionRect = _chunkPEHYWUVVcjs.unionRect; exports.unprojectCanvasPoint = _chunkPEHYWUVVcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkPEHYWUVVcjs.updateLayerEffect; exports.updateLayerFilter = _chunkPEHYWUVVcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkPEHYWUVVcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk6GFRKLLScjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkPEHYWUVVcjs.updateShapeLayer; exports.updateSmartFilter = _chunkPEHYWUVVcjs.updateSmartFilter; exports.updateTypeLayer = _chunkPEHYWUVVcjs.updateTypeLayer; exports.uvToXy = _chunkPEHYWUVVcjs.uvToXy; exports.validateEffectGradient = _chunkMZXQTKUMcjs.validateEffectGradient; exports.validateLayerEffect = _chunkMZXQTKUMcjs.validateLayerEffect; exports.validateLayerEffects = _chunkMZXQTKUMcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkPEHYWUVVcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkPEHYWUVVcjs.vibranceLinear; exports.vibrancePixel = _chunkPEHYWUVVcjs.vibrancePixel; exports.walkDabs = _chunk6GFRKLLScjs.walkDabs; exports.warpMeshEditPoints = _chunk5XXMLBH4cjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunk5XXMLBH4cjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunk5XXMLBH4cjs.warpMeshParamAt; exports.warpPresetMesh = _chunk5XXMLBH4cjs.warpPresetMesh; exports.warpSurface = _chunkMZXQTKUMcjs.warpSurface; exports.wbMatrix = _chunkPEHYWUVVcjs.wbMatrix; exports.wetGpuSupport = _chunkFHPVDTI2cjs.wetGpuSupport; exports.wetSimdSupported = _chunkFHPVDTI2cjs.wetSimdSupported; exports.wetSupport = _chunkFHPVDTI2cjs.wetSupport; exports.whiteBalanceFromSample = _chunkPEHYWUVVcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkPEHYWUVVcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkPEHYWUVVcjs.withFilterMaskSurface; exports.withNewIds = _chunkPEHYWUVVcjs.withNewIds; exports.writeAdjustmentBlock = _chunkPEHYWUVVcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkJ5BA3BQ6cjs.writeDeepRegion; exports.writeLfx2 = _chunkPEHYWUVVcjs.writeLfx2; exports.writePatternBlock = _chunkPEHYWUVVcjs.writePatternBlock; exports.writePsd = _chunkPEHYWUVVcjs.writePsd; exports.writeRegion = _chunkJ5BA3BQ6cjs.writeRegion; exports.xyToTempTint = _chunkPEHYWUVVcjs.xyToTempTint; exports.xyToUv = _chunkPEHYWUVVcjs.xyToUv;
|
|
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;
|
|
15717
15708
|
//# sourceMappingURL=index.cjs.map
|