@automovie/viewer 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (387) hide show
  1. package/README.md +8 -87
  2. package/lib/IAutoMovieViewerCompletedFrame.d.ts +19 -11
  3. package/lib/IAutoMovieViewerDisplayMetadata.d.ts +0 -5
  4. package/lib/IAutoMovieViewerHandle.d.ts +3 -25
  5. package/lib/IMountViewerOptions.d.ts +24 -38
  6. package/lib/IViewerCameraStateSnapshot.d.ts +0 -5
  7. package/lib/IViewerFrameTransfer.d.ts +11 -0
  8. package/lib/IViewerFrameTransfer.js +3 -0
  9. package/lib/IViewerFrameTransfer.js.map +1 -0
  10. package/lib/IViewerFrameTransfer.mjs +0 -0
  11. package/lib/applyCaptureCanvasSize.d.ts +9 -10
  12. package/lib/applyCaptureCanvasSize.js +7 -13
  13. package/lib/applyCaptureCanvasSize.js.map +1 -1
  14. package/lib/applyCaptureCanvasSize.mjs +7 -10
  15. package/lib/applyCaptureCanvasSize.mjs.map +1 -1
  16. package/lib/audio/IAutoMovieAudioCue.d.ts +3 -8
  17. package/lib/audio/planAutoMovieAudioPlayback.d.ts +8 -21
  18. package/lib/audio/planAutoMovieAudioPlayback.js +8 -14
  19. package/lib/audio/planAutoMovieAudioPlayback.js.map +1 -1
  20. package/lib/audio/planAutoMovieAudioPlayback.mjs +8 -14
  21. package/lib/audio/planAutoMovieAudioPlayback.mjs.map +1 -1
  22. package/lib/audio/playAutoMovieAudioCues.d.ts +4 -11
  23. package/lib/audio/playAutoMovieAudioCues.js +4 -11
  24. package/lib/audio/playAutoMovieAudioCues.js.map +1 -1
  25. package/lib/audio/playAutoMovieAudioCues.mjs +4 -11
  26. package/lib/audio/playAutoMovieAudioCues.mjs.map +1 -1
  27. package/lib/createViewerCameraState.d.ts +3 -11
  28. package/lib/createViewerCameraState.js +80 -121
  29. package/lib/createViewerCameraState.js.map +1 -1
  30. package/lib/createViewerCameraState.mjs +46 -98
  31. package/lib/createViewerCameraState.mjs.map +1 -1
  32. package/lib/createViewerDisplayClock.d.ts +2 -10
  33. package/lib/createViewerDisplayClock.js +4 -12
  34. package/lib/createViewerDisplayClock.js.map +1 -1
  35. package/lib/createViewerDisplayClock.mjs +3 -11
  36. package/lib/createViewerDisplayClock.mjs.map +1 -1
  37. package/lib/createViewerDisplayPublication.d.ts +7 -15
  38. package/lib/createViewerDisplayPublication.js +7 -15
  39. package/lib/createViewerDisplayPublication.js.map +1 -1
  40. package/lib/createViewerDisplayPublication.mjs +7 -15
  41. package/lib/createViewerDisplayPublication.mjs.map +1 -1
  42. package/lib/createViewerDisplaySave.d.ts +8 -16
  43. package/lib/createViewerDisplaySave.js +8 -16
  44. package/lib/createViewerDisplaySave.js.map +1 -1
  45. package/lib/createViewerDisplaySave.mjs +8 -16
  46. package/lib/createViewerDisplaySave.mjs.map +1 -1
  47. package/lib/createViewerFrameControl.d.ts +8 -10
  48. package/lib/createViewerFrameControl.js +3 -15
  49. package/lib/createViewerFrameControl.js.map +1 -1
  50. package/lib/createViewerFrameControl.mjs +3 -12
  51. package/lib/createViewerFrameControl.mjs.map +1 -1
  52. package/lib/createViewerViewportResize.d.ts +4 -12
  53. package/lib/createViewerViewportResize.js +7 -20
  54. package/lib/createViewerViewportResize.js.map +1 -1
  55. package/lib/createViewerViewportResize.mjs +6 -14
  56. package/lib/createViewerViewportResize.mjs.map +1 -1
  57. package/lib/index.d.ts +1 -0
  58. package/lib/index.js +1 -0
  59. package/lib/index.js.map +1 -1
  60. package/lib/index.mjs +6 -1
  61. package/lib/inspector/AutoMovieInspector.d.ts +33 -13
  62. package/lib/inspector/AutoMovieInspector.js +110 -19
  63. package/lib/inspector/AutoMovieInspector.js.map +1 -1
  64. package/lib/inspector/AutoMovieInspector.mjs +121 -18
  65. package/lib/inspector/AutoMovieInspector.mjs.map +1 -1
  66. package/lib/inspector/AutoMovieInspectorBeauty.d.ts +41 -0
  67. package/lib/inspector/AutoMovieInspectorBeauty.js +56 -0
  68. package/lib/inspector/AutoMovieInspectorBeauty.js.map +1 -0
  69. package/lib/inspector/AutoMovieInspectorBeauty.mjs +55 -0
  70. package/lib/inspector/AutoMovieInspectorBeauty.mjs.map +1 -0
  71. package/lib/inspector/AutoMovieInspectorDiagnosticLog.d.ts +48 -0
  72. package/lib/inspector/AutoMovieInspectorDiagnosticLog.js +186 -0
  73. package/lib/inspector/AutoMovieInspectorDiagnosticLog.js.map +1 -0
  74. package/lib/inspector/AutoMovieInspectorDiagnosticLog.mjs +171 -0
  75. package/lib/inspector/AutoMovieInspectorDiagnosticLog.mjs.map +1 -0
  76. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.d.ts +23 -0
  77. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.js +37 -0
  78. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.js.map +1 -0
  79. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.mjs +85 -0
  80. package/lib/inspector/AutoMovieInspectorDiagnosticsPanel.mjs.map +1 -0
  81. package/lib/inspector/AutoMovieInspectorMarksPanel.d.ts +4 -10
  82. package/lib/inspector/AutoMovieInspectorMarksPanel.js +18 -35
  83. package/lib/inspector/AutoMovieInspectorMarksPanel.js.map +1 -1
  84. package/lib/inspector/AutoMovieInspectorMarksPanel.mjs +32 -38
  85. package/lib/inspector/AutoMovieInspectorMarksPanel.mjs.map +1 -1
  86. package/lib/inspector/AutoMovieInspectorPlayhead.d.ts +35 -96
  87. package/lib/inspector/AutoMovieInspectorPlayhead.js +41 -101
  88. package/lib/inspector/AutoMovieInspectorPlayhead.js.map +1 -1
  89. package/lib/inspector/AutoMovieInspectorPlayhead.mjs +44 -98
  90. package/lib/inspector/AutoMovieInspectorPlayhead.mjs.map +1 -1
  91. package/lib/inspector/AutoMovieInspectorRequestPanel.d.ts +9 -10
  92. package/lib/inspector/AutoMovieInspectorRequestPanel.js +18 -12
  93. package/lib/inspector/AutoMovieInspectorRequestPanel.js.map +1 -1
  94. package/lib/inspector/AutoMovieInspectorRequestPanel.mjs +32 -14
  95. package/lib/inspector/AutoMovieInspectorRequestPanel.mjs.map +1 -1
  96. package/lib/inspector/AutoMovieInspectorSelectionPanel.d.ts +0 -8
  97. package/lib/inspector/AutoMovieInspectorSelectionPanel.js +0 -8
  98. package/lib/inspector/AutoMovieInspectorSelectionPanel.js.map +1 -1
  99. package/lib/inspector/AutoMovieInspectorSelectionPanel.mjs +0 -8
  100. package/lib/inspector/AutoMovieInspectorSelectionPanel.mjs.map +1 -1
  101. package/lib/inspector/AutoMovieInspectorShadePanel.d.ts +2 -9
  102. package/lib/inspector/AutoMovieInspectorShadePanel.js +18 -25
  103. package/lib/inspector/AutoMovieInspectorShadePanel.js.map +1 -1
  104. package/lib/inspector/AutoMovieInspectorShadePanel.mjs +18 -27
  105. package/lib/inspector/AutoMovieInspectorShadePanel.mjs.map +1 -1
  106. package/lib/inspector/AutoMovieInspectorTimePanel.d.ts +0 -8
  107. package/lib/inspector/AutoMovieInspectorTimePanel.js +0 -8
  108. package/lib/inspector/AutoMovieInspectorTimePanel.js.map +1 -1
  109. package/lib/inspector/AutoMovieInspectorTimePanel.mjs +0 -8
  110. package/lib/inspector/AutoMovieInspectorTimePanel.mjs.map +1 -1
  111. package/lib/inspector/AutoMovieInspectorTimeReadout.d.ts +0 -8
  112. package/lib/inspector/AutoMovieInspectorTimeReadout.js +4 -10
  113. package/lib/inspector/AutoMovieInspectorTimeReadout.js.map +1 -1
  114. package/lib/inspector/AutoMovieInspectorTimeReadout.mjs +3 -12
  115. package/lib/inspector/AutoMovieInspectorTimeReadout.mjs.map +1 -1
  116. package/lib/inspector/AutoMovieInspectorTransition.d.ts +79 -0
  117. package/lib/inspector/AutoMovieInspectorTransition.js +131 -0
  118. package/lib/inspector/AutoMovieInspectorTransition.js.map +1 -0
  119. package/lib/inspector/AutoMovieInspectorTransition.mjs +119 -0
  120. package/lib/inspector/AutoMovieInspectorTransition.mjs.map +1 -0
  121. package/lib/inspector/AutoMovieInspectorViewPanel.d.ts +0 -8
  122. package/lib/inspector/AutoMovieInspectorViewPanel.js +0 -8
  123. package/lib/inspector/AutoMovieInspectorViewPanel.js.map +1 -1
  124. package/lib/inspector/AutoMovieInspectorViewPanel.mjs +0 -8
  125. package/lib/inspector/AutoMovieInspectorViewPanel.mjs.map +1 -1
  126. package/lib/inspector/IAutoMovieInspectorAction.d.ts +54 -95
  127. package/lib/inspector/IAutoMovieInspectorLive.d.ts +43 -0
  128. package/lib/inspector/IAutoMovieInspectorLive.js +3 -0
  129. package/lib/inspector/IAutoMovieInspectorLive.js.map +1 -0
  130. package/lib/inspector/IAutoMovieInspectorLive.mjs +0 -0
  131. package/lib/inspector/IAutoMovieInspectorPathNode.d.ts +14 -9
  132. package/lib/inspector/IAutoMovieInspectorProps.d.ts +3 -14
  133. package/lib/inspector/IAutoMovieInspectorScene.d.ts +96 -100
  134. package/lib/inspector/IAutoMovieInspectorSceneHost.d.ts +37 -102
  135. package/lib/inspector/IAutoMovieInspectorState.d.ts +6 -7
  136. package/lib/inspector/assertAutoMovieInspectorRaster.d.ts +7 -0
  137. package/lib/inspector/assertAutoMovieInspectorRaster.js +19 -0
  138. package/lib/inspector/assertAutoMovieInspectorRaster.js.map +1 -0
  139. package/lib/inspector/assertAutoMovieInspectorRaster.mjs +17 -0
  140. package/lib/inspector/assertAutoMovieInspectorRaster.mjs.map +1 -0
  141. package/lib/inspector/buildAutoMovieInspectorPathTree.d.ts +9 -10
  142. package/lib/inspector/buildAutoMovieInspectorPathTree.js +9 -10
  143. package/lib/inspector/buildAutoMovieInspectorPathTree.js.map +1 -1
  144. package/lib/inspector/buildAutoMovieInspectorPathTree.mjs +9 -10
  145. package/lib/inspector/buildAutoMovieInspectorPathTree.mjs.map +1 -1
  146. package/lib/inspector/changesAutoMovieObservedScene.d.ts +16 -0
  147. package/lib/inspector/changesAutoMovieObservedScene.js +28 -0
  148. package/lib/inspector/changesAutoMovieObservedScene.js.map +1 -0
  149. package/lib/inspector/changesAutoMovieObservedScene.mjs +21 -0
  150. package/lib/inspector/changesAutoMovieObservedScene.mjs.map +1 -0
  151. package/lib/inspector/createAutoMovieInspectorAddressWriter.d.ts +13 -11
  152. package/lib/inspector/createAutoMovieInspectorAddressWriter.js +13 -11
  153. package/lib/inspector/createAutoMovieInspectorAddressWriter.js.map +1 -1
  154. package/lib/inspector/createAutoMovieInspectorAddressWriter.mjs +13 -11
  155. package/lib/inspector/createAutoMovieInspectorAddressWriter.mjs.map +1 -1
  156. package/lib/inspector/createAutoMovieInspectorCanvasHost.d.ts +7 -10
  157. package/lib/inspector/createAutoMovieInspectorCanvasHost.js +14 -11
  158. package/lib/inspector/createAutoMovieInspectorCanvasHost.js.map +1 -1
  159. package/lib/inspector/createAutoMovieInspectorCanvasHost.mjs +17 -14
  160. package/lib/inspector/createAutoMovieInspectorCanvasHost.mjs.map +1 -1
  161. package/lib/inspector/createAutoMovieInspectorState.d.ts +3 -9
  162. package/lib/inspector/createAutoMovieInspectorState.js +3 -9
  163. package/lib/inspector/createAutoMovieInspectorState.js.map +1 -1
  164. package/lib/inspector/createAutoMovieInspectorState.mjs +3 -9
  165. package/lib/inspector/createAutoMovieInspectorState.mjs.map +1 -1
  166. package/lib/inspector/firstAutoMovieInspectorSecond.d.ts +6 -0
  167. package/lib/inspector/firstAutoMovieInspectorSecond.js +13 -0
  168. package/lib/inspector/firstAutoMovieInspectorSecond.js.map +1 -0
  169. package/lib/inspector/firstAutoMovieInspectorSecond.mjs +11 -0
  170. package/lib/inspector/firstAutoMovieInspectorSecond.mjs.map +1 -0
  171. package/lib/inspector/followAutoMovieInspectorSize.d.ts +11 -0
  172. package/lib/inspector/followAutoMovieInspectorSize.js +26 -0
  173. package/lib/inspector/followAutoMovieInspectorSize.js.map +1 -0
  174. package/lib/inspector/followAutoMovieInspectorSize.mjs +26 -0
  175. package/lib/inspector/followAutoMovieInspectorSize.mjs.map +1 -0
  176. package/lib/inspector/formatAutoMovieInspectorAddress.d.ts +11 -10
  177. package/lib/inspector/formatAutoMovieInspectorAddress.js +15 -11
  178. package/lib/inspector/formatAutoMovieInspectorAddress.js.map +1 -1
  179. package/lib/inspector/formatAutoMovieInspectorAddress.mjs +15 -11
  180. package/lib/inspector/formatAutoMovieInspectorAddress.mjs.map +1 -1
  181. package/lib/inspector/formatAutoMovieInspectorCommand.d.ts +20 -14
  182. package/lib/inspector/formatAutoMovieInspectorCommand.js +33 -14
  183. package/lib/inspector/formatAutoMovieInspectorCommand.js.map +1 -1
  184. package/lib/inspector/formatAutoMovieInspectorCommand.mjs +26 -15
  185. package/lib/inspector/formatAutoMovieInspectorCommand.mjs.map +1 -1
  186. package/lib/inspector/handleAutoMovieInspectorKey.d.ts +24 -15
  187. package/lib/inspector/handleAutoMovieInspectorKey.js +27 -16
  188. package/lib/inspector/handleAutoMovieInspectorKey.js.map +1 -1
  189. package/lib/inspector/handleAutoMovieInspectorKey.mjs +27 -16
  190. package/lib/inspector/handleAutoMovieInspectorKey.mjs.map +1 -1
  191. package/lib/inspector/index.d.ts +5 -0
  192. package/lib/inspector/index.js +5 -0
  193. package/lib/inspector/index.js.map +1 -1
  194. package/lib/inspector/index.mjs +6 -1
  195. package/lib/inspector/inspectAutoMovieInspectorRequest.d.ts +19 -0
  196. package/lib/inspector/inspectAutoMovieInspectorRequest.js +20 -0
  197. package/lib/inspector/inspectAutoMovieInspectorRequest.js.map +1 -0
  198. package/lib/inspector/inspectAutoMovieInspectorRequest.mjs +20 -0
  199. package/lib/inspector/inspectAutoMovieInspectorRequest.mjs.map +1 -0
  200. package/lib/inspector/installAutoMovieInspectorRequest.d.ts +20 -0
  201. package/lib/inspector/installAutoMovieInspectorRequest.js +36 -0
  202. package/lib/inspector/installAutoMovieInspectorRequest.js.map +1 -0
  203. package/lib/inspector/installAutoMovieInspectorRequest.mjs +35 -0
  204. package/lib/inspector/installAutoMovieInspectorRequest.mjs.map +1 -0
  205. package/lib/inspector/locateAutoMovieInspectorFinding.d.ts +19 -0
  206. package/lib/inspector/locateAutoMovieInspectorFinding.js +34 -0
  207. package/lib/inspector/locateAutoMovieInspectorFinding.js.map +1 -0
  208. package/lib/inspector/locateAutoMovieInspectorFinding.mjs +37 -0
  209. package/lib/inspector/locateAutoMovieInspectorFinding.mjs.map +1 -0
  210. package/lib/inspector/messageOfAutoMovieInspectorError.d.ts +2 -0
  211. package/lib/inspector/messageOfAutoMovieInspectorError.js +8 -0
  212. package/lib/inspector/messageOfAutoMovieInspectorError.js.map +1 -0
  213. package/lib/inspector/messageOfAutoMovieInspectorError.mjs +8 -0
  214. package/lib/inspector/messageOfAutoMovieInspectorError.mjs.map +1 -0
  215. package/lib/inspector/mountAutoMovieInspectorPage.d.ts +5 -8
  216. package/lib/inspector/mountAutoMovieInspectorPage.js +3 -9
  217. package/lib/inspector/mountAutoMovieInspectorPage.js.map +1 -1
  218. package/lib/inspector/mountAutoMovieInspectorPage.mjs +4 -9
  219. package/lib/inspector/mountAutoMovieInspectorPage.mjs.map +1 -1
  220. package/lib/inspector/mountAutoMovieInspectorScene.d.ts +55 -12
  221. package/lib/inspector/mountAutoMovieInspectorScene.js +238 -164
  222. package/lib/inspector/mountAutoMovieInspectorScene.js.map +1 -1
  223. package/lib/inspector/mountAutoMovieInspectorScene.mjs +223 -149
  224. package/lib/inspector/mountAutoMovieInspectorScene.mjs.map +1 -1
  225. package/lib/inspector/placeAutoMovieInspectorLabels.d.ts +29 -0
  226. package/lib/inspector/placeAutoMovieInspectorLabels.js +33 -0
  227. package/lib/inspector/placeAutoMovieInspectorLabels.js.map +1 -0
  228. package/lib/inspector/placeAutoMovieInspectorLabels.mjs +32 -0
  229. package/lib/inspector/placeAutoMovieInspectorLabels.mjs.map +1 -0
  230. package/lib/inspector/readAutoMovieInspectorAddress.d.ts +8 -11
  231. package/lib/inspector/readAutoMovieInspectorAddress.js +8 -11
  232. package/lib/inspector/readAutoMovieInspectorAddress.js.map +1 -1
  233. package/lib/inspector/readAutoMovieInspectorAddress.mjs +8 -11
  234. package/lib/inspector/readAutoMovieInspectorAddress.mjs.map +1 -1
  235. package/lib/inspector/readAutoMovieInspectorFacts.d.ts +17 -0
  236. package/lib/inspector/readAutoMovieInspectorFacts.js +34 -0
  237. package/lib/inspector/readAutoMovieInspectorFacts.js.map +1 -0
  238. package/lib/inspector/readAutoMovieInspectorFacts.mjs +28 -0
  239. package/lib/inspector/readAutoMovieInspectorFacts.mjs.map +1 -0
  240. package/lib/inspector/readsAutoMovieInspectorPlacedScene.d.ts +9 -0
  241. package/lib/inspector/readsAutoMovieInspectorPlacedScene.js +14 -0
  242. package/lib/inspector/readsAutoMovieInspectorPlacedScene.js.map +1 -0
  243. package/lib/inspector/readsAutoMovieInspectorPlacedScene.mjs +14 -0
  244. package/lib/inspector/readsAutoMovieInspectorPlacedScene.mjs.map +1 -0
  245. package/lib/inspector/reduceAutoMovieInspectorState.d.ts +10 -10
  246. package/lib/inspector/reduceAutoMovieInspectorState.js +17 -11
  247. package/lib/inspector/reduceAutoMovieInspectorState.js.map +1 -1
  248. package/lib/inspector/reduceAutoMovieInspectorState.mjs +16 -11
  249. package/lib/inspector/reduceAutoMovieInspectorState.mjs.map +1 -1
  250. package/lib/inspector/releaseAutoMovieInspectorSteps.d.ts +6 -0
  251. package/lib/inspector/releaseAutoMovieInspectorSteps.js +23 -0
  252. package/lib/inspector/releaseAutoMovieInspectorSteps.js.map +1 -0
  253. package/lib/inspector/releaseAutoMovieInspectorSteps.mjs +19 -0
  254. package/lib/inspector/releaseAutoMovieInspectorSteps.mjs.map +1 -0
  255. package/lib/inspector/reportAutoMovieInspectorLabels.d.ts +21 -0
  256. package/lib/inspector/reportAutoMovieInspectorLabels.js +27 -0
  257. package/lib/inspector/reportAutoMovieInspectorLabels.js.map +1 -0
  258. package/lib/inspector/reportAutoMovieInspectorLabels.mjs +30 -0
  259. package/lib/inspector/reportAutoMovieInspectorLabels.mjs.map +1 -0
  260. package/lib/inspector/resolveAutoMovieInspectorCamera.d.ts +22 -0
  261. package/lib/inspector/resolveAutoMovieInspectorCamera.js +34 -0
  262. package/lib/inspector/resolveAutoMovieInspectorCamera.js.map +1 -0
  263. package/lib/inspector/resolveAutoMovieInspectorCamera.mjs +34 -0
  264. package/lib/inspector/resolveAutoMovieInspectorCamera.mjs.map +1 -0
  265. package/lib/inspector/showAutoMovieInspectorFinding.d.ts +25 -0
  266. package/lib/inspector/showAutoMovieInspectorFinding.js +26 -0
  267. package/lib/inspector/showAutoMovieInspectorFinding.js.map +1 -0
  268. package/lib/inspector/showAutoMovieInspectorFinding.mjs +26 -0
  269. package/lib/inspector/showAutoMovieInspectorFinding.mjs.map +1 -0
  270. package/lib/inspector/stopAutoMovieInspectorTime.d.ts +11 -0
  271. package/lib/inspector/stopAutoMovieInspectorTime.js +17 -0
  272. package/lib/inspector/stopAutoMovieInspectorTime.js.map +1 -0
  273. package/lib/inspector/stopAutoMovieInspectorTime.mjs +18 -0
  274. package/lib/inspector/stopAutoMovieInspectorTime.mjs.map +1 -0
  275. package/lib/inspector/writeAutoMovieInspectorInspection.d.ts +6 -0
  276. package/lib/inspector/writeAutoMovieInspectorInspection.js +12 -0
  277. package/lib/inspector/writeAutoMovieInspectorInspection.js.map +1 -0
  278. package/lib/inspector/writeAutoMovieInspectorInspection.mjs +12 -0
  279. package/lib/inspector/writeAutoMovieInspectorInspection.mjs.map +1 -0
  280. package/lib/internal.d.ts +7 -0
  281. package/lib/internal.js +25 -0
  282. package/lib/internal.js.map +1 -0
  283. package/lib/internal.mjs +8 -0
  284. package/lib/mountViewer.d.ts +16 -10
  285. package/lib/mountViewer.js +17 -14
  286. package/lib/mountViewer.js.map +1 -1
  287. package/lib/mountViewer.mjs +18 -12
  288. package/lib/mountViewer.mjs.map +1 -1
  289. package/lib/publishViewerCompletedFrame.d.ts +12 -10
  290. package/lib/publishViewerCompletedFrame.js +11 -9
  291. package/lib/publishViewerCompletedFrame.js.map +1 -1
  292. package/lib/publishViewerCompletedFrame.mjs +11 -9
  293. package/lib/publishViewerCompletedFrame.mjs.map +1 -1
  294. package/lib/redrawViewerCompletedFrame.d.ts +2 -10
  295. package/lib/redrawViewerCompletedFrame.js +4 -12
  296. package/lib/redrawViewerCompletedFrame.js.map +1 -1
  297. package/lib/redrawViewerCompletedFrame.mjs +3 -11
  298. package/lib/redrawViewerCompletedFrame.mjs.map +1 -1
  299. package/lib/releaseMountedViewer.d.ts +5 -9
  300. package/lib/releaseMountedViewer.js +5 -9
  301. package/lib/releaseMountedViewer.js.map +1 -1
  302. package/lib/releaseMountedViewer.mjs +5 -9
  303. package/lib/releaseMountedViewer.mjs.map +1 -1
  304. package/lib/transport/AutoMovieViewerTransport.d.ts +13 -122
  305. package/lib/transport/AutoMovieViewerTransport.js +10 -74
  306. package/lib/transport/AutoMovieViewerTransport.js.map +1 -1
  307. package/lib/transport/AutoMovieViewerTransport.mjs +10 -65
  308. package/lib/transport/AutoMovieViewerTransport.mjs.map +1 -1
  309. package/lib/transport/readAutoMovieReviewInterval.d.ts +3 -10
  310. package/lib/transport/readAutoMovieReviewInterval.js +11 -16
  311. package/lib/transport/readAutoMovieReviewInterval.js.map +1 -1
  312. package/lib/transport/readAutoMovieReviewInterval.mjs +8 -14
  313. package/lib/transport/readAutoMovieReviewInterval.mjs.map +1 -1
  314. package/package.json +12 -8
  315. package/src/IAutoMovieViewerCompletedFrame.ts +21 -11
  316. package/src/IAutoMovieViewerDisplayMetadata.ts +0 -5
  317. package/src/IAutoMovieViewerHandle.ts +3 -25
  318. package/src/IMountViewerOptions.ts +24 -38
  319. package/src/IViewerCameraStateSnapshot.ts +0 -5
  320. package/src/IViewerFrameTransfer.ts +13 -0
  321. package/src/applyCaptureCanvasSize.ts +9 -18
  322. package/src/audio/IAutoMovieAudioCue.ts +3 -8
  323. package/src/audio/planAutoMovieAudioPlayback.ts +9 -23
  324. package/src/audio/playAutoMovieAudioCues.ts +4 -11
  325. package/src/createViewerCameraState.ts +119 -175
  326. package/src/createViewerDisplayClock.ts +4 -12
  327. package/src/createViewerDisplayPublication.ts +7 -15
  328. package/src/createViewerDisplaySave.ts +8 -16
  329. package/src/createViewerFrameControl.ts +16 -24
  330. package/src/createViewerViewportResize.ts +7 -23
  331. package/src/index.ts +1 -0
  332. package/src/inspector/AutoMovieInspector.tsx +183 -20
  333. package/src/inspector/AutoMovieInspectorBeauty.ts +89 -0
  334. package/src/inspector/AutoMovieInspectorDiagnosticLog.ts +235 -0
  335. package/src/inspector/AutoMovieInspectorDiagnosticsPanel.tsx +118 -0
  336. package/src/inspector/AutoMovieInspectorMarksPanel.tsx +26 -34
  337. package/src/inspector/AutoMovieInspectorPlayhead.ts +53 -110
  338. package/src/inspector/AutoMovieInspectorRequestPanel.tsx +57 -29
  339. package/src/inspector/AutoMovieInspectorSelectionPanel.tsx +0 -8
  340. package/src/inspector/AutoMovieInspectorShadePanel.tsx +24 -29
  341. package/src/inspector/AutoMovieInspectorTimePanel.tsx +0 -8
  342. package/src/inspector/AutoMovieInspectorTimeReadout.tsx +4 -10
  343. package/src/inspector/AutoMovieInspectorTransition.ts +178 -0
  344. package/src/inspector/AutoMovieInspectorViewPanel.tsx +0 -8
  345. package/src/inspector/IAutoMovieInspectorAction.ts +57 -94
  346. package/src/inspector/IAutoMovieInspectorLive.ts +62 -0
  347. package/src/inspector/IAutoMovieInspectorPathNode.ts +14 -9
  348. package/src/inspector/IAutoMovieInspectorProps.ts +4 -14
  349. package/src/inspector/IAutoMovieInspectorScene.ts +104 -99
  350. package/src/inspector/IAutoMovieInspectorSceneHost.ts +43 -102
  351. package/src/inspector/IAutoMovieInspectorState.ts +6 -7
  352. package/src/inspector/assertAutoMovieInspectorRaster.ts +23 -0
  353. package/src/inspector/buildAutoMovieInspectorPathTree.ts +9 -10
  354. package/src/inspector/changesAutoMovieObservedScene.ts +30 -0
  355. package/src/inspector/createAutoMovieInspectorAddressWriter.ts +13 -11
  356. package/src/inspector/createAutoMovieInspectorCanvasHost.ts +14 -12
  357. package/src/inspector/createAutoMovieInspectorState.ts +3 -9
  358. package/src/inspector/firstAutoMovieInspectorSecond.ts +13 -0
  359. package/src/inspector/followAutoMovieInspectorSize.ts +32 -0
  360. package/src/inspector/formatAutoMovieInspectorAddress.ts +15 -11
  361. package/src/inspector/formatAutoMovieInspectorCommand.ts +44 -15
  362. package/src/inspector/handleAutoMovieInspectorKey.ts +27 -16
  363. package/src/inspector/index.ts +5 -0
  364. package/src/inspector/inspectAutoMovieInspectorRequest.ts +37 -0
  365. package/src/inspector/installAutoMovieInspectorRequest.ts +50 -0
  366. package/src/inspector/locateAutoMovieInspectorFinding.ts +40 -0
  367. package/src/inspector/messageOfAutoMovieInspectorError.ts +4 -0
  368. package/src/inspector/mountAutoMovieInspectorPage.tsx +7 -8
  369. package/src/inspector/mountAutoMovieInspectorScene.ts +290 -232
  370. package/src/inspector/placeAutoMovieInspectorLabels.ts +53 -0
  371. package/src/inspector/readAutoMovieInspectorAddress.ts +8 -11
  372. package/src/inspector/readAutoMovieInspectorFacts.ts +50 -0
  373. package/src/inspector/readsAutoMovieInspectorPlacedScene.ts +16 -0
  374. package/src/inspector/reduceAutoMovieInspectorState.ts +17 -11
  375. package/src/inspector/releaseAutoMovieInspectorSteps.ts +19 -0
  376. package/src/inspector/reportAutoMovieInspectorLabels.ts +45 -0
  377. package/src/inspector/resolveAutoMovieInspectorCamera.ts +50 -0
  378. package/src/inspector/showAutoMovieInspectorFinding.ts +40 -0
  379. package/src/inspector/stopAutoMovieInspectorTime.ts +19 -0
  380. package/src/inspector/writeAutoMovieInspectorInspection.ts +12 -0
  381. package/src/internal.ts +9 -0
  382. package/src/mountViewer.ts +17 -14
  383. package/src/publishViewerCompletedFrame.ts +14 -10
  384. package/src/redrawViewerCompletedFrame.ts +3 -12
  385. package/src/releaseMountedViewer.ts +5 -9
  386. package/src/transport/AutoMovieViewerTransport.ts +17 -144
  387. package/src/transport/readAutoMovieReviewInterval.ts +15 -16
