@pixerate/editor 0.98.0 → 0.100.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11;
|
|
2
2
|
|
|
3
3
|
var _chunkD6FH2YAXcjs = require('../chunk-D6FH2YAX.cjs');
|
|
4
4
|
|
|
@@ -3193,6 +3193,66 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3193
3193
|
}
|
|
3194
3194
|
ctx.restore();
|
|
3195
3195
|
}
|
|
3196
|
+
if (options.freeTransform) {
|
|
3197
|
+
const t = options.freeTransform;
|
|
3198
|
+
ctx.save();
|
|
3199
|
+
try {
|
|
3200
|
+
const scr = (p) => projectImagePoint(p, projection);
|
|
3201
|
+
ctx.beginPath();
|
|
3202
|
+
if (t.warp) {
|
|
3203
|
+
for (const c of t.warp.curves) {
|
|
3204
|
+
const [a, b, d, e] = c.map(scr);
|
|
3205
|
+
ctx.moveTo(a.x, a.y);
|
|
3206
|
+
ctx.bezierCurveTo(b.x, b.y, d.x, d.y, e.x, e.y);
|
|
3207
|
+
}
|
|
3208
|
+
for (const h of t.warp.handles) {
|
|
3209
|
+
const a = scr(h.anchor);
|
|
3210
|
+
const q2 = scr(h.point);
|
|
3211
|
+
ctx.moveTo(a.x, a.y);
|
|
3212
|
+
ctx.lineTo(q2.x, q2.y);
|
|
3213
|
+
}
|
|
3214
|
+
} else {
|
|
3215
|
+
const outline = t.outline.map(scr);
|
|
3216
|
+
outline.forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
|
|
3217
|
+
ctx.closePath();
|
|
3218
|
+
}
|
|
3219
|
+
ctx.lineWidth = 3;
|
|
3220
|
+
ctx.strokeStyle = "rgba(0,0,0,0.5)";
|
|
3221
|
+
ctx.stroke();
|
|
3222
|
+
ctx.lineWidth = 1;
|
|
3223
|
+
ctx.strokeStyle = "#ffffff";
|
|
3224
|
+
ctx.stroke();
|
|
3225
|
+
for (const h of [...t.handles, ..._nullishCoalesce(_optionalChain([t, 'access', _46 => _46.warp, 'optionalAccess', _47 => _47.anchors]), () => ( []))].map(scr)) {
|
|
3226
|
+
ctx.fillStyle = "#ffffff";
|
|
3227
|
+
ctx.strokeStyle = "#1e293b";
|
|
3228
|
+
ctx.fillRect(h.x - 4, h.y - 4, 8, 8);
|
|
3229
|
+
ctx.strokeRect(h.x - 4, h.y - 4, 8, 8);
|
|
3230
|
+
}
|
|
3231
|
+
for (const h of (_nullishCoalesce(_optionalChain([t, 'access', _48 => _48.warp, 'optionalAccess', _49 => _49.handles]), () => ( []))).map((w) => scr(w.point))) {
|
|
3232
|
+
ctx.beginPath();
|
|
3233
|
+
ctx.arc(h.x, h.y, 3, 0, Math.PI * 2);
|
|
3234
|
+
ctx.fillStyle = "#ffffff";
|
|
3235
|
+
ctx.fill();
|
|
3236
|
+
ctx.strokeStyle = "#1e293b";
|
|
3237
|
+
ctx.stroke();
|
|
3238
|
+
}
|
|
3239
|
+
const r = scr(t.reference);
|
|
3240
|
+
ctx.beginPath();
|
|
3241
|
+
ctx.arc(r.x, r.y, 5, 0, Math.PI * 2);
|
|
3242
|
+
ctx.moveTo(r.x - 8, r.y);
|
|
3243
|
+
ctx.lineTo(r.x + 8, r.y);
|
|
3244
|
+
ctx.moveTo(r.x, r.y - 8);
|
|
3245
|
+
ctx.lineTo(r.x, r.y + 8);
|
|
3246
|
+
ctx.lineWidth = 3;
|
|
3247
|
+
ctx.strokeStyle = "rgba(0,0,0,0.5)";
|
|
3248
|
+
ctx.stroke();
|
|
3249
|
+
ctx.lineWidth = 1;
|
|
3250
|
+
ctx.strokeStyle = "#ffffff";
|
|
3251
|
+
ctx.stroke();
|
|
3252
|
+
} catch (e6) {
|
|
3253
|
+
}
|
|
3254
|
+
ctx.restore();
|
|
3255
|
+
}
|
|
3196
3256
|
if (isActivelyCropping) {
|
|
3197
3257
|
const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
|
|
3198
3258
|
this.drawCropOverlay(ctx, getViewportMetrics(geoState, vpWidth, vpHeight, true, activeCrop));
|
|
@@ -3257,10 +3317,10 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3257
3317
|
applyDepthMask(imageData, maskData, depthMask);
|
|
3258
3318
|
}
|
|
3259
3319
|
}
|
|
3260
|
-
} catch (
|
|
3320
|
+
} catch (e7) {
|
|
3261
3321
|
}
|
|
3262
3322
|
}
|
|
3263
|
-
_optionalChain([onPixels, 'optionalCall',
|
|
3323
|
+
_optionalChain([onPixels, 'optionalCall', _50 => _50(imageData)]);
|
|
3264
3324
|
baseCtx.putImageData(imageData, 0, 0);
|
|
3265
3325
|
}
|
|
3266
3326
|
return baseCanvas;
|
|
@@ -3269,7 +3329,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3269
3329
|
/** Which base path renders `state` (see `needsLegacyBase`). */
|
|
3270
3330
|
chooseRoute(state, region, naturalWidth, naturalHeight) {
|
|
3271
3331
|
let route;
|
|
3272
|
-
if (!_optionalChain([state, 'access',
|
|
3332
|
+
if (!_optionalChain([state, 'access', _51 => _51.layers, 'optionalAccess', _52 => _52.length])) route = "legacy";
|
|
3273
3333
|
else if (this.baseRoute === "layers") route = "layers";
|
|
3274
3334
|
else {
|
|
3275
3335
|
const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
|
|
@@ -3279,7 +3339,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3279
3339
|
region,
|
|
3280
3340
|
canvas: { width: naturalWidth, height: naturalHeight },
|
|
3281
3341
|
transform: state.transform,
|
|
3282
|
-
sourceOpaque: _nullishCoalesce(_optionalChain([this, 'access',
|
|
3342
|
+
sourceOpaque: _nullishCoalesce(_optionalChain([this, 'access', _53 => _53.layerSources, 'optionalAccess', _54 => _54.sourceIsOpaque, 'call', _55 => _55()]), () => ( true))
|
|
3283
3343
|
}) ? "legacy" : "layers";
|
|
3284
3344
|
}
|
|
3285
3345
|
this.lastBaseRoute = route;
|
|
@@ -3297,36 +3357,36 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3297
3357
|
return _nullishCoalesce(this.depthMaps.get(`${source.maskSource}|${width}x${height}`), () => ( null));
|
|
3298
3358
|
},
|
|
3299
3359
|
rasterizeAnnotation: (annotation, rect) => this.rasterizeAnnotation(annotation, rect),
|
|
3300
|
-
version: `${_nullishCoalesce(_optionalChain([host, 'optionalAccess',
|
|
3301
|
-
globalLight: _optionalChain([host, 'optionalAccess',
|
|
3302
|
-
pattern: _optionalChain([host, 'optionalAccess',
|
|
3360
|
+
version: `${_nullishCoalesce(_optionalChain([host, 'optionalAccess', _56 => _56.version, 'call', _57 => _57()]), () => ( ""))}:${this.assetVersion}`,
|
|
3361
|
+
globalLight: _optionalChain([host, 'optionalAccess', _58 => _58.globalLight, 'optionalCall', _59 => _59()]),
|
|
3362
|
+
pattern: _optionalChain([host, 'optionalAccess', _60 => _60.pattern]) ? (id) => host.pattern(id) : void 0
|
|
3303
3363
|
};
|
|
3304
3364
|
}
|
|
3305
3365
|
/** Loads what the compositor reads synchronously: depth maps (at canvas size) and annotation images. */
|
|
3306
3366
|
/** Loads depth maps and annotation images the compositor reads synchronously. */
|
|
3307
3367
|
async prepareLayerAssets(layers, width, height) {
|
|
3308
3368
|
for (const l of _chunkWT6ZAWJPcjs.flattenLayers.call(void 0, layers)) {
|
|
3309
|
-
const source = _optionalChain([l, 'access',
|
|
3310
|
-
if (_optionalChain([source, 'optionalAccess',
|
|
3369
|
+
const source = _optionalChain([l, 'access', _61 => _61.mask, 'optionalAccess', _62 => _62.source]);
|
|
3370
|
+
if (_optionalChain([source, 'optionalAccess', _63 => _63.enabled]) && source.maskSource) {
|
|
3311
3371
|
const key = `${source.maskSource}|${width}x${height}`;
|
|
3312
3372
|
if (this.depthMaps.has(key)) continue;
|
|
3313
3373
|
try {
|
|
3314
3374
|
const maskImg = await this.imageCache.get(source.maskSource);
|
|
3315
3375
|
const canvas = this.createCanvas(width, height);
|
|
3316
3376
|
const mctx = canvas.getContext("2d");
|
|
3317
|
-
const data = mctx ? (mctx.drawImage(maskImg, 0, 0, width, height), _optionalChain([mctx, 'access',
|
|
3377
|
+
const data = mctx ? (mctx.drawImage(maskImg, 0, 0, width, height), _optionalChain([mctx, 'access', _64 => _64.getImageData, 'optionalCall', _65 => _65(0, 0, width, height)])) : null;
|
|
3318
3378
|
if (data) {
|
|
3319
3379
|
this.depthMaps.set(key, { width, height, data: data.data });
|
|
3320
3380
|
this.assetVersion++;
|
|
3321
3381
|
}
|
|
3322
|
-
} catch (
|
|
3382
|
+
} catch (e8) {
|
|
3323
3383
|
}
|
|
3324
3384
|
}
|
|
3325
3385
|
if (l.type === "annotation" && l.annotation.type === "image" && !this.imageCache.peek(l.annotation.src)) {
|
|
3326
3386
|
try {
|
|
3327
3387
|
await this.imageCache.get(l.annotation.src);
|
|
3328
3388
|
this.assetVersion++;
|
|
3329
|
-
} catch (
|
|
3389
|
+
} catch (e9) {
|
|
3330
3390
|
}
|
|
3331
3391
|
}
|
|
3332
3392
|
}
|
|
@@ -3354,7 +3414,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3354
3414
|
this.drawAnnotationShape(ctx, annotation, img);
|
|
3355
3415
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
3356
3416
|
return new Uint8ClampedArray(ctx.getImageData(0, 0, rect.width, rect.height).data);
|
|
3357
|
-
} catch (
|
|
3417
|
+
} catch (e10) {
|
|
3358
3418
|
return null;
|
|
3359
3419
|
}
|
|
3360
3420
|
}
|
|
@@ -3434,7 +3494,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3434
3494
|
const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
|
|
3435
3495
|
const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
|
|
3436
3496
|
if (!(opacity < 1) && !(blur > 0)) return null;
|
|
3437
|
-
const data = _optionalChain([ctx, 'access',
|
|
3497
|
+
const data = _optionalChain([ctx, 'access', _66 => _66.getImageData, 'optionalCall', _67 => _67(0, 0, w, h)]);
|
|
3438
3498
|
if (!data) return null;
|
|
3439
3499
|
applyOutputStage(data, opacity, blur);
|
|
3440
3500
|
ctx.putImageData(data, 0, 0);
|
|
@@ -3443,7 +3503,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3443
3503
|
publishHistogram(histogram) {
|
|
3444
3504
|
if (histogram === this.previewHistogram) return;
|
|
3445
3505
|
this.previewHistogram = histogram;
|
|
3446
|
-
_optionalChain([this, 'access',
|
|
3506
|
+
_optionalChain([this, 'access', _68 => _68.onPreviewHistogram, 'optionalCall', _69 => _69(histogram)]);
|
|
3447
3507
|
}
|
|
3448
3508
|
__init19() {this.quickMaskCache = /* @__PURE__ */ new WeakMap()}
|
|
3449
3509
|
__init20() {this.outlineCache = /* @__PURE__ */ new WeakMap()}
|
|
@@ -3553,7 +3613,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3553
3613
|
_chunkCRMAXIUVcjs.blendImageData.call(void 0, backdrop, source, _chunkCRMAXIUVcjs.normalizeBlendMode.call(void 0, ann.blend));
|
|
3554
3614
|
lctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
3555
3615
|
lctx.putImageData(backdrop, 0, 0);
|
|
3556
|
-
} catch (
|
|
3616
|
+
} catch (e11) {
|
|
3557
3617
|
return false;
|
|
3558
3618
|
}
|
|
3559
3619
|
ctx.save();
|
|
@@ -3569,7 +3629,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3569
3629
|
if (ann.type === "image") {
|
|
3570
3630
|
try {
|
|
3571
3631
|
img = await this.imageCache.get(ann.src);
|
|
3572
|
-
} catch (
|
|
3632
|
+
} catch (e12) {
|
|
3573
3633
|
}
|
|
3574
3634
|
}
|
|
3575
3635
|
this.drawAnnotationShape(ctx, ann, img);
|
|
@@ -3856,8 +3916,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3856
3916
|
if (!ctx) return maskCanvas;
|
|
3857
3917
|
ctx.fillStyle = MASK_BLACK;
|
|
3858
3918
|
ctx.fillRect(0, 0, naturalWidth, naturalHeight);
|
|
3859
|
-
const useCrop = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3860
|
-
const useAnnotations = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3919
|
+
const useCrop = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _70 => _70.useCrop]), () => ( true));
|
|
3920
|
+
const useAnnotations = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _71 => _71.useAnnotations]), () => ( true));
|
|
3861
3921
|
if (useCrop && state.crop) {
|
|
3862
3922
|
ctx.fillStyle = MASK_WHITE;
|
|
3863
3923
|
ctx.fillRect(state.crop.x, state.crop.y, state.crop.width, state.crop.height);
|
|
@@ -3867,8 +3927,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
|
|
|
3867
3927
|
this.drawAnnotationMask(ctx, ann);
|
|
3868
3928
|
}
|
|
3869
3929
|
}
|
|
3870
|
-
const imageData = _optionalChain([ctx, 'access',
|
|
3871
|
-
const selection = (_nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3930
|
+
const imageData = _optionalChain([ctx, 'access', _72 => _72.getImageData, 'optionalCall', _73 => _73(0, 0, naturalWidth, naturalHeight)]);
|
|
3931
|
+
const selection = (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _74 => _74.useSelection]), () => ( true))) && _optionalChain([state, 'access', _75 => _75.selection, 'optionalAccess', _76 => _76.bounds]) && state.selection.width === naturalWidth && state.selection.height === naturalHeight ? state.selection : null;
|
|
3872
3932
|
if (imageData) {
|
|
3873
3933
|
const d = imageData.data;
|
|
3874
3934
|
for (let i = 0; i < d.length; i += 4) {
|
|
@@ -4001,7 +4061,7 @@ function removeAnnotationLayers(layers) {
|
|
|
4001
4061
|
function polygonCoverage(points, width, height, antiAlias = true) {
|
|
4002
4062
|
const m = new Float32Array(width * height);
|
|
4003
4063
|
if (points.length < 3 || width <= 0 || height <= 0) return m;
|
|
4004
|
-
const
|
|
4064
|
+
const sub2 = antiAlias ? 4 : 1;
|
|
4005
4065
|
const edges = [];
|
|
4006
4066
|
for (let i = 0; i < points.length; i++) {
|
|
4007
4067
|
const a = points[i];
|
|
@@ -4016,8 +4076,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
4016
4076
|
const xs = [];
|
|
4017
4077
|
for (let py = 0; py < height; py++) {
|
|
4018
4078
|
const row = py * width;
|
|
4019
|
-
for (let s = 0; s <
|
|
4020
|
-
const y = py + (s + 0.5) /
|
|
4079
|
+
for (let s = 0; s < sub2; s++) {
|
|
4080
|
+
const y = py + (s + 0.5) / sub2;
|
|
4021
4081
|
while (next < edges.length && edges[next].top <= y) active.push(edges[next++]);
|
|
4022
4082
|
if (active.length) active = active.filter((e) => e.bottom > y);
|
|
4023
4083
|
if (!active.length) continue;
|
|
@@ -4039,7 +4099,7 @@ function polygonCoverage(points, width, height, antiAlias = true) {
|
|
|
4039
4099
|
const c = cx + 0.5;
|
|
4040
4100
|
cov = c >= x0 && c < x1 ? 1 : 0;
|
|
4041
4101
|
}
|
|
4042
|
-
if (cov > 0) m[row + cx] += cov /
|
|
4102
|
+
if (cov > 0) m[row + cx] += cov / sub2;
|
|
4043
4103
|
}
|
|
4044
4104
|
}
|
|
4045
4105
|
}
|
|
@@ -4606,7 +4666,7 @@ function deserializeEffects(raw) {
|
|
|
4606
4666
|
if (p && typeof p.key === "string" && typeof p.data === "string") {
|
|
4607
4667
|
try {
|
|
4608
4668
|
psd = { key: p.key, data: _chunkWT6ZAWJPcjs.base64ToBytes.call(void 0, p.data) };
|
|
4609
|
-
} catch (
|
|
4669
|
+
} catch (e13) {
|
|
4610
4670
|
psd = void 0;
|
|
4611
4671
|
}
|
|
4612
4672
|
}
|
|
@@ -4645,7 +4705,7 @@ function serializeLayer(layer, ctx) {
|
|
|
4645
4705
|
}
|
|
4646
4706
|
}
|
|
4647
4707
|
if (layer.fillOpacity !== void 0 && layer.fillOpacity !== 1) out.fillOpacity = layer.fillOpacity;
|
|
4648
|
-
if (_optionalChain([layer, 'access',
|
|
4708
|
+
if (_optionalChain([layer, 'access', _77 => _77.filters, 'optionalAccess', _78 => _78.length])) out.filters = JSON.parse(JSON.stringify(layer.filters));
|
|
4649
4709
|
return out;
|
|
4650
4710
|
}
|
|
4651
4711
|
case "adjustment":
|
|
@@ -4824,7 +4884,7 @@ function deserializeLayer(raw, ctx) {
|
|
|
4824
4884
|
...base,
|
|
4825
4885
|
type: "pixel",
|
|
4826
4886
|
surface: r.source === "document" ? _chunkCRMAXIUVcjs.emptySurface.call(void 0, 4) : readSurface(r.asset, r.x, r.y, 4, 0, ctx, `Layer "${base.name || id}"`),
|
|
4827
|
-
offset: { x: Math.round(num(_optionalChain([r, 'access',
|
|
4887
|
+
offset: { x: Math.round(num(_optionalChain([r, 'access', _79 => _79.offset, 'optionalAccess', _80 => _80.x]), -1e7, 1e7, 0)), y: Math.round(num(_optionalChain([r, 'access', _81 => _81.offset, 'optionalAccess', _82 => _82.y]), -1e7, 1e7, 0)) }
|
|
4828
4888
|
};
|
|
4829
4889
|
if (r.source === "document") layer.source = "document";
|
|
4830
4890
|
if (typeof r.fillOpacity === "number" && r.fillOpacity !== 1) layer.fillOpacity = num(r.fillOpacity, 0, 1, 1);
|
|
@@ -4900,7 +4960,7 @@ function placeLayer(layers, layer, placement = {}, defaultIndex) {
|
|
|
4900
4960
|
if (given > 1) fail("Give only one of aboveId, belowId and parentId.");
|
|
4901
4961
|
if (placement.aboveId || placement.belowId) {
|
|
4902
4962
|
const ref = requireLayer(layers, _nullishCoalesce(placement.aboveId, () => ( placement.belowId)));
|
|
4903
|
-
return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, layer, _nullishCoalesce(_optionalChain([ref, 'access',
|
|
4963
|
+
return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, layer, _nullishCoalesce(_optionalChain([ref, 'access', _83 => _83.parent, 'optionalAccess', _84 => _84.id]), () => ( null)), ref.index + (placement.aboveId ? 1 : 0));
|
|
4904
4964
|
}
|
|
4905
4965
|
if (placement.parentId) {
|
|
4906
4966
|
const ref = requireLayer(layers, placement.parentId);
|
|
@@ -4938,7 +4998,7 @@ function duplicateLayer(layers, id, name) {
|
|
|
4938
4998
|
const copy = withNewIds(loc.layer);
|
|
4939
4999
|
copy.name = _nullishCoalesce(name, () => ( `${loc.layer.name || "Layer"} copy`));
|
|
4940
5000
|
delete copy.locks;
|
|
4941
|
-
return { layers: _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
5001
|
+
return { layers: _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _85 => _85.parent, 'optionalAccess', _86 => _86.id]), () => ( null)), loc.index + 1), id: copy.id };
|
|
4942
5002
|
}
|
|
4943
5003
|
function setLayerProperties(layers, id, props) {
|
|
4944
5004
|
const loc = requireLayer(layers, id);
|
|
@@ -4990,8 +5050,8 @@ function setLayerProperties(layers, id, props) {
|
|
|
4990
5050
|
function groupLayers(layers, ids, name = "Group") {
|
|
4991
5051
|
if (!ids.length) fail("Give at least one layer id to group.");
|
|
4992
5052
|
const locs = ids.map((id) => requireLayer(layers, id));
|
|
4993
|
-
const parent = _nullishCoalesce(_optionalChain([locs, 'access',
|
|
4994
|
-
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access',
|
|
5053
|
+
const parent = _nullishCoalesce(_optionalChain([locs, 'access', _87 => _87[0], 'access', _88 => _88.parent, 'optionalAccess', _89 => _89.id]), () => ( null));
|
|
5054
|
+
if (locs.some((l) => (_nullishCoalesce(_optionalChain([l, 'access', _90 => _90.parent, 'optionalAccess', _91 => _91.id]), () => ( null))) !== parent)) fail("Layers to group must share one parent; move them next to each other first.");
|
|
4995
5055
|
for (const l of locs) requireUnlocked(l.layer, "all", "group it");
|
|
4996
5056
|
const ordered = [...new Set(locs)].sort((a, b) => a.index - b.index);
|
|
4997
5057
|
const top = ordered[ordered.length - 1].index;
|
|
@@ -5008,7 +5068,7 @@ function groupLayers(layers, ids, name = "Group") {
|
|
|
5008
5068
|
return c;
|
|
5009
5069
|
})
|
|
5010
5070
|
};
|
|
5011
|
-
if (_optionalChain([group, 'access',
|
|
5071
|
+
if (_optionalChain([group, 'access', _92 => _92.children, 'access', _93 => _93[0], 'optionalAccess', _94 => _94.clipped])) {
|
|
5012
5072
|
const c = { ...group.children[0] };
|
|
5013
5073
|
delete c.clipped;
|
|
5014
5074
|
group.children[0] = c;
|
|
@@ -5024,7 +5084,7 @@ function ungroupLayer(layers, id) {
|
|
|
5024
5084
|
const group = loc.layer;
|
|
5025
5085
|
let out = _chunkWT6ZAWJPcjs.mapLayer.call(void 0, layers, id, () => null);
|
|
5026
5086
|
group.children.forEach((c, i) => {
|
|
5027
|
-
out = _chunkWT6ZAWJPcjs.insertLayer.call(void 0, out, c, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
5087
|
+
out = _chunkWT6ZAWJPcjs.insertLayer.call(void 0, out, c, _nullishCoalesce(_optionalChain([loc, 'access', _95 => _95.parent, 'optionalAccess', _96 => _96.id]), () => ( null)), loc.index + i);
|
|
5028
5088
|
});
|
|
5029
5089
|
return { layers: out, ids: group.children.map((c) => c.id) };
|
|
5030
5090
|
}
|
|
@@ -5082,7 +5142,7 @@ function requirePixelLayer(layers, id) {
|
|
|
5082
5142
|
}
|
|
5083
5143
|
function addLayerFilter(layers, id, filter) {
|
|
5084
5144
|
const layer = requirePixelLayer(layers, id);
|
|
5085
|
-
if (_optionalChain([layer, 'access',
|
|
5145
|
+
if (_optionalChain([layer, 'access', _97 => _97.filters, 'optionalAccess', _98 => _98.some, 'call', _99 => _99((f) => f.kind === filter.kind)])) fail(`Layer "${id}" already has a ${filter.kind} filter; change it with update_layer_filter.`);
|
|
5086
5146
|
return _chunkWT6ZAWJPcjs.mapLayer.call(void 0, layers, id, () => ({ ...layer, filters: [..._nullishCoalesce(layer.filters, () => ( [])), filter] }));
|
|
5087
5147
|
}
|
|
5088
5148
|
function updateLayerFilter(layers, id, filterId, changes) {
|
|
@@ -5146,7 +5206,7 @@ function addLayerEffect(layers, id, kind, params = {}, index) {
|
|
|
5146
5206
|
return { layers: setLayerEffects(layers, id, { ...current, items }), effect };
|
|
5147
5207
|
}
|
|
5148
5208
|
function requireEffect(layer, effectId) {
|
|
5149
|
-
const items = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
5209
|
+
const items = _nullishCoalesce(_optionalChain([layer, 'access', _100 => _100.effects, 'optionalAccess', _101 => _101.items]), () => ( []));
|
|
5150
5210
|
const i = items.findIndex((e) => e.id === effectId);
|
|
5151
5211
|
if (i === -1) fail(`Layer "${layer.name || layer.id}" has no effect "${effectId}". Effects: ${items.map((e) => `${e.id} (${e.kind})`).join(", ") || "none"}; call list_layer_effects.`);
|
|
5152
5212
|
return i;
|
|
@@ -5413,7 +5473,7 @@ var PsdWriter = (_class4 = class {constructor() { _class4.prototype.__init24.cal
|
|
|
5413
5473
|
function decodeLegacyName(b) {
|
|
5414
5474
|
try {
|
|
5415
5475
|
return new TextDecoder("utf-8", { fatal: true }).decode(b);
|
|
5416
|
-
} catch (
|
|
5476
|
+
} catch (e14) {
|
|
5417
5477
|
return String.fromCharCode(...b);
|
|
5418
5478
|
}
|
|
5419
5479
|
}
|
|
@@ -5434,7 +5494,7 @@ function descriptor(classId, items = []) {
|
|
|
5434
5494
|
return { name: "", classId, items };
|
|
5435
5495
|
}
|
|
5436
5496
|
function descGet(d, key) {
|
|
5437
|
-
return _optionalChain([d, 'access',
|
|
5497
|
+
return _optionalChain([d, 'access', _102 => _102.items, 'access', _103 => _103.find, 'call', _104 => _104(([k]) => k === key), 'optionalAccess', _105 => _105[1]]);
|
|
5438
5498
|
}
|
|
5439
5499
|
function descNumber(d, key) {
|
|
5440
5500
|
const v = descGet(d, key);
|
|
@@ -5444,7 +5504,7 @@ function descNumber(d, key) {
|
|
|
5444
5504
|
}
|
|
5445
5505
|
function descBool(d, key) {
|
|
5446
5506
|
const v = descGet(d, key);
|
|
5447
|
-
return _optionalChain([v, 'optionalAccess',
|
|
5507
|
+
return _optionalChain([v, 'optionalAccess', _106 => _106.type]) === "bool" ? v.value : void 0;
|
|
5448
5508
|
}
|
|
5449
5509
|
function descObject(d, key) {
|
|
5450
5510
|
const v = descGet(d, key);
|
|
@@ -5915,7 +5975,7 @@ function parseAdjustmentBlock(key, data) {
|
|
|
5915
5975
|
default:
|
|
5916
5976
|
return null;
|
|
5917
5977
|
}
|
|
5918
|
-
} catch (
|
|
5978
|
+
} catch (e15) {
|
|
5919
5979
|
return null;
|
|
5920
5980
|
}
|
|
5921
5981
|
}
|
|
@@ -6333,7 +6393,7 @@ function parseMask(d) {
|
|
|
6333
6393
|
}
|
|
6334
6394
|
if (!realFirst) m.real = readReal();
|
|
6335
6395
|
return m;
|
|
6336
|
-
} catch (
|
|
6396
|
+
} catch (e16) {
|
|
6337
6397
|
return void 0;
|
|
6338
6398
|
}
|
|
6339
6399
|
}
|
|
@@ -6407,14 +6467,14 @@ function readPsd(bytes) {
|
|
|
6407
6467
|
return { header, colorModeData, resources, layers, mergedAlpha, globalBlocks, imageCompression, imageData: r.rest() };
|
|
6408
6468
|
}
|
|
6409
6469
|
function layerBlock(rec, key) {
|
|
6410
|
-
return _optionalChain([rec, 'access',
|
|
6470
|
+
return _optionalChain([rec, 'access', _107 => _107.blocks, 'access', _108 => _108.find, 'call', _109 => _109((b) => b.key === key), 'optionalAccess', _110 => _110.data]);
|
|
6411
6471
|
}
|
|
6412
6472
|
function layerName(rec) {
|
|
6413
6473
|
const luni = layerBlock(rec, "luni");
|
|
6414
6474
|
if (luni) {
|
|
6415
6475
|
try {
|
|
6416
6476
|
return new PsdReader(luni).unicode();
|
|
6417
|
-
} catch (
|
|
6477
|
+
} catch (e17) {
|
|
6418
6478
|
}
|
|
6419
6479
|
}
|
|
6420
6480
|
return rec.legacyName;
|
|
@@ -6438,7 +6498,7 @@ function u8Block(rec, key) {
|
|
|
6438
6498
|
function layerTree(file) {
|
|
6439
6499
|
const stack = [[]];
|
|
6440
6500
|
file.layers.forEach((rec, index) => {
|
|
6441
|
-
const kind = _nullishCoalesce(_optionalChain([sectionDivider, 'call',
|
|
6501
|
+
const kind = _nullishCoalesce(_optionalChain([sectionDivider, 'call', _111 => _111(rec), 'optionalAccess', _112 => _112.kind]), () => ( SECTION_OTHER));
|
|
6442
6502
|
if (kind === SECTION_DIVIDER) {
|
|
6443
6503
|
stack.push([]);
|
|
6444
6504
|
} else if (kind === SECTION_OPEN || kind === SECTION_CLOSED) {
|
|
@@ -6456,7 +6516,7 @@ function layerTree(file) {
|
|
|
6456
6516
|
}
|
|
6457
6517
|
function channelRect(rec, id) {
|
|
6458
6518
|
if (id === CHANNEL_USER_MASK && rec.mask) return rec.mask.rect;
|
|
6459
|
-
if (id === CHANNEL_REAL_USER_MASK && rec.mask) return _nullishCoalesce(_optionalChain([rec, 'access',
|
|
6519
|
+
if (id === CHANNEL_REAL_USER_MASK && rec.mask) return _nullishCoalesce(_optionalChain([rec, 'access', _113 => _113.mask, 'access', _114 => _114.real, 'optionalAccess', _115 => _115.rect]), () => ( rec.mask.rect));
|
|
6460
6520
|
return rec.rect;
|
|
6461
6521
|
}
|
|
6462
6522
|
function decodeLayerChannel(file, rec, id) {
|
|
@@ -6474,7 +6534,7 @@ function decodeMergedImage(file) {
|
|
|
6474
6534
|
return decodePlanes(file.imageCompression, file.imageData, { planes: channels, width, height, depth, psb });
|
|
6475
6535
|
}
|
|
6476
6536
|
function resource(file, id) {
|
|
6477
|
-
return _optionalChain([file, 'access',
|
|
6537
|
+
return _optionalChain([file, 'access', _116 => _116.resources, 'access', _117 => _117.find, 'call', _118 => _118((r) => r.id === id), 'optionalAccess', _119 => _119.data]);
|
|
6478
6538
|
}
|
|
6479
6539
|
function resolution(file) {
|
|
6480
6540
|
const d = resource(file, 1005);
|
|
@@ -6801,15 +6861,15 @@ var pct = (d, key, fallback) => num2(d, key, fallback * 100) / 100;
|
|
|
6801
6861
|
var bool = (d, key) => descBool(d, key) === true;
|
|
6802
6862
|
var enumOf = (d, key) => {
|
|
6803
6863
|
const v = descGet(d, key);
|
|
6804
|
-
return _optionalChain([v, 'optionalAccess',
|
|
6864
|
+
return _optionalChain([v, 'optionalAccess', _120 => _120.type]) === "enum" ? v.value : void 0;
|
|
6805
6865
|
};
|
|
6806
6866
|
var text = (d, key) => {
|
|
6807
6867
|
const v = d ? descGet(d, key) : void 0;
|
|
6808
|
-
return _optionalChain([v, 'optionalAccess',
|
|
6868
|
+
return _optionalChain([v, 'optionalAccess', _121 => _121.type]) === "TEXT" ? v.value : "";
|
|
6809
6869
|
};
|
|
6810
6870
|
var list = (d, key) => {
|
|
6811
6871
|
const v = descGet(d, key);
|
|
6812
|
-
if (_optionalChain([v, 'optionalAccess',
|
|
6872
|
+
if (_optionalChain([v, 'optionalAccess', _122 => _122.type]) !== "VlLs") return [];
|
|
6813
6873
|
return v.items.flatMap((it) => it.type === "Objc" || it.type === "GlbO" ? [it.value] : []);
|
|
6814
6874
|
};
|
|
6815
6875
|
var clamp3 = (v, lo, hi) => Number.isFinite(v) ? Math.min(hi, Math.max(lo, v)) : lo;
|
|
@@ -6879,8 +6939,8 @@ function contourOf(d, key) {
|
|
|
6879
6939
|
return { name, points };
|
|
6880
6940
|
}
|
|
6881
6941
|
function contourDesc(c) {
|
|
6882
|
-
const name = _nullishCoalesce(_optionalChain([c, 'optionalAccess',
|
|
6883
|
-
const points = _nullishCoalesce(_optionalChain([c, 'optionalAccess',
|
|
6942
|
+
const name = _nullishCoalesce(_optionalChain([c, 'optionalAccess', _123 => _123.name]), () => ( "Linear"));
|
|
6943
|
+
const points = _nullishCoalesce(_optionalChain([c, 'optionalAccess', _124 => _124.points]), () => ( [
|
|
6884
6944
|
{ input: 0, output: 0 },
|
|
6885
6945
|
{ input: 1, output: 1 }
|
|
6886
6946
|
]));
|
|
@@ -6915,7 +6975,7 @@ function gradientOf(d, notes) {
|
|
|
6915
6975
|
{ position: 0, color: "#000000" },
|
|
6916
6976
|
{ position: 1, color: "#ffffff" }
|
|
6917
6977
|
],
|
|
6918
|
-
style: _nullishCoalesce(_optionalChain([GRADIENT_STYLES, 'access',
|
|
6978
|
+
style: _nullishCoalesce(_optionalChain([GRADIENT_STYLES, 'access', _125 => _125.find, 'call', _126 => _126(([, id]) => id === enumOf(d, "Type")), 'optionalAccess', _127 => _127[0]]), () => ( "linear")),
|
|
6919
6979
|
angle: clamp3(num2(d, "Angl", 90), -360, 360),
|
|
6920
6980
|
scale: clamp3(pct(d, "Scl ", 1), 0.1, 1.5),
|
|
6921
6981
|
reverse: bool(d, "Rvrs"),
|
|
@@ -6969,7 +7029,7 @@ function gradientItems(g) {
|
|
|
6969
7029
|
)
|
|
6970
7030
|
)
|
|
6971
7031
|
};
|
|
6972
|
-
const op = _optionalChain([g, 'access',
|
|
7032
|
+
const op = _optionalChain([g, 'access', _128 => _128.opacityStops, 'optionalAccess', _129 => _129.length]) ? g.opacityStops : g.stops.map((s) => ({ position: s.position, opacity: 1 }));
|
|
6973
7033
|
const trns = {
|
|
6974
7034
|
type: "VlLs",
|
|
6975
7035
|
items: op.map(
|
|
@@ -7165,7 +7225,7 @@ function parseLfx2(data) {
|
|
|
7165
7225
|
let d;
|
|
7166
7226
|
try {
|
|
7167
7227
|
d = parseVersionedDescriptor(data.subarray(4));
|
|
7168
|
-
} catch (
|
|
7228
|
+
} catch (e18) {
|
|
7169
7229
|
return null;
|
|
7170
7230
|
}
|
|
7171
7231
|
const notes = /* @__PURE__ */ new Set();
|
|
@@ -7386,7 +7446,7 @@ function parseLrfx(data) {
|
|
|
7386
7446
|
} else if (key === "bevl") notes.add("legacy bevels are not read");
|
|
7387
7447
|
}
|
|
7388
7448
|
return { effects: { enabled: true, items }, notes: [...notes] };
|
|
7389
|
-
} catch (
|
|
7449
|
+
} catch (e19) {
|
|
7390
7450
|
return null;
|
|
7391
7451
|
}
|
|
7392
7452
|
}
|
|
@@ -7738,7 +7798,7 @@ function importNode(ctx, node, depth) {
|
|
|
7738
7798
|
if (node.children) {
|
|
7739
7799
|
const props2 = baseProps(ctx, rec, name, notes);
|
|
7740
7800
|
const divider = sectionDivider(rec);
|
|
7741
|
-
const key = _nullishCoalesce(_optionalChain([divider, 'optionalAccess',
|
|
7801
|
+
const key = _nullishCoalesce(_optionalChain([divider, 'optionalAccess', _130 => _130.blendKey]), () => ( rec.blendKey));
|
|
7742
7802
|
const groupBlend = key === "pass" ? "pass-through" : _nullishCoalesce(PSD_BLEND_KEYS[key], () => ( "normal"));
|
|
7743
7803
|
const children = [];
|
|
7744
7804
|
for (const child of node.children) {
|
|
@@ -7748,7 +7808,7 @@ function importNode(ctx, node, depth) {
|
|
|
7748
7808
|
const group = { type: "group", id: ctx.newId(name), ...props2, blend: groupBlend, children };
|
|
7749
7809
|
const effects2 = recordEffects(ctx, rec, name, notes, true);
|
|
7750
7810
|
if (effects2) group.effects = effects2;
|
|
7751
|
-
if (_optionalChain([divider, 'optionalAccess',
|
|
7811
|
+
if (_optionalChain([divider, 'optionalAccess', _131 => _131.kind]) === SECTION_CLOSED) group.collapsed = true;
|
|
7752
7812
|
const mask2 = recordMask(ctx, rec, name);
|
|
7753
7813
|
if (mask2) group.mask = mask2;
|
|
7754
7814
|
entry.type = "group";
|
|
@@ -7989,7 +8049,7 @@ function exportPsd(input) {
|
|
|
7989
8049
|
return {
|
|
7990
8050
|
opacity: Math.round(Math.min(1, Math.max(0, layer.opacity)) * 255),
|
|
7991
8051
|
clipping: layer.clipped ? 1 : 0,
|
|
7992
|
-
flags: (layer.visible ? 0 : LAYER_FLAG_HIDDEN) | (_optionalChain([layer, 'access',
|
|
8052
|
+
flags: (layer.visible ? 0 : LAYER_FLAG_HIDDEN) | (_optionalChain([layer, 'access', _132 => _132.locks, 'optionalAccess', _133 => _133.transparency]) ? LAYER_FLAG_TRANSPARENCY_PROTECTED : 0),
|
|
7993
8053
|
legacyName: name,
|
|
7994
8054
|
blocks
|
|
7995
8055
|
};
|
|
@@ -8046,7 +8106,7 @@ function exportPsd(input) {
|
|
|
8046
8106
|
}
|
|
8047
8107
|
case "pixel": {
|
|
8048
8108
|
if (layer.source === "document") throw new PsdError(`Layer "${layer.name}" reads the document image; resolve its pixels before export.`);
|
|
8049
|
-
if (_optionalChain([layer, 'access',
|
|
8109
|
+
if (_optionalChain([layer, 'access', _134 => _134.filters, 'optionalAccess', _135 => _135.some, 'call', _136 => _136(isActiveFilter)])) throw new PsdError(`Layer "${layer.name}" has live filters; bake them before export.`);
|
|
8050
8110
|
const extra = [];
|
|
8051
8111
|
if (layer.fillOpacity !== void 0 && layer.fillOpacity < 1) {
|
|
8052
8112
|
extra.push({ key: "iOpa", data: Uint8Array.from([Math.round(Math.max(0, layer.fillOpacity) * 255), 0, 0, 0]) });
|
|
@@ -8362,7 +8422,7 @@ var FreeTransformSession = (_class6 = class {
|
|
|
8362
8422
|
if (init.interpolation !== void 0 && !_chunkWT6ZAWJPcjs.isInterpolation.call(void 0, init.interpolation)) fail2(`Unknown interpolation "${String(init.interpolation)}"; use nearest, bilinear or bicubic.`);
|
|
8363
8423
|
this.interp = _nullishCoalesce(init.interpolation, () => ( "bicubic"));
|
|
8364
8424
|
const sel = host.selection();
|
|
8365
|
-
const selected = Boolean(_optionalChain([sel, 'optionalAccess',
|
|
8425
|
+
const selected = Boolean(_optionalChain([sel, 'optionalAccess', _137 => _137.bounds]));
|
|
8366
8426
|
let content = _nullishCoalesce(init.content, () => ( "auto"));
|
|
8367
8427
|
if (!["auto", "layer", "selection", "selection-copy", "selection-outline"].includes(content)) {
|
|
8368
8428
|
fail2(`Unknown content "${String(content)}"; use auto, layer, selection, selection-copy or selection-outline.`);
|
|
@@ -8390,9 +8450,9 @@ var FreeTransformSession = (_class6 = class {
|
|
|
8390
8450
|
const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
|
|
8391
8451
|
const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
|
|
8392
8452
|
if (channel !== "pixels" && channel !== "mask") fail2(`Unknown channel "${String(channel)}"; use pixels or mask.`);
|
|
8393
|
-
const linked = _optionalChain([mask, 'optionalAccess',
|
|
8453
|
+
const linked = _optionalChain([mask, 'optionalAccess', _138 => _138.linked]) !== false;
|
|
8394
8454
|
const maskAlone = channel === "mask" && (!linked || layer.type !== "pixel");
|
|
8395
|
-
if (channel === "mask" && !mask) fail2(_optionalChain([layer, 'access',
|
|
8455
|
+
if (channel === "mask" && !mask) fail2(_optionalChain([layer, 'access', _139 => _139.mask, 'optionalAccess', _140 => _140.source]) ? `Layer "${layer.name || id}" has a depth mask, which is generated, not transformed.` : `Layer "${layer.name || id}" has no mask to transform; add one with add_layer_mask, or transform its pixels.`);
|
|
8396
8456
|
if (!maskAlone && layer.type !== "pixel") fail2(`Layer "${layer.name || id}" is a ${layer.type} layer; Free Transform works on pixel layers, layer masks (channel mask) and selections.`);
|
|
8397
8457
|
if (!layer.visible && content !== "selection-copy") fail2(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
|
|
8398
8458
|
if (content !== "selection-copy") {
|
|
@@ -8447,7 +8507,7 @@ var FreeTransformSession = (_class6 = class {
|
|
|
8447
8507
|
};
|
|
8448
8508
|
this.copyId = copy.id;
|
|
8449
8509
|
const loc = _chunkWT6ZAWJPcjs.findLayer.call(void 0, layers, layer.id);
|
|
8450
|
-
this.startLayers = _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
8510
|
+
this.startLayers = _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _141 => _141.parent, 'optionalAccess', _142 => _142.id]), () => ( null)), loc.index + 1);
|
|
8451
8511
|
this.parts.push({ what: "pixels", offset: o, moving: lifted, base: null, reduced: /* @__PURE__ */ new Map() });
|
|
8452
8512
|
moves.push("pixels");
|
|
8453
8513
|
}
|
|
@@ -8617,10 +8677,10 @@ var FreeTransformSession = (_class6 = class {
|
|
|
8617
8677
|
result(changed, layers, selection) {
|
|
8618
8678
|
let bounds = null;
|
|
8619
8679
|
const id = _nullishCoalesce(this.copyId, () => ( this.layerId));
|
|
8620
|
-
const layer = id ? _optionalChain([_chunkWT6ZAWJPcjs.findLayer.call(void 0, layers, id), 'optionalAccess',
|
|
8621
|
-
if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess',
|
|
8622
|
-
else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess',
|
|
8623
|
-
else if (this.moves.includes("selection")) bounds = _optionalChain([selection, 'optionalAccess',
|
|
8680
|
+
const layer = id ? _optionalChain([_chunkWT6ZAWJPcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _143 => _143.layer]) : void 0;
|
|
8681
|
+
if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _144 => _144.type]) === "pixel") bounds = toDoc(_chunkCRMAXIUVcjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
|
|
8682
|
+
else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _145 => _145.mask])) bounds = toDoc(_chunkCRMAXIUVcjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
|
|
8683
|
+
else if (this.moves.includes("selection")) bounds = _optionalChain([selection, 'optionalAccess', _146 => _146.bounds]) ? { ...selection.bounds } : null;
|
|
8624
8684
|
return {
|
|
8625
8685
|
layerId: _nullishCoalesce(this.copyId, () => ( this.layerId)),
|
|
8626
8686
|
content: this.content,
|
|
@@ -8643,7 +8703,7 @@ function paintCoverageInto(base, coverage, apply, rects) {
|
|
|
8643
8703
|
const key = _chunkCRMAXIUVcjs.tileKey.call(void 0, t.tx, t.ty);
|
|
8644
8704
|
if (done.has(key)) continue;
|
|
8645
8705
|
done.add(key);
|
|
8646
|
-
const src = _nullishCoalesce(_optionalChain([base, 'access',
|
|
8706
|
+
const src = _nullishCoalesce(_optionalChain([base, 'access', _147 => _147.tiles, 'access', _148 => _148.get, 'call', _149 => _149(key), 'optionalAccess', _150 => _150.data]), () => ( defaultTile(base)));
|
|
8647
8707
|
const data = _chunkZZOTHJ4Kcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
|
|
8648
8708
|
const tile = _chunkCRMAXIUVcjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
|
|
8649
8709
|
if (tile) tiles.set(key, tile);
|
|
@@ -8695,11 +8755,11 @@ var PaintStrokeSession = (_class7 = class {
|
|
|
8695
8755
|
offset: a.offset,
|
|
8696
8756
|
lockTransparency: a.lockTransparency,
|
|
8697
8757
|
selection: a.selection,
|
|
8698
|
-
readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access',
|
|
8758
|
+
readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _151 => _151.live, 'access', _152 => _152.get, 'call', _153 => _153(_chunkCRMAXIUVcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _154 => _154.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
|
|
8699
8759
|
writeTile: (tx, ty) => {
|
|
8700
8760
|
const key = _chunkCRMAXIUVcjs.tileKey.call(void 0, tx, ty);
|
|
8701
8761
|
if (!this.touched.has(key)) {
|
|
8702
|
-
const src = _nullishCoalesce(_optionalChain([this, 'access',
|
|
8762
|
+
const src = _nullishCoalesce(_optionalChain([this, 'access', _155 => _155.base, 'access', _156 => _156.tiles, 'access', _157 => _157.get, 'call', _158 => _158(key), 'optionalAccess', _159 => _159.data]), () => ( defaultTile(this.base)));
|
|
8703
8763
|
this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
|
|
8704
8764
|
this.touched.add(key);
|
|
8705
8765
|
}
|
|
@@ -8736,8 +8796,8 @@ var PaintStrokeSession = (_class7 = class {
|
|
|
8736
8796
|
}
|
|
8737
8797
|
}
|
|
8738
8798
|
for (const [key, { tx, ty, r }] of regions) {
|
|
8739
|
-
const src = _nullishCoalesce(_optionalChain([this, 'access',
|
|
8740
|
-
const prev = this.touched.has(key) ? _optionalChain([this, 'access',
|
|
8799
|
+
const src = _nullishCoalesce(_optionalChain([this, 'access', _160 => _160.base, 'access', _161 => _161.tiles, 'access', _162 => _162.get, 'call', _163 => _163(key), 'optionalAccess', _164 => _164.data]), () => ( defaultTile(this.base)));
|
|
8800
|
+
const prev = this.touched.has(key) ? _optionalChain([this, 'access', _165 => _165.live, 'access', _166 => _166.get, 'call', _167 => _167(key), 'optionalAccess', _168 => _168.data]) : void 0;
|
|
8741
8801
|
this.touched.add(key);
|
|
8742
8802
|
const data = _chunkZZOTHJ4Kcjs.applyStrokeToTile.call(void 0, stroke.coverage, src, ch, tx, ty, this.apply, prev ? { into: prev, region: r } : {});
|
|
8743
8803
|
this.live.set(key, { data, uniform: null });
|
|
@@ -8812,14 +8872,14 @@ function migrateSerializedImageEditorState(data) {
|
|
|
8812
8872
|
const legacy = data;
|
|
8813
8873
|
const adjustments = normalizeStoredAdjustments(legacy.adjustments);
|
|
8814
8874
|
return {
|
|
8815
|
-
version: _optionalChain([adjustments, 'access',
|
|
8875
|
+
version: _optionalChain([adjustments, 'access', _169 => _169.layers, 'optionalAccess', _170 => _170.length]) ? 2 : 1,
|
|
8816
8876
|
crop: legacy.crop ? { ...legacy.crop } : null,
|
|
8817
8877
|
transform: { ...DEFAULT_TRANSFORM, ...legacy.transform },
|
|
8818
8878
|
adjustments: serializeAdjustments(adjustments),
|
|
8819
8879
|
depthMask: {
|
|
8820
8880
|
...DEFAULT_DEPTH_MASK,
|
|
8821
8881
|
...legacy.depthMask,
|
|
8822
|
-
depthRange: [..._nullishCoalesce(_optionalChain([legacy, 'access',
|
|
8882
|
+
depthRange: [..._nullishCoalesce(_optionalChain([legacy, 'access', _171 => _171.depthMask, 'optionalAccess', _172 => _172.depthRange]), () => ( DEFAULT_DEPTH_MASK.depthRange))]
|
|
8823
8883
|
},
|
|
8824
8884
|
annotations: JSON.parse(JSON.stringify(_nullishCoalesce(legacy.annotations, () => ( [])))),
|
|
8825
8885
|
...legacy.selection ? { selection: { ...legacy.selection } } : {}
|
|
@@ -8883,7 +8943,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
8883
8943
|
sourceIsOpaque: () => this.sourceIsOpaque(),
|
|
8884
8944
|
version: () => `${this.sourceVersion()}:${this.patternsVersion()}`,
|
|
8885
8945
|
globalLight: () => this.state.globalLight,
|
|
8886
|
-
pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access',
|
|
8946
|
+
pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _173 => _173.state, 'access', _174 => _174.patterns, 'optionalAccess', _175 => _175.find, 'call', _176 => _176((p) => p.id === id)]), () => ( null))
|
|
8887
8947
|
};
|
|
8888
8948
|
this.state = {
|
|
8889
8949
|
sourceUrl: typeof options.image === "string" ? options.image : null,
|
|
@@ -8916,10 +8976,10 @@ var ImageEditorController = (_class8 = class {
|
|
|
8916
8976
|
};
|
|
8917
8977
|
}
|
|
8918
8978
|
this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
|
|
8919
|
-
if (_optionalChain([options, 'access',
|
|
8979
|
+
if (_optionalChain([options, 'access', _177 => _177.initialState, 'optionalAccess', _178 => _178.selection])) {
|
|
8920
8980
|
try {
|
|
8921
8981
|
this.state.selection = normalizeSelection(deserializeSelection(options.initialState.selection));
|
|
8922
|
-
} catch (
|
|
8982
|
+
} catch (e20) {
|
|
8923
8983
|
}
|
|
8924
8984
|
}
|
|
8925
8985
|
this.initialSnapshot = this.captureHistoryEntry();
|
|
@@ -8960,7 +9020,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
8960
9020
|
height: img.naturalHeight || img.height || 600
|
|
8961
9021
|
}
|
|
8962
9022
|
};
|
|
8963
|
-
} catch (
|
|
9023
|
+
} catch (e21) {
|
|
8964
9024
|
return { sourceUrl: src, element: null, dimensions: { ...this.state.imageDimensions } };
|
|
8965
9025
|
}
|
|
8966
9026
|
}
|
|
@@ -8999,7 +9059,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
8999
9059
|
else if (!strokeRects) this.pendingDirty = "all";
|
|
9000
9060
|
this.syncViews();
|
|
9001
9061
|
const currentState = { ...this.state };
|
|
9002
|
-
_optionalChain([this, 'access',
|
|
9062
|
+
_optionalChain([this, 'access', _179 => _179.onStateChange, 'optionalCall', _180 => _180(currentState)]);
|
|
9003
9063
|
this.listeners.forEach((l) => l(currentState));
|
|
9004
9064
|
}
|
|
9005
9065
|
/** Recomputes the compatibility views (`adjustments`, `depthMask`, `annotations`) when the stack changed. */
|
|
@@ -9210,7 +9270,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
9210
9270
|
return this.state.layers;
|
|
9211
9271
|
}
|
|
9212
9272
|
getLayer(id) {
|
|
9213
|
-
return _optionalChain([_chunkWT6ZAWJPcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess',
|
|
9273
|
+
return _optionalChain([_chunkWT6ZAWJPcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _181 => _181.layer]);
|
|
9214
9274
|
}
|
|
9215
9275
|
/** The active layer, or `undefined`. */
|
|
9216
9276
|
getActiveLayer() {
|
|
@@ -9223,7 +9283,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
9223
9283
|
setActiveLayer(id, target = "pixels") {
|
|
9224
9284
|
if (id !== null && !this.getLayer(id)) return false;
|
|
9225
9285
|
const layer = id ? this.getLayer(id) : void 0;
|
|
9226
|
-
const t = target === "mask" && _optionalChain([layer, 'optionalAccess',
|
|
9286
|
+
const t = target === "mask" && _optionalChain([layer, 'optionalAccess', _182 => _182.mask]) ? "mask" : "pixels";
|
|
9227
9287
|
if (this.state.activeLayerId === id && this.state.activeTarget === t) return true;
|
|
9228
9288
|
this.state.activeLayerId = id;
|
|
9229
9289
|
this.state.activeTarget = t;
|
|
@@ -9282,7 +9342,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
9282
9342
|
surfaceOf: (l) => this.surfaceOf(l),
|
|
9283
9343
|
version: `${this.sourceVersion()}:${this.patternsVersion()}`,
|
|
9284
9344
|
globalLight: this.state.globalLight,
|
|
9285
|
-
pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access',
|
|
9345
|
+
pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _183 => _183.state, 'access', _184 => _184.patterns, 'optionalAccess', _185 => _185.find, 'call', _186 => _186((p) => p.id === id)]), () => ( null))
|
|
9286
9346
|
};
|
|
9287
9347
|
}
|
|
9288
9348
|
__init49() {this.sourceIds = /* @__PURE__ */ new WeakMap()}
|
|
@@ -9359,9 +9419,9 @@ var ImageEditorController = (_class8 = class {
|
|
|
9359
9419
|
if (!ctx || typeof ctx.getImageData !== "function") return null;
|
|
9360
9420
|
ctx.drawImage(el, 0, 0, width, height);
|
|
9361
9421
|
const data = ctx.getImageData(0, 0, width, height);
|
|
9362
|
-
if (!_optionalChain([data, 'optionalAccess',
|
|
9422
|
+
if (!_optionalChain([data, 'optionalAccess', _187 => _187.data]) || data.data.length < width * height * 4) return null;
|
|
9363
9423
|
return { width, height, data: data.data };
|
|
9364
|
-
} catch (
|
|
9424
|
+
} catch (e22) {
|
|
9365
9425
|
return null;
|
|
9366
9426
|
}
|
|
9367
9427
|
}
|
|
@@ -9370,7 +9430,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
9370
9430
|
commitLayers(next, extra, commitToHistory = true) {
|
|
9371
9431
|
if (commitToHistory) this.recordHistory();
|
|
9372
9432
|
this.state.layers = next;
|
|
9373
|
-
_optionalChain([extra, 'optionalCall',
|
|
9433
|
+
_optionalChain([extra, 'optionalCall', _188 => _188()]);
|
|
9374
9434
|
if (this.state.activeLayerId && !_chunkWT6ZAWJPcjs.findLayer.call(void 0, next, this.state.activeLayerId)) {
|
|
9375
9435
|
this.state.activeLayerId = null;
|
|
9376
9436
|
this.state.activeTarget = "pixels";
|
|
@@ -9407,7 +9467,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
9407
9467
|
const layer = {
|
|
9408
9468
|
type: "pixel",
|
|
9409
9469
|
id: init.id && !ids.has(init.id) ? init.id : newLayerId(),
|
|
9410
|
-
name: _optionalChain([init, 'access',
|
|
9470
|
+
name: _optionalChain([init, 'access', _189 => _189.name, 'optionalAccess', _190 => _190.trim, 'call', _191 => _191()]) || this.nextLayerName(),
|
|
9411
9471
|
visible: _nullishCoalesce(init.visible, () => ( true)),
|
|
9412
9472
|
opacity: _nullishCoalesce(init.opacity, () => ( 1)),
|
|
9413
9473
|
blend: _nullishCoalesce(blend, () => ( "normal")),
|
|
@@ -9434,12 +9494,12 @@ var ImageEditorController = (_class8 = class {
|
|
|
9434
9494
|
async decodeImage(image) {
|
|
9435
9495
|
const trimmed = image.trim();
|
|
9436
9496
|
let png = null;
|
|
9437
|
-
if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkWT6ZAWJPcjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess',
|
|
9497
|
+
if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkWT6ZAWJPcjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _192 => _192.bytes]), () => ( null));
|
|
9438
9498
|
else if (/^[A-Za-z0-9+/=\s]+$/.test(trimmed) && trimmed.length > 16) {
|
|
9439
9499
|
try {
|
|
9440
9500
|
const bytes = _chunkWT6ZAWJPcjs.base64ToBytes.call(void 0, trimmed);
|
|
9441
9501
|
if (_chunkWT6ZAWJPcjs.isPng.call(void 0, bytes)) png = bytes;
|
|
9442
|
-
} catch (
|
|
9502
|
+
} catch (e23) {
|
|
9443
9503
|
png = null;
|
|
9444
9504
|
}
|
|
9445
9505
|
}
|
|
@@ -9447,14 +9507,14 @@ var ImageEditorController = (_class8 = class {
|
|
|
9447
9507
|
try {
|
|
9448
9508
|
const d = _chunkWT6ZAWJPcjs.decodePng.call(void 0, png);
|
|
9449
9509
|
return { width: d.width, height: d.height, data: d.data };
|
|
9450
|
-
} catch (
|
|
9510
|
+
} catch (e24) {
|
|
9451
9511
|
}
|
|
9452
9512
|
}
|
|
9453
9513
|
const src = png ? `data:image/png;base64,${_chunkWT6ZAWJPcjs.bytesToBase64.call(void 0, png)}` : trimmed;
|
|
9454
9514
|
let img;
|
|
9455
9515
|
try {
|
|
9456
9516
|
img = await this.renderer.imageCache.get(src);
|
|
9457
|
-
} catch (
|
|
9517
|
+
} catch (e25) {
|
|
9458
9518
|
throw new 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.");
|
|
9459
9519
|
}
|
|
9460
9520
|
const w = img.naturalWidth || img.width;
|
|
@@ -9492,9 +9552,9 @@ var ImageEditorController = (_class8 = class {
|
|
|
9492
9552
|
moveLayer(id, placement) {
|
|
9493
9553
|
const next = moveLayer(this.state.layers, id, placement);
|
|
9494
9554
|
const loc = _chunkWT6ZAWJPcjs.findLayer.call(void 0, next, id);
|
|
9495
|
-
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
9555
|
+
if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _193 => _193.parent, 'optionalAccess', _194 => _194.id]), () => ( null)), index: loc.index };
|
|
9496
9556
|
this.commitLayers(next);
|
|
9497
|
-
return { parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
9557
|
+
return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _195 => _195.parent, 'optionalAccess', _196 => _196.id]), () => ( null)), index: loc.index };
|
|
9498
9558
|
}
|
|
9499
9559
|
/**
|
|
9500
9560
|
* Changes name, visibility, opacity, fill, blend, clipping, locks or (groups) collapsed state, as
|
|
@@ -9511,7 +9571,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
9511
9571
|
const group = {
|
|
9512
9572
|
type: "group",
|
|
9513
9573
|
id: newLayerId("group"),
|
|
9514
|
-
name: _optionalChain([init, 'access',
|
|
9574
|
+
name: _optionalChain([init, 'access', _197 => _197.name, 'optionalAccess', _198 => _198.trim, 'call', _199 => _199()]) || "Group",
|
|
9515
9575
|
visible: true,
|
|
9516
9576
|
opacity: 1,
|
|
9517
9577
|
blend,
|
|
@@ -9561,7 +9621,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
9561
9621
|
let mask;
|
|
9562
9622
|
if (from === "selection") {
|
|
9563
9623
|
const sel = this.state.selection;
|
|
9564
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
9624
|
+
if (!_optionalChain([sel, 'optionalAccess', _200 => _200.bounds])) throw new LayerOperationError("Nothing is selected; select first, or use reveal-all / hide-all.");
|
|
9565
9625
|
mask = this.maskFromSelection(sel, props);
|
|
9566
9626
|
if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
|
|
9567
9627
|
mask = { ...mask, surface: _chunkCRMAXIUVcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
|
|
@@ -9639,7 +9699,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
9639
9699
|
const layer = loc.layer;
|
|
9640
9700
|
if (layer.type !== "pixel") throw new LayerOperationError(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
|
|
9641
9701
|
const sel = this.state.selection;
|
|
9642
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
9702
|
+
if (!_optionalChain([sel, 'optionalAccess', _201 => _201.bounds])) throw new LayerOperationError("Nothing is selected; select the pixels to copy first.");
|
|
9643
9703
|
if (options.cut) requireUnlocked(layer, "pixels", "cut from it");
|
|
9644
9704
|
const surface = this.surfaceOf(layer);
|
|
9645
9705
|
const sb = sel.bounds;
|
|
@@ -9657,14 +9717,14 @@ var ImageEditorController = (_class8 = class {
|
|
|
9657
9717
|
const copy = {
|
|
9658
9718
|
type: "pixel",
|
|
9659
9719
|
id: newLayerId(),
|
|
9660
|
-
name: _optionalChain([options, 'access',
|
|
9720
|
+
name: _optionalChain([options, 'access', _202 => _202.name, 'optionalAccess', _203 => _203.trim, 'call', _204 => _204()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
|
|
9661
9721
|
visible: true,
|
|
9662
9722
|
opacity: 1,
|
|
9663
9723
|
blend: "normal",
|
|
9664
9724
|
surface: _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
|
|
9665
9725
|
offset: { ...layer.offset }
|
|
9666
9726
|
};
|
|
9667
|
-
let next = _chunkWT6ZAWJPcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
9727
|
+
let next = _chunkWT6ZAWJPcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _205 => _205.parent, 'optionalAccess', _206 => _206.id]), () => ( null)), loc.index + 1);
|
|
9668
9728
|
if (kept) {
|
|
9669
9729
|
const cutLayer = { ...layer, surface: _chunkCRMAXIUVcjs.writeRegion.call(void 0, surface, src, kept) };
|
|
9670
9730
|
delete cutLayer.source;
|
|
@@ -9688,7 +9748,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
9688
9748
|
layers: () => this.state.layers,
|
|
9689
9749
|
activeLayerId: () => this.state.activeLayerId,
|
|
9690
9750
|
activeTarget: () => this.state.activeTarget,
|
|
9691
|
-
selection: () => _optionalChain([this, 'access',
|
|
9751
|
+
selection: () => _optionalChain([this, 'access', _207 => _207.state, 'access', _208 => _208.selection, 'optionalAccess', _209 => _209.bounds]) ? this.state.selection : null,
|
|
9692
9752
|
canvas: () => this.naturalSize,
|
|
9693
9753
|
pixelsOf: (layer) => this.surfaceOf(layer),
|
|
9694
9754
|
capture: () => this.captureHistoryEntry(),
|
|
@@ -10019,7 +10079,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10019
10079
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
10020
10080
|
const key = `${tw}x${th}:${ox},${oy}`;
|
|
10021
10081
|
let byKey = this.thumbCache.get(surface);
|
|
10022
|
-
const hit = _optionalChain([byKey, 'optionalAccess',
|
|
10082
|
+
const hit = _optionalChain([byKey, 'optionalAccess', _210 => _210.get, 'call', _211 => _211(key)]);
|
|
10023
10083
|
if (hit) return hit;
|
|
10024
10084
|
const out = new Uint8ClampedArray(tw * th * 4);
|
|
10025
10085
|
for (let y = 0; y < th; y++) {
|
|
@@ -10107,7 +10167,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10107
10167
|
if (!layer.visible) throw new LayerOperationError(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
|
|
10108
10168
|
const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
|
|
10109
10169
|
const surface = ch === "mask" ? layer.mask.surface : this.surfaceOf(layer);
|
|
10110
|
-
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access',
|
|
10170
|
+
const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _212 => _212.locks, 'optionalAccess', _213 => _213.transparency]));
|
|
10111
10171
|
return { id, layer, channel: ch, offset, surface, lockTransparency };
|
|
10112
10172
|
}
|
|
10113
10173
|
/** The layer with its pixels (or mask) replaced by `surface`. */
|
|
@@ -10144,7 +10204,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10144
10204
|
opacity: brush.opacity,
|
|
10145
10205
|
blend: target.channel === "mask" ? "normal" : brush.blend,
|
|
10146
10206
|
lockTransparency: target.lockTransparency,
|
|
10147
|
-
selection: _optionalChain([this, 'access',
|
|
10207
|
+
selection: _optionalChain([this, 'access', _214 => _214.state, 'access', _215 => _215.selection, 'optionalAccess', _216 => _216.bounds]) ? this.state.selection : null,
|
|
10148
10208
|
offset: target.offset
|
|
10149
10209
|
};
|
|
10150
10210
|
if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply);
|
|
@@ -10196,7 +10256,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10196
10256
|
paintStroke(init) {
|
|
10197
10257
|
if (!Array.isArray(init.points) || !init.points.length) throw new LayerOperationError("points must hold at least one { x, y } point.");
|
|
10198
10258
|
for (const p of init.points) {
|
|
10199
|
-
if (!Number.isFinite(_optionalChain([p, 'optionalAccess',
|
|
10259
|
+
if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _217 => _217.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _218 => _218.y]))) throw new LayerOperationError("Every point needs finite x and y (document pixels).");
|
|
10200
10260
|
}
|
|
10201
10261
|
const session = this.beginStroke(init);
|
|
10202
10262
|
session.push(init.points);
|
|
@@ -10224,8 +10284,8 @@ var ImageEditorController = (_class8 = class {
|
|
|
10224
10284
|
const opacity = _nullishCoalesce(options.opacity, () => ( 1));
|
|
10225
10285
|
if (!(opacity >= 0 && opacity <= 1)) throw new LayerOperationError("opacity must be from 0 to 1.");
|
|
10226
10286
|
const blend = _nullishCoalesce(parseBlend(options.blend), () => ( "normal"));
|
|
10227
|
-
const sel = options.useSelection !== false && _optionalChain([this, 'access',
|
|
10228
|
-
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess',
|
|
10287
|
+
const sel = options.useSelection !== false && _optionalChain([this, 'access', _219 => _219.state, 'access', _220 => _220.selection, 'optionalAccess', _221 => _221.bounds]) ? this.state.selection : null;
|
|
10288
|
+
const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _222 => _222.bounds]), () => ( { x: 0, y: 0, width, height }));
|
|
10229
10289
|
const coverage = new (0, _chunkZZOTHJ4Kcjs.CoverageMap)();
|
|
10230
10290
|
const ones = new Float32Array(region.width * region.height);
|
|
10231
10291
|
if (sel) {
|
|
@@ -10343,7 +10403,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10343
10403
|
placeLayer(layers, node, where) {
|
|
10344
10404
|
if (where.aboveId) {
|
|
10345
10405
|
const loc = _chunkWT6ZAWJPcjs.findLayer.call(void 0, layers, where.aboveId);
|
|
10346
|
-
if (loc) return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
10406
|
+
if (loc) return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _223 => _223.parent, 'optionalAccess', _224 => _224.id]), () => ( null)), loc.index + 1);
|
|
10347
10407
|
}
|
|
10348
10408
|
if (where.parentId) {
|
|
10349
10409
|
const loc = _chunkWT6ZAWJPcjs.findLayer.call(void 0, layers, where.parentId);
|
|
@@ -10354,11 +10414,11 @@ var ImageEditorController = (_class8 = class {
|
|
|
10354
10414
|
const at = Math.max(0, Math.min(nodes.length, Math.round(where.adjustmentIndex)));
|
|
10355
10415
|
if (at < nodes.length) {
|
|
10356
10416
|
const loc = _chunkWT6ZAWJPcjs.findLayer.call(void 0, layers, nodes[at].id);
|
|
10357
|
-
return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
10417
|
+
return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _225 => _225.parent, 'optionalAccess', _226 => _226.id]), () => ( null)), loc.index);
|
|
10358
10418
|
}
|
|
10359
10419
|
if (nodes.length) {
|
|
10360
10420
|
const loc = _chunkWT6ZAWJPcjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
|
|
10361
|
-
return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
10421
|
+
return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _227 => _227.parent, 'optionalAccess', _228 => _228.id]), () => ( null)), loc.index + 1);
|
|
10362
10422
|
}
|
|
10363
10423
|
}
|
|
10364
10424
|
return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
|
|
@@ -10470,7 +10530,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10470
10530
|
const anchor = nodes[to];
|
|
10471
10531
|
const without = _chunkWT6ZAWJPcjs.mapLayer.call(void 0, layers, id, () => null);
|
|
10472
10532
|
const loc = _chunkWT6ZAWJPcjs.findLayer.call(void 0, without, anchor.id);
|
|
10473
|
-
return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
10533
|
+
return _chunkWT6ZAWJPcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _229 => _229.parent, 'optionalAccess', _230 => _230.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
|
|
10474
10534
|
}
|
|
10475
10535
|
/** Moves a layer to `toIndex` among the adjustment layers (0 = bottom) as one undo step. Returns false if nothing moved. */
|
|
10476
10536
|
moveAdjustmentLayer(id, toIndex) {
|
|
@@ -10506,7 +10566,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10506
10566
|
return _nullishCoalesce(this.state.selection, () => ( null));
|
|
10507
10567
|
}
|
|
10508
10568
|
get hasSelection() {
|
|
10509
|
-
return Boolean(_optionalChain([this, 'access',
|
|
10569
|
+
return Boolean(_optionalChain([this, 'access', _231 => _231.state, 'access', _232 => _232.selection, 'optionalAccess', _233 => _233.bounds]));
|
|
10510
10570
|
}
|
|
10511
10571
|
get naturalSize() {
|
|
10512
10572
|
return {
|
|
@@ -10596,13 +10656,13 @@ var ImageEditorController = (_class8 = class {
|
|
|
10596
10656
|
try {
|
|
10597
10657
|
const canvas = await this.renderSource();
|
|
10598
10658
|
const ctx = canvas.getContext("2d");
|
|
10599
|
-
const data2 = _optionalChain([ctx, 'optionalAccess',
|
|
10659
|
+
const data2 = _optionalChain([ctx, 'optionalAccess', _234 => _234.getImageData, 'optionalCall', _235 => _235(0, 0, width, height)]);
|
|
10600
10660
|
if (data2 && data2.data && data2.data.length >= width * height * 4) {
|
|
10601
10661
|
base = { width, height, data: data2.data };
|
|
10602
10662
|
this.samplePixels = base;
|
|
10603
10663
|
this.samplePixelsOverride = false;
|
|
10604
10664
|
}
|
|
10605
|
-
} catch (
|
|
10665
|
+
} catch (e26) {
|
|
10606
10666
|
base = null;
|
|
10607
10667
|
}
|
|
10608
10668
|
}
|
|
@@ -10662,7 +10722,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10662
10722
|
/** Select › Modify: grow, shrink, feather, border or smooth by `radius` pixels (one undo step). */
|
|
10663
10723
|
modifySelection(op, radius) {
|
|
10664
10724
|
const sel = this.state.selection;
|
|
10665
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
10725
|
+
if (!_optionalChain([sel, 'optionalAccess', _236 => _236.bounds])) return false;
|
|
10666
10726
|
return this.setSelection(modifySelection(sel, op, radius));
|
|
10667
10727
|
}
|
|
10668
10728
|
/**
|
|
@@ -10671,7 +10731,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10671
10731
|
*/
|
|
10672
10732
|
async refineSelection(params, options = {}) {
|
|
10673
10733
|
const sel = this.state.selection;
|
|
10674
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
10734
|
+
if (!_optionalChain([sel, 'optionalAccess', _237 => _237.bounds])) return false;
|
|
10675
10735
|
const pixels = (_nullishCoalesce(params.radius, () => ( 0))) > 0 ? await this.requirePixels(options) : null;
|
|
10676
10736
|
return this.setSelection(refineSelection(pixels, sel, params));
|
|
10677
10737
|
}
|
|
@@ -10688,7 +10748,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10688
10748
|
const canvas = this.renderer.createCanvas(w, h);
|
|
10689
10749
|
const ctx = canvas.getContext("2d");
|
|
10690
10750
|
if (ctx) ctx.drawImage(img, 0, 0, w, h);
|
|
10691
|
-
const data = _optionalChain([ctx, 'optionalAccess',
|
|
10751
|
+
const data = _optionalChain([ctx, 'optionalAccess', _238 => _238.getImageData, 'optionalCall', _239 => _239(0, 0, w, h)]);
|
|
10692
10752
|
if (!data) throw new Error("The mask image pixels are not available (no canvas access); pass pixels.");
|
|
10693
10753
|
pixels = { width: w, height: h, data: data.data };
|
|
10694
10754
|
} else {
|
|
@@ -10716,7 +10776,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10716
10776
|
*/
|
|
10717
10777
|
applySelectionAsLayerMask(layerId, props = {}) {
|
|
10718
10778
|
const sel = this.state.selection;
|
|
10719
|
-
if (!_optionalChain([sel, 'optionalAccess',
|
|
10779
|
+
if (!_optionalChain([sel, 'optionalAccess', _240 => _240.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
|
|
10720
10780
|
return this.setLayerMask(layerId, this.maskFromSelection(sel, props));
|
|
10721
10781
|
}
|
|
10722
10782
|
setLayerMask(layerId, mask, commitToHistory = true) {
|
|
@@ -10747,7 +10807,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10747
10807
|
/** Load Selection from a layer mask (its pixels; density and feather are not applied). */
|
|
10748
10808
|
selectionFromLayerMask(layerId, mode = "replace") {
|
|
10749
10809
|
const layer = this.getLayer(layerId);
|
|
10750
|
-
if (!_optionalChain([layer, 'optionalAccess',
|
|
10810
|
+
if (!_optionalChain([layer, 'optionalAccess', _241 => _241.mask]) || layer.mask.source) return false;
|
|
10751
10811
|
const { width, height } = this.naturalSize;
|
|
10752
10812
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
10753
10813
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
@@ -10783,7 +10843,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10783
10843
|
this.state.layers = _chunkWT6ZAWJPcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
10784
10844
|
const next = { ...l };
|
|
10785
10845
|
if (isDefaultDepthMask(merged)) {
|
|
10786
|
-
if (_optionalChain([next, 'access',
|
|
10846
|
+
if (_optionalChain([next, 'access', _242 => _242.mask, 'optionalAccess', _243 => _243.source])) delete next.mask;
|
|
10787
10847
|
} else next.mask = depthRasterMask(merged);
|
|
10788
10848
|
return next;
|
|
10789
10849
|
});
|
|
@@ -10793,7 +10853,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10793
10853
|
resetDepthMask() {
|
|
10794
10854
|
this.recordHistory();
|
|
10795
10855
|
const target = this.developLayer();
|
|
10796
|
-
if (_optionalChain([target, 'optionalAccess',
|
|
10856
|
+
if (_optionalChain([target, 'optionalAccess', _244 => _244.mask, 'optionalAccess', _245 => _245.source])) {
|
|
10797
10857
|
this.state.layers = _chunkWT6ZAWJPcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
|
|
10798
10858
|
const next = { ...l };
|
|
10799
10859
|
delete next.mask;
|
|
@@ -10815,7 +10875,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10815
10875
|
const fullAnnotation = { ...annotation, id };
|
|
10816
10876
|
const layer = annotationLayerFor(fullAnnotation);
|
|
10817
10877
|
const loc = placement.aboveId ? _chunkWT6ZAWJPcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
|
|
10818
|
-
this.state.layers = loc ? _chunkWT6ZAWJPcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access',
|
|
10878
|
+
this.state.layers = loc ? _chunkWT6ZAWJPcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _246 => _246.parent, 'optionalAccess', _247 => _247.id]), () => ( null)), loc.index + 1) : _chunkWT6ZAWJPcjs.insertLayer.call(void 0, this.state.layers, layer, null);
|
|
10819
10879
|
this.state.selectedAnnotationId = id;
|
|
10820
10880
|
this.notify();
|
|
10821
10881
|
return id;
|
|
@@ -10912,7 +10972,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10912
10972
|
dirty: dirty === "all" ? void 0 : dirty,
|
|
10913
10973
|
checkpointLayerId: this.state.activeLayerId
|
|
10914
10974
|
});
|
|
10915
|
-
} catch (
|
|
10975
|
+
} catch (e27) {
|
|
10916
10976
|
}
|
|
10917
10977
|
}
|
|
10918
10978
|
async renderExport(options) {
|
|
@@ -10921,7 +10981,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
10921
10981
|
return this.renderer.createCanvas(1, 1);
|
|
10922
10982
|
}
|
|
10923
10983
|
this.syncViews();
|
|
10924
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
10984
|
+
if (_optionalChain([options, 'optionalAccess', _248 => _248.layerIds])) {
|
|
10925
10985
|
const keep = new Set(options.layerIds);
|
|
10926
10986
|
const layers = _chunkWT6ZAWJPcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
|
|
10927
10987
|
return this.renderer.renderExport(source, { ...this.state, layers }, options);
|
|
@@ -11054,7 +11114,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
11054
11114
|
let px2 = await this.decodeImage(newDataUrl);
|
|
11055
11115
|
if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
|
|
11056
11116
|
const data = new Uint8ClampedArray(px2.data);
|
|
11057
|
-
const sel = _optionalChain([this, 'access',
|
|
11117
|
+
const sel = _optionalChain([this, 'access', _249 => _249.state, 'access', _250 => _250.selection, 'optionalAccess', _251 => _251.bounds]) ? this.state.selection : null;
|
|
11058
11118
|
if (sel) for (let p = 0, i = 3; p < width * height; p++, i += 4) data[i] = Math.round(data[i] * sel.data[p] / 255);
|
|
11059
11119
|
return this.addPixelLayer({ name: "Inpaint", pixels: { width, height, data } });
|
|
11060
11120
|
}
|
|
@@ -11106,7 +11166,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
11106
11166
|
if (layer.locks) next.locks = layer.locks;
|
|
11107
11167
|
if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
|
|
11108
11168
|
} else if (layer.type === "pixel") {
|
|
11109
|
-
if (!_optionalChain([layer, 'access',
|
|
11169
|
+
if (!_optionalChain([layer, 'access', _252 => _252.filters, 'optionalAccess', _253 => _253.length])) throw new LayerOperationError(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
|
|
11110
11170
|
requireUnlocked(layer, "pixels", "rasterize it");
|
|
11111
11171
|
const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
|
|
11112
11172
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
|
|
@@ -11180,15 +11240,15 @@ var ImageEditorController = (_class8 = class {
|
|
|
11180
11240
|
const canvas = { x: 0, y: 0, width, height };
|
|
11181
11241
|
const warnings = [];
|
|
11182
11242
|
const note = /* @__PURE__ */ new Map();
|
|
11183
|
-
const
|
|
11243
|
+
const add2 = (msg, name) => note.set(msg, [..._nullishCoalesce(note.get(msg), () => ( [])), name]);
|
|
11184
11244
|
const canRasterize = this.renderer.canRasterize();
|
|
11185
11245
|
await this.renderer.prepareLayerAssets(this.state.layers, width, height);
|
|
11186
11246
|
const sources = this.renderer.compositorSources(width, height);
|
|
11187
11247
|
const compositor = new LayerCompositor();
|
|
11188
11248
|
const bakeMask = (layer) => {
|
|
11189
11249
|
const mask = layer.mask;
|
|
11190
|
-
if (!_optionalChain([mask, 'optionalAccess',
|
|
11191
|
-
|
|
11250
|
+
if (!_optionalChain([mask, 'optionalAccess', _254 => _254.source])) return mask;
|
|
11251
|
+
add2("Parametric (depth) masks were baked into pixel masks", layer.name);
|
|
11192
11252
|
const plain3 = { ...layer, mask: { ...mask, density: 1, feather: 0, enabled: true } };
|
|
11193
11253
|
const ox = layer.type === "pixel" ? layer.offset.x : 0;
|
|
11194
11254
|
const oy = layer.type === "pixel" ? layer.offset.y : 0;
|
|
@@ -11204,7 +11264,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
11204
11264
|
};
|
|
11205
11265
|
const prepare = async (layer) => {
|
|
11206
11266
|
const p = await prepareLayer(layer);
|
|
11207
|
-
if (_optionalChain([p, 'optionalAccess',
|
|
11267
|
+
if (_optionalChain([p, 'optionalAccess', _255 => _255.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
|
|
11208
11268
|
return p;
|
|
11209
11269
|
};
|
|
11210
11270
|
const prepareLayer = async (layer) => {
|
|
@@ -11219,10 +11279,10 @@ var ImageEditorController = (_class8 = class {
|
|
|
11219
11279
|
if (layer.type === "adjustment") return { ...layer, mask: bakeMask(layer) };
|
|
11220
11280
|
if (layer.type === "annotation") {
|
|
11221
11281
|
if (!canRasterize) {
|
|
11222
|
-
|
|
11282
|
+
add2("Annotation layers need a canvas (a browser) to rasterize and were left out", layer.name);
|
|
11223
11283
|
return null;
|
|
11224
11284
|
}
|
|
11225
|
-
|
|
11285
|
+
add2("Annotation layers were written as pixel layers", layer.name);
|
|
11226
11286
|
const blend = layer.blend === "normal" && layer.annotation.blend ? layer.annotation.blend : layer.blend;
|
|
11227
11287
|
const content = { ...layer, visible: true, opacity: 1, blend: "normal", annotation: { ...layer.annotation, blend: void 0 } };
|
|
11228
11288
|
delete content.mask;
|
|
@@ -11251,9 +11311,9 @@ var ImageEditorController = (_class8 = class {
|
|
|
11251
11311
|
out.surface = this.surfaceOf(layer);
|
|
11252
11312
|
delete out.source;
|
|
11253
11313
|
}
|
|
11254
|
-
const active = _nullishCoalesce(_optionalChain([layer, 'access',
|
|
11314
|
+
const active = _nullishCoalesce(_optionalChain([layer, 'access', _256 => _256.filters, 'optionalAccess', _257 => _257.filter, 'call', _258 => _258(isActiveFilter)]), () => ( []));
|
|
11255
11315
|
if (active.length) {
|
|
11256
|
-
|
|
11316
|
+
add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
|
|
11257
11317
|
const content = { ...out, visible: true, opacity: 1, blend: "normal" };
|
|
11258
11318
|
delete content.mask;
|
|
11259
11319
|
delete content.clipped;
|
|
@@ -11262,7 +11322,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
11262
11322
|
const data = compositor.composite([content], canvas, sources);
|
|
11263
11323
|
out = { ...out, surface: _chunkCRMAXIUVcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
|
|
11264
11324
|
}
|
|
11265
|
-
if (_optionalChain([layer, 'access',
|
|
11325
|
+
if (_optionalChain([layer, 'access', _259 => _259.filters, 'optionalAccess', _260 => _260.some, 'call', _261 => _261((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
|
|
11266
11326
|
delete out.filters;
|
|
11267
11327
|
const mask = bakeMask(layer);
|
|
11268
11328
|
if (mask) out.mask = mask;
|
|
@@ -11332,7 +11392,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
11332
11392
|
}
|
|
11333
11393
|
toJSON(options) {
|
|
11334
11394
|
const out = this.serializeState();
|
|
11335
|
-
if (_optionalChain([this, 'access',
|
|
11395
|
+
if (_optionalChain([this, 'access', _262 => _262.state, 'access', _263 => _263.selection, 'optionalAccess', _264 => _264.bounds])) out.selection = serializeSelection(this.state.selection);
|
|
11336
11396
|
if (!options || out.version !== LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
|
|
11337
11397
|
return serializeLayersExternal(this.state.layers, options.store).then(({ layers, assets }) => ({ ...out, layers, assets }));
|
|
11338
11398
|
}
|
|
@@ -11359,7 +11419,7 @@ var ImageEditorController = (_class8 = class {
|
|
|
11359
11419
|
if (data.selection) {
|
|
11360
11420
|
try {
|
|
11361
11421
|
selection = normalizeSelection(deserializeSelection(data.selection));
|
|
11362
|
-
} catch (
|
|
11422
|
+
} catch (e28) {
|
|
11363
11423
|
selection = null;
|
|
11364
11424
|
}
|
|
11365
11425
|
}
|
|
@@ -11413,10 +11473,10 @@ var ImageEditorController = (_class8 = class {
|
|
|
11413
11473
|
serializeState() {
|
|
11414
11474
|
const { width, height } = this.naturalSize;
|
|
11415
11475
|
const view = legacyView(this.stack(), width, height, null);
|
|
11416
|
-
if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access',
|
|
11476
|
+
if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _265 => _265.state, 'access', _266 => _266.patterns, 'optionalAccess', _267 => _267.length])) {
|
|
11417
11477
|
return {
|
|
11418
11478
|
// States without adjustment layers keep schema 1, so they round-trip unchanged.
|
|
11419
|
-
version: _optionalChain([view, 'access',
|
|
11479
|
+
version: _optionalChain([view, 'access', _268 => _268.adjustments, 'access', _269 => _269.layers, 'optionalAccess', _270 => _270.length]) ? 2 : 1,
|
|
11420
11480
|
crop: this.state.crop ? { ...this.state.crop } : null,
|
|
11421
11481
|
transform: { ...this.state.transform },
|
|
11422
11482
|
adjustments: serializeAdjustments(view.adjustments),
|
|
@@ -11441,13 +11501,13 @@ var ImageEditorController = (_class8 = class {
|
|
|
11441
11501
|
};
|
|
11442
11502
|
if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
|
|
11443
11503
|
if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
|
|
11444
|
-
if (_optionalChain([this, 'access',
|
|
11504
|
+
if (_optionalChain([this, 'access', _271 => _271.state, 'access', _272 => _272.patterns, 'optionalAccess', _273 => _273.length])) out.patterns = serializePatterns(this.state.patterns);
|
|
11445
11505
|
return out;
|
|
11446
11506
|
}
|
|
11447
11507
|
}, _class8);
|
|
11448
11508
|
function serializeAdjustments(adjustments) {
|
|
11449
11509
|
const out = { ...adjustments };
|
|
11450
|
-
if (_optionalChain([out, 'access',
|
|
11510
|
+
if (_optionalChain([out, 'access', _274 => _274.layers, 'optionalAccess', _275 => _275.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
|
|
11451
11511
|
else delete out.layers;
|
|
11452
11512
|
if (normalizeProcessVersion(out.process) === LEGACY_PROCESS_VERSION) {
|
|
11453
11513
|
delete out.process;
|
|
@@ -11483,11 +11543,11 @@ function withDevelop(layer, partial) {
|
|
|
11483
11543
|
return { ...layer, filters };
|
|
11484
11544
|
}
|
|
11485
11545
|
function withBlur(layer, radius) {
|
|
11486
|
-
const existing = _optionalChain([layer, 'access',
|
|
11546
|
+
const existing = _optionalChain([layer, 'access', _276 => _276.filters, 'optionalAccess', _277 => _277.find, 'call', _278 => _278((f) => f.kind === "blur")]);
|
|
11487
11547
|
const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
|
|
11488
11548
|
if (radius > 0) {
|
|
11489
11549
|
filters.push({
|
|
11490
|
-
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess',
|
|
11550
|
+
id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _279 => _279.id]), () => ( (layer.source === "document" ? BLUR_FILTER_ID : newLayerId("flt")))),
|
|
11491
11551
|
kind: "blur",
|
|
11492
11552
|
enabled: true,
|
|
11493
11553
|
radius
|
|
@@ -11583,7 +11643,7 @@ function pixelsOnly(layers) {
|
|
|
11583
11643
|
for (const l of layers) {
|
|
11584
11644
|
if (l.type === "adjustment") continue;
|
|
11585
11645
|
if (l.type === "group") out.push({ ...l, children: pixelsOnly(l.children) });
|
|
11586
|
-
else if (l.type === "pixel" && _optionalChain([l, 'access',
|
|
11646
|
+
else if (l.type === "pixel" && _optionalChain([l, 'access', _280 => _280.filters, 'optionalAccess', _281 => _281.length])) {
|
|
11587
11647
|
const p = { ...l };
|
|
11588
11648
|
delete p.filters;
|
|
11589
11649
|
out.push(p);
|
|
@@ -11641,7 +11701,7 @@ function toHex2(c) {
|
|
|
11641
11701
|
return "#" + [c[0], c[1], c[2]].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("");
|
|
11642
11702
|
}
|
|
11643
11703
|
function normalizeSelection(mask) {
|
|
11644
|
-
return _optionalChain([mask, 'optionalAccess',
|
|
11704
|
+
return _optionalChain([mask, 'optionalAccess', _282 => _282.bounds]) ? mask : null;
|
|
11645
11705
|
}
|
|
11646
11706
|
function sameSelection(a, b) {
|
|
11647
11707
|
if (a.width !== b.width || a.height !== b.height) return false;
|
|
@@ -11746,7 +11806,7 @@ function loadImageEditorDocument(input) {
|
|
|
11746
11806
|
if (typeof input === "string") {
|
|
11747
11807
|
try {
|
|
11748
11808
|
parsed = JSON.parse(input);
|
|
11749
|
-
} catch (
|
|
11809
|
+
} catch (e29) {
|
|
11750
11810
|
parsed = input;
|
|
11751
11811
|
}
|
|
11752
11812
|
}
|
|
@@ -11802,7 +11862,7 @@ function loadImageEditorDocument(input) {
|
|
|
11802
11862
|
}
|
|
11803
11863
|
const state = { version: 1, ...result.value };
|
|
11804
11864
|
if (isV2) {
|
|
11805
|
-
if (_optionalChain([state, 'access',
|
|
11865
|
+
if (_optionalChain([state, 'access', _283 => _283.adjustments, 'access', _284 => _284.layers, 'optionalAccess', _285 => _285.length])) state.version = 2;
|
|
11806
11866
|
result.report.version = 2;
|
|
11807
11867
|
}
|
|
11808
11868
|
if (state.selection === void 0) delete state.selection;
|
|
@@ -12002,7 +12062,7 @@ function findAdjustmentControl(id) {
|
|
|
12002
12062
|
}
|
|
12003
12063
|
function findLayerControl(kind, id) {
|
|
12004
12064
|
if (id === "opacity") return ADJUSTMENT_LAYER_OPACITY_CONTROL;
|
|
12005
|
-
return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access',
|
|
12065
|
+
return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _286 => _286[kind], 'optionalAccess', _287 => _287.find, 'call', _288 => _288((c) => c.id === id)]);
|
|
12006
12066
|
}
|
|
12007
12067
|
function clampControlValue(spec, v) {
|
|
12008
12068
|
if (typeof v !== "number" || !Number.isFinite(v)) return spec.default;
|
|
@@ -12121,7 +12181,7 @@ function summary(controller) {
|
|
|
12121
12181
|
const area = selectionArea(sel);
|
|
12122
12182
|
return {
|
|
12123
12183
|
empty: !sel,
|
|
12124
|
-
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess',
|
|
12184
|
+
bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _289 => _289.bounds]), () => ( null)),
|
|
12125
12185
|
/** Σ coverage in pixels. */
|
|
12126
12186
|
area: Math.round(area),
|
|
12127
12187
|
percent: Math.round(area / Math.max(1, width * height) * 1e4) / 100,
|
|
@@ -12365,7 +12425,7 @@ async function renderImageRegion(controller, request) {
|
|
|
12365
12425
|
if (request.includeOverlays) {
|
|
12366
12426
|
const s = request.scale;
|
|
12367
12427
|
const selection = state.selection;
|
|
12368
|
-
if (_optionalChain([selection, 'optionalAccess',
|
|
12428
|
+
if (_optionalChain([selection, 'optionalAccess', _290 => _290.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
|
|
12369
12429
|
const shade = selectionShade(selection, document);
|
|
12370
12430
|
if (shade) context.drawImage(shade, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
|
|
12371
12431
|
}
|
|
@@ -12390,7 +12450,7 @@ function createImageCaptureSurface(controller) {
|
|
|
12390
12450
|
return {
|
|
12391
12451
|
units: "image pixels",
|
|
12392
12452
|
content: whole,
|
|
12393
|
-
selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access',
|
|
12453
|
+
selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _291 => _291.getState, 'call', _292 => _292(), 'access', _293 => _293.selection, 'optionalAccess', _294 => _294.bounds]), () => ( null)) }),
|
|
12394
12454
|
overlays: "a shade over unselected pixels and the crop box outline",
|
|
12395
12455
|
maxScale: 8,
|
|
12396
12456
|
render: (request) => renderImageRegion(controller, request)
|
|
@@ -12732,7 +12792,7 @@ function createImageLayerTools(controller) {
|
|
|
12732
12792
|
if (!loc) return null;
|
|
12733
12793
|
return {
|
|
12734
12794
|
...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
|
|
12735
|
-
parentId: _nullishCoalesce(_optionalChain([loc, 'access',
|
|
12795
|
+
parentId: _nullishCoalesce(_optionalChain([loc, 'access', _295 => _295.parent, 'optionalAccess', _296 => _296.id]), () => ( null)),
|
|
12736
12796
|
index: loc.index
|
|
12737
12797
|
};
|
|
12738
12798
|
};
|
|
@@ -13416,7 +13476,7 @@ function createImageEffectTools(controller) {
|
|
|
13416
13476
|
annotations: { title: "List layer effects", ...READ3 },
|
|
13417
13477
|
handler: ({ layerId }) => result(layerArg(layerId), { globalLight: controller.getGlobalLight(), patterns: patternList(controller), kinds: [..._chunkWT6ZAWJPcjs.LAYER_EFFECT_KINDS] })
|
|
13418
13478
|
};
|
|
13419
|
-
const
|
|
13479
|
+
const add2 = {
|
|
13420
13480
|
name: "add_layer_effect",
|
|
13421
13481
|
title: "Add a layer effect",
|
|
13422
13482
|
description: "Adds a live effect to a pixel, annotation or group layer with Photoshop's defaults, changed by settings: drop-shadow, inner-shadow, outer-glow, inner-glow, bevel-emboss, satin, color-overlay, gradient-overlay, pattern-overlay or stroke. Several of one kind are allowed (the first listed is on top). One undo step. Returns the new effect's id and the layer's effects.",
|
|
@@ -13514,7 +13574,7 @@ function createImageEffectTools(controller) {
|
|
|
13514
13574
|
return { globalLight: controller.setGlobalLight(next) };
|
|
13515
13575
|
}
|
|
13516
13576
|
};
|
|
13517
|
-
return [list2,
|
|
13577
|
+
return [list2, add2, update, remove, setEnabled, light];
|
|
13518
13578
|
}
|
|
13519
13579
|
|
|
13520
13580
|
// src/image-editor/layers/paint-ui.ts
|
|
@@ -13614,7 +13674,7 @@ var PaintGesture = (_class9 = class {
|
|
|
13614
13674
|
const layer = this.controller.getActiveLayer();
|
|
13615
13675
|
if (!layer) throw new Error("Select a layer to move in the Layers panel.");
|
|
13616
13676
|
if (layer.type !== "pixel") throw new Error(`Only pixel layers move; "${layer.name}" is a ${layer.type} layer.`);
|
|
13617
|
-
if (_optionalChain([layer, 'access',
|
|
13677
|
+
if (_optionalChain([layer, 'access', _297 => _297.locks, 'optionalAccess', _298 => _298.all]) || _optionalChain([layer, 'access', _299 => _299.locks, 'optionalAccess', _300 => _300.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
|
|
13618
13678
|
this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin: { ...layer.offset }, moved: false };
|
|
13619
13679
|
return null;
|
|
13620
13680
|
}
|
|
@@ -13663,7 +13723,7 @@ var PaintGesture = (_class9 = class {
|
|
|
13663
13723
|
this.move = null;
|
|
13664
13724
|
}
|
|
13665
13725
|
cancel() {
|
|
13666
|
-
_optionalChain([this, 'access',
|
|
13726
|
+
_optionalChain([this, 'access', _301 => _301.stroke, 'optionalAccess', _302 => _302.cancel, 'call', _303 => _303()]);
|
|
13667
13727
|
this.stroke = null;
|
|
13668
13728
|
this.move = null;
|
|
13669
13729
|
}
|
|
@@ -14337,7 +14397,7 @@ function createImageEditorToolProvider(controller, options = {}) {
|
|
|
14337
14397
|
for (const ref of [aboveId, parentId]) {
|
|
14338
14398
|
if (ref !== void 0 && !controller.getLayer(ref)) throw new Error(`Unknown layer "${ref}". Call list_layers for ids.`);
|
|
14339
14399
|
}
|
|
14340
|
-
if (parentId !== void 0 && _optionalChain([controller, 'access',
|
|
14400
|
+
if (parentId !== void 0 && _optionalChain([controller, 'access', _304 => _304.getLayer, 'call', _305 => _305(parentId), 'optionalAccess', _306 => _306.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
|
|
14341
14401
|
const id = controller.addAdjustmentLayer({ kind, params, opacity, blend, name, aboveId, parentId });
|
|
14342
14402
|
const layer = controller.getAdjustmentLayer(id);
|
|
14343
14403
|
return { layer: JSON.parse(JSON.stringify(layer)), index: controller.getAdjustmentLayers().findIndex((l) => l.id === id) };
|
|
@@ -14761,31 +14821,32 @@ function layerMenu(controller) {
|
|
|
14761
14821
|
const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
|
|
14762
14822
|
const below = loc ? siblings[loc.index - 1] : void 0;
|
|
14763
14823
|
const hasSel = controller.hasSelection;
|
|
14764
|
-
const isPixel = _optionalChain([active, 'optionalAccess',
|
|
14824
|
+
const isPixel = _optionalChain([active, 'optionalAccess', _307 => _307.type]) === "pixel";
|
|
14765
14825
|
return [
|
|
14766
14826
|
{ action: "new-layer", label: "New Layer", enabled: true },
|
|
14767
14827
|
{ action: "new-group", label: "New Group", enabled: true },
|
|
14768
14828
|
{ action: "duplicate", label: "Duplicate Layer", enabled: Boolean(active) },
|
|
14769
14829
|
{ action: "delete", label: "Delete Layer", enabled: Boolean(active) },
|
|
14770
14830
|
{ action: "group-selected", label: "Group Layer", enabled: Boolean(active) },
|
|
14771
|
-
{ action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess',
|
|
14772
|
-
{ action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess',
|
|
14831
|
+
{ action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _308 => _308.type]) === "group" },
|
|
14832
|
+
{ action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _309 => _309.visible]) && _optionalChain([below, 'optionalAccess', _310 => _310.type]) === "pixel") },
|
|
14773
14833
|
{ action: "merge-visible", label: "Merge Visible", enabled: s.layers.some((l) => l.visible) },
|
|
14774
14834
|
{ action: "flatten", label: "Flatten Image", enabled: s.layers.length > 0 },
|
|
14775
14835
|
{ action: "via-copy", label: "Layer via Copy", enabled: isPixel && hasSel },
|
|
14776
14836
|
{ action: "via-cut", label: "Layer via Cut", enabled: isPixel && hasSel },
|
|
14777
14837
|
{ action: "add-mask", label: "Add Layer Mask", enabled: Boolean(active) },
|
|
14778
14838
|
{ action: "add-mask-selection", label: "Add Mask from Selection", enabled: Boolean(active) && hasSel },
|
|
14779
|
-
{ action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess',
|
|
14780
|
-
{ action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess',
|
|
14781
|
-
{ action: "toggle-mask", label: _optionalChain([active, 'optionalAccess',
|
|
14782
|
-
{ action: "
|
|
14783
|
-
{ action: "
|
|
14839
|
+
{ action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _311 => _311.mask])) },
|
|
14840
|
+
{ action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _312 => _312.mask])) },
|
|
14841
|
+
{ action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _313 => _313.mask, 'optionalAccess', _314 => _314.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _315 => _315.mask])) },
|
|
14842
|
+
{ action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _316 => _316.mask, 'optionalAccess', _317 => _317.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _318 => _318.mask]) && !active.mask.source) },
|
|
14843
|
+
{ action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _319 => _319.type]) === "annotation" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _320 => _320.type]) === "pixel" && _optionalChain([active, 'access', _321 => _321.filters, 'optionalAccess', _322 => _322.length])) },
|
|
14844
|
+
{ action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _323 => _323.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
|
|
14784
14845
|
];
|
|
14785
14846
|
}
|
|
14786
14847
|
async function runLayerMenuAction(controller, action) {
|
|
14787
14848
|
const active = controller.getActiveLayer();
|
|
14788
|
-
const id = _optionalChain([active, 'optionalAccess',
|
|
14849
|
+
const id = _optionalChain([active, 'optionalAccess', _324 => _324.id]);
|
|
14789
14850
|
try {
|
|
14790
14851
|
switch (action) {
|
|
14791
14852
|
case "new-layer":
|
|
@@ -14832,13 +14893,16 @@ async function runLayerMenuAction(controller, action) {
|
|
|
14832
14893
|
if (id) controller.removeLayerMask(id);
|
|
14833
14894
|
break;
|
|
14834
14895
|
case "toggle-mask":
|
|
14835
|
-
if (id && _optionalChain([active, 'optionalAccess',
|
|
14896
|
+
if (id && _optionalChain([active, 'optionalAccess', _325 => _325.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
|
|
14897
|
+
break;
|
|
14898
|
+
case "toggle-mask-link":
|
|
14899
|
+
if (id && _optionalChain([active, 'optionalAccess', _326 => _326.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
|
|
14836
14900
|
break;
|
|
14837
14901
|
case "rasterize":
|
|
14838
14902
|
if (id) await controller.rasterizeLayer(id);
|
|
14839
14903
|
break;
|
|
14840
14904
|
case "toggle-clip":
|
|
14841
|
-
if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess',
|
|
14905
|
+
if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _327 => _327.clipped]) });
|
|
14842
14906
|
break;
|
|
14843
14907
|
}
|
|
14844
14908
|
return null;
|
|
@@ -14853,18 +14917,18 @@ function layerEffectsPanel(layer) {
|
|
|
14853
14917
|
if (!layer) return { ...empty, available: false, reason: "Select a layer to add effects." };
|
|
14854
14918
|
if (layer.type === "adjustment") return { ...empty, available: false, reason: "Adjustment layers cannot have effects." };
|
|
14855
14919
|
const fx = layer.effects;
|
|
14856
|
-
const readOnly = Boolean(_optionalChain([layer, 'access',
|
|
14920
|
+
const readOnly = Boolean(_optionalChain([layer, 'access', _328 => _328.locks, 'optionalAccess', _329 => _329.all]));
|
|
14857
14921
|
return {
|
|
14858
14922
|
available: true,
|
|
14859
14923
|
readOnly,
|
|
14860
14924
|
reason: readOnly ? "The layer is locked; unlock it to change its effects." : void 0,
|
|
14861
|
-
enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
14862
|
-
scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
14863
|
-
rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess',
|
|
14925
|
+
enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _330 => _330.enabled]), () => ( true)),
|
|
14926
|
+
scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _331 => _331.scale]), () => ( 1)),
|
|
14927
|
+
rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _332 => _332.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkWT6ZAWJPcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
|
|
14864
14928
|
};
|
|
14865
14929
|
}
|
|
14866
14930
|
function layerEffectsBadge(layer) {
|
|
14867
|
-
if (!_optionalChain([layer, 'access',
|
|
14931
|
+
if (!_optionalChain([layer, 'access', _333 => _333.effects, 'optionalAccess', _334 => _334.items, 'access', _335 => _335.length])) return null;
|
|
14868
14932
|
return _chunkWT6ZAWJPcjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
|
|
14869
14933
|
}
|
|
14870
14934
|
var LAYER_EFFECT_MENU = _chunkWT6ZAWJPcjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkWT6ZAWJPcjs.layerEffectLabel.call(void 0, kind) }));
|
|
@@ -14909,8 +14973,8 @@ function fillControls(f, allowPattern, patterns) {
|
|
|
14909
14973
|
}
|
|
14910
14974
|
function gradientControls(prefix, g) {
|
|
14911
14975
|
return [
|
|
14912
|
-
{ key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access',
|
|
14913
|
-
{ key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access',
|
|
14976
|
+
{ key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _336 => _336.stops, 'access', _337 => _337[0], 'optionalAccess', _338 => _338.color]), () => ( "#000000")) },
|
|
14977
|
+
{ key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _339 => _339.stops, 'access', _340 => _340[g.stops.length - 1], 'optionalAccess', _341 => _341.color]), () => ( "#ffffff")) },
|
|
14914
14978
|
{ key: `${prefix}.style`, label: "Style", type: "select", value: g.style, options: opt(["linear", "Linear"], ["radial", "Radial"], ["angle", "Angle"], ["reflected", "Reflected"], ["diamond", "Diamond"]) },
|
|
14915
14979
|
{ key: `${prefix}.angle`, label: "Angle", type: "range", min: -180, max: 180, step: 1, value: g.angle, unit: "\xB0" },
|
|
14916
14980
|
{ key: `${prefix}.scale`, label: "Scale", type: "range", min: 0.1, max: 1.5, step: 0.01, value: g.scale, percent: true, unit: "%" },
|
|
@@ -15002,19 +15066,19 @@ function layerEffectControls(e, patterns = []) {
|
|
|
15002
15066
|
}
|
|
15003
15067
|
function fillOfType(current, type, patterns) {
|
|
15004
15068
|
if (type === "gradient") return { type: "gradient", gradient: _chunkWT6ZAWJPcjs.defaultEffectGradient.call(void 0, ) };
|
|
15005
|
-
if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access',
|
|
15069
|
+
if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _342 => _342[0], 'optionalAccess', _343 => _343.id]), () => ( "checker")), scale: 1 };
|
|
15006
15070
|
return { type: "color", color: current.type === "color" ? current.color : "#000000" };
|
|
15007
15071
|
}
|
|
15008
15072
|
function effectControlChange(effect, key, value, patterns = []) {
|
|
15009
15073
|
const [top, ...rest] = key.split(".");
|
|
15010
15074
|
if (top === "fill" && rest[0] === "type") return { fill: fillOfType(effect.fill, String(value), patterns) };
|
|
15011
15075
|
if (top === "patternId" && !rest.length) {
|
|
15012
|
-
const name = _optionalChain([patternOptions, 'call',
|
|
15076
|
+
const name = _optionalChain([patternOptions, 'call', _344 => _344(patterns), 'access', _345 => _345.find, 'call', _346 => _346((o) => o.value === value), 'optionalAccess', _347 => _347.label]);
|
|
15013
15077
|
return name ? { patternId: value, name } : { patternId: value };
|
|
15014
15078
|
}
|
|
15015
15079
|
if (!rest.length) return { [top]: value };
|
|
15016
15080
|
if (top === "fill" && rest[0] === "patternId") {
|
|
15017
|
-
const name = _optionalChain([patternOptions, 'call',
|
|
15081
|
+
const name = _optionalChain([patternOptions, 'call', _348 => _348(patterns), 'access', _349 => _349.find, 'call', _350 => _350((o) => o.value === value), 'optionalAccess', _351 => _351.label]);
|
|
15018
15082
|
return { fill: { ...effect.fill, patternId: value, ...name ? { name } : {} } };
|
|
15019
15083
|
}
|
|
15020
15084
|
return { [top]: setPath(getPath(effect, top), rest, value) };
|
|
@@ -15053,6 +15117,582 @@ async function downloadPsd(controller, name = "image") {
|
|
|
15053
15117
|
return { fileName, warnings: res.warnings };
|
|
15054
15118
|
}
|
|
15055
15119
|
|
|
15120
|
+
// src/image-editor/layers/transform-ui.ts
|
|
15121
|
+
var CORNERS = ["nw", "ne", "se", "sw"];
|
|
15122
|
+
var SIDES = ["n", "e", "s", "w"];
|
|
15123
|
+
var CORNER_INDEX = { nw: 0, ne: 1, se: 2, sw: 3 };
|
|
15124
|
+
var SIDE_CORNERS = { n: [0, 1], e: [1, 2], s: [2, 3], w: [3, 0] };
|
|
15125
|
+
var HANDLE_FRACTION = { nw: [0, 0], n: [0.5, 0], ne: [1, 0], e: [1, 0.5], se: [1, 1], s: [0.5, 1], sw: [0, 1], w: [0, 0.5] };
|
|
15126
|
+
var ANCHOR_FRACTION2 = {
|
|
15127
|
+
"top-left": [0, 0],
|
|
15128
|
+
top: [0.5, 0],
|
|
15129
|
+
"top-right": [1, 0],
|
|
15130
|
+
left: [0, 0.5],
|
|
15131
|
+
center: [0.5, 0.5],
|
|
15132
|
+
right: [1, 0.5],
|
|
15133
|
+
"bottom-left": [0, 1],
|
|
15134
|
+
bottom: [0.5, 1],
|
|
15135
|
+
"bottom-right": [1, 1]
|
|
15136
|
+
};
|
|
15137
|
+
var FREE_TRANSFORM_MODE_OPTIONS = [
|
|
15138
|
+
{ id: "scale", label: "Free", title: "Free Transform: corners scale, outside rotates, Ctrl/Cmd distorts" },
|
|
15139
|
+
{ id: "rotate", label: "Rotate", title: "Every handle rotates about the reference point" },
|
|
15140
|
+
{ id: "skew", label: "Skew", title: "Sides slide along themselves" },
|
|
15141
|
+
{ id: "distort", label: "Distort", title: "Each corner moves freely" },
|
|
15142
|
+
{ id: "perspective", label: "Perspective", title: "A corner and its partner move symmetrically" },
|
|
15143
|
+
{ id: "warp", label: "Warp", title: "Bend through a mesh: drag its points or pull inside; presets in the bar" }
|
|
15144
|
+
];
|
|
15145
|
+
var WARP_STYLE_OPTIONS = [
|
|
15146
|
+
{ id: "custom", label: "Custom" },
|
|
15147
|
+
..._chunkDWGZUSEScjs.WARP_STYLES.map((id) => ({ id, label: _chunkDWGZUSEScjs.WARP_STYLE_LABELS[id] }))
|
|
15148
|
+
];
|
|
15149
|
+
var WARP_GRID_OPTIONS = [
|
|
15150
|
+
{ id: "1x1", label: "Default", columns: 1, rows: 1 },
|
|
15151
|
+
{ id: "3x3", label: "3 \xD7 3", columns: 3, rows: 3 },
|
|
15152
|
+
{ id: "5x5", label: "5 \xD7 5", columns: 5, rows: 5 }
|
|
15153
|
+
];
|
|
15154
|
+
var FREE_TRANSFORM_FIELDS = [
|
|
15155
|
+
{ id: "x", label: "X", unit: "px", title: "Reference point X (document pixels)" },
|
|
15156
|
+
{ id: "y", label: "Y", unit: "px", title: "Reference point Y (document pixels)" },
|
|
15157
|
+
{ id: "scaleX", label: "W", unit: "%", title: "Width in percent of the original" },
|
|
15158
|
+
{ id: "scaleY", label: "H", unit: "%", title: "Height in percent of the original" },
|
|
15159
|
+
{ id: "rotate", label: "\u2220", unit: "\xB0", title: "Rotation in degrees, clockwise" },
|
|
15160
|
+
{ id: "skewX", label: "H skew", unit: "\xB0", title: "Horizontal skew in degrees" },
|
|
15161
|
+
{ id: "skewY", label: "V skew", unit: "\xB0", title: "Vertical skew in degrees" }
|
|
15162
|
+
];
|
|
15163
|
+
var CURSOR = {
|
|
15164
|
+
nw: "nwse-resize",
|
|
15165
|
+
se: "nwse-resize",
|
|
15166
|
+
ne: "nesw-resize",
|
|
15167
|
+
sw: "nesw-resize",
|
|
15168
|
+
n: "ns-resize",
|
|
15169
|
+
s: "ns-resize",
|
|
15170
|
+
e: "ew-resize",
|
|
15171
|
+
w: "ew-resize",
|
|
15172
|
+
reference: "move",
|
|
15173
|
+
inside: "move",
|
|
15174
|
+
outside: "alias"
|
|
15175
|
+
};
|
|
15176
|
+
var meshIndex = (h) => h && h.startsWith("mesh:") ? Number(h.slice(5)) : -1;
|
|
15177
|
+
var mod = (m) => Boolean(m.ctrlKey || m.metaKey);
|
|
15178
|
+
var add = (a, b) => ({ x: a.x + b.x, y: a.y + b.y });
|
|
15179
|
+
var sub = (a, b) => ({ x: a.x - b.x, y: a.y - b.y });
|
|
15180
|
+
function rotateAbout(p, c, rad) {
|
|
15181
|
+
const cos = Math.cos(rad);
|
|
15182
|
+
const sin = Math.sin(rad);
|
|
15183
|
+
const d = sub(p, c);
|
|
15184
|
+
return { x: c.x + d.x * cos - d.y * sin, y: c.y + d.x * sin + d.y * cos };
|
|
15185
|
+
}
|
|
15186
|
+
function insideQuad(q2, p) {
|
|
15187
|
+
let sign = 0;
|
|
15188
|
+
for (let i = 0; i < 4; i++) {
|
|
15189
|
+
const a = q2[i];
|
|
15190
|
+
const b = q2[(i + 1) % 4];
|
|
15191
|
+
const c = (b.x - a.x) * (p.y - a.y) - (b.y - a.y) * (p.x - a.x);
|
|
15192
|
+
if (Math.abs(c) < 1e-12) continue;
|
|
15193
|
+
const s = Math.sign(c);
|
|
15194
|
+
if (sign && s !== sign) return false;
|
|
15195
|
+
sign = s;
|
|
15196
|
+
}
|
|
15197
|
+
return true;
|
|
15198
|
+
}
|
|
15199
|
+
function insidePolygon(poly, p) {
|
|
15200
|
+
let inside = false;
|
|
15201
|
+
for (let i = 0, j = poly.length - 1; i < poly.length; j = i++) {
|
|
15202
|
+
const a = poly[i];
|
|
15203
|
+
const b = poly[j];
|
|
15204
|
+
if (a.y > p.y !== b.y > p.y && p.x < (b.x - a.x) * (p.y - a.y) / (b.y - a.y) + a.x) inside = !inside;
|
|
15205
|
+
}
|
|
15206
|
+
return inside;
|
|
15207
|
+
}
|
|
15208
|
+
var FreeTransformTool = (_class11 = class {
|
|
15209
|
+
constructor(controller, options = {}) {;_class11.prototype.__init65.call(this);_class11.prototype.__init66.call(this);_class11.prototype.__init67.call(this);_class11.prototype.__init68.call(this);_class11.prototype.__init69.call(this);_class11.prototype.__init70.call(this);_class11.prototype.__init71.call(this);_class11.prototype.__init72.call(this);_class11.prototype.__init73.call(this);_class11.prototype.__init74.call(this);_class11.prototype.__init75.call(this);_class11.prototype.__init76.call(this);_class11.prototype.__init77.call(this);_class11.prototype.__init78.call(this);
|
|
15210
|
+
this.controller = controller;
|
|
15211
|
+
this.options = options;
|
|
15212
|
+
}
|
|
15213
|
+
|
|
15214
|
+
|
|
15215
|
+
__init65() {this.sessionRef = null}
|
|
15216
|
+
__init66() {this.modeValue = "scale"}
|
|
15217
|
+
/** The reference point in the untransformed frame's space (follows the transform). */
|
|
15218
|
+
__init67() {this.refBox = { x: 0, y: 0 }}
|
|
15219
|
+
__init68() {this.corners = null}
|
|
15220
|
+
__init69() {this.drag = null}
|
|
15221
|
+
/** The warp mesh in the frame's own space (null: no warp). */
|
|
15222
|
+
__init70() {this.mesh = null}
|
|
15223
|
+
__init71() {this.warpSettings = { style: "custom", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", columns: 1, rows: 1 }}
|
|
15224
|
+
__init72() {this.pending = false}
|
|
15225
|
+
__init73() {this.viewScale = 1}
|
|
15226
|
+
|
|
15227
|
+
/** Values typed into the options bar since the last drag (V skew is not recovered from the shape). */
|
|
15228
|
+
__init74() {this.typed = {}}
|
|
15229
|
+
/** Width and height scale together when typed (the chain icon). */
|
|
15230
|
+
__init75() {this.proportional = true}
|
|
15231
|
+
__init76() {this.error = null}
|
|
15232
|
+
__init77() {this.lastResult = null}
|
|
15233
|
+
get active() {
|
|
15234
|
+
return Boolean(_optionalChain([this, 'access', _352 => _352.sessionRef, 'optionalAccess', _353 => _353.isOpen]));
|
|
15235
|
+
}
|
|
15236
|
+
get session() {
|
|
15237
|
+
return this.active ? this.sessionRef : null;
|
|
15238
|
+
}
|
|
15239
|
+
get mode() {
|
|
15240
|
+
return this.modeValue;
|
|
15241
|
+
}
|
|
15242
|
+
get interpolation() {
|
|
15243
|
+
return _nullishCoalesce(_optionalChain([this, 'access', _354 => _354.sessionRef, 'optionalAccess', _355 => _355.interpolation]), () => ( "bicubic"));
|
|
15244
|
+
}
|
|
15245
|
+
__init78() {this.listeners = /* @__PURE__ */ new Set()}
|
|
15246
|
+
/** Calls `listener` whenever the overlay, readout, mode or error changes. Returns the unsubscribe. */
|
|
15247
|
+
subscribe(listener) {
|
|
15248
|
+
this.listeners.add(listener);
|
|
15249
|
+
return () => {
|
|
15250
|
+
this.listeners.delete(listener);
|
|
15251
|
+
};
|
|
15252
|
+
}
|
|
15253
|
+
changed() {
|
|
15254
|
+
_optionalChain([this, 'access', _356 => _356.options, 'access', _357 => _357.onChange, 'optionalCall', _358 => _358()]);
|
|
15255
|
+
for (const l of this.listeners) l();
|
|
15256
|
+
}
|
|
15257
|
+
/** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
|
|
15258
|
+
begin(init = {}) {
|
|
15259
|
+
if (this.active) return null;
|
|
15260
|
+
try {
|
|
15261
|
+
if (!init.layerId && init.content !== "selection-outline" && !this.controller.getState().activeLayerId) {
|
|
15262
|
+
const top = [..._chunkWT6ZAWJPcjs.flattenLayers.call(void 0, this.controller.getState().layers)].reverse().find((l) => l.type === "pixel" && l.visible);
|
|
15263
|
+
if (top) this.controller.setActiveLayer(top.id);
|
|
15264
|
+
}
|
|
15265
|
+
const s = this.controller.beginFreeTransform(init);
|
|
15266
|
+
this.sessionRef = s;
|
|
15267
|
+
this.corners = s.geometry.corners;
|
|
15268
|
+
this.refBox = { x: s.box.x + s.box.width / 2, y: s.box.y + s.box.height / 2 };
|
|
15269
|
+
this.modeValue = "scale";
|
|
15270
|
+
this.mesh = null;
|
|
15271
|
+
this.warpSettings = { style: "custom", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", columns: 1, rows: 1 };
|
|
15272
|
+
this.typed = {};
|
|
15273
|
+
this.error = null;
|
|
15274
|
+
} catch (e) {
|
|
15275
|
+
this.error = e instanceof Error ? e.message : String(e);
|
|
15276
|
+
}
|
|
15277
|
+
this.changed();
|
|
15278
|
+
return this.error;
|
|
15279
|
+
}
|
|
15280
|
+
setMode(mode) {
|
|
15281
|
+
this.modeValue = mode;
|
|
15282
|
+
const s = this.session;
|
|
15283
|
+
if (mode === "warp" && s && !this.mesh) this.mesh = _chunkDWGZUSEScjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
|
|
15284
|
+
this.changed();
|
|
15285
|
+
}
|
|
15286
|
+
/** The Warp options bar's settings. */
|
|
15287
|
+
warpBar() {
|
|
15288
|
+
return { ...this.warpSettings };
|
|
15289
|
+
}
|
|
15290
|
+
/** The warp mesh (frame space), or null. */
|
|
15291
|
+
get warp() {
|
|
15292
|
+
return this.mesh;
|
|
15293
|
+
}
|
|
15294
|
+
/**
|
|
15295
|
+
* Applies Warp options: a preset `style` with `bend` / `horizontal` / `vertical` (percent) and
|
|
15296
|
+
* `orientation` replaces the mesh; `custom` keeps it; the grid size re-splits it (exactly when it
|
|
15297
|
+
* can). Switches to Warp mode.
|
|
15298
|
+
*/
|
|
15299
|
+
setWarp(changes) {
|
|
15300
|
+
const s = this.session;
|
|
15301
|
+
if (!s) return;
|
|
15302
|
+
this.modeValue = "warp";
|
|
15303
|
+
const next = { ...this.warpSettings, ...changes };
|
|
15304
|
+
this.warpSettings = next;
|
|
15305
|
+
let mesh = _nullishCoalesce(this.mesh, () => ( _chunkDWGZUSEScjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
|
|
15306
|
+
if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
|
|
15307
|
+
const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
|
|
15308
|
+
mesh = _nullishCoalesce(_chunkDWGZUSEScjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkDWGZUSEScjs.identityWarpMesh.call(void 0, s.box)));
|
|
15309
|
+
mesh = _chunkDWGZUSEScjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
15310
|
+
}
|
|
15311
|
+
if ("columns" in changes || "rows" in changes) mesh = _chunkDWGZUSEScjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
|
|
15312
|
+
this.mesh = mesh;
|
|
15313
|
+
this.changed();
|
|
15314
|
+
this.preview();
|
|
15315
|
+
}
|
|
15316
|
+
/** Sets the reference point to an anchor of the frame (the options bar's locator). */
|
|
15317
|
+
setReference(anchor) {
|
|
15318
|
+
const s = this.session;
|
|
15319
|
+
if (!s) return;
|
|
15320
|
+
const [fx, fy] = ANCHOR_FRACTION2[anchor];
|
|
15321
|
+
this.refBox = { x: s.box.x + fx * s.box.width, y: s.box.y + fy * s.box.height };
|
|
15322
|
+
this.changed();
|
|
15323
|
+
}
|
|
15324
|
+
setInterpolation(interpolation) {
|
|
15325
|
+
const s = this.session;
|
|
15326
|
+
if (!s) return;
|
|
15327
|
+
this.run(() => s.update({ interpolation }, false));
|
|
15328
|
+
}
|
|
15329
|
+
/** Screen pixels per document pixel and the visible document area, for previews. */
|
|
15330
|
+
setView(scale, clip) {
|
|
15331
|
+
this.viewScale = scale > 0 ? scale : 1;
|
|
15332
|
+
this.viewClip = clip;
|
|
15333
|
+
}
|
|
15334
|
+
homography() {
|
|
15335
|
+
const s = this.session;
|
|
15336
|
+
return s && this.corners ? _chunkMUUXNRU4cjs.rectToQuad.call(void 0, s.box, this.corners) : null;
|
|
15337
|
+
}
|
|
15338
|
+
/** The reference point in document pixels. */
|
|
15339
|
+
referencePoint() {
|
|
15340
|
+
const h = this.homography();
|
|
15341
|
+
return h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, this.refBox) : null;
|
|
15342
|
+
}
|
|
15343
|
+
/** The outline, handles and reference point to draw, or `null` when no transform is open. */
|
|
15344
|
+
overlay() {
|
|
15345
|
+
const s = this.session;
|
|
15346
|
+
const h = this.homography();
|
|
15347
|
+
if (!s || !h || !this.corners) return null;
|
|
15348
|
+
const handles = [...CORNERS, ...SIDES].map((id) => {
|
|
15349
|
+
const [fx, fy] = HANDLE_FRACTION[id];
|
|
15350
|
+
const p = _nullishCoalesce(_chunkMUUXNRU4cjs.applyHomography.call(void 0, h, { x: s.box.x + fx * s.box.width, y: s.box.y + fy * s.box.height }), () => ( { x: 0, y: 0 }));
|
|
15351
|
+
return { id, x: p.x, y: p.y };
|
|
15352
|
+
});
|
|
15353
|
+
const out = { outline: this.corners.map((p) => ({ x: p.x, y: p.y })), handles, reference: _nullishCoalesce(this.referencePoint(), () => ( { x: 0, y: 0 })) };
|
|
15354
|
+
if (this.modeValue === "warp" && this.mesh) {
|
|
15355
|
+
const m = this.mesh;
|
|
15356
|
+
const at = (p) => _nullishCoalesce(_chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p), () => ( p));
|
|
15357
|
+
const pts = m.points.map(at);
|
|
15358
|
+
const edit = _chunkDWGZUSEScjs.warpMeshEditPoints.call(void 0, m);
|
|
15359
|
+
out.handles = [];
|
|
15360
|
+
out.outline = _chunkDWGZUSEScjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
|
|
15361
|
+
out.warp = {
|
|
15362
|
+
curves: _chunkDWGZUSEScjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
|
|
15363
|
+
anchors: edit.anchors.map((i) => pts[i]),
|
|
15364
|
+
handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
|
|
15365
|
+
};
|
|
15366
|
+
}
|
|
15367
|
+
return out;
|
|
15368
|
+
}
|
|
15369
|
+
/** The mesh's border anchors, clockwise (for the inside test). */
|
|
15370
|
+
meshOutline(pts, m) {
|
|
15371
|
+
const nx = 3 * (m.us.length - 1) + 1;
|
|
15372
|
+
const ny = 3 * (m.vs.length - 1) + 1;
|
|
15373
|
+
const ring = [];
|
|
15374
|
+
for (let i = 0; i < nx; i++) ring.push(pts[i]);
|
|
15375
|
+
for (let j = 1; j < ny; j++) ring.push(pts[j * nx + nx - 1]);
|
|
15376
|
+
for (let i = nx - 2; i >= 0; i--) ring.push(pts[(ny - 1) * nx + i]);
|
|
15377
|
+
for (let j = ny - 2; j > 0; j--) ring.push(pts[j * nx]);
|
|
15378
|
+
return ring;
|
|
15379
|
+
}
|
|
15380
|
+
/** What a document point is over (`tolerance` in document pixels: a few screen pixels / scale). */
|
|
15381
|
+
hit(p, tolerance) {
|
|
15382
|
+
const o = this.overlay();
|
|
15383
|
+
if (!o) return null;
|
|
15384
|
+
if (this.modeValue === "warp" && this.mesh) {
|
|
15385
|
+
const h = this.homography();
|
|
15386
|
+
const edit = _chunkDWGZUSEScjs.warpMeshEditPoints.call(void 0, this.mesh);
|
|
15387
|
+
let best2 = -1;
|
|
15388
|
+
let bestD2 = tolerance;
|
|
15389
|
+
for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
|
|
15390
|
+
const q2 = _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, this.mesh.points[i]);
|
|
15391
|
+
if (!q2) continue;
|
|
15392
|
+
const d = Math.hypot(q2.x - p.x, q2.y - p.y);
|
|
15393
|
+
if (d <= bestD2) {
|
|
15394
|
+
best2 = i;
|
|
15395
|
+
bestD2 = d;
|
|
15396
|
+
}
|
|
15397
|
+
}
|
|
15398
|
+
if (best2 >= 0) return `mesh:${best2}`;
|
|
15399
|
+
return insidePolygon(o.outline, p) ? "inside" : "outside";
|
|
15400
|
+
}
|
|
15401
|
+
let best = null;
|
|
15402
|
+
let bestD = tolerance;
|
|
15403
|
+
for (const h of o.handles) {
|
|
15404
|
+
const d = Math.hypot(h.x - p.x, h.y - p.y);
|
|
15405
|
+
if (d <= bestD) {
|
|
15406
|
+
best = h.id;
|
|
15407
|
+
bestD = d;
|
|
15408
|
+
}
|
|
15409
|
+
}
|
|
15410
|
+
if (Math.hypot(o.reference.x - p.x, o.reference.y - p.y) < bestD) best = "reference";
|
|
15411
|
+
if (best) return best;
|
|
15412
|
+
return insideQuad(o.outline, p) ? "inside" : "outside";
|
|
15413
|
+
}
|
|
15414
|
+
/** The CSS cursor for a handle. */
|
|
15415
|
+
cursor(handle) {
|
|
15416
|
+
if (!handle) return "default";
|
|
15417
|
+
if (meshIndex(handle) >= 0) return "pointer";
|
|
15418
|
+
if (this.modeValue === "warp") return handle === "inside" ? "grab" : "default";
|
|
15419
|
+
if (this.modeValue === "rotate" && handle !== "inside" && handle !== "reference") return CURSOR.outside;
|
|
15420
|
+
return CURSOR[handle];
|
|
15421
|
+
}
|
|
15422
|
+
/** Starts a drag on what `p` is over. */
|
|
15423
|
+
down(p, tolerance) {
|
|
15424
|
+
if (!this.session || !this.corners) return null;
|
|
15425
|
+
const handle = this.hit(p, tolerance);
|
|
15426
|
+
if (!handle) return null;
|
|
15427
|
+
let st = null;
|
|
15428
|
+
if (this.modeValue === "warp" && this.mesh && handle === "inside") {
|
|
15429
|
+
const q2 = this.toFrame(p, this.corners);
|
|
15430
|
+
if (q2) {
|
|
15431
|
+
const r = _chunkDWGZUSEScjs.warpMeshParamAt.call(void 0, this.mesh, q2);
|
|
15432
|
+
st = { s: r.s, t: r.t };
|
|
15433
|
+
}
|
|
15434
|
+
}
|
|
15435
|
+
this.drag = { handle, start: { x: p.x, y: p.y }, corners: this.corners, refBox: { ...this.refBox }, ref: _nullishCoalesce(this.referencePoint(), () => ( p)), mesh: this.mesh, st };
|
|
15436
|
+
return handle;
|
|
15437
|
+
}
|
|
15438
|
+
/** A document point in the frame's own space under `corners`. */
|
|
15439
|
+
toFrame(p, corners) {
|
|
15440
|
+
const s = this.session;
|
|
15441
|
+
const h = s ? _chunkMUUXNRU4cjs.rectToQuad.call(void 0, s.box, corners) : null;
|
|
15442
|
+
const inv = h && _chunkMUUXNRU4cjs.invertHomography.call(void 0, h);
|
|
15443
|
+
return inv ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, inv, p) : null;
|
|
15444
|
+
}
|
|
15445
|
+
/** Continues the drag to `p` with the modifiers held now. */
|
|
15446
|
+
move(p, m = {}) {
|
|
15447
|
+
const d = this.drag;
|
|
15448
|
+
const s = this.session;
|
|
15449
|
+
if (!d || !s) return;
|
|
15450
|
+
if (d.handle === "reference") {
|
|
15451
|
+
const h = _chunkMUUXNRU4cjs.rectToQuad.call(void 0, s.box, d.corners);
|
|
15452
|
+
const inv = h && _chunkMUUXNRU4cjs.invertHomography.call(void 0, h);
|
|
15453
|
+
const q2 = inv && _chunkMUUXNRU4cjs.applyHomography.call(void 0, inv, p);
|
|
15454
|
+
if (q2) this.refBox = q2;
|
|
15455
|
+
this.changed();
|
|
15456
|
+
return;
|
|
15457
|
+
}
|
|
15458
|
+
if (this.modeValue === "warp" && d.mesh) {
|
|
15459
|
+
const a = this.toFrame(d.start, d.corners);
|
|
15460
|
+
const b = this.toFrame(p, d.corners);
|
|
15461
|
+
if (!a || !b) return;
|
|
15462
|
+
const delta = { x: b.x - a.x, y: b.y - a.y };
|
|
15463
|
+
const i = meshIndex(d.handle);
|
|
15464
|
+
if (i >= 0) this.mesh = _chunkDWGZUSEScjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
|
|
15465
|
+
else if (d.handle === "inside" && d.st) this.mesh = _chunkDWGZUSEScjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
|
|
15466
|
+
else return;
|
|
15467
|
+
this.warpSettings = { ...this.warpSettings, style: "custom" };
|
|
15468
|
+
this.changed();
|
|
15469
|
+
this.preview();
|
|
15470
|
+
return;
|
|
15471
|
+
}
|
|
15472
|
+
const corners = this.dragCorners(d, p, m);
|
|
15473
|
+
if (corners) this.setCorners(corners);
|
|
15474
|
+
}
|
|
15475
|
+
/** Ends the drag (the transform stays open). */
|
|
15476
|
+
up() {
|
|
15477
|
+
this.drag = null;
|
|
15478
|
+
}
|
|
15479
|
+
dragCorners(d, p, m) {
|
|
15480
|
+
const s = this.session;
|
|
15481
|
+
const c0 = d.corners;
|
|
15482
|
+
let delta = sub(p, d.start);
|
|
15483
|
+
const map = (f) => c0.map(f);
|
|
15484
|
+
const handle = d.handle;
|
|
15485
|
+
const isCorner = handle in CORNER_INDEX;
|
|
15486
|
+
const isSide = handle in SIDE_CORNERS;
|
|
15487
|
+
const rotating = handle === "outside" || this.modeValue === "rotate" && (isCorner || isSide);
|
|
15488
|
+
if (handle === "inside") {
|
|
15489
|
+
if (m.shiftKey) delta = Math.abs(delta.x) >= Math.abs(delta.y) ? { x: delta.x, y: 0 } : { x: 0, y: delta.y };
|
|
15490
|
+
return map((q3) => add(q3, delta));
|
|
15491
|
+
}
|
|
15492
|
+
if (rotating) {
|
|
15493
|
+
const r = d.ref;
|
|
15494
|
+
let a = Math.atan2(p.y - r.y, p.x - r.x) - Math.atan2(d.start.y - r.y, d.start.x - r.x);
|
|
15495
|
+
if (m.shiftKey) a = Math.round(a / (Math.PI / 12)) * (Math.PI / 12);
|
|
15496
|
+
return map((q3) => rotateAbout(q3, r, a));
|
|
15497
|
+
}
|
|
15498
|
+
const perspective = this.modeValue === "perspective" || mod(m) && m.altKey && m.shiftKey;
|
|
15499
|
+
const distort = this.modeValue === "distort" || mod(m) && !perspective;
|
|
15500
|
+
const skew = this.modeValue === "skew" || mod(m) && isSide;
|
|
15501
|
+
if (isSide && (skew || perspective)) {
|
|
15502
|
+
const [i, j] = SIDE_CORNERS[handle];
|
|
15503
|
+
const dir = sub(c0[j], c0[i]);
|
|
15504
|
+
const len = Math.hypot(dir.x, dir.y) || 1;
|
|
15505
|
+
const t = (delta.x * dir.x + delta.y * dir.y) / len;
|
|
15506
|
+
const v = { x: dir.x / len * t, y: dir.y / len * t };
|
|
15507
|
+
const [oi, oj] = SIDE_CORNERS[{ n: "s", s: "n", e: "w", w: "e" }[handle]];
|
|
15508
|
+
return map((q3, k) => k === i || k === j ? add(q3, v) : m.altKey && (k === oi || k === oj) ? sub(q3, v) : q3);
|
|
15509
|
+
}
|
|
15510
|
+
if (isCorner && perspective) {
|
|
15511
|
+
const k = CORNER_INDEX[handle];
|
|
15512
|
+
if (Math.abs(delta.x) >= Math.abs(delta.y)) {
|
|
15513
|
+
const partner2 = [1, 0, 3, 2][k];
|
|
15514
|
+
return map((q3, i) => i === k ? { x: q3.x + delta.x, y: q3.y } : i === partner2 ? { x: q3.x - delta.x, y: q3.y } : q3);
|
|
15515
|
+
}
|
|
15516
|
+
const partner = [3, 2, 1, 0][k];
|
|
15517
|
+
return map((q3, i) => i === k ? { x: q3.x, y: q3.y + delta.y } : i === partner ? { x: q3.x, y: q3.y - delta.y } : q3);
|
|
15518
|
+
}
|
|
15519
|
+
if (distort || isCorner && this.modeValue === "skew") {
|
|
15520
|
+
if (isCorner) return map((q3, i2) => i2 === CORNER_INDEX[handle] ? add(q3, delta) : q3);
|
|
15521
|
+
const [i, j] = SIDE_CORNERS[handle];
|
|
15522
|
+
return map((q3, k) => k === i || k === j ? add(q3, delta) : q3);
|
|
15523
|
+
}
|
|
15524
|
+
const h = _chunkMUUXNRU4cjs.rectToQuad.call(void 0, s.box, c0);
|
|
15525
|
+
const inv = h && _chunkMUUXNRU4cjs.invertHomography.call(void 0, h);
|
|
15526
|
+
if (!h || !inv) return null;
|
|
15527
|
+
const q2 = _chunkMUUXNRU4cjs.applyHomography.call(void 0, inv, p);
|
|
15528
|
+
const q0 = _chunkMUUXNRU4cjs.applyHomography.call(void 0, inv, d.start);
|
|
15529
|
+
if (!q2 || !q0) return null;
|
|
15530
|
+
const b = s.box;
|
|
15531
|
+
const [fx, fy] = HANDLE_FRACTION[handle];
|
|
15532
|
+
const grab = { x: b.x + fx * b.width, y: b.y + fy * b.height };
|
|
15533
|
+
const anchor = m.altKey ? d.refBox : { x: b.x + (1 - fx) * b.width, y: b.y + (1 - fy) * b.height };
|
|
15534
|
+
const target = add(grab, sub(q2, q0));
|
|
15535
|
+
const ax = grab.x - anchor.x;
|
|
15536
|
+
const ay = grab.y - anchor.y;
|
|
15537
|
+
let sx = isCorner || handle === "e" || handle === "w" ? Math.abs(ax) > 1e-9 ? (target.x - anchor.x) / ax : 1 : 1;
|
|
15538
|
+
let sy = isCorner || handle === "n" || handle === "s" ? Math.abs(ay) > 1e-9 ? (target.y - anchor.y) / ay : 1 : 1;
|
|
15539
|
+
if (isCorner && !m.shiftKey) {
|
|
15540
|
+
const k = Math.abs(sx) >= Math.abs(sy) ? sx : sy;
|
|
15541
|
+
sx = k;
|
|
15542
|
+
sy = k;
|
|
15543
|
+
}
|
|
15544
|
+
const scaled = [
|
|
15545
|
+
{ x: b.x, y: b.y },
|
|
15546
|
+
{ x: b.x + b.width, y: b.y },
|
|
15547
|
+
{ x: b.x + b.width, y: b.y + b.height },
|
|
15548
|
+
{ x: b.x, y: b.y + b.height }
|
|
15549
|
+
].map((c) => _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, { x: anchor.x + (c.x - anchor.x) * sx, y: anchor.y + (c.y - anchor.y) * sy }));
|
|
15550
|
+
return scaled.every(Boolean) ? scaled : null;
|
|
15551
|
+
}
|
|
15552
|
+
/** Sets new corners and refreshes the preview (scheduled). Invalid shapes keep the last good one. */
|
|
15553
|
+
setCorners(corners) {
|
|
15554
|
+
const s = this.session;
|
|
15555
|
+
if (!s) return;
|
|
15556
|
+
const h = _chunkMUUXNRU4cjs.rectToQuad.call(void 0, s.box, corners);
|
|
15557
|
+
if (!h) return;
|
|
15558
|
+
this.corners = corners;
|
|
15559
|
+
this.typed = {};
|
|
15560
|
+
this.changed();
|
|
15561
|
+
this.preview();
|
|
15562
|
+
}
|
|
15563
|
+
preview() {
|
|
15564
|
+
if (this.pending) return;
|
|
15565
|
+
this.pending = true;
|
|
15566
|
+
const run = () => {
|
|
15567
|
+
this.pending = false;
|
|
15568
|
+
const s = this.session;
|
|
15569
|
+
if (!s || !this.corners) return;
|
|
15570
|
+
this.run(() => s.update({ corners: this.corners, warp: this.mesh }, { scale: this.viewScale, clip: this.viewClip }));
|
|
15571
|
+
};
|
|
15572
|
+
if (this.options.schedule) this.options.schedule(run);
|
|
15573
|
+
else run();
|
|
15574
|
+
}
|
|
15575
|
+
run(fn) {
|
|
15576
|
+
try {
|
|
15577
|
+
fn();
|
|
15578
|
+
this.error = null;
|
|
15579
|
+
} catch (e) {
|
|
15580
|
+
this.error = e instanceof Error ? e.message : String(e);
|
|
15581
|
+
if (this.sessionRef && !this.sessionRef.isOpen) this.sessionRef = null;
|
|
15582
|
+
}
|
|
15583
|
+
this.changed();
|
|
15584
|
+
}
|
|
15585
|
+
/** The options bar's numbers for the current shape. */
|
|
15586
|
+
bar() {
|
|
15587
|
+
const s = this.session;
|
|
15588
|
+
if (!s || !this.corners) return null;
|
|
15589
|
+
const read = describeTransform({ box: s.box, corners: this.corners }, this.refBox);
|
|
15590
|
+
return {
|
|
15591
|
+
affine: read.affine,
|
|
15592
|
+
x: _nullishCoalesce(this.typed.x, () => ( read.x)),
|
|
15593
|
+
y: _nullishCoalesce(this.typed.y, () => ( read.y)),
|
|
15594
|
+
scaleX: _nullishCoalesce(this.typed.scaleX, () => ( read.scaleX)),
|
|
15595
|
+
scaleY: _nullishCoalesce(this.typed.scaleY, () => ( read.scaleY)),
|
|
15596
|
+
rotate: _nullishCoalesce(this.typed.rotate, () => ( read.rotate)),
|
|
15597
|
+
skewX: _nullishCoalesce(this.typed.skewX, () => ( read.skewX)),
|
|
15598
|
+
skewY: _nullishCoalesce(this.typed.skewY, () => ( 0))
|
|
15599
|
+
};
|
|
15600
|
+
}
|
|
15601
|
+
/** Applies a typed options-bar value (W and H together while `proportional`). */
|
|
15602
|
+
setField(field, value) {
|
|
15603
|
+
const s = this.session;
|
|
15604
|
+
const cur = this.bar();
|
|
15605
|
+
if (!s || !cur || !Number.isFinite(value)) return;
|
|
15606
|
+
const next = { ...cur, [field]: value };
|
|
15607
|
+
if (this.proportional && field === "scaleX") next.scaleY = cur.scaleY === 0 ? value : value / cur.scaleX * cur.scaleY;
|
|
15608
|
+
if (this.proportional && field === "scaleY") next.scaleX = cur.scaleX === 0 ? value : value / cur.scaleY * cur.scaleX;
|
|
15609
|
+
if (!next.scaleX || !next.scaleY) {
|
|
15610
|
+
this.error = "Width and height must not be 0 %.";
|
|
15611
|
+
this.changed();
|
|
15612
|
+
return;
|
|
15613
|
+
}
|
|
15614
|
+
const m = matrixFromParams(s.box, {
|
|
15615
|
+
scaleX: next.scaleX,
|
|
15616
|
+
scaleY: next.scaleY,
|
|
15617
|
+
rotate: next.rotate,
|
|
15618
|
+
skewX: next.skewX,
|
|
15619
|
+
skewY: next.skewY,
|
|
15620
|
+
reference: this.refBox,
|
|
15621
|
+
dx: next.x - this.refBox.x,
|
|
15622
|
+
dy: next.y - this.refBox.y
|
|
15623
|
+
});
|
|
15624
|
+
this.setCorners(cornersFromMatrix(s.box, m));
|
|
15625
|
+
this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
|
|
15626
|
+
this.changed();
|
|
15627
|
+
}
|
|
15628
|
+
/** Finishes with full-quality resampling (one undo step). */
|
|
15629
|
+
commit() {
|
|
15630
|
+
const s = this.session;
|
|
15631
|
+
if (!s) return null;
|
|
15632
|
+
let res = null;
|
|
15633
|
+
this.pending = false;
|
|
15634
|
+
this.run(() => {
|
|
15635
|
+
if (this.corners) s.update({ corners: this.corners, warp: this.mesh }, false);
|
|
15636
|
+
res = s.commit();
|
|
15637
|
+
});
|
|
15638
|
+
this.lastResult = res;
|
|
15639
|
+
this.sessionRef = null;
|
|
15640
|
+
this.corners = null;
|
|
15641
|
+
this.mesh = null;
|
|
15642
|
+
this.drag = null;
|
|
15643
|
+
this.changed();
|
|
15644
|
+
return res;
|
|
15645
|
+
}
|
|
15646
|
+
/** Abandons the transform and restores everything. */
|
|
15647
|
+
cancel() {
|
|
15648
|
+
_optionalChain([this, 'access', _359 => _359.sessionRef, 'optionalAccess', _360 => _360.cancel, 'call', _361 => _361()]);
|
|
15649
|
+
this.sessionRef = null;
|
|
15650
|
+
this.corners = null;
|
|
15651
|
+
this.mesh = null;
|
|
15652
|
+
this.drag = null;
|
|
15653
|
+
this.pending = false;
|
|
15654
|
+
this.error = null;
|
|
15655
|
+
this.changed();
|
|
15656
|
+
}
|
|
15657
|
+
/**
|
|
15658
|
+
* Keyboard: Enter commits, Escape cancels, arrows nudge by 1 px (Shift: 10). Ctrl/Cmd+T opens a
|
|
15659
|
+
* Free Transform when none is open. Returns true when the key was used (prevent its default).
|
|
15660
|
+
*/
|
|
15661
|
+
key(e) {
|
|
15662
|
+
const t = e.target;
|
|
15663
|
+
const typing = Boolean(t && (t.isContentEditable || t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT"));
|
|
15664
|
+
if (!this.active) {
|
|
15665
|
+
if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "t" && !typing) {
|
|
15666
|
+
this.begin();
|
|
15667
|
+
return true;
|
|
15668
|
+
}
|
|
15669
|
+
return false;
|
|
15670
|
+
}
|
|
15671
|
+
if (e.key === "Enter") {
|
|
15672
|
+
this.commit();
|
|
15673
|
+
return true;
|
|
15674
|
+
}
|
|
15675
|
+
if (e.key === "Escape") {
|
|
15676
|
+
this.cancel();
|
|
15677
|
+
return true;
|
|
15678
|
+
}
|
|
15679
|
+
if (typing) return false;
|
|
15680
|
+
const step = e.shiftKey ? 10 : 1;
|
|
15681
|
+
const nudge = { ArrowLeft: { x: -step, y: 0 }, ArrowRight: { x: step, y: 0 }, ArrowUp: { x: 0, y: -step }, ArrowDown: { x: 0, y: step } };
|
|
15682
|
+
const v = nudge[e.key];
|
|
15683
|
+
if (v && this.corners) {
|
|
15684
|
+
this.setCorners(this.corners.map((q2) => add(q2, v)));
|
|
15685
|
+
return true;
|
|
15686
|
+
}
|
|
15687
|
+
return false;
|
|
15688
|
+
}
|
|
15689
|
+
}, _class11);
|
|
15690
|
+
|
|
15691
|
+
|
|
15692
|
+
|
|
15693
|
+
|
|
15694
|
+
|
|
15695
|
+
|
|
15056
15696
|
|
|
15057
15697
|
|
|
15058
15698
|
|
|
@@ -15581,5 +16221,5 @@ async function downloadPsd(controller, name = "image") {
|
|
|
15581
16221
|
|
|
15582
16222
|
|
|
15583
16223
|
|
|
15584
|
-
exports.ADJUSTMENT_KEYS = ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = BACKGROUND_LAYER_NAME; exports.BLEND_MODES = _chunkCRMAXIUVcjs.BLEND_MODES; exports.BLUR_FILTER_ID = BLUR_FILTER_ID; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.CoverageMap = _chunkZZOTHJ4Kcjs.CoverageMap; exports.D50 = D50; exports.D65 = D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_BRUSH = _chunkZZOTHJ4Kcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_GLOBAL_LIGHT = _chunkWT6ZAWJPcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MIXER = _chunkZZOTHJ4Kcjs.DEFAULT_MIXER; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEVELOP_FILTER_ID = DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkWT6ZAWJPcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DabWalker = _chunkZZOTHJ4Kcjs.DabWalker; exports.EMPTY_DISTANCE = EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkZZOTHJ4Kcjs.EMPTY_MIXER_LOAD; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_MODES = FREE_TRANSFORM_MODES; exports.FreeTransformSession = FreeTransformSession; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.INTERPOLATIONS = _chunkWT6ZAWJPcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkWT6ZAWJPcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = LEGACY_PROCESS_VERSION; exports.LUMA_709 = LUMA_709; exports.LayerCompositor = LayerCompositor; exports.LayerEffectError = _chunkWT6ZAWJPcjs.LayerEffectError; exports.LayerOperationError = LayerOperationError; exports.MAX_BRUSH_SIZE = _chunkZZOTHJ4Kcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkWT6ZAWJPcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = MAX_KELVIN; exports.MAX_TRANSFORM_PIXELS = _chunkWT6ZAWJPcjs.MAX_TRANSFORM_PIXELS; exports.MIN_KELVIN = MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkZZOTHJ4Kcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkZZOTHJ4Kcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkZZOTHJ4Kcjs.MIXING_MODELS; exports.MixerStroke = _chunkZZOTHJ4Kcjs.MixerStroke; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PATTERN_BLOCK_KEYS = PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCRMAXIUVcjs.PIGMENT_BANDS; exports.PIGMENT_LAMBDA_MIN = _chunkCRMAXIUVcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCRMAXIUVcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_WAVELENGTHS = _chunkCRMAXIUVcjs.PIGMENT_WAVELENGTHS; exports.PSD_BLEND_KEYS = PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkWT6ZAWJPcjs.PatternPlacement; exports.PatternTile = _chunkWT6ZAWJPcjs.PatternTile; exports.PsdError = PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SUPPORTED_ADJUSTMENT_KEYS = SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.StrokeCoverage = _chunkZZOTHJ4Kcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCRMAXIUVcjs.SurfaceDraft; exports.TILE = _chunkCRMAXIUVcjs.TILE; exports.TILE_SHIFT = _chunkCRMAXIUVcjs.TILE_SHIFT; exports.TINT_SCALE = TINT_SCALE; exports.TONE_LUT_SIZE = TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = TRANSFORM_ANCHORS; exports.TiledSurface = _chunkCRMAXIUVcjs.TiledSurface; exports.TransformTooLargeError = _chunkWT6ZAWJPcjs.TransformTooLargeError; exports.VIBRANCE_GREY = VIBRANCE_GREY; exports.WARP_STYLES = _chunkDWGZUSEScjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkDWGZUSEScjs.WARP_STYLE_LABELS; exports.XYZ_D50_TO_SRGB = XYZ_D50_TO_SRGB; exports.ZlibError = _chunkWT6ZAWJPcjs.ZlibError; exports.activeAdjustmentLayers = activeAdjustmentLayers; exports.addLayerEffect = addLayerEffect; exports.addLayerFilter = addLayerFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = adjustmentKindLabel; exports.adjustmentLayersKey = adjustmentLayersKey; exports.adjustmentNodeAsLayer = adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = adjustmentNodeFromLegacy; exports.adler32 = _chunkWT6ZAWJPcjs.adler32; exports.anchorPoint = anchorPoint; exports.annotationLayerFor = annotationLayerFor; exports.annotationLayerName = annotationLayerName; exports.applyAdjustmentLayers = applyAdjustmentLayers; exports.applyAdjustments = applyAdjustments; exports.applyBoxBlur = applyBoxBlur; exports.applyDepthMask = applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = applyImageProjectionToContext; exports.applyLegacyAdjustments = applyLegacyAdjustments; exports.applyMatrix3 = applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = applyParams; exports.applyProcess2Adjustments = applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyStrokeToTile = _chunkZZOTHJ4Kcjs.applyStrokeToTile; exports.backgroundLayer = backgroundLayer; exports.base64ToBytes = _chunkWT6ZAWJPcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.blackWhiteGray = blackWhiteGray; exports.blendChannel = _chunkCRMAXIUVcjs.blendChannel; exports.blendImageData = _chunkCRMAXIUVcjs.blendImageData; exports.blendLum = _chunkCRMAXIUVcjs.blendLum; exports.blendPixel = _chunkCRMAXIUVcjs.blendPixel; exports.blendRgb = _chunkCRMAXIUVcjs.blendRgb; exports.blendTile = _chunkWT6ZAWJPcjs.blendTile; exports.blurFilter = blurFilter; exports.borderCoverage = borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = bradfordAdaptation; exports.buildLayerMaskPlanes = buildLayerMaskPlanes; exports.buildToneLut = buildToneLut; exports.builtinPattern = _chunkWT6ZAWJPcjs.builtinPattern; exports.builtinPatternIds = _chunkWT6ZAWJPcjs.builtinPatternIds; exports.bytesToBase64 = _chunkWT6ZAWJPcjs.bytesToBase64; exports.calculateCropDrag = calculateCropDrag; exports.canvasCompositeOperation = _chunkCRMAXIUVcjs.canvasCompositeOperation; exports.canvasToImagePoint = canvasToImagePoint; exports.changedTiles = _chunkWT6ZAWJPcjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = clampCropToImage; exports.cleanMixer = _chunkZZOTHJ4Kcjs.cleanMixer; exports.collectTiles = _chunkCRMAXIUVcjs.collectTiles; exports.colorBalanceChannel = colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = combineSelections; exports.compileAdjustmentLayer = compileAdjustmentLayer; exports.compositeSurfaceOver = _chunkWT6ZAWJPcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = computeSelectionBounds; exports.contentBounds = _chunkCRMAXIUVcjs.contentBounds; exports.contractCoverage = contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.cornersFromMatrix = cornersFromMatrix; exports.coverageTileCoord = _chunkZZOTHJ4Kcjs.coverageTileCoord; exports.coverageToByte = coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = createAdjustmentLayer; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageTransformTools = createImageTransformTools; exports.createPigment = _chunkCRMAXIUVcjs.createPigment; exports.createPigmentTools = _chunkZZOTHJ4Kcjs.createPigmentTools; exports.createSelectionMask = createSelectionMask; exports.curveLut = _chunkWT6ZAWJPcjs.curveLut; exports.curveLutFromLevels = curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkZZOTHJ4Kcjs.dabCoverage; exports.dabRect = _chunkZZOTHJ4Kcjs.dabRect; exports.decodeLayerChannel = decodeLayerChannel; exports.decodeLayerMask = decodeLayerMask; exports.decodeMergedImage = decodeMergedImage; exports.decodePlanes = decodePlanes; exports.decodePng = _chunkWT6ZAWJPcjs.decodePng; exports.decodePngDataUrl = decodePngDataUrl; exports.decodeSelectionRle = decodeSelectionRle; exports.defaultAdjustmentParams = defaultAdjustmentParams; exports.defaultEffectGradient = _chunkWT6ZAWJPcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkWT6ZAWJPcjs.defaultLayerEffect; exports.deflate = _chunkWT6ZAWJPcjs.deflate; exports.deflateRaw = _chunkWT6ZAWJPcjs.deflateRaw; exports.depthMaskAlpha = depthMaskAlpha; exports.depthRasterMask = depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = describeTransform; exports.deserializeEffects = deserializeEffects; exports.deserializeLayer = deserializeLayer; exports.deserializeLayers = deserializeLayers; exports.deserializePatterns = deserializePatterns; exports.deserializeSelection = deserializeSelection; exports.developFilter = developFilter; exports.developFromAdjustments = developFromAdjustments; exports.developTarget = developTarget; exports.distanceTransform = distanceTransform; exports.downloadPsd = downloadPsd; exports.dragWarpMeshPoint = _chunkDWGZUSEScjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.duplicateLayer = duplicateLayer; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkWT6ZAWJPcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkWT6ZAWJPcjs.effectReach; exports.effectsFingerprint = _chunkWT6ZAWJPcjs.effectsFingerprint; exports.effectsMargin = _chunkWT6ZAWJPcjs.effectsMargin; exports.effectsScale = _chunkWT6ZAWJPcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCRMAXIUVcjs.emptySurface; exports.encodePng = _chunkWT6ZAWJPcjs.encodePng; exports.encodeRle = encodeRle; exports.encodeSelectionRle = encodeSelectionRle; exports.encodeSurface = encodeSurface; exports.evalWarpMesh = _chunkDWGZUSEScjs.evalWarpMesh; exports.evaluateAdjustmentLayers = evaluateAdjustmentLayers; exports.expandCoverage = expandCoverage; exports.exportPsd = exportPsd; exports.featherCoverage = featherCoverage; exports.fillRect = _chunkCRMAXIUVcjs.fillRect; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkWT6ZAWJPcjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunkCRMAXIUVcjs.finishTile; exports.flattenLayers = _chunkWT6ZAWJPcjs.flattenLayers; exports.flipCorners = flipCorners; exports.formatControlValue = formatControlValue; exports.fullSelection = fullSelection; exports.gaussianBlur = _chunkWT6ZAWJPcjs.gaussianBlur; exports.geometryHomography = geometryHomography; exports.getAnnotationBounds = getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = getCropCursor; exports.getRotatedSize = getRotatedSize; exports.getViewportMetrics = getViewportMetrics; exports.getViewportProjection = getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = greyMorphology; exports.groupLayers = groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkWT6ZAWJPcjs.hasActiveEffects; exports.hasResampledLegacyMask = hasResampledLegacyMask; exports.hasWarp = hasWarp; exports.hashMaskContent = hashMaskContent; exports.hashNoise = _chunkWT6ZAWJPcjs.hashNoise; exports.hexToRgb = hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = hitTestAnnotation; exports.hitTestCrop = hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = hueRangeTables; exports.hueRangeWeight = hueRangeWeight; exports.hueSaturation = hueSaturation; exports.identityCurve = identityCurve; exports.identityLevels = identityLevels; exports.identityTransform = identityTransform; exports.identityWarpMesh = _chunkDWGZUSEScjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = imageToCanvasPoint; exports.importPsd = importPsd; exports.inflate = _chunkWT6ZAWJPcjs.inflate; exports.inflateRaw = _chunkWT6ZAWJPcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkWT6ZAWJPcjs.insertLayer; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = invertMatrix3; exports.invertSelection = invertSelection; exports.isActiveFilter = isActiveFilter; exports.isAdjustmentKind = isAdjustmentKind; exports.isBlendMode = _chunkCRMAXIUVcjs.isBlendMode; exports.isDefaultDepthMask = isDefaultDepthMask; exports.isIdentityTransform = isIdentityTransform; exports.isInterpolation = _chunkWT6ZAWJPcjs.isInterpolation; exports.isLayerEffectKind = _chunkWT6ZAWJPcjs.isLayerEffectKind; exports.isLayerLocked = _chunkWT6ZAWJPcjs.isLayerLocked; exports.isLegacyShape = isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPng = _chunkWT6ZAWJPcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = isQuarterTurnSwapped; exports.isSelectionEmpty = isSelectionEmpty; exports.isSelectionMode = isSelectionMode; exports.isSeparableBlendMode = _chunkCRMAXIUVcjs.isSeparableBlendMode; exports.isSpatialFilter = isSpatialFilter; exports.isTransformAnchor = isTransformAnchor; exports.isValidWarp = isValidWarp; exports.kelvinToTemperature = kelvinToTemperature; exports.keysWeight = _chunkWT6ZAWJPcjs.keysWeight; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkWT6ZAWJPcjs.layerEffectFields; exports.layerEffectLabel = _chunkWT6ZAWJPcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerLabel = layerLabel; exports.layerMaskCoverage = layerMaskCoverage; exports.layerMaskFromSelection = layerMaskFromSelection; exports.layerMaskKey = layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = layerTree; exports.layerTypeLabel = layerTypeLabel; exports.layersFromLegacy = layersFromLegacy; exports.legacyAdjustmentLayer = legacyAdjustmentLayer; exports.legacyMaskOf = legacyMaskOf; exports.legacyView = legacyView; exports.lerpPigment = _chunkCRMAXIUVcjs.lerpPigment; exports.lerpPigmentInto = _chunkCRMAXIUVcjs.lerpPigmentInto; exports.levelsValue = levelsValue; exports.linearSrgbToXy = linearSrgbToXy; exports.linearToSrgb = linearToSrgb; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkZZOTHJ4Kcjs.loadMixer; exports.magicWand = magicWand; exports.mapCropHandle = mapCropHandle; exports.mapLayer = _chunkWT6ZAWJPcjs.mapLayer; exports.maskSummary = maskSummary; exports.matrixFromCorners = matrixFromCorners; exports.matrixFromParams = matrixFromParams; exports.mergeLayerEffect = _chunkWT6ZAWJPcjs.mergeLayerEffect; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunkCRMAXIUVcjs.mixPigment8; exports.mixPigmentRgb = _chunkCRMAXIUVcjs.mixPigmentRgb; exports.mixPigments = _chunkCRMAXIUVcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.modifySelection = modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = moveLayer; exports.mulMatrix3 = mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = neutralHueRange; exports.newEffectId = _chunkWT6ZAWJPcjs.newEffectId; exports.newLayerId = newLayerId; exports.normalizeAdjustmentLayer = normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = normalizeAdjustmentLayers; exports.normalizeAngle = normalizeAngle; exports.normalizeBlendMode = _chunkCRMAXIUVcjs.normalizeBlendMode; exports.normalizeBrush = _chunkZZOTHJ4Kcjs.normalizeBrush; exports.normalizeFilter = normalizeFilter; exports.normalizeLayerEffects = _chunkWT6ZAWJPcjs.normalizeLayerEffects; exports.normalizeLayerMask = normalizeLayerMask; exports.normalizeMixer = _chunkZZOTHJ4Kcjs.normalizeMixer; exports.normalizeProcessVersion = normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.offsetLayer = offsetLayer; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCRMAXIUVcjs.packRgba; exports.parseAdjustmentBlock = parseAdjustmentBlock; exports.parseBlend = parseBlend; exports.parseColor = parseColor; exports.parseDataUrl = _chunkWT6ZAWJPcjs.parseDataUrl; exports.parseEffectColor = _chunkWT6ZAWJPcjs.parseEffectColor; exports.parseLfx2 = parseLfx2; exports.parseLrfx = parseLrfx; exports.parsePatternBlock = parsePatternBlock; exports.parseSelectionMode = parseSelectionMode; exports.parseVersionedDescriptor = parseVersionedDescriptor; exports.photoFilterMatrix = photoFilterMatrix; exports.pixelLayerBounds = pixelLayerBounds; exports.pixelLayers = pixelLayers; exports.placeLayer = placeLayer; exports.pngDataUrl = _chunkWT6ZAWJPcjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = posterizeValue; exports.presetWarp = presetWarp; exports.previewStep = previewStep; exports.projectImagePoint = projectImagePoint; exports.projectImageRect = projectImageRect; exports.projectMaskCoverage = projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = psdPatternToEffectPattern; exports.psdToLayers = psdToLayers; exports.pullWarpMesh = _chunkDWGZUSEScjs.pullWarpMesh; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = rangeLightness; exports.rasterMaskFromLegacy = rasterMaskFromLegacy; exports.rasterizeDab = _chunkZZOTHJ4Kcjs.rasterizeDab; exports.readAdjustmentControls = readAdjustmentControls; exports.readPixel = _chunkCRMAXIUVcjs.readPixel; exports.readPsd = readPsd; exports.readRegion = _chunkCRMAXIUVcjs.readRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkWT6ZAWJPcjs.reduceSurface; exports.referencePoint = referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCRMAXIUVcjs.reflectanceToRgb; exports.removeAlpha = removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = removeLayer; exports.removeLayerEffect = removeLayerEffect; exports.removeLayerFilter = removeLayerFilter; exports.renderLayerEffects = _chunkWT6ZAWJPcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.requireLayer = requireLayer; exports.requireUnlocked = requireUnlocked; exports.resizePixels = resizePixels; exports.resizeSelection = resizeSelection; exports.resizeWarpMesh = _chunkDWGZUSEScjs.resizeWarpMesh; exports.resolveExternalAssets = resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.rgbToGray = rgbToGray; exports.rgbToHsl = rgbToHsl; exports.rgbToReflectance = _chunkCRMAXIUVcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = sampleLut; exports.sampleToneLut = sampleToneLut; exports.scaleLayerEffect = _chunkWT6ZAWJPcjs.scaleLayerEffect; exports.selectionArea = selectionArea; exports.selectionFromCoverage = selectionFromCoverage; exports.selectionFromPixels = selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = selectionToCoverage; exports.selectionToPixels = selectionToPixels; exports.selectionValueAt = selectionValueAt; exports.serializeEffects = serializeEffects; exports.serializeLayer = serializeLayer; exports.serializeLayers = serializeLayers; exports.serializeLayersExternal = serializeLayersExternal; exports.serializePatterns = serializePatterns; exports.serializeSelection = serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = setLayerEffects; exports.setLayerEffectsEnabled = setLayerEffectsEnabled; exports.setLayerMask = setLayerMask; exports.setLayerProperties = setLayerProperties; exports.setLum = _chunkCRMAXIUVcjs.setLum; exports.setPigmentColor = _chunkCRMAXIUVcjs.setPigmentColor; exports.shiftCoverage = shiftCoverage; exports.smoothCoverage = smoothCoverage; exports.smoothPoints = _chunkZZOTHJ4Kcjs.smoothPoints; exports.solidSurface = _chunkCRMAXIUVcjs.solidSurface; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = srgbToLinear; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCRMAXIUVcjs.surfaceBytes; exports.surfaceFromPixels = _chunkCRMAXIUVcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCRMAXIUVcjs.surfacesEqual; exports.tempTintToXy = tempTintToXy; exports.temperatureToKelvin = temperatureToKelvin; exports.tileCoord = _chunkCRMAXIUVcjs.tileCoord; exports.tileKey = _chunkCRMAXIUVcjs.tileKey; exports.tileRect = _chunkCRMAXIUVcjs.tileRect; exports.tilesInRect = _chunkCRMAXIUVcjs.tilesInRect; exports.tipFalloff = _chunkZZOTHJ4Kcjs.tipFalloff; exports.tipReach = _chunkZZOTHJ4Kcjs.tipReach; exports.tipShape = _chunkZZOTHJ4Kcjs.tipShape; exports.toHex = toHex2; exports.toneCurve = toneCurve; exports.toneLuts = toneLuts; exports.toneRange = toneRange; exports.transformHomography = transformHomography; exports.transformMap = transformMap; exports.transformSurface = _chunkWT6ZAWJPcjs.transformSurface; exports.transformedBounds = _chunkWT6ZAWJPcjs.transformedBounds; exports.transformedBox = transformedBox; exports.transformedPoint = transformedPoint; exports.translateSurface = _chunkCRMAXIUVcjs.translateSurface; exports.ungroupLayer = ungroupLayer; exports.uniformTile = _chunkCRMAXIUVcjs.uniformTile; exports.unionRect = unionRect; exports.unprojectCanvasPoint = unprojectCanvasPoint; exports.updateLayerEffect = updateLayerEffect; exports.updateLayerFilter = updateLayerFilter; exports.updateLayerMaskProps = updateLayerMaskProps; exports.uvToXy = uvToXy; exports.validateEffectGradient = _chunkWT6ZAWJPcjs.validateEffectGradient; exports.validateLayerEffect = _chunkWT6ZAWJPcjs.validateLayerEffect; exports.validateLayerEffects = _chunkWT6ZAWJPcjs.validateLayerEffects; exports.versionedDescriptorBytes = versionedDescriptorBytes; exports.vibranceLinear = vibranceLinear; exports.vibrancePixel = vibrancePixel; exports.walkDabs = _chunkZZOTHJ4Kcjs.walkDabs; exports.warpMeshEditPoints = _chunkDWGZUSEScjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkDWGZUSEScjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkDWGZUSEScjs.warpMeshParamAt; exports.warpPresetMesh = _chunkDWGZUSEScjs.warpPresetMesh; exports.warpSurface = _chunkWT6ZAWJPcjs.warpSurface; exports.wbMatrix = wbMatrix; exports.whiteBalanceFromSample = whiteBalanceFromSample; exports.whiteBalanceMatrix = whiteBalanceMatrix; exports.withNewIds = withNewIds; exports.writeAdjustmentBlock = writeAdjustmentBlock; exports.writeLfx2 = writeLfx2; exports.writePatternBlock = writePatternBlock; exports.writePsd = writePsd; exports.writeRegion = _chunkCRMAXIUVcjs.writeRegion; exports.xyToTempTint = xyToTempTint; exports.xyToUv = xyToUv;
|
|
16224
|
+
exports.ADJUSTMENT_KEYS = ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = BACKGROUND_LAYER_NAME; exports.BLEND_MODES = _chunkCRMAXIUVcjs.BLEND_MODES; exports.BLUR_FILTER_ID = BLUR_FILTER_ID; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.CoverageMap = _chunkZZOTHJ4Kcjs.CoverageMap; exports.D50 = D50; exports.D65 = D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_BRUSH = _chunkZZOTHJ4Kcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_GLOBAL_LIGHT = _chunkWT6ZAWJPcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MIXER = _chunkZZOTHJ4Kcjs.DEFAULT_MIXER; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEVELOP_FILTER_ID = DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkWT6ZAWJPcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DabWalker = _chunkZZOTHJ4Kcjs.DabWalker; exports.EMPTY_DISTANCE = EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkZZOTHJ4Kcjs.EMPTY_MIXER_LOAD; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.INTERPOLATIONS = _chunkWT6ZAWJPcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkWT6ZAWJPcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = LEGACY_PROCESS_VERSION; exports.LUMA_709 = LUMA_709; exports.LayerCompositor = LayerCompositor; exports.LayerEffectError = _chunkWT6ZAWJPcjs.LayerEffectError; exports.LayerOperationError = LayerOperationError; exports.MAX_BRUSH_SIZE = _chunkZZOTHJ4Kcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkWT6ZAWJPcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = MAX_KELVIN; exports.MAX_TRANSFORM_PIXELS = _chunkWT6ZAWJPcjs.MAX_TRANSFORM_PIXELS; exports.MIN_KELVIN = MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkZZOTHJ4Kcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkZZOTHJ4Kcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkZZOTHJ4Kcjs.MIXING_MODELS; exports.MixerStroke = _chunkZZOTHJ4Kcjs.MixerStroke; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PATTERN_BLOCK_KEYS = PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCRMAXIUVcjs.PIGMENT_BANDS; exports.PIGMENT_LAMBDA_MIN = _chunkCRMAXIUVcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCRMAXIUVcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_WAVELENGTHS = _chunkCRMAXIUVcjs.PIGMENT_WAVELENGTHS; exports.PSD_BLEND_KEYS = PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkWT6ZAWJPcjs.PatternPlacement; exports.PatternTile = _chunkWT6ZAWJPcjs.PatternTile; exports.PsdError = PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SUPPORTED_ADJUSTMENT_KEYS = SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.StrokeCoverage = _chunkZZOTHJ4Kcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCRMAXIUVcjs.SurfaceDraft; exports.TILE = _chunkCRMAXIUVcjs.TILE; exports.TILE_SHIFT = _chunkCRMAXIUVcjs.TILE_SHIFT; exports.TINT_SCALE = TINT_SCALE; exports.TONE_LUT_SIZE = TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = TRANSFORM_ANCHORS; exports.TiledSurface = _chunkCRMAXIUVcjs.TiledSurface; exports.TransformTooLargeError = _chunkWT6ZAWJPcjs.TransformTooLargeError; exports.VIBRANCE_GREY = VIBRANCE_GREY; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkDWGZUSEScjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkDWGZUSEScjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.XYZ_D50_TO_SRGB = XYZ_D50_TO_SRGB; exports.ZlibError = _chunkWT6ZAWJPcjs.ZlibError; exports.activeAdjustmentLayers = activeAdjustmentLayers; exports.addLayerEffect = addLayerEffect; exports.addLayerFilter = addLayerFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = adjustmentKindLabel; exports.adjustmentLayersKey = adjustmentLayersKey; exports.adjustmentNodeAsLayer = adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = adjustmentNodeFromLegacy; exports.adler32 = _chunkWT6ZAWJPcjs.adler32; exports.anchorPoint = anchorPoint; exports.annotationLayerFor = annotationLayerFor; exports.annotationLayerName = annotationLayerName; exports.applyAdjustmentLayers = applyAdjustmentLayers; exports.applyAdjustments = applyAdjustments; exports.applyBoxBlur = applyBoxBlur; exports.applyDepthMask = applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = applyImageProjectionToContext; exports.applyLegacyAdjustments = applyLegacyAdjustments; exports.applyMatrix3 = applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = applyParams; exports.applyProcess2Adjustments = applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyStrokeToTile = _chunkZZOTHJ4Kcjs.applyStrokeToTile; exports.backgroundLayer = backgroundLayer; exports.base64ToBytes = _chunkWT6ZAWJPcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.blackWhiteGray = blackWhiteGray; exports.blendChannel = _chunkCRMAXIUVcjs.blendChannel; exports.blendImageData = _chunkCRMAXIUVcjs.blendImageData; exports.blendLum = _chunkCRMAXIUVcjs.blendLum; exports.blendPixel = _chunkCRMAXIUVcjs.blendPixel; exports.blendRgb = _chunkCRMAXIUVcjs.blendRgb; exports.blendTile = _chunkWT6ZAWJPcjs.blendTile; exports.blurFilter = blurFilter; exports.borderCoverage = borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = bradfordAdaptation; exports.buildLayerMaskPlanes = buildLayerMaskPlanes; exports.buildToneLut = buildToneLut; exports.builtinPattern = _chunkWT6ZAWJPcjs.builtinPattern; exports.builtinPatternIds = _chunkWT6ZAWJPcjs.builtinPatternIds; exports.bytesToBase64 = _chunkWT6ZAWJPcjs.bytesToBase64; exports.calculateCropDrag = calculateCropDrag; exports.canvasCompositeOperation = _chunkCRMAXIUVcjs.canvasCompositeOperation; exports.canvasToImagePoint = canvasToImagePoint; exports.changedTiles = _chunkWT6ZAWJPcjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = clampCropToImage; exports.cleanMixer = _chunkZZOTHJ4Kcjs.cleanMixer; exports.collectTiles = _chunkCRMAXIUVcjs.collectTiles; exports.colorBalanceChannel = colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = combineSelections; exports.compileAdjustmentLayer = compileAdjustmentLayer; exports.compositeSurfaceOver = _chunkWT6ZAWJPcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = computeSelectionBounds; exports.contentBounds = _chunkCRMAXIUVcjs.contentBounds; exports.contractCoverage = contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.cornersFromMatrix = cornersFromMatrix; exports.coverageTileCoord = _chunkZZOTHJ4Kcjs.coverageTileCoord; exports.coverageToByte = coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = createAdjustmentLayer; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageTransformTools = createImageTransformTools; exports.createPigment = _chunkCRMAXIUVcjs.createPigment; exports.createPigmentTools = _chunkZZOTHJ4Kcjs.createPigmentTools; exports.createSelectionMask = createSelectionMask; exports.curveLut = _chunkWT6ZAWJPcjs.curveLut; exports.curveLutFromLevels = curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkZZOTHJ4Kcjs.dabCoverage; exports.dabRect = _chunkZZOTHJ4Kcjs.dabRect; exports.decodeLayerChannel = decodeLayerChannel; exports.decodeLayerMask = decodeLayerMask; exports.decodeMergedImage = decodeMergedImage; exports.decodePlanes = decodePlanes; exports.decodePng = _chunkWT6ZAWJPcjs.decodePng; exports.decodePngDataUrl = decodePngDataUrl; exports.decodeSelectionRle = decodeSelectionRle; exports.defaultAdjustmentParams = defaultAdjustmentParams; exports.defaultEffectGradient = _chunkWT6ZAWJPcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkWT6ZAWJPcjs.defaultLayerEffect; exports.deflate = _chunkWT6ZAWJPcjs.deflate; exports.deflateRaw = _chunkWT6ZAWJPcjs.deflateRaw; exports.depthMaskAlpha = depthMaskAlpha; exports.depthRasterMask = depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = describeTransform; exports.deserializeEffects = deserializeEffects; exports.deserializeLayer = deserializeLayer; exports.deserializeLayers = deserializeLayers; exports.deserializePatterns = deserializePatterns; exports.deserializeSelection = deserializeSelection; exports.developFilter = developFilter; exports.developFromAdjustments = developFromAdjustments; exports.developTarget = developTarget; exports.distanceTransform = distanceTransform; exports.downloadPsd = downloadPsd; exports.dragWarpMeshPoint = _chunkDWGZUSEScjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.duplicateLayer = duplicateLayer; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkWT6ZAWJPcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkWT6ZAWJPcjs.effectReach; exports.effectsFingerprint = _chunkWT6ZAWJPcjs.effectsFingerprint; exports.effectsMargin = _chunkWT6ZAWJPcjs.effectsMargin; exports.effectsScale = _chunkWT6ZAWJPcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCRMAXIUVcjs.emptySurface; exports.encodePng = _chunkWT6ZAWJPcjs.encodePng; exports.encodeRle = encodeRle; exports.encodeSelectionRle = encodeSelectionRle; exports.encodeSurface = encodeSurface; exports.evalWarpMesh = _chunkDWGZUSEScjs.evalWarpMesh; exports.evaluateAdjustmentLayers = evaluateAdjustmentLayers; exports.expandCoverage = expandCoverage; exports.exportPsd = exportPsd; exports.featherCoverage = featherCoverage; exports.fillRect = _chunkCRMAXIUVcjs.fillRect; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkWT6ZAWJPcjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunkCRMAXIUVcjs.finishTile; exports.flattenLayers = _chunkWT6ZAWJPcjs.flattenLayers; exports.flipCorners = flipCorners; exports.formatControlValue = formatControlValue; exports.fullSelection = fullSelection; exports.gaussianBlur = _chunkWT6ZAWJPcjs.gaussianBlur; exports.geometryHomography = geometryHomography; exports.getAnnotationBounds = getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = getCropCursor; exports.getRotatedSize = getRotatedSize; exports.getViewportMetrics = getViewportMetrics; exports.getViewportProjection = getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = greyMorphology; exports.groupLayers = groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkWT6ZAWJPcjs.hasActiveEffects; exports.hasResampledLegacyMask = hasResampledLegacyMask; exports.hasWarp = hasWarp; exports.hashMaskContent = hashMaskContent; exports.hashNoise = _chunkWT6ZAWJPcjs.hashNoise; exports.hexToRgb = hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = hitTestAnnotation; exports.hitTestCrop = hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = hueRangeTables; exports.hueRangeWeight = hueRangeWeight; exports.hueSaturation = hueSaturation; exports.identityCurve = identityCurve; exports.identityLevels = identityLevels; exports.identityTransform = identityTransform; exports.identityWarpMesh = _chunkDWGZUSEScjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = imageToCanvasPoint; exports.importPsd = importPsd; exports.inflate = _chunkWT6ZAWJPcjs.inflate; exports.inflateRaw = _chunkWT6ZAWJPcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkWT6ZAWJPcjs.insertLayer; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = invertMatrix3; exports.invertSelection = invertSelection; exports.isActiveFilter = isActiveFilter; exports.isAdjustmentKind = isAdjustmentKind; exports.isBlendMode = _chunkCRMAXIUVcjs.isBlendMode; exports.isDefaultDepthMask = isDefaultDepthMask; exports.isIdentityTransform = isIdentityTransform; exports.isInterpolation = _chunkWT6ZAWJPcjs.isInterpolation; exports.isLayerEffectKind = _chunkWT6ZAWJPcjs.isLayerEffectKind; exports.isLayerLocked = _chunkWT6ZAWJPcjs.isLayerLocked; exports.isLegacyShape = isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPng = _chunkWT6ZAWJPcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = isQuarterTurnSwapped; exports.isSelectionEmpty = isSelectionEmpty; exports.isSelectionMode = isSelectionMode; exports.isSeparableBlendMode = _chunkCRMAXIUVcjs.isSeparableBlendMode; exports.isSpatialFilter = isSpatialFilter; exports.isTransformAnchor = isTransformAnchor; exports.isValidWarp = isValidWarp; exports.kelvinToTemperature = kelvinToTemperature; exports.keysWeight = _chunkWT6ZAWJPcjs.keysWeight; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkWT6ZAWJPcjs.layerEffectFields; exports.layerEffectLabel = _chunkWT6ZAWJPcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerLabel = layerLabel; exports.layerMaskCoverage = layerMaskCoverage; exports.layerMaskFromSelection = layerMaskFromSelection; exports.layerMaskKey = layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = layerTree; exports.layerTypeLabel = layerTypeLabel; exports.layersFromLegacy = layersFromLegacy; exports.legacyAdjustmentLayer = legacyAdjustmentLayer; exports.legacyMaskOf = legacyMaskOf; exports.legacyView = legacyView; exports.lerpPigment = _chunkCRMAXIUVcjs.lerpPigment; exports.lerpPigmentInto = _chunkCRMAXIUVcjs.lerpPigmentInto; exports.levelsValue = levelsValue; exports.linearSrgbToXy = linearSrgbToXy; exports.linearToSrgb = linearToSrgb; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkZZOTHJ4Kcjs.loadMixer; exports.magicWand = magicWand; exports.mapCropHandle = mapCropHandle; exports.mapLayer = _chunkWT6ZAWJPcjs.mapLayer; exports.maskSummary = maskSummary; exports.matrixFromCorners = matrixFromCorners; exports.matrixFromParams = matrixFromParams; exports.mergeLayerEffect = _chunkWT6ZAWJPcjs.mergeLayerEffect; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunkCRMAXIUVcjs.mixPigment8; exports.mixPigmentRgb = _chunkCRMAXIUVcjs.mixPigmentRgb; exports.mixPigments = _chunkCRMAXIUVcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.modifySelection = modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = moveLayer; exports.mulMatrix3 = mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = neutralHueRange; exports.newEffectId = _chunkWT6ZAWJPcjs.newEffectId; exports.newLayerId = newLayerId; exports.normalizeAdjustmentLayer = normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = normalizeAdjustmentLayers; exports.normalizeAngle = normalizeAngle; exports.normalizeBlendMode = _chunkCRMAXIUVcjs.normalizeBlendMode; exports.normalizeBrush = _chunkZZOTHJ4Kcjs.normalizeBrush; exports.normalizeFilter = normalizeFilter; exports.normalizeLayerEffects = _chunkWT6ZAWJPcjs.normalizeLayerEffects; exports.normalizeLayerMask = normalizeLayerMask; exports.normalizeMixer = _chunkZZOTHJ4Kcjs.normalizeMixer; exports.normalizeProcessVersion = normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.offsetLayer = offsetLayer; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCRMAXIUVcjs.packRgba; exports.parseAdjustmentBlock = parseAdjustmentBlock; exports.parseBlend = parseBlend; exports.parseColor = parseColor; exports.parseDataUrl = _chunkWT6ZAWJPcjs.parseDataUrl; exports.parseEffectColor = _chunkWT6ZAWJPcjs.parseEffectColor; exports.parseLfx2 = parseLfx2; exports.parseLrfx = parseLrfx; exports.parsePatternBlock = parsePatternBlock; exports.parseSelectionMode = parseSelectionMode; exports.parseVersionedDescriptor = parseVersionedDescriptor; exports.photoFilterMatrix = photoFilterMatrix; exports.pixelLayerBounds = pixelLayerBounds; exports.pixelLayers = pixelLayers; exports.placeLayer = placeLayer; exports.pngDataUrl = _chunkWT6ZAWJPcjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = posterizeValue; exports.presetWarp = presetWarp; exports.previewStep = previewStep; exports.projectImagePoint = projectImagePoint; exports.projectImageRect = projectImageRect; exports.projectMaskCoverage = projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = psdPatternToEffectPattern; exports.psdToLayers = psdToLayers; exports.pullWarpMesh = _chunkDWGZUSEScjs.pullWarpMesh; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = rangeLightness; exports.rasterMaskFromLegacy = rasterMaskFromLegacy; exports.rasterizeDab = _chunkZZOTHJ4Kcjs.rasterizeDab; exports.readAdjustmentControls = readAdjustmentControls; exports.readPixel = _chunkCRMAXIUVcjs.readPixel; exports.readPsd = readPsd; exports.readRegion = _chunkCRMAXIUVcjs.readRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkWT6ZAWJPcjs.reduceSurface; exports.referencePoint = referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCRMAXIUVcjs.reflectanceToRgb; exports.removeAlpha = removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = removeLayer; exports.removeLayerEffect = removeLayerEffect; exports.removeLayerFilter = removeLayerFilter; exports.renderLayerEffects = _chunkWT6ZAWJPcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.requireLayer = requireLayer; exports.requireUnlocked = requireUnlocked; exports.resizePixels = resizePixels; exports.resizeSelection = resizeSelection; exports.resizeWarpMesh = _chunkDWGZUSEScjs.resizeWarpMesh; exports.resolveExternalAssets = resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.rgbToGray = rgbToGray; exports.rgbToHsl = rgbToHsl; exports.rgbToReflectance = _chunkCRMAXIUVcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = sampleLut; exports.sampleToneLut = sampleToneLut; exports.scaleLayerEffect = _chunkWT6ZAWJPcjs.scaleLayerEffect; exports.selectionArea = selectionArea; exports.selectionFromCoverage = selectionFromCoverage; exports.selectionFromPixels = selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = selectionToCoverage; exports.selectionToPixels = selectionToPixels; exports.selectionValueAt = selectionValueAt; exports.serializeEffects = serializeEffects; exports.serializeLayer = serializeLayer; exports.serializeLayers = serializeLayers; exports.serializeLayersExternal = serializeLayersExternal; exports.serializePatterns = serializePatterns; exports.serializeSelection = serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = setLayerEffects; exports.setLayerEffectsEnabled = setLayerEffectsEnabled; exports.setLayerMask = setLayerMask; exports.setLayerProperties = setLayerProperties; exports.setLum = _chunkCRMAXIUVcjs.setLum; exports.setPigmentColor = _chunkCRMAXIUVcjs.setPigmentColor; exports.shiftCoverage = shiftCoverage; exports.smoothCoverage = smoothCoverage; exports.smoothPoints = _chunkZZOTHJ4Kcjs.smoothPoints; exports.solidSurface = _chunkCRMAXIUVcjs.solidSurface; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = srgbToLinear; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCRMAXIUVcjs.surfaceBytes; exports.surfaceFromPixels = _chunkCRMAXIUVcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCRMAXIUVcjs.surfacesEqual; exports.tempTintToXy = tempTintToXy; exports.temperatureToKelvin = temperatureToKelvin; exports.tileCoord = _chunkCRMAXIUVcjs.tileCoord; exports.tileKey = _chunkCRMAXIUVcjs.tileKey; exports.tileRect = _chunkCRMAXIUVcjs.tileRect; exports.tilesInRect = _chunkCRMAXIUVcjs.tilesInRect; exports.tipFalloff = _chunkZZOTHJ4Kcjs.tipFalloff; exports.tipReach = _chunkZZOTHJ4Kcjs.tipReach; exports.tipShape = _chunkZZOTHJ4Kcjs.tipShape; exports.toHex = toHex2; exports.toneCurve = toneCurve; exports.toneLuts = toneLuts; exports.toneRange = toneRange; exports.transformHomography = transformHomography; exports.transformMap = transformMap; exports.transformSurface = _chunkWT6ZAWJPcjs.transformSurface; exports.transformedBounds = _chunkWT6ZAWJPcjs.transformedBounds; exports.transformedBox = transformedBox; exports.transformedPoint = transformedPoint; exports.translateSurface = _chunkCRMAXIUVcjs.translateSurface; exports.ungroupLayer = ungroupLayer; exports.uniformTile = _chunkCRMAXIUVcjs.uniformTile; exports.unionRect = unionRect; exports.unprojectCanvasPoint = unprojectCanvasPoint; exports.updateLayerEffect = updateLayerEffect; exports.updateLayerFilter = updateLayerFilter; exports.updateLayerMaskProps = updateLayerMaskProps; exports.uvToXy = uvToXy; exports.validateEffectGradient = _chunkWT6ZAWJPcjs.validateEffectGradient; exports.validateLayerEffect = _chunkWT6ZAWJPcjs.validateLayerEffect; exports.validateLayerEffects = _chunkWT6ZAWJPcjs.validateLayerEffects; exports.versionedDescriptorBytes = versionedDescriptorBytes; exports.vibranceLinear = vibranceLinear; exports.vibrancePixel = vibrancePixel; exports.walkDabs = _chunkZZOTHJ4Kcjs.walkDabs; exports.warpMeshEditPoints = _chunkDWGZUSEScjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkDWGZUSEScjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkDWGZUSEScjs.warpMeshParamAt; exports.warpPresetMesh = _chunkDWGZUSEScjs.warpPresetMesh; exports.warpSurface = _chunkWT6ZAWJPcjs.warpSurface; exports.wbMatrix = wbMatrix; exports.whiteBalanceFromSample = whiteBalanceFromSample; exports.whiteBalanceMatrix = whiteBalanceMatrix; exports.withNewIds = withNewIds; exports.writeAdjustmentBlock = writeAdjustmentBlock; exports.writeLfx2 = writeLfx2; exports.writePatternBlock = writePatternBlock; exports.writePsd = writePsd; exports.writeRegion = _chunkCRMAXIUVcjs.writeRegion; exports.xyToTempTint = xyToTempTint; exports.xyToUv = xyToUv;
|
|
15585
16225
|
//# sourceMappingURL=index.cjs.map
|