@flighthq/effects 0.1.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.
Files changed (335) hide show
  1. package/dist/autoExposureEffect.d.ts +3 -0
  2. package/dist/autoExposureEffect.d.ts.map +1 -0
  3. package/dist/autoExposureEffect.js +4 -0
  4. package/dist/autoExposureEffect.js.map +1 -0
  5. package/dist/barrelDistortionEffect.d.ts +3 -0
  6. package/dist/barrelDistortionEffect.d.ts.map +1 -0
  7. package/dist/barrelDistortionEffect.js +4 -0
  8. package/dist/barrelDistortionEffect.js.map +1 -0
  9. package/dist/bloomEffect.d.ts +6 -0
  10. package/dist/bloomEffect.d.ts.map +1 -0
  11. package/dist/bloomEffect.js +16 -0
  12. package/dist/bloomEffect.js.map +1 -0
  13. package/dist/bokehDepthOfFieldEffect.d.ts +3 -0
  14. package/dist/bokehDepthOfFieldEffect.d.ts.map +1 -0
  15. package/dist/bokehDepthOfFieldEffect.js +4 -0
  16. package/dist/bokehDepthOfFieldEffect.js.map +1 -0
  17. package/dist/brightnessContrastEffect.d.ts +3 -0
  18. package/dist/brightnessContrastEffect.d.ts.map +1 -0
  19. package/dist/brightnessContrastEffect.js +4 -0
  20. package/dist/brightnessContrastEffect.js.map +1 -0
  21. package/dist/cameraMotionBlurEffect.d.ts +3 -0
  22. package/dist/cameraMotionBlurEffect.d.ts.map +1 -0
  23. package/dist/cameraMotionBlurEffect.js +4 -0
  24. package/dist/cameraMotionBlurEffect.js.map +1 -0
  25. package/dist/channelMixerEffect.d.ts +3 -0
  26. package/dist/channelMixerEffect.d.ts.map +1 -0
  27. package/dist/channelMixerEffect.js +4 -0
  28. package/dist/channelMixerEffect.js.map +1 -0
  29. package/dist/chromaticAberrationEffect.d.ts +3 -0
  30. package/dist/chromaticAberrationEffect.d.ts.map +1 -0
  31. package/dist/chromaticAberrationEffect.js +4 -0
  32. package/dist/chromaticAberrationEffect.js.map +1 -0
  33. package/dist/colorBlindSimulationEffect.d.ts +3 -0
  34. package/dist/colorBlindSimulationEffect.d.ts.map +1 -0
  35. package/dist/colorBlindSimulationEffect.js +4 -0
  36. package/dist/colorBlindSimulationEffect.js.map +1 -0
  37. package/dist/colorGradeEffect.d.ts +3 -0
  38. package/dist/colorGradeEffect.d.ts.map +1 -0
  39. package/dist/colorGradeEffect.js +4 -0
  40. package/dist/colorGradeEffect.js.map +1 -0
  41. package/dist/colorScienceMath.d.ts +9 -0
  42. package/dist/colorScienceMath.d.ts.map +1 -0
  43. package/dist/colorScienceMath.js +135 -0
  44. package/dist/colorScienceMath.js.map +1 -0
  45. package/dist/colorTemperatureMath.d.ts +5 -0
  46. package/dist/colorTemperatureMath.d.ts.map +1 -0
  47. package/dist/colorTemperatureMath.js +45 -0
  48. package/dist/colorTemperatureMath.js.map +1 -0
  49. package/dist/contactShadowsEffect.d.ts +3 -0
  50. package/dist/contactShadowsEffect.d.ts.map +1 -0
  51. package/dist/contactShadowsEffect.js +4 -0
  52. package/dist/contactShadowsEffect.js.map +1 -0
  53. package/dist/crtEffect.d.ts +3 -0
  54. package/dist/crtEffect.d.ts.map +1 -0
  55. package/dist/crtEffect.js +4 -0
  56. package/dist/crtEffect.js.map +1 -0
  57. package/dist/customShaderEffect.d.ts +3 -0
  58. package/dist/customShaderEffect.d.ts.map +1 -0
  59. package/dist/customShaderEffect.js +4 -0
  60. package/dist/customShaderEffect.js.map +1 -0
  61. package/dist/depthMath.d.ts +4 -0
  62. package/dist/depthMath.d.ts.map +1 -0
  63. package/dist/depthMath.js +55 -0
  64. package/dist/depthMath.js.map +1 -0
  65. package/dist/directionalBlurEffect.d.ts +3 -0
  66. package/dist/directionalBlurEffect.d.ts.map +1 -0
  67. package/dist/directionalBlurEffect.js +4 -0
  68. package/dist/directionalBlurEffect.js.map +1 -0
  69. package/dist/displacementEffect.d.ts +3 -0
  70. package/dist/displacementEffect.d.ts.map +1 -0
  71. package/dist/displacementEffect.js +4 -0
  72. package/dist/displacementEffect.js.map +1 -0
  73. package/dist/ditherEffect.d.ts +3 -0
  74. package/dist/ditherEffect.d.ts.map +1 -0
  75. package/dist/ditherEffect.js +4 -0
  76. package/dist/ditherEffect.js.map +1 -0
  77. package/dist/edgeDetectMath.d.ts +6 -0
  78. package/dist/edgeDetectMath.d.ts.map +1 -0
  79. package/dist/edgeDetectMath.js +72 -0
  80. package/dist/edgeDetectMath.js.map +1 -0
  81. package/dist/exposureEffect.d.ts +3 -0
  82. package/dist/exposureEffect.d.ts.map +1 -0
  83. package/dist/exposureEffect.js +4 -0
  84. package/dist/exposureEffect.js.map +1 -0
  85. package/dist/filmEmulationEffect.d.ts +3 -0
  86. package/dist/filmEmulationEffect.d.ts.map +1 -0
  87. package/dist/filmEmulationEffect.js +4 -0
  88. package/dist/filmEmulationEffect.js.map +1 -0
  89. package/dist/filmGrainEffect.d.ts +3 -0
  90. package/dist/filmGrainEffect.d.ts.map +1 -0
  91. package/dist/filmGrainEffect.js +4 -0
  92. package/dist/filmGrainEffect.js.map +1 -0
  93. package/dist/fxaaEffect.d.ts +3 -0
  94. package/dist/fxaaEffect.d.ts.map +1 -0
  95. package/dist/fxaaEffect.js +4 -0
  96. package/dist/fxaaEffect.js.map +1 -0
  97. package/dist/gaussianMath.d.ts +5 -0
  98. package/dist/gaussianMath.d.ts.map +1 -0
  99. package/dist/gaussianMath.js +42 -0
  100. package/dist/gaussianMath.js.map +1 -0
  101. package/dist/glitchEffect.d.ts +3 -0
  102. package/dist/glitchEffect.d.ts.map +1 -0
  103. package/dist/glitchEffect.js +4 -0
  104. package/dist/glitchEffect.js.map +1 -0
  105. package/dist/godRaysEffect.d.ts +3 -0
  106. package/dist/godRaysEffect.d.ts.map +1 -0
  107. package/dist/godRaysEffect.js +4 -0
  108. package/dist/godRaysEffect.js.map +1 -0
  109. package/dist/godRaysMath.d.ts +8 -0
  110. package/dist/godRaysMath.d.ts.map +1 -0
  111. package/dist/godRaysMath.js +49 -0
  112. package/dist/godRaysMath.js.map +1 -0
  113. package/dist/grayscaleEffect.d.ts +3 -0
  114. package/dist/grayscaleEffect.d.ts.map +1 -0
  115. package/dist/grayscaleEffect.js +4 -0
  116. package/dist/grayscaleEffect.js.map +1 -0
  117. package/dist/halftoneEffect.d.ts +3 -0
  118. package/dist/halftoneEffect.d.ts.map +1 -0
  119. package/dist/halftoneEffect.js +4 -0
  120. package/dist/halftoneEffect.js.map +1 -0
  121. package/dist/hueSaturationEffect.d.ts +3 -0
  122. package/dist/hueSaturationEffect.d.ts.map +1 -0
  123. package/dist/hueSaturationEffect.js +4 -0
  124. package/dist/hueSaturationEffect.js.map +1 -0
  125. package/dist/index.d.ts +67 -0
  126. package/dist/index.d.ts.map +1 -0
  127. package/dist/index.js +67 -0
  128. package/dist/index.js.map +1 -0
  129. package/dist/invertEffect.d.ts +3 -0
  130. package/dist/invertEffect.d.ts.map +1 -0
  131. package/dist/invertEffect.js +4 -0
  132. package/dist/invertEffect.js.map +1 -0
  133. package/dist/kuwaharaEffect.d.ts +3 -0
  134. package/dist/kuwaharaEffect.d.ts.map +1 -0
  135. package/dist/kuwaharaEffect.js +4 -0
  136. package/dist/kuwaharaEffect.js.map +1 -0
  137. package/dist/kuwaharaMath.d.ts +6 -0
  138. package/dist/kuwaharaMath.d.ts.map +1 -0
  139. package/dist/kuwaharaMath.js +70 -0
  140. package/dist/kuwaharaMath.js.map +1 -0
  141. package/dist/lensDirtEffect.d.ts +3 -0
  142. package/dist/lensDirtEffect.d.ts.map +1 -0
  143. package/dist/lensDirtEffect.js +4 -0
  144. package/dist/lensDirtEffect.js.map +1 -0
  145. package/dist/lensDistortionEffect.d.ts +3 -0
  146. package/dist/lensDistortionEffect.d.ts.map +1 -0
  147. package/dist/lensDistortionEffect.js +4 -0
  148. package/dist/lensDistortionEffect.js.map +1 -0
  149. package/dist/lensFlareEffect.d.ts +3 -0
  150. package/dist/lensFlareEffect.d.ts.map +1 -0
  151. package/dist/lensFlareEffect.js +4 -0
  152. package/dist/lensFlareEffect.js.map +1 -0
  153. package/dist/liftGammaGainEffect.d.ts +3 -0
  154. package/dist/liftGammaGainEffect.d.ts.map +1 -0
  155. package/dist/liftGammaGainEffect.js +4 -0
  156. package/dist/liftGammaGainEffect.js.map +1 -0
  157. package/dist/lookupTableGradeEffect.d.ts +3 -0
  158. package/dist/lookupTableGradeEffect.d.ts.map +1 -0
  159. package/dist/lookupTableGradeEffect.js +4 -0
  160. package/dist/lookupTableGradeEffect.js.map +1 -0
  161. package/dist/lutMath.d.ts +7 -0
  162. package/dist/lutMath.d.ts.map +1 -0
  163. package/dist/lutMath.js +39 -0
  164. package/dist/lutMath.js.map +1 -0
  165. package/dist/motionBlurEffect.d.ts +3 -0
  166. package/dist/motionBlurEffect.d.ts.map +1 -0
  167. package/dist/motionBlurEffect.js +4 -0
  168. package/dist/motionBlurEffect.js.map +1 -0
  169. package/dist/outlineEffect.d.ts +3 -0
  170. package/dist/outlineEffect.d.ts.map +1 -0
  171. package/dist/outlineEffect.js +4 -0
  172. package/dist/outlineEffect.js.map +1 -0
  173. package/dist/panniniProjectionEffect.d.ts +3 -0
  174. package/dist/panniniProjectionEffect.d.ts.map +1 -0
  175. package/dist/panniniProjectionEffect.js +4 -0
  176. package/dist/panniniProjectionEffect.js.map +1 -0
  177. package/dist/pixelateEffect.d.ts +3 -0
  178. package/dist/pixelateEffect.d.ts.map +1 -0
  179. package/dist/pixelateEffect.js +4 -0
  180. package/dist/pixelateEffect.js.map +1 -0
  181. package/dist/posterizeEffect.d.ts +3 -0
  182. package/dist/posterizeEffect.d.ts.map +1 -0
  183. package/dist/posterizeEffect.js +4 -0
  184. package/dist/posterizeEffect.js.map +1 -0
  185. package/dist/radialBlurEffect.d.ts +3 -0
  186. package/dist/radialBlurEffect.d.ts.map +1 -0
  187. package/dist/radialBlurEffect.js +4 -0
  188. package/dist/radialBlurEffect.js.map +1 -0
  189. package/dist/renderEffectDefaults.d.ts +4 -0
  190. package/dist/renderEffectDefaults.d.ts.map +1 -0
  191. package/dist/renderEffectDefaults.js +111 -0
  192. package/dist/renderEffectDefaults.js.map +1 -0
  193. package/dist/renderEffectInputs.d.ts +5 -0
  194. package/dist/renderEffectInputs.d.ts.map +1 -0
  195. package/dist/renderEffectInputs.js +87 -0
  196. package/dist/renderEffectInputs.js.map +1 -0
  197. package/dist/renderEffectInterpolation.d.ts +4 -0
  198. package/dist/renderEffectInterpolation.d.ts.map +1 -0
  199. package/dist/renderEffectInterpolation.js +75 -0
  200. package/dist/renderEffectInterpolation.js.map +1 -0
  201. package/dist/renderEffectValidation.d.ts +3 -0
  202. package/dist/renderEffectValidation.d.ts.map +1 -0
  203. package/dist/renderEffectValidation.js +18 -0
  204. package/dist/renderEffectValidation.js.map +1 -0
  205. package/dist/scanlinesEffect.d.ts +3 -0
  206. package/dist/scanlinesEffect.d.ts.map +1 -0
  207. package/dist/scanlinesEffect.js +4 -0
  208. package/dist/scanlinesEffect.js.map +1 -0
  209. package/dist/screenSpaceFogEffect.d.ts +3 -0
  210. package/dist/screenSpaceFogEffect.d.ts.map +1 -0
  211. package/dist/screenSpaceFogEffect.js +4 -0
  212. package/dist/screenSpaceFogEffect.js.map +1 -0
  213. package/dist/sepiaEffect.d.ts +3 -0
  214. package/dist/sepiaEffect.d.ts.map +1 -0
  215. package/dist/sepiaEffect.js +4 -0
  216. package/dist/sepiaEffect.js.map +1 -0
  217. package/dist/sharpenEffect.d.ts +3 -0
  218. package/dist/sharpenEffect.d.ts.map +1 -0
  219. package/dist/sharpenEffect.js +4 -0
  220. package/dist/sharpenEffect.js.map +1 -0
  221. package/dist/sketchEffect.d.ts +3 -0
  222. package/dist/sketchEffect.d.ts.map +1 -0
  223. package/dist/sketchEffect.js +4 -0
  224. package/dist/sketchEffect.js.map +1 -0
  225. package/dist/smaaEffect.d.ts +3 -0
  226. package/dist/smaaEffect.d.ts.map +1 -0
  227. package/dist/smaaEffect.js +4 -0
  228. package/dist/smaaEffect.js.map +1 -0
  229. package/dist/ssaoEffect.d.ts +3 -0
  230. package/dist/ssaoEffect.d.ts.map +1 -0
  231. package/dist/ssaoEffect.js +4 -0
  232. package/dist/ssaoEffect.js.map +1 -0
  233. package/dist/ssrEffect.d.ts +3 -0
  234. package/dist/ssrEffect.d.ts.map +1 -0
  235. package/dist/ssrEffect.js +4 -0
  236. package/dist/ssrEffect.js.map +1 -0
  237. package/dist/stylizeMath.d.ts +9 -0
  238. package/dist/stylizeMath.d.ts.map +1 -0
  239. package/dist/stylizeMath.js +77 -0
  240. package/dist/stylizeMath.js.map +1 -0
  241. package/dist/taaEffect.d.ts +3 -0
  242. package/dist/taaEffect.d.ts.map +1 -0
  243. package/dist/taaEffect.js +4 -0
  244. package/dist/taaEffect.js.map +1 -0
  245. package/dist/tiltShiftEffect.d.ts +3 -0
  246. package/dist/tiltShiftEffect.d.ts.map +1 -0
  247. package/dist/tiltShiftEffect.js +4 -0
  248. package/dist/tiltShiftEffect.js.map +1 -0
  249. package/dist/toneMapEffect.d.ts +3 -0
  250. package/dist/toneMapEffect.d.ts.map +1 -0
  251. package/dist/toneMapEffect.js +4 -0
  252. package/dist/toneMapEffect.js.map +1 -0
  253. package/dist/toneMapMath.d.ts +12 -0
  254. package/dist/toneMapMath.d.ts.map +1 -0
  255. package/dist/toneMapMath.js +110 -0
  256. package/dist/toneMapMath.js.map +1 -0
  257. package/dist/vignetteEffect.d.ts +3 -0
  258. package/dist/vignetteEffect.d.ts.map +1 -0
  259. package/dist/vignetteEffect.js +4 -0
  260. package/dist/vignetteEffect.js.map +1 -0
  261. package/dist/volumetricLightEffect.d.ts +3 -0
  262. package/dist/volumetricLightEffect.d.ts.map +1 -0
  263. package/dist/volumetricLightEffect.js +4 -0
  264. package/dist/volumetricLightEffect.js.map +1 -0
  265. package/dist/whiteBalanceEffect.d.ts +3 -0
  266. package/dist/whiteBalanceEffect.d.ts.map +1 -0
  267. package/dist/whiteBalanceEffect.js +4 -0
  268. package/dist/whiteBalanceEffect.js.map +1 -0
  269. package/package.json +37 -0
  270. package/src/autoExposureEffect.test.ts +11 -0
  271. package/src/barrelDistortionEffect.test.ts +11 -0
  272. package/src/bloomEffect.test.ts +41 -0
  273. package/src/bokehDepthOfFieldEffect.test.ts +15 -0
  274. package/src/brightnessContrastEffect.test.ts +14 -0
  275. package/src/cameraMotionBlurEffect.test.ts +14 -0
  276. package/src/channelMixerEffect.test.ts +12 -0
  277. package/src/chromaticAberrationEffect.test.ts +14 -0
  278. package/src/colorBlindSimulationEffect.test.ts +13 -0
  279. package/src/colorGradeEffect.test.ts +11 -0
  280. package/src/colorScienceMath.test.ts +160 -0
  281. package/src/colorTemperatureMath.test.ts +67 -0
  282. package/src/contactShadowsEffect.test.ts +14 -0
  283. package/src/crtEffect.test.ts +16 -0
  284. package/src/customShaderEffect.test.ts +14 -0
  285. package/src/depthMath.test.ts +71 -0
  286. package/src/directionalBlurEffect.test.ts +11 -0
  287. package/src/displacementEffect.test.ts +15 -0
  288. package/src/ditherEffect.test.ts +11 -0
  289. package/src/edgeDetectMath.test.ts +84 -0
  290. package/src/exposureEffect.test.ts +7 -0
  291. package/src/filmEmulationEffect.test.ts +14 -0
  292. package/src/filmGrainEffect.test.ts +15 -0
  293. package/src/fxaaEffect.test.ts +14 -0
  294. package/src/gaussianMath.test.ts +93 -0
  295. package/src/glitchEffect.test.ts +16 -0
  296. package/src/godRaysEffect.test.ts +15 -0
  297. package/src/godRaysMath.test.ts +63 -0
  298. package/src/grayscaleEffect.test.ts +11 -0
  299. package/src/halftoneEffect.test.ts +11 -0
  300. package/src/hueSaturationEffect.test.ts +15 -0
  301. package/src/invertEffect.test.ts +11 -0
  302. package/src/kuwaharaEffect.test.ts +11 -0
  303. package/src/kuwaharaMath.test.ts +65 -0
  304. package/src/lensDirtEffect.test.ts +15 -0
  305. package/src/lensDistortionEffect.test.ts +11 -0
  306. package/src/lensFlareEffect.test.ts +16 -0
  307. package/src/liftGammaGainEffect.test.ts +15 -0
  308. package/src/lookupTableGradeEffect.test.ts +11 -0
  309. package/src/lutMath.test.ts +67 -0
  310. package/src/motionBlurEffect.test.ts +11 -0
  311. package/src/outlineEffect.test.ts +15 -0
  312. package/src/panniniProjectionEffect.test.ts +14 -0
  313. package/src/pixelateEffect.test.ts +11 -0
  314. package/src/posterizeEffect.test.ts +11 -0
  315. package/src/radialBlurEffect.test.ts +15 -0
  316. package/src/renderEffectDefaults.test.ts +70 -0
  317. package/src/renderEffectInputs.test.ts +60 -0
  318. package/src/renderEffectInterpolation.test.ts +71 -0
  319. package/src/renderEffectValidation.test.ts +37 -0
  320. package/src/scanlinesEffect.test.ts +11 -0
  321. package/src/screenSpaceFogEffect.test.ts +14 -0
  322. package/src/sepiaEffect.test.ts +11 -0
  323. package/src/sharpenEffect.test.ts +11 -0
  324. package/src/sketchEffect.test.ts +11 -0
  325. package/src/smaaEffect.test.ts +11 -0
  326. package/src/ssaoEffect.test.ts +11 -0
  327. package/src/ssrEffect.test.ts +11 -0
  328. package/src/stylizeMath.test.ts +99 -0
  329. package/src/taaEffect.test.ts +11 -0
  330. package/src/tiltShiftEffect.test.ts +15 -0
  331. package/src/toneMapEffect.test.ts +7 -0
  332. package/src/toneMapMath.test.ts +145 -0
  333. package/src/vignetteEffect.test.ts +16 -0
  334. package/src/volumetricLightEffect.test.ts +14 -0
  335. package/src/whiteBalanceEffect.test.ts +11 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whiteBalanceEffect.d.ts","sourceRoot":"","sources":["../src/whiteBalanceEffect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,QAAQ,CAAC,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAM,GAAG,kBAAkB,CAErH"}