@@ -1,66 +1,103 @@
1
1
  import type {
2
2
  IAutoMovieCapturePlanRequest,
3
- IAutoMovieInspectionLabel,
4
- IAutoMovieInspectionView,
3
+ IAutoMovieInspectionDiagnostics,
5
4
  } from "@automovie/interface";
6
5
  import {
7
- type IApplyAutoMovieInspectionProps,
8
6
  type IAutoMovieDrawScene,
9
7
  type IAutoMovieDrawSubject,
10
8
  type IAutoMovieInspectionHandle,
11
- type IAutoMovieViewerViewpoint,
12
- applyAutoMovieInspection,
13
- autoMovieViewerNamedViewpoints,
14
- formatAutoMovieInspectionRequest,
15
- listAutoMovieInspectionPaths,
16
- parseAutoMovieInspectionView,
17
- resolveAutoMovieInspectionView,
9
+ createAutoMovieInspectionDiagnosticOverlay,
10
+ observeAutoMoviePlacedInspection,
18
11
  } from "@automovie/render";
19
12
  import type * as THREE from "three";
20
13
 
14
+ import { AutoMovieInspectorBeauty } from "./AutoMovieInspectorBeauty.js";
15
+ import { AutoMovieInspectorDiagnosticLog } from "./AutoMovieInspectorDiagnosticLog.js";
21
16
  import type { AutoMovieInspectorPlayhead } from "./AutoMovieInspectorPlayhead.js";
