@pixerate/editor 0.105.0 → 0.107.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/{chunk-DS7KDKPX.js → chunk-3PHA3UKI.js} +2 -2
- package/dist/{chunk-ZID226ZG.cjs → chunk-FRD3FUXI.cjs} +172 -172
- package/dist/{chunk-ZID226ZG.cjs.map → chunk-FRD3FUXI.cjs.map} +1 -1
- package/dist/{chunk-67FRIOPZ.js → chunk-G4BIYE6R.js} +2 -2
- package/dist/{chunk-PV42JITT.cjs → chunk-HUFQD4CB.cjs} +44 -44
- package/dist/{chunk-PV42JITT.cjs.map → chunk-HUFQD4CB.cjs.map} +1 -1
- package/dist/{chunk-4X5MIVCE.js → chunk-SOROZ2BF.js} +3 -3
- package/dist/{chunk-CRMAXIUV.cjs → chunk-SZ6KMZNM.cjs} +157 -8
- package/dist/chunk-SZ6KMZNM.cjs.map +1 -0
- package/dist/{chunk-WSTEXEKD.cjs → chunk-T3QZ6S47.cjs} +92 -92
- package/dist/{chunk-WSTEXEKD.cjs.map → chunk-T3QZ6S47.cjs.map} +1 -1
- package/dist/{chunk-HEW6KDNI.js → chunk-WMBIJCHA.js} +155 -6
- package/dist/chunk-WMBIJCHA.js.map +1 -0
- package/dist/{compositor-Bc3PNP3C.d.cts → compositor-D92URMlm.d.cts} +1 -1
- package/dist/{compositor-BsYYllvR.d.ts → compositor-Kt_M4ruo.d.ts} +1 -1
- package/dist/{export-_m3Es4ru.d.cts → export-JGWQEPJn.d.cts} +3 -3
- package/dist/{export-iMrop3Jm.d.ts → export-a9bnF7Cl.d.ts} +3 -3
- package/dist/image-editor/index.cjs +831 -632
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +42 -9
- package/dist/image-editor/index.d.ts +42 -9
- package/dist/image-editor/index.js +203 -4
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{mixer-C1M1Nua_.d.cts → mixer-5ziHU8OS.d.cts} +1 -1
- package/dist/{mixer-Cu5a9Bzd.d.ts → mixer-DNqiYXYQ.d.ts} +1 -1
- package/dist/paint/index.cjs +3 -3
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint/index.js +2 -2
- package/dist/paint-editor/index.cjs +175 -127
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +18 -7
- package/dist/paint-editor/index.d.ts +18 -7
- package/dist/paint-editor/index.js +59 -11
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/raster/index.cjs +11 -3
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.d.cts +4 -4
- package/dist/raster/index.d.ts +4 -4
- package/dist/raster/index.js +10 -2
- package/dist/{surface-BBJN9wxg.d.ts → surface-CkKOHGPm.d.cts} +20 -2
- package/dist/{surface-BBJN9wxg.d.cts → surface-CkKOHGPm.d.ts} +20 -2
- package/package.json +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +21 -1
- package/dist/chunk-CRMAXIUV.cjs.map +0 -1
- package/dist/chunk-HEW6KDNI.js.map +0 -1
- /package/dist/{chunk-DS7KDKPX.js.map → chunk-3PHA3UKI.js.map} +0 -0
- /package/dist/{chunk-67FRIOPZ.js.map → chunk-G4BIYE6R.js.map} +0 -0
- /package/dist/{chunk-4X5MIVCE.js.map → chunk-SOROZ2BF.js.map} +0 -0
|
@@ -26,7 +26,7 @@ var _chunkMUUXNRU4cjs = require('./chunk-MUUXNRU4.cjs');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkSZ6KMZNMcjs = require('./chunk-SZ6KMZNM.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 (!_chunkSZ6KMZNMcjs.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
|
+
_chunkSZ6KMZNMcjs.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 = _chunkSZ6KMZNMcjs.blendChannel.call(void 0, mode, b0, sr);
|
|
1605
|
+
m1 = _chunkSZ6KMZNMcjs.blendChannel.call(void 0, mode, b1, sg);
|
|
1606
|
+
m2 = _chunkSZ6KMZNMcjs.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 = _chunkSZ6KMZNMcjs.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" && _chunkSZ6KMZNMcjs.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++) {
|
|
@@ -1877,7 +1877,7 @@ function compositeLayerEffects(input) {
|
|
|
1877
1877
|
}
|
|
1878
1878
|
const premerge = !normalLike;
|
|
1879
1879
|
if (premerge) {
|
|
1880
|
-
const sep2 =
|
|
1880
|
+
const sep2 = _chunkSZ6KMZNMcjs.isSeparableBlendMode.call(void 0, input.blend);
|
|
1881
1881
|
for (let i = 0; i < n; i++) {
|
|
1882
1882
|
const p = i * 4;
|
|
1883
1883
|
const sr = lay[p];
|
|
@@ -1997,7 +1997,7 @@ function compositeLayerEffects(input) {
|
|
|
1997
1997
|
paintColor(work, fx(i, 1), e.shadowColor, e.shadowBlend, e.shadowOpacity);
|
|
1998
1998
|
}
|
|
1999
1999
|
const mode = premerge ? "normal" : input.blend;
|
|
2000
|
-
const sep =
|
|
2000
|
+
const sep = _chunkSZ6KMZNMcjs.isSeparableBlendMode.call(void 0, mode);
|
|
2001
2001
|
for (let i = 0; i < n; i++) {
|
|
2002
2002
|
const p = i * 4;
|
|
2003
2003
|
if (lay[p + 3] > 0) compositeAt(work, p, mode, sep, lay[p], lay[p + 1], lay[p + 2], lay[p + 3]);
|
|
@@ -2042,7 +2042,7 @@ function renderLayerEffects(effects, layer, backdrop, canvas, ctx) {
|
|
|
2042
2042
|
}
|
|
2043
2043
|
|
|
2044
2044
|
// src/raster/compositor.ts
|
|
2045
|
-
var TILE_PIXELS =
|
|
2045
|
+
var TILE_PIXELS = _chunkSZ6KMZNMcjs.TILE * _chunkSZ6KMZNMcjs.TILE;
|
|
2046
2046
|
var TILE_BYTES = TILE_PIXELS * 4;
|
|
2047
2047
|
function sameSig(a, b) {
|
|
2048
2048
|
if (!a || a.key !== b.key || a.refs.length !== b.refs.length) return false;
|
|
@@ -2054,13 +2054,13 @@ function dirtyInTile(rects, tx, ty) {
|
|
|
2054
2054
|
let y0 = Infinity;
|
|
2055
2055
|
let x1 = -Infinity;
|
|
2056
2056
|
let y1 = -Infinity;
|
|
2057
|
-
const ox = tx *
|
|
2058
|
-
const oy = ty *
|
|
2057
|
+
const ox = tx * _chunkSZ6KMZNMcjs.TILE;
|
|
2058
|
+
const oy = ty * _chunkSZ6KMZNMcjs.TILE;
|
|
2059
2059
|
for (const r of rects) {
|
|
2060
2060
|
const a = Math.max(ox, Math.floor(r.x));
|
|
2061
2061
|
const b = Math.max(oy, Math.floor(r.y));
|
|
2062
|
-
const c = Math.min(ox +
|
|
2063
|
-
const d = Math.min(oy +
|
|
2062
|
+
const c = Math.min(ox + _chunkSZ6KMZNMcjs.TILE, Math.ceil(r.x + r.width));
|
|
2063
|
+
const d = Math.min(oy + _chunkSZ6KMZNMcjs.TILE, Math.ceil(r.y + r.height));
|
|
2064
2064
|
if (c <= a || d <= b) continue;
|
|
2065
2065
|
x0 = Math.min(x0, a);
|
|
2066
2066
|
y0 = Math.min(y0, b);
|
|
@@ -2073,7 +2073,7 @@ function blendTile(dst, src, mode, alpha, coverage) {
|
|
|
2073
2073
|
if (!(alpha > 0)) return;
|
|
2074
2074
|
const normal = mode === "normal";
|
|
2075
2075
|
const pigment = mode === "pigment";
|
|
2076
|
-
const lut = !normal &&
|
|
2076
|
+
const lut = !normal && _chunkSZ6KMZNMcjs.isSeparableBlendMode.call(void 0, mode) ? separableLut(mode) : null;
|
|
2077
2077
|
const cb = [0, 0, 0];
|
|
2078
2078
|
const cs = [0, 0, 0];
|
|
2079
2079
|
const n = dst.length;
|
|
@@ -2100,7 +2100,7 @@ function blendTile(dst, src, mode, alpha, coverage) {
|
|
|
2100
2100
|
const d1 = dst[i + 1];
|
|
2101
2101
|
const d2 = dst[i + 2];
|
|
2102
2102
|
if (pigment) {
|
|
2103
|
-
|
|
2103
|
+
_chunkSZ6KMZNMcjs.mixPigment8.call(void 0, d0, d1, d2, src[i], src[i + 1], src[i + 2], as / ao, cb);
|
|
2104
2104
|
dst[i] = Math.round(cb[0] * 255);
|
|
2105
2105
|
dst[i + 1] = Math.round(cb[1] * 255);
|
|
2106
2106
|
dst[i + 2] = Math.round(cb[2] * 255);
|
|
@@ -2131,7 +2131,7 @@ function blendTile(dst, src, mode, alpha, coverage) {
|
|
|
2131
2131
|
cs[0] = s0;
|
|
2132
2132
|
cs[1] = s1;
|
|
2133
2133
|
cs[2] = s2;
|
|
2134
|
-
const m =
|
|
2134
|
+
const m = _chunkSZ6KMZNMcjs.blendRgb.call(void 0, mode, cb, cs);
|
|
2135
2135
|
m0 = m[0];
|
|
2136
2136
|
m1 = m[1];
|
|
2137
2137
|
m2 = m[2];
|
|
@@ -2150,7 +2150,7 @@ function separableLut(mode) {
|
|
|
2150
2150
|
let lut = separableLuts.get(mode);
|
|
2151
2151
|
if (!lut) {
|
|
2152
2152
|
lut = new Float64Array(65536);
|
|
2153
|
-
for (let b = 0; b < 256; b++) for (let c = 0; c < 256; c++) lut[b << 8 | c] =
|
|
2153
|
+
for (let b = 0; b < 256; b++) for (let c = 0; c < 256; c++) lut[b << 8 | c] = _chunkSZ6KMZNMcjs.blendChannel.call(void 0, mode, b / 255, c / 255);
|
|
2154
2154
|
separableLuts.set(mode, lut);
|
|
2155
2155
|
}
|
|
2156
2156
|
return lut;
|
|
@@ -2224,15 +2224,15 @@ var RasterCompositor = (_class = class {
|
|
|
2224
2224
|
composite(layers, rect, sources, options = {}) {
|
|
2225
2225
|
const out = new Uint8ClampedArray(Math.max(0, rect.width * rect.height * 4));
|
|
2226
2226
|
this.compositeTiles(layers, rect, sources, (tx, ty, data) => {
|
|
2227
|
-
const ox = tx *
|
|
2228
|
-
const oy = ty *
|
|
2227
|
+
const ox = tx * _chunkSZ6KMZNMcjs.TILE;
|
|
2228
|
+
const oy = ty * _chunkSZ6KMZNMcjs.TILE;
|
|
2229
2229
|
const x0 = Math.max(rect.x, ox);
|
|
2230
2230
|
const y0 = Math.max(rect.y, oy);
|
|
2231
|
-
const x1 = Math.min(rect.x + rect.width, ox +
|
|
2232
|
-
const y1 = Math.min(rect.y + rect.height, oy +
|
|
2231
|
+
const x1 = Math.min(rect.x + rect.width, ox + _chunkSZ6KMZNMcjs.TILE);
|
|
2232
|
+
const y1 = Math.min(rect.y + rect.height, oy + _chunkSZ6KMZNMcjs.TILE);
|
|
2233
2233
|
const span = (x1 - x0) * 4;
|
|
2234
2234
|
for (let y = y0; y < y1; y++) {
|
|
2235
|
-
const s = ((y - oy) *
|
|
2235
|
+
const s = ((y - oy) * _chunkSZ6KMZNMcjs.TILE + (x0 - ox)) * 4;
|
|
2236
2236
|
out.set(data.subarray(s, s + span), ((y - rect.y) * rect.width + (x0 - rect.x)) * 4);
|
|
2237
2237
|
}
|
|
2238
2238
|
}, options);
|
|
@@ -2253,9 +2253,9 @@ var RasterCompositor = (_class = class {
|
|
|
2253
2253
|
this.callStats = stats;
|
|
2254
2254
|
const grow = options.dirty ? this.effectsReach(layers) : 0;
|
|
2255
2255
|
const dirty = grow > 0 ? options.dirty.map((d) => inflateRect(d, grow)) : options.dirty;
|
|
2256
|
-
for (const { tx, ty } of
|
|
2256
|
+
for (const { tx, ty } of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, rect)) {
|
|
2257
2257
|
stats.tiles++;
|
|
2258
|
-
const before = _optionalChain([this, 'access', _6 => _6.tiles, 'access', _7 => _7.get, 'call', _8 => _8(
|
|
2258
|
+
const before = _optionalChain([this, 'access', _6 => _6.tiles, 'access', _7 => _7.get, 'call', _8 => _8(_chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _9 => _9.result]);
|
|
2259
2259
|
const data = this.compositeTile(layers, steps, tx, ty, stats, dirty ? dirtyInTile(dirty, tx, ty) : null);
|
|
2260
2260
|
onTile(tx, ty, data, data !== before);
|
|
2261
2261
|
}
|
|
@@ -2337,7 +2337,7 @@ var RasterCompositor = (_class = class {
|
|
|
2337
2337
|
return key;
|
|
2338
2338
|
}
|
|
2339
2339
|
compositeTile(root, steps, tx, ty, stats, dirty = null) {
|
|
2340
|
-
const key =
|
|
2340
|
+
const key = _chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty);
|
|
2341
2341
|
const entry = this.tiles.get(key);
|
|
2342
2342
|
const sigs = steps.map((s) => this.stepSig(s, tx, ty));
|
|
2343
2343
|
let first = 0;
|
|
@@ -2360,20 +2360,20 @@ var RasterCompositor = (_class = class {
|
|
|
2360
2360
|
}
|
|
2361
2361
|
}
|
|
2362
2362
|
}
|
|
2363
|
-
const tileRect = { x: tx *
|
|
2363
|
+
const tileRect = { x: tx * _chunkSZ6KMZNMcjs.TILE, y: ty * _chunkSZ6KMZNMcjs.TILE, width: _chunkSZ6KMZNMcjs.TILE, height: _chunkSZ6KMZNMcjs.TILE };
|
|
2364
2364
|
const hint = this.hint;
|
|
2365
2365
|
const checkpoints = /* @__PURE__ */ new Map();
|
|
2366
2366
|
if (entry) {
|
|
2367
2367
|
for (const [index, cp] of entry.checkpoints) if (index <= start) checkpoints.set(index, cp);
|
|
2368
2368
|
}
|
|
2369
2369
|
let result;
|
|
2370
|
-
if (entry && dirty && (dirty.width <
|
|
2370
|
+
if (entry && dirty && (dirty.width < _chunkSZ6KMZNMcjs.TILE || dirty.height < _chunkSZ6KMZNMcjs.TILE)) {
|
|
2371
2371
|
const r = dirty;
|
|
2372
2372
|
const sub = (data) => {
|
|
2373
2373
|
const out = new Uint8ClampedArray(r.width * r.height * 4);
|
|
2374
2374
|
if (!data) return out;
|
|
2375
2375
|
for (let y = 0; y < r.height; y++) {
|
|
2376
|
-
const s = ((r.y - tileRect.y + y) *
|
|
2376
|
+
const s = ((r.y - tileRect.y + y) * _chunkSZ6KMZNMcjs.TILE + (r.x - tileRect.x)) * 4;
|
|
2377
2377
|
out.set(data.subarray(s, s + r.width * 4), y * r.width * 4);
|
|
2378
2378
|
}
|
|
2379
2379
|
return out;
|
|
@@ -2386,7 +2386,7 @@ var RasterCompositor = (_class = class {
|
|
|
2386
2386
|
}
|
|
2387
2387
|
result = new Uint8ClampedArray(entry.result);
|
|
2388
2388
|
for (let y = 0; y < r.height; y++) {
|
|
2389
|
-
result.set(acc.subarray(y * r.width * 4, (y + 1) * r.width * 4), ((r.y - tileRect.y + y) *
|
|
2389
|
+
result.set(acc.subarray(y * r.width * 4, (y + 1) * r.width * 4), ((r.y - tileRect.y + y) * _chunkSZ6KMZNMcjs.TILE + (r.x - tileRect.x)) * 4);
|
|
2390
2390
|
}
|
|
2391
2391
|
} else {
|
|
2392
2392
|
const acc = base ? new Uint8ClampedArray(base.data) : new Uint8ClampedArray(TILE_BYTES);
|
|
@@ -2495,8 +2495,8 @@ var RasterCompositor = (_class = class {
|
|
|
2495
2495
|
if (!this.isPixel(layer)) return { key, refs: this.maskRefs(layer, tx, ty, 0, 0) };
|
|
2496
2496
|
const { surface, dx, dy } = this.layerPixels(layer);
|
|
2497
2497
|
const refs = [surface.defaultValue];
|
|
2498
|
-
const r = { x: tx *
|
|
2499
|
-
for (const t of
|
|
2498
|
+
const r = { x: tx * _chunkSZ6KMZNMcjs.TILE - dx, y: ty * _chunkSZ6KMZNMcjs.TILE - dy, width: _chunkSZ6KMZNMcjs.TILE, height: _chunkSZ6KMZNMcjs.TILE };
|
|
2499
|
+
for (const t of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, r)) refs.push(_nullishCoalesce(surface.getTile(t.tx, t.ty), () => ( null)));
|
|
2500
2500
|
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))));
|
|
2501
2501
|
return { key, refs };
|
|
2502
2502
|
}
|
|
@@ -2558,8 +2558,8 @@ var RasterCompositor = (_class = class {
|
|
|
2558
2558
|
const sigs = /* @__PURE__ */ new Map();
|
|
2559
2559
|
if (region.width <= 0 || region.height <= 0) return sigs;
|
|
2560
2560
|
const steps = isGroup(layer) ? this.buildSteps(_nullishCoalesce(layer.children, () => ( []))) : null;
|
|
2561
|
-
for (const t of
|
|
2562
|
-
sigs.set(
|
|
2561
|
+
for (const t of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, region)) {
|
|
2562
|
+
sigs.set(_chunkSZ6KMZNMcjs.tileKey.call(void 0, t.tx, t.ty), steps ? this.plainGroupSig(layer, steps, t.tx, t.ty) : this.plainContentSig(layer, t.tx, t.ty));
|
|
2563
2563
|
}
|
|
2564
2564
|
return sigs;
|
|
2565
2565
|
}
|
|
@@ -2583,7 +2583,7 @@ var RasterCompositor = (_class = class {
|
|
|
2583
2583
|
const region = this.effectRegion(layer);
|
|
2584
2584
|
const m = effectsMargin(layer.effects);
|
|
2585
2585
|
if (effectsAreLocal(activeEffectItems(layer.effects))) {
|
|
2586
|
-
return { key, refs: this.shapeRefs(layer, intersectRect({ x: tx *
|
|
2586
|
+
return { key, refs: this.shapeRefs(layer, intersectRect({ x: tx * _chunkSZ6KMZNMcjs.TILE - m, y: ty * _chunkSZ6KMZNMcjs.TILE - m, width: _chunkSZ6KMZNMcjs.TILE + 2 * m, height: _chunkSZ6KMZNMcjs.TILE + 2 * m }, region)) };
|
|
2587
2587
|
}
|
|
2588
2588
|
return { key, refs: [`${region.x},${region.y},${region.width},${region.height}`, ...this.shapeRefs(layer, region)] };
|
|
2589
2589
|
}
|
|
@@ -2632,11 +2632,11 @@ var RasterCompositor = (_class = class {
|
|
|
2632
2632
|
*/
|
|
2633
2633
|
shapeChanges(layer, prev, tiles, region) {
|
|
2634
2634
|
const out = [];
|
|
2635
|
-
for (const { tx, ty } of
|
|
2636
|
-
const sig = tiles.get(
|
|
2637
|
-
const old = prev.tiles.get(
|
|
2635
|
+
for (const { tx, ty } of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, region)) {
|
|
2636
|
+
const sig = tiles.get(_chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty));
|
|
2637
|
+
const old = prev.tiles.get(_chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty));
|
|
2638
2638
|
if (old ? sameSig(old, sig) : sig.refs.every((r2) => r2 === null || r2 === 0)) continue;
|
|
2639
|
-
const r = intersectRect({ x: tx *
|
|
2639
|
+
const r = intersectRect({ x: tx * _chunkSZ6KMZNMcjs.TILE, y: ty * _chunkSZ6KMZNMcjs.TILE, width: _chunkSZ6KMZNMcjs.TILE, height: _chunkSZ6KMZNMcjs.TILE }, region);
|
|
2640
2640
|
if (r.width > 0 && r.height > 0) out.push(r);
|
|
2641
2641
|
}
|
|
2642
2642
|
const dirty = this.callDirty;
|
|
@@ -2731,7 +2731,7 @@ var RasterCompositor = (_class = class {
|
|
|
2731
2731
|
if (!mask || mask.enabled === false) return [];
|
|
2732
2732
|
if (mask.source || (_nullishCoalesce(mask.feather, () => ( 0))) > 0) return [this.planeFor(mask, ox, oy)];
|
|
2733
2733
|
const refs = [];
|
|
2734
|
-
for (const t of
|
|
2734
|
+
for (const t of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, { x: tx * _chunkSZ6KMZNMcjs.TILE - ox, y: ty * _chunkSZ6KMZNMcjs.TILE - oy, width: _chunkSZ6KMZNMcjs.TILE, height: _chunkSZ6KMZNMcjs.TILE })) {
|
|
2735
2735
|
refs.push(_nullishCoalesce(mask.surface.getTile(t.tx, t.ty), () => ( null)));
|
|
2736
2736
|
}
|
|
2737
2737
|
return refs;
|
|
@@ -2766,12 +2766,12 @@ var RasterCompositor = (_class = class {
|
|
|
2766
2766
|
if (!this.isPixel(layer)) return _nullishCoalesce(_optionalChain([this, 'access', _40 => _40.profile, 'access', _41 => _41.contentTile, 'optionalCall', _42 => _42(layer, r, this.sources)]), () => ( null));
|
|
2767
2767
|
const { surface, dx, dy, perPixel } = this.layerPixels(layer);
|
|
2768
2768
|
const src = { x: r.x - dx, y: r.y - dy, width: r.width, height: r.height };
|
|
2769
|
-
const covered =
|
|
2769
|
+
const covered = _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, src).map((t) => surface.getTile(t.tx, t.ty));
|
|
2770
2770
|
if (surface.defaultValue === 0 && covered.every((t) => !t)) return null;
|
|
2771
|
-
const aligned = r.width ===
|
|
2771
|
+
const aligned = r.width === _chunkSZ6KMZNMcjs.TILE && r.height === _chunkSZ6KMZNMcjs.TILE && src.x % _chunkSZ6KMZNMcjs.TILE === 0 && src.y % _chunkSZ6KMZNMcjs.TILE === 0;
|
|
2772
2772
|
if (!perPixel) {
|
|
2773
2773
|
if (aligned && covered[0]) return covered[0].data;
|
|
2774
|
-
return
|
|
2774
|
+
return _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, src);
|
|
2775
2775
|
}
|
|
2776
2776
|
const fkey = `${dx},${dy}:${perPixel.key}`;
|
|
2777
2777
|
const anchor = _nullishCoalesce(covered.find(Boolean), () => ( surface));
|
|
@@ -2781,7 +2781,7 @@ var RasterCompositor = (_class = class {
|
|
|
2781
2781
|
const hit = _optionalChain([byKey, 'optionalAccess', _43 => _43.get, 'call', _44 => _44(refsKey)]);
|
|
2782
2782
|
if (hit) return hit;
|
|
2783
2783
|
}
|
|
2784
|
-
const data =
|
|
2784
|
+
const data = _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, src);
|
|
2785
2785
|
perPixel.apply(data, r.width, r.height);
|
|
2786
2786
|
if (aligned) {
|
|
2787
2787
|
if (!byKey) {
|
|
@@ -2820,7 +2820,7 @@ var RasterCompositor = (_class = class {
|
|
|
2820
2820
|
if (!generated || generated.length !== W * H) v.fill(1);
|
|
2821
2821
|
else v.set(generated);
|
|
2822
2822
|
} else {
|
|
2823
|
-
const bytes =
|
|
2823
|
+
const bytes = _chunkSZ6KMZNMcjs.readRegion.call(void 0, mask.surface, { x: -ox, y: -oy, width: W, height: H });
|
|
2824
2824
|
for (let i = 0; i < v.length; i++) v[i] = bytes[i] / 255;
|
|
2825
2825
|
}
|
|
2826
2826
|
const feather = _nullishCoalesce(mask.feather, () => ( 0));
|
|
@@ -2856,7 +2856,7 @@ var RasterCompositor = (_class = class {
|
|
|
2856
2856
|
for (let x = x0; x < x1; x++) out[d + x] = plane.data[s + x];
|
|
2857
2857
|
}
|
|
2858
2858
|
} else {
|
|
2859
|
-
const bytes =
|
|
2859
|
+
const bytes = _chunkSZ6KMZNMcjs.readRegion.call(void 0, mask.surface, { x: r.x - ox, y: r.y - oy, width: r.width, height: r.height });
|
|
2860
2860
|
let all = true;
|
|
2861
2861
|
for (let i = 0; i < n; i++) {
|
|
2862
2862
|
out[i] = bytes[i] / 255;
|
|
@@ -2968,10 +2968,10 @@ var RasterCompositor = (_class = class {
|
|
|
2968
2968
|
}
|
|
2969
2969
|
}, _class);
|
|
2970
2970
|
function filterOverCanvas(surface, ox, oy, filters, width, height) {
|
|
2971
|
-
if (width <= 0 || height <= 0) return
|
|
2972
|
-
const data =
|
|
2971
|
+
if (width <= 0 || height <= 0) return _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4);
|
|
2972
|
+
const data = _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, { x: -ox, y: -oy, width, height });
|
|
2973
2973
|
filters.apply(data, width, height);
|
|
2974
|
-
return
|
|
2974
|
+
return _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, 0, 0);
|
|
2975
2975
|
}
|
|
2976
2976
|
function copyRect(data, r, a) {
|
|
2977
2977
|
const out = new Uint8ClampedArray(a.width * a.height * 4);
|
|
@@ -3060,7 +3060,7 @@ function intersect(a, b) {
|
|
|
3060
3060
|
return x1 > x && y1 > y ? { x, y, width: x1 - x, height: y1 - y } : null;
|
|
3061
3061
|
}
|
|
3062
3062
|
function hasTilesIn(src, r) {
|
|
3063
|
-
for (const { tx, ty } of
|
|
3063
|
+
for (const { tx, ty } of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, r)) if (src.getTile(tx, ty)) return true;
|
|
3064
3064
|
return false;
|
|
3065
3065
|
}
|
|
3066
3066
|
function readWindow(src, srcRect, rect) {
|
|
@@ -3069,7 +3069,7 @@ function readWindow(src, srcRect, rect) {
|
|
|
3069
3069
|
const win = { x: rect.x, y: rect.y, w: rect.width, h: rect.height, n, data };
|
|
3070
3070
|
const r = intersect(rect, srcRect);
|
|
3071
3071
|
if (!r) return win;
|
|
3072
|
-
const px =
|
|
3072
|
+
const px = _chunkSZ6KMZNMcjs.readRegion.call(void 0, src, r);
|
|
3073
3073
|
for (let y = 0; y < r.height; y++) {
|
|
3074
3074
|
let s = y * r.width * src.channels;
|
|
3075
3075
|
let d = ((r.y - rect.y + y) * rect.width + (r.x - rect.x)) * n;
|
|
@@ -3211,13 +3211,13 @@ function boxReduce(src, srcRect, kx, ky) {
|
|
|
3211
3211
|
const ry1 = Math.ceil((srcRect.y + srcRect.height) / ky);
|
|
3212
3212
|
const rw = rx1 - rx0;
|
|
3213
3213
|
const rect = { x: rx0, y: ry0, width: rw, height: ry1 - ry0 };
|
|
3214
|
-
let out =
|
|
3215
|
-
const rowsPer = Math.max(1, Math.floor(
|
|
3214
|
+
let out = _chunkSZ6KMZNMcjs.emptySurface.call(void 0, ch, src.defaultValue);
|
|
3215
|
+
const rowsPer = Math.max(1, Math.floor(_chunkSZ6KMZNMcjs.TILE / ky));
|
|
3216
3216
|
const area = kx * ky;
|
|
3217
3217
|
for (let ry = ry0; ry < ry1; ry += rowsPer) {
|
|
3218
3218
|
const rows = Math.min(rowsPer, ry1 - ry);
|
|
3219
3219
|
const strip = { x: rx0 * kx, y: ry * ky, width: rw * kx, height: rows * ky };
|
|
3220
|
-
const px =
|
|
3220
|
+
const px = _chunkSZ6KMZNMcjs.readRegion.call(void 0, src, strip);
|
|
3221
3221
|
const red = new Uint8ClampedArray(rw * rows * ch);
|
|
3222
3222
|
for (let j = 0; j < rows; j++) {
|
|
3223
3223
|
for (let i = 0; i < rw; i++) {
|
|
@@ -3253,13 +3253,13 @@ function boxReduce(src, srcRect, kx, ky) {
|
|
|
3253
3253
|
}
|
|
3254
3254
|
}
|
|
3255
3255
|
}
|
|
3256
|
-
out =
|
|
3256
|
+
out = _chunkSZ6KMZNMcjs.writeRegion.call(void 0, out, { x: rx0, y: ry, width: rw, height: rows }, red);
|
|
3257
3257
|
}
|
|
3258
3258
|
return { surface: out, rect };
|
|
3259
3259
|
}
|
|
3260
3260
|
function reduceSurface(src, factor) {
|
|
3261
3261
|
const k = Math.max(1, Math.floor(factor));
|
|
3262
|
-
const b =
|
|
3262
|
+
const b = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, src);
|
|
3263
3263
|
if (k === 1 || !b) return src;
|
|
3264
3264
|
return boxReduce(src, b, k, k).surface;
|
|
3265
3265
|
}
|
|
@@ -3287,7 +3287,7 @@ function checkBudget(dst, what = "result") {
|
|
|
3287
3287
|
}
|
|
3288
3288
|
}
|
|
3289
3289
|
function assemble(src, tiles) {
|
|
3290
|
-
return new (0,
|
|
3290
|
+
return new (0, _chunkSZ6KMZNMcjs.TiledSurface)(src.channels, tiles, src.defaultValue);
|
|
3291
3291
|
}
|
|
3292
3292
|
function transformedBounds(source, h) {
|
|
3293
3293
|
if (!(source.width > 0 && source.height > 0) || !_chunkMUUXNRU4cjs.invertHomography.call(void 0, h)) return null;
|
|
@@ -3299,16 +3299,16 @@ function transformSurface(src, h, options = {}) {
|
|
|
3299
3299
|
const interp = _nullishCoalesce(options.interpolation, () => ( "bicubic"));
|
|
3300
3300
|
const ch = src.channels;
|
|
3301
3301
|
const def = src.defaultValue;
|
|
3302
|
-
const empty =
|
|
3302
|
+
const empty = _chunkSZ6KMZNMcjs.emptySurface.call(void 0, ch, def);
|
|
3303
3303
|
const given = options.source;
|
|
3304
3304
|
const step = normalizeStep(options.step);
|
|
3305
3305
|
if (_chunkMUUXNRU4cjs.isIdentityHomography.call(void 0, h, 1e-12) && !given && !options.clip) return src;
|
|
3306
3306
|
const dx = h[2] / h[8];
|
|
3307
3307
|
const dy = h[5] / h[8];
|
|
3308
3308
|
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) {
|
|
3309
|
-
return
|
|
3309
|
+
return _chunkSZ6KMZNMcjs.translateSurface.call(void 0, src, Math.round(dx), Math.round(dy));
|
|
3310
3310
|
}
|
|
3311
|
-
let srcRect = given ? intersect(given, given) :
|
|
3311
|
+
let srcRect = given ? intersect(given, given) : _chunkSZ6KMZNMcjs.contentBounds.call(void 0, src);
|
|
3312
3312
|
if (!srcRect) return empty;
|
|
3313
3313
|
let H = h;
|
|
3314
3314
|
let S = src;
|
|
@@ -3358,8 +3358,8 @@ function transformSurface(src, h, options = {}) {
|
|
|
3358
3358
|
const sy0 = sr.y;
|
|
3359
3359
|
const sx1 = sr.x + sr.width - 1;
|
|
3360
3360
|
const sy1 = sr.y + sr.height - 1;
|
|
3361
|
-
for (const { tx, ty } of
|
|
3362
|
-
const t = intersect({ x: tx *
|
|
3361
|
+
for (const { tx, ty } of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, dst)) {
|
|
3362
|
+
const t = intersect({ x: tx * _chunkSZ6KMZNMcjs.TILE, y: ty * _chunkSZ6KMZNMcjs.TILE, width: _chunkSZ6KMZNMcjs.TILE, height: _chunkSZ6KMZNMcjs.TILE }, dst);
|
|
3363
3363
|
if (!t) continue;
|
|
3364
3364
|
const tc = [
|
|
3365
3365
|
{ x: t.x, y: t.y },
|
|
@@ -3405,11 +3405,11 @@ function transformSurface(src, h, options = {}) {
|
|
|
3405
3405
|
const readable = intersect(foot, sr);
|
|
3406
3406
|
if (!readable || !hasTilesIn(S, readable)) continue;
|
|
3407
3407
|
const win = readWindow(S, sr, foot);
|
|
3408
|
-
const out = new Uint8ClampedArray(
|
|
3408
|
+
const out = new Uint8ClampedArray(_chunkSZ6KMZNMcjs.TILE * _chunkSZ6KMZNMcjs.TILE * ch);
|
|
3409
3409
|
if (def) out.fill(def);
|
|
3410
3410
|
let any = false;
|
|
3411
|
-
const ox = tx *
|
|
3412
|
-
const oy = ty *
|
|
3411
|
+
const ox = tx * _chunkSZ6KMZNMcjs.TILE;
|
|
3412
|
+
const oy = ty * _chunkSZ6KMZNMcjs.TILE;
|
|
3413
3413
|
let su = widen(su0);
|
|
3414
3414
|
let sv = widen(sv0);
|
|
3415
3415
|
const ystart = t.y - ((t.y - oy) % step + step) % step;
|
|
@@ -3445,7 +3445,7 @@ function transformSurface(src, h, options = {}) {
|
|
|
3445
3445
|
const y0 = Math.max(y, t.y);
|
|
3446
3446
|
const y1 = Math.min(y + step, t.y + t.height);
|
|
3447
3447
|
for (let yy = y0; yy < y1; yy++) {
|
|
3448
|
-
const row = (yy - oy) *
|
|
3448
|
+
const row = (yy - oy) * _chunkSZ6KMZNMcjs.TILE - ox;
|
|
3449
3449
|
for (let bi = 0, x = xstart; bi < blocks; bi++, x += step) {
|
|
3450
3450
|
if (!rowSet[bi]) continue;
|
|
3451
3451
|
const x0 = Math.max(x, t.x);
|
|
@@ -3457,8 +3457,8 @@ function transformSurface(src, h, options = {}) {
|
|
|
3457
3457
|
}
|
|
3458
3458
|
}
|
|
3459
3459
|
if (!any) continue;
|
|
3460
|
-
const tile =
|
|
3461
|
-
if (tile) tiles.set(
|
|
3460
|
+
const tile = _chunkSZ6KMZNMcjs.finishTile.call(void 0, out, ch, def);
|
|
3461
|
+
if (tile) tiles.set(_chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty), tile);
|
|
3462
3462
|
}
|
|
3463
3463
|
return assemble(src, tiles);
|
|
3464
3464
|
}
|
|
@@ -3469,8 +3469,8 @@ function warpSurface(src, f, options = {}) {
|
|
|
3469
3469
|
const interp = _nullishCoalesce(options.interpolation, () => ( "bicubic"));
|
|
3470
3470
|
const ch = src.channels;
|
|
3471
3471
|
const def = src.defaultValue;
|
|
3472
|
-
const empty =
|
|
3473
|
-
const sr = options.source ? intersect(options.source, options.source) :
|
|
3472
|
+
const empty = _chunkSZ6KMZNMcjs.emptySurface.call(void 0, ch, def);
|
|
3473
|
+
const sr = options.source ? intersect(options.source, options.source) : _chunkSZ6KMZNMcjs.contentBounds.call(void 0, src);
|
|
3474
3474
|
if (!sr) return empty;
|
|
3475
3475
|
const step = normalizeStep(options.step);
|
|
3476
3476
|
const nx = Math.min(MAX_CELLS, Math.max(1, Math.ceil(sr.width / CELL)));
|
|
@@ -3521,10 +3521,10 @@ function warpSurface(src, f, options = {}) {
|
|
|
3521
3521
|
tris[t++] = a + w1;
|
|
3522
3522
|
}
|
|
3523
3523
|
}
|
|
3524
|
-
const tx0 = Math.floor(dst.x /
|
|
3525
|
-
const ty0 = Math.floor(dst.y /
|
|
3526
|
-
const cols = Math.floor((dst.x + dst.width - 1) /
|
|
3527
|
-
const rows = Math.floor((dst.y + dst.height - 1) /
|
|
3524
|
+
const tx0 = Math.floor(dst.x / _chunkSZ6KMZNMcjs.TILE);
|
|
3525
|
+
const ty0 = Math.floor(dst.y / _chunkSZ6KMZNMcjs.TILE);
|
|
3526
|
+
const cols = Math.floor((dst.x + dst.width - 1) / _chunkSZ6KMZNMcjs.TILE) - tx0 + 1;
|
|
3527
|
+
const rows = Math.floor((dst.y + dst.height - 1) / _chunkSZ6KMZNMcjs.TILE) - ty0 + 1;
|
|
3528
3528
|
const bins = Array.from({ length: cols * rows }, () => []);
|
|
3529
3529
|
for (let k = 0; k < triCount; k++) {
|
|
3530
3530
|
const a = tris[3 * k];
|
|
@@ -3534,10 +3534,10 @@ function warpSurface(src, f, options = {}) {
|
|
|
3534
3534
|
const tminy = Math.floor(Math.min(dvy[a], dvy[b], dvy[c]));
|
|
3535
3535
|
const tmaxx = Math.ceil(Math.max(dvx[a], dvx[b], dvx[c]));
|
|
3536
3536
|
const tmaxy = Math.ceil(Math.max(dvy[a], dvy[b], dvy[c]));
|
|
3537
|
-
const cx0 = Math.max(0, Math.floor(Math.max(tminx, dst.x) /
|
|
3538
|
-
const cy0 = Math.max(0, Math.floor(Math.max(tminy, dst.y) /
|
|
3539
|
-
const cx1 = Math.min(cols - 1, Math.floor(Math.min(tmaxx, dst.x + dst.width - 1) /
|
|
3540
|
-
const cy1 = Math.min(rows - 1, Math.floor(Math.min(tmaxy, dst.y + dst.height - 1) /
|
|
3537
|
+
const cx0 = Math.max(0, Math.floor(Math.max(tminx, dst.x) / _chunkSZ6KMZNMcjs.TILE) - tx0);
|
|
3538
|
+
const cy0 = Math.max(0, Math.floor(Math.max(tminy, dst.y) / _chunkSZ6KMZNMcjs.TILE) - ty0);
|
|
3539
|
+
const cx1 = Math.min(cols - 1, Math.floor(Math.min(tmaxx, dst.x + dst.width - 1) / _chunkSZ6KMZNMcjs.TILE) - tx0);
|
|
3540
|
+
const cy1 = Math.min(rows - 1, Math.floor(Math.min(tmaxy, dst.y + dst.height - 1) / _chunkSZ6KMZNMcjs.TILE) - ty0);
|
|
3541
3541
|
for (let cy = cy0; cy <= cy1; cy++) for (let cx = cx0; cx <= cx1; cx++) bins[cy * cols + cx].push(k);
|
|
3542
3542
|
}
|
|
3543
3543
|
const tiles = /* @__PURE__ */ new Map();
|
|
@@ -3551,7 +3551,7 @@ function warpSurface(src, f, options = {}) {
|
|
|
3551
3551
|
if (!list.length) continue;
|
|
3552
3552
|
const ttx = tx0 + cx;
|
|
3553
3553
|
const tty = ty0 + cy;
|
|
3554
|
-
const t = intersect({ x: ttx *
|
|
3554
|
+
const t = intersect({ x: ttx * _chunkSZ6KMZNMcjs.TILE, y: tty * _chunkSZ6KMZNMcjs.TILE, width: _chunkSZ6KMZNMcjs.TILE, height: _chunkSZ6KMZNMcjs.TILE }, dst);
|
|
3555
3555
|
if (!t) continue;
|
|
3556
3556
|
const tw = t.width;
|
|
3557
3557
|
const th = t.height;
|
|
@@ -3641,11 +3641,11 @@ function warpSurface(src, f, options = {}) {
|
|
|
3641
3641
|
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);
|
|
3642
3642
|
if (!foot || !hasTilesIn(src, foot)) continue;
|
|
3643
3643
|
const win = readWindow(src, sr, foot);
|
|
3644
|
-
const out = new Uint8ClampedArray(
|
|
3644
|
+
const out = new Uint8ClampedArray(_chunkSZ6KMZNMcjs.TILE * _chunkSZ6KMZNMcjs.TILE * ch);
|
|
3645
3645
|
if (def) out.fill(def);
|
|
3646
3646
|
let any = false;
|
|
3647
|
-
const ox = ttx *
|
|
3648
|
-
const oy = tty *
|
|
3647
|
+
const ox = ttx * _chunkSZ6KMZNMcjs.TILE;
|
|
3648
|
+
const oy = tty * _chunkSZ6KMZNMcjs.TILE;
|
|
3649
3649
|
const pointAt = (o, into) => {
|
|
3650
3650
|
const li = owner[o];
|
|
3651
3651
|
const cnx = ssx[li];
|
|
@@ -3676,7 +3676,7 @@ function warpSurface(src, f, options = {}) {
|
|
|
3676
3676
|
pointAt(o, acc);
|
|
3677
3677
|
const x = t.x + o % tw;
|
|
3678
3678
|
const y = t.y + Math.floor(o / tw);
|
|
3679
|
-
if (store(out, ((y - oy) *
|
|
3679
|
+
if (store(out, ((y - oy) * _chunkSZ6KMZNMcjs.TILE + (x - ox)) * ch, acc, ch, def)) any = true;
|
|
3680
3680
|
}
|
|
3681
3681
|
} else {
|
|
3682
3682
|
for (let by = 0; by < th; by += step) {
|
|
@@ -3684,19 +3684,19 @@ function warpSurface(src, f, options = {}) {
|
|
|
3684
3684
|
const o = by * tw + bx;
|
|
3685
3685
|
if (Number.isNaN(us[o])) continue;
|
|
3686
3686
|
pointAt(o, acc);
|
|
3687
|
-
const first = ((t.y + by - oy) *
|
|
3687
|
+
const first = ((t.y + by - oy) * _chunkSZ6KMZNMcjs.TILE + (t.x + bx - ox)) * ch;
|
|
3688
3688
|
if (!store(out, first, acc, ch, def)) continue;
|
|
3689
3689
|
any = true;
|
|
3690
3690
|
for (let yy = by; yy < Math.min(th, by + step); yy++) {
|
|
3691
|
-
const row = ((t.y + yy - oy) *
|
|
3691
|
+
const row = ((t.y + yy - oy) * _chunkSZ6KMZNMcjs.TILE + (t.x - ox)) * ch;
|
|
3692
3692
|
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];
|
|
3693
3693
|
}
|
|
3694
3694
|
}
|
|
3695
3695
|
}
|
|
3696
3696
|
}
|
|
3697
3697
|
if (!any) continue;
|
|
3698
|
-
const tile =
|
|
3699
|
-
if (tile) tiles.set(
|
|
3698
|
+
const tile = _chunkSZ6KMZNMcjs.finishTile.call(void 0, out, ch, def);
|
|
3699
|
+
if (tile) tiles.set(_chunkSZ6KMZNMcjs.tileKey.call(void 0, ttx, tty), tile);
|
|
3700
3700
|
}
|
|
3701
3701
|
}
|
|
3702
3702
|
return assemble(src, tiles);
|
|
@@ -3712,7 +3712,7 @@ function compositeSurfaceOver(base, top) {
|
|
|
3712
3712
|
tiles.set(key, t);
|
|
3713
3713
|
continue;
|
|
3714
3714
|
}
|
|
3715
|
-
const d = new Uint8ClampedArray(
|
|
3715
|
+
const d = new Uint8ClampedArray(_chunkSZ6KMZNMcjs.TILE * _chunkSZ6KMZNMcjs.TILE * ch);
|
|
3716
3716
|
if (under) d.set(under.data);
|
|
3717
3717
|
else if (base.defaultValue) d.fill(base.defaultValue);
|
|
3718
3718
|
const s = t.data;
|
|
@@ -3738,11 +3738,11 @@ function compositeSurfaceOver(base, top) {
|
|
|
3738
3738
|
if (ta > 0) d[p] = s[i] * ta + d[p] * (1 - ta);
|
|
3739
3739
|
}
|
|
3740
3740
|
}
|
|
3741
|
-
const tile =
|
|
3741
|
+
const tile = _chunkSZ6KMZNMcjs.finishTile.call(void 0, d, ch, base.defaultValue);
|
|
3742
3742
|
if (tile) tiles.set(key, tile);
|
|
3743
3743
|
else tiles.delete(key);
|
|
3744
3744
|
}
|
|
3745
|
-
return new (0,
|
|
3745
|
+
return new (0, _chunkSZ6KMZNMcjs.TiledSurface)(ch, tiles, base.defaultValue);
|
|
3746
3746
|
}
|
|
3747
3747
|
|
|
3748
3748
|
// src/raster/zlib.ts
|
|
@@ -4652,4 +4652,4 @@ function pngDataUrl(width, height, data, channels = 4) {
|
|
|
4652
4652
|
|
|
4653
4653
|
|
|
4654
4654
|
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.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;
|
|
4655
|
-
//# sourceMappingURL=chunk-
|
|
4655
|
+
//# sourceMappingURL=chunk-T3QZ6S47.cjs.map
|