@nodetool-ai/gpu 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 (359) hide show
  1. package/README.md +52 -0
  2. package/dist/.nodetool-build-stamp +1 -0
  3. package/dist/blend/blendModes.d.ts +67 -0
  4. package/dist/blend/blendModes.d.ts.map +1 -0
  5. package/dist/blend/blendModes.js +80 -0
  6. package/dist/blend/blendModes.js.map +1 -0
  7. package/dist/blend/index.d.ts +10 -0
  8. package/dist/blend/index.d.ts.map +1 -0
  9. package/dist/blend/index.js +10 -0
  10. package/dist/blend/index.js.map +1 -0
  11. package/dist/blend/wgsl.d.ts +16 -0
  12. package/dist/blend/wgsl.d.ts.map +1 -0
  13. package/dist/blend/wgsl.js +85 -0
  14. package/dist/blend/wgsl.js.map +1 -0
  15. package/dist/compositor/compositor.d.ts +112 -0
  16. package/dist/compositor/compositor.d.ts.map +1 -0
  17. package/dist/compositor/compositor.js +353 -0
  18. package/dist/compositor/compositor.js.map +1 -0
  19. package/dist/compositor/headless.d.ts +47 -0
  20. package/dist/compositor/headless.d.ts.map +1 -0
  21. package/dist/compositor/headless.js +158 -0
  22. package/dist/compositor/headless.js.map +1 -0
  23. package/dist/compositor/index.d.ts +8 -0
  24. package/dist/compositor/index.d.ts.map +1 -0
  25. package/dist/compositor/index.js +8 -0
  26. package/dist/compositor/index.js.map +1 -0
  27. package/dist/compositor/shaders.d.ts +24 -0
  28. package/dist/compositor/shaders.d.ts.map +1 -0
  29. package/dist/compositor/shaders.js +241 -0
  30. package/dist/compositor/shaders.js.map +1 -0
  31. package/dist/compositor/transform.d.ts +49 -0
  32. package/dist/compositor/transform.d.ts.map +1 -0
  33. package/dist/compositor/transform.js +74 -0
  34. package/dist/compositor/transform.js.map +1 -0
  35. package/dist/context.d.ts +108 -0
  36. package/dist/context.d.ts.map +1 -0
  37. package/dist/context.js +205 -0
  38. package/dist/context.js.map +1 -0
  39. package/dist/debug/premulValidator.d.ts +85 -0
  40. package/dist/debug/premulValidator.d.ts.map +1 -0
  41. package/dist/debug/premulValidator.js +239 -0
  42. package/dist/debug/premulValidator.js.map +1 -0
  43. package/dist/executor.d.ts +74 -0
  44. package/dist/executor.d.ts.map +1 -0
  45. package/dist/executor.js +413 -0
  46. package/dist/executor.js.map +1 -0
  47. package/dist/fullscreenQuad.d.ts +11 -0
  48. package/dist/fullscreenQuad.d.ts.map +1 -0
  49. package/dist/fullscreenQuad.js +31 -0
  50. package/dist/fullscreenQuad.js.map +1 -0
  51. package/dist/index.d.ts +16 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +16 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/module.d.ts +162 -0
  56. package/dist/module.d.ts.map +1 -0
  57. package/dist/module.js +100 -0
  58. package/dist/module.js.map +1 -0
  59. package/dist/node.d.ts +38 -0
  60. package/dist/node.d.ts.map +1 -0
  61. package/dist/node.js +140 -0
  62. package/dist/node.js.map +1 -0
  63. package/dist/pool.d.ts +30 -0
  64. package/dist/pool.d.ts.map +1 -0
  65. package/dist/pool.js +33 -0
  66. package/dist/pool.js.map +1 -0
  67. package/dist/recipe.d.ts +148 -0
  68. package/dist/recipe.d.ts.map +1 -0
  69. package/dist/recipe.js +181 -0
  70. package/dist/recipe.js.map +1 -0
  71. package/dist/registry.d.ts +49 -0
  72. package/dist/registry.d.ts.map +1 -0
  73. package/dist/registry.js +100 -0
  74. package/dist/registry.js.map +1 -0
  75. package/dist/shaders/_canary/passthrough/v1/module.d.ts +13 -0
  76. package/dist/shaders/_canary/passthrough/v1/module.d.ts.map +1 -0
  77. package/dist/shaders/_canary/passthrough/v1/module.js +71 -0
  78. package/dist/shaders/_canary/passthrough/v1/module.js.map +1 -0
  79. package/dist/shaders/alpha/premulToStraight/v1/module.d.ts +16 -0
  80. package/dist/shaders/alpha/premulToStraight/v1/module.d.ts.map +1 -0
  81. package/dist/shaders/alpha/premulToStraight/v1/module.js +62 -0
  82. package/dist/shaders/alpha/premulToStraight/v1/module.js.map +1 -0
  83. package/dist/shaders/alpha/straightToPremul/v1/module.d.ts +19 -0
  84. package/dist/shaders/alpha/straightToPremul/v1/module.d.ts.map +1 -0
  85. package/dist/shaders/alpha/straightToPremul/v1/module.js +61 -0
  86. package/dist/shaders/alpha/straightToPremul/v1/module.js.map +1 -0
  87. package/dist/shaders/color/brightnessContrast/v1/module.d.ts +17 -0
  88. package/dist/shaders/color/brightnessContrast/v1/module.d.ts.map +1 -0
  89. package/dist/shaders/color/brightnessContrast/v1/module.js +84 -0
  90. package/dist/shaders/color/brightnessContrast/v1/module.js.map +1 -0
  91. package/dist/shaders/color/cdl/v1/module.d.ts +35 -0
  92. package/dist/shaders/color/cdl/v1/module.d.ts.map +1 -0
  93. package/dist/shaders/color/cdl/v1/module.js +106 -0
  94. package/dist/shaders/color/cdl/v1/module.js.map +1 -0
  95. package/dist/shaders/color/channelMerge/v1/module.d.ts +22 -0
  96. package/dist/shaders/color/channelMerge/v1/module.d.ts.map +1 -0
  97. package/dist/shaders/color/channelMerge/v1/module.js +101 -0
  98. package/dist/shaders/color/channelMerge/v1/module.js.map +1 -0
  99. package/dist/shaders/color/channelShuffle/v1/module.d.ts +29 -0
  100. package/dist/shaders/color/channelShuffle/v1/module.d.ts.map +1 -0
  101. package/dist/shaders/color/channelShuffle/v1/module.js +94 -0
  102. package/dist/shaders/color/channelShuffle/v1/module.js.map +1 -0
  103. package/dist/shaders/color/channelSplit/v1/module.d.ts +18 -0
  104. package/dist/shaders/color/channelSplit/v1/module.d.ts.map +1 -0
  105. package/dist/shaders/color/channelSplit/v1/module.js +90 -0
  106. package/dist/shaders/color/channelSplit/v1/module.js.map +1 -0
  107. package/dist/shaders/color/colorBalance/v1/module.d.ts +18 -0
  108. package/dist/shaders/color/colorBalance/v1/module.d.ts.map +1 -0
  109. package/dist/shaders/color/colorBalance/v1/module.js +86 -0
  110. package/dist/shaders/color/colorBalance/v1/module.js.map +1 -0
  111. package/dist/shaders/color/cubeLut/v1/module.d.ts +14 -0
  112. package/dist/shaders/color/cubeLut/v1/module.d.ts.map +1 -0
  113. package/dist/shaders/color/cubeLut/v1/module.js +78 -0
  114. package/dist/shaders/color/cubeLut/v1/module.js.map +1 -0
  115. package/dist/shaders/color/curves/v1/module.d.ts +31 -0
  116. package/dist/shaders/color/curves/v1/module.d.ts.map +1 -0
  117. package/dist/shaders/color/curves/v1/module.js +102 -0
  118. package/dist/shaders/color/curves/v1/module.js.map +1 -0
  119. package/dist/shaders/color/exposure/v1/module.d.ts +15 -0
  120. package/dist/shaders/color/exposure/v1/module.d.ts.map +1 -0
  121. package/dist/shaders/color/exposure/v1/module.js +78 -0
  122. package/dist/shaders/color/exposure/v1/module.js.map +1 -0
  123. package/dist/shaders/color/exposureTone/v1/module.d.ts +28 -0
  124. package/dist/shaders/color/exposureTone/v1/module.d.ts.map +1 -0
  125. package/dist/shaders/color/exposureTone/v1/module.js +107 -0
  126. package/dist/shaders/color/exposureTone/v1/module.js.map +1 -0
  127. package/dist/shaders/color/filmLook/v1/module.d.ts +28 -0
  128. package/dist/shaders/color/filmLook/v1/module.d.ts.map +1 -0
  129. package/dist/shaders/color/filmLook/v1/module.js +103 -0
  130. package/dist/shaders/color/filmLook/v1/module.js.map +1 -0
  131. package/dist/shaders/color/grade/v1/module.d.ts +35 -0
  132. package/dist/shaders/color/grade/v1/module.d.ts.map +1 -0
  133. package/dist/shaders/color/grade/v1/module.js +182 -0
  134. package/dist/shaders/color/grade/v1/module.js.map +1 -0
  135. package/dist/shaders/color/grayscale/v1/module.d.ts +14 -0
  136. package/dist/shaders/color/grayscale/v1/module.d.ts.map +1 -0
  137. package/dist/shaders/color/grayscale/v1/module.js +79 -0
  138. package/dist/shaders/color/grayscale/v1/module.js.map +1 -0
  139. package/dist/shaders/color/hsb/v1/module.d.ts +20 -0
  140. package/dist/shaders/color/hsb/v1/module.d.ts.map +1 -0
  141. package/dist/shaders/color/hsb/v1/module.js +131 -0
  142. package/dist/shaders/color/hsb/v1/module.js.map +1 -0
  143. package/dist/shaders/color/hslAdjust/v1/module.d.ts +30 -0
  144. package/dist/shaders/color/hslAdjust/v1/module.d.ts.map +1 -0
  145. package/dist/shaders/color/hslAdjust/v1/module.js +170 -0
  146. package/dist/shaders/color/hslAdjust/v1/module.js.map +1 -0
  147. package/dist/shaders/color/invert/v1/module.d.ts +15 -0
  148. package/dist/shaders/color/invert/v1/module.d.ts.map +1 -0
  149. package/dist/shaders/color/invert/v1/module.js +85 -0
  150. package/dist/shaders/color/invert/v1/module.js.map +1 -0
  151. package/dist/shaders/color/levels/v1/module.d.ts +33 -0
  152. package/dist/shaders/color/levels/v1/module.d.ts.map +1 -0
  153. package/dist/shaders/color/levels/v1/module.js +116 -0
  154. package/dist/shaders/color/levels/v1/module.js.map +1 -0
  155. package/dist/shaders/color/liftGammaGain/v1/module.d.ts +40 -0
  156. package/dist/shaders/color/liftGammaGain/v1/module.d.ts.map +1 -0
  157. package/dist/shaders/color/liftGammaGain/v1/module.js +114 -0
  158. package/dist/shaders/color/liftGammaGain/v1/module.js.map +1 -0
  159. package/dist/shaders/color/posterize/v1/module.d.ts +16 -0
  160. package/dist/shaders/color/posterize/v1/module.d.ts.map +1 -0
  161. package/dist/shaders/color/posterize/v1/module.js +80 -0
  162. package/dist/shaders/color/posterize/v1/module.js.map +1 -0
  163. package/dist/shaders/color/solarize/v1/module.d.ts +15 -0
  164. package/dist/shaders/color/solarize/v1/module.d.ts.map +1 -0
  165. package/dist/shaders/color/solarize/v1/module.js +83 -0
  166. package/dist/shaders/color/solarize/v1/module.js.map +1 -0
  167. package/dist/shaders/color/splitToning/v1/module.d.ts +26 -0
  168. package/dist/shaders/color/splitToning/v1/module.d.ts.map +1 -0
  169. package/dist/shaders/color/splitToning/v1/module.js +95 -0
  170. package/dist/shaders/color/splitToning/v1/module.js.map +1 -0
  171. package/dist/shaders/filters/blur/gaussian/v1/module.d.ts +23 -0
  172. package/dist/shaders/filters/blur/gaussian/v1/module.d.ts.map +1 -0
  173. package/dist/shaders/filters/blur/gaussian/v1/module.js +110 -0
  174. package/dist/shaders/filters/blur/gaussian/v1/module.js.map +1 -0
  175. package/dist/shaders/filters/blur/separable/v1/module.d.ts +18 -0
  176. package/dist/shaders/filters/blur/separable/v1/module.d.ts.map +1 -0
  177. package/dist/shaders/filters/blur/separable/v1/module.js +64 -0
  178. package/dist/shaders/filters/blur/separable/v1/module.js.map +1 -0
  179. package/dist/shaders/filters/convolve3x3/v1/module.d.ts +23 -0
  180. package/dist/shaders/filters/convolve3x3/v1/module.d.ts.map +1 -0
  181. package/dist/shaders/filters/convolve3x3/v1/module.js +128 -0
  182. package/dist/shaders/filters/convolve3x3/v1/module.js.map +1 -0
  183. package/dist/shaders/filters/glow/v1/module.d.ts +26 -0
  184. package/dist/shaders/filters/glow/v1/module.d.ts.map +1 -0
  185. package/dist/shaders/filters/glow/v1/module.js +102 -0
  186. package/dist/shaders/filters/glow/v1/module.js.map +1 -0
  187. package/dist/shaders/filters/grain/v1/module.d.ts +38 -0
  188. package/dist/shaders/filters/grain/v1/module.d.ts.map +1 -0
  189. package/dist/shaders/filters/grain/v1/module.js +110 -0
  190. package/dist/shaders/filters/grain/v1/module.js.map +1 -0
  191. package/dist/shaders/filters/pixelate/v1/module.d.ts +14 -0
  192. package/dist/shaders/filters/pixelate/v1/module.d.ts.map +1 -0
  193. package/dist/shaders/filters/pixelate/v1/module.js +76 -0
  194. package/dist/shaders/filters/pixelate/v1/module.js.map +1 -0
  195. package/dist/shaders/filters/sharpen/unsharpMask/v1/module.d.ts +17 -0
  196. package/dist/shaders/filters/sharpen/unsharpMask/v1/module.d.ts.map +1 -0
  197. package/dist/shaders/filters/sharpen/unsharpMask/v1/module.js +93 -0
  198. package/dist/shaders/filters/sharpen/unsharpMask/v1/module.js.map +1 -0
  199. package/dist/shaders/filters/threshold/v1/module.d.ts +17 -0
  200. package/dist/shaders/filters/threshold/v1/module.d.ts.map +1 -0
  201. package/dist/shaders/filters/threshold/v1/module.js +71 -0
  202. package/dist/shaders/filters/threshold/v1/module.js.map +1 -0
  203. package/dist/shaders/filters/vignette/v1/module.d.ts +18 -0
  204. package/dist/shaders/filters/vignette/v1/module.d.ts.map +1 -0
  205. package/dist/shaders/filters/vignette/v1/module.js +78 -0
  206. package/dist/shaders/filters/vignette/v1/module.js.map +1 -0
  207. package/dist/shaders/filters/visualFx/v1/module.d.ts +24 -0
  208. package/dist/shaders/filters/visualFx/v1/module.d.ts.map +1 -0
  209. package/dist/shaders/filters/visualFx/v1/module.js +210 -0
  210. package/dist/shaders/filters/visualFx/v1/module.js.map +1 -0
  211. package/dist/shaders/index.d.ts +86 -0
  212. package/dist/shaders/index.d.ts.map +1 -0
  213. package/dist/shaders/index.js +161 -0
  214. package/dist/shaders/index.js.map +1 -0
  215. package/dist/shaders/keyer/chromaKey/v1/module.d.ts +25 -0
  216. package/dist/shaders/keyer/chromaKey/v1/module.d.ts.map +1 -0
  217. package/dist/shaders/keyer/chromaKey/v1/module.js +111 -0
  218. package/dist/shaders/keyer/chromaKey/v1/module.js.map +1 -0
  219. package/dist/shaders/keyer/lumaKey/v1/module.d.ts +22 -0
  220. package/dist/shaders/keyer/lumaKey/v1/module.d.ts.map +1 -0
  221. package/dist/shaders/keyer/lumaKey/v1/module.js +89 -0
  222. package/dist/shaders/keyer/lumaKey/v1/module.js.map +1 -0
  223. package/dist/shaders/mask/apply/v1/module.d.ts +16 -0
  224. package/dist/shaders/mask/apply/v1/module.d.ts.map +1 -0
  225. package/dist/shaders/mask/apply/v1/module.js +79 -0
  226. package/dist/shaders/mask/apply/v1/module.js.map +1 -0
  227. package/dist/shaders/mask/fromImage/v1/module.d.ts +18 -0
  228. package/dist/shaders/mask/fromImage/v1/module.d.ts.map +1 -0
  229. package/dist/shaders/mask/fromImage/v1/module.js +99 -0
  230. package/dist/shaders/mask/fromImage/v1/module.js.map +1 -0
  231. package/dist/shaders/mask/invert/v1/module.d.ts +12 -0
  232. package/dist/shaders/mask/invert/v1/module.d.ts.map +1 -0
  233. package/dist/shaders/mask/invert/v1/module.js +57 -0
  234. package/dist/shaders/mask/invert/v1/module.js.map +1 -0
  235. package/dist/shaders/mixer/add/v1/module.d.ts +17 -0
  236. package/dist/shaders/mixer/add/v1/module.d.ts.map +1 -0
  237. package/dist/shaders/mixer/add/v1/module.js +73 -0
  238. package/dist/shaders/mixer/add/v1/module.js.map +1 -0
  239. package/dist/shaders/mixer/colorOverlay/v1/module.d.ts +26 -0
  240. package/dist/shaders/mixer/colorOverlay/v1/module.d.ts.map +1 -0
  241. package/dist/shaders/mixer/colorOverlay/v1/module.js +81 -0
  242. package/dist/shaders/mixer/colorOverlay/v1/module.js.map +1 -0
  243. package/dist/shaders/mixer/dropShadow/v1/module.d.ts +28 -0
  244. package/dist/shaders/mixer/dropShadow/v1/module.d.ts.map +1 -0
  245. package/dist/shaders/mixer/dropShadow/v1/module.js +104 -0
  246. package/dist/shaders/mixer/dropShadow/v1/module.js.map +1 -0
  247. package/dist/shaders/mixer/outline/v1/module.d.ts +27 -0
  248. package/dist/shaders/mixer/outline/v1/module.d.ts.map +1 -0
  249. package/dist/shaders/mixer/outline/v1/module.js +105 -0
  250. package/dist/shaders/mixer/outline/v1/module.js.map +1 -0
  251. package/dist/shaders/mixer/over/v1/module.d.ts +16 -0
  252. package/dist/shaders/mixer/over/v1/module.d.ts.map +1 -0
  253. package/dist/shaders/mixer/over/v1/module.js +71 -0
  254. package/dist/shaders/mixer/over/v1/module.js.map +1 -0
  255. package/dist/shaders/mixer/shadowCompose/v1/module.d.ts +26 -0
  256. package/dist/shaders/mixer/shadowCompose/v1/module.d.ts.map +1 -0
  257. package/dist/shaders/mixer/shadowCompose/v1/module.js +95 -0
  258. package/dist/shaders/mixer/shadowCompose/v1/module.js.map +1 -0
  259. package/dist/shaders/sources/angularGradient/v1/module.d.ts +18 -0
  260. package/dist/shaders/sources/angularGradient/v1/module.d.ts.map +1 -0
  261. package/dist/shaders/sources/angularGradient/v1/module.js +67 -0
  262. package/dist/shaders/sources/angularGradient/v1/module.js.map +1 -0
  263. package/dist/shaders/sources/checkerboard/v1/module.d.ts +19 -0
  264. package/dist/shaders/sources/checkerboard/v1/module.d.ts.map +1 -0
  265. package/dist/shaders/sources/checkerboard/v1/module.js +70 -0
  266. package/dist/shaders/sources/checkerboard/v1/module.js.map +1 -0
  267. package/dist/shaders/sources/diamondGradient/v1/module.d.ts +18 -0
  268. package/dist/shaders/sources/diamondGradient/v1/module.d.ts.map +1 -0
  269. package/dist/shaders/sources/diamondGradient/v1/module.js +61 -0
  270. package/dist/shaders/sources/diamondGradient/v1/module.js.map +1 -0
  271. package/dist/shaders/sources/gaussianNoise/v1/module.d.ts +21 -0
  272. package/dist/shaders/sources/gaussianNoise/v1/module.d.ts.map +1 -0
  273. package/dist/shaders/sources/gaussianNoise/v1/module.js +72 -0
  274. package/dist/shaders/sources/gaussianNoise/v1/module.js.map +1 -0
  275. package/dist/shaders/sources/linearGradient/v1/module.d.ts +21 -0
  276. package/dist/shaders/sources/linearGradient/v1/module.d.ts.map +1 -0
  277. package/dist/shaders/sources/linearGradient/v1/module.js +72 -0
  278. package/dist/shaders/sources/linearGradient/v1/module.js.map +1 -0
  279. package/dist/shaders/sources/radialGradient/v1/module.d.ts +18 -0
  280. package/dist/shaders/sources/radialGradient/v1/module.d.ts.map +1 -0
  281. package/dist/shaders/sources/radialGradient/v1/module.js +60 -0
  282. package/dist/shaders/sources/radialGradient/v1/module.js.map +1 -0
  283. package/dist/shaders/sources/solid/v1/module.d.ts +17 -0
  284. package/dist/shaders/sources/solid/v1/module.d.ts.map +1 -0
  285. package/dist/shaders/sources/solid/v1/module.js +49 -0
  286. package/dist/shaders/sources/solid/v1/module.js.map +1 -0
  287. package/dist/shaders/transform/affine/v1/module.d.ts +36 -0
  288. package/dist/shaders/transform/affine/v1/module.d.ts.map +1 -0
  289. package/dist/shaders/transform/affine/v1/module.js +94 -0
  290. package/dist/shaders/transform/affine/v1/module.js.map +1 -0
  291. package/dist/shaders/transform/cornerPin/v1/module.d.ts +40 -0
  292. package/dist/shaders/transform/cornerPin/v1/module.d.ts.map +1 -0
  293. package/dist/shaders/transform/cornerPin/v1/module.js +109 -0
  294. package/dist/shaders/transform/cornerPin/v1/module.js.map +1 -0
  295. package/dist/shaders/transform/crop/v1/module.d.ts +26 -0
  296. package/dist/shaders/transform/crop/v1/module.d.ts.map +1 -0
  297. package/dist/shaders/transform/crop/v1/module.js +82 -0
  298. package/dist/shaders/transform/crop/v1/module.js.map +1 -0
  299. package/dist/shaders/transform/displace/v1/module.d.ts +23 -0
  300. package/dist/shaders/transform/displace/v1/module.d.ts.map +1 -0
  301. package/dist/shaders/transform/displace/v1/module.js +95 -0
  302. package/dist/shaders/transform/displace/v1/module.js.map +1 -0
  303. package/dist/shaders/transform/mirror/v1/module.d.ts +14 -0
  304. package/dist/shaders/transform/mirror/v1/module.d.ts.map +1 -0
  305. package/dist/shaders/transform/mirror/v1/module.js +73 -0
  306. package/dist/shaders/transform/mirror/v1/module.js.map +1 -0
  307. package/dist/shaders/transform/offset/v1/module.d.ts +21 -0
  308. package/dist/shaders/transform/offset/v1/module.d.ts.map +1 -0
  309. package/dist/shaders/transform/offset/v1/module.js +88 -0
  310. package/dist/shaders/transform/offset/v1/module.js.map +1 -0
  311. package/dist/shaders/transform/pad/v1/module.d.ts +26 -0
  312. package/dist/shaders/transform/pad/v1/module.d.ts.map +1 -0
  313. package/dist/shaders/transform/pad/v1/module.js +95 -0
  314. package/dist/shaders/transform/pad/v1/module.js.map +1 -0
  315. package/dist/shaders/transform/polarRemap/v1/module.d.ts +20 -0
  316. package/dist/shaders/transform/polarRemap/v1/module.d.ts.map +1 -0
  317. package/dist/shaders/transform/polarRemap/v1/module.js +95 -0
  318. package/dist/shaders/transform/polarRemap/v1/module.js.map +1 -0
  319. package/dist/shaders/transform/resize/v1/module.d.ts +20 -0
  320. package/dist/shaders/transform/resize/v1/module.d.ts.map +1 -0
  321. package/dist/shaders/transform/resize/v1/module.js +116 -0
  322. package/dist/shaders/transform/resize/v1/module.js.map +1 -0
  323. package/dist/shaders/transform/rotate90/v1/module.d.ts +25 -0
  324. package/dist/shaders/transform/rotate90/v1/module.d.ts.map +1 -0
  325. package/dist/shaders/transform/rotate90/v1/module.js +90 -0
  326. package/dist/shaders/transform/rotate90/v1/module.js.map +1 -0
  327. package/dist/shaders/transform/spherize/v1/module.d.ts +21 -0
  328. package/dist/shaders/transform/spherize/v1/module.d.ts.map +1 -0
  329. package/dist/shaders/transform/spherize/v1/module.js +94 -0
  330. package/dist/shaders/transform/spherize/v1/module.js.map +1 -0
  331. package/dist/shaders/transform/tile/v1/module.d.ts +22 -0
  332. package/dist/shaders/transform/tile/v1/module.d.ts.map +1 -0
  333. package/dist/shaders/transform/tile/v1/module.js +89 -0
  334. package/dist/shaders/transform/tile/v1/module.js.map +1 -0
  335. package/dist/shared/lumaWgsl.d.ts +14 -0
  336. package/dist/shared/lumaWgsl.d.ts.map +1 -0
  337. package/dist/shared/lumaWgsl.js +18 -0
  338. package/dist/shared/lumaWgsl.js.map +1 -0
  339. package/dist/shared/premulWgsl.d.ts +46 -0
  340. package/dist/shared/premulWgsl.d.ts.map +1 -0
  341. package/dist/shared/premulWgsl.js +90 -0
  342. package/dist/shared/premulWgsl.js.map +1 -0
  343. package/dist/texture.d.ts +54 -0
  344. package/dist/texture.d.ts.map +1 -0
  345. package/dist/texture.js +70 -0
  346. package/dist/texture.js.map +1 -0
  347. package/dist/types.d.ts +103 -0
  348. package/dist/types.d.ts.map +1 -0
  349. package/dist/types.js +8 -0
  350. package/dist/types.js.map +1 -0
  351. package/dist/validate/wgslLinearity.d.ts +86 -0
  352. package/dist/validate/wgslLinearity.d.ts.map +1 -0
  353. package/dist/validate/wgslLinearity.js +298 -0
  354. package/dist/validate/wgslLinearity.js.map +1 -0
  355. package/dist/webgpu/index.d.ts +11 -0
  356. package/dist/webgpu/index.d.ts.map +1 -0
  357. package/dist/webgpu/index.js +11 -0
  358. package/dist/webgpu/index.js.map +1 -0
  359. package/package.json +85 -0