17
+ import { AutoMovieInspectorTransition } from "./AutoMovieInspectorTransition.js";
18
+ import type { IAutoMovieInspectorLive } from "./IAutoMovieInspectorLive.js";
22
19
  import type { IAutoMovieInspectorScene } from "./IAutoMovieInspectorScene.js";
23
20
  import type { IAutoMovieInspectorSceneHost } from "./IAutoMovieInspectorSceneHost.js";
21
+ import { assertAutoMovieInspectorRaster } from "./assertAutoMovieInspectorRaster.js";
22
+ import { changesAutoMovieObservedScene } from "./changesAutoMovieObservedScene.js";
23
+ import { firstAutoMovieInspectorSecond } from "./firstAutoMovieInspectorSecond.js";
24
+ import { followAutoMovieInspectorSize } from "./followAutoMovieInspectorSize.js";
25
+ import { inspectAutoMovieInspectorRequest } from "./inspectAutoMovieInspectorRequest.js";
26
+ import { installAutoMovieInspectorRequest } from "./installAutoMovieInspectorRequest.js";
27
+ import { messageOfAutoMovieInspectorError } from "./messageOfAutoMovieInspectorError.js";
24
28
  import { readAutoMovieInspectorAddress } from "./readAutoMovieInspectorAddress.js";
