@pixerate/editor 0.113.0 → 0.115.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 +8 -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-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-4KLT7ZYS.cjs → chunk-DFQEX3AM.cjs} +29 -29
- package/dist/{chunk-4KLT7ZYS.cjs.map → chunk-DFQEX3AM.cjs.map} +1 -1
- package/dist/chunk-G5NMLUVF.cjs +2574 -0
- package/dist/chunk-G5NMLUVF.cjs.map +1 -0
- package/dist/{chunk-YGIMK4NX.cjs → chunk-I7FQBWMQ.cjs} +813 -842
- package/dist/chunk-I7FQBWMQ.cjs.map +1 -0
- package/dist/{chunk-LPYOIVLA.js → chunk-LKCYANMW.js} +3 -3
- 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-CZOXTEMN.js → chunk-XICA4PVO.js} +392 -421
- package/dist/chunk-XICA4PVO.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/cms/index.js.map +1 -0
- package/dist/{export-CEXEzqBf.d.cts → export-BJE8T0YA.d.cts} +279 -191
- package/dist/{export-DIkoK8-r.d.ts → export-Con3UKkm.d.ts} +279 -191
- package/dist/image-editor/index.cjs +1848 -1218
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +85 -93
- package/dist/image-editor/index.d.ts +85 -93
- package/dist/image-editor/index.js +871 -241
- 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 +4 -4
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint/index.js +3 -3
- package/dist/paint-editor/index.cjs +147 -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 +7 -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/{retouch-CEIKR22W.d.cts → retouch-Bxkuc0KH.d.cts} +1 -1
- package/dist/{retouch-BXmeSCaB.d.ts → retouch-Do6tBs2H.d.ts} +1 -1
- package/dist/{surface-C8RRg_Bh.d.cts → surface-Cn30xIV6.d.cts} +6 -1
- package/dist/{surface-C8RRg_Bh.d.ts → 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 +9 -2
- package/skills/pixerate-image-editor/SKILL.md +13 -36
- package/skills/pixerate-image-editor/references/color-management.md +42 -0
- package/skills/pixerate-image-editor/references/photoshop-files.md +41 -0
- package/skills/pixerate-paint-editor/SKILL.md +136 -4
- package/skills/pixerate-vector/SKILL.md +72 -2
- package/dist/chunk-BLWCAQCW.js.map +0 -1
- package/dist/chunk-CZOXTEMN.js.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-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-LPYOIVLA.js.map → chunk-LKCYANMW.js.map} +0 -0
- /package/dist/{chunk-Z4BC6M74.js.map → chunk-UBIXVXPR.js.map} +0 -0
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { H as Homography, V as Vec2, B as Box, Q as Quad, A as AffineMatrix } from './types-CwMPoRMU.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Perspective (projective) maps between quadrilaterals: Free Distort and Perspective in both the
|
|
5
|
-
* vector and the image editor. Pure maths; degenerate or non-finite input gives `null` instead of
|
|
6
|
-
* NaNs.
|
|
7
|
-
*
|
|
8
|
-
* Ported from ArtCraft (MIT OR Apache-2.0, © ArtCraft Team and contributors; see
|
|
9
|
-
* THIRD_PARTY_NOTICES.md): pdfcraft `crates/geom/src/perspective.rs` (`Homography::from_points`,
|
|
10
|
-
* `Homography::apply`, `solve8`, `order_quad`) and photocraft `crates/algo/src/transform.rs`
|
|
11
|
-
* (`Homography::square_to_quad`, `rect_to_quad`, `inverse`, `mul`, `local_scale`, `front_side`,
|
|
12
|
-
* `warp_output_bounds`, `convex_quad`).
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Gaussian elimination with partial pivoting on an 8×8 system (the 9th column of each row is the
|
|
17
|
-
* right-hand side). Null when the system is singular.
|
|
18
|
-
*/
|
|
19
|
-
declare function solve8(rows: readonly (readonly number[])[]): number[] | null;
|
|
20
|
-
/** The image of `p`, or null where the map sends it to infinity. */
|
|
21
|
-
declare function applyHomography(h: Homography, p: Vec2): Vec2 | null;
|
|
22
|
-
/**
|
|
23
|
-
* The projective map that takes each of `from` to the point at the same index of `to`. Null when
|
|
24
|
-
* three of either set are collinear or a coordinate is not finite.
|
|
25
|
-
*/
|
|
26
|
-
declare function homographyFromPoints(from: readonly Vec2[], to: readonly Vec2[]): Homography | null;
|
|
27
|
-
/**
|
|
28
|
-
* Whether `h` maps the whole convex quad `quad` without sending any of it through infinity (the
|
|
29
|
-
* denominator keeps one sign over it): what a usable distortion needs.
|
|
30
|
-
*/
|
|
31
|
-
declare function homographyKeepsQuad(h: Homography, quad: readonly Vec2[]): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* The four corners in reading order for a y-down space: top-left, top-right, bottom-right,
|
|
34
|
-
* bottom-left, whatever order they come in. Null unless they form a convex quadrilateral with a
|
|
35
|
-
* non-negligible area.
|
|
36
|
-
*/
|
|
37
|
-
declare function orderQuad(points: readonly Vec2[]): Vec2[] | null;
|
|
38
|
-
/** The inverse map, or null for a singular one. */
|
|
39
|
-
declare function invertHomography(m: Homography): Homography | null;
|
|
40
|
-
/** An affine matrix (SVG order) as a homography. */
|
|
41
|
-
declare function homographyFromAffine(m: AffineMatrix): Homography;
|
|
42
|
-
/**
|
|
43
|
-
* The map taking box `r`'s corners onto `quad` (TL, TR, BR, BL), exact for parallelograms (then
|
|
44
|
-
* affine). Null for an empty box, a non-finite or degenerate quad, or a singular result.
|
|
45
|
-
*/
|
|
46
|
-
declare function rectToQuad(r: Box, quad: readonly Vec2[]): Homography | null;
|
|
47
|
-
/** Box `r`'s corners as a quad (TL, TR, BR, BL). */
|
|
48
|
-
declare function boxQuad(r: Box): Quad;
|
|
49
|
-
|
|
50
|
-
export { applyHomography as a, homographyKeepsQuad as b, boxQuad as c, homographyFromAffine as d, homographyFromPoints as h, invertHomography as i, orderQuad as o, rectToQuad as r, solve8 as s };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { H as Homography, V as Vec2, B as Box, Q as Quad, A as AffineMatrix } from './types-CwMPoRMU.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Perspective (projective) maps between quadrilaterals: Free Distort and Perspective in both the
|
|
5
|
-
* vector and the image editor. Pure maths; degenerate or non-finite input gives `null` instead of
|
|
6
|
-
* NaNs.
|
|
7
|
-
*
|
|
8
|
-
* Ported from ArtCraft (MIT OR Apache-2.0, © ArtCraft Team and contributors; see
|
|
9
|
-
* THIRD_PARTY_NOTICES.md): pdfcraft `crates/geom/src/perspective.rs` (`Homography::from_points`,
|
|
10
|
-
* `Homography::apply`, `solve8`, `order_quad`) and photocraft `crates/algo/src/transform.rs`
|
|
11
|
-
* (`Homography::square_to_quad`, `rect_to_quad`, `inverse`, `mul`, `local_scale`, `front_side`,
|
|
12
|
-
* `warp_output_bounds`, `convex_quad`).
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Gaussian elimination with partial pivoting on an 8×8 system (the 9th column of each row is the
|
|
17
|
-
* right-hand side). Null when the system is singular.
|
|
18
|
-
*/
|
|
19
|
-
declare function solve8(rows: readonly (readonly number[])[]): number[] | null;
|
|
20
|
-
/** The image of `p`, or null where the map sends it to infinity. */
|
|
21
|
-
declare function applyHomography(h: Homography, p: Vec2): Vec2 | null;
|
|
22
|
-
/**
|
|
23
|
-
* The projective map that takes each of `from` to the point at the same index of `to`. Null when
|
|
24
|
-
* three of either set are collinear or a coordinate is not finite.
|
|
25
|
-
*/
|
|
26
|
-
declare function homographyFromPoints(from: readonly Vec2[], to: readonly Vec2[]): Homography | null;
|
|
27
|
-
/**
|
|
28
|
-
* Whether `h` maps the whole convex quad `quad` without sending any of it through infinity (the
|
|
29
|
-
* denominator keeps one sign over it): what a usable distortion needs.
|
|
30
|
-
*/
|
|
31
|
-
declare function homographyKeepsQuad(h: Homography, quad: readonly Vec2[]): boolean;
|
|
32
|
-
/**
|
|
33
|
-
* The four corners in reading order for a y-down space: top-left, top-right, bottom-right,
|
|
34
|
-
* bottom-left, whatever order they come in. Null unless they form a convex quadrilateral with a
|
|
35
|
-
* non-negligible area.
|
|
36
|
-
*/
|
|
37
|
-
declare function orderQuad(points: readonly Vec2[]): Vec2[] | null;
|
|
38
|
-
/** The inverse map, or null for a singular one. */
|
|
39
|
-
declare function invertHomography(m: Homography): Homography | null;
|
|
40
|
-
/** An affine matrix (SVG order) as a homography. */
|
|
41
|
-
declare function homographyFromAffine(m: AffineMatrix): Homography;
|
|
42
|
-
/**
|
|
43
|
-
* The map taking box `r`'s corners onto `quad` (TL, TR, BR, BL), exact for parallelograms (then
|
|
44
|
-
* affine). Null for an empty box, a non-finite or degenerate quad, or a singular result.
|
|
45
|
-
*/
|
|
46
|
-
declare function rectToQuad(r: Box, quad: readonly Vec2[]): Homography | null;
|
|
47
|
-
/** Box `r`'s corners as a quad (TL, TR, BR, BL). */
|
|
48
|
-
declare function boxQuad(r: Box): Quad;
|
|
49
|
-
|
|
50
|
-
export { applyHomography as a, homographyKeepsQuad as b, boxQuad as c, homographyFromAffine as d, homographyFromPoints as h, invertHomography as i, orderQuad as o, rectToQuad as r, solve8 as s };
|
package/dist/warp-CWHZzE3x.d.ts
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { W as WarpStyle, a as WarpMesh, V as Vec2, B as Box } from './types-CwMPoRMU.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Warp geometry shared by the vector editor's envelopes and the image editor's Free Transform
|
|
5
|
-
* warp: preset warp styles and editable Bézier meshes, both forward maps from a source box onto
|
|
6
|
-
* the plane.
|
|
7
|
-
*
|
|
8
|
-
* - **Presets** (`WarpStyle`, Photoshop's fifteen with bend and horizontal / vertical distortion
|
|
9
|
-
* in percent): each is one bicubic Bézier patch whose 4 × 4 control grid follows the bend
|
|
10
|
-
* (`warpPresetGrid`). Every preset is the identity at bend 0 and continuous in it.
|
|
11
|
-
* - **Meshes** (`WarpMesh`): a grid of bicubic patches. Splitting a mesh (`splitWarpMeshU` / `V`)
|
|
12
|
-
* is an exact de Casteljau subdivision, so it never changes the shape, and a preset turns into
|
|
13
|
-
* an editable mesh of any size exactly.
|
|
14
|
-
*
|
|
15
|
-
* Ported from ArtCraft (MIT OR Apache-2.0, © ArtCraft Team and contributors; see
|
|
16
|
-
* THIRD_PARTY_NOTICES.md): photocraft `crates/geom/src/warp.rs` (`WarpStyle`, `StyleWarp`,
|
|
17
|
-
* `rest_grid`, `edge_arc`, `arc_grid`, `blend_rows`, `preset_grid`, `bernstein`, `split_cubic`,
|
|
18
|
-
* `BERN_INV`, and `BezierMesh`: `identity`, `fit`, `eval`, `split_u`, `split_v`, `remove_split_u`,
|
|
19
|
-
* `transpose`, `map_points`, `param_at`, `pull`, `smooth_lines`, `drag_point`, `control_bounds`;
|
|
20
|
-
* `Warp::map` and `Warp::to_mesh`).
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/** The fifteen presets in Photoshop's menu order. */
|
|
24
|
-
declare const WARP_STYLES: readonly WarpStyle[];
|
|
25
|
-
declare const WARP_STYLE_LABELS: Readonly<Record<WarpStyle, string>>;
|
|
26
|
-
/**
|
|
27
|
-
* A preset as a Bézier control grid (rows of `[x, y]` in box units, y down). `b`, `hd`, `vd` are
|
|
28
|
-
* the bend and the horizontal / vertical distortion as fractions (−1…1); `aspect` is the box's
|
|
29
|
-
* height over its width. The arc family stays circular in pixels, the other offsets scale with the
|
|
30
|
-
* box, and a vertical warp is the horizontal one with the axes (and distortions) swapped.
|
|
31
|
-
*/
|
|
32
|
-
declare function warpPresetGrid(style: WarpStyle, b: number, hd: number, vd: number, vertical: boolean, aspect: number): [number, number][][];
|
|
33
|
-
/** A preset warp's settings (bend and distortions in percent, −100…100). */
|
|
34
|
-
interface WarpPreset {
|
|
35
|
-
style: WarpStyle;
|
|
36
|
-
bend: number;
|
|
37
|
-
horizontal?: number;
|
|
38
|
-
vertical?: number;
|
|
39
|
-
/** Bend along the vertical axis. */
|
|
40
|
-
orientation?: 'horizontal' | 'vertical';
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* A preset as one Bézier patch over `bounds` (points in the bounds' space), or null when it
|
|
44
|
-
* changes nothing (an unknown style, all-zero amounts, or an empty box).
|
|
45
|
-
*/
|
|
46
|
-
declare function warpPresetMesh(preset: WarpPreset, bounds: Box): WarpMesh | null;
|
|
47
|
-
/** Control points per row. */
|
|
48
|
-
declare const warpMeshColumns: (m: WarpMesh) => number;
|
|
49
|
-
/** Control point rows. */
|
|
50
|
-
declare const warpMeshRows: (m: WarpMesh) => number;
|
|
51
|
-
/** Whether a mesh is well formed: knots from 0 to 1 increasing, the right number of finite points. */
|
|
52
|
-
declare function isValidWarpMesh(m: unknown): m is WarpMesh;
|
|
53
|
-
/** Fits a mesh with patch boundaries `us` / `vs` to the map `f` (box fractions → output) by interpolating it at each patch's thirds. Exact for bicubic maps (affine maps included). */
|
|
54
|
-
declare function fitWarpMesh(f: (s: number, t: number) => Vec2, us: readonly number[], vs: readonly number[]): WarpMesh;
|
|
55
|
-
/** The identity mesh over `bounds` with `columns × rows` patches. */
|
|
56
|
-
declare function identityWarpMesh(bounds: Box, columns?: number, rows?: number): WarpMesh;
|
|
57
|
-
/** The surface at box fractions `(s, t)`. */
|
|
58
|
-
declare function evalWarpMesh(m: WarpMesh, s: number, t: number): Vec2;
|
|
59
|
-
/** The mesh with the patch column holding `s` split at `s` (exact). Null when `s` is on or too close to a boundary. */
|
|
60
|
-
declare function splitWarpMeshU(m: WarpMesh, s: number): WarpMesh | null;
|
|
61
|
-
/** The mesh with the patch row holding `t` split at `t` (exact). */
|
|
62
|
-
declare function splitWarpMeshV(m: WarpMesh, t: number): WarpMesh | null;
|
|
63
|
-
/**
|
|
64
|
-
* The mesh without interior vertical boundary `k` (1 … us.length − 2), its two patch columns
|
|
65
|
-
* merged: exact when they came from an unedited split; otherwise the outer control points stay and
|
|
66
|
-
* the inner handles are extrapolated.
|
|
67
|
-
*/
|
|
68
|
-
declare function removeWarpMeshSplitU(m: WarpMesh, k: number): WarpMesh | null;
|
|
69
|
-
/** Removes interior horizontal boundary `k`. */
|
|
70
|
-
declare function removeWarpMeshSplitV(m: WarpMesh, k: number): WarpMesh | null;
|
|
71
|
-
/** Every control point through `f` (exact for affine maps). */
|
|
72
|
-
declare function mapWarpMeshPoints(m: WarpMesh, f: (p: Vec2) => Vec2): WarpMesh;
|
|
73
|
-
/**
|
|
74
|
-
* The mesh with `columns × rows` patches over the same surface: split exactly when its knots are
|
|
75
|
-
* a subset of the new even ones (a one-patch mesh always is), otherwise refitted.
|
|
76
|
-
*/
|
|
77
|
-
declare function resizeWarpMesh(m: WarpMesh, columns: number, rows: number): WarpMesh;
|
|
78
|
-
/** Bounding box of the control points (the surface lies inside it). */
|
|
79
|
-
declare function warpMeshControlBounds(m: WarpMesh): Box;
|
|
80
|
-
/** Box fractions `(s, t)` whose surface point is nearest `p` (a coarse search, then Newton steps). */
|
|
81
|
-
declare function warpMeshParamAt(m: WarpMesh, p: Vec2): {
|
|
82
|
-
s: number;
|
|
83
|
-
t: number;
|
|
84
|
-
distance: number;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* `base` with control point `index` dragged by `d`, keeping the surface smooth across the grid
|
|
88
|
-
* lines: an anchor moves with the eight points around it as one block; a handle moves with the two
|
|
89
|
-
* points beside it across its line, and the handle opposite it on the same anchor turns the other
|
|
90
|
-
* way (with its two neighbours), so the line keeps passing straight through the anchor. An inner
|
|
91
|
-
* point of a patch moves alone.
|
|
92
|
-
*/
|
|
93
|
-
declare function dragWarpMeshPoint(base: WarpMesh, index: number, d: Vec2): WarpMesh;
|
|
94
|
-
/**
|
|
95
|
-
* `base` with its surface point at box fractions `(s, t)` pulled by `d`, the way dragging inside a
|
|
96
|
-
* patch works: interior anchors within about two cells follow by a share of `d` that fades with
|
|
97
|
-
* distance (each with its block of handles, so grid lines stay smooth); the outer border stays
|
|
98
|
-
* pinned unless the grab is near it, and then it bows; the four corners never move. The grabbed
|
|
99
|
-
* patch's inner points (and, near the border, the border's handles) make up the rest, so the
|
|
100
|
-
* grabbed point lands exactly at its start + `d`.
|
|
101
|
-
*/
|
|
102
|
-
declare function pullWarpMesh(base: WarpMesh, s: number, t: number, d: Vec2): WarpMesh;
|
|
103
|
-
/**
|
|
104
|
-
* The control points an editor shows: the anchors (where grid lines cross) and the handles along
|
|
105
|
-
* the grid lines, each with the anchor it belongs to. Points inside a patch are left out (drag
|
|
106
|
-
* inside a patch to pull the surface instead).
|
|
107
|
-
*/
|
|
108
|
-
declare function warpMeshEditPoints(m: WarpMesh): {
|
|
109
|
-
anchors: number[];
|
|
110
|
-
handles: {
|
|
111
|
-
index: number;
|
|
112
|
-
anchor: number;
|
|
113
|
-
}[];
|
|
114
|
-
};
|
|
115
|
-
/** The mesh's grid lines (patch borders) as cubics `[p0, p1, p2, p3]`. */
|
|
116
|
-
declare function warpMeshGridCurves(m: WarpMesh): Vec2[][];
|
|
117
|
-
|
|
118
|
-
export { type WarpPreset as W, WARP_STYLES as a, WARP_STYLE_LABELS as b, removeWarpMeshSplitV as c, dragWarpMeshPoint as d, evalWarpMesh as e, fitWarpMesh as f, resizeWarpMesh as g, splitWarpMeshV as h, isValidWarpMesh as i, identityWarpMesh as j, warpMeshControlBounds as k, warpMeshEditPoints as l, mapWarpMeshPoints as m, warpMeshGridCurves as n, warpMeshParamAt as o, pullWarpMesh as p, warpMeshRows as q, removeWarpMeshSplitU as r, splitWarpMeshU as s, warpPresetGrid as t, warpPresetMesh as u, warpMeshColumns as w };
|
package/dist/warp-D5jz_tN7.d.cts
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { W as WarpStyle, a as WarpMesh, V as Vec2, B as Box } from './types-CwMPoRMU.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Warp geometry shared by the vector editor's envelopes and the image editor's Free Transform
|
|
5
|
-
* warp: preset warp styles and editable Bézier meshes, both forward maps from a source box onto
|
|
6
|
-
* the plane.
|
|
7
|
-
*
|
|
8
|
-
* - **Presets** (`WarpStyle`, Photoshop's fifteen with bend and horizontal / vertical distortion
|
|
9
|
-
* in percent): each is one bicubic Bézier patch whose 4 × 4 control grid follows the bend
|
|
10
|
-
* (`warpPresetGrid`). Every preset is the identity at bend 0 and continuous in it.
|
|
11
|
-
* - **Meshes** (`WarpMesh`): a grid of bicubic patches. Splitting a mesh (`splitWarpMeshU` / `V`)
|
|
12
|
-
* is an exact de Casteljau subdivision, so it never changes the shape, and a preset turns into
|
|
13
|
-
* an editable mesh of any size exactly.
|
|
14
|
-
*
|
|
15
|
-
* Ported from ArtCraft (MIT OR Apache-2.0, © ArtCraft Team and contributors; see
|
|
16
|
-
* THIRD_PARTY_NOTICES.md): photocraft `crates/geom/src/warp.rs` (`WarpStyle`, `StyleWarp`,
|
|
17
|
-
* `rest_grid`, `edge_arc`, `arc_grid`, `blend_rows`, `preset_grid`, `bernstein`, `split_cubic`,
|
|
18
|
-
* `BERN_INV`, and `BezierMesh`: `identity`, `fit`, `eval`, `split_u`, `split_v`, `remove_split_u`,
|
|
19
|
-
* `transpose`, `map_points`, `param_at`, `pull`, `smooth_lines`, `drag_point`, `control_bounds`;
|
|
20
|
-
* `Warp::map` and `Warp::to_mesh`).
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/** The fifteen presets in Photoshop's menu order. */
|
|
24
|
-
declare const WARP_STYLES: readonly WarpStyle[];
|
|
25
|
-
declare const WARP_STYLE_LABELS: Readonly<Record<WarpStyle, string>>;
|
|
26
|
-
/**
|
|
27
|
-
* A preset as a Bézier control grid (rows of `[x, y]` in box units, y down). `b`, `hd`, `vd` are
|
|
28
|
-
* the bend and the horizontal / vertical distortion as fractions (−1…1); `aspect` is the box's
|
|
29
|
-
* height over its width. The arc family stays circular in pixels, the other offsets scale with the
|
|
30
|
-
* box, and a vertical warp is the horizontal one with the axes (and distortions) swapped.
|
|
31
|
-
*/
|
|
32
|
-
declare function warpPresetGrid(style: WarpStyle, b: number, hd: number, vd: number, vertical: boolean, aspect: number): [number, number][][];
|
|
33
|
-
/** A preset warp's settings (bend and distortions in percent, −100…100). */
|
|
34
|
-
interface WarpPreset {
|
|
35
|
-
style: WarpStyle;
|
|
36
|
-
bend: number;
|
|
37
|
-
horizontal?: number;
|
|
38
|
-
vertical?: number;
|
|
39
|
-
/** Bend along the vertical axis. */
|
|
40
|
-
orientation?: 'horizontal' | 'vertical';
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* A preset as one Bézier patch over `bounds` (points in the bounds' space), or null when it
|
|
44
|
-
* changes nothing (an unknown style, all-zero amounts, or an empty box).
|
|
45
|
-
*/
|
|
46
|
-
declare function warpPresetMesh(preset: WarpPreset, bounds: Box): WarpMesh | null;
|
|
47
|
-
/** Control points per row. */
|
|
48
|
-
declare const warpMeshColumns: (m: WarpMesh) => number;
|
|
49
|
-
/** Control point rows. */
|
|
50
|
-
declare const warpMeshRows: (m: WarpMesh) => number;
|
|
51
|
-
/** Whether a mesh is well formed: knots from 0 to 1 increasing, the right number of finite points. */
|
|
52
|
-
declare function isValidWarpMesh(m: unknown): m is WarpMesh;
|
|
53
|
-
/** Fits a mesh with patch boundaries `us` / `vs` to the map `f` (box fractions → output) by interpolating it at each patch's thirds. Exact for bicubic maps (affine maps included). */
|
|
54
|
-
declare function fitWarpMesh(f: (s: number, t: number) => Vec2, us: readonly number[], vs: readonly number[]): WarpMesh;
|
|
55
|
-
/** The identity mesh over `bounds` with `columns × rows` patches. */
|
|
56
|
-
declare function identityWarpMesh(bounds: Box, columns?: number, rows?: number): WarpMesh;
|
|
57
|
-
/** The surface at box fractions `(s, t)`. */
|
|
58
|
-
declare function evalWarpMesh(m: WarpMesh, s: number, t: number): Vec2;
|
|
59
|
-
/** The mesh with the patch column holding `s` split at `s` (exact). Null when `s` is on or too close to a boundary. */
|
|
60
|
-
declare function splitWarpMeshU(m: WarpMesh, s: number): WarpMesh | null;
|
|
61
|
-
/** The mesh with the patch row holding `t` split at `t` (exact). */
|
|
62
|
-
declare function splitWarpMeshV(m: WarpMesh, t: number): WarpMesh | null;
|
|
63
|
-
/**
|
|
64
|
-
* The mesh without interior vertical boundary `k` (1 … us.length − 2), its two patch columns
|
|
65
|
-
* merged: exact when they came from an unedited split; otherwise the outer control points stay and
|
|
66
|
-
* the inner handles are extrapolated.
|
|
67
|
-
*/
|
|
68
|
-
declare function removeWarpMeshSplitU(m: WarpMesh, k: number): WarpMesh | null;
|
|
69
|
-
/** Removes interior horizontal boundary `k`. */
|
|
70
|
-
declare function removeWarpMeshSplitV(m: WarpMesh, k: number): WarpMesh | null;
|
|
71
|
-
/** Every control point through `f` (exact for affine maps). */
|
|
72
|
-
declare function mapWarpMeshPoints(m: WarpMesh, f: (p: Vec2) => Vec2): WarpMesh;
|
|
73
|
-
/**
|
|
74
|
-
* The mesh with `columns × rows` patches over the same surface: split exactly when its knots are
|
|
75
|
-
* a subset of the new even ones (a one-patch mesh always is), otherwise refitted.
|
|
76
|
-
*/
|
|
77
|
-
declare function resizeWarpMesh(m: WarpMesh, columns: number, rows: number): WarpMesh;
|
|
78
|
-
/** Bounding box of the control points (the surface lies inside it). */
|
|
79
|
-
declare function warpMeshControlBounds(m: WarpMesh): Box;
|
|
80
|
-
/** Box fractions `(s, t)` whose surface point is nearest `p` (a coarse search, then Newton steps). */
|
|
81
|
-
declare function warpMeshParamAt(m: WarpMesh, p: Vec2): {
|
|
82
|
-
s: number;
|
|
83
|
-
t: number;
|
|
84
|
-
distance: number;
|
|
85
|
-
};
|
|
86
|
-
/**
|
|
87
|
-
* `base` with control point `index` dragged by `d`, keeping the surface smooth across the grid
|
|
88
|
-
* lines: an anchor moves with the eight points around it as one block; a handle moves with the two
|
|
89
|
-
* points beside it across its line, and the handle opposite it on the same anchor turns the other
|
|
90
|
-
* way (with its two neighbours), so the line keeps passing straight through the anchor. An inner
|
|
91
|
-
* point of a patch moves alone.
|
|
92
|
-
*/
|
|
93
|
-
declare function dragWarpMeshPoint(base: WarpMesh, index: number, d: Vec2): WarpMesh;
|
|
94
|
-
/**
|
|
95
|
-
* `base` with its surface point at box fractions `(s, t)` pulled by `d`, the way dragging inside a
|
|
96
|
-
* patch works: interior anchors within about two cells follow by a share of `d` that fades with
|
|
97
|
-
* distance (each with its block of handles, so grid lines stay smooth); the outer border stays
|
|
98
|
-
* pinned unless the grab is near it, and then it bows; the four corners never move. The grabbed
|
|
99
|
-
* patch's inner points (and, near the border, the border's handles) make up the rest, so the
|
|
100
|
-
* grabbed point lands exactly at its start + `d`.
|
|
101
|
-
*/
|
|
102
|
-
declare function pullWarpMesh(base: WarpMesh, s: number, t: number, d: Vec2): WarpMesh;
|
|
103
|
-
/**
|
|
104
|
-
* The control points an editor shows: the anchors (where grid lines cross) and the handles along
|
|
105
|
-
* the grid lines, each with the anchor it belongs to. Points inside a patch are left out (drag
|
|
106
|
-
* inside a patch to pull the surface instead).
|
|
107
|
-
*/
|
|
108
|
-
declare function warpMeshEditPoints(m: WarpMesh): {
|
|
109
|
-
anchors: number[];
|
|
110
|
-
handles: {
|
|
111
|
-
index: number;
|
|
112
|
-
anchor: number;
|
|
113
|
-
}[];
|
|
114
|
-
};
|
|
115
|
-
/** The mesh's grid lines (patch borders) as cubics `[p0, p1, p2, p3]`. */
|
|
116
|
-
declare function warpMeshGridCurves(m: WarpMesh): Vec2[][];
|
|
117
|
-
|
|
118
|
-
export { type WarpPreset as W, WARP_STYLES as a, WARP_STYLE_LABELS as b, removeWarpMeshSplitV as c, dragWarpMeshPoint as d, evalWarpMesh as e, fitWarpMesh as f, resizeWarpMesh as g, splitWarpMeshV as h, isValidWarpMesh as i, identityWarpMesh as j, warpMeshControlBounds as k, warpMeshEditPoints as l, mapWarpMeshPoints as m, warpMeshGridCurves as n, warpMeshParamAt as o, pullWarpMesh as p, warpMeshRows as q, removeWarpMeshSplitU as r, splitWarpMeshU as s, warpPresetGrid as t, warpPresetMesh as u, warpMeshColumns as w };
|
|
File without changes
|
|
File without changes
|