@nodetool-ai/image-nodes 0.8.1

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.
Files changed (87) hide show
  1. package/README.md +94 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/index.d.ts +19 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +19 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/nodes/game.d.ts +68 -0
  8. package/dist/nodes/game.d.ts.map +1 -0
  9. package/dist/nodes/game.js +551 -0
  10. package/dist/nodes/game.js.map +1 -0
  11. package/dist/nodes/gpu-device.d.ts +59 -0
  12. package/dist/nodes/gpu-device.d.ts.map +1 -0
  13. package/dist/nodes/gpu-device.js +144 -0
  14. package/dist/nodes/gpu-device.js.map +1 -0
  15. package/dist/nodes/image-io.d.ts +122 -0
  16. package/dist/nodes/image-io.d.ts.map +1 -0
  17. package/dist/nodes/image-io.js +381 -0
  18. package/dist/nodes/image-io.js.map +1 -0
  19. package/dist/nodes/image.d.ts +649 -0
  20. package/dist/nodes/image.d.ts.map +1 -0
  21. package/dist/nodes/image.js +2827 -0
  22. package/dist/nodes/image.js.map +1 -0
  23. package/dist/nodes/lib-grid.d.ts +19 -0
  24. package/dist/nodes/lib-grid.d.ts.map +1 -0
  25. package/dist/nodes/lib-grid.js +134 -0
  26. package/dist/nodes/lib-grid.js.map +1 -0
  27. package/dist/nodes/lib-image-channel.d.ts +38 -0
  28. package/dist/nodes/lib-image-channel.d.ts.map +1 -0
  29. package/dist/nodes/lib-image-channel.js +55 -0
  30. package/dist/nodes/lib-image-channel.js.map +1 -0
  31. package/dist/nodes/lib-image-color-grading.d.ts +3 -0
  32. package/dist/nodes/lib-image-color-grading.d.ts.map +1 -0
  33. package/dist/nodes/lib-image-color-grading.js +1080 -0
  34. package/dist/nodes/lib-image-color-grading.js.map +1 -0
  35. package/dist/nodes/lib-image-color.d.ts +96 -0
  36. package/dist/nodes/lib-image-color.d.ts.map +1 -0
  37. package/dist/nodes/lib-image-color.js +150 -0
  38. package/dist/nodes/lib-image-color.js.map +1 -0
  39. package/dist/nodes/lib-image-draw.d.ts +4 -0
  40. package/dist/nodes/lib-image-draw.d.ts.map +1 -0
  41. package/dist/nodes/lib-image-draw.js +464 -0
  42. package/dist/nodes/lib-image-draw.js.map +1 -0
  43. package/dist/nodes/lib-image-effects.d.ts +72 -0
  44. package/dist/nodes/lib-image-effects.d.ts.map +1 -0
  45. package/dist/nodes/lib-image-effects.js +123 -0
  46. package/dist/nodes/lib-image-effects.js.map +1 -0
  47. package/dist/nodes/lib-image-enhance.d.ts +3 -0
  48. package/dist/nodes/lib-image-enhance.d.ts.map +1 -0
  49. package/dist/nodes/lib-image-enhance.js +442 -0
  50. package/dist/nodes/lib-image-enhance.js.map +1 -0
  51. package/dist/nodes/lib-image-filter-extras.d.ts +72 -0
  52. package/dist/nodes/lib-image-filter-extras.d.ts.map +1 -0
  53. package/dist/nodes/lib-image-filter-extras.js +110 -0
  54. package/dist/nodes/lib-image-filter-extras.js.map +1 -0
  55. package/dist/nodes/lib-image-filter.d.ts +3 -0
  56. package/dist/nodes/lib-image-filter.d.ts.map +1 -0
  57. package/dist/nodes/lib-image-filter.js +588 -0
  58. package/dist/nodes/lib-image-filter.js.map +1 -0
  59. package/dist/nodes/lib-image-generators.d.ts +71 -0
  60. package/dist/nodes/lib-image-generators.d.ts.map +1 -0
  61. package/dist/nodes/lib-image-generators.js +158 -0
  62. package/dist/nodes/lib-image-generators.js.map +1 -0
  63. package/dist/nodes/lib-image-keyer.d.ts +34 -0
  64. package/dist/nodes/lib-image-keyer.d.ts.map +1 -0
  65. package/dist/nodes/lib-image-keyer.js +61 -0
  66. package/dist/nodes/lib-image-keyer.js.map +1 -0
  67. package/dist/nodes/lib-image-mask.d.ts +47 -0
  68. package/dist/nodes/lib-image-mask.d.ts.map +1 -0
  69. package/dist/nodes/lib-image-mask.js +59 -0
  70. package/dist/nodes/lib-image-mask.js.map +1 -0
  71. package/dist/nodes/lib-image-utils.d.ts +16 -0
  72. package/dist/nodes/lib-image-utils.d.ts.map +1 -0
  73. package/dist/nodes/lib-image-utils.js +61 -0
  74. package/dist/nodes/lib-image-utils.js.map +1 -0
  75. package/dist/nodes/lib-image-warp.d.ts +112 -0
  76. package/dist/nodes/lib-image-warp.d.ts.map +1 -0
  77. package/dist/nodes/lib-image-warp.js +236 -0
  78. package/dist/nodes/lib-image-warp.js.map +1 -0
  79. package/dist/nodes/lib-shader-utils.d.ts +105 -0
  80. package/dist/nodes/lib-shader-utils.d.ts.map +1 -0
  81. package/dist/nodes/lib-shader-utils.js +452 -0
  82. package/dist/nodes/lib-shader-utils.js.map +1 -0
  83. package/dist/nodes/sketch.d.ts +62 -0
  84. package/dist/nodes/sketch.d.ts.map +1 -0
  85. package/dist/nodes/sketch.js +325 -0
  86. package/dist/nodes/sketch.js.map +1 -0
  87. package/package.json +83 -0
