@pixerate/editor 0.109.0 → 0.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blending-DXl06NSx.d.ts +486 -0
- package/dist/blending-aOE6Y3UE.d.cts +486 -0
- package/dist/chunk-7VOHOPLW.cjs +1136 -0
- package/dist/chunk-7VOHOPLW.cjs.map +1 -0
- package/dist/{chunk-RE77QYUF.js → chunk-DMRSJBJF.js} +3 -3
- package/dist/chunk-FTBZPI77.cjs +1 -0
- package/dist/chunk-FTBZPI77.cjs.map +1 -0
- package/dist/{chunk-WMBIJCHA.js → chunk-HNS7UHCM.js} +5 -1
- package/dist/{chunk-WMBIJCHA.js.map → chunk-HNS7UHCM.js.map} +1 -1
- package/dist/{chunk-CFMWALBM.js → chunk-LQEEDHOP.js} +2 -2
- package/dist/{chunk-D37BX2ZA.cjs → chunk-MGL4U5WA.cjs} +199 -199
- package/dist/{chunk-D37BX2ZA.cjs.map → chunk-MGL4U5WA.cjs.map} +1 -1
- package/dist/{chunk-AZTZRLDI.cjs → chunk-POGBUYWE.cjs} +92 -92
- package/dist/{chunk-AZTZRLDI.cjs.map → chunk-POGBUYWE.cjs.map} +1 -1
- package/dist/chunk-VKK5VS2T.js +1 -0
- package/dist/{chunk-SZ6KMZNM.cjs → chunk-XIOMMGPD.cjs} +6 -2
- package/dist/chunk-XIOMMGPD.cjs.map +1 -0
- package/dist/{chunk-3PHA3UKI.js → chunk-Z4BC6M74.js} +523 -121
- package/dist/chunk-Z4BC6M74.js.map +1 -0
- package/dist/{export-BLPLaE6Z.d.ts → export-CO2ryu3I.d.ts} +3 -3
- package/dist/{export-DSUc4fQD.d.cts → export-DRiLzP_j.d.cts} +3 -3
- package/dist/image-editor/index.cjs +722 -696
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +9 -9
- package/dist/image-editor/index.d.ts +9 -9
- package/dist/image-editor/index.js +31 -5
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint/index.cjs +28 -4
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +3 -89
- package/dist/paint/index.d.ts +3 -89
- package/dist/paint/index.js +27 -3
- package/dist/paint-editor/index.cjs +1052 -286
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +301 -22
- package/dist/paint-editor/index.d.ts +301 -22
- package/dist/paint-editor/index.js +848 -82
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/raster/index.cjs +5 -3
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.d.cts +2 -2
- package/dist/raster/index.d.ts +2 -2
- package/dist/raster/index.js +4 -2
- package/dist/{render-C-fO_mes.d.cts → render-BEriFuqK.d.cts} +1 -1
- package/dist/{render-OLIMk_v0.d.ts → render-tjzKaik-.d.ts} +1 -1
- package/dist/{surface-CkKOHGPm.d.cts → surface-C8RRg_Bh.d.cts} +109 -1
- package/dist/{surface-CkKOHGPm.d.ts → surface-C8RRg_Bh.d.ts} +109 -1
- package/package.json +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +49 -13
- package/dist/chunk-3PHA3UKI.js.map +0 -1
- package/dist/chunk-6BU5WU4R.cjs +0 -1
- package/dist/chunk-6BU5WU4R.cjs.map +0 -1
- package/dist/chunk-HUFQD4CB.cjs +0 -734
- package/dist/chunk-HUFQD4CB.cjs.map +0 -1
- package/dist/chunk-SZ6KMZNM.cjs.map +0 -1
- package/dist/chunk-XYBJKUAU.js +0 -1
- package/dist/mixer-5ziHU8OS.d.cts +0 -282
- package/dist/mixer-DNqiYXYQ.d.ts +0 -282
- /package/dist/{chunk-RE77QYUF.js.map → chunk-DMRSJBJF.js.map} +0 -0
- /package/dist/{chunk-CFMWALBM.js.map → chunk-LQEEDHOP.js.map} +0 -0
- /package/dist/{chunk-XYBJKUAU.js.map → chunk-VKK5VS2T.js.map} +0 -0
|
@@ -26,7 +26,7 @@ var _chunkMUUXNRU4cjs = require('./chunk-MUUXNRU4.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkXIOMMGPDcjs = require('./chunk-XIOMMGPD.cjs');
|
|
30
30
|
|
|
31
31
|
// src/raster/blur.ts
|
|
32
32
|
function gaussianKernel(sigma) {
|
|
@@ -387,7 +387,7 @@ function oneOf(r, key, path, values) {
|
|
|
387
387
|
if (typeof r[key] !== "string" || !values.includes(r[key])) fail(`${path}.${key}`, `must be one of ${values.join(", ")}.`);
|
|
388
388
|
}
|
|
389
389
|
function blend(r, key, path) {
|
|
390
|
-
if (!
|
|
390
|
+
if (!_chunkXIOMMGPDcjs.isBlendMode.call(void 0, r[key])) fail(`${path}.${key}`, `must be a blend mode such as normal, multiply or screen (got ${JSON.stringify(r[key])}).`);
|
|
391
391
|
if (r[key] === "pigment") fail(`${path}.${key}`, "pigment is a layer blend mode only; effects cannot use it.");
|
|
392
392
|
}
|
|
393
393
|
function contour(v, path) {
|
|
@@ -1586,7 +1586,7 @@ function compositeAt(dst, i, mode, separable, sr, sg, sb, sa) {
|
|
|
1586
1586
|
rgbScratchS[0] = sr;
|
|
1587
1587
|
rgbScratchS[1] = sg;
|
|
1588
1588
|
rgbScratchS[2] = sb;
|
|
1589
|
-
|
|
1589
|
+
_chunkXIOMMGPDcjs.mixPigmentRgb.call(void 0, rgbScratchB, rgbScratchS, sa / ao, rgbScratchM);
|
|
1590
1590
|
dst[i] = rgbScratchM[0];
|
|
1591
1591
|
dst[i + 1] = rgbScratchM[1];
|
|
1592
1592
|
dst[i + 2] = rgbScratchM[2];
|
|
@@ -1601,9 +1601,9 @@ function compositeAt(dst, i, mode, separable, sr, sg, sb, sa) {
|
|
|
1601
1601
|
m1 = sg;
|
|
1602
1602
|
m2 = sb;
|
|
1603
1603
|
} else if (separable) {
|
|
1604
|
-
m0 =
|
|
1605
|
-
m1 =
|
|
1606
|
-
m2 =
|
|
1604
|
+
m0 = _chunkXIOMMGPDcjs.blendChannel.call(void 0, mode, b0, sr);
|
|
1605
|
+
m1 = _chunkXIOMMGPDcjs.blendChannel.call(void 0, mode, b1, sg);
|
|
1606
|
+
m2 = _chunkXIOMMGPDcjs.blendChannel.call(void 0, mode, b2, sb);
|
|
1607
1607
|
} else {
|
|
1608
1608
|
rgbScratchB[0] = b0;
|
|
1609
1609
|
rgbScratchB[1] = b1;
|
|
@@ -1611,7 +1611,7 @@ function compositeAt(dst, i, mode, separable, sr, sg, sb, sa) {
|
|
|
1611
1611
|
rgbScratchS[0] = sr;
|
|
1612
1612
|
rgbScratchS[1] = sg;
|
|
1613
1613
|
rgbScratchS[2] = sb;
|
|
1614
|
-
const m =
|
|
1614
|
+
const m = _chunkXIOMMGPDcjs.blendRgb.call(void 0, mode, rgbScratchB, rgbScratchS);
|
|
1615
1615
|
m0 = m[0];
|
|
1616
1616
|
m1 = m[1];
|
|
1617
1617
|
m2 = m[2];
|
|
@@ -1625,7 +1625,7 @@ function compositeAt(dst, i, mode, separable, sr, sg, sb, sa) {
|
|
|
1625
1625
|
dst[i + 3] = ao;
|
|
1626
1626
|
}
|
|
1627
1627
|
function paint(dst, m, color2, mode, opacity) {
|
|
1628
|
-
const sep = mode !== "normal" &&
|
|
1628
|
+
const sep = mode !== "normal" && _chunkXIOMMGPDcjs.isSeparableBlendMode.call(void 0, mode);
|
|
1629
1629
|
const c = [0, 0, 0, 1];
|
|
1630
1630
|
const n = m.length;
|
|
1631
1631
|
for (let i = 0; i < n; i++) {
|
|
@@ -1914,7 +1914,7 @@ function compositeLayerEffects(input) {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
const premerge = !normalLike;
|
|
1916
1916
|
if (premerge) {
|
|
1917
|
-
const sep2 =
|
|
1917
|
+
const sep2 = _chunkXIOMMGPDcjs.isSeparableBlendMode.call(void 0, input.blend);
|
|
1918
1918
|
for (let i = 0; i < n; i++) {
|
|
1919
1919
|
const p = i * 4;
|
|
1920
1920
|
const sr = lay[p];
|
|
@@ -2034,7 +2034,7 @@ function compositeLayerEffects(input) {
|
|
|
2034
2034
|
paintColor(work, fx(i, 1), e.shadowColor, e.shadowBlend, e.shadowOpacity);
|
|
2035
2035
|
}
|
|
2036
2036
|
const mode = premerge ? "normal" : input.blend;
|
|
2037
|
-
const sep =
|
|
2037
|
+
const sep = _chunkXIOMMGPDcjs.isSeparableBlendMode.call(void 0, mode);
|
|
2038
2038
|
for (let i = 0; i < n; i++) {
|
|
2039
2039
|
const p = i * 4;
|
|
2040
2040
|
if (lay[p + 3] > 0) compositeAt(work, p, mode, sep, lay[p], lay[p + 1], lay[p + 2], lay[p + 3]);
|
|
@@ -2079,7 +2079,7 @@ function renderLayerEffects(effects, layer, backdrop, canvas, ctx) {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
|
|
2081
2081
|
// src/raster/compositor.ts
|
|
2082
|
-
var TILE_PIXELS =
|
|
2082
|
+
var TILE_PIXELS = _chunkXIOMMGPDcjs.TILE * _chunkXIOMMGPDcjs.TILE;
|
|
2083
2083
|
var TILE_BYTES = TILE_PIXELS * 4;
|
|
2084
2084
|
function sameSig(a, b) {
|
|
2085
2085
|
if (!a || a.key !== b.key || a.refs.length !== b.refs.length) return false;
|
|
@@ -2091,13 +2091,13 @@ function dirtyInTile(rects, tx, ty) {
|
|
|
2091
2091
|
let y0 = Infinity;
|
|
2092
2092
|
let x1 = -Infinity;
|
|
2093
2093
|
let y1 = -Infinity;
|
|
2094
|
-
const ox = tx *
|
|
2095
|
-
const oy = ty *
|
|
2094
|
+
const ox = tx * _chunkXIOMMGPDcjs.TILE;
|
|
2095
|
+
const oy = ty * _chunkXIOMMGPDcjs.TILE;
|
|
2096
2096
|
for (const r of rects) {
|
|
2097
2097
|
const a = Math.max(ox, Math.floor(r.x));
|
|
2098
2098
|
const b = Math.max(oy, Math.floor(r.y));
|
|
2099
|
-
const c = Math.min(ox +
|
|
2100
|
-
const d = Math.min(oy +
|
|
2099
|
+
const c = Math.min(ox + _chunkXIOMMGPDcjs.TILE, Math.ceil(r.x + r.width));
|
|
2100
|
+
const d = Math.min(oy + _chunkXIOMMGPDcjs.TILE, Math.ceil(r.y + r.height));
|
|
2101
2101
|
if (c <= a || d <= b) continue;
|
|
2102
2102
|
x0 = Math.min(x0, a);
|
|
2103
2103
|
y0 = Math.min(y0, b);
|
|
@@ -2110,7 +2110,7 @@ function blendTile(dst, src, mode, alpha, coverage) {
|
|
|
2110
2110
|
if (!(alpha > 0)) return;
|
|
2111
2111
|
const normal = mode === "normal";
|
|
2112
2112
|
const pigment = mode === "pigment";
|
|
2113
|
-
const lut = !normal &&
|
|
2113
|
+
const lut = !normal && _chunkXIOMMGPDcjs.isSeparableBlendMode.call(void 0, mode) ? separableLut(mode) : null;
|
|
2114
2114
|
const cb = [0, 0, 0];
|
|
2115
2115
|
const cs = [0, 0, 0];
|
|
2116
2116
|
const n = dst.length;
|
|
@@ -2137,7 +2137,7 @@ function blendTile(dst, src, mode, alpha, coverage) {
|
|
|
2137
2137
|
const d1 = dst[i + 1];
|
|
2138
2138
|
const d2 = dst[i + 2];
|
|
2139
2139
|
if (pigment) {
|
|
2140
|
-
|
|
2140
|
+
_chunkXIOMMGPDcjs.mixPigment8.call(void 0, d0, d1, d2, src[i], src[i + 1], src[i + 2], as / ao, cb);
|
|
2141
2141
|
dst[i] = Math.round(cb[0] * 255);
|
|
2142
2142
|
dst[i + 1] = Math.round(cb[1] * 255);
|
|
2143
2143
|
dst[i + 2] = Math.round(cb[2] * 255);
|
|
@@ -2168,7 +2168,7 @@ function blendTile(dst, src, mode, alpha, coverage) {
|
|
|
2168
2168
|
cs[0] = s0;
|
|
2169
2169
|
cs[1] = s1;
|
|
2170
2170
|
cs[2] = s2;
|
|
2171
|
-
const m =
|
|
2171
|
+
const m = _chunkXIOMMGPDcjs.blendRgb.call(void 0, mode, cb, cs);
|
|
2172
2172
|
m0 = m[0];
|
|
2173
2173
|
m1 = m[1];
|
|
2174
2174
|
m2 = m[2];
|
|
@@ -2187,7 +2187,7 @@ function separableLut(mode) {
|
|
|
2187
2187
|
let lut = separableLuts.get(mode);
|
|
2188
2188
|
if (!lut) {
|
|
2189
2189
|
lut = new Float64Array(65536);
|
|
2190
|
-
for (let b = 0; b < 256; b++) for (let c = 0; c < 256; c++) lut[b << 8 | c] =
|
|
2190
|
+
for (let b = 0; b < 256; b++) for (let c = 0; c < 256; c++) lut[b << 8 | c] = _chunkXIOMMGPDcjs.blendChannel.call(void 0, mode, b / 255, c / 255);
|
|
2191
2191
|
separableLuts.set(mode, lut);
|
|
2192
2192
|
}
|
|
2193
2193
|
return lut;
|
|
@@ -2261,15 +2261,15 @@ var RasterCompositor = (_class = class {
|
|
|
2261
2261
|
composite(layers, rect, sources, options = {}) {
|
|
2262
2262
|
const out = new Uint8ClampedArray(Math.max(0, rect.width * rect.height * 4));
|
|
2263
2263
|
this.compositeTiles(layers, rect, sources, (tx, ty, data) => {
|
|
2264
|
-
const ox = tx *
|
|
2265
|
-
const oy = ty *
|
|
2264
|
+
const ox = tx * _chunkXIOMMGPDcjs.TILE;
|
|
2265
|
+
const oy = ty * _chunkXIOMMGPDcjs.TILE;
|
|
2266
2266
|
const x0 = Math.max(rect.x, ox);
|
|
2267
2267
|
const y0 = Math.max(rect.y, oy);
|
|
2268
|
-
const x1 = Math.min(rect.x + rect.width, ox +
|
|
2269
|
-
const y1 = Math.min(rect.y + rect.height, oy +
|
|
2268
|
+
const x1 = Math.min(rect.x + rect.width, ox + _chunkXIOMMGPDcjs.TILE);
|
|
2269
|
+
const y1 = Math.min(rect.y + rect.height, oy + _chunkXIOMMGPDcjs.TILE);
|
|
2270
2270
|
const span = (x1 - x0) * 4;
|
|
2271
2271
|
for (let y = y0; y < y1; y++) {
|
|
2272
|
-
const s = ((y - oy) *
|
|
2272
|
+
const s = ((y - oy) * _chunkXIOMMGPDcjs.TILE + (x0 - ox)) * 4;
|
|
2273
2273
|
out.set(data.subarray(s, s + span), ((y - rect.y) * rect.width + (x0 - rect.x)) * 4);
|
|
2274
2274
|
}
|
|
2275
2275
|
}, options);
|
|
@@ -2290,9 +2290,9 @@ var RasterCompositor = (_class = class {
|
|
|
2290
2290
|
this.callStats = stats;
|
|
2291
2291
|
const grow = options.dirty ? this.effectsReach(layers) : 0;
|
|
2292
2292
|
const dirty = grow > 0 ? options.dirty.map((d) => inflateRect(d, grow)) : options.dirty;
|
|
2293
|
-
for (const { tx, ty } of
|
|
2293
|
+
for (const { tx, ty } of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, rect)) {
|
|
2294
2294
|
stats.tiles++;
|
|
2295
|
-
const before = _optionalChain([this, 'access', _6 => _6.tiles, 'access', _7 => _7.get, 'call', _8 => _8(
|
|
2295
|
+
const before = _optionalChain([this, 'access', _6 => _6.tiles, 'access', _7 => _7.get, 'call', _8 => _8(_chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _9 => _9.result]);
|
|
2296
2296
|
const data = this.compositeTile(layers, steps, tx, ty, stats, dirty ? dirtyInTile(dirty, tx, ty) : null);
|
|
2297
2297
|
onTile(tx, ty, data, data !== before);
|
|
2298
2298
|
}
|
|
@@ -2374,7 +2374,7 @@ var RasterCompositor = (_class = class {
|
|
|
2374
2374
|
return key;
|
|
2375
2375
|
}
|
|
2376
2376
|
compositeTile(root, steps, tx, ty, stats, dirty = null) {
|
|
2377
|
-
const key =
|
|
2377
|
+
const key = _chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty);
|
|
2378
2378
|
const entry = this.tiles.get(key);
|
|
2379
2379
|
const sigs = steps.map((s) => this.stepSig(s, tx, ty));
|
|
2380
2380
|
let first = 0;
|
|
@@ -2397,20 +2397,20 @@ var RasterCompositor = (_class = class {
|
|
|
2397
2397
|
}
|
|
2398
2398
|
}
|
|
2399
2399
|
}
|
|
2400
|
-
const tileRect = { x: tx *
|
|
2400
|
+
const tileRect = { x: tx * _chunkXIOMMGPDcjs.TILE, y: ty * _chunkXIOMMGPDcjs.TILE, width: _chunkXIOMMGPDcjs.TILE, height: _chunkXIOMMGPDcjs.TILE };
|
|
2401
2401
|
const hint = this.hint;
|
|
2402
2402
|
const checkpoints = /* @__PURE__ */ new Map();
|
|
2403
2403
|
if (entry) {
|
|
2404
2404
|
for (const [index, cp] of entry.checkpoints) if (index <= start) checkpoints.set(index, cp);
|
|
2405
2405
|
}
|
|
2406
2406
|
let result;
|
|
2407
|
-
if (entry && dirty && (dirty.width <
|
|
2407
|
+
if (entry && dirty && (dirty.width < _chunkXIOMMGPDcjs.TILE || dirty.height < _chunkXIOMMGPDcjs.TILE)) {
|
|
2408
2408
|
const r = dirty;
|
|
2409
2409
|
const sub = (data) => {
|
|
2410
2410
|
const out = new Uint8ClampedArray(r.width * r.height * 4);
|
|
2411
2411
|
if (!data) return out;
|
|
2412
2412
|
for (let y = 0; y < r.height; y++) {
|
|
2413
|
-
const s = ((r.y - tileRect.y + y) *
|
|
2413
|
+
const s = ((r.y - tileRect.y + y) * _chunkXIOMMGPDcjs.TILE + (r.x - tileRect.x)) * 4;
|
|
2414
2414
|
out.set(data.subarray(s, s + r.width * 4), y * r.width * 4);
|
|
2415
2415
|
}
|
|
2416
2416
|
return out;
|
|
@@ -2423,7 +2423,7 @@ var RasterCompositor = (_class = class {
|
|
|
2423
2423
|
}
|
|
2424
2424
|
result = new Uint8ClampedArray(entry.result);
|
|
2425
2425
|
for (let y = 0; y < r.height; y++) {
|
|
2426
|
-
result.set(acc.subarray(y * r.width * 4, (y + 1) * r.width * 4), ((r.y - tileRect.y + y) *
|
|
2426
|
+
result.set(acc.subarray(y * r.width * 4, (y + 1) * r.width * 4), ((r.y - tileRect.y + y) * _chunkXIOMMGPDcjs.TILE + (r.x - tileRect.x)) * 4);
|
|
2427
2427
|
}
|
|
2428
2428
|
} else {
|
|
2429
2429
|
const acc = base ? new Uint8ClampedArray(base.data) : new Uint8ClampedArray(TILE_BYTES);
|
|
@@ -2532,8 +2532,8 @@ var RasterCompositor = (_class = class {
|
|
|
2532
2532
|
if (!this.isPixel(layer)) return { key, refs: this.maskRefs(layer, tx, ty, 0, 0) };
|
|
2533
2533
|
const { surface, dx, dy } = this.layerPixels(layer);
|
|
2534
2534
|
const refs = [surface.defaultValue];
|
|
2535
|
-
const r = { x: tx *
|
|
2536
|
-
for (const t of
|
|
2535
|
+
const r = { x: tx * _chunkXIOMMGPDcjs.TILE - dx, y: ty * _chunkXIOMMGPDcjs.TILE - dy, width: _chunkXIOMMGPDcjs.TILE, height: _chunkXIOMMGPDcjs.TILE };
|
|
2536
|
+
for (const t of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, r)) refs.push(_nullishCoalesce(surface.getTile(t.tx, t.ty), () => ( null)));
|
|
2537
2537
|
refs.push(...this.maskRefs(layer, tx, ty, _nullishCoalesce(_optionalChain([layer, 'access', _23 => _23.offset, 'optionalAccess', _24 => _24.x]), () => ( 0)), _nullishCoalesce(_optionalChain([layer, 'access', _25 => _25.offset, 'optionalAccess', _26 => _26.y]), () => ( 0))));
|
|
2538
2538
|
return { key, refs };
|
|
2539
2539
|
}
|
|
@@ -2595,8 +2595,8 @@ var RasterCompositor = (_class = class {
|
|
|
2595
2595
|
const sigs = /* @__PURE__ */ new Map();
|
|
2596
2596
|
if (region.width <= 0 || region.height <= 0) return sigs;
|
|
2597
2597
|
const steps = isGroup(layer) ? this.buildSteps(_nullishCoalesce(layer.children, () => ( []))) : null;
|
|
2598
|
-
for (const t of
|
|
2599
|
-
sigs.set(
|
|
2598
|
+
for (const t of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, region)) {
|
|
2599
|
+
sigs.set(_chunkXIOMMGPDcjs.tileKey.call(void 0, t.tx, t.ty), steps ? this.plainGroupSig(layer, steps, t.tx, t.ty) : this.plainContentSig(layer, t.tx, t.ty));
|
|
2600
2600
|
}
|
|
2601
2601
|
return sigs;
|
|
2602
2602
|
}
|
|
@@ -2620,7 +2620,7 @@ var RasterCompositor = (_class = class {
|
|
|
2620
2620
|
const region = this.effectRegion(layer);
|
|
2621
2621
|
const m = effectsMargin(layer.effects);
|
|
2622
2622
|
if (effectsAreLocal(activeEffectItems(layer.effects))) {
|
|
2623
|
-
return { key, refs: this.shapeRefs(layer, intersectRect({ x: tx *
|
|
2623
|
+
return { key, refs: this.shapeRefs(layer, intersectRect({ x: tx * _chunkXIOMMGPDcjs.TILE - m, y: ty * _chunkXIOMMGPDcjs.TILE - m, width: _chunkXIOMMGPDcjs.TILE + 2 * m, height: _chunkXIOMMGPDcjs.TILE + 2 * m }, region)) };
|
|
2624
2624
|
}
|
|
2625
2625
|
return { key, refs: [`${region.x},${region.y},${region.width},${region.height}`, ...this.shapeRefs(layer, region)] };
|
|
2626
2626
|
}
|
|
@@ -2669,11 +2669,11 @@ var RasterCompositor = (_class = class {
|
|
|
2669
2669
|
*/
|
|
2670
2670
|
shapeChanges(layer, prev, tiles, region) {
|
|
2671
2671
|
const out = [];
|
|
2672
|
-
for (const { tx, ty } of
|
|
2673
|
-
const sig = tiles.get(
|
|
2674
|
-
const old = prev.tiles.get(
|
|
2672
|
+
for (const { tx, ty } of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, region)) {
|
|
2673
|
+
const sig = tiles.get(_chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty));
|
|
2674
|
+
const old = prev.tiles.get(_chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty));
|
|
2675
2675
|
if (old ? sameSig(old, sig) : sig.refs.every((r2) => r2 === null || r2 === 0)) continue;
|
|
2676
|
-
const r = intersectRect({ x: tx *
|
|
2676
|
+
const r = intersectRect({ x: tx * _chunkXIOMMGPDcjs.TILE, y: ty * _chunkXIOMMGPDcjs.TILE, width: _chunkXIOMMGPDcjs.TILE, height: _chunkXIOMMGPDcjs.TILE }, region);
|
|
2677
2677
|
if (r.width > 0 && r.height > 0) out.push(r);
|
|
2678
2678
|
}
|
|
2679
2679
|
const dirty = this.callDirty;
|
|
@@ -2768,7 +2768,7 @@ var RasterCompositor = (_class = class {
|
|
|
2768
2768
|
if (!mask || mask.enabled === false) return [];
|
|
2769
2769
|
if (mask.source || (_nullishCoalesce(mask.feather, () => ( 0))) > 0) return [this.planeFor(mask, ox, oy)];
|
|
2770
2770
|
const refs = [];
|
|
2771
|
-
for (const t of
|
|
2771
|
+
for (const t of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, { x: tx * _chunkXIOMMGPDcjs.TILE - ox, y: ty * _chunkXIOMMGPDcjs.TILE - oy, width: _chunkXIOMMGPDcjs.TILE, height: _chunkXIOMMGPDcjs.TILE })) {
|
|
2772
2772
|
refs.push(_nullishCoalesce(mask.surface.getTile(t.tx, t.ty), () => ( null)));
|
|
2773
2773
|
}
|
|
2774
2774
|
return refs;
|
|
@@ -2803,12 +2803,12 @@ var RasterCompositor = (_class = class {
|
|
|
2803
2803
|
if (!this.isPixel(layer)) return _nullishCoalesce(_optionalChain([this, 'access', _40 => _40.profile, 'access', _41 => _41.contentTile, 'optionalCall', _42 => _42(layer, r, this.sources)]), () => ( null));
|
|
2804
2804
|
const { surface, dx, dy, perPixel } = this.layerPixels(layer);
|
|
2805
2805
|
const src = { x: r.x - dx, y: r.y - dy, width: r.width, height: r.height };
|
|
2806
|
-
const covered =
|
|
2806
|
+
const covered = _chunkXIOMMGPDcjs.tilesInRect.call(void 0, src).map((t) => surface.getTile(t.tx, t.ty));
|
|
2807
2807
|
if (surface.defaultValue === 0 && covered.every((t) => !t)) return null;
|
|
2808
|
-
const aligned = r.width ===
|
|
2808
|
+
const aligned = r.width === _chunkXIOMMGPDcjs.TILE && r.height === _chunkXIOMMGPDcjs.TILE && src.x % _chunkXIOMMGPDcjs.TILE === 0 && src.y % _chunkXIOMMGPDcjs.TILE === 0;
|
|
2809
2809
|
if (!perPixel) {
|
|
2810
2810
|
if (aligned && covered[0]) return covered[0].data;
|
|
2811
|
-
return
|
|
2811
|
+
return _chunkXIOMMGPDcjs.readRegion.call(void 0, surface, src);
|
|
2812
2812
|
}
|
|
2813
2813
|
const fkey = `${dx},${dy}:${perPixel.key}`;
|
|
2814
2814
|
const anchor = _nullishCoalesce(covered.find(Boolean), () => ( surface));
|
|
@@ -2818,7 +2818,7 @@ var RasterCompositor = (_class = class {
|
|
|
2818
2818
|
const hit = _optionalChain([byKey, 'optionalAccess', _43 => _43.get, 'call', _44 => _44(refsKey)]);
|
|
2819
2819
|
if (hit) return hit;
|
|
2820
2820
|
}
|
|
2821
|
-
const data =
|
|
2821
|
+
const data = _chunkXIOMMGPDcjs.readRegion.call(void 0, surface, src);
|
|
2822
2822
|
perPixel.apply(data, r.width, r.height);
|
|
2823
2823
|
if (aligned) {
|
|
2824
2824
|
if (!byKey) {
|
|
@@ -2857,7 +2857,7 @@ var RasterCompositor = (_class = class {
|
|
|
2857
2857
|
if (!generated || generated.length !== W * H) v.fill(1);
|
|
2858
2858
|
else v.set(generated);
|
|
2859
2859
|
} else {
|
|
2860
|
-
const bytes =
|
|
2860
|
+
const bytes = _chunkXIOMMGPDcjs.readRegion.call(void 0, mask.surface, { x: -ox, y: -oy, width: W, height: H });
|
|
2861
2861
|
for (let i = 0; i < v.length; i++) v[i] = bytes[i] / 255;
|
|
2862
2862
|
}
|
|
2863
2863
|
const feather = _nullishCoalesce(mask.feather, () => ( 0));
|
|
@@ -2893,7 +2893,7 @@ var RasterCompositor = (_class = class {
|
|
|
2893
2893
|
for (let x = x0; x < x1; x++) out[d + x] = plane.data[s + x];
|
|
2894
2894
|
}
|
|
2895
2895
|
} else {
|
|
2896
|
-
const bytes =
|
|
2896
|
+
const bytes = _chunkXIOMMGPDcjs.readRegion.call(void 0, mask.surface, { x: r.x - ox, y: r.y - oy, width: r.width, height: r.height });
|
|
2897
2897
|
let all = true;
|
|
2898
2898
|
for (let i = 0; i < n; i++) {
|
|
2899
2899
|
out[i] = bytes[i] / 255;
|
|
@@ -3005,10 +3005,10 @@ var RasterCompositor = (_class = class {
|
|
|
3005
3005
|
}
|
|
3006
3006
|
}, _class);
|
|
3007
3007
|
function filterOverCanvas(surface, ox, oy, filters, width, height) {
|
|
3008
|
-
if (width <= 0 || height <= 0) return
|
|
3009
|
-
const data =
|
|
3008
|
+
if (width <= 0 || height <= 0) return _chunkXIOMMGPDcjs.emptySurface.call(void 0, 4);
|
|
3009
|
+
const data = _chunkXIOMMGPDcjs.readRegion.call(void 0, surface, { x: -ox, y: -oy, width, height });
|
|
3010
3010
|
filters.apply(data, width, height);
|
|
3011
|
-
return
|
|
3011
|
+
return _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, 0, 0);
|
|
3012
3012
|
}
|
|
3013
3013
|
function copyRect(data, r, a) {
|
|
3014
3014
|
const out = new Uint8ClampedArray(a.width * a.height * 4);
|
|
@@ -3097,7 +3097,7 @@ function intersect(a, b) {
|
|
|
3097
3097
|
return x1 > x && y1 > y ? { x, y, width: x1 - x, height: y1 - y } : null;
|
|
3098
3098
|
}
|
|
3099
3099
|
function hasTilesIn(src, r) {
|
|
3100
|
-
for (const { tx, ty } of
|
|
3100
|
+
for (const { tx, ty } of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, r)) if (src.getTile(tx, ty)) return true;
|
|
3101
3101
|
return false;
|
|
3102
3102
|
}
|
|
3103
3103
|
function readWindow(src, srcRect, rect) {
|
|
@@ -3106,7 +3106,7 @@ function readWindow(src, srcRect, rect) {
|
|
|
3106
3106
|
const win = { x: rect.x, y: rect.y, w: rect.width, h: rect.height, n, data };
|
|
3107
3107
|
const r = intersect(rect, srcRect);
|
|
3108
3108
|
if (!r) return win;
|
|
3109
|
-
const px =
|
|
3109
|
+
const px = _chunkXIOMMGPDcjs.readRegion.call(void 0, src, r);
|
|
3110
3110
|
for (let y = 0; y < r.height; y++) {
|
|
3111
3111
|
let s = y * r.width * src.channels;
|
|
3112
3112
|
let d = ((r.y - rect.y + y) * rect.width + (r.x - rect.x)) * n;
|
|
@@ -3248,13 +3248,13 @@ function boxReduce(src, srcRect, kx, ky) {
|
|
|
3248
3248
|
const ry1 = Math.ceil((srcRect.y + srcRect.height) / ky);
|
|
3249
3249
|
const rw = rx1 - rx0;
|
|
3250
3250
|
const rect = { x: rx0, y: ry0, width: rw, height: ry1 - ry0 };
|
|
3251
|
-
let out =
|
|
3252
|
-
const rowsPer = Math.max(1, Math.floor(
|
|
3251
|
+
let out = _chunkXIOMMGPDcjs.emptySurface.call(void 0, ch, src.defaultValue);
|
|
3252
|
+
const rowsPer = Math.max(1, Math.floor(_chunkXIOMMGPDcjs.TILE / ky));
|
|
3253
3253
|
const area = kx * ky;
|
|
3254
3254
|
for (let ry = ry0; ry < ry1; ry += rowsPer) {
|
|
3255
3255
|
const rows = Math.min(rowsPer, ry1 - ry);
|
|
3256
3256
|
const strip = { x: rx0 * kx, y: ry * ky, width: rw * kx, height: rows * ky };
|
|
3257
|
-
const px =
|
|
3257
|
+
const px = _chunkXIOMMGPDcjs.readRegion.call(void 0, src, strip);
|
|
3258
3258
|
const red = new Uint8ClampedArray(rw * rows * ch);
|
|
3259
3259
|
for (let j = 0; j < rows; j++) {
|
|
3260
3260
|
for (let i = 0; i < rw; i++) {
|
|
@@ -3290,13 +3290,13 @@ function boxReduce(src, srcRect, kx, ky) {
|
|
|
3290
3290
|
}
|
|
3291
3291
|
}
|
|
3292
3292
|
}
|
|
3293
|
-
out =
|
|
3293
|
+
out = _chunkXIOMMGPDcjs.writeRegion.call(void 0, out, { x: rx0, y: ry, width: rw, height: rows }, red);
|
|
3294
3294
|
}
|
|
3295
3295
|
return { surface: out, rect };
|
|
3296
3296
|
}
|
|
3297
3297
|
function reduceSurface(src, factor) {
|
|
3298
3298
|
const k = Math.max(1, Math.floor(factor));
|
|
3299
|
-
const b =
|
|
3299
|
+
const b = _chunkXIOMMGPDcjs.contentBounds.call(void 0, src);
|
|
3300
3300
|
if (k === 1 || !b) return src;
|
|
3301
3301
|
return boxReduce(src, b, k, k).surface;
|
|
3302
3302
|
}
|
|
@@ -3324,7 +3324,7 @@ function checkBudget(dst, what = "result") {
|
|
|
3324
3324
|
}
|
|
3325
3325
|
}
|
|
3326
3326
|
function assemble(src, tiles) {
|
|
3327
|
-
return new (0,
|
|
3327
|
+
return new (0, _chunkXIOMMGPDcjs.TiledSurface)(src.channels, tiles, src.defaultValue);
|
|
3328
3328
|
}
|
|
3329
3329
|
function transformedBounds(source, h) {
|
|
3330
3330
|
if (!(source.width > 0 && source.height > 0) || !_chunkMUUXNRU4cjs.invertHomography.call(void 0, h)) return null;
|
|
@@ -3336,16 +3336,16 @@ function transformSurface(src, h, options = {}) {
|
|
|
3336
3336
|
const interp = _nullishCoalesce(options.interpolation, () => ( "bicubic"));
|
|
3337
3337
|
const ch = src.channels;
|
|
3338
3338
|
const def = src.defaultValue;
|
|
3339
|
-
const empty =
|
|
3339
|
+
const empty = _chunkXIOMMGPDcjs.emptySurface.call(void 0, ch, def);
|
|
3340
3340
|
const given = options.source;
|
|
3341
3341
|
const step = normalizeStep(options.step);
|
|
3342
3342
|
if (_chunkMUUXNRU4cjs.isIdentityHomography.call(void 0, h, 1e-12) && !given && !options.clip) return src;
|
|
3343
3343
|
const dx = h[2] / h[8];
|
|
3344
3344
|
const dy = h[5] / h[8];
|
|
3345
3345
|
if (!given && !options.clip && _chunkMUUXNRU4cjs.isIdentityHomography.call(void 0, [h[0], h[1], 0, h[3], h[4], 0, h[6], h[7], h[8]], 1e-12) && Math.abs(dx - Math.round(dx)) < 1e-9 && Math.abs(dy - Math.round(dy)) < 1e-9) {
|
|
3346
|
-
return
|
|
3346
|
+
return _chunkXIOMMGPDcjs.translateSurface.call(void 0, src, Math.round(dx), Math.round(dy));
|
|
3347
3347
|
}
|
|
3348
|
-
let srcRect = given ? intersect(given, given) :
|
|
3348
|
+
let srcRect = given ? intersect(given, given) : _chunkXIOMMGPDcjs.contentBounds.call(void 0, src);
|
|
3349
3349
|
if (!srcRect) return empty;
|
|
3350
3350
|
let H = h;
|
|
3351
3351
|
let S = src;
|
|
@@ -3395,8 +3395,8 @@ function transformSurface(src, h, options = {}) {
|
|
|
3395
3395
|
const sy0 = sr.y;
|
|
3396
3396
|
const sx1 = sr.x + sr.width - 1;
|
|
3397
3397
|
const sy1 = sr.y + sr.height - 1;
|
|
3398
|
-
for (const { tx, ty } of
|
|
3399
|
-
const t = intersect({ x: tx *
|
|
3398
|
+
for (const { tx, ty } of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, dst)) {
|
|
3399
|
+
const t = intersect({ x: tx * _chunkXIOMMGPDcjs.TILE, y: ty * _chunkXIOMMGPDcjs.TILE, width: _chunkXIOMMGPDcjs.TILE, height: _chunkXIOMMGPDcjs.TILE }, dst);
|
|
3400
3400
|
if (!t) continue;
|
|
3401
3401
|
const tc = [
|
|
3402
3402
|
{ x: t.x, y: t.y },
|
|
@@ -3442,11 +3442,11 @@ function transformSurface(src, h, options = {}) {
|
|
|
3442
3442
|
const readable = intersect(foot, sr);
|
|
3443
3443
|
if (!readable || !hasTilesIn(S, readable)) continue;
|
|
3444
3444
|
const win = readWindow(S, sr, foot);
|
|
3445
|
-
const out = new Uint8ClampedArray(
|
|
3445
|
+
const out = new Uint8ClampedArray(_chunkXIOMMGPDcjs.TILE * _chunkXIOMMGPDcjs.TILE * ch);
|
|
3446
3446
|
if (def) out.fill(def);
|
|
3447
3447
|
let any = false;
|
|
3448
|
-
const ox = tx *
|
|
3449
|
-
const oy = ty *
|
|
3448
|
+
const ox = tx * _chunkXIOMMGPDcjs.TILE;
|
|
3449
|
+
const oy = ty * _chunkXIOMMGPDcjs.TILE;
|
|
3450
3450
|
let su = widen(su0);
|
|
3451
3451
|
let sv = widen(sv0);
|
|
3452
3452
|
const ystart = t.y - ((t.y - oy) % step + step) % step;
|
|
@@ -3482,7 +3482,7 @@ function transformSurface(src, h, options = {}) {
|
|
|
3482
3482
|
const y0 = Math.max(y, t.y);
|
|
3483
3483
|
const y1 = Math.min(y + step, t.y + t.height);
|
|
3484
3484
|
for (let yy = y0; yy < y1; yy++) {
|
|
3485
|
-
const row = (yy - oy) *
|
|
3485
|
+
const row = (yy - oy) * _chunkXIOMMGPDcjs.TILE - ox;
|
|
3486
3486
|
for (let bi = 0, x = xstart; bi < blocks; bi++, x += step) {
|
|
3487
3487
|
if (!rowSet[bi]) continue;
|
|
3488
3488
|
const x0 = Math.max(x, t.x);
|
|
@@ -3494,8 +3494,8 @@ function transformSurface(src, h, options = {}) {
|
|
|
3494
3494
|
}
|
|
3495
3495
|
}
|
|
3496
3496
|
if (!any) continue;
|
|
3497
|
-
const tile =
|
|
3498
|
-
if (tile) tiles.set(
|
|
3497
|
+
const tile = _chunkXIOMMGPDcjs.finishTile.call(void 0, out, ch, def);
|
|
3498
|
+
if (tile) tiles.set(_chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty), tile);
|
|
3499
3499
|
}
|
|
3500
3500
|
return assemble(src, tiles);
|
|
3501
3501
|
}
|
|
@@ -3506,8 +3506,8 @@ function warpSurface(src, f, options = {}) {
|
|
|
3506
3506
|
const interp = _nullishCoalesce(options.interpolation, () => ( "bicubic"));
|
|
3507
3507
|
const ch = src.channels;
|
|
3508
3508
|
const def = src.defaultValue;
|
|
3509
|
-
const empty =
|
|
3510
|
-
const sr = options.source ? intersect(options.source, options.source) :
|
|
3509
|
+
const empty = _chunkXIOMMGPDcjs.emptySurface.call(void 0, ch, def);
|
|
3510
|
+
const sr = options.source ? intersect(options.source, options.source) : _chunkXIOMMGPDcjs.contentBounds.call(void 0, src);
|
|
3511
3511
|
if (!sr) return empty;
|
|
3512
3512
|
const step = normalizeStep(options.step);
|
|
3513
3513
|
const nx = Math.min(MAX_CELLS, Math.max(1, Math.ceil(sr.width / CELL)));
|
|
@@ -3558,10 +3558,10 @@ function warpSurface(src, f, options = {}) {
|
|
|
3558
3558
|
tris[t++] = a + w1;
|
|
3559
3559
|
}
|
|
3560
3560
|
}
|
|
3561
|
-
const tx0 = Math.floor(dst.x /
|
|
3562
|
-
const ty0 = Math.floor(dst.y /
|
|
3563
|
-
const cols = Math.floor((dst.x + dst.width - 1) /
|
|
3564
|
-
const rows = Math.floor((dst.y + dst.height - 1) /
|
|
3561
|
+
const tx0 = Math.floor(dst.x / _chunkXIOMMGPDcjs.TILE);
|
|
3562
|
+
const ty0 = Math.floor(dst.y / _chunkXIOMMGPDcjs.TILE);
|
|
3563
|
+
const cols = Math.floor((dst.x + dst.width - 1) / _chunkXIOMMGPDcjs.TILE) - tx0 + 1;
|
|
3564
|
+
const rows = Math.floor((dst.y + dst.height - 1) / _chunkXIOMMGPDcjs.TILE) - ty0 + 1;
|
|
3565
3565
|
const bins = Array.from({ length: cols * rows }, () => []);
|
|
3566
3566
|
for (let k = 0; k < triCount; k++) {
|
|
3567
3567
|
const a = tris[3 * k];
|
|
@@ -3571,10 +3571,10 @@ function warpSurface(src, f, options = {}) {
|
|
|
3571
3571
|
const tminy = Math.floor(Math.min(dvy[a], dvy[b], dvy[c]));
|
|
3572
3572
|
const tmaxx = Math.ceil(Math.max(dvx[a], dvx[b], dvx[c]));
|
|
3573
3573
|
const tmaxy = Math.ceil(Math.max(dvy[a], dvy[b], dvy[c]));
|
|
3574
|
-
const cx0 = Math.max(0, Math.floor(Math.max(tminx, dst.x) /
|
|
3575
|
-
const cy0 = Math.max(0, Math.floor(Math.max(tminy, dst.y) /
|
|
3576
|
-
const cx1 = Math.min(cols - 1, Math.floor(Math.min(tmaxx, dst.x + dst.width - 1) /
|
|
3577
|
-
const cy1 = Math.min(rows - 1, Math.floor(Math.min(tmaxy, dst.y + dst.height - 1) /
|
|
3574
|
+
const cx0 = Math.max(0, Math.floor(Math.max(tminx, dst.x) / _chunkXIOMMGPDcjs.TILE) - tx0);
|
|
3575
|
+
const cy0 = Math.max(0, Math.floor(Math.max(tminy, dst.y) / _chunkXIOMMGPDcjs.TILE) - ty0);
|
|
3576
|
+
const cx1 = Math.min(cols - 1, Math.floor(Math.min(tmaxx, dst.x + dst.width - 1) / _chunkXIOMMGPDcjs.TILE) - tx0);
|
|
3577
|
+
const cy1 = Math.min(rows - 1, Math.floor(Math.min(tmaxy, dst.y + dst.height - 1) / _chunkXIOMMGPDcjs.TILE) - ty0);
|
|
3578
3578
|
for (let cy = cy0; cy <= cy1; cy++) for (let cx = cx0; cx <= cx1; cx++) bins[cy * cols + cx].push(k);
|
|
3579
3579
|
}
|
|
3580
3580
|
const tiles = /* @__PURE__ */ new Map();
|
|
@@ -3588,7 +3588,7 @@ function warpSurface(src, f, options = {}) {
|
|
|
3588
3588
|
if (!list.length) continue;
|
|
3589
3589
|
const ttx = tx0 + cx;
|
|
3590
3590
|
const tty = ty0 + cy;
|
|
3591
|
-
const t = intersect({ x: ttx *
|
|
3591
|
+
const t = intersect({ x: ttx * _chunkXIOMMGPDcjs.TILE, y: tty * _chunkXIOMMGPDcjs.TILE, width: _chunkXIOMMGPDcjs.TILE, height: _chunkXIOMMGPDcjs.TILE }, dst);
|
|
3592
3592
|
if (!t) continue;
|
|
3593
3593
|
const tw = t.width;
|
|
3594
3594
|
const th = t.height;
|
|
@@ -3678,11 +3678,11 @@ function warpSurface(src, f, options = {}) {
|
|
|
3678
3678
|
const foot = intersect({ x: Math.floor(fx0) - 3, y: Math.floor(fy0) - 3, width: Math.ceil(fx1) - Math.floor(fx0) + 6, height: Math.ceil(fy1) - Math.floor(fy0) + 6 }, sr);
|
|
3679
3679
|
if (!foot || !hasTilesIn(src, foot)) continue;
|
|
3680
3680
|
const win = readWindow(src, sr, foot);
|
|
3681
|
-
const out = new Uint8ClampedArray(
|
|
3681
|
+
const out = new Uint8ClampedArray(_chunkXIOMMGPDcjs.TILE * _chunkXIOMMGPDcjs.TILE * ch);
|
|
3682
3682
|
if (def) out.fill(def);
|
|
3683
3683
|
let any = false;
|
|
3684
|
-
const ox = ttx *
|
|
3685
|
-
const oy = tty *
|
|
3684
|
+
const ox = ttx * _chunkXIOMMGPDcjs.TILE;
|
|
3685
|
+
const oy = tty * _chunkXIOMMGPDcjs.TILE;
|
|
3686
3686
|
const pointAt = (o, into) => {
|
|
3687
3687
|
const li = owner[o];
|
|
3688
3688
|
const cnx = ssx[li];
|
|
@@ -3713,7 +3713,7 @@ function warpSurface(src, f, options = {}) {
|
|
|
3713
3713
|
pointAt(o, acc);
|
|
3714
3714
|
const x = t.x + o % tw;
|
|
3715
3715
|
const y = t.y + Math.floor(o / tw);
|
|
3716
|
-
if (store(out, ((y - oy) *
|
|
3716
|
+
if (store(out, ((y - oy) * _chunkXIOMMGPDcjs.TILE + (x - ox)) * ch, acc, ch, def)) any = true;
|
|
3717
3717
|
}
|
|
3718
3718
|
} else {
|
|
3719
3719
|
for (let by = 0; by < th; by += step) {
|
|
@@ -3721,19 +3721,19 @@ function warpSurface(src, f, options = {}) {
|
|
|
3721
3721
|
const o = by * tw + bx;
|
|
3722
3722
|
if (Number.isNaN(us[o])) continue;
|
|
3723
3723
|
pointAt(o, acc);
|
|
3724
|
-
const first = ((t.y + by - oy) *
|
|
3724
|
+
const first = ((t.y + by - oy) * _chunkXIOMMGPDcjs.TILE + (t.x + bx - ox)) * ch;
|
|
3725
3725
|
if (!store(out, first, acc, ch, def)) continue;
|
|
3726
3726
|
any = true;
|
|
3727
3727
|
for (let yy = by; yy < Math.min(th, by + step); yy++) {
|
|
3728
|
-
const row = ((t.y + yy - oy) *
|
|
3728
|
+
const row = ((t.y + yy - oy) * _chunkXIOMMGPDcjs.TILE + (t.x - ox)) * ch;
|
|
3729
3729
|
for (let xx = bx; xx < Math.min(tw, bx + step); xx++) for (let c = 0; c < ch; c++) out[row + xx * ch + c] = out[first + c];
|
|
3730
3730
|
}
|
|
3731
3731
|
}
|
|
3732
3732
|
}
|
|
3733
3733
|
}
|
|
3734
3734
|
if (!any) continue;
|
|
3735
|
-
const tile =
|
|
3736
|
-
if (tile) tiles.set(
|
|
3735
|
+
const tile = _chunkXIOMMGPDcjs.finishTile.call(void 0, out, ch, def);
|
|
3736
|
+
if (tile) tiles.set(_chunkXIOMMGPDcjs.tileKey.call(void 0, ttx, tty), tile);
|
|
3737
3737
|
}
|
|
3738
3738
|
}
|
|
3739
3739
|
return assemble(src, tiles);
|
|
@@ -3749,7 +3749,7 @@ function compositeSurfaceOver(base, top) {
|
|
|
3749
3749
|
tiles.set(key, t);
|
|
3750
3750
|
continue;
|
|
3751
3751
|
}
|
|
3752
|
-
const d = new Uint8ClampedArray(
|
|
3752
|
+
const d = new Uint8ClampedArray(_chunkXIOMMGPDcjs.TILE * _chunkXIOMMGPDcjs.TILE * ch);
|
|
3753
3753
|
if (under) d.set(under.data);
|
|
3754
3754
|
else if (base.defaultValue) d.fill(base.defaultValue);
|
|
3755
3755
|
const s = t.data;
|
|
@@ -3775,11 +3775,11 @@ function compositeSurfaceOver(base, top) {
|
|
|
3775
3775
|
if (ta > 0) d[p] = s[i] * ta + d[p] * (1 - ta);
|
|
3776
3776
|
}
|
|
3777
3777
|
}
|
|
3778
|
-
const tile =
|
|
3778
|
+
const tile = _chunkXIOMMGPDcjs.finishTile.call(void 0, d, ch, base.defaultValue);
|
|
3779
3779
|
if (tile) tiles.set(key, tile);
|
|
3780
3780
|
else tiles.delete(key);
|
|
3781
3781
|
}
|
|
3782
|
-
return new (0,
|
|
3782
|
+
return new (0, _chunkXIOMMGPDcjs.TiledSurface)(ch, tiles, base.defaultValue);
|
|
3783
3783
|
}
|
|
3784
3784
|
|
|
3785
3785
|
// src/raster/zlib.ts
|
|
@@ -4690,4 +4690,4 @@ function pngDataUrl(width, height, data, channels = 4) {
|
|
|
4690
4690
|
|
|
4691
4691
|
|
|
4692
4692
|
exports.DIRECT_GAUSSIAN_MAX_SIGMA = DIRECT_GAUSSIAN_MAX_SIGMA; exports.gaussianBlur = gaussianBlur; exports.flattenLayers = flattenLayers; exports.findLayer = findLayer; exports.mapLayer = mapLayer; exports.insertLayer = insertLayer; exports.isLayerLocked = isLayerLocked; exports.DEFAULT_GLOBAL_LIGHT = DEFAULT_GLOBAL_LIGHT; exports.LAYER_EFFECT_KINDS = LAYER_EFFECT_KINDS; exports.layerEffectLabel = layerEffectLabel; exports.isLayerEffectKind = isLayerEffectKind; exports.defaultEffectGradient = defaultEffectGradient; exports.newEffectId = newEffectId; exports.defaultLayerEffect = defaultLayerEffect; exports.hasActiveEffects = hasActiveEffects; exports.MAX_EFFECT_REACH = MAX_EFFECT_REACH; exports.effectReach = effectReach; exports.effectsMargin = effectsMargin; exports.effectsScale = effectsScale; exports.scaleLayerEffect = scaleLayerEffect; exports.parseEffectColor = parseEffectColor; exports.effectColorHex = effectColorHex; exports.LayerEffectError = LayerEffectError; exports.validateEffectGradient = validateEffectGradient; exports.layerEffectFields = layerEffectFields; exports.validateLayerEffect = validateLayerEffect; exports.mergeLayerEffect = mergeLayerEffect; exports.validateLayerEffects = validateLayerEffects; exports.normalizeLayerEffects = normalizeLayerEffects; exports.effectsFingerprint = effectsFingerprint; exports.PatternTile = PatternTile; exports.PatternPlacement = PatternPlacement; exports.builtinPatternIds = builtinPatternIds; exports.builtinPattern = builtinPattern; exports.hashNoise = hashNoise; exports.CURVE_LUT_SIZE = CURVE_LUT_SIZE; exports.curveLut = curveLut; exports.STROKE_CHAMFER_MAX = STROKE_CHAMFER_MAX; exports.contourLut = contourLut; exports.activeEffectItems = activeEffectItems; exports.effectsAreLocal = effectsAreLocal; exports.buildEffectMaps = buildEffectMaps; exports.patchEffectMaps = patchEffectMaps; exports.gradientT = gradientT; exports.effectFillColors = effectFillColors; exports.compositeLayerEffects = compositeLayerEffects; exports.renderLayerEffects = renderLayerEffects; exports.blendTile = blendTile; exports.RasterCompositor = RasterCompositor; exports.changedTiles = changedTiles; exports.INTERPOLATIONS = INTERPOLATIONS; exports.isInterpolation = isInterpolation; exports.MAX_TRANSFORM_PIXELS = MAX_TRANSFORM_PIXELS; exports.TransformTooLargeError = TransformTooLargeError; exports.keysWeight = keysWeight; exports.reduceSurface = reduceSurface; exports.transformedBounds = transformedBounds; exports.transformSurface = transformSurface; exports.warpSurface = warpSurface; exports.compositeSurfaceOver = compositeSurfaceOver; exports.ZlibError = ZlibError; exports.inflateRaw = inflateRaw; exports.adler32 = adler32; exports.inflate = inflate; exports.deflateRaw = deflateRaw; exports.deflate = deflate; exports.encodePng = encodePng; exports.isPng = isPng; exports.decodePng = decodePng; exports.bytesToBase64 = bytesToBase64; exports.base64ToBytes = base64ToBytes; exports.parseDataUrl = parseDataUrl; exports.pngDataUrl = pngDataUrl;
|
|
4693
|
-
//# sourceMappingURL=chunk-
|
|
4693
|
+
//# sourceMappingURL=chunk-POGBUYWE.cjs.map
|