@pixerate/editor 0.146.0 → 0.147.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/README.md +3 -1
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/agent/index.cjs +36 -34
- package/dist/agent/index.js +7 -5
- package/dist/animation/index.cjs +5 -3
- package/dist/animation/index.js +4 -2
- package/dist/animation-editor/index.cjs +62 -60
- package/dist/animation-editor/index.js +6 -4
- package/dist/canvas/index.cjs +36 -34
- package/dist/canvas/index.js +19 -17
- package/dist/chart/index.cjs +88 -86
- package/dist/chart/index.js +7 -5
- package/dist/{chunk-WBJ6BG4R.js → chunk-2AQL4JHM.js} +6 -6
- package/dist/{chunk-HLMF3E53.cjs → chunk-2WDZI6QD.cjs} +15 -15
- package/dist/{chunk-ZNHB5RG6.js → chunk-37RLSNQ3.js} +2 -2
- package/dist/{chunk-5WOY52O6.cjs → chunk-4YQKRHMI.cjs} +8 -8
- package/dist/chunk-6ONMQ6WF.js +113 -0
- package/dist/{chunk-L434J57V.cjs → chunk-6QTON3VW.cjs} +16 -16
- package/dist/chunk-AA34BA7G.js +1913 -0
- package/dist/{chunk-QX25HWFL.js → chunk-AY65VQSU.js} +1 -1
- package/dist/{chunk-ONZJD2OD.cjs → chunk-BROJYMWU.cjs} +57 -153
- package/dist/{chunk-YM75DN54.js → chunk-DSZCDNTM.js} +1 -1
- package/dist/{chunk-PUR6BZFA.cjs → chunk-DVLMW3GB.cjs} +53 -53
- package/dist/{chunk-ALUWD3FG.js → chunk-EIUTJPEL.js} +1 -1
- package/dist/{chunk-X65C4DWV.js → chunk-EQ4SF4X4.js} +1 -1
- package/dist/{chunk-77SG47WT.js → chunk-FLOGD3QB.js} +1 -1
- package/dist/{chunk-AJSW5GMP.js → chunk-HVQVHUTV.js} +19 -115
- package/dist/{chunk-UR37VCIR.cjs → chunk-I4AHLP7F.cjs} +16 -35
- package/dist/chunk-IPJ3TEYR.cjs +113 -0
- package/dist/chunk-KY3FYKP3.js +52 -0
- package/dist/chunk-LEUZ4FRC.cjs +52 -0
- package/dist/{chunk-H6FX45CP.cjs → chunk-LIXLD433.cjs} +37 -37
- package/dist/{chunk-6GAYGQDC.js → chunk-O5ML2I6O.js} +3 -3
- package/dist/{chunk-KI2VBONS.js → chunk-OET45HIR.js} +2 -2
- package/dist/{chunk-XNZWATSB.cjs → chunk-QCEQIRJQ.cjs} +85 -85
- package/dist/{chunk-HRI3ZMDM.cjs → chunk-RHXW4TA5.cjs} +3 -3
- package/dist/{chunk-UUTTJK77.cjs → chunk-SUF6WRXR.cjs} +2 -2
- package/dist/{chunk-RN767PO6.js → chunk-SUVZJ2CP.js} +15 -34
- package/dist/{chunk-FLUTRPLY.cjs → chunk-TLMRGLQQ.cjs} +16 -16
- package/dist/{chunk-DAS7M4RY.js → chunk-UILRJQFD.js} +2 -2
- package/dist/chunk-UKCJ43YL.cjs +1913 -0
- package/dist/{chunk-XQ33O5BC.cjs → chunk-X35BV5YT.cjs} +44 -44
- package/dist/{chunk-6HMEHNWW.cjs → chunk-XTU6QO2W.cjs} +26 -26
- package/dist/{chunk-VM6JYWXQ.js → chunk-ZQUANEK4.js} +2 -2
- package/dist/cms/index.cjs +5 -3
- package/dist/cms/index.js +18 -16
- package/dist/color/contrast.d.cts +14 -0
- package/dist/color/contrast.d.ts +14 -0
- package/dist/color/convert.d.cts +30 -0
- package/dist/color/convert.d.ts +30 -0
- package/dist/color/dual.d.cts +98 -0
- package/dist/color/dual.d.ts +98 -0
- package/dist/color/format.d.cts +12 -0
- package/dist/color/format.d.ts +12 -0
- package/dist/color/gamut.d.cts +12 -0
- package/dist/color/gamut.d.ts +12 -0
- package/dist/color/harmony.d.cts +22 -0
- package/dist/color/harmony.d.ts +22 -0
- package/dist/color/index.cjs +115 -0
- package/dist/color/index.d.cts +18 -0
- package/dist/color/index.d.ts +18 -0
- package/dist/color/index.js +115 -0
- package/dist/color/mix.d.cts +11 -0
- package/dist/color/mix.d.ts +11 -0
- package/dist/color/named.d.cts +5 -0
- package/dist/color/named.d.ts +5 -0
- package/dist/color/parse.d.cts +11 -0
- package/dist/color/parse.d.ts +11 -0
- package/dist/color/picker.d.cts +52 -0
- package/dist/color/picker.d.ts +52 -0
- package/dist/color/recent.d.cts +8 -0
- package/dist/color/recent.d.ts +8 -0
- package/dist/color/tools.d.cts +15 -0
- package/dist/color/tools.d.ts +15 -0
- package/dist/color/types.d.cts +41 -0
- package/dist/color/types.d.ts +41 -0
- package/dist/color/vision.d.cts +36 -0
- package/dist/color/vision.d.ts +36 -0
- package/dist/export/index.cjs +6 -4
- package/dist/export/index.js +5 -3
- package/dist/extensions/index.cjs +10 -8
- package/dist/extensions/index.js +9 -7
- package/dist/gradient/controller.d.cts +109 -0
- package/dist/gradient/controller.d.ts +109 -0
- package/dist/gradient/editor.d.cts +38 -0
- package/dist/gradient/editor.d.ts +38 -0
- package/dist/gradient/index.cjs +1549 -0
- package/dist/gradient/index.d.cts +5 -0
- package/dist/gradient/index.d.ts +5 -0
- package/dist/gradient/index.js +1549 -0
- package/dist/gradient/model.d.cts +94 -0
- package/dist/gradient/model.d.ts +94 -0
- package/dist/gradient/tools.d.cts +11 -0
- package/dist/gradient/tools.d.ts +11 -0
- package/dist/gradient/types.d.cts +44 -0
- package/dist/gradient/types.d.ts +44 -0
- package/dist/image-editor/index.cjs +649 -647
- package/dist/image-editor/index.js +6 -4
- package/dist/index.cjs +19 -17
- package/dist/index.js +16 -14
- package/dist/paint-editor/color.d.cts +3 -13
- package/dist/paint-editor/color.d.ts +3 -13
- package/dist/paint-editor/index.cjs +23 -68
- package/dist/paint-editor/index.js +15 -60
- package/dist/vector/index.cjs +950 -948
- package/dist/vector/index.js +5 -3
- package/dist/video-editor/index.cjs +5 -3
- package/dist/video-editor/index.js +4 -2
- package/package.json +21 -1
- package/skills/README.md +1 -0
- package/skills/pixerate-color/SKILL.md +69 -0
- package/dist/chunk-45VRG4RB.js +0 -65
- package/dist/chunk-5FXOR7F2.cjs +0 -65
|
@@ -363,7 +363,7 @@ var _chunk5UEFNX24cjs = require('../chunk-5UEFNX24.cjs');
|
|
|
363
363
|
|
|
364
364
|
|
|
365
365
|
|
|
366
|
-
var
|
|
366
|
+
var _chunkQCEQIRJQcjs = require('../chunk-QCEQIRJQ.cjs');
|
|
367
367
|
|
|
368
368
|
|
|
369
369
|
var _chunkA2IS7EHEcjs = require('../chunk-A2IS7EHE.cjs');
|
|
@@ -582,7 +582,7 @@ var _chunkGNK7SESQcjs = require('../chunk-GNK7SESQ.cjs');
|
|
|
582
582
|
|
|
583
583
|
|
|
584
584
|
|
|
585
|
-
var
|
|
585
|
+
var _chunkBROJYMWUcjs = require('../chunk-BROJYMWU.cjs');
|
|
586
586
|
require('../chunk-2BSBFBOA.cjs');
|
|
587
587
|
|
|
588
588
|
|
|
@@ -622,7 +622,7 @@ require('../chunk-2BSBFBOA.cjs');
|
|
|
622
622
|
|
|
623
623
|
|
|
624
624
|
|
|
625
|
-
var
|
|
625
|
+
var _chunkRHXW4TA5cjs = require('../chunk-RHXW4TA5.cjs');
|
|
626
626
|
require('../chunk-BXMIBMVG.cjs');
|
|
627
627
|
require('../chunk-CVFAAZXE.cjs');
|
|
628
628
|
require('../chunk-GF2RBSDM.cjs');
|
|
@@ -832,8 +832,10 @@ var _chunkCWM3CUUXcjs = require('../chunk-CWM3CUUX.cjs');
|
|
|
832
832
|
var _chunkXFM3OCHUcjs = require('../chunk-XFM3OCHU.cjs');
|
|
833
833
|
require('../chunk-NIBFDFYW.cjs');
|
|
834
834
|
require('../chunk-UWEQ55MY.cjs');
|
|
835
|
-
require('../chunk-
|
|
835
|
+
require('../chunk-LEUZ4FRC.cjs');
|
|
836
836
|
require('../chunk-A6QWKBJP.cjs');
|
|
837
|
+
require('../chunk-UKCJ43YL.cjs');
|
|
838
|
+
require('../chunk-IPJ3TEYR.cjs');
|
|
837
839
|
|
|
838
840
|
// src/image-editor/histogram.ts
|
|
839
841
|
var HISTOGRAM_BINS = 256;
|
|
@@ -938,7 +940,7 @@ function quickMaskPixels(mask, style = {}) {
|
|
|
938
940
|
|
|
939
941
|
// src/image-editor/layers/render.ts
|
|
940
942
|
function isQuarterTurn(rotate) {
|
|
941
|
-
return
|
|
943
|
+
return _chunkQCEQIRJQcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
|
|
942
944
|
}
|
|
943
945
|
function isIntegerRect(r) {
|
|
944
946
|
return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
|
|
@@ -946,7 +948,7 @@ function isIntegerRect(r) {
|
|
|
946
948
|
function baseProjection(region, transform, baseW, baseH) {
|
|
947
949
|
return {
|
|
948
950
|
region,
|
|
949
|
-
angle:
|
|
951
|
+
angle: _chunkQCEQIRJQcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
950
952
|
flipH: transform.flipH,
|
|
951
953
|
flipV: transform.flipV,
|
|
952
954
|
scale: 1,
|
|
@@ -955,14 +957,14 @@ function baseProjection(region, transform, baseW, baseH) {
|
|
|
955
957
|
};
|
|
956
958
|
}
|
|
957
959
|
function projectQuarterTurn(src, srcRect, region, transform) {
|
|
958
|
-
const rotated =
|
|
960
|
+
const rotated = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
959
961
|
const w = Math.max(1, Math.round(rotated.width));
|
|
960
962
|
const h = Math.max(1, Math.round(rotated.height));
|
|
961
963
|
const out = new Uint8ClampedArray(w * h * 4);
|
|
962
964
|
const p = baseProjection(region, transform, w, h);
|
|
963
|
-
const o =
|
|
964
|
-
const ox =
|
|
965
|
-
const oy =
|
|
965
|
+
const o = _chunkQCEQIRJQcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
|
|
966
|
+
const ox = _chunkQCEQIRJQcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
|
|
967
|
+
const oy = _chunkQCEQIRJQcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
|
|
966
968
|
const ux = Math.round(ox.x - o.x);
|
|
967
969
|
const vx = Math.round(ox.y - o.y);
|
|
968
970
|
const uy = Math.round(oy.x - o.x);
|
|
@@ -991,23 +993,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
|
|
|
991
993
|
const d = img.data;
|
|
992
994
|
for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
|
|
993
995
|
}
|
|
994
|
-
if (legacyOutputBlur && legacyOutputBlur > 0)
|
|
996
|
+
if (legacyOutputBlur && legacyOutputBlur > 0) _chunkQCEQIRJQcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
|
|
995
997
|
}
|
|
996
998
|
function needsLegacyBase(input) {
|
|
997
999
|
const { stack, region, canvas, transform } = input;
|
|
998
|
-
if (!
|
|
1000
|
+
if (!_chunkQCEQIRJQcjs.isLegacyShape.call(void 0, stack)) return false;
|
|
999
1001
|
const bg = stack.layers[0];
|
|
1000
1002
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
|
|
1001
1003
|
if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
|
|
1002
1004
|
if (stack.outputOpacity < 1) return true;
|
|
1003
|
-
const blur =
|
|
1005
|
+
const blur = _chunkQCEQIRJQcjs.blurFilter.call(void 0, bg);
|
|
1004
1006
|
if (blur && blur.enabled && blur.radius > 0) {
|
|
1005
1007
|
const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
|
|
1006
|
-
const angle =
|
|
1008
|
+
const angle = _chunkQCEQIRJQcjs.normalizeAngle.call(void 0, transform.rotate);
|
|
1007
1009
|
if (!full || angle === 90 || angle === 270) return true;
|
|
1008
1010
|
}
|
|
1009
1011
|
if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
|
|
1010
|
-
if (
|
|
1012
|
+
if (_chunkQCEQIRJQcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
|
|
1011
1013
|
return false;
|
|
1012
1014
|
}
|
|
1013
1015
|
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;
|
|
@@ -1039,7 +1041,7 @@ function coveringRect(region) {
|
|
|
1039
1041
|
const y = Math.floor(region.y);
|
|
1040
1042
|
return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
|
|
1041
1043
|
}
|
|
1042
|
-
function renderLayeredBase(stack, region, transform, sources, compositor = new (0,
|
|
1044
|
+
function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)()) {
|
|
1043
1045
|
if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
|
|
1044
1046
|
throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
|
|
1045
1047
|
}
|
|
@@ -1173,8 +1175,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1173
1175
|
* The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
|
|
1174
1176
|
* trust dirty rectangles; exports use `exportCompositor`.
|
|
1175
1177
|
*/
|
|
1176
|
-
__init8() {this.compositor = new (0,
|
|
1177
|
-
__init9() {this.exportCompositor = new (0,
|
|
1178
|
+
__init8() {this.compositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)()}
|
|
1179
|
+
__init9() {this.exportCompositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
|
|
1178
1180
|
/** How the host resolves layer pixels (set by the controller). */
|
|
1179
1181
|
|
|
1180
1182
|
/**
|
|
@@ -1251,9 +1253,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1251
1253
|
return;
|
|
1252
1254
|
}
|
|
1253
1255
|
const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
|
|
1254
|
-
const projection =
|
|
1256
|
+
const projection = _chunkQCEQIRJQcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
|
|
1255
1257
|
const { region } = projection;
|
|
1256
|
-
const rotated =
|
|
1258
|
+
const rotated = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1257
1259
|
const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
|
|
1258
1260
|
let overlay = annotations;
|
|
1259
1261
|
if (route === "legacy") {
|
|
@@ -1263,8 +1265,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1263
1265
|
`${naturalWidth}x${naturalHeight}`,
|
|
1264
1266
|
`${region.x},${region.y},${region.width},${region.height}`,
|
|
1265
1267
|
`${projection.angle},${transform.flipH},${transform.flipV}`,
|
|
1266
|
-
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${
|
|
1267
|
-
|
|
1268
|
+
`${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
|
|
1269
|
+
_chunkQCEQIRJQcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
|
|
1268
1270
|
`${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}`,
|
|
1269
1271
|
`d${this.displayKey}`
|
|
1270
1272
|
].join("|");
|
|
@@ -1298,7 +1300,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1298
1300
|
}
|
|
1299
1301
|
if (overlay.length > 0 || options.draftAnnotation) {
|
|
1300
1302
|
ctx.save();
|
|
1301
|
-
|
|
1303
|
+
_chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1302
1304
|
ctx.beginPath();
|
|
1303
1305
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1304
1306
|
ctx.clip();
|
|
@@ -1321,7 +1323,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1321
1323
|
if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
|
|
1322
1324
|
ctx.save();
|
|
1323
1325
|
try {
|
|
1324
|
-
|
|
1326
|
+
_chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1325
1327
|
ctx.beginPath();
|
|
1326
1328
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1327
1329
|
ctx.clip();
|
|
@@ -1336,7 +1338,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1336
1338
|
const b = options.brushCursor;
|
|
1337
1339
|
ctx.save();
|
|
1338
1340
|
try {
|
|
1339
|
-
|
|
1341
|
+
_chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
|
|
1340
1342
|
const px2 = 1 / (projection.scale || 1);
|
|
1341
1343
|
ctx.beginPath();
|
|
1342
1344
|
ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
|
|
@@ -1351,7 +1353,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1351
1353
|
ctx.restore();
|
|
1352
1354
|
}
|
|
1353
1355
|
if (options.cloneSourceMarker) {
|
|
1354
|
-
const m =
|
|
1356
|
+
const m = _chunkQCEQIRJQcjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
|
|
1355
1357
|
ctx.save();
|
|
1356
1358
|
try {
|
|
1357
1359
|
const r = 7;
|
|
@@ -1375,7 +1377,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1375
1377
|
const t = options.textEdit;
|
|
1376
1378
|
ctx.save();
|
|
1377
1379
|
try {
|
|
1378
|
-
const scr = (p) =>
|
|
1380
|
+
const scr = (p) => _chunkQCEQIRJQcjs.projectImagePoint.call(void 0, p, projection);
|
|
1379
1381
|
const poly = (pts) => {
|
|
1380
1382
|
ctx.beginPath();
|
|
1381
1383
|
pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
|
|
@@ -1414,7 +1416,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1414
1416
|
const t = options.freeTransform;
|
|
1415
1417
|
ctx.save();
|
|
1416
1418
|
try {
|
|
1417
|
-
const scr = (p) =>
|
|
1419
|
+
const scr = (p) => _chunkQCEQIRJQcjs.projectImagePoint.call(void 0, p, projection);
|
|
1418
1420
|
ctx.beginPath();
|
|
1419
1421
|
if (t.warp) {
|
|
1420
1422
|
for (const c of t.warp.curves) {
|
|
@@ -1472,7 +1474,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1472
1474
|
}
|
|
1473
1475
|
if (isActivelyCropping) {
|
|
1474
1476
|
const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
|
|
1475
|
-
this.drawCropOverlay(ctx,
|
|
1477
|
+
this.drawCropOverlay(ctx, _chunkQCEQIRJQcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
|
|
1476
1478
|
}
|
|
1477
1479
|
}
|
|
1478
1480
|
/**
|
|
@@ -1481,7 +1483,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1481
1483
|
*/
|
|
1482
1484
|
async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
|
|
1483
1485
|
const { adjustments, depthMask } = state;
|
|
1484
|
-
const rotated =
|
|
1486
|
+
const rotated = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1485
1487
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1486
1488
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1487
1489
|
const baseCanvas = this.createCanvas(baseW, baseH);
|
|
@@ -1489,7 +1491,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1489
1491
|
if (!baseCtx) return baseCanvas;
|
|
1490
1492
|
const projection = getBaseProjection(region, transform, baseW, baseH);
|
|
1491
1493
|
baseCtx.save();
|
|
1492
|
-
|
|
1494
|
+
_chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
|
|
1493
1495
|
baseCtx.drawImage(
|
|
1494
1496
|
img,
|
|
1495
1497
|
region.x,
|
|
@@ -1504,8 +1506,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1504
1506
|
baseCtx.restore();
|
|
1505
1507
|
const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
|
|
1506
1508
|
if (imageData) {
|
|
1507
|
-
const layerMasks =
|
|
1508
|
-
|
|
1509
|
+
const layerMasks = _chunkQCEQIRJQcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
|
|
1510
|
+
_chunkQCEQIRJQcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
|
|
1509
1511
|
if (depthMask.enabled && depthMask.maskSource) {
|
|
1510
1512
|
try {
|
|
1511
1513
|
const maskImg = await this.imageCache.get(depthMask.maskSource);
|
|
@@ -1516,7 +1518,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1516
1518
|
const maskCtx = maskCanvas.getContext("2d");
|
|
1517
1519
|
if (maskCtx) {
|
|
1518
1520
|
maskCtx.save();
|
|
1519
|
-
|
|
1521
|
+
_chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
|
|
1520
1522
|
maskCtx.drawImage(
|
|
1521
1523
|
maskImg,
|
|
1522
1524
|
region.x * sx,
|
|
@@ -1531,7 +1533,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1531
1533
|
maskCtx.restore();
|
|
1532
1534
|
const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
|
|
1533
1535
|
if (maskData) {
|
|
1534
|
-
|
|
1536
|
+
_chunkQCEQIRJQcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
|
|
1535
1537
|
}
|
|
1536
1538
|
}
|
|
1537
1539
|
} catch (e8) {
|
|
@@ -1550,7 +1552,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1550
1552
|
else if (this.baseRoute === "layers") route = "layers";
|
|
1551
1553
|
else {
|
|
1552
1554
|
const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
|
|
1553
|
-
const shaped = this.baseRoute === "legacy" &&
|
|
1555
|
+
const shaped = this.baseRoute === "legacy" && _chunkQCEQIRJQcjs.isLegacyShape.call(void 0, stack);
|
|
1554
1556
|
route = shaped || needsLegacyBase({
|
|
1555
1557
|
stack,
|
|
1556
1558
|
region,
|
|
@@ -1685,17 +1687,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1685
1687
|
if (!comp) return null;
|
|
1686
1688
|
const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
|
|
1687
1689
|
const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
|
|
1688
|
-
const rotated =
|
|
1690
|
+
const rotated = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
1689
1691
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
1690
1692
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
1691
|
-
const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${
|
|
1693
|
+
const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkQCEQIRJQcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
|
|
1692
1694
|
if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
|
|
1693
1695
|
const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
|
|
1694
1696
|
const ctx = canvas.getContext("2d");
|
|
1695
1697
|
if (!ctx) return null;
|
|
1696
1698
|
ctx.clearRect(0, 0, baseW, baseH);
|
|
1697
1699
|
ctx.save();
|
|
1698
|
-
|
|
1700
|
+
_chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
|
|
1699
1701
|
ctx.beginPath();
|
|
1700
1702
|
ctx.rect(region.x, region.y, region.width, region.height);
|
|
1701
1703
|
ctx.clip();
|
|
@@ -1967,7 +1969,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1967
1969
|
ctx.strokeStyle = "#3b82f6";
|
|
1968
1970
|
ctx.lineWidth = 1.5;
|
|
1969
1971
|
ctx.setLineDash([4, 4]);
|
|
1970
|
-
const bounds =
|
|
1972
|
+
const bounds = _chunkQCEQIRJQcjs.getAnnotationBounds.call(void 0, ann);
|
|
1971
1973
|
const pad = 4;
|
|
1972
1974
|
ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
|
|
1973
1975
|
ctx.fillStyle = "#ffffff";
|
|
@@ -1988,7 +1990,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
1988
1990
|
}
|
|
1989
1991
|
/** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
|
|
1990
1992
|
getAnnotationBounds(ann) {
|
|
1991
|
-
return
|
|
1993
|
+
return _chunkQCEQIRJQcjs.getAnnotationBounds.call(void 0, ann);
|
|
1992
1994
|
}
|
|
1993
1995
|
/**
|
|
1994
1996
|
* Draws a rule-of-thirds crop grid overlay. All rectangles come from
|
|
@@ -2070,8 +2072,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2070
2072
|
}
|
|
2071
2073
|
const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
|
|
2072
2074
|
const { crop, transform, annotations } = state;
|
|
2073
|
-
const region = crop ?
|
|
2074
|
-
const rotated =
|
|
2075
|
+
const region = crop ? _chunkQCEQIRJQcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
|
|
2076
|
+
const rotated = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
|
|
2075
2077
|
const baseW = Math.max(1, Math.round(rotated.width));
|
|
2076
2078
|
const baseH = Math.max(1, Math.round(rotated.height));
|
|
2077
2079
|
const exportW = options.width || baseW;
|
|
@@ -2100,7 +2102,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2100
2102
|
const bctx = baseCanvas.getContext("2d");
|
|
2101
2103
|
if (bctx) {
|
|
2102
2104
|
bctx.save();
|
|
2103
|
-
|
|
2105
|
+
_chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
|
|
2104
2106
|
bctx.beginPath();
|
|
2105
2107
|
bctx.rect(region.x, region.y, region.width, region.height);
|
|
2106
2108
|
bctx.clip();
|
|
@@ -2113,7 +2115,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2113
2115
|
if (options.includeAnnotations !== false && overlay.length > 0) {
|
|
2114
2116
|
ctx.save();
|
|
2115
2117
|
ctx.scale(exportW / baseW, exportH / baseH);
|
|
2116
|
-
|
|
2118
|
+
_chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
|
|
2117
2119
|
for (const ann of overlay) {
|
|
2118
2120
|
await this.drawAnnotation(ctx, ann);
|
|
2119
2121
|
}
|
|
@@ -2203,7 +2205,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
2203
2205
|
case "rect":
|
|
2204
2206
|
case "image":
|
|
2205
2207
|
case "text": {
|
|
2206
|
-
const b =
|
|
2208
|
+
const b = _chunkQCEQIRJQcjs.getAnnotationBounds.call(void 0, ann);
|
|
2207
2209
|
ctx.fillRect(b.x, b.y, b.width, b.height);
|
|
2208
2210
|
break;
|
|
2209
2211
|
}
|
|
@@ -2223,7 +2225,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
|
|
|
2223
2225
|
function getBaseProjection(region, transform, baseW, baseH) {
|
|
2224
2226
|
return {
|
|
2225
2227
|
region,
|
|
2226
|
-
angle:
|
|
2228
|
+
angle: _chunkQCEQIRJQcjs.normalizeAngle.call(void 0, transform.rotate),
|
|
2227
2229
|
flipH: transform.flipH,
|
|
2228
2230
|
flipV: transform.flipV,
|
|
2229
2231
|
scale: 1,
|
|
@@ -2327,8 +2329,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
2327
2329
|
}
|
|
2328
2330
|
function toMask(width, height, coverage) {
|
|
2329
2331
|
const out = new Uint8Array(coverage.length);
|
|
2330
|
-
for (let i = 0; i < out.length; i++) out[i] =
|
|
2331
|
-
return
|
|
2332
|
+
for (let i = 0; i < out.length; i++) out[i] = _chunkQCEQIRJQcjs.coverageToByte.call(void 0, coverage[i]);
|
|
2333
|
+
return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, width, height, out);
|
|
2332
2334
|
}
|
|
2333
2335
|
function polygonSelection(width, height, points, options = {}) {
|
|
2334
2336
|
return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
|
|
@@ -2455,7 +2457,7 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2455
2457
|
const { width: w, height: h } = pixels;
|
|
2456
2458
|
const sx = Math.floor(seed.x);
|
|
2457
2459
|
const sy = Math.floor(seed.y);
|
|
2458
|
-
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return
|
|
2460
|
+
if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, w, h);
|
|
2459
2461
|
const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
|
|
2460
2462
|
const marks = new Uint8Array(n);
|
|
2461
2463
|
let bx0 = w;
|
|
@@ -2503,9 +2505,9 @@ function magicWand(pixels, seed, options = {}) {
|
|
|
2503
2505
|
}
|
|
2504
2506
|
}
|
|
2505
2507
|
}
|
|
2506
|
-
if (bx1 < 0) return
|
|
2507
|
-
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return
|
|
2508
|
-
return
|
|
2508
|
+
if (bx1 < 0) return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, w, h);
|
|
2509
|
+
if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, w, h, marks);
|
|
2510
|
+
return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0,
|
|
2509
2511
|
w,
|
|
2510
2512
|
h,
|
|
2511
2513
|
antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
|
|
@@ -2527,7 +2529,7 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2527
2529
|
const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
|
|
2528
2530
|
const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
|
|
2529
2531
|
const out = new Uint8Array(n);
|
|
2530
|
-
if (!parsed.length) return
|
|
2532
|
+
if (!parsed.length) return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2531
2533
|
for (let i = 0; i < n; i++) {
|
|
2532
2534
|
const p = i * 4;
|
|
2533
2535
|
if (data[p + 3] <= 0) continue;
|
|
@@ -2543,9 +2545,9 @@ function colorRange(pixels, samples, options = {}) {
|
|
|
2543
2545
|
}
|
|
2544
2546
|
if (k > best) best = k;
|
|
2545
2547
|
}
|
|
2546
|
-
out[i] =
|
|
2548
|
+
out[i] = _chunkQCEQIRJQcjs.coverageToByte.call(void 0, best);
|
|
2547
2549
|
}
|
|
2548
|
-
return
|
|
2550
|
+
return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, w, h, out);
|
|
2549
2551
|
}
|
|
2550
2552
|
var TONE_RANGE_PRESETS = {
|
|
2551
2553
|
shadows: [0, 65],
|
|
@@ -2563,9 +2565,9 @@ function toneRange(pixels, range, falloff = 20) {
|
|
|
2563
2565
|
if (d[p + 3] <= 0) continue;
|
|
2564
2566
|
const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
|
|
2565
2567
|
const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
|
|
2566
|
-
out[i] =
|
|
2568
|
+
out[i] = _chunkQCEQIRJQcjs.coverageToByte.call(void 0, 1 - outside / ramp);
|
|
2567
2569
|
}
|
|
2568
|
-
return
|
|
2570
|
+
return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2569
2571
|
}
|
|
2570
2572
|
function hueRange(pixels, center) {
|
|
2571
2573
|
const n = checkPixels(pixels);
|
|
@@ -2588,9 +2590,9 @@ function hueRange(pixels, center) {
|
|
|
2588
2590
|
hue *= 60;
|
|
2589
2591
|
let dh = ((hue - center) % 360 + 360) % 360;
|
|
2590
2592
|
dh = Math.min(dh, 360 - dh);
|
|
2591
|
-
out[i] =
|
|
2593
|
+
out[i] = _chunkQCEQIRJQcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
|
|
2592
2594
|
}
|
|
2593
|
-
return
|
|
2595
|
+
return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
|
|
2594
2596
|
}
|
|
2595
2597
|
|
|
2596
2598
|
// src/image-editor/selection/refine.ts
|
|
@@ -2724,9 +2726,9 @@ function edgeWidth(guide, w, h, r) {
|
|
|
2724
2726
|
g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
|
|
2725
2727
|
}
|
|
2726
2728
|
}
|
|
2727
|
-
const gm =
|
|
2728
|
-
const hi =
|
|
2729
|
-
const lo =
|
|
2729
|
+
const gm = _chunkQCEQIRJQcjs.greyMorphology.call(void 0, g, w, h, r, true);
|
|
2730
|
+
const hi = _chunkQCEQIRJQcjs.greyMorphology.call(void 0, y, w, h, r, true);
|
|
2731
|
+
const lo = _chunkQCEQIRJQcjs.greyMorphology.call(void 0, y, w, h, r, false);
|
|
2730
2732
|
const out = new Float32Array(n);
|
|
2731
2733
|
for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
|
|
2732
2734
|
return out;
|
|
@@ -2750,7 +2752,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2750
2752
|
}
|
|
2751
2753
|
}
|
|
2752
2754
|
if (any) {
|
|
2753
|
-
const dist =
|
|
2755
|
+
const dist = _chunkQCEQIRJQcjs.distanceTransform.call(void 0, boundary, w, h);
|
|
2754
2756
|
const r = gfRadius(p);
|
|
2755
2757
|
const q = guidedFilterColor(guide, m, w, h, r);
|
|
2756
2758
|
const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
|
|
@@ -2776,7 +2778,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
|
|
|
2776
2778
|
for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
|
|
2777
2779
|
}
|
|
2778
2780
|
const amount = shiftAmount(p);
|
|
2779
|
-
if (Math.abs(amount) >= 1e-4) a =
|
|
2781
|
+
if (Math.abs(amount) >= 1e-4) a = _chunkQCEQIRJQcjs.shiftCoverage.call(void 0, a, w, h, amount);
|
|
2780
2782
|
return a;
|
|
2781
2783
|
}
|
|
2782
2784
|
function guidePlanes(pixels, win) {
|
|
@@ -2820,9 +2822,9 @@ function refineSelection(pixels, mask, params = {}) {
|
|
|
2820
2822
|
const out = new Uint8Array(mask.width * mask.height);
|
|
2821
2823
|
for (let y = 0; y < wh; y++) {
|
|
2822
2824
|
const dst = (y0 + y) * mask.width + x0;
|
|
2823
|
-
for (let x = 0; x < ww; x++) out[dst + x] =
|
|
2825
|
+
for (let x = 0; x < ww; x++) out[dst + x] = _chunkQCEQIRJQcjs.coverageToByte.call(void 0, refined[y * ww + x]);
|
|
2824
2826
|
}
|
|
2825
|
-
return
|
|
2827
|
+
return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
|
|
2826
2828
|
}
|
|
2827
2829
|
|
|
2828
2830
|
// src/image-editor/effects.ts
|
|
@@ -2992,7 +2994,7 @@ var ImageEffectsEngine = (_class4 = class {
|
|
|
2992
2994
|
// src/image-editor/free-transform.ts
|
|
2993
2995
|
var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
|
|
2994
2996
|
var fail = (message) => {
|
|
2995
|
-
throw new (0,
|
|
2997
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(message);
|
|
2996
2998
|
};
|
|
2997
2999
|
var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
|
|
2998
3000
|
function previewStep(scale) {
|
|
@@ -3101,7 +3103,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3101
3103
|
} else {
|
|
3102
3104
|
const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
|
|
3103
3105
|
if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
|
|
3104
|
-
const layer =
|
|
3106
|
+
const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, layers, id).layer;
|
|
3105
3107
|
this.layerId = layer.id;
|
|
3106
3108
|
const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
|
|
3107
3109
|
const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
|
|
@@ -3112,20 +3114,20 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3112
3114
|
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.`);
|
|
3113
3115
|
if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
|
|
3114
3116
|
if (content !== "selection-copy") {
|
|
3115
|
-
|
|
3116
|
-
if (!maskAlone)
|
|
3117
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
|
|
3118
|
+
if (!maskAlone) _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
|
|
3117
3119
|
}
|
|
3118
3120
|
const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
3119
3121
|
const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
|
|
3120
3122
|
if (layer.type === "smart" && !maskAlone) {
|
|
3121
3123
|
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).`);
|
|
3122
|
-
if (!
|
|
3124
|
+
if (!_chunkQCEQIRJQcjs.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.`);
|
|
3123
3125
|
this.smart = layer;
|
|
3124
3126
|
this.smartObject = true;
|
|
3125
|
-
this.startGeometry =
|
|
3127
|
+
this.startGeometry = _chunkQCEQIRJQcjs.placementGeometry.call(void 0, layer);
|
|
3126
3128
|
if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
|
|
3127
3129
|
this.startInterp = this.interp;
|
|
3128
|
-
this.box =
|
|
3130
|
+
this.box = _chunkQCEQIRJQcjs.contentsBox.call(void 0, layer.contents);
|
|
3129
3131
|
this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
|
|
3130
3132
|
this.geometryValue = this.startGeometry;
|
|
3131
3133
|
this.shown = this.startLayers;
|
|
@@ -3133,8 +3135,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3133
3135
|
}
|
|
3134
3136
|
if (layer.type === "type" && !maskAlone) {
|
|
3135
3137
|
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).`);
|
|
3136
|
-
const frame =
|
|
3137
|
-
const m =
|
|
3138
|
+
const frame = _chunkQCEQIRJQcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
|
|
3139
|
+
const m = _chunkQCEQIRJQcjs.textMatrix.call(void 0, layer);
|
|
3138
3140
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
3139
3141
|
this.typeTarget = layer;
|
|
3140
3142
|
this.typeLayer = true;
|
|
@@ -3153,7 +3155,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3153
3155
|
}
|
|
3154
3156
|
if (layer.type === "shape" && !maskAlone) {
|
|
3155
3157
|
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).`);
|
|
3156
|
-
const g =
|
|
3158
|
+
const g = _chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, layer);
|
|
3157
3159
|
if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
|
|
3158
3160
|
const w = Math.max(g.width, 1);
|
|
3159
3161
|
const h = Math.max(g.height, 1);
|
|
@@ -3201,7 +3203,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3201
3203
|
if (box) {
|
|
3202
3204
|
const copy = {
|
|
3203
3205
|
type: "pixel",
|
|
3204
|
-
id:
|
|
3206
|
+
id: _chunkQCEQIRJQcjs.newLayerId.call(void 0, ),
|
|
3205
3207
|
name: `${layer.name || "Layer"} copy`,
|
|
3206
3208
|
visible: true,
|
|
3207
3209
|
opacity: 1,
|
|
@@ -3225,7 +3227,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3225
3227
|
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).");
|
|
3226
3228
|
this.box = box;
|
|
3227
3229
|
this.moves = moves;
|
|
3228
|
-
this.startGeometry =
|
|
3230
|
+
this.startGeometry = _chunkQCEQIRJQcjs.identityTransform.call(void 0, box);
|
|
3229
3231
|
this.startInterp = this.interp;
|
|
3230
3232
|
this.geometryValue = this.startGeometry;
|
|
3231
3233
|
this.shown = this.startLayers;
|
|
@@ -3303,8 +3305,8 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3303
3305
|
warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
|
|
3304
3306
|
};
|
|
3305
3307
|
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.");
|
|
3306
|
-
if (!
|
|
3307
|
-
if (this.typeTarget && (
|
|
3308
|
+
if (!_chunkQCEQIRJQcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
|
|
3309
|
+
if (this.typeTarget && (_chunkQCEQIRJQcjs.hasWarp.call(void 0, next) || !_chunkQCEQIRJQcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
|
|
3308
3310
|
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.");
|
|
3309
3311
|
}
|
|
3310
3312
|
this.geometryValue = next;
|
|
@@ -3316,10 +3318,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3316
3318
|
if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
|
|
3317
3319
|
if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
|
|
3318
3320
|
const g = this.geometryValue;
|
|
3319
|
-
const identity =
|
|
3320
|
-
const warp =
|
|
3321
|
-
const h = warp ? null :
|
|
3322
|
-
const f = warp ?
|
|
3321
|
+
const identity = _chunkQCEQIRJQcjs.isIdentityTransform.call(void 0, g);
|
|
3322
|
+
const warp = _chunkQCEQIRJQcjs.hasWarp.call(void 0, g);
|
|
3323
|
+
const h = warp ? null : _chunkQCEQIRJQcjs.geometryHomography.call(void 0, g);
|
|
3324
|
+
const f = warp ? _chunkQCEQIRJQcjs.transformMap.call(void 0, g) : null;
|
|
3323
3325
|
const step = final ? 1 : previewStep(preview.scale);
|
|
3324
3326
|
const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
|
|
3325
3327
|
let layers = this.startLayers;
|
|
@@ -3363,7 +3365,7 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3363
3365
|
if (part.what === "selection") {
|
|
3364
3366
|
const { width, height } = this.host.canvas();
|
|
3365
3367
|
const data = new Uint8Array(_chunkCWM3CUUXcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
|
|
3366
|
-
const next =
|
|
3368
|
+
const next = _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, width, height, data);
|
|
3367
3369
|
selection = next.bounds ? next : null;
|
|
3368
3370
|
} else if (part.what === "pixels") {
|
|
3369
3371
|
layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, targetId, (l) => {
|
|
@@ -3385,14 +3387,14 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3385
3387
|
resampleShape(final, preview, warpMap, h) {
|
|
3386
3388
|
const layer = this.shape;
|
|
3387
3389
|
let components = layer.components;
|
|
3388
|
-
if (!
|
|
3390
|
+
if (!_chunkQCEQIRJQcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
|
|
3389
3391
|
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;
|
|
3390
3392
|
const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkQT26RHKKcjs.applyHomography.call(void 0, h, p) : p)));
|
|
3391
|
-
components =
|
|
3393
|
+
components = _chunkQCEQIRJQcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
|
|
3392
3394
|
}
|
|
3393
3395
|
const moved = { ...layer, components };
|
|
3394
3396
|
delete moved.annotation;
|
|
3395
|
-
const surface =
|
|
3397
|
+
const surface = _chunkQCEQIRJQcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
|
|
3396
3398
|
return _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
|
|
3397
3399
|
}
|
|
3398
3400
|
/**
|
|
@@ -3402,13 +3404,13 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3402
3404
|
resampleType() {
|
|
3403
3405
|
const layer = this.typeTarget;
|
|
3404
3406
|
const g = this.geometryValue;
|
|
3405
|
-
if (
|
|
3406
|
-
const m =
|
|
3407
|
+
if (_chunkQCEQIRJQcjs.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.");
|
|
3408
|
+
const m = _chunkQCEQIRJQcjs.matrixFromCorners.call(void 0, g.box, g.corners);
|
|
3407
3409
|
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.");
|
|
3408
3410
|
const next = { ...layer, transform: m };
|
|
3409
3411
|
delete next.annotation;
|
|
3410
|
-
let layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () =>
|
|
3411
|
-
const change = _chunkQT26RHKKcjs.multiplyHomographies.call(void 0, _chunkQT26RHKKcjs.homographyFromAffine.call(void 0,
|
|
3412
|
+
let layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkQCEQIRJQcjs.rerenderText.call(void 0, next, this.host.textEnv()));
|
|
3413
|
+
const change = _chunkQT26RHKKcjs.multiplyHomographies.call(void 0, _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, _chunkRHXW4TA5cjs.invertMatrix.call(void 0, _chunkQCEQIRJQcjs.textMatrix.call(void 0, layer))), _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, m));
|
|
3412
3414
|
for (const part of this.parts) {
|
|
3413
3415
|
if (part.what !== "mask") continue;
|
|
3414
3416
|
const surface = _chunkHGTDMKNEcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
|
|
@@ -3424,12 +3426,12 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3424
3426
|
const canvas = this.host.canvas();
|
|
3425
3427
|
try {
|
|
3426
3428
|
if (final) {
|
|
3427
|
-
const res =
|
|
3429
|
+
const res = _chunkQCEQIRJQcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
|
|
3428
3430
|
this.smartMasksMoved = res.masksMoved;
|
|
3429
3431
|
return res.layers;
|
|
3430
3432
|
}
|
|
3431
3433
|
const step = previewStep(preview.scale);
|
|
3432
|
-
const surface =
|
|
3434
|
+
const surface = _chunkQCEQIRJQcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
|
|
3433
3435
|
return _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
|
|
3434
3436
|
} catch (e) {
|
|
3435
3437
|
if (e instanceof _chunkHGTDMKNEcjs.TransformTooLargeError) fail(e.message);
|
|
@@ -3439,10 +3441,10 @@ var FreeTransformSession = (_class5 = class {
|
|
|
3439
3441
|
/** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
|
|
3440
3442
|
isChanged() {
|
|
3441
3443
|
const g = this.geometryValue;
|
|
3442
|
-
if (!this.smart && !this.typeTarget) return !
|
|
3444
|
+
if (!this.smart && !this.typeTarget) return !_chunkQCEQIRJQcjs.isIdentityTransform.call(void 0, g);
|
|
3443
3445
|
const a = this.startGeometry;
|
|
3444
3446
|
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);
|
|
3445
|
-
const warp = (w, box) => w &&
|
|
3447
|
+
const warp = (w, box) => w && _chunkQCEQIRJQcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
|
|
3446
3448
|
return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
|
|
3447
3449
|
}
|
|
3448
3450
|
render(preview) {
|
|
@@ -3513,7 +3515,7 @@ function effectiveProof(proof, mode) {
|
|
|
3513
3515
|
function colorModePlanes(doc, mode) {
|
|
3514
3516
|
const src = resolveProfile(doc);
|
|
3515
3517
|
if (mode.mode === "cmyk") {
|
|
3516
|
-
const t2 =
|
|
3518
|
+
const t2 = _chunkBROJYMWUcjs.Transform.create(src, resolveProfile(mode.profile), { intent: mode.intent, bpc: true });
|
|
3517
3519
|
return (rgba, n) => {
|
|
3518
3520
|
const ink = new Uint8Array(n * 4);
|
|
3519
3521
|
t2.convert8(rgba, 4, ink, 4, false);
|
|
@@ -3522,7 +3524,7 @@ function colorModePlanes(doc, mode) {
|
|
|
3522
3524
|
return planes;
|
|
3523
3525
|
};
|
|
3524
3526
|
}
|
|
3525
|
-
const t =
|
|
3527
|
+
const t = _chunkBROJYMWUcjs.Transform.create(src, _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
|
|
3526
3528
|
return (rgba, n) => {
|
|
3527
3529
|
const lab = new Uint8Array(n * 4);
|
|
3528
3530
|
t.convert8(rgba, 4, lab, 4, false);
|
|
@@ -3534,7 +3536,7 @@ function colorModePlanes(doc, mode) {
|
|
|
3534
3536
|
function colorModePlanes16(doc, mode) {
|
|
3535
3537
|
const src = resolveProfile(doc);
|
|
3536
3538
|
const cmyk = mode.mode === "cmyk";
|
|
3537
|
-
const t = cmyk ?
|
|
3539
|
+
const t = cmyk ? _chunkBROJYMWUcjs.Transform.create(src, resolveProfile(mode.profile), { intent: mode.intent, bpc: true }) : _chunkBROJYMWUcjs.Transform.create(src, _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
|
|
3538
3540
|
const k = cmyk ? 4 : 3;
|
|
3539
3541
|
return (rgba, n) => {
|
|
3540
3542
|
const out = new Uint16Array(n * 4);
|
|
@@ -3547,38 +3549,38 @@ function colorModePlanes16(doc, mode) {
|
|
|
3547
3549
|
var resolved = /* @__PURE__ */ new WeakMap();
|
|
3548
3550
|
var fromBytes = /* @__PURE__ */ new Map();
|
|
3549
3551
|
function resolveProfile(doc) {
|
|
3550
|
-
if (!doc) return
|
|
3552
|
+
if (!doc) return _chunkBROJYMWUcjs.srgbProfile.call(void 0, );
|
|
3551
3553
|
const hit = resolved.get(doc);
|
|
3552
3554
|
if (hit) return hit;
|
|
3553
3555
|
let p;
|
|
3554
|
-
if (doc.builtin) p =
|
|
3556
|
+
if (doc.builtin) p = _chunkBROJYMWUcjs.builtinProfile.call(void 0, doc.builtin);
|
|
3555
3557
|
else if (doc.icc) {
|
|
3556
3558
|
const key = _chunkCWM3CUUXcjs.bytesToBase64.call(void 0, doc.icc);
|
|
3557
|
-
p = _nullishCoalesce(fromBytes.get(key), () => (
|
|
3559
|
+
p = _nullishCoalesce(fromBytes.get(key), () => ( _chunkBROJYMWUcjs.parseProfile.call(void 0, doc.icc)));
|
|
3558
3560
|
if (fromBytes.size > 32) fromBytes.clear();
|
|
3559
3561
|
fromBytes.set(key, p);
|
|
3560
|
-
} else p =
|
|
3562
|
+
} else p = _chunkBROJYMWUcjs.srgbProfile.call(void 0, );
|
|
3561
3563
|
resolved.set(doc, p);
|
|
3562
3564
|
return p;
|
|
3563
3565
|
}
|
|
3564
3566
|
function profileBytes(doc) {
|
|
3565
3567
|
if (_optionalChain([doc, 'optionalAccess', _76 => _76.icc])) return doc.icc;
|
|
3566
3568
|
const p = resolveProfile(doc);
|
|
3567
|
-
return _nullishCoalesce(p.bytes, () => (
|
|
3569
|
+
return _nullishCoalesce(p.bytes, () => ( _chunkBROJYMWUcjs.encodeProfile.call(void 0, p)));
|
|
3568
3570
|
}
|
|
3569
3571
|
function documentProfile(input) {
|
|
3570
3572
|
if (typeof input === "string") {
|
|
3571
|
-
const id =
|
|
3572
|
-
if (!id) throw new (0,
|
|
3573
|
-
return { builtin: id, name:
|
|
3573
|
+
const id = _chunkBROJYMWUcjs.builtinProfileId.call(void 0, input);
|
|
3574
|
+
if (!id) throw new (0, _chunkBROJYMWUcjs.CmsError)(`Unknown colour profile "${input}"; use one of ${_chunkBROJYMWUcjs.BUILTIN_PROFILES.map((b) => b.id).join(", ")}, or ICC bytes.`);
|
|
3575
|
+
return { builtin: id, name: _chunkBROJYMWUcjs.BUILTIN_PROFILES.find((b) => b.id === id).description };
|
|
3574
3576
|
}
|
|
3575
|
-
const p =
|
|
3577
|
+
const p = _chunkBROJYMWUcjs.parseProfile.call(void 0, input);
|
|
3576
3578
|
return { name: p.description || "Embedded profile", icc: input.slice() };
|
|
3577
3579
|
}
|
|
3578
3580
|
function isSrgb(doc) {
|
|
3579
3581
|
if (!doc || doc.builtin === "srgb") return true;
|
|
3580
3582
|
try {
|
|
3581
|
-
return
|
|
3583
|
+
return _chunkBROJYMWUcjs.sameColors.call(void 0, resolveProfile(doc), _chunkBROJYMWUcjs.srgbProfile.call(void 0, ), _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"));
|
|
3582
3584
|
} catch (e14) {
|
|
3583
3585
|
return false;
|
|
3584
3586
|
}
|
|
@@ -3591,13 +3593,13 @@ function deserializeColorProfile(raw, problems) {
|
|
|
3591
3593
|
if (!r || typeof r !== "object") return null;
|
|
3592
3594
|
try {
|
|
3593
3595
|
if (r.builtin) {
|
|
3594
|
-
const id =
|
|
3595
|
-
if (!id) throw new (0,
|
|
3596
|
+
const id = _chunkBROJYMWUcjs.builtinProfileId.call(void 0, r.builtin);
|
|
3597
|
+
if (!id) throw new (0, _chunkBROJYMWUcjs.CmsError)(`unknown built-in profile "${r.builtin}"`);
|
|
3596
3598
|
return documentProfile(id);
|
|
3597
3599
|
}
|
|
3598
3600
|
if (typeof r.icc === "string") {
|
|
3599
3601
|
const icc = _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, r.icc);
|
|
3600
|
-
|
|
3602
|
+
_chunkBROJYMWUcjs.parseProfile.call(void 0, icc);
|
|
3601
3603
|
return { name: typeof r.name === "string" ? r.name : "Embedded profile", icc };
|
|
3602
3604
|
}
|
|
3603
3605
|
} catch (e) {
|
|
@@ -3607,14 +3609,14 @@ function deserializeColorProfile(raw, problems) {
|
|
|
3607
3609
|
}
|
|
3608
3610
|
function displayTransform(doc, proof) {
|
|
3609
3611
|
const src = resolveProfile(doc);
|
|
3610
|
-
const display =
|
|
3612
|
+
const display = _chunkBROJYMWUcjs.srgbProfile.call(void 0, );
|
|
3611
3613
|
let t = null;
|
|
3612
3614
|
let gamut = null;
|
|
3613
3615
|
if (proof) {
|
|
3614
3616
|
const p = resolveProfile(proof.profile);
|
|
3615
|
-
t =
|
|
3616
|
-
if (proof.gamutWarning) gamut = new (0,
|
|
3617
|
-
} else if (!isSrgb(doc)) t =
|
|
3617
|
+
t = _chunkBROJYMWUcjs.Transform.proof(src, p, display, proof.intent, proof.bpc, proof.simulatePaper);
|
|
3618
|
+
if (proof.gamutWarning) gamut = new (0, _chunkBROJYMWUcjs.GamutCheck)(src, p, _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"));
|
|
3619
|
+
} else if (!isSrgb(doc)) t = _chunkBROJYMWUcjs.Transform.create(src, display, { intent: "relative", bpc: true });
|
|
3618
3620
|
if (!t) return null;
|
|
3619
3621
|
const tr = t;
|
|
3620
3622
|
const g = gamut;
|
|
@@ -3641,7 +3643,7 @@ function convertHex(hex, from, to, intent = "relative", bpc = true) {
|
|
|
3641
3643
|
if (!m) return hex;
|
|
3642
3644
|
const n = parseInt(m[1], 16);
|
|
3643
3645
|
const out = new Float32Array(4);
|
|
3644
|
-
|
|
3646
|
+
_chunkBROJYMWUcjs.Transform.create(from, to, { intent, bpc }).eval([(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255], out);
|
|
3645
3647
|
const c = (v) => Math.round(Math.min(1, Math.max(0, v)) * 255).toString(16).padStart(2, "0");
|
|
3646
3648
|
return `#${c(out[0])}${c(out[1])}${c(out[2])}`;
|
|
3647
3649
|
}
|
|
@@ -3702,7 +3704,7 @@ function convertSurfaceColors(surface, t) {
|
|
|
3702
3704
|
}
|
|
3703
3705
|
|
|
3704
3706
|
// src/image-editor/controller.ts
|
|
3705
|
-
var IMAGE_EDITOR_SCHEMA_VERSION =
|
|
3707
|
+
var IMAGE_EDITOR_SCHEMA_VERSION = _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION;
|
|
3706
3708
|
var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge", "blur", "sharpen", "history"];
|
|
3707
3709
|
var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
|
|
3708
3710
|
var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
|
|
@@ -3896,7 +3898,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3896
3898
|
for (const t of _chunkCWM3CUUXcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
|
|
3897
3899
|
const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, t.tx, t.ty);
|
|
3898
3900
|
const cur = regions.get(key);
|
|
3899
|
-
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ?
|
|
3901
|
+
regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkQCEQIRJQcjs.unionRect.call(void 0, cur.r, r) : r });
|
|
3900
3902
|
}
|
|
3901
3903
|
}
|
|
3902
3904
|
for (const [key, { tx, ty, r }] of regions) {
|
|
@@ -3928,7 +3930,7 @@ var PaintStrokeSession = (_class6 = class {
|
|
|
3928
3930
|
}
|
|
3929
3931
|
/** Finishes the stroke (one undo step) and returns what changed. */
|
|
3930
3932
|
end() {
|
|
3931
|
-
if (this.closed) throw new (0,
|
|
3933
|
+
if (this.closed) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("This stroke has already ended.");
|
|
3932
3934
|
const last = _nullishCoalesce(this.last, () => ( void 0));
|
|
3933
3935
|
const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
|
|
3934
3936
|
_optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
|
|
@@ -4064,20 +4066,20 @@ function sameTile(a, b) {
|
|
|
4064
4066
|
for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
|
|
4065
4067
|
return true;
|
|
4066
4068
|
}
|
|
4067
|
-
var DEFAULT_ADJUSTMENTS =
|
|
4069
|
+
var DEFAULT_ADJUSTMENTS = _chunkQCEQIRJQcjs.DEFAULT_ADJUSTMENTS_VALUES;
|
|
4068
4070
|
function normalizeStoredAdjustments(stored) {
|
|
4069
4071
|
if (!stored) return { ...DEFAULT_ADJUSTMENTS };
|
|
4070
4072
|
const out = {
|
|
4071
4073
|
...DEFAULT_ADJUSTMENTS,
|
|
4072
4074
|
...stored,
|
|
4073
|
-
process:
|
|
4075
|
+
process: _chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, stored.process)
|
|
4074
4076
|
};
|
|
4075
|
-
const layers =
|
|
4077
|
+
const layers = _chunkQCEQIRJQcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
|
|
4076
4078
|
if (layers.length) out.layers = layers;
|
|
4077
4079
|
else delete out.layers;
|
|
4078
4080
|
return out;
|
|
4079
4081
|
}
|
|
4080
|
-
var isLayered = (data) => Boolean(data && data.version ===
|
|
4082
|
+
var isLayered = (data) => Boolean(data && data.version === _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
|
|
4081
4083
|
function migrateSerializedImageEditorState(data) {
|
|
4082
4084
|
if (isLayered(data)) {
|
|
4083
4085
|
const out = {
|
|
@@ -4109,10 +4111,10 @@ function migrateSerializedImageEditorState(data) {
|
|
|
4109
4111
|
function migrateToLayeredState(data, size) {
|
|
4110
4112
|
const clean = migrateSerializedImageEditorState(data);
|
|
4111
4113
|
if (isLayered(clean)) return clean;
|
|
4112
|
-
const stack =
|
|
4113
|
-
const { layers, assets } =
|
|
4114
|
+
const stack = _chunkQCEQIRJQcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
|
|
4115
|
+
const { layers, assets } = _chunkQCEQIRJQcjs.serializeLayers.call(void 0, stack.layers);
|
|
4114
4116
|
const out = {
|
|
4115
|
-
version:
|
|
4117
|
+
version: _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION,
|
|
4116
4118
|
width: Math.round(size.width),
|
|
4117
4119
|
height: Math.round(size.height),
|
|
4118
4120
|
layers,
|
|
@@ -4126,8 +4128,8 @@ function migrateToLayeredState(data, size) {
|
|
|
4126
4128
|
if (clean.selection) out.selection = clean.selection;
|
|
4127
4129
|
return out;
|
|
4128
4130
|
}
|
|
4129
|
-
var DEFAULT_TRANSFORM =
|
|
4130
|
-
var DEFAULT_DEPTH_MASK =
|
|
4131
|
+
var DEFAULT_TRANSFORM = _chunkQCEQIRJQcjs.DEFAULT_TRANSFORM_VALUES;
|
|
4132
|
+
var DEFAULT_DEPTH_MASK = _chunkQCEQIRJQcjs.DEFAULT_DEPTH_MASK_VALUES;
|
|
4131
4133
|
var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
|
|
4132
4134
|
var ImageEditorController = (_class7 = class {
|
|
4133
4135
|
|
|
@@ -4150,7 +4152,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4150
4152
|
__init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
|
|
4151
4153
|
__init63() {this.viewKey = []}
|
|
4152
4154
|
/** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
|
|
4153
|
-
__init64() {this.compositor = new (0,
|
|
4155
|
+
__init64() {this.compositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)()}
|
|
4154
4156
|
/** The effects provider slot (see `setEffectsProvider`). */
|
|
4155
4157
|
__init65() {this.effects = new (0, _chunkRUZQMYXHcjs.EffectsSlot)()}
|
|
4156
4158
|
/** Renders provider effects: effect smart filter results and effect layers. */
|
|
@@ -4208,7 +4210,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4208
4210
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
4209
4211
|
if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
|
|
4210
4212
|
try {
|
|
4211
|
-
this.state.selection = normalizeSelection(
|
|
4213
|
+
this.state.selection = normalizeSelection(_chunkQCEQIRJQcjs.deserializeSelection.call(void 0, options.initialState.selection));
|
|
4212
4214
|
} catch (e15) {
|
|
4213
4215
|
}
|
|
4214
4216
|
}
|
|
@@ -4320,10 +4322,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
4320
4322
|
if (l.type === "group") {
|
|
4321
4323
|
const children = walk(l.children);
|
|
4322
4324
|
if (children !== l.children) next2 = { ...l, children };
|
|
4323
|
-
} 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 ||
|
|
4325
|
+
} 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 || _chunkQCEQIRJQcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
|
|
4324
4326
|
try {
|
|
4325
|
-
const r =
|
|
4326
|
-
if (all || !
|
|
4327
|
+
const r = _chunkQCEQIRJQcjs.rerender.call(void 0, l, canvas);
|
|
4328
|
+
if (all || !_chunkQCEQIRJQcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
|
|
4327
4329
|
} catch (e17) {
|
|
4328
4330
|
}
|
|
4329
4331
|
}
|
|
@@ -4379,19 +4381,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4379
4381
|
const d = await this.describeEffect(effect, "filter");
|
|
4380
4382
|
const values = _chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4381
4383
|
const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4382
|
-
if (!found) throw new (0,
|
|
4384
|
+
if (!found) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
|
|
4383
4385
|
let layers = this.state.layers;
|
|
4384
4386
|
let id = layerId;
|
|
4385
4387
|
let converted = false;
|
|
4386
4388
|
if (found.layer.type !== "smart") {
|
|
4387
|
-
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0,
|
|
4388
|
-
const res2 =
|
|
4389
|
+
if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkQCEQIRJQcjs.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.`);
|
|
4390
|
+
const res2 = _chunkQCEQIRJQcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
|
|
4389
4391
|
layers = res2.layers;
|
|
4390
4392
|
id = res2.layer.id;
|
|
4391
4393
|
converted = true;
|
|
4392
4394
|
}
|
|
4393
|
-
const filter =
|
|
4394
|
-
const res =
|
|
4395
|
+
const filter = _chunkQCEQIRJQcjs.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 });
|
|
4396
|
+
const res = _chunkQCEQIRJQcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
|
|
4395
4397
|
this.commitLayers(res.layers);
|
|
4396
4398
|
return { layerId: id, filter: res.filter, converted };
|
|
4397
4399
|
}
|
|
@@ -4402,9 +4404,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4402
4404
|
* false, during a drag).
|
|
4403
4405
|
*/
|
|
4404
4406
|
async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
|
|
4405
|
-
const layer =
|
|
4407
|
+
const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
|
|
4406
4408
|
const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
|
|
4407
|
-
if (!was || was.kind !== "effect") throw new (0,
|
|
4409
|
+
if (!was || was.kind !== "effect") throw new (0, _chunkQCEQIRJQcjs.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"}.`);
|
|
4408
4410
|
const update = {};
|
|
4409
4411
|
if (changes.values) {
|
|
4410
4412
|
const d = await this.describeEffect(was.effect);
|
|
@@ -4413,15 +4415,15 @@ var ImageEditorController = (_class7 = class {
|
|
|
4413
4415
|
for (const [k, v] of Object.entries(changes.values)) {
|
|
4414
4416
|
if (v !== null) given[k] = v;
|
|
4415
4417
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4416
|
-
else throw new (0,
|
|
4418
|
+
else throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4417
4419
|
}
|
|
4418
4420
|
update.values = { ...base, ..._chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4419
4421
|
}
|
|
4420
4422
|
for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
|
|
4421
|
-
let res =
|
|
4422
|
-
if (changes.index !== void 0) res = { ...res, layers:
|
|
4423
|
+
let res = _chunkQCEQIRJQcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
|
|
4424
|
+
if (changes.index !== void 0) res = { ...res, layers: _chunkQCEQIRJQcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
|
|
4423
4425
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
4424
|
-
return
|
|
4426
|
+
return _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
|
|
4425
4427
|
}
|
|
4426
4428
|
/**
|
|
4427
4429
|
* Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
|
|
@@ -4433,12 +4435,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4433
4435
|
const values = _chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, d, options.values);
|
|
4434
4436
|
const { width, height } = this.naturalSize;
|
|
4435
4437
|
const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
|
|
4436
|
-
const blend =
|
|
4437
|
-
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0,
|
|
4438
|
+
const blend = _chunkQCEQIRJQcjs.parseBlend.call(void 0, options.blend);
|
|
4439
|
+
if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4438
4440
|
const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4439
4441
|
const layer = {
|
|
4440
4442
|
type: "pixel",
|
|
4441
|
-
id: options.id && !ids.has(options.id) ? options.id :
|
|
4443
|
+
id: options.id && !ids.has(options.id) ? options.id : _chunkQCEQIRJQcjs.newLayerId.call(void 0, ),
|
|
4442
4444
|
name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
|
|
4443
4445
|
visible: true,
|
|
4444
4446
|
opacity: _nullishCoalesce(options.opacity, () => ( 1)),
|
|
@@ -4447,7 +4449,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4447
4449
|
offset: { x: 0, y: 0 },
|
|
4448
4450
|
generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
|
|
4449
4451
|
};
|
|
4450
|
-
const next =
|
|
4452
|
+
const next = _chunkQCEQIRJQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
|
|
4451
4453
|
this.commitLayers(next, () => {
|
|
4452
4454
|
this.state.activeLayerId = layer.id;
|
|
4453
4455
|
this.state.activeTarget = "pixels";
|
|
@@ -4462,8 +4464,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
4462
4464
|
async updateEffectLayer(layerId, changes, commitToHistory = true) {
|
|
4463
4465
|
const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4464
4466
|
const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
|
|
4465
|
-
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0,
|
|
4466
|
-
|
|
4467
|
+
if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
|
|
4468
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
|
|
4467
4469
|
const g = layer.generator;
|
|
4468
4470
|
const d = await this.describeEffect(g.effect);
|
|
4469
4471
|
const base = { ...g.values };
|
|
@@ -4471,7 +4473,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4471
4473
|
for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
|
|
4472
4474
|
if (v !== null) given[k] = v;
|
|
4473
4475
|
else if (k in d.controls.properties) base[k] = d.defaults[k];
|
|
4474
|
-
else throw new (0,
|
|
4476
|
+
else throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
|
|
4475
4477
|
}
|
|
4476
4478
|
const values = { ...base, ..._chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
|
|
4477
4479
|
const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
|
|
@@ -4486,7 +4488,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4486
4488
|
/** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
|
|
4487
4489
|
rasterizeEffectLayer(layerId) {
|
|
4488
4490
|
const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
|
|
4489
|
-
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0,
|
|
4491
|
+
if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
|
|
4490
4492
|
this.commitLayers(
|
|
4491
4493
|
_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
|
|
4492
4494
|
const { generator: _g, ...rest } = l;
|
|
@@ -4514,7 +4516,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4514
4516
|
if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
|
|
4515
4517
|
this.viewKey = key;
|
|
4516
4518
|
const { width, height } = this.naturalSize;
|
|
4517
|
-
const view =
|
|
4519
|
+
const view = _chunkQCEQIRJQcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
|
|
4518
4520
|
s.adjustments = view.adjustments;
|
|
4519
4521
|
s.depthMask = view.depthMask;
|
|
4520
4522
|
s.annotations = view.annotations;
|
|
@@ -4668,7 +4670,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4668
4670
|
applyCropPreset(ratio) {
|
|
4669
4671
|
this.recordHistory();
|
|
4670
4672
|
const { width, height } = this.state.imageDimensions;
|
|
4671
|
-
if (ratio &&
|
|
4673
|
+
if (ratio && _chunkQCEQIRJQcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
|
|
4672
4674
|
ratio = 1 / ratio;
|
|
4673
4675
|
}
|
|
4674
4676
|
if (!ratio) {
|
|
@@ -4750,7 +4752,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4750
4752
|
*/
|
|
4751
4753
|
getLayerPixels(id) {
|
|
4752
4754
|
const layer = this.getLayer(id);
|
|
4753
|
-
if (!layer || !
|
|
4755
|
+
if (!layer || !_chunkQCEQIRJQcjs.hasSurface.call(void 0, layer)) return null;
|
|
4754
4756
|
const surface = this.surfaceOf(layer);
|
|
4755
4757
|
const b = _chunkCWM3CUUXcjs.contentBounds.call(void 0, surface);
|
|
4756
4758
|
if (!b) return null;
|
|
@@ -4763,7 +4765,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4763
4765
|
*/
|
|
4764
4766
|
getLayerBounds(id) {
|
|
4765
4767
|
const layer = this.getLayer(id);
|
|
4766
|
-
if (!layer || !
|
|
4768
|
+
if (!layer || !_chunkQCEQIRJQcjs.hasSurface.call(void 0, layer)) return null;
|
|
4767
4769
|
const surface = this.surfaceOf(layer);
|
|
4768
4770
|
let b = this.boundsCache.get(surface);
|
|
4769
4771
|
if (b === void 0) {
|
|
@@ -4778,9 +4780,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
4778
4780
|
*/
|
|
4779
4781
|
getLayerDataURL(id) {
|
|
4780
4782
|
const layer = this.getLayer(id);
|
|
4781
|
-
if (!layer || !
|
|
4783
|
+
if (!layer || !_chunkQCEQIRJQcjs.hasSurface.call(void 0, layer)) return null;
|
|
4782
4784
|
const surface = this.surfaceOf(layer);
|
|
4783
|
-
const enc =
|
|
4785
|
+
const enc = _chunkQCEQIRJQcjs.encodeSurface.call(void 0, surface);
|
|
4784
4786
|
return enc ? enc.url : null;
|
|
4785
4787
|
}
|
|
4786
4788
|
/**
|
|
@@ -4922,19 +4924,19 @@ var ImageEditorController = (_class7 = class {
|
|
|
4922
4924
|
if (init.pixels) {
|
|
4923
4925
|
const px2 = init.pixels;
|
|
4924
4926
|
if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
|
|
4925
|
-
throw new (0,
|
|
4927
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
|
|
4926
4928
|
}
|
|
4927
4929
|
surface = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, px2, 4);
|
|
4928
4930
|
} else if (init.color !== void 0) {
|
|
4929
4931
|
const c = parseColor(init.color);
|
|
4930
4932
|
surface = _chunkCWM3CUUXcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkCWM3CUUXcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
|
|
4931
4933
|
}
|
|
4932
|
-
const blend =
|
|
4933
|
-
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
4934
|
+
const blend = _chunkQCEQIRJQcjs.parseBlend.call(void 0, init.blend);
|
|
4935
|
+
if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
4934
4936
|
const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
4935
4937
|
const layer = {
|
|
4936
4938
|
type: "pixel",
|
|
4937
|
-
id: init.id && !ids.has(init.id) ? init.id :
|
|
4939
|
+
id: init.id && !ids.has(init.id) ? init.id : _chunkQCEQIRJQcjs.newLayerId.call(void 0, ),
|
|
4938
4940
|
name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
|
|
4939
4941
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
4940
4942
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
@@ -4943,7 +4945,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
4943
4945
|
offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
|
|
4944
4946
|
};
|
|
4945
4947
|
if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
|
|
4946
|
-
const next =
|
|
4948
|
+
const next = _chunkQCEQIRJQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
4947
4949
|
this.commitLayers(next, () => {
|
|
4948
4950
|
this.state.activeLayerId = layer.id;
|
|
4949
4951
|
this.state.activeTarget = "pixels";
|
|
@@ -4983,12 +4985,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
4983
4985
|
try {
|
|
4984
4986
|
img = await this.renderer.imageCache.get(src);
|
|
4985
4987
|
} catch (e22) {
|
|
4986
|
-
throw new (0,
|
|
4988
|
+
throw new (0, _chunkQCEQIRJQcjs.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.");
|
|
4987
4989
|
}
|
|
4988
4990
|
const w = img.naturalWidth || img.width;
|
|
4989
4991
|
const h = img.naturalHeight || img.height;
|
|
4990
4992
|
const ctx = this.renderer.createCanvas(w, h).getContext("2d");
|
|
4991
|
-
if (!ctx || typeof ctx.getImageData !== "function") throw new (0,
|
|
4993
|
+
if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
|
|
4992
4994
|
ctx.drawImage(img, 0, 0, w, h);
|
|
4993
4995
|
const data = ctx.getImageData(0, 0, w, h);
|
|
4994
4996
|
return { width: w, height: h, data: data.data };
|
|
@@ -5001,7 +5003,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5001
5003
|
}
|
|
5002
5004
|
/** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
|
|
5003
5005
|
duplicateLayer(id, name) {
|
|
5004
|
-
const res =
|
|
5006
|
+
const res = _chunkQCEQIRJQcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
|
|
5005
5007
|
this.commitLayers(res.layers, () => {
|
|
5006
5008
|
this.state.activeLayerId = res.id;
|
|
5007
5009
|
});
|
|
@@ -5009,16 +5011,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5009
5011
|
}
|
|
5010
5012
|
/** Deletes a layer (refused when locked), as one undo step. */
|
|
5011
5013
|
removeLayer(id) {
|
|
5012
|
-
const next =
|
|
5014
|
+
const next = _chunkQCEQIRJQcjs.removeLayer.call(void 0, this.state.layers, id);
|
|
5013
5015
|
this.commitLayers(next, () => {
|
|
5014
|
-
if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([
|
|
5016
|
+
if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkQCEQIRJQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
|
|
5015
5017
|
this.state.selectedAnnotationId = null;
|
|
5016
5018
|
}
|
|
5017
5019
|
});
|
|
5018
5020
|
}
|
|
5019
5021
|
/** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
|
|
5020
5022
|
moveLayer(id, placement) {
|
|
5021
|
-
const next =
|
|
5023
|
+
const next = _chunkQCEQIRJQcjs.moveLayer.call(void 0, this.state.layers, id, placement);
|
|
5022
5024
|
const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id);
|
|
5023
5025
|
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
|
|
5024
5026
|
this.commitLayers(next);
|
|
@@ -5029,23 +5031,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
5029
5031
|
* one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
|
|
5030
5032
|
*/
|
|
5031
5033
|
setLayerProperties(id, props, commitToHistory = true) {
|
|
5032
|
-
const next =
|
|
5034
|
+
const next = _chunkQCEQIRJQcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
|
|
5033
5035
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5034
5036
|
return _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer;
|
|
5035
5037
|
}
|
|
5036
5038
|
/** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
|
|
5037
5039
|
addGroup(init = {}) {
|
|
5038
|
-
const blend = init.blend === void 0 ? "pass-through" :
|
|
5040
|
+
const blend = init.blend === void 0 ? "pass-through" : _chunkQCEQIRJQcjs.parseBlend.call(void 0, init.blend, true);
|
|
5039
5041
|
const group = {
|
|
5040
5042
|
type: "group",
|
|
5041
|
-
id:
|
|
5043
|
+
id: _chunkQCEQIRJQcjs.newLayerId.call(void 0, "group"),
|
|
5042
5044
|
name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
|
|
5043
5045
|
visible: true,
|
|
5044
5046
|
opacity: 1,
|
|
5045
5047
|
blend,
|
|
5046
5048
|
children: []
|
|
5047
5049
|
};
|
|
5048
|
-
const next =
|
|
5050
|
+
const next = _chunkQCEQIRJQcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
|
|
5049
5051
|
this.commitLayers(next, () => {
|
|
5050
5052
|
this.state.activeLayerId = group.id;
|
|
5051
5053
|
this.state.activeTarget = "pixels";
|
|
@@ -5054,7 +5056,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5054
5056
|
}
|
|
5055
5057
|
/** Puts sibling layers into a new group (one undo step). Returns the group id. */
|
|
5056
5058
|
groupLayers(ids, name) {
|
|
5057
|
-
const res =
|
|
5059
|
+
const res = _chunkQCEQIRJQcjs.groupLayers.call(void 0, this.state.layers, ids, name);
|
|
5058
5060
|
this.commitLayers(res.layers, () => {
|
|
5059
5061
|
this.state.activeLayerId = res.id;
|
|
5060
5062
|
});
|
|
@@ -5062,7 +5064,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5062
5064
|
}
|
|
5063
5065
|
/** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
|
|
5064
5066
|
ungroupLayer(id) {
|
|
5065
|
-
const res =
|
|
5067
|
+
const res = _chunkQCEQIRJQcjs.ungroupLayer.call(void 0, this.state.layers, id);
|
|
5066
5068
|
this.commitLayers(res.layers);
|
|
5067
5069
|
return res.ids;
|
|
5068
5070
|
}
|
|
@@ -5071,38 +5073,38 @@ var ImageEditorController = (_class7 = class {
|
|
|
5071
5073
|
* (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
|
|
5072
5074
|
*/
|
|
5073
5075
|
offsetLayer(id, move, commitToHistory = true) {
|
|
5074
|
-
const layer =
|
|
5076
|
+
const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5075
5077
|
if (layer.type === "smart") {
|
|
5076
5078
|
const tl = layer.placement.corners[0];
|
|
5077
5079
|
const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5078
5080
|
const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5079
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5080
|
-
this.commitLayers(
|
|
5081
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("x and y must be numbers.");
|
|
5082
|
+
this.commitLayers(_chunkQCEQIRJQcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
|
|
5081
5083
|
const moved = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, id).layer;
|
|
5082
5084
|
return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
|
|
5083
5085
|
}
|
|
5084
5086
|
if (layer.type === "shape") {
|
|
5085
|
-
const g = _nullishCoalesce(
|
|
5087
|
+
const g = _nullishCoalesce(_chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
|
|
5086
5088
|
const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
|
|
5087
5089
|
const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
|
|
5088
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5089
|
-
|
|
5090
|
-
let moved =
|
|
5090
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("x and y must be numbers.");
|
|
5091
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5092
|
+
let moved = _chunkQCEQIRJQcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
|
|
5091
5093
|
const mask = layer.mask;
|
|
5092
5094
|
if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
|
|
5093
5095
|
this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
5094
|
-
const b = _nullishCoalesce(
|
|
5096
|
+
const b = _nullishCoalesce(_chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
|
|
5095
5097
|
return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
|
|
5096
5098
|
}
|
|
5097
5099
|
if (layer.type === "type") {
|
|
5098
5100
|
const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
|
|
5099
5101
|
const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
|
|
5100
5102
|
const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
|
|
5101
|
-
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0,
|
|
5102
|
-
|
|
5103
|
+
if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("x and y must be numbers.");
|
|
5104
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "position", "move it");
|
|
5103
5105
|
const mx = Math.round(dx);
|
|
5104
5106
|
const my = Math.round(dy);
|
|
5105
|
-
let moved = { ...
|
|
5107
|
+
let moved = { ..._chunkQCEQIRJQcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, mx, my) };
|
|
5106
5108
|
const mask = layer.mask;
|
|
5107
5109
|
if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, mx, my) } };
|
|
5108
5110
|
this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
|
|
@@ -5112,7 +5114,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5112
5114
|
const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
5113
5115
|
const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
|
|
5114
5116
|
const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
|
|
5115
|
-
const next =
|
|
5117
|
+
const next = _chunkQCEQIRJQcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
|
|
5116
5118
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5117
5119
|
return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
|
|
5118
5120
|
}
|
|
@@ -5122,11 +5124,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5122
5124
|
* target when the layer is active.
|
|
5123
5125
|
*/
|
|
5124
5126
|
addLayerMask(id, from = "reveal-all", props = {}) {
|
|
5125
|
-
const layer =
|
|
5127
|
+
const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5126
5128
|
let mask;
|
|
5127
5129
|
if (from === "selection") {
|
|
5128
5130
|
const sel = this.state.selection;
|
|
5129
|
-
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0,
|
|
5131
|
+
if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5130
5132
|
mask = this.maskFromSelection(sel, props);
|
|
5131
5133
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
5132
5134
|
mask = { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
@@ -5135,7 +5137,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5135
5137
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5136
5138
|
mask = withMaskProps({ surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5137
5139
|
}
|
|
5138
|
-
const next =
|
|
5140
|
+
const next = _chunkQCEQIRJQcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
|
|
5139
5141
|
this.commitLayers(next, () => {
|
|
5140
5142
|
if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
|
|
5141
5143
|
});
|
|
@@ -5143,18 +5145,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
5143
5145
|
}
|
|
5144
5146
|
/** Removes a layer's mask (one undo step). */
|
|
5145
5147
|
removeLayerMask(id) {
|
|
5146
|
-
const layer =
|
|
5147
|
-
if (!layer.mask) throw new (0,
|
|
5148
|
-
this.commitLayers(
|
|
5148
|
+
const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5149
|
+
if (!layer.mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5150
|
+
this.commitLayers(_chunkQCEQIRJQcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
|
|
5149
5151
|
if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
|
|
5150
5152
|
});
|
|
5151
5153
|
}
|
|
5152
5154
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
5153
5155
|
setLayerMaskProps(id, props, commitToHistory = true) {
|
|
5154
|
-
const layer =
|
|
5155
|
-
if (!layer.mask) throw new (0,
|
|
5156
|
+
const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
5157
|
+
if (!layer.mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
5156
5158
|
const mask = withMaskProps(layer.mask, props);
|
|
5157
|
-
this.commitLayers(
|
|
5159
|
+
this.commitLayers(_chunkQCEQIRJQcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
|
|
5158
5160
|
return mask;
|
|
5159
5161
|
}
|
|
5160
5162
|
/**
|
|
@@ -5162,11 +5164,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
5162
5164
|
* the depth map) and removes the mask, as one undo step.
|
|
5163
5165
|
*/
|
|
5164
5166
|
async applyLayerMask(id) {
|
|
5165
|
-
const loc =
|
|
5167
|
+
const loc = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5166
5168
|
const layer = loc.layer;
|
|
5167
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5168
|
-
if (!layer.mask) throw new (0,
|
|
5169
|
-
|
|
5169
|
+
if (layer.type !== "pixel") throw new (0, _chunkQCEQIRJQcjs.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.`);
|
|
5170
|
+
if (!layer.mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
|
|
5171
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
|
|
5170
5172
|
const { width, height } = this.naturalSize;
|
|
5171
5173
|
await this.renderer.prepareLayerAssets([layer], width, height);
|
|
5172
5174
|
const sources = this.renderer.compositorSources(width, height);
|
|
@@ -5199,13 +5201,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
5199
5201
|
*/
|
|
5200
5202
|
layerViaCopy(options = {}) {
|
|
5201
5203
|
const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
|
|
5202
|
-
if (!id) throw new (0,
|
|
5203
|
-
const loc =
|
|
5204
|
+
if (!id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
|
|
5205
|
+
const loc = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5204
5206
|
const layer = loc.layer;
|
|
5205
|
-
if (layer.type !== "pixel") throw new (0,
|
|
5207
|
+
if (layer.type !== "pixel") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
|
|
5206
5208
|
const sel = this.state.selection;
|
|
5207
|
-
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0,
|
|
5208
|
-
if (options.cut)
|
|
5209
|
+
if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
|
|
5210
|
+
if (options.cut) _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
|
|
5209
5211
|
const surface = this.surfaceOf(layer);
|
|
5210
5212
|
const sb = sel.bounds;
|
|
5211
5213
|
const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
|
|
@@ -5221,7 +5223,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5221
5223
|
}
|
|
5222
5224
|
const copy = {
|
|
5223
5225
|
type: "pixel",
|
|
5224
|
-
id:
|
|
5226
|
+
id: _chunkQCEQIRJQcjs.newLayerId.call(void 0, ),
|
|
5225
5227
|
name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
5226
5228
|
visible: true,
|
|
5227
5229
|
opacity: 1,
|
|
@@ -5294,7 +5296,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5294
5296
|
* Refused while another transform is open.
|
|
5295
5297
|
*/
|
|
5296
5298
|
beginFreeTransform(init = {}) {
|
|
5297
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5299
|
+
if (this.getFreeTransform()) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
|
|
5298
5300
|
const session = new FreeTransformSession(this.transformHost(), init);
|
|
5299
5301
|
this.openTransform = session;
|
|
5300
5302
|
this.notify();
|
|
@@ -5308,26 +5310,26 @@ var ImageEditorController = (_class7 = class {
|
|
|
5308
5310
|
*/
|
|
5309
5311
|
transformLayer(spec) {
|
|
5310
5312
|
const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
|
|
5311
|
-
if (given > 1) throw new (0,
|
|
5312
|
-
if (!given && spec.warp === void 0) throw new (0,
|
|
5313
|
+
if (given > 1) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give only one of matrix, corners and params.");
|
|
5314
|
+
if (!given && spec.warp === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
|
|
5313
5315
|
if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
|
|
5314
|
-
throw new (0,
|
|
5316
|
+
throw new (0, _chunkQCEQIRJQcjs.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).");
|
|
5315
5317
|
}
|
|
5316
5318
|
if (spec.matrix) {
|
|
5317
5319
|
const [a, b, c, d] = spec.matrix;
|
|
5318
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5320
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5319
5321
|
}
|
|
5320
5322
|
const session = this.beginFreeTransform(spec);
|
|
5321
5323
|
try {
|
|
5322
5324
|
const g = session.startGeometry;
|
|
5323
|
-
const corners = spec.matrix ? g.corners.map((p) =>
|
|
5325
|
+
const corners = spec.matrix ? g.corners.map((p) => _chunkRHXW4TA5cjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkQCEQIRJQcjs.applyParams.call(void 0, g, spec.params) : g.corners;
|
|
5324
5326
|
let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
|
|
5325
5327
|
if (spec.warp) {
|
|
5326
5328
|
if ("style" in spec.warp) {
|
|
5327
|
-
if (!
|
|
5328
|
-
warp =
|
|
5329
|
+
if (!_chunkRHXW4TA5cjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkRHXW4TA5cjs.WARP_STYLES.join(", ")}.`);
|
|
5330
|
+
warp = _chunkQCEQIRJQcjs.presetWarp.call(void 0, session.box, spec.warp);
|
|
5329
5331
|
} else {
|
|
5330
|
-
if (!
|
|
5332
|
+
if (!_chunkQCEQIRJQcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkQCEQIRJQcjs.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.");
|
|
5331
5333
|
warp = spec.warp;
|
|
5332
5334
|
}
|
|
5333
5335
|
}
|
|
@@ -5340,10 +5342,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5340
5342
|
}
|
|
5341
5343
|
/** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
|
|
5342
5344
|
flipLayer(axis, init = {}) {
|
|
5343
|
-
if (axis !== "horizontal" && axis !== "vertical") throw new (0,
|
|
5345
|
+
if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
|
|
5344
5346
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5345
5347
|
try {
|
|
5346
|
-
session.update({ corners:
|
|
5348
|
+
session.update({ corners: _chunkQCEQIRJQcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
|
|
5347
5349
|
return session.commit();
|
|
5348
5350
|
} catch (e) {
|
|
5349
5351
|
session.cancel();
|
|
@@ -5355,16 +5357,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5355
5357
|
* centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
|
|
5356
5358
|
*/
|
|
5357
5359
|
rotateLayer90(turn, init = {}) {
|
|
5358
|
-
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0,
|
|
5360
|
+
if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
|
|
5359
5361
|
const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
|
|
5360
5362
|
try {
|
|
5361
|
-
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(
|
|
5363
|
+
const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkQCEQIRJQcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
|
|
5362
5364
|
const cx = b.x + b.width / 2;
|
|
5363
5365
|
const cy = b.y + b.height / 2;
|
|
5364
5366
|
const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
|
|
5365
5367
|
const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
|
|
5366
5368
|
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];
|
|
5367
|
-
session.update({ corners: session.startGeometry.corners.map((p) =>
|
|
5369
|
+
session.update({ corners: session.startGeometry.corners.map((p) => _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, p)) }, false);
|
|
5368
5370
|
return session.commit();
|
|
5369
5371
|
} catch (e) {
|
|
5370
5372
|
session.cancel();
|
|
@@ -5373,20 +5375,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5373
5375
|
}
|
|
5374
5376
|
/** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
|
|
5375
5377
|
addLayerFilter(id, filter) {
|
|
5376
|
-
const f =
|
|
5377
|
-
const next =
|
|
5378
|
+
const f = _chunkQCEQIRJQcjs.normalizeFilter.call(void 0, filter);
|
|
5379
|
+
const next = _chunkQCEQIRJQcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
|
|
5378
5380
|
this.commitLayers(next);
|
|
5379
5381
|
return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5380
5382
|
}
|
|
5381
5383
|
/** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
|
|
5382
5384
|
updateLayerFilter(id, filterId, changes, commitToHistory = true) {
|
|
5383
|
-
const next =
|
|
5385
|
+
const next = _chunkQCEQIRJQcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
|
|
5384
5386
|
this.commitLayers(next, void 0, commitToHistory);
|
|
5385
5387
|
return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5386
5388
|
}
|
|
5387
5389
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
5388
5390
|
removeLayerFilter(id, filterId) {
|
|
5389
|
-
const next =
|
|
5391
|
+
const next = _chunkQCEQIRJQcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
|
|
5390
5392
|
this.commitLayers(next);
|
|
5391
5393
|
return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
|
|
5392
5394
|
}
|
|
@@ -5402,8 +5404,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5402
5404
|
*/
|
|
5403
5405
|
convertToSmartObject(ids, options = {}) {
|
|
5404
5406
|
const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
|
|
5405
|
-
if (!list.length) throw new (0,
|
|
5406
|
-
const res =
|
|
5407
|
+
if (!list.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
|
|
5408
|
+
const res = _chunkQCEQIRJQcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
|
|
5407
5409
|
this.commitLayers(res.layers, () => {
|
|
5408
5410
|
this.state.activeLayerId = res.layer.id;
|
|
5409
5411
|
this.state.activeTarget = "pixels";
|
|
@@ -5412,7 +5414,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5412
5414
|
}
|
|
5413
5415
|
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
5414
5416
|
rasterizeSmartObject(id) {
|
|
5415
|
-
const res =
|
|
5417
|
+
const res = _chunkQCEQIRJQcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
|
|
5416
5418
|
this.commitLayers(res.layers, () => {
|
|
5417
5419
|
if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
|
|
5418
5420
|
});
|
|
@@ -5420,10 +5422,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5420
5422
|
}
|
|
5421
5423
|
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
5422
5424
|
getSmartObject(id) {
|
|
5423
|
-
const layer =
|
|
5425
|
+
const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5424
5426
|
const c = layer.contents;
|
|
5425
|
-
const g =
|
|
5426
|
-
const readout =
|
|
5427
|
+
const g = _chunkQCEQIRJQcjs.placementGeometry.call(void 0, layer);
|
|
5428
|
+
const readout = _chunkQCEQIRJQcjs.describeTransform.call(void 0, g);
|
|
5427
5429
|
const stack = layer.smartFilters;
|
|
5428
5430
|
return {
|
|
5429
5431
|
layerId: layer.id,
|
|
@@ -5433,10 +5435,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5433
5435
|
kind: c.kind,
|
|
5434
5436
|
width: c.width,
|
|
5435
5437
|
height: c.height,
|
|
5436
|
-
decoded:
|
|
5438
|
+
decoded: _chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, c),
|
|
5437
5439
|
fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
|
|
5438
5440
|
linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
|
|
5439
|
-
instances:
|
|
5441
|
+
instances: _chunkQCEQIRJQcjs.instancesOf.call(void 0, this.state.layers, c.id),
|
|
5440
5442
|
layerCount: c.document ? _chunkHGTDMKNEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
|
|
5441
5443
|
},
|
|
5442
5444
|
placement: {
|
|
@@ -5448,8 +5450,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5448
5450
|
scaleY: readout.scaleY,
|
|
5449
5451
|
rotate: readout.rotate,
|
|
5450
5452
|
skewX: readout.skewX,
|
|
5451
|
-
center:
|
|
5452
|
-
bounds:
|
|
5453
|
+
center: _chunkQCEQIRJQcjs.anchorPoint.call(void 0, g, "center"),
|
|
5454
|
+
bounds: _chunkQCEQIRJQcjs.transformedBox.call(void 0, g)
|
|
5453
5455
|
},
|
|
5454
5456
|
smartFilters: {
|
|
5455
5457
|
enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
|
|
@@ -5466,7 +5468,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5466
5468
|
* change. Returns the new placement summary.
|
|
5467
5469
|
*/
|
|
5468
5470
|
setSmartObjectPlacement(id, placement, commitToHistory = true) {
|
|
5469
|
-
const res =
|
|
5471
|
+
const res = _chunkQCEQIRJQcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
|
|
5470
5472
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5471
5473
|
return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
|
|
5472
5474
|
}
|
|
@@ -5479,23 +5481,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
5479
5481
|
* nothing is relative to the current transform.
|
|
5480
5482
|
*/
|
|
5481
5483
|
setSmartObjectTransform(id, spec) {
|
|
5482
|
-
const layer =
|
|
5483
|
-
const g =
|
|
5484
|
+
const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5485
|
+
const g = _chunkQCEQIRJQcjs.placementGeometry.call(void 0, layer);
|
|
5484
5486
|
const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
|
|
5485
5487
|
const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
|
|
5486
|
-
if (ways > 1) throw new (0,
|
|
5488
|
+
if (ways > 1) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
|
|
5487
5489
|
let corners = g.corners;
|
|
5488
5490
|
if (spec.corners) corners = spec.corners;
|
|
5489
5491
|
else if (spec.matrix) {
|
|
5490
|
-
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0,
|
|
5492
|
+
if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkQCEQIRJQcjs.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).");
|
|
5491
5493
|
const [a, b, c, d] = spec.matrix;
|
|
5492
|
-
if (Math.abs(a * d - b * c) < 1e-9) throw new (0,
|
|
5493
|
-
corners =
|
|
5494
|
+
if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
|
|
5495
|
+
corners = _chunkQCEQIRJQcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
|
|
5494
5496
|
} else if (numeric.length) {
|
|
5495
|
-
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0,
|
|
5496
|
-
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0,
|
|
5497
|
-
const now =
|
|
5498
|
-
const centre =
|
|
5497
|
+
if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
|
|
5498
|
+
for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`${k} must be a finite number.`);
|
|
5499
|
+
const now = _chunkQCEQIRJQcjs.describeTransform.call(void 0, g);
|
|
5500
|
+
const centre = _chunkQCEQIRJQcjs.anchorPoint.call(void 0, g, "center");
|
|
5499
5501
|
const params = {
|
|
5500
5502
|
scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
|
|
5501
5503
|
scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
|
|
@@ -5503,20 +5505,20 @@ var ImageEditorController = (_class7 = class {
|
|
|
5503
5505
|
skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
|
|
5504
5506
|
skewY: _nullishCoalesce(spec.skewY, () => ( 0))
|
|
5505
5507
|
};
|
|
5506
|
-
const m =
|
|
5508
|
+
const m = _chunkQCEQIRJQcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
|
|
5507
5509
|
const cx = g.box.width / 2;
|
|
5508
5510
|
const cy = g.box.height / 2;
|
|
5509
5511
|
const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
|
|
5510
|
-
corners =
|
|
5512
|
+
corners = _chunkQCEQIRJQcjs.cornersFromMatrix.call(void 0, g.box, _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, m, _chunkRHXW4TA5cjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
|
|
5511
5513
|
}
|
|
5512
5514
|
let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
|
|
5513
5515
|
if (spec.warp === null) warp = null;
|
|
5514
5516
|
else if (spec.warp) {
|
|
5515
5517
|
if ("style" in spec.warp) {
|
|
5516
|
-
if (!
|
|
5517
|
-
warp =
|
|
5518
|
+
if (!_chunkRHXW4TA5cjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkRHXW4TA5cjs.WARP_STYLES.join(", ")}.`);
|
|
5519
|
+
warp = _chunkQCEQIRJQcjs.presetWarp.call(void 0, g.box, spec.warp);
|
|
5518
5520
|
} else {
|
|
5519
|
-
if (!
|
|
5521
|
+
if (!_chunkQCEQIRJQcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkQCEQIRJQcjs.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.");
|
|
5520
5522
|
warp = spec.warp;
|
|
5521
5523
|
}
|
|
5522
5524
|
}
|
|
@@ -5530,16 +5532,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5530
5532
|
* the layers that changed.
|
|
5531
5533
|
*/
|
|
5532
5534
|
replaceSmartObjectContents(id, source) {
|
|
5533
|
-
const layer =
|
|
5535
|
+
const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5534
5536
|
let contents;
|
|
5535
5537
|
if ("contents" in source) contents = source.contents;
|
|
5536
|
-
else if ("pixels" in source) contents =
|
|
5538
|
+
else if ("pixels" in source) contents = _chunkQCEQIRJQcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
|
|
5537
5539
|
else {
|
|
5538
|
-
const psd =
|
|
5539
|
-
contents =
|
|
5540
|
+
const psd = _chunkQCEQIRJQcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkQCEQIRJQcjs.newLayerId.call(void 0, ) });
|
|
5541
|
+
contents = _chunkQCEQIRJQcjs.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`)));
|
|
5540
5542
|
contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
|
|
5541
5543
|
}
|
|
5542
|
-
const res =
|
|
5544
|
+
const res = _chunkQCEQIRJQcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
|
|
5543
5545
|
this.commitLayers(res.layers);
|
|
5544
5546
|
return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
|
|
5545
5547
|
}
|
|
@@ -5554,16 +5556,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5554
5556
|
* and bytes.
|
|
5555
5557
|
*/
|
|
5556
5558
|
exportSmartObjectContents(id) {
|
|
5557
|
-
const layer =
|
|
5559
|
+
const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5558
5560
|
const c = layer.contents;
|
|
5559
5561
|
const base = c.name.replace(/\.\w+$/, "") || "Contents";
|
|
5560
5562
|
if (c.file) {
|
|
5561
|
-
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ...
|
|
5563
|
+
const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkQCEQIRJQcjs.BROWSER_IMAGE_TYPES };
|
|
5562
5564
|
const ext = c.file.type.toLowerCase();
|
|
5563
5565
|
return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
|
|
5564
5566
|
}
|
|
5565
|
-
if (!
|
|
5566
|
-
const f =
|
|
5567
|
+
if (!_chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
|
|
5568
|
+
const f = _chunkQCEQIRJQcjs.smartContentsFile.call(void 0, c);
|
|
5567
5569
|
return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
|
|
5568
5570
|
}
|
|
5569
5571
|
/**
|
|
@@ -5572,7 +5574,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5572
5574
|
* undo step. Returns the copy's id.
|
|
5573
5575
|
*/
|
|
5574
5576
|
copySmartObject(id, linked = false, name) {
|
|
5575
|
-
const res =
|
|
5577
|
+
const res = _chunkQCEQIRJQcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
|
|
5576
5578
|
this.commitLayers(res.layers, () => {
|
|
5577
5579
|
this.state.activeLayerId = res.layer.id;
|
|
5578
5580
|
this.state.activeTarget = "pixels";
|
|
@@ -5581,31 +5583,31 @@ var ImageEditorController = (_class7 = class {
|
|
|
5581
5583
|
}
|
|
5582
5584
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
5583
5585
|
addSmartFilter(id, filter, index) {
|
|
5584
|
-
const res =
|
|
5586
|
+
const res = _chunkQCEQIRJQcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkQCEQIRJQcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
|
|
5585
5587
|
this.commitLayers(res.layers);
|
|
5586
5588
|
return res.filter;
|
|
5587
5589
|
}
|
|
5588
5590
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
5589
5591
|
updateSmartFilter(id, filterId, changes, commitToHistory = true) {
|
|
5590
|
-
const res =
|
|
5592
|
+
const res = _chunkQCEQIRJQcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
|
|
5591
5593
|
this.commitLayers(res.layers, void 0, commitToHistory);
|
|
5592
5594
|
return res.filter;
|
|
5593
5595
|
}
|
|
5594
5596
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
5595
5597
|
removeSmartFilter(id, filterId) {
|
|
5596
|
-
const res =
|
|
5598
|
+
const res = _chunkQCEQIRJQcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
|
|
5597
5599
|
this.commitLayers(res.layers);
|
|
5598
5600
|
return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
|
|
5599
5601
|
}
|
|
5600
5602
|
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
5601
5603
|
moveSmartFilter(id, filterId, index) {
|
|
5602
|
-
const res =
|
|
5604
|
+
const res = _chunkQCEQIRJQcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
|
|
5603
5605
|
this.commitLayers(res.layers);
|
|
5604
5606
|
return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
|
|
5605
5607
|
}
|
|
5606
5608
|
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
5607
5609
|
setSmartFiltersEnabled(id, enabled) {
|
|
5608
|
-
const res =
|
|
5610
|
+
const res = _chunkQCEQIRJQcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
|
|
5609
5611
|
this.commitLayers(res.layers);
|
|
5610
5612
|
return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
|
|
5611
5613
|
}
|
|
@@ -5615,21 +5617,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
5615
5617
|
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
5616
5618
|
*/
|
|
5617
5619
|
setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
|
|
5618
|
-
const layer =
|
|
5620
|
+
const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5619
5621
|
let mask;
|
|
5620
5622
|
if (from === "none") mask = null;
|
|
5621
5623
|
else if (from === "keep") {
|
|
5622
|
-
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0,
|
|
5624
|
+
if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
|
|
5623
5625
|
mask = withMaskProps(layer.smartFilters.mask, props);
|
|
5624
5626
|
} else if (from === "selection") {
|
|
5625
5627
|
const sel = this.state.selection;
|
|
5626
|
-
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0,
|
|
5628
|
+
if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
5627
5629
|
mask = this.maskFromSelection(sel, props);
|
|
5628
5630
|
} else {
|
|
5629
5631
|
const v = from === "reveal-all" ? 255 : 0;
|
|
5630
5632
|
mask = withMaskProps({ surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
|
|
5631
5633
|
}
|
|
5632
|
-
const res =
|
|
5634
|
+
const res = _chunkQCEQIRJQcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
|
|
5633
5635
|
this.commitLayers(res.layers, () => {
|
|
5634
5636
|
if (this.state.activeLayerId !== id) return;
|
|
5635
5637
|
if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
|
|
@@ -5645,14 +5647,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
5645
5647
|
async prepareSmartObjects() {
|
|
5646
5648
|
const pending = /* @__PURE__ */ new Map();
|
|
5647
5649
|
for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers)) {
|
|
5648
|
-
if (l.type === "smart" && !
|
|
5650
|
+
if (l.type === "smart" && !_chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkQCEQIRJQcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
|
|
5649
5651
|
}
|
|
5650
5652
|
const left = [];
|
|
5651
5653
|
for (const [cid, c] of pending) {
|
|
5652
5654
|
try {
|
|
5653
|
-
const url = `data:${
|
|
5655
|
+
const url = `data:${_chunkQCEQIRJQcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkCWM3CUUXcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
|
|
5654
5656
|
const px2 = await this.decodeImage(url);
|
|
5655
|
-
const decoded = { ...c, kind: "raster", raster:
|
|
5657
|
+
const decoded = { ...c, kind: "raster", raster: _chunkQCEQIRJQcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
|
|
5656
5658
|
const swap = (layers) => {
|
|
5657
5659
|
let out = layers;
|
|
5658
5660
|
for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
|
|
@@ -5680,10 +5682,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5680
5682
|
* Contents can nest. Returns the contents' size and layer ids.
|
|
5681
5683
|
*/
|
|
5682
5684
|
editSmartObjectContents(id) {
|
|
5683
|
-
if (this.getFreeTransform()) throw new (0,
|
|
5684
|
-
const layer =
|
|
5685
|
+
if (this.getFreeTransform()) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
|
|
5686
|
+
const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
|
|
5685
5687
|
const c = layer.contents;
|
|
5686
|
-
if (!
|
|
5688
|
+
if (!_chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkQCEQIRJQcjs.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.`);
|
|
5687
5689
|
const saved = {
|
|
5688
5690
|
state: { ...this.state },
|
|
5689
5691
|
undo: this.undoStack,
|
|
@@ -5694,7 +5696,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5694
5696
|
samplePixelsOverride: this.samplePixelsOverride,
|
|
5695
5697
|
psdResolution: this.psdResolution
|
|
5696
5698
|
};
|
|
5697
|
-
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id:
|
|
5699
|
+
const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkQCEQIRJQcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
|
|
5698
5700
|
this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
|
|
5699
5701
|
const s = this.state;
|
|
5700
5702
|
this.state = {
|
|
@@ -5702,7 +5704,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5702
5704
|
sourceUrl: null,
|
|
5703
5705
|
imageDimensions: { width: c.width, height: c.height },
|
|
5704
5706
|
crop: null,
|
|
5705
|
-
transform: { ...
|
|
5707
|
+
transform: { ..._chunkQCEQIRJQcjs.DEFAULT_TRANSFORM_VALUES },
|
|
5706
5708
|
layers,
|
|
5707
5709
|
activeLayerId: layers.length ? layers[layers.length - 1].id : null,
|
|
5708
5710
|
activeTarget: "pixels",
|
|
@@ -5735,7 +5737,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5735
5737
|
*/
|
|
5736
5738
|
closeSmartObjectContents(save = true) {
|
|
5737
5739
|
const top = this.contentsStack.pop();
|
|
5738
|
-
if (!top) throw new (0,
|
|
5740
|
+
if (!top) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
|
|
5739
5741
|
if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
|
|
5740
5742
|
this.openTransform = null;
|
|
5741
5743
|
const edited = this.state;
|
|
@@ -5749,10 +5751,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
5749
5751
|
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";
|
|
5750
5752
|
if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
|
|
5751
5753
|
const px2 = _chunkCWM3CUUXcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
|
|
5752
|
-
next =
|
|
5754
|
+
next = _chunkQCEQIRJQcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
|
|
5753
5755
|
} else {
|
|
5754
5756
|
const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
|
|
5755
|
-
next =
|
|
5757
|
+
next = _chunkQCEQIRJQcjs.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);
|
|
5756
5758
|
}
|
|
5757
5759
|
}
|
|
5758
5760
|
const saved = top.saved;
|
|
@@ -5771,7 +5773,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5771
5773
|
this.notify();
|
|
5772
5774
|
return { layerId: top.layerId, changed: false, layerIds: [] };
|
|
5773
5775
|
}
|
|
5774
|
-
const res =
|
|
5776
|
+
const res = _chunkQCEQIRJQcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
|
|
5775
5777
|
this.commitLayers(res.layers);
|
|
5776
5778
|
return { layerId: top.layerId, changed: true, layerIds: res.ids };
|
|
5777
5779
|
}
|
|
@@ -5786,35 +5788,35 @@ var ImageEditorController = (_class7 = class {
|
|
|
5786
5788
|
// --- Layer effects ---
|
|
5787
5789
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
5788
5790
|
getLayerEffects(id) {
|
|
5789
|
-
return
|
|
5791
|
+
return _chunkQCEQIRJQcjs.layerEffectsOf.call(void 0, _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer);
|
|
5790
5792
|
}
|
|
5791
5793
|
/**
|
|
5792
5794
|
* Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
|
|
5793
5795
|
* `index` in the layer's effect list (default the end). Returns the new effect and the effects.
|
|
5794
5796
|
*/
|
|
5795
5797
|
addLayerEffect(id, kind, params = {}, index) {
|
|
5796
|
-
const res =
|
|
5798
|
+
const res = _chunkQCEQIRJQcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
|
|
5797
5799
|
this.commitLayers(res.layers);
|
|
5798
5800
|
return { effect: res.effect, effects: this.getLayerEffects(id) };
|
|
5799
5801
|
}
|
|
5800
5802
|
/** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
|
|
5801
5803
|
updateLayerEffect(id, effectId, changes, commitToHistory = true) {
|
|
5802
|
-
this.commitLayers(
|
|
5804
|
+
this.commitLayers(_chunkQCEQIRJQcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
|
|
5803
5805
|
return this.getLayerEffects(id);
|
|
5804
5806
|
}
|
|
5805
5807
|
/** Removes one effect (one undo step). Returns the remaining effects. */
|
|
5806
5808
|
removeLayerEffect(id, effectId) {
|
|
5807
|
-
this.commitLayers(
|
|
5809
|
+
this.commitLayers(_chunkQCEQIRJQcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
|
|
5808
5810
|
return this.getLayerEffects(id);
|
|
5809
5811
|
}
|
|
5810
5812
|
/** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
|
|
5811
5813
|
setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
|
|
5812
|
-
this.commitLayers(
|
|
5814
|
+
this.commitLayers(_chunkQCEQIRJQcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
|
|
5813
5815
|
return this.getLayerEffects(id);
|
|
5814
5816
|
}
|
|
5815
5817
|
/** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
|
|
5816
5818
|
setLayerEffects(id, effects, commitToHistory = true) {
|
|
5817
|
-
this.commitLayers(
|
|
5819
|
+
this.commitLayers(_chunkQCEQIRJQcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
|
|
5818
5820
|
return this.getLayerEffects(id);
|
|
5819
5821
|
}
|
|
5820
5822
|
__init76() {this.patternIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -5840,8 +5842,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5840
5842
|
/** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
|
|
5841
5843
|
setGlobalLight(light, commitToHistory = true) {
|
|
5842
5844
|
const next = { ...this.getGlobalLight(), ...light };
|
|
5843
|
-
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0,
|
|
5844
|
-
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0,
|
|
5845
|
+
if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
|
|
5846
|
+
if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
|
|
5845
5847
|
if (commitToHistory) this.recordHistory();
|
|
5846
5848
|
if (next.angle === _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
|
|
5847
5849
|
else this.state.globalLight = next;
|
|
@@ -5852,16 +5854,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5852
5854
|
async compositeToSurface(layers, rect) {
|
|
5853
5855
|
const { width, height } = this.naturalSize;
|
|
5854
5856
|
if (_chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
|
|
5855
|
-
throw new (0,
|
|
5857
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
|
|
5856
5858
|
}
|
|
5857
5859
|
await this.renderer.prepareLayerAssets(layers, width, height);
|
|
5858
5860
|
const sources = this.renderer.compositorSources(width, height);
|
|
5859
5861
|
const depth = this.bitDepth;
|
|
5860
5862
|
if (depth !== 8) {
|
|
5861
|
-
const samples = _chunkHGTDMKNEcjs.workingToSamples.call(void 0,
|
|
5863
|
+
const samples = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkQCEQIRJQcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
|
|
5862
5864
|
return _chunkCWM3CUUXcjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
|
|
5863
5865
|
}
|
|
5864
|
-
const data = new (0,
|
|
5866
|
+
const data = new (0, _chunkQCEQIRJQcjs.LayerCompositor)().composite(layers, rect, sources);
|
|
5865
5867
|
return _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
|
|
5866
5868
|
}
|
|
5867
5869
|
/**
|
|
@@ -5874,22 +5876,22 @@ var ImageEditorController = (_class7 = class {
|
|
|
5874
5876
|
const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
|
|
5875
5877
|
const depth = this.bitDepth;
|
|
5876
5878
|
if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkCWM3CUUXcjs.to16From8.call(void 0, this.compositePixels(r).data) };
|
|
5877
|
-
const data = _chunkHGTDMKNEcjs.workingToSamples.call(void 0,
|
|
5879
|
+
const data = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkQCEQIRJQcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
|
|
5878
5880
|
return { width: r.width, height: r.height, depth, data };
|
|
5879
5881
|
}
|
|
5880
5882
|
/** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
|
|
5881
5883
|
paintBounds(layer) {
|
|
5882
5884
|
const { width, height } = this.naturalSize;
|
|
5883
5885
|
const canvas = { x: 0, y: 0, width, height };
|
|
5884
|
-
if (
|
|
5886
|
+
if (_chunkQCEQIRJQcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
5885
5887
|
if (layer.type === "annotation") {
|
|
5886
|
-
const b =
|
|
5888
|
+
const b = _chunkQCEQIRJQcjs.getAnnotationBounds.call(void 0, layer.annotation);
|
|
5887
5889
|
const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
|
|
5888
5890
|
return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
|
|
5889
5891
|
}
|
|
5890
5892
|
if (layer.type === "group") {
|
|
5891
5893
|
let r = null;
|
|
5892
|
-
for (const c of layer.children) r =
|
|
5894
|
+
for (const c of layer.children) r = _chunkQCEQIRJQcjs.unionRect.call(void 0, r, this.paintBounds(c));
|
|
5893
5895
|
return _nullishCoalesce(r, () => ( canvas));
|
|
5894
5896
|
}
|
|
5895
5897
|
return canvas;
|
|
@@ -5900,16 +5902,16 @@ var ImageEditorController = (_class7 = class {
|
|
|
5900
5902
|
* Returns the merged id.
|
|
5901
5903
|
*/
|
|
5902
5904
|
async mergeDown(id) {
|
|
5903
|
-
const loc =
|
|
5905
|
+
const loc = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id);
|
|
5904
5906
|
const upper = loc.layer;
|
|
5905
5907
|
const siblings = loc.parent ? loc.parent.children : this.state.layers;
|
|
5906
5908
|
const lower = siblings[loc.index - 1];
|
|
5907
|
-
if (!lower) throw new (0,
|
|
5908
|
-
if (lower.type !== "pixel") throw new (0,
|
|
5909
|
-
if (!upper.visible) throw new (0,
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
let rect = _nullishCoalesce(
|
|
5909
|
+
if (!lower) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
|
|
5910
|
+
if (lower.type !== "pixel") throw new (0, _chunkQCEQIRJQcjs.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.`);
|
|
5911
|
+
if (!upper.visible) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
|
|
5912
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
|
|
5913
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
|
|
5914
|
+
let rect = _nullishCoalesce(_chunkQCEQIRJQcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
|
|
5913
5915
|
const reach = Math.max(_chunkHGTDMKNEcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkHGTDMKNEcjs.effectsMargin.call(void 0, upper.effects));
|
|
5914
5916
|
if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
|
|
5915
5917
|
const base = { ...lower, blend: "normal", opacity: 1 };
|
|
@@ -5935,12 +5937,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
5935
5937
|
*/
|
|
5936
5938
|
async mergeVisible() {
|
|
5937
5939
|
const visible = this.state.layers.filter((l) => l.visible);
|
|
5938
|
-
if (!visible.length) throw new (0,
|
|
5940
|
+
if (!visible.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("No layer is visible.");
|
|
5939
5941
|
const { width, height } = this.naturalSize;
|
|
5940
5942
|
const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
|
|
5941
5943
|
const merged = {
|
|
5942
5944
|
type: "pixel",
|
|
5943
|
-
id:
|
|
5945
|
+
id: _chunkQCEQIRJQcjs.newLayerId.call(void 0, ),
|
|
5944
5946
|
name: "Merged",
|
|
5945
5947
|
visible: true,
|
|
5946
5948
|
opacity: 1,
|
|
@@ -5964,8 +5966,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
5964
5966
|
const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
|
|
5965
5967
|
const bg = {
|
|
5966
5968
|
type: "pixel",
|
|
5967
|
-
id:
|
|
5968
|
-
name:
|
|
5969
|
+
id: _chunkQCEQIRJQcjs.BACKGROUND_LAYER_ID,
|
|
5970
|
+
name: _chunkQCEQIRJQcjs.BACKGROUND_LAYER_NAME,
|
|
5969
5971
|
visible: true,
|
|
5970
5972
|
opacity: 1,
|
|
5971
5973
|
blend: "normal",
|
|
@@ -5992,7 +5994,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
5992
5994
|
const k = Math.min(1, side / Math.max(width, height));
|
|
5993
5995
|
const tw = Math.max(1, Math.round(width * k));
|
|
5994
5996
|
const th = Math.max(1, Math.round(height * k));
|
|
5995
|
-
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null :
|
|
5997
|
+
const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkQCEQIRJQcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
|
|
5996
5998
|
if (!surface) return null;
|
|
5997
5999
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
5998
6000
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
@@ -6088,7 +6090,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6088
6090
|
* pixels. The next stroke fixes the offset from its first point. View state, no undo.
|
|
6089
6091
|
*/
|
|
6090
6092
|
setCloneSource(point) {
|
|
6091
|
-
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0,
|
|
6093
|
+
if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
|
|
6092
6094
|
const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
|
|
6093
6095
|
this.state.paint = { ...this.state.paint, cloneSource: source };
|
|
6094
6096
|
this.notify();
|
|
@@ -6104,9 +6106,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6104
6106
|
const next = t ? { ...cur, ...t } : { ..._chunk6FUAHCVIcjs.IDENTITY_CLONE_TRANSFORM };
|
|
6105
6107
|
for (const k of ["scaleX", "scaleY"]) {
|
|
6106
6108
|
const v = next[k];
|
|
6107
|
-
if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0,
|
|
6109
|
+
if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
|
|
6108
6110
|
}
|
|
6109
|
-
if (!Number.isFinite(next.rotate)) throw new (0,
|
|
6111
|
+
if (!Number.isFinite(next.rotate)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("rotate must be a number of degrees.");
|
|
6110
6112
|
next.rotate = ((next.rotate + 180) % 360 + 360) % 360 - 180;
|
|
6111
6113
|
this.state.paint = { ...this.state.paint, cloneTransform: next };
|
|
6112
6114
|
this.notify();
|
|
@@ -6124,27 +6126,27 @@ var ImageEditorController = (_class7 = class {
|
|
|
6124
6126
|
/** Resolves and validates what a stroke, fill or clear paints into. */
|
|
6125
6127
|
paintTarget(layerId, channel, action) {
|
|
6126
6128
|
const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
|
|
6127
|
-
if (!id) throw new (0,
|
|
6128
|
-
const layer =
|
|
6129
|
+
if (!id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
|
|
6130
|
+
const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
6129
6131
|
const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
|
|
6130
6132
|
if (ch === "mask") {
|
|
6131
|
-
if (!layer.mask) throw new (0,
|
|
6132
|
-
if (layer.mask.source) throw new (0,
|
|
6133
|
-
|
|
6133
|
+
if (!layer.mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
|
|
6134
|
+
if (layer.mask.source) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
|
|
6135
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6134
6136
|
} else if (ch === "filter-mask") {
|
|
6135
6137
|
if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
|
|
6136
|
-
throw new (0,
|
|
6138
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
|
|
6137
6139
|
}
|
|
6138
|
-
if (!
|
|
6139
|
-
|
|
6140
|
+
if (!_chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
|
|
6141
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "all", action);
|
|
6140
6142
|
} else {
|
|
6141
|
-
if (layer.type === "smart") throw new (0,
|
|
6142
|
-
if (layer.type === "shape") throw new (0,
|
|
6143
|
-
if (layer.type === "type") throw new (0,
|
|
6144
|
-
if (layer.type !== "pixel") throw new (0,
|
|
6145
|
-
|
|
6143
|
+
if (layer.type === "smart") throw new (0, _chunkQCEQIRJQcjs.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.`);
|
|
6144
|
+
if (layer.type === "shape") throw new (0, _chunkQCEQIRJQcjs.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).`);
|
|
6145
|
+
if (layer.type === "type") throw new (0, _chunkQCEQIRJQcjs.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).`);
|
|
6146
|
+
if (layer.type !== "pixel") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
|
|
6147
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", action);
|
|
6146
6148
|
}
|
|
6147
|
-
if (!layer.visible) throw new (0,
|
|
6149
|
+
if (!layer.visible) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
|
|
6148
6150
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
6149
6151
|
const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
|
|
6150
6152
|
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
|
|
@@ -6153,7 +6155,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6153
6155
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
6154
6156
|
withSurface(layer, channel, surface) {
|
|
6155
6157
|
if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
|
|
6156
|
-
if (channel === "filter-mask") return
|
|
6158
|
+
if (channel === "filter-mask") return _chunkQCEQIRJQcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
|
|
6157
6159
|
const next = { ...layer, surface };
|
|
6158
6160
|
delete next.source;
|
|
6159
6161
|
return next;
|
|
@@ -6166,10 +6168,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6166
6168
|
*/
|
|
6167
6169
|
beginStroke(init = {}) {
|
|
6168
6170
|
const tool = _nullishCoalesce(init.tool, () => ( "brush"));
|
|
6169
|
-
if (!STROKE_TOOLS.includes(tool)) throw new (0,
|
|
6171
|
+
if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
|
|
6170
6172
|
const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
|
|
6171
6173
|
if (tool === "mixer" && target.channel !== "pixels") {
|
|
6172
|
-
throw new (0,
|
|
6174
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
|
|
6173
6175
|
}
|
|
6174
6176
|
const brush = _chunkLRRCMRSLcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
|
|
6175
6177
|
let strokePaint = null;
|
|
@@ -6203,7 +6205,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6203
6205
|
retouchStroke(tool, init, brush, target, apply) {
|
|
6204
6206
|
const settings = _chunk6FUAHCVIcjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
|
|
6205
6207
|
const mask = target.channel !== "pixels";
|
|
6206
|
-
if (tool === "sponge" && mask) throw new (0,
|
|
6208
|
+
if (tool === "sponge" && mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
|
|
6207
6209
|
if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunk6FUAHCVIcjs.RetouchDabStroke)(brush, pixels, _chunk6FUAHCVIcjs.smudgeEffect.call(void 0, brush, settings.strength)) };
|
|
6208
6210
|
if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunk6FUAHCVIcjs.RetouchDabStroke)(brush, pixels, _chunk6FUAHCVIcjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
|
|
6209
6211
|
const retouchApply = {
|
|
@@ -6242,11 +6244,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6242
6244
|
if (tool === "history") {
|
|
6243
6245
|
const steps = settings.historySteps;
|
|
6244
6246
|
const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
|
|
6245
|
-
if (!entry) throw new (0,
|
|
6247
|
+
if (!entry) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("There is no earlier state to paint from yet: the History Brush paints a layer as it was some undo steps back. Make a change first.");
|
|
6246
6248
|
const then = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _232 => _232.layer]);
|
|
6247
|
-
if (!then) throw new (0,
|
|
6249
|
+
if (!then) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
|
|
6248
6250
|
const surface = target.channel === "mask" ? _optionalChain([then, 'access', _233 => _233.mask, 'optionalAccess', _234 => _234.surface]) : then.type === "pixel" ? then.surface : void 0;
|
|
6249
|
-
if (!surface) throw new (0,
|
|
6251
|
+
if (!surface) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
|
|
6250
6252
|
const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
|
|
6251
6253
|
const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
|
|
6252
6254
|
const source2 = depth ? new (0, _chunk6FUAHCVIcjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
|
|
@@ -6291,7 +6293,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6291
6293
|
}
|
|
6292
6294
|
if (init.source) this.setCloneSource(init.source);
|
|
6293
6295
|
const cs = this.state.paint.cloneSource;
|
|
6294
|
-
if (!cs) throw new (0,
|
|
6296
|
+
if (!cs) throw new (0, _chunkQCEQIRJQcjs.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 }.`);
|
|
6295
6297
|
let offset = { x: 0, y: 0 };
|
|
6296
6298
|
let first = { x: 0, y: 0 };
|
|
6297
6299
|
const xf = this.state.paint.cloneTransform;
|
|
@@ -6328,7 +6330,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6328
6330
|
const sources = this.compositorSources();
|
|
6329
6331
|
if (depth) {
|
|
6330
6332
|
return new (0, _chunk6FUAHCVIcjs.TilePixelSource)((tx, ty) => {
|
|
6331
|
-
const w =
|
|
6333
|
+
const w = _chunkQCEQIRJQcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkCWM3CUUXcjs.TILE, y: ty * _chunkCWM3CUUXcjs.TILE, width: _chunkCWM3CUUXcjs.TILE, height: _chunkCWM3CUUXcjs.TILE }, sources, depth);
|
|
6332
6334
|
for (let i = 0; i < w.length; i += 4) {
|
|
6333
6335
|
if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkCWM3CUUXcjs.srgbEncode.call(void 0, w[i + c]);
|
|
6334
6336
|
for (let c = 0; c < 4; c++) w[i + c] *= 255;
|
|
@@ -6336,7 +6338,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6336
6338
|
return w;
|
|
6337
6339
|
}, 4);
|
|
6338
6340
|
}
|
|
6339
|
-
const compositor = new (0,
|
|
6341
|
+
const compositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)();
|
|
6340
6342
|
return new (0, _chunk6FUAHCVIcjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
|
|
6341
6343
|
}
|
|
6342
6344
|
/** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
|
|
@@ -6386,9 +6388,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6386
6388
|
* document bounds and the number of dabs.
|
|
6387
6389
|
*/
|
|
6388
6390
|
paintStroke(init) {
|
|
6389
|
-
if (!Array.isArray(init.points) || !init.points.length) throw new (0,
|
|
6391
|
+
if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("points must hold at least one { x, y } point.");
|
|
6390
6392
|
for (const p of init.points) {
|
|
6391
|
-
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0,
|
|
6393
|
+
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
|
|
6392
6394
|
}
|
|
6393
6395
|
const session = this.beginStroke(init);
|
|
6394
6396
|
session.push(init.points);
|
|
@@ -6414,8 +6416,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6414
6416
|
const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
|
|
6415
6417
|
const { width, height } = this.naturalSize;
|
|
6416
6418
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
6417
|
-
if (!(opacity >= 0 && opacity <= 1)) throw new (0,
|
|
6418
|
-
const blend = _nullishCoalesce(
|
|
6419
|
+
if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("opacity must be from 0 to 1.");
|
|
6420
|
+
const blend = _nullishCoalesce(_chunkQCEQIRJQcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
|
|
6419
6421
|
const sel = options.useSelection !== false && _optionalChain([this, 'access', _241 => _241.state, 'access', _242 => _242.selection, 'optionalAccess', _243 => _243.bounds]) ? this.state.selection : null;
|
|
6420
6422
|
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _244 => _244.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
6421
6423
|
const coverage = new (0, _chunkLRRCMRSLcjs.CoverageMap)();
|
|
@@ -6451,7 +6453,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6451
6453
|
// --- Adjustments ---
|
|
6452
6454
|
/** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
|
|
6453
6455
|
developLayer() {
|
|
6454
|
-
return
|
|
6456
|
+
return _chunkQCEQIRJQcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
|
|
6455
6457
|
}
|
|
6456
6458
|
/**
|
|
6457
6459
|
* Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
|
|
@@ -6477,7 +6479,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6477
6479
|
this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
|
|
6478
6480
|
}
|
|
6479
6481
|
if ("layers" in partial) {
|
|
6480
|
-
layers = this.replaceAdjustmentNodes(layers,
|
|
6482
|
+
layers = this.replaceAdjustmentNodes(layers, _chunkQCEQIRJQcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
|
|
6481
6483
|
}
|
|
6482
6484
|
this.state.layers = layers;
|
|
6483
6485
|
this.notify();
|
|
@@ -6485,7 +6487,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6485
6487
|
/** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
|
|
6486
6488
|
get isProcessOutdated() {
|
|
6487
6489
|
this.syncViews();
|
|
6488
|
-
return
|
|
6490
|
+
return _chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkQCEQIRJQcjs.LATEST_PROCESS_VERSION;
|
|
6489
6491
|
}
|
|
6490
6492
|
/**
|
|
6491
6493
|
* Update to Current Process: re-interprets the current adjustment values with the latest
|
|
@@ -6493,7 +6495,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6493
6495
|
*/
|
|
6494
6496
|
upgradeProcess() {
|
|
6495
6497
|
if (!this.isProcessOutdated) return false;
|
|
6496
|
-
this.setAdjustments({ process:
|
|
6498
|
+
this.setAdjustments({ process: _chunkQCEQIRJQcjs.LATEST_PROCESS_VERSION });
|
|
6497
6499
|
return true;
|
|
6498
6500
|
}
|
|
6499
6501
|
/** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
|
|
@@ -6504,7 +6506,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6504
6506
|
this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0,
|
|
6505
6507
|
this.state.layers,
|
|
6506
6508
|
target.id,
|
|
6507
|
-
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process:
|
|
6509
|
+
(l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkQCEQIRJQcjs.LATEST_PROCESS_VERSION }), 0)
|
|
6508
6510
|
);
|
|
6509
6511
|
}
|
|
6510
6512
|
delete this.state.legacyOutputBlur;
|
|
@@ -6568,7 +6570,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6568
6570
|
const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
|
|
6569
6571
|
for (const l of next) {
|
|
6570
6572
|
if (existing.has(l.id)) continue;
|
|
6571
|
-
out = this.placeLayer(out,
|
|
6573
|
+
out = this.placeLayer(out, _chunkQCEQIRJQcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
|
|
6572
6574
|
}
|
|
6573
6575
|
const order = next.map((l) => l.id);
|
|
6574
6576
|
for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
|
|
@@ -6583,7 +6585,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6583
6585
|
addAdjustmentLayer(init, index) {
|
|
6584
6586
|
const spec = typeof init === "string" ? { kind: init } : init;
|
|
6585
6587
|
const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
|
|
6586
|
-
const layer =
|
|
6588
|
+
const layer = _chunkQCEQIRJQcjs.createAdjustmentLayer.call(void 0, spec.kind, {
|
|
6587
6589
|
id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
|
|
6588
6590
|
name: spec.name,
|
|
6589
6591
|
params: spec.params,
|
|
@@ -6592,10 +6594,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
6592
6594
|
blend: spec.blend,
|
|
6593
6595
|
mask: _nullishCoalesce(spec.mask, () => ( void 0))
|
|
6594
6596
|
});
|
|
6595
|
-
while (ids.has(layer.id)) layer.id =
|
|
6597
|
+
while (ids.has(layer.id)) layer.id = _chunkQCEQIRJQcjs.newLayerId.call(void 0, "adj");
|
|
6596
6598
|
const { width, height } = this.naturalSize;
|
|
6597
6599
|
this.recordHistory();
|
|
6598
|
-
const node =
|
|
6600
|
+
const node = _chunkQCEQIRJQcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
|
|
6599
6601
|
const positioned = Boolean(spec.aboveId || spec.parentId);
|
|
6600
6602
|
this.state.layers = this.placeLayer(this.state.layers, node, {
|
|
6601
6603
|
aboveId: spec.aboveId,
|
|
@@ -6615,7 +6617,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6615
6617
|
if (!loc || loc.layer.type !== "adjustment") return false;
|
|
6616
6618
|
const { width, height } = this.naturalSize;
|
|
6617
6619
|
const node = loc.layer;
|
|
6618
|
-
const merged =
|
|
6620
|
+
const merged = _chunkQCEQIRJQcjs.normalizeAdjustmentLayer.call(void 0, {
|
|
6619
6621
|
id: node.id,
|
|
6620
6622
|
kind: node.kind,
|
|
6621
6623
|
enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
|
|
@@ -6635,7 +6637,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6635
6637
|
params: merged.params
|
|
6636
6638
|
};
|
|
6637
6639
|
if (update.mask !== void 0) {
|
|
6638
|
-
const mask = update.mask ?
|
|
6640
|
+
const mask = update.mask ? _chunkQCEQIRJQcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
|
|
6639
6641
|
if (mask) next.mask = mask;
|
|
6640
6642
|
else delete next.mask;
|
|
6641
6643
|
}
|
|
@@ -6722,8 +6724,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
6722
6724
|
const { width, height } = this.naturalSize;
|
|
6723
6725
|
let next = null;
|
|
6724
6726
|
if (mask) {
|
|
6725
|
-
const sized = mask.width === width && mask.height === height ? mask :
|
|
6726
|
-
next =
|
|
6727
|
+
const sized = mask.width === width && mask.height === height ? mask : _chunkQCEQIRJQcjs.resizeSelection.call(void 0, mask, width, height);
|
|
6728
|
+
next = _chunkQCEQIRJQcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
|
|
6727
6729
|
} else if (mode !== "replace") {
|
|
6728
6730
|
return false;
|
|
6729
6731
|
}
|
|
@@ -6737,7 +6739,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6737
6739
|
/** Select › All. */
|
|
6738
6740
|
selectAll() {
|
|
6739
6741
|
const { width, height } = this.naturalSize;
|
|
6740
|
-
return this.setSelection(
|
|
6742
|
+
return this.setSelection(_chunkQCEQIRJQcjs.fullSelection.call(void 0, width, height));
|
|
6741
6743
|
}
|
|
6742
6744
|
/** Select › Deselect. */
|
|
6743
6745
|
deselect() {
|
|
@@ -6746,11 +6748,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6746
6748
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
6747
6749
|
invertSelection() {
|
|
6748
6750
|
const { width, height } = this.naturalSize;
|
|
6749
|
-
const current = _nullishCoalesce(this.state.selection, () => (
|
|
6750
|
-
return this.setSelection(
|
|
6751
|
+
const current = _nullishCoalesce(this.state.selection, () => ( _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, width, height)));
|
|
6752
|
+
return this.setSelection(_chunkQCEQIRJQcjs.invertSelection.call(void 0, current));
|
|
6751
6753
|
}
|
|
6752
6754
|
shapeCommand(mask, options) {
|
|
6753
|
-
const shaped = options.feather && options.feather > 0 ?
|
|
6755
|
+
const shaped = options.feather && options.feather > 0 ? _chunkQCEQIRJQcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
|
|
6754
6756
|
return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6755
6757
|
}
|
|
6756
6758
|
/** Rectangular marquee in natural image pixels. */
|
|
@@ -6804,11 +6806,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
6804
6806
|
if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
|
|
6805
6807
|
return null;
|
|
6806
6808
|
}
|
|
6807
|
-
const legacy =
|
|
6809
|
+
const legacy = _chunkQCEQIRJQcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
|
|
6808
6810
|
if (options.sample === "active-layer") {
|
|
6809
6811
|
const layer = this.getActiveLayer();
|
|
6810
6812
|
if (!layer || layer.type !== "pixel") {
|
|
6811
|
-
throw new (0,
|
|
6813
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
|
|
6812
6814
|
}
|
|
6813
6815
|
const surface = layer.source === "document" && options.pixels ? _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
|
|
6814
6816
|
return { width, height, data: _chunkCWM3CUUXcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
|
|
@@ -6817,7 +6819,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6817
6819
|
this.syncViews();
|
|
6818
6820
|
if (legacy && !options.pixels) {
|
|
6819
6821
|
const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
|
|
6820
|
-
|
|
6822
|
+
_chunkQCEQIRJQcjs.applyAdjustments.call(void 0, copy, _chunkQCEQIRJQcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
|
|
6821
6823
|
return copy;
|
|
6822
6824
|
}
|
|
6823
6825
|
const pixels = options.pixels;
|
|
@@ -6829,7 +6831,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6829
6831
|
};
|
|
6830
6832
|
const stack = withoutAnnotations(this.state.layers);
|
|
6831
6833
|
const layers = options.sampleMerged ? stack : pixelsOnly(stack);
|
|
6832
|
-
const data = new (0,
|
|
6834
|
+
const data = new (0, _chunkQCEQIRJQcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
|
|
6833
6835
|
return { width, height, data };
|
|
6834
6836
|
}
|
|
6835
6837
|
async requirePixels(options) {
|
|
@@ -6856,7 +6858,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6856
6858
|
modifySelection(op, radius) {
|
|
6857
6859
|
const sel = this.state.selection;
|
|
6858
6860
|
if (!_optionalChain([sel, 'optionalAccess', _258 => _258.bounds])) return false;
|
|
6859
|
-
return this.setSelection(
|
|
6861
|
+
return this.setSelection(_chunkQCEQIRJQcjs.modifySelection.call(void 0, sel, op, radius));
|
|
6860
6862
|
}
|
|
6861
6863
|
/**
|
|
6862
6864
|
* Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
|
|
@@ -6887,7 +6889,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6887
6889
|
} else {
|
|
6888
6890
|
pixels = source;
|
|
6889
6891
|
}
|
|
6890
|
-
this.setSelection(
|
|
6892
|
+
this.setSelection(_chunkQCEQIRJQcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
|
|
6891
6893
|
return this.getSelection();
|
|
6892
6894
|
}
|
|
6893
6895
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
@@ -6899,7 +6901,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6899
6901
|
// --- Layer masks ---
|
|
6900
6902
|
maskFromSelection(sel, props = {}) {
|
|
6901
6903
|
const { width, height } = this.naturalSize;
|
|
6902
|
-
const sized = sel.width === width && sel.height === height ? sel :
|
|
6904
|
+
const sized = sel.width === width && sel.height === height ? sel : _chunkQCEQIRJQcjs.resizeSelection.call(void 0, sel, width, height);
|
|
6903
6905
|
const mask = { surface: _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
|
|
6904
6906
|
return withMaskProps(mask, props);
|
|
6905
6907
|
}
|
|
@@ -6945,7 +6947,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6945
6947
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
6946
6948
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
6947
6949
|
const data = _chunkCWM3CUUXcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
|
|
6948
|
-
const sel =
|
|
6950
|
+
const sel = _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
|
|
6949
6951
|
return this.setSelection(sel, mode);
|
|
6950
6952
|
}
|
|
6951
6953
|
// --- Histogram ---
|
|
@@ -6975,9 +6977,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
6975
6977
|
merged.depthRange = [...merged.depthRange];
|
|
6976
6978
|
this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
6977
6979
|
const next = { ...l };
|
|
6978
|
-
if (
|
|
6980
|
+
if (_chunkQCEQIRJQcjs.isDefaultDepthMask.call(void 0, merged)) {
|
|
6979
6981
|
if (_optionalChain([next, 'access', _264 => _264.mask, 'optionalAccess', _265 => _265.source])) delete next.mask;
|
|
6980
|
-
} else next.mask =
|
|
6982
|
+
} else next.mask = _chunkQCEQIRJQcjs.depthRasterMask.call(void 0, merged);
|
|
6981
6983
|
return next;
|
|
6982
6984
|
});
|
|
6983
6985
|
}
|
|
@@ -6998,7 +7000,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
6998
7000
|
// --- Annotations & Layers ---
|
|
6999
7001
|
/** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
|
|
7000
7002
|
annotationLayer(id) {
|
|
7001
|
-
return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([
|
|
7003
|
+
return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkQCEQIRJQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
|
|
7002
7004
|
}
|
|
7003
7005
|
/** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
|
|
7004
7006
|
annotationEnv() {
|
|
@@ -7014,7 +7016,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7014
7016
|
this.recordHistory();
|
|
7015
7017
|
const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
|
|
7016
7018
|
const fullAnnotation = { ...annotation, id };
|
|
7017
|
-
const layer =
|
|
7019
|
+
const layer = _chunkQCEQIRJQcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
|
|
7018
7020
|
const loc = placement.aboveId ? _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
7019
7021
|
this.state.layers = loc ? _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _269 => _269.parent, 'optionalAccess', _270 => _270.id]), () => ( null)), loc.index + 1) : _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
|
|
7020
7022
|
this.state.selectedAnnotationId = id;
|
|
@@ -7026,17 +7028,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
7026
7028
|
this.recordHistory();
|
|
7027
7029
|
}
|
|
7028
7030
|
const layer = this.annotationLayer(id);
|
|
7029
|
-
const current = layer ?
|
|
7031
|
+
const current = layer ? _chunkQCEQIRJQcjs.annotationOfLayer.call(void 0, layer) : null;
|
|
7030
7032
|
if (layer && current) {
|
|
7031
7033
|
const annotation = { ...current, ...partial, id };
|
|
7032
|
-
const name = layer.name ===
|
|
7034
|
+
const name = layer.name === _chunkQCEQIRJQcjs.annotationLayerName.call(void 0, current) ? _chunkQCEQIRJQcjs.annotationLayerName.call(void 0, annotation) : layer.name;
|
|
7033
7035
|
this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
|
|
7034
7036
|
}
|
|
7035
7037
|
this.notify();
|
|
7036
7038
|
}
|
|
7037
7039
|
/** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
|
|
7038
7040
|
layerForAnnotation(layer, annotation, name) {
|
|
7039
|
-
const fresh =
|
|
7041
|
+
const fresh = _chunkQCEQIRJQcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
|
|
7040
7042
|
const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
|
|
7041
7043
|
for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
7042
7044
|
if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
|
|
@@ -7196,8 +7198,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7196
7198
|
withEmbeddedProfile(bytes, mime) {
|
|
7197
7199
|
const icc = profileBytes(this.state.colorProfile);
|
|
7198
7200
|
try {
|
|
7199
|
-
if (mime === "image/png") return
|
|
7200
|
-
if (mime === "image/jpeg") return
|
|
7201
|
+
if (mime === "image/png") return _chunkBROJYMWUcjs.writePngIcc.call(void 0, bytes, icc, this.getColorProfile().name);
|
|
7202
|
+
if (mime === "image/jpeg") return _chunkBROJYMWUcjs.writeJpegIcc.call(void 0, bytes, icc);
|
|
7201
7203
|
} catch (e26) {
|
|
7202
7204
|
}
|
|
7203
7205
|
return bytes;
|
|
@@ -7323,8 +7325,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7323
7325
|
return;
|
|
7324
7326
|
}
|
|
7325
7327
|
const target = this.developLayer();
|
|
7326
|
-
if (!target) throw new (0,
|
|
7327
|
-
|
|
7328
|
+
if (!target) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("There is no pixel layer to mask.");
|
|
7329
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, target, "all", "mask it");
|
|
7328
7330
|
const { width, height } = this.naturalSize;
|
|
7329
7331
|
let px2 = await this.decodeImage(newDataUrl);
|
|
7330
7332
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
@@ -7332,14 +7334,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7332
7334
|
for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
|
|
7333
7335
|
let surface = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
|
|
7334
7336
|
if (target.offset.x || target.offset.y) surface = _chunkCWM3CUUXcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
|
|
7335
|
-
this.commitLayers(
|
|
7337
|
+
this.commitLayers(_chunkQCEQIRJQcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
|
|
7336
7338
|
return target.id;
|
|
7337
7339
|
}
|
|
7338
7340
|
// --- Type layers ---
|
|
7339
7341
|
|
|
7340
7342
|
/** The shaper that lays out and draws type layers (`null` when there is none here). */
|
|
7341
7343
|
getTextShaper() {
|
|
7342
|
-
if (this.textShaperValue === void 0) this.textShaperValue =
|
|
7344
|
+
if (this.textShaperValue === void 0) this.textShaperValue = _chunkRHXW4TA5cjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
|
|
7343
7345
|
return this.textShaperValue;
|
|
7344
7346
|
}
|
|
7345
7347
|
/** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
|
|
@@ -7356,7 +7358,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7356
7358
|
return _nullishCoalesce(_optionalChain([this, 'access', _277 => _277.getTextShaper, 'call', _278 => _278(), 'optionalAccess', _279 => _279.families, 'optionalCall', _280 => _280()]), () => ( ["sans-serif", "serif", "monospace"]));
|
|
7357
7359
|
}
|
|
7358
7360
|
typeInfo(id) {
|
|
7359
|
-
const layer =
|
|
7361
|
+
const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7360
7362
|
const ranges = (runs) => {
|
|
7361
7363
|
let at = 0;
|
|
7362
7364
|
return runs.map((r) => {
|
|
@@ -7369,7 +7371,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7369
7371
|
let lines = [];
|
|
7370
7372
|
let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
|
|
7371
7373
|
if (shaper) {
|
|
7372
|
-
const layout =
|
|
7374
|
+
const layout = _chunkRHXW4TA5cjs.layoutText.call(void 0, layer, shaper);
|
|
7373
7375
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7374
7376
|
lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
|
|
7375
7377
|
if (layer.rendering === "stored") missing = layout.missingFonts;
|
|
@@ -7399,25 +7401,25 @@ var ImageEditorController = (_class7 = class {
|
|
|
7399
7401
|
* text wrapped in `box`. Refused without a text shaper. Returns its id.
|
|
7400
7402
|
*/
|
|
7401
7403
|
addTextLayer(init) {
|
|
7402
|
-
const text =
|
|
7403
|
-
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0,
|
|
7404
|
-
const style =
|
|
7405
|
-
const paragraph =
|
|
7404
|
+
const text = _chunkQCEQIRJQcjs.normalizeText.call(void 0, init.text);
|
|
7405
|
+
if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("x and y must be numbers (document pixels).");
|
|
7406
|
+
const style = _chunkQCEQIRJQcjs.patchTextStyle.call(void 0, { ..._chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
|
|
7407
|
+
const paragraph = _chunkQCEQIRJQcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
|
|
7406
7408
|
let frame = { kind: "point" };
|
|
7407
7409
|
if (init.box) {
|
|
7408
7410
|
const { width, height } = init.box;
|
|
7409
|
-
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0,
|
|
7411
|
+
if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
|
|
7410
7412
|
frame = { kind: "box", width, height };
|
|
7411
7413
|
}
|
|
7412
|
-
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0,
|
|
7413
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7414
|
-
if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7414
|
+
if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("rotation must be a number of degrees.");
|
|
7415
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7416
|
+
if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7415
7417
|
const t = [1, 0, 0, 1, init.x, init.y];
|
|
7416
|
-
const transform = init.rotation ?
|
|
7417
|
-
const layer =
|
|
7418
|
+
const transform = init.rotation ? _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, t, _chunkRHXW4TA5cjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
|
|
7419
|
+
const layer = _chunkQCEQIRJQcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkQCEQIRJQcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
|
|
7418
7420
|
if (init.opacity !== void 0) layer.opacity = init.opacity;
|
|
7419
7421
|
if (init.blend !== void 0) layer.blend = init.blend;
|
|
7420
|
-
const next =
|
|
7422
|
+
const next = _chunkQCEQIRJQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7421
7423
|
this.commitLayers(next, () => {
|
|
7422
7424
|
this.state.activeLayerId = layer.id;
|
|
7423
7425
|
this.state.activeTarget = "pixels";
|
|
@@ -7429,28 +7431,28 @@ var ImageEditorController = (_class7 = class {
|
|
|
7429
7431
|
* `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
|
|
7430
7432
|
*/
|
|
7431
7433
|
setText(id, text, range = {}, commitToHistory = true) {
|
|
7432
|
-
const layer =
|
|
7433
|
-
const insert =
|
|
7434
|
-
const [start, end] =
|
|
7435
|
-
const { layers } =
|
|
7434
|
+
const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7435
|
+
const insert = _chunkQCEQIRJQcjs.normalizeText.call(void 0, text);
|
|
7436
|
+
const [start, end] = _chunkQCEQIRJQcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7437
|
+
const { layers } = _chunkQCEQIRJQcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkQCEQIRJQcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
|
|
7436
7438
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7437
7439
|
return this.typeInfo(id);
|
|
7438
7440
|
}
|
|
7439
7441
|
/** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
|
|
7440
7442
|
setTextStyle(id, style, range = {}, commitToHistory = true) {
|
|
7441
|
-
const layer =
|
|
7442
|
-
const [start, end] =
|
|
7443
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7444
|
-
|
|
7445
|
-
const { layers } =
|
|
7443
|
+
const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7444
|
+
const [start, end] = _chunkQCEQIRJQcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7445
|
+
if (!Object.keys(style).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one style field to set.");
|
|
7446
|
+
_chunkQCEQIRJQcjs.patchTextStyle.call(void 0, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE, style);
|
|
7447
|
+
const { layers } = _chunkQCEQIRJQcjs.updateTypeLayer.call(void 0,
|
|
7446
7448
|
this.state.layers,
|
|
7447
7449
|
id,
|
|
7448
7450
|
(l) => {
|
|
7449
7451
|
if (start === end) {
|
|
7450
|
-
if (l.text.length) throw new (0,
|
|
7451
|
-
return { runs: [{ length: 0, style:
|
|
7452
|
+
if (l.text.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
|
|
7453
|
+
return { runs: [{ length: 0, style: _chunkQCEQIRJQcjs.patchTextStyle.call(void 0, _chunkRHXW4TA5cjs.styleAt.call(void 0, l.runs, 0, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE), style) }] };
|
|
7452
7454
|
}
|
|
7453
|
-
return { runs:
|
|
7455
|
+
return { runs: _chunkRHXW4TA5cjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkQCEQIRJQcjs.patchTextStyle.call(void 0, s, style)) };
|
|
7454
7456
|
},
|
|
7455
7457
|
this.textEnv(),
|
|
7456
7458
|
"restyle its text"
|
|
@@ -7460,11 +7462,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7460
7462
|
}
|
|
7461
7463
|
/** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
|
|
7462
7464
|
setParagraphStyle(id, style, range = {}, commitToHistory = true) {
|
|
7463
|
-
const layer =
|
|
7464
|
-
const [start, end] =
|
|
7465
|
-
if (!Object.keys(style).length) throw new (0,
|
|
7466
|
-
|
|
7467
|
-
const { layers } =
|
|
7465
|
+
const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7466
|
+
const [start, end] = _chunkQCEQIRJQcjs.textRange.call(void 0, layer.text, range.start, range.end);
|
|
7467
|
+
if (!Object.keys(style).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one paragraph field to set.");
|
|
7468
|
+
_chunkQCEQIRJQcjs.patchParagraphStyle.call(void 0, {}, style);
|
|
7469
|
+
const { layers } = _chunkQCEQIRJQcjs.updateTypeLayer.call(void 0,
|
|
7468
7470
|
this.state.layers,
|
|
7469
7471
|
id,
|
|
7470
7472
|
(l) => {
|
|
@@ -7473,7 +7475,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7473
7475
|
const a = at;
|
|
7474
7476
|
at += p.length;
|
|
7475
7477
|
const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
|
|
7476
|
-
return touches || !l.text.length ? { length: p.length, style:
|
|
7478
|
+
return touches || !l.text.length ? { length: p.length, style: _chunkQCEQIRJQcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
|
|
7477
7479
|
});
|
|
7478
7480
|
return { paragraphs };
|
|
7479
7481
|
},
|
|
@@ -7489,21 +7491,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7489
7491
|
* paragraph. Also resizes a box. One undo step.
|
|
7490
7492
|
*/
|
|
7491
7493
|
setTextFrame(id, frame, commitToHistory = true) {
|
|
7492
|
-
const layer =
|
|
7493
|
-
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0,
|
|
7494
|
-
if (frame.kind !== "box" && frame.kind !== "point") throw new (0,
|
|
7494
|
+
const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7495
|
+
if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("width and height must be at least 1 pixel.");
|
|
7496
|
+
if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("kind must be point or box.");
|
|
7495
7497
|
const shaper = this.getTextShaper();
|
|
7496
|
-
const { layers } =
|
|
7498
|
+
const { layers } = _chunkQCEQIRJQcjs.updateTypeLayer.call(void 0,
|
|
7497
7499
|
this.state.layers,
|
|
7498
7500
|
id,
|
|
7499
7501
|
(l) => {
|
|
7500
7502
|
if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
|
|
7501
|
-
if (!shaper) throw new (0,
|
|
7502
|
-
const lines =
|
|
7503
|
+
if (!shaper) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
|
|
7504
|
+
const lines = _chunkRHXW4TA5cjs.layoutText.call(void 0, l, shaper).lines;
|
|
7503
7505
|
const first = lines[0];
|
|
7504
7506
|
const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
|
|
7505
7507
|
const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
|
|
7506
|
-
const m =
|
|
7508
|
+
const m = _chunkQCEQIRJQcjs.textMatrix.call(void 0, l);
|
|
7507
7509
|
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]];
|
|
7508
7510
|
const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
|
|
7509
7511
|
return { frame: nextFrame, transform: shifted };
|
|
@@ -7520,21 +7522,21 @@ var ImageEditorController = (_class7 = class {
|
|
|
7520
7522
|
* `warnings` says when other colours were dropped. One undo step.
|
|
7521
7523
|
*/
|
|
7522
7524
|
convertTextToShape(id) {
|
|
7523
|
-
const layer =
|
|
7524
|
-
|
|
7525
|
+
const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7526
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
|
|
7525
7527
|
const shaper = this.getTextShaper();
|
|
7526
|
-
if (!shaper) throw new (0,
|
|
7527
|
-
const parts =
|
|
7528
|
-
const subpaths = parts.flatMap((p) =>
|
|
7529
|
-
if (!subpaths.length) throw new (0,
|
|
7528
|
+
if (!shaper) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
|
|
7529
|
+
const parts = _chunkQCEQIRJQcjs.textOutlines.call(void 0, layer, shaper);
|
|
7530
|
+
const subpaths = parts.flatMap((p) => _chunkRHXW4TA5cjs.bezierToSubpaths.call(void 0, p.path));
|
|
7531
|
+
if (!subpaths.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
|
|
7530
7532
|
const warnings = [];
|
|
7531
7533
|
const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
|
|
7532
7534
|
if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
|
|
7533
|
-
const missing =
|
|
7535
|
+
const missing = _chunkRHXW4TA5cjs.layoutText.call(void 0, layer, shaper).missingFonts;
|
|
7534
7536
|
if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
|
|
7535
|
-
const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => (
|
|
7537
|
+
const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => ( _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE));
|
|
7536
7538
|
const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
|
|
7537
|
-
const shape =
|
|
7539
|
+
const shape = _chunkQCEQIRJQcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
|
|
7538
7540
|
const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
|
|
7539
7541
|
for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
|
|
7540
7542
|
this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
|
|
@@ -7542,23 +7544,23 @@ var ImageEditorController = (_class7 = class {
|
|
|
7542
7544
|
}
|
|
7543
7545
|
/** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
|
|
7544
7546
|
getTextLayout(id) {
|
|
7545
|
-
const layer =
|
|
7547
|
+
const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7546
7548
|
const shaper = this.getTextShaper();
|
|
7547
|
-
return shaper ?
|
|
7549
|
+
return shaper ? _chunkRHXW4TA5cjs.layoutText.call(void 0, layer, shaper) : null;
|
|
7548
7550
|
}
|
|
7549
7551
|
/** The text index nearest a document point (for clicks on a type layer). */
|
|
7550
7552
|
textIndexAt(id, point) {
|
|
7551
|
-
const layer =
|
|
7553
|
+
const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7552
7554
|
const layout = this.getTextLayout(id);
|
|
7553
|
-
return layout ?
|
|
7555
|
+
return layout ? _chunkRHXW4TA5cjs.textIndexAt.call(void 0, layout, _chunkQCEQIRJQcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
|
|
7554
7556
|
}
|
|
7555
7557
|
/** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
|
|
7556
7558
|
textCaret(id, index) {
|
|
7557
|
-
const layer =
|
|
7559
|
+
const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
|
|
7558
7560
|
const layout = this.getTextLayout(id);
|
|
7559
7561
|
if (!layout) return null;
|
|
7560
|
-
const c =
|
|
7561
|
-
const m =
|
|
7562
|
+
const c = _chunkRHXW4TA5cjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
|
|
7563
|
+
const m = _chunkQCEQIRJQcjs.textMatrix.call(void 0, layer);
|
|
7562
7564
|
const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
|
|
7563
7565
|
return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
|
|
7564
7566
|
}
|
|
@@ -7569,14 +7571,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7569
7571
|
}
|
|
7570
7572
|
/** One component from tool or UI input (validated). */
|
|
7571
7573
|
componentFrom(spec, path) {
|
|
7572
|
-
const op =
|
|
7573
|
-
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0,
|
|
7574
|
-
if (spec.shape !== void 0) return
|
|
7575
|
-
if (spec.subpaths !== void 0) return { op, subpaths:
|
|
7576
|
-
throw new (0,
|
|
7574
|
+
const op = _chunkQCEQIRJQcjs.requireOperation.call(void 0, spec.op, `${path}op`);
|
|
7575
|
+
if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
|
|
7576
|
+
if (spec.shape !== void 0) return _chunkQCEQIRJQcjs.liveComponent.call(void 0, _chunkQCEQIRJQcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
|
|
7577
|
+
if (spec.subpaths !== void 0) return { op, subpaths: _chunkQCEQIRJQcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
|
|
7578
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
|
|
7577
7579
|
}
|
|
7578
7580
|
shapeInfo(id) {
|
|
7579
|
-
const layer =
|
|
7581
|
+
const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7580
7582
|
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
7581
7583
|
const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
|
|
7582
7584
|
const info = {
|
|
@@ -7586,13 +7588,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
7586
7588
|
index,
|
|
7587
7589
|
op: c.op,
|
|
7588
7590
|
live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
|
|
7589
|
-
subpaths:
|
|
7590
|
-
bounds: box(
|
|
7591
|
+
subpaths: _chunkRHXW4TA5cjs.roundSubpaths.call(void 0, c.subpaths),
|
|
7592
|
+
bounds: box(_chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
|
|
7591
7593
|
})),
|
|
7592
7594
|
fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
|
|
7593
7595
|
fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
|
|
7594
7596
|
stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
|
|
7595
|
-
geometryBounds: box(
|
|
7597
|
+
geometryBounds: box(_chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, layer)),
|
|
7596
7598
|
bounds: this.getLayerBounds(id)
|
|
7597
7599
|
};
|
|
7598
7600
|
if (layer.annotation) info.annotationId = layer.annotation.id;
|
|
@@ -7609,17 +7611,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
7609
7611
|
*/
|
|
7610
7612
|
addShapeLayer(init) {
|
|
7611
7613
|
const specs = _optionalChain([init, 'access', _289 => _289.components, 'optionalAccess', _290 => _290.length]) ? init.components : [init];
|
|
7612
|
-
if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0,
|
|
7614
|
+
if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
|
|
7613
7615
|
const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _293 => _293.components, 'optionalAccess', _294 => _294.length]) ? `components[${i}].` : ""));
|
|
7614
|
-
const stroke = init.stroke ?
|
|
7616
|
+
const stroke = init.stroke ? _chunkQCEQIRJQcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
|
|
7615
7617
|
const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
|
|
7616
|
-
const fill = init.fill === void 0 ? stroke && openOnly ? null :
|
|
7617
|
-
if (!fill && !stroke) throw new (0,
|
|
7618
|
-
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0,
|
|
7619
|
-
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0,
|
|
7620
|
-
if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0,
|
|
7621
|
-
const layer =
|
|
7622
|
-
const next =
|
|
7618
|
+
const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkQCEQIRJQcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkQCEQIRJQcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
|
|
7619
|
+
if (!fill && !stroke) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
|
|
7620
|
+
if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7621
|
+
if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("opacity must be between 0 and 1.");
|
|
7622
|
+
if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
|
|
7623
|
+
const layer = _chunkQCEQIRJQcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
|
|
7624
|
+
const next = _chunkQCEQIRJQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
|
|
7623
7625
|
this.commitLayers(next, () => {
|
|
7624
7626
|
this.state.activeLayerId = layer.id;
|
|
7625
7627
|
this.state.activeTarget = "pixels";
|
|
@@ -7632,18 +7634,18 @@ var ImageEditorController = (_class7 = class {
|
|
|
7632
7634
|
* only those settings of the current stroke. Returns the shape.
|
|
7633
7635
|
*/
|
|
7634
7636
|
setShapeStyle(id, changes, commitToHistory = true) {
|
|
7635
|
-
const layer =
|
|
7636
|
-
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null :
|
|
7637
|
-
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null :
|
|
7638
|
-
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0,
|
|
7637
|
+
const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7638
|
+
const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkQCEQIRJQcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
|
|
7639
|
+
const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkQCEQIRJQcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
|
|
7640
|
+
if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
|
|
7639
7641
|
const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
|
|
7640
|
-
const { layers } =
|
|
7642
|
+
const { layers } = _chunkQCEQIRJQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
|
|
7641
7643
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7642
7644
|
return this.shapeInfo(id);
|
|
7643
7645
|
}
|
|
7644
7646
|
componentIndex(layer, index) {
|
|
7645
7647
|
if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
|
|
7646
|
-
throw new (0,
|
|
7648
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
|
|
7647
7649
|
}
|
|
7648
7650
|
return index;
|
|
7649
7651
|
}
|
|
@@ -7653,36 +7655,36 @@ var ImageEditorController = (_class7 = class {
|
|
|
7653
7655
|
* the live shape) or its operation. Returns the shape.
|
|
7654
7656
|
*/
|
|
7655
7657
|
setShapeComponent(id, index, change, commitToHistory = true) {
|
|
7656
|
-
const layer =
|
|
7658
|
+
const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7657
7659
|
const i = this.componentIndex(layer, index);
|
|
7658
7660
|
const current = layer.components[i];
|
|
7659
7661
|
let shape = change.shape;
|
|
7660
7662
|
if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
|
|
7661
7663
|
else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
|
|
7662
|
-
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op:
|
|
7664
|
+
const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkQCEQIRJQcjs.requireOperation.call(void 0, change.op) };
|
|
7663
7665
|
const components = layer.components.map((c, k) => k === i ? next : c);
|
|
7664
|
-
const { layers } =
|
|
7666
|
+
const { layers } = _chunkQCEQIRJQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7665
7667
|
this.commitLayers(layers, void 0, commitToHistory);
|
|
7666
7668
|
return this.shapeInfo(id);
|
|
7667
7669
|
}
|
|
7668
7670
|
/** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
|
|
7669
7671
|
addShapeComponent(id, spec, index) {
|
|
7670
|
-
const layer =
|
|
7672
|
+
const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7671
7673
|
const c = this.componentFrom(spec, "");
|
|
7672
7674
|
const at = index === void 0 ? layer.components.length : index;
|
|
7673
|
-
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0,
|
|
7675
|
+
if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
|
|
7674
7676
|
const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
|
|
7675
|
-
const { layers } =
|
|
7677
|
+
const { layers } = _chunkQCEQIRJQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7676
7678
|
this.commitLayers(layers);
|
|
7677
7679
|
return this.shapeInfo(id);
|
|
7678
7680
|
}
|
|
7679
7681
|
/** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
|
|
7680
7682
|
removeShapeComponent(id, index) {
|
|
7681
|
-
const layer =
|
|
7683
|
+
const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7682
7684
|
const i = this.componentIndex(layer, index);
|
|
7683
|
-
if (layer.components.length === 1) throw new (0,
|
|
7685
|
+
if (layer.components.length === 1) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
|
|
7684
7686
|
const components = layer.components.filter((_, k) => k !== i);
|
|
7685
|
-
const { layers } =
|
|
7687
|
+
const { layers } = _chunkQCEQIRJQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
|
|
7686
7688
|
this.commitLayers(layers);
|
|
7687
7689
|
return this.shapeInfo(id);
|
|
7688
7690
|
}
|
|
@@ -7691,10 +7693,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7691
7693
|
* shapes become paths), as one undo step. Returns the shape.
|
|
7692
7694
|
*/
|
|
7693
7695
|
mergeShapeComponents(id) {
|
|
7694
|
-
const layer =
|
|
7695
|
-
if (layer.components.length < 2) throw new (0,
|
|
7696
|
-
const components =
|
|
7697
|
-
const { layers } =
|
|
7696
|
+
const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
|
|
7697
|
+
if (layer.components.length < 2) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
|
|
7698
|
+
const components = _chunkQCEQIRJQcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
|
|
7699
|
+
const { layers } = _chunkQCEQIRJQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
|
|
7698
7700
|
this.commitLayers(layers);
|
|
7699
7701
|
return this.shapeInfo(id);
|
|
7700
7702
|
}
|
|
@@ -7704,8 +7706,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7704
7706
|
* step. Returns the layer id.
|
|
7705
7707
|
*/
|
|
7706
7708
|
async rasterizeLayer(id) {
|
|
7707
|
-
const layer =
|
|
7708
|
-
|
|
7709
|
+
const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
|
|
7710
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
|
|
7709
7711
|
const { width, height } = this.naturalSize;
|
|
7710
7712
|
const canvas = { x: 0, y: 0, width, height };
|
|
7711
7713
|
let next;
|
|
@@ -7721,8 +7723,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7721
7723
|
if (layer.locks) next.locks = layer.locks;
|
|
7722
7724
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
7723
7725
|
} else if (layer.type === "pixel") {
|
|
7724
|
-
if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0,
|
|
7725
|
-
|
|
7726
|
+
if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
|
|
7727
|
+
_chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
|
|
7726
7728
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
7727
7729
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
7728
7730
|
delete content.mask;
|
|
@@ -7739,10 +7741,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7739
7741
|
} else if (layer.type === "smart") {
|
|
7740
7742
|
return this.rasterizeSmartObject(id);
|
|
7741
7743
|
} else if (layer.type === "shape" || layer.type === "type") {
|
|
7742
|
-
next = layer.type === "shape" ?
|
|
7744
|
+
next = layer.type === "shape" ? _chunkQCEQIRJQcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkQCEQIRJQcjs.typeAsPixelLayer.call(void 0, layer);
|
|
7743
7745
|
if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _297 => _297.annotation, 'optionalAccess', _298 => _298.id])) this.state.selectedAnnotationId = null;
|
|
7744
7746
|
} else {
|
|
7745
|
-
throw new (0,
|
|
7747
|
+
throw new (0, _chunkQCEQIRJQcjs.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.`);
|
|
7746
7748
|
}
|
|
7747
7749
|
this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
|
|
7748
7750
|
return id;
|
|
@@ -7767,7 +7769,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7767
7769
|
setColorMode(mode, options = {}) {
|
|
7768
7770
|
let next;
|
|
7769
7771
|
if (mode === "rgb") {
|
|
7770
|
-
if (options.profile !== void 0) throw new (0,
|
|
7772
|
+
if (options.profile !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
|
|
7771
7773
|
next = null;
|
|
7772
7774
|
} else if (mode === "lab") next = { mode: "lab" };
|
|
7773
7775
|
else if (mode === "cmyk") {
|
|
@@ -7775,14 +7777,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7775
7777
|
try {
|
|
7776
7778
|
doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
|
|
7777
7779
|
} catch (e) {
|
|
7778
|
-
throw new (0,
|
|
7780
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7779
7781
|
}
|
|
7780
7782
|
const cs = resolveProfile(doc).colorSpace;
|
|
7781
|
-
if (cs !== "cmyk") throw new (0,
|
|
7783
|
+
if (cs !== "cmyk") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
|
|
7782
7784
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7783
|
-
if (!
|
|
7785
|
+
if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
|
|
7784
7786
|
next = { mode: "cmyk", profile: doc, intent };
|
|
7785
|
-
} else throw new (0,
|
|
7787
|
+
} else throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
|
|
7786
7788
|
this.recordHistory();
|
|
7787
7789
|
if (next) this.state.colorMode = next;
|
|
7788
7790
|
else delete this.state.colorMode;
|
|
@@ -7795,10 +7797,10 @@ var ImageEditorController = (_class7 = class {
|
|
|
7795
7797
|
try {
|
|
7796
7798
|
doc = documentProfile(profile);
|
|
7797
7799
|
} catch (e) {
|
|
7798
|
-
throw new (0,
|
|
7800
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7799
7801
|
}
|
|
7800
7802
|
const cs = resolveProfile(doc).colorSpace;
|
|
7801
|
-
if (cs !== "rgb") throw new (0,
|
|
7803
|
+
if (cs !== "rgb") throw new (0, _chunkQCEQIRJQcjs.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.`);
|
|
7802
7804
|
return doc;
|
|
7803
7805
|
}
|
|
7804
7806
|
/**
|
|
@@ -7824,8 +7826,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
7824
7826
|
convertToProfile(profile, options = {}) {
|
|
7825
7827
|
const doc = this.rgbProfileArg(profile, "Convert to Profile");
|
|
7826
7828
|
const intent = _nullishCoalesce(options.intent, () => ( "relative"));
|
|
7827
|
-
if (!
|
|
7828
|
-
const t =
|
|
7829
|
+
if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
|
|
7830
|
+
const t = _chunkBROJYMWUcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7829
7831
|
const converted = [];
|
|
7830
7832
|
const unconverted = [];
|
|
7831
7833
|
const memo = /* @__PURE__ */ new Map();
|
|
@@ -7854,11 +7856,11 @@ var ImageEditorController = (_class7 = class {
|
|
|
7854
7856
|
else if (l.type === "pixel") next2 = { ...next2, surface: convertSurfaceColors(this.surfaceOf(l), t), source: void 0 };
|
|
7855
7857
|
else if (l.type === "shape") {
|
|
7856
7858
|
const s = next2;
|
|
7857
|
-
next2 =
|
|
7859
|
+
next2 = _chunkQCEQIRJQcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
|
|
7858
7860
|
} else if (l.type === "type") {
|
|
7859
7861
|
const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
|
|
7860
7862
|
try {
|
|
7861
|
-
next2 =
|
|
7863
|
+
next2 = _chunkQCEQIRJQcjs.rerenderText.call(void 0, recoloured, textEnv);
|
|
7862
7864
|
} catch (e27) {
|
|
7863
7865
|
next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
|
|
7864
7866
|
}
|
|
@@ -7888,12 +7890,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
7888
7890
|
try {
|
|
7889
7891
|
doc = documentProfile(setup.profile);
|
|
7890
7892
|
} catch (e) {
|
|
7891
|
-
throw new (0,
|
|
7893
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7892
7894
|
}
|
|
7893
7895
|
const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
|
|
7894
|
-
if (!
|
|
7896
|
+
if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
|
|
7895
7897
|
const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
|
|
7896
|
-
if (!
|
|
7898
|
+
if (!_chunkBROJYMWUcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
|
|
7897
7899
|
this.state.proofSetup = next;
|
|
7898
7900
|
this.notify();
|
|
7899
7901
|
return next;
|
|
@@ -7910,14 +7912,14 @@ var ImageEditorController = (_class7 = class {
|
|
|
7910
7912
|
src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
|
|
7911
7913
|
dst = resolveProfile(documentProfile(to));
|
|
7912
7914
|
} catch (e) {
|
|
7913
|
-
throw new (0,
|
|
7915
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
|
|
7914
7916
|
}
|
|
7915
|
-
if (src.colorSpace !== "rgb") throw new (0,
|
|
7916
|
-
const t =
|
|
7917
|
-
const toLab =
|
|
7917
|
+
if (src.colorSpace !== "rgb") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
|
|
7918
|
+
const t = _chunkBROJYMWUcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
|
|
7919
|
+
const toLab = _chunkBROJYMWUcjs.Transform.create(src, _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
|
|
7918
7920
|
return colors.map((input) => {
|
|
7919
7921
|
const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
|
|
7920
|
-
if (!m) throw new (0,
|
|
7922
|
+
if (!m) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
|
|
7921
7923
|
const n = parseInt(m[1], 16);
|
|
7922
7924
|
const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
|
|
7923
7925
|
const out = new Float32Array(16);
|
|
@@ -7943,7 +7945,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7943
7945
|
* the ids of the layers whose pixels changed.
|
|
7944
7946
|
*/
|
|
7945
7947
|
setBitDepth(depth) {
|
|
7946
|
-
if (!_chunkCWM3CUUXcjs.isBitDepth.call(void 0, depth)) throw new (0,
|
|
7948
|
+
if (!_chunkCWM3CUUXcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
|
|
7947
7949
|
const changed = [];
|
|
7948
7950
|
const withMask = (l) => {
|
|
7949
7951
|
const m = l.mask;
|
|
@@ -7992,7 +7994,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
7992
7994
|
* Throws `PsdError` for files that cannot be read at all.
|
|
7993
7995
|
*/
|
|
7994
7996
|
loadPsd(bytes) {
|
|
7995
|
-
const result =
|
|
7997
|
+
const result = _chunkQCEQIRJQcjs.importPsd.call(void 0, bytes, { newId: () => _chunkQCEQIRJQcjs.newLayerId.call(void 0, ) });
|
|
7996
7998
|
this.abandonContents();
|
|
7997
7999
|
this.recordHistory();
|
|
7998
8000
|
const s = this.state;
|
|
@@ -8002,7 +8004,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8002
8004
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
8003
8005
|
s.layers = this.checkPsdFonts(result);
|
|
8004
8006
|
s.crop = null;
|
|
8005
|
-
s.transform = { ...
|
|
8007
|
+
s.transform = { ..._chunkQCEQIRJQcjs.DEFAULT_TRANSFORM_VALUES };
|
|
8006
8008
|
s.outputOpacity = 1;
|
|
8007
8009
|
delete s.legacyOutputBlur;
|
|
8008
8010
|
s.selection = null;
|
|
@@ -8053,7 +8055,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8053
8055
|
let layers = result.layers;
|
|
8054
8056
|
const missing = /* @__PURE__ */ new Map();
|
|
8055
8057
|
for (const l of types) {
|
|
8056
|
-
const fonts = shaper ?
|
|
8058
|
+
const fonts = shaper ? _chunkRHXW4TA5cjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
|
|
8057
8059
|
if (!fonts.length) continue;
|
|
8058
8060
|
layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
|
|
8059
8061
|
for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
|
|
@@ -8081,7 +8083,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8081
8083
|
const canRasterize = this.renderer.canRasterize();
|
|
8082
8084
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
8083
8085
|
const sources = this.renderer.compositorSources(width, height);
|
|
8084
|
-
const compositor = new (0,
|
|
8086
|
+
const compositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)();
|
|
8085
8087
|
const bakeMask = (layer) => {
|
|
8086
8088
|
const mask = layer.mask;
|
|
8087
8089
|
if (!_optionalChain([mask, 'optionalAccess', _309 => _309.source])) return mask;
|
|
@@ -8163,7 +8165,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8163
8165
|
out.surface = this.surfaceOf(layer);
|
|
8164
8166
|
delete out.source;
|
|
8165
8167
|
}
|
|
8166
|
-
const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(
|
|
8168
|
+
const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunkQCEQIRJQcjs.isActiveFilter)]), () => ( []));
|
|
8167
8169
|
if (active.length) {
|
|
8168
8170
|
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
8169
8171
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -8196,8 +8198,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8196
8198
|
const color = this.psdColorOptions(warnings);
|
|
8197
8199
|
if (color.colorMode && this.bitDepth === 32) warnings.push(`${color.colorMode.toUpperCase()} files are written at 16 bits per channel at most; the 32-bit samples were converted (colour above 1 clipped).`);
|
|
8198
8200
|
const depth = color.colorMode && this.bitDepth === 32 ? 16 : this.bitDepth;
|
|
8199
|
-
const mergedDeep = depth === 8 ? void 0 : _chunkHGTDMKNEcjs.workingToSamples.call(void 0,
|
|
8200
|
-
const result =
|
|
8201
|
+
const mergedDeep = depth === 8 ? void 0 : _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkQCEQIRJQcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
|
|
8202
|
+
const result = _chunkQCEQIRJQcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
|
|
8201
8203
|
warnings.push(...result.warnings);
|
|
8202
8204
|
return { bytes: result.bytes, warnings, psb: result.psb, width, height };
|
|
8203
8205
|
}
|
|
@@ -8213,13 +8215,13 @@ var ImageEditorController = (_class7 = class {
|
|
|
8213
8215
|
if (!this.samplePixelsOverride) this.samplePixels = null;
|
|
8214
8216
|
if (this.state.selection && (sx !== 1 || sy !== 1)) {
|
|
8215
8217
|
this.state.selection = normalizeSelection(
|
|
8216
|
-
|
|
8218
|
+
_chunkQCEQIRJQcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
|
|
8217
8219
|
);
|
|
8218
8220
|
}
|
|
8219
8221
|
let layers = this.state.layers;
|
|
8220
8222
|
if (sx !== 1 || sy !== 1) {
|
|
8221
8223
|
if (this.state.crop) {
|
|
8222
|
-
this.state.crop =
|
|
8224
|
+
this.state.crop = _chunkQCEQIRJQcjs.clampCropToImage.call(void 0,
|
|
8223
8225
|
{
|
|
8224
8226
|
x: Math.round(this.state.crop.x * sx),
|
|
8225
8227
|
y: Math.round(this.state.crop.y * sy),
|
|
@@ -8238,17 +8240,17 @@ var ImageEditorController = (_class7 = class {
|
|
|
8238
8240
|
} else if (l.type === "shape") {
|
|
8239
8241
|
const a = l.annotation;
|
|
8240
8242
|
const scaled = a ? scaleAnnotation(a, sx, sy) : null;
|
|
8241
|
-
const fromAnnotation = scaled ?
|
|
8243
|
+
const fromAnnotation = scaled ? _chunkQCEQIRJQcjs.shapeFromAnnotation.call(void 0, scaled) : null;
|
|
8242
8244
|
const m = [sx, 0, 0, sy, 0, 0];
|
|
8243
|
-
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => (
|
|
8245
|
+
const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunkQCEQIRJQcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
|
|
8244
8246
|
const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
|
|
8245
8247
|
if (scaled && fromAnnotation) moved.annotation = scaled;
|
|
8246
8248
|
else delete moved.annotation;
|
|
8247
|
-
layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () =>
|
|
8249
|
+
layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkQCEQIRJQcjs.rerenderShape.call(void 0, moved, env));
|
|
8248
8250
|
}
|
|
8249
8251
|
}
|
|
8250
8252
|
}
|
|
8251
|
-
const bg =
|
|
8253
|
+
const bg = _chunkQCEQIRJQcjs.developTarget.call(void 0, layers, null);
|
|
8252
8254
|
if (bg && bg.source !== "document") layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
|
|
8253
8255
|
if (clearAnnotations) {
|
|
8254
8256
|
for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => null);
|
|
@@ -8269,7 +8271,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8269
8271
|
let out;
|
|
8270
8272
|
try {
|
|
8271
8273
|
out = this.serializeState();
|
|
8272
|
-
if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection =
|
|
8274
|
+
if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunkQCEQIRJQcjs.serializeSelection.call(void 0, this.state.selection);
|
|
8273
8275
|
} finally {
|
|
8274
8276
|
if (root) {
|
|
8275
8277
|
this.state = current;
|
|
@@ -8277,8 +8279,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8277
8279
|
this.viewKey = [];
|
|
8278
8280
|
}
|
|
8279
8281
|
}
|
|
8280
|
-
if (!options || out.version !==
|
|
8281
|
-
return
|
|
8282
|
+
if (!options || out.version !== _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
|
|
8283
|
+
return _chunkQCEQIRJQcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
|
|
8282
8284
|
}
|
|
8283
8285
|
/**
|
|
8284
8286
|
* Loads a stored state whose v3 assets may live in an asset store (references other than data
|
|
@@ -8286,12 +8288,12 @@ var ImageEditorController = (_class7 = class {
|
|
|
8286
8288
|
* out and listed in `lastLoadProblems`.
|
|
8287
8289
|
*/
|
|
8288
8290
|
async loadJSONAsync(data, options = {}) {
|
|
8289
|
-
if (data.version !==
|
|
8291
|
+
if (data.version !== _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
|
|
8290
8292
|
this.loadJSON(data);
|
|
8291
8293
|
return;
|
|
8292
8294
|
}
|
|
8293
8295
|
const problems = [];
|
|
8294
|
-
const assets = await
|
|
8296
|
+
const assets = await _chunkQCEQIRJQcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
|
|
8295
8297
|
this.loadJSON({ ...data, assets });
|
|
8296
8298
|
this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
|
|
8297
8299
|
}
|
|
@@ -8303,7 +8305,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8303
8305
|
let selection = null;
|
|
8304
8306
|
if (data.selection) {
|
|
8305
8307
|
try {
|
|
8306
|
-
selection = normalizeSelection(
|
|
8308
|
+
selection = normalizeSelection(_chunkQCEQIRJQcjs.deserializeSelection.call(void 0, data.selection));
|
|
8307
8309
|
} catch (e28) {
|
|
8308
8310
|
selection = null;
|
|
8309
8311
|
}
|
|
@@ -8321,8 +8323,8 @@ var ImageEditorController = (_class7 = class {
|
|
|
8321
8323
|
if (isLayered(data)) {
|
|
8322
8324
|
const problems = [];
|
|
8323
8325
|
const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
|
|
8324
|
-
const storedPatterns =
|
|
8325
|
-
s.layers =
|
|
8326
|
+
const storedPatterns = _chunkQCEQIRJQcjs.deserializePatterns.call(void 0, data.patterns, []);
|
|
8327
|
+
s.layers = _chunkQCEQIRJQcjs.deserializeLayers.call(void 0, data.layers, {
|
|
8326
8328
|
assets: _nullishCoalesce(data.assets, () => ( {})),
|
|
8327
8329
|
problems,
|
|
8328
8330
|
smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
|
|
@@ -8340,7 +8342,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8340
8342
|
const light = data.globalLight;
|
|
8341
8343
|
if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
|
|
8342
8344
|
else delete s.globalLight;
|
|
8343
|
-
const patterns =
|
|
8345
|
+
const patterns = _chunkQCEQIRJQcjs.deserializePatterns.call(void 0, data.patterns, problems);
|
|
8344
8346
|
if (patterns.length) s.patterns = patterns;
|
|
8345
8347
|
else delete s.patterns;
|
|
8346
8348
|
if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
|
|
@@ -8356,7 +8358,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8356
8358
|
}
|
|
8357
8359
|
} else {
|
|
8358
8360
|
const { width, height } = this.naturalSize;
|
|
8359
|
-
const stack =
|
|
8361
|
+
const stack = _chunkQCEQIRJQcjs.layersFromLegacy.call(void 0, data, width, height);
|
|
8360
8362
|
s.layers = stack.layers;
|
|
8361
8363
|
s.outputOpacity = stack.outputOpacity;
|
|
8362
8364
|
if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
|
|
@@ -8377,7 +8379,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8377
8379
|
}
|
|
8378
8380
|
serializeState() {
|
|
8379
8381
|
const { width, height } = this.naturalSize;
|
|
8380
|
-
const view =
|
|
8382
|
+
const view = _chunkQCEQIRJQcjs.legacyView.call(void 0, this.stack(), width, height, null);
|
|
8381
8383
|
if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _330 => _330.state, 'access', _331 => _331.patterns, 'optionalAccess', _332 => _332.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
|
|
8382
8384
|
return {
|
|
8383
8385
|
// States without adjustment layers keep schema 1, so they round-trip unchanged.
|
|
@@ -8392,9 +8394,9 @@ var ImageEditorController = (_class7 = class {
|
|
|
8392
8394
|
annotations: JSON.parse(JSON.stringify(view.annotations))
|
|
8393
8395
|
};
|
|
8394
8396
|
}
|
|
8395
|
-
const { layers, assets, smartContents } =
|
|
8397
|
+
const { layers, assets, smartContents } = _chunkQCEQIRJQcjs.serializeLayers.call(void 0, this.state.layers);
|
|
8396
8398
|
const out = {
|
|
8397
|
-
version:
|
|
8399
|
+
version: _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION,
|
|
8398
8400
|
width,
|
|
8399
8401
|
height,
|
|
8400
8402
|
layers,
|
|
@@ -8406,7 +8408,7 @@ var ImageEditorController = (_class7 = class {
|
|
|
8406
8408
|
};
|
|
8407
8409
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
8408
8410
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
8409
|
-
if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns =
|
|
8411
|
+
if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunkQCEQIRJQcjs.serializePatterns.call(void 0, this.state.patterns);
|
|
8410
8412
|
if (smartContents) out.smartContents = smartContents;
|
|
8411
8413
|
if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
|
|
8412
8414
|
if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
|
|
@@ -8418,7 +8420,7 @@ function serializeAdjustments(adjustments) {
|
|
|
8418
8420
|
const out = { ...adjustments };
|
|
8419
8421
|
if (_optionalChain([out, 'access', _339 => _339.layers, 'optionalAccess', _340 => _340.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
8420
8422
|
else delete out.layers;
|
|
8421
|
-
if (
|
|
8423
|
+
if (_chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkQCEQIRJQcjs.LEGACY_PROCESS_VERSION) {
|
|
8422
8424
|
delete out.process;
|
|
8423
8425
|
if (!out.tint) delete out.tint;
|
|
8424
8426
|
}
|
|
@@ -8429,7 +8431,7 @@ function withDevelop(layer, partial) {
|
|
|
8429
8431
|
let i = filters.findIndex((f) => f.kind === "develop");
|
|
8430
8432
|
if (i === -1) {
|
|
8431
8433
|
filters.unshift({
|
|
8432
|
-
id: layer.source === "document" ?
|
|
8434
|
+
id: layer.source === "document" ? _chunkQCEQIRJQcjs.DEVELOP_FILTER_ID : _chunkQCEQIRJQcjs.newLayerId.call(void 0, "flt"),
|
|
8433
8435
|
kind: "develop",
|
|
8434
8436
|
enabled: true,
|
|
8435
8437
|
brightness: 0,
|
|
@@ -8438,7 +8440,7 @@ function withDevelop(layer, partial) {
|
|
|
8438
8440
|
exposure: 0,
|
|
8439
8441
|
temperature: 0,
|
|
8440
8442
|
tint: 0,
|
|
8441
|
-
process:
|
|
8443
|
+
process: _chunkQCEQIRJQcjs.LATEST_PROCESS_VERSION
|
|
8442
8444
|
});
|
|
8443
8445
|
i = 0;
|
|
8444
8446
|
}
|
|
@@ -8447,7 +8449,7 @@ function withDevelop(layer, partial) {
|
|
|
8447
8449
|
const v = partial[k];
|
|
8448
8450
|
if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
|
|
8449
8451
|
}
|
|
8450
|
-
if ("process" in partial) next.process =
|
|
8452
|
+
if ("process" in partial) next.process = _chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, partial.process);
|
|
8451
8453
|
filters[i] = next;
|
|
8452
8454
|
return { ...layer, filters };
|
|
8453
8455
|
}
|
|
@@ -8456,7 +8458,7 @@ function withBlur(layer, radius) {
|
|
|
8456
8458
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
8457
8459
|
if (radius > 0) {
|
|
8458
8460
|
filters.push({
|
|
8459
|
-
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ?
|
|
8461
|
+
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunkQCEQIRJQcjs.BLUR_FILTER_ID : _chunkQCEQIRJQcjs.newLayerId.call(void 0, "flt")))),
|
|
8460
8462
|
kind: "blur",
|
|
8461
8463
|
enabled: true,
|
|
8462
8464
|
radius
|
|
@@ -8480,7 +8482,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8480
8482
|
if (!update.mask) delete next.mask;
|
|
8481
8483
|
else {
|
|
8482
8484
|
const current = node.mask && !node.mask.source ? node.mask : null;
|
|
8483
|
-
const memo = current ?
|
|
8485
|
+
const memo = current ? _chunkQCEQIRJQcjs.legacyMaskOf.call(void 0, current, width, height) : null;
|
|
8484
8486
|
if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
|
|
8485
8487
|
next.mask = withMaskProps(current, {
|
|
8486
8488
|
density: _nullishCoalesce(update.mask.density, () => ( 1)),
|
|
@@ -8488,7 +8490,7 @@ function mergeAdjustmentNode(node, update, width, height) {
|
|
|
8488
8490
|
enabled: update.mask.enabled !== false
|
|
8489
8491
|
});
|
|
8490
8492
|
} else {
|
|
8491
|
-
const m =
|
|
8493
|
+
const m = _chunkQCEQIRJQcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
|
|
8492
8494
|
if (m) next.mask = m;
|
|
8493
8495
|
else delete next.mask;
|
|
8494
8496
|
}
|
|
@@ -8527,7 +8529,7 @@ function resizeLegacyMasks(layers, from, to) {
|
|
|
8527
8529
|
for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) {
|
|
8528
8530
|
if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
|
|
8529
8531
|
const old = l.mask;
|
|
8530
|
-
const mask =
|
|
8532
|
+
const mask = _chunkQCEQIRJQcjs.rasterMaskFromLegacy.call(void 0, _chunkQCEQIRJQcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
|
|
8531
8533
|
if (!mask) continue;
|
|
8532
8534
|
out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
|
|
8533
8535
|
}
|
|
@@ -8623,12 +8625,12 @@ function withoutAnnotations(layers) {
|
|
|
8623
8625
|
function parseColor(value) {
|
|
8624
8626
|
if (Array.isArray(value)) {
|
|
8625
8627
|
if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
|
|
8626
|
-
throw new (0,
|
|
8628
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
|
|
8627
8629
|
}
|
|
8628
8630
|
return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
|
|
8629
8631
|
}
|
|
8630
8632
|
const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
|
|
8631
|
-
if (!m) throw new (0,
|
|
8633
|
+
if (!m) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
|
|
8632
8634
|
let hex = m[1];
|
|
8633
8635
|
if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
|
|
8634
8636
|
const n = (i) => parseInt(hex.slice(i, i + 2), 16);
|
|
@@ -8638,7 +8640,7 @@ function readImagePaint(raw) {
|
|
|
8638
8640
|
try {
|
|
8639
8641
|
return _chunkLRRCMRSLcjs.parsePaintSource.call(void 0, raw);
|
|
8640
8642
|
} catch (e) {
|
|
8641
|
-
if (e instanceof _chunkLRRCMRSLcjs.PaintSourceError) throw new (0,
|
|
8643
|
+
if (e instanceof _chunkLRRCMRSLcjs.PaintSourceError) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(e.message);
|
|
8642
8644
|
throw e;
|
|
8643
8645
|
}
|
|
8644
8646
|
}
|
|
@@ -8786,7 +8788,7 @@ function loadImageEditorDocument(input) {
|
|
|
8786
8788
|
// Optional: only present when something was selected when saving.
|
|
8787
8789
|
selection: {
|
|
8788
8790
|
parse: (value) => {
|
|
8789
|
-
const mask =
|
|
8791
|
+
const mask = _chunkQCEQIRJQcjs.deserializeSelection.call(void 0, value);
|
|
8790
8792
|
const v = value;
|
|
8791
8793
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8792
8794
|
},
|
|
@@ -8874,7 +8876,7 @@ function loadLayeredDocument(doc) {
|
|
|
8874
8876
|
},
|
|
8875
8877
|
selection: {
|
|
8876
8878
|
parse: (value) => {
|
|
8877
|
-
const mask =
|
|
8879
|
+
const mask = _chunkQCEQIRJQcjs.deserializeSelection.call(void 0, value);
|
|
8878
8880
|
const v = value;
|
|
8879
8881
|
return { width: mask.width, height: mask.height, rle: v.rle };
|
|
8880
8882
|
},
|
|
@@ -9355,14 +9357,14 @@ function describeSelection(mask) {
|
|
|
9355
9357
|
// src/image-editor/selection-tools.ts
|
|
9356
9358
|
var modeSchema = {
|
|
9357
9359
|
type: "string",
|
|
9358
|
-
enum: [...
|
|
9360
|
+
enum: [..._chunkQCEQIRJQcjs.SELECTION_MODES],
|
|
9359
9361
|
description: "How the result combines with the current selection (default replace)."
|
|
9360
9362
|
};
|
|
9361
9363
|
var num2 = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
|
|
9362
9364
|
function summary(controller) {
|
|
9363
9365
|
const sel = controller.getSelection();
|
|
9364
9366
|
const { width, height } = controller.getState().imageDimensions;
|
|
9365
|
-
const area =
|
|
9367
|
+
const area = _chunkQCEQIRJQcjs.selectionArea.call(void 0, sel);
|
|
9366
9368
|
return {
|
|
9367
9369
|
empty: !sel,
|
|
9368
9370
|
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _356 => _356.bounds]), () => ( null)),
|
|
@@ -9408,7 +9410,7 @@ function createImageSelectionTools(controller) {
|
|
|
9408
9410
|
},
|
|
9409
9411
|
annotations: writeAnnotations("Select a region", true),
|
|
9410
9412
|
handler: ({ shape, x, y, width, height, mode, feather }) => {
|
|
9411
|
-
const opts = { mode:
|
|
9413
|
+
const opts = { mode: _chunkQCEQIRJQcjs.parseSelectionMode.call(void 0, mode), feather: num2(feather, 0) };
|
|
9412
9414
|
switch (shape) {
|
|
9413
9415
|
case "all":
|
|
9414
9416
|
controller.selectAll();
|
|
@@ -9461,7 +9463,7 @@ function createImageSelectionTools(controller) {
|
|
|
9461
9463
|
annotations: writeAnnotations("Select by colour", true),
|
|
9462
9464
|
handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
|
|
9463
9465
|
const common = {
|
|
9464
|
-
mode:
|
|
9466
|
+
mode: _chunkQCEQIRJQcjs.parseSelectionMode.call(void 0, mode),
|
|
9465
9467
|
sampleMerged: sampleMerged === true,
|
|
9466
9468
|
sample: _nullishCoalesce(sample, () => ( "composite"))
|
|
9467
9469
|
};
|
|
@@ -9482,7 +9484,7 @@ function createImageSelectionTools(controller) {
|
|
|
9482
9484
|
inputSchema: {
|
|
9483
9485
|
type: "object",
|
|
9484
9486
|
properties: {
|
|
9485
|
-
op: { type: "string", enum: [...
|
|
9487
|
+
op: { type: "string", enum: [..._chunkQCEQIRJQcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
|
|
9486
9488
|
radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
|
|
9487
9489
|
},
|
|
9488
9490
|
required: ["op", "radius"],
|
|
@@ -9490,7 +9492,7 @@ function createImageSelectionTools(controller) {
|
|
|
9490
9492
|
},
|
|
9491
9493
|
annotations: writeAnnotations("Modify the selection"),
|
|
9492
9494
|
handler: ({ op, radius }) => {
|
|
9493
|
-
if (!
|
|
9495
|
+
if (!_chunkQCEQIRJQcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
|
|
9494
9496
|
if (!controller.getSelection()) throw new Error("Nothing is selected.");
|
|
9495
9497
|
controller.modifySelection(op, Math.min(500, Math.max(0, num2(radius, 0))));
|
|
9496
9498
|
return summary(controller);
|
|
@@ -9534,7 +9536,7 @@ function createImageSelectionTools(controller) {
|
|
|
9534
9536
|
type: "object",
|
|
9535
9537
|
properties: {
|
|
9536
9538
|
layerId: { type: "string", description: "Existing adjustment layer to mask." },
|
|
9537
|
-
kind: { type: "string", enum:
|
|
9539
|
+
kind: { type: "string", enum: _chunkQCEQIRJQcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
|
|
9538
9540
|
params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
|
|
9539
9541
|
density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
|
|
9540
9542
|
feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
|
|
@@ -9554,11 +9556,11 @@ function createImageSelectionTools(controller) {
|
|
|
9554
9556
|
if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
|
|
9555
9557
|
controller.applySelectionAsLayerMask(layerId, props);
|
|
9556
9558
|
id = layerId;
|
|
9557
|
-
} else if (
|
|
9559
|
+
} else if (_chunkQCEQIRJQcjs.isAdjustmentKind.call(void 0, kind)) {
|
|
9558
9560
|
id = controller.addAdjustmentLayer({
|
|
9559
9561
|
kind,
|
|
9560
9562
|
params,
|
|
9561
|
-
mask:
|
|
9563
|
+
mask: _chunkQCEQIRJQcjs.layerMaskFromSelection.call(void 0, sel, props)
|
|
9562
9564
|
});
|
|
9563
9565
|
} else {
|
|
9564
9566
|
throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
|
|
@@ -9695,11 +9697,11 @@ function createImageEditTools(controller) {
|
|
|
9695
9697
|
const geometry2 = () => {
|
|
9696
9698
|
const s = controller.getState();
|
|
9697
9699
|
const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
|
|
9698
|
-
const out =
|
|
9700
|
+
const out = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
|
|
9699
9701
|
return {
|
|
9700
9702
|
image: { ...s.imageDimensions },
|
|
9701
9703
|
crop: s.crop ? { ...s.crop } : null,
|
|
9702
|
-
rotation:
|
|
9704
|
+
rotation: _chunkQCEQIRJQcjs.normalizeAngle.call(void 0, s.transform.rotate),
|
|
9703
9705
|
flipH: s.transform.flipH,
|
|
9704
9706
|
flipV: s.transform.flipV,
|
|
9705
9707
|
output: { width: Math.round(out.width), height: Math.round(out.height) }
|
|
@@ -9934,7 +9936,7 @@ function describeLayer(layer, activeId, boundsOf) {
|
|
|
9934
9936
|
const out = {
|
|
9935
9937
|
id: layer.id,
|
|
9936
9938
|
type: layer.type,
|
|
9937
|
-
name: layer.name || (layer.type === "adjustment" ?
|
|
9939
|
+
name: layer.name || (layer.type === "adjustment" ? _chunkQCEQIRJQcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
|
|
9938
9940
|
visible: layer.visible,
|
|
9939
9941
|
opacity: round3(layer.opacity),
|
|
9940
9942
|
blend: layer.blend,
|
|
@@ -10023,8 +10025,8 @@ function createImageLayerTools(controller) {
|
|
|
10023
10025
|
};
|
|
10024
10026
|
};
|
|
10025
10027
|
const exists = (id, what = "layerId") => {
|
|
10026
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10027
|
-
|
|
10028
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
|
|
10029
|
+
_chunkQCEQIRJQcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
10028
10030
|
return id;
|
|
10029
10031
|
};
|
|
10030
10032
|
const listLayers = {
|
|
@@ -10060,7 +10062,7 @@ function createImageLayerTools(controller) {
|
|
|
10060
10062
|
handler: ({ layerId, target }) => {
|
|
10061
10063
|
const id = exists(layerId);
|
|
10062
10064
|
const layer = controller.getLayer(id);
|
|
10063
|
-
if (target === "mask" && !layer.mask) throw new (0,
|
|
10065
|
+
if (target === "mask" && !layer.mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
|
|
10064
10066
|
controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
|
|
10065
10067
|
return { layer: describe(id), activeTarget: controller.getState().activeTarget };
|
|
10066
10068
|
}
|
|
@@ -10085,7 +10087,7 @@ function createImageLayerTools(controller) {
|
|
|
10085
10087
|
},
|
|
10086
10088
|
annotations: { title: "Add a pixel layer", ...WRITE2 },
|
|
10087
10089
|
handler: async (args) => {
|
|
10088
|
-
if (args.color !== void 0 && args.image !== void 0) throw new (0,
|
|
10090
|
+
if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give color or image, not both.");
|
|
10089
10091
|
for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
|
|
10090
10092
|
const init = {
|
|
10091
10093
|
name: args.name,
|
|
@@ -10175,7 +10177,7 @@ function createImageLayerTools(controller) {
|
|
|
10175
10177
|
const id = exists(args.layerId);
|
|
10176
10178
|
const props = {};
|
|
10177
10179
|
for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
|
|
10178
|
-
if (!Object.keys(props).length) throw new (0,
|
|
10180
|
+
if (!Object.keys(props).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one property to change.");
|
|
10179
10181
|
controller.setLayerProperties(id, props);
|
|
10180
10182
|
return { layer: describe(id) };
|
|
10181
10183
|
}
|
|
@@ -10269,8 +10271,8 @@ function createImageLayerTools(controller) {
|
|
|
10269
10271
|
annotations: { title: "Move a layer's pixels", ...WRITE2 },
|
|
10270
10272
|
handler: ({ layerId, x, y, dx, dy }) => {
|
|
10271
10273
|
const id = exists(layerId);
|
|
10272
|
-
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0,
|
|
10273
|
-
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0,
|
|
10274
|
+
if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give x and y, or dx and dy.");
|
|
10275
|
+
if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
|
|
10274
10276
|
return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
|
|
10275
10277
|
}
|
|
10276
10278
|
};
|
|
@@ -10342,7 +10344,7 @@ function createImageLayerTools(controller) {
|
|
|
10342
10344
|
annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
|
|
10343
10345
|
handler: ({ layerId, density, feather, enabled, linked }) => {
|
|
10344
10346
|
const id = exists(layerId);
|
|
10345
|
-
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0,
|
|
10347
|
+
if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give density, feather, enabled or linked.");
|
|
10346
10348
|
const mask = controller.setLayerMaskProps(id, {
|
|
10347
10349
|
density,
|
|
10348
10350
|
feather,
|
|
@@ -10425,7 +10427,7 @@ function createImageLayerTools(controller) {
|
|
|
10425
10427
|
handler: (args) => {
|
|
10426
10428
|
const id = exists(args.layerId);
|
|
10427
10429
|
const changes = filterValues(args);
|
|
10428
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10430
|
+
if (!Object.keys(changes).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one value to change.");
|
|
10429
10431
|
return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
|
|
10430
10432
|
}
|
|
10431
10433
|
};
|
|
@@ -10689,8 +10691,8 @@ function describeLayerEffects(effects) {
|
|
|
10689
10691
|
}
|
|
10690
10692
|
function createImageEffectTools(controller) {
|
|
10691
10693
|
const layerArg = (id) => {
|
|
10692
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
10693
|
-
|
|
10694
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
|
|
10695
|
+
_chunkQCEQIRJQcjs.requireLayer.call(void 0, controller.getLayers(), id);
|
|
10694
10696
|
return id;
|
|
10695
10697
|
};
|
|
10696
10698
|
const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
|
|
@@ -10721,7 +10723,7 @@ function createImageEffectTools(controller) {
|
|
|
10721
10723
|
annotations: { title: "Add a layer effect", ...WRITE3 },
|
|
10722
10724
|
handler: ({ layerId, kind, settings, index }) => {
|
|
10723
10725
|
const id = layerArg(layerId);
|
|
10724
|
-
if (!_chunkHGTDMKNEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0,
|
|
10726
|
+
if (!_chunkHGTDMKNEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`kind must be one of ${_chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
|
|
10725
10727
|
const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
|
|
10726
10728
|
return result(id, { effectId: effect.id });
|
|
10727
10729
|
}
|
|
@@ -10741,7 +10743,7 @@ function createImageEffectTools(controller) {
|
|
|
10741
10743
|
handler: ({ layerId, effectId, settings }) => {
|
|
10742
10744
|
const id = layerArg(layerId);
|
|
10743
10745
|
const changes = _nullishCoalesce(settings, () => ( {}));
|
|
10744
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
10746
|
+
if (!Object.keys(changes).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one setting to change.");
|
|
10745
10747
|
controller.updateLayerEffect(id, effectId, changes);
|
|
10746
10748
|
return result(id);
|
|
10747
10749
|
}
|
|
@@ -10793,7 +10795,7 @@ function createImageEffectTools(controller) {
|
|
|
10793
10795
|
},
|
|
10794
10796
|
annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
|
|
10795
10797
|
handler: ({ angle, altitude }) => {
|
|
10796
|
-
if (angle === void 0 && altitude === void 0) throw new (0,
|
|
10798
|
+
if (angle === void 0 && altitude === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give angle, altitude or both.");
|
|
10797
10799
|
const next = {};
|
|
10798
10800
|
if (angle !== void 0) next.angle = angle;
|
|
10799
10801
|
if (altitude !== void 0) next.altitude = altitude;
|
|
@@ -11006,7 +11008,7 @@ var PaintGesture = (_class8 = class {
|
|
|
11006
11008
|
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.`);
|
|
11007
11009
|
if (_optionalChain([layer, 'access', _370 => _370.locks, 'optionalAccess', _371 => _371.all]) || _optionalChain([layer, 'access', _372 => _372.locks, 'optionalAccess', _373 => _373.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
|
|
11008
11010
|
const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
|
|
11009
|
-
const b =
|
|
11011
|
+
const b = _chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, layer);
|
|
11010
11012
|
return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
|
|
11011
11013
|
})();
|
|
11012
11014
|
this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
|
|
@@ -11164,9 +11166,9 @@ function createImagePaintTools(controller) {
|
|
|
11164
11166
|
annotations: { title: "Paint a brush stroke", ...WRITE4 },
|
|
11165
11167
|
handler: (args) => {
|
|
11166
11168
|
const tool = args.tool;
|
|
11167
|
-
if (args.mixer !== void 0 && tool !== "mixer") throw new (0,
|
|
11168
|
-
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0,
|
|
11169
|
-
if (args.paint !== void 0 && args.color !== void 0) throw new (0,
|
|
11169
|
+
if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
|
|
11170
|
+
if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
|
|
11171
|
+
if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give color or paint, not both.");
|
|
11170
11172
|
const result = controller.paintStroke({
|
|
11171
11173
|
tool,
|
|
11172
11174
|
points: args.points,
|
|
@@ -11284,11 +11286,11 @@ function createImagePaintTools(controller) {
|
|
|
11284
11286
|
var READ5 = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
|
|
11285
11287
|
var PROFILE = {
|
|
11286
11288
|
type: "string",
|
|
11287
|
-
description: `A built-in profile id (${
|
|
11289
|
+
description: `A built-in profile id (${_chunkBROJYMWUcjs.BUILTIN_PROFILES.map((b) => b.id).join(", ")}; names like "Adobe RGB (1998)" work too), or "icc:<base64>" for ICC profile bytes.`
|
|
11288
11290
|
};
|
|
11289
11291
|
var INTENT = {
|
|
11290
11292
|
type: "string",
|
|
11291
|
-
enum: [...
|
|
11293
|
+
enum: [..._chunkBROJYMWUcjs.INTENTS],
|
|
11292
11294
|
description: "Rendering intent (default relative): relative (colorimetric, white to white, clips out-of-gamut colours: best for most photos), perceptual (compresses the whole gamut smoothly), saturation (keeps colours vivid, for graphics), absolute (keeps the source white too: for proofing a paper colour)."
|
|
11293
11295
|
};
|
|
11294
11296
|
function profileArg(v) {
|
|
@@ -11297,7 +11299,7 @@ function profileArg(v) {
|
|
|
11297
11299
|
try {
|
|
11298
11300
|
return _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, s.slice(4));
|
|
11299
11301
|
} catch (e30) {
|
|
11300
|
-
throw new (0,
|
|
11302
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The icc: value is not valid base64.");
|
|
11301
11303
|
}
|
|
11302
11304
|
}
|
|
11303
11305
|
return s;
|
|
@@ -11314,7 +11316,7 @@ function createImageColorTools(controller) {
|
|
|
11314
11316
|
return {
|
|
11315
11317
|
profile: controller.getColorProfile(),
|
|
11316
11318
|
proof: proof2 ? { profile: proof2.profile.name, builtin: _nullishCoalesce(proof2.profile.builtin, () => ( null)), intent: proof2.intent, bpc: proof2.bpc, simulatePaper: proof2.simulatePaper, gamutWarning: proof2.gamutWarning } : null,
|
|
11317
|
-
builtins:
|
|
11319
|
+
builtins: _chunkBROJYMWUcjs.BUILTIN_PROFILES.map((b) => ({ ...b }))
|
|
11318
11320
|
};
|
|
11319
11321
|
}
|
|
11320
11322
|
};
|
|
@@ -11362,10 +11364,10 @@ function createImageColorTools(controller) {
|
|
|
11362
11364
|
annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11363
11365
|
handler: (args) => {
|
|
11364
11366
|
if (args.off === true) {
|
|
11365
|
-
if (args.profile !== void 0) throw new (0,
|
|
11367
|
+
if (args.profile !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give either off true or a profile, not both.");
|
|
11366
11368
|
return controller.setProofSetup(null);
|
|
11367
11369
|
}
|
|
11368
|
-
if (args.profile === void 0) throw new (0,
|
|
11370
|
+
if (args.profile === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
|
|
11369
11371
|
const s = controller.setProofSetup({
|
|
11370
11372
|
profile: profileArg(args.profile),
|
|
11371
11373
|
...args.intent !== void 0 ? { intent: args.intent } : {},
|
|
@@ -11417,7 +11419,7 @@ function createImageColorTools(controller) {
|
|
|
11417
11419
|
},
|
|
11418
11420
|
annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
|
|
11419
11421
|
handler: (args) => {
|
|
11420
|
-
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0,
|
|
11422
|
+
if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
|
|
11421
11423
|
return controller.setColorMode(args.mode, {
|
|
11422
11424
|
...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
|
|
11423
11425
|
...args.intent !== void 0 ? { intent: args.intent } : {}
|
|
@@ -11482,7 +11484,7 @@ function checkSource(controller, source) {
|
|
|
11482
11484
|
const p = source;
|
|
11483
11485
|
const { width, height } = controller.getState().imageDimensions;
|
|
11484
11486
|
if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
|
|
11485
|
-
throw new (0,
|
|
11487
|
+
throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
|
|
11486
11488
|
}
|
|
11487
11489
|
return p;
|
|
11488
11490
|
}
|
|
@@ -11722,10 +11724,10 @@ function createImageRetouchTools(controller) {
|
|
|
11722
11724
|
annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
|
|
11723
11725
|
handler: (args) => {
|
|
11724
11726
|
if (args.clear === true) {
|
|
11725
|
-
if (args.x !== void 0 || args.y !== void 0) throw new (0,
|
|
11727
|
+
if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give either clear true or x and y, not both.");
|
|
11726
11728
|
return controller.setCloneSource(null);
|
|
11727
11729
|
}
|
|
11728
|
-
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0,
|
|
11730
|
+
if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
|
|
11729
11731
|
return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
|
|
11730
11732
|
}
|
|
11731
11733
|
};
|
|
@@ -11748,7 +11750,7 @@ function createImageRetouchTools(controller) {
|
|
|
11748
11750
|
annotations: { title: "Transform the clone source", ...WRITE5, idempotentHint: false },
|
|
11749
11751
|
handler: (args) => {
|
|
11750
11752
|
if (args.reset === true) {
|
|
11751
|
-
if (Object.keys(args).some((k) => k !== "reset")) throw new (0,
|
|
11753
|
+
if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give either reset true or transform values, not both.");
|
|
11752
11754
|
return controller.setCloneTransform(null);
|
|
11753
11755
|
}
|
|
11754
11756
|
const cur = controller.getState().paint.cloneTransform;
|
|
@@ -11758,7 +11760,7 @@ function createImageRetouchTools(controller) {
|
|
|
11758
11760
|
if (args.rotate !== void 0) next.rotate = args.rotate;
|
|
11759
11761
|
if (args.flipHorizontal === true) next.scaleX = -(_nullishCoalesce(next.scaleX, () => ( cur.scaleX)));
|
|
11760
11762
|
if (args.flipVertical === true) next.scaleY = -(_nullishCoalesce(next.scaleY, () => ( cur.scaleY)));
|
|
11761
|
-
if (!Object.keys(next).length) throw new (0,
|
|
11763
|
+
if (!Object.keys(next).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
|
|
11762
11764
|
return controller.setCloneTransform(next);
|
|
11763
11765
|
}
|
|
11764
11766
|
};
|
|
@@ -11779,11 +11781,11 @@ var DATA = {
|
|
|
11779
11781
|
description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
|
|
11780
11782
|
};
|
|
11781
11783
|
function psdBytesFromBase64(data) {
|
|
11782
|
-
if (typeof data !== "string" || !data.trim()) throw new (0,
|
|
11784
|
+
if (typeof data !== "string" || !data.trim()) throw new (0, _chunkQCEQIRJQcjs.PsdError)("data is required: the PSD file as base64.");
|
|
11783
11785
|
const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
|
|
11784
|
-
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0,
|
|
11786
|
+
if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkQCEQIRJQcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
|
|
11785
11787
|
const bytes = _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, body);
|
|
11786
|
-
if (bytes.length < 26) throw new (0,
|
|
11788
|
+
if (bytes.length < 26) throw new (0, _chunkQCEQIRJQcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
|
|
11787
11789
|
return bytes;
|
|
11788
11790
|
}
|
|
11789
11791
|
function createImagePsdTools(controller) {
|
|
@@ -11794,7 +11796,7 @@ function createImagePsdTools(controller) {
|
|
|
11794
11796
|
inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
|
|
11795
11797
|
annotations: { title: "Inspect a PSD", ...READ7 },
|
|
11796
11798
|
handler: ({ data }) => {
|
|
11797
|
-
const res =
|
|
11799
|
+
const res = _chunkQCEQIRJQcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
|
|
11798
11800
|
return {
|
|
11799
11801
|
width: res.width,
|
|
11800
11802
|
height: res.height,
|
|
@@ -11881,7 +11883,7 @@ var GEOMETRY = {
|
|
|
11881
11883
|
dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
|
|
11882
11884
|
reference: {
|
|
11883
11885
|
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}.",
|
|
11884
|
-
anyOf: [{ type: "string", enum:
|
|
11886
|
+
anyOf: [{ type: "string", enum: _chunkQCEQIRJQcjs.TRANSFORM_ANCHORS }, POINT]
|
|
11885
11887
|
},
|
|
11886
11888
|
matrix: {
|
|
11887
11889
|
type: "array",
|
|
@@ -11902,14 +11904,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
|
|
|
11902
11904
|
function geometryFrom(args) {
|
|
11903
11905
|
const numeric = NUMERIC.filter((k) => args[k] !== void 0);
|
|
11904
11906
|
const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
|
|
11905
|
-
if (ways === 0) throw new (0,
|
|
11906
|
-
if (ways > 1) throw new (0,
|
|
11907
|
+
if (ways === 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
|
|
11908
|
+
if (ways > 1) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
|
|
11907
11909
|
if (args.matrix !== void 0) return { matrix: args.matrix };
|
|
11908
11910
|
if (args.corners !== void 0) return { corners: args.corners };
|
|
11909
11911
|
const params = {};
|
|
11910
11912
|
for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
|
|
11911
|
-
if (params.scaleX === 0 || params.scaleY === 0) throw new (0,
|
|
11912
|
-
if (typeof params.reference === "string" && !
|
|
11913
|
+
if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
|
|
11914
|
+
if (typeof params.reference === "string" && !_chunkQCEQIRJQcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkQCEQIRJQcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
|
|
11913
11915
|
return { params };
|
|
11914
11916
|
}
|
|
11915
11917
|
function targetFrom(args) {
|
|
@@ -11958,15 +11960,15 @@ function createImageTransformTools(controller) {
|
|
|
11958
11960
|
moved: [...s.moves],
|
|
11959
11961
|
frame: { ...s.box },
|
|
11960
11962
|
corners: s.startGeometry.corners.map(roundPoint),
|
|
11961
|
-
center: roundPoint(
|
|
11963
|
+
center: roundPoint(_chunkQCEQIRJQcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
|
|
11962
11964
|
};
|
|
11963
11965
|
if (s.smartObject) out.smartObject = true;
|
|
11964
11966
|
s.cancel();
|
|
11965
11967
|
if (args.meshColumns !== void 0) {
|
|
11966
11968
|
const cols = args.meshColumns;
|
|
11967
11969
|
const rows = _nullishCoalesce(args.meshRows, () => ( cols));
|
|
11968
|
-
const mesh =
|
|
11969
|
-
out.mesh = { columns: cols, rows, pointsPerRow:
|
|
11970
|
+
const mesh = _chunkRHXW4TA5cjs.identityWarpMesh.call(void 0, s.box, cols, rows);
|
|
11971
|
+
out.mesh = { columns: cols, rows, pointsPerRow: _chunkRHXW4TA5cjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkRHXW4TA5cjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
|
|
11970
11972
|
}
|
|
11971
11973
|
return out;
|
|
11972
11974
|
}
|
|
@@ -11991,7 +11993,7 @@ function createImageTransformTools(controller) {
|
|
|
11991
11993
|
type: "object",
|
|
11992
11994
|
properties: {
|
|
11993
11995
|
...TARGET3,
|
|
11994
|
-
style: { type: "string", enum:
|
|
11996
|
+
style: { type: "string", enum: _chunkRHXW4TA5cjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
|
|
11995
11997
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
|
|
11996
11998
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
|
|
11997
11999
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
|
|
@@ -12013,11 +12015,11 @@ function createImageTransformTools(controller) {
|
|
|
12013
12015
|
annotations: { title: "Warp a layer", ...WRITE6 },
|
|
12014
12016
|
handler: (args) => {
|
|
12015
12017
|
const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
|
|
12016
|
-
if (hasPreset && args.mesh !== void 0) throw new (0,
|
|
12017
|
-
if (!hasPreset && args.mesh === void 0) throw new (0,
|
|
12018
|
+
if (hasPreset && args.mesh !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
|
|
12019
|
+
if (!hasPreset && args.mesh === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give a preset style or a mesh.");
|
|
12018
12020
|
let warp;
|
|
12019
12021
|
if (hasPreset) {
|
|
12020
|
-
if (args.style === void 0) throw new (0,
|
|
12022
|
+
if (args.style === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkRHXW4TA5cjs.WARP_STYLES.join(", ")}.`);
|
|
12021
12023
|
warp = {
|
|
12022
12024
|
style: args.style,
|
|
12023
12025
|
bend: _nullishCoalesce(args.bend, () => ( 50)),
|
|
@@ -12028,7 +12030,7 @@ function createImageTransformTools(controller) {
|
|
|
12028
12030
|
} else {
|
|
12029
12031
|
const m = args.mesh;
|
|
12030
12032
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
12031
|
-
if (m.points.length !== want) throw new (0,
|
|
12033
|
+
if (m.points.length !== want) throw new (0, _chunkQCEQIRJQcjs.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}.`);
|
|
12032
12034
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
12033
12035
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
12034
12036
|
}
|
|
@@ -12123,13 +12125,13 @@ function settingsFrom(args) {
|
|
|
12123
12125
|
return out;
|
|
12124
12126
|
}
|
|
12125
12127
|
function imageArg(image) {
|
|
12126
|
-
if (typeof image !== "string" || !image.trim()) throw new (0,
|
|
12128
|
+
if (typeof image !== "string" || !image.trim()) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
|
|
12127
12129
|
return image.trim();
|
|
12128
12130
|
}
|
|
12129
12131
|
function createImageSmartObjectTools(controller) {
|
|
12130
12132
|
const smartId = (id) => {
|
|
12131
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12132
|
-
|
|
12133
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
|
|
12134
|
+
_chunkQCEQIRJQcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
|
|
12133
12135
|
return id;
|
|
12134
12136
|
};
|
|
12135
12137
|
const info = (id) => {
|
|
@@ -12166,7 +12168,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
12166
12168
|
},
|
|
12167
12169
|
annotations: { title: "Convert to Smart Object", ...WRITE7 },
|
|
12168
12170
|
handler: ({ layerIds, name }) => {
|
|
12169
|
-
for (const id2 of _nullishCoalesce(layerIds, () => ( [])))
|
|
12171
|
+
for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkQCEQIRJQcjs.requireLayer.call(void 0, controller.getLayers(), id2);
|
|
12170
12172
|
const id = controller.convertToSmartObject(layerIds, { name });
|
|
12171
12173
|
return { layer: layerSummary(id), smartObject: info(id) };
|
|
12172
12174
|
}
|
|
@@ -12203,7 +12205,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
12203
12205
|
{
|
|
12204
12206
|
type: "object",
|
|
12205
12207
|
properties: {
|
|
12206
|
-
style: { type: "string", enum:
|
|
12208
|
+
style: { type: "string", enum: _chunkRHXW4TA5cjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
|
|
12207
12209
|
bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
|
|
12208
12210
|
horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
|
|
12209
12211
|
vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
|
|
@@ -12239,12 +12241,12 @@ function createImageSmartObjectTools(controller) {
|
|
|
12239
12241
|
else if (w) {
|
|
12240
12242
|
const m = w;
|
|
12241
12243
|
const want = (3 * m.columns + 1) * (3 * m.rows + 1);
|
|
12242
|
-
if (m.points.length !== want) throw new (0,
|
|
12244
|
+
if (m.points.length !== want) throw new (0, _chunkQCEQIRJQcjs.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}.`);
|
|
12243
12245
|
const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
|
|
12244
12246
|
warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
|
|
12245
12247
|
}
|
|
12246
12248
|
const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
|
|
12247
|
-
if (!keys.some((k) => args[k] !== void 0)) throw new (0,
|
|
12249
|
+
if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
|
|
12248
12250
|
const res = controller.setSmartObjectTransform(id, {
|
|
12249
12251
|
corners: args.corners,
|
|
12250
12252
|
matrix: args.matrix,
|
|
@@ -12369,7 +12371,7 @@ function createImageSmartObjectTools(controller) {
|
|
|
12369
12371
|
handler: (args) => {
|
|
12370
12372
|
const id = smartId(args.layerId);
|
|
12371
12373
|
const changes = settingsFrom(args);
|
|
12372
|
-
if (!Object.keys(changes).length) throw new (0,
|
|
12374
|
+
if (!Object.keys(changes).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one value to change.");
|
|
12373
12375
|
const filter = controller.updateSmartFilter(id, args.filterId, changes);
|
|
12374
12376
|
return { layerId: id, filter, smartFilters: info(id).smartFilters };
|
|
12375
12377
|
}
|
|
@@ -12690,8 +12692,8 @@ function geometry(args) {
|
|
|
12690
12692
|
}
|
|
12691
12693
|
function createImageShapeTools(controller) {
|
|
12692
12694
|
const shapeId = (id) => {
|
|
12693
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12694
|
-
|
|
12695
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
|
|
12696
|
+
_chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
|
|
12695
12697
|
return id;
|
|
12696
12698
|
};
|
|
12697
12699
|
const layerSummary = (id) => {
|
|
@@ -12766,7 +12768,7 @@ function createImageShapeTools(controller) {
|
|
|
12766
12768
|
annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
|
|
12767
12769
|
handler: ({ layerId, fill, stroke, fillRule }) => {
|
|
12768
12770
|
const id = shapeId(layerId);
|
|
12769
|
-
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0,
|
|
12771
|
+
if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
|
|
12770
12772
|
return controller.setShapeStyle(id, { fill, stroke, fillRule });
|
|
12771
12773
|
}
|
|
12772
12774
|
};
|
|
@@ -12815,7 +12817,7 @@ function createImageShapeTools(controller) {
|
|
|
12815
12817
|
handler: ({ layerId, componentIndex, ...rest }) => {
|
|
12816
12818
|
const id = shapeId(layerId);
|
|
12817
12819
|
const change = geometry(rest);
|
|
12818
|
-
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0,
|
|
12820
|
+
if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give shape, subpaths or op to change.");
|
|
12819
12821
|
return controller.setShapeComponent(id, componentIndex, change);
|
|
12820
12822
|
}
|
|
12821
12823
|
};
|
|
@@ -12889,8 +12891,8 @@ function pick2(args, keys) {
|
|
|
12889
12891
|
}
|
|
12890
12892
|
function createImageTypeTools(controller) {
|
|
12891
12893
|
const typeId = (id) => {
|
|
12892
|
-
if (typeof id !== "string" || !id) throw new (0,
|
|
12893
|
-
|
|
12894
|
+
if (typeof id !== "string" || !id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
|
|
12895
|
+
_chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
|
|
12894
12896
|
return id;
|
|
12895
12897
|
};
|
|
12896
12898
|
const layerSummary = (id) => {
|
|
@@ -12970,7 +12972,7 @@ function createImageTypeTools(controller) {
|
|
|
12970
12972
|
annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
|
|
12971
12973
|
handler: (args) => {
|
|
12972
12974
|
const style = pick2(args, Object.keys(STYLE));
|
|
12973
|
-
if (!Object.keys(style).length) throw new (0,
|
|
12975
|
+
if (!Object.keys(style).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
|
|
12974
12976
|
return controller.setTextStyle(typeId(args.layerId), style, range(args));
|
|
12975
12977
|
}
|
|
12976
12978
|
};
|
|
@@ -12982,7 +12984,7 @@ function createImageTypeTools(controller) {
|
|
|
12982
12984
|
annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
|
|
12983
12985
|
handler: (args) => {
|
|
12984
12986
|
const style = pick2(args, Object.keys(PARAGRAPH));
|
|
12985
|
-
if (!Object.keys(style).length) throw new (0,
|
|
12987
|
+
if (!Object.keys(style).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
|
|
12986
12988
|
return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
|
|
12987
12989
|
}
|
|
12988
12990
|
};
|
|
@@ -13004,7 +13006,7 @@ function createImageTypeTools(controller) {
|
|
|
13004
13006
|
annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
|
|
13005
13007
|
handler: ({ layerId, kind, width, height }) => {
|
|
13006
13008
|
const id = typeId(layerId);
|
|
13007
|
-
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0,
|
|
13009
|
+
if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("kind box needs width and height in pixels.");
|
|
13008
13010
|
return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
|
|
13009
13011
|
}
|
|
13010
13012
|
};
|
|
@@ -13026,7 +13028,7 @@ function createImageTypeTools(controller) {
|
|
|
13026
13028
|
var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
|
|
13027
13029
|
function adjustmentsSummary(adjustments) {
|
|
13028
13030
|
return {
|
|
13029
|
-
process:
|
|
13031
|
+
process: _chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, adjustments.process),
|
|
13030
13032
|
values: readAdjustmentControls(adjustments),
|
|
13031
13033
|
layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
|
|
13032
13034
|
};
|
|
@@ -13069,7 +13071,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13069
13071
|
default: def,
|
|
13070
13072
|
...requiresProcess ? { requiresProcess } : {}
|
|
13071
13073
|
})),
|
|
13072
|
-
layerKinds:
|
|
13074
|
+
layerKinds: _chunkQCEQIRJQcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
|
|
13073
13075
|
kind,
|
|
13074
13076
|
label,
|
|
13075
13077
|
controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
|
|
@@ -13155,7 +13157,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13155
13157
|
const result = { applied, clamped };
|
|
13156
13158
|
if (typeof label === "string" && label) result.label = label;
|
|
13157
13159
|
const notes = [];
|
|
13158
|
-
if ("tint" in applied &&
|
|
13160
|
+
if ("tint" in applied && _chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
|
|
13159
13161
|
notes.push("Tint has no effect on process 1 edits.");
|
|
13160
13162
|
}
|
|
13161
13163
|
if (notes.length) result.notes = notes;
|
|
@@ -13165,11 +13167,11 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13165
13167
|
const addLayer = {
|
|
13166
13168
|
name: "add_adjustment_layer",
|
|
13167
13169
|
title: "Add an adjustment layer",
|
|
13168
|
-
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " +
|
|
13170
|
+
description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkQCEQIRJQcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
|
|
13169
13171
|
inputSchema: {
|
|
13170
13172
|
type: "object",
|
|
13171
13173
|
properties: {
|
|
13172
|
-
kind: { type: "string", enum:
|
|
13174
|
+
kind: { type: "string", enum: _chunkQCEQIRJQcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
|
|
13173
13175
|
params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
|
|
13174
13176
|
opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
|
|
13175
13177
|
blend: { type: "string", enum: _chunkCWM3CUUXcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
|
|
@@ -13188,7 +13190,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
13188
13190
|
openWorldHint: false
|
|
13189
13191
|
},
|
|
13190
13192
|
handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
|
|
13191
|
-
if (!
|
|
13193
|
+
if (!_chunkQCEQIRJQcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
|
|
13192
13194
|
if (blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
|
|
13193
13195
|
if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
|
|
13194
13196
|
for (const ref of [aboveId, parentId]) {
|
|
@@ -13285,7 +13287,7 @@ function boxToCurvePoint(x, y, width, height) {
|
|
|
13285
13287
|
return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
|
|
13286
13288
|
}
|
|
13287
13289
|
function curveSvgPath(points, width, height, samples = 64) {
|
|
13288
|
-
const lut =
|
|
13290
|
+
const lut = _chunkQCEQIRJQcjs.curveLutFromLevels.call(void 0, points);
|
|
13289
13291
|
const n = lut.length - 1;
|
|
13290
13292
|
let d = "";
|
|
13291
13293
|
for (let i = 0; i <= samples; i++) {
|
|
@@ -13795,7 +13797,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13795
13797
|
else {
|
|
13796
13798
|
const layout = this.layout();
|
|
13797
13799
|
if (layout && layout.lines.length) {
|
|
13798
|
-
const c =
|
|
13800
|
+
const c = _chunkRHXW4TA5cjs.caretAt.call(void 0, layout, f);
|
|
13799
13801
|
const line = layout.lines[c.line];
|
|
13800
13802
|
if (to === "home") f = line.start;
|
|
13801
13803
|
else if (to === "end") {
|
|
@@ -13890,7 +13892,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13890
13892
|
styleHere() {
|
|
13891
13893
|
const layer = this.layer;
|
|
13892
13894
|
const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
|
|
13893
|
-
return
|
|
13895
|
+
return _chunkRHXW4TA5cjs.styleAt.call(void 0, layer.runs, at, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE);
|
|
13894
13896
|
}
|
|
13895
13897
|
info() {
|
|
13896
13898
|
return this.controller.getTextLayer(this.layerId);
|
|
@@ -13899,8 +13901,8 @@ var TextEditSession = (_class11 = class {
|
|
|
13899
13901
|
overlay() {
|
|
13900
13902
|
const layer = this.layer;
|
|
13901
13903
|
const layout = this.layout();
|
|
13902
|
-
const m =
|
|
13903
|
-
const at = (x, y) =>
|
|
13904
|
+
const m = _chunkQCEQIRJQcjs.textMatrix.call(void 0, layer);
|
|
13905
|
+
const at = (x, y) => _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, { x, y });
|
|
13904
13906
|
let frame = null;
|
|
13905
13907
|
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)];
|
|
13906
13908
|
else if (layout) {
|
|
@@ -13920,7 +13922,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13920
13922
|
selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
|
|
13921
13923
|
}
|
|
13922
13924
|
}
|
|
13923
|
-
const c =
|
|
13925
|
+
const c = _chunkRHXW4TA5cjs.caretAt.call(void 0, layout, this.focus);
|
|
13924
13926
|
return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
|
|
13925
13927
|
}
|
|
13926
13928
|
/** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
|
|
@@ -13935,7 +13937,7 @@ var TextEditSession = (_class11 = class {
|
|
|
13935
13937
|
}
|
|
13936
13938
|
if (this.layer.name === "Text" && this.changed) {
|
|
13937
13939
|
try {
|
|
13938
|
-
this.controller.setLayerProperties(this.layerId, { name:
|
|
13940
|
+
this.controller.setLayerProperties(this.layerId, { name: _chunkQCEQIRJQcjs.typeLayerName.call(void 0, this.text) }, false);
|
|
13939
13941
|
} catch (e32) {
|
|
13940
13942
|
}
|
|
13941
13943
|
}
|
|
@@ -13946,8 +13948,8 @@ function typeLayerAt(controller, p, slop = 4) {
|
|
|
13946
13948
|
const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
|
|
13947
13949
|
for (const l of layers) {
|
|
13948
13950
|
if (!l.visible) continue;
|
|
13949
|
-
const inv = invert(
|
|
13950
|
-
const q =
|
|
13951
|
+
const inv = invert(_chunkQCEQIRJQcjs.textMatrix.call(void 0, l));
|
|
13952
|
+
const q = _chunkRHXW4TA5cjs.applyMatrix.call(void 0, inv, p);
|
|
13951
13953
|
let b = null;
|
|
13952
13954
|
if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
|
|
13953
13955
|
else {
|
|
@@ -14057,7 +14059,7 @@ function layerPanelRows(layers, activeId) {
|
|
|
14057
14059
|
}
|
|
14058
14060
|
function layerLabel(layer) {
|
|
14059
14061
|
if (layer.name) return layer.name;
|
|
14060
|
-
if (layer.type === "adjustment") return
|
|
14062
|
+
if (layer.type === "adjustment") return _chunkQCEQIRJQcjs.adjustmentKindLabel.call(void 0, layer.kind);
|
|
14061
14063
|
return layer.type === "group" ? "Group" : "Layer";
|
|
14062
14064
|
}
|
|
14063
14065
|
function layerBadge(layer) {
|
|
@@ -14444,8 +14446,8 @@ function effectControlChange(effect, key, value, patterns = []) {
|
|
|
14444
14446
|
}
|
|
14445
14447
|
|
|
14446
14448
|
// src/image-editor/layers/color-ui.ts
|
|
14447
|
-
var WORKING_SPACE_OPTIONS =
|
|
14448
|
-
var PROOF_PROFILE_OPTIONS =
|
|
14449
|
+
var WORKING_SPACE_OPTIONS = _chunkBROJYMWUcjs.BUILTIN_PROFILES.filter((b) => b.colorSpace === "rgb").map((b) => ({ id: b.id, label: b.description }));
|
|
14450
|
+
var PROOF_PROFILE_OPTIONS = _chunkBROJYMWUcjs.BUILTIN_PROFILES.map((b) => ({ id: b.id, label: b.description }));
|
|
14449
14451
|
var INTENT_OPTIONS = [
|
|
14450
14452
|
{ id: "relative", label: "Relative Colorimetric", title: "Keep in-gamut colours exact, clip the rest (photos)" },
|
|
14451
14453
|
{ id: "perceptual", label: "Perceptual", title: "Compress the whole gamut smoothly" },
|
|
@@ -14529,7 +14531,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
|
|
|
14529
14531
|
];
|
|
14530
14532
|
var WARP_STYLE_OPTIONS = [
|
|
14531
14533
|
{ id: "custom", label: "Custom" },
|
|
14532
|
-
...
|
|
14534
|
+
..._chunkRHXW4TA5cjs.WARP_STYLES.map((id) => ({ id, label: _chunkRHXW4TA5cjs.WARP_STYLE_LABELS[id] }))
|
|
14533
14535
|
];
|
|
14534
14536
|
var WARP_GRID_OPTIONS = [
|
|
14535
14537
|
{ id: "1x1", label: "Default", columns: 1, rows: 1 },
|
|
@@ -14665,7 +14667,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14665
14667
|
setMode(mode) {
|
|
14666
14668
|
this.modeValue = mode;
|
|
14667
14669
|
const s = this.session;
|
|
14668
|
-
if (mode === "warp" && s && !this.mesh) this.mesh =
|
|
14670
|
+
if (mode === "warp" && s && !this.mesh) this.mesh = _chunkRHXW4TA5cjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
|
|
14669
14671
|
this.changed();
|
|
14670
14672
|
}
|
|
14671
14673
|
/** The Warp options bar's settings. */
|
|
@@ -14687,13 +14689,13 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14687
14689
|
this.modeValue = "warp";
|
|
14688
14690
|
const next = { ...this.warpSettings, ...changes };
|
|
14689
14691
|
this.warpSettings = next;
|
|
14690
|
-
let mesh = _nullishCoalesce(this.mesh, () => (
|
|
14692
|
+
let mesh = _nullishCoalesce(this.mesh, () => ( _chunkRHXW4TA5cjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
|
|
14691
14693
|
if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
|
|
14692
14694
|
const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
|
|
14693
|
-
mesh = _nullishCoalesce(
|
|
14694
|
-
mesh =
|
|
14695
|
+
mesh = _nullishCoalesce(_chunkRHXW4TA5cjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkRHXW4TA5cjs.identityWarpMesh.call(void 0, s.box)));
|
|
14696
|
+
mesh = _chunkRHXW4TA5cjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14695
14697
|
}
|
|
14696
|
-
if ("columns" in changes || "rows" in changes) mesh =
|
|
14698
|
+
if ("columns" in changes || "rows" in changes) mesh = _chunkRHXW4TA5cjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
14697
14699
|
this.mesh = mesh;
|
|
14698
14700
|
this.changed();
|
|
14699
14701
|
this.preview();
|
|
@@ -14740,11 +14742,11 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14740
14742
|
const m = this.mesh;
|
|
14741
14743
|
const at = (p) => _nullishCoalesce(_chunkQT26RHKKcjs.applyHomography.call(void 0, h, p), () => ( p));
|
|
14742
14744
|
const pts = m.points.map(at);
|
|
14743
|
-
const edit =
|
|
14745
|
+
const edit = _chunkRHXW4TA5cjs.warpMeshEditPoints.call(void 0, m);
|
|
14744
14746
|
out.handles = [];
|
|
14745
|
-
out.outline =
|
|
14747
|
+
out.outline = _chunkRHXW4TA5cjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
|
|
14746
14748
|
out.warp = {
|
|
14747
|
-
curves:
|
|
14749
|
+
curves: _chunkRHXW4TA5cjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
|
|
14748
14750
|
anchors: edit.anchors.map((i) => pts[i]),
|
|
14749
14751
|
handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
|
|
14750
14752
|
};
|
|
@@ -14768,7 +14770,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14768
14770
|
if (!o) return null;
|
|
14769
14771
|
if (this.modeValue === "warp" && this.mesh) {
|
|
14770
14772
|
const h = this.homography();
|
|
14771
|
-
const edit =
|
|
14773
|
+
const edit = _chunkRHXW4TA5cjs.warpMeshEditPoints.call(void 0, this.mesh);
|
|
14772
14774
|
let best2 = -1;
|
|
14773
14775
|
let bestD2 = tolerance;
|
|
14774
14776
|
for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
|
|
@@ -14813,7 +14815,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14813
14815
|
if (this.modeValue === "warp" && this.mesh && handle === "inside") {
|
|
14814
14816
|
const q = this.toFrame(p, this.corners);
|
|
14815
14817
|
if (q) {
|
|
14816
|
-
const r =
|
|
14818
|
+
const r = _chunkRHXW4TA5cjs.warpMeshParamAt.call(void 0, this.mesh, q);
|
|
14817
14819
|
st = { s: r.s, t: r.t };
|
|
14818
14820
|
}
|
|
14819
14821
|
}
|
|
@@ -14846,8 +14848,8 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14846
14848
|
if (!a || !b) return;
|
|
14847
14849
|
const delta = { x: b.x - a.x, y: b.y - a.y };
|
|
14848
14850
|
const i = meshIndex(d.handle);
|
|
14849
|
-
if (i >= 0) this.mesh =
|
|
14850
|
-
else if (d.handle === "inside" && d.st) this.mesh =
|
|
14851
|
+
if (i >= 0) this.mesh = _chunkRHXW4TA5cjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
|
|
14852
|
+
else if (d.handle === "inside" && d.st) this.mesh = _chunkRHXW4TA5cjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
|
|
14851
14853
|
else return;
|
|
14852
14854
|
this.warpSettings = { ...this.warpSettings, style: "custom" };
|
|
14853
14855
|
this.changed();
|
|
@@ -14971,7 +14973,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14971
14973
|
bar() {
|
|
14972
14974
|
const s = this.session;
|
|
14973
14975
|
if (!s || !this.corners) return null;
|
|
14974
|
-
const read =
|
|
14976
|
+
const read = _chunkQCEQIRJQcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
|
|
14975
14977
|
return {
|
|
14976
14978
|
affine: read.affine,
|
|
14977
14979
|
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
@@ -14996,7 +14998,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
14996
14998
|
this.changed();
|
|
14997
14999
|
return;
|
|
14998
15000
|
}
|
|
14999
|
-
const m =
|
|
15001
|
+
const m = _chunkQCEQIRJQcjs.matrixFromParams.call(void 0, s.box, {
|
|
15000
15002
|
scaleX: next.scaleX,
|
|
15001
15003
|
scaleY: next.scaleY,
|
|
15002
15004
|
rotate: next.rotate,
|
|
@@ -15006,7 +15008,7 @@ var FreeTransformTool = (_class13 = class {
|
|
|
15006
15008
|
dx: next.x - this.refBox.x,
|
|
15007
15009
|
dy: next.y - this.refBox.y
|
|
15008
15010
|
});
|
|
15009
|
-
this.setCorners(
|
|
15011
|
+
this.setCorners(_chunkQCEQIRJQcjs.cornersFromMatrix.call(void 0, s.box, m));
|
|
15010
15012
|
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
15011
15013
|
this.changed();
|
|
15012
15014
|
}
|
|
@@ -16123,4 +16125,4 @@ function createImageEffectsToolProvider(controller, options = {}) {
|
|
|
16123
16125
|
|
|
16124
16126
|
|
|
16125
16127
|
|
|
16126
|
-
exports.ADJUSTMENT_KEYS = _chunkXNZWATSBcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkXNZWATSBcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkXNZWATSBcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkXNZWATSBcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkXNZWATSBcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkXNZWATSBcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkXNZWATSBcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkGNK7SESQcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkONZJD2ODcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkLRRCMRSLcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkLRRCMRSLcjs.CoverageMap; exports.D50 = _chunkXNZWATSBcjs.D50; exports.D65 = _chunkXNZWATSBcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkHRI3ZMDMcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkLRRCMRSLcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkLRRCMRSLcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkGNK7SESQcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkXNZWATSBcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkLRRCMRSLcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkLRRCMRSLcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkLRRCMRSLcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk6FUAHCVIcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkLRRCMRSLcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkGNK7SESQcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkGNK7SESQcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkXNZWATSBcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkGNK7SESQcjs.DRY_EPS; exports.DabWalker = _chunkLRRCMRSLcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkXNZWATSBcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkLRRCMRSLcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkGNK7SESQcjs.EX; exports.EY = _chunkGNK7SESQcjs.EY; exports.FLAG_ALIVE = _chunkGNK7SESQcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkGNK7SESQcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkGNK7SESQcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkGNK7SESQcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkGNK7SESQcjs.FLAG_TOP; exports.FLAG_WET = _chunkGNK7SESQcjs.FLAG_WET; exports.FLAT = _chunkGNK7SESQcjs.FLAT; exports.FREE_INTERVAL = _chunkGNK7SESQcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkXNZWATSBcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkLRRCMRSLcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkLRRCMRSLcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkGNK7SESQcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkXNZWATSBcjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunk6FUAHCVIcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkXNZWATSBcjs.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.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.INTENTS = _chunkONZJD2ODcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkXNZWATSBcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkXNZWATSBcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkXNZWATSBcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkXNZWATSBcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkXNZWATSBcjs.LUMA_709; exports.LayerCompositor = _chunkXNZWATSBcjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkXNZWATSBcjs.LayerOperationError; exports.MAX_BATCH = _chunkGNK7SESQcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkLRRCMRSLcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkXNZWATSBcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkGNK7SESQcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkGNK7SESQcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkGNK7SESQcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkXNZWATSBcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkXNZWATSBcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkLRRCMRSLcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkLRRCMRSLcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkLRRCMRSLcjs.MIXING_MODELS; exports.MixerStroke = _chunkLRRCMRSLcjs.MixerStroke; exports.OPP = _chunkGNK7SESQcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkLRRCMRSLcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkLRRCMRSLcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkLRRCMRSLcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkGNK7SESQcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkXNZWATSBcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkGNK7SESQcjs.PARAM; exports.PARAM_FLOATS = _chunkGNK7SESQcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkXNZWATSBcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkGNK7SESQcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkGNK7SESQcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkGNK7SESQcjs.PLANE; exports.PLANE_BYTES = _chunkGNK7SESQcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkXNZWATSBcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkGNK7SESQcjs.P_D0; exports.P_EDGE = _chunkGNK7SESQcjs.P_EDGE; exports.P_FX = _chunkGNK7SESQcjs.P_FX; exports.P_FY = _chunkGNK7SESQcjs.P_FY; exports.P_H = _chunkGNK7SESQcjs.P_H; exports.P_P0 = _chunkGNK7SESQcjs.P_P0; exports.P_RHO = _chunkGNK7SESQcjs.P_RHO; exports.P_SW = _chunkGNK7SESQcjs.P_SW; exports.P_UX = _chunkGNK7SESQcjs.P_UX; exports.P_UY = _chunkGNK7SESQcjs.P_UY; exports.PaintExchange = _chunkLRRCMRSLcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkLRRCMRSLcjs.PaintGradientSampler; exports.PaintSourceError = _chunkLRRCMRSLcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkLRRCMRSLcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkXNZWATSBcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk6FUAHCVIcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk6FUAHCVIcjs.RegionPixelSource; exports.RetouchDabStroke = _chunk6FUAHCVIcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkXNZWATSBcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkXNZWATSBcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkGNK7SESQcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkXNZWATSBcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkXNZWATSBcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkGNK7SESQcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkGNK7SESQcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkGNK7SESQcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkXNZWATSBcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk6FUAHCVIcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkGNK7SESQcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkGNK7SESQcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkXNZWATSBcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkLRRCMRSLcjs.SmudgeTip; exports.StrokeCoverage = _chunkLRRCMRSLcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkXNZWATSBcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkXNZWATSBcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkXNZWATSBcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkXNZWATSBcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkLRRCMRSLcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkXNZWATSBcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk6FUAHCVIcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkXNZWATSBcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkLRRCMRSLcjs.TileMedium; exports.TilePixelSource = _chunk6FUAHCVIcjs.TilePixelSource; exports.TileableNoise = _chunkLRRCMRSLcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk6FUAHCVIcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkGNK7SESQcjs.U_MAX; exports.VIBRANCE_GREY = _chunkXNZWATSBcjs.VIBRANCE_GREY; exports.W9 = _chunkGNK7SESQcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkHRI3ZMDMcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkHRI3ZMDMcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkGNK7SESQcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkGNK7SESQcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkGNK7SESQcjs.WET_TILE; exports.WGSL_HALO = _chunkGNK7SESQcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkGNK7SESQcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkGNK7SESQcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkGNK7SESQcjs.WetGpuEngine; exports.WetMedium = _chunkGNK7SESQcjs.WetMedium; exports.WetWorkerPool = _chunkGNK7SESQcjs.WetWorkerPool; exports.WetWorld = _chunkGNK7SESQcjs.WetWorld; exports.WetWorldError = _chunkGNK7SESQcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkXNZWATSBcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkXNZWATSBcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkXNZWATSBcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkXNZWATSBcjs.activeSmartFilters; exports.addLayerEffect = _chunkXNZWATSBcjs.addLayerEffect; exports.addLayerFilter = _chunkXNZWATSBcjs.addLayerFilter; exports.addPaintGradientStop = _chunkLRRCMRSLcjs.addPaintGradientStop; exports.addSmartFilter = _chunkXNZWATSBcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkXNZWATSBcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkXNZWATSBcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkXNZWATSBcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkXNZWATSBcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.anchorPoint = _chunkXNZWATSBcjs.anchorPoint; exports.annotationBlend = _chunkXNZWATSBcjs.annotationBlend; exports.annotationLayerFor = _chunkXNZWATSBcjs.annotationLayerFor; exports.annotationLayerName = _chunkXNZWATSBcjs.annotationLayerName; exports.annotationOfLayer = _chunkXNZWATSBcjs.annotationOfLayer; exports.annotationOfShape = _chunkXNZWATSBcjs.annotationOfShape; exports.annotationOfType = _chunkXNZWATSBcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkXNZWATSBcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkXNZWATSBcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkXNZWATSBcjs.applyAdjustments; exports.applyBoxBlur = _chunkXNZWATSBcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkXNZWATSBcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkXNZWATSBcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkXNZWATSBcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkXNZWATSBcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkXNZWATSBcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkXNZWATSBcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkXNZWATSBcjs.applyParams; exports.applyProcess2Adjustments = _chunkXNZWATSBcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkXNZWATSBcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk6FUAHCVIcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkXNZWATSBcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkLRRCMRSLcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkLRRCMRSLcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk6FUAHCVIcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkXNZWATSBcjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk6FUAHCVIcjs.bestOffset; exports.blackWhiteGray = _chunkXNZWATSBcjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkLRRCMRSLcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkLRRCMRSLcjs.blenderDab; exports.blurFilter = _chunkXNZWATSBcjs.blurFilter; exports.borderCoverage = _chunkXNZWATSBcjs.borderCoverage; exports.boxBlurPixels = _chunk6FUAHCVIcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkXNZWATSBcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkXNZWATSBcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkLRRCMRSLcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkLRRCMRSLcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkLRRCMRSLcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkLRRCMRSLcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkLRRCMRSLcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkXNZWATSBcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkXNZWATSBcjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkXNZWATSBcjs.calculateCropDrag; exports.canShareMemory = _chunkGNK7SESQcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkXNZWATSBcjs.canvasToImagePoint; exports.caretAt = _chunkHRI3ZMDMcjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkXNZWATSBcjs.clampCropToImage; exports.cleanMixer = _chunkLRRCMRSLcjs.cleanMixer; exports.cloneSamplePoint = _chunk6FUAHCVIcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkXNZWATSBcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkXNZWATSBcjs.combineSelections; exports.compileAdjustmentLayer = _chunkXNZWATSBcjs.compileAdjustmentLayer; exports.componentPath = _chunkXNZWATSBcjs.componentPath; exports.compositeDeep = _chunkXNZWATSBcjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkXNZWATSBcjs.computeSelectionBounds; exports.contentAwareFill = _chunk6FUAHCVIcjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkXNZWATSBcjs.contentsBox; exports.contentsSurface = _chunkXNZWATSBcjs.contentsSurface; exports.contractCoverage = _chunkXNZWATSBcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkXNZWATSBcjs.convertToSmartObject; exports.copySmartObject = _chunkXNZWATSBcjs.copySmartObject; exports.cornersFromMatrix = _chunkXNZWATSBcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkLRRCMRSLcjs.coverageTileCoord; exports.coverageToByte = _chunkXNZWATSBcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkXNZWATSBcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkLRRCMRSLcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkHRI3ZMDMcjs.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.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkHRI3ZMDMcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkHRI3ZMDMcjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkGNK7SESQcjs.createPigmentTools; exports.createSelectionMask = _chunkXNZWATSBcjs.createSelectionMask; exports.createShapeLayer = _chunkXNZWATSBcjs.createShapeLayer; exports.createTypeLayer = _chunkXNZWATSBcjs.createTypeLayer; exports.createWetGpuEngine = _chunkGNK7SESQcjs.createWetGpuEngine; exports.cssFont = _chunkHRI3ZMDMcjs.cssFont; exports.cssFontFamily = _chunkHRI3ZMDMcjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkXNZWATSBcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkLRRCMRSLcjs.dabCoverage; exports.dabRect = _chunkLRRCMRSLcjs.dabRect; exports.decodeDeepSurface = _chunkXNZWATSBcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkXNZWATSBcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkXNZWATSBcjs.decodeLayerMask; exports.decodeMergedImage = _chunkXNZWATSBcjs.decodeMergedImage; exports.decodePlanes = _chunkXNZWATSBcjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkXNZWATSBcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkXNZWATSBcjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultAdjustmentParams = _chunkXNZWATSBcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkXNZWATSBcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkXNZWATSBcjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkXNZWATSBcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkXNZWATSBcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkXNZWATSBcjs.deserializeEffects; exports.deserializeLayer = _chunkXNZWATSBcjs.deserializeLayer; exports.deserializeLayers = _chunkXNZWATSBcjs.deserializeLayers; exports.deserializePatterns = _chunkXNZWATSBcjs.deserializePatterns; exports.deserializeSelection = _chunkXNZWATSBcjs.deserializeSelection; exports.developFilter = _chunkXNZWATSBcjs.developFilter; exports.developFromAdjustments = _chunkXNZWATSBcjs.developFromAdjustments; exports.developTarget = _chunkXNZWATSBcjs.developTarget; exports.dexp = _chunkGNK7SESQcjs.dexp; exports.dilateMask = _chunk6FUAHCVIcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkXNZWATSBcjs.distanceTransform; exports.dlog = _chunkGNK7SESQcjs.dlog; exports.documentContents = _chunkXNZWATSBcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk6FUAHCVIcjs.dodgeBurn; exports.dodgeBurnCurve = _chunk6FUAHCVIcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkGNK7SESQcjs.dpow; exports.dragWarpMeshPoint = _chunkHRI3ZMDMcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkGNK7SESQcjs.dsincos; exports.duplicateLayer = _chunkXNZWATSBcjs.duplicateLayer; exports.edgeBits = _chunkGNK7SESQcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkXNZWATSBcjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkXNZWATSBcjs.encodeRle; exports.encodeSelectionRle = _chunkXNZWATSBcjs.encodeSelectionRle; exports.encodeSurface = _chunkXNZWATSBcjs.encodeSurface; exports.evalWarpMesh = _chunkHRI3ZMDMcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkXNZWATSBcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkLRRCMRSLcjs.exchangeRates; exports.expNeg = _chunkGNK7SESQcjs.expNeg; exports.expandCoverage = _chunkXNZWATSBcjs.expandCoverage; exports.exportPsd = _chunkXNZWATSBcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkXNZWATSBcjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkGNK7SESQcjs.filmPixel; exports.filmReflectance = _chunkGNK7SESQcjs.filmReflectance; exports.filterMaskCoverage = _chunkXNZWATSBcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkGNK7SESQcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkHRI3ZMDMcjs.fitParagraphRuns; exports.fitRuns = _chunkHRI3ZMDMcjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkXNZWATSBcjs.flattenPath; exports.flipCorners = _chunkXNZWATSBcjs.flipCorners; exports.flowField = _chunkGNK7SESQcjs.flowField; exports.fontOf = _chunkHRI3ZMDMcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkXNZWATSBcjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkXNZWATSBcjs.geometryHomography; exports.getAnnotationBounds = _chunkXNZWATSBcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkXNZWATSBcjs.getCropCursor; exports.getRotatedSize = _chunkXNZWATSBcjs.getRotatedSize; exports.getViewportMetrics = _chunkXNZWATSBcjs.getViewportMetrics; exports.getViewportProjection = _chunkXNZWATSBcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkLRRCMRSLcjs.gradientDabColor; exports.grainCatch = _chunkLRRCMRSLcjs.grainCatch; exports.grainHeights = _chunkLRRCMRSLcjs.grainHeights; exports.greyMorphology = _chunkXNZWATSBcjs.greyMorphology; exports.groupLayers = _chunkXNZWATSBcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkXNZWATSBcjs.hasResampledLegacyMask; exports.hasSurface = _chunkXNZWATSBcjs.hasSurface; exports.hasWarp = _chunkXNZWATSBcjs.hasWarp; exports.hash2 = _chunkLRRCMRSLcjs.hash2; exports.hashMaskContent = _chunkXNZWATSBcjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk6FUAHCVIcjs.healPixels; exports.hexToPaintRgb = _chunkLRRCMRSLcjs.hexToPaintRgb; exports.hexToRgb = _chunkXNZWATSBcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkXNZWATSBcjs.hitTestAnnotation; exports.hitTestCrop = _chunkXNZWATSBcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkXNZWATSBcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkXNZWATSBcjs.hueRangeTables; exports.hueRangeWeight = _chunkXNZWATSBcjs.hueRangeWeight; exports.hueSaturation = _chunkXNZWATSBcjs.hueSaturation; exports.identityCurve = _chunkXNZWATSBcjs.identityCurve; exports.identityLevels = _chunkXNZWATSBcjs.identityLevels; exports.identityTransform = _chunkXNZWATSBcjs.identityTransform; exports.identityWarpMesh = _chunkHRI3ZMDMcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkXNZWATSBcjs.imageToCanvasPoint; exports.importPsd = _chunkXNZWATSBcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkXNZWATSBcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkXNZWATSBcjs.invertMatrix3; exports.invertSelection = _chunkXNZWATSBcjs.invertSelection; exports.isActiveFilter = _chunkXNZWATSBcjs.isActiveFilter; exports.isAdjustmentKind = _chunkXNZWATSBcjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkLRRCMRSLcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkXNZWATSBcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkXNZWATSBcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkLRRCMRSLcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk6FUAHCVIcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkXNZWATSBcjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkXNZWATSBcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkXNZWATSBcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkXNZWATSBcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkXNZWATSBcjs.isSelectionEmpty; exports.isSelectionMode = _chunkXNZWATSBcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkXNZWATSBcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkXNZWATSBcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkXNZWATSBcjs.isTransformAnchor; exports.isValidWarp = _chunkXNZWATSBcjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkXNZWATSBcjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkGNK7SESQcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkXNZWATSBcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkXNZWATSBcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkXNZWATSBcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkXNZWATSBcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkXNZWATSBcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkXNZWATSBcjs.layerTree; exports.layerTypeLabel = _chunkXNZWATSBcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkXNZWATSBcjs.layersFromLegacy; exports.layoutText = _chunkHRI3ZMDMcjs.layoutText; exports.legacyAdjustmentLayer = _chunkXNZWATSBcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkXNZWATSBcjs.legacyMaskOf; exports.legacyView = _chunkXNZWATSBcjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkXNZWATSBcjs.levelsValue; exports.linearSrgbToXy = _chunkXNZWATSBcjs.linearSrgbToXy; exports.linearToSrgb = _chunkXNZWATSBcjs.linearToSrgb; exports.linearToSrgb8 = _chunkGNK7SESQcjs.linearToSrgb8; exports.liveComponent = _chunkXNZWATSBcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkXNZWATSBcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkLRRCMRSLcjs.loadMixer; exports.loadOpenTypeFont = _chunk5UEFNX24cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkGNK7SESQcjs.loadWetKernel; exports.luma = _chunk6FUAHCVIcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkXNZWATSBcjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkXNZWATSBcjs.mapSubpaths; exports.maskBounds = _chunk6FUAHCVIcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkXNZWATSBcjs.matrixFromCorners; exports.matrixFromParams = _chunkXNZWATSBcjs.matrixFromParams; exports.membraneFill = _chunk6FUAHCVIcjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkXNZWATSBcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkLRRCMRSLcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkLRRCMRSLcjs.mixerRates; exports.modifySelection = _chunkXNZWATSBcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkXNZWATSBcjs.moveLayer; exports.moveSmartFilter = _chunkXNZWATSBcjs.moveSmartFilter; exports.mulMatrix3 = _chunkXNZWATSBcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkXNZWATSBcjs.neutralHueRange; exports.newContentsId = _chunkXNZWATSBcjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkXNZWATSBcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkXNZWATSBcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkXNZWATSBcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkXNZWATSBcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkLRRCMRSLcjs.normalizeBlender; exports.normalizeBrush = _chunkLRRCMRSLcjs.normalizeBrush; exports.normalizeFilter = _chunkXNZWATSBcjs.normalizeFilter; exports.normalizeFlow = _chunkGNK7SESQcjs.normalizeFlow; exports.normalizeHexColor = _chunkLRRCMRSLcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkXNZWATSBcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkXNZWATSBcjs.normalizeLiveShape; exports.normalizeMixer = _chunkLRRCMRSLcjs.normalizeMixer; exports.normalizePlacement = _chunkXNZWATSBcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkXNZWATSBcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk6FUAHCVIcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkXNZWATSBcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkXNZWATSBcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkXNZWATSBcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkLRRCMRSLcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkXNZWATSBcjs.normalizeSubpaths; exports.normalizeText = _chunkXNZWATSBcjs.normalizeText; exports.normalizeTilt = _chunkGNK7SESQcjs.normalizeTilt; exports.normalizeWetParams = _chunkGNK7SESQcjs.normalizeWetParams; exports.offsetLayer = _chunkXNZWATSBcjs.offsetLayer; exports.offsetShape = _chunkXNZWATSBcjs.offsetShape; exports.offsetSmartObject = _chunkXNZWATSBcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkGNK7SESQcjs.packWetParams; exports.paintGradientMappingFor = _chunkLRRCMRSLcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkLRRCMRSLcjs.paintPathStroke; exports.paintSourceColor = _chunkLRRCMRSLcjs.paintSourceColor; exports.paintSourceCss = _chunkLRRCMRSLcjs.paintSourceCss; exports.paragraphRanges = _chunkHRI3ZMDMcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkXNZWATSBcjs.parseAdjustmentBlock; exports.parseBlend = _chunkXNZWATSBcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkXNZWATSBcjs.parseLfx2; exports.parseLrfx = _chunkXNZWATSBcjs.parseLrfx; exports.parseOpenTypeFont = _chunk5UEFNX24cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkLRRCMRSLcjs.parsePaintSource; exports.parsePatternBlock = _chunkXNZWATSBcjs.parsePatternBlock; exports.parseSelectionMode = _chunkXNZWATSBcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkXNZWATSBcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkXNZWATSBcjs.patchParagraphStyle; exports.patchTextStyle = _chunkXNZWATSBcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkLRRCMRSLcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkLRRCMRSLcjs.pathStrokeDabs; exports.perDabStrength = _chunk6FUAHCVIcjs.perDabStrength; exports.photoFilterMatrix = _chunkXNZWATSBcjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkGNK7SESQcjs.pigmentColor; exports.pigmentOf = _chunkGNK7SESQcjs.pigmentOf; exports.pixelLayerBounds = _chunkXNZWATSBcjs.pixelLayerBounds; exports.pixelLayers = _chunkXNZWATSBcjs.pixelLayers; exports.pixelPigment = _chunkGNK7SESQcjs.pixelPigment; exports.placeContents = _chunkXNZWATSBcjs.placeContents; exports.placeLayer = _chunkXNZWATSBcjs.placeLayer; exports.placementAt = _chunkXNZWATSBcjs.placementAt; exports.placementBounds = _chunkXNZWATSBcjs.placementBounds; exports.placementGeometry = _chunkXNZWATSBcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkGNK7SESQcjs.pointerPressure; exports.pointerStrokeSample = _chunkGNK7SESQcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkGNK7SESQcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkXNZWATSBcjs.posterizeValue; exports.presetWarp = _chunkXNZWATSBcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkXNZWATSBcjs.projectImagePoint; exports.projectImageRect = _chunkXNZWATSBcjs.projectImageRect; exports.projectMaskCoverage = _chunkXNZWATSBcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkXNZWATSBcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkXNZWATSBcjs.psdToLayers; exports.pullWarpMesh = _chunkHRI3ZMDMcjs.pullWarpMesh; exports.put255 = _chunkLRRCMRSLcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkLRRCMRSLcjs.rand01; exports.randSigned = _chunkLRRCMRSLcjs.randSigned; exports.rangeLightness = _chunkXNZWATSBcjs.rangeLightness; exports.rasterContents = _chunkXNZWATSBcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkXNZWATSBcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkXNZWATSBcjs.rasterizeCoverage; exports.rasterizeDab = _chunkLRRCMRSLcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkXNZWATSBcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkLRRCMRSLcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkXNZWATSBcjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk6FUAHCVIcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkXNZWATSBcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkXNZWATSBcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkXNZWATSBcjs.removeLayer; exports.removeLayerEffect = _chunkXNZWATSBcjs.removeLayerEffect; exports.removeLayerFilter = _chunkXNZWATSBcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkLRRCMRSLcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkXNZWATSBcjs.removeSmartFilter; exports.renderBrushstroke = _chunkLRRCMRSLcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkXNZWATSBcjs.renderShape; exports.renderShapeRect = _chunkXNZWATSBcjs.renderShapeRect; exports.renderSmartObject = _chunkXNZWATSBcjs.renderSmartObject; exports.renderText = _chunkXNZWATSBcjs.renderText; exports.replaceContents = _chunkXNZWATSBcjs.replaceContents; exports.replaceTextRange = _chunkXNZWATSBcjs.replaceTextRange; exports.requireLayer = _chunkXNZWATSBcjs.requireLayer; exports.requireOperation = _chunkXNZWATSBcjs.requireOperation; exports.requireShapeLayer = _chunkXNZWATSBcjs.requireShapeLayer; exports.requireSmartObject = _chunkXNZWATSBcjs.requireSmartObject; exports.requireTypeLayer = _chunkXNZWATSBcjs.requireTypeLayer; exports.requireUnlocked = _chunkXNZWATSBcjs.requireUnlocked; exports.rerender = _chunkXNZWATSBcjs.rerender; exports.rerenderShape = _chunkXNZWATSBcjs.rerenderShape; exports.rerenderText = _chunkXNZWATSBcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkXNZWATSBcjs.resizeSelection; exports.resizeWarpMesh = _chunkHRI3ZMDMcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkXNZWATSBcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkLRRCMRSLcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkHRI3ZMDMcjs.restyleRange; exports.retouchFilter = _chunk6FUAHCVIcjs.retouchFilter; exports.reversePaintGradient = _chunkLRRCMRSLcjs.reversePaintGradient; exports.rgbToGray = _chunkXNZWATSBcjs.rgbToGray; exports.rgbToHsl = _chunkXNZWATSBcjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk6FUAHCVIcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkXNZWATSBcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkXNZWATSBcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkXNZWATSBcjs.sampleLut; exports.sampleToneLut = _chunkXNZWATSBcjs.sampleToneLut; exports.saturationOf = _chunk6FUAHCVIcjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkLRRCMRSLcjs.scalePaintGradient; exports.seamlessClone = _chunk6FUAHCVIcjs.seamlessClone; exports.seedFromString = _chunkLRRCMRSLcjs.seedFromString; exports.selectionArea = _chunkXNZWATSBcjs.selectionArea; exports.selectionFromCoverage = _chunkXNZWATSBcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkXNZWATSBcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkXNZWATSBcjs.selectionToCoverage; exports.selectionToPixels = _chunkXNZWATSBcjs.selectionToPixels; exports.selectionValueAt = _chunkXNZWATSBcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkXNZWATSBcjs.serializeContents; exports.serializeEffects = _chunkXNZWATSBcjs.serializeEffects; exports.serializeLayer = _chunkXNZWATSBcjs.serializeLayer; exports.serializeLayers = _chunkXNZWATSBcjs.serializeLayers; exports.serializeLayersExternal = _chunkXNZWATSBcjs.serializeLayersExternal; exports.serializePatterns = _chunkXNZWATSBcjs.serializePatterns; exports.serializeSelection = _chunkXNZWATSBcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkXNZWATSBcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkXNZWATSBcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkXNZWATSBcjs.setLayerMask; exports.setLayerProperties = _chunkXNZWATSBcjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkXNZWATSBcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkXNZWATSBcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkXNZWATSBcjs.setSmartPlacement; exports.shadeTile = _chunkGNK7SESQcjs.shadeTile; exports.shapeAsPixelLayer = _chunkXNZWATSBcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkXNZWATSBcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkXNZWATSBcjs.shapeGeometryBounds; exports.shapeLayers = _chunkXNZWATSBcjs.shapeLayers; exports.shapeOutline = _chunkXNZWATSBcjs.shapeOutline; exports.shapeRenderClip = _chunkXNZWATSBcjs.shapeRenderClip; exports.shiftCoverage = _chunkXNZWATSBcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkXNZWATSBcjs.smartObjectLayers; exports.smoothCoverage = _chunkXNZWATSBcjs.smoothCoverage; exports.smoothPoints = _chunkLRRCMRSLcjs.smoothPoints; exports.smudgeEffect = _chunk6FUAHCVIcjs.smudgeEffect; exports.solidPaint = _chunkLRRCMRSLcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk6FUAHCVIcjs.solveMembrane; exports.spliceRuns = _chunkHRI3ZMDMcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk6FUAHCVIcjs.sponge; exports.spongeEffect = _chunk6FUAHCVIcjs.spongeEffect; exports.spotHealPixels = _chunk6FUAHCVIcjs.spotHealPixels; exports.spotHealWindow = _chunk6FUAHCVIcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkGNK7SESQcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkXNZWATSBcjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.stepSlotTs = _chunkGNK7SESQcjs.stepSlotTs; exports.strokeGrainCatch = _chunkLRRCMRSLcjs.strokeGrainCatch; exports.styleAt = _chunkHRI3ZMDMcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkXNZWATSBcjs.tempTintToXy; exports.temperatureToKelvin = _chunkXNZWATSBcjs.temperatureToKelvin; exports.textIndexAt = _chunkHRI3ZMDMcjs.textIndexAt; exports.textMatrix = _chunkXNZWATSBcjs.textMatrix; exports.textOutlines = _chunkXNZWATSBcjs.textOutlines; exports.textRange = _chunkXNZWATSBcjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkLRRCMRSLcjs.tipFalloff; exports.tipReach = _chunkLRRCMRSLcjs.tipReach; exports.tipShape = _chunkLRRCMRSLcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkXNZWATSBcjs.toTextSpace; exports.toneCurve = _chunkXNZWATSBcjs.toneCurve; exports.toneLuts = _chunkXNZWATSBcjs.toneLuts; exports.toneOf = _chunk6FUAHCVIcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkXNZWATSBcjs.transformHomography; exports.transformMap = _chunkXNZWATSBcjs.transformMap; exports.transformShapeComponents = _chunkXNZWATSBcjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkXNZWATSBcjs.transformTypeLayer; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkXNZWATSBcjs.transformedBox; exports.transformedPoint = _chunkXNZWATSBcjs.transformedPoint; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkXNZWATSBcjs.typeAsPixelLayer; exports.typeFrame = _chunkXNZWATSBcjs.typeFrame; exports.typeFromAnnotation = _chunkXNZWATSBcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkXNZWATSBcjs.typeLayerName; exports.ungroupLayer = _chunkXNZWATSBcjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkXNZWATSBcjs.unionRect; exports.unprojectCanvasPoint = _chunkXNZWATSBcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkXNZWATSBcjs.updateLayerEffect; exports.updateLayerFilter = _chunkXNZWATSBcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkXNZWATSBcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkLRRCMRSLcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkXNZWATSBcjs.updateShapeLayer; exports.updateSmartFilter = _chunkXNZWATSBcjs.updateSmartFilter; exports.updateTypeLayer = _chunkXNZWATSBcjs.updateTypeLayer; exports.uvToXy = _chunkXNZWATSBcjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkXNZWATSBcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkXNZWATSBcjs.vibranceLinear; exports.vibrancePixel = _chunkXNZWATSBcjs.vibrancePixel; exports.walkDabs = _chunkLRRCMRSLcjs.walkDabs; exports.warpMeshEditPoints = _chunkHRI3ZMDMcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkHRI3ZMDMcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkHRI3ZMDMcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkHRI3ZMDMcjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.wbMatrix = _chunkXNZWATSBcjs.wbMatrix; exports.wetGpuSupport = _chunkGNK7SESQcjs.wetGpuSupport; exports.wetSimdSupported = _chunkGNK7SESQcjs.wetSimdSupported; exports.wetSupport = _chunkGNK7SESQcjs.wetSupport; exports.whiteBalanceFromSample = _chunkXNZWATSBcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkXNZWATSBcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkXNZWATSBcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkXNZWATSBcjs.withNewIds; exports.writeAdjustmentBlock = _chunkXNZWATSBcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkXNZWATSBcjs.writeLfx2; exports.writePatternBlock = _chunkXNZWATSBcjs.writePatternBlock; exports.writePsd = _chunkXNZWATSBcjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkXNZWATSBcjs.xyToTempTint; exports.xyToUv = _chunkXNZWATSBcjs.xyToUv;
|
|
16128
|
+
exports.ADJUSTMENT_KEYS = _chunkQCEQIRJQcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkQCEQIRJQcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkQCEQIRJQcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkQCEQIRJQcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkQCEQIRJQcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkQCEQIRJQcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkQCEQIRJQcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkGNK7SESQcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkLRRCMRSLcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkLRRCMRSLcjs.CoverageMap; exports.D50 = _chunkQCEQIRJQcjs.D50; exports.D65 = _chunkQCEQIRJQcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkRHXW4TA5cjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkLRRCMRSLcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkLRRCMRSLcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkGNK7SESQcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkQCEQIRJQcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkLRRCMRSLcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkLRRCMRSLcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkLRRCMRSLcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk6FUAHCVIcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkLRRCMRSLcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkGNK7SESQcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkGNK7SESQcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkQCEQIRJQcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkGNK7SESQcjs.DRY_EPS; exports.DabWalker = _chunkLRRCMRSLcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkQCEQIRJQcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkLRRCMRSLcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkGNK7SESQcjs.EX; exports.EY = _chunkGNK7SESQcjs.EY; exports.FLAG_ALIVE = _chunkGNK7SESQcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkGNK7SESQcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkGNK7SESQcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkGNK7SESQcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkGNK7SESQcjs.FLAG_TOP; exports.FLAG_WET = _chunkGNK7SESQcjs.FLAG_WET; exports.FLAT = _chunkGNK7SESQcjs.FLAT; exports.FREE_INTERVAL = _chunkGNK7SESQcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkQCEQIRJQcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkLRRCMRSLcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkLRRCMRSLcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkGNK7SESQcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkQCEQIRJQcjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunk6FUAHCVIcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkQCEQIRJQcjs.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.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkQCEQIRJQcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkQCEQIRJQcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkQCEQIRJQcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkQCEQIRJQcjs.LUMA_709; exports.LayerCompositor = _chunkQCEQIRJQcjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkQCEQIRJQcjs.LayerOperationError; exports.MAX_BATCH = _chunkGNK7SESQcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkLRRCMRSLcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkQCEQIRJQcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkGNK7SESQcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkGNK7SESQcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkGNK7SESQcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkQCEQIRJQcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkQCEQIRJQcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkLRRCMRSLcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkLRRCMRSLcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkLRRCMRSLcjs.MIXING_MODELS; exports.MixerStroke = _chunkLRRCMRSLcjs.MixerStroke; exports.OPP = _chunkGNK7SESQcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkLRRCMRSLcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkLRRCMRSLcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkLRRCMRSLcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkGNK7SESQcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkQCEQIRJQcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkGNK7SESQcjs.PARAM; exports.PARAM_FLOATS = _chunkGNK7SESQcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkQCEQIRJQcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkGNK7SESQcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkGNK7SESQcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkGNK7SESQcjs.PLANE; exports.PLANE_BYTES = _chunkGNK7SESQcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkQCEQIRJQcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkGNK7SESQcjs.P_D0; exports.P_EDGE = _chunkGNK7SESQcjs.P_EDGE; exports.P_FX = _chunkGNK7SESQcjs.P_FX; exports.P_FY = _chunkGNK7SESQcjs.P_FY; exports.P_H = _chunkGNK7SESQcjs.P_H; exports.P_P0 = _chunkGNK7SESQcjs.P_P0; exports.P_RHO = _chunkGNK7SESQcjs.P_RHO; exports.P_SW = _chunkGNK7SESQcjs.P_SW; exports.P_UX = _chunkGNK7SESQcjs.P_UX; exports.P_UY = _chunkGNK7SESQcjs.P_UY; exports.PaintExchange = _chunkLRRCMRSLcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkLRRCMRSLcjs.PaintGradientSampler; exports.PaintSourceError = _chunkLRRCMRSLcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkLRRCMRSLcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkQCEQIRJQcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk6FUAHCVIcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk6FUAHCVIcjs.RegionPixelSource; exports.RetouchDabStroke = _chunk6FUAHCVIcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkQCEQIRJQcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkQCEQIRJQcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkGNK7SESQcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkQCEQIRJQcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkQCEQIRJQcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkGNK7SESQcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkGNK7SESQcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkGNK7SESQcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkQCEQIRJQcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk6FUAHCVIcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkGNK7SESQcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkGNK7SESQcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkQCEQIRJQcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkLRRCMRSLcjs.SmudgeTip; exports.StrokeCoverage = _chunkLRRCMRSLcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkQCEQIRJQcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkQCEQIRJQcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkQCEQIRJQcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkQCEQIRJQcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkLRRCMRSLcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkQCEQIRJQcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk6FUAHCVIcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkQCEQIRJQcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkLRRCMRSLcjs.TileMedium; exports.TilePixelSource = _chunk6FUAHCVIcjs.TilePixelSource; exports.TileableNoise = _chunkLRRCMRSLcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk6FUAHCVIcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkGNK7SESQcjs.U_MAX; exports.VIBRANCE_GREY = _chunkQCEQIRJQcjs.VIBRANCE_GREY; exports.W9 = _chunkGNK7SESQcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkRHXW4TA5cjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkRHXW4TA5cjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkGNK7SESQcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkGNK7SESQcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkGNK7SESQcjs.WET_TILE; exports.WGSL_HALO = _chunkGNK7SESQcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkGNK7SESQcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkGNK7SESQcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkGNK7SESQcjs.WetGpuEngine; exports.WetMedium = _chunkGNK7SESQcjs.WetMedium; exports.WetWorkerPool = _chunkGNK7SESQcjs.WetWorkerPool; exports.WetWorld = _chunkGNK7SESQcjs.WetWorld; exports.WetWorldError = _chunkGNK7SESQcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkQCEQIRJQcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkQCEQIRJQcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkQCEQIRJQcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkQCEQIRJQcjs.activeSmartFilters; exports.addLayerEffect = _chunkQCEQIRJQcjs.addLayerEffect; exports.addLayerFilter = _chunkQCEQIRJQcjs.addLayerFilter; exports.addPaintGradientStop = _chunkLRRCMRSLcjs.addPaintGradientStop; exports.addSmartFilter = _chunkQCEQIRJQcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkQCEQIRJQcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkQCEQIRJQcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkQCEQIRJQcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkQCEQIRJQcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.anchorPoint = _chunkQCEQIRJQcjs.anchorPoint; exports.annotationBlend = _chunkQCEQIRJQcjs.annotationBlend; exports.annotationLayerFor = _chunkQCEQIRJQcjs.annotationLayerFor; exports.annotationLayerName = _chunkQCEQIRJQcjs.annotationLayerName; exports.annotationOfLayer = _chunkQCEQIRJQcjs.annotationOfLayer; exports.annotationOfShape = _chunkQCEQIRJQcjs.annotationOfShape; exports.annotationOfType = _chunkQCEQIRJQcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkQCEQIRJQcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkQCEQIRJQcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkQCEQIRJQcjs.applyAdjustments; exports.applyBoxBlur = _chunkQCEQIRJQcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkQCEQIRJQcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkQCEQIRJQcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkQCEQIRJQcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkQCEQIRJQcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkQCEQIRJQcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkQCEQIRJQcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkQCEQIRJQcjs.applyParams; exports.applyProcess2Adjustments = _chunkQCEQIRJQcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkQCEQIRJQcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk6FUAHCVIcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkQCEQIRJQcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkLRRCMRSLcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkLRRCMRSLcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk6FUAHCVIcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkQCEQIRJQcjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk6FUAHCVIcjs.bestOffset; exports.blackWhiteGray = _chunkQCEQIRJQcjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkLRRCMRSLcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkLRRCMRSLcjs.blenderDab; exports.blurFilter = _chunkQCEQIRJQcjs.blurFilter; exports.borderCoverage = _chunkQCEQIRJQcjs.borderCoverage; exports.boxBlurPixels = _chunk6FUAHCVIcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkQCEQIRJQcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkQCEQIRJQcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkLRRCMRSLcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkLRRCMRSLcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkLRRCMRSLcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkLRRCMRSLcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkLRRCMRSLcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkQCEQIRJQcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkQCEQIRJQcjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkQCEQIRJQcjs.calculateCropDrag; exports.canShareMemory = _chunkGNK7SESQcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkQCEQIRJQcjs.canvasToImagePoint; exports.caretAt = _chunkRHXW4TA5cjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkQCEQIRJQcjs.clampCropToImage; exports.cleanMixer = _chunkLRRCMRSLcjs.cleanMixer; exports.cloneSamplePoint = _chunk6FUAHCVIcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkQCEQIRJQcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkQCEQIRJQcjs.combineSelections; exports.compileAdjustmentLayer = _chunkQCEQIRJQcjs.compileAdjustmentLayer; exports.componentPath = _chunkQCEQIRJQcjs.componentPath; exports.compositeDeep = _chunkQCEQIRJQcjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkQCEQIRJQcjs.computeSelectionBounds; exports.contentAwareFill = _chunk6FUAHCVIcjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkQCEQIRJQcjs.contentsBox; exports.contentsSurface = _chunkQCEQIRJQcjs.contentsSurface; exports.contractCoverage = _chunkQCEQIRJQcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkQCEQIRJQcjs.convertToSmartObject; exports.copySmartObject = _chunkQCEQIRJQcjs.copySmartObject; exports.cornersFromMatrix = _chunkQCEQIRJQcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkLRRCMRSLcjs.coverageTileCoord; exports.coverageToByte = _chunkQCEQIRJQcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkQCEQIRJQcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkLRRCMRSLcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkRHXW4TA5cjs.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.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkRHXW4TA5cjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkRHXW4TA5cjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkGNK7SESQcjs.createPigmentTools; exports.createSelectionMask = _chunkQCEQIRJQcjs.createSelectionMask; exports.createShapeLayer = _chunkQCEQIRJQcjs.createShapeLayer; exports.createTypeLayer = _chunkQCEQIRJQcjs.createTypeLayer; exports.createWetGpuEngine = _chunkGNK7SESQcjs.createWetGpuEngine; exports.cssFont = _chunkRHXW4TA5cjs.cssFont; exports.cssFontFamily = _chunkRHXW4TA5cjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkQCEQIRJQcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkLRRCMRSLcjs.dabCoverage; exports.dabRect = _chunkLRRCMRSLcjs.dabRect; exports.decodeDeepSurface = _chunkQCEQIRJQcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkQCEQIRJQcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkQCEQIRJQcjs.decodeLayerMask; exports.decodeMergedImage = _chunkQCEQIRJQcjs.decodeMergedImage; exports.decodePlanes = _chunkQCEQIRJQcjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkQCEQIRJQcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkQCEQIRJQcjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultAdjustmentParams = _chunkQCEQIRJQcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkQCEQIRJQcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkQCEQIRJQcjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkQCEQIRJQcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkQCEQIRJQcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkQCEQIRJQcjs.deserializeEffects; exports.deserializeLayer = _chunkQCEQIRJQcjs.deserializeLayer; exports.deserializeLayers = _chunkQCEQIRJQcjs.deserializeLayers; exports.deserializePatterns = _chunkQCEQIRJQcjs.deserializePatterns; exports.deserializeSelection = _chunkQCEQIRJQcjs.deserializeSelection; exports.developFilter = _chunkQCEQIRJQcjs.developFilter; exports.developFromAdjustments = _chunkQCEQIRJQcjs.developFromAdjustments; exports.developTarget = _chunkQCEQIRJQcjs.developTarget; exports.dexp = _chunkGNK7SESQcjs.dexp; exports.dilateMask = _chunk6FUAHCVIcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkQCEQIRJQcjs.distanceTransform; exports.dlog = _chunkGNK7SESQcjs.dlog; exports.documentContents = _chunkQCEQIRJQcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk6FUAHCVIcjs.dodgeBurn; exports.dodgeBurnCurve = _chunk6FUAHCVIcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkGNK7SESQcjs.dpow; exports.dragWarpMeshPoint = _chunkRHXW4TA5cjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkGNK7SESQcjs.dsincos; exports.duplicateLayer = _chunkQCEQIRJQcjs.duplicateLayer; exports.edgeBits = _chunkGNK7SESQcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkQCEQIRJQcjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkQCEQIRJQcjs.encodeRle; exports.encodeSelectionRle = _chunkQCEQIRJQcjs.encodeSelectionRle; exports.encodeSurface = _chunkQCEQIRJQcjs.encodeSurface; exports.evalWarpMesh = _chunkRHXW4TA5cjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkQCEQIRJQcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkLRRCMRSLcjs.exchangeRates; exports.expNeg = _chunkGNK7SESQcjs.expNeg; exports.expandCoverage = _chunkQCEQIRJQcjs.expandCoverage; exports.exportPsd = _chunkQCEQIRJQcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkQCEQIRJQcjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkGNK7SESQcjs.filmPixel; exports.filmReflectance = _chunkGNK7SESQcjs.filmReflectance; exports.filterMaskCoverage = _chunkQCEQIRJQcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkGNK7SESQcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkRHXW4TA5cjs.fitParagraphRuns; exports.fitRuns = _chunkRHXW4TA5cjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkQCEQIRJQcjs.flattenPath; exports.flipCorners = _chunkQCEQIRJQcjs.flipCorners; exports.flowField = _chunkGNK7SESQcjs.flowField; exports.fontOf = _chunkRHXW4TA5cjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkQCEQIRJQcjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkQCEQIRJQcjs.geometryHomography; exports.getAnnotationBounds = _chunkQCEQIRJQcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkQCEQIRJQcjs.getCropCursor; exports.getRotatedSize = _chunkQCEQIRJQcjs.getRotatedSize; exports.getViewportMetrics = _chunkQCEQIRJQcjs.getViewportMetrics; exports.getViewportProjection = _chunkQCEQIRJQcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkLRRCMRSLcjs.gradientDabColor; exports.grainCatch = _chunkLRRCMRSLcjs.grainCatch; exports.grainHeights = _chunkLRRCMRSLcjs.grainHeights; exports.greyMorphology = _chunkQCEQIRJQcjs.greyMorphology; exports.groupLayers = _chunkQCEQIRJQcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkQCEQIRJQcjs.hasResampledLegacyMask; exports.hasSurface = _chunkQCEQIRJQcjs.hasSurface; exports.hasWarp = _chunkQCEQIRJQcjs.hasWarp; exports.hash2 = _chunkLRRCMRSLcjs.hash2; exports.hashMaskContent = _chunkQCEQIRJQcjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk6FUAHCVIcjs.healPixels; exports.hexToPaintRgb = _chunkLRRCMRSLcjs.hexToPaintRgb; exports.hexToRgb = _chunkQCEQIRJQcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkQCEQIRJQcjs.hitTestAnnotation; exports.hitTestCrop = _chunkQCEQIRJQcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkQCEQIRJQcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkQCEQIRJQcjs.hueRangeTables; exports.hueRangeWeight = _chunkQCEQIRJQcjs.hueRangeWeight; exports.hueSaturation = _chunkQCEQIRJQcjs.hueSaturation; exports.identityCurve = _chunkQCEQIRJQcjs.identityCurve; exports.identityLevels = _chunkQCEQIRJQcjs.identityLevels; exports.identityTransform = _chunkQCEQIRJQcjs.identityTransform; exports.identityWarpMesh = _chunkRHXW4TA5cjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkQCEQIRJQcjs.imageToCanvasPoint; exports.importPsd = _chunkQCEQIRJQcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkQCEQIRJQcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkQCEQIRJQcjs.invertMatrix3; exports.invertSelection = _chunkQCEQIRJQcjs.invertSelection; exports.isActiveFilter = _chunkQCEQIRJQcjs.isActiveFilter; exports.isAdjustmentKind = _chunkQCEQIRJQcjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkLRRCMRSLcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkQCEQIRJQcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkQCEQIRJQcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkLRRCMRSLcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk6FUAHCVIcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkQCEQIRJQcjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkQCEQIRJQcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkQCEQIRJQcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkQCEQIRJQcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkQCEQIRJQcjs.isSelectionEmpty; exports.isSelectionMode = _chunkQCEQIRJQcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkQCEQIRJQcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkQCEQIRJQcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkQCEQIRJQcjs.isTransformAnchor; exports.isValidWarp = _chunkQCEQIRJQcjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkQCEQIRJQcjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkGNK7SESQcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkQCEQIRJQcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkQCEQIRJQcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkQCEQIRJQcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkQCEQIRJQcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkQCEQIRJQcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkQCEQIRJQcjs.layerTree; exports.layerTypeLabel = _chunkQCEQIRJQcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkQCEQIRJQcjs.layersFromLegacy; exports.layoutText = _chunkRHXW4TA5cjs.layoutText; exports.legacyAdjustmentLayer = _chunkQCEQIRJQcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkQCEQIRJQcjs.legacyMaskOf; exports.legacyView = _chunkQCEQIRJQcjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkQCEQIRJQcjs.levelsValue; exports.linearSrgbToXy = _chunkQCEQIRJQcjs.linearSrgbToXy; exports.linearToSrgb = _chunkQCEQIRJQcjs.linearToSrgb; exports.linearToSrgb8 = _chunkGNK7SESQcjs.linearToSrgb8; exports.liveComponent = _chunkQCEQIRJQcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkQCEQIRJQcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkLRRCMRSLcjs.loadMixer; exports.loadOpenTypeFont = _chunk5UEFNX24cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkGNK7SESQcjs.loadWetKernel; exports.luma = _chunk6FUAHCVIcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkQCEQIRJQcjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkQCEQIRJQcjs.mapSubpaths; exports.maskBounds = _chunk6FUAHCVIcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkQCEQIRJQcjs.matrixFromCorners; exports.matrixFromParams = _chunkQCEQIRJQcjs.matrixFromParams; exports.membraneFill = _chunk6FUAHCVIcjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkQCEQIRJQcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkLRRCMRSLcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkLRRCMRSLcjs.mixerRates; exports.modifySelection = _chunkQCEQIRJQcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkQCEQIRJQcjs.moveLayer; exports.moveSmartFilter = _chunkQCEQIRJQcjs.moveSmartFilter; exports.mulMatrix3 = _chunkQCEQIRJQcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkQCEQIRJQcjs.neutralHueRange; exports.newContentsId = _chunkQCEQIRJQcjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkQCEQIRJQcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkQCEQIRJQcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkQCEQIRJQcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkQCEQIRJQcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkLRRCMRSLcjs.normalizeBlender; exports.normalizeBrush = _chunkLRRCMRSLcjs.normalizeBrush; exports.normalizeFilter = _chunkQCEQIRJQcjs.normalizeFilter; exports.normalizeFlow = _chunkGNK7SESQcjs.normalizeFlow; exports.normalizeHexColor = _chunkLRRCMRSLcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkQCEQIRJQcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkQCEQIRJQcjs.normalizeLiveShape; exports.normalizeMixer = _chunkLRRCMRSLcjs.normalizeMixer; exports.normalizePlacement = _chunkQCEQIRJQcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkQCEQIRJQcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk6FUAHCVIcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkQCEQIRJQcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkQCEQIRJQcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkQCEQIRJQcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkLRRCMRSLcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkQCEQIRJQcjs.normalizeSubpaths; exports.normalizeText = _chunkQCEQIRJQcjs.normalizeText; exports.normalizeTilt = _chunkGNK7SESQcjs.normalizeTilt; exports.normalizeWetParams = _chunkGNK7SESQcjs.normalizeWetParams; exports.offsetLayer = _chunkQCEQIRJQcjs.offsetLayer; exports.offsetShape = _chunkQCEQIRJQcjs.offsetShape; exports.offsetSmartObject = _chunkQCEQIRJQcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkGNK7SESQcjs.packWetParams; exports.paintGradientMappingFor = _chunkLRRCMRSLcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkLRRCMRSLcjs.paintPathStroke; exports.paintSourceColor = _chunkLRRCMRSLcjs.paintSourceColor; exports.paintSourceCss = _chunkLRRCMRSLcjs.paintSourceCss; exports.paragraphRanges = _chunkRHXW4TA5cjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkQCEQIRJQcjs.parseAdjustmentBlock; exports.parseBlend = _chunkQCEQIRJQcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkQCEQIRJQcjs.parseLfx2; exports.parseLrfx = _chunkQCEQIRJQcjs.parseLrfx; exports.parseOpenTypeFont = _chunk5UEFNX24cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkLRRCMRSLcjs.parsePaintSource; exports.parsePatternBlock = _chunkQCEQIRJQcjs.parsePatternBlock; exports.parseSelectionMode = _chunkQCEQIRJQcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkQCEQIRJQcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkQCEQIRJQcjs.patchParagraphStyle; exports.patchTextStyle = _chunkQCEQIRJQcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkLRRCMRSLcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkLRRCMRSLcjs.pathStrokeDabs; exports.perDabStrength = _chunk6FUAHCVIcjs.perDabStrength; exports.photoFilterMatrix = _chunkQCEQIRJQcjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkGNK7SESQcjs.pigmentColor; exports.pigmentOf = _chunkGNK7SESQcjs.pigmentOf; exports.pixelLayerBounds = _chunkQCEQIRJQcjs.pixelLayerBounds; exports.pixelLayers = _chunkQCEQIRJQcjs.pixelLayers; exports.pixelPigment = _chunkGNK7SESQcjs.pixelPigment; exports.placeContents = _chunkQCEQIRJQcjs.placeContents; exports.placeLayer = _chunkQCEQIRJQcjs.placeLayer; exports.placementAt = _chunkQCEQIRJQcjs.placementAt; exports.placementBounds = _chunkQCEQIRJQcjs.placementBounds; exports.placementGeometry = _chunkQCEQIRJQcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkGNK7SESQcjs.pointerPressure; exports.pointerStrokeSample = _chunkGNK7SESQcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkGNK7SESQcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkQCEQIRJQcjs.posterizeValue; exports.presetWarp = _chunkQCEQIRJQcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkQCEQIRJQcjs.projectImagePoint; exports.projectImageRect = _chunkQCEQIRJQcjs.projectImageRect; exports.projectMaskCoverage = _chunkQCEQIRJQcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkQCEQIRJQcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkQCEQIRJQcjs.psdToLayers; exports.pullWarpMesh = _chunkRHXW4TA5cjs.pullWarpMesh; exports.put255 = _chunkLRRCMRSLcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkLRRCMRSLcjs.rand01; exports.randSigned = _chunkLRRCMRSLcjs.randSigned; exports.rangeLightness = _chunkQCEQIRJQcjs.rangeLightness; exports.rasterContents = _chunkQCEQIRJQcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkQCEQIRJQcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkQCEQIRJQcjs.rasterizeCoverage; exports.rasterizeDab = _chunkLRRCMRSLcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkQCEQIRJQcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkLRRCMRSLcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkQCEQIRJQcjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk6FUAHCVIcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkQCEQIRJQcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkQCEQIRJQcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkQCEQIRJQcjs.removeLayer; exports.removeLayerEffect = _chunkQCEQIRJQcjs.removeLayerEffect; exports.removeLayerFilter = _chunkQCEQIRJQcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkLRRCMRSLcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkQCEQIRJQcjs.removeSmartFilter; exports.renderBrushstroke = _chunkLRRCMRSLcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkQCEQIRJQcjs.renderShape; exports.renderShapeRect = _chunkQCEQIRJQcjs.renderShapeRect; exports.renderSmartObject = _chunkQCEQIRJQcjs.renderSmartObject; exports.renderText = _chunkQCEQIRJQcjs.renderText; exports.replaceContents = _chunkQCEQIRJQcjs.replaceContents; exports.replaceTextRange = _chunkQCEQIRJQcjs.replaceTextRange; exports.requireLayer = _chunkQCEQIRJQcjs.requireLayer; exports.requireOperation = _chunkQCEQIRJQcjs.requireOperation; exports.requireShapeLayer = _chunkQCEQIRJQcjs.requireShapeLayer; exports.requireSmartObject = _chunkQCEQIRJQcjs.requireSmartObject; exports.requireTypeLayer = _chunkQCEQIRJQcjs.requireTypeLayer; exports.requireUnlocked = _chunkQCEQIRJQcjs.requireUnlocked; exports.rerender = _chunkQCEQIRJQcjs.rerender; exports.rerenderShape = _chunkQCEQIRJQcjs.rerenderShape; exports.rerenderText = _chunkQCEQIRJQcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkQCEQIRJQcjs.resizeSelection; exports.resizeWarpMesh = _chunkRHXW4TA5cjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkQCEQIRJQcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkLRRCMRSLcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkRHXW4TA5cjs.restyleRange; exports.retouchFilter = _chunk6FUAHCVIcjs.retouchFilter; exports.reversePaintGradient = _chunkLRRCMRSLcjs.reversePaintGradient; exports.rgbToGray = _chunkQCEQIRJQcjs.rgbToGray; exports.rgbToHsl = _chunkQCEQIRJQcjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk6FUAHCVIcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkQCEQIRJQcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkQCEQIRJQcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkQCEQIRJQcjs.sampleLut; exports.sampleToneLut = _chunkQCEQIRJQcjs.sampleToneLut; exports.saturationOf = _chunk6FUAHCVIcjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkLRRCMRSLcjs.scalePaintGradient; exports.seamlessClone = _chunk6FUAHCVIcjs.seamlessClone; exports.seedFromString = _chunkLRRCMRSLcjs.seedFromString; exports.selectionArea = _chunkQCEQIRJQcjs.selectionArea; exports.selectionFromCoverage = _chunkQCEQIRJQcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkQCEQIRJQcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkQCEQIRJQcjs.selectionToCoverage; exports.selectionToPixels = _chunkQCEQIRJQcjs.selectionToPixels; exports.selectionValueAt = _chunkQCEQIRJQcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkQCEQIRJQcjs.serializeContents; exports.serializeEffects = _chunkQCEQIRJQcjs.serializeEffects; exports.serializeLayer = _chunkQCEQIRJQcjs.serializeLayer; exports.serializeLayers = _chunkQCEQIRJQcjs.serializeLayers; exports.serializeLayersExternal = _chunkQCEQIRJQcjs.serializeLayersExternal; exports.serializePatterns = _chunkQCEQIRJQcjs.serializePatterns; exports.serializeSelection = _chunkQCEQIRJQcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkQCEQIRJQcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkQCEQIRJQcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkQCEQIRJQcjs.setLayerMask; exports.setLayerProperties = _chunkQCEQIRJQcjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkQCEQIRJQcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkQCEQIRJQcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkQCEQIRJQcjs.setSmartPlacement; exports.shadeTile = _chunkGNK7SESQcjs.shadeTile; exports.shapeAsPixelLayer = _chunkQCEQIRJQcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkQCEQIRJQcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkQCEQIRJQcjs.shapeGeometryBounds; exports.shapeLayers = _chunkQCEQIRJQcjs.shapeLayers; exports.shapeOutline = _chunkQCEQIRJQcjs.shapeOutline; exports.shapeRenderClip = _chunkQCEQIRJQcjs.shapeRenderClip; exports.shiftCoverage = _chunkQCEQIRJQcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkQCEQIRJQcjs.smartObjectLayers; exports.smoothCoverage = _chunkQCEQIRJQcjs.smoothCoverage; exports.smoothPoints = _chunkLRRCMRSLcjs.smoothPoints; exports.smudgeEffect = _chunk6FUAHCVIcjs.smudgeEffect; exports.solidPaint = _chunkLRRCMRSLcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk6FUAHCVIcjs.solveMembrane; exports.spliceRuns = _chunkRHXW4TA5cjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk6FUAHCVIcjs.sponge; exports.spongeEffect = _chunk6FUAHCVIcjs.spongeEffect; exports.spotHealPixels = _chunk6FUAHCVIcjs.spotHealPixels; exports.spotHealWindow = _chunk6FUAHCVIcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkGNK7SESQcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkQCEQIRJQcjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.stepSlotTs = _chunkGNK7SESQcjs.stepSlotTs; exports.strokeGrainCatch = _chunkLRRCMRSLcjs.strokeGrainCatch; exports.styleAt = _chunkRHXW4TA5cjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkQCEQIRJQcjs.tempTintToXy; exports.temperatureToKelvin = _chunkQCEQIRJQcjs.temperatureToKelvin; exports.textIndexAt = _chunkRHXW4TA5cjs.textIndexAt; exports.textMatrix = _chunkQCEQIRJQcjs.textMatrix; exports.textOutlines = _chunkQCEQIRJQcjs.textOutlines; exports.textRange = _chunkQCEQIRJQcjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkLRRCMRSLcjs.tipFalloff; exports.tipReach = _chunkLRRCMRSLcjs.tipReach; exports.tipShape = _chunkLRRCMRSLcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkQCEQIRJQcjs.toTextSpace; exports.toneCurve = _chunkQCEQIRJQcjs.toneCurve; exports.toneLuts = _chunkQCEQIRJQcjs.toneLuts; exports.toneOf = _chunk6FUAHCVIcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkQCEQIRJQcjs.transformHomography; exports.transformMap = _chunkQCEQIRJQcjs.transformMap; exports.transformShapeComponents = _chunkQCEQIRJQcjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkQCEQIRJQcjs.transformTypeLayer; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkQCEQIRJQcjs.transformedBox; exports.transformedPoint = _chunkQCEQIRJQcjs.transformedPoint; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkQCEQIRJQcjs.typeAsPixelLayer; exports.typeFrame = _chunkQCEQIRJQcjs.typeFrame; exports.typeFromAnnotation = _chunkQCEQIRJQcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkQCEQIRJQcjs.typeLayerName; exports.ungroupLayer = _chunkQCEQIRJQcjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkQCEQIRJQcjs.unionRect; exports.unprojectCanvasPoint = _chunkQCEQIRJQcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkQCEQIRJQcjs.updateLayerEffect; exports.updateLayerFilter = _chunkQCEQIRJQcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkQCEQIRJQcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkLRRCMRSLcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkQCEQIRJQcjs.updateShapeLayer; exports.updateSmartFilter = _chunkQCEQIRJQcjs.updateSmartFilter; exports.updateTypeLayer = _chunkQCEQIRJQcjs.updateTypeLayer; exports.uvToXy = _chunkQCEQIRJQcjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkQCEQIRJQcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkQCEQIRJQcjs.vibranceLinear; exports.vibrancePixel = _chunkQCEQIRJQcjs.vibrancePixel; exports.walkDabs = _chunkLRRCMRSLcjs.walkDabs; exports.warpMeshEditPoints = _chunkRHXW4TA5cjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkRHXW4TA5cjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkRHXW4TA5cjs.warpMeshParamAt; exports.warpPresetMesh = _chunkRHXW4TA5cjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.wbMatrix = _chunkQCEQIRJQcjs.wbMatrix; exports.wetGpuSupport = _chunkGNK7SESQcjs.wetGpuSupport; exports.wetSimdSupported = _chunkGNK7SESQcjs.wetSimdSupported; exports.wetSupport = _chunkGNK7SESQcjs.wetSupport; exports.whiteBalanceFromSample = _chunkQCEQIRJQcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkQCEQIRJQcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkQCEQIRJQcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkQCEQIRJQcjs.withNewIds; exports.writeAdjustmentBlock = _chunkQCEQIRJQcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkQCEQIRJQcjs.writeLfx2; exports.writePatternBlock = _chunkQCEQIRJQcjs.writePatternBlock; exports.writePsd = _chunkQCEQIRJQcjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkQCEQIRJQcjs.xyToTempTint; exports.xyToUv = _chunkQCEQIRJQcjs.xyToUv;
|