25
-
26
- /** What a mount holds once its instance is ready. */
27
- interface ILive {
28
- instance: IAutoMovieDrawScene;
29
- renderer: IAutoMovieInspectorSceneHost.IRenderer;
30
- inspection: IAutoMovieInspectionHandle;
31
- applied: IAutoMovieCapturePlanRequest;
32
- frame: number | undefined;
33
- lastMs: number | undefined;
34
- drawn: AutoMovieInspectorPlayhead.ISnapshot | undefined;
35
- size: IAutoMovieInspectorSceneHost.ISize | undefined;
36
- dirty: boolean;
37
- seeking: boolean;
38
- error: string | null;
39
- labelled: boolean;
40
- }
29
+ import { readAutoMovieInspectorFacts } from "./readAutoMovieInspectorFacts.js";
30
+ import { readsAutoMovieInspectorPlacedScene } from "./readsAutoMovieInspectorPlacedScene.js";
31
+ import { releaseAutoMovieInspectorSteps } from "./releaseAutoMovieInspectorSteps.js";
32
+ import { reportAutoMovieInspectorLabels } from "./reportAutoMovieInspectorLabels.js";
33
+ import { resolveAutoMovieInspectorCamera } from "./resolveAutoMovieInspectorCamera.js";
34
+ import { writeAutoMovieInspectorInspection } from "./writeAutoMovieInspectorInspection.js";
41
35
 
