@pixerate/editor 0.112.0 → 0.113.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 +6 -0
- package/dist/chunk-4KLT7ZYS.cjs +781 -0
- package/dist/chunk-4KLT7ZYS.cjs.map +1 -0
- package/dist/chunk-LPYOIVLA.js +781 -0
- package/dist/chunk-LPYOIVLA.js.map +1 -0
- package/dist/{export-DBba-buV.d.cts → export-CEXEzqBf.d.cts} +111 -6
- package/dist/{export-DNu_Jr8p.d.ts → export-DIkoK8-r.d.ts} +111 -6
- package/dist/image-editor/index.cjs +872 -285
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +77 -9
- package/dist/image-editor/index.d.ts +77 -9
- package/dist/image-editor/index.js +654 -67
- package/dist/image-editor/index.js.map +1 -1
- package/dist/paint/index.cjs +61 -2
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +29 -2
- package/dist/paint/index.d.ts +29 -2
- package/dist/paint/index.js +60 -1
- package/dist/paint-editor/index.d.cts +3 -3
- package/dist/paint-editor/index.d.ts +3 -3
- package/dist/{blending-DXl06NSx.d.ts → retouch-BXmeSCaB.d.ts} +218 -1
- package/dist/{blending-aOE6Y3UE.d.cts → retouch-CEIKR22W.d.cts} +218 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +30 -6
- package/skills/pixerate-image-editor/references/retouching.md +36 -0
- package/skills/pixerate-vector/SKILL.md +102 -5
- package/dist/chunk-FTBZPI77.cjs +0 -1
- package/dist/chunk-FTBZPI77.cjs.map +0 -1
- package/dist/chunk-VKK5VS2T.js +0 -1
- package/dist/chunk-VKK5VS2T.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/paint/heal.ts","../src/paint/retouch.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 { DabWalker, dabRect, rasterizeDab, type BrushSettings, type CoverageMap, type Dab, type StrokePoint } from './brush';\nimport { SmudgeTip, type SmudgeSettings } from './blending';\nimport { TileMedium, 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, Uint8ClampedArray | null>();\n private lastKey = NaN;\n private last: Uint8ClampedArray | null = null;\n\n constructor(\n private readonly readTile: (tx: number, ty: number) => Uint8ClampedArray | 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(\n coverage: CoverageMap,\n tileData: Uint8ClampedArray,\n channels: 1 | 4,\n tx: number,\n ty: number,\n paint: RetouchPaint,\n s: RetouchApply,\n options: { into?: Uint8ClampedArray; region?: RasterRect } = {}\n): Uint8ClampedArray {\n const out = options.into ? new Uint8ClampedArray(options.into) : new Uint8ClampedArray(tileData);\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 out[i] = Math.round((r0 + (rgb[0] - r0) * k) * 255);\n out[i + 1] = Math.round((g0 + (rgb[1] - g0) * k) * 255);\n out[i + 2] = Math.round((b0 + (rgb[2] - b0) * k) * 255);\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 out[i] = Math.round(o[0] * 255);\n out[i + 1] = Math.round(o[1] * 255);\n out[i + 2] = Math.round(o[2] * 255);\n if (!s.lockTransparency) out[i + 3] = Math.round(o[3] * 255);\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 px[i] = Math.round(rgb[0] * 255);\n px[i + 1] = Math.round(rgb[1] * 255);\n px[i + 2] = Math.round(rgb[2] * 255);\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) ?? 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) ?? 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"],"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,2BAA2B,IAAI,CAAC,eAAe,QAAQ,MAAM,QAAQ,EAAE,MAAM,GAAG;AACzJ,QAAM,IAAI,IAAI,WAAW,IAAI,CAAC;AAC9B,WAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,IAAK,GAAE,CAAC,IAAI,QAAQ,CAAC,IAAI,IAAI;AAC3D,aAAW,GAAG,GAAG,GAAG,GAAG,CAAC;AAC1B;AAEA,SAAS,WAAW,GAAW,GAAW,SAAqB,GAAiB,OAAqB;AACnG,MAAI,WAAW;AACf,MAAI,WAAW;AACf,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,QAAI,QAAQ,CAAC,EAAG;AAAA,SACX;AACH,kBAAY,EAAE,CAAC;AACf;A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AACA,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,OAAO,MAAM;AACX,iBAAW,EAAE,IAAI,IAAI,KAAK,KAAK,MAAM,OAAO,GAAG;AAC7C,cAAM,IAAI,OAAO,UAAU,IAAI,EAAE;AACjC,iBAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,IAAK,GAAE,CAAC,IAAI,KAAK,IAAI,CAAC;AAAA,MACtD;AACA,YAAM,MAAM;AAAA,IACd;AAAA,EACF;AACF;AAEA,SAAS,UAAU,GAAsB,GAA2B;AAClE,MAAI,CAAC,EAAG,QAAO,EAAE,GAAG,EAAE;AACtB,QAAM,IAAI,KAAK,IAAI,EAAE,GAAG,EAAE,CAAC;AAC3B,QAAM,IAAI,KAAK,IAAI,EAAE,GAAG,EAAE,CAAC;AAC3B,SAAO,EAAE,GAAG,GAAG,OAAO,KAAK,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,GAAG,QAAQ,KAAK,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,IAAI,EAAE;AACzH;","names":["w","t"]}
|
|
@@ -3,7 +3,7 @@ import { b as PixelSurface, B as BlendMode, a as TiledSurface } from './surface-
|
|
|
3
3
|
import { A as AffineMatrix, Q as Quad, a as WarpMesh, V as Vec2$1, H as Homography } from './types-CwMPoRMU.cjs';
|
|
4
4
|
import { B as BezierPath } from './bezier-BfwIbVTl.cjs';
|
|
5
5
|
import { v as VectorSubpath, n as Vec2 } from './types-DyQq-WPY.cjs';
|
|
6
|
-
import { B as BrushSettings, M as MixerSettings, d as MixerLoad, f as
|
|
6
|
+
import { B as BrushSettings, M as MixerSettings, d as MixerLoad, f as RetouchSettings, g as StrokeCoverage, h as MixerTarget, i as MixerStroke, j as RetouchApply, c as StrokePoint, k as RetouchPaint, C as CoverageMap, P as PaintTileTarget, l as StrokeApply } from './retouch-CEIKR22W.cjs';
|
|
7
7
|
import { W as WarpPreset } from './warp-D5jz_tN7.cjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -2501,6 +2501,21 @@ interface PaintOptions {
|
|
|
2501
2501
|
mixer: MixerSettings;
|
|
2502
2502
|
/** What the Mixer Brush carries now: its reservoir, how much is left and the picked-up colour. */
|
|
2503
2503
|
mixerLoad: MixerLoad;
|
|
2504
|
+
/** The retouching tools' options (aligned, sample, spot healing type, tone range, exposure, sponge mode, smudge strength). */
|
|
2505
|
+
retouch: RetouchSettings;
|
|
2506
|
+
/** The Clone Stamp and Healing Brush source point (Alt-click), or `null` when none is set. */
|
|
2507
|
+
cloneSource: CloneSource | null;
|
|
2508
|
+
}
|
|
2509
|
+
/** Where the Clone Stamp and Healing Brush sample from. */
|
|
2510
|
+
interface CloneSource {
|
|
2511
|
+
/** The source point, document pixels. */
|
|
2512
|
+
x: number;
|
|
2513
|
+
y: number;
|
|
2514
|
+
/** With Aligned on: the offset (source − stroke start) the first stroke fixed, kept for the next strokes; `null` until a stroke has used the point. */
|
|
2515
|
+
offset: {
|
|
2516
|
+
x: number;
|
|
2517
|
+
y: number;
|
|
2518
|
+
} | null;
|
|
2504
2519
|
}
|
|
2505
2520
|
/**
|
|
2506
2521
|
* The geometry of one shape component: a live shape (`{ kind: 'rect' | 'ellipse' | 'polygon' |
|
|
@@ -2610,8 +2625,12 @@ interface TypeLayerInfo {
|
|
|
2610
2625
|
rendering: 'live' | 'stored';
|
|
2611
2626
|
annotationId?: string;
|
|
2612
2627
|
}
|
|
2628
|
+
/** The retouching tools (see `@pixerate/editor/paint`'s retouch module). */
|
|
2629
|
+
type RetouchTool = 'clone' | 'heal' | 'spot-heal' | 'smudge' | 'dodge' | 'burn' | 'sponge';
|
|
2630
|
+
declare const RETOUCH_TOOLS: readonly RetouchTool[];
|
|
2631
|
+
declare const isRetouchTool: (tool: unknown) => tool is RetouchTool;
|
|
2613
2632
|
/** Paint tools a stroke can use. */
|
|
2614
|
-
type StrokeTool = 'brush' | 'eraser' | 'mixer';
|
|
2633
|
+
type StrokeTool = 'brush' | 'eraser' | 'mixer' | RetouchTool;
|
|
2615
2634
|
/** A stroke: tool, target (default the active layer and target) and brush / colour overrides. */
|
|
2616
2635
|
interface StrokeInit {
|
|
2617
2636
|
tool?: StrokeTool;
|
|
@@ -2628,6 +2647,16 @@ interface StrokeInit {
|
|
|
2628
2647
|
mixer?: Partial<MixerSettings>;
|
|
2629
2648
|
/** Eraser colour on locked transparency / masks (default the background). */
|
|
2630
2649
|
background?: string | number[];
|
|
2650
|
+
/** Overrides of the paint options' retouch settings (the retouching tools). */
|
|
2651
|
+
retouch?: Partial<RetouchSettings>;
|
|
2652
|
+
/**
|
|
2653
|
+
* Clone Stamp / Healing Brush: the source point for this stroke (document pixels). Given, it
|
|
2654
|
+
* becomes the clone source (as an Alt-click), so the stroke starts its offset afresh.
|
|
2655
|
+
*/
|
|
2656
|
+
source?: {
|
|
2657
|
+
x: number;
|
|
2658
|
+
y: number;
|
|
2659
|
+
};
|
|
2631
2660
|
/** Kept with the stroke for replays (v1 brushes have no jitter). */
|
|
2632
2661
|
seed?: number;
|
|
2633
2662
|
}
|
|
@@ -2651,6 +2680,28 @@ interface PaintStrokeResult {
|
|
|
2651
2680
|
dabs: number;
|
|
2652
2681
|
/** The Mixer Brush's load after the stroke (tool `mixer` only). */
|
|
2653
2682
|
mixerLoad?: MixerLoad;
|
|
2683
|
+
/**
|
|
2684
|
+
* Clone Stamp / Healing Brush: the offset used (source − first stroke point, whole pixels) and
|
|
2685
|
+
* where the stroke's first point sampled.
|
|
2686
|
+
*/
|
|
2687
|
+
clone?: {
|
|
2688
|
+
offset: {
|
|
2689
|
+
x: number;
|
|
2690
|
+
y: number;
|
|
2691
|
+
};
|
|
2692
|
+
source: {
|
|
2693
|
+
x: number;
|
|
2694
|
+
y: number;
|
|
2695
|
+
};
|
|
2696
|
+
aligned: boolean;
|
|
2697
|
+
};
|
|
2698
|
+
/** Spot Healing: the offset of the patch it copied, or `null` when it filled smoothly. */
|
|
2699
|
+
spotHeal?: {
|
|
2700
|
+
offset: {
|
|
2701
|
+
x: number;
|
|
2702
|
+
y: number;
|
|
2703
|
+
} | null;
|
|
2704
|
+
};
|
|
2654
2705
|
}
|
|
2655
2706
|
/** An opaque pre-stroke history snapshot. */
|
|
2656
2707
|
type HistoryEntryHandle = {
|
|
@@ -2663,11 +2714,42 @@ interface MixerStrokeInit {
|
|
|
2663
2714
|
/** Stores the brush load when the stroke ends and returns it (after any clean). */
|
|
2664
2715
|
end(load: MixerLoad): MixerLoad;
|
|
2665
2716
|
}
|
|
2717
|
+
/** A stroke that paints dab by dab into live pixels (Mixer Brush, Smudge, Sponge). */
|
|
2718
|
+
interface LiveDabStroke {
|
|
2719
|
+
push(points: readonly StrokePoint[]): CropBox[];
|
|
2720
|
+
finish(last?: StrokePoint): CropBox[];
|
|
2721
|
+
readonly bounds: CropBox | null;
|
|
2722
|
+
readonly dabCount: number;
|
|
2723
|
+
}
|
|
2724
|
+
/**
|
|
2725
|
+
* How a retouching stroke starts (see `PaintStrokeSession`): either coverage-based (Clone Stamp,
|
|
2726
|
+
* Healing Brush, Spot Healing, Dodge, Burn: `coverage` composited with `paint()` over the
|
|
2727
|
+
* pre-stroke pixels, optionally replaced by `finalPaint` when the stroke ends) or sequential
|
|
2728
|
+
* (`create`: dabs over live pixels, Smudge and Sponge).
|
|
2729
|
+
*/
|
|
2730
|
+
type RetouchStrokeInit = {
|
|
2731
|
+
kind: 'coverage';
|
|
2732
|
+
coverage: StrokeCoverage;
|
|
2733
|
+
apply: RetouchApply;
|
|
2734
|
+
/** Called with the first point before any dab is shown (the clone offset is fixed here). */
|
|
2735
|
+
start(first: StrokePoint): void;
|
|
2736
|
+
/** What the coverage lays while the stroke is drawn. */
|
|
2737
|
+
paint(): RetouchPaint;
|
|
2738
|
+
/** What it lays once the stroke ends, from the whole coverage (healing); `null` keeps `paint()`. */
|
|
2739
|
+
finalPaint?(coverage: CoverageMap): RetouchPaint | null;
|
|
2740
|
+
/** Extra result fields. */
|
|
2741
|
+
result?(): Partial<PaintStrokeResult>;
|
|
2742
|
+
} | {
|
|
2743
|
+
kind: 'dabs';
|
|
2744
|
+
/** Makes the stroke over the session's live pixels (RGBA, or an RGBA view of a mask). */
|
|
2745
|
+
create(pixels: PaintTileTarget): LiveDabStroke;
|
|
2746
|
+
result?(): Partial<PaintStrokeResult>;
|
|
2747
|
+
};
|
|
2666
2748
|
/**
|
|
2667
2749
|
* A stroke in progress (see `beginStroke`): `push` input points as they arrive, then `end` (one
|
|
2668
2750
|
* undo step) or `cancel`. Brush and eraser strokes build up a coverage map composited over the
|
|
2669
2751
|
* pre-stroke pixels; Mixer Brush strokes paint dab by dab into the live pixels, so each dab picks
|
|
2670
|
-
* up what the dabs before it laid down.
|
|
2752
|
+
* up what the dabs before it laid down. Retouching strokes take one of the two shapes.
|
|
2671
2753
|
*/
|
|
2672
2754
|
declare class PaintStrokeSession {
|
|
2673
2755
|
private readonly controller;
|
|
@@ -2684,6 +2766,10 @@ declare class PaintStrokeSession {
|
|
|
2684
2766
|
private readonly stroke;
|
|
2685
2767
|
private readonly mixer;
|
|
2686
2768
|
private readonly mixerInit;
|
|
2769
|
+
private readonly retouch;
|
|
2770
|
+
/** Writes a mask's RGBA view back (sequential retouching on a mask). */
|
|
2771
|
+
private readonly flushView;
|
|
2772
|
+
private started;
|
|
2687
2773
|
/** Mixer tiles written since the last update: they get new tile objects so the compositor sees them change. */
|
|
2688
2774
|
private readonly fresh;
|
|
2689
2775
|
private last;
|
|
@@ -2692,7 +2778,9 @@ declare class PaintStrokeSession {
|
|
|
2692
2778
|
id: string;
|
|
2693
2779
|
channel: LayerTarget;
|
|
2694
2780
|
surface: TiledSurface;
|
|
2695
|
-
}, stroke: StrokeCoverage | MixerStrokeInit, apply: StrokeApply);
|
|
2781
|
+
}, stroke: StrokeCoverage | MixerStrokeInit | RetouchStrokeInit, apply: StrokeApply);
|
|
2782
|
+
/** The new tile of a coverage stroke over the pre-stroke tile `src`. */
|
|
2783
|
+
private compositeTile;
|
|
2696
2784
|
/** The live pixels a mixer stroke reads and writes; base tiles are copied on first write. */
|
|
2697
2785
|
private mixerPixels;
|
|
2698
2786
|
get layerId(): string;
|
|
@@ -3185,9 +3273,10 @@ declare class ImageEditorController {
|
|
|
3185
3273
|
mask?: boolean;
|
|
3186
3274
|
}): string | null;
|
|
3187
3275
|
/** Brush settings, colours and tool options of the paint tools (view state, no undo). */
|
|
3188
|
-
setPaintOptions(options: Partial<Omit<PaintOptions, 'brush' | 'mixer' | 'mixerLoad'>> & {
|
|
3276
|
+
setPaintOptions(options: Partial<Omit<PaintOptions, 'brush' | 'mixer' | 'mixerLoad' | 'retouch' | 'cloneSource'>> & {
|
|
3189
3277
|
brush?: Partial<BrushSettings>;
|
|
3190
3278
|
mixer?: Partial<MixerSettings>;
|
|
3279
|
+
retouch?: Partial<RetouchSettings>;
|
|
3191
3280
|
}): PaintOptions;
|
|
3192
3281
|
/**
|
|
3193
3282
|
* Loads the Mixer Brush's reservoir full with `color` (default the foreground); the picked-up
|
|
@@ -3198,6 +3287,14 @@ declare class ImageEditorController {
|
|
|
3198
3287
|
cleanMixerBrush(): MixerLoad;
|
|
3199
3288
|
/** Empties the Mixer Brush entirely (no reservoir, nothing picked up). Returns the brush load. */
|
|
3200
3289
|
emptyMixerBrush(): MixerLoad;
|
|
3290
|
+
/**
|
|
3291
|
+
* Sets (Alt-click) or clears the Clone Stamp and Healing Brush source point, in document
|
|
3292
|
+
* pixels. The next stroke fixes the offset from its first point. View state, no undo.
|
|
3293
|
+
*/
|
|
3294
|
+
setCloneSource(point: {
|
|
3295
|
+
x: number;
|
|
3296
|
+
y: number;
|
|
3297
|
+
} | null): CloneSource | null;
|
|
3201
3298
|
/** D: black foreground, white background. */
|
|
3202
3299
|
resetPaintColors(): void;
|
|
3203
3300
|
/** X: swaps the foreground and background colours. */
|
|
@@ -3213,6 +3310,12 @@ declare class ImageEditorController {
|
|
|
3213
3310
|
* without recording history.
|
|
3214
3311
|
*/
|
|
3215
3312
|
beginStroke(init?: StrokeInit): PaintStrokeSession;
|
|
3313
|
+
/** A retouching stroke's start: its settings, what it samples and how it composites. */
|
|
3314
|
+
private retouchStroke;
|
|
3315
|
+
/** A pixel source over a surface (layer pixels or a mask) in layer space at `offset`. */
|
|
3316
|
+
private surfaceSource;
|
|
3317
|
+
/** A pixel source over the composite of the current layers (through `throughId` and below, or all of them), as it is now. */
|
|
3318
|
+
private compositeSource;
|
|
3216
3319
|
/** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
|
|
3217
3320
|
private mixerStroke;
|
|
3218
3321
|
/** @internal Shows a stroke's live surface (no history). */
|
|
@@ -3921,6 +4024,8 @@ interface ImageAnnotation extends BaseAnnotation {
|
|
|
3921
4024
|
type Annotation = PenAnnotation | RectAnnotation | CircleAnnotation | ArrowAnnotation | LineAnnotation | TextAnnotation | ImageAnnotation;
|
|
3922
4025
|
type CreateAnnotationPayload = Omit<PenAnnotation, 'id'> | Omit<RectAnnotation, 'id'> | Omit<CircleAnnotation, 'id'> | Omit<ArrowAnnotation, 'id'> | Omit<LineAnnotation, 'id'> | Omit<TextAnnotation, 'id'> | Omit<ImageAnnotation, 'id'>;
|
|
3923
4026
|
type ImageEditorTool = 'select' | 'crop' | 'pen' | 'rect' | 'circle' | 'arrow' | 'line' | 'text' | 'watermark' | 'move' | 'brush' | 'eraser' | 'mixer'
|
|
4027
|
+
/** Retouching (see `RetouchTool`): Clone Stamp, Healing Brush, Spot Healing, Smudge, Dodge, Burn, Sponge. */
|
|
4028
|
+
| 'clone' | 'heal' | 'spot-heal' | 'smudge' | 'dodge' | 'burn' | 'sponge'
|
|
3924
4029
|
/** Live shape layers (see `ShapeDrawGesture`). */
|
|
3925
4030
|
| 'shape'
|
|
3926
4031
|
/** Live type layers, edited on the canvas (see `TypeToolGesture`). */
|
|
@@ -4088,4 +4193,4 @@ interface PsdExportResult {
|
|
|
4088
4193
|
/** Writes the prepared stack as PSD (or PSB) bytes. */
|
|
4089
4194
|
declare function exportPsd(input: PsdExportInput): PsdExportResult;
|
|
4090
4195
|
|
|
4091
|
-
export { type FreeTransformResult as $, type AdjustmentKind as A, LayerCompositor as B, type CurvePoint as C, type DepthMaskOptions as D, type SmartFilterStack as E, type SmartFilter as F, type SmartObjectLayer as G, type HueRange as H, type ImageEditorAssetStore as I, type SmartContents as J, type SmartDocument as K, type LevelsChannel as L, type SmartPlacement as M, type FreeTransformGeometry as N, type TextShaper as O, type PsdExportResult as P, type TextFont as Q, type RefineEdgeParams as R, type SerializedLayer as S, type TextEnv as T, type LiveShapeKind as U, type TextAlign as V, type TextStyle as W, type ParagraphStyle as X, type TypeLayerInfo as Y, type LayerPlacement as Z, type FreeTransformMode as _, type ImageAdjustments as a, type LayerBase as a$, FreeTransformSession as a0, type FreeTransformInit as a1, type TransformAnchor as a2, type AIResultOptions as a3, type AdjustmentLayerBase as a4, type AdjustmentLayerInit as a5, type AdjustmentLayerUpdate as a6, type AnnotationPlacement as a7, type AnnotationType as a8, type ArrowAnnotation as a9, type FreeTransformContent as aA, type FreeTransformHost as aB, type FreeTransformPreview as aC, GUIDED_FILTER_EPS as aD, type GroupLayer as aE, HISTOGRAM_BINS as aF, type HistogramChannel as aG, type HistoryEntryHandle as aH, type HueSaturationParams as aI, IMAGE_EDITOR_SCHEMA_VERSION as aJ, type ImageAnnotation as aK, type ImageDimensions as aL, type ImageEditorAIHooks as aM, type ImageEditorFit as aN, type ImageEditorOptions as aO, ImageEditorRenderer as aP, type ImageEditorState as aQ, type ImageEditorTool as aR, type ImageLayerType as aS, type InpaintHook as aT, type InpaintOptions as aU, type InvertParams as aV, LAYERED_SCHEMA_VERSION as aW, LIVE_SHAPE_KINDS as aX, type LaidChar as aY, type LaidFragment as aZ, type LaidLine as a_, type AspectRatio as aa, type BaseAnnotation as ab, type BlackWhiteParams as ac, type BlurFilter as ad, type CircleAnnotation as ae, type ColorBalanceParams as af, type ColorBalanceTone as ag, type ColorRangeOptions as ah, type ColorRangeSample as ai, type CreateAnnotationPayload as aj, type CropHandle as ak, type CurvesParams as al, DEFAULT_ADJUSTMENTS as am, DEFAULT_AUTO_LEADING as an, DEFAULT_DEPTH_MASK as ao, DEFAULT_MITER_LIMIT as ap, DEFAULT_REFINE_EDGE_PARAMS as aq, DEFAULT_TEXT_STYLE as ar, DEFAULT_TRANSFORM as as, type DeserializeContext as at, type DevelopSettings as au, EMPTY_DISTANCE as av, type ExportOptions as aw, FREE_TRANSFORM_CONTENTS as ax, FREE_TRANSFORM_MODES as ay, type FillOptions as az, type SerializedImageEditorState as b, type SerializedSmartFilter as b$, type LayerBlendMode as b0, type LayerFilterKind as b1, type LayerLocation as b2, type LayerMaskProps as b3, LayerOperationError as b4, type LayerProperties as b5, type LayerSourcesHost as b6, type LayerTarget as b7, type LegacySerializedImageEditorState as b8, type LevelsParams as b9, type PsdSmartFilter as bA, type PsdTaggedBlock as bB, type PsdTreeNode as bC, type RectAnnotation as bD, type RemoveBackgroundHook as bE, type RemoveBackgroundOptions as bF, type RenderOptions as bG, SELECTION_MODES as bH, SELECTION_MODIFY_OPS as bI, SHAPE_OPERATIONS as bJ, SHAPE_RENDER_MARGIN as bK, type SampleOptions as bL, type SelectionChannel as bM, type SelectionCommandOptions as bN, type SelectionModifyOp as bO, type SerializeContext as bP, type SerializedAdjustmentLayer as bQ, type SerializedAnnotationLayer as bR, type SerializedGroupLayer as bS, type SerializedLayerEffects as bT, type SerializedLayeredImageEditorState as bU, type SerializedPattern as bV, type SerializedPixelLayer as bW, type SerializedRasterMask as bX, type SerializedSelection as bY, type SerializedShapeLayer as bZ, type SerializedSmartContents as b_, type LineAnnotation as ba, type LiveShape as bb, type MagicWandOptions as bc, type MixerStrokeInit as bd, PARAGRAPH_STYLE_FIELDS as be, PSD_BLEND_KEYS as bf, type PaintOptions as bg, type PaintStrokeResult as bh, PaintStrokeSession as bi, type ParagraphRun as bj, type PenAnnotation as bk, type PhotoFilterParams as bl, type PixelBuffer as bm, type PixelLayerInit as bn, type PosterizeParams as bo, type PsdChannel as bp, type PsdExportInput as bq, type PsdFile as br, type PsdHeader as bs, type PsdImportOptions as bt, type PsdImportResult as bu, type PsdLayerMask as bv, type PsdLayerRecord as bw, type PsdLayerSummary as bx, type PsdRect as by, type PsdResource as bz, type AdjustmentLayer as c, computeSelectionBounds as c$, type SerializedSmartObjectLayer as c0, type SerializedTypeLayer as c1, type ShapeArrowhead as c2, type ShapeComponent as c3, type ShapeEnv as c4, type ShapeFillRule as c5, type ShapeGeometryInput as c6, type ShapeLayerData as c7, type ShapeLayerInfo as c8, type ShapeLayerInit as c9, type TransformReadout as cA, type TypeLayerData as cB, type TypePsdData as cC, type VibranceParams as cD, type ViewportMetrics as cE, addLayerEffect as cF, addLayerFilter as cG, adjustmentNodeAsLayer as cH, anchorPoint as cI, annotationBlend as cJ, annotationOfShape as cK, annotationOfType as cL, applyImageProjectionToContext as cM, applyParams as cN, blurFilter as cO, borderCoverage as cP, boxMean as cQ, boxPointOf as cR, buildLayerMaskPlanes as cS, calculateCropDrag as cT, canvasToImagePoint as cU, caretAt as cV, clampCropToImage as cW, colorRange as cX, combineSelections as cY, componentPath as cZ, computeHistogram as c_, type ShapeLineCap as ca, type ShapeLineJoin as cb, type ShapeOperation as cc, type ShapePaint as cd, type ShapePsdData as ce, type ShapeSelectionOptions as cf, type ShapeStroke as cg, type ShapeStrokeAlign as ch, type ShapeStrokeInput as ci, type SmartFilterKind as cj, type SmartObjectInfo as ck, type SmartPsdData as cl, type StrokeInit as cm, type StrokeTool as cn, TEXT_ALIGNS as co, TEXT_RENDER_MARGIN as cp, TEXT_STYLE_FIELDS as cq, TONE_RANGE_PRESETS as cr, TRANSFORM_ANCHORS as cs, type TextAnnotation as ct, type TextLayerInit as cu, type TextLayout as cv, type TextRun as cw, type ThresholdParams as cx, type ToneRangePreset as cy, type TransformParams as cz, type AdjustmentParamsMap as d, isSelectionMode as d$, contractCoverage as d0, cornersFromMatrix as d1, coverageToByte as d2, createSelectionMask as d3, createShapeLayer as d4, createTypeLayer as d5, decodeLayerChannel as d6, decodeLayerMask as d7, decodeMergedImage as d8, decodePngDataUrl as d9, geometryHomography as dA, getAnnotationBounds as dB, getCropCursor as dC, getRotatedSize as dD, getViewportMetrics as dE, getViewportProjection as dF, globalImageCache as dG, greyMorphology as dH, groupLayers as dI, guidePlanes as dJ, guidedFilterColor as dK, hasSurface as dL, hasWarp as dM, hashMaskContent as dN, histogramPath as dO, hitTestAnnotation as dP, hitTestCrop as dQ, hueRange as dR, identityTransform as dS, imageToCanvasPoint as dT, importPsd as dU, invertSelection as dV, isActiveFilter as dW, isIdentityTransform as dX, isQuarterTurnSwapped as dY, isRenderedLayer as dZ, isSelectionEmpty as d_, decodeSelectionRle as da, defaultShapeName as db, depthMaskAlpha as dc, describeTransform as dd, deserializeEffects as de, deserializeLayer as df, deserializeLayers as dg, deserializePatterns as dh, deserializeSelection as di, developFilter as dj, distanceTransform as dk, duplicateLayer as dl, edgeWidth as dm, ellipsePoints as dn, ellipseSelection as dp, encodeSelectionRle as dq, encodeSurface as dr, expandCoverage as ds, exportPsd as dt, featherCoverage as du, fitParagraphRuns as dv, fitRuns as dw, flipCorners as dx, fontOf as dy, fullSelection as dz, type AdjustmentLayerMask as e, renderShape as e$, isSpatialFilter as e0, isTransformAnchor as e1, isValidWarp as e2, layerEffectsOf as e3, layerMaskCoverage as e4, layerMaskFromSelection as e5, layerMaskKey as e6, layerName as e7, layerTree as e8, layerTypeLabel as e9, offsetShape as eA, paragraphRanges as eB, parseBlend as eC, parseColor as eD, parseSelectionMode as eE, patchParagraphStyle as eF, patchTextStyle as eG, pixelLayerBounds as eH, pixelLayers as eI, placeLayer as eJ, polygonCoverage as eK, polygonSelection as eL, presetWarp as eM, previewStep as eN, projectImagePoint as eO, projectImageRect as eP, projectMaskCoverage as eQ, psdToLayers as eR, readPsd as eS, rectSelection as eT, referencePoint as eU, refineCoverage as eV, refineEdgeHalo as eW, refineSelection as eX, removeLayer as eY, removeLayerEffect as eZ, removeLayerFilter as e_, layoutText as ea, liveComponent as eb, liveShapeSubpaths as ec, magicWand as ed, mapCropHandle as ee, mapSubpaths as ef, matrixFromCorners as eg, matrixFromParams as eh, mergeShapeComponents as ei, migrateSerializedImageEditorState as ej, migrateToLayeredState as ek, modifySelection as el, moveLayer as em, newLayerId as en, normalizeAngle as eo, normalizeFilter as ep, normalizeLayerMask as eq, normalizeLiveShape as er, normalizeRect as es, normalizeRefineEdgeParams as et, normalizeShapePaint as eu, normalizeShapeStroke as ev, normalizeStoredAdjustments as ew, normalizeSubpaths as ex, normalizeText as ey, offsetLayer as ez, type AdjustmentLayerOf as f, unprojectCanvasPoint as f$, renderShapeRect as f0, renderText as f1, replaceTextRange as f2, requireLayer as f3, requireOperation as f4, requireShapeLayer as f5, requireTypeLayer as f6, requireUnlocked as f7, rerenderShape as f8, rerenderText as f9, shapeOutline as fA, shapeRenderClip as fB, shiftCoverage as fC, smartObjectLayers as fD, smoothCoverage as fE, spliceRuns as fF, srgb8ToLab as fG, styleAt as fH, textIndexAt as fI, textMatrix as fJ, textOutlines as fK, textRange as fL, toHex as fM, toTextSpace as fN, toneRange as fO, transformHomography as fP, transformMap as fQ, transformShapeComponents as fR, transformTypeLayer as fS, transformedBox as fT, transformedPoint as fU, typeAsPixelLayer as fV, typeFrame as fW, typeFromAnnotation as fX, typeLayerName as fY, ungroupLayer as fZ, unionRect as f_, resizePixels as fa, resizeSelection as fb, resolveExternalAssets as fc, restyleRange as fd, runLayerFilters as fe, selectionArea as ff, selectionFromCoverage as fg, selectionFromPixels as fh, selectionToCoverage as fi, selectionToPixels as fj, selectionValueAt as fk, serializeContents as fl, serializeEffects as fm, serializeLayer as fn, serializeLayers as fo, serializeLayersExternal as fp, serializePatterns as fq, serializeSelection as fr, setLayerEffects as fs, setLayerEffectsEnabled as ft, setLayerMask as fu, setLayerProperties as fv, shapeAsPixelLayer as fw, shapeFromAnnotation as fx, shapeGeometryBounds as fy, shapeLayers as fz, ImageEditorController as g, updateLayerEffect as g0, updateLayerFilter as g1, updateLayerMaskProps as g2, updateShapeLayer as g3, updateTypeLayer as g4, withNewIds as g5, writePsd as g6, type SelectionMask as h, type SelectionMode as i, type ColorDistance as j, type ImagePoint as k, type ImageLayer as l, type CropBox as m, type RasterMask as n, type Annotation as o, type AdjustmentLayerNode as p, type AnnotationLayer as q, type ShapeLayer as r, type TypeLayer as s, type LayerFilter as t, type PixelLayer as u, type DevelopFilter as v, type ImageTransform as w, type ImageHistogram as x, type ImageProjection as y, type CompositorSources as z };
|
|
4196
|
+
export { type FreeTransformResult as $, type AdjustmentKind as A, LayerCompositor as B, type CurvePoint as C, type DepthMaskOptions as D, type SmartFilterStack as E, type SmartFilter as F, type SmartObjectLayer as G, type HueRange as H, type ImageEditorAssetStore as I, type SmartContents as J, type SmartDocument as K, type LevelsChannel as L, type SmartPlacement as M, type FreeTransformGeometry as N, type TextShaper as O, type PsdExportResult as P, type TextFont as Q, type RefineEdgeParams as R, type SerializedLayer as S, type TextEnv as T, type LiveShapeKind as U, type TextAlign as V, type TextStyle as W, type ParagraphStyle as X, type TypeLayerInfo as Y, type LayerPlacement as Z, type FreeTransformMode as _, type ImageAdjustments as a, type LaidLine as a$, FreeTransformSession as a0, type FreeTransformInit as a1, type TransformAnchor as a2, type AIResultOptions as a3, type AdjustmentLayerBase as a4, type AdjustmentLayerInit as a5, type AdjustmentLayerUpdate as a6, type AnnotationPlacement as a7, type AnnotationType as a8, type ArrowAnnotation as a9, type FillOptions as aA, type FreeTransformContent as aB, type FreeTransformHost as aC, type FreeTransformPreview as aD, GUIDED_FILTER_EPS as aE, type GroupLayer as aF, HISTOGRAM_BINS as aG, type HistogramChannel as aH, type HistoryEntryHandle as aI, type HueSaturationParams as aJ, IMAGE_EDITOR_SCHEMA_VERSION as aK, type ImageAnnotation as aL, type ImageDimensions as aM, type ImageEditorAIHooks as aN, type ImageEditorFit as aO, type ImageEditorOptions as aP, ImageEditorRenderer as aQ, type ImageEditorState as aR, type ImageEditorTool as aS, type ImageLayerType as aT, type InpaintHook as aU, type InpaintOptions as aV, type InvertParams as aW, LAYERED_SCHEMA_VERSION as aX, LIVE_SHAPE_KINDS as aY, type LaidChar as aZ, type LaidFragment as a_, type AspectRatio as aa, type BaseAnnotation as ab, type BlackWhiteParams as ac, type BlurFilter as ad, type CircleAnnotation as ae, type CloneSource as af, type ColorBalanceParams as ag, type ColorBalanceTone as ah, type ColorRangeOptions as ai, type ColorRangeSample as aj, type CreateAnnotationPayload as ak, type CropHandle as al, type CurvesParams as am, DEFAULT_ADJUSTMENTS as an, DEFAULT_AUTO_LEADING as ao, DEFAULT_DEPTH_MASK as ap, DEFAULT_MITER_LIMIT as aq, DEFAULT_REFINE_EDGE_PARAMS as ar, DEFAULT_TEXT_STYLE as as, DEFAULT_TRANSFORM as at, type DeserializeContext as au, type DevelopSettings as av, EMPTY_DISTANCE as aw, type ExportOptions as ax, FREE_TRANSFORM_CONTENTS as ay, FREE_TRANSFORM_MODES as az, type SerializedImageEditorState as b, type SerializedRasterMask as b$, type LayerBase as b0, type LayerBlendMode as b1, type LayerFilterKind as b2, type LayerLocation as b3, type LayerMaskProps as b4, LayerOperationError as b5, type LayerProperties as b6, type LayerSourcesHost as b7, type LayerTarget as b8, type LegacySerializedImageEditorState as b9, type PsdResource as bA, type PsdSmartFilter as bB, type PsdTaggedBlock as bC, type PsdTreeNode as bD, RETOUCH_TOOLS as bE, type RectAnnotation as bF, type RemoveBackgroundHook as bG, type RemoveBackgroundOptions as bH, type RenderOptions as bI, type RetouchStrokeInit as bJ, type RetouchTool as bK, SELECTION_MODES as bL, SELECTION_MODIFY_OPS as bM, SHAPE_OPERATIONS as bN, SHAPE_RENDER_MARGIN as bO, type SampleOptions as bP, type SelectionChannel as bQ, type SelectionCommandOptions as bR, type SelectionModifyOp as bS, type SerializeContext as bT, type SerializedAdjustmentLayer as bU, type SerializedAnnotationLayer as bV, type SerializedGroupLayer as bW, type SerializedLayerEffects as bX, type SerializedLayeredImageEditorState as bY, type SerializedPattern as bZ, type SerializedPixelLayer as b_, type LevelsParams as ba, type LineAnnotation as bb, type LiveShape as bc, type MagicWandOptions as bd, type MixerStrokeInit as be, PARAGRAPH_STYLE_FIELDS as bf, PSD_BLEND_KEYS as bg, type PaintOptions as bh, type PaintStrokeResult as bi, PaintStrokeSession as bj, type ParagraphRun as bk, type PenAnnotation as bl, type PhotoFilterParams as bm, type PixelBuffer as bn, type PixelLayerInit as bo, type PosterizeParams as bp, type PsdChannel as bq, type PsdExportInput as br, type PsdFile as bs, type PsdHeader as bt, type PsdImportOptions as bu, type PsdImportResult as bv, type PsdLayerMask as bw, type PsdLayerRecord as bx, type PsdLayerSummary as by, type PsdRect as bz, type AdjustmentLayer as c, colorRange as c$, type SerializedSelection as c0, type SerializedShapeLayer as c1, type SerializedSmartContents as c2, type SerializedSmartFilter as c3, type SerializedSmartObjectLayer as c4, type SerializedTypeLayer as c5, type ShapeArrowhead as c6, type ShapeComponent as c7, type ShapeEnv as c8, type ShapeFillRule as c9, type TextRun as cA, type ThresholdParams as cB, type ToneRangePreset as cC, type TransformParams as cD, type TransformReadout as cE, type TypeLayerData as cF, type TypePsdData as cG, type VibranceParams as cH, type ViewportMetrics as cI, addLayerEffect as cJ, addLayerFilter as cK, adjustmentNodeAsLayer as cL, anchorPoint as cM, annotationBlend as cN, annotationOfShape as cO, annotationOfType as cP, applyImageProjectionToContext as cQ, applyParams as cR, blurFilter as cS, borderCoverage as cT, boxMean as cU, boxPointOf as cV, buildLayerMaskPlanes as cW, calculateCropDrag as cX, canvasToImagePoint as cY, caretAt as cZ, clampCropToImage as c_, type ShapeGeometryInput as ca, type ShapeLayerData as cb, type ShapeLayerInfo as cc, type ShapeLayerInit as cd, type ShapeLineCap as ce, type ShapeLineJoin as cf, type ShapeOperation as cg, type ShapePaint as ch, type ShapePsdData as ci, type ShapeSelectionOptions as cj, type ShapeStroke as ck, type ShapeStrokeAlign as cl, type ShapeStrokeInput as cm, type SmartFilterKind as cn, type SmartObjectInfo as co, type SmartPsdData as cp, type StrokeInit as cq, type StrokeTool as cr, TEXT_ALIGNS as cs, TEXT_RENDER_MARGIN as ct, TEXT_STYLE_FIELDS as cu, TONE_RANGE_PRESETS as cv, TRANSFORM_ANCHORS as cw, type TextAnnotation as cx, type TextLayerInit as cy, type TextLayout as cz, type AdjustmentParamsMap as d, isIdentityTransform as d$, combineSelections as d0, componentPath as d1, computeHistogram as d2, computeSelectionBounds as d3, contractCoverage as d4, cornersFromMatrix as d5, coverageToByte as d6, createSelectionMask as d7, createShapeLayer as d8, createTypeLayer as d9, fitRuns as dA, flipCorners as dB, fontOf as dC, fullSelection as dD, geometryHomography as dE, getAnnotationBounds as dF, getCropCursor as dG, getRotatedSize as dH, getViewportMetrics as dI, getViewportProjection as dJ, globalImageCache as dK, greyMorphology as dL, groupLayers as dM, guidePlanes as dN, guidedFilterColor as dO, hasSurface as dP, hasWarp as dQ, hashMaskContent as dR, histogramPath as dS, hitTestAnnotation as dT, hitTestCrop as dU, hueRange as dV, identityTransform as dW, imageToCanvasPoint as dX, importPsd as dY, invertSelection as dZ, isActiveFilter as d_, decodeLayerChannel as da, decodeLayerMask as db, decodeMergedImage as dc, decodePngDataUrl as dd, decodeSelectionRle as de, defaultShapeName as df, depthMaskAlpha as dg, describeTransform as dh, deserializeEffects as di, deserializeLayer as dj, deserializeLayers as dk, deserializePatterns as dl, deserializeSelection as dm, developFilter as dn, distanceTransform as dp, duplicateLayer as dq, edgeWidth as dr, ellipsePoints as ds, ellipseSelection as dt, encodeSelectionRle as du, encodeSurface as dv, expandCoverage as dw, exportPsd as dx, featherCoverage as dy, fitParagraphRuns as dz, type AdjustmentLayerMask as e, refineEdgeHalo as e$, isQuarterTurnSwapped as e0, isRenderedLayer as e1, isRetouchTool as e2, isSelectionEmpty as e3, isSelectionMode as e4, isSpatialFilter as e5, isTransformAnchor as e6, isValidWarp as e7, layerEffectsOf as e8, layerMaskCoverage as e9, normalizeShapeStroke as eA, normalizeStoredAdjustments as eB, normalizeSubpaths as eC, normalizeText as eD, offsetLayer as eE, offsetShape as eF, paragraphRanges as eG, parseBlend as eH, parseColor as eI, parseSelectionMode as eJ, patchParagraphStyle as eK, patchTextStyle as eL, pixelLayerBounds as eM, pixelLayers as eN, placeLayer as eO, polygonCoverage as eP, polygonSelection as eQ, presetWarp as eR, previewStep as eS, projectImagePoint as eT, projectImageRect as eU, projectMaskCoverage as eV, psdToLayers as eW, readPsd as eX, rectSelection as eY, referencePoint as eZ, refineCoverage as e_, layerMaskFromSelection as ea, layerMaskKey as eb, layerName as ec, layerTree as ed, layerTypeLabel as ee, layoutText as ef, liveComponent as eg, liveShapeSubpaths as eh, magicWand as ei, mapCropHandle as ej, mapSubpaths as ek, matrixFromCorners as el, matrixFromParams as em, mergeShapeComponents as en, migrateSerializedImageEditorState as eo, migrateToLayeredState as ep, modifySelection as eq, moveLayer as er, newLayerId as es, normalizeAngle as et, normalizeFilter as eu, normalizeLayerMask as ev, normalizeLiveShape as ew, normalizeRect as ex, normalizeRefineEdgeParams as ey, normalizeShapePaint as ez, type AdjustmentLayerOf as f, typeFrame as f$, refineSelection as f0, removeLayer as f1, removeLayerEffect as f2, removeLayerFilter as f3, renderShape as f4, renderShapeRect as f5, renderText as f6, replaceTextRange as f7, requireLayer as f8, requireOperation as f9, setLayerProperties as fA, shapeAsPixelLayer as fB, shapeFromAnnotation as fC, shapeGeometryBounds as fD, shapeLayers as fE, shapeOutline as fF, shapeRenderClip as fG, shiftCoverage as fH, smartObjectLayers as fI, smoothCoverage as fJ, spliceRuns as fK, srgb8ToLab as fL, styleAt as fM, textIndexAt as fN, textMatrix as fO, textOutlines as fP, textRange as fQ, toHex as fR, toTextSpace as fS, toneRange as fT, transformHomography as fU, transformMap as fV, transformShapeComponents as fW, transformTypeLayer as fX, transformedBox as fY, transformedPoint as fZ, typeAsPixelLayer as f_, requireShapeLayer as fa, requireTypeLayer as fb, requireUnlocked as fc, rerenderShape as fd, rerenderText as fe, resizePixels as ff, resizeSelection as fg, resolveExternalAssets as fh, restyleRange as fi, runLayerFilters as fj, selectionArea as fk, selectionFromCoverage as fl, selectionFromPixels as fm, selectionToCoverage as fn, selectionToPixels as fo, selectionValueAt as fp, serializeContents as fq, serializeEffects as fr, serializeLayer as fs, serializeLayers as ft, serializeLayersExternal as fu, serializePatterns as fv, serializeSelection as fw, setLayerEffects as fx, setLayerEffectsEnabled as fy, setLayerMask as fz, ImageEditorController as g, typeFromAnnotation as g0, typeLayerName as g1, ungroupLayer as g2, unionRect as g3, unprojectCanvasPoint as g4, updateLayerEffect as g5, updateLayerFilter as g6, updateLayerMaskProps as g7, updateShapeLayer as g8, updateTypeLayer as g9, withNewIds as ga, writePsd as gb, type SelectionMask as h, type SelectionMode as i, type ColorDistance as j, type ImagePoint as k, type ImageLayer as l, type CropBox as m, type RasterMask as n, type Annotation as o, type AdjustmentLayerNode as p, type AnnotationLayer as q, type ShapeLayer as r, type TypeLayer as s, type LayerFilter as t, type PixelLayer as u, type DevelopFilter as v, type ImageTransform as w, type ImageHistogram as x, type ImageProjection as y, type CompositorSources as z };
|