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