@allyhub/sdk 0.1.0-alpha.8 → 0.2.0-next.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 (365) hide show
  1. package/LICENSE.md +241 -0
  2. package/NOTICE +85 -0
  3. package/client.d.ts +45 -1
  4. package/dist/anim.js +2 -75
  5. package/dist/define.d.ts +10 -4
  6. package/dist/define.js +2 -95
  7. package/dist/dom.d.ts +1 -1
  8. package/dist/dom.js +2 -457
  9. package/dist/fit.js +2 -60
  10. package/dist/free.d.ts +18 -0
  11. package/dist/free.js +2 -0
  12. package/dist/index.d.ts +28 -13
  13. package/dist/index.js +2 -11
  14. package/dist/input.d.ts +306 -0
  15. package/dist/input.js +2 -0
  16. package/dist/media.d.ts +3 -6
  17. package/dist/media.js +2 -27
  18. package/dist/messages.d.ts +3 -2
  19. package/dist/messages.js +2 -2
  20. package/dist/module.d.ts +24 -0
  21. package/dist/module.js +2 -0
  22. package/dist/noise.js +2 -233
  23. package/dist/parts.d.ts +98 -22
  24. package/dist/parts.js +2 -414
  25. package/dist/paths.d.ts +1 -1
  26. package/dist/paths.js +2 -720
  27. package/dist/phone.d.ts +26 -0
  28. package/dist/phone.js +2 -0
  29. package/dist/piece.d.ts +106 -35
  30. package/dist/piece.js +2 -38
  31. package/dist/props.d.ts +1 -1
  32. package/dist/props.js +2 -35
  33. package/dist/scenery.d.ts +2 -0
  34. package/dist/scenery.js +2 -0
  35. package/dist/text.js +2 -38
  36. package/dist/written.d.ts +12 -0
  37. package/dist/written.js +2 -0
  38. package/docs/README.md +18 -0
  39. package/docs/batches.md +148 -0
  40. package/docs/contract.md +51 -0
  41. package/docs/defaults.md +703 -0
  42. package/docs/docs.md +148 -0
  43. package/docs/footage.md +249 -0
  44. package/docs/layers.md +317 -0
  45. package/docs/modeling.md +143 -0
  46. package/docs/project.md +265 -0
  47. package/docs/scenery.md +308 -0
  48. package/docs/sheets.md +119 -0
  49. package/docs/slides.md +111 -0
  50. package/docs/sound.md +170 -0
  51. package/docs/speech.md +289 -0
  52. package/docs/video.md +265 -0
  53. package/node_modules/@allyhub-next/audio/LICENSE +241 -0
  54. package/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +52 -0
  55. package/node_modules/@allyhub-next/audio/dist/at-cut.js +2 -0
  56. package/node_modules/@allyhub-next/audio/dist/decode.d.ts +33 -0
  57. package/node_modules/@allyhub-next/audio/dist/decode.js +2 -0
  58. package/node_modules/@allyhub-next/audio/dist/envelope.d.ts +37 -0
  59. package/node_modules/@allyhub-next/audio/dist/envelope.js +2 -0
  60. package/node_modules/@allyhub-next/audio/dist/index.d.ts +17 -0
  61. package/node_modules/@allyhub-next/audio/dist/index.js +2 -0
  62. package/node_modules/@allyhub-next/audio/dist/levels.d.ts +97 -0
  63. package/node_modules/@allyhub-next/audio/dist/levels.js +2 -0
  64. package/node_modules/@allyhub-next/audio/dist/master.d.ts +29 -0
  65. package/node_modules/@allyhub-next/audio/dist/master.js +2 -0
  66. package/node_modules/@allyhub-next/audio/dist/music.d.ts +11 -0
  67. package/node_modules/@allyhub-next/audio/dist/music.js +2 -0
  68. package/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +39 -0
  69. package/node_modules/@allyhub-next/audio/dist/node/decode.js +2 -0
  70. package/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +25 -0
  71. package/node_modules/@allyhub-next/audio/dist/node/ebur128.js +2 -0
  72. package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +31 -0
  73. package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.js +2 -0
  74. package/node_modules/@allyhub-next/audio/dist/node/index.d.ts +8 -0
  75. package/node_modules/@allyhub-next/audio/dist/node/index.js +2 -0
  76. package/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +18 -0
  77. package/node_modules/@allyhub-next/audio/dist/node/loudness.js +2 -0
  78. package/node_modules/@allyhub-next/audio/dist/node/master.d.ts +42 -0
  79. package/node_modules/@allyhub-next/audio/dist/node/master.js +2 -0
  80. package/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +60 -0
  81. package/node_modules/@allyhub-next/audio/dist/node/measure.js +2 -0
  82. package/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +31 -0
  83. package/node_modules/@allyhub-next/audio/dist/node/mix.js +2 -0
  84. package/node_modules/@allyhub-next/audio/dist/plan.d.ts +143 -0
  85. package/node_modules/@allyhub-next/audio/dist/plan.js +2 -0
  86. package/node_modules/@allyhub-next/audio/dist/recorded.d.ts +26 -0
  87. package/node_modules/@allyhub-next/audio/dist/recorded.js +2 -0
  88. package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +47 -0
  89. package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.js +2 -0
  90. package/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +89 -0
  91. package/node_modules/@allyhub-next/audio/dist/recording/chain.js +2 -0
  92. package/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +64 -0
  93. package/node_modules/@allyhub-next/audio/dist/recording/dynamics.js +2 -0
  94. package/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +26 -0
  95. package/node_modules/@allyhub-next/audio/dist/recording/fft.js +2 -0
  96. package/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +42 -0
  97. package/node_modules/@allyhub-next/audio/dist/recording/filters.js +2 -0
  98. package/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +56 -0
  99. package/node_modules/@allyhub-next/audio/dist/recording/fit.js +2 -0
  100. package/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +10 -0
  101. package/node_modules/@allyhub-next/audio/dist/recording/index.js +2 -0
  102. package/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +12 -0
  103. package/node_modules/@allyhub-next/audio/dist/recording/loudness.js +2 -0
  104. package/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +67 -0
  105. package/node_modules/@allyhub-next/audio/dist/recording/measure.js +2 -0
  106. package/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +32 -0
  107. package/node_modules/@allyhub-next/audio/dist/recording/mic.js +2 -0
  108. package/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +27 -0
  109. package/node_modules/@allyhub-next/audio/dist/recording/noise.js +2 -0
  110. package/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +64 -0
  111. package/node_modules/@allyhub-next/audio/dist/recording/presets.js +2 -0
  112. package/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +78 -0
  113. package/node_modules/@allyhub-next/audio/dist/recording/room.js +2 -0
  114. package/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +111 -0
  115. package/node_modules/@allyhub-next/audio/dist/recording/setup.js +2 -0
  116. package/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +3 -0
  117. package/node_modules/@allyhub-next/audio/dist/recording/vec.js +2 -0
  118. package/node_modules/@allyhub-next/audio/dist/render.d.ts +26 -0
  119. package/node_modules/@allyhub-next/audio/dist/render.js +2 -0
  120. package/node_modules/@allyhub-next/audio/dist/sfx.d.ts +10 -0
  121. package/node_modules/@allyhub-next/audio/dist/sfx.js +2 -0
  122. package/node_modules/@allyhub-next/audio/dist/shape.d.ts +118 -0
  123. package/node_modules/@allyhub-next/audio/dist/shape.js +2 -0
  124. package/node_modules/@allyhub-next/audio/dist/voice.d.ts +45 -0
  125. package/node_modules/@allyhub-next/audio/dist/voice.js +2 -0
  126. package/node_modules/@allyhub-next/audio/package.json +17 -0
  127. package/node_modules/@allyhub-next/formats/LICENSE +241 -0
  128. package/node_modules/@allyhub-next/formats/dist/data/comments.d.ts +94 -0
  129. package/node_modules/@allyhub-next/formats/dist/data/comments.js +2 -0
  130. package/node_modules/@allyhub-next/formats/dist/data/config.d.ts +10 -0
  131. package/node_modules/@allyhub-next/formats/dist/data/config.js +2 -0
  132. package/node_modules/@allyhub-next/formats/dist/data/edits.d.ts +28 -0
  133. package/node_modules/@allyhub-next/formats/dist/data/edits.js +2 -0
  134. package/node_modules/@allyhub-next/formats/dist/data/elements.d.ts +6 -0
  135. package/node_modules/@allyhub-next/formats/dist/data/elements.js +2 -0
  136. package/node_modules/@allyhub-next/formats/dist/data/faces.d.ts +38 -0
  137. package/node_modules/@allyhub-next/formats/dist/data/faces.js +2 -0
  138. package/node_modules/@allyhub-next/formats/dist/data/file.d.ts +11 -0
  139. package/node_modules/@allyhub-next/formats/dist/data/file.js +2 -0
  140. package/node_modules/@allyhub-next/formats/dist/data/gen.d.ts +31 -0
  141. package/node_modules/@allyhub-next/formats/dist/data/gen.js +2 -0
  142. package/node_modules/@allyhub-next/formats/dist/data/messages.d.ts +34 -0
  143. package/node_modules/@allyhub-next/formats/dist/data/messages.js +2 -0
  144. package/node_modules/@allyhub-next/formats/dist/data/reference.d.ts +676 -0
  145. package/node_modules/@allyhub-next/formats/dist/data/reference.js +2 -0
  146. package/node_modules/@allyhub-next/formats/dist/data/script.d.ts +37 -0
  147. package/node_modules/@allyhub-next/formats/dist/data/script.js +2 -0
  148. package/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +214 -0
  149. package/node_modules/@allyhub-next/formats/dist/data/sheet.js +2 -0
  150. package/node_modules/@allyhub-next/formats/dist/data/words.d.ts +25 -0
  151. package/node_modules/@allyhub-next/formats/dist/data/words.js +2 -0
  152. package/node_modules/@allyhub-next/formats/dist/index.d.ts +16 -0
  153. package/node_modules/@allyhub-next/formats/dist/index.js +2 -0
  154. package/node_modules/@allyhub-next/formats/dist/items.d.ts +94 -0
  155. package/node_modules/@allyhub-next/formats/dist/items.js +2 -0
  156. package/node_modules/@allyhub-next/formats/dist/layout.d.ts +50 -0
  157. package/node_modules/@allyhub-next/formats/dist/layout.js +5 -0
  158. package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +301 -0
  159. package/node_modules/@allyhub-next/formats/dist/schemas.js +2 -0
  160. package/node_modules/@allyhub-next/formats/package.json +14 -0
  161. package/node_modules/@allyhub-next/protocol/LICENSE +241 -0
  162. package/node_modules/@allyhub-next/protocol/dist/app.d.ts +98 -0
  163. package/node_modules/@allyhub-next/protocol/dist/app.js +2 -0
  164. package/node_modules/@allyhub-next/protocol/dist/auth.d.ts +116 -0
  165. package/node_modules/@allyhub-next/protocol/dist/auth.js +2 -0
  166. package/node_modules/@allyhub-next/protocol/dist/cli.d.ts +59 -0
  167. package/node_modules/@allyhub-next/protocol/dist/cli.js +2 -0
  168. package/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +274 -0
  169. package/node_modules/@allyhub-next/protocol/dist/cloud.js +2 -0
  170. package/node_modules/@allyhub-next/protocol/dist/editor.d.ts +405 -0
  171. package/node_modules/@allyhub-next/protocol/dist/editor.js +2 -0
  172. package/node_modules/@allyhub-next/protocol/dist/files.d.ts +101 -0
  173. package/node_modules/@allyhub-next/protocol/dist/files.js +2 -0
  174. package/node_modules/@allyhub-next/protocol/dist/index.d.ts +12 -0
  175. package/node_modules/@allyhub-next/protocol/dist/index.js +2 -0
  176. package/node_modules/@allyhub-next/protocol/dist/jsonrpc.d.ts +83 -0
  177. package/node_modules/@allyhub-next/protocol/dist/jsonrpc.js +2 -0
  178. package/node_modules/@allyhub-next/protocol/dist/registry.d.ts +53 -0
  179. package/node_modules/@allyhub-next/protocol/dist/registry.js +2 -0
  180. package/node_modules/@allyhub-next/protocol/dist/runtimes.d.ts +93 -0
  181. package/node_modules/@allyhub-next/protocol/dist/runtimes.js +2 -0
  182. package/node_modules/@allyhub-next/protocol/dist/teams.d.ts +67 -0
  183. package/node_modules/@allyhub-next/protocol/dist/teams.js +2 -0
  184. package/node_modules/@allyhub-next/protocol/dist/tools.d.ts +345 -0
  185. package/node_modules/@allyhub-next/protocol/dist/tools.js +2 -0
  186. package/node_modules/@allyhub-next/protocol/package.json +13 -0
  187. package/node_modules/@allyhub-next/runtimes/LICENSE +241 -0
  188. package/node_modules/@allyhub-next/runtimes/dist/bundled.d.ts +10 -0
  189. package/node_modules/@allyhub-next/runtimes/dist/bundled.js +2 -0
  190. package/node_modules/@allyhub-next/runtimes/dist/download.d.ts +15 -0
  191. package/node_modules/@allyhub-next/runtimes/dist/download.js +2 -0
  192. package/node_modules/@allyhub-next/runtimes/dist/errors.d.ts +16 -0
  193. package/node_modules/@allyhub-next/runtimes/dist/errors.js +2 -0
  194. package/node_modules/@allyhub-next/runtimes/dist/home.d.ts +2 -0
  195. package/node_modules/@allyhub-next/runtimes/dist/home.js +2 -0
  196. package/node_modules/@allyhub-next/runtimes/dist/index.d.ts +9 -0
  197. package/node_modules/@allyhub-next/runtimes/dist/index.js +2 -0
  198. package/node_modules/@allyhub-next/runtimes/dist/lock.d.ts +6 -0
  199. package/node_modules/@allyhub-next/runtimes/dist/lock.js +2 -0
  200. package/node_modules/@allyhub-next/runtimes/dist/manifest.d.ts +3 -0
  201. package/node_modules/@allyhub-next/runtimes/dist/manifest.js +2 -0
  202. package/node_modules/@allyhub-next/runtimes/dist/runtimes.d.ts +63 -0
  203. package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +3 -0
  204. package/node_modules/@allyhub-next/runtimes/dist/unpack.d.ts +7 -0
  205. package/node_modules/@allyhub-next/runtimes/dist/unpack.js +2 -0
  206. package/node_modules/@allyhub-next/runtimes/manifest.json +395 -0
  207. package/node_modules/@allyhub-next/runtimes/package.json +14 -0
  208. package/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +153 -0
  209. package/node_modules/@allyhub-next/scenery/LICENSE +241 -0
  210. package/node_modules/@allyhub-next/scenery/NOTICE +42 -0
  211. package/node_modules/@allyhub-next/scenery/dist/aim.d.ts +55 -0
  212. package/node_modules/@allyhub-next/scenery/dist/aim.js +2 -0
  213. package/node_modules/@allyhub-next/scenery/dist/bake.d.ts +203 -0
  214. package/node_modules/@allyhub-next/scenery/dist/bake.js +2 -0
  215. package/node_modules/@allyhub-next/scenery/dist/camera.d.ts +150 -0
  216. package/node_modules/@allyhub-next/scenery/dist/camera.js +2 -0
  217. package/node_modules/@allyhub-next/scenery/dist/curve.d.ts +40 -0
  218. package/node_modules/@allyhub-next/scenery/dist/curve.js +2 -0
  219. package/node_modules/@allyhub-next/scenery/dist/define.d.ts +164 -0
  220. package/node_modules/@allyhub-next/scenery/dist/define.js +2 -0
  221. package/node_modules/@allyhub-next/scenery/dist/fit.d.ts +64 -0
  222. package/node_modules/@allyhub-next/scenery/dist/fit.js +2 -0
  223. package/node_modules/@allyhub-next/scenery/dist/glass.d.ts +34 -0
  224. package/node_modules/@allyhub-next/scenery/dist/glass.js +2 -0
  225. package/node_modules/@allyhub-next/scenery/dist/handheld.d.ts +184 -0
  226. package/node_modules/@allyhub-next/scenery/dist/handheld.js +2 -0
  227. package/node_modules/@allyhub-next/scenery/dist/hull.d.ts +23 -0
  228. package/node_modules/@allyhub-next/scenery/dist/hull.js +2 -0
  229. package/node_modules/@allyhub-next/scenery/dist/index.d.ts +22 -0
  230. package/node_modules/@allyhub-next/scenery/dist/index.js +2 -0
  231. package/node_modules/@allyhub-next/scenery/dist/lens.d.ts +48 -0
  232. package/node_modules/@allyhub-next/scenery/dist/lens.js +2 -0
  233. package/node_modules/@allyhub-next/scenery/dist/moire.d.ts +136 -0
  234. package/node_modules/@allyhub-next/scenery/dist/moire.js +93 -0
  235. package/node_modules/@allyhub-next/scenery/dist/motion.d.ts +48 -0
  236. package/node_modules/@allyhub-next/scenery/dist/motion.js +2 -0
  237. package/node_modules/@allyhub-next/scenery/dist/move.d.ts +260 -0
  238. package/node_modules/@allyhub-next/scenery/dist/move.js +2 -0
  239. package/node_modules/@allyhub-next/scenery/dist/noise.d.ts +41 -0
  240. package/node_modules/@allyhub-next/scenery/dist/noise.js +2 -0
  241. package/node_modules/@allyhub-next/scenery/dist/phone.d.ts +34 -0
  242. package/node_modules/@allyhub-next/scenery/dist/phone.js +2 -0
  243. package/node_modules/@allyhub-next/scenery/dist/report.d.ts +677 -0
  244. package/node_modules/@allyhub-next/scenery/dist/report.js +2 -0
  245. package/node_modules/@allyhub-next/scenery/dist/screen-focus.d.ts +55 -0
  246. package/node_modules/@allyhub-next/scenery/dist/screen-focus.js +2 -0
  247. package/node_modules/@allyhub-next/scenery/dist/screen.d.ts +71 -0
  248. package/node_modules/@allyhub-next/scenery/dist/screen.js +2 -0
  249. package/node_modules/@allyhub-next/scenery/dist/solve.d.ts +82 -0
  250. package/node_modules/@allyhub-next/scenery/dist/solve.js +2 -0
  251. package/node_modules/@allyhub-next/scenery/dist/timing.d.ts +26 -0
  252. package/node_modules/@allyhub-next/scenery/dist/timing.js +2 -0
  253. package/node_modules/@allyhub-next/scenery/dist/vec.d.ts +19 -0
  254. package/node_modules/@allyhub-next/scenery/dist/vec.js +2 -0
  255. package/node_modules/@allyhub-next/scenery/package.json +13 -0
  256. package/node_modules/@allyhub-next/video-core/LICENSE +241 -0
  257. package/node_modules/@allyhub-next/video-core/dist/anchors.d.ts +164 -0
  258. package/node_modules/@allyhub-next/video-core/dist/anchors.js +2 -0
  259. package/node_modules/@allyhub-next/video-core/dist/audio-types.d.ts +148 -0
  260. package/node_modules/@allyhub-next/video-core/dist/audio-types.js +2 -0
  261. package/node_modules/@allyhub-next/video-core/dist/backdrop.d.ts +87 -0
  262. package/node_modules/@allyhub-next/video-core/dist/backdrop.js +2 -0
  263. package/node_modules/@allyhub-next/video-core/dist/captions.d.ts +122 -0
  264. package/node_modules/@allyhub-next/video-core/dist/captions.js +11 -0
  265. package/node_modules/@allyhub-next/video-core/dist/console.d.ts +91 -0
  266. package/node_modules/@allyhub-next/video-core/dist/console.js +2 -0
  267. package/node_modules/@allyhub-next/video-core/dist/contrast.d.ts +98 -0
  268. package/node_modules/@allyhub-next/video-core/dist/contrast.js +2 -0
  269. package/node_modules/@allyhub-next/video-core/dist/cut-report.d.ts +77 -0
  270. package/node_modules/@allyhub-next/video-core/dist/cut-report.js +2 -0
  271. package/node_modules/@allyhub-next/video-core/dist/edit.d.ts +77 -0
  272. package/node_modules/@allyhub-next/video-core/dist/edit.js +13 -0
  273. package/node_modules/@allyhub-next/video-core/dist/edits.d.ts +163 -0
  274. package/node_modules/@allyhub-next/video-core/dist/edits.js +2 -0
  275. package/node_modules/@allyhub-next/video-core/dist/export.d.ts +96 -0
  276. package/node_modules/@allyhub-next/video-core/dist/export.js +2 -0
  277. package/node_modules/@allyhub-next/video-core/dist/fact.d.ts +965 -0
  278. package/node_modules/@allyhub-next/video-core/dist/fact.js +2 -0
  279. package/node_modules/@allyhub-next/video-core/dist/footage-motion.d.ts +168 -0
  280. package/node_modules/@allyhub-next/video-core/dist/footage-motion.js +2 -0
  281. package/node_modules/@allyhub-next/video-core/dist/formats.d.ts +240 -0
  282. package/node_modules/@allyhub-next/video-core/dist/formats.js +2 -0
  283. package/node_modules/@allyhub-next/video-core/dist/gen.d.ts +37 -0
  284. package/node_modules/@allyhub-next/video-core/dist/gen.js +2 -0
  285. package/node_modules/@allyhub-next/video-core/dist/index.d.ts +40 -0
  286. package/node_modules/@allyhub-next/video-core/dist/index.js +2 -0
  287. package/node_modules/@allyhub-next/video-core/dist/look.d.ts +66 -0
  288. package/node_modules/@allyhub-next/video-core/dist/look.js +2 -0
  289. package/node_modules/@allyhub-next/video-core/dist/marks.d.ts +34 -0
  290. package/node_modules/@allyhub-next/video-core/dist/marks.js +2 -0
  291. package/node_modules/@allyhub-next/video-core/dist/matrix.d.ts +289 -0
  292. package/node_modules/@allyhub-next/video-core/dist/matrix.js +2 -0
  293. package/node_modules/@allyhub-next/video-core/dist/measure.d.ts +465 -0
  294. package/node_modules/@allyhub-next/video-core/dist/measure.js +5 -0
  295. package/node_modules/@allyhub-next/video-core/dist/media.d.ts +226 -0
  296. package/node_modules/@allyhub-next/video-core/dist/media.js +2 -0
  297. package/node_modules/@allyhub-next/video-core/dist/messages.d.ts +88 -0
  298. package/node_modules/@allyhub-next/video-core/dist/messages.js +2 -0
  299. package/node_modules/@allyhub-next/video-core/dist/motion.d.ts +56 -0
  300. package/node_modules/@allyhub-next/video-core/dist/motion.js +2 -0
  301. package/node_modules/@allyhub-next/video-core/dist/music.d.ts +110 -0
  302. package/node_modules/@allyhub-next/video-core/dist/music.js +2 -0
  303. package/node_modules/@allyhub-next/video-core/dist/piece.d.ts +1146 -0
  304. package/node_modules/@allyhub-next/video-core/dist/piece.js +2 -0
  305. package/node_modules/@allyhub-next/video-core/dist/placement.d.ts +37 -0
  306. package/node_modules/@allyhub-next/video-core/dist/placement.js +2 -0
  307. package/node_modules/@allyhub-next/video-core/dist/problem.d.ts +262 -0
  308. package/node_modules/@allyhub-next/video-core/dist/problem.js +2 -0
  309. package/node_modules/@allyhub-next/video-core/dist/render-types.d.ts +49 -0
  310. package/node_modules/@allyhub-next/video-core/dist/render-types.js +2 -0
  311. package/node_modules/@allyhub-next/video-core/dist/schema.d.ts +352 -0
  312. package/node_modules/@allyhub-next/video-core/dist/schema.js +2 -0
  313. package/node_modules/@allyhub-next/video-core/dist/script-edit.d.ts +176 -0
  314. package/node_modules/@allyhub-next/video-core/dist/script-edit.js +2 -0
  315. package/node_modules/@allyhub-next/video-core/dist/script.d.ts +67 -0
  316. package/node_modules/@allyhub-next/video-core/dist/script.js +2 -0
  317. package/node_modules/@allyhub-next/video-core/dist/seams.d.ts +214 -0
  318. package/node_modules/@allyhub-next/video-core/dist/seams.js +2 -0
  319. package/node_modules/@allyhub-next/video-core/dist/slides.d.ts +37 -0
  320. package/node_modules/@allyhub-next/video-core/dist/slides.js +2 -0
  321. package/node_modules/@allyhub-next/video-core/dist/sound-under.d.ts +72 -0
  322. package/node_modules/@allyhub-next/video-core/dist/sound-under.js +2 -0
  323. package/node_modules/@allyhub-next/video-core/dist/speech.d.ts +83 -0
  324. package/node_modules/@allyhub-next/video-core/dist/speech.js +5 -0
  325. package/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +616 -0
  326. package/node_modules/@allyhub-next/video-core/dist/timeline.js +2 -0
  327. package/node_modules/@allyhub-next/video-core/dist/timing.d.ts +88 -0
  328. package/node_modules/@allyhub-next/video-core/dist/timing.js +2 -0
  329. package/node_modules/@allyhub-next/video-core/dist/transcript.d.ts +288 -0
  330. package/node_modules/@allyhub-next/video-core/dist/transcript.js +2 -0
  331. package/node_modules/@allyhub-next/video-core/dist/transition.d.ts +289 -0
  332. package/node_modules/@allyhub-next/video-core/dist/transition.js +2 -0
  333. package/node_modules/@allyhub-next/video-core/dist/voice.d.ts +175 -0
  334. package/node_modules/@allyhub-next/video-core/dist/voice.js +2 -0
  335. package/node_modules/@allyhub-next/video-core/dist/words.d.ts +128 -0
  336. package/node_modules/@allyhub-next/video-core/dist/words.js +2 -0
  337. package/node_modules/@allyhub-next/video-core/package.json +14 -0
  338. package/package.json +52 -41
  339. package/README.md +0 -17
  340. package/dist/anim.d.ts.map +0 -1
  341. package/dist/anim.js.map +0 -1
  342. package/dist/define.d.ts.map +0 -1
  343. package/dist/define.js.map +0 -1
  344. package/dist/dom.d.ts.map +0 -1
  345. package/dist/dom.js.map +0 -1
  346. package/dist/fit.d.ts.map +0 -1
  347. package/dist/fit.js.map +0 -1
  348. package/dist/index.d.ts.map +0 -1
  349. package/dist/index.js.map +0 -1
  350. package/dist/media.d.ts.map +0 -1
  351. package/dist/media.js.map +0 -1
  352. package/dist/messages.d.ts.map +0 -1
  353. package/dist/messages.js.map +0 -1
  354. package/dist/noise.d.ts.map +0 -1
  355. package/dist/noise.js.map +0 -1
  356. package/dist/parts.d.ts.map +0 -1
  357. package/dist/parts.js.map +0 -1
  358. package/dist/paths.d.ts.map +0 -1
  359. package/dist/paths.js.map +0 -1
  360. package/dist/piece.d.ts.map +0 -1
  361. package/dist/piece.js.map +0 -1
  362. package/dist/props.d.ts.map +0 -1
  363. package/dist/props.js.map +0 -1
  364. package/dist/text.d.ts.map +0 -1
  365. package/dist/text.js.map +0 -1