42
36
  /**
43
- * Mount a subject on the inspector's canvas: build an instance, apply the request's inspection, and draw it every animation frame at the playhead's second through the request's first view.
37
+ * Mount a subject on the inspector's canvas: build an instance, apply the
38
+ * request's inspection, and draw it every animation frame at the playhead's
39
+ * second through the request's first view.
40
+ *
41
+ * The instance is created at once and arrives later. When it arrives the mount
42
+ * checks its clock and raster, seeks it to the request's first second and waits
43
+ * until it is ready there, lists its paths and the marks of its first second,
44
+ * applies the inspection of the newest request (or, when the scene refuses it,
45
+ * of the request that asks for nothing, reported through `refused`), sets the
46
+ * playhead's duration and second, reports `ready` and schedules the first
47
+ * frame. Each frame advances a playing playhead by the wall time since the last
48
+ * frame, follows the host's size, and redraws when the playhead's snapshot or
49
+ * the request changed: place the instance and, once it is ready, run the
50
+ * subject's `beforeDraw` on a WebGL renderer, as the draw host does, so its
51
+ * surface feeds show the second drawn with the scene's own materials, then
52
+ * update the inspection with the second's marks, resolve the view and render.
53
+ * An inspection that changes the scene's materials or layers is lifted around
54
+ * the seek of a subject with `beforeDraw` or `inspectPlaced` and applied again
55
+ * after them. Beauty pictures draw through `AutoMovieInspectorBeauty`, the
56
+ * subject's optics and indirect shading as delivery draws one sample. While a
57
+ * seek is pending no other is started, and the next frame seeks the newest
58
+ * second, so a slow subject drops intermediate seconds instead of queueing
59
+ * them. A drawing error pauses playback and is reported once until a frame
60
+ * draws again.
44
61
  *
45
- * The instance is created at once and arrives later. When it arrives the mount checks its clock and raster, seeks it to the request's first second and waits until it is ready there, lists its paths and the marks of its first second, applies the inspection of the newest request (or, when the scene refuses it, of the request that asks for nothing, reported through `refused`), sets the playhead's duration and second, reports `ready` and schedules the first frame. Each frame advances a playing playhead by the wall time since the last frame, follows the host's size, and redraws when the playhead's snapshot or the request changed: seek the instance and, once its promise resolves, update the inspection with the second's marks, resolve the view and render. While a seek is pending no other is started, and the next frame seeks the newest second, so a slow subject drops intermediate seconds instead of queueing them. A drawing error pauses playback and is reported once until a frame draws again.
62
+ * The picture's aspect is the subject's raster, not the canvas's, so a view
63
+ * frames what a capture of the same subject frames; the page gives the canvas
64
+ * that aspect. The mount adds no listener and holds at most one pending frame,
65
+ * so a mount, dispose and mount again on one canvas, as React's StrictMode runs
66
+ * an effect, leaves one renderer and one frame loop; a mount disposed before
67
+ * its instance arrives or is ready disposes the instance then and creates no
68
+ * renderer, and a seek that resolves after dispose draws nothing.
46
69
  *
47
- * The picture's aspect is the subject's raster, not the canvas's, so a view frames what a capture of the same subject frames; the page gives the canvas that aspect. The mount adds no listener and holds at most one pending frame, so a mount, dispose and mount again on one canvas, as React's StrictMode runs an effect, leaves one renderer and one frame loop; a mount disposed before its instance arrives or is ready disposes the instance then and creates no renderer, and a seek that resolves after dispose draws nothing.
70
+ * An opted-in subject is observed at the second actually placed, before the
71
+ * inspection changes the scene: an inspection that changes layers, materials,
72
+ * mark geometry or clipping is restored before the seek and re-applied after
73
+ * the observation, while one that changes none of them, as the default request,
74
+ * stays applied and only updates its marks, as for any subject. Its findings
75
+ * reach the report and the diagnostic log with the playhead's playing flag and
76
+ * jump count, so uninterrupted playback can join painted samples into an
77
+ * observed span. Its witness cubes are drawn under the beauty shade unless
78
+ * `overlay(false)` hid them; hiding them stops no check and no report.
48
79
  *
49
- * The page draws the first view and the first pass of the request; the capture command draws them all. While paused, the labels the request asks for are placed by the inspection on the picture's pixels, with the stamp's font pixel at least one CSS pixel of the canvas as a capture keeps it at least one sheet pixel, and reported in CSS pixels; a named view with a focus is framed on what the focus selects.
80
+ * `AutoMovieInspectorTransition` places the subject, the shown shot last, so
81
+ * diagnostics, marks, camera and inspection pictures follow it as in the draw
82
+ * page; a plain beauty transition paints and holds its other layers first and
83
+ * composites them by their `playbackLayersAt` weights, under the witness cubes
84
+ * at full strength, so a dissolve and a fade match delivery.
50
85
  *
51
- * @evidence contracts/development/common.md#meaningful-documentation States the arrival sequence, the fallback on refusal, what a frame does and when it redraws, the error rule, the aspect rule, the lifecycle guarantees, which view and pass are drawn, and how labels and focus are placed.
52
- * @evidence contracts/development/implementation.md#principled-implementation The scene is changed only through render's inspection, which restores before re-applying; views are resolved by render's view resolver on the inspection's drawn bounds, and the delivery camera takes the raster's aspect as the capture does. Wall time comes from the frame callback's own timestamp, so a frame's advance is the time actually elapsed. The subject's seek promise is the draw contract's readiness signal, so a picture is drawn only once the subject reports it can be.
53
- * @evidence contracts/development/implementation.md#clear-and-simple-structure One closure owns one mount: arrival, apply, frame, seek, paint, failure and dispose are local steps over one record of what is held; React, the DOM and WebGL stay with the component and the host.
54
- * @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts A refused request is reported with the request still drawn rather than drawn half-applied, an instance that arrives after dispose is released rather than drawn, and no frame is drawn from a size that is not positive.
55
- * @evidence contracts/development/implementation.md#efficient-algorithms A frame that changed nothing costs one size read and one snapshot comparison; a redraw costs the subject's seek, the inspection's update linear in its marks, one view resolution and the render. Paths and the first second's marks are listed once per mount.
56
- * @evidence contracts/development/implementation.md#reuse-equivalent-work The applied inspection, the renderer and the instance live for the whole mount; an inspection is re-applied only when its written text changes.
57
- * @evidence contracts/development/implementation.md#bound-retention-and-release-resources The mount owns one instance, one renderer, one applied inspection and at most one pending frame, released by `dispose` in reverse order, each attempted even when another fails; the playhead is borrowed and gains no listener.
86
+ * The page draws the first view and the first pass of the request; the capture
87
+ * command draws them all. While paused, the labels the request asks for are
88
+ * placed by the inspection on the picture's pixels, with the stamp's font pixel
89
+ * at least one CSS pixel of the canvas as a capture keeps it at least one sheet
90
+ * pixel, and reported in CSS pixels; a named view with a focus is framed on
91
+ * what the focus selects.
58
92
  */