@@ -0,0 +1,110 @@
1
+ /**
2
+ * `filters.grain@1` — film grain as a multiplicative gain wobble.
3
+ *
4
+ * **Multiplied, not added.** The input is premultiplied, so `rgb <= a` holds on
5
+ * every pixel and adding noise would break it: a translucent layer would come
6
+ * back with channels brighter than its own alpha, which reads as a bright
7
+ * fringe once it composites. A scalar gain preserves the invariant (the same
8
+ * reason `filters.vignette@1` may scale), and it is also closer to how exposed
9
+ * stock behaves — grain bites in the midtones and leaves black black, because
10
+ * there is nothing there to modulate.
11
+ *
12
+ * **Reproducible.** The pattern is a hash of the grain cell and `seed`, with no
13
+ * clock and no RNG state, so two renders of the same frame are byte-identical
14
+ * and a cached render can be handed back. A host that wants the pattern to roll
15
+ * passes the frame's own time as the seed.
16
+ */
17
+ import tgpu from "typegpu";
18
+ import * as d from "typegpu/data";
19
+ import { defineModule } from "../../../../module.js";
20
+ export const GrainParams = d.struct({
21
+ /** Gain wobble, 0..1. 0 leaves the picture untouched. */
22
+ amount: d.f32,
23
+ /** Grain cell size in source pixels. 1 is per-pixel. */
24
+ size: d.f32,
25
+ /** 0 = one gain for the pixel (monochrome), 1 = per-channel colour noise. */
26
+ colorAmount: d.f32,
27
+ /** Rolls the pattern. Same seed, same grain. */
28
+ seed: d.f32
29
+ });
30
+ const layout = tgpu.bindGroupLayout({
31
+ source: { texture: "float" },
32
+ outputTexture: { storageTexture: "rgba8unorm" },
33
+ params: { uniform: GrainParams }
34
+ });
35
+ export const filtersGrainV1 = defineModule({
36
+ id: "filters.grain",
37
+ version: 1,
38
+ surface: "internal",
39
+ category: "filters",
40
+ // A per-channel scale of premultiplied RGB, saturated against alpha — the
41
+ // same shape `filters.vignette@1` is tagged for.
42
+ linearity: "linear-in-rgb",
43
+ kind: "compute",
44
+ params: GrainParams,
45
+ paramDefaults: { amount: 0, size: 1, colorAmount: 0, seed: 0 },
46
+ paramUi: {
47
+ amount: { min: 0, max: 1, step: 0.01, label: "Amount" },
48
+ size: { min: 1, max: 16, step: 0.5, label: "Size" },
49
+ colorAmount: { min: 0, max: 1, step: 0.01, label: "Colour" },
50
+ seed: { label: "Seed" }
51
+ },
52
+ layout,
53
+ workgroupSize: [16, 16, 1],
54
+ wgsl: /* wgsl */ `
55
+ fn hash31(p: vec3f) -> f32 {
56
+ var p3 = fract(p * 0.1031);
57
+ p3 = p3 + dot(p3, vec3f(p3.y, p3.z, p3.x) + 33.33);
58
+ return fract((p3.x + p3.y) * p3.z);
59
+ }
60
+
61
+ /** Signed noise in [-1, 1] for one grain cell and channel. */
62
+ fn grainAt(cell: vec2f, seed: f32, channel: f32) -> f32 {
63
+ return hash31(vec3f(cell.x, cell.y, seed + channel * 19.19)) * 2.0 - 1.0;
64
+ }
65
+
66
+ @compute @workgroup_size(16, 16, 1)
67
+ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
68
+ let dims = textureDimensions(layout.$.source);
69
+ if (gid.x >= dims.x || gid.y >= dims.y) { return; }
70
+ let coords = vec2<i32>(i32(gid.x), i32(gid.y));
71
+ let v = layout.$.params;
72
+ let color = textureLoad(layout.$.source, coords, 0);
73
+
74
+ // Quantize to grain cells so size coarsens the stock instead of just
75
+ // reseeding it. Sub-pixel sizes collapse back to per-pixel.
76
+ let cell = floor(vec2f(f32(gid.x), f32(gid.y)) / max(v.size, 1.0));
77
+
78
+ let mono = grainAt(cell, v.seed, 0.0);
79
+ let perChannel = vec3f(
80
+ grainAt(cell, v.seed, 1.0),
81
+ grainAt(cell, v.seed, 2.0),
82
+ grainAt(cell, v.seed, 3.0)
83
+ );
84
+ let n = mix(vec3f(mono), perChannel, clamp(v.colorAmount, 0.0, 1.0));
85
+
86
+ let gain = vec3f(1.0) + n * clamp(v.amount, 0.0, 1.0);
87
+ // Saturating against alpha rather than 1.0 is what keeps rgb <= a when the
88
+ // gain runs above 1 on an already-bright premultiplied pixel.
89
+ let rgb = clamp(color.rgb * gain, vec3f(0.0), vec3f(color.a)); // premul: ok
90
+ textureStore(layout.$.outputTexture, coords, vec4<f32>(rgb, color.a));
91
+ }
92
+ `,
93
+ io: {
94
+ inputs: {
95
+ source: {
96
+ colorSpace: "srgb",
97
+ alpha: "premultiplied",
98
+ bindingKinds: ["texture_2d"]
99
+ }
100
+ },
101
+ output: {
102
+ colorSpace: "srgb",
103
+ alpha: "premultiplied",
104
+ format: "rgba8unorm",
105
+ dimensions: "same-as:source"
106
+ },
107
+ rod: "same-as:source"
108
+ }
109
+ });
110
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/filters/grain/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,yDAAyD;IACzD,MAAM,EAAE,CAAC,CAAC,GAAG;IACb,wDAAwD;IACxD,IAAI,EAAE,CAAC,CAAC,GAAG;IACX,6EAA6E;IAC7E,WAAW,EAAE,CAAC,CAAC,GAAG;IAClB,gDAAgD;IAChD,IAAI,EAAE,CAAC,CAAC,GAAG;CACZ,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC5B,aAAa,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE;IAC/C,MAAM,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;CACjC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC;IACzC,EAAE,EAAE,eAAe;IACnB,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,SAAS;IACnB,0EAA0E;IAC1E,iDAAiD;IACjD,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,WAAW;IACnB,aAAa,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE;IAC9D,OAAO,EAAE;QACP,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;QACvD,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE;QACnD,WAAW,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC5D,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;KACxB;IACD,MAAM;IACN,aAAa,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1B,IAAI,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsClB;IACC,EAAE,EAAE;QACF,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;aAC7B;SACF;QACD,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `filters.pixelate@1` — snap UVs to a coarse grid before sampling.
3
+ *
4
+ * `cellSize` is in source pixels; effective output resolution is `dims / cellSize`.
5
+ * `cellSize ≤ 1` is treated as passthrough. Fragment, with the canonical mask slot.
6
+ */
7
+ import * as d from "typegpu/data";
8
+ export declare const PixelateParams: d.WgslStruct<{
9
+ cellSize: d.F32;
10
+ }>;
11
+ export declare const filtersPixelateV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
12
+ cellSize: d.F32;
13
+ }>>;
14
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/filters/pixelate/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,cAAc;;EAEzB,CAAC;AAgBH,eAAO,MAAM,iBAAiB;;GAkD5B,CAAC"}
@@ -0,0 +1,76 @@
1
+ /**
2
+ * `filters.pixelate@1` — snap UVs to a coarse grid before sampling.
3
+ *
4
+ * `cellSize` is in source pixels; effective output resolution is `dims / cellSize`.
5
+ * `cellSize ≤ 1` is treated as passthrough. Fragment, with the canonical mask slot.
6
+ */
7
+ import tgpu from "typegpu";
8
+ import * as d from "typegpu/data";
9
+ import { defineModule } from "../../../../module.js";
10
+ export const PixelateParams = d.struct({
11
+ cellSize: d.f32
12
+ });
13
+ const layout = tgpu.bindGroupLayout({
14
+ params: { uniform: PixelateParams },
15
+ source: { texture: "float" },
16
+ mask: { texture: "float" },
17
+ samp: { sampler: "filtering" }
18
+ });
19
+ const samplerDescriptor = {
20
+ magFilter: "linear",
21
+ minFilter: "linear",
22
+ addressModeU: "clamp-to-edge",
23
+ addressModeV: "clamp-to-edge"
24
+ };
25
+ export const filtersPixelateV1 = defineModule({
26
+ id: "filters.pixelate",
27
+ version: 1,
28
+ surface: "internal",
29
+ category: "filters",
30
+ linearity: "linear-in-rgb",
31
+ kind: "fragment",
32
+ params: PixelateParams,
33
+ paramDefaults: { cellSize: 8 },
34
+ paramUi: {
35
+ cellSize: { min: 1, max: 128, step: 1, label: "Cell size", notes: "pixels" }
36
+ },
37
+ layout,
38
+ samplers: { samp: samplerDescriptor },
39
+ wgsl: /* wgsl */ `
40
+ @fragment
41
+ fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
42
+ let dims = vec2f(textureDimensions(layout.$.source));
43
+ let cell = max(1.0, layout.$.params.cellSize);
44
+ let snapped = (floor(uv * dims / cell) + vec2f(0.5)) * cell / dims;
45
+ let processed = textureSample(layout.$.source, layout.$.samp, snapped);
46
+ let src = textureSample(layout.$.source, layout.$.samp, uv);
47
+ let coverage = textureSample(layout.$.mask, layout.$.samp, uv).a;
48
+ let mixed = mix(src.rgb, processed.rgb, coverage);
49
+ let mixedA = mix(src.a, processed.a, coverage);
50
+ return vec4f(mixed, mixedA);
51
+ }
52
+ `,
53
+ io: {
54
+ inputs: {
55
+ source: {
56
+ colorSpace: "linear",
57
+ alpha: "premultiplied",
58
+ bindingKinds: ["texture_2d"]
59
+ },
60
+ mask: {
61
+ colorSpace: "linear",
62
+ alpha: "premultiplied",
63
+ bindingKinds: ["texture_2d"],
64
+ optional: true
65
+ }
66
+ },
67
+ output: {
68
+ colorSpace: "linear",
69
+ alpha: "premultiplied",
70
+ format: "rgba8unorm",
71
+ dimensions: "same-as:source"
72
+ },
73
+ rod: "same-as:source"
74
+ }
75
+ });
76
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/filters/pixelate/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,CAAC,CAAC,GAAG;CAChB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAA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UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * `filters.sharpen.unsharpMask@1` — unsharp-mask sharpen.
3
+ *
4
+ * Migrated verbatim from the timeline preview's `sharpenComputeShader`. A 3×3
5
+ * box average is the low-pass; `sharpened = center + amount * (center - blur)`,
6
+ * gated by a luminance threshold. Hand-packed uniform → TypeGPU `SharpenParams`.
7
+ */
8
+ import * as d from "typegpu/data";
9
+ export declare const SharpenParams: d.WgslStruct<{
10
+ amount: d.F32;
11
+ threshold: d.F32;
12
+ }>;
13
+ export declare const sharpenUnsharpMaskV1: import("../../../../../module.js").ShaderModule<d.WgslStruct<{
14
+ amount: d.F32;
15
+ threshold: d.F32;
16
+ }>>;
17
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../../src/shaders/filters/sharpen/unsharpMask/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,aAAa;;;EAGxB,CAAC;AAQH,eAAO,MAAM,oBAAoB;;;GAwE/B,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * `filters.sharpen.unsharpMask@1` — unsharp-mask sharpen.
3
+ *
4
+ * Migrated verbatim from the timeline preview's `sharpenComputeShader`. A 3×3
5
+ * box average is the low-pass; `sharpened = center + amount * (center - blur)`,
6
+ * gated by a luminance threshold. Hand-packed uniform → TypeGPU `SharpenParams`.
7
+ */
8
+ import tgpu from "typegpu";
9
+ import * as d from "typegpu/data";
10
+ import { defineModule } from "../../../../../module.js";
11
+ export const SharpenParams = d.struct({
12
+ amount: d.f32,
13
+ threshold: d.f32
14
+ });
15
+ const layout = tgpu.bindGroupLayout({
16
+ source: { texture: "float" },
17
+ outputTexture: { storageTexture: "rgba8unorm" },
18
+ params: { uniform: SharpenParams }
19
+ });
20
+ export const sharpenUnsharpMaskV1 = defineModule({
21
+ id: "filters.sharpen.unsharpMask",
22
+ version: 1,
23
+ // Promoted in Phase 3 alongside the rest of the Phase 2 timeline-effect
24
+ // batch (params stable since Phase 2).
25
+ surface: "published",
26
+ category: "filters",
27
+ linearity: "nonlinear-in-rgb",
28
+ kind: "compute",
29
+ params: SharpenParams,
30
+ paramDefaults: { amount: 0, threshold: 0 },
31
+ paramUi: {
32
+ amount: { min: 0, max: 2, step: 0.01, label: "Amount" },
33
+ threshold: { min: 0, max: 1, step: 0.01, label: "Threshold" }
34
+ },
35
+ layout,
36
+ workgroupSize: [16, 16, 1],
37
+ wgsl: /* wgsl */ `
38
+ fn loadClamped(coords: vec2<i32>) -> vec4<f32> {
39
+ let dims = textureDimensions(layout.$.source);
40
+ let c = vec2<i32>(
41
+ clamp(coords.x, 0, i32(dims.x) - 1),
42
+ clamp(coords.y, 0, i32(dims.y) - 1)
43
+ );
44
+ return textureLoad(layout.$.source, c, 0);
45
+ }
46
+
47
+ @compute @workgroup_size(16, 16, 1)
48
+ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
49
+ let dims = textureDimensions(layout.$.source);
50
+ if (gid.x >= dims.x || gid.y >= dims.y) { return; }
51
+ let coords = vec2<i32>(i32(gid.x), i32(gid.y));
52
+ let sharpen = layout.$.params;
53
+ let center = textureLoad(layout.$.source, coords, 0);
54
+
55
+ // 3x3 box average as the low-pass; sharpen = center + amount * (center - blur).
56
+ var sum = vec4<f32>(0.0);
57
+ for (var j = -1; j <= 1; j = j + 1) {
58
+ for (var i = -1; i <= 1; i = i + 1) {
59
+ sum = sum + loadClamped(vec2<i32>(coords.x + i, coords.y + j));
60
+ }
61
+ }
62
+ let blurAvg = sum / 9.0;
63
+ // Un-premultiply before differencing: the unsharp diff and overshoot must be
64
+ // computed on straight colour, otherwise the result is scaled by alpha and a
65
+ // sharpened highlight can exceed the (preserved) centre alpha — rgb > a. The
66
+ // sharpened straight colour is re-premultiplied by the centre alpha at the end.
67
+ let centerStraight = center.rgb / max(center.a, 1.0 / 255.0);
68
+ let blurStraight = blurAvg.rgb / max(blurAvg.a, 1.0 / 255.0);
69
+ let diff = centerStraight - blurStraight;
70
+ let lum = abs(dot(diff, vec3<f32>(0.299, 0.587, 0.114)));
71
+ let mask = step(sharpen.threshold, lum);
72
+ let sharpened = clamp(centerStraight + diff * sharpen.amount * mask, vec3<f32>(0.0), vec3<f32>(1.0));
73
+ textureStore(layout.$.outputTexture, coords, vec4<f32>(sharpened * center.a, center.a));
74
+ }
75
+ `,
76
+ io: {
77
+ inputs: {
78
+ source: {
79
+ colorSpace: "srgb",
80
+ alpha: "premultiplied",
81
+ bindingKinds: ["texture_2d"]
82
+ }
83
+ },
84
+ output: {
85
+ colorSpace: "srgb",
86
+ alpha: "premultiplied",
87
+ format: "rgba8unorm",
88
+ dimensions: "same-as:source"
89
+ },
90
+ rod: "same-as:source"
91
+ }
92
+ });
93
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../../src/shaders/filters/sharpen/unsharpMask/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,GAAG;IACb,SAAS,EAAE,CAAC,CAAC,GAAG;CACjB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC5B,aAAa,EAAE,EA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
+ * black out the rest. `softness` widens the cutoff into a smooth ramp.
4
+ *
5
+ * Used as the bright-extraction stage of the `filters.glow` recipe and as a
6
+ * general-purpose bright-pass filter.
7
+ */
8
+ import * as d from "typegpu/data";
9
+ export declare const ThresholdParams: d.WgslStruct<{
10
+ threshold: d.F32;
11
+ softness: d.F32;
12
+ }>;
13
+ export declare const filtersThresholdV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
14
+ threshold: d.F32;
15
+ softness: d.F32;
16
+ }>>;
17
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/filters/threshold/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,eAAe;;;EAG1B,CAAC;AAeH,eAAO,MAAM,kBAAkB;;;GA4C7B,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * `filters.threshold@1` — keep pixels whose luma is above `threshold`,
3
+ * black out the rest. `softness` widens the cutoff into a smooth ramp.
4
+ *
5
+ * Used as the bright-extraction stage of the `filters.glow` recipe and as a
6
+ * general-purpose bright-pass filter.
7
+ */
8
+ import tgpu from "typegpu";
9
+ import * as d from "typegpu/data";
10
+ import { defineModule } from "../../../../module.js";
11
+ export const ThresholdParams = d.struct({
12
+ threshold: d.f32,
13
+ softness: d.f32
14
+ });
15
+ const layout = tgpu.bindGroupLayout({
16
+ params: { uniform: ThresholdParams },
17
+ source: { texture: "float" },
18
+ samp: { sampler: "filtering" }
19
+ });
20
+ const samplerDescriptor = {
21
+ magFilter: "linear",
22
+ minFilter: "linear",
23
+ addressModeU: "clamp-to-edge",
24
+ addressModeV: "clamp-to-edge"
25
+ };
26
+ export const filtersThresholdV1 = defineModule({
27
+ id: "filters.threshold",
28
+ version: 1,
29
+ surface: "internal",
30
+ category: "filters",
31
+ linearity: "linear-in-rgb",
32
+ kind: "fragment",
33
+ params: ThresholdParams,
34
+ paramDefaults: { threshold: 0.7, softness: 0.1 },
35
+ paramUi: {
36
+ threshold: { min: 0, max: 1, step: 0.01, label: "Threshold" },
37
+ softness: { min: 0, max: 0.5, step: 0.01, label: "Softness" }
38
+ },
39
+ layout,
40
+ samplers: { samp: samplerDescriptor },
41
+ wgsl: /* wgsl */ `
42
+ @fragment
43
+ fn fs_main(@location(0) uv: vec2f) -> @location(0) vec4f {
44
+ let src = textureSample(layout.$.source, layout.$.samp, uv);
45
+ let p = layout.$.params;
46
+ let safeA = max(src.a, 1.0 / 255.0);
47
+ let straight = src.rgb / safeA;
48
+ let luma = dot(straight, vec3f(0.299, 0.587, 0.114));
49
+ let soft = max(p.softness, 0.0001);
50
+ let t = smoothstep(p.threshold - soft, p.threshold + soft, luma);
51
+ return vec4f(src.rgb * t, src.a * t);
52
+ }
53
+ `,
54
+ io: {
55
+ inputs: {
56
+ source: {
57
+ colorSpace: "linear",
58
+ alpha: "premultiplied",
59
+ bindingKinds: ["texture_2d"]
60
+ }
61
+ },
62
+ output: {
63
+ colorSpace: "linear",
64
+ alpha: "premultiplied",
65
+ format: "rgba8unorm",
66
+ dimensions: "same-as:source"
67
+ },
68
+ rod: "same-as:source"
69
+ }
70
+ });
71
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/filters/threshold/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,SAAS,EAAE,CAAC,CAAC,GAAG;IAChB,QAAQ,EAAE,CAAC,CAAC,GAAG;CAChB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,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M,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * `filters.vignette@1` — radial darken from frame center.
3
+ *
4
+ * Migrated verbatim from the timeline preview's `vignetteComputeShader`.
5
+ * Hand-packed uniform → TypeGPU `VignetteParams`; the falloff math is unchanged.
6
+ */
7
+ import * as d from "typegpu/data";
8
+ export declare const VignetteParams: d.WgslStruct<{
9
+ intensity: d.F32;
10
+ radius: d.F32;
11
+ softness: d.F32;
12
+ }>;
13
+ export declare const vignetteV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
14
+ intensity: d.F32;
15
+ radius: d.F32;
16
+ softness: d.F32;
17
+ }>>;
18
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/filters/vignette/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,cAAc;;;;EAIzB,CAAC;AAQH,eAAO,MAAM,UAAU;;;;GAyDrB,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * `filters.vignette@1` — radial darken from frame center.
3
+ *
4
+ * Migrated verbatim from the timeline preview's `vignetteComputeShader`.
5
+ * Hand-packed uniform → TypeGPU `VignetteParams`; the falloff math is unchanged.
6
+ */
7
+ import tgpu from "typegpu";
8
+ import * as d from "typegpu/data";
9
+ import { defineModule } from "../../../../module.js";
10
+ export const VignetteParams = d.struct({
11
+ intensity: d.f32,
12
+ radius: d.f32,
13
+ softness: d.f32
14
+ });
15
+ const layout = tgpu.bindGroupLayout({
16
+ source: { texture: "float" },
17
+ outputTexture: { storageTexture: "rgba8unorm" },
18
+ params: { uniform: VignetteParams }
19
+ });
20
+ export const vignetteV1 = defineModule({
21
+ id: "filters.vignette",
22
+ version: 1,
23
+ // Promoted in Phase 3: (intensity, radius, softness) schema has been stable
24
+ // since Phase 2 and the falloff math is unchanged.
25
+ surface: "published",
26
+ category: "filters",
27
+ linearity: "linear-in-rgb",
28
+ kind: "compute",
29
+ params: VignetteParams,
30
+ paramDefaults: { intensity: 0, radius: 0.9, softness: 0.5 },
31
+ paramUi: {
32
+ intensity: { min: 0, max: 1, step: 0.01, label: "Intensity" },
33
+ radius: { min: 0.1, max: 1.5, step: 0.01, label: "Radius" },
34
+ softness: { min: 0, max: 1, step: 0.01, label: "Softness" }
35
+ },
36
+ layout,
37
+ workgroupSize: [16, 16, 1],
38
+ wgsl: /* wgsl */ `
39
+ @compute @workgroup_size(16, 16, 1)
40
+ fn main(@builtin(global_invocation_id) gid: vec3<u32>) {
41
+ let dims = textureDimensions(layout.$.source);
42
+ if (gid.x >= dims.x || gid.y >= dims.y) { return; }
43
+ let coords = vec2<i32>(i32(gid.x), i32(gid.y));
44
+ let v = layout.$.params;
45
+ let color = textureLoad(layout.$.source, coords, 0);
46
+
47
+ // Normalize to [-1, 1] coordinates centered on the frame.
48
+ let uv = vec2<f32>(
49
+ (f32(gid.x) + 0.5) / f32(dims.x) * 2.0 - 1.0,
50
+ (f32(gid.y) + 0.5) / f32(dims.y) * 2.0 - 1.0
51
+ );
52
+ let dist = length(uv);
53
+ let inner = max(0.0, v.radius - v.softness);
54
+ let outer = max(inner + 0.001, v.radius);
55
+ let t = clamp((dist - inner) / (outer - inner), 0.0, 1.0);
56
+ let fade = t * t * (3.0 - 2.0 * t);
57
+ let dim = 1.0 - v.intensity * fade;
58
+ textureStore(layout.$.outputTexture, coords, vec4<f32>(color.rgb * dim, color.a)); // premul: ok — scalar '* dim' preserves rgb <= a
59
+ }
60
+ `,
61
+ io: {
62
+ inputs: {
63
+ source: {
64
+ colorSpace: "srgb",
65
+ alpha: "premultiplied",
66
+ bindingKinds: ["texture_2d"]
67
+ }
68
+ },
69
+ output: {
70
+ colorSpace: "srgb",
71
+ alpha: "premultiplied",
72
+ format: "rgba8unorm",
73
+ dimensions: "same-as:source"
74
+ },
75
+ rod: "same-as:source"
76
+ }
77
+ });
78
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../../../src/shaders/filters/vignette/v1/module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,SAAS,EAAE,CAAC,CAAC,GAAG;IAChB,MAAM,EAAE,CAAC,CAAC,GAAG;IACb,QAAQ,EAAE,CAAC,CAAC,GAAG;CAChB,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC;IAClC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE;IAC5B,aAAa,EAAE,EAAE,cAAc,EAAE,YAAY,EAAE;IAC/C,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;CACpC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAC;IACrC,EAAE,EAAE,kBAAkB;IACtB,OAAO,EAAE,CAAC;IACV,4EAA4E;IAC5E,mDAAmD;IACnD,OAAO,EAAE,WAAW;IACpB,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,cAAc;IACtB,aAAa,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE;IAC3D,OAAO,EAAE;QACP,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE;QAC7D,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE;QAC3D,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE;KAC5D;IACD,MAAM;IACN,aAAa,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1B,IAAI,EAAE,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;CAsBlB;IACC,EAAE,EAAE;QACF,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,eAAe;gBACtB,YAAY,EAAE,CAAC,YAAY,CAAC;aAC7B;SACF;QACD,MAAM,EAAE;YACN,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,gBAAgB;SAC7B;QACD,GAAG,EAAE,gBAAgB;KACtB;CACF,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import * as d from "typegpu/data";
2
+ export declare const VisualFxParams: d.WgslStruct<{
3
+ mode: d.F32;
4
+ amount: d.F32;
5
+ scale: d.F32;
6
+ angle: d.F32;
7
+ time: d.F32;
8
+ seed: d.F32;
9
+ softness: d.F32;
10
+ colorA: d.Vec4f;
11
+ colorB: d.Vec4f;
12
+ }>;
13
+ export declare const filtersVisualFxV1: import("../../../../module.js").ShaderModule<d.WgslStruct<{
14
+ mode: d.F32;
15
+ amount: d.F32;
16
+ scale: d.F32;
17
+ angle: d.F32;
18
+ time: d.F32;
19
+ seed: d.F32;
20
+ softness: d.F32;
21
+ colorA: d.Vec4f;
22
+ colorB: d.Vec4f;
23
+ }>>;
24
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/shaders/filters/visualFx/v1/module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAGlC,eAAO,MAAM,cAAc;;;;;;;;;;EAUzB,CAAC;AASH,eAAO,MAAM,iBAAiB;;;;;;;;;;GA4L5B,CAAC"}