@pixerate/editor 0.112.0 → 0.114.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 +11 -0
- package/dist/animation-editor/index.cjs +60 -54
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +3 -3
- package/dist/animation-editor/index.d.ts +3 -3
- package/dist/animation-editor/index.js +14 -8
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/builtin-CY97ppKM.d.cts +354 -0
- package/dist/builtin-CY97ppKM.d.ts +354 -0
- package/dist/canvas/index.cjs +3 -3
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.js +9 -9
- package/dist/chunk-26PGXHY7.cjs +753 -0
- package/dist/chunk-26PGXHY7.cjs.map +1 -0
- package/dist/chunk-2OJACTPR.cjs +929 -0
- package/dist/chunk-2OJACTPR.cjs.map +1 -0
- package/dist/chunk-3UFGNHSP.js +929 -0
- package/dist/chunk-3UFGNHSP.js.map +1 -0
- package/dist/{chunk-YGIMK4NX.cjs → chunk-5OVJHMZQ.cjs} +757 -825
- package/dist/chunk-5OVJHMZQ.cjs.map +1 -0
- package/dist/chunk-643B2HKC.cjs +534 -0
- package/dist/chunk-643B2HKC.cjs.map +1 -0
- package/dist/chunk-6FCKOS2B.js +534 -0
- package/dist/chunk-6FCKOS2B.js.map +1 -0
- package/dist/chunk-BRLYOPLT.js +2574 -0
- package/dist/chunk-BRLYOPLT.js.map +1 -0
- package/dist/{chunk-LQEEDHOP.js → chunk-C6C5PDKU.js} +759 -761
- package/dist/chunk-C6C5PDKU.js.map +1 -0
- package/dist/chunk-DFQEX3AM.cjs +781 -0
- package/dist/chunk-DFQEX3AM.cjs.map +1 -0
- package/dist/{chunk-CZOXTEMN.js → chunk-EUVSQ25B.js} +336 -404
- package/dist/chunk-EUVSQ25B.js.map +1 -0
- package/dist/chunk-G5NMLUVF.cjs +2574 -0
- package/dist/chunk-G5NMLUVF.cjs.map +1 -0
- package/dist/chunk-LKCYANMW.js +781 -0
- package/dist/chunk-LKCYANMW.js.map +1 -0
- package/dist/{chunk-W3GXSUSQ.cjs → chunk-LPLCWZTM.cjs} +5087 -1283
- package/dist/chunk-LPLCWZTM.cjs.map +1 -0
- package/dist/chunk-MMVHBKMM.js +753 -0
- package/dist/chunk-MMVHBKMM.js.map +1 -0
- package/dist/{chunk-POGBUYWE.cjs → chunk-ST7E3NEE.cjs} +857 -859
- package/dist/chunk-ST7E3NEE.cjs.map +1 -0
- package/dist/{chunk-7VOHOPLW.cjs → chunk-TCKIXI46.cjs} +59 -59
- package/dist/{chunk-7VOHOPLW.cjs.map → chunk-TCKIXI46.cjs.map} +1 -1
- package/dist/{chunk-XIOMMGPD.cjs → chunk-TFOPHZ3U.cjs} +1 -1
- package/dist/chunk-TFOPHZ3U.cjs.map +1 -0
- package/dist/{chunk-Z4BC6M74.js → chunk-UBIXVXPR.js} +2 -2
- package/dist/{chunk-BLWCAQCW.js → chunk-VXR7XWMF.js} +4574 -770
- package/dist/chunk-VXR7XWMF.js.map +1 -0
- package/dist/{chunk-HNS7UHCM.js → chunk-XK5LZKBD.js} +1 -1
- package/dist/chunk-XK5LZKBD.js.map +1 -0
- package/dist/cms/index.cjs +146 -0
- package/dist/cms/index.cjs.map +1 -0
- package/dist/cms/index.d.cts +51 -0
- package/dist/cms/index.d.ts +51 -0
- package/dist/cms/index.js +146 -0
- package/dist/{export-DNu_Jr8p.d.ts → export-_1dUKwpF.d.ts} +326 -195
- package/dist/{export-DBba-buV.d.cts → export-b6NjCZ5-.d.cts} +326 -195
- package/dist/image-editor/index.cjs +2377 -1291
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +149 -97
- package/dist/image-editor/index.d.ts +149 -97
- package/dist/image-editor/index.js +1343 -257
- package/dist/image-editor/index.js.map +1 -1
- package/dist/opentype-BZEOSOX3.d.ts +188 -0
- package/dist/opentype-Dpe75vL5.d.cts +188 -0
- package/dist/paint/index.cjs +63 -4
- package/dist/paint/index.cjs.map +1 -1
- package/dist/paint/index.d.cts +30 -3
- package/dist/paint/index.d.ts +30 -3
- package/dist/paint/index.js +62 -3
- package/dist/paint-editor/index.cjs +146 -145
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +9 -8
- package/dist/paint-editor/index.d.ts +9 -8
- package/dist/paint-editor/index.js +6 -5
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/raster/index.cjs +53 -3
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.d.cts +62 -91
- package/dist/raster/index.d.ts +62 -91
- package/dist/raster/index.js +59 -9
- package/dist/{render-BEriFuqK.d.cts → render-B1K_OoLy.d.cts} +87 -2
- package/dist/{render-tjzKaik-.d.ts → render-CrmHOgpo.d.ts} +87 -2
- package/dist/{blending-aOE6Y3UE.d.cts → retouch-Bxkuc0KH.d.cts} +219 -2
- package/dist/{blending-DXl06NSx.d.ts → retouch-Do6tBs2H.d.ts} +219 -2
- package/dist/{surface-C8RRg_Bh.d.ts → surface-Cn30xIV6.d.cts} +6 -1
- package/dist/{surface-C8RRg_Bh.d.cts → surface-Cn30xIV6.d.ts} +6 -1
- package/dist/{svg-D_cfkhlB.d.cts → svg-BnRj0q8i.d.cts} +16 -4
- package/dist/{svg-wIaKLrU0.d.ts → svg-CmmBFfGT.d.ts} +16 -4
- package/dist/{types-DtL_qLFz.d.ts → types-1SUQKDAw.d.ts} +273 -4
- package/dist/{types-DyQq-WPY.d.cts → types-yINF17Ta.d.cts} +273 -4
- package/dist/vector/index.cjs +12170 -7343
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +1579 -16
- package/dist/vector/index.d.ts +1579 -16
- package/dist/vector/index.js +6303 -1476
- package/dist/vector/index.js.map +1 -1
- package/dist/warp-B39VsOtd.d.cts +348 -0
- package/dist/warp-DMN30aY6.d.ts +348 -0
- package/dist/zlib-dxQdgHyN.d.cts +95 -0
- package/dist/zlib-dxQdgHyN.d.ts +95 -0
- package/package.json +6 -1
- package/skills/pixerate-image-editor/SKILL.md +34 -34
- package/skills/pixerate-image-editor/references/color-management.md +37 -0
- package/skills/pixerate-image-editor/references/photoshop-files.md +39 -0
- package/skills/pixerate-image-editor/references/retouching.md +36 -0
- package/skills/pixerate-vector/SKILL.md +154 -5
- package/dist/chunk-BLWCAQCW.js.map +0 -1
- package/dist/chunk-CZOXTEMN.js.map +0 -1
- package/dist/chunk-FTBZPI77.cjs +0 -1
- package/dist/chunk-FTBZPI77.cjs.map +0 -1
- package/dist/chunk-HNS7UHCM.js.map +0 -1
- package/dist/chunk-JLYX4V57.cjs +0 -2001
- package/dist/chunk-JLYX4V57.cjs.map +0 -1
- package/dist/chunk-KB2YBCVS.js +0 -2001
- package/dist/chunk-KB2YBCVS.js.map +0 -1
- package/dist/chunk-LQEEDHOP.js.map +0 -1
- package/dist/chunk-POGBUYWE.cjs.map +0 -1
- package/dist/chunk-VKK5VS2T.js +0 -1
- package/dist/chunk-W3GXSUSQ.cjs.map +0 -1
- package/dist/chunk-XIOMMGPD.cjs.map +0 -1
- package/dist/chunk-YGIMK4NX.cjs.map +0 -1
- package/dist/homography-CZ-tFjay.d.cts +0 -50
- package/dist/homography-Ctfjoc1b.d.ts +0 -50
- package/dist/warp-CWHZzE3x.d.ts +0 -118
- package/dist/warp-D5jz_tN7.d.cts +0 -118
- /package/dist/{chunk-Z4BC6M74.js.map → chunk-UBIXVXPR.js.map} +0 -0
- /package/dist/{chunk-VKK5VS2T.js.map → cms/index.js.map} +0 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { H as Homography, V as Vec2, B as Box, Q as Quad, A as AffineMatrix } from './types-CwMPoRMU.js';
|
|
2
|
+
import { T as TextShaper, a as TextFont } from './warp-DMN30aY6.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Perspective (projective) maps between quadrilaterals: Free Distort and Perspective in both the
|
|
6
|
+
* vector and the image editor. Pure maths; degenerate or non-finite input gives `null` instead of
|
|
7
|
+
* NaNs.
|
|
8
|
+
*
|
|
9
|
+
* Ported from ArtCraft (MIT OR Apache-2.0, © ArtCraft Team and contributors; see
|
|
10
|
+
* THIRD_PARTY_NOTICES.md): pdfcraft `crates/geom/src/perspective.rs` (`Homography::from_points`,
|
|
11
|
+
* `Homography::apply`, `solve8`, `order_quad`) and photocraft `crates/algo/src/transform.rs`
|
|
12
|
+
* (`Homography::square_to_quad`, `rect_to_quad`, `inverse`, `mul`, `local_scale`, `front_side`,
|
|
13
|
+
* `warp_output_bounds`, `convex_quad`).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Gaussian elimination with partial pivoting on an 8×8 system (the 9th column of each row is the
|
|
18
|
+
* right-hand side). Null when the system is singular.
|
|
19
|
+
*/
|
|
20
|
+
declare function solve8(rows: readonly (readonly number[])[]): number[] | null;
|
|
21
|
+
/** The image of `p`, or null where the map sends it to infinity. */
|
|
22
|
+
declare function applyHomography(h: Homography, p: Vec2): Vec2 | null;
|
|
23
|
+
/**
|
|
24
|
+
* The projective map that takes each of `from` to the point at the same index of `to`. Null when
|
|
25
|
+
* three of either set are collinear or a coordinate is not finite.
|
|
26
|
+
*/
|
|
27
|
+
declare function homographyFromPoints(from: readonly Vec2[], to: readonly Vec2[]): Homography | null;
|
|
28
|
+
/**
|
|
29
|
+
* Whether `h` maps the whole convex quad `quad` without sending any of it through infinity (the
|
|
30
|
+
* denominator keeps one sign over it): what a usable distortion needs.
|
|
31
|
+
*/
|
|
32
|
+
declare function homographyKeepsQuad(h: Homography, quad: readonly Vec2[]): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The four corners in reading order for a y-down space: top-left, top-right, bottom-right,
|
|
35
|
+
* bottom-left, whatever order they come in. Null unless they form a convex quadrilateral with a
|
|
36
|
+
* non-negligible area.
|
|
37
|
+
*/
|
|
38
|
+
declare function orderQuad(points: readonly Vec2[]): Vec2[] | null;
|
|
39
|
+
/** The inverse map, or null for a singular one. */
|
|
40
|
+
declare function invertHomography(m: Homography): Homography | null;
|
|
41
|
+
/** An affine matrix (SVG order) as a homography. */
|
|
42
|
+
declare function homographyFromAffine(m: AffineMatrix): Homography;
|
|
43
|
+
/**
|
|
44
|
+
* The map taking box `r`'s corners onto `quad` (TL, TR, BR, BL), exact for parallelograms (then
|
|
45
|
+
* affine). Null for an empty box, a non-finite or degenerate quad, or a singular result.
|
|
46
|
+
*/
|
|
47
|
+
declare function rectToQuad(r: Box, quad: readonly Vec2[]): Homography | null;
|
|
48
|
+
/** Box `r`'s corners as a quad (TL, TR, BR, BL). */
|
|
49
|
+
declare function boxQuad(r: Box): Quad;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Text shapers for type layers (see `TextShaper` in `text.ts`):
|
|
53
|
+
*
|
|
54
|
+
* - `createCanvasTextShaper`: the browser's own fonts and text drawing through Canvas 2D
|
|
55
|
+
* (`measureText`, `fillText`). The default in browsers. It cannot give outlines.
|
|
56
|
+
* - `createOutlineTextShaper`: glyph outlines from font objects the host loads, typed after
|
|
57
|
+
* opentype.js's `Font` (`getPath`, `getAdvanceWidth`, `unitsPerEm`, …) without depending on it.
|
|
58
|
+
* Pure: it renders anywhere (servers, workers, tests) and makes Convert to Shape possible.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/** A family as it goes into a CSS `font` value: generics and lists as written, other names quoted when needed. */
|
|
62
|
+
declare function cssFontFamily(family: string): string;
|
|
63
|
+
/** The CSS `font` shorthand for a font (`italic 700 24px Inter`). */
|
|
64
|
+
declare function cssFont(font: TextFont, family?: string): string;
|
|
65
|
+
interface CanvasTextShaperOptions {
|
|
66
|
+
/** A 1 × 1 canvas for measuring (default an `OffscreenCanvas`, else a DOM canvas). */
|
|
67
|
+
createCanvas?(width: number, height: number): HTMLCanvasElement | OffscreenCanvas;
|
|
68
|
+
/** Family used when one is missing (default `sans-serif`). */
|
|
69
|
+
fallbackFamily?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A shaper over Canvas 2D. A family is missing when text set in it measures the same as in
|
|
73
|
+
* both `monospace` and `serif` (the browser fell back), so web fonts must be loaded before use.
|
|
74
|
+
* Returns `null` where there is no 2D canvas.
|
|
75
|
+
*/
|
|
76
|
+
declare function createCanvasTextShaper(options?: CanvasTextShaperOptions): TextShaper | null;
|
|
77
|
+
/** A path command as opentype.js returns it. */
|
|
78
|
+
interface OutlinePathCommand {
|
|
79
|
+
type: 'M' | 'L' | 'C' | 'Q' | 'Z';
|
|
80
|
+
x?: number;
|
|
81
|
+
y?: number;
|
|
82
|
+
x1?: number;
|
|
83
|
+
y1?: number;
|
|
84
|
+
x2?: number;
|
|
85
|
+
y2?: number;
|
|
86
|
+
}
|
|
87
|
+
/** The parts of an opentype.js `Font` the outline shaper uses. */
|
|
88
|
+
interface OutlineFontFace {
|
|
89
|
+
unitsPerEm: number;
|
|
90
|
+
ascender: number;
|
|
91
|
+
descender: number;
|
|
92
|
+
getAdvanceWidth(text: string, fontSize: number, options?: {
|
|
93
|
+
kerning?: boolean;
|
|
94
|
+
}): number;
|
|
95
|
+
getPath(text: string, x: number, y: number, fontSize: number, options?: {
|
|
96
|
+
kerning?: boolean;
|
|
97
|
+
}): {
|
|
98
|
+
commands: OutlinePathCommand[];
|
|
99
|
+
};
|
|
100
|
+
names?: {
|
|
101
|
+
fontFamily?: Record<string, string>;
|
|
102
|
+
postScriptName?: Record<string, string>;
|
|
103
|
+
};
|
|
104
|
+
tables?: {
|
|
105
|
+
os2?: {
|
|
106
|
+
usWeightClass?: number;
|
|
107
|
+
fsSelection?: number;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** A face with its family, weight and style (read from the font's names when not given). */
|
|
112
|
+
interface OutlineFontEntry {
|
|
113
|
+
face: OutlineFontFace;
|
|
114
|
+
family?: string;
|
|
115
|
+
weight?: number;
|
|
116
|
+
italic?: boolean;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A shaper over outline fonts the host loads (opentype.js `Font` objects or anything with the same
|
|
120
|
+
* methods). Fonts are matched by family (case-insensitive), then the nearest weight and the
|
|
121
|
+
* italic flag; a missing family uses `fallback` (default the first font) and is reported missing.
|
|
122
|
+
*/
|
|
123
|
+
declare function createOutlineTextShaper(fonts: ReadonlyArray<OutlineFontFace | OutlineFontEntry>, options?: {
|
|
124
|
+
fallback?: string;
|
|
125
|
+
id?: string;
|
|
126
|
+
}): TextShaper;
|
|
127
|
+
/**
|
|
128
|
+
* A shaper that needs no fonts: advances estimated per character class (narrow, wide, CJK), an
|
|
129
|
+
* ascent of 0.8 em and a descent of 0.2 em. It cannot draw or outline. Layout then runs in any
|
|
130
|
+
* host (servers, tests, agents without fonts) and gives stable, approximate lines; plug in a real
|
|
131
|
+
* shaper to match the fonts. Every family counts as available, since it cannot tell.
|
|
132
|
+
*/
|
|
133
|
+
declare function createMetricTextShaper(options?: {
|
|
134
|
+
id?: string;
|
|
135
|
+
}): TextShaper;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* A small OpenType reader: enough of a font file to set Latin, Cyrillic, Greek and CJK text as
|
|
139
|
+
* outlines without a third-party library. It reads TrueType (`glyf`) and CFF (`CFF `, CID-keyed
|
|
140
|
+
* included) outlines, `cmap` (formats 4 and 12), horizontal metrics, `kern` (format 0) and `GPOS`
|
|
141
|
+
* pair kerning (lookup type 2, formats 1 and 2, the `kern` feature), and the family, PostScript
|
|
142
|
+
* name, weight and style. It does not apply `GSUB` (ligatures, contextual forms) or complex-script
|
|
143
|
+
* shaping, so Arabic, Indic and similar scripts set as isolated glyphs.
|
|
144
|
+
*
|
|
145
|
+
* The result has the shape of opentype.js's `Font` that `createOutlineTextShaper` takes, so hosts
|
|
146
|
+
* can pass either. Written from the OpenType specification (TrueType glyph outlines, the CFF
|
|
147
|
+
* specification and the Type 2 charstring format), not ported.
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
/** A parsed font, usable as an `OutlineFontFace`. */
|
|
151
|
+
interface OpenTypeFont extends OutlineFontFace {
|
|
152
|
+
/** The family name (typographic family when the font has one). */
|
|
153
|
+
readonly family: string;
|
|
154
|
+
/** The subfamily ("Bold Italic"). */
|
|
155
|
+
readonly style: string;
|
|
156
|
+
readonly postScriptName: string;
|
|
157
|
+
readonly weight: number;
|
|
158
|
+
readonly italic: boolean;
|
|
159
|
+
readonly numGlyphs: number;
|
|
160
|
+
/** `glyf` (TrueType quadratic outlines) or `cff` (cubic). */
|
|
161
|
+
readonly outlines: 'glyf' | 'cff';
|
|
162
|
+
/** The glyph for a code point (0, `.notdef`, when the font lacks it). */
|
|
163
|
+
glyphIndex(codePoint: number): number;
|
|
164
|
+
/** A glyph's advance in font units. */
|
|
165
|
+
advance(glyph: number): number;
|
|
166
|
+
/** Kerning between two glyphs in font units (negative pulls them together). */
|
|
167
|
+
kerning(left: number, right: number): number;
|
|
168
|
+
/** A glyph's outline in font units, y up, origin on the baseline. */
|
|
169
|
+
glyphPath(glyph: number): OutlinePathCommand[];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Reads a TrueType or OpenType font (`.ttf`, `.otf`, or face `index` of a `.ttc` collection).
|
|
173
|
+
* Throws with the reason when the file is not one, or lacks the tables layout needs. For WOFF files
|
|
174
|
+
* use `loadOpenTypeFont`.
|
|
175
|
+
*/
|
|
176
|
+
declare function parseOpenTypeFont(data: ArrayBuffer | ArrayBufferView, options?: {
|
|
177
|
+
index?: number;
|
|
178
|
+
}): OpenTypeFont;
|
|
179
|
+
/**
|
|
180
|
+
* Reads a font file: TrueType, OpenType, a collection (`index`) or WOFF 1.0 (decompressed with the
|
|
181
|
+
* platform's `DecompressionStream`). WOFF2 needs Brotli, which browsers do not expose, so it is
|
|
182
|
+
* refused with a hint.
|
|
183
|
+
*/
|
|
184
|
+
declare function loadOpenTypeFont(data: ArrayBuffer | ArrayBufferView | Blob, options?: {
|
|
185
|
+
index?: number;
|
|
186
|
+
}): Promise<OpenTypeFont>;
|
|
187
|
+
|
|
188
|
+
export { type CanvasTextShaperOptions as C, type OpenTypeFont as O, type OutlineFontEntry as a, type OutlineFontFace as b, type OutlinePathCommand as c, applyHomography as d, createCanvasTextShaper as e, createMetricTextShaper as f, createOutlineTextShaper as g, cssFontFamily as h, homographyFromPoints as i, homographyKeepsQuad as j, boxQuad as k, loadOpenTypeFont as l, cssFont as m, homographyFromAffine as n, orderQuad as o, parseOpenTypeFont as p, invertHomography as q, rectToQuad as r, solve8 as s };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { H as Homography, V as Vec2, B as Box, Q as Quad, A as AffineMatrix } from './types-CwMPoRMU.cjs';
|
|
2
|
+
import { T as TextShaper, a as TextFont } from './warp-B39VsOtd.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Perspective (projective) maps between quadrilaterals: Free Distort and Perspective in both the
|
|
6
|
+
* vector and the image editor. Pure maths; degenerate or non-finite input gives `null` instead of
|
|
7
|
+
* NaNs.
|
|
8
|
+
*
|
|
9
|
+
* Ported from ArtCraft (MIT OR Apache-2.0, © ArtCraft Team and contributors; see
|
|
10
|
+
* THIRD_PARTY_NOTICES.md): pdfcraft `crates/geom/src/perspective.rs` (`Homography::from_points`,
|
|
11
|
+
* `Homography::apply`, `solve8`, `order_quad`) and photocraft `crates/algo/src/transform.rs`
|
|
12
|
+
* (`Homography::square_to_quad`, `rect_to_quad`, `inverse`, `mul`, `local_scale`, `front_side`,
|
|
13
|
+
* `warp_output_bounds`, `convex_quad`).
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Gaussian elimination with partial pivoting on an 8×8 system (the 9th column of each row is the
|
|
18
|
+
* right-hand side). Null when the system is singular.
|
|
19
|
+
*/
|
|
20
|
+
declare function solve8(rows: readonly (readonly number[])[]): number[] | null;
|
|
21
|
+
/** The image of `p`, or null where the map sends it to infinity. */
|
|
22
|
+
declare function applyHomography(h: Homography, p: Vec2): Vec2 | null;
|
|
23
|
+
/**
|
|
24
|
+
* The projective map that takes each of `from` to the point at the same index of `to`. Null when
|
|
25
|
+
* three of either set are collinear or a coordinate is not finite.
|
|
26
|
+
*/
|
|
27
|
+
declare function homographyFromPoints(from: readonly Vec2[], to: readonly Vec2[]): Homography | null;
|
|
28
|
+
/**
|
|
29
|
+
* Whether `h` maps the whole convex quad `quad` without sending any of it through infinity (the
|
|
30
|
+
* denominator keeps one sign over it): what a usable distortion needs.
|
|
31
|
+
*/
|
|
32
|
+
declare function homographyKeepsQuad(h: Homography, quad: readonly Vec2[]): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The four corners in reading order for a y-down space: top-left, top-right, bottom-right,
|
|
35
|
+
* bottom-left, whatever order they come in. Null unless they form a convex quadrilateral with a
|
|
36
|
+
* non-negligible area.
|
|
37
|
+
*/
|
|
38
|
+
declare function orderQuad(points: readonly Vec2[]): Vec2[] | null;
|
|
39
|
+
/** The inverse map, or null for a singular one. */
|
|
40
|
+
declare function invertHomography(m: Homography): Homography | null;
|
|
41
|
+
/** An affine matrix (SVG order) as a homography. */
|
|
42
|
+
declare function homographyFromAffine(m: AffineMatrix): Homography;
|
|
43
|
+
/**
|
|
44
|
+
* The map taking box `r`'s corners onto `quad` (TL, TR, BR, BL), exact for parallelograms (then
|
|
45
|
+
* affine). Null for an empty box, a non-finite or degenerate quad, or a singular result.
|
|
46
|
+
*/
|
|
47
|
+
declare function rectToQuad(r: Box, quad: readonly Vec2[]): Homography | null;
|
|
48
|
+
/** Box `r`'s corners as a quad (TL, TR, BR, BL). */
|
|
49
|
+
declare function boxQuad(r: Box): Quad;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Text shapers for type layers (see `TextShaper` in `text.ts`):
|
|
53
|
+
*
|
|
54
|
+
* - `createCanvasTextShaper`: the browser's own fonts and text drawing through Canvas 2D
|
|
55
|
+
* (`measureText`, `fillText`). The default in browsers. It cannot give outlines.
|
|
56
|
+
* - `createOutlineTextShaper`: glyph outlines from font objects the host loads, typed after
|
|
57
|
+
* opentype.js's `Font` (`getPath`, `getAdvanceWidth`, `unitsPerEm`, …) without depending on it.
|
|
58
|
+
* Pure: it renders anywhere (servers, workers, tests) and makes Convert to Shape possible.
|
|
59
|
+
*/
|
|
60
|
+
|
|
61
|
+
/** A family as it goes into a CSS `font` value: generics and lists as written, other names quoted when needed. */
|
|
62
|
+
declare function cssFontFamily(family: string): string;
|
|
63
|
+
/** The CSS `font` shorthand for a font (`italic 700 24px Inter`). */
|
|
64
|
+
declare function cssFont(font: TextFont, family?: string): string;
|
|
65
|
+
interface CanvasTextShaperOptions {
|
|
66
|
+
/** A 1 × 1 canvas for measuring (default an `OffscreenCanvas`, else a DOM canvas). */
|
|
67
|
+
createCanvas?(width: number, height: number): HTMLCanvasElement | OffscreenCanvas;
|
|
68
|
+
/** Family used when one is missing (default `sans-serif`). */
|
|
69
|
+
fallbackFamily?: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A shaper over Canvas 2D. A family is missing when text set in it measures the same as in
|
|
73
|
+
* both `monospace` and `serif` (the browser fell back), so web fonts must be loaded before use.
|
|
74
|
+
* Returns `null` where there is no 2D canvas.
|
|
75
|
+
*/
|
|
76
|
+
declare function createCanvasTextShaper(options?: CanvasTextShaperOptions): TextShaper | null;
|
|
77
|
+
/** A path command as opentype.js returns it. */
|
|
78
|
+
interface OutlinePathCommand {
|
|
79
|
+
type: 'M' | 'L' | 'C' | 'Q' | 'Z';
|
|
80
|
+
x?: number;
|
|
81
|
+
y?: number;
|
|
82
|
+
x1?: number;
|
|
83
|
+
y1?: number;
|
|
84
|
+
x2?: number;
|
|
85
|
+
y2?: number;
|
|
86
|
+
}
|
|
87
|
+
/** The parts of an opentype.js `Font` the outline shaper uses. */
|
|
88
|
+
interface OutlineFontFace {
|
|
89
|
+
unitsPerEm: number;
|
|
90
|
+
ascender: number;
|
|
91
|
+
descender: number;
|
|
92
|
+
getAdvanceWidth(text: string, fontSize: number, options?: {
|
|
93
|
+
kerning?: boolean;
|
|
94
|
+
}): number;
|
|
95
|
+
getPath(text: string, x: number, y: number, fontSize: number, options?: {
|
|
96
|
+
kerning?: boolean;
|
|
97
|
+
}): {
|
|
98
|
+
commands: OutlinePathCommand[];
|
|
99
|
+
};
|
|
100
|
+
names?: {
|
|
101
|
+
fontFamily?: Record<string, string>;
|
|
102
|
+
postScriptName?: Record<string, string>;
|
|
103
|
+
};
|
|
104
|
+
tables?: {
|
|
105
|
+
os2?: {
|
|
106
|
+
usWeightClass?: number;
|
|
107
|
+
fsSelection?: number;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** A face with its family, weight and style (read from the font's names when not given). */
|
|
112
|
+
interface OutlineFontEntry {
|
|
113
|
+
face: OutlineFontFace;
|
|
114
|
+
family?: string;
|
|
115
|
+
weight?: number;
|
|
116
|
+
italic?: boolean;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A shaper over outline fonts the host loads (opentype.js `Font` objects or anything with the same
|
|
120
|
+
* methods). Fonts are matched by family (case-insensitive), then the nearest weight and the
|
|
121
|
+
* italic flag; a missing family uses `fallback` (default the first font) and is reported missing.
|
|
122
|
+
*/
|
|
123
|
+
declare function createOutlineTextShaper(fonts: ReadonlyArray<OutlineFontFace | OutlineFontEntry>, options?: {
|
|
124
|
+
fallback?: string;
|
|
125
|
+
id?: string;
|
|
126
|
+
}): TextShaper;
|
|
127
|
+
/**
|
|
128
|
+
* A shaper that needs no fonts: advances estimated per character class (narrow, wide, CJK), an
|
|
129
|
+
* ascent of 0.8 em and a descent of 0.2 em. It cannot draw or outline. Layout then runs in any
|
|
130
|
+
* host (servers, tests, agents without fonts) and gives stable, approximate lines; plug in a real
|
|
131
|
+
* shaper to match the fonts. Every family counts as available, since it cannot tell.
|
|
132
|
+
*/
|
|
133
|
+
declare function createMetricTextShaper(options?: {
|
|
134
|
+
id?: string;
|
|
135
|
+
}): TextShaper;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* A small OpenType reader: enough of a font file to set Latin, Cyrillic, Greek and CJK text as
|
|
139
|
+
* outlines without a third-party library. It reads TrueType (`glyf`) and CFF (`CFF `, CID-keyed
|
|
140
|
+
* included) outlines, `cmap` (formats 4 and 12), horizontal metrics, `kern` (format 0) and `GPOS`
|
|
141
|
+
* pair kerning (lookup type 2, formats 1 and 2, the `kern` feature), and the family, PostScript
|
|
142
|
+
* name, weight and style. It does not apply `GSUB` (ligatures, contextual forms) or complex-script
|
|
143
|
+
* shaping, so Arabic, Indic and similar scripts set as isolated glyphs.
|
|
144
|
+
*
|
|
145
|
+
* The result has the shape of opentype.js's `Font` that `createOutlineTextShaper` takes, so hosts
|
|
146
|
+
* can pass either. Written from the OpenType specification (TrueType glyph outlines, the CFF
|
|
147
|
+
* specification and the Type 2 charstring format), not ported.
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
/** A parsed font, usable as an `OutlineFontFace`. */
|
|
151
|
+
interface OpenTypeFont extends OutlineFontFace {
|
|
152
|
+
/** The family name (typographic family when the font has one). */
|
|
153
|
+
readonly family: string;
|
|
154
|
+
/** The subfamily ("Bold Italic"). */
|
|
155
|
+
readonly style: string;
|
|
156
|
+
readonly postScriptName: string;
|
|
157
|
+
readonly weight: number;
|
|
158
|
+
readonly italic: boolean;
|
|
159
|
+
readonly numGlyphs: number;
|
|
160
|
+
/** `glyf` (TrueType quadratic outlines) or `cff` (cubic). */
|
|
161
|
+
readonly outlines: 'glyf' | 'cff';
|
|
162
|
+
/** The glyph for a code point (0, `.notdef`, when the font lacks it). */
|
|
163
|
+
glyphIndex(codePoint: number): number;
|
|
164
|
+
/** A glyph's advance in font units. */
|
|
165
|
+
advance(glyph: number): number;
|
|
166
|
+
/** Kerning between two glyphs in font units (negative pulls them together). */
|
|
167
|
+
kerning(left: number, right: number): number;
|
|
168
|
+
/** A glyph's outline in font units, y up, origin on the baseline. */
|
|
169
|
+
glyphPath(glyph: number): OutlinePathCommand[];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Reads a TrueType or OpenType font (`.ttf`, `.otf`, or face `index` of a `.ttc` collection).
|
|
173
|
+
* Throws with the reason when the file is not one, or lacks the tables layout needs. For WOFF files
|
|
174
|
+
* use `loadOpenTypeFont`.
|
|
175
|
+
*/
|
|
176
|
+
declare function parseOpenTypeFont(data: ArrayBuffer | ArrayBufferView, options?: {
|
|
177
|
+
index?: number;
|
|
178
|
+
}): OpenTypeFont;
|
|
179
|
+
/**
|
|
180
|
+
* Reads a font file: TrueType, OpenType, a collection (`index`) or WOFF 1.0 (decompressed with the
|
|
181
|
+
* platform's `DecompressionStream`). WOFF2 needs Brotli, which browsers do not expose, so it is
|
|
182
|
+
* refused with a hint.
|
|
183
|
+
*/
|
|
184
|
+
declare function loadOpenTypeFont(data: ArrayBuffer | ArrayBufferView | Blob, options?: {
|
|
185
|
+
index?: number;
|
|
186
|
+
}): Promise<OpenTypeFont>;
|
|
187
|
+
|
|
188
|
+
export { type CanvasTextShaperOptions as C, type OpenTypeFont as O, type OutlineFontEntry as a, type OutlineFontFace as b, type OutlinePathCommand as c, applyHomography as d, createCanvasTextShaper as e, createMetricTextShaper as f, createOutlineTextShaper as g, cssFontFamily as h, homographyFromPoints as i, homographyKeepsQuad as j, boxQuad as k, loadOpenTypeFont as l, cssFont as m, homographyFromAffine as n, orderQuad as o, parseOpenTypeFont as p, invertHomography as q, rectToQuad as r, solve8 as s };
|
package/dist/paint/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
var _chunkDFQEX3AMcjs = require('../chunk-DFQEX3AM.cjs');
|
|
31
32
|
|
|
32
33
|
|
|
33
34
|
|
|
@@ -38,7 +39,6 @@
|
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
var _chunk7VOHOPLWcjs = require('../chunk-7VOHOPLW.cjs');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -51,7 +51,6 @@ var _chunk7VOHOPLWcjs = require('../chunk-7VOHOPLW.cjs');
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
var _chunkXIOMMGPDcjs = require('../chunk-XIOMMGPD.cjs');
|
|
55
54
|
|
|
56
55
|
|
|
57
56
|
|
|
@@ -69,6 +68,7 @@ var _chunkXIOMMGPDcjs = require('../chunk-XIOMMGPD.cjs');
|
|
|
69
68
|
|
|
70
69
|
|
|
71
70
|
|
|
71
|
+
var _chunkTCKIXI46cjs = require('../chunk-TCKIXI46.cjs');
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
@@ -81,6 +81,7 @@ var _chunkXIOMMGPDcjs = require('../chunk-XIOMMGPD.cjs');
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
|
|
84
|
+
var _chunkTFOPHZ3Ucjs = require('../chunk-TFOPHZ3U.cjs');
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
|
|
@@ -102,5 +103,63 @@ var _chunkXIOMMGPDcjs = require('../chunk-XIOMMGPD.cjs');
|
|
|
102
103
|
|
|
103
104
|
|
|
104
105
|
|
|
105
|
-
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
exports.CoverageMap = _chunkTCKIXI46cjs.CoverageMap; exports.DEFAULT_BLENDER = _chunkTCKIXI46cjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkTCKIXI46cjs.DEFAULT_BRUSH; exports.DEFAULT_MIXER = _chunkTCKIXI46cjs.DEFAULT_MIXER; exports.DEFAULT_RETOUCH = _chunkDFQEX3AMcjs.DEFAULT_RETOUCH; exports.DEFAULT_SMUDGE = _chunkTCKIXI46cjs.DEFAULT_SMUDGE; exports.DabWalker = _chunkTCKIXI46cjs.DabWalker; exports.EMPTY_MIXER_LOAD = _chunkTCKIXI46cjs.EMPTY_MIXER_LOAD; exports.MAX_BRUSH_SIZE = _chunkTCKIXI46cjs.MAX_BRUSH_SIZE; exports.MIXER_DRAIN = _chunkTCKIXI46cjs.MIXER_DRAIN; exports.MIXER_PICKUP_RATE = _chunkTCKIXI46cjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkTCKIXI46cjs.MIXING_MODELS; exports.MixerStroke = _chunkTCKIXI46cjs.MixerStroke; exports.PIGMENT_BANDS = _chunkTFOPHZ3Ucjs.PIGMENT_BANDS; exports.PIGMENT_LAMBDA_MIN = _chunkTFOPHZ3Ucjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkTFOPHZ3Ucjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_WAVELENGTHS = _chunkTFOPHZ3Ucjs.PIGMENT_WAVELENGTHS; exports.PaintExchange = _chunkTCKIXI46cjs.PaintExchange; exports.RETOUCH_SAMPLES = _chunkDFQEX3AMcjs.RETOUCH_SAMPLES; exports.RegionPixelSource = _chunkDFQEX3AMcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkDFQEX3AMcjs.RetouchDabStroke; exports.SPOT_HEAL_TYPES = _chunkDFQEX3AMcjs.SPOT_HEAL_TYPES; exports.SmudgeTip = _chunkTCKIXI46cjs.SmudgeTip; exports.StrokeCoverage = _chunkTCKIXI46cjs.StrokeCoverage; exports.TONE_RANGES = _chunkDFQEX3AMcjs.TONE_RANGES; exports.TileMedium = _chunkTCKIXI46cjs.TileMedium; exports.TilePixelSource = _chunkDFQEX3AMcjs.TilePixelSource; exports.applyRetouchToTile = _chunkDFQEX3AMcjs.applyRetouchToTile; exports.applyStrokeToTile = _chunkTCKIXI46cjs.applyStrokeToTile; exports.bestOffset = _chunkDFQEX3AMcjs.bestOffset; exports.blendRadius = _chunkTCKIXI46cjs.blendRadius; exports.blenderDab = _chunkTCKIXI46cjs.blenderDab; exports.cleanMixer = _chunkTCKIXI46cjs.cleanMixer; exports.coverageTileCoord = _chunkTCKIXI46cjs.coverageTileCoord; exports.createBlenderScratch = _chunkTCKIXI46cjs.createBlenderScratch; exports.createPigment = _chunkTFOPHZ3Ucjs.createPigment; exports.createPigmentTools = _chunkTCKIXI46cjs.createPigmentTools; exports.dabCoverage = _chunkTCKIXI46cjs.dabCoverage; exports.dabRect = _chunkTCKIXI46cjs.dabRect; exports.dilateMask = _chunkDFQEX3AMcjs.dilateMask; exports.dodgeBurn = _chunkDFQEX3AMcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkDFQEX3AMcjs.dodgeBurnCurve; exports.exchangeRates = _chunkTCKIXI46cjs.exchangeRates; exports.healPixels = _chunkDFQEX3AMcjs.healPixels; exports.lerpPigment = _chunkTFOPHZ3Ucjs.lerpPigment; exports.lerpPigmentInto = _chunkTFOPHZ3Ucjs.lerpPigmentInto; exports.loadMixer = _chunkTCKIXI46cjs.loadMixer; exports.luma = _chunkDFQEX3AMcjs.luma; exports.maskBounds = _chunkDFQEX3AMcjs.maskBounds; exports.membraneFill = _chunkDFQEX3AMcjs.membraneFill; exports.mixPigments = _chunkTFOPHZ3Ucjs.mixPigments; exports.mixerRates = _chunkTCKIXI46cjs.mixerRates; exports.normalizeBlender = _chunkTCKIXI46cjs.normalizeBlender; exports.normalizeBrush = _chunkTCKIXI46cjs.normalizeBrush; exports.normalizeMixer = _chunkTCKIXI46cjs.normalizeMixer; exports.normalizeRetouch = _chunkDFQEX3AMcjs.normalizeRetouch; exports.normalizeSmudge = _chunkTCKIXI46cjs.normalizeSmudge; exports.perDabStrength = _chunkDFQEX3AMcjs.perDabStrength; exports.rasterizeDab = _chunkTCKIXI46cjs.rasterizeDab; exports.readSourceRegion = _chunkDFQEX3AMcjs.readSourceRegion; exports.reflectanceToRgb = _chunkTFOPHZ3Ucjs.reflectanceToRgb; exports.rgbToReflectance = _chunkTFOPHZ3Ucjs.rgbToReflectance; exports.rgbaViewOfGrey = _chunkDFQEX3AMcjs.rgbaViewOfGrey; exports.saturationOf = _chunkDFQEX3AMcjs.saturationOf; exports.seamlessClone = _chunkDFQEX3AMcjs.seamlessClone; exports.setPigmentColor = _chunkTFOPHZ3Ucjs.setPigmentColor; exports.smoothPoints = _chunkTCKIXI46cjs.smoothPoints; exports.smudgeEffect = _chunkDFQEX3AMcjs.smudgeEffect; exports.solveMembrane = _chunkDFQEX3AMcjs.solveMembrane; exports.sponge = _chunkDFQEX3AMcjs.sponge; exports.spongeEffect = _chunkDFQEX3AMcjs.spongeEffect; exports.spotHealPixels = _chunkDFQEX3AMcjs.spotHealPixels; exports.spotHealWindow = _chunkDFQEX3AMcjs.spotHealWindow; exports.tipFalloff = _chunkTCKIXI46cjs.tipFalloff; exports.tipReach = _chunkTCKIXI46cjs.tipReach; exports.tipShape = _chunkTCKIXI46cjs.tipShape; exports.toneOf = _chunkDFQEX3AMcjs.toneOf; exports.walkDabs = _chunkTCKIXI46cjs.walkDabs;
|
|
106
165
|
//# sourceMappingURL=index.cjs.map
|
package/dist/paint/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/paint/index.cjs"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/paint/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,q0IAAC","file":"/home/runner/work/editor/editor/packages/core/dist/paint/index.cjs"}
|
package/dist/paint/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { m as BlenderScratch, b as BlenderSettings, B as BrushSettings, C as CoverageMap, n as DEFAULT_BLENDER, o as DEFAULT_BRUSH, p as DEFAULT_MIXER, q as DEFAULT_RETOUCH, r as DEFAULT_SMUDGE, D as Dab, s as DabWalker, E as EMPTY_MIXER_LOAD, t as ExchangeRates, e as MAX_BRUSH_SIZE, u as MIXER_DRAIN, v as MIXER_PICKUP_RATE, w as MIXING_MODELS, d as MixerLoad, M as MixerSettings, i as MixerStroke, h as MixerTarget, a as MixingModel, x as PaintExchange, y as PaintMedium, z as PaintSample, P as PaintTileTarget, A as PixelSource, F as RETOUCH_SAMPLES, G as RegionPixelSource, j as RetouchApply, H as RetouchDabEffect, I as RetouchDabStroke, k as RetouchPaint, J as RetouchSample, f as RetouchSettings, R as RgbTriple, K as SPOT_HEAL_TYPES, L as SmudgeDab, S as SmudgeSettings, N as SmudgeTip, O as SpotHealType, l as StrokeApply, g as StrokeCoverage, c as StrokePoint, T as TONE_RANGES, Q as TileMedium, U as TileMediumOptions, V as TilePixelSource, W as ToneRange, X as applyRetouchToTile, Y as applyStrokeToTile, Z as blendRadius, _ as blenderDab, $ as cleanMixer, a0 as coverageTileCoord, a1 as createBlenderScratch, a2 as dabCoverage, a3 as dabRect, a4 as dodgeBurn, a5 as dodgeBurnCurve, a6 as exchangeRates, a7 as healPixels, a8 as loadMixer, a9 as luma, aa as mixerRates, ab as normalizeBlender, ac as normalizeBrush, ad as normalizeMixer, ae as normalizeRetouch, af as normalizeSmudge, ag as perDabStrength, ah as rasterizeDab, ai as readSourceRegion, aj as rgbaViewOfGrey, ak as saturationOf, al as smoothPoints, am as smudgeEffect, an as sponge, ao as spongeEffect, ap as spotHealPixels, aq as spotHealWindow, ar as tipFalloff, as as tipReach, at as tipShape, au as toneOf, av as walkDabs } from '../retouch-Bxkuc0KH.cjs';
|
|
2
|
+
export { Z as PIGMENT_BANDS, _ as PIGMENT_LAMBDA_MIN, $ as PIGMENT_LAMBDA_STEP, a0 as PIGMENT_WAVELENGTHS, Y as Pigment, a1 as PigmentOptions, a2 as PigmentRgb, a3 as createPigment, a4 as lerpPigment, a5 as lerpPigmentInto, a6 as mixPigments, a7 as reflectanceToRgb, a8 as rgbToReflectance, a9 as setPigmentColor } from '../surface-Cn30xIV6.cjs';
|
|
3
3
|
import { A as AgentTool } from '../registry-BqA1AZt0.cjs';
|
|
4
4
|
import '../schema-Di0CS6Pe.cjs';
|
|
5
5
|
|
|
@@ -9,4 +9,31 @@ import '../schema-Di0CS6Pe.cjs';
|
|
|
9
9
|
*/
|
|
10
10
|
declare function createPigmentTools(): AgentTool[];
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Solves `Δv = 0` on the `unknown` pixels, with the known pixels of `v` as Dirichlet values
|
|
14
|
+
* (neighbours off the grid are ignored: a free boundary). `v` holds the known values on entry and
|
|
15
|
+
* the solution on exit.
|
|
16
|
+
*/
|
|
17
|
+
declare function solveMembrane(w: number, h: number, unknown: ArrayLike<boolean | number>, v: Float32Array): void;
|
|
18
|
+
/**
|
|
19
|
+
* Seamless cloning: `dst` outside `mask`; inside, `src` plus the membrane that removes the
|
|
20
|
+
* mismatch at the mask's edge. So the result keeps the source's texture and takes the
|
|
21
|
+
* destination's colour and light. `src` and `dst` are interleaved `w × h × ch`; leave a one-pixel
|
|
22
|
+
* unmasked margin for a fully fixed boundary.
|
|
23
|
+
*/
|
|
24
|
+
declare function seamlessClone(w: number, h: number, ch: number, src: ArrayLike<number>, dst: ArrayLike<number>, mask: ArrayLike<boolean | number>): Float32Array;
|
|
25
|
+
/** Membrane fill (no source texture): the known pixels interpolated smoothly into `hole`. */
|
|
26
|
+
declare function membraneFill(w: number, h: number, ch: number, img: ArrayLike<number>, hole: ArrayLike<boolean | number>): Float32Array;
|
|
27
|
+
/** A mask grown by `r` pixels (square structuring element). */
|
|
28
|
+
declare function dilateMask(w: number, h: number, mask: ArrayLike<boolean | number>, r: number): Uint8Array;
|
|
29
|
+
/** Bounding box [x0, y0, x1, y1) of the set cells, or null. */
|
|
30
|
+
declare function maskBounds(w: number, h: number, mask: ArrayLike<boolean | number>): [number, number, number, number] | null;
|
|
31
|
+
/**
|
|
32
|
+
* Proximity match: the translation `(dx, dy)` (within `maxRadius`) whose pixels best match the
|
|
33
|
+
* ring of `ring` pixels around the hole (sum of squared differences), so `img[p + (dx, dy)]` can
|
|
34
|
+
* fill `p` in the hole. The source window must lie on the grid and hold no hole pixels. Nearer
|
|
35
|
+
* sources win ties. Returns null when no translation fits.
|
|
36
|
+
*/
|
|
37
|
+
declare function bestOffset(w: number, h: number, ch: number, img: ArrayLike<number>, hole: ArrayLike<boolean | number>, ring: number, maxRadius: number): [number, number] | null;
|
|
38
|
+
|
|
39
|
+
export { bestOffset, createPigmentTools, dilateMask, maskBounds, membraneFill, seamlessClone, solveMembrane };
|
package/dist/paint/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { m as BlenderScratch, b as BlenderSettings, B as BrushSettings, C as CoverageMap, n as DEFAULT_BLENDER, o as DEFAULT_BRUSH, p as DEFAULT_MIXER, q as DEFAULT_RETOUCH, r as DEFAULT_SMUDGE, D as Dab, s as DabWalker, E as EMPTY_MIXER_LOAD, t as ExchangeRates, e as MAX_BRUSH_SIZE, u as MIXER_DRAIN, v as MIXER_PICKUP_RATE, w as MIXING_MODELS, d as MixerLoad, M as MixerSettings, i as MixerStroke, h as MixerTarget, a as MixingModel, x as PaintExchange, y as PaintMedium, z as PaintSample, P as PaintTileTarget, A as PixelSource, F as RETOUCH_SAMPLES, G as RegionPixelSource, j as RetouchApply, H as RetouchDabEffect, I as RetouchDabStroke, k as RetouchPaint, J as RetouchSample, f as RetouchSettings, R as RgbTriple, K as SPOT_HEAL_TYPES, L as SmudgeDab, S as SmudgeSettings, N as SmudgeTip, O as SpotHealType, l as StrokeApply, g as StrokeCoverage, c as StrokePoint, T as TONE_RANGES, Q as TileMedium, U as TileMediumOptions, V as TilePixelSource, W as ToneRange, X as applyRetouchToTile, Y as applyStrokeToTile, Z as blendRadius, _ as blenderDab, $ as cleanMixer, a0 as coverageTileCoord, a1 as createBlenderScratch, a2 as dabCoverage, a3 as dabRect, a4 as dodgeBurn, a5 as dodgeBurnCurve, a6 as exchangeRates, a7 as healPixels, a8 as loadMixer, a9 as luma, aa as mixerRates, ab as normalizeBlender, ac as normalizeBrush, ad as normalizeMixer, ae as normalizeRetouch, af as normalizeSmudge, ag as perDabStrength, ah as rasterizeDab, ai as readSourceRegion, aj as rgbaViewOfGrey, ak as saturationOf, al as smoothPoints, am as smudgeEffect, an as sponge, ao as spongeEffect, ap as spotHealPixels, aq as spotHealWindow, ar as tipFalloff, as as tipReach, at as tipShape, au as toneOf, av as walkDabs } from '../retouch-Do6tBs2H.js';
|
|
2
|
+
export { Z as PIGMENT_BANDS, _ as PIGMENT_LAMBDA_MIN, $ as PIGMENT_LAMBDA_STEP, a0 as PIGMENT_WAVELENGTHS, Y as Pigment, a1 as PigmentOptions, a2 as PigmentRgb, a3 as createPigment, a4 as lerpPigment, a5 as lerpPigmentInto, a6 as mixPigments, a7 as reflectanceToRgb, a8 as rgbToReflectance, a9 as setPigmentColor } from '../surface-Cn30xIV6.js';
|
|
3
3
|
import { A as AgentTool } from '../registry-D-4fit9C.js';
|
|
4
4
|
import '../schema-Di0CS6Pe.js';
|
|
5
5
|
|
|
@@ -9,4 +9,31 @@ import '../schema-Di0CS6Pe.js';
|
|
|
9
9
|
*/
|
|
10
10
|
declare function createPigmentTools(): AgentTool[];
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Solves `Δv = 0` on the `unknown` pixels, with the known pixels of `v` as Dirichlet values
|
|
14
|
+
* (neighbours off the grid are ignored: a free boundary). `v` holds the known values on entry and
|
|
15
|
+
* the solution on exit.
|
|
16
|
+
*/
|
|
17
|
+
declare function solveMembrane(w: number, h: number, unknown: ArrayLike<boolean | number>, v: Float32Array): void;
|
|
18
|
+
/**
|
|
19
|
+
* Seamless cloning: `dst` outside `mask`; inside, `src` plus the membrane that removes the
|
|
20
|
+
* mismatch at the mask's edge. So the result keeps the source's texture and takes the
|
|
21
|
+
* destination's colour and light. `src` and `dst` are interleaved `w × h × ch`; leave a one-pixel
|
|
22
|
+
* unmasked margin for a fully fixed boundary.
|
|
23
|
+
*/
|
|
24
|
+
declare function seamlessClone(w: number, h: number, ch: number, src: ArrayLike<number>, dst: ArrayLike<number>, mask: ArrayLike<boolean | number>): Float32Array;
|
|
25
|
+
/** Membrane fill (no source texture): the known pixels interpolated smoothly into `hole`. */
|
|
26
|
+
declare function membraneFill(w: number, h: number, ch: number, img: ArrayLike<number>, hole: ArrayLike<boolean | number>): Float32Array;
|
|
27
|
+
/** A mask grown by `r` pixels (square structuring element). */
|
|
28
|
+
declare function dilateMask(w: number, h: number, mask: ArrayLike<boolean | number>, r: number): Uint8Array;
|
|
29
|
+
/** Bounding box [x0, y0, x1, y1) of the set cells, or null. */
|
|
30
|
+
declare function maskBounds(w: number, h: number, mask: ArrayLike<boolean | number>): [number, number, number, number] | null;
|
|
31
|
+
/**
|
|
32
|
+
* Proximity match: the translation `(dx, dy)` (within `maxRadius`) whose pixels best match the
|
|
33
|
+
* ring of `ring` pixels around the hole (sum of squared differences), so `img[p + (dx, dy)]` can
|
|
34
|
+
* fill `p` in the hole. The source window must lie on the grid and hold no hole pixels. Nearer
|
|
35
|
+
* sources win ties. Returns null when no translation fits.
|
|
36
|
+
*/
|
|
37
|
+
declare function bestOffset(w: number, h: number, ch: number, img: ArrayLike<number>, hole: ArrayLike<boolean | number>, ring: number, maxRadius: number): [number, number] | null;
|
|
38
|
+
|
|
39
|
+
export { bestOffset, createPigmentTools, dilateMask, maskBounds, membraneFill, seamlessClone, solveMembrane };
|