59
93
  export function mountAutoMovieInspectorScene(props: {
60
94
  /** The subject to build. */
61
95
  subject: IAutoMovieDrawSubject;
62
96
 
63
- /** The subject's name, as the request's `subject` key and the refusals name it. */
97
+ /**
98
+ * The subject's name, as the request's `subject` key and the refusals name
99
+ * it.
100
+ */
64
101
  name: string;
65
102
 
66
103
  /** The request in force when the mount starts. */
@@ -76,9 +113,15 @@ export function mountAutoMovieInspectorScene(props: {
76
113
  report: IAutoMovieInspectorScene.IReport;
77
114
  }): IAutoMovieInspectorScene {
78
115
  const { host, playhead, report } = props;
116
+ const diagnosticLog: AutoMovieInspectorDiagnosticLog =
117
+ new AutoMovieInspectorDiagnosticLog(report);
118
+ const witnessCubes: ReturnType<
119
+ typeof createAutoMovieInspectionDiagnosticOverlay
120
+ > = createAutoMovieInspectionDiagnosticOverlay();
79
121
  let disposed: boolean = false;
122
+ let witnesses: boolean = true;
80
123
  let wanted: IAutoMovieCapturePlanRequest = props.request;
81
- let live: ILive | undefined;
124
+ let live: IAutoMovieInspectorLive | undefined;
82
125
 
83
126
  // The instance arrives later; one that arrives after dispose is released at once.
84
127
  props.subject
@@ -88,29 +131,23 @@ export function mountAutoMovieInspectorScene(props: {
88
131
  else await arrive(instance);
89
132
  })
90
133
  .catch((error: unknown): void => {
91
- if (!disposed) report.error(messageOf(error));
134
+ if (!disposed) report.error(messageOfAutoMovieInspectorError(error));
92
135
  });
93
136
 
94
- /** Take an arrived instance into use once it is ready at its first second, releasing it if anything fails. */
137
+ /**
138
+ * Take an arrived instance into use once it is ready at its first second,
139
+ * releasing it if anything fails.
140
+ */
95
141
  async function arrive(instance: IAutoMovieDrawScene): Promise<void> {
96
142
  let seconds: number;
97
143
  try {
98
- for (const [name, value] of [
99
- ["duration", instance.durationSeconds],
100
- ["fps", instance.fps],
101
- ["width", instance.width],
102
- ["height", instance.height],
103
- ] as const)
104
- if (!(Number.isFinite(value) && value > 0))
105
- throw new Error(
106
- `Subject "${props.name}" ${name} ${value} is not positive`,
107
- );
144
+ assertAutoMovieInspectorRaster(props.name, instance);
108
145
  playhead.setDuration(instance.durationSeconds);
109
- playhead.seek(firstSecond(wanted));
146
+ playhead.seek(firstAutoMovieInspectorSecond(wanted));
110
147
  seconds = playhead.getSnapshot().seconds;
111
148
  await instance.seek(seconds);
112
149
  } catch (error) {
113
- if (!disposed) report.error(messageOf(error));
150
+ if (!disposed) report.error(messageOfAutoMovieInspectorError(error));
114
151
  instance.dispose();
115
152
  return;
116
153
  }
@@ -122,64 +159,48 @@ export function mountAutoMovieInspectorScene(props: {
122
159
  }
123
160
  const held: (() => void)[] = [(): void => instance.dispose()];
124
161
  try {
125
- // Paths are listed before the inspection adds its own objects to the scene.
126
- const marks: NonNullable<IApplyAutoMovieInspectionProps["marks"]> =
127
- instance.marks?.(seconds) ?? [];
128
- const facts: IAutoMovieInspectorScene.IFacts = {
129
- paths: [
130
- ...listAutoMovieInspectionPaths(instance.scene).map(
131
- ({ path }: { path: string }): string => path,
132
- ),
133
- ...marks.map(({ path }: { path: string }): string => path),
134
- ],
135
- marks,
162
+ // Facts are read before the inspection adds its own objects to the scene.
163
+ const facts: IAutoMovieInspectorScene.IFacts =
164
+ readAutoMovieInspectorFacts({ instance, seconds });
165
+ const { marks } = facts;
136
166
 
137
- views: [
138
- ...Object.keys(instance.views ?? {}),
139
- ...autoMovieViewerNamedViewpoints().map(
140
- ({ id }: IAutoMovieViewerViewpoint): string => id,
141
- ),
142
- ],
143
- width: instance.width,
144
- height: instance.height,
145
- durationSeconds: instance.durationSeconds,
146
- fps: instance.fps,
147
- };
148
-
149
- const renderer: IAutoMovieInspectorSceneHost.IRenderer =
167
+ const { renderer, compositor }: IAutoMovieInspectorSceneHost.ICreated =
150
168
  host.createRenderer();
151
169
  held.push((): void => renderer.dispose());
152
- const inspect: (
153
- request: IAutoMovieCapturePlanRequest,
154
- ) => IAutoMovieInspectionHandle = (
155
- request: IAutoMovieCapturePlanRequest,
156
- ): IAutoMovieInspectionHandle =>
157
- applyAutoMovieInspection({
158
- scene: instance.scene,
159
- request: request.inspection,
160
- renderer,
161
- marks,
162
- });
170
+ const beauty: AutoMovieInspectorBeauty = new AutoMovieInspectorBeauty();
171
+ held.push((): void => beauty.dispose());
172
+ const transition: AutoMovieInspectorTransition =
173
+ new AutoMovieInspectorTransition();
174
+ held.push((): void => transition.dispose());
163
175
 
164
176
  // The newest request, or the one that asks for nothing when the scene refuses it.
165
177
  let applied: IAutoMovieCapturePlanRequest = wanted;
166
178
  let inspection: IAutoMovieInspectionHandle;
167
179
  let refusal: string | null = null;
168
180
  try {
169
- inspection = inspect(applied);
181
+ inspection = inspectAutoMovieInspectorRequest({
182
+ ...{ instance, renderer, marks },
183
+ request: applied,
184
+ });
170
185
  } catch (error) {
171
- refusal = messageOf(error);
186
+ refusal = messageOfAutoMovieInspectorError(error);
172
187
  applied = {
173
188
  ...readAutoMovieInspectorAddress(""),
174
189
  subject: wanted.subject,
175
190
  };
176
- inspection = inspect(applied);
191
+ inspection = inspectAutoMovieInspectorRequest({
192
+ ...{ instance, renderer, marks },
193
+ request: applied,
194
+ });
177
195
  }
178
196
  held.push((): void => inspection.restore());
179
197
  wanted = applied;
180
198
  live = {
181
199
  instance,
182
200
  renderer,
201
+ compositor,
202
+ beauty,
203
+ transition,
183
204
  inspection,
184
205
  applied,
185
206
  frame: undefined,
@@ -197,14 +218,17 @@ export function mountAutoMovieInspectorScene(props: {
197
218
  live.frame = host.requestFrame(frame);
198
219
  } catch (error) {
199
220
  live = undefined;
200
- report.error(messageOf(error));
201
- release(held.reverse());
221
+ report.error(messageOfAutoMovieInspectorError(error));
222
+ releaseAutoMovieInspectorSteps(held.reverse());
202
223
  }
203
224
  }
204
225
 
205
- /** One animation frame: advance, follow the size, redraw when something changed, schedule the next. */
226
+ /**
227
+ * One animation frame: advance, follow the size, redraw when something
228
+ * changed, schedule the next.
229
+ */
206
230
  function frame(nowMs: number): void {
207
- const now: ILive | undefined = live;
231
+ const now: IAutoMovieInspectorLive | undefined = live;
208
232
  if (disposed || now === undefined) return;
209
233
  now.frame = undefined;
210
234
  const wall: number =
@@ -212,22 +236,7 @@ export function mountAutoMovieInspectorScene(props: {
212
236
  now.lastMs = nowMs;
213
237
  playhead.advance(wall);
214
238
 
215
- const size: IAutoMovieInspectorSceneHost.ISize = host.size();
216
- const drawable: boolean = [size.width, size.height, size.pixelRatio].every(
217
- (value: number): boolean => Number.isFinite(value) && value > 0,
218
- );
219
- if (
220
- drawable &&
221
- (now.size === undefined ||
222
- now.size.width !== size.width ||
223
- now.size.height !== size.height ||
224
- now.size.pixelRatio !== size.pixelRatio)
225
- ) {
226
- now.renderer.setPixelRatio(size.pixelRatio);
227
- now.renderer.setSize(size.width, size.height, false);
228
- now.size = size;
229
- now.dirty = true;
230
- }
239
+ const drawable: boolean = followAutoMovieInspectorSize(now, host.size());
231
240
 
232
241
  const snapshot: AutoMovieInspectorPlayhead.ISnapshot =
233
242
  playhead.getSnapshot();
@@ -236,9 +245,12 @@ export function mountAutoMovieInspectorScene(props: {
236
245
  now.frame = host.requestFrame(frame);
237
246
  }
238
247
 
239
- /** Seek one second and draw it once the subject is ready there; frames skip drawing while a seek is pending. */
248
+ /**
249
+ * Place one second and draw it once the subject is ready there; frames skip
250
+ * drawing while a placement is pending.
251
+ */
240
252
  function draw(
241
- now: ILive,
253
+ now: IAutoMovieInspectorLive,
242
254
  snapshot: AutoMovieInspectorPlayhead.ISnapshot,
243
255
  ): void {
244
256
  now.dirty = false;
@@ -246,7 +258,22 @@ export function mountAutoMovieInspectorScene(props: {
246
258
  now.seeking = true;
247
259
  let ready: Promise<void>;
248
260
  try {
249
- ready = now.instance.seek(snapshot.seconds);
261
+ // An observation and the subject's feeds read the scene as placed, without what the inspection changed.
262
+ if (
263
+ readsAutoMovieInspectorPlacedScene(now.instance) &&
264
+ changesAutoMovieObservedScene(now.applied.inspection)
265
+ )
266
+ now.inspection.restore();
267
+ // A transition's other layers are placed, painted and held, and the shot the picture shows most of is placed last.
268
+ ready = now.transition.place({
269
+ name: props.name,
270
+ instance: now.instance,
271
+ request: now.applied.inspection,
272
+ compositor: now.compositor,
273
+ seconds: snapshot.seconds,
274
+ paint: (): void =>
275
+ beauty(now, filmCamera(now, snapshot.seconds), snapshot.seconds),
276
+ });
250
277
  } catch (error) {
251
278
  ready = Promise.reject(
252
279
  error instanceof Error ? error : new Error(String(error)),
@@ -263,43 +290,68 @@ export function mountAutoMovieInspectorScene(props: {
263
290
  });
264
291
  }
265
292
 
266
- /** Draw the second the subject is now at through the applied request's first view. */
293
+ /**
294
+ * Draw the second the subject is now at through the applied request's first
295
+ * view.
296
+ */
267
297
  function paint(
268
- now: ILive,
298
+ now: IAutoMovieInspectorLive,
269
299
  snapshot: AutoMovieInspectorPlayhead.ISnapshot,
270
300
  ): void {
271
301
  const { instance } = now;
272
302
  try {
273
- now.inspection.update(instance.marks?.(snapshot.seconds));
303
+ const diagnostics: IAutoMovieInspectionDiagnostics | undefined =
304
+ observeAutoMoviePlacedInspection(
305
+ instance,
306
+ snapshot.seconds,
307
+ "viewer",
308
+ undefined,
309
+ now.transition.byShot,
310
+ );
311
+ // The subject's render-target work, such as surface feeds, runs once on the placed scene's own materials before any shade applies, as the draw host runs it; only a WebGL renderer has render targets.
312
+ if (now.compositor !== null)
313
+ instance.beforeDraw?.(now.compositor, snapshot.seconds);
314
+ // Re-apply only an inspection that was restored for the scene's readers or changed; otherwise update its marks.
315
+ if (
316
+ readsAutoMovieInspectorPlacedScene(instance) &&
317
+ (changesAutoMovieObservedScene(now.applied.inspection) ||
318
+ changesAutoMovieObservedScene(wanted.inspection) ||
319
+ writeAutoMovieInspectorInspection(wanted) !==
320
+ writeAutoMovieInspectorInspection(now.applied))
321
+ ) {
322
+ now.inspection.restore();
323
+ if (installInspection(now, wanted, snapshot.seconds))
324
+ now.applied = wanted;
325
+ } else now.inspection.update(instance.marks?.(snapshot.seconds));
274
326
 
275
- // The delivery camera takes the raster's aspect, as a capture of the subject does.
276
- const aspect: number = instance.width / instance.height;
277
- if (instance.camera.aspect !== aspect) {
278
- instance.camera.aspect = aspect;
279
- instance.camera.updateProjectionMatrix();
280
- }
281
- const text: string = now.applied.views[0]!;
282
- const view: IAutoMovieInspectionView = parseAutoMovieInspectionView(text);
283
- const camera: THREE.Camera = resolveAutoMovieInspectionView({
284
- view,
285
- text,
286
- bounds:
287
- view.type === "named" ? now.inspection.bounds(view.focus) : null,
288
- camera: instance.camera,
289
- ...(instance.views === undefined ? {} : { views: instance.views }),
290
- seconds: snapshot.seconds,
291
- width: instance.width,
292
- height: instance.height,
293
- }).camera;
294
- now.renderer.render(instance.scene, camera);
295
- if (!snapshot.playing) {
296
- report.legend([...now.inspection.legend]);
297
- report.labels(place(now, camera));
298
- now.labelled = true;
299
- } else if (now.labelled) {
300
- report.labels({ labels: [], lineHeight: 0, dropped: 0 });
301
- now.labelled = false;
327
+ const camera: THREE.Camera = filmCamera(now, snapshot.seconds);
328
+ const shaded: boolean = now.applied.inspection.shade === "beauty";
329
+ const shown: () => void = (): void =>
330
+ beauty(now, camera, snapshot.seconds);
331
+ // A composited transition takes its witness cubes over the composite, at full strength.
332
+ const composited: boolean = shaded && now.transition.finish(shown);
333
+ const diagnosticLegend: ReturnType<typeof witnessCubes.render> =
334
+ witnessCubes.render({
335
+ scene: composited ? now.transition.overlay : instance.scene,
336
+ diagnostics: witnesses && shaded ? diagnostics : undefined,
337
+ render: (): void => {
338
+ // The beauty shade shows the delivered picture: the subject's optics, through the stage delivery draws with.
339
+ if (composited) now.transition.over(camera);
340
+ else if (shaded) shown();
341
+ else now.renderer.render(instance.scene, camera);
342
+ },
343
+ width: now.size!.width,
344
+ height: now.size!.height,
345
+ stroke: now.applied.inspection.stroke,
346
+ });
347
+ if (diagnostics !== undefined) {
348
+ diagnosticLog.observe(diagnostics, snapshot);
349
+ report.diagnostics?.(diagnostics);
302
350
  }
351
+ reportAutoMovieInspectorLabels({
352
+ ...{ now, report, camera, diagnosticLegend },
353
+ playing: snapshot.playing,
354
+ });
303
355
  if (now.error !== null) {
304
356
  now.error = null;
305
357
  report.error(null);
@@ -309,133 +361,139 @@ export function mountAutoMovieInspectorScene(props: {
309
361
  }
310
362
  }
311
363
 
312
- /** Report a drawing error once until a frame draws again, and stop playback on it. */
364
+ /** The applied view's camera at a placed second. */
365
+ function filmCamera(
366
+ now: IAutoMovieInspectorLive,
367
+ seconds: number,
368
+ ): THREE.Camera {
369
+ return resolveAutoMovieInspectorCamera({
370
+ instance: now.instance,
371
+ text: now.applied.views[0]!,
372
+ inspection: now.inspection,
373
+ seconds,
374
+ });
375
+ }
376
+
377
+ /**
378
+ * Paint the placed scene's beauty picture through the stages delivery draws
379
+ * one sample with.
380
+ */
381
+ function beauty(
382
+ now: IAutoMovieInspectorLive,
383
+ camera: THREE.Camera,
384
+ seconds: number,
385
+ ): void {
386
+ now.beauty.draw({
387
+ renderer: now.renderer,
388
+ instance: now.instance,
389
+ camera,
390
+ seconds,
391
+ width: Math.floor(now.size!.width * now.size!.pixelRatio),
392
+ height: Math.floor(now.size!.height * now.size!.pixelRatio),
393
+ });
394
+ }
395
+
396
+ /**
397
+ * Report a drawing error once until a frame draws again, and stop playback on
398
+ * it.
399
+ */
313
400
  function fail(
314
- now: ILive,
401
+ now: IAutoMovieInspectorLive,
315
402
  snapshot: AutoMovieInspectorPlayhead.ISnapshot,
316
403
  error: unknown,
317
404
  ): void {
318
405
  if (snapshot.playing) playhead.pause();
319
- const message: string = messageOf(error);
406
+ const message: string = messageOfAutoMovieInspectorError(error);
320
407
  if (message !== now.error) {
321
408
  now.error = message;
322
409
  report.error(message);
323
410
  }
324
411
  }
325
412
 
413
+ /**
414
+ * Install a request on the live subject; on refusal keep the applied one in
415
+ * force and report the refusal.
416
+ */
417
+ function installInspection(
418
+ now: IAutoMovieInspectorLive,
419
+ request: IAutoMovieCapturePlanRequest,
420
+ seconds: number,
421
+ ): boolean {
422
+ return installAutoMovieInspectorRequest({
423
+ ...{ now, request, seconds },
424
+ refused: (error: unknown): void => {
425
+ wanted = now.applied;
426
+ report.refused(now.applied, messageOfAutoMovieInspectorError(error));
427
+ },
428
+ });
429
+ }
326
430
  return {
327
431
  apply: (request: IAutoMovieCapturePlanRequest): void => {
328
432
  if (disposed || request === wanted) return;
329
433
  wanted = request;
330
- const now: ILive | undefined = live;
434
+ const now: IAutoMovieInspectorLive | undefined = live;
331
435
  if (now === undefined) return;
332
436
 
333
- // The inspection is re-applied only when its text changed; a refusal re-applies the previous one.
334
- if (written(request) !== written(now.applied)) {
335
- const seconds: number = playhead.getSnapshot().seconds;
336
- const inspect: (
337
- next: IAutoMovieCapturePlanRequest,
338
- ) => IAutoMovieInspectionHandle = (
339
- next: IAutoMovieCapturePlanRequest,
340
- ): IAutoMovieInspectionHandle =>
341
- applyAutoMovieInspection({
342
- scene: now.instance.scene,
343
- request: next.inspection,
344
- renderer: now.renderer,
345
- marks: now.instance.marks?.(seconds) ?? [],
346
- });
437
+ // Opted-in subjects apply each request only after the current settled scene is observed.
438
+ if (now.instance.inspectPlaced !== undefined) {
439
+ if (
440
+ firstAutoMovieInspectorSecond(request) !==
441
+ firstAutoMovieInspectorSecond(now.applied)
442
+ )
443
+ playhead.seek(firstAutoMovieInspectorSecond(request));
444
+ now.dirty = true;
445
+ return;
446
+ }
447
+
448
+ // A generic subject keeps its inspection until its request changes.
449
+ if (
450
+ writeAutoMovieInspectorInspection(request) !==
451
+ writeAutoMovieInspectorInspection(now.applied)
452
+ ) {
347
453
  now.inspection.restore();
348
- try {
349
- now.inspection = inspect(request);
350
- } catch (error) {
351
- now.inspection = inspect(now.applied);
352
- wanted = now.applied;
454
+ const accepted: boolean = installInspection(
455
+ now,
456
+ request,
457
+ playhead.getSnapshot().seconds,
458
+ );
459
+ if (!accepted) {
353
460
  now.dirty = true;
354
- report.refused(now.applied, messageOf(error));
355
461
  return;
356
462
  }
357
463
  report.legend([...now.inspection.legend]);
358
464
  }
359
- if (firstSecond(request) !== firstSecond(now.applied))
360
- playhead.seek(firstSecond(request));
465
+ if (
466
+ firstAutoMovieInspectorSecond(request) !==
467
+ firstAutoMovieInspectorSecond(now.applied)
468
+ )
469
+ playhead.seek(firstAutoMovieInspectorSecond(request));
361
470
  now.applied = request;
362
471
  now.dirty = true;
363
472
  },
473
+ overlay: (show: boolean): void => {
474
+ if (disposed || show === witnesses) return;
475
+ witnesses = show;
476
+ if (live !== undefined) live.dirty = true;
477
+ },
364
478
  dispose: (): void => {
365
479
  if (disposed) return;
366
480
  disposed = true;
367
- const now: ILive | undefined = live;
481
+ const now: IAutoMovieInspectorLive | undefined = live;
368
482
  live = undefined;
369
483
  if (now === undefined) return;
370
- release([
484
+ releaseAutoMovieInspectorSteps([
371
485
  (): void => {
372
486
  if (now.frame !== undefined) host.cancelFrame(now.frame);
373
487
  now.frame = undefined;
374
488
  },
375
489
  (): void => now.inspection.restore(),
490
+ (): void => now.transition.dispose(),
491
+ (): void => now.beauty.dispose(),
376
492
  (): void => now.renderer.dispose(),
377
493
  (): void => now.instance.dispose(),
494
+ (): void => diagnosticLog.dispose(),
495
+ (): void => witnessCubes.dispose(),
378
496
  ]);
379
497
  },
380
498
  };
381
499
  }
382
-
383
- /** The labels of a paused picture in CSS pixels of the canvas. */
384
- function place(
385
- now: ILive,
386
- camera: THREE.Camera,
387
- ): IAutoMovieInspectorScene.ILabels {
388
- const { width, height } = now.instance;
389
- const shown: IAutoMovieInspectorSceneHost.ISize = now.size!;
390
-
391
- // The stamp's font pixel stays at least one CSS pixel, as a capture keeps it at least one sheet pixel.
392
- const scale: number = Math.max(1, Math.ceil(height / shown.height));
393
- const placed: ReturnType<IAutoMovieInspectionHandle["labels"]> =
394
- now.inspection.labels(camera, width, height, scale);
395
- return {
396
- labels: placed.labels.map(
397
- (
398
- label: IAutoMovieInspectionLabel,
399
- ): IAutoMovieInspectorScene.ILabels["labels"][number] => ({
400
- path: label.path,
401
- text: label.text,
402
- left: (label.x * shown.width) / width,
403
- top: (label.y * shown.height) / height,
404
- }),
405
- ),
406
- // The stamp's box is nine font pixels high.
407
- lineHeight: (9 * scale * shown.height) / height,
408
- dropped: placed.dropped.length,
409
- };
410
- }
411
-
412
- /** The first second a request draws: its first explicit second, or the start of its sampling. */
413
- function firstSecond(request: IAutoMovieCapturePlanRequest): number {
414
- return request.sampling.kind === "at"
415
- ? request.sampling.seconds[0]!
416
- : request.sampling.from;
417
- }
418
-
419
- /** A request's inspection as the text it writes, the identity an applied inspection is reused by. */
420
- function written(request: IAutoMovieCapturePlanRequest): string {
421
- return JSON.stringify(formatAutoMovieInspectionRequest(request.inspection));
422
- }
423
-
424
- /** Run every step, then throw every failure together. */
425
- function release(steps: readonly (() => void)[]): void {
426
- const failures: unknown[] = [];
427
- for (const step of steps)
428
- try {
429
- step();
430
- } catch (error) {
431
- failures.push(error);
432
- }
433
- if (failures.length === 1) throw failures[0];
434
- if (failures.length > 1)
435
- throw new AggregateError(failures, "The inspector mount failed to release");
436
- }
437
-
438
- /** The text of a thrown value. */
439
- function messageOf(error: unknown): string {
440
- return error instanceof Error ? error.message : String(error);
441
- }