@@ -0,0 +1,4 @@
1
+ export function createWhiteBalanceEffect(options = {}) {
2
+ return { kind: 'WhiteBalanceEffect', ...options };
3
+ }
4
+ //# sourceMappingURL=whiteBalanceEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whiteBalanceEffect.js","sourceRoot":"","sources":["../src/whiteBalanceEffect.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,wBAAwB,CAAC,UAAsD,EAAE;IAC/F,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,GAAG,OAAO,EAAE,CAAC;AACpD,CAAC"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@flighthq/effects",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "src/**/*.test.ts",
16
+ "!dist/**/*.test.js",
17
+ "!dist/**/*.test.d.ts",
18
+ "!dist/**/*.test.js.map",
19
+ "!dist/**/*.test.d.ts.map"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsc -b",
23
+ "clean": "tsc -b --clean",
24
+ "test": "vitest run --config vitest.config.ts",
25
+ "test:watch": "vitest --watch --config vitest.config.ts",
26
+ "prepack": "npm run clean && npm run clean:dist && npm run build",
27
+ "clean:dist": "tsx ../../scripts/clean-package-dist.ts"
28
+ },
29
+ "dependencies": {
30
+ "@flighthq/types": "0.1.0"
31
+ },
32
+ "devDependencies": {
33
+ "typescript": "^5.3.0"
34
+ },
35
+ "description": "Render-effect intents and substrate-agnostic recipe math",
36
+ "sideEffects": false
37
+ }
@@ -0,0 +1,11 @@
1
+ import { createAutoExposureEffect } from './autoExposureEffect';
2
+
3
+ describe('createAutoExposureEffect', () => {
4
+ it('carries options', () => {
5
+ expect(createAutoExposureEffect({ adaptationSpeed: 2 })).toMatchObject({ adaptationSpeed: 2 });
6
+ });
7
+
8
+ it('tags the intent type', () => {
9
+ expect(createAutoExposureEffect().kind).toBe('AutoExposureEffect');
10
+ });
11
+ });
@@ -0,0 +1,11 @@
1
+ import { createBarrelDistortionEffect } from './barrelDistortionEffect';
2
+
3
+ describe('createBarrelDistortionEffect', () => {
4
+ it('carries options', () => {
5
+ expect(createBarrelDistortionEffect({ amount: 0.3 })).toMatchObject({ amount: 0.3 });
6
+ });
7
+
8
+ it('tags the intent type', () => {
9
+ expect(createBarrelDistortionEffect().kind).toBe('BarrelDistortionEffect');
10
+ });
11
+ });
@@ -0,0 +1,41 @@
1
+ import { computeBloomBlurRadius, computeBloomIntensity, computeBloomThreshold, createBloomEffect } from './bloomEffect';
2
+
3
+ describe('computeBloomBlurRadius', () => {
4
+ it('defaults to 8 when radius is unset', () => {
5
+ expect(computeBloomBlurRadius(createBloomEffect())).toBe(8);
6
+ });
7
+
8
+ it('clamps negative radius to zero', () => {
9
+ expect(computeBloomBlurRadius(createBloomEffect({ radius: -4 }))).toBe(0);
10
+ });
11
+ });
12
+
13
+ describe('computeBloomIntensity', () => {
14
+ it('defaults to 1 when intensity is unset', () => {
15
+ expect(computeBloomIntensity(createBloomEffect())).toBe(1);
16
+ });
17
+
18
+ it('passes through an explicit intensity', () => {
19
+ expect(computeBloomIntensity(createBloomEffect({ intensity: 2.5 }))).toBe(2.5);
20
+ });
21
+ });
22
+
23
+ describe('computeBloomThreshold', () => {
24
+ it('defaults to 0.8 when threshold is unset', () => {
25
+ expect(computeBloomThreshold(createBloomEffect())).toBe(0.8);
26
+ });
27
+
28
+ it('passes through an explicit threshold', () => {
29
+ expect(computeBloomThreshold(createBloomEffect({ threshold: 0.25 }))).toBe(0.25);
30
+ });
31
+ });
32
+
33
+ describe('createBloomEffect', () => {
34
+ it('tags the intent type', () => {
35
+ expect(createBloomEffect().kind).toBe('BloomEffect');
36
+ });
37
+
38
+ it('carries options', () => {
39
+ expect(createBloomEffect({ threshold: 0.5, intensity: 2 })).toMatchObject({ threshold: 0.5, intensity: 2 });
40
+ });
41
+ });
@@ -0,0 +1,15 @@
1
+ import { createBokehDepthOfFieldEffect } from './bokehDepthOfFieldEffect';
2
+
3
+ describe('createBokehDepthOfFieldEffect', () => {
4
+ it('tags the intent type', () => {
5
+ expect(createBokehDepthOfFieldEffect().kind).toBe('BokehDepthOfFieldEffect');
6
+ });
7
+
8
+ it('carries options', () => {
9
+ expect(createBokehDepthOfFieldEffect({ focusDistance: 0.5, focusRange: 0.2, maxBlur: 4 })).toMatchObject({
10
+ focusDistance: 0.5,
11
+ focusRange: 0.2,
12
+ maxBlur: 4,
13
+ });
14
+ });
15
+ });
@@ -0,0 +1,14 @@
1
+ import { createBrightnessContrastEffect } from './brightnessContrastEffect';
2
+
3
+ describe('createBrightnessContrastEffect', () => {
4
+ it('tags the intent type', () => {
5
+ expect(createBrightnessContrastEffect().kind).toBe('BrightnessContrastEffect');
6
+ });
7
+
8
+ it('carries options', () => {
9
+ expect(createBrightnessContrastEffect({ brightness: 0.2, contrast: 1.5 })).toMatchObject({
10
+ brightness: 0.2,
11
+ contrast: 1.5,
12
+ });
13
+ });
14
+ });
@@ -0,0 +1,14 @@
1
+ import { createCameraMotionBlurEffect } from './cameraMotionBlurEffect';
2
+
3
+ describe('createCameraMotionBlurEffect', () => {
4
+ it('tags the intent type', () => {
5
+ expect(createCameraMotionBlurEffect().kind).toBe('CameraMotionBlurEffect');
6
+ });
7
+
8
+ it('carries options', () => {
9
+ expect(createCameraMotionBlurEffect({ intensity: 0.5, samples: 12 })).toMatchObject({
10
+ intensity: 0.5,
11
+ samples: 12,
12
+ });
13
+ });
14
+ });
@@ -0,0 +1,12 @@
1
+ import { createChannelMixerEffect } from './channelMixerEffect';
2
+
3
+ describe('createChannelMixerEffect', () => {
4
+ it('tags the intent type', () => {
5
+ expect(createChannelMixerEffect({ matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0] }).kind).toBe('ChannelMixerEffect');
6
+ });
7
+
8
+ it('carries the matrix', () => {
9
+ const matrix = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0];
10
+ expect(createChannelMixerEffect({ matrix }).matrix).toBe(matrix);
11
+ });
12
+ });
@@ -0,0 +1,14 @@
1
+ import { createChromaticAberrationEffect } from './chromaticAberrationEffect';
2
+
3
+ describe('createChromaticAberrationEffect', () => {
4
+ it('tags the intent type', () => {
5
+ expect(createChromaticAberrationEffect().kind).toBe('ChromaticAberrationEffect');
6
+ });
7
+
8
+ it('carries options', () => {
9
+ expect(createChromaticAberrationEffect({ intensity: 0.01, radial: false })).toMatchObject({
10
+ intensity: 0.01,
11
+ radial: false,
12
+ });
13
+ });
14
+ });
@@ -0,0 +1,13 @@
1
+ import { createColorBlindSimulationEffect } from './colorBlindSimulationEffect';
2
+
3
+ describe('createColorBlindSimulationEffect', () => {
4
+ it('carries options', () => {
5
+ expect(createColorBlindSimulationEffect({ type: 'protanopia' })).toMatchObject({
6
+ type: 'protanopia',
7
+ });
8
+ });
9
+
10
+ it('tags the intent type', () => {
11
+ expect(createColorBlindSimulationEffect().kind).toBe('ColorBlindSimulationEffect');
12
+ });
13
+ });
@@ -0,0 +1,11 @@
1
+ import { createColorGradeEffect } from './colorGradeEffect';
2
+
3
+ describe('createColorGradeEffect', () => {
4
+ it('tags the intent type', () => {
5
+ expect(createColorGradeEffect().kind).toBe('ColorGradeEffect');
6
+ });
7
+
8
+ it('carries options', () => {
9
+ expect(createColorGradeEffect({ exposure: 1, saturation: 1.2 })).toMatchObject({ exposure: 1, saturation: 1.2 });
10
+ });
11
+ });
@@ -0,0 +1,160 @@
1
+ import {
2
+ computeHslToRgb,
3
+ computeLinearToSrgb,
4
+ computeOklabToRgb,
5
+ computeRgbToHsl,
6
+ computeRgbToOklab,
7
+ computeSrgbToLinear,
8
+ getRec709LuminanceWeights,
9
+ getRec2020LuminanceWeights,
10
+ } from './colorScienceMath';
11
+
12
+ describe('computeHslToRgb', () => {
13
+ it('hue=0, full saturation, mid lightness → red', () => {
14
+ const out: [number, number, number] = [0, 0, 0];
15
+ computeHslToRgb(0, 1, 0.5, out);
16
+ expect(out[0]).toBeCloseTo(1, 4);
17
+ expect(out[1]).toBeCloseTo(0, 4);
18
+ expect(out[2]).toBeCloseTo(0, 4);
19
+ });
20
+ it('round-trips with computeRgbToHsl', () => {
21
+ const r = 0.3;
22
+ const g = 0.7;
23
+ const b = 0.1;
24
+ const hsl: [number, number, number] = [0, 0, 0];
25
+ computeRgbToHsl(r, g, b, hsl);
26
+ const rgb: [number, number, number] = [0, 0, 0];
27
+ computeHslToRgb(hsl[0], hsl[1], hsl[2], rgb);
28
+ expect(rgb[0]).toBeCloseTo(r, 4);
29
+ expect(rgb[1]).toBeCloseTo(g, 4);
30
+ expect(rgb[2]).toBeCloseTo(b, 4);
31
+ });
32
+ });
33
+
34
+ describe('computeLinearToSrgb', () => {
35
+ it('0 maps to 0', () => {
36
+ expect(computeLinearToSrgb(0)).toBeCloseTo(0, 5);
37
+ });
38
+ it('1 maps to 1', () => {
39
+ expect(computeLinearToSrgb(1)).toBeCloseTo(1, 5);
40
+ });
41
+ it('round-trips with computeSrgbToLinear', () => {
42
+ const linear = 0.5;
43
+ expect(computeSrgbToLinear(computeLinearToSrgb(linear))).toBeCloseTo(linear, 4);
44
+ });
45
+ it('clamps negative values to 0', () => {
46
+ expect(computeLinearToSrgb(-1)).toBeCloseTo(0, 5);
47
+ });
48
+ });
49
+
50
+ describe('computeOklabToRgb', () => {
51
+ it('round-trips with computeRgbToOklab for a mid-gray', () => {
52
+ const r = 0.5;
53
+ const g = 0.5;
54
+ const b = 0.5;
55
+ const lab: [number, number, number] = [0, 0, 0];
56
+ computeRgbToOklab(r, g, b, lab);
57
+ const rgb: [number, number, number] = [0, 0, 0];
58
+ computeOklabToRgb(lab[0], lab[1], lab[2], rgb);
59
+ expect(rgb[0]).toBeCloseTo(r, 3);
60
+ expect(rgb[1]).toBeCloseTo(g, 3);
61
+ expect(rgb[2]).toBeCloseTo(b, 3);
62
+ });
63
+ it('round-trips with computeRgbToOklab for a saturated color', () => {
64
+ const r = 0.8;
65
+ const g = 0.2;
66
+ const b = 0.1;
67
+ const lab: [number, number, number] = [0, 0, 0];
68
+ computeRgbToOklab(r, g, b, lab);
69
+ const rgb: [number, number, number] = [0, 0, 0];
70
+ computeOklabToRgb(lab[0], lab[1], lab[2], rgb);
71
+ expect(rgb[0]).toBeCloseTo(r, 3);
72
+ expect(rgb[1]).toBeCloseTo(g, 3);
73
+ expect(rgb[2]).toBeCloseTo(b, 3);
74
+ });
75
+ });
76
+
77
+ describe('computeRgbToHsl', () => {
78
+ it('red (1,0,0) has hue 0°', () => {
79
+ const out: [number, number, number] = [0, 0, 0];
80
+ computeRgbToHsl(1, 0, 0, out);
81
+ expect(out[0]).toBeCloseTo(0, 2);
82
+ expect(out[1]).toBeCloseTo(1, 2);
83
+ expect(out[2]).toBeCloseTo(0.5, 2);
84
+ });
85
+ it('green (0,1,0) has hue 120°', () => {
86
+ const out: [number, number, number] = [0, 0, 0];
87
+ computeRgbToHsl(0, 1, 0, out);
88
+ expect(out[0]).toBeCloseTo(120, 2);
89
+ });
90
+ it('white (1,1,1) has lightness 1 and saturation 0', () => {
91
+ const out: [number, number, number] = [0, 0, 0];
92
+ computeRgbToHsl(1, 1, 1, out);
93
+ expect(out[1]).toBeCloseTo(0, 4);
94
+ expect(out[2]).toBeCloseTo(1, 5);
95
+ });
96
+ it('black (0,0,0) has lightness 0 and saturation 0', () => {
97
+ const out: [number, number, number] = [0, 0, 0];
98
+ computeRgbToHsl(0, 0, 0, out);
99
+ expect(out[1]).toBeCloseTo(0, 4);
100
+ expect(out[2]).toBeCloseTo(0, 5);
101
+ });
102
+ });
103
+
104
+ describe('computeRgbToOklab', () => {
105
+ it('black (0,0,0) maps to L=0', () => {
106
+ const out: [number, number, number] = [0, 0, 0];
107
+ computeRgbToOklab(0, 0, 0, out);
108
+ expect(out[0]).toBeCloseTo(0, 4);
109
+ });
110
+ it('white (1,1,1) maps to L~1, a~0, b~0', () => {
111
+ const out: [number, number, number] = [0, 0, 0];
112
+ computeRgbToOklab(1, 1, 1, out);
113
+ expect(out[0]).toBeCloseTo(1, 2);
114
+ expect(out[1]).toBeCloseTo(0, 3);
115
+ expect(out[2]).toBeCloseTo(0, 3);
116
+ });
117
+ });
118
+
119
+ describe('computeSrgbToLinear', () => {
120
+ it('0 maps to 0', () => {
121
+ expect(computeSrgbToLinear(0)).toBeCloseTo(0, 5);
122
+ });
123
+ it('1 maps to 1', () => {
124
+ expect(computeSrgbToLinear(1)).toBeCloseTo(1, 5);
125
+ });
126
+ it('round-trips with computeLinearToSrgb', () => {
127
+ const srgb = 0.5;
128
+ expect(computeLinearToSrgb(computeSrgbToLinear(srgb))).toBeCloseTo(srgb, 4);
129
+ });
130
+ });
131
+
132
+ describe('getRec2020LuminanceWeights', () => {
133
+ it('weights sum to 1', () => {
134
+ const out: [number, number, number] = [0, 0, 0];
135
+ getRec2020LuminanceWeights(out);
136
+ expect(out[0] + out[1] + out[2]).toBeCloseTo(1, 5);
137
+ });
138
+ it('returns canonical Rec.2020 values', () => {
139
+ const out: [number, number, number] = [0, 0, 0];
140
+ getRec2020LuminanceWeights(out);
141
+ expect(out[0]).toBeCloseTo(0.2627, 4);
142
+ expect(out[1]).toBeCloseTo(0.678, 4);
143
+ expect(out[2]).toBeCloseTo(0.0593, 4);
144
+ });
145
+ });
146
+
147
+ describe('getRec709LuminanceWeights', () => {
148
+ it('weights sum to 1', () => {
149
+ const out: [number, number, number] = [0, 0, 0];
150
+ getRec709LuminanceWeights(out);
151
+ expect(out[0] + out[1] + out[2]).toBeCloseTo(1, 5);
152
+ });
153
+ it('returns canonical Rec.709 values', () => {
154
+ const out: [number, number, number] = [0, 0, 0];
155
+ getRec709LuminanceWeights(out);
156
+ expect(out[0]).toBeCloseTo(0.2126, 4);
157
+ expect(out[1]).toBeCloseTo(0.7152, 4);
158
+ expect(out[2]).toBeCloseTo(0.0722, 4);
159
+ });
160
+ });
@@ -0,0 +1,67 @@
1
+ import { computeColorTemperatureRgb, computeWhiteBalanceMultipliers } from './colorTemperatureMath';
2
+
3
+ describe('computeColorTemperatureRgb', () => {
4
+ it('returns values in [0, 1] range', () => {
5
+ const out: [number, number, number] = [0, 0, 0];
6
+ computeColorTemperatureRgb(6500, out);
7
+ expect(out[0]).toBeGreaterThanOrEqual(0);
8
+ expect(out[0]).toBeLessThanOrEqual(1);
9
+ expect(out[1]).toBeGreaterThanOrEqual(0);
10
+ expect(out[1]).toBeLessThanOrEqual(1);
11
+ expect(out[2]).toBeGreaterThanOrEqual(0);
12
+ expect(out[2]).toBeLessThanOrEqual(1);
13
+ });
14
+ it('warm color (2700 K) has high red, low blue', () => {
15
+ const out: [number, number, number] = [0, 0, 0];
16
+ computeColorTemperatureRgb(2700, out);
17
+ expect(out[0]).toBeGreaterThan(out[2]);
18
+ });
19
+ it('cool color (10000 K) has low red, high blue', () => {
20
+ const out: [number, number, number] = [0, 0, 0];
21
+ computeColorTemperatureRgb(10000, out);
22
+ expect(out[2]).toBeGreaterThan(out[0]);
23
+ });
24
+ it('clamps to [1000, 40000] K range', () => {
25
+ const out1: [number, number, number] = [0, 0, 0];
26
+ const out2: [number, number, number] = [0, 0, 0];
27
+ computeColorTemperatureRgb(500, out1);
28
+ computeColorTemperatureRgb(1000, out2);
29
+ expect(out1).toEqual(out2);
30
+ });
31
+ it('writes result to out without reading from it (alias-safe)', () => {
32
+ const out: [number, number, number] = [99, 99, 99];
33
+ computeColorTemperatureRgb(6500, out);
34
+ expect(out[0]).not.toBe(99);
35
+ });
36
+ });
37
+
38
+ describe('computeWhiteBalanceMultipliers', () => {
39
+ it('neutral (0, 0) returns non-zero multipliers', () => {
40
+ const out: [number, number, number] = [0, 0, 0];
41
+ computeWhiteBalanceMultipliers(0, 0, out);
42
+ expect(out[0]).toBeGreaterThan(0);
43
+ expect(out[1]).toBeGreaterThan(0);
44
+ expect(out[2]).toBeGreaterThan(0);
45
+ });
46
+ it('warm temperature increases red relative to cool', () => {
47
+ const warmOut: [number, number, number] = [0, 0, 0];
48
+ const coolOut: [number, number, number] = [0, 0, 0];
49
+ computeWhiteBalanceMultipliers(0.5, 0, warmOut);
50
+ computeWhiteBalanceMultipliers(-0.5, 0, coolOut);
51
+ expect(warmOut[0]).toBeGreaterThan(coolOut[0]);
52
+ });
53
+ it('positive tint (magenta) reduces green relative to negative tint (green)', () => {
54
+ const magentaOut: [number, number, number] = [0, 0, 0];
55
+ const greenOut: [number, number, number] = [0, 0, 0];
56
+ computeWhiteBalanceMultipliers(0, 0.5, magentaOut);
57
+ computeWhiteBalanceMultipliers(0, -0.5, greenOut);
58
+ expect(greenOut[1]).toBeGreaterThan(magentaOut[1]);
59
+ });
60
+ it('all output channels are non-negative', () => {
61
+ const out: [number, number, number] = [0, 0, 0];
62
+ computeWhiteBalanceMultipliers(-1, -1, out);
63
+ expect(out[0]).toBeGreaterThanOrEqual(0);
64
+ expect(out[1]).toBeGreaterThanOrEqual(0);
65
+ expect(out[2]).toBeGreaterThanOrEqual(0);
66
+ });
67
+ });
@@ -0,0 +1,14 @@
1
+ import { createContactShadowsEffect } from './contactShadowsEffect';
2
+
3
+ describe('createContactShadowsEffect', () => {
4
+ it('carries options', () => {
5
+ expect(createContactShadowsEffect({ opacity: 0.8, samples: 32 })).toMatchObject({
6
+ opacity: 0.8,
7
+ samples: 32,
8
+ });
9
+ });
10
+
11
+ it('tags the intent type', () => {
12
+ expect(createContactShadowsEffect().kind).toBe('ContactShadowsEffect');
13
+ });
14
+ });
@@ -0,0 +1,16 @@
1
+ import { createCrtEffect } from './crtEffect';
2
+
3
+ describe('createCrtEffect', () => {
4
+ it('tags the intent type', () => {
5
+ expect(createCrtEffect().kind).toBe('CrtEffect');
6
+ });
7
+
8
+ it('carries options', () => {
9
+ expect(createCrtEffect({ curvature: 0.2, scanlineIntensity: 0.5, vignette: 0.3, aberration: 0.01 })).toMatchObject({
10
+ curvature: 0.2,
11
+ scanlineIntensity: 0.5,
12
+ vignette: 0.3,
13
+ aberration: 0.01,
14
+ });
15
+ });
16
+ });
@@ -0,0 +1,14 @@
1
+ import { createCustomShaderEffect } from './customShaderEffect';
2
+
3
+ describe('createCustomShaderEffect', () => {
4
+ it('carries options', () => {
5
+ expect(createCustomShaderEffect({ shaderKey: 'myEffect', uniforms: { intensity: 0.5 } })).toMatchObject({
6
+ shaderKey: 'myEffect',
7
+ uniforms: { intensity: 0.5 },
8
+ });
9
+ });
10
+
11
+ it('tags the intent type', () => {
12
+ expect(createCustomShaderEffect({ shaderKey: 'test' }).kind).toBe('CustomShaderEffect');
13
+ });
14
+ });
@@ -0,0 +1,71 @@
1
+ import { computeDepthOfFieldCoc, computeLinearDepthFromNonlinear, computeSsaoSampleKernel } from './depthMath';
2
+
3
+ describe('computeDepthOfFieldCoc', () => {
4
+ it('returns 0 when depth equals focusDistance', () => {
5
+ expect(computeDepthOfFieldCoc(5, 5, 1.8, 50)).toBeCloseTo(0, 4);
6
+ });
7
+ it('behind-focus depth returns positive CoC', () => {
8
+ expect(computeDepthOfFieldCoc(10, 5, 1.8, 50)).toBeGreaterThan(0);
9
+ });
10
+ it('in-front-of-focus depth returns negative CoC', () => {
11
+ expect(computeDepthOfFieldCoc(2, 5, 1.8, 50)).toBeLessThan(0);
12
+ });
13
+ it('larger aperture increases CoC magnitude', () => {
14
+ const coc14 = Math.abs(computeDepthOfFieldCoc(10, 5, 1.4, 50));
15
+ const coc8 = Math.abs(computeDepthOfFieldCoc(10, 5, 8, 50));
16
+ expect(coc14).toBeGreaterThan(coc8);
17
+ });
18
+ });
19
+
20
+ describe('computeLinearDepthFromNonlinear', () => {
21
+ it('depth=0 returns near plane', () => {
22
+ expect(computeLinearDepthFromNonlinear(0, 0.1, 1000)).toBeCloseTo(0.1, 3);
23
+ });
24
+ it('depth=1 returns far plane', () => {
25
+ expect(computeLinearDepthFromNonlinear(1, 0.1, 1000)).toBeCloseTo(1000, 0);
26
+ });
27
+ it('depth=0.5 returns a value between near and far', () => {
28
+ const linear = computeLinearDepthFromNonlinear(0.5, 0.1, 100);
29
+ expect(linear).toBeGreaterThan(0.1);
30
+ expect(linear).toBeLessThan(100);
31
+ });
32
+ it('uses the standard hyperbolic depth formula', () => {
33
+ // near=1, far=10, depth=0 → result == (1*10)/(10-0) = 1
34
+ expect(computeLinearDepthFromNonlinear(0, 1, 10)).toBeCloseTo(1, 5);
35
+ });
36
+ });
37
+
38
+ describe('computeSsaoSampleKernel', () => {
39
+ it('returns the requested sample count', () => {
40
+ const out = new Float32Array(16 * 3);
41
+ const count = computeSsaoSampleKernel(16, out);
42
+ expect(count).toBe(16);
43
+ });
44
+ it('all Z components are non-negative (hemisphere along +Z)', () => {
45
+ const out = new Float32Array(16 * 3);
46
+ const count = computeSsaoSampleKernel(16, out);
47
+ for (let i = 0; i < count; i++) {
48
+ expect(out[i * 3 + 2]).toBeGreaterThanOrEqual(0);
49
+ }
50
+ });
51
+ it('all samples are within the unit sphere', () => {
52
+ const out = new Float32Array(16 * 3);
53
+ const count = computeSsaoSampleKernel(16, out);
54
+ for (let i = 0; i < count; i++) {
55
+ const x = out[i * 3 + 0];
56
+ const y = out[i * 3 + 1];
57
+ const z = out[i * 3 + 2];
58
+ const len = Math.sqrt(x * x + y * y + z * z);
59
+ expect(len).toBeLessThanOrEqual(1 + 1e-6);
60
+ }
61
+ });
62
+ it('is deterministic (same output on repeated calls)', () => {
63
+ const out1 = new Float32Array(8 * 3);
64
+ const out2 = new Float32Array(8 * 3);
65
+ computeSsaoSampleKernel(8, out1);
66
+ computeSsaoSampleKernel(8, out2);
67
+ for (let i = 0; i < out1.length; i++) {
68
+ expect(out1[i]).toBeCloseTo(out2[i], 5);
69
+ }
70
+ });
71
+ });
@@ -0,0 +1,11 @@
1
+ import { createDirectionalBlurEffect } from './directionalBlurEffect';
2
+
3
+ describe('createDirectionalBlurEffect', () => {
4
+ it('tags the intent type', () => {
5
+ expect(createDirectionalBlurEffect().kind).toBe('DirectionalBlurEffect');
6
+ });
7
+
8
+ it('carries options', () => {
9
+ expect(createDirectionalBlurEffect({ angle: 1, length: 8 })).toMatchObject({ angle: 1, length: 8 });
10
+ });
11
+ });
@@ -0,0 +1,15 @@
1
+ import { createDisplacementEffect } from './displacementEffect';
2
+
3
+ describe('createDisplacementEffect', () => {
4
+ it('tags the intent type', () => {
5
+ expect(createDisplacementEffect().kind).toBe('DisplacementEffect');
6
+ });
7
+
8
+ it('carries options', () => {
9
+ expect(createDisplacementEffect({ intensity: 10, frequency: 14, seed: 2 })).toMatchObject({
10
+ intensity: 10,
11
+ frequency: 14,
12
+ seed: 2,
13
+ });
14
+ });
15
+ });
@@ -0,0 +1,11 @@
1
+ import { createDitherEffect } from './ditherEffect';
2
+
3
+ describe('createDitherEffect', () => {
4
+ it('tags the intent type', () => {
5
+ expect(createDitherEffect().kind).toBe('DitherEffect');
6
+ });
7
+
8
+ it('carries options', () => {
9
+ expect(createDitherEffect({ levels: 4 })).toMatchObject({ levels: 4 });
10
+ });
11
+ });