@pixerate/editor 0.117.0 → 0.119.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/THIRD_PARTY_NOTICES.md +3 -0
- package/dist/animation-editor/index.cjs +54 -54
- package/dist/animation-editor/index.d.cts +3 -3
- package/dist/animation-editor/index.d.ts +3 -3
- package/dist/animation-editor/index.js +2 -2
- package/dist/{chunk-2J3LS7JZ.cjs → chunk-4S2AXNQF.cjs} +221 -186
- package/dist/chunk-4S2AXNQF.cjs.map +1 -0
- package/dist/{chunk-7LNZAWSJ.js → chunk-CSHEI3YT.js} +625 -451
- package/dist/chunk-CSHEI3YT.js.map +1 -0
- package/dist/{chunk-M7O4BJRH.cjs → chunk-KGNUFO4T.cjs} +36 -36
- package/dist/{chunk-M7O4BJRH.cjs.map → chunk-KGNUFO4T.cjs.map} +1 -1
- package/dist/{chunk-R2JE6SA7.js → chunk-KZLQY4CD.js} +42 -7
- package/dist/chunk-KZLQY4CD.js.map +1 -0
- package/dist/{chunk-L2T6EJ5S.cjs → chunk-L3PXFMOF.cjs} +38 -25
- package/dist/chunk-L3PXFMOF.cjs.map +1 -0
- package/dist/{chunk-FODKPD44.cjs → chunk-LI3KTY7K.cjs} +724 -550
- package/dist/chunk-LI3KTY7K.cjs.map +1 -0
- package/dist/{chunk-IVSNUXW7.js → chunk-T7IZDNSL.js} +37 -24
- package/dist/chunk-T7IZDNSL.js.map +1 -0
- package/dist/{chunk-T2P5TIZ6.js → chunk-TDQDMBUR.js} +2 -2
- package/dist/{chunk-BYAWOAST.cjs → chunk-TS5IEUW6.cjs} +26 -25
- package/dist/chunk-TS5IEUW6.cjs.map +1 -0
- package/dist/{chunk-VD2UDVF7.js → chunk-UMVW2Q66.js} +21 -5
- package/dist/chunk-UMVW2Q66.js.map +1 -0
- package/dist/{chunk-EBSYZRSW.cjs → chunk-WMRIG4XQ.cjs} +21 -5
- package/dist/chunk-WMRIG4XQ.cjs.map +1 -0
- package/dist/{chunk-JHXMNOMF.js → chunk-YHW26LS2.js} +14 -13
- package/dist/chunk-YHW26LS2.js.map +1 -0
- package/dist/{export-DMOuzgZZ.d.cts → export-B_jO2PrH.d.cts} +18 -4
- package/dist/{export-Dul1SbPv.d.ts → export-Ds8Ccw0K.d.ts} +18 -4
- package/dist/{flow-4-OC-UkQ.d.cts → flow-A2Dj-69w.d.cts} +21 -9
- package/dist/{flow-Cb7lkPm8.d.ts → flow-C95atNoQ.d.ts} +21 -9
- package/dist/image-editor/index.cjs +1104 -979
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +5 -5
- package/dist/image-editor/index.d.ts +5 -5
- package/dist/image-editor/index.js +157 -32
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint/index.cjs +5 -3
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint/index.js +4 -2
- package/dist/paint-editor/index.cjs +147 -147
- package/dist/paint-editor/index.d.cts +4 -4
- package/dist/paint-editor/index.d.ts +4 -4
- package/dist/paint-editor/index.js +4 -4
- package/dist/raster/index.cjs +2 -2
- package/dist/raster/index.js +1 -1
- package/dist/{svg-DlEuhwoX.d.ts → svg-CTxrB5xO.d.ts} +5 -1
- package/dist/{svg-CVdFc80-.d.cts → svg-hK0WQc7-.d.cts} +5 -1
- package/dist/{types-Tfly4Aya.d.cts → types-Dq-8qgoo.d.cts} +45 -3
- package/dist/{types-CDLGhAZp.d.ts → types-TrSSh_RB.d.ts} +45 -3
- package/dist/vector/index.cjs +1535 -1164
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +127 -9
- package/dist/vector/index.d.ts +127 -9
- package/dist/vector/index.js +386 -15
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/references/photoshop-files.md +9 -7
- package/skills/pixerate-vector/SKILL.md +13 -1
- package/skills/pixerate-vector/references/commands.md +1 -0
- package/dist/chunk-2J3LS7JZ.cjs.map +0 -1
- package/dist/chunk-7LNZAWSJ.js.map +0 -1
- package/dist/chunk-BYAWOAST.cjs.map +0 -1
- package/dist/chunk-EBSYZRSW.cjs.map +0 -1
- package/dist/chunk-FODKPD44.cjs.map +0 -1
- package/dist/chunk-IVSNUXW7.js.map +0 -1
- package/dist/chunk-JHXMNOMF.js.map +0 -1
- package/dist/chunk-L2T6EJ5S.cjs.map +0 -1
- package/dist/chunk-R2JE6SA7.js.map +0 -1
- package/dist/chunk-VD2UDVF7.js.map +0 -1
- /package/dist/{chunk-T2P5TIZ6.js.map → chunk-TDQDMBUR.js.map} +0 -0
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
applyStrokeToTile,
|
|
7
7
|
dabRect,
|
|
8
8
|
normalizeBrush,
|
|
9
|
+
put255,
|
|
9
10
|
rasterizeDab
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-T7IZDNSL.js";
|
|
11
12
|
import {
|
|
12
13
|
TILE,
|
|
13
14
|
TiledSurface,
|
|
@@ -447,7 +448,7 @@ function readSourceRegion(source, rect, dx = 0, dy = 0) {
|
|
|
447
448
|
return out;
|
|
448
449
|
}
|
|
449
450
|
function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, options = {}) {
|
|
450
|
-
const out =
|
|
451
|
+
const out = (options.into ?? tileData).slice();
|
|
451
452
|
const ox = tx * TILE + s.offset.x;
|
|
452
453
|
const oy = ty * TILE + s.offset.y;
|
|
453
454
|
let x0 = 0;
|
|
@@ -522,9 +523,9 @@ function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, opti
|
|
|
522
523
|
const g0 = rgb[1];
|
|
523
524
|
const b0 = rgb[2];
|
|
524
525
|
paint.tone(rgb);
|
|
525
|
-
out
|
|
526
|
-
out
|
|
527
|
-
out
|
|
526
|
+
put255(out, i, r0 + (rgb[0] - r0) * k);
|
|
527
|
+
put255(out, i + 1, g0 + (rgb[1] - g0) * k);
|
|
528
|
+
put255(out, i + 2, b0 + (rgb[2] - b0) * k);
|
|
528
529
|
continue;
|
|
529
530
|
}
|
|
530
531
|
if (s.lockTransparency && a === 0) continue;
|
|
@@ -539,10 +540,10 @@ function applyRetouchToTile(coverage, tileData, channels, tx, ty, paint, s, opti
|
|
|
539
540
|
cs[ch] = src[ch] / 255;
|
|
540
541
|
}
|
|
541
542
|
const o = blendPixel(blend, cb, cs, k);
|
|
542
|
-
out
|
|
543
|
-
out
|
|
544
|
-
out
|
|
545
|
-
if (!s.lockTransparency) out
|
|
543
|
+
put255(out, i, o[0]);
|
|
544
|
+
put255(out, i + 1, o[1]);
|
|
545
|
+
put255(out, i + 2, o[2]);
|
|
546
|
+
if (!s.lockTransparency) put255(out, i + 3, o[3]);
|
|
546
547
|
}
|
|
547
548
|
}
|
|
548
549
|
return out;
|
|
@@ -760,9 +761,9 @@ function spongeEffect(brush, saturate, vibrance) {
|
|
|
760
761
|
rgb[1] = px[i + 1] / 255;
|
|
761
762
|
rgb[2] = px[i + 2] / 255;
|
|
762
763
|
sponge(rgb, k, saturate, vibrance);
|
|
763
|
-
px
|
|
764
|
-
px
|
|
765
|
-
px
|
|
764
|
+
put255(px, i, rgb[0]);
|
|
765
|
+
put255(px, i + 1, rgb[1]);
|
|
766
|
+
put255(px, i + 2, rgb[2]);
|
|
766
767
|
}
|
|
767
768
|
}
|
|
768
769
|
};
|
|
@@ -971,4 +972,4 @@ export {
|
|
|
971
972
|
pathStrokeCoverage,
|
|
972
973
|
paintPathStroke
|
|
973
974
|
};
|
|
974
|
-
//# sourceMappingURL=chunk-
|
|
975
|
+
//# sourceMappingURL=chunk-YHW26LS2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/paint/heal.ts","../src/paint/retouch.ts","../src/paint/path-stroke.ts"],"sourcesContent":["// Portions ported from photocraft/crates/algo/src/poisson.rs and inpaint.rs (MIT OR Apache-2.0, © ArtCraft Team and contributors). See THIRD_PARTY_NOTICES.md.\n\n/**\n * Gradient-domain (\"Poisson\") blending for the Healing Brush and the Spot Healing Brush.\n *\n * Method: P. Pérez, M. Gangnet, A. Blake, *Poisson Image Editing*, SIGGRAPH 2003. Seamless cloning\n * looks for `f` over a region Ω with `f = f*` (the destination) on its boundary and `∇f` as close\n * as possible to the source's `∇g`. The answer is `f = g + h`, where `h` is the membrane: the\n * harmonic function (`Δh = 0`) that equals `f* − g` on the boundary. So healed pixels keep the\n * source's texture while their colour and lighting are pulled to the pixels around the stroke.\n *\n * The Laplace equation is solved on the 4-connected grid by successive over-relaxation, started\n * from a recursively solved half-resolution grid (cascadic multigrid). Harmonic functions are\n * smooth, so the coarse guess is close and a few sweeps per level remove the rest.\n *\n * Buffers are interleaved `w × h × ch` floats in any units (the callers use 0..255). Pure maths:\n * no DOM, no framework.\n */\n\n/** Largest per-sweep update below which a solve has converged. */\nconst TOL = 2e-3;\n/** Sweeps (cap) and relaxation on every level above the coarsest. */\nconst FINE_ITERS = 30;\nconst FINE_OMEGA = 1.7;\n\n/**\n * Solves `Δv = 0` on the `unknown` pixels, with the known pixels of `v` as Dirichlet values\n * (neighbours off the grid are ignored: a free boundary). `v` holds the known values on entry and\n * the solution on exit.\n */\nexport function solveMembrane(w: number, h: number, unknown: ArrayLike<boolean | number>, v: Float32Array): void {\n if (unknown.length !== w * h || v.length !== w * h) throw new RangeError(`solveMembrane: expected ${w * h} cells, got ${unknown.length} and ${v.length}.`);\n const u = new Uint8Array(w * h);\n for (let i = 0; i < u.length; i++) u[i] = unknown[i] ? 1 : 0;\n solveLevel(w, h, u, v, 0);\n}\n\nfunction solveLevel(w: number, h: number, unknown: Uint8Array, v: Float32Array, depth: number): void {\n let nUnknown = 0;\n let knownSum = 0;\n let nKnown = 0;\n for (let i = 0; i < unknown.length; i++) {\n if (unknown[i]) nUnknown++;\n else {\n knownSum += v[i];\n nKnown++;\n }\n }\n if (nUnknown === 0 || nKnown === 0) return;\n if (w >= 8 && h >= 8 && nUnknown > 64 && depth < 16) {\n // Restrict: a coarse cell is known when any of its children is (the mean of those).\n const cw = Math.ceil(w / 2);\n const chh = Math.ceil(h / 2);\n const cu = new Uint8Array(cw * chh).fill(1);\n const cv = new Float32Array(cw * chh);\n for (let cy = 0; cy < chh; cy++) {\n for (let cx = 0; cx < cw; cx++) {\n let s = 0;\n let n = 0;\n for (let k = 0; k < 4; k++) {\n const x = cx * 2 + (k & 1);\n const y = cy * 2 + (k >> 1);\n if (x < w && y < h && !unknown[y * w + x]) {\n s += v[y * w + x];\n n++;\n }\n }\n if (n > 0) {\n cu[cy * cw + cx] = 0;\n cv[cy * cw + cx] = s / n;\n }\n }\n }\n solveLevel(cw, chh, cu, cv, depth + 1);\n // Prolong: a bilinear sample of the coarse solution is the starting guess.\n for (let y = 0; y < h; y++) {\n const fy = Math.min(chh - 1, Math.max(0, (y + 0.5) / 2 - 0.5));\n const y0 = Math.floor(fy);\n const y1 = Math.min(chh - 1, y0 + 1);\n const ty = fy - y0;\n for (let x = 0; x < w; x++) {\n if (!unknown[y * w + x]) continue;\n const fx = Math.min(cw - 1, Math.max(0, (x + 0.5) / 2 - 0.5));\n const x0 = Math.floor(fx);\n const x1 = Math.min(cw - 1, x0 + 1);\n const tx = fx - x0;\n const a = cv[y0 * cw + x0] + (cv[y0 * cw + x1] - cv[y0 * cw + x0]) * tx;\n const b = cv[y1 * cw + x0] + (cv[y1 * cw + x1] - cv[y1 * cw + x0]) * tx;\n v[y * w + x] = a + (b - a) * ty;\n }\n }\n sor(w, h, unknown, v, FINE_ITERS, FINE_OMEGA);\n } else {\n const mean = knownSum / nKnown;\n for (let i = 0; i < v.length; i++) if (unknown[i]) v[i] = mean;\n sor(w, h, unknown, v, 2000, 1.85);\n }\n}\n\n/** Over-relaxed Gauss-Seidel sweeps over the unknown cells until the largest update is below `TOL`. */\nfunction sor(w: number, h: number, unknown: Uint8Array, v: Float32Array, maxIter: number, omega: number): void {\n let n = 0;\n for (let i = 0; i < unknown.length; i++) if (unknown[i]) n++;\n const cells = new Uint32Array(n);\n const masks = new Uint8Array(n);\n for (let i = 0, k = 0; i < unknown.length; i++) {\n if (!unknown[i]) continue;\n const x = i % w;\n const y = (i - x) / w;\n cells[k] = i;\n masks[k++] = (x > 0 ? 1 : 0) | (x + 1 < w ? 2 : 0) | (y > 0 ? 4 : 0) | (y + 1 < h ? 8 : 0);\n }\n for (let it = 0; it < maxIter; it++) {\n let maxD = 0;\n for (let k = 0; k < n; k++) {\n const i = cells[k];\n const m = masks[k];\n let s: number;\n let c: number;\n if (m === 15) {\n s = v[i - 1] + v[i + 1] + v[i - w] + v[i + w];\n c = 4;\n } else {\n s = 0;\n c = 0;\n if (m & 1) (s += v[i - 1]), c++;\n if (m & 2) (s += v[i + 1]), c++;\n if (m & 4) (s += v[i - w]), c++;\n if (m & 8) (s += v[i + w]), c++;\n if (c === 0) continue;\n }\n const d = omega * (s / c - v[i]);\n v[i] += d;\n const ad = d < 0 ? -d : d;\n if (ad > maxD) maxD = ad;\n }\n if (maxD < TOL) break;\n }\n}\n\n/**\n * Seamless cloning: `dst` outside `mask`; inside, `src` plus the membrane that removes the\n * mismatch at the mask's edge. So the result keeps the source's texture and takes the\n * destination's colour and light. `src` and `dst` are interleaved `w × h × ch`; leave a one-pixel\n * unmasked margin for a fully fixed boundary.\n */\nexport function seamlessClone(w: number, h: number, ch: number, src: ArrayLike<number>, dst: ArrayLike<number>, mask: ArrayLike<boolean | number>): Float32Array {\n const n = w * h;\n if (src.length !== n * ch || dst.length !== n * ch || mask.length !== n) throw new RangeError('seamlessClone: src, dst and mask must cover w × h pixels.');\n const out = new Float32Array(n * ch);\n const hv = new Float32Array(n);\n for (let c = 0; c < ch; c++) {\n for (let i = 0; i < n; i++) hv[i] = mask[i] ? 0 : dst[i * ch + c] - src[i * ch + c];\n solveMembrane(w, h, mask, hv);\n for (let i = 0; i < n; i++) out[i * ch + c] = mask[i] ? src[i * ch + c] + hv[i] : dst[i * ch + c];\n }\n return out;\n}\n\n/** Membrane fill (no source texture): the known pixels interpolated smoothly into `hole`. */\nexport function membraneFill(w: number, h: number, ch: number, img: ArrayLike<number>, hole: ArrayLike<boolean | number>): Float32Array {\n const n = w * h;\n const out = new Float32Array(n * ch);\n const v = new Float32Array(n);\n for (let c = 0; c < ch; c++) {\n for (let i = 0; i < n; i++) v[i] = hole[i] ? 0 : img[i * ch + c];\n solveMembrane(w, h, hole, v);\n for (let i = 0; i < n; i++) out[i * ch + c] = v[i];\n }\n return out;\n}\n\n/** A mask grown by `r` pixels (square structuring element). */\nexport function dilateMask(w: number, h: number, mask: ArrayLike<boolean | number>, r: number): Uint8Array {\n const tmp = new Uint8Array(w * h);\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n if (!mask[y * w + x]) continue;\n for (let xx = Math.max(0, x - r); xx <= Math.min(w - 1, x + r); xx++) tmp[y * w + xx] = 1;\n }\n }\n const out = new Uint8Array(w * h);\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n if (!tmp[y * w + x]) continue;\n for (let yy = Math.max(0, y - r); yy <= Math.min(h - 1, y + r); yy++) out[yy * w + x] = 1;\n }\n }\n return out;\n}\n\n/** A summed-area table over a mask, for \"how many masked cells in this window\". */\nclass MaskIntegral {\n private readonly s: Uint32Array;\n constructor(\n private readonly w: number,\n private readonly h: number,\n mask: ArrayLike<boolean | number>\n ) {\n const W = w + 1;\n this.s = new Uint32Array(W * (h + 1));\n for (let y = 0; y < h; y++) {\n let row = 0;\n for (let x = 0; x < w; x++) {\n row += mask[y * w + x] ? 1 : 0;\n this.s[(y + 1) * W + x + 1] = this.s[y * W + x + 1] + row;\n }\n }\n }\n /** Masked cells in [x0, x1) × [y0, y1) (clipped to the grid). */\n count(x0: number, y0: number, x1: number, y1: number): number {\n const W = this.w + 1;\n const a = Math.max(0, Math.min(this.w, x0));\n const b = Math.max(0, Math.min(this.h, y0));\n const c = Math.max(0, Math.min(this.w, x1));\n const d = Math.max(0, Math.min(this.h, y1));\n if (c <= a || d <= b) return 0;\n return this.s[d * W + c] - this.s[b * W + c] - this.s[d * W + a] + this.s[b * W + a];\n }\n}\n\n/** Bounding box [x0, y0, x1, y1) of the set cells, or null. */\nexport function maskBounds(w: number, h: number, mask: ArrayLike<boolean | number>): [number, number, number, number] | null {\n let x0 = w;\n let y0 = h;\n let x1 = -1;\n let y1 = -1;\n for (let y = 0; y < h; y++) {\n for (let x = 0; x < w; x++) {\n if (!mask[y * w + x]) continue;\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n }\n }\n return x1 < 0 ? null : [x0, y0, x1 + 1, y1 + 1];\n}\n\n/**\n * Proximity match: the translation `(dx, dy)` (within `maxRadius`) whose pixels best match the\n * ring of `ring` pixels around the hole (sum of squared differences), so `img[p + (dx, dy)]` can\n * fill `p` in the hole. The source window must lie on the grid and hold no hole pixels. Nearer\n * sources win ties. Returns null when no translation fits.\n */\nexport function bestOffset(w: number, h: number, ch: number, img: ArrayLike<number>, hole: ArrayLike<boolean | number>, ring: number, maxRadius: number): [number, number] | null {\n const bb = maskBounds(w, h, hole);\n if (!bb) return null;\n const extent = Math.max(w, h);\n const R = Math.max(0, Math.min(extent, Math.floor(maxRadius)));\n if (R === 0) return null;\n const rg = Math.max(1, Math.min(extent, Math.floor(ring)));\n const hs = new MaskIntegral(w, h, hole);\n const x0 = bb[0] - rg;\n const y0 = bb[1] - rg;\n const x1 = bb[2] + rg;\n const y1 = bb[3] + rg;\n // Sample points: the ring around the hole, subsampled to about 2000.\n const pts: number[] = [];\n for (let y = Math.max(0, y0); y < Math.min(h, y1); y++) {\n for (let x = Math.max(0, x0); x < Math.min(w, x1); x++) {\n if (hole[y * w + x]) continue;\n if (hs.count(x - rg, y - rg, x + rg + 1, y + rg + 1) > 0) pts.push(x, y);\n }\n }\n const stride = Math.max(1, Math.floor(pts.length / 2 / 2000));\n const sx: number[] = [];\n const sy: number[] = [];\n for (let i = 0; i < pts.length; i += 2 * stride) {\n sx.push(pts[i]);\n sy.push(pts[i + 1]);\n }\n const n = Math.max(1, sx.length);\n const evalAt = (dx: number, dy: number, cutoff: number): number | null => {\n if (dx === 0 && dy === 0) return null;\n const hx0 = x0 + dx;\n const hy0 = y0 + dy;\n const hx1 = x1 + dx;\n const hy1 = y1 + dy;\n if (hx0 < 0 || hy0 < 0 || hx1 > w || hy1 > h) return null;\n if (hs.count(hx0, hy0, hx1, hy1) !== 0) return null;\n const penalty = 1 + 1e-3 * (Math.hypot(dx, dy) / R);\n let e = 0;\n for (let i = 0; i < sx.length; i++) {\n const a = (sy[i] * w + sx[i]) * ch;\n const b = ((sy[i] + dy) * w + sx[i] + dx) * ch;\n for (let c = 0; c < ch; c++) {\n const d = img[a + c] - img[b + c];\n e += d * d;\n }\n if ((i & 31) === 31 && (e / n) * penalty >= cutoff) return null;\n }\n return (e / n) * penalty;\n };\n const found: { best: [number, number] | null; e: number } = { best: null, e: Infinity };\n const consider = (dx: number, dy: number) => {\n const e = evalAt(dx, dy, found.e);\n if (e !== null && e < found.e) {\n found.e = e;\n found.best = [dx, dy];\n }\n };\n // A coarse grid over the search window, then every offset around the winner.\n const step = Math.max(1, Math.floor(R / 24));\n for (let dy = -R; dy <= R; dy += step) for (let dx = -R; dx <= R; dx += step) consider(dx, dy);\n if (step > 1 && found.best) {\n const [bx, by] = found.best;\n for (let dy = by - step; dy <= by + step; dy++) for (let dx = bx - step; dx <= bx + step; dx++) consider(dx, dy);\n }\n return found.best;\n}\n","// Portions ported from photocraft/crates/paint/src/retouch.rs, crates/algo/src/retouch.rs and crates/engine/src/retouch_cmds.rs (MIT OR Apache-2.0, © ArtCraft Team and contributors). See THIRD_PARTY_NOTICES.md.\n\n/**\n * The retouching tools on the shared brush engine: Clone Stamp, Healing Brush, Spot Healing\n * Brush, Smudge, Dodge, Burn and Sponge. Two stroke shapes cover them all:\n *\n * - **Accumulate, then composite** (Clone Stamp, Dodge, Burn; the Healing tools' result): the\n * stroke's dabs build up one `CoverageMap` (flow builds towards the dab's opacity ceiling), and\n * per-pixel paint taken from the pre-stroke state (a cloned source, a toned copy of the pixel,\n * a healed patch) is composited through it with `applyRetouchToTile`. Pixels painted earlier in\n * the stroke are never sampled again, and overlapping dabs never exceed the stroke's opacity.\n * - **Sequential dabs** (Smudge, Sponge): `RetouchDabStroke` runs each dab in order over live\n * tiles, so dab n sees what dab n − 1 did.\n *\n * The Healing Brush clones while it is drawn and, when the stroke ends, replaces the clone with a\n * seamless clone (`healPixels`, Poisson blending): the source's texture with the colour and light\n * of the pixels around the stroke. The Spot Healing Brush finds its own source (`spotHealPixels`).\n *\n * Tone curves (`dodgeBurnCurve`, `dodgeBurn`, `sponge`) are photocraft's, made to behave like\n * Photoshop's tools: the chosen range moves most, black and white stay put for midtones, and\n * Protect Tones works on luma so hue and saturation are kept. Data in, pixels out; no DOM.\n */\n\nimport { blendPixel, type BlendMode } from '../raster/blend';\nimport type { RasterRect } from '../raster/surface';\nimport { TILE, tileKey } from '../raster/surface';\nimport { srgbDecode, srgbEncode } from '../raster/deep';\nimport { DabWalker, dabRect, rasterizeDab, type BrushSettings, type CoverageMap, type Dab, type StrokePoint } from './brush';\nimport { SmudgeTip, type SmudgeSettings } from './blending';\nimport { TileMedium, put255, type PaintPixels, type PaintTileTarget } from './exchange';\nimport { bestOffset, dilateMask, maskBounds, membraneFill, seamlessClone } from './heal';\n\n// ---------------------------------------------------------------------------\n// Tone kernels\n// ---------------------------------------------------------------------------\n\n/** The tonal range Dodge and Burn work on most. */\nexport type ToneRange = 'shadows' | 'midtones' | 'highlights';\n\nexport const TONE_RANGES: readonly ToneRange[] = ['shadows', 'midtones', 'highlights'];\n\n/** Rec. 601 luma of straight RGB (0..1). */\nexport function luma(r: number, g: number, b: number): number {\n return 0.299 * r + 0.587 * g + 0.114 * b;\n}\n\n/** The dodge (or burn) transfer of one value `v` (0..1) at exposure `e` (0..1). */\nexport function dodgeBurnCurve(v: number, e: number, range: ToneRange, burn: boolean): number {\n const x = Math.max(0, v);\n const k = Math.min(1, Math.max(0, e));\n const c = Math.min(1, x);\n if (range === 'midtones') {\n // A gamma bend weighted to peak at mid-grey: 0 and 1 stay where they are.\n const w = Math.min(1, Math.max(0, 4 * x * (1 - x)));\n return x + w * (Math.pow(c, burn ? 1 + k : 1 / (1 + k)) - x);\n }\n // Shadows / highlights: `v + e·w·(target − v)`, weighted (1 − v)² or v², so that end moves most.\n const w = range === 'shadows' ? (1 - c) * (1 - c) : c * c;\n return burn ? x - k * w * x : x + k * w * (1 - c);\n}\n\n/** Brings RGB back into 0..1 keeping its luma (mixing towards grey) rather than clipping each channel. */\nfunction compressGamut(c: number[], l: number): void {\n const L = Math.min(1, Math.max(0, l));\n const lo = Math.min(c[0], c[1], c[2]);\n const hi = Math.max(c[0], c[1], c[2]);\n let t = 1;\n if (hi > 1 && hi - L > 1e-9) t = Math.min(t, (1 - L) / (hi - L));\n if (lo < 0 && L - lo > 1e-9) t = Math.min(t, L / (L - lo));\n for (let i = 0; i < 3; i++) c[i] = L + (c[i] - L) * t;\n}\n\n/**\n * Dodge (or burn) straight RGB `c` (0..1, written in place) at exposure `e`. With `protectTones`\n * the curve moves luma and the colour is scaled to it (hue and saturation kept); otherwise each\n * channel goes through the curve.\n */\nexport function dodgeBurn(c: number[], e: number, range: ToneRange, burn: boolean, protectTones: boolean): number[] {\n if (!(e > 0)) return c;\n if (protectTones) {\n const l = luma(c[0], c[1], c[2]);\n const nl = dodgeBurnCurve(l, e, range, burn);\n if (l > 1e-6) for (let i = 0; i < 3; i++) c[i] *= nl / l;\n else c[0] = c[1] = c[2] = nl;\n compressGamut(c, nl);\n } else for (let i = 0; i < 3; i++) c[i] = dodgeBurnCurve(c[i], e, range, burn);\n return c;\n}\n\n/** HSV saturation (chroma / max) of straight RGB. */\nexport function saturationOf(r: number, g: number, b: number): number {\n const lo = Math.min(r, g, b);\n const hi = Math.max(r, g, b);\n return hi <= 1e-6 ? 0 : Math.min(1, Math.max(0, (hi - lo) / hi));\n}\n\n/**\n * Sponge: moves straight RGB `c` (written in place) away from (`saturate`) or towards its luma\n * grey by `amount` (0..1). `vibrance` damps it where it would clip: saturating touches already\n * saturated colours less, desaturating touches near-greys less. Gamut-compressed, never clipped.\n */\nexport function sponge(c: number[], amount: number, saturate: boolean, vibrance: boolean): number[] {\n let a = Math.min(1, Math.max(0, amount));\n if (!(a > 0)) return c;\n if (vibrance) {\n const s = saturationOf(c[0], c[1], c[2]);\n a *= saturate ? 1 - s : 0.25 + 0.75 * s;\n }\n const l = luma(c[0], c[1], c[2]);\n const k = saturate ? 1 + a : 1 - a;\n for (let i = 0; i < 3; i++) c[i] = l + (c[i] - l) * k;\n compressGamut(c, l);\n return c;\n}\n\n/** Per-dab strength so that one pass over a point totals about `e`, whatever the spacing. */\nexport function perDabStrength(e: number, spacing: number): number {\n return 1 - Math.pow(1 - Math.min(1, Math.max(0, e)), Math.min(1, Math.max(0.01, spacing)));\n}\n\n// ---------------------------------------------------------------------------\n// Settings\n// ---------------------------------------------------------------------------\n\n/** Which pixels the Clone Stamp and the Healing tools sample. */\nexport type RetouchSample = 'current' | 'current-below' | 'all';\n\nexport const RETOUCH_SAMPLES: readonly RetouchSample[] = ['current', 'current-below', 'all'];\n\n/** How the Spot Healing Brush finds its source. */\nexport type SpotHealType = 'proximity-match' | 'smooth';\n\nexport const SPOT_HEAL_TYPES: readonly SpotHealType[] = ['proximity-match', 'smooth'];\n\n/** The retouching tools' options. */\nexport interface RetouchSettings {\n /** Clone / heal: keep the source offset from stroke to stroke (default true); off, every stroke starts at the source point. */\n aligned: boolean;\n /** Clone / heal / spot heal: what is sampled (default `current`: the target layer). */\n sample: RetouchSample;\n /** Spot heal: `proximity-match` (default: the best matching patch nearby) or `smooth` (a smooth fill from the edges). */\n spotType: SpotHealType;\n /** Dodge / burn: the tonal range (default `midtones`). */\n range: ToneRange;\n /** Dodge / burn: exposure 0..1 (default 0.5). */\n exposure: number;\n /** Dodge / burn: tone luma only, keeping hue and saturation (default true). */\n protectTones: boolean;\n /** Sponge: `desaturate` (default) or `saturate`. */\n spongeMode: 'desaturate' | 'saturate';\n /** Sponge: damp the change where colours would clip (default true). */\n vibrance: boolean;\n /** Smudge: how strongly the finger carries and lays paint, 0..1 (default 0.5). */\n strength: number;\n}\n\nexport const DEFAULT_RETOUCH: Readonly<RetouchSettings> = {\n aligned: true,\n sample: 'current',\n spotType: 'proximity-match',\n range: 'midtones',\n exposure: 0.5,\n protectTones: true,\n spongeMode: 'desaturate',\n vibrance: true,\n strength: 0.5,\n};\n\n/** Retouch settings with every field valid (missing or invalid fields from `base`). */\nexport function normalizeRetouch(raw: Partial<RetouchSettings> = {}, base: RetouchSettings = DEFAULT_RETOUCH): RetouchSettings {\n const unit = (v: unknown, d: number) => (typeof v === 'number' && Number.isFinite(v) ? Math.min(1, Math.max(0, v)) : d);\n const bool = (v: unknown, d: boolean) => (typeof v === 'boolean' ? v : d);\n const pick = <T extends string>(v: unknown, all: readonly T[], d: T): T => (all.includes(v as T) ? (v as T) : d);\n return {\n aligned: bool(raw.aligned, base.aligned),\n sample: pick(raw.sample, RETOUCH_SAMPLES, base.sample),\n spotType: pick(raw.spotType, SPOT_HEAL_TYPES, base.spotType),\n range: pick(raw.range, TONE_RANGES, base.range),\n exposure: unit(raw.exposure, base.exposure),\n protectTones: bool(raw.protectTones, base.protectTones),\n spongeMode: pick(raw.spongeMode, ['desaturate', 'saturate'] as const, base.spongeMode),\n vibrance: bool(raw.vibrance, base.vibrance),\n strength: unit(raw.strength, base.strength),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Pixel sources\n// ---------------------------------------------------------------------------\n\n/** Pixels a retouching stroke samples, by document pixel. */\nexport interface PixelSource {\n /** Straight RGBA 0..255 of document pixel (x, y) into `out`; false (and `out` zeroed) where there is nothing. */\n sample(x: number, y: number, out: number[]): boolean;\n}\n\n/**\n * A source over raster tiles (layer pixels, a mask, or composite tiles): `readTile` gives tile\n * (tx, ty) in source space or `null` when it is empty; source pixel = document pixel − `offset`.\n * One-channel tiles read as grey (alpha 255). Tiles are cached, so make one per stroke.\n */\nexport class TilePixelSource implements PixelSource {\n private readonly cache = new Map<number, PaintPixels | null>();\n private lastKey = NaN;\n private last: PaintPixels | null = null;\n\n constructor(\n /** A tile's bytes, or a float working tile on the same 0..255 scale (16 / 32 bits). */\n private readonly readTile: (tx: number, ty: number) => PaintPixels | null,\n readonly channels: 1 | 4,\n readonly offset: { x: number; y: number } = { x: 0, y: 0 }\n ) {}\n\n sample(x: number, y: number, out: number[]): boolean {\n const lx = x - this.offset.x;\n const ly = y - this.offset.y;\n const tx = Math.floor(lx / TILE);\n const ty = Math.floor(ly / TILE);\n const key = tileKey(tx, ty);\n if (key !== this.lastKey) {\n let t = this.cache.get(key);\n if (t === undefined) {\n t = this.readTile(tx, ty);\n this.cache.set(key, t);\n }\n this.last = t;\n this.lastKey = key;\n }\n const t = this.last;\n if (!t) {\n out[0] = out[1] = out[2] = out[3] = 0;\n return false;\n }\n const p = (ly - ty * TILE) * TILE + (lx - tx * TILE);\n if (this.channels === 1) {\n out[0] = out[1] = out[2] = t[p];\n out[3] = 255;\n return true;\n }\n const i = p * 4;\n out[0] = t[i];\n out[1] = t[i + 1];\n out[2] = t[i + 2];\n out[3] = t[i + 3];\n return out[3] > 0;\n }\n}\n\n/** A source over a region of float RGBA pixels (0..255), e.g. a healed patch. */\nexport class RegionPixelSource implements PixelSource {\n constructor(\n readonly rect: RasterRect,\n readonly data: Float32Array\n ) {}\n\n sample(x: number, y: number, out: number[]): boolean {\n const r = this.rect;\n const lx = x - r.x;\n const ly = y - r.y;\n if (lx < 0 || ly < 0 || lx >= r.width || ly >= r.height) {\n out[0] = out[1] = out[2] = out[3] = 0;\n return false;\n }\n const i = (ly * r.width + lx) * 4;\n out[0] = this.data[i];\n out[1] = this.data[i + 1];\n out[2] = this.data[i + 2];\n out[3] = this.data[i + 3];\n return out[3] > 0;\n }\n}\n\n/** `rect` of a source, shifted by (dx, dy), as float RGBA 0..255 (`rect.width × rect.height × 4`). */\nexport function readSourceRegion(source: PixelSource, rect: RasterRect, dx = 0, dy = 0): Float32Array {\n const out = new Float32Array(rect.width * rect.height * 4);\n const px = [0, 0, 0, 0];\n for (let y = 0; y < rect.height; y++) {\n for (let x = 0; x < rect.width; x++) {\n source.sample(rect.x + x + dx, rect.y + y + dy, px);\n const i = (y * rect.width + x) * 4;\n out[i] = px[0];\n out[i + 1] = px[1];\n out[i + 2] = px[2];\n out[i + 3] = px[3];\n }\n }\n return out;\n}\n\n// ---------------------------------------------------------------------------\n// Accumulate, then composite\n// ---------------------------------------------------------------------------\n\n/** What a coverage-based retouching stroke lays through its coverage. */\nexport type RetouchPaint =\n /** Source pixels at document pixel + (dx, dy) (Clone Stamp, a healed patch). */\n | { kind: 'source'; source: PixelSource; dx: number; dy: number }\n /** The target pixel itself, toned (Dodge, Burn): `tone` edits straight RGB 0..1 in place. */\n | { kind: 'tone'; tone: (rgb: number[]) => void }\n /** A flat colour (the Spot Healing Brush's trail while it is drawn), RGBA 0..255. */\n | { kind: 'color'; color: readonly [number, number, number, number] };\n\n/** How a coverage-based retouching stroke composites. */\nexport interface RetouchApply {\n /** Stroke opacity 0..1. */\n opacity: number;\n /** Blend mode for source paint (default normal). */\n blend?: BlendMode;\n lockTransparency: boolean;\n /** Selection coverage (document space, canvas-sized), or `null`. */\n selection: { width: number; height: number; data: ArrayLike<number> } | null;\n /** Layer offset (target pixels are in layer space). */\n offset: { x: number; y: number };\n}\n\n/**\n * Composites `paint` through the stroke's coverage over `tileData` (target tile (tx, ty) as it was\n * before the stroke, layer space; RGBA, or one byte per pixel for masks) and returns the new tile.\n * With `into` (the previous result) and `region` (document space), only `region` is recomputed.\n * Tone paint keeps alpha; source and colour paint composite with `blend` (source-over by\n * default), keeping alpha on a locked layer.\n */\nexport function applyRetouchToTile<T extends PaintPixels>(\n coverage: CoverageMap,\n tileData: T,\n channels: 1 | 4,\n tx: number,\n ty: number,\n paint: RetouchPaint,\n s: RetouchApply,\n options: { into?: T; region?: RasterRect } = {}\n): T {\n // A float working tile (16 / 32 bits) stays float and keeps fractions; bytes round as ever.\n const out = (options.into ?? tileData).slice() as T;\n const ox = tx * TILE + s.offset.x;\n const oy = ty * TILE + s.offset.y;\n let x0 = 0;\n let y0 = 0;\n let x1 = TILE;\n let y1 = TILE;\n if (options.region) {\n const r = options.region;\n x0 = Math.max(0, Math.floor(r.x) - ox);\n y0 = Math.max(0, Math.floor(r.y) - oy);\n x1 = Math.min(TILE, Math.ceil(r.x + r.width) - ox);\n y1 = Math.min(TILE, Math.ceil(r.y + r.height) - oy);\n if (x1 <= x0 || y1 <= y0) return out;\n if (options.into) {\n for (let y = y0; y < y1; y++) out.set(tileData.subarray((y * TILE + x0) * channels, (y * TILE + x1) * channels), (y * TILE + x0) * channels);\n }\n }\n const sel = s.selection;\n const blend = s.blend ?? 'normal';\n const src = [0, 0, 0, 0];\n const rgb = [0, 0, 0];\n const cb = [0, 0, 0, 0];\n const cs = [0, 0, 0, 0];\n // The coverage tile under the pixel, looked up once per tile it crosses.\n let covKey = NaN;\n let covTile: Float32Array | undefined;\n for (let y = y0; y < y1; y++) {\n const dy = oy + y;\n const cty = Math.floor(dy / TILE);\n for (let x = x0; x < x1; x++) {\n const dx = ox + x;\n const ctx = Math.floor(dx / TILE);\n const key = tileKey(ctx, cty);\n if (key !== covKey) {\n covKey = key;\n covTile = coverage.tiles.get(key);\n }\n if (!covTile) continue;\n const c = covTile[(dy - cty * TILE) * TILE + (dx - ctx * TILE)];\n if (c <= 0) continue;\n let k = c * s.opacity;\n if (sel) {\n if (dx < 0 || dy < 0 || dx >= sel.width || dy >= sel.height) continue;\n k *= sel.data[dy * sel.width + dx] / 255;\n }\n if (k > 1) k = 1;\n if (k <= 0) continue;\n const p = y * TILE + x;\n if (channels === 1) {\n // Masks: grey values; the source's grey is its red channel.\n const g = out[p];\n let t: number;\n if (paint.kind === 'tone') {\n rgb[0] = rgb[1] = rgb[2] = g / 255;\n paint.tone(rgb);\n t = luma(rgb[0], rgb[1], rgb[2]) * 255;\n } else if (paint.kind === 'color') t = paint.color[0];\n else {\n if (!paint.source.sample(dx + paint.dx, dy + paint.dy, src)) continue;\n t = src[0];\n k *= src[3] / 255;\n }\n out[p] = Math.round(g + (t - g) * k);\n continue;\n }\n const i = p * 4;\n const a = out[i + 3];\n if (paint.kind === 'tone') {\n if (a === 0) continue;\n rgb[0] = out[i] / 255;\n rgb[1] = out[i + 1] / 255;\n rgb[2] = out[i + 2] / 255;\n const r0 = rgb[0];\n const g0 = rgb[1];\n const b0 = rgb[2];\n paint.tone(rgb);\n put255(out, i, r0 + (rgb[0] - r0) * k);\n put255(out, i + 1, g0 + (rgb[1] - g0) * k);\n put255(out, i + 2, b0 + (rgb[2] - b0) * k);\n continue;\n }\n if (s.lockTransparency && a === 0) continue;\n if (paint.kind === 'color') {\n src[0] = paint.color[0];\n src[1] = paint.color[1];\n src[2] = paint.color[2];\n src[3] = paint.color[3];\n } else if (!paint.source.sample(dx + paint.dx, dy + paint.dy, src)) continue;\n for (let ch = 0; ch < 4; ch++) {\n cb[ch] = out[i + ch] / 255;\n cs[ch] = src[ch] / 255;\n }\n // Source-over, as a brush lays paint: cloning transparency paints nothing.\n const o = blendPixel(blend, cb, cs, k);\n put255(out, i, o[0]);\n put255(out, i + 1, o[1]);\n put255(out, i + 2, o[2]);\n if (!s.lockTransparency) put255(out, i + 3, o[3]);\n }\n }\n return out;\n}\n\n/**\n * Dodge / Burn at 16 or 32 bits: `applyRetouchToTile`'s tone paint on a layer tile's deep samples\n * (`Uint16Array` sRGB-encoded, or `Float32Array` linear light, RGBA). The tone curves work on\n * encoded values as at 8 bits, so 32-bit samples are encoded, toned and decoded (colour above 1 is\n * toned at 1 and keeps its excess). Returns the new samples.\n */\nexport function applyToneToDeepTile(\n coverage: CoverageMap,\n samples: Uint16Array | Float32Array,\n tx: number,\n ty: number,\n tone: (rgb: number[]) => void,\n s: RetouchApply,\n options: { into?: Uint16Array | Float32Array; region?: RasterRect } = {}\n): Uint16Array | Float32Array {\n const linear = samples instanceof Float32Array;\n const out = (options.into ?? samples).slice() as Uint16Array | Float32Array;\n const ox = tx * TILE + s.offset.x;\n const oy = ty * TILE + s.offset.y;\n let x0 = 0;\n let y0 = 0;\n let x1 = TILE;\n let y1 = TILE;\n if (options.region) {\n const r = options.region;\n x0 = Math.max(0, Math.floor(r.x) - ox);\n y0 = Math.max(0, Math.floor(r.y) - oy);\n x1 = Math.min(TILE, Math.ceil(r.x + r.width) - ox);\n y1 = Math.min(TILE, Math.ceil(r.y + r.height) - oy);\n if (x1 <= x0 || y1 <= y0) return out;\n if (options.into) for (let y = y0; y < y1; y++) out.set(samples.subarray((y * TILE + x0) * 4, (y * TILE + x1) * 4), (y * TILE + x0) * 4);\n }\n const sel = s.selection;\n const rgb = [0, 0, 0];\n const before = [0, 0, 0];\n const excess = [0, 0, 0];\n let covKey = NaN;\n let covTile: Float32Array | undefined;\n for (let y = y0; y < y1; y++) {\n const dy = oy + y;\n const cty = Math.floor(dy / TILE);\n for (let x = x0; x < x1; x++) {\n const dx = ox + x;\n const ctx = Math.floor(dx / TILE);\n const key = tileKey(ctx, cty);\n if (key !== covKey) {\n covKey = key;\n covTile = coverage.tiles.get(key);\n }\n if (!covTile) continue;\n const c = covTile[(dy - cty * TILE) * TILE + (dx - ctx * TILE)];\n if (c <= 0) continue;\n let k = c * s.opacity;\n if (sel) {\n if (dx < 0 || dy < 0 || dx >= sel.width || dy >= sel.height) continue;\n k *= sel.data[dy * sel.width + dx] / 255;\n }\n if (k > 1) k = 1;\n if (k <= 0) continue;\n const i = (y * TILE + x) * 4;\n if (out[i + 3] === 0) continue;\n for (let ch = 0; ch < 3; ch++) {\n const v = out[i + ch];\n if (linear) {\n excess[ch] = v > 1 ? v - 1 : 0;\n rgb[ch] = srgbEncode(v > 1 ? 1 : v < 0 ? 0 : v);\n } else rgb[ch] = v / 65535;\n before[ch] = rgb[ch];\n }\n tone(rgb);\n for (let ch = 0; ch < 3; ch++) {\n const e = before[ch] + (rgb[ch] - before[ch]) * k;\n if (linear) out[i + ch] = srgbDecode(e) + excess[ch];\n else out[i + ch] = e <= 0 ? 0 : e >= 1 ? 65535 : Math.round(e * 65535);\n }\n }\n }\n return out;\n}\n\n/** The tone function of a Dodge or Burn stroke. */\nexport function toneOf(tool: 'dodge' | 'burn', settings: Pick<RetouchSettings, 'exposure' | 'range' | 'protectTones'>): (rgb: number[]) => void {\n const burn = tool === 'burn';\n return (rgb) => {\n dodgeBurn(rgb, settings.exposure, settings.range, burn, settings.protectTones);\n };\n}\n\n// ---------------------------------------------------------------------------\n// Healing\n// ---------------------------------------------------------------------------\n\n/**\n * Heals `src` into `dst` over `mask` (all `w × h`, RGBA floats 0..255): a seamless clone solved\n * only over the mask's bounds plus a one-pixel fixed ring; elsewhere the result is `dst`.\n */\nexport function healPixels(w: number, h: number, src: Float32Array, dst: Float32Array, mask: ArrayLike<boolean | number>): Float32Array {\n const out = new Float32Array(dst);\n const bb = maskBounds(w, h, mask);\n if (!bb) return out;\n const x0 = Math.max(0, bb[0] - 1);\n const y0 = Math.max(0, bb[1] - 1);\n const x1 = Math.min(w, bb[2] + 1);\n const y1 = Math.min(h, bb[3] + 1);\n const rw = x1 - x0;\n const rh = y1 - y0;\n const s = new Float32Array(rw * rh * 4);\n const d = new Float32Array(rw * rh * 4);\n const m = new Uint8Array(rw * rh);\n for (let y = 0; y < rh; y++) {\n for (let x = 0; x < rw; x++) {\n const gi = (y + y0) * w + x + x0;\n const li = y * rw + x;\n m[li] = mask[gi] ? 1 : 0;\n for (let c = 0; c < 4; c++) {\n s[li * 4 + c] = src[gi * 4 + c];\n d[li * 4 + c] = dst[gi * 4 + c];\n }\n }\n }\n const healed = seamlessClone(rw, rh, 4, s, d, m);\n for (let y = 0; y < rh; y++) {\n for (let x = 0; x < rw; x++) {\n const gi = ((y + y0) * w + x + x0) * 4;\n const li = (y * rw + x) * 4;\n for (let c = 0; c < 4; c++) out[gi + c] = Math.min(255, Math.max(0, healed[li + c]));\n }\n }\n return out;\n}\n\n/**\n * Spot healing: fills `hole` (`w × h`) of `img` (RGBA floats 0..255) with no given source, then\n * heals the fill into its surroundings. `proximity-match` copies the best matching nearby patch\n * (falling back to `smooth` when none fits); `smooth` interpolates the edges inwards. `size` is\n * the brush diameter in pixels. Returns the healed pixels over the whole grid.\n */\nexport function spotHealPixels(\n w: number,\n h: number,\n img: Float32Array,\n hole: ArrayLike<boolean | number>,\n size: number,\n type: SpotHealType,\n /** Told the patch offset it copied (`null`: a smooth fill). */\n onOffset?: (offset: [number, number] | null) => void\n): Float32Array {\n // Fill a slightly larger domain than the healed area, so the solve's boundary sees filled values\n // that differ from the untouched pixels: that mismatch is what the membrane corrects.\n const domain = dilateMask(w, h, hole, 2);\n const healMask = dilateMask(w, h, hole, 1);\n let filled: Float32Array | null = null;\n let bestFound: [number, number] | null = null;\n if (type === 'proximity-match') {\n const ring = Math.min(16, Math.max(3, Math.floor(size / 8)));\n const off = bestOffset(w, h, 4, img, domain, ring, Math.floor(Math.max(w, h) / 2));\n if (off) {\n bestFound = off;\n // Copy from the pre-healing pixels, never from what this loop already wrote.\n filled = new Float32Array(img);\n const [ddx, ddy] = off;\n for (let i = 0; i < w * h; i++) {\n if (!domain[i]) continue;\n const x = (i % w) + ddx;\n const y = Math.floor(i / w) + ddy;\n const j = (y * w + x) * 4;\n for (let c = 0; c < 4; c++) filled[i * 4 + c] = img[j + c];\n }\n }\n }\n onOffset?.(filled ? (bestFound as [number, number]) : null);\n if (!filled) filled = membraneFill(w, h, 4, img, domain);\n return healPixels(w, h, filled, img, healMask);\n}\n\n/** The window a Spot Healing stroke over `bounds` looks for texture in: the bounds grown by their size, on the canvas. */\nexport function spotHealWindow(bounds: RasterRect, canvas: { width: number; height: number }): RasterRect {\n const g = Math.max(8, Math.ceil(Math.max(bounds.width, bounds.height)));\n const x0 = Math.max(0, bounds.x - g);\n const y0 = Math.max(0, bounds.y - g);\n const x1 = Math.min(canvas.width, bounds.x + bounds.width + g);\n const y1 = Math.min(canvas.height, bounds.y + bounds.height + g);\n return { x: x0, y: y0, width: Math.max(0, x1 - x0), height: Math.max(0, y1 - y0) };\n}\n\n// ---------------------------------------------------------------------------\n// Sequential dabs\n// ---------------------------------------------------------------------------\n\n/**\n * One dab of a sequential retouching stroke: `cov` is the tip's pure coverage over `rect`\n * (document space, 0..1); `d.alpha` is the flow and `d.opacity` the pressure opacity.\n */\nexport type RetouchDabEffect = (medium: TileMedium, d: Dab, rect: RasterRect, cov: Float32Array) => void;\n\n/**\n * A stroke whose dabs edit live tiles in order (Smudge, Sponge). Feed points with `push` (any\n * chunks give the same dabs), end with `finish`; each returns the document rectangles it touched.\n */\nexport class RetouchDabStroke {\n dabCount = 0;\n bounds: RasterRect | null = null;\n private readonly walker: DabWalker;\n private readonly medium: TileMedium;\n private smoothPos: StrokePoint | null = null;\n private buf = new Float32Array(0);\n\n constructor(\n readonly brush: BrushSettings,\n target: PaintTileTarget,\n private readonly effect: RetouchDabEffect\n ) {\n this.walker = new DabWalker(brush);\n this.medium = new TileMedium(target);\n }\n\n push(points: readonly StrokePoint[]): RasterRect[] {\n const dabs: Dab[] = [];\n for (const p of points) this.walker.push(this.smooth(p), dabs);\n return this.paint(dabs);\n }\n\n finish(last?: StrokePoint): RasterRect[] {\n const dabs: Dab[] = [];\n if (last && this.smoothPos && (this.smoothPos.x !== last.x || this.smoothPos.y !== last.y)) this.walker.push(last, dabs);\n this.walker.finish(dabs);\n return this.paint(dabs);\n }\n\n private smooth(p: StrokePoint): StrokePoint {\n const a = 1 - Math.min(0.95, Math.max(0, this.brush.smoothing));\n const cur = this.smoothPos;\n const n = cur && a < 1 ? { ...p, x: cur.x + (p.x - cur.x) * a, y: cur.y + (p.y - cur.y) * a } : p;\n this.smoothPos = n;\n return n;\n }\n\n private paint(dabs: Dab[]): RasterRect[] {\n const rects: RasterRect[] = [];\n for (const d of dabs) {\n const rect = dabRect(d, this.brush.hardness);\n const n = rect.width * rect.height;\n if (this.buf.length < n) this.buf = new Float32Array(n);\n const cov = this.buf.subarray(0, n);\n rasterizeDab({ ...d, alpha: 1 }, this.brush.hardness, rect, cov);\n this.medium.reset();\n this.effect(this.medium, d, rect, cov);\n rects.push(rect);\n this.bounds = unionRect(this.bounds, rect);\n this.dabCount++;\n }\n return rects;\n }\n}\n\n/** The Smudge's per-dab effect: a `SmudgeTip` whose strength carries and lays the paint. */\nexport function smudgeEffect(brush: BrushSettings, strength: number, mixing: SmudgeSettings['mixing'] = 'rgb'): RetouchDabEffect {\n const s = Math.min(1, Math.max(0, strength));\n const tip = new SmudgeTip({ strength: s, length: s, mixing }, brush.size);\n return (medium, d, rect, cov) => tip.dab(medium, { x: d.x, y: d.y, radius: d.radius, opacity: d.opacity * d.alpha }, rect, cov);\n}\n\n/** The Sponge's per-dab effect: each dab moves saturation by about half its flow, compounding over passes. */\nexport function spongeEffect(brush: BrushSettings, saturate: boolean, vibrance: boolean): RetouchDabEffect {\n const rgb = [0, 0, 0];\n return (medium, d, rect, cov) => {\n const w = rect.width;\n for (let yy = 0; yy < rect.height; yy++) {\n for (let xx = 0; xx < w; xx++) {\n const cv = cov[yy * w + xx];\n if (cv <= 0) continue;\n const dx = rect.x + xx;\n const dy = rect.y + yy;\n const k = perDabStrength(cv * d.alpha * d.opacity * 0.5, brush.spacing) * medium.selectionAt(dx, dy);\n if (k <= 0) continue;\n const ri = medium.locate(dx, dy, false);\n if (ri < 0 || medium.pixels[ri + 3] === 0) continue;\n const i = medium.locate(dx, dy, true);\n const px = medium.pixels;\n rgb[0] = px[i] / 255;\n rgb[1] = px[i + 1] / 255;\n rgb[2] = px[i + 2] / 255;\n sponge(rgb, k, saturate, vibrance);\n put255(px, i, rgb[0]);\n put255(px, i + 1, rgb[1]);\n put255(px, i + 2, rgb[2]);\n }\n }\n };\n}\n\n/**\n * An RGBA view of one-channel tiles (masks), for the sequential-dab tools: reads expand grey to\n * opaque RGB, writes land in RGBA copies, and `flush` writes their red channel back through\n * `target.writeTile`. Alpha is locked, so a mask's values are all a dab changes.\n */\nexport function rgbaViewOfGrey(target: PaintTileTarget): { target: PaintTileTarget; flush(): void } {\n const views = new Map<number, Uint8ClampedArray>();\n const dirty = new Map<number, { tx: number; ty: number; data: Uint8ClampedArray }>();\n const expand = (g: Uint8ClampedArray) => {\n const out = new Uint8ClampedArray(g.length * 4);\n for (let i = 0; i < g.length; i++) {\n out[i * 4] = out[i * 4 + 1] = out[i * 4 + 2] = g[i];\n out[i * 4 + 3] = 255;\n }\n return out;\n };\n const view: PaintTileTarget = {\n offset: target.offset,\n lockTransparency: true,\n selection: target.selection,\n readTile: (tx, ty) => {\n const key = tileKey(tx, ty);\n let v = views.get(key);\n if (!v) {\n // An empty mask tile is still values (0), not transparency: always give a tile.\n v = expand((target.readTile(tx, ty) as Uint8ClampedArray | null) ?? new Uint8ClampedArray(TILE * TILE));\n views.set(key, v);\n }\n return v;\n },\n writeTile: (tx, ty) => {\n const key = tileKey(tx, ty);\n let v = views.get(key);\n if (!v) {\n v = expand((target.readTile(tx, ty) as Uint8ClampedArray | null) ?? new Uint8ClampedArray(TILE * TILE));\n views.set(key, v);\n }\n dirty.set(key, { tx, ty, data: v });\n return v;\n },\n };\n return {\n target: view,\n flush: () => {\n for (const { tx, ty, data } of dirty.values()) {\n const g = target.writeTile(tx, ty);\n for (let i = 0; i < g.length; i++) g[i] = data[i * 4];\n }\n dirty.clear();\n },\n };\n}\n\nfunction unionRect(a: RasterRect | null, b: RasterRect): RasterRect {\n if (!a) return { ...b };\n const x = Math.min(a.x, b.x);\n const y = Math.min(a.y, b.y);\n return { x, y, width: Math.max(a.x + a.width, b.x + b.width) - x, height: Math.max(a.y + a.height, b.y + b.height) - y };\n}\n","/**\n * A brush stroke along a path: polyline samples, each with an optional pressure and pen tilt, are\n * walked at the brush's spacing (pressure and tilt interpolated between samples) into dabs, built\n * up in a coverage map and composited onto a layer. This is what a vector editor calls to draw a\n * path with a natural-media brush (\"brushstrokes on vector paths\"): the path is the data, the\n * pixels are rendered from it.\n *\n * - Pressure scales size and / or opacity as the brush says.\n * - Tilt (`tiltX` / `tiltY` in degrees, or `altitude` / `azimuth` in radians, as Pointer Events give\n * them) widens the tip (`tilt.size`), flattens it along the lean (`tilt.roundness`), and with\n * `tilt.followAzimuth` turns the tip to the lean, as a pen laid on its side does.\n * - With `followPath` the tip turns with the path (a calligraphic nib along a curve).\n *\n * Deterministic and DOM-free: the same samples and brush give the same pixels everywhere.\n */\n\nimport { applyStrokeToTile, CoverageMap, dabRect, normalizeBrush, rasterizeDab, type BrushSettings, type Dab } from './brush';\nimport { TiledSurface, finishTile, tileKey, tilesInRect, TILE, type RasterRect } from '../raster/surface';\nimport type { BlendMode } from '../raster/blend';\n\n/** One sample of the path (document pixels). */\nexport interface PathSample {\n x: number;\n y: number;\n /** 0..1 (default 1). */\n pressure?: number;\n /** Pointer Events tilt in degrees (−90..90). */\n tiltX?: number;\n tiltY?: number;\n /** Radians above the surface (π/2 upright); overrides tiltX / tiltY. */\n altitude?: number;\n /** Radians clockwise from +x: where the pen leans (with altitude). */\n azimuth?: number;\n}\n\nexport interface PathStrokeOptions {\n brush: Partial<BrushSettings>;\n /** How tilt shapes the tip (each 0..1; default none). */\n tilt?: { size?: number; roundness?: number; followAzimuth?: boolean };\n /** Turn the tip with the direction of the path (added to the brush angle). */\n followPath?: boolean;\n /** Size at zero pressure as a fraction of the full size, when pressure controls size (default 0). */\n minSize?: number;\n /** Join the last sample back to the first. */\n closed?: boolean;\n}\n\n/** A pen's lean from a sample: 0 upright .. 1 flat, and the direction it leans (radians, clockwise from +x). */\nfunction lean(s: PathSample): { amount: number; azimuth: number } | null {\n if (typeof s.altitude === 'number' && Number.isFinite(s.altitude)) {\n return { amount: 1 - Math.min(1, Math.max(0, s.altitude / (Math.PI / 2))), azimuth: s.azimuth ?? 0 };\n }\n if (typeof s.tiltX === 'number' || typeof s.tiltY === 'number') {\n const tx = ((s.tiltX ?? 0) * Math.PI) / 180;\n const ty = ((s.tiltY ?? 0) * Math.PI) / 180;\n if (tx === 0 && ty === 0) return { amount: 0, azimuth: 0 };\n const az = Math.atan2(Math.tan(ty), Math.tan(tx));\n const alt = Math.atan(1 / Math.hypot(Math.tan(tx), Math.tan(ty)));\n return { amount: 1 - alt / (Math.PI / 2), azimuth: az };\n }\n return null;\n}\n\n/** The dabs of a brush stroke along `samples`, with pressure and tilt interpolated between them. */\nexport function pathStrokeDabs(samples: readonly PathSample[], options: PathStrokeOptions): Dab[] {\n const brush = normalizeBrush(options.brush);\n const pts = options.closed && samples.length > 2 ? [...samples, samples[0]] : [...samples];\n if (!pts.length) return [];\n const tilt = options.tilt ?? {};\n const minSize = Math.min(1, Math.max(0, options.minSize ?? 0));\n const dab = (x: number, y: number, p: number, l: { amount: number; azimuth: number } | null, dir: number): Dab => {\n const pr = Math.min(1, Math.max(0, p));\n const lean0 = l?.amount ?? 0;\n const size = brush.size * (brush.pressureSize ? minSize + (1 - minSize) * pr : 1) * (1 + 1.5 * (tilt.size ?? 0) * lean0);\n let angle = (brush.angle * Math.PI) / 180;\n if (options.followPath) angle += dir;\n if (tilt.followAzimuth && l) angle = -l.azimuth;\n const roundness = Math.max(0.05, brush.roundness * (1 - 0.85 * (tilt.roundness ?? 0) * lean0));\n const op = brush.pressureOpacity ? pr : 1;\n return { x, y, radius: Math.max(0.5, size / 2), alpha: brush.flow, opacity: brush.opacity * op, angle, roundness };\n };\n const out: Dab[] = [];\n const pressure = (s: PathSample) => (typeof s.pressure === 'number' && Number.isFinite(s.pressure) ? s.pressure : 1);\n if (pts.length === 1) {\n out.push(dab(pts[0].x, pts[0].y, pressure(pts[0]), lean(pts[0]), 0));\n return out;\n }\n let carry = 0;\n out.push(dab(pts[0].x, pts[0].y, pressure(pts[0]), lean(pts[0]), Math.atan2(-(pts[1].y - pts[0].y), pts[1].x - pts[0].x)));\n for (let i = 0; i + 1 < pts.length; i++) {\n const a = pts[i];\n const b = pts[i + 1];\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n const len = Math.hypot(dx, dy);\n if (len === 0) continue;\n // Dab angles are counter-clockwise with y up, as the shared rasterizer reads them.\n const dir = Math.atan2(-dy, dx);\n const la = lean(a);\n const lb = lean(b);\n let t = carry;\n for (;;) {\n const f = t / len;\n if (f > 1) break;\n const p = pressure(a) + (pressure(b) - pressure(a)) * f;\n const l = la && lb ? { amount: la.amount + (lb.amount - la.amount) * f, azimuth: la.azimuth + (lb.azimuth - la.azimuth) * f } : (la ?? lb);\n const size = brush.size * (brush.pressureSize ? minSize + (1 - minSize) * p : 1);\n const step = Math.max(0.5, size * brush.spacing);\n if (t > 0 || i > 0) out.push(dab(a.x + dx * f, a.y + dy * f, p, l, dir));\n t += step;\n }\n carry = t - len;\n }\n return out;\n}\n\n/** The coverage of a brush stroke along `samples` (build-up towards each dab's opacity) and its bounds. */\nexport function pathStrokeCoverage(samples: readonly PathSample[], options: PathStrokeOptions): { coverage: CoverageMap; bounds: RasterRect | null; dabs: number } {\n const brush = normalizeBrush(options.brush);\n const coverage = new CoverageMap();\n const dabs = pathStrokeDabs(samples, options);\n let buf = new Float32Array(0);\n let bounds: RasterRect | null = null;\n for (const d of dabs) {\n const rect = dabRect(d, brush.hardness);\n const n = rect.width * rect.height;\n if (n <= 0) continue;\n if (buf.length < n) buf = new Float32Array(n);\n const vals = buf.subarray(0, n);\n rasterizeDab(d, brush.hardness, rect, vals);\n coverage.accumulate(rect, vals, d.opacity);\n if (!bounds) bounds = { ...rect };\n else {\n const x = Math.min(bounds.x, rect.x);\n const y = Math.min(bounds.y, rect.y);\n bounds = { x, y, width: Math.max(bounds.x + bounds.width, rect.x + rect.width) - x, height: Math.max(bounds.y + bounds.height, rect.y + rect.height) - y };\n }\n }\n return { coverage, bounds, dabs: dabs.length };\n}\n\nexport interface PaintPathOptions extends PathStrokeOptions {\n /** RGBA 0..255 of the paint. */\n color: readonly [number, number, number, number];\n /** `erase` removes paint instead (default `paint`). */\n mode?: 'paint' | 'erase';\n /** Blend mode (default the brush's). */\n blend?: BlendMode;\n /** Layer offset: layer pixel = document pixel − offset (default 0, 0). */\n offset?: { x: number; y: number };\n lockTransparency?: boolean;\n /** Where paint may land (canvas-sized coverage 0..255), or none. */\n selection?: { width: number; height: number; data: ArrayLike<number> } | null;\n}\n\n/**\n * Paints a brush stroke along `samples` onto an RGBA layer surface and returns the new surface\n * (the input is not changed; untouched tiles are shared) with the bounds it touched.\n */\nexport function paintPathStroke(surface: TiledSurface, samples: readonly PathSample[], options: PaintPathOptions): { surface: TiledSurface; bounds: RasterRect | null; dabs: number } {\n if (surface.channels !== 4) throw new Error('paintPathStroke paints RGBA surfaces (4 channels).');\n const brush = normalizeBrush(options.brush);\n const { coverage, bounds, dabs } = pathStrokeCoverage(samples, options);\n if (!bounds) return { surface, bounds: null, dabs };\n const offset = options.offset ?? { x: 0, y: 0 };\n const apply = {\n mode: options.mode ?? 'paint',\n color: options.color,\n background: [0, 0, 0, 0] as const,\n opacity: brush.opacity,\n blend: options.blend ?? brush.blend,\n lockTransparency: options.lockTransparency ?? false,\n selection: options.selection ?? null,\n offset,\n };\n const tiles = new Map(surface.tiles);\n for (const { tx, ty } of tilesInRect({ x: bounds.x - offset.x, y: bounds.y - offset.y, width: bounds.width, height: bounds.height })) {\n const key = tileKey(tx, ty);\n const src = surface.tiles.get(key)?.data;\n const base = src && src.length === TILE * TILE * 4 ? src : new Uint8ClampedArray(TILE * TILE * 4);\n const t = finishTile(applyStrokeToTile(coverage, base, 4, tx, ty, apply), 4, surface.defaultValue);\n if (t) tiles.set(key, t);\n else tiles.delete(key);\n }\n return { surface: new TiledSurface(4, tiles, surface.defaultValue), bounds, dabs };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAM,MAAM;AAEZ,IAAM,aAAa;AACnB,IAAM,aAAa;AAOZ,SAAS,cAAc,GAAW,GAAW,SAAsC,GAAuB;AAC/G,MAAI,QAAQ,WAAW,IAAI,KAAK,EAAE,WAAW,IAAI,EAAG,OAAM,IAAI,WAAW,2BAA2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AI,MAAM,IAAI,kBAAkB,OAAO,OAAO,CAAC;AAChG,UAAM,IAAI,WAAW,kBAAkB,UAAU,MAAM,GAAG,IAAI,IAAI,KAAK,GAAG,GAAG,QAAQ,YAAY;AACjG,QAAI,EAAG,OAAM,IAAI,KAAK,CAAC;AAAA,QAClB,OAAM,OAAO,GAAG;AAAA,EACvB;AACA,SAAO,EAAE,SAAS,IAAI,aAAa,GAAG,OAAO,QAAQ,YAAY,GAAG,QAAQ,KAAK;AACnF;","names":["w","t"]}
|
|
@@ -4,8 +4,8 @@ import { b as BuiltinProfileId, j as Intent, P as Profile, T as Transform, d as
|
|
|
4
4
|
import { A as AffineMatrix, Q as Quad, a as WarpMesh, V as Vec2$1, H as Homography } from './types-CwMPoRMU.cjs';
|
|
5
5
|
import { B as BezierPath } from './bezier-BfwIbVTl.cjs';
|
|
6
6
|
import { b as TextRun, P as ParagraphRun, T as TextShaper, c as ParagraphStyle, d as TextStyle, L as LaidFragment, W as WarpPreset, e as TextLayout } from './warp-B39VsOtd.cjs';
|
|
7
|
-
import { w as VectorSubpath, o as Vec2 } from './types-
|
|
8
|
-
import { B as BrushSettings, M as MixerSettings, a as MixerLoad, R as RetouchSettings, S as StrokeCoverage, b as MixerTarget, c as MixerStroke, d as RetouchApply, e as StrokePoint, f as RetouchPaint, C as CoverageMap, P as PaintTileTarget, g as StrokeApply } from './flow-
|
|
7
|
+
import { w as VectorSubpath, o as Vec2 } from './types-Dq-8qgoo.cjs';
|
|
8
|
+
import { B as BrushSettings, M as MixerSettings, a as MixerLoad, R as RetouchSettings, S as StrokeCoverage, b as MixerTarget, c as MixerStroke, d as RetouchApply, e as StrokePoint, f as RetouchPaint, C as CoverageMap, P as PaintTileTarget, g as StrokeApply } from './flow-A2Dj-69w.cjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* A selection: one 8-bit coverage value per image pixel (0 = not selected, 255 = fully
|
|
@@ -750,6 +750,8 @@ interface SerializedRasterMask {
|
|
|
750
750
|
/** `false`: unlinked from the layer's pixels. */
|
|
751
751
|
linked?: boolean;
|
|
752
752
|
source?: DepthMaskOptions;
|
|
753
|
+
/** 16- or 32-bit coverage (one sample per pixel; the PNG asset is its 8-bit rendering). */
|
|
754
|
+
deep?: SerializedDeepPixels;
|
|
753
755
|
}
|
|
754
756
|
interface SerializedLayerBase {
|
|
755
757
|
id: string;
|
|
@@ -790,8 +792,9 @@ interface SerializedPixelLayer extends SerializedLayerBase {
|
|
|
790
792
|
deep?: SerializedDeepPixels;
|
|
791
793
|
}
|
|
792
794
|
/**
|
|
793
|
-
* High bit depth pixels: `width × height` interleaved RGBA samples at (`x`, `y`) in layer space
|
|
794
|
-
* little-endian (`Uint16` for 16-bit, `Float32`
|
|
795
|
+
* High bit depth pixels: `width × height` interleaved RGBA samples at (`x`, `y`) in layer space
|
|
796
|
+
* (one coverage sample per pixel for a mask), little-endian (`Uint16` for 16-bit, `Float32`
|
|
797
|
+
* linear light for 32-bit; coverage 0..1 for a mask), deflated and base64.
|
|
795
798
|
*/
|
|
796
799
|
interface SerializedDeepPixels {
|
|
797
800
|
depth: 16 | 32;
|
|
@@ -2740,6 +2743,13 @@ declare class PaintStrokeSession {
|
|
|
2740
2743
|
/** Brush and eraser strokes on a 16- or 32-bit document: the deep samples of each touched tile. */
|
|
2741
2744
|
private readonly deep;
|
|
2742
2745
|
private readonly liveDeep;
|
|
2746
|
+
/**
|
|
2747
|
+
* Mixer Brush, Smudge and Sponge on a 16- or 32-bit layer: they read and write float working
|
|
2748
|
+
* tiles on the 8-bit 0..255 sRGB-encoded scale, which keep the fractions bytes would round away.
|
|
2749
|
+
*/
|
|
2750
|
+
private readonly dabDeep;
|
|
2751
|
+
private readonly work;
|
|
2752
|
+
private readonly workRead;
|
|
2743
2753
|
constructor(controller: ImageEditorController, target: {
|
|
2744
2754
|
id: string;
|
|
2745
2755
|
channel: LayerTarget;
|
|
@@ -2747,6 +2757,10 @@ declare class PaintStrokeSession {
|
|
|
2747
2757
|
}, stroke: StrokeCoverage | MixerStrokeInit | RetouchStrokeInit, apply: StrokeApply,
|
|
2748
2758
|
/** Composite brush / eraser strokes at this bit depth (layers only); `null` for 8 bits. */
|
|
2749
2759
|
depth?: 16 | 32 | null);
|
|
2760
|
+
/** The pre-stroke tile as a float working tile (cached; `null`: transparent). */
|
|
2761
|
+
private readWork;
|
|
2762
|
+
/** Clone, healing and the spot-heal trail at depth: `paint` through the coverage on the float working tile. */
|
|
2763
|
+
private retouchDeepTile;
|
|
2750
2764
|
/** The new tile of a coverage stroke over the pre-stroke tile `src`. */
|
|
2751
2765
|
private compositeTile;
|
|
2752
2766
|
/** The live pixels a mixer stroke reads and writes; base tiles are copied on first write. */
|
|
@@ -4,8 +4,8 @@ import { b as BuiltinProfileId, j as Intent, P as Profile, T as Transform, d as
|
|
|
4
4
|
import { A as AffineMatrix, Q as Quad, a as WarpMesh, V as Vec2$1, H as Homography } from './types-CwMPoRMU.js';
|
|
5
5
|
import { B as BezierPath } from './bezier-DYBvLgUH.js';
|
|
6
6
|
import { b as TextRun, P as ParagraphRun, T as TextShaper, c as ParagraphStyle, d as TextStyle, L as LaidFragment, W as WarpPreset, e as TextLayout } from './warp-DMN30aY6.js';
|
|
7
|
-
import { w as VectorSubpath, o as Vec2 } from './types-
|
|
8
|
-
import { B as BrushSettings, M as MixerSettings, a as MixerLoad, R as RetouchSettings, S as StrokeCoverage, b as MixerTarget, c as MixerStroke, d as RetouchApply, e as StrokePoint, f as RetouchPaint, C as CoverageMap, P as PaintTileTarget, g as StrokeApply } from './flow-
|
|
7
|
+
import { w as VectorSubpath, o as Vec2 } from './types-TrSSh_RB.js';
|
|
8
|
+
import { B as BrushSettings, M as MixerSettings, a as MixerLoad, R as RetouchSettings, S as StrokeCoverage, b as MixerTarget, c as MixerStroke, d as RetouchApply, e as StrokePoint, f as RetouchPaint, C as CoverageMap, P as PaintTileTarget, g as StrokeApply } from './flow-C95atNoQ.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* A selection: one 8-bit coverage value per image pixel (0 = not selected, 255 = fully
|
|
@@ -750,6 +750,8 @@ interface SerializedRasterMask {
|
|
|
750
750
|
/** `false`: unlinked from the layer's pixels. */
|
|
751
751
|
linked?: boolean;
|
|
752
752
|
source?: DepthMaskOptions;
|
|
753
|
+
/** 16- or 32-bit coverage (one sample per pixel; the PNG asset is its 8-bit rendering). */
|
|
754
|
+
deep?: SerializedDeepPixels;
|
|
753
755
|
}
|
|
754
756
|
interface SerializedLayerBase {
|
|
755
757
|
id: string;
|
|
@@ -790,8 +792,9 @@ interface SerializedPixelLayer extends SerializedLayerBase {
|
|
|
790
792
|
deep?: SerializedDeepPixels;
|
|
791
793
|
}
|
|
792
794
|
/**
|
|
793
|
-
* High bit depth pixels: `width × height` interleaved RGBA samples at (`x`, `y`) in layer space
|
|
794
|
-
* little-endian (`Uint16` for 16-bit, `Float32`
|
|
795
|
+
* High bit depth pixels: `width × height` interleaved RGBA samples at (`x`, `y`) in layer space
|
|
796
|
+
* (one coverage sample per pixel for a mask), little-endian (`Uint16` for 16-bit, `Float32`
|
|
797
|
+
* linear light for 32-bit; coverage 0..1 for a mask), deflated and base64.
|
|
795
798
|
*/
|
|
796
799
|
interface SerializedDeepPixels {
|
|
797
800
|
depth: 16 | 32;
|
|
@@ -2740,6 +2743,13 @@ declare class PaintStrokeSession {
|
|
|
2740
2743
|
/** Brush and eraser strokes on a 16- or 32-bit document: the deep samples of each touched tile. */
|
|
2741
2744
|
private readonly deep;
|
|
2742
2745
|
private readonly liveDeep;
|
|
2746
|
+
/**
|
|
2747
|
+
* Mixer Brush, Smudge and Sponge on a 16- or 32-bit layer: they read and write float working
|
|
2748
|
+
* tiles on the 8-bit 0..255 sRGB-encoded scale, which keep the fractions bytes would round away.
|
|
2749
|
+
*/
|
|
2750
|
+
private readonly dabDeep;
|
|
2751
|
+
private readonly work;
|
|
2752
|
+
private readonly workRead;
|
|
2743
2753
|
constructor(controller: ImageEditorController, target: {
|
|
2744
2754
|
id: string;
|
|
2745
2755
|
channel: LayerTarget;
|
|
@@ -2747,6 +2757,10 @@ declare class PaintStrokeSession {
|
|
|
2747
2757
|
}, stroke: StrokeCoverage | MixerStrokeInit | RetouchStrokeInit, apply: StrokeApply,
|
|
2748
2758
|
/** Composite brush / eraser strokes at this bit depth (layers only); `null` for 8 bits. */
|
|
2749
2759
|
depth?: 16 | 32 | null);
|
|
2760
|
+
/** The pre-stroke tile as a float working tile (cached; `null`: transparent). */
|
|
2761
|
+
private readWork;
|
|
2762
|
+
/** Clone, healing and the spot-heal trail at depth: `paint` through the coverage on the float working tile. */
|
|
2763
|
+
private retouchDeepTile;
|
|
2750
2764
|
/** The new tile of a coverage stroke over the pre-stroke tile `src`. */
|
|
2751
2765
|
private compositeTile;
|
|
2752
2766
|
/** The live pixels a mixer stroke reads and writes; base tiles are copied on first write. */
|
|
@@ -163,11 +163,13 @@ declare function applyStrokeToTile(coverage: CoverageMap, tileData: Uint8Clamped
|
|
|
163
163
|
* samples (`Uint16Array` sRGB or `Float32Array` linear light, see `raster/deep`) of the target's
|
|
164
164
|
* tile (tx, ty) as it was before the stroke, and returns new samples of the same type. Blending
|
|
165
165
|
* runs in float in the samples' own space (sRGB at 16 bits, linear light at 32 bits); the paint
|
|
166
|
-
* colours are 8-bit sRGB and converted.
|
|
166
|
+
* colours are 8-bit sRGB and converted. With `options.channels` 1, a mask's coverage samples
|
|
167
|
+
* (16-bit, or float 0..1) move towards the paint's grey, as `applyStrokeToTile` does at 8 bits.
|
|
167
168
|
*/
|
|
168
169
|
declare function applyStrokeToDeepTile(coverage: CoverageMap, samples: Uint16Array | Float32Array, tx: number, ty: number, s: StrokeApply, options?: {
|
|
169
170
|
into?: Uint16Array | Float32Array;
|
|
170
171
|
region?: RasterRect;
|
|
172
|
+
channels?: 1 | 4;
|
|
171
173
|
}): Uint16Array | Float32Array;
|
|
172
174
|
/** Tile coordinates of coverage tile keys (for callers that track dirty tiles). */
|
|
173
175
|
declare function coverageTileCoord(key: TileKey): {
|
|
@@ -274,12 +276,19 @@ declare class PaintExchange {
|
|
|
274
276
|
/** 3. The reservoir drains. */
|
|
275
277
|
drain(): void;
|
|
276
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* A brush's working tile: 8-bit bytes, or (on a 16- or 32-bit document) floats on the same
|
|
281
|
+
* 0..255 sRGB-encoded scale, which keep the fractions an 8-bit tile would round away.
|
|
282
|
+
*/
|
|
283
|
+
type PaintPixels = Uint8ClampedArray | Float32Array;
|
|
284
|
+
/** Writes `v` (0..1) into a working tile: rounded for bytes, kept exact (not below 0) for floats. */
|
|
285
|
+
declare function put255(px: PaintPixels, i: number, v: number): void;
|
|
277
286
|
/** The pixels a brush reads and writes (RGBA tiles in layer space). */
|
|
278
287
|
interface PaintTileTarget {
|
|
279
288
|
/** The tile (TILE × TILE × 4) at (tx, ty) as it is now, or `null` when it is fully transparent. */
|
|
280
|
-
readTile(tx: number, ty: number):
|
|
289
|
+
readTile(tx: number, ty: number): PaintPixels | null;
|
|
281
290
|
/** A writable tile at (tx, ty), returned by `readTile` from then on. */
|
|
282
|
-
writeTile(tx: number, ty: number):
|
|
291
|
+
writeTile(tx: number, ty: number): PaintPixels;
|
|
283
292
|
/** Layer offset: layer pixel = document pixel − offset. */
|
|
284
293
|
offset: {
|
|
285
294
|
x: number;
|
|
@@ -336,7 +345,7 @@ declare class TileMedium implements PaintMedium {
|
|
|
336
345
|
*/
|
|
337
346
|
locate(dx: number, dy: number, write: boolean): number;
|
|
338
347
|
/** The tile `locate` last found. */
|
|
339
|
-
get pixels():
|
|
348
|
+
get pixels(): PaintPixels;
|
|
340
349
|
/** Selection coverage at a document pixel, 0..1 (1 without a selection). */
|
|
341
350
|
selectionAt(dx: number, dy: number): number;
|
|
342
351
|
sample(rect: RasterRect, cov: ArrayLike<number>): PaintSample | null;
|
|
@@ -579,6 +588,7 @@ interface PixelSource {
|
|
|
579
588
|
* One-channel tiles read as grey (alpha 255). Tiles are cached, so make one per stroke.
|
|
580
589
|
*/
|
|
581
590
|
declare class TilePixelSource implements PixelSource {
|
|
591
|
+
/** A tile's bytes, or a float working tile on the same 0..255 scale (16 / 32 bits). */
|
|
582
592
|
private readonly readTile;
|
|
583
593
|
readonly channels: 1 | 4;
|
|
584
594
|
readonly offset: {
|
|
@@ -588,7 +598,9 @@ declare class TilePixelSource implements PixelSource {
|
|
|
588
598
|
private readonly cache;
|
|
589
599
|
private lastKey;
|
|
590
600
|
private last;
|
|
591
|
-
constructor(
|
|
601
|
+
constructor(
|
|
602
|
+
/** A tile's bytes, or a float working tile on the same 0..255 scale (16 / 32 bits). */
|
|
603
|
+
readTile: (tx: number, ty: number) => PaintPixels | null, channels: 1 | 4, offset?: {
|
|
592
604
|
x: number;
|
|
593
605
|
y: number;
|
|
594
606
|
});
|
|
@@ -648,10 +660,10 @@ interface RetouchApply {
|
|
|
648
660
|
* Tone paint keeps alpha; source and colour paint composite with `blend` (source-over by
|
|
649
661
|
* default), keeping alpha on a locked layer.
|
|
650
662
|
*/
|
|
651
|
-
declare function applyRetouchToTile(coverage: CoverageMap, tileData:
|
|
652
|
-
into?:
|
|
663
|
+
declare function applyRetouchToTile<T extends PaintPixels>(coverage: CoverageMap, tileData: T, channels: 1 | 4, tx: number, ty: number, paint: RetouchPaint, s: RetouchApply, options?: {
|
|
664
|
+
into?: T;
|
|
653
665
|
region?: RasterRect;
|
|
654
|
-
}):
|
|
666
|
+
}): T;
|
|
655
667
|
/**
|
|
656
668
|
* Dodge / Burn at 16 or 32 bits: `applyRetouchToTile`'s tone paint on a layer tile's deep samples
|
|
657
669
|
* (`Uint16Array` sRGB-encoded, or `Float32Array` linear light, RGBA). The tone curves work on
|
|
@@ -1280,4 +1292,4 @@ declare function normalizeFlow(raw?: Partial<WetFlowSpec>, base?: WetFlowSpec):
|
|
|
1280
1292
|
/** The flow field of a spec on a canvas, or `null` for `none` (strength is applied by the world). */
|
|
1281
1293
|
declare function flowField(spec: WetFlowSpec, width: number, height: number): WetFlowField | null;
|
|
1282
1294
|
|
|
1283
|
-
export { FLAG_RIGHT as $, normalizeWetParams as A, type BrushSettings as B, CoverageMap as C, type Dab as D, wetSupport as E, type BlenderScratch as F, DEFAULT_BLENDER as G, DEFAULT_BRUSH as H, DEFAULT_MIXER as I, DEFAULT_RETOUCH as J, DEFAULT_SMUDGE as K, DEFAULT_WET_PAPER as L, type MixerSettings as M, DRY_EPS as N, DabWalker as O, type PaintTileTarget as P, EMPTY_MIXER_LOAD as Q, type RetouchSettings as R, StrokeCoverage as S, TileMedium as T, EX as U, EY as V, WetWorld as W, type ExchangeRates as X, FLAG_ALIVE as Y, FLAG_BOTTOM as Z, FLAG_LEFT as _, type MixerLoad as a,
|
|
1295
|
+
export { FLAG_RIGHT as $, normalizeWetParams as A, type BrushSettings as B, CoverageMap as C, type Dab as D, wetSupport as E, type BlenderScratch as F, DEFAULT_BLENDER as G, DEFAULT_BRUSH as H, DEFAULT_MIXER as I, DEFAULT_RETOUCH as J, DEFAULT_SMUDGE as K, DEFAULT_WET_PAPER as L, type MixerSettings as M, DRY_EPS as N, DabWalker as O, type PaintTileTarget as P, EMPTY_MIXER_LOAD as Q, type RetouchSettings as R, StrokeCoverage as S, TileMedium as T, EX as U, EY as V, WetWorld as W, type ExchangeRates as X, FLAG_ALIVE as Y, FLAG_BOTTOM as Z, FLAG_LEFT as _, type MixerLoad as a, applyStrokeToDeepTile as a$, FLAG_TOP as a0, FLAG_WET as a1, FLAT as a2, FREE_INTERVAL as a3, MAX_BATCH as a4, MAX_TILT_ACCEL as a5, MAX_WET_LANES as a6, MAX_WET_SLOTS as a7, MIXER_DRAIN as a8, MIXER_PICKUP_RATE as a9, RetouchDabStroke as aA, type RetouchSample as aB, SET_PLANES as aC, SLOT_BYTES as aD, SLOT_PLANES as aE, SLOT_SIDE as aF, SPOT_HEAL_TYPES as aG, STRIP as aH, type SmudgeDab as aI, SmudgeTip as aJ, type SpotHealType as aK, TONE_RANGES as aL, type TileMediumOptions as aM, TilePixelSource as aN, type ToneRange as aO, U_MAX as aP, W9 as aQ, WET_TILE as aR, type WetFlowField as aS, type WetKernelKind as aT, type WetLaneOptions as aU, type WetLaneStats as aV, type WetPaper as aW, type WetWorkerLayout as aX, WetWorkerPool as aY, WetWorldError as aZ, applyRetouchToTile as a_, MIXING_MODELS as aa, OPP as ab, PAPER_CAPACITY as ac, PARAM as ad, PARAM_FLOATS as ae, PIGMENT_CHANNELS as af, PLANE as ag, PLANE_BYTES as ah, P_D0 as ai, P_EDGE as aj, P_FX as ak, P_FY as al, P_H as am, P_P0 as an, P_RHO as ao, P_SW as ap, P_UX as aq, P_UY as ar, PaintExchange as as, type PaintMedium as at, type PaintPixels as au, type PaintSample as av, type PixelSource as aw, RETOUCH_SAMPLES as ax, RegionPixelSource as ay, type RetouchDabEffect as az, type MixerTarget as b, applyStrokeToTile as b0, applyToneToDeepTile as b1, blendRadius as b2, blenderDab as b3, canShareMemory as b4, cleanMixer as b5, coverageTileCoord as b6, createBlenderScratch as b7, dabCoverage as b8, dabRect as b9, smudgeEffect as bA, sponge as bB, spongeEffect as bC, spotHealPixels as bD, spotHealWindow as bE, tipFalloff as bF, tipReach as bG, tipShape as bH, toneOf as bI, walkDabs as bJ, wetSimdSupported as bK, dodgeBurn as ba, dodgeBurnCurve as bb, dsincos as bc, edgeBits as bd, exchangeRates as be, flowField as bf, healPixels as bg, latticeViscosity as bh, loadMixer as bi, loadWetKernel as bj, luma as bk, mixerRates as bl, normalizeBlender as bm, normalizeBrush as bn, normalizeMixer as bo, normalizeRetouch as bp, normalizeSmudge as bq, normalizeTilt as br, packWetParams as bs, perDabStrength as bt, put255 as bu, rasterizeDab as bv, readSourceRegion as bw, rgbaViewOfGrey as bx, saturationOf as by, smoothPoints as bz, MixerStroke as c, type RetouchApply as d, type StrokePoint as e, type RetouchPaint as f, type StrokeApply as g, type MixingModel as h, type BlenderSettings as i, type SmudgeSettings as j, type WetTilt as k, type WetParams as l, type WetFlowSpec as m, type RgbTriple as n, type WetWorldOptions as o, type WetBackendInfo as p, type WetSnapshot as q, type WetPaperInput as r, DEFAULT_FLOW as s, DEFAULT_WET_PARAMS as t, MAX_BRUSH_SIZE as u, WET_FLOW_KINDS as v, WET_PARAM_KEYS as w, type WetFlowKind as x, type WetSupport as y, normalizeFlow as z };
|
|
@@ -163,11 +163,13 @@ declare function applyStrokeToTile(coverage: CoverageMap, tileData: Uint8Clamped
|
|
|
163
163
|
* samples (`Uint16Array` sRGB or `Float32Array` linear light, see `raster/deep`) of the target's
|
|
164
164
|
* tile (tx, ty) as it was before the stroke, and returns new samples of the same type. Blending
|
|
165
165
|
* runs in float in the samples' own space (sRGB at 16 bits, linear light at 32 bits); the paint
|
|
166
|
-
* colours are 8-bit sRGB and converted.
|
|
166
|
+
* colours are 8-bit sRGB and converted. With `options.channels` 1, a mask's coverage samples
|
|
167
|
+
* (16-bit, or float 0..1) move towards the paint's grey, as `applyStrokeToTile` does at 8 bits.
|
|
167
168
|
*/
|
|
168
169
|
declare function applyStrokeToDeepTile(coverage: CoverageMap, samples: Uint16Array | Float32Array, tx: number, ty: number, s: StrokeApply, options?: {
|
|
169
170
|
into?: Uint16Array | Float32Array;
|
|
170
171
|
region?: RasterRect;
|
|
172
|
+
channels?: 1 | 4;
|
|
171
173
|
}): Uint16Array | Float32Array;
|
|
172
174
|
/** Tile coordinates of coverage tile keys (for callers that track dirty tiles). */
|
|
173
175
|
declare function coverageTileCoord(key: TileKey): {
|
|
@@ -274,12 +276,19 @@ declare class PaintExchange {
|
|
|
274
276
|
/** 3. The reservoir drains. */
|
|
275
277
|
drain(): void;
|
|
276
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* A brush's working tile: 8-bit bytes, or (on a 16- or 32-bit document) floats on the same
|
|
281
|
+
* 0..255 sRGB-encoded scale, which keep the fractions an 8-bit tile would round away.
|
|
282
|
+
*/
|
|
283
|
+
type PaintPixels = Uint8ClampedArray | Float32Array;
|
|
284
|
+
/** Writes `v` (0..1) into a working tile: rounded for bytes, kept exact (not below 0) for floats. */
|
|
285
|
+
declare function put255(px: PaintPixels, i: number, v: number): void;
|
|
277
286
|
/** The pixels a brush reads and writes (RGBA tiles in layer space). */
|
|
278
287
|
interface PaintTileTarget {
|
|
279
288
|
/** The tile (TILE × TILE × 4) at (tx, ty) as it is now, or `null` when it is fully transparent. */
|
|
280
|
-
readTile(tx: number, ty: number):
|
|
289
|
+
readTile(tx: number, ty: number): PaintPixels | null;
|
|
281
290
|
/** A writable tile at (tx, ty), returned by `readTile` from then on. */
|
|
282
|
-
writeTile(tx: number, ty: number):
|
|
291
|
+
writeTile(tx: number, ty: number): PaintPixels;
|
|
283
292
|
/** Layer offset: layer pixel = document pixel − offset. */
|
|
284
293
|
offset: {
|
|
285
294
|
x: number;
|
|
@@ -336,7 +345,7 @@ declare class TileMedium implements PaintMedium {
|
|
|
336
345
|
*/
|
|
337
346
|
locate(dx: number, dy: number, write: boolean): number;
|
|
338
347
|
/** The tile `locate` last found. */
|
|
339
|
-
get pixels():
|
|
348
|
+
get pixels(): PaintPixels;
|
|
340
349
|
/** Selection coverage at a document pixel, 0..1 (1 without a selection). */
|
|
341
350
|
selectionAt(dx: number, dy: number): number;
|
|
342
351
|
sample(rect: RasterRect, cov: ArrayLike<number>): PaintSample | null;
|
|
@@ -579,6 +588,7 @@ interface PixelSource {
|
|
|
579
588
|
* One-channel tiles read as grey (alpha 255). Tiles are cached, so make one per stroke.
|
|
580
589
|
*/
|
|
581
590
|
declare class TilePixelSource implements PixelSource {
|
|
591
|
+
/** A tile's bytes, or a float working tile on the same 0..255 scale (16 / 32 bits). */
|
|
582
592
|
private readonly readTile;
|
|
583
593
|
readonly channels: 1 | 4;
|
|
584
594
|
readonly offset: {
|
|
@@ -588,7 +598,9 @@ declare class TilePixelSource implements PixelSource {
|
|
|
588
598
|
private readonly cache;
|
|
589
599
|
private lastKey;
|
|
590
600
|
private last;
|
|
591
|
-
constructor(
|
|
601
|
+
constructor(
|
|
602
|
+
/** A tile's bytes, or a float working tile on the same 0..255 scale (16 / 32 bits). */
|
|
603
|
+
readTile: (tx: number, ty: number) => PaintPixels | null, channels: 1 | 4, offset?: {
|
|
592
604
|
x: number;
|
|
593
605
|
y: number;
|
|
594
606
|
});
|
|
@@ -648,10 +660,10 @@ interface RetouchApply {
|
|
|
648
660
|
* Tone paint keeps alpha; source and colour paint composite with `blend` (source-over by
|
|
649
661
|
* default), keeping alpha on a locked layer.
|
|
650
662
|
*/
|
|
651
|
-
declare function applyRetouchToTile(coverage: CoverageMap, tileData:
|
|
652
|
-
into?:
|
|
663
|
+
declare function applyRetouchToTile<T extends PaintPixels>(coverage: CoverageMap, tileData: T, channels: 1 | 4, tx: number, ty: number, paint: RetouchPaint, s: RetouchApply, options?: {
|
|
664
|
+
into?: T;
|
|
653
665
|
region?: RasterRect;
|
|
654
|
-
}):
|
|
666
|
+
}): T;
|
|
655
667
|
/**
|
|
656
668
|
* Dodge / Burn at 16 or 32 bits: `applyRetouchToTile`'s tone paint on a layer tile's deep samples
|
|
657
669
|
* (`Uint16Array` sRGB-encoded, or `Float32Array` linear light, RGBA). The tone curves work on
|
|
@@ -1280,4 +1292,4 @@ declare function normalizeFlow(raw?: Partial<WetFlowSpec>, base?: WetFlowSpec):
|
|
|
1280
1292
|
/** The flow field of a spec on a canvas, or `null` for `none` (strength is applied by the world). */
|
|
1281
1293
|
declare function flowField(spec: WetFlowSpec, width: number, height: number): WetFlowField | null;
|
|
1282
1294
|
|
|
1283
|
-
export { FLAG_RIGHT as $, normalizeWetParams as A, type BrushSettings as B, CoverageMap as C, type Dab as D, wetSupport as E, type BlenderScratch as F, DEFAULT_BLENDER as G, DEFAULT_BRUSH as H, DEFAULT_MIXER as I, DEFAULT_RETOUCH as J, DEFAULT_SMUDGE as K, DEFAULT_WET_PAPER as L, type MixerSettings as M, DRY_EPS as N, DabWalker as O, type PaintTileTarget as P, EMPTY_MIXER_LOAD as Q, type RetouchSettings as R, StrokeCoverage as S, TileMedium as T, EX as U, EY as V, WetWorld as W, type ExchangeRates as X, FLAG_ALIVE as Y, FLAG_BOTTOM as Z, FLAG_LEFT as _, type MixerLoad as a,
|
|
1295
|
+
export { FLAG_RIGHT as $, normalizeWetParams as A, type BrushSettings as B, CoverageMap as C, type Dab as D, wetSupport as E, type BlenderScratch as F, DEFAULT_BLENDER as G, DEFAULT_BRUSH as H, DEFAULT_MIXER as I, DEFAULT_RETOUCH as J, DEFAULT_SMUDGE as K, DEFAULT_WET_PAPER as L, type MixerSettings as M, DRY_EPS as N, DabWalker as O, type PaintTileTarget as P, EMPTY_MIXER_LOAD as Q, type RetouchSettings as R, StrokeCoverage as S, TileMedium as T, EX as U, EY as V, WetWorld as W, type ExchangeRates as X, FLAG_ALIVE as Y, FLAG_BOTTOM as Z, FLAG_LEFT as _, type MixerLoad as a, applyStrokeToDeepTile as a$, FLAG_TOP as a0, FLAG_WET as a1, FLAT as a2, FREE_INTERVAL as a3, MAX_BATCH as a4, MAX_TILT_ACCEL as a5, MAX_WET_LANES as a6, MAX_WET_SLOTS as a7, MIXER_DRAIN as a8, MIXER_PICKUP_RATE as a9, RetouchDabStroke as aA, type RetouchSample as aB, SET_PLANES as aC, SLOT_BYTES as aD, SLOT_PLANES as aE, SLOT_SIDE as aF, SPOT_HEAL_TYPES as aG, STRIP as aH, type SmudgeDab as aI, SmudgeTip as aJ, type SpotHealType as aK, TONE_RANGES as aL, type TileMediumOptions as aM, TilePixelSource as aN, type ToneRange as aO, U_MAX as aP, W9 as aQ, WET_TILE as aR, type WetFlowField as aS, type WetKernelKind as aT, type WetLaneOptions as aU, type WetLaneStats as aV, type WetPaper as aW, type WetWorkerLayout as aX, WetWorkerPool as aY, WetWorldError as aZ, applyRetouchToTile as a_, MIXING_MODELS as aa, OPP as ab, PAPER_CAPACITY as ac, PARAM as ad, PARAM_FLOATS as ae, PIGMENT_CHANNELS as af, PLANE as ag, PLANE_BYTES as ah, P_D0 as ai, P_EDGE as aj, P_FX as ak, P_FY as al, P_H as am, P_P0 as an, P_RHO as ao, P_SW as ap, P_UX as aq, P_UY as ar, PaintExchange as as, type PaintMedium as at, type PaintPixels as au, type PaintSample as av, type PixelSource as aw, RETOUCH_SAMPLES as ax, RegionPixelSource as ay, type RetouchDabEffect as az, type MixerTarget as b, applyStrokeToTile as b0, applyToneToDeepTile as b1, blendRadius as b2, blenderDab as b3, canShareMemory as b4, cleanMixer as b5, coverageTileCoord as b6, createBlenderScratch as b7, dabCoverage as b8, dabRect as b9, smudgeEffect as bA, sponge as bB, spongeEffect as bC, spotHealPixels as bD, spotHealWindow as bE, tipFalloff as bF, tipReach as bG, tipShape as bH, toneOf as bI, walkDabs as bJ, wetSimdSupported as bK, dodgeBurn as ba, dodgeBurnCurve as bb, dsincos as bc, edgeBits as bd, exchangeRates as be, flowField as bf, healPixels as bg, latticeViscosity as bh, loadMixer as bi, loadWetKernel as bj, luma as bk, mixerRates as bl, normalizeBlender as bm, normalizeBrush as bn, normalizeMixer as bo, normalizeRetouch as bp, normalizeSmudge as bq, normalizeTilt as br, packWetParams as bs, perDabStrength as bt, put255 as bu, rasterizeDab as bv, readSourceRegion as bw, rgbaViewOfGrey as bx, saturationOf as by, smoothPoints as bz, MixerStroke as c, type RetouchApply as d, type StrokePoint as e, type RetouchPaint as f, type StrokeApply as g, type MixingModel as h, type BlenderSettings as i, type SmudgeSettings as j, type WetTilt as k, type WetParams as l, type WetFlowSpec as m, type RgbTriple as n, type WetWorldOptions as o, type WetBackendInfo as p, type WetSnapshot as q, type WetPaperInput as r, DEFAULT_FLOW as s, DEFAULT_WET_PARAMS as t, MAX_BRUSH_SIZE as u, WET_FLOW_KINDS as v, WET_PARAM_KEYS as w, type WetFlowKind as x, type WetSupport as y, normalizeFlow as z };
|