@@ -0,0 +1,184 @@
1
+ import { type CameraState } from "./camera.js";
2
+ import { type Move, type MoveTime } from "./move.js";
3
+ /** A turn about the camera's own axes, degrees: yaw (positive turns left), pitch (up) and roll (counterclockwise). */
4
+ export type Turn = readonly [yaw: number, pitch: number, roll?: number];
5
+ /** A move along the camera's own axes, m: right, up and forward. */
6
+ export type Shift = readonly [right: number, up: number, forward?: number];
7
+ /** A reframe: the hand going to another framing. */
8
+ export interface Reframe {
9
+ /** When it starts: seconds of scenery time or a word or anchor reference. */
10
+ at: MoveTime;
11
+ /** The framing it goes to (a camera, or a move), held until the shot ends. */
12
+ to?: CameraState | Move;
13
+ /** Or a turn of the camera about its own axes from where it is. */
14
+ turn?: Turn;
15
+ /** And a move along them. */
16
+ shift?: Shift;
17
+ /** Seconds it takes; default `reframe.duration`. */
18
+ duration?: number;
19
+ /** How far past the framing it goes before it comes back, a share of the move; default `reframe.overshoot`. */
20
+ overshoot?: number;
21
+ }
22
+ /** A jolt: the hand knocked, the view thrown and ringing back. */
23
+ export interface Jolt {
24
+ at: MoveTime;
25
+ /** How far it throws the view at most; default `jolt.turn`. */
26
+ turn?: Turn;
27
+ }
28
+ export interface AutofocusOptions {
29
+ /** Where it rests, a share of the distance to what it focuses on (negative: in front of it). */
30
+ miss?: number;
31
+ /** How far it hunts after a cut, at most, as a share of the distance. */
32
+ hunt?: number;
33
+ /** Its swings a second as it hunts, and the seconds they take to die away. */
34
+ rate?: number;
35
+ decay?: number;
36
+ /** The share of `hunt` a cut, a reframe and a jolt each set off. */
37
+ after?: {
38
+ cut?: number;
39
+ reframe?: number;
40
+ jolt?: number;
41
+ };
42
+ }
43
+ export interface AutoExposureOptions {
44
+ /** Seconds before it follows a reframe to a framing of another ev, and the seconds it takes to get there (with no overshoot). */
45
+ delay?: number;
46
+ settle?: number;
47
+ /** Stops it is off at a cut, at most (from half that, either way), settling over `settle`. */
48
+ cut?: number;
49
+ /** Its breathing as it meters: the standard deviation in stops, and the seconds of its slow swing. */
50
+ breathe?: number;
51
+ period?: number;
52
+ }
53
+ export interface HandheldOptions {
54
+ /** How far the hand sways the camera's view: each of yaw and pitch's standard deviation, degrees. */
55
+ angle?: number;
56
+ /** Roll's standard deviation over the angle's (the sway's, the drift's and the tremor's). */
57
+ roll?: number;
58
+ /** How far the hand moves the camera: each axis's standard deviation, m. */
59
+ shift?: number;
60
+ /** How fast it sways: the middle of its spectrum, Hz (from a third of it to three times it, falling as 1/f²). */
61
+ sway?: number;
62
+ /**
63
+ * The tremor over the sway: yaw and pitch's standard deviation,
64
+ * degrees; the middle of its band and how far it spreads, Hz; how much
65
+ * its middle differs from shot to shot (a share); how much its strength
66
+ * swells and fades (0: steady), over about `period` seconds.
67
+ */
68
+ tremor?: {
69
+ angle?: number;
70
+ frequency?: number;
71
+ spread?: number;
72
+ vary?: number;
73
+ swell?: number;
74
+ period?: number;
75
+ };
76
+ /** The framing's slow drift: yaw and pitch's standard deviation, degrees; each axis's, m; the seconds of its swing. */
77
+ drift?: {
78
+ angle?: number;
79
+ shift?: number;
80
+ period?: number;
81
+ };
82
+ /**
83
+ * A phone's stabiliser: the share of the turning it takes out, from
84
+ * none at 0 Hz to `strength` well above `cutoff` Hz (the sway's slow
85
+ * part passes, the tremor and a jolt's ringing mostly go). Absent: none;
86
+ * `{}` takes STABILIZER_DEFAULTS.
87
+ */
88
+ stabilizer?: {
89
+ strength?: number;
90
+ cutoff?: number;
91
+ };
92
+ /** Reframes the hand makes, each in the shot it starts in. */
93
+ reframes?: readonly Reframe[];
94
+ /** How a reframe moves when it does not say: its seconds, its overshoot, when its speed peaks (a share of the move), how far its path bows (a share), and how much a seed changes each from reframe to reframe. */
95
+ reframe?: {
96
+ duration?: number;
97
+ overshoot?: number;
98
+ peak?: number;
99
+ bow?: number;
100
+ vary?: number;
101
+ };
102
+ /** Jolts, each in the shot it is in. */
103
+ jolts?: readonly Jolt[];
104
+ /** How a jolt throws the view when it does not say, how fast it rings (Hz) and how soon it is gone (s), and how much a seed changes each. */
105
+ jolt?: {
106
+ turn?: Turn;
107
+ ring?: number;
108
+ decay?: number;
109
+ vary?: number;
110
+ };
111
+ /** The autofocus hunting, when the camera has an aperture: absent, none; `{}` takes AUTOFOCUS_DEFAULTS. */
112
+ autofocus?: AutofocusOptions;
113
+ /** The auto-exposure, when the camera has an ev: absent, none; `{}` takes AUTO_EXPOSURE_DEFAULTS. */
114
+ exposure?: AutoExposureOptions;
115
+ /** Another seed is another hand. */
116
+ seed?: number;
117
+ }
118
+ export declare const HANDHELD_DEFAULTS: {
119
+ angle: number;
120
+ roll: number;
121
+ shift: number;
122
+ sway: number;
123
+ tremor: {
124
+ angle: number;
125
+ frequency: number;
126
+ spread: number;
127
+ vary: number;
128
+ swell: number;
129
+ period: number;
130
+ };
131
+ drift: {
132
+ angle: number;
133
+ shift: number;
134
+ period: number;
135
+ };
136
+ reframe: {
137
+ duration: number;
138
+ overshoot: number;
139
+ peak: number;
140
+ bow: number;
141
+ vary: number;
142
+ };
143
+ jolt: {
144
+ turn: Turn;
145
+ ring: number;
146
+ decay: number;
147
+ vary: number;
148
+ };
149
+ seed: number;
150
+ };
151
+ export declare const STABILIZER_DEFAULTS: {
152
+ strength: number;
153
+ cutoff: number;
154
+ };
155
+ export declare const AUTOFOCUS_DEFAULTS: {
156
+ miss: number;
157
+ hunt: number;
158
+ rate: number;
159
+ decay: number;
160
+ after: {
161
+ cut: number;
162
+ reframe: number;
163
+ jolt: number;
164
+ };
165
+ };
166
+ export declare const AUTO_EXPOSURE_DEFAULTS: {
167
+ delay: number;
168
+ settle: number;
169
+ cut: number;
170
+ breathe: number;
171
+ period: number;
172
+ };
173
+ /** Why handheld's options cannot be used, or undefined. */
174
+ export declare function handheldProblem(o: HandheldOptions): string | undefined;
175
+ /**
176
+ * A camera, or a move, held in a hand: each moment's camera turned and
177
+ * moved about its own axes by the hand, reframed and jolted where asked,
178
+ * its focus hunting and its exposure following where asked. Its lens,
179
+ * aperture and focus are kept, and the cuts of a camera made by shots()
180
+ * (each shot a new hand); a camera aimed at a target is given as the
181
+ * direction it looked.
182
+ */
183
+ export declare function handheld(camera: CameraState | Move, opts?: HandheldOptions): Move;
184
+ //# sourceMappingURL=handheld.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{aimAt as Fe,aimShape as $e}from"./aim.js";import{CAMERA_DEFAULTS as ke,resolveCamera as X}from"./camera.js";import{cutsOf as Ue,mixCameras as De,momentOf as re,stateOf as ne,withCuts as Ie}from"./move.js";import{bandNoise as Y,hash3 as Le,powerNoise as Te,swellOf as Ne,unit3 as _e}from"./noise.js";import{add as Z,cross as J,DEG as C,dot as I,normalize as oe,rotate as Q,scale as N,sub as Pe}from"./vec.js";export const HANDHELD_DEFAULTS={angle:.25,roll:.5,shift:.003,sway:.7,tremor:{angle:.02,frequency:9,spread:1.5,vary:.12,swell:.3,period:3},drift:{angle:.15,shift:.002,period:8},reframe:{duration:.5,overshoot:.1,peak:.36,bow:.1,vary:.5},jolt:{turn:[.15,-.35,.1],ring:5,decay:.09,vary:.3},seed:1};const Ce=2;export const STABILIZER_DEFAULTS={strength:.8,cutoff:1.5},AUTOFOCUS_DEFAULTS={miss:-.02,hunt:.12,rate:2.3,decay:.3,after:{cut:1,reframe:.7,jolt:.3}},AUTO_EXPOSURE_DEFAULTS={delay:.15,settle:.7,cut:.25,breathe:.03,period:3};export function handheldProblem(t){const o=[["angle",t.angle],["roll",t.roll],["shift",t.shift],["sway",t.sway],["tremor.angle",t.tremor?.angle],["tremor.frequency",t.tremor?.frequency],["tremor.spread",t.tremor?.spread],["tremor.vary",t.tremor?.vary],["tremor.swell",t.tremor?.swell],["drift.angle",t.drift?.angle],["drift.shift",t.drift?.shift],["stabilizer.strength",t.stabilizer?.strength],["stabilizer.cutoff",t.stabilizer?.cutoff],["reframe.bow",t.reframe?.bow],["reframe.vary",t.reframe?.vary],["jolt.vary",t.jolt?.vary],["autofocus.hunt",t.autofocus?.hunt],["autofocus.rate",t.autofocus?.rate],["exposure.cut",t.exposure?.cut],["exposure.breathe",t.exposure?.breathe],["exposure.delay",t.exposure?.delay]];for(const[i,e]of o)if(e!==void 0&&!(Number.isFinite(e)&&e>=0))return`handheld()'s ${i} is a number from 0, not ${String(e)}`;const y=[["tremor.period",t.tremor?.period],["drift.period",t.drift?.period],["reframe.duration",t.reframe?.duration],["jolt.ring",t.jolt?.ring],["jolt.decay",t.jolt?.decay],["autofocus.decay",t.autofocus?.decay],["exposure.settle",t.exposure?.settle],["exposure.period",t.exposure?.period],...(t.reframes??[]).map((i,e)=>[`reframes[${String(e)}].duration`,i.duration])];for(const[i,e]of y)if(e!==void 0&&!(Number.isFinite(e)&&e>0))return`handheld()'s ${i} is a number above 0, not ${String(e)}`;if(t.stabilizer?.strength!==void 0&&t.stabilizer.strength>1)return`handheld()'s stabilizer.strength is a share from 0 to 1, not ${String(t.stabilizer.strength)}`;for(const[i,e]of(t.reframes??[]).entries()){if(e.to===void 0&&e.turn===void 0&&e.shift===void 0)return`handheld()'s reframes[${String(i)}] has nowhere to go: give it a framing (to), a turn or a shift`;if(e.overshoot!==void 0&&!(Number.isFinite(e.overshoot)&&e.overshoot>=-.5&&e.overshoot<=1))return`handheld()'s reframes[${String(i)}].overshoot is a share from -0.5 to 1, not ${String(e.overshoot)}`}if(t.seed!==void 0&&!Number.isInteger(t.seed))return`handheld()'s seed is a whole number, not ${String(t.seed)}`}const qe=t=>{const o=Math.min(1,Math.max(0,t));return o*o*(3-2*o)},$=(t,o,y)=>2*_e(t,o,y)-1;function Re(t,o,y){if(t<=0)return 0;const i=2*Math.PI*o,e=Math.atan(i*y)/i,D=Math.exp(-e/y)*Math.sin(i*e);return Math.exp(-t/y)*Math.sin(i*t)/D}export function handheld(t,o={}){const y=handheldProblem(o);if(y)throw new Error(y);const i=HANDHELD_DEFAULTS,e={angle:o.angle??i.angle,roll:o.roll??i.roll,shift:o.shift??i.shift,sway:o.sway??i.sway,tremor:{...i.tremor,...o.tremor},drift:{...i.drift,...o.drift},reframe:{...i.reframe,...o.reframe},jolt:{...i.jolt,...o.jolt},seed:o.seed??i.seed},D=o.stabilizer?{...STABILIZER_DEFAULTS,...o.stabilizer}:void 0,M=o.autofocus?{...AUTOFOCUS_DEFAULTS,...o.autofocus,after:{...AUTOFOCUS_DEFAULTS.after,...o.autofocus.after}}:void 0,x=o.exposure?{...AUTO_EXPOSURE_DEFAULTS,...o.exposure}:void 0,_=s=>D?1-D.strength*s*s/(s*s+D.cutoff*D.cutoff):1,j=e.seed*7919,V=new Map,se=s=>{const m=V.get(s);if(m)return m;const l=Le(j,s,1),u={low:e.sway/3,high:e.sway*3,alpha:Ce},O=[0,1,2,3,4,5].map(h=>Te(l,h,u,h<3?_:()=>1)),f=e.tremor.frequency*(1+e.tremor.vary*$(l,7,0)),c=_(f),w=[10,11,12].map(h=>{const g=Y(l,h,{center:f,spread:e.tremor.spread});return F=>c*g(F)}),n={sway:O,tremor:w,swell:Ne(l,13,e.tremor.swell,e.tremor.period),drift:[20,21,22,23,24,25].map(h=>Y(l,h,{center:0,spread:1/e.drift.period})),breathe:x?Y(l,30,{center:0,spread:1/x.period}):()=>0};return V.set(s,n),n},ee=new WeakMap;let q;const ae=s=>{const m=s?.time;if(m){const f=ee.get(m);if(f)return f}else if(q)return q;const l=Ue(t,s),u=f=>l.filter(c=>c<=f).length,O={cuts:l,reframes:(o.reframes??[]).map((f,c)=>{const w=re(s,f.at,"A reframe's at"),n=e.reframe.vary;return{at:w,shot:u(w),spec:f,shape:$e({overshoot:f.overshoot??e.reframe.overshoot,peak:e.reframe.peak,vary:n,seed:j,index:c}),duration:(f.duration??e.reframe.duration)*(1+.25*n*$(j,c,40)),bow:e.reframe.bow*$(j,c,41),index:c}}).sort((f,c)=>f.at-c.at),jolts:(o.jolts??[]).map((f,c)=>{const w=re(s,f.at,"A jolt's at"),n=e.jolt.vary,h=f.turn??e.jolt.turn,g=F=>1+n*$(j,c,50+F);return{at:w,shot:u(w),turn:[h[0]*g(0),h[1]*g(1),(h[2]??0)*g(2)],ring:e.jolt.ring*g(3),decay:e.jolt.decay*g(4),index:c}})};return m?ee.set(m,O):q=O,O};return Ie(t,(s,m)=>{const l=ae(m),u=l.cuts.filter(r=>r<=s).length,O=u>0?l.cuts[u-1]??-1/0:-1/0,f=se(u),c=m?.aspect??1,w=r=>m?.pointOf(r);let n=ne(t,s,m),h=0,g=0,F=0;const S=[0,0,0];for(const r of l.reframes){if(r.shot!==u||s<=r.at)continue;const p=(s-r.at)/r.duration,d=Fe(r.shape,p),z=r.bow*Math.sin(Math.PI*Math.min(1,p));if(r.spec.to){const b=ne(r.spec.to,s,m),a=X(n,c,w),U=X(b,c,w).forward,P=I(U,a.right),B=I(U,a.up),T=I(U,a.forward),G=Math.atan2(-P,T)/C,Ee=Math.atan2(B,Math.hypot(P,T))/C;h+=-Ee*z,g+=G*z;const Oe=x?qe((s-r.at-x.delay)/x.settle):Math.min(1,Math.max(0,d));n=De(n,b,d,m,"A reframe",Oe)}if(r.spec.turn){const[b,a,E=0]=r.spec.turn;h+=b*d-a*z,g+=a*d+b*z,F+=E*d}if(r.spec.shift){const[b,a,E=0]=r.spec.shift;S[0]+=b*d,S[1]+=a*d,S[2]+=E*d}}for(const r of l.jolts){if(r.shot!==u||s<=r.at)continue;const p=Re(s-r.at,r.ring,r.decay)*_(r.ring);h+=r.turn[0]*p,g+=r.turn[1]*p,F+=(r.turn[2]??0)*p}const[ie,fe,de,ue,ce,le]=f.sway.map(r=>r(s)),[he,me,pe]=f.tremor.map(r=>r(s)),[ge,we,ve,ye,be,Me]=f.drift.map(r=>r(s)),xe=f.swell(s),R=e.tremor.angle*xe,H=_(1/e.drift.period);h+=e.angle*(ie??0)+R*(he??0)+e.drift.angle*H*(ge??0),g+=e.angle*(fe??0)+R*(me??0)+e.drift.angle*H*(we??0),F+=e.roll*(e.angle*(de??0)+R*(pe??0)+e.drift.angle*H*(ve??0)),S[0]+=e.shift*(ue??0)+e.drift.shift*(ye??0),S[1]+=e.shift*(ce??0)+e.drift.shift*(be??0),S[2]+=e.shift*(le??0)+e.drift.shift*(Me??0);const A=X(n,c,w);let k=A.forward,L=A.up,K=A.right;const W=(r,p)=>{const d=p*C;k=Q(k,r,d),L=Q(L,r,d),K=Q(K,r,d)};W(K,g),W(L,h),W(N(k,-1),F);const je=Z(Z(Z(A.position,N(A.right,S[0])),N(A.up,S[1])),N(A.forward,S[2])),v={};if(n.lens!==void 0&&(v.lens=n.lens),n.lensFrame!==void 0&&(v.lensFrame=n.lensFrame),n.fov!==void 0&&(v.fov=n.fov),n.near!==void 0&&(v.near=n.near),n.far!==void 0&&(v.far=n.far),n.aperture!==void 0&&(v.aperture=n.aperture),n.ev!==void 0&&(v.ev=n.ev),n.focus!==void 0&&(v.focus=n.focus),M&&n.aperture!==void 0&&n.focus!==void 0){const r=n.focus,p=typeof r=="number"?void 0:typeof r=="string"?m?.pointOf(r):r,d=typeof r=="number"?r:p?I(Pe(p,A.position),A.forward):void 0;if(d!==void 0&&d>0){const z=[...u>0?[{when:O,share:M.after.cut,id:0}]:[],...l.reframes.filter(a=>a.shot===u).map(a=>({when:a.at+a.duration*.5,share:M.after.reframe,id:1+a.index})),...l.jolts.filter(a=>a.shot===u).map(a=>({when:a.at,share:M.after.jolt,id:1e3+a.index}))];let b=M.miss;for(const a of z){const E=s-a.when;if(E<0||E>M.decay*12)continue;const U=a.id*4,P=M.hunt*a.share*(1+.4*$(j,u,60+U)),B=M.rate*(1+.2*$(j,u,61+U)),T=2*Math.PI*B*E,G=$(j,u,62+U)<0?-1:1;b+=G*P*Math.exp(-E/M.decay)*(a.id===0?Math.cos(T):Math.sin(T))}v.focus=d*(1+b)}}if(x&&n.ev!==void 0){let r=n.ev+x.breathe*f.breathe(s);if(u>0){const p=s-O,d=x.settle/4,z=$(j,u,70);r+=x.cut*Math.sign(z)*(.5+.5*Math.abs(z))*(1+p/d)*Math.exp(-p/d)}v.ev=r}const Se=oe(n.up??ke.up),te=J(oe(J(k,Se)),k),Ae=N(k,-1),ze=Math.atan2(I(J(te,L),Ae),I(te,L));return{...v,position:je,direction:k,...n.up?{up:n.up}:{},roll:ze/C}})}
@@ -0,0 +1,23 @@
1
+ /** A point on the floor: x and z, m. */
2
+ export type Floor = readonly [number, number];
3
+ /** The convex hull, counterclockwise from the lowest x (then z), without repeats. */
4
+ export declare function convexHull(points: readonly Floor[]): Floor[];
5
+ /** The smallest rectangle round points on the floor. */
6
+ export interface FloorRect {
7
+ /** Its centre, x and z. */
8
+ center: Floor;
9
+ /** Its longer side, then its shorter, m. */
10
+ length: number;
11
+ width: number;
12
+ /**
13
+ * Degrees about +Y from +X to its longer side, in [0, 180): which way it
14
+ * runs on the floor, as yaw turns (counterclockwise seen from above).
15
+ */
16
+ angle: number;
17
+ /** Its four corners, in order round it. */
18
+ corners: [Floor, Floor, Floor, Floor];
19
+ area: number;
20
+ }
21
+ /** The smallest-area rectangle round points on the floor; undefined for none. */
22
+ export declare function floorRect(points: readonly Floor[]): FloorRect | undefined;
23
+ //# sourceMappingURL=hull.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ const P=(r,c,e)=>(c[0]-r[0])*(e[1]-r[1])-(c[1]-r[1])*(e[0]-r[0]);export function convexHull(r){const c=[...r].sort((t,n)=>t[0]-n[0]||t[1]-n[1]),e=[];for(const t of c){const n=e.at(-1);(n?.[0]!==t[0]||n[1]!==t[1])&&e.push(t)}if(e.length<3)return e;const o=[];for(const t of e){for(;o.length>=2;){const[n,s]=[o[o.length-2],o[o.length-1]];if(n&&s&&P(n,s,t)<=0)o.pop();else break}o.push(t)}const i=[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n){for(;i.length>=2;){const[s,l]=[i[i.length-2],i[i.length-1]];if(s&&l&&P(s,l,n)<=0)i.pop();else break}i.push(n)}}return[...o.slice(0,-1),...i.slice(0,-1)]}export function floorRect(r){const c=convexHull(r),e=c[0];if(!e)return;let o;const i=c.length<2?1:c.length;for(let h=0;h<i;h++){const g=c[h]??e,k=c[(h+1)%c.length]??e;let p=k[0]-g[0],d=k[1]-g[1];const I=Math.hypot(p,d);I===0?(p=1,d=0):(p/=I,d/=I);const b=[p,d],w=[-d,p];let a=[1/0,1/0],f=[-1/0,-1/0];for(const x of c){const v=x[0]*b[0]+x[1]*b[1],H=x[0]*w[0]+x[1]*w[1];a=[Math.min(a[0],v),Math.min(a[1],H)],f=[Math.max(f[0],v),Math.max(f[1],H)]}const q=(f[0]-a[0])*(f[1]-a[1]);(!o||q<o.area-1e-12)&&(o={area:q,ux:b,uz:w,lo:a,hi:f})}if(!o)return;const{ux:t,uz:n,lo:s,hi:l,area:R}=o,u=(h,g)=>[t[0]*h+n[0]*g,t[1]*h+n[1]*g],j=[u(s[0],s[1]),u(l[0],s[1]),u(l[0],l[1]),u(s[0],l[1])],M=l[0]-s[0],m=l[1]-s[1],z=M>=m?t:n;let y=Math.atan2(-z[1],z[0])*180/Math.PI;return y=(y%180+180)%180,{center:u((s[0]+l[0])/2,(s[1]+l[1])/2),length:Math.max(M,m),width:Math.min(M,m),angle:y,corners:j,area:R}}
@@ -0,0 +1,22 @@
1
+ export { blurDiameter, CAMERA_DEFAULTS, CameraError, cameraProblems, directionOf, exposureOf, project, resolveCamera, yawPitchOf, type CameraState, type PointOf, type Projection, type ResolvedCamera, } from "./camera.js";
2
+ export { BAKE_CPU, BAKE_DEFAULTS, BAKE_MIN_SIZE, bakeProblems, bakeRenderer, resolveBake, type BakeOptions, type BakeReport, type ResolvedBake, } from "./bake.js";
3
+ export { Curve, SAME_POINT, type CurvePoint } from "./curve.js";
4
+ export { defineScenery, isScenery, type AssetRef, type Bounds, type Scenery, type SceneryDefinition, type SceneryHost, type SceneryProp, type SceneryRendererOptions, SCENERY_RENDERER_DEFAULTS, } from "./define.js";
5
+ export { FIT_DEFAULTS, fitCamera, type Box, type FitOptions, type Margins, } from "./fit.js";
6
+ export { diagonalLens, fieldOfView, fieldOfViewFromVertical, FULL_FRAME_DIAGONAL, lensForVertical, lensFrameProblem, type FieldOfView, type LensFrame, } from "./lens.js";
7
+ export { blend, cutsOf, focusScreen, keys, mixCameras, momentOf, orbit, path, PATH_DEFAULTS, pathCurve, shots, stateOf, withCuts, NeedsTimeError, type CameraKey, type Cuts, type Shot, type BlendOptions, type FocusScreenOptions, type ScreenFace, type KeysOptions, type LensOptions, type Move, type OrbitOptions, type PathOptions, type MoveTime, type SceneryView, } from "./move.js";
8
+ export { GLASS_DEFAULTS, glassIor, glassProblems, type GlassOptions, } from "./glass.js";
9
+ export { aimAt, aimed, AIM_DEFAULTS, aimProblem, aimShape, rise, type AimOptions, type AimShape, } from "./aim.js";
10
+ export { AUTO_EXPOSURE_DEFAULTS, AUTOFOCUS_DEFAULTS, handheld, HANDHELD_DEFAULTS, handheldProblem, STABILIZER_DEFAULTS, type AutoExposureOptions, type AutofocusOptions, type HandheldOptions, type Jolt, type Reframe, type Shift, type Turn, } from "./handheld.js";
11
+ export { bandNoise, gauss3, hash3, powerNoise, swellOf, unit3, type Band, type Slope, } from "./noise.js";
12
+ export { convexHull, floorRect, type Floor, type FloorRect } from "./hull.js";
13
+ export { solveCamera, SOLVE_DEFAULTS, SOLVE_PARAMS, type SolveLine, type SolveOptions, type SolveParam, type SolvePoint, type SolveResidual, type SolveResult, } from "./solve.js";
14
+ export { invert3, moireAt, moireBand, moireCamera, moireProblems, moireScreen, MOIRE_GLSL, MOIRE_SCREENS, PANEL_DEFAULTS, SENSOR_DEFAULTS, STRIPE_DEPTH, type MoireCamera, type MoireScreen, type PanelOptions, type SensorOptions, } from "./moire.js";
15
+ export { screenFocus, SCREEN_FOCUS_DEFAULTS, type ScreenFocus, type ScreenFocusOptions, } from "./screen-focus.js";
16
+ export { apply, homography, matrix3d, screenOnFrame, shownCentre, SCREEN_LIGHT_DEFAULTS, screenLightBaseProblem, type Px, type ScreenLightBase, type ScreenOnFrame, } from "./screen.js";
17
+ export { AROUND_DEFAULTS, FLOOR_DEFAULTS, INVENTORY_FRAME, MAP_DEFAULTS, MAP_VIEWS, MEASURE_DEFAULTS, MOTION_DEFAULTS, SIDES, type AxisBox, type CameraClearance, type CameraSource, type Channel, type ClearAhead, type Contact, type FreeFloor, type Levels, type MeasureRequest, type MeasureResult, type MeshHealth, type Motion, type MotionRequest, type SeeRequest, type SeeResult, type SeeTile, type Sight, type Support, type DrawnCamera, type Footprint, type MapPath, type MapRequest, type MapResult, type MapView, type MapViewResult, type OwnBox, type PointRef, type PointsRequest, type Seen, type Side, type UprightBox, type ViewRequest, type ViewResult, type ViewTile, type ViewTileResult, type SceneryInventory, type SceneryLight, type SceneryObject, topObjects, } from "./report.js";
18
+ export { channel, motionOf, type CameraSample, type MotionNumbers, } from "./motion.js";
19
+ export { easeValue, timedNumber, type Ease, type NumberKey } from "./timing.js";
20
+ export { PHONE_CAMERA, phoneCamera, type Deeper, type PhoneCamera, } from "./phone.js";
21
+ export type { Vec3 } from "./vec.js";
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ export{blurDiameter,CAMERA_DEFAULTS,CameraError,cameraProblems,directionOf,exposureOf,project,resolveCamera,yawPitchOf}from"./camera.js";export{BAKE_CPU,BAKE_DEFAULTS,BAKE_MIN_SIZE,bakeProblems,bakeRenderer,resolveBake}from"./bake.js";export{Curve,SAME_POINT}from"./curve.js";export{defineScenery,isScenery,SCENERY_RENDERER_DEFAULTS}from"./define.js";export{FIT_DEFAULTS,fitCamera}from"./fit.js";export{diagonalLens,fieldOfView,fieldOfViewFromVertical,FULL_FRAME_DIAGONAL,lensForVertical,lensFrameProblem}from"./lens.js";export{blend,cutsOf,focusScreen,keys,mixCameras,momentOf,orbit,path,PATH_DEFAULTS,pathCurve,shots,stateOf,withCuts,NeedsTimeError}from"./move.js";export{GLASS_DEFAULTS,glassIor,glassProblems}from"./glass.js";export{aimAt,aimed,AIM_DEFAULTS,aimProblem,aimShape,rise}from"./aim.js";export{AUTO_EXPOSURE_DEFAULTS,AUTOFOCUS_DEFAULTS,handheld,HANDHELD_DEFAULTS,handheldProblem,STABILIZER_DEFAULTS}from"./handheld.js";export{bandNoise,gauss3,hash3,powerNoise,swellOf,unit3}from"./noise.js";export{convexHull,floorRect}from"./hull.js";export{solveCamera,SOLVE_DEFAULTS,SOLVE_PARAMS}from"./solve.js";export{invert3,moireAt,moireBand,moireCamera,moireProblems,moireScreen,MOIRE_GLSL,MOIRE_SCREENS,PANEL_DEFAULTS,SENSOR_DEFAULTS,STRIPE_DEPTH}from"./moire.js";export{screenFocus,SCREEN_FOCUS_DEFAULTS}from"./screen-focus.js";export{apply,homography,matrix3d,screenOnFrame,shownCentre,SCREEN_LIGHT_DEFAULTS,screenLightBaseProblem}from"./screen.js";export{AROUND_DEFAULTS,FLOOR_DEFAULTS,INVENTORY_FRAME,MAP_DEFAULTS,MAP_VIEWS,MEASURE_DEFAULTS,MOTION_DEFAULTS,SIDES,topObjects}from"./report.js";export{channel,motionOf}from"./motion.js";export{easeValue,timedNumber}from"./timing.js";export{PHONE_CAMERA,phoneCamera}from"./phone.js";
@@ -0,0 +1,48 @@
1
+ /** The diagonal of a 36 × 24 mm frame, in mm. */
2
+ export declare const FULL_FRAME_DIAGONAL: number;
3
+ /** The long and short sides of a 36 × 24 mm frame, in mm. */
4
+ export declare const FULL_FRAME_LONG = 36;
5
+ export declare const FULL_FRAME_SHORT = 24;
6
+ /**
7
+ * What a lens is measured on:
8
+ * - "diagonal": the output frame's diagonal (the default);
9
+ * - "long", "short": the output frame's long or short side, as 36 or 24 mm;
10
+ * - { aspect, keep }: the diagonal of a frame of that aspect (4/3, a
11
+ * phone's photo), then the output frame cut from it keeping that frame's
12
+ * long or short side (a phone's video keeps the long side);
13
+ * - "phone": { aspect: 4 / 3, keep: "long" }, how a phone's camera app
14
+ * quotes its lenses for video.
15
+ */
16
+ export type LensFrame = "diagonal" | "long" | "short" | "phone" | {
17
+ aspect: number;
18
+ keep: "long" | "short";
19
+ };
20
+ /** "phone" is a phone's 4:3 photo frame, its video keeping the long side. */
21
+ export declare const PHONE_FRAME: {
22
+ readonly aspect: number;
23
+ readonly keep: "long";
24
+ };
25
+ /** The angles a frame sees, in degrees. */
26
+ export interface FieldOfView {
27
+ horizontal: number;
28
+ vertical: number;
29
+ diagonal: number;
30
+ }
31
+ /** Whether a lens frame is one of the five forms, with a usable aspect. */
32
+ export declare function lensFrameProblem(frame: LensFrame): string | undefined;
33
+ /**
34
+ * The angles a lens sees on a frame of `aspect` (width over height).
35
+ * fieldOfView(26, 16 / 9) is 71.9° × 44.4°, 79.5° on the diagonal.
36
+ */
37
+ export declare function fieldOfView(lens: number, aspect: number, frame?: LensFrame): FieldOfView;
38
+ /** The lens that sees `vertical` degrees on a frame of `aspect`: fieldOfView's inverse. */
39
+ export declare function lensForVertical(vertical: number, aspect: number, frame?: LensFrame): number;
40
+ /** The angles a frame of `aspect` sees with a vertical angle of `vertical` degrees. */
41
+ export declare function fieldOfViewFromVertical(vertical: number, aspect: number): FieldOfView;
42
+ /**
43
+ * A lens said in the default convention: the focal length that sees the
44
+ * same diagonal on the output frame. A phone's 26 mm in 16:9 video
45
+ * (`{ aspect: 4/3, keep: "long" }`) is 28.3 mm on the diagonal.
46
+ */
47
+ export declare function diagonalLens(lens: number, aspect: number, frame?: LensFrame): number;
48
+ //# sourceMappingURL=lens.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ export const FULL_FRAME_DIAGONAL=Math.hypot(36,24),FULL_FRAME_LONG=36,FULL_FRAME_SHORT=24,PHONE_FRAME={aspect:4/3,keep:"long"};const g=t=>Math.max(t,1/t);function p(t,n){const e=g(t),o=n==="phone"?PHONE_FRAME:n;if(o==="diagonal"){const r=FULL_FRAME_DIAGONAL/2,u=Math.hypot(1,e);return{long:r*e/u,short:r/u}}if(o==="long"){const r=FULL_FRAME_LONG/2;return{long:r,short:r/e}}if(o==="short"){const r=FULL_FRAME_SHORT/2;return{long:r*e,short:r}}const s=g(o.aspect),a=FULL_FRAME_DIAGONAL/2,i=Math.hypot(1,s);if(o.keep==="long"){const r=a*s/i;return{long:r,short:r/e}}const l=a/i;return{long:l*e,short:l}}const c=t=>2*Math.atan(t)*180/Math.PI,h=t=>Math.tan(t*Math.PI/360);export function lensFrameProblem(t){if(t==="diagonal"||t==="long"||t==="short"||t==="phone")return;if(!(Number.isFinite(t.aspect)&&t.aspect>0))return`lensFrame.aspect must be a positive number, not ${String(t.aspect)}`;const n=t.keep;if(n!=="long"&&n!=="short")return`lensFrame.keep must be "long" or "short", not ${JSON.stringify(n)}`}export function fieldOfView(t,n,e="diagonal"){const o=p(n,e),s=o.long/t,a=o.short/t,i=n>=1;return{horizontal:c(i?s:a),vertical:c(i?a:s),diagonal:c(Math.hypot(s,a))}}export function lensForVertical(t,n,e="diagonal"){const o=p(n,e);return(n>=1?o.short:o.long)/h(t)}export function fieldOfViewFromVertical(t,n){const e=h(t),o=e*n;return{horizontal:c(o),vertical:t,diagonal:c(Math.hypot(o,e))}}export function diagonalLens(t,n,e="diagonal"){const o=fieldOfView(t,n,e).diagonal;return FULL_FRAME_DIAGONAL/2/h(o)}
@@ -0,0 +1,136 @@
1
+ import { type ResolvedCamera } from "./camera.js";
2
+ import { type Px } from "./screen.js";
3
+ import type { Vec3 } from "./vec.js";
4
+ /** A sensor that films the scenery layer (scenery({ sensor })). */
5
+ export interface SensorOptions {
6
+ /** Photosites across the frame's longer side (a 12 MP phone's 4:3 sensor, cropped to 16:9: 4032). */
7
+ photosites?: number;
8
+ /** The lens's own blur, a Gaussian's standard deviation in photosites. */
9
+ lens?: number;
10
+ /** How strong the moiré is, a share of what the model gives (0: none). */
11
+ moire?: number;
12
+ /**
13
+ * How much of the false colour the phone's processing leaves (0: bands of
14
+ * light and dark only; 1: as the Bayer grid made them).
15
+ */
16
+ chroma?: number;
17
+ /**
18
+ * The lens's barrel (negative) or pincushion (positive) distortion before
19
+ * the phone corrects the picture, k1 over the frame's half diagonal: the
20
+ * sensor's grid, as the corrected picture sees it, bends, and so do the
21
+ * bands.
22
+ */
23
+ distortion?: number;
24
+ }
25
+ /** A screen's physical pixels (screen({ pixels })). */
26
+ export interface PanelOptions {
27
+ /** Physical pixels per content pixel each way (a Retina laptop: 2). */
28
+ density?: number;
29
+ /** How much the dark lines between rows of pixels darken them (0–1). */
30
+ rows?: number;
31
+ }
32
+ export declare const SENSOR_DEFAULTS: {
33
+ photosites: number;
34
+ lens: number;
35
+ moire: number;
36
+ chroma: number;
37
+ distortion: number;
38
+ };
39
+ export declare const PANEL_DEFAULTS: {
40
+ density: number;
41
+ rows: number;
42
+ };
43
+ /**
44
+ * The depth a stripe a third of a pixel wide gives its fundamental,
45
+ * against its mean (2 sin(π/3) / (π/3)), half of it left by a phone's
46
+ * demosaicing: with a phone's lens (sharp to about half at the sensor's
47
+ * Nyquist), a screen at the worst distance shows bands of a fifth to a
48
+ * third of its brightness.
49
+ */
50
+ export declare const STRIPE_DEPTH: number;
51
+ /** What the moiré of one screen at one moment is drawn from. */
52
+ export interface MoireScreen {
53
+ /** The homography from the layer's px to the content's px (row-major, 3 × 3). */
54
+ inverse: number[];
55
+ /** The content's size, px. */
56
+ size: [number, number];
57
+ /** Physical pixels per content pixel. */
58
+ density: number;
59
+ /** How much the rows darken. */
60
+ rows: number;
61
+ /** Depth along the view at the content's (0, 0), and its change per content px along x and y, m. */
62
+ depth: [d0: number, dx: number, dy: number];
63
+ }
64
+ /** The camera's part: the sensor and its depth of field. */
65
+ export interface MoireCamera {
66
+ /** Layer px per photosite. */
67
+ pitch: number;
68
+ /** The lens's blur, photosites. */
69
+ lens: number;
70
+ strength: number;
71
+ /** The share of false colour left. */
72
+ chroma: number;
73
+ /** k1, and the frame's centre and half diagonal in layer px. */
74
+ distortion: {
75
+ k1: number;
76
+ centre: Px;
77
+ radius: number;
78
+ };
79
+ /**
80
+ * The circle of confusion's diameter in layer px at a depth d:
81
+ * k · |d − focus| / max(d, near); none without an aperture.
82
+ */
83
+ blur?: {
84
+ k: number;
85
+ focus: number;
86
+ near: number;
87
+ };
88
+ }
89
+ /**
90
+ * The factor per channel (red, green, blue) a layer pixel of a screen is
91
+ * multiplied by; undefined where the pixel is not on the screen.
92
+ */
93
+ export declare function moireAt(screen: MoireScreen, camera: MoireCamera, at: Px): [number, number, number] | undefined;
94
+ /**
95
+ * The deepest band at a layer pixel of a screen, of any channel and of
96
+ * the stripes or the rows: how much it darkens at its darkest (0–1, before
97
+ * the phone takes out its colour) and how far apart its bands are, layer
98
+ * px. Undefined off the screen.
99
+ */
100
+ export declare function moireBand(screen: MoireScreen, camera: MoireCamera, at: Px): {
101
+ depth: number;
102
+ period: number;
103
+ } | undefined;
104
+ /** The most screens one layer's moiré is drawn for. */
105
+ export declare const MOIRE_SCREENS = 4;
106
+ /**
107
+ * The same arithmetic for the page: a fragment shader over the layer that
108
+ * gives, at each pixel, the factors of the nearest screen there (clear
109
+ * elsewhere), to multiply what is under it by.
110
+ */
111
+ export declare const MOIRE_GLSL: string;
112
+ /** A 3 × 3 matrix's inverse (row-major); undefined when it has none. */
113
+ export declare function invert3(m: readonly number[]): number[] | undefined;
114
+ /**
115
+ * One screen's part of the moiré at a moment: its content's corners on the
116
+ * layer (top left, top right, bottom right, bottom left, layer px) and in
117
+ * the scenery, its content's size and its panel.
118
+ */
119
+ export declare function moireScreen(o: {
120
+ quad: readonly [Px, Px, Px, Px];
121
+ corners: readonly [Vec3, Vec3, Vec3, Vec3];
122
+ size: readonly [number, number];
123
+ camera: ResolvedCamera;
124
+ panel?: PanelOptions;
125
+ }): MoireScreen | undefined;
126
+ /**
127
+ * The camera's part: its sensor on a frame `frame` px (the photosites span
128
+ * its longer side) and, with an aperture, its blur on a layer `height` px
129
+ * tall (blurDiameter's frame).
130
+ */
131
+ export declare function moireCamera(camera: ResolvedCamera, frame: readonly [number, number], height: number, sensor?: SensorOptions,
132
+ /** Where the layer's box starts on the frame, px. */
133
+ origin?: Px): MoireCamera;
134
+ /** Problems with a sensor's or a panel's options, each a sentence. */
135
+ export declare function moireProblems(sensor: SensorOptions | undefined, panel: PanelOptions | undefined): string[];
136
+ //# sourceMappingURL=moire.d.ts.map
@@ -0,0 +1,93 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{blurDiameter as z}from"./camera.js";import{homography as C}from"./screen.js";export const SENSOR_DEFAULTS={photosites:4032,lens:.35,moire:1,chroma:.3,distortion:-.03},PANEL_DEFAULTS={density:2,rows:.15},STRIPE_DEPTH=2*Math.sin(Math.PI/3)/(Math.PI/3)/2;const g=2*Math.PI,P=o=>Math.abs(o)<1e-6?1:Math.sin(Math.PI*o)/(Math.PI*o);function R(o,n){if(n===1){const i=Math.round(o[0]+o[1]),t=Math.round(o[0]-o[1]);return[(i+t)/2,(i-t)/2]}return[Math.round(2*o[0])/2,Math.round(2*o[1])/2]}const T={0:[0,0],1:[1,0],2:[1,1]};function D(o,n,i,t,f,s,e){return E(o,n,i,t,f,s,e).factor}function E(o,n,i,t,f,s,e){const r=s.pitch,c=[i[0]*r,i[1]*r],d=F(t,s),h=[d[0]/r,d[1]/r],u=R(c,o),p=T[o],a=[(c[0]-u[0])/r,(c[1]-u[1])/r],m=Math.hypot(a[0],a[1]);if(m>=.5)return{factor:1,depth:0,period:1/0};const w=c[0]*c[0]+c[1]*c[1],S=Math.exp(-2*Math.PI**2*s.lens**2*w),x=e/4,b=Math.exp(-2*Math.PI**2*x**2*(i[0]*i[0]+i[1]*i[1])),y=Math.abs(P(c[0])*P(c[1])),M=Math.abs(P(a[0])*P(a[1]))*(1-2*m),l=Math.min(1,s.strength*f*S*b*y*M),v=n-g*(u[0]*h[0]+u[1]*h[1])+g*(u[0]*p[0]+u[1]*p[1]);return{factor:1-l*(1-Math.cos(v))/2,depth:l,period:m>0?1/m:1/0}}function F(o,n){const{k1:i,centre:t,radius:f}=n.distortion,s=o[0]-t[0],e=o[1]-t[1],r=(s*s+e*e)/(f*f),c=1+i*r;return[t[0]+s*c,t[1]+e*c]}const I=[.299,.587,.114];export function moireAt(o,n,i){const t=o.inverse,[f,s]=i,e=(t[6]??0)*f+(t[7]??0)*s+(t[8]??1);if(e<=0)return;const r=((t[0]??0)*f+(t[1]??0)*s+(t[2]??0))/e,c=((t[3]??0)*f+(t[4]??0)*s+(t[5]??0))/e,[d,h]=o.size;if(r<0||c<0||r>d||c>h)return;const u=[((t[0]??0)-(t[6]??0)*r)/e,((t[1]??0)-(t[7]??0)*r)/e],p=[((t[3]??0)-(t[6]??0)*c)/e,((t[4]??0)-(t[7]??0)*c)/e],a=o.density,[m,w,S]=o.depth,x=m+w*r+S*c,b=n.blur?n.blur.k*Math.abs(x-n.blur.focus)/Math.max(x,n.blur.near):0,y=[a*u[0],a*u[1]],M=[a*p[0],a*p[1]],l=[1,1,1];for(const k of[0,1,2]){const A=D(k,g*(a*r-k/3),y,i,STRIPE_DEPTH,n,b),N=D(k,g*a*c,M,i,o.rows*STRIPE_DEPTH,n,b);l[k]=A*N}const v=I[0]*l[0]+I[1]*l[1]+I[2]*l[2];return[v+n.chroma*(l[0]-v),v+n.chroma*(l[1]-v),v+n.chroma*(l[2]-v)]}export function moireBand(o,n,i){const t=o.inverse,[f,s]=i,e=(t[6]??0)*f+(t[7]??0)*s+(t[8]??1);if(e<=0)return;const r=((t[0]??0)*f+(t[1]??0)*s+(t[2]??0))/e,c=((t[3]??0)*f+(t[4]??0)*s+(t[5]??0))/e,[d,h]=o.size;if(r<0||c<0||r>d||c>h)return;const u=[((t[0]??0)-(t[6]??0)*r)/e,((t[1]??0)-(t[7]??0)*r)/e],p=[((t[3]??0)-(t[6]??0)*c)/e,((t[4]??0)-(t[7]??0)*c)/e],a=o.density,[m,w,S]=o.depth,x=m+w*r+S*c,b=n.blur?n.blur.k*Math.abs(x-n.blur.focus)/Math.max(x,n.blur.near):0;let y={depth:0,period:1/0};for(const M of[0,1,2])for(const l of[E(M,g*(a*r-M/3),[a*u[0],a*u[1]],i,STRIPE_DEPTH,n,b),E(M,g*a*c,[a*p[0],a*p[1]],i,o.rows*STRIPE_DEPTH,n,b)])l.depth>y.depth&&(y={depth:l.depth,period:l.period});return y}export const MOIRE_SCREENS=4,MOIRE_GLSL=`#version 300 es
3
+ precision highp float;
4
+ #define SCREENS ${String(MOIRE_SCREENS)}
5
+ uniform int count;
6
+ uniform mat3 inverse[SCREENS];
7
+ uniform vec2 size[SCREENS];
8
+ uniform vec2 panel[SCREENS];
9
+ uniform vec3 depth[SCREENS];
10
+ uniform vec2 layer;
11
+ uniform float pitch;
12
+ uniform float lensBlur;
13
+ uniform float strength;
14
+ uniform vec3 blur;
15
+ uniform float stripeDepth;
16
+ uniform float chroma;
17
+ uniform vec4 distortion;
18
+ out vec4 colour;
19
+ const float PI = 3.14159265358979;
20
+ const float TAU = 6.28318530717959;
21
+
22
+ float sinc(float x) { return abs(x) < 1e-6 ? 1.0 : sin(PI * x) / (PI * x); }
23
+
24
+ vec2 nearestPoint(vec2 k, int channel) {
25
+ if (channel == 1) {
26
+ float p = floor(k.x + k.y + 0.5);
27
+ float r = floor(k.x - k.y + 0.5);
28
+ return vec2(p + r, p - r) / 2.0;
29
+ }
30
+ return floor(2.0 * k + 0.5) / 2.0;
31
+ }
32
+
33
+ vec2 sensorAt(vec2 at) {
34
+ vec2 d = at - distortion.yz;
35
+ float r2 = dot(d, d) / (distortion.w * distortion.w);
36
+ return distortion.yz + d * (1.0 + distortion.x * r2);
37
+ }
38
+
39
+ float aliased(int channel, float phase, vec2 k, vec2 at, float lines, float blurPx) {
40
+ vec2 ks = k * pitch;
41
+ vec2 s = sensorAt(at) / pitch;
42
+ vec2 g = nearestPoint(ks, channel);
43
+ vec2 o = channel == 0 ? vec2(0.0) : channel == 1 ? vec2(1.0, 0.0) : vec2(1.0);
44
+ vec2 ka = (ks - g) / pitch;
45
+ float fine = length(ka);
46
+ if (fine >= 0.5) return 1.0;
47
+ float lens = exp(-2.0 * PI * PI * lensBlur * lensBlur * dot(ks, ks));
48
+ float sigma = blurPx / 4.0;
49
+ float defocus = exp(-2.0 * PI * PI * sigma * sigma * dot(k, k));
50
+ float site = abs(sinc(ks.x) * sinc(ks.y));
51
+ float outMtf = abs(sinc(ka.x) * sinc(ka.y)) * (1.0 - 2.0 * fine);
52
+ float d = min(1.0, strength * lines * lens * defocus * site * outMtf);
53
+ float psi = phase - TAU * dot(g, s) + TAU * dot(g, o);
54
+ return 1.0 - d * (1.0 - cos(psi)) / 2.0;
55
+ }
56
+
57
+ void main() {
58
+ // Layer px, from the top left, at the pixel's centre.
59
+ vec2 at = vec2(gl_FragCoord.x, layer.y - gl_FragCoord.y);
60
+ vec3 factor = vec3(1.0);
61
+ bool on = false;
62
+ float nearestDepth = 1e9;
63
+ for (int i = 0; i < SCREENS; i++) {
64
+ if (i >= count) break;
65
+ // Sent transposed: m[col][row] is the homography's row, column.
66
+ mat3 m = inverse[i];
67
+ float w = m[0][2] * at.x + m[1][2] * at.y + m[2][2];
68
+ if (w <= 0.0) continue;
69
+ float u = (m[0][0] * at.x + m[1][0] * at.y + m[2][0]) / w;
70
+ float v = (m[0][1] * at.x + m[1][1] * at.y + m[2][1]) / w;
71
+ if (u < 0.0 || v < 0.0 || u > size[i].x || v > size[i].y) continue;
72
+ float d = depth[i].x + depth[i].y * u + depth[i].z * v;
73
+ if (d >= nearestDepth) continue;
74
+ nearestDepth = d;
75
+ vec2 du = vec2(m[0][0] - m[0][2] * u, m[1][0] - m[1][2] * u) / w;
76
+ vec2 dv = vec2(m[0][1] - m[0][2] * v, m[1][1] - m[1][2] * v) / w;
77
+ float D = panel[i].x;
78
+ float blurPx = blur.x > 0.0 ? blur.x * abs(d - blur.y) / max(d, blur.z) : 0.0;
79
+ vec2 ku = D * du;
80
+ vec2 kv = D * dv;
81
+ vec3 f;
82
+ for (int c = 0; c < 3; c++) {
83
+ float stripes = aliased(c, TAU * (D * u - float(c) / 3.0), ku, at, stripeDepth, blurPx);
84
+ float rows = aliased(c, TAU * D * v, kv, at, panel[i].y * stripeDepth, blurPx);
85
+ f[c] = stripes * rows;
86
+ }
87
+ float light = dot(f, vec3(0.299, 0.587, 0.114));
88
+ factor = vec3(light) + chroma * (f - vec3(light));
89
+ on = true;
90
+ }
91
+ // Off every screen: nothing (premultiplied).
92
+ colour = on ? vec4(factor, 1.0) : vec4(0.0);
93
+ }`;export function invert3(o){const[n=0,i=0,t=0,f=0,s=0,e=0,r=0,c=0,d=1]=o,h=s*d-e*c,u=-(f*d-e*r),p=f*c-s*r,a=n*h+i*u+t*p;if(!(Math.abs(a)<1e-18))return[h/a,-(i*d-t*c)/a,(i*e-t*s)/a,u/a,(n*d-t*r)/a,-(n*e-t*f)/a,p/a,-(n*c-i*r)/a,(n*s-i*f)/a]}export function moireScreen(o){const[n,i]=o.size,t=C(n,i,o.quad),f=t?invert3(t):void 0;if(!f)return;const s=o.camera,e=u=>(u[0]-s.position[0])*s.forward[0]+(u[1]-s.position[1])*s.forward[1]+(u[2]-s.position[2])*s.forward[2],[r,c,,d]=o.corners,h=e(r);return{inverse:f,size:[n,i],density:o.panel?.density??PANEL_DEFAULTS.density,rows:o.panel?.rows??PANEL_DEFAULTS.rows,depth:[h,(e(c)-h)/n,(e(d)-h)/i]}}export function moireCamera(o,n,i,t={},f=[0,0]){const s=t.photosites??SENSOR_DEFAULTS.photosites,e={pitch:Math.max(n[0],n[1])/s,lens:t.lens??SENSOR_DEFAULTS.lens,strength:t.moire??SENSOR_DEFAULTS.moire,chroma:t.chroma??SENSOR_DEFAULTS.chroma,distortion:{k1:t.distortion??SENSOR_DEFAULTS.distortion,centre:[n[0]/2-f[0],n[1]/2-f[1]],radius:Math.hypot(n[0],n[1])/2}},r=o.dof;if(r){const c=2*r.focus,d=z(o,c,i)*Math.max(c,o.near)/Math.abs(c-r.focus);e.blur={k:d,focus:r.focus,near:o.near}}return e}export function moireProblems(o,n){const i=[],t=(s,e)=>{s!==void 0&&!(Number.isFinite(s)&&s>0)&&i.push(`${e} is a positive number, not ${String(s)}.`)};t(o?.photosites,"sensor.photosites"),t(o?.lens,"sensor.lens"),t(n?.density,"pixels.density");const f=(s,e,r)=>{s!==void 0&&!(Number.isFinite(s)&&s>=0&&s<=r)&&i.push(`${e} is from 0 to ${String(r)}, not ${String(s)}.`)};return f(o?.moire,"sensor.moire",4),f(o?.chroma,"sensor.chroma",1),o?.distortion!==void 0&&!(Number.isFinite(o.distortion)&&Math.abs(o.distortion)<=.5)&&i.push(`sensor.distortion is from -0.5 to 0.5, not ${String(o.distortion)}.`),f(n?.rows,"pixels.rows",1),i}
@@ -0,0 +1,48 @@
1
+ import type { Channel } from "./report.js";
2
+ import { type Vec3 } from "./vec.js";
3
+ /** A camera at a moment, resolved. */
4
+ export interface CameraSample {
5
+ t: number;
6
+ position: Vec3;
7
+ forward: Vec3;
8
+ up: Vec3;
9
+ right: Vec3;
10
+ /** The lens in the diagonal convention, mm. */
11
+ lens: number;
12
+ yaw: number;
13
+ pitch: number;
14
+ roll: number;
15
+ target?: Vec3;
16
+ }
17
+ export interface MotionNumbers {
18
+ length: number;
19
+ truck: Channel;
20
+ pedestal: Channel;
21
+ dolly: Channel;
22
+ pan: Channel;
23
+ tilt: Channel;
24
+ roll: Channel;
25
+ zoom: Channel;
26
+ arc?: Channel;
27
+ speed: Channel;
28
+ turn: Channel;
29
+ acceleration: Channel;
30
+ jerk: Channel;
31
+ smoothness: number | null;
32
+ step: {
33
+ distance: number;
34
+ angle: number;
35
+ at: number;
36
+ };
37
+ /** The cuts inside it, times: what is measured stops at each and starts again after. */
38
+ cuts: number[];
39
+ }
40
+ /** A channel from values at moments: its largest magnitude and when, its mean magnitude. */
41
+ export declare function channel(values: readonly number[], times: readonly number[]): Channel;
42
+ /**
43
+ * The motion of samples taken at a steady rate. A cut (a time between two
44
+ * samples) is no motion: the step across it is not measured, and neither
45
+ * acceleration nor jerk spans it; smoothness is the least smooth shot's.
46
+ */
47
+ export declare function motionOf(samples: readonly CameraSample[], cuts?: readonly number[]): MotionNumbers;
48
+ //# sourceMappingURL=motion.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{distance as V,dot as k,length as L,normalize as N,sub as j}from"./vec.js";const u=a=>Math.round(a*1e6)/1e6;export function channel(a,d){let r=0,m=d[0]??0,g=0;return a.forEach((x,h)=>{const i=Math.abs(x);g+=i,i>r&&(r=i,m=d[h]??m)}),{peak:u(r),at:u(m),mean:u(a.length>0?g/a.length:0)}}const Q=(a,d)=>{let r=d-a;for(;r>180;)r-=360;for(;r<-180;)r+=360;return r},R=(a,d)=>{const r=Math.max(-1,Math.min(1,k(N(a),N(d))));return Math.acos(r)*180/Math.PI};export function motionOf(a,d=[]){const r=a.length,m=[...d].sort((t,n)=>t-n),g=t=>m.filter(n=>n<=t).length,x=m.filter(t=>t>(a[0]?.t??0)&&t<=(a[r-1]?.t??0)),h={peak:0,at:a[0]?.t??0,mean:0};if(r<2)return{length:0,truck:h,pedestal:h,dolly:h,pan:h,tilt:h,roll:h,zoom:h,speed:h,turn:h,acceleration:h,jerk:h,smoothness:null,step:{distance:0,angle:0,at:a[0]?.t??0},cuts:x.map(u)};const i=[],T=[],q=[],B=[],C=[],D=[],F=[],G=[],S=[],_=[],H=[],y=[],M=[];let J=0,f={distance:0,angle:0,at:a[0]?.t??0},K=!0;for(let t=0;t+1<r;t++){const n=a[t],e=a[t+1];if(!n||!e)continue;const o=e.t-n.t;if(!(o>0)||g(n.t)!==g(e.t))continue;const s=j(e.position,n.position),l=[s[0]/o,s[1]/o,s[2]/o];y.push(l),M.push(g(n.t)),i.push((n.t+e.t)/2),T.push(k(l,n.right)),q.push(k(l,n.up)),B.push(k(l,n.forward)),C.push(Q(n.yaw,e.yaw)/o),D.push((e.pitch-n.pitch)/o),F.push(Q(n.roll,e.roll)/o),G.push((Math.log2(e.lens)-Math.log2(n.lens))/o),_.push(L(l));const w=R(n.forward,e.forward);H.push(w/o),n.target&&e.target?S.push(R(j(n.position,n.target),j(e.position,e.target))/o):K=!1;const c=V(n.position,e.position);J+=c,(c>f.distance||w>f.angle)&&(f={distance:Math.max(f.distance,c),angle:Math.max(f.angle,w),at:n.t})}const b=[],z=[],v=[];for(let t=0;t+1<y.length;t++){if(M[t]!==M[t+1])continue;const n=y[t],e=y[t+1],o=i[t],s=i[t+1];if(!n||!e||o===void 0||s===void 0||!(s>o))continue;const l=j(e,n);b.push([l[0]/(s-o),l[1]/(s-o),l[2]/(s-o)]),z.push((o+s)/2),v.push(M[t]??0)}const P=[],E=[],A=[];for(let t=0;t+1<b.length;t++){if(v[t]!==v[t+1])continue;const n=b[t],e=b[t+1],o=z[t],s=z[t+1];if(!n||!e||o===void 0||s===void 0||!(s>o))continue;const l=j(e,n);P.push([l[0]/(s-o),l[1]/(s-o),l[2]/(s-o)]),E.push((o+s)/2),A.push(v[t]??0)}let O=null;for(const t of new Set(A)){const n=P.filter((c,p)=>A[p]===t),e=E.filter((c,p)=>A[p]===t),o=a.filter(c=>g(c.t)===t).map(c=>c.t),s=Math.max(0,..._.filter((c,p)=>M[p]===t));if(!(s>1e-9)||n.length<2)continue;let l=0;for(let c=0;c+1<n.length;c++){const p=n[c],I=n[c+1],U=(e[c+1]??0)-(e[c]??0);!p||!I||(l+=(k(p,p)+k(I,I))/2*U)}const w=(o.at(-1)??0)-(o[0]??0);if(l>0){const c=u(-Math.log(w**3/(s*s)*l));(O===null||c<O)&&(O=c)}}return{length:u(J),truck:channel(T,i),pedestal:channel(q,i),dolly:channel(B,i),pan:channel(C,i),tilt:channel(D,i),roll:channel(F,i),zoom:channel(G,i),...K&&S.length>0?{arc:channel(S,i)}:{},speed:channel(_,i),turn:channel(H,i),acceleration:channel(b.map(L),z),jerk:channel(P.map(L),E),smoothness:O,step:{distance:u(f.distance),angle:u(f.angle),at:u(f.at)},cuts:x.map(u)}}