@@ -0,0 +1,112 @@
1
+ /**
2
+ * `lib.image.warp.*` — geometric warps that re-sample the source. Tile, pad
3
+ * with empty/coloured borders, affine matrix remap, perspective corner pin,
4
+ * polar coordinate remap, displacement-map driven warp, fisheye spherize,
5
+ * UV-space offset.
6
+ *
7
+ * Resize / crop / mirror / rotate already live under `nodetool.image.*` and
8
+ * `nodetool.image.RotateAndFlip` — those nodeTypes stay; this file only
9
+ * exposes ops that don't already have an equivalent.
10
+ */
11
+ import { BaseNode } from "@nodetool-ai/node-sdk";
12
+ import type { ImageRef } from "@nodetool-ai/node-sdk";
13
+ import type { ProcessingContext } from "@nodetool-ai/runtime";
14
+ declare class OffsetNode extends BaseNode {
15
+ static readonly nodeType = "lib.image.warp.Offset";
16
+ static readonly title = "Offset";
17
+ static readonly description = "Translate the image by (dx, dy) UV units with selectable wrap.\n image, offset, translate, shift";
18
+ static readonly inputFields: string[];
19
+ static readonly metadataOutputTypes: {
20
+ output: string;
21
+ };
22
+ process(context?: ProcessingContext): Promise<{
23
+ output: ImageRef;
24
+ }>;
25
+ }
26
+ declare class PadNode extends BaseNode {
27
+ static readonly nodeType = "lib.image.warp.Pad";
28
+ static readonly title = "Pad";
29
+ static readonly description = "Pad with empty / coloured space on each side. Output enlarges to fit.\n image, pad, border, expand, frame";
30
+ static readonly inputFields: string[];
31
+ static readonly metadataOutputTypes: {
32
+ output: string;
33
+ };
34
+ process(context?: ProcessingContext): Promise<{
35
+ output: ImageRef;
36
+ }>;
37
+ }
38
+ declare class TileNode extends BaseNode {
39
+ static readonly nodeType = "lib.image.warp.Tile";
40
+ static readonly title = "Tile";
41
+ static readonly description = "Tile the source N \u00D7 M times across the same-sized canvas.\n image, tile, repeat, pattern";
42
+ static readonly inputFields: string[];
43
+ static readonly metadataOutputTypes: {
44
+ output: string;
45
+ };
46
+ process(context?: ProcessingContext): Promise<{
47
+ output: ImageRef;
48
+ }>;
49
+ }
50
+ declare class AffineNode extends BaseNode {
51
+ static readonly nodeType = "lib.image.warp.Affine";
52
+ static readonly title = "Affine";
53
+ static readonly description = "Apply an inverse 2\u00D73 affine matrix. Each output UV maps to source (m00\u00B7u + m01\u00B7v + tx, m10\u00B7u + m11\u00B7v + ty).\n image, affine, transform, matrix, warp";
54
+ static readonly inputFields: string[];
55
+ static readonly metadataOutputTypes: {
56
+ output: string;
57
+ };
58
+ process(context?: ProcessingContext): Promise<{
59
+ output: ImageRef;
60
+ }>;
61
+ }
62
+ declare class CornerPinNode extends BaseNode {
63
+ static readonly nodeType = "lib.image.warp.CornerPin";
64
+ static readonly title = "Corner Pin";
65
+ static readonly description = "Perspective warp via an inverse 3\u00D73 homography (H22 fixed at 1).\n image, perspective, corner pin, homography, warp";
66
+ static readonly inputFields: string[];
67
+ static readonly metadataOutputTypes: {
68
+ output: string;
69
+ };
70
+ process(context?: ProcessingContext): Promise<{
71
+ output: ImageRef;
72
+ }>;
73
+ }
74
+ declare class PolarRemapNode extends BaseNode {
75
+ static readonly nodeType = "lib.image.warp.PolarRemap";
76
+ static readonly title = "Polar Remap";
77
+ static readonly description = "Convert between rectangular and polar UV space. 0 rect\u2192polar / 1 polar\u2192rect.\n image, polar, warp, kaleidoscope";
78
+ static readonly inputFields: string[];
79
+ static readonly metadataOutputTypes: {
80
+ output: string;
81
+ };
82
+ process(context?: ProcessingContext): Promise<{
83
+ output: ImageRef;
84
+ }>;
85
+ }
86
+ declare class DisplaceNode extends BaseNode {
87
+ static readonly nodeType = "lib.image.warp.Displace";
88
+ static readonly title = "Displace";
89
+ static readonly description = "Per-pixel UV offset driven by a displacement map (R+G channels). Useful for ripples and glass.\n image, displace, warp, ripple, distortion";
90
+ static readonly inputFields: string[];
91
+ static readonly metadataOutputTypes: {
92
+ output: string;
93
+ };
94
+ process(context?: ProcessingContext): Promise<{
95
+ output: ImageRef;
96
+ }>;
97
+ }
98
+ declare class SpherizeNode extends BaseNode {
99
+ static readonly nodeType = "lib.image.warp.Spherize";
100
+ static readonly title = "Spherize";
101
+ static readonly description = "Fisheye lens distortion centred on the source. Positive bulges out, negative pinches in.\n image, fisheye, spherize, warp, lens";
102
+ static readonly inputFields: string[];
103
+ static readonly metadataOutputTypes: {
104
+ output: string;
105
+ };
106
+ process(context?: ProcessingContext): Promise<{
107
+ output: ImageRef;
108
+ }>;
109
+ }
110
+ export declare const LIB_IMAGE_WARP_NODES: (typeof OffsetNode | typeof PadNode | typeof TileNode | typeof AffineNode | typeof CornerPinNode | typeof PolarRemapNode | typeof DisplaceNode | typeof SpherizeNode)[];
111
+ export { OffsetNode, PadNode, TileNode, AffineNode, CornerPinNode, PolarRemapNode, DisplaceNode, SpherizeNode };
112
+ //# sourceMappingURL=lib-image-warp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib-image-warp.d.ts","sourceRoot":"","sources":["../../src/nodes/lib-image-warp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAA4B,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAA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AQ,CAAC,QAAQ,6BAA6B;IACrD,MAAM,CAAC,QAAQ,CAAC,KAAK,cAAc;IACnC,MAAM,CAAC,QAAQ,CAAC,WAAW,mJACuH;IAClJ,MAAM,CAAC,QAAQ,CAAC,WAAW,WAA6B;IACxD,MAAM,CAAC,QAAQ,CAAC,mBAAmB;QAAK,MAAM;MAAY;IAEpD,OAAO,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,QAAQ,CAAA;KAAE,CAAC,CAaxE;CACF;AAkBD,cAAM,YAAa,SAAQ,QAAQ;IACjC,MAAM,CAAC,QAAQ,CAAC,QAAQ,6BAA6B;IACrD,MAAM,CAAC,QAAQ,CAAC,KAAK,cAAc;IACnC,MAAM,CAAC,QAAQ,CAAC,WAAW,wIAC4G;IACvI,MAAM,CAAC,QAAQ,CAAC,WAAW,WAAa;IACxC,MAAM,CAAC,QAAQ,CAAC,mBAAmB;QAAK,MAAM;MAAY;IAEpD,OAAO,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,QAAQ,CAAA;KAAE,CAAC,CAUxE;CACF;AAQD,eAAO,MAAM,oBAAoB,yKAS9B,CAAC;AAEJ,OAAO,EACL,UAAU,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EACV,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACb,CAAC"}
@@ -0,0 +1,236 @@
1
+ /**
2
+ * `lib.image.warp.*` — geometric warps that re-sample the source. Tile, pad
3
+ * with empty/coloured borders, affine matrix remap, perspective corner pin,
4
+ * polar coordinate remap, displacement-map driven warp, fisheye spherize,
5
+ * UV-space offset.
6
+ *
7
+ * Resize / crop / mirror / rotate already live under `nodetool.image.*` and
8
+ * `nodetool.image.RotateAndFlip` — those nodeTypes stay; this file only
9
+ * exposes ops that don't already have an equivalent.
10
+ */
11
+ import { BaseNode, registerDeclaredProperty } from "@nodetool-ai/node-sdk";
12
+ import * as d from "typegpu/data";
13
+ import { transformOffsetV1, transformPadV1, transformTileV1, transformAffineV1, transformCornerPinV1, transformPolarRemapV1, transformDisplaceV1, transformSpherizeV1 } from "@nodetool-ai/gpu/pool";
14
+ import { IMAGE_PROP, extraImageProp, colorProp, colorValueToVec4, floatProp, intProp, num, premultiplyVec4, runShaderNode } from "./lib-shader-utils.js";
15
+ import { imageDimensions } from "./image-io.js";
16
+ import { tagAsBrowserGpu, tagAsContentCard } from "@nodetool-ai/nodes-utils";
17
+ function clamp(value, min, max) {
18
+ return Math.min(max, Math.max(min, value));
19
+ }
20
+ /**
21
+ * Convert a colour value to a vec4f, premultiplying the alpha into RGB before
22
+ * packing. Use when handing a colour to a shader whose param contract
23
+ * expects premultiplied (e.g. `transform.pad@1`'s `color`).
24
+ */
25
+ function premultipliedVec4From(value, fallback) {
26
+ const [r, g, b, a] = premultiplyVec4(colorValueToVec4(value, fallback));
27
+ return d.vec4f(r, g, b, a);
28
+ }
29
+ async function imageDims(image, ctx) {
30
+ if (!image)
31
+ return null;
32
+ const { width, height } = await imageDimensions(image, ctx);
33
+ if (!width || !height)
34
+ return null;
35
+ return { width, height };
36
+ }
37
+ class OffsetNode extends BaseNode {
38
+ static nodeType = "lib.image.warp.Offset";
39
+ static title = "Offset";
40
+ static description = "Translate the image by (dx, dy) UV units with selectable wrap.\n image, offset, translate, shift";
41
+ static inputFields = ["image"];
42
+ static metadataOutputTypes = { output: "image" };
43
+ async process(context) {
44
+ const props = this.serialize();
45
+ const output = await runShaderNode(transformOffsetV1, {
46
+ dx: num(props.dx, 0),
47
+ dy: num(props.dy, 0),
48
+ wrap: num(props.wrap, 0)
49
+ }, props.image, {}, context);
50
+ return { output };
51
+ }
52
+ }
53
+ registerDeclaredProperty(OffsetNode, "image", IMAGE_PROP);
54
+ registerDeclaredProperty(OffsetNode, "dx", floatProp(0, { min: -1, max: 1, label: "Offset X" }));
55
+ registerDeclaredProperty(OffsetNode, "dy", floatProp(0, { min: -1, max: 1, label: "Offset Y" }));
56
+ registerDeclaredProperty(OffsetNode, "wrap", intProp(0, { min: 0, max: 2, label: "Wrap", notes: "0 clamp / 1 repeat / 2 mirror" }));
57
+ class PadNode extends BaseNode {
58
+ static nodeType = "lib.image.warp.Pad";
59
+ static title = "Pad";
60
+ static description = "Pad with empty / coloured space on each side. Output enlarges to fit.\n image, pad, border, expand, frame";
61
+ static inputFields = ["image"];
62
+ static metadataOutputTypes = { output: "image" };
63
+ async process(context) {
64
+ const props = this.serialize();
65
+ const src = await imageDims(props.image, context);
66
+ let opts = {};
67
+ if (src) {
68
+ const wScale = 1 + num(props.left, 0) + num(props.right, 0);
69
+ const hScale = 1 + num(props.top, 0) + num(props.bottom, 0);
70
+ opts = {
71
+ outputWidth: Math.max(1, Math.round(src.width * wScale)),
72
+ outputHeight: Math.max(1, Math.round(src.height * hScale))
73
+ };
74
+ }
75
+ const output = await runShaderNode(transformPadV1, {
76
+ left: num(props.left, 0),
77
+ top: num(props.top, 0),
78
+ right: num(props.right, 0),
79
+ bottom: num(props.bottom, 0),
80
+ // Shader's `color` is declared premultiplied — the colour picker
81
+ // emits straight alpha, so we premultiply before handing it over.
82
+ color: premultipliedVec4From(props.color, [0, 0, 0, 0])
83
+ }, props.image, opts, context);
84
+ return { output };
85
+ }
86
+ }
87
+ registerDeclaredProperty(PadNode, "image", IMAGE_PROP);
88
+ registerDeclaredProperty(PadNode, "left", floatProp(0, { min: 0, max: 4, label: "Left", notes: "× source width" }));
89
+ registerDeclaredProperty(PadNode, "top", floatProp(0, { min: 0, max: 4, label: "Top", notes: "× source height" }));
90
+ registerDeclaredProperty(PadNode, "right", floatProp(0, { min: 0, max: 4, label: "Right", notes: "× source width" }));
91
+ registerDeclaredProperty(PadNode, "bottom", floatProp(0, { min: 0, max: 4, label: "Bottom", notes: "× source height" }));
92
+ registerDeclaredProperty(PadNode, "color", colorProp("#00000000", { label: "Fill color" }));
93
+ class TileNode extends BaseNode {
94
+ static nodeType = "lib.image.warp.Tile";
95
+ static title = "Tile";
96
+ static description = "Tile the source N × M times across the same-sized canvas.\n image, tile, repeat, pattern";
97
+ static inputFields = ["image"];
98
+ static metadataOutputTypes = { output: "image" };
99
+ async process(context) {
100
+ const props = this.serialize();
101
+ const output = await runShaderNode(transformTileV1, {
102
+ // Prop metadata caps tiles at [1, 32]; clamp so an out-of-range wire
103
+ // value can't reach the shader as a zero/negative or runaway count.
104
+ tilesX: clamp(Math.round(num(props.tiles_x, 2)), 1, 32),
105
+ tilesY: clamp(Math.round(num(props.tiles_y, 2)), 1, 32),
106
+ wrap: num(props.wrap, 1)
107
+ }, props.image, {}, context);
108
+ return { output };
109
+ }
110
+ }
111
+ registerDeclaredProperty(TileNode, "image", IMAGE_PROP);
112
+ registerDeclaredProperty(TileNode, "tiles_x", intProp(2, { min: 1, max: 32, label: "Tiles X" }));
113
+ registerDeclaredProperty(TileNode, "tiles_y", intProp(2, { min: 1, max: 32, label: "Tiles Y" }));
114
+ registerDeclaredProperty(TileNode, "wrap", intProp(1, { min: 0, max: 2, label: "Wrap", notes: "0 clamp / 1 repeat / 2 mirror" }));
115
+ class AffineNode extends BaseNode {
116
+ static nodeType = "lib.image.warp.Affine";
117
+ static title = "Affine";
118
+ static description = "Apply an inverse 2×3 affine matrix. Each output UV maps to source (m00·u + m01·v + tx, m10·u + m11·v + ty).\n image, affine, transform, matrix, warp";
119
+ static inputFields = ["image"];
120
+ static metadataOutputTypes = { output: "image" };
121
+ async process(context) {
122
+ const props = this.serialize();
123
+ const w = num(props.target_width, 0);
124
+ const h = num(props.target_height, 0);
125
+ // Resolve each dimension independently so a single specified target
126
+ // (e.g. width only) is honored and combined with the source's other
127
+ // dimension, instead of being dropped unless BOTH are set.
128
+ const src = w > 0 && h > 0 ? null : await imageDims(props.image, context);
129
+ const outputWidth = w > 0 ? w : src?.width;
130
+ const outputHeight = h > 0 ? h : src?.height;
131
+ const opts = outputWidth && outputHeight ? { outputWidth, outputHeight } : {};
132
+ const output = await runShaderNode(transformAffineV1, {
133
+ m00: num(props.m00, 1),
134
+ m01: num(props.m01, 0),
135
+ tx: num(props.tx, 0),
136
+ m10: num(props.m10, 0),
137
+ m11: num(props.m11, 1),
138
+ ty: num(props.ty, 0)
139
+ }, props.image, opts, context);
140
+ return { output };
141
+ }
142
+ }
143
+ registerDeclaredProperty(AffineNode, "image", IMAGE_PROP);
144
+ registerDeclaredProperty(AffineNode, "target_width", intProp(0, { min: 0, max: 8192, label: "Target width", notes: "0 = match source" }));
145
+ registerDeclaredProperty(AffineNode, "target_height", intProp(0, { min: 0, max: 8192, label: "Target height", notes: "0 = match source" }));
146
+ registerDeclaredProperty(AffineNode, "m00", floatProp(1, { label: "m00" }));
147
+ registerDeclaredProperty(AffineNode, "m01", floatProp(0, { label: "m01" }));
148
+ registerDeclaredProperty(AffineNode, "tx", floatProp(0, { label: "tx" }));
149
+ registerDeclaredProperty(AffineNode, "m10", floatProp(0, { label: "m10" }));
150
+ registerDeclaredProperty(AffineNode, "m11", floatProp(1, { label: "m11" }));
151
+ registerDeclaredProperty(AffineNode, "ty", floatProp(0, { label: "ty" }));
152
+ class CornerPinNode extends BaseNode {
153
+ static nodeType = "lib.image.warp.CornerPin";
154
+ static title = "Corner Pin";
155
+ static description = "Perspective warp via an inverse 3×3 homography (H22 fixed at 1).\n image, perspective, corner pin, homography, warp";
156
+ static inputFields = ["image"];
157
+ static metadataOutputTypes = { output: "image" };
158
+ async process(context) {
159
+ const props = this.serialize();
160
+ const output = await runShaderNode(transformCornerPinV1, {
161
+ h00: num(props.h00, 1),
162
+ h01: num(props.h01, 0),
163
+ h02: num(props.h02, 0),
164
+ h10: num(props.h10, 0),
165
+ h11: num(props.h11, 1),
166
+ h12: num(props.h12, 0),
167
+ h20: num(props.h20, 0),
168
+ h21: num(props.h21, 0)
169
+ }, props.image, {}, context);
170
+ return { output };
171
+ }
172
+ }
173
+ registerDeclaredProperty(CornerPinNode, "image", IMAGE_PROP);
174
+ for (const key of ["h00", "h01", "h02", "h10", "h11", "h12", "h20", "h21"]) {
175
+ const def = key === "h00" || key === "h11" ? 1 : 0;
176
+ registerDeclaredProperty(CornerPinNode, key, floatProp(def, { label: key.toUpperCase() }));
177
+ }
178
+ class PolarRemapNode extends BaseNode {
179
+ static nodeType = "lib.image.warp.PolarRemap";
180
+ static title = "Polar Remap";
181
+ static description = "Convert between rectangular and polar UV space. 0 rect→polar / 1 polar→rect.\n image, polar, warp, kaleidoscope";
182
+ static inputFields = ["image"];
183
+ static metadataOutputTypes = { output: "image" };
184
+ async process(context) {
185
+ const props = this.serialize();
186
+ const output = await runShaderNode(transformPolarRemapV1, { mode: num(props.mode, 0) }, props.image, {}, context);
187
+ return { output };
188
+ }
189
+ }
190
+ registerDeclaredProperty(PolarRemapNode, "image", IMAGE_PROP);
191
+ registerDeclaredProperty(PolarRemapNode, "mode", intProp(0, { min: 0, max: 1, label: "Mode" }));
192
+ class DisplaceNode extends BaseNode {
193
+ static nodeType = "lib.image.warp.Displace";
194
+ static title = "Displace";
195
+ static description = "Per-pixel UV offset driven by a displacement map (R+G channels). Useful for ripples and glass.\n image, displace, warp, ripple, distortion";
196
+ static inputFields = ["image", "displacement"];
197
+ static metadataOutputTypes = { output: "image" };
198
+ async process(context) {
199
+ const props = this.serialize();
200
+ const output = await runShaderNode(transformDisplaceV1, {
201
+ amountX: num(props.amount_x, 0.05),
202
+ amountY: num(props.amount_y, 0.05)
203
+ }, props.image, { extraInputs: { displacement: props.displacement } }, context);
204
+ return { output };
205
+ }
206
+ }
207
+ registerDeclaredProperty(DisplaceNode, "image", IMAGE_PROP);
208
+ registerDeclaredProperty(DisplaceNode, "displacement", extraImageProp("Displacement map", "R/G channels drive the UV offset"));
209
+ registerDeclaredProperty(DisplaceNode, "amount_x", floatProp(0.05, { min: -1, max: 1, label: "Amount X" }));
210
+ registerDeclaredProperty(DisplaceNode, "amount_y", floatProp(0.05, { min: -1, max: 1, label: "Amount Y" }));
211
+ class SpherizeNode extends BaseNode {
212
+ static nodeType = "lib.image.warp.Spherize";
213
+ static title = "Spherize";
214
+ static description = "Fisheye lens distortion centred on the source. Positive bulges out, negative pinches in.\n image, fisheye, spherize, warp, lens";
215
+ static inputFields = ["image"];
216
+ static metadataOutputTypes = { output: "image" };
217
+ async process(context) {
218
+ const props = this.serialize();
219
+ const output = await runShaderNode(transformSpherizeV1, { amount: num(props.amount, 0.5) }, props.image, {}, context);
220
+ return { output };
221
+ }
222
+ }
223
+ registerDeclaredProperty(SpherizeNode, "image", IMAGE_PROP);
224
+ registerDeclaredProperty(SpherizeNode, "amount", floatProp(0.5, { min: -1, max: 1, label: "Amount", notes: "negative pinches" }));
225
+ export const LIB_IMAGE_WARP_NODES = tagAsBrowserGpu(tagAsContentCard([
226
+ OffsetNode,
227
+ PadNode,
228
+ TileNode,
229
+ AffineNode,
230
+ CornerPinNode,
231
+ PolarRemapNode,
232
+ DisplaceNode,
233
+ SpherizeNode
234
+ ]));
235
+ export { OffsetNode, PadNode, TileNode, AffineNode, CornerPinNode, PolarRemapNode, DisplaceNode, SpherizeNode };
236
+ //# sourceMappingURL=lib-image-warp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib-image-warp.js","sourceRoot":"","sources":["../../src/nodes/lib-image-warp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAG3E,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,UAAU,EACV,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,GAAG,EACH,eAAe,EACf,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CA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GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAChF,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,eAAe,CAAC,gBAAgB,CAAC;IACnE,UAAU;IACV,OAAO;IACP,QAAQ;IACR,UAAU;IACV,aAAa;IACb,cAAc;IACd,YAAY;IACZ,YAAY;CACb,CAAC,CAAC,CAAC;AAEJ,OAAO,EACL,UAAU,EACV,OAAO,EACP,QAAQ,EACR,UAAU,EACV,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACb,CAAC"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Shared runner for `@nodetool-ai/gpu/pool` shader nodes.
3
+ *
4
+ * Environment-aware: acquires a Dawn `GPUContext` on Node and a
5
+ * `navigator.gpu` context in the browser, so the same shader path runs
6
+ * client-side (pure-browser sub-graphs) and server-side. Codec work (decode
7
+ * input / encode PNG) goes through the sharp-free {@link import("./image-io.js")}
8
+ * seam, which uses Canvas in the browser and `sharp` on Node.
9
+ *
10
+ * One helper per shader category builds a `BaseNode` per published or internal
11
+ * module from the pool. Every node body funnels into {@link runShaderNode}
12
+ * (single-pass) or {@link runRecipeNode} (multi-pass recipes), which decode
13
+ * the input(s) via `decodeRgba`, upload to a `LabeledTexture`, run
14
+ * `Executor.encode` / `RecipeRunner.encode` against the cached Dawn device,
15
+ * and emit raw RGBA via {@link rawRgbaImageRef} so chained shader nodes skip
16
+ * the PNG re-encode.
17
+ *
18
+ * Alpha conversion: the pool's contract is premultiplied between modules,
19
+ * while the node-graph carries straight-alpha RGBA (`decodeRgba` /
20
+ * `rawRgbaImageRef`). The helper premultiplies on upload and un-premultiplies
21
+ * on readback so per-module shaders see canonical premultiplied throughout.
22
+ */
23
+ import { type RecipeModule, type ShaderModule } from "@nodetool-ai/gpu/pool";
24
+ import type { PropOptions } from "@nodetool-ai/node-sdk";
25
+ import type { ImageRef } from "@nodetool-ai/node-sdk";
26
+ import type { ProcessingContext } from "@nodetool-ai/runtime";
27
+ /** Options shared by both single-pass and recipe runners. */
28
+ export interface RunShaderOptions {
29
+ /** Required when `io.output.dimensions === "host-specified"` or `"derived"`. */
30
+ outputWidth?: number;
31
+ outputHeight?: number;
32
+ /** Extra labeled inputs (`mask`, `alpha`, `displacement`, `over`, …). */
33
+ extraInputs?: Record<string, unknown>;
34
+ }
35
+ /**
36
+ * Run a single-pass {@link ShaderModule} against the cached Dawn device. The
37
+ * dispatch (fragment vs compute) is picked from `module.kind`.
38
+ */
39
+ export declare function runShaderNode(module: ShaderModule, params: Record<string, unknown>, sourceImage: unknown | null, opts?: RunShaderOptions, context?: ProcessingContext): Promise<ImageRef>;
40
+ /** Run a multi-pass {@link RecipeModule} (e.g. `filters.glow`, `mixer.dropShadow`). */
41
+ export declare function runRecipeNode(recipe: RecipeModule, params: Record<string, unknown>, sourceImage: unknown | null, opts?: RunShaderOptions, context?: ProcessingContext): Promise<ImageRef>;
42
+ /**
43
+ * Coerce an arbitrary prop value to a finite number, falling back when it is
44
+ * `NaN`/`Infinity`/non-numeric. Shared by every `lib.image.*` node body that
45
+ * reads scalar props off `this.serialize()`.
46
+ */
47
+ export declare function num(value: unknown, fallback: number): number;
48
+ /**
49
+ * Declarative descriptor for a generated image node: its type/title/docs, which
50
+ * fields render inline vs as input handles, its outputs, and its prop schema.
51
+ * Every `createXNode(desc)` factory in this package consumes this shape.
52
+ */
53
+ export type Desc = {
54
+ nodeType: string;
55
+ title: string;
56
+ description: string;
57
+ inlineFields: string[];
58
+ inputFields: string[];
59
+ outputs: Record<string, string>;
60
+ properties: Array<{
61
+ name: string;
62
+ options: PropOptions;
63
+ }>;
64
+ };
65
+ /** Standard `image` input slot for shader nodes consuming a source texture. */
66
+ export declare const IMAGE_PROP: PropOptions;
67
+ /** Optional second image slot (mask, alpha source, displacement map, …). */
68
+ export declare function extraImageProp(title: string, description: string): PropOptions;
69
+ /** Numeric scalar prop with min/max/step taken from a module's `paramUi`. */
70
+ export declare function floatProp(defaultValue: number, ui?: {
71
+ label?: string;
72
+ notes?: string;
73
+ min?: number;
74
+ max?: number;
75
+ step?: number;
76
+ }): PropOptions;
77
+ /** Integer-valued scalar (radius, mode enum, channel count). */
78
+ export declare function intProp(defaultValue: number, ui?: {
79
+ label?: string;
80
+ notes?: string;
81
+ min?: number;
82
+ max?: number;
83
+ step?: number;
84
+ }): PropOptions;
85
+ /** Hex/CSS color prop. Stored as `{ type: "color", value: "#RRGGBBAA" }`. */
86
+ export declare function colorProp(defaultHex: string, ui?: {
87
+ label?: string;
88
+ notes?: string;
89
+ }): PropOptions;
90
+ /**
91
+ * Parse a color value to a `[r, g, b, a]` tuple in [0,1].
92
+ *
93
+ * Accepted shapes:
94
+ * - `{ type: "color", value: "#rrggbb" | "#rrggbbaa" }` — the node-graph
95
+ * color prop form
96
+ * - `"#rrggbb"` / `"#rrggbbaa"` / `"rrggbb"` — bare hex strings
97
+ * - `[r, g, b, a]` / `[r, g, b]` — already-normalized floats in [0,1]
98
+ *
99
+ * Returns `fallback` for anything else, including hex strings that fail to
100
+ * parse (NaN bytes).
101
+ */
102
+ export declare function colorValueToVec4(color: unknown, fallback?: [number, number, number, number]): [number, number, number, number];
103
+ /** Premultiply a straight-alpha `[r,g,b,a]` tuple. */
104
+ export declare function premultiplyVec4(rgba: [number, number, number, number]): [number, number, number, number];
105
+ //# sourceMappingURL=lib-shader-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib-shader-utils.d.ts","sourceRoot":"","sources":["../../src/nodes/lib-shader-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,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