@omnimedia/omnitool 1.1.0-8 → 1.1.0-80

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 (436) hide show
  1. package/README.md +293 -76
  2. package/package.json +19 -17
  3. package/s/context.ts +0 -7
  4. package/s/demo/demo.bundle.ts +104 -43
  5. package/s/demo/demo.css +244 -14
  6. package/s/demo/routines/export-test.ts +16 -0
  7. package/s/demo/routines/filmstrip-test.ts +22 -18
  8. package/s/demo/routines/load-video.ts +2 -3
  9. package/s/demo/routines/playback-test.ts +61 -0
  10. package/s/demo/routines/timeline-setup.ts +50 -0
  11. package/s/demo/routines/transcode-test.ts +19 -5
  12. package/s/demo/routines/transitions-test.ts +2 -2
  13. package/s/demo/routines/waveform-test.ts +35 -8
  14. package/s/driver/driver-worker.ts +9 -0
  15. package/s/driver/driver.test.ts +1 -1
  16. package/s/driver/driver.ts +43 -42
  17. package/s/driver/fns/schematic.ts +26 -6
  18. package/s/driver/fns/work.ts +65 -189
  19. package/s/driver/parts/compositor.ts +316 -0
  20. package/s/driver/parts/machina.ts +19 -20
  21. package/s/driver/utils/find-pixi-filter.ts +24 -0
  22. package/s/index.html.ts +103 -25
  23. package/s/index.ts +1 -0
  24. package/s/tests.bundle.ts +11 -0
  25. package/s/tests.html.ts +28 -0
  26. package/s/timeline/index.ts +8 -2
  27. package/s/timeline/parts/animations.ts +56 -0
  28. package/s/timeline/parts/filmstrip.ts +43 -16
  29. package/s/timeline/parts/filters.ts +453 -0
  30. package/s/timeline/parts/item.ts +70 -7
  31. package/s/timeline/parts/media.ts +12 -2
  32. package/s/timeline/parts/resource-pool.ts +8 -5
  33. package/s/timeline/parts/resource.ts +3 -0
  34. package/s/timeline/parts/waveform/parts/collect.ts +72 -0
  35. package/s/timeline/parts/waveform/parts/render.ts +45 -0
  36. package/s/timeline/parts/waveform/parts/types.ts +24 -0
  37. package/s/timeline/parts/waveform/waveform.ts +161 -0
  38. package/s/timeline/renderers/export/parts/audio-gain.ts +17 -0
  39. package/s/timeline/renderers/export/parts/audio-mix.ts +133 -0
  40. package/s/timeline/renderers/export/parts/cursor.ts +129 -0
  41. package/s/timeline/renderers/export/parts/produce-audio.ts +64 -0
  42. package/s/timeline/renderers/export/parts/produce-video.ts +49 -0
  43. package/s/timeline/renderers/export/parts/resamplers.ts +48 -0
  44. package/s/timeline/renderers/export/produce.ts +28 -0
  45. package/s/timeline/renderers/parts/handy.ts +377 -0
  46. package/s/timeline/renderers/parts/samplers/audio/parts/find.ts +19 -0
  47. package/s/timeline/renderers/parts/samplers/audio/parts/init.ts +60 -0
  48. package/s/timeline/renderers/parts/samplers/audio/parts/sink.ts +38 -0
  49. package/s/timeline/renderers/parts/samplers/audio/parts/types.ts +16 -0
  50. package/s/timeline/renderers/parts/samplers/audio/sampler.ts +35 -0
  51. package/s/timeline/renderers/parts/samplers/visual/parts/defaults.ts +16 -0
  52. package/s/timeline/renderers/parts/samplers/visual/parts/sample.ts +69 -0
  53. package/s/timeline/renderers/parts/samplers/visual/parts/sequence.ts +111 -0
  54. package/s/timeline/renderers/parts/samplers/visual/parts/sink.ts +38 -0
  55. package/s/timeline/renderers/parts/samplers/visual/parts/transition.ts +28 -0
  56. package/s/timeline/renderers/parts/samplers/visual/parts/types.ts +10 -0
  57. package/s/timeline/renderers/parts/samplers/visual/sampler.ts +28 -0
  58. package/s/timeline/renderers/parts/schedulers.ts +96 -0
  59. package/s/timeline/renderers/player/parts/playback.ts +159 -0
  60. package/s/timeline/renderers/player/player.ts +77 -0
  61. package/s/timeline/renderers/renderers.test.ts +385 -0
  62. package/s/timeline/sugar/helpers.ts +190 -0
  63. package/s/timeline/sugar/o.ts +271 -59
  64. package/s/timeline/sugar/omni.test.ts +210 -0
  65. package/s/timeline/sugar/omni.ts +35 -12
  66. package/s/timeline/types.ts +28 -3
  67. package/s/timeline/utils/anim.ts +71 -0
  68. package/s/timeline/utils/checksum.ts +3 -1
  69. package/s/timeline/utils/datafile.ts +15 -4
  70. package/s/timeline/utils/dummy-data.ts +3 -3
  71. package/s/timeline/utils/matrix.ts +21 -0
  72. package/s/timeline/utils/terps.ts +81 -0
  73. package/s/units/fps.ts +8 -0
  74. package/s/units/ms.ts +8 -0
  75. package/s/units/seconds.ts +8 -0
  76. package/x/WebGLRenderer-4CHIZDHY.js +2 -0
  77. package/x/WebGLRenderer-4CHIZDHY.js.map +7 -0
  78. package/x/WebGPURenderer-O6WXU2QR.js +2 -0
  79. package/x/WebGPURenderer-O6WXU2QR.js.map +7 -0
  80. package/x/browserAll-WNIOTNNP.js +2 -0
  81. package/x/browserAll-WNIOTNNP.js.map +7 -0
  82. package/x/chunk-23FOBGX6.js +2 -0
  83. package/x/chunk-23FOBGX6.js.map +7 -0
  84. package/x/chunk-73XOWA4F.js +393 -0
  85. package/x/chunk-73XOWA4F.js.map +7 -0
  86. package/x/chunk-IAWJKNX5.js +42 -0
  87. package/x/chunk-IAWJKNX5.js.map +7 -0
  88. package/x/chunk-KCMVLWBS.js +157 -0
  89. package/x/chunk-KCMVLWBS.js.map +7 -0
  90. package/x/chunk-MR32SQ27.js +2 -0
  91. package/x/chunk-MR32SQ27.js.map +7 -0
  92. package/x/chunk-VCUJJYRJ.js +327 -0
  93. package/x/chunk-VCUJJYRJ.js.map +7 -0
  94. package/x/chunk-XNIZ4L5W.js +269 -0
  95. package/x/chunk-XNIZ4L5W.js.map +7 -0
  96. package/x/chunk-ZLGNQFUI.js +15 -0
  97. package/x/chunk-ZLGNQFUI.js.map +7 -0
  98. package/x/context.d.ts +1 -4
  99. package/x/context.js +1 -5
  100. package/x/context.js.map +1 -1
  101. package/x/demo/WebGLRenderer-RSJAHIG2.js +2 -0
  102. package/x/demo/WebGLRenderer-RSJAHIG2.js.map +7 -0
  103. package/x/demo/WebGPURenderer-MGFAJCYY.js +2 -0
  104. package/x/demo/WebGPURenderer-MGFAJCYY.js.map +7 -0
  105. package/x/demo/browserAll-PTRBXBRP.js +2 -0
  106. package/x/demo/browserAll-PTRBXBRP.js.map +7 -0
  107. package/x/demo/chunk-CUYOGHWU.js +42 -0
  108. package/x/demo/chunk-CUYOGHWU.js.map +7 -0
  109. package/x/demo/chunk-DGTDNJ7W.js +2 -0
  110. package/x/demo/chunk-DGTDNJ7W.js.map +7 -0
  111. package/x/demo/chunk-FZ5BYF63.js +15 -0
  112. package/x/demo/chunk-FZ5BYF63.js.map +7 -0
  113. package/x/demo/chunk-KWN4NNES.js +269 -0
  114. package/x/demo/chunk-KWN4NNES.js.map +7 -0
  115. package/x/demo/chunk-OJ3FPXW7.js +157 -0
  116. package/x/demo/chunk-OJ3FPXW7.js.map +7 -0
  117. package/x/demo/chunk-PSLUOGTZ.js +393 -0
  118. package/x/demo/chunk-PSLUOGTZ.js.map +7 -0
  119. package/x/demo/chunk-VLCVEIFU.js +327 -0
  120. package/x/demo/chunk-VLCVEIFU.js.map +7 -0
  121. package/x/demo/chunk-ZWCPT5FR.js +2 -0
  122. package/x/demo/chunk-ZWCPT5FR.js.map +7 -0
  123. package/x/demo/demo.bundle.js +94 -40
  124. package/x/demo/demo.bundle.js.map +1 -1
  125. package/x/demo/demo.bundle.min.js +7340 -90
  126. package/x/demo/demo.bundle.min.js.map +4 -4
  127. package/x/demo/demo.css +244 -14
  128. package/x/demo/routines/export-test.d.ts +2 -0
  129. package/x/demo/routines/export-test.js +10 -0
  130. package/x/demo/routines/export-test.js.map +1 -0
  131. package/x/demo/routines/filmstrip-test.d.ts +1 -1
  132. package/x/demo/routines/filmstrip-test.js +20 -17
  133. package/x/demo/routines/filmstrip-test.js.map +1 -1
  134. package/x/demo/routines/load-video.d.ts +1 -1
  135. package/x/demo/routines/load-video.js +1 -2
  136. package/x/demo/routines/load-video.js.map +1 -1
  137. package/x/demo/routines/playback-test.d.ts +2 -0
  138. package/x/demo/routines/playback-test.js +51 -0
  139. package/x/demo/routines/playback-test.js.map +1 -0
  140. package/x/demo/routines/timeline-setup.d.ts +6 -0
  141. package/x/demo/routines/timeline-setup.js +32 -0
  142. package/x/demo/routines/timeline-setup.js.map +1 -0
  143. package/x/demo/routines/transcode-test.js +15 -5
  144. package/x/demo/routines/transcode-test.js.map +1 -1
  145. package/x/demo/routines/transitions-test.js +2 -2
  146. package/x/demo/routines/transitions-test.js.map +1 -1
  147. package/x/demo/routines/waveform-test.d.ts +2 -1
  148. package/x/demo/routines/waveform-test.js +29 -8
  149. package/x/demo/routines/waveform-test.js.map +1 -1
  150. package/x/demo/webworkerAll-JENRT6BT.js +2 -0
  151. package/x/demo/webworkerAll-JENRT6BT.js.map +7 -0
  152. package/x/driver/driver-worker.d.ts +1 -0
  153. package/x/driver/driver-worker.js +6 -0
  154. package/x/driver/driver-worker.js.map +1 -0
  155. package/x/driver/driver.d.ts +25 -8
  156. package/x/driver/driver.js +43 -39
  157. package/x/driver/driver.js.map +1 -1
  158. package/x/driver/driver.test.js +1 -1
  159. package/x/driver/driver.test.js.map +1 -1
  160. package/x/driver/driver.worker.bundle.min.js +117 -3506
  161. package/x/driver/driver.worker.bundle.min.js.map +4 -4
  162. package/x/driver/fns/host.d.ts +3 -2
  163. package/x/driver/fns/schematic.d.ts +25 -4
  164. package/x/driver/fns/work.d.ts +4 -4
  165. package/x/driver/fns/work.js +55 -155
  166. package/x/driver/fns/work.js.map +1 -1
  167. package/x/driver/parts/compositor.d.ts +39 -0
  168. package/x/driver/parts/compositor.js +261 -0
  169. package/x/driver/parts/compositor.js.map +1 -0
  170. package/x/driver/parts/machina.d.ts +0 -20
  171. package/x/driver/parts/machina.js +6 -10
  172. package/x/driver/parts/machina.js.map +1 -1
  173. package/x/driver/utils/find-pixi-filter.d.ts +5 -0
  174. package/x/driver/utils/find-pixi-filter.js +13 -0
  175. package/x/driver/utils/find-pixi-filter.js.map +1 -0
  176. package/x/features/speech/transcribe/parts/prep-audio.d.ts +1 -1
  177. package/x/features/speech/transcribe/worker.bundle.min.js +899 -899
  178. package/x/features/speech/transcribe/worker.bundle.min.js.map +4 -4
  179. package/x/index.d.ts +1 -0
  180. package/x/index.html +347 -38
  181. package/x/index.html.js +103 -24
  182. package/x/index.html.js.map +1 -1
  183. package/x/index.js +1 -0
  184. package/x/index.js.map +1 -1
  185. package/x/tests.bundle.js +8 -0
  186. package/x/tests.bundle.js.map +1 -0
  187. package/x/tests.bundle.min.js +7374 -0
  188. package/x/tests.bundle.min.js.map +7 -0
  189. package/x/tests.html +316 -0
  190. package/x/tests.html.d.ts +2 -0
  191. package/x/tests.html.js +22 -0
  192. package/x/tests.html.js.map +1 -0
  193. package/x/timeline/index.d.ts +7 -1
  194. package/x/timeline/index.js +7 -1
  195. package/x/timeline/index.js.map +1 -1
  196. package/x/timeline/parts/animations.d.ts +105 -0
  197. package/x/timeline/parts/animations.js +28 -0
  198. package/x/timeline/parts/animations.js.map +1 -0
  199. package/x/timeline/parts/filmstrip.d.ts +4 -3
  200. package/x/timeline/parts/filmstrip.js +29 -10
  201. package/x/timeline/parts/filmstrip.js.map +1 -1
  202. package/x/timeline/parts/filters.d.ts +108 -0
  203. package/x/timeline/parts/filters.js +340 -0
  204. package/x/timeline/parts/filters.js.map +1 -0
  205. package/x/timeline/parts/item.d.ts +56 -4
  206. package/x/timeline/parts/item.js +5 -1
  207. package/x/timeline/parts/item.js.map +1 -1
  208. package/x/timeline/parts/media.d.ts +2 -0
  209. package/x/timeline/parts/media.js +11 -2
  210. package/x/timeline/parts/media.js.map +1 -1
  211. package/x/timeline/parts/resource-pool.d.ts +3 -0
  212. package/x/timeline/parts/resource-pool.js +7 -4
  213. package/x/timeline/parts/resource-pool.js.map +1 -1
  214. package/x/timeline/parts/resource.d.ts +3 -0
  215. package/x/timeline/parts/waveform/parts/collect.d.ts +11 -0
  216. package/x/timeline/parts/waveform/parts/collect.js +56 -0
  217. package/x/timeline/parts/waveform/parts/collect.js.map +1 -0
  218. package/x/timeline/parts/waveform/parts/render.d.ts +5 -0
  219. package/x/timeline/parts/waveform/parts/render.js +29 -0
  220. package/x/timeline/parts/waveform/parts/render.js.map +1 -0
  221. package/x/timeline/parts/waveform/parts/types.d.ts +21 -0
  222. package/x/timeline/parts/waveform/parts/types.js.map +1 -0
  223. package/x/timeline/parts/waveform/waveform.d.ts +19 -0
  224. package/x/timeline/parts/waveform/waveform.js +133 -0
  225. package/x/timeline/parts/waveform/waveform.js.map +1 -0
  226. package/x/timeline/renderers/export/parts/audio-gain.d.ts +1 -0
  227. package/x/timeline/renderers/export/parts/audio-gain.js +13 -0
  228. package/x/timeline/renderers/export/parts/audio-gain.js.map +1 -0
  229. package/x/timeline/renderers/export/parts/audio-mix.d.ts +21 -0
  230. package/x/timeline/renderers/export/parts/audio-mix.js +89 -0
  231. package/x/timeline/renderers/export/parts/audio-mix.js.map +1 -0
  232. package/x/timeline/renderers/export/parts/cursor.d.ts +18 -0
  233. package/x/timeline/renderers/export/parts/cursor.js +99 -0
  234. package/x/timeline/renderers/export/parts/cursor.js.map +1 -0
  235. package/x/timeline/renderers/export/parts/produce-audio.d.ts +6 -0
  236. package/x/timeline/renderers/export/parts/produce-audio.js +41 -0
  237. package/x/timeline/renderers/export/parts/produce-audio.js.map +1 -0
  238. package/x/timeline/renderers/export/parts/produce-video.d.ts +10 -0
  239. package/x/timeline/renderers/export/parts/produce-video.js +26 -0
  240. package/x/timeline/renderers/export/parts/produce-video.js.map +1 -0
  241. package/x/timeline/renderers/export/parts/resamplers.d.ts +12 -0
  242. package/x/timeline/renderers/export/parts/resamplers.js +29 -0
  243. package/x/timeline/renderers/export/parts/resamplers.js.map +1 -0
  244. package/x/timeline/renderers/export/produce.d.ts +13 -0
  245. package/x/timeline/renderers/export/produce.js +15 -0
  246. package/x/timeline/renderers/export/produce.js.map +1 -0
  247. package/x/timeline/renderers/parts/handy.d.ts +36 -0
  248. package/x/timeline/renderers/parts/handy.js +221 -0
  249. package/x/timeline/renderers/parts/handy.js.map +1 -0
  250. package/x/timeline/renderers/parts/samplers/audio/parts/find.d.ts +6 -0
  251. package/x/timeline/renderers/parts/samplers/audio/parts/find.js +15 -0
  252. package/x/timeline/renderers/parts/samplers/audio/parts/find.js.map +1 -0
  253. package/x/timeline/renderers/parts/samplers/audio/parts/init.d.ts +5 -0
  254. package/x/timeline/renderers/parts/samplers/audio/parts/init.js +40 -0
  255. package/x/timeline/renderers/parts/samplers/audio/parts/init.js.map +1 -0
  256. package/x/timeline/renderers/parts/samplers/audio/parts/sink.d.ts +8 -0
  257. package/x/timeline/renderers/parts/samplers/audio/parts/sink.js +24 -0
  258. package/x/timeline/renderers/parts/samplers/audio/parts/sink.js.map +1 -0
  259. package/x/timeline/renderers/parts/samplers/audio/parts/types.d.ts +14 -0
  260. package/x/timeline/renderers/parts/samplers/audio/parts/types.js +2 -0
  261. package/x/timeline/renderers/parts/samplers/audio/parts/types.js.map +1 -0
  262. package/x/timeline/renderers/parts/samplers/audio/sampler.d.ts +11 -0
  263. package/x/timeline/renderers/parts/samplers/audio/sampler.js +22 -0
  264. package/x/timeline/renderers/parts/samplers/audio/sampler.js.map +1 -0
  265. package/x/timeline/renderers/parts/samplers/visual/parts/defaults.d.ts +5 -0
  266. package/x/timeline/renderers/parts/samplers/visual/parts/defaults.js +10 -0
  267. package/x/timeline/renderers/parts/samplers/visual/parts/defaults.js.map +1 -0
  268. package/x/timeline/renderers/parts/samplers/visual/parts/sample.d.ts +6 -0
  269. package/x/timeline/renderers/parts/samplers/visual/parts/sample.js +48 -0
  270. package/x/timeline/renderers/parts/samplers/visual/parts/sample.js.map +1 -0
  271. package/x/timeline/renderers/parts/samplers/visual/parts/sequence.d.ts +6 -0
  272. package/x/timeline/renderers/parts/samplers/visual/parts/sequence.js +75 -0
  273. package/x/timeline/renderers/parts/samplers/visual/parts/sequence.js.map +1 -0
  274. package/x/timeline/renderers/parts/samplers/visual/parts/sink.d.ts +8 -0
  275. package/x/timeline/renderers/parts/samplers/visual/parts/sink.js +24 -0
  276. package/x/timeline/renderers/parts/samplers/visual/parts/sink.js.map +1 -0
  277. package/x/timeline/renderers/parts/samplers/visual/parts/transition.d.ts +3 -0
  278. package/x/timeline/renderers/parts/samplers/visual/parts/transition.js +18 -0
  279. package/x/timeline/renderers/parts/samplers/visual/parts/transition.js.map +1 -0
  280. package/x/timeline/renderers/parts/samplers/visual/parts/types.d.ts +8 -0
  281. package/x/timeline/renderers/parts/samplers/visual/parts/types.js +2 -0
  282. package/x/timeline/renderers/parts/samplers/visual/parts/types.js.map +1 -0
  283. package/x/timeline/renderers/parts/samplers/visual/sampler.d.ts +7 -0
  284. package/x/timeline/renderers/parts/samplers/visual/sampler.js +17 -0
  285. package/x/timeline/renderers/parts/samplers/visual/sampler.js.map +1 -0
  286. package/x/timeline/renderers/parts/schedulers.d.ts +17 -0
  287. package/x/timeline/renderers/parts/schedulers.js +64 -0
  288. package/x/timeline/renderers/parts/schedulers.js.map +1 -0
  289. package/x/timeline/renderers/player/parts/playback.d.ts +36 -0
  290. package/x/timeline/renderers/player/parts/playback.js +113 -0
  291. package/x/timeline/renderers/player/parts/playback.js.map +1 -0
  292. package/x/timeline/renderers/player/player.d.ts +25 -0
  293. package/x/timeline/renderers/player/player.js +56 -0
  294. package/x/timeline/renderers/player/player.js.map +1 -0
  295. package/x/timeline/renderers/renderers.test.d.ts +32 -0
  296. package/x/timeline/renderers/renderers.test.js +305 -0
  297. package/x/timeline/renderers/renderers.test.js.map +1 -0
  298. package/x/timeline/sugar/helpers.d.ts +56 -0
  299. package/x/timeline/sugar/helpers.js +104 -0
  300. package/x/timeline/sugar/helpers.js.map +1 -0
  301. package/x/timeline/sugar/o.d.ts +48 -14
  302. package/x/timeline/sugar/o.js +213 -54
  303. package/x/timeline/sugar/o.js.map +1 -1
  304. package/x/timeline/sugar/omni.d.ts +11 -6
  305. package/x/timeline/sugar/omni.js +28 -8
  306. package/x/timeline/sugar/omni.js.map +1 -1
  307. package/x/timeline/sugar/omni.test.d.ts +27 -0
  308. package/x/timeline/sugar/omni.test.js +128 -0
  309. package/x/timeline/sugar/omni.test.js.map +1 -0
  310. package/x/timeline/types.d.ts +12 -2
  311. package/x/timeline/utils/anim.d.ts +5 -0
  312. package/x/timeline/utils/anim.js +44 -0
  313. package/x/timeline/utils/anim.js.map +1 -0
  314. package/x/timeline/utils/checksum.d.ts +3 -2
  315. package/x/timeline/utils/checksum.js.map +1 -1
  316. package/x/timeline/utils/datafile.d.ts +5 -3
  317. package/x/timeline/utils/datafile.js +18 -5
  318. package/x/timeline/utils/datafile.js.map +1 -1
  319. package/x/timeline/utils/dummy-data.d.ts +1 -2
  320. package/x/timeline/utils/dummy-data.js +4 -2
  321. package/x/timeline/utils/dummy-data.js.map +1 -1
  322. package/x/timeline/utils/matrix.d.ts +9 -0
  323. package/x/timeline/utils/matrix.js +10 -0
  324. package/x/timeline/utils/matrix.js.map +1 -1
  325. package/x/timeline/utils/terps.d.ts +11 -0
  326. package/x/timeline/utils/terps.js +57 -0
  327. package/x/timeline/utils/terps.js.map +1 -0
  328. package/x/units/fps.d.ts +6 -0
  329. package/x/units/fps.js +2 -0
  330. package/x/units/fps.js.map +1 -0
  331. package/x/units/ms.d.ts +6 -0
  332. package/x/units/ms.js +2 -0
  333. package/x/units/ms.js.map +1 -0
  334. package/x/units/seconds.d.ts +6 -0
  335. package/x/units/seconds.js +2 -0
  336. package/x/units/seconds.js.map +1 -0
  337. package/x/webworkerAll-RLCTMSDD.js +2 -0
  338. package/x/webworkerAll-RLCTMSDD.js.map +7 -0
  339. package/s/tests.test.ts +0 -8
  340. package/s/timeline/parts/compositor/export.ts +0 -77
  341. package/s/timeline/parts/compositor/parts/html-tree.ts +0 -37
  342. package/s/timeline/parts/compositor/parts/schedulers.ts +0 -85
  343. package/s/timeline/parts/compositor/parts/tree-builder.ts +0 -184
  344. package/s/timeline/parts/compositor/parts/webcodecs-tree.ts +0 -30
  345. package/s/timeline/parts/compositor/playback.ts +0 -81
  346. package/s/timeline/parts/compositor/samplers/html.ts +0 -115
  347. package/s/timeline/parts/compositor/samplers/webcodecs.ts +0 -60
  348. package/s/timeline/parts/waveform.ts +0 -62
  349. package/s/timeline/sugar/builders.ts +0 -102
  350. package/s/timeline/sugar/omni-test.ts +0 -38
  351. package/s/timeline/timeline.ts +0 -22
  352. package/s/timeline/utils/audio-stream.ts +0 -15
  353. package/s/timeline/utils/video-cursor.ts +0 -40
  354. package/s/tools/common/loader.ts +0 -26
  355. package/s/tools/common/transformer-pipeline.ts +0 -26
  356. package/s/tools/speech-recognition/common/model.ts +0 -26
  357. package/s/tools/speech-recognition/whisper/fns/host.ts +0 -25
  358. package/s/tools/speech-recognition/whisper/fns/schematic.ts +0 -23
  359. package/s/tools/speech-recognition/whisper/fns/work.ts +0 -91
  360. package/s/tools/speech-recognition/whisper/parts/types.ts +0 -38
  361. package/s/tools/speech-recognition/whisper/parts/worker.bundle.ts +0 -7
  362. package/s/tools/speech-recognition/whisper/tool.ts +0 -70
  363. package/x/tests.test.js +0 -6
  364. package/x/tests.test.js.map +0 -1
  365. package/x/timeline/parts/compositor/export.d.ts +0 -9
  366. package/x/timeline/parts/compositor/export.js +0 -64
  367. package/x/timeline/parts/compositor/export.js.map +0 -1
  368. package/x/timeline/parts/compositor/parts/html-tree.d.ts +0 -3
  369. package/x/timeline/parts/compositor/parts/html-tree.js +0 -40
  370. package/x/timeline/parts/compositor/parts/html-tree.js.map +0 -1
  371. package/x/timeline/parts/compositor/parts/schedulers.d.ts +0 -15
  372. package/x/timeline/parts/compositor/parts/schedulers.js +0 -64
  373. package/x/timeline/parts/compositor/parts/schedulers.js.map +0 -1
  374. package/x/timeline/parts/compositor/parts/tree-builder.d.ts +0 -37
  375. package/x/timeline/parts/compositor/parts/tree-builder.js +0 -147
  376. package/x/timeline/parts/compositor/parts/tree-builder.js.map +0 -1
  377. package/x/timeline/parts/compositor/parts/webcodecs-tree.d.ts +0 -3
  378. package/x/timeline/parts/compositor/parts/webcodecs-tree.js +0 -28
  379. package/x/timeline/parts/compositor/parts/webcodecs-tree.js.map +0 -1
  380. package/x/timeline/parts/compositor/playback.d.ts +0 -19
  381. package/x/timeline/parts/compositor/playback.js +0 -71
  382. package/x/timeline/parts/compositor/playback.js.map +0 -1
  383. package/x/timeline/parts/compositor/samplers/html.d.ts +0 -3
  384. package/x/timeline/parts/compositor/samplers/html.js +0 -106
  385. package/x/timeline/parts/compositor/samplers/html.js.map +0 -1
  386. package/x/timeline/parts/compositor/samplers/webcodecs.d.ts +0 -2
  387. package/x/timeline/parts/compositor/samplers/webcodecs.js +0 -55
  388. package/x/timeline/parts/compositor/samplers/webcodecs.js.map +0 -1
  389. package/x/timeline/parts/waveform.d.ts +0 -8
  390. package/x/timeline/parts/waveform.js +0 -51
  391. package/x/timeline/parts/waveform.js.map +0 -1
  392. package/x/timeline/sugar/builders.d.ts +0 -96
  393. package/x/timeline/sugar/builders.js +0 -108
  394. package/x/timeline/sugar/builders.js.map +0 -1
  395. package/x/timeline/sugar/omni-test.d.ts +0 -1
  396. package/x/timeline/sugar/omni-test.js +0 -22
  397. package/x/timeline/sugar/omni-test.js.map +0 -1
  398. package/x/timeline/timeline.d.ts +0 -9
  399. package/x/timeline/timeline.js +0 -22
  400. package/x/timeline/timeline.js.map +0 -1
  401. package/x/timeline/utils/audio-stream.d.ts +0 -6
  402. package/x/timeline/utils/audio-stream.js +0 -17
  403. package/x/timeline/utils/audio-stream.js.map +0 -1
  404. package/x/timeline/utils/video-cursor.d.ts +0 -10
  405. package/x/timeline/utils/video-cursor.js +0 -36
  406. package/x/timeline/utils/video-cursor.js.map +0 -1
  407. package/x/tools/common/loader.d.ts +0 -19
  408. package/x/tools/common/loader.js +0 -18
  409. package/x/tools/common/loader.js.map +0 -1
  410. package/x/tools/common/transformer-pipeline.d.ts +0 -8
  411. package/x/tools/common/transformer-pipeline.js +0 -24
  412. package/x/tools/common/transformer-pipeline.js.map +0 -1
  413. package/x/tools/speech-recognition/common/model.d.ts +0 -14
  414. package/x/tools/speech-recognition/common/model.js +0 -16
  415. package/x/tools/speech-recognition/common/model.js.map +0 -1
  416. package/x/tools/speech-recognition/whisper/fns/host.d.ts +0 -13
  417. package/x/tools/speech-recognition/whisper/fns/host.js +0 -19
  418. package/x/tools/speech-recognition/whisper/fns/host.js.map +0 -1
  419. package/x/tools/speech-recognition/whisper/fns/schematic.d.ts +0 -19
  420. package/x/tools/speech-recognition/whisper/fns/schematic.js +0 -2
  421. package/x/tools/speech-recognition/whisper/fns/schematic.js.map +0 -1
  422. package/x/tools/speech-recognition/whisper/fns/work.d.ts +0 -12
  423. package/x/tools/speech-recognition/whisper/fns/work.js +0 -74
  424. package/x/tools/speech-recognition/whisper/fns/work.js.map +0 -1
  425. package/x/tools/speech-recognition/whisper/parts/types.d.ts +0 -31
  426. package/x/tools/speech-recognition/whisper/parts/types.js.map +0 -1
  427. package/x/tools/speech-recognition/whisper/parts/worker.bundle.d.ts +0 -1
  428. package/x/tools/speech-recognition/whisper/parts/worker.bundle.js +0 -4
  429. package/x/tools/speech-recognition/whisper/parts/worker.bundle.js.map +0 -1
  430. package/x/tools/speech-recognition/whisper/parts/worker.bundle.min.js +0 -8
  431. package/x/tools/speech-recognition/whisper/parts/worker.bundle.min.js.map +0 -7
  432. package/x/tools/speech-recognition/whisper/tool.d.ts +0 -12
  433. package/x/tools/speech-recognition/whisper/tool.js +0 -63
  434. package/x/tools/speech-recognition/whisper/tool.js.map +0 -1
  435. /package/x/{tests.test.d.ts → tests.bundle.d.ts} +0 -0
  436. /package/x/{tools/speech-recognition/whisper → timeline/parts/waveform}/parts/types.js +0 -0
@@ -17,7 +17,7 @@ export class Filmstrip {
17
17
 
18
18
  private constructor(
19
19
  private videoTrack: InputVideoTrack,
20
- private options: Required<FilmstripOptions>
20
+ private options: FilmstripOptions
21
21
  ) {
22
22
  this.#sink = new CanvasSink(videoTrack, options.canvasSinkOptions)
23
23
  }
@@ -33,7 +33,8 @@ export class Filmstrip {
33
33
  videoTrack, {
34
34
  frequency: options.frequency ?? 1,
35
35
  canvasSinkOptions: options.canvasSinkOptions ?? {width: 80, height: 50, fit: "fill"},
36
- onChange: options.onChange
36
+ onChange: options.onChange,
37
+ onPlaceholders: options.onPlaceholders
37
38
  })
38
39
  else throw new Error("Source has no video track")
39
40
  }
@@ -54,9 +55,28 @@ export class Filmstrip {
54
55
  return this.options.frequency
55
56
  }
56
57
 
57
- #computeActiveRange([start, end]: TimeRange): TimeRange {
58
+ #computeActiveRange([start, end]: TimeRange, margin = 1): TimeRange {
58
59
  const tileSize = end - start
59
- return [start - tileSize, end + tileSize]
60
+ return [start - tileSize * margin, end + tileSize * margin]
61
+ }
62
+
63
+ async #generatePlaceholders() {
64
+ const [rangeStart, rangeEnd] = this.#activeRange
65
+ const neededTimestamps = new Set<number>()
66
+
67
+ // duration should be computed but with trim etc also
68
+ const duration = await this.videoTrack.computeDuration()
69
+ for (
70
+ let timestamp = Math.max(0, rangeStart);
71
+ timestamp <= rangeEnd;
72
+ timestamp += this.options.frequency
73
+ ) {
74
+ // Clamp to valid time range
75
+ if (timestamp >= 0 && timestamp <= duration)
76
+ neededTimestamps.add(timestamp)
77
+ }
78
+
79
+ this.options.onPlaceholders?.([...neededTimestamps])
60
80
  }
61
81
 
62
82
  async #generateTiles() {
@@ -66,13 +86,13 @@ export class Filmstrip {
66
86
  // duration should be computed but with trim etc also
67
87
  const duration = await this.videoTrack.computeDuration()
68
88
  for (
69
- let timestamp = rangeStart;
89
+ let timestamp = Math.max(0, rangeStart);
70
90
  timestamp <= rangeEnd;
71
91
  timestamp += this.options.frequency
72
92
  ) {
73
93
  // Clamp to valid time range
74
94
  if (timestamp >= 0 && timestamp <= duration)
75
- neededTimestamps.add(+timestamp.toFixed(3))
95
+ neededTimestamps.add(timestamp)
76
96
  }
77
97
 
78
98
  const missingTimestamps = [...neededTimestamps]
@@ -106,15 +126,20 @@ export class Filmstrip {
106
126
  * @param visibleRange - The current timeline viewport as a [start, end] tuple in seconds.
107
127
  */
108
128
  set range(visibleRange: TimeRange) {
109
- const newRange = this.#computeActiveRange(visibleRange)
110
- // Avoid redundant updates
111
- if (
112
- this.#activeRange[0] === newRange[0] &&
113
- this.#activeRange[1] === newRange[1]
114
- )
115
- return
129
+ const [visStart, visEnd] = visibleRange
130
+ const visibleSize = visEnd - visStart
131
+ const [actStart, actEnd] = this.#activeRange
132
+
133
+ // trigger when we're 1x visible width away from margin edges
134
+ const leftTrigger = actStart + visibleSize
135
+ const rightTrigger = actEnd - visibleSize
136
+
137
+ const nearLeftEdge = visStart < leftTrigger
138
+ const nearRightEdge = visEnd > rightTrigger
139
+
140
+ if (!nearLeftEdge && !nearRightEdge) return
116
141
 
117
- this.#activeRange = newRange
142
+ this.#activeRange = this.#computeActiveRange(visibleRange, 2)
118
143
  this.#update()
119
144
  }
120
145
 
@@ -122,6 +147,7 @@ export class Filmstrip {
122
147
  #shouldRunAgain = false
123
148
 
124
149
  async #update() {
150
+ this.#generatePlaceholders()
125
151
  // Perform update immediately. If multiple updates are requested while updating,
126
152
  // only the latest one will run after the current finishes (skips intermediate ones).
127
153
  if(this.#updating) {
@@ -147,11 +173,12 @@ export class Filmstrip {
147
173
  }
148
174
  }
149
175
 
150
- type TimeRange = [number, number]
176
+ export type TimeRange = [start: number, end: number]
151
177
 
152
178
  interface FilmstripOptions {
153
- frequency?: number
179
+ frequency: number
154
180
  canvasSinkOptions?: CanvasSinkOptions
181
+ onPlaceholders?: (timestamps: number[]) => void
155
182
  onChange: (tiles: {
156
183
  time: number
157
184
  canvas: WrappedCanvas
@@ -0,0 +1,453 @@
1
+ import type {
2
+ AlphaFilterOptions,
3
+ BlurFilterOptions,
4
+ ColorMatrix,
5
+ FilterOptions as PixiFilterOptions,
6
+ NoiseFilterOptions,
7
+ Point,
8
+ } from "pixi.js"
9
+ import type * as PixiFilters from "pixi-filters"
10
+ import {FilterableItem, Item} from "./item.js"
11
+
12
+ export type PixelateFilterOptions = {size?: number | number[] | Point}
13
+ export type EmbossFilterOptions = {strength?: number}
14
+
15
+ export type ChoiceOptions = string[] | Record<string, string | number> | number[]
16
+
17
+ export type ChoiceFilterProperty = {
18
+ type: "choice"
19
+ options: ChoiceOptions
20
+ default: string | number
21
+ }
22
+
23
+ export type NumericFilterProperty = {
24
+ type: "number"
25
+ min: number
26
+ max: number
27
+ default: number
28
+ step?: number
29
+ }
30
+
31
+ export type ColorFilterProperty = {
32
+ type: "color"
33
+ default: string
34
+ }
35
+
36
+ export type BooleanFilterProperty = {
37
+ type: "boolean"
38
+ default: boolean
39
+ }
40
+
41
+ export type ObjectFilterProperty = {
42
+ type: "object"
43
+ properties: Record<string, FilterPropertyConfig>
44
+ }
45
+
46
+ export type ArrayFilterProperty = {
47
+ type: "array"
48
+ items: FilterPropertyConfig[]
49
+ }
50
+
51
+ export type FilterPropertyConfig =
52
+ | NumericFilterProperty
53
+ | ColorFilterProperty
54
+ | BooleanFilterProperty
55
+ | ChoiceFilterProperty
56
+ | ObjectFilterProperty
57
+ | ArrayFilterProperty
58
+
59
+ export interface FilterSchema {
60
+ [property: string]: FilterPropertyConfig
61
+ }
62
+
63
+ export type SchemaFromOptions<T> = {
64
+ [K in keyof Required<T>]?: FilterPropertyConfig
65
+ }
66
+
67
+ type FilterDefinition<TType extends string, TParams> = {
68
+ type: TType
69
+ schema: SchemaFromOptions<TParams>
70
+ _params?: TParams
71
+ }
72
+
73
+ const num =(
74
+ min: number,
75
+ max: number,
76
+ defaultValue: number,
77
+ step?: number,
78
+ ): NumericFilterProperty => ({
79
+ type: "number",
80
+ min,
81
+ max,
82
+ default: defaultValue,
83
+ ...(step === undefined ? {} : {step}),
84
+ })
85
+
86
+ const color =(defaultValue: string): ColorFilterProperty => ({
87
+ type: "color",
88
+ default: defaultValue,
89
+ })
90
+
91
+ const bool =(defaultValue: boolean): BooleanFilterProperty => ({
92
+ type: "boolean",
93
+ default: defaultValue,
94
+ })
95
+
96
+ const choice =(
97
+ options: ChoiceOptions,
98
+ defaultValue: string | number,
99
+ ): ChoiceFilterProperty => ({
100
+ type: "choice",
101
+ options,
102
+ default: defaultValue,
103
+ })
104
+
105
+ const object =(properties: Record<string, FilterPropertyConfig>): ObjectFilterProperty => ({
106
+ type: "object",
107
+ properties,
108
+ })
109
+
110
+ const array =(items: FilterPropertyConfig[]): ArrayFilterProperty => ({
111
+ type: "array",
112
+ items,
113
+ })
114
+
115
+ const kernelSizes = [3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25]
116
+ const glitchFillModes = {
117
+ TRANSPARENT: 0,
118
+ ORIGINAL: 1,
119
+ LOOP: 2,
120
+ CLAMP: 3,
121
+ MIRROR: 4,
122
+ } as const
123
+
124
+ const defineFilter = <TParams>() =>
125
+ <TType extends string>(
126
+ type: TType,
127
+ schema: SchemaFromOptions<TParams> = {},
128
+ ): FilterDefinition<TType, TParams> => ({type, schema})
129
+
130
+ export const filters = {
131
+ adjustment: defineFilter<PixiFilters.AdjustmentFilterOptions>()("AdjustmentFilter", {
132
+ gamma: num(0, 5, 1),
133
+ saturation: num(0, 5, 1),
134
+ contrast: num(0, 5, 1),
135
+ brightness: num(0, 5, 1),
136
+ red: num(0, 5, 1),
137
+ green: num(0, 5, 1),
138
+ blue: num(0, 5, 1),
139
+ alpha: num(0, 1, 1, 0.01),
140
+ }),
141
+ advancedBloom: defineFilter<PixiFilters.AdvancedBloomFilterOptions>()("AdvancedBloomFilter", {
142
+ threshold: num(0.1, 0.9, 0.5, 0.01),
143
+ bloomScale: num(0.5, 1.5, 1, 0.01),
144
+ brightness: num(0.5, 1.5, 1, 0.01),
145
+ blur: num(0, 20, 8, 0.1),
146
+ quality: num(1, 20, 4, 1),
147
+ }),
148
+ alpha: defineFilter<AlphaFilterOptions>()("AlphaFilter", {
149
+ alpha: num(0, 1, 1, 0.01),
150
+ }),
151
+ ascii: defineFilter<PixiFilters.AsciiFilterOptions>()("AsciiFilter", {
152
+ size: num(2, 20, 8, 1),
153
+ color: color("#ffffff"),
154
+ replaceColor: bool(false),
155
+ }),
156
+ backdropBlur: defineFilter<BlurFilterOptions>()("BackdropBlurFilter", {
157
+ strength: num(0, 100, 8, 0.1),
158
+ quality: num(1, 10, 4, 1),
159
+ }),
160
+ bevel: defineFilter<PixiFilters.BevelFilterOptions>()("BevelFilter", {
161
+ rotation: num(0, 360, 45, 1),
162
+ thickness: num(0, 10, 2, 0.1),
163
+ lightColor: color("#ffffff"),
164
+ lightAlpha: num(0, 1, 0.7, 0.01),
165
+ shadowColor: color("#000000"),
166
+ shadowAlpha: num(0, 1, 0.7, 0.01),
167
+ }),
168
+ bloom: defineFilter<PixiFilters.BloomFilterOptions>()("BloomFilter", {
169
+ strength: object({
170
+ x: num(0, 20, 2, 0.1),
171
+ y: num(0, 20, 2, 0.1),
172
+ }),
173
+ quality: num(1, 20, 4, 1),
174
+ resolution: num(0.25, 4, 1, 0.01),
175
+ kernelSize: choice([5, 7, 9, 11, 13, 15], 5),
176
+ }),
177
+ blur: defineFilter<BlurFilterOptions>()("BlurFilter", {
178
+ strength: num(0, 100, 8, 0.1),
179
+ quality: num(1, 10, 4, 1),
180
+ }),
181
+ bulgePinch: defineFilter<PixiFilters.BulgePinchFilterOptions>()("BulgePinchFilter", {
182
+ radius: num(0, 1000, 100, 1),
183
+ strength: num(-1, 1, 1, 0.01),
184
+ center: object({
185
+ x: num(0, 1, 0.5, 0.01),
186
+ y: num(0, 1, 0.5, 0.01),
187
+ }),
188
+ }),
189
+ colorGradient: defineFilter<PixiFilters.ColorGradientFilterOptions | PixiFilters.ColorGradientFilterCSSOptions>()("ColorGradientFilter"),
190
+ colorMatrix: defineFilter<PixiFilterOptions & {matrix?: ColorMatrix}>()("ColorMatrixFilter"),
191
+ colorOverlay: defineFilter<PixiFilters.ColorOverlayFilterOptions>()("ColorOverlayFilter", {
192
+ color: color("#ff0000"),
193
+ alpha: num(0, 1, 0.5, 0.01),
194
+ }),
195
+ colorReplace: defineFilter<PixiFilters.ColorReplaceFilterOptions>()("ColorReplaceFilter", {
196
+ originalColor: color("#ff0000"),
197
+ targetColor: color("#000000"),
198
+ tolerance: num(0, 1, 0.4, 0.01),
199
+ }),
200
+ convolution: defineFilter<PixiFilters.ConvolutionFilterOptions>()("ConvolutionFilter", {
201
+ width: num(0, 500, 300, 1),
202
+ height: num(0, 500, 300, 1),
203
+ matrix: array([
204
+ num(0, 1, 0),
205
+ num(0, 1, 0.5, 0.01),
206
+ num(0, 1, 0),
207
+ num(0, 1, 0.5, 0.01),
208
+ num(0, 1, 1, 0.01),
209
+ num(0, 1, 0.5, 0.01),
210
+ num(0, 1, 0),
211
+ num(0, 1, 0.5, 0.01),
212
+ num(0, 1, 0),
213
+ ]),
214
+ }),
215
+ crossHatch: defineFilter<{}>()("CrossHatchFilter"),
216
+ crt: defineFilter<PixiFilters.CRTFilterOptions>()("CRTFilter", {
217
+ curvature: num(0, 10, 1, 0.01),
218
+ lineWidth: num(0, 5, 3, 0.01),
219
+ lineContrast: num(0, 1, 0.3, 0.01),
220
+ verticalLine: bool(false),
221
+ noise: num(0, 1, 0.2, 0.01),
222
+ noiseSize: num(1, 10, 1, 0.1),
223
+ vignetting: num(0, 1, 0.3, 0.01),
224
+ vignettingAlpha: num(0, 1, 1, 0.01),
225
+ vignettingBlur: num(0, 1, 0.3, 0.01),
226
+ seed: num(0, 1, 0, 0.01),
227
+ time: num(0.5, 20, 0.5, 0.01),
228
+ }),
229
+ dot: defineFilter<PixiFilters.DotFilterOptions>()("DotFilter", {
230
+ scale: num(0.3, 1, 1, 0.01),
231
+ angle: num(0, 5, 5, 0.01),
232
+ grayscale: bool(true),
233
+ }),
234
+ dropShadow: defineFilter<PixiFilters.DropShadowFilterOptions>()("DropShadowFilter", {
235
+ blur: num(0, 20, 2, 0.1),
236
+ quality: num(1, 20, 3, 1),
237
+ alpha: num(0, 1, 0.5, 0.01),
238
+ offset: object({
239
+ x: num(-50, 50, 4, 1),
240
+ y: num(-50, 50, 4, 1),
241
+ }),
242
+ color: color("#000000"),
243
+ shadowOnly: bool(false),
244
+ }),
245
+ emboss: defineFilter<EmbossFilterOptions>()("EmbossFilter", {
246
+ strength: num(0, 20, 5, 0.1),
247
+ }),
248
+ glitch: defineFilter<PixiFilters.GlitchFilterOptions>()("GlitchFilter", {
249
+ slices: num(0, 64, 5, 1),
250
+ seed: num(0, 1, 0.5, 0.01),
251
+ offset: num(-400, 400, 100, 1),
252
+ direction: num(-180, 180, 0, 1),
253
+ fillMode: choice(glitchFillModes, "LOOP"),
254
+ average: bool(false),
255
+ minSize: num(0, 64, 8, 1),
256
+ sampleSize: num(1, 2048, 512, 1),
257
+ red: object({
258
+ x: num(-50, 50, 2, 1),
259
+ y: num(-50, 50, 2, 1),
260
+ }),
261
+ blue: object({
262
+ x: num(-50, 50, 10, 1),
263
+ y: num(-50, 50, -4, 1),
264
+ }),
265
+ green: object({
266
+ x: num(-50, 50, -10, 1),
267
+ y: num(-50, 50, 4, 1),
268
+ }),
269
+ }),
270
+ glow: defineFilter<PixiFilters.GlowFilterOptions>()("GlowFilter", {
271
+ distance: num(0, 20, 15, 0.1),
272
+ innerStrength: num(0, 20, 0, 0.1),
273
+ outerStrength: num(0, 20, 2, 0.1),
274
+ color: color("#ffffff"),
275
+ quality: num(0, 1, 0.2, 0.01),
276
+ alpha: num(0, 1, 1, 0.01),
277
+ knockout: bool(false),
278
+ }),
279
+ godray: defineFilter<PixiFilters.GodrayFilterOptions>()("GodrayFilter", {
280
+ time: num(0, 1, 0, 0.01),
281
+ gain: num(0, 1, 0.6, 0.01),
282
+ lacunarity: num(0, 5, 2.75, 0.01),
283
+ alpha: num(0, 1, 1, 0.01),
284
+ parallel: bool(true),
285
+ angle: num(-60, 60, 30, 1),
286
+ center: object({
287
+ x: num(-100, 2012, 956, 1),
288
+ y: num(-1000, -100, -100, 1),
289
+ }),
290
+ }),
291
+ grayscale: defineFilter<{}>()("GrayscaleFilter"),
292
+ hslAdjustment: defineFilter<PixiFilters.HslAdjustmentFilterOptions>()("HslAdjustmentFilter", {
293
+ hue: num(-180, 180, 0, 1),
294
+ saturation: num(-1, 1, 0, 0.01),
295
+ lightness: num(-1, 1, 0, 0.01),
296
+ colorize: bool(false),
297
+ alpha: num(0, 1, 1, 0.01),
298
+ }),
299
+ kawaseBlur: defineFilter<PixiFilters.KawaseBlurFilterOptions>()("KawaseBlurFilter", {
300
+ strength: num(0, 20, 4, 0.1),
301
+ quality: num(1, 20, 3, 1),
302
+ pixelSize: object({
303
+ x: num(0, 10, 1, 0.1),
304
+ y: num(0, 10, 1, 0.1),
305
+ }),
306
+ }),
307
+ motionBlur: defineFilter<PixiFilters.MotionBlurFilterOptions>()("MotionBlurFilter", {
308
+ velocity: object({
309
+ x: num(-90, 90, 40, 1),
310
+ y: num(-90, 90, 40, 1),
311
+ }),
312
+ kernelSize: choice(kernelSizes, 15),
313
+ offset: num(-150, 150, 0, 1),
314
+ }),
315
+ multiColorReplace: defineFilter<PixiFilters.MultiColorReplaceFilterOptions>()("MultiColorReplaceFilter"),
316
+ noise: defineFilter<NoiseFilterOptions>()("NoiseFilter", {
317
+ noise: num(0, 1, 0.5, 0.01),
318
+ seed: num(0.01, 10, 0.5, 0.01),
319
+ }),
320
+ oldFilm: defineFilter<PixiFilters.OldFilmFilterOptions>()("OldFilmFilter", {
321
+ sepia: num(0, 1, 0.3, 0.01),
322
+ noise: num(0, 1, 0.3, 0.01),
323
+ noiseSize: num(1, 10, 1, 0.1),
324
+ scratch: num(-1, 1, 0.5, 0.01),
325
+ scratchDensity: num(0, 1, 0.3, 0.01),
326
+ scratchWidth: num(1, 20, 1, 0.1),
327
+ vignetting: num(0, 1, 0.3, 0.01),
328
+ vignettingAlpha: num(0, 1, 1, 0.01),
329
+ vignettingBlur: num(0, 1, 0.3, 0.01),
330
+ }),
331
+ outline: defineFilter<PixiFilters.OutlineFilterOptions>()("OutlineFilter", {
332
+ thickness: num(0, 10, 4, 0.1),
333
+ color: color("#000000"),
334
+ alpha: num(0, 1, 1, 0.01),
335
+ knockout: bool(false),
336
+ }),
337
+ pixelate: defineFilter<PixelateFilterOptions>()("PixelateFilter", {
338
+ size: object({
339
+ x: num(4, 40, 10, 1),
340
+ y: num(4, 40, 10, 1),
341
+ }),
342
+ }),
343
+ radialBlur: defineFilter<PixiFilters.RadialBlurFilterOptions>()("RadialBlurFilter", {
344
+ angle: num(-180, 180, 20, 1),
345
+ radius: num(-1, 1912, 300, 1),
346
+ center: object({
347
+ x: num(0, 1912, 956, 1),
348
+ y: num(0, 920, 460, 1),
349
+ }),
350
+ kernelSize: choice(kernelSizes, 15),
351
+ }),
352
+ reflection: defineFilter<PixiFilters.ReflectionFilterOptions>()("ReflectionFilter", {
353
+ mirror: bool(true),
354
+ boundary: num(0, 1, 0.5, 0.01),
355
+ amplitude: object({
356
+ start: num(0, 50, 0, 0.1),
357
+ end: num(0, 50, 20, 0.1),
358
+ }),
359
+ waveLength: object({
360
+ start: num(10, 200, 30, 1),
361
+ end: num(10, 200, 100, 1),
362
+ }),
363
+ alpha: object({
364
+ start: num(0, 1, 1, 0.01),
365
+ end: num(0, 1, 1, 0.01),
366
+ }),
367
+ time: num(0, 20, 0, 0.01),
368
+ }),
369
+ rgbSplit: defineFilter<PixiFilters.RGBSplitFilterOptions>()("RGBSplitFilter", {
370
+ red: object({
371
+ x: num(-20, 20, -10, 1),
372
+ y: num(-20, 20, 0, 1),
373
+ }),
374
+ blue: object({
375
+ x: num(-20, 20, 0, 1),
376
+ y: num(-20, 20, 0, 1),
377
+ }),
378
+ green: object({
379
+ x: num(-20, 20, 0, 1),
380
+ y: num(-20, 20, 10, 1),
381
+ }),
382
+ }),
383
+ shockwave: defineFilter<PixiFilters.ShockwaveFilterOptions>()("ShockwaveFilter", {
384
+ speed: num(500, 2000, 500, 1),
385
+ amplitude: num(1, 100, 30, 1),
386
+ wavelength: num(2, 400, 160, 1),
387
+ brightness: num(0.2, 2, 1, 0.01),
388
+ radius: num(100, 2000, -1, 1),
389
+ center: object({
390
+ x: num(0, 1912, 956, 1),
391
+ y: num(0, 920, 460, 1),
392
+ }),
393
+ }),
394
+ simplexNoise: defineFilter<PixiFilters.SimplexNoiseFilterOptions>()("SimplexNoiseFilter", {
395
+ strength: num(0, 1, 0.5, 0.01),
396
+ noiseScale: num(0, 50, 10, 0.1),
397
+ offsetX: num(0, 5, 0, 0.01),
398
+ offsetY: num(0, 5, 0, 0.01),
399
+ offsetZ: num(0, 5, 0, 0.01),
400
+ step: num(-1, 1, -1, 0.01),
401
+ }),
402
+ tiltShift: defineFilter<PixiFilters.TiltShiftFilterOptions>()("TiltShiftFilter", {
403
+ blur: num(0, 200, 100, 0.1),
404
+ gradientBlur: num(0, 1000, 600, 1),
405
+ start: object({
406
+ x: num(0, 1912, 0, 1),
407
+ y: num(0, 920, 460, 1),
408
+ }),
409
+ end: object({
410
+ x: num(0, 1912, 1912, 1),
411
+ y: num(0, 920, 460, 1),
412
+ }),
413
+ }),
414
+ twist: defineFilter<Partial<PixiFilters.TwistFilterOptions>>()("TwistFilter", {
415
+ angle: num(-10, 10, 4, 0.01),
416
+ radius: num(0, 1912, 200, 1),
417
+ offset: object({
418
+ x: num(0, 1912, 956, 1),
419
+ y: num(0, 920, 460, 1),
420
+ }),
421
+ }),
422
+ zoomBlur: defineFilter<PixiFilters.ZoomBlurFilterOptions>()("ZoomBlurFilter", {
423
+ strength: num(0.01, 0.5, 0.1, 0.01),
424
+ center: object({
425
+ x: num(0, 1912, 956, 1),
426
+ y: num(0, 920, 460, 1),
427
+ }),
428
+ innerRadius: num(0, 956, 80, 1),
429
+ radius: num(0, 956, -1, 1),
430
+ }),
431
+ } as const
432
+
433
+ type FilterDefinitions = typeof filters
434
+ type FilterDefinitionParams<T> =
435
+ T extends FilterDefinition<string, infer TParams>
436
+ ? TParams
437
+ : never
438
+
439
+ export type FilterOptions = {
440
+ [TName in keyof FilterDefinitions as FilterDefinitions[TName]["type"]]:
441
+ FilterDefinitionParams<FilterDefinitions[TName]>
442
+ }
443
+
444
+ export type FilterType = FilterDefinitions[keyof FilterDefinitions]["type"]
445
+ export type FilterParams<T extends FilterType = FilterType> = FilterOptions[T]
446
+
447
+ export interface FilterAction<TFilter extends FilterType> {
448
+ <T extends FilterableItem>(item: T, params?: FilterParams<TFilter>): T
449
+ make(params?: FilterParams<TFilter>): Item.Filter<TFilter>
450
+ }
451
+ export type FilterActions = {
452
+ [TName in keyof typeof filters]: FilterAction<(typeof filters)[TName]["type"]>
453
+ }
@@ -1,6 +1,12 @@
1
1
 
2
+ import {TextStyleOptions} from "pixi.js"
3
+
2
4
  import {Id, Hash} from "./basics.js"
3
- import {Transform} from "../types.js"
5
+ import {Ms} from "../../units/ms.js"
6
+ import type {FilterParams, FilterType} from "./filters.js"
7
+ import {Anim, TrackTransform, Transform, VisualAnimations} from "../types.js"
8
+
9
+ export type Crop = [top: number, right: number, bottom: number, left: number]
4
10
 
5
11
  export enum Kind {
6
12
  Sequence,
@@ -10,7 +16,11 @@ export enum Kind {
10
16
  Text,
11
17
  Gap,
12
18
  Spatial,
19
+ AnimatedSpatial,
20
+ Animation,
13
21
  Transition,
22
+ TextStyle,
23
+ Filter
14
24
  }
15
25
 
16
26
  export enum Effect {
@@ -18,11 +28,42 @@ export enum Effect {
18
28
  }
19
29
 
20
30
  export namespace Item {
21
- export type Spatial = {
22
- id: Id
23
- kind: Kind.Spatial
24
- transform: Transform
25
- }
31
+ export type TextStyle = {
32
+ id: Id
33
+ kind: Kind.TextStyle
34
+ style: TextStyleOptions
35
+ }
36
+
37
+ export type Spatial = {
38
+ id: Id
39
+ kind: Kind.Spatial
40
+ transform: Transform
41
+ crop?: Crop
42
+ enabled: boolean
43
+ }
44
+
45
+ export type AnimatedSpatial = {
46
+ id: Id
47
+ kind: Kind.AnimatedSpatial
48
+ anim: Anim<TrackTransform>
49
+ crop?: Crop
50
+ enabled: boolean
51
+ }
52
+
53
+ export type Animation = {
54
+ id: Id
55
+ kind: Kind.Animation
56
+ anims: VisualAnimations
57
+ enabled: boolean
58
+ }
59
+
60
+ export type Filter<T extends FilterType = FilterType> = {
61
+ id: Id
62
+ kind: Kind.Filter
63
+ type: T
64
+ params?: FilterParams<T>
65
+ enabled: boolean
66
+ }
26
67
 
27
68
  export type Gap = {
28
69
  id: Id
@@ -35,6 +76,7 @@ export namespace Item {
35
76
  kind: Kind.Sequence
36
77
  childrenIds: Id[]
37
78
  spatialId?: Id
79
+ filterIds?: Id[]
38
80
  }
39
81
 
40
82
  export type Stack = {
@@ -42,6 +84,7 @@ export namespace Item {
42
84
  kind: Kind.Stack
43
85
  childrenIds: Id[]
44
86
  spatialId?: Id
87
+ filterIds?: Id[]
45
88
  }
46
89
 
47
90
  export type Video = {
@@ -51,6 +94,8 @@ export namespace Item {
51
94
  start: number
52
95
  duration: number
53
96
  spatialId?: Id
97
+ animationId?: Id
98
+ filterIds?: Id[]
54
99
  }
55
100
 
56
101
  export type Audio = {
@@ -59,14 +104,18 @@ export namespace Item {
59
104
  mediaHash: Hash
60
105
  start: number
61
106
  duration: number
107
+ gain?: number
62
108
  }
63
109
 
64
110
  export type Text = {
65
111
  id: Id
66
112
  kind: Kind.Text
67
113
  content: string
114
+ duration: number
68
115
  spatialId?: Id
69
- color: string
116
+ animationId?: Id
117
+ styleId?: Id
118
+ filterIds?: Id[]
70
119
  }
71
120
 
72
121
  export type Transition = {
@@ -85,6 +134,20 @@ export namespace Item {
85
134
  | Gap
86
135
  | Transition
87
136
  | Spatial
137
+ | AnimatedSpatial
138
+ | Animation
139
+ | TextStyle
140
+ | Filter
88
141
  )
89
142
  }
90
143
 
144
+ export type ContainerItem = Item.Sequence | Item.Stack
145
+ export type NonContainerItem = Exclude<Item.Any, ContainerItem>
146
+ export type FilterableItem = Item.Sequence | Item.Stack | Item.Video | Item.Text
147
+ export type SpatialItem = Item.Spatial | Item.AnimatedSpatial
148
+ export type VisualAnimatableItem = Item.Video | Item.Text
149
+
150
+ export type PlayableItem = Item.Any & {
151
+ start: Ms
152
+ duration: Ms
153
+ }