@field/cascade 0.10.0 → 0.12.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/AGENTS.md +25 -5
- package/ARCHITECTURE.md +5 -4
- package/CHANGELOG.md +382 -0
- package/README.md +1 -2
- package/dist/assets/AgentPanel-1JugFjE4.css +1 -0
- package/dist/assets/AgentPanel-BDL5MddA.js +5 -0
- package/dist/assets/{CodeEditor-DSZBpzdy.js → CodeEditor-C-xYG-Wn.js} +120 -120
- package/dist/assets/CodePanel-CtXd50m6.js +2 -0
- package/dist/assets/CookInfoPanel-B3NMhKJF.css +1 -0
- package/dist/assets/CookInfoPanel-DG4_TRsX.js +2 -0
- package/dist/assets/CustomNodeDialog-CHfZUs-r.js +1 -0
- package/dist/assets/DefinitionNode-CaRTXQ_b.js +1 -0
- package/dist/assets/DefinitionPanel-C3CxZY9r.js +1 -0
- package/dist/assets/DefinitionPanel-VNLnAiQD.css +1 -0
- package/dist/assets/OpenGraphDialog-BLdr6k_q.js +1 -0
- package/dist/assets/ProjectSettings-ZnvmIAir.js +2 -0
- package/dist/assets/{SettingsDialog-p25h3tj0.js → SettingsDialog-CBX3Wa87.js} +1 -1
- package/dist/assets/TimelinePanel-CDeR0arY.css +1 -0
- package/dist/assets/TimelinePanel-CWgnFH1e.js +1 -0
- package/dist/assets/{VersionHistoryDialog-DzFLUotB.js → VersionHistoryDialog-BOSoW1R-.js} +1 -1
- package/dist/assets/assert-BO2_erPD.js +1 -0
- package/dist/assets/assert-hvykGCnP.js +1 -0
- package/dist/assets/builder-BmBKcDix.js +1 -0
- package/dist/assets/camera-DFF7YA3F.js +1 -0
- package/dist/assets/checks-DAvyO9Gf.js +1 -0
- package/dist/assets/contactSheet-N1NcaWxw.js +2 -0
- package/dist/assets/{core-BICrEt0y.js → core-DB-MkGjj.js} +3 -4
- package/dist/assets/coreTypes-DtnDATZ7.js +1 -0
- package/dist/assets/{cssMode-D7TXw57I.js → cssMode-DPVckSOc.js} +1 -1
- package/dist/assets/definitions-B227e7f_.js +1 -0
- package/dist/assets/definitions-D0WOUJd7.js +1 -0
- package/dist/assets/{editor.api-DvkCO3ko.js → editor.api-Dkutg_Z1.js} +1 -1
- package/dist/assets/expressions-X-Z-GrgW.js +5 -0
- package/dist/assets/file-DAL6IfjV.js +1 -0
- package/dist/assets/filters-D3k1LRMa.js +1 -0
- package/dist/assets/{freemarker2-BA2lxsF1.js → freemarker2-CLiLKk3B.js} +1 -1
- package/dist/assets/generators-BhDxRAFC.js +1 -0
- package/dist/assets/geo-BsMImJIJ.js +1 -0
- package/dist/assets/geo-C4YngDob.js +2 -0
- package/dist/assets/{handlebars-BcDiyPd8.js → handlebars-CcD3aMeL.js} +1 -1
- package/dist/assets/{html-C7O4TyhX.js → html-DvZWGfqb.js} +1 -1
- package/dist/assets/{htmlMode-WaDGF3Mj.js → htmlMode-DUD3VaoN.js} +1 -1
- package/dist/assets/image-0SfH-snh.js +1 -0
- package/dist/assets/image-Ck-RdGU4.js +2 -0
- package/dist/assets/index-BWnrmIB9.js +137 -0
- package/dist/assets/index-DIaxEONI.css +1 -0
- package/dist/assets/io-BGmt2g0D.js +1 -0
- package/dist/assets/{javascript-CpIEK7tz.js → javascript-Cap2ahgh.js} +1 -1
- package/dist/assets/{jsonMode-B2FltW0f.js → jsonMode-B0uLjp9C.js} +1 -1
- package/dist/assets/{liquid-CN6FFHZE.js → liquid-CnxwhfLn.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-QhV9XtLp.js → lspLanguageFeatures-Dn9hlKX6.js} +1 -1
- package/dist/assets/math-GeULS-sk.js +1 -0
- package/dist/assets/{mdx-DE89pafV.js → mdx-BV3jbrVa.js} +1 -1
- package/dist/assets/pop-KMF_qloi.js +1 -0
- package/dist/assets/preload-helper-Czpn1I53.js +1 -0
- package/dist/assets/{python-ByTllTB9.js → python-CGyFk4XK.js} +1 -1
- package/dist/assets/{razor-USYlRRCE.js → razor-CQfzX3-N.js} +1 -1
- package/dist/assets/remap-5SjXQU-q.js +1 -0
- package/dist/assets/renderMarkdown-ork0Oir7.js +67 -0
- package/dist/assets/studioImages-CAyH-0Pl.js +1 -0
- package/dist/assets/text-ZpX7qNkx.js +2 -0
- package/dist/assets/time-P_OiBhcf.js +1 -0
- package/dist/assets/{tsMode-BXpN8iUz.js → tsMode-BOeXzO9H.js} +1 -1
- package/dist/assets/{typescript-DInBjGQQ.js → typescript-J1SnE_Tu.js} +1 -1
- package/dist/assets/{workers-C7Ye5B7D.js → workers-CYwwTiVF.js} +1 -1
- package/dist/assets/{xml-U0Uocqyo.js → xml-DnPRNzK9.js} +1 -1
- package/dist/assets/{yaml-CBw_PVYf.js → yaml-BmmYBNa9.js} +1 -1
- package/dist/cli/DefinitionNode-P7AA4TAU.js +15 -0
- package/dist/cli/Graph-OB6EWSGL.js +2975 -0
- package/dist/cli/assert-GROGQNCQ.js +25 -0
- package/dist/cli/checks-3WB44XBL.js +189 -0
- package/dist/cli/chunk-2JEU3MGB.js +1125 -0
- package/dist/cli/chunk-2KXB47FP.js +115 -0
- package/dist/cli/chunk-3RXL5GHB.js +816 -0
- package/dist/cli/chunk-53LGFPWX.js +138 -0
- package/dist/cli/chunk-5ORUQ6ES.js +267 -0
- package/dist/cli/chunk-73S4JZXK.js +336 -0
- package/dist/cli/chunk-7QE2ZNSN.js +121 -0
- package/dist/cli/chunk-BP7UKF36.js +376 -0
- package/dist/cli/chunk-BPODRH52.js +201 -0
- package/dist/cli/chunk-BZ63XQ3I.js +1301 -0
- package/dist/cli/chunk-CKS2FQWR.js +89 -0
- package/dist/cli/chunk-CO22XHNG.js +593 -0
- package/dist/cli/chunk-CTPLRSWF.js +2197 -0
- package/dist/cli/chunk-DEQSEFFH.js +153 -0
- package/dist/cli/chunk-EU4ZFZ7Y.js +122 -0
- package/dist/cli/chunk-EZRWJ4G2.js +104 -0
- package/dist/cli/chunk-FWMSGKEH.js +71 -0
- package/dist/cli/chunk-G23A2BZZ.js +705 -0
- package/dist/cli/chunk-GRIN2DDP.js +1465 -0
- package/dist/cli/chunk-HFHWYL55.js +139 -0
- package/dist/cli/chunk-HSNOBIVT.js +263 -0
- package/dist/cli/chunk-ICH7N5PN.js +26 -0
- package/dist/cli/chunk-J7VK7MNF.js +418 -0
- package/dist/cli/chunk-JVOCK5W4.js +83 -0
- package/dist/cli/chunk-KBGUO27Q.js +15 -0
- package/dist/cli/chunk-KH4MUBKF.js +1551 -0
- package/dist/cli/chunk-L6B6FUQP.js +330 -0
- package/dist/cli/chunk-LTXWBXOM.js +438 -0
- package/dist/cli/chunk-MI5JLQYA.js +220 -0
- package/dist/cli/chunk-MP653A5O.js +3766 -0
- package/dist/cli/chunk-NJFMDXHR.js +320 -0
- package/dist/cli/chunk-OM6BEME6.js +267 -0
- package/dist/cli/chunk-OWWBYLHC.js +136 -0
- package/dist/cli/chunk-QQPA2ZHH.js +273 -0
- package/dist/cli/chunk-RUU3YWXU.js +99 -0
- package/dist/cli/chunk-RXDIMXN5.js +98 -0
- package/dist/cli/chunk-ST6LROUG.js +267 -0
- package/dist/cli/chunk-TJW67QSI.js +225 -0
- package/dist/cli/chunk-WD62JIP6.js +118 -0
- package/dist/cli/chunk-WGKPJZDY.js +364 -0
- package/dist/cli/chunk-X4WKAOQP.js +634 -0
- package/dist/cli/chunk-X566FWBV.js +156 -0
- package/dist/cli/chunk-YH637PDL.js +317 -0
- package/dist/cli/chunk-ZL4JTG5Y.js +37 -0
- package/dist/cli/chunk-ZSCUZE6I.js +112 -0
- package/dist/cli/cliCommands-JJN5Z3ZC.js +3470 -0
- package/dist/cli/commands-PHYFYA3F.js +1374 -0
- package/dist/cli/contactSheet-2PQVRUFW.js +11 -0
- package/dist/cli/definitions-BPOPW52L.js +32 -0
- package/dist/cli/doctorCommand-ORWQRNYP.js +106 -0
- package/dist/cli/edit-S5KEQ5RA.js +28 -0
- package/dist/cli/editorCommands-NFR32JOY.js +41 -0
- package/dist/cli/encode-ICPEPMH5.js +17 -0
- package/dist/cli/file-3HTQHPYQ.js +41 -0
- package/dist/cli/filters-6ODFWYK4.js +379 -0
- package/dist/cli/frames-LSAUBZ7P.js +16 -0
- package/dist/cli/generators-YU7GB4MD.js +210 -0
- package/dist/cli/geo-6ZPGKZRU.js +43 -0
- package/dist/cli/graphCommands-EOUOBOIJ.js +184 -0
- package/dist/cli/graphFile-YTGJB5F5.js +292 -0
- package/dist/cli/headlessCanvas-ENRHC7GS.js +16 -0
- package/dist/cli/helpCommand-PULH6ZYB.js +157 -0
- package/dist/cli/image-TXELZZK5.js +55 -0
- package/dist/cli/index.js +100 -30756
- package/dist/cli/math-RSYRQ3C6.js +16 -0
- package/dist/cli/mcp-JVZFQOEX.js +164 -0
- package/dist/cli/parity-X6DEH2DV.js +334 -0
- package/dist/cli/pop-B7SIIYKN.js +39 -0
- package/dist/cli/project-VYGIA7JX.js +12 -0
- package/dist/cli/projectDefinition-F3D7UIHJ.js +27 -0
- package/dist/cli/projectRuntime-2Q4JKEH3.js +55 -0
- package/dist/cli/registerStandardNodes-BXJCB6E4.js +744 -0
- package/dist/cli/render-PT4MWI6U.js +438 -0
- package/dist/cli/runCommand-HNPQVZMS.js +198 -0
- package/dist/cli/runner-5XPXVW7J.js +43 -0
- package/dist/cli/runtime/image.ts +302 -0
- package/dist/cli/runtime/io.ts +78 -0
- package/dist/cli/runtime/stage.ts +4 -1
- package/dist/cli/share-MHF6TNRK.js +166 -0
- package/dist/cli/stageCache-TY2BFZJR.js +15 -0
- package/dist/cli/stageRunner-KY2EJP7X.js +10 -0
- package/dist/cli/text-MB3EKR4H.js +126 -0
- package/dist/cli/verbs-PI2JH5FI.js +19 -0
- package/dist/cli/webBuild-WPPMGGW7.js +44 -0
- package/dist/contracts/capabilities.d.ts +18 -1
- package/dist/contracts/color.d.ts +8 -0
- package/dist/contracts/color.js +23 -0
- package/dist/contracts/definition.d.ts +10 -0
- package/dist/contracts/documentFormat.d.ts +18 -0
- package/dist/contracts/documentFormat.js +195 -0
- package/dist/contracts/editor.d.ts +17 -0
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/schema.d.ts +1 -1
- package/dist/contracts/schema.js +1 -0
- package/dist/contracts/validate.js +11 -1
- package/dist/contracts/values.d.ts +24 -0
- package/dist/image.d.ts +156 -0
- package/dist/image.js +161 -0
- package/dist/index.html +8 -2
- package/dist/io.d.ts +29 -0
- package/dist/io.js +40 -0
- package/dist/player/app.js +3 -2
- package/dist/player/editor.js +35 -9
- package/dist/player/editorEngine.js +3 -2
- package/dist/runtime/builtins/assert/checks.d.ts +18 -0
- package/dist/runtime/builtins/assert/checks.js +207 -0
- package/dist/runtime/builtins/assert/definitions.d.ts +130 -0
- package/dist/runtime/builtins/assert/definitions.js +54 -0
- package/dist/runtime/builtins/assert/index.d.ts +152 -0
- package/dist/runtime/builtins/assert/index.js +36 -0
- package/dist/runtime/builtins/image/contactSheet.d.ts +64 -0
- package/dist/runtime/builtins/image/contactSheet.js +150 -0
- package/dist/runtime/builtins/image/definitions.d.ts +950 -0
- package/dist/runtime/builtins/image/definitions.js +343 -0
- package/dist/runtime/builtins/image/file.d.ts +8 -0
- package/dist/runtime/builtins/image/file.js +37 -0
- package/dist/runtime/builtins/image/filters.d.ts +8 -0
- package/dist/runtime/builtins/image/filters.js +394 -0
- package/dist/runtime/builtins/image/generators.d.ts +7 -0
- package/dist/runtime/builtins/image/generators.js +144 -0
- package/dist/runtime/builtins/image/index.d.ts +952 -0
- package/dist/runtime/builtins/image/index.js +44 -0
- package/dist/runtime/builtins/image/io.d.ts +100 -0
- package/dist/runtime/builtins/image/io.js +142 -0
- package/dist/runtime/builtins/image/planar.d.ts +55 -0
- package/dist/runtime/builtins/image/planar.js +274 -0
- package/dist/runtime/builtins/image/simplex.d.ts +22 -0
- package/dist/runtime/builtins/image/simplex.js +92 -0
- package/dist/runtime/builtins/image/text.d.ts +4 -0
- package/dist/runtime/builtins/image/text.js +141 -0
- package/dist/runtime/builtins/index.d.ts +3 -0
- package/dist/runtime/builtins/index.js +7 -0
- package/dist/runtime/gpu.d.ts +25 -0
- package/dist/runtime/gpu.js +40 -0
- package/dist/runtime/runtime.d.ts +2 -0
- package/dist/runtime/runtime.js +268 -44
- package/dist/runtime/types.d.ts +30 -0
- package/dist/stage.js +4 -1
- package/doc/CLI_REFERENCE.md +91 -2
- package/doc/EDITOR_EXPORT.md +37 -2
- package/doc/MCP.md +18 -1
- package/doc/NODE_REFERENCE.md +424 -10
- package/doc/PROJECT_AUTHORING.md +222 -7
- package/package.json +19 -4
- package/dist/assets/CodePanel-sY6sZa7B.js +0 -2
- package/dist/assets/CustomNodeDialog-BRKnqZhp.js +0 -1
- package/dist/assets/ExportDialog-C7dVGua4.js +0 -358
- package/dist/assets/ExportDialog-DOq0flMV.css +0 -1
- package/dist/assets/OpenGraphDialog-ZsgL-iwr.js +0 -1
- package/dist/assets/ProjectSettings-Cw17nNe3.js +0 -2
- package/dist/assets/definitions-DUww2Rt-.js +0 -1
- package/dist/assets/geo-C2RHOVHC.js +0 -1
- package/dist/assets/image-DR4oeyJB.js +0 -2062
- package/dist/assets/index-7vae6YFC.css +0 -1
- package/dist/assets/index-DyvDC6pS.js +0 -219
- package/dist/assets/math-DaDEgWKt.js +0 -1
- package/dist/assets/pop-pLH7L0PW.js +0 -1
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The image library's declarations: `cascade.image.*`, the eleven nodes that
|
|
3
|
+
* were Studio classes until 2026-11-07, with the same module ids, ports and
|
|
4
|
+
* prop names, so a saved graph loads unchanged.
|
|
5
|
+
*
|
|
6
|
+
* Literal and small on purpose: these sit in Studio's first-paint bundle with
|
|
7
|
+
* the rest of the built-in list, and each node's body loads behind a dynamic
|
|
8
|
+
* import the first time it cooks (`index.ts`).
|
|
9
|
+
*
|
|
10
|
+
* Every node is `portable` with `assets`: an image arrives as an `ImageRef`
|
|
11
|
+
* and leaves as one, through the host's in-memory image contract (`io.ts`).
|
|
12
|
+
*/
|
|
13
|
+
export const contactSheetDefinition = {
|
|
14
|
+
apiVersion: 1,
|
|
15
|
+
label: "Contact Sheet",
|
|
16
|
+
description: "Lay images out as one labelled grid.",
|
|
17
|
+
icon: "LayoutGrid",
|
|
18
|
+
runsOn: "portable",
|
|
19
|
+
capabilities: ["assets"],
|
|
20
|
+
inputs: {
|
|
21
|
+
images: { kind: "data", type: "image", variadic: true },
|
|
22
|
+
/** More images after the wired ones: image values or project-relative paths. */
|
|
23
|
+
list: { kind: "data", type: "array" },
|
|
24
|
+
},
|
|
25
|
+
outputs: {
|
|
26
|
+
image: { kind: "data", type: "image" },
|
|
27
|
+
asset: { kind: "data", type: "asset" },
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
columns: { type: "int", default: 0, min: 0, max: 64, description: "0: as square as the count allows." },
|
|
31
|
+
gap: { type: "int", default: 16, min: 0, max: 512 },
|
|
32
|
+
background: { type: "color", default: [1, 1, 1, 1], label: "Background" },
|
|
33
|
+
cellWidth: { type: "int", default: 0, min: 0, max: 8192, description: "0: images at their own size. Otherwise each is scaled to fit this width." },
|
|
34
|
+
labels: { type: "string", default: "", description: "One label per line, in image order." },
|
|
35
|
+
labelSize: { type: "int", default: 14, min: 6, max: 128 },
|
|
36
|
+
labelColor: { type: "color", default: [0.1, 0.1, 0.1, 1], label: "Label Colour" },
|
|
37
|
+
filename: { type: "string", default: "contact-sheet.png", label: "Filename" },
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const colorDefinition = {
|
|
41
|
+
apiVersion: 1,
|
|
42
|
+
label: "Color",
|
|
43
|
+
description: "A solid colour.",
|
|
44
|
+
icon: "Square",
|
|
45
|
+
runsOn: "portable",
|
|
46
|
+
capabilities: ["assets"],
|
|
47
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
48
|
+
props: {
|
|
49
|
+
color: { type: "color", default: [1, 1, 1, 1], label: "Color" },
|
|
50
|
+
resolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" },
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
export const checkersDefinition = {
|
|
54
|
+
apiVersion: 1,
|
|
55
|
+
label: "Checkers",
|
|
56
|
+
description: "A checkerboard.",
|
|
57
|
+
icon: "Grid",
|
|
58
|
+
runsOn: "portable",
|
|
59
|
+
capabilities: ["assets"],
|
|
60
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
61
|
+
props: {
|
|
62
|
+
color1: { type: "color", default: [1, 1, 1, 1], label: "Color 1" },
|
|
63
|
+
color2: { type: "color", default: [0, 0, 0, 1], label: "Color 2" },
|
|
64
|
+
mode: {
|
|
65
|
+
type: "string", default: "size", label: "Mode", control: "select",
|
|
66
|
+
options: [{ value: "size", label: "Size" }, { value: "divisions", label: "Divisions" }],
|
|
67
|
+
},
|
|
68
|
+
size: { type: "float", default: 32, min: 1, max: 512, step: 0.1, label: "Size", description: "Cell size in pixels (mode Size)." },
|
|
69
|
+
divisions: { type: "int", default: 16, min: 1, max: 512, step: 1, label: "Divisions", description: "Cells across (mode Divisions)." },
|
|
70
|
+
centered: { type: "bool", default: false, label: "Centered" },
|
|
71
|
+
resolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" },
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
export const noiseDefinition = {
|
|
75
|
+
apiVersion: 1,
|
|
76
|
+
label: "Noise",
|
|
77
|
+
description: "Fractal simplex noise, grey.",
|
|
78
|
+
icon: "Cloud",
|
|
79
|
+
runsOn: "portable",
|
|
80
|
+
capabilities: ["assets"],
|
|
81
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
82
|
+
props: {
|
|
83
|
+
seed: { type: "int", default: 0, min: 0, max: 10000, step: 1, label: "Seed" },
|
|
84
|
+
scale: { type: "float", default: 0.01, min: 0.001, max: 1, step: 0.001, label: "Scale" },
|
|
85
|
+
iterations: { type: "int", default: 4, min: 1, max: 8, step: 1, label: "Iterations" },
|
|
86
|
+
resolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" },
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
export const rampDefinition = {
|
|
90
|
+
apiVersion: 1,
|
|
91
|
+
label: "Ramp",
|
|
92
|
+
description: "A colour ramp: horizontal, vertical, radial or concentric.",
|
|
93
|
+
icon: "Gradient",
|
|
94
|
+
runsOn: "portable",
|
|
95
|
+
capabilities: ["assets"],
|
|
96
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
97
|
+
props: {
|
|
98
|
+
type: {
|
|
99
|
+
type: "string", default: "horizontal", label: "Type", control: "select",
|
|
100
|
+
options: [
|
|
101
|
+
{ value: "horizontal", label: "Horizontal" },
|
|
102
|
+
{ value: "vertical", label: "Vertical" },
|
|
103
|
+
{ value: "radial", label: "Radial" },
|
|
104
|
+
{ value: "concentric", label: "Concentric" },
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
points: {
|
|
108
|
+
type: "array",
|
|
109
|
+
label: "Ramp",
|
|
110
|
+
description: "{ position, color, interpolation: linear | smooth | constant } stops.",
|
|
111
|
+
default: [
|
|
112
|
+
{ position: 0, color: { r: 0, g: 0, b: 0 }, interpolation: "linear" },
|
|
113
|
+
{ position: 1, color: { r: 1, g: 1, b: 1 }, interpolation: "linear" },
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
resolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" },
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
export const textDefinition = {
|
|
120
|
+
apiVersion: 1,
|
|
121
|
+
label: "Text",
|
|
122
|
+
description: "Text drawn with a CSS font family, or a font file from the project.",
|
|
123
|
+
icon: "Type",
|
|
124
|
+
runsOn: "portable",
|
|
125
|
+
capabilities: ["assets"],
|
|
126
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
127
|
+
props: {
|
|
128
|
+
text: { type: "string", default: "Hello, World!", label: "Text", control: "textarea" },
|
|
129
|
+
font: {
|
|
130
|
+
type: "string", default: "Inter, system-ui, sans-serif", label: "Font",
|
|
131
|
+
description: "A CSS font family list, or a project font file (.otf, .ttf, .woff, .woff2); a file that is not there falls back to sans-serif.",
|
|
132
|
+
},
|
|
133
|
+
fontSize: { type: "float", default: 48, min: 1, max: 500, step: 1, label: "Font Size", control: "slider" },
|
|
134
|
+
fontWeight: {
|
|
135
|
+
type: "string", default: "normal", label: "Font Weight", control: "select",
|
|
136
|
+
options: [
|
|
137
|
+
{ value: "normal", label: "Normal" },
|
|
138
|
+
{ value: "bold", label: "Bold" },
|
|
139
|
+
{ value: "100", label: "Thin (100)" },
|
|
140
|
+
{ value: "200", label: "Extra Light (200)" },
|
|
141
|
+
{ value: "300", label: "Light (300)" },
|
|
142
|
+
{ value: "500", label: "Medium (500)" },
|
|
143
|
+
{ value: "600", label: "Semi Bold (600)" },
|
|
144
|
+
{ value: "700", label: "Bold (700)" },
|
|
145
|
+
{ value: "800", label: "Extra Bold (800)" },
|
|
146
|
+
{ value: "900", label: "Black (900)" },
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
fontStyle: {
|
|
150
|
+
type: "string", default: "normal", label: "Font Style", control: "select",
|
|
151
|
+
options: [{ value: "normal", label: "Normal" }, { value: "italic", label: "Italic" }, { value: "oblique", label: "Oblique" }],
|
|
152
|
+
},
|
|
153
|
+
alignH: {
|
|
154
|
+
type: "string", default: "center", label: "Horizontal Align", control: "select",
|
|
155
|
+
options: [{ value: "left", label: "Left" }, { value: "center", label: "Center" }, { value: "right", label: "Right" }],
|
|
156
|
+
},
|
|
157
|
+
alignV: {
|
|
158
|
+
type: "string", default: "middle", label: "Vertical Align", control: "select",
|
|
159
|
+
options: [{ value: "top", label: "Top" }, { value: "middle", label: "Middle" }, { value: "bottom", label: "Bottom" }],
|
|
160
|
+
},
|
|
161
|
+
color: { type: "color", default: [1, 1, 1, 1], label: "Color" },
|
|
162
|
+
backgroundColor: { type: "color", default: [0, 0, 0, 0], label: "Background" },
|
|
163
|
+
resolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" },
|
|
164
|
+
offset: { type: "vec2", default: [0, 0], min: -2048, max: 2048, step: 1, label: "Offset" },
|
|
165
|
+
rotation: { type: "float", default: 0, min: -180, max: 180, step: 0.1, label: "Rotation", control: "slider" },
|
|
166
|
+
letterSpacing: { type: "float", default: 0, min: -50, max: 100, step: 0.5, label: "Letter Spacing", control: "slider" },
|
|
167
|
+
lineHeight: { type: "float", default: 1.2, min: 0.5, max: 3, step: 0.05, label: "Line Height", control: "slider" },
|
|
168
|
+
opacity: { type: "float", default: 1, min: 0, max: 1, step: 0.01, label: "Opacity", control: "slider" },
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
export const imageDefinition = {
|
|
172
|
+
apiVersion: 1,
|
|
173
|
+
label: "File",
|
|
174
|
+
description: "An image file from the project, or an image input, optionally resized.",
|
|
175
|
+
icon: "FileImage",
|
|
176
|
+
runsOn: "portable",
|
|
177
|
+
capabilities: ["assets"],
|
|
178
|
+
inputs: { image: { kind: "data", type: "image", description: "Used instead of the file when wired." } },
|
|
179
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
180
|
+
props: {
|
|
181
|
+
file: { type: "string", default: "", label: "File", description: "A project-relative image path." },
|
|
182
|
+
resolutionMode: {
|
|
183
|
+
type: "string", default: "original", label: "Resolution Mode", control: "select",
|
|
184
|
+
options: [{ value: "original", label: "Original" }, { value: "max", label: "Max Resolution" }, { value: "fixed", label: "Fixed Resolution" }],
|
|
185
|
+
},
|
|
186
|
+
maxResolution: { type: "vec2i", default: [2048, 2048], min: 1, max: 4096, label: "Max Resolution" },
|
|
187
|
+
fixedResolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Fixed Resolution" },
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
export const blurDefinition = {
|
|
191
|
+
apiVersion: 1,
|
|
192
|
+
label: "Blur",
|
|
193
|
+
description: "Box (three passes, fast) or true Gaussian blur.",
|
|
194
|
+
icon: "Droplets",
|
|
195
|
+
runsOn: "portable",
|
|
196
|
+
capabilities: ["assets"],
|
|
197
|
+
inputs: { image: { kind: "data", type: "image" } },
|
|
198
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
199
|
+
props: {
|
|
200
|
+
method: {
|
|
201
|
+
type: "string", default: "box", label: "Method", control: "select",
|
|
202
|
+
options: [{ value: "box", label: "Box (Fast)" }, { value: "gaussian", label: "Gaussian (Accurate)" }],
|
|
203
|
+
},
|
|
204
|
+
radius: { type: "float", default: 5, min: 0, max: 100, step: 0.1, label: "Radius" },
|
|
205
|
+
wrapEdges: { type: "bool", default: false, label: "Wrap Edges" },
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
export const normalMapDefinition = {
|
|
209
|
+
apiVersion: 1,
|
|
210
|
+
label: "Normal Map",
|
|
211
|
+
description: "A normal map from the red (or grey) channel as height.",
|
|
212
|
+
icon: "Box",
|
|
213
|
+
runsOn: "portable",
|
|
214
|
+
capabilities: ["assets"],
|
|
215
|
+
inputs: { image: { kind: "data", type: "image" } },
|
|
216
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
217
|
+
props: {
|
|
218
|
+
scale: { type: "float", default: 1, min: 0, max: 10, step: 0.1, label: "Scale" },
|
|
219
|
+
flipX: { type: "bool", default: false, label: "Flip X" },
|
|
220
|
+
flipY: { type: "bool", default: false, label: "Flip Y" },
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
export const resizeDefinition = {
|
|
224
|
+
apiVersion: 1,
|
|
225
|
+
label: "Resize",
|
|
226
|
+
description: "Scale an image, or resize it to a fixed size, bilinear.",
|
|
227
|
+
icon: "Maximize2",
|
|
228
|
+
runsOn: "portable",
|
|
229
|
+
capabilities: ["assets"],
|
|
230
|
+
inputs: { image: { kind: "data", type: "image" } },
|
|
231
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
232
|
+
props: {
|
|
233
|
+
mode: {
|
|
234
|
+
type: "string", default: "scale", label: "Mode", control: "select",
|
|
235
|
+
options: [{ value: "scale", label: "Scale" }, { value: "fixed", label: "Fixed" }],
|
|
236
|
+
},
|
|
237
|
+
scale: { type: "float", default: 1, min: 0.1, max: 10, step: 0.1, label: "Scale" },
|
|
238
|
+
width: { type: "int", default: 512, min: 1, max: 4096, step: 1, label: "Width" },
|
|
239
|
+
height: { type: "int", default: 512, min: 1, max: 4096, step: 1, label: "Height" },
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
export const transformDefinition = {
|
|
243
|
+
apiVersion: 1,
|
|
244
|
+
label: "Transform",
|
|
245
|
+
description: "Rotate, translate and scale an image about a pivot.",
|
|
246
|
+
icon: "Move",
|
|
247
|
+
runsOn: "portable",
|
|
248
|
+
capabilities: ["assets"],
|
|
249
|
+
inputs: { image: { kind: "data", type: "image" } },
|
|
250
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
251
|
+
props: {
|
|
252
|
+
translate: { type: "vec2", default: [0, 0], min: -2048, max: 2048, step: 1, label: "Translate" },
|
|
253
|
+
rotation: { type: "float", default: 0, min: -180, max: 180, step: 0.1, label: "Rotation" },
|
|
254
|
+
scale: { type: "vec2", default: [1, 1], min: 0.01, max: 10, step: 0.01, label: "Scale" },
|
|
255
|
+
uniformScale: { type: "bool", default: true, label: "Uniform Scale" },
|
|
256
|
+
pivot: {
|
|
257
|
+
type: "string", default: "center", label: "Pivot", control: "select",
|
|
258
|
+
options: [
|
|
259
|
+
{ value: "center", label: "Center" },
|
|
260
|
+
{ value: "top-left", label: "Top Left" },
|
|
261
|
+
{ value: "top-right", label: "Top Right" },
|
|
262
|
+
{ value: "bottom-left", label: "Bottom Left" },
|
|
263
|
+
{ value: "bottom-right", label: "Bottom Right" },
|
|
264
|
+
{ value: "custom", label: "Custom" },
|
|
265
|
+
],
|
|
266
|
+
},
|
|
267
|
+
customPivot: { type: "vec2", default: [0.5, 0.5], min: 0, max: 1, step: 0.01, label: "Custom Pivot" },
|
|
268
|
+
filter: {
|
|
269
|
+
type: "string", default: "bilinear", label: "Filter", control: "select",
|
|
270
|
+
options: [{ value: "nearest", label: "Nearest" }, { value: "bilinear", label: "Bilinear" }],
|
|
271
|
+
},
|
|
272
|
+
wrap: {
|
|
273
|
+
type: "string", default: "clamp", label: "Wrap Mode", control: "select",
|
|
274
|
+
options: [
|
|
275
|
+
{ value: "clamp", label: "Clamp" },
|
|
276
|
+
{ value: "repeat", label: "Repeat" },
|
|
277
|
+
{ value: "mirror", label: "Mirror" },
|
|
278
|
+
{ value: "transparent", label: "Transparent" },
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
export const compositeDefinition = {
|
|
284
|
+
apiVersion: 1,
|
|
285
|
+
label: "Composite",
|
|
286
|
+
description: "Blend image2 over image1.",
|
|
287
|
+
icon: "Layers",
|
|
288
|
+
runsOn: "portable",
|
|
289
|
+
capabilities: ["assets"],
|
|
290
|
+
inputs: {
|
|
291
|
+
image1: { kind: "data", type: "image" },
|
|
292
|
+
image2: { kind: "data", type: "image" },
|
|
293
|
+
},
|
|
294
|
+
outputs: { image: { kind: "data", type: "image" } },
|
|
295
|
+
props: {
|
|
296
|
+
blendMode: {
|
|
297
|
+
type: "string", default: "multiply", label: "Blend Mode", control: "select",
|
|
298
|
+
options: [
|
|
299
|
+
{ value: "normal", label: "Normal" },
|
|
300
|
+
{ value: "multiply", label: "Multiply" },
|
|
301
|
+
{ value: "screen", label: "Screen" },
|
|
302
|
+
{ value: "overlay", label: "Overlay" },
|
|
303
|
+
{ value: "darken", label: "Darken" },
|
|
304
|
+
{ value: "lighten", label: "Lighten" },
|
|
305
|
+
{ value: "color-dodge", label: "Color Dodge" },
|
|
306
|
+
{ value: "color-burn", label: "Color Burn" },
|
|
307
|
+
{ value: "hard-light", label: "Hard Light" },
|
|
308
|
+
{ value: "soft-light", label: "Soft Light" },
|
|
309
|
+
{ value: "difference", label: "Difference" },
|
|
310
|
+
{ value: "exclusion", label: "Exclusion" },
|
|
311
|
+
{ value: "add", label: "Add" },
|
|
312
|
+
{ value: "subtract", label: "Subtract" },
|
|
313
|
+
{ value: "divide", label: "Divide" },
|
|
314
|
+
{ value: "pin-light", label: "Pin Light" },
|
|
315
|
+
{ value: "vivid-light", label: "Vivid Light" },
|
|
316
|
+
{ value: "linear-dodge", label: "Linear Dodge" },
|
|
317
|
+
{ value: "linear-burn", label: "Linear Burn" },
|
|
318
|
+
],
|
|
319
|
+
},
|
|
320
|
+
opacity: { type: "float", default: 1, min: 0, max: 1, step: 0.01, label: "Opacity" },
|
|
321
|
+
outputResolution: {
|
|
322
|
+
type: "string", default: "input1", label: "Output Resolution", control: "select",
|
|
323
|
+
options: [
|
|
324
|
+
{ value: "input1", label: "Use Input 1" },
|
|
325
|
+
{ value: "input2", label: "Use Input 2" },
|
|
326
|
+
{ value: "largest", label: "Largest Input" },
|
|
327
|
+
{ value: "smallest", label: "Smallest Input" },
|
|
328
|
+
{ value: "custom", label: "Custom" },
|
|
329
|
+
],
|
|
330
|
+
},
|
|
331
|
+
customResolution: { type: "vec2i", default: [512, 512], min: 1, max: 4096, label: "Resolution" },
|
|
332
|
+
fitMode: {
|
|
333
|
+
type: "string", default: "fill", label: "Fit Mode", control: "select",
|
|
334
|
+
options: [
|
|
335
|
+
{ value: "fill", label: "Fill (Crop)" },
|
|
336
|
+
{ value: "fit", label: "Fit (Letterbox)" },
|
|
337
|
+
{ value: "stretch", label: "Stretch" },
|
|
338
|
+
{ value: "native", label: "Native (No Scale)" },
|
|
339
|
+
],
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
//# sourceMappingURL=definitions.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NodeExecutionContext } from "@field/cascade/contracts";
|
|
2
|
+
import type { imageDefinition } from "./definitions.js";
|
|
3
|
+
/**
|
|
4
|
+
* `cascade.image.Image` (labelled File): a project image, or the image wired
|
|
5
|
+
* into it, at its own size, within a maximum, or at a fixed size.
|
|
6
|
+
*/
|
|
7
|
+
export declare function executeImage(context: NodeExecutionContext<typeof imageDefinition>): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { imageReference, output, readPlanar } from "./io.js";
|
|
2
|
+
import { resample } from "./planar.js";
|
|
3
|
+
/**
|
|
4
|
+
* `cascade.image.Image` (labelled File): a project image, or the image wired
|
|
5
|
+
* into it, at its own size, within a maximum, or at a fixed size.
|
|
6
|
+
*/
|
|
7
|
+
export async function executeImage(context) {
|
|
8
|
+
const { props } = context;
|
|
9
|
+
const source = await readPlanar(context, imageReference(context.inputs.image) ?? imageReference(props.file));
|
|
10
|
+
if (!source)
|
|
11
|
+
return;
|
|
12
|
+
if (props.resolutionMode === "original") {
|
|
13
|
+
await output(context, source);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (props.resolutionMode === "max") {
|
|
17
|
+
const [maxWidth, maxHeight] = props.maxResolution;
|
|
18
|
+
const aspect = source.width / source.height;
|
|
19
|
+
let width = source.width;
|
|
20
|
+
let height = source.height;
|
|
21
|
+
if (width > maxWidth) {
|
|
22
|
+
width = maxWidth;
|
|
23
|
+
height = maxWidth / aspect;
|
|
24
|
+
}
|
|
25
|
+
if (height > maxHeight) {
|
|
26
|
+
height = maxHeight;
|
|
27
|
+
width = maxHeight * aspect;
|
|
28
|
+
}
|
|
29
|
+
width = Math.round(width);
|
|
30
|
+
height = Math.round(height);
|
|
31
|
+
await output(context, width !== source.width || height !== source.height ? resample(source, width, height) : source);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const [width, height] = props.fixedResolution;
|
|
35
|
+
await output(context, resample(source, width, height));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=file.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NodeExecutionContext } from "@field/cascade/contracts";
|
|
2
|
+
import type { blurDefinition, compositeDefinition, normalMapDefinition, resizeDefinition, transformDefinition } from "./definitions.js";
|
|
3
|
+
export declare function executeBlur(context: NodeExecutionContext<typeof blurDefinition>): Promise<void>;
|
|
4
|
+
export declare function executeNormalMap(context: NodeExecutionContext<typeof normalMapDefinition>): Promise<void>;
|
|
5
|
+
export declare function executeResize(context: NodeExecutionContext<typeof resizeDefinition>): Promise<void>;
|
|
6
|
+
export declare function executeTransform(context: NodeExecutionContext<typeof transformDefinition>): Promise<void>;
|
|
7
|
+
export declare function executeComposite(context: NodeExecutionContext<typeof compositeDefinition>): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=filters.d.ts.map
|