supervision 0.0.9000 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -2
  3. package/dist/constants/media-renderer.d.ts +9 -0
  4. package/dist/constants/media-renderer.d.ts.map +1 -0
  5. package/dist/detections/browser-cold-detection-frame-store.d.ts +5 -0
  6. package/dist/detections/browser-cold-detection-frame-store.d.ts.map +1 -0
  7. package/dist/detections/chunked-detection-frame-source.d.ts +3 -0
  8. package/dist/detections/chunked-detection-frame-source.d.ts.map +1 -0
  9. package/dist/detections/offset-detection-frame-source.d.ts +10 -0
  10. package/dist/detections/offset-detection-frame-source.d.ts.map +1 -0
  11. package/dist/editing/mask-brush-editor.d.ts +47 -0
  12. package/dist/editing/mask-brush-editor.d.ts.map +1 -0
  13. package/dist/editing.d.ts +8 -0
  14. package/dist/editing.d.ts.map +1 -0
  15. package/dist/editing.js +265 -0
  16. package/dist/editing.js.map +1 -0
  17. package/dist/index.d.ts +58 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +9419 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/mask-preparation.worker.js +823 -0
  22. package/dist/mask-preparation.worker.js.map +1 -0
  23. package/dist/media/decoded-video-sample-reader.d.ts +8 -0
  24. package/dist/media/decoded-video-sample-reader.d.ts.map +1 -0
  25. package/dist/media/media-metadata.d.ts +21 -0
  26. package/dist/media/media-metadata.d.ts.map +1 -0
  27. package/dist/media/media-normalization.d.ts +6 -0
  28. package/dist/media/media-normalization.d.ts.map +1 -0
  29. package/dist/media/media-preparation.d.ts +9 -0
  30. package/dist/media/media-preparation.d.ts.map +1 -0
  31. package/dist/media/media-probe.d.ts +3 -0
  32. package/dist/media/media-probe.d.ts.map +1 -0
  33. package/dist/media/media-source-state.d.ts +5 -0
  34. package/dist/media/media-source-state.d.ts.map +1 -0
  35. package/dist/media/media-source.d.ts +38 -0
  36. package/dist/media/media-source.d.ts.map +1 -0
  37. package/dist/media/media-stream-media-source.d.ts +27 -0
  38. package/dist/media/media-stream-media-source.d.ts.map +1 -0
  39. package/dist/media/mediabunny-media-source.d.ts +13 -0
  40. package/dist/media/mediabunny-media-source.d.ts.map +1 -0
  41. package/dist/media/static-image-media-source.d.ts +13 -0
  42. package/dist/media/static-image-media-source.d.ts.map +1 -0
  43. package/dist/playback/media-playback-controller.d.ts +24 -0
  44. package/dist/playback/media-playback-controller.d.ts.map +1 -0
  45. package/dist/render-preparation/default-render-preparation-worker.d.ts +8 -0
  46. package/dist/render-preparation/default-render-preparation-worker.d.ts.map +1 -0
  47. package/dist/render-preparation/embedded-mask-preparation-worker.d.ts +2 -0
  48. package/dist/render-preparation/embedded-mask-preparation-worker.d.ts.map +1 -0
  49. package/dist/render-preparation/mask-frame-artifact.d.ts +28 -0
  50. package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -0
  51. package/dist/render-preparation/mask-frame-compositor.d.ts +14 -0
  52. package/dist/render-preparation/mask-frame-compositor.d.ts.map +1 -0
  53. package/dist/render-preparation/mask-frame-preparer.d.ts +19 -0
  54. package/dist/render-preparation/mask-frame-preparer.d.ts.map +1 -0
  55. package/dist/render-preparation/mask-preparation-worker-count.d.ts +15 -0
  56. package/dist/render-preparation/mask-preparation-worker-count.d.ts.map +1 -0
  57. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts +64 -0
  58. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -0
  59. package/dist/render-preparation/mask-preparation.worker.d.ts +2 -0
  60. package/dist/render-preparation/mask-preparation.worker.d.ts.map +1 -0
  61. package/dist/render-preparation/prepared-render-window.d.ts +46 -0
  62. package/dist/render-preparation/prepared-render-window.d.ts.map +1 -0
  63. package/dist/render-preparation/prepared-window-timeline.d.ts +16 -0
  64. package/dist/render-preparation/prepared-window-timeline.d.ts.map +1 -0
  65. package/dist/renderers/media-renderer-core.d.ts +9 -0
  66. package/dist/renderers/media-renderer-core.d.ts.map +1 -0
  67. package/dist/renderers/media-renderer-scene.d.ts +77 -0
  68. package/dist/renderers/media-renderer-scene.d.ts.map +1 -0
  69. package/dist/renderers/media-renderer-state.d.ts +44 -0
  70. package/dist/renderers/media-renderer-state.d.ts.map +1 -0
  71. package/dist/renderers/media-renderer.d.ts +8 -0
  72. package/dist/renderers/media-renderer.d.ts.map +1 -0
  73. package/dist/renderers/pixi-annotation-overlay-layer.d.ts +25 -0
  74. package/dist/renderers/pixi-annotation-overlay-layer.d.ts.map +1 -0
  75. package/dist/renderers/pixi-box-layer.d.ts +28 -0
  76. package/dist/renderers/pixi-box-layer.d.ts.map +1 -0
  77. package/dist/renderers/pixi-focus-layer.d.ts +92 -0
  78. package/dist/renderers/pixi-focus-layer.d.ts.map +1 -0
  79. package/dist/renderers/pixi-id-mask-shader.d.ts +62 -0
  80. package/dist/renderers/pixi-id-mask-shader.d.ts.map +1 -0
  81. package/dist/renderers/pixi-interaction-layer.d.ts +63 -0
  82. package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -0
  83. package/dist/renderers/pixi-interaction-presentation-layer.d.ts +84 -0
  84. package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -0
  85. package/dist/renderers/pixi-label-layer.d.ts +32 -0
  86. package/dist/renderers/pixi-label-layer.d.ts.map +1 -0
  87. package/dist/renderers/pixi-mask-brush-preview.d.ts +26 -0
  88. package/dist/renderers/pixi-mask-brush-preview.d.ts.map +1 -0
  89. package/dist/renderers/pixi-mask-layer.d.ts +98 -0
  90. package/dist/renderers/pixi-mask-layer.d.ts.map +1 -0
  91. package/dist/renderers/pixi-media-scene.d.ts +6 -0
  92. package/dist/renderers/pixi-media-scene.d.ts.map +1 -0
  93. package/dist/renderers/pixi-path.d.ts +15 -0
  94. package/dist/renderers/pixi-path.d.ts.map +1 -0
  95. package/dist/renderers/pixi-polygon-layer.d.ts +32 -0
  96. package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -0
  97. package/dist/renderers/pixi-scene-fit.d.ts +14 -0
  98. package/dist/renderers/pixi-scene-fit.d.ts.map +1 -0
  99. package/dist/renderers/pixi-scene-layer-slot.d.ts +23 -0
  100. package/dist/renderers/pixi-scene-layer-slot.d.ts.map +1 -0
  101. package/dist/renderers/pixi-vector-layer.d.ts +24 -0
  102. package/dist/renderers/pixi-vector-layer.d.ts.map +1 -0
  103. package/dist/sessions/media-session-defaults.d.ts +21 -0
  104. package/dist/sessions/media-session-defaults.d.ts.map +1 -0
  105. package/dist/sessions/media-session-detections.d.ts +16 -0
  106. package/dist/sessions/media-session-detections.d.ts.map +1 -0
  107. package/dist/sessions/media-session-media.d.ts +19 -0
  108. package/dist/sessions/media-session-media.d.ts.map +1 -0
  109. package/dist/sessions/media-session-state.d.ts +12 -0
  110. package/dist/sessions/media-session-state.d.ts.map +1 -0
  111. package/dist/sessions/media-session.d.ts +10 -0
  112. package/dist/sessions/media-session.d.ts.map +1 -0
  113. package/dist/types/media-normalization.d.ts +119 -0
  114. package/dist/types/media-normalization.d.ts.map +1 -0
  115. package/dist/types/media-preparation.d.ts +30 -0
  116. package/dist/types/media-preparation.d.ts.map +1 -0
  117. package/dist/types/media-renderer.d.ts +115 -0
  118. package/dist/types/media-renderer.d.ts.map +1 -0
  119. package/dist/types/media-session.d.ts +242 -0
  120. package/dist/types/media-session.d.ts.map +1 -0
  121. package/dist/types/render-preparation.d.ts +164 -0
  122. package/dist/types/render-preparation.d.ts.map +1 -0
  123. package/dist/workers/worker-rpc-client.d.ts +15 -0
  124. package/dist/workers/worker-rpc-client.d.ts.map +1 -0
  125. package/node_modules/supervision-js-core/dist/detections/array-detection-frame-source.d.ts +4 -0
  126. package/node_modules/supervision-js-core/dist/detections/array-detection-frame-source.d.ts.map +1 -0
  127. package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts +14 -0
  128. package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts.map +1 -0
  129. package/node_modules/supervision-js-core/dist/detections/cold-detection-frame-source.d.ts +6 -0
  130. package/node_modules/supervision-js-core/dist/detections/cold-detection-frame-source.d.ts.map +1 -0
  131. package/node_modules/supervision-js-core/dist/detections/composite-detection-frame-source.d.ts +3 -0
  132. package/node_modules/supervision-js-core/dist/detections/composite-detection-frame-source.d.ts.map +1 -0
  133. package/node_modules/supervision-js-core/dist/detections/editable-annotation-frame-session.d.ts +35 -0
  134. package/node_modules/supervision-js-core/dist/detections/editable-annotation-frame-session.d.ts.map +1 -0
  135. package/node_modules/supervision-js-core/dist/detections/memory-cold-detection-frame-store.d.ts +3 -0
  136. package/node_modules/supervision-js-core/dist/detections/memory-cold-detection-frame-store.d.ts.map +1 -0
  137. package/node_modules/supervision-js-core/dist/detections/writable-detection-frame-source.d.ts +8 -0
  138. package/node_modules/supervision-js-core/dist/detections/writable-detection-frame-source.d.ts.map +1 -0
  139. package/node_modules/supervision-js-core/dist/index.d.ts +65 -0
  140. package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -0
  141. package/node_modules/supervision-js-core/dist/index.js +4277 -0
  142. package/node_modules/supervision-js-core/dist/index.js.map +1 -0
  143. package/node_modules/supervision-js-core/dist/interactions/annotation-editing-engine.d.ts +3 -0
  144. package/node_modules/supervision-js-core/dist/interactions/annotation-editing-engine.d.ts.map +1 -0
  145. package/node_modules/supervision-js-core/dist/interactions/annotation-handles.d.ts +13 -0
  146. package/node_modules/supervision-js-core/dist/interactions/annotation-handles.d.ts.map +1 -0
  147. package/node_modules/supervision-js-core/dist/interactions/detection-picker.d.ts +7 -0
  148. package/node_modules/supervision-js-core/dist/interactions/detection-picker.d.ts.map +1 -0
  149. package/node_modules/supervision-js-core/dist/interactions/viewport-controller.d.ts +6 -0
  150. package/node_modules/supervision-js-core/dist/interactions/viewport-controller.d.ts.map +1 -0
  151. package/node_modules/supervision-js-core/dist/styles/box-style.d.ts +44 -0
  152. package/node_modules/supervision-js-core/dist/styles/box-style.d.ts.map +1 -0
  153. package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts +20 -0
  154. package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts.map +1 -0
  155. package/node_modules/supervision-js-core/dist/styles/focus-style.d.ts +37 -0
  156. package/node_modules/supervision-js-core/dist/styles/focus-style.d.ts.map +1 -0
  157. package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts +64 -0
  158. package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts.map +1 -0
  159. package/node_modules/supervision-js-core/dist/styles/keypoint-style.d.ts +19 -0
  160. package/node_modules/supervision-js-core/dist/styles/keypoint-style.d.ts.map +1 -0
  161. package/node_modules/supervision-js-core/dist/styles/label-style.d.ts +61 -0
  162. package/node_modules/supervision-js-core/dist/styles/label-style.d.ts.map +1 -0
  163. package/node_modules/supervision-js-core/dist/styles/mask-style.d.ts +55 -0
  164. package/node_modules/supervision-js-core/dist/styles/mask-style.d.ts.map +1 -0
  165. package/node_modules/supervision-js-core/dist/styles/polygon-style.d.ts +15 -0
  166. package/node_modules/supervision-js-core/dist/styles/polygon-style.d.ts.map +1 -0
  167. package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts +14 -0
  168. package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts.map +1 -0
  169. package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts +22 -0
  170. package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts.map +1 -0
  171. package/node_modules/supervision-js-core/dist/styles/style-value.d.ts +4 -0
  172. package/node_modules/supervision-js-core/dist/styles/style-value.d.ts.map +1 -0
  173. package/node_modules/supervision-js-core/dist/types/box-style.d.ts +58 -0
  174. package/node_modules/supervision-js-core/dist/types/box-style.d.ts.map +1 -0
  175. package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts +325 -0
  176. package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts.map +1 -0
  177. package/node_modules/supervision-js-core/dist/types/detections.d.ts +183 -0
  178. package/node_modules/supervision-js-core/dist/types/detections.d.ts.map +1 -0
  179. package/node_modules/supervision-js-core/dist/types/editing.d.ts +140 -0
  180. package/node_modules/supervision-js-core/dist/types/editing.d.ts.map +1 -0
  181. package/node_modules/supervision-js-core/dist/types/focus-style.d.ts +36 -0
  182. package/node_modules/supervision-js-core/dist/types/focus-style.d.ts.map +1 -0
  183. package/node_modules/supervision-js-core/dist/types/interaction-style.d.ts +44 -0
  184. package/node_modules/supervision-js-core/dist/types/interaction-style.d.ts.map +1 -0
  185. package/node_modules/supervision-js-core/dist/types/interaction.d.ts +70 -0
  186. package/node_modules/supervision-js-core/dist/types/interaction.d.ts.map +1 -0
  187. package/node_modules/supervision-js-core/dist/types/keypoint-style.d.ts +30 -0
  188. package/node_modules/supervision-js-core/dist/types/keypoint-style.d.ts.map +1 -0
  189. package/node_modules/supervision-js-core/dist/types/label-style.d.ts +65 -0
  190. package/node_modules/supervision-js-core/dist/types/label-style.d.ts.map +1 -0
  191. package/node_modules/supervision-js-core/dist/types/mask-style.d.ts +59 -0
  192. package/node_modules/supervision-js-core/dist/types/mask-style.d.ts.map +1 -0
  193. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +204 -0
  194. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -0
  195. package/node_modules/supervision-js-core/dist/types/media.d.ts +42 -0
  196. package/node_modules/supervision-js-core/dist/types/media.d.ts.map +1 -0
  197. package/node_modules/supervision-js-core/dist/types/polygon-style.d.ts +13 -0
  198. package/node_modules/supervision-js-core/dist/types/polygon-style.d.ts.map +1 -0
  199. package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts +12 -0
  200. package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts.map +1 -0
  201. package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts +106 -0
  202. package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts.map +1 -0
  203. package/node_modules/supervision-js-core/dist/types/style.d.ts +28 -0
  204. package/node_modules/supervision-js-core/dist/types/style.d.ts.map +1 -0
  205. package/node_modules/supervision-js-core/dist/types/viewport.d.ts +19 -0
  206. package/node_modules/supervision-js-core/dist/types/viewport.d.ts.map +1 -0
  207. package/node_modules/supervision-js-core/dist/utils/annotation-visibility.d.ts +5 -0
  208. package/node_modules/supervision-js-core/dist/utils/annotation-visibility.d.ts.map +1 -0
  209. package/node_modules/supervision-js-core/dist/utils/color-palette.d.ts +12 -0
  210. package/node_modules/supervision-js-core/dist/utils/color-palette.d.ts.map +1 -0
  211. package/node_modules/supervision-js-core/dist/utils/color.d.ts +4 -0
  212. package/node_modules/supervision-js-core/dist/utils/color.d.ts.map +1 -0
  213. package/node_modules/supervision-js-core/dist/utils/detection-conversions.d.ts +24 -0
  214. package/node_modules/supervision-js-core/dist/utils/detection-conversions.d.ts.map +1 -0
  215. package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts +16 -0
  216. package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts.map +1 -0
  217. package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts +31 -0
  218. package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts.map +1 -0
  219. package/node_modules/supervision-js-core/dist/utils/geometry.d.ts +11 -0
  220. package/node_modules/supervision-js-core/dist/utils/geometry.d.ts.map +1 -0
  221. package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts +18 -0
  222. package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts.map +1 -0
  223. package/node_modules/supervision-js-core/dist/utils/mask-style.d.ts +4 -0
  224. package/node_modules/supervision-js-core/dist/utils/mask-style.d.ts.map +1 -0
  225. package/node_modules/supervision-js-core/dist/utils/object.d.ts +2 -0
  226. package/node_modules/supervision-js-core/dist/utils/object.d.ts.map +1 -0
  227. package/node_modules/supervision-js-core/package.json +51 -0
  228. package/package.json +92 -16
  229. package/index.js +0 -0
@@ -0,0 +1,38 @@
1
+ export interface DecodedVideoSample {
2
+ readonly timestamp: number;
3
+ readonly duration: number;
4
+ draw(context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, dx: number, dy: number, dWidth?: number, dHeight?: number): void;
5
+ close(): void;
6
+ }
7
+ export interface DecodedVideoSampleSink {
8
+ getSample(timestamp: number, options?: {
9
+ skipLiveWait?: boolean;
10
+ }): Promise<DecodedVideoSample | null>;
11
+ samples(startTimestamp?: number, endTimestamp?: number, options?: {
12
+ skipLiveWait?: boolean;
13
+ }): AsyncGenerator<DecodedVideoSample, void, unknown>;
14
+ }
15
+ export interface DisposableMediaInput {
16
+ dispose(): void;
17
+ }
18
+ export interface DecodedMediaSourceMetadata {
19
+ readonly canRead: boolean;
20
+ readonly formatName: string | null;
21
+ readonly formatMimeType: string | null;
22
+ readonly mimeType: string | null;
23
+ readonly duration: number | null;
24
+ readonly trackCount: number;
25
+ readonly videoTrackCount: number;
26
+ readonly audioTrackCount: number;
27
+ readonly primaryVideoWidth: number;
28
+ readonly primaryVideoHeight: number;
29
+ readonly firstTimestamp: number;
30
+ readonly estimatedFrameRate?: number | null;
31
+ readonly estimatedFrameCount?: number | null;
32
+ }
33
+ export interface DecodedMediaSource {
34
+ readonly input: DisposableMediaInput;
35
+ readonly metadata: DecodedMediaSourceMetadata;
36
+ readonly sampleSink: DecodedVideoSampleSink;
37
+ }
38
+ //# sourceMappingURL=media-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-source.d.ts","sourceRoot":"","sources":["../../src/media/media-source.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,IAAI,CACF,OAAO,EAAE,wBAAwB,GAAG,iCAAiC,EACrE,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAAC;IACR,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS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Q,CAAC,UAAU,EAAE,sBAAsB,CAAC;CAC7C"}
@@ -0,0 +1,27 @@
1
+ import type { MediaRendererSource } from "#types/media-renderer";
2
+ export type MediaStreamRendererSourceOptions = {
3
+ /** Maximum decoded snapshots retained while the renderer is catching up. */
4
+ readonly maxBufferedFrames?: number;
5
+ /**
6
+ * Timestamp origin exposed to the renderer. `"media"` preserves the browser
7
+ * MediaStream clock. `"first-frame"` starts the visible timeline at zero so
8
+ * an independently transported detection stream can apply the same origin.
9
+ * Defaults to `"media"`.
10
+ */
11
+ readonly timestampOrigin?: "first-frame" | "media";
12
+ /**
13
+ * Stop the caller-supplied MediaStream tracks when the session is destroyed.
14
+ * Defaults to false because WebRTC connection ownership normally stays with
15
+ * the host application.
16
+ */
17
+ readonly stopTracksOnDispose?: boolean;
18
+ };
19
+ /**
20
+ * Adapts a browser MediaStream to the renderer-owned decoded-media boundary.
21
+ *
22
+ * The HTMLVideoElement is an internal decode clock only. Every presented frame
23
+ * is snapshotted before it enters the bounded queue, so Pixi remains the sole
24
+ * visible composition surface and annotations use the exact sample timestamp.
25
+ */
26
+ export declare function createMediaStreamRendererSource(stream: MediaStream, options?: MediaStreamRendererSourceOptions): MediaRendererSource;
27
+ //# sourceMappingURL=media-stream-media-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-stream-media-source.d.ts","sourceRoot":"","sources":["../../src/media/media-stream-media-source.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAMjE,MAAM,MAAM,gCAAgC,GAAG;IAC7C,4EAA4E;IAC5E,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;IACnD;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAaF;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,gCAAqC,GAC7C,mBAAmB,CAMrB"}
@@ -0,0 +1,13 @@
1
+ import type { DecodedMediaSource } from "./media-source";
2
+ import type { MediaRendererSource } from "#types/media-renderer";
3
+ import type { InputFormat, Source } from "mediabunny";
4
+ export interface MediabunnyMediaSourceInput {
5
+ readonly formats?: readonly InputFormat[];
6
+ readonly metadata?: {
7
+ readonly duration?: number | null;
8
+ };
9
+ readonly source: Source;
10
+ }
11
+ export declare function openMediabunnyMediaSource(sourceInput: string | URL | Request | MediabunnyMediaSourceInput): Promise<DecodedMediaSource>;
12
+ export declare function createMediabunnyMediaRendererSource(sourceInput: MediabunnyMediaSourceInput): MediaRendererSource;
13
+ //# sourceMappingURL=mediabunny-media-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mediabunny-media-source.d.ts","sourceRoot":"","sources":["../../src/media/mediabunny-media-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACnC,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAID,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,0BAA0B,GAC/D,OAAO,CAAC,kBAAkB,CAAC,CA+F7B;AAYD,wBAAgB,mCAAmC,CACjD,WAAW,EAAE,0BAA0B,GACtC,mBAAmB,CAMrB"}
@@ -0,0 +1,13 @@
1
+ import type { MediaRendererSource } from "#types/media-renderer";
2
+ export type StaticImageSource = HTMLImageElement | ImageBitmap | HTMLCanvasElement | OffscreenCanvas | VideoFrame;
3
+ export interface HostFrameSource {
4
+ readonly width: number;
5
+ readonly height: number;
6
+ draw(context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, dx: number, dy: number, dWidth: number, dHeight: number): void;
7
+ }
8
+ /** Creates an image-first renderer source without routing through Mediabunny. */
9
+ export declare function createStaticImageMediaSource(source: StaticImageSource | HostFrameSource): MediaRendererSource;
10
+ export declare function createImageUrlMediaSource(src: string, options?: {
11
+ readonly crossOrigin?: string;
12
+ }): MediaRendererSource;
13
+ //# sourceMappingURL=static-image-media-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-image-media-source.d.ts","sourceRoot":"","sources":["../../src/media/static-image-media-source.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,MAAM,MAAM,iBAAiB,GACzB,gBAAgB,GAChB,WAAW,GACX,iBAAiB,GACjB,eAAe,GACf,UAAU,CAAC;AAEf,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,IAAI,CACF,OAAO,EAAE,wBAAwB,GAAG,iCAAiC,EACrE,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,IAAI,CAAC;CACT;AAED,iFAAiF;AACjF,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,iBAAiB,GAAG,eAAe,GAC1C,mBAAmB,CAkBrB;AAED,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,MAAM,EACX,OAAO,GAAE;IAAE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GAC9C,mBAAmB,CAMrB"}
@@ -0,0 +1,24 @@
1
+ import type { DecodedVideoSample, DecodedVideoSampleSink } from "#media/media-source";
2
+ export interface MediaPlaybackController {
3
+ play(): void;
4
+ pause(): void;
5
+ seek(mediaTime: number): void;
6
+ setPlaybackRate(playbackRate: number): void;
7
+ destroy(): void;
8
+ }
9
+ export declare function createMediaPlaybackController(options: {
10
+ readonly sampleSink: DecodedVideoSampleSink;
11
+ readonly firstTimestamp: number;
12
+ readonly duration: number | null;
13
+ readonly loop: boolean;
14
+ readonly initialMediaTime: number;
15
+ readonly playbackRate?: number;
16
+ readonly presentSample: (sample: DecodedVideoSample) => void;
17
+ readonly waitForSample?: (sample: DecodedVideoSample) => Promise<void>;
18
+ readonly onCurrentTimeChange: (currentTime: number) => void;
19
+ readonly onEnded: () => void;
20
+ readonly onError: (error: unknown) => void;
21
+ readonly onWaiting?: () => void;
22
+ readonly onResume?: () => void;
23
+ }): MediaPlaybackController;
24
+ //# sourceMappingURL=media-playback-controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-playback-controller.d.ts","sourceRoot":"","sources":["../../src/playback/media-playback-controller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAU7B,MAAM,WAAW,uBAAuB;IACtC,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE;IACrD,QAAQ,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAC5C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvE,QAAQ,CAAC,mBAAmB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC,GAAG,uBAAuB,CA8c1B"}
@@ -0,0 +1,8 @@
1
+ import type { RenderPreparationWorkerFactory } from "#types/render-preparation";
2
+ /**
3
+ * Creates workers from the self-contained source embedded in the browser
4
+ * package. The shared object URL is intentionally retained for the lifetime of
5
+ * the module so every session and every member of a worker pool can reuse it.
6
+ */
7
+ export declare function createDefaultRenderPreparationWorkerFactory(): RenderPreparationWorkerFactory;
8
+ //# sourceMappingURL=default-render-preparation-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-render-preparation-worker.d.ts","sourceRoot":"","sources":["../../src/render-preparation/default-render-preparation-worker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAKhF;;;;GAIG;AACH,wBAAgB,2CAA2C,IAAI,8BAA8B,CAc5F"}
@@ -0,0 +1,2 @@
1
+ export declare const EMBEDDED_MASK_PREPARATION_WORKER_SOURCE = "__SUPERVISION_JS_EMBEDDED_MASK_PREPARATION_WORKER_SOURCE__";
2
+ //# sourceMappingURL=embedded-mask-preparation-worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedded-mask-preparation-worker.d.ts","sourceRoot":"","sources":["../../src/render-preparation/embedded-mask-preparation-worker.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uCAAuC,+DACU,CAAC"}
@@ -0,0 +1,28 @@
1
+ export declare enum PreparedMaskFrameKind {
2
+ PngIdMask = "pngIdMask",
3
+ RgbaImage = "rgbaImage"
4
+ }
5
+ export interface PreparedRgbaMaskFrame {
6
+ readonly height: number;
7
+ readonly key: string;
8
+ readonly kind: PreparedMaskFrameKind.RgbaImage;
9
+ readonly source: HTMLCanvasElement | ImageBitmap;
10
+ readonly width: number;
11
+ close(): void;
12
+ }
13
+ export interface PreparedPngIdMaskFrame {
14
+ readonly fillPalette: Float32Array<ArrayBuffer>;
15
+ readonly hasStroke: boolean;
16
+ readonly height: number;
17
+ readonly key: string;
18
+ readonly kind: PreparedMaskFrameKind.PngIdMask;
19
+ readonly maxStrokeWidth: number;
20
+ readonly png: Uint8Array<ArrayBuffer>;
21
+ readonly source: ImageBitmap;
22
+ readonly strokePalette: Float32Array<ArrayBuffer>;
23
+ readonly strokeWidths: Float32Array<ArrayBuffer>;
24
+ readonly width: number;
25
+ close(): void;
26
+ }
27
+ export type PreparedMaskFrame = PreparedPngIdMaskFrame | PreparedRgbaMaskFrame;
28
+ //# sourceMappingURL=mask-frame-artifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-frame-artifact.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-artifact.ts"],"names":[],"mappings":"AAAA,oBAAY,qBAAqB;IAC/B,SAAS,cAAc;IACvB,SAAS,cAAc;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC;IAC/C,QAAQ,CAAC,MAAM,EAAE,iBAAiB,GAAG,WAAW,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAChD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC;IAC/C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAClD,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GAAG,qBAAqB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { SerializableMaskInstruction } from "#render-preparation/mask-preparation-worker-protocol";
2
+ import { type IdMaskFrame } from "supervision-js-core";
3
+ export { MAX_ID_MASK_PALETTE_ENTRIES, MAX_ID_MASK_STROKE_WIDTH, createIdMaskFrame, type IdMaskFrame, } from "supervision-js-core";
4
+ export interface CompositedMaskFrame {
5
+ readonly data: Uint8ClampedArray<ArrayBuffer>;
6
+ readonly height: number;
7
+ readonly width: number;
8
+ }
9
+ export interface PngIdMaskFrame extends IdMaskFrame {
10
+ readonly png: Uint8Array<ArrayBuffer>;
11
+ }
12
+ export declare function compositeMaskFrame(instructions: readonly SerializableMaskInstruction[]): CompositedMaskFrame | undefined;
13
+ export declare function createPngIdMaskFrame(instructions: readonly SerializableMaskInstruction[]): Promise<PngIdMaskFrame | undefined>;
14
+ //# sourceMappingURL=mask-frame-compositor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-frame-compositor.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-compositor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AAExG,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAmB7B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CACvC;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,SAAS,2BAA2B,EAAE,GACnD,mBAAmB,GAAG,SAAS,CAgBjC;AAED,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,SAAS,2BAA2B,EAAE,GACnD,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAerC"}
@@ -0,0 +1,19 @@
1
+ import { PreparedMaskFrameKind, type PreparedMaskFrame } from "#render-preparation/mask-frame-artifact";
2
+ import { type MaskFramePreparationJob } from "#render-preparation/mask-preparation-worker-protocol";
3
+ import { RenderPreparationExecutionMode, RenderPreparationWorkerStatus, type RenderPreparationOptions } from "#types/render-preparation";
4
+ export { PreparedMaskFrameKind, type PreparedMaskFrame };
5
+ export interface MaskFramePreparerStatus {
6
+ readonly executionMode: RenderPreparationExecutionMode;
7
+ readonly message: string | null;
8
+ readonly workerStatus: RenderPreparationWorkerStatus;
9
+ }
10
+ export interface MaskFramePreparer {
11
+ getStatus(): MaskFramePreparerStatus;
12
+ prepare(job: MaskFramePreparationJob): Promise<PreparedMaskFrame | undefined>;
13
+ destroy(): void;
14
+ }
15
+ export declare function createMaskFramePreparer(options?: {
16
+ readonly renderPreparation?: RenderPreparationOptions;
17
+ readonly onStatusChange?: () => void;
18
+ }): MaskFramePreparer;
19
+ //# sourceMappingURL=mask-frame-preparer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-frame-preparer.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-preparer.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,qBAAqB,EACrB,KAAK,iBAAiB,EACvB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAEL,KAAK,uBAAuB,EAG7B,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,8BAA8B,EAE9B,6BAA6B,EAC7B,KAAK,wBAAwB,EAE9B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,CAAC;AAEzD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,aAAa,EAAE,8BAA8B,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,6BAA6B,CAAC;CACtD;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,IAAI,uBAAuB,CAAC;IACrC,OAAO,CAAC,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;IAC9E,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,uBAAuB,CACrC,OAAO,GAAE;IACP,QAAQ,CAAC,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;IACtD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC,GACL,iBAAiB,CAsGnB"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Automatic mask preparation intentionally uses a small pool. RLE decode and
3
+ * PNG ID-mask creation are CPU-heavy enough to benefit from parallelism, but
4
+ * worker count also increases memory pressure and can compete with media
5
+ * decode. Explicit caller requests are allowed higher, but still bounded.
6
+ */
7
+ export declare const AUTO_MASK_PREPARATION_WORKER_LIMIT = 4;
8
+ export declare const REQUESTED_MASK_PREPARATION_WORKER_LIMIT = 8;
9
+ export declare const MIN_MASK_PREPARATION_WORKER_COUNT = 1;
10
+ export declare function resolveMaskPreparationWorkerCount(options?: {
11
+ readonly hardwareConcurrency?: number;
12
+ readonly requestedWorkerCount?: number;
13
+ }): number;
14
+ export declare function getBrowserMaskPreparationWorkerCount(requestedWorkerCount: number | undefined): number;
15
+ //# sourceMappingURL=mask-preparation-worker-count.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-preparation-worker-count.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-preparation-worker-count.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,IAAI,CAAC;AACpD,eAAO,MAAM,uCAAuC,IAAI,CAAC;AACzD,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD,wBAAgB,iCAAiC,CAC/C,OAAO,GAAE;IACP,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACnC,UAkBP;AAED,wBAAgB,oCAAoC,CAClD,oBAAoB,EAAE,MAAM,GAAG,SAAS,UASzC"}
@@ -0,0 +1,64 @@
1
+ import type { DetectionMask, Point } from "supervision-js-core";
2
+ import type { MaskStrokeStyle } from "supervision-js-core";
3
+ import type { PreparedMaskFrameKind } from "./mask-frame-artifact";
4
+ export declare enum MaskPreparationWorkerMessageType {
5
+ Complete = "complete",
6
+ Empty = "empty",
7
+ Error = "error",
8
+ Prepare = "prepare"
9
+ }
10
+ interface SerializableRasterInstructionBase {
11
+ readonly alpha: number;
12
+ readonly color: number;
13
+ readonly detectionIndex: number;
14
+ readonly stroke?: MaskStrokeStyle;
15
+ }
16
+ export type SerializableMaskInstruction = (SerializableRasterInstructionBase & {
17
+ readonly mask: DetectionMask;
18
+ readonly polygon?: never;
19
+ }) | (SerializableRasterInstructionBase & {
20
+ readonly mask?: never;
21
+ readonly polygon: {
22
+ readonly height: number;
23
+ readonly points: readonly Point[];
24
+ readonly width: number;
25
+ };
26
+ });
27
+ export interface MaskFramePreparationJob {
28
+ readonly instructions: readonly SerializableMaskInstruction[];
29
+ readonly key: string;
30
+ }
31
+ export interface MaskPreparationWorkerPrepareMessage {
32
+ readonly job: MaskFramePreparationJob;
33
+ readonly requestId: number;
34
+ readonly type: MaskPreparationWorkerMessageType.Prepare;
35
+ }
36
+ export interface MaskPreparationWorkerCompleteMessage {
37
+ readonly artifactKind?: PreparedMaskFrameKind;
38
+ readonly fillPalette?: Float32Array<ArrayBuffer>;
39
+ readonly hasStroke?: boolean;
40
+ readonly imageBitmap?: ImageBitmap;
41
+ readonly imageData?: ImageData;
42
+ readonly key: string;
43
+ readonly maxStrokeWidth?: number;
44
+ readonly png?: Uint8Array<ArrayBuffer>;
45
+ readonly requestId: number;
46
+ readonly strokePalette?: Float32Array<ArrayBuffer>;
47
+ readonly strokeWidths?: Float32Array<ArrayBuffer>;
48
+ readonly type: MaskPreparationWorkerMessageType.Complete;
49
+ }
50
+ export interface MaskPreparationWorkerEmptyMessage {
51
+ readonly key: string;
52
+ readonly requestId: number;
53
+ readonly type: MaskPreparationWorkerMessageType.Empty;
54
+ }
55
+ export interface MaskPreparationWorkerErrorMessage {
56
+ readonly error: string;
57
+ readonly key: string;
58
+ readonly requestId: number;
59
+ readonly type: MaskPreparationWorkerMessageType.Error;
60
+ }
61
+ export type MaskPreparationWorkerRequest = MaskPreparationWorkerPrepareMessage;
62
+ export type MaskPreparationWorkerResponse = MaskPreparationWorkerCompleteMessage | MaskPreparationWorkerEmptyMessage | MaskPreparationWorkerErrorMessage;
63
+ export {};
64
+ //# sourceMappingURL=mask-preparation-worker-protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-preparation-worker-protocol.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-preparation-worker-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAEnE,oBAAY,gCAAgC;IAC1C,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,OAAO,YAAY;CACpB;AAED,UAAU,iCAAiC;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,MAAM,MAAM,2BAA2B,GACnC,CAAC,iCAAiC,GAAG;IACnC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;CAC1B,CAAC,GACF,CAAC,iCAAiC,GAAG;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE;QAChB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;QAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;KACxB,C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CAAiC;IAChD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,gCAAgC,CAAC,KAAK,CAAC;CACvD;AAED,MAAM,MAAM,4BAA4B,GAAG,mCAAmC,CAAC;AAE/E,MAAM,MAAM,6BAA6B,GACrC,oCAAoC,GACpC,iCAAiC,GACjC,iCAAiC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mask-preparation.worker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-preparation.worker.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-preparation.worker.ts"],"names":[],"mappings":""}
@@ -0,0 +1,46 @@
1
+ import { type PreparedMaskFrame } from "#render-preparation/mask-frame-preparer";
2
+ import type { SerializableMaskInstruction } from "#render-preparation/mask-preparation-worker-protocol";
3
+ import { type PreparedRenderTimelineContext } from "#render-preparation/prepared-window-timeline";
4
+ import { type BufferedDetectionTimeline } from "supervision-js-core";
5
+ import type { DetectionFrame } from "supervision-js-core";
6
+ import type { MaskStyle } from "supervision-js-core";
7
+ import { RenderPreparationArtifactKind, type RenderPreparationOptions, type RenderPreparationPlaybackGateOptions } from "#types/render-preparation";
8
+ export interface PreparedRenderFrame {
9
+ readonly detectionFrame: DetectionFrame;
10
+ readonly key: string;
11
+ readonly maskFrame?: PreparedMaskFrame;
12
+ readonly maskStatus: PreparedRenderFrameMaskStatus;
13
+ }
14
+ export declare enum PreparedRenderFrameMaskStatus {
15
+ Disabled = "disabled",
16
+ Empty = "empty",
17
+ Pending = "pending",
18
+ Prepared = "prepared"
19
+ }
20
+ export interface PreparedRenderWindow {
21
+ getFrame(mediaTime: number): PreparedRenderFrame | undefined;
22
+ waitForReady(mediaTime: number, options: RenderPreparationPlaybackGateOptions): Promise<void>;
23
+ setTimelineContext(context: PreparedRenderTimelineContext): void;
24
+ setMaskStyle(maskStyle: MaskStyle | null | undefined): void;
25
+ destroy(): void;
26
+ }
27
+ export type { PreparedMaskFrame } from "./mask-frame-preparer";
28
+ export type { PreparedRenderTimelineContext } from "./prepared-window-timeline";
29
+ export declare function createPreparedRenderWindow(options: {
30
+ readonly artifactKind?: RenderPreparationArtifactKind;
31
+ readonly detectionTimeline: BufferedDetectionTimeline;
32
+ readonly maskStyle?: MaskStyle | null;
33
+ readonly maxMaskFrameCacheSize?: number;
34
+ readonly onMaskFrameEvicted?: (key: string) => void;
35
+ readonly onMaskFramePrepared?: (maskFrame: PreparedMaskFrame) => void;
36
+ readonly onMaskFramesCleared?: () => void;
37
+ readonly prefetchFrameCount?: number;
38
+ readonly preparedWindowScanIntervalSeconds?: number;
39
+ readonly renderPreparation?: RenderPreparationOptions;
40
+ readonly resolveInstructions?: (options: {
41
+ readonly frame: DetectionFrame;
42
+ readonly maskStyle: MaskStyle;
43
+ readonly mediaTime: number;
44
+ }) => readonly SerializableMaskInstruction[];
45
+ }): PreparedRenderWindow;
46
+ //# sourceMappingURL=prepared-render-window.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepared-render-window.d.ts","sourceRoot":"","sources":["../../src/render-preparation/prepared-render-window.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAGL,6BAA6B,EAE7B,KAAK,wBAAwB,EAC7B,KAAK,oCAAoC,E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AI,CAAC;IACtE,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,iCAAiC,CAAC,EAAE,MAAM,CAAC;IACpD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;IACtD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE;QACvC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;QAC/B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;QAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC5B,KAAK,SAAS,2BAA2B,EAAE,CAAC;CAC9C,GAAG,oBAAoB,CAg9BvB"}
@@ -0,0 +1,16 @@
1
+ import type { DetectionFrame } from "supervision-js-core";
2
+ export interface PreparedRenderTimelineContext {
3
+ readonly duration: number | null;
4
+ readonly loop: boolean;
5
+ }
6
+ export interface PreparedWindowTimeline {
7
+ clear(): void;
8
+ getFrameDistance(frameTime: number, mediaTime: number): number;
9
+ getWindowFrames(bufferedFrames: readonly DetectionFrame[], mediaTime: number): readonly DetectionFrame[];
10
+ rememberFrames(frames: readonly DetectionFrame[], retainedKeys: ReadonlySet<string>): void;
11
+ setContext(context: PreparedRenderTimelineContext): void;
12
+ }
13
+ export declare function createPreparedWindowTimeline(options: {
14
+ readonly getFrameKey: (frame: DetectionFrame) => string;
15
+ }): PreparedWindowTimeline;
16
+ //# sourceMappingURL=prepared-window-timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prepared-window-timeline.d.ts","sourceRoot":"","sources":["../../src/render-preparation/prepared-window-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,IAAI,IAAI,CAAC;IACd,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/D,eAAe,CACb,cAAc,EAAE,SAAS,cAAc,EAAE,EACzC,SAAS,EAAE,MAAM,GAChB,SAAS,cAAc,EAAE,CAAC;IAC7B,cAAc,CACZ,MAAM,EAAE,SAAS,cAAc,EAAE,EACjC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,GAChC,IAAI,CAAC;IACR,UAAU,CAAC,OAAO,EAAE,6BAA6B,GAAG,IAAI,CAAC;CAC1D;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE;IACpD,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,MAAM,CAAC;CACzD,GAAG,sBAAsB,CAqEzB"}
@@ -0,0 +1,9 @@
1
+ import type { DecodedMediaSource } from "#media/media-source";
2
+ import { type MediaRenderer, type MediaRendererOptions } from "#types/media-renderer";
3
+ import type { MediaRendererScene, MediaRendererSceneOptions } from "./media-renderer-scene";
4
+ export interface MediaRendererCoreProviders {
5
+ openMediaSource(src: string | URL | Request): Promise<DecodedMediaSource>;
6
+ createScene(options: MediaRendererSceneOptions): Promise<MediaRendererScene>;
7
+ }
8
+ export declare function createMediaRendererCore(options: MediaRendererOptions, providers: MediaRendererCoreProviders): Promise<MediaRenderer>;
9
+ //# sourceMappingURL=media-renderer-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-renderer-core.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-core.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAE1B,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,0BAA0B;IACzC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1E,WAAW,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC9E;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,oBAAoB,EAC7B,SAAS,EAAE,0BAA0B,GACpC,OAAO,CAAC,aAAa,CAAC,CAykBxB"}
@@ -0,0 +1,77 @@
1
+ import type { DecodedVideoSample } from "#media/media-source";
2
+ import type { BoxStyle } from "supervision-js-core";
3
+ import type { BufferedDetectionTimeline, DetectionBufferState } from "supervision-js-core";
4
+ import type { DetectionLabelBounds, MediaRendererDiagnosticsOptions, MediaFrameRenderTimings, MediaRendererFit, MediaRendererPresentation } from "#types/media-renderer";
5
+ import type { DetectionPickResult, DetectionSelectionOptions, MediaInteractionOptions } from "supervision-js-core";
6
+ import type { FocusStyle } from "supervision-js-core";
7
+ import type { InteractionStyle } from "supervision-js-core";
8
+ import type { LabelStyle } from "supervision-js-core";
9
+ import type { MaskStyle } from "supervision-js-core";
10
+ import type { PolygonStyle, PolylineStyle, KeypointStyle } from "supervision-js-core";
11
+ import type { MediaDisplayAdjustments } from "supervision-js-core";
12
+ import type { Point, ViewportTransform } from "supervision-js-core";
13
+ import type { AnnotationEditingEngine, AnnotationOverlayStyle, PreviewOverlayData } from "supervision-js-core";
14
+ import type { RenderPreparationOptions, RenderPreparationPlaybackGateOptions } from "#types/render-preparation";
15
+ import type { MaskBrushPreviewOptions } from "#editing/mask-brush-editor";
16
+ export interface MediaRendererSceneOptions {
17
+ readonly container: HTMLElement;
18
+ readonly backgroundColor: MediaRendererPresentation["backgroundColor"];
19
+ readonly fit: MediaRendererFit;
20
+ readonly maxDevicePixelRatio: number | undefined;
21
+ readonly detectionTimeline: BufferedDetectionTimeline;
22
+ readonly boxStyle: BoxStyle | null | undefined;
23
+ readonly focusStyle: FocusStyle | null | undefined;
24
+ readonly labelStyle: LabelStyle | null | undefined;
25
+ readonly maskStyle: MaskStyle | null | undefined;
26
+ readonly polygonStyle: PolygonStyle | null | undefined;
27
+ readonly polylineStyle: PolylineStyle | null | undefined;
28
+ readonly keypointStyle: KeypointStyle | null | undefined;
29
+ readonly interaction: MediaInteractionOptions | undefined;
30
+ readonly interactionStyle: InteractionStyle | null | undefined;
31
+ readonly canInteract: () => boolean;
32
+ readonly renderPreparation: RenderPreparationOptions | undefined;
33
+ readonly diagnostics: MediaRendererDiagnosticsOptions | undefined;
34
+ readonly visibility: MediaRendererPresentation["visibility"];
35
+ readonly editingEngine: AnnotationEditingEngine | undefined;
36
+ readonly annotationOverlayStyle: AnnotationOverlayStyle | null | undefined;
37
+ readonly maskBrush: MaskBrushPreviewOptions | undefined;
38
+ readonly previewOverlay: (() => PreviewOverlayData | null) | undefined;
39
+ }
40
+ export interface PresentedMediaSample {
41
+ readonly mediaTime: number;
42
+ readonly duration?: number;
43
+ readonly activeDetectionFrameTime: number | null;
44
+ readonly activeDetectionFrameIndex: number | null;
45
+ readonly activeDetectionCount: number;
46
+ readonly detectionBuffer: DetectionBufferState;
47
+ readonly renderTimings?: MediaFrameRenderTimings;
48
+ }
49
+ export interface MediaRendererScene {
50
+ readonly rendererBackend: string;
51
+ initializeMedia(dimensions: {
52
+ width: number;
53
+ height: number;
54
+ }): void;
55
+ setTimelineContext?(context: MediaRendererSceneTimelineContext): void;
56
+ presentSample(sample: DecodedVideoSample): PresentedMediaSample;
57
+ waitForRenderPreparation?(mediaTime: number, options: RenderPreparationPlaybackGateOptions): Promise<void>;
58
+ setRenderQuality(maxDevicePixelRatio: number | undefined): void;
59
+ setDisplayAdjustments?(adjustments: MediaDisplayAdjustments): void;
60
+ getViewportTransform?(): ViewportTransform;
61
+ setViewportTransform?(transform: Partial<Omit<ViewportTransform, "locked">>): void;
62
+ setViewportLocked?(locked: boolean): void;
63
+ screenToMedia?(point: Point): Point;
64
+ mediaToScreen?(point: Point): Point;
65
+ getDetectionLabelBounds?(detectionId: string | number): DetectionLabelBounds | null;
66
+ panViewportBy?(dx: number, dy: number): void;
67
+ zoomViewportAt?(point: Point, factor: number): void;
68
+ zoomViewportFromWheel?(point: Point, deltaY: number): void;
69
+ setPresentation(presentation: MediaRendererPresentation, mediaTime: number): PresentedMediaSample | void;
70
+ setSelectedDetection?(selection: DetectionSelectionOptions | null, mediaTime: number): DetectionPickResult | null;
71
+ destroy(): void;
72
+ }
73
+ export interface MediaRendererSceneTimelineContext {
74
+ readonly duration: number | null;
75
+ readonly loop: boolean;
76
+ }
77
+ //# sourceMappingURL=media-renderer-scene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-renderer-scene.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,oBAAoB,EACpB,+BAA+B,EAC/B,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,K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;CACjB;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB"}
@@ -0,0 +1,44 @@
1
+ import type { DecodedMediaSourceMetadata } from "#media/media-source";
2
+ import type { DetectionBufferState } from "supervision-js-core";
3
+ import { type MediaFrameDiagnostics, type MediaRendererFit, type MediaRendererState, type MediaSourceState } from "#types/media-renderer";
4
+ import type { PresentedMediaSample } from "./media-renderer-scene";
5
+ interface MediaRendererRuntimeStateOptions {
6
+ readonly fit: MediaRendererFit;
7
+ readonly playbackRate: number;
8
+ readonly getDetectionBufferState: () => DetectionBufferState;
9
+ readonly onFrame?: (diagnostics: MediaFrameDiagnostics) => void;
10
+ readonly onSource?: (state: MediaSourceState) => void;
11
+ readonly onState?: (state: MediaRendererState) => void;
12
+ }
13
+ export interface MediaRendererRuntimeState {
14
+ currentTime(): number;
15
+ duration(): number | null;
16
+ errorMessage(): string | null;
17
+ isDestroyed(): boolean;
18
+ isError(): boolean;
19
+ isPlaybackActive(): boolean;
20
+ isBuffering(): boolean;
21
+ isPlaying(): boolean;
22
+ emitSourceState(): void;
23
+ recordMediaMetadata(metadata: DecodedMediaSourceMetadata): {
24
+ height: number;
25
+ width: number;
26
+ };
27
+ setSourceReady(metadata: DecodedMediaSourceMetadata): void;
28
+ setCurrentTime(currentTime: number): void;
29
+ setPlaybackRate(playbackRate: number): void;
30
+ setRendererBackend(rendererBackend: string | null): void;
31
+ recordPresentedSample(sample: PresentedMediaSample): void;
32
+ recordPresentationUpdate(sample: PresentedMediaSample): void;
33
+ setReady(): void;
34
+ setPlaying(): void;
35
+ setBuffering(): void;
36
+ setPaused(): void;
37
+ setRenderError(error: unknown): void;
38
+ markDestroyed(): void;
39
+ setSourceDestroyed(): void;
40
+ snapshot(): MediaRendererState;
41
+ }
42
+ export declare function createMediaRendererRuntimeState(options: MediaRendererRuntimeStateOptions): MediaRendererRuntimeState;
43
+ export {};
44
+ //# sourceMappingURL=media-renderer-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-renderer-state.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-state.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAGL,KAAK,qBAAqB,EAE1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,UAAU,gCAAgC;IACxC,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACxD;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,IAAI,MAAM,CAAC;IACtB,QAAQ,IAAI,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAC9B,WAAW,IAAI,OAAO,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC;IACnB,gBAAgB,IAAI,OAAO,CAAC;IAC5B,WAAW,IAAI,OAAO,CAAC;IACvB,SAAS,IAAI,OAAO,CAAC;IACrB,eAAe,IAAI,IAAI,CAAC;IACxB,mBAAmB,CAAC,QAAQ,EAAE,0BAA0B,GAAG;QACzD,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,cAAc,CAAC,QAAQ,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAC3D,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,kBAAkB,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACzD,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC1D,wBAAwB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC7D,QAAQ,IAAI,IAAI,CAAC;IACjB,UAAU,IAAI,IAAI,CAAC;IACnB,YAAY,IAAI,IAAI,CAAC;IACrB,SAAS,IAAI,IAAI,CAAC;IAClB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACrC,aAAa,IAAI,IAAI,CAAC;IACtB,kBAAkB,IAAI,IAAI,CAAC;IAC3B,QAAQ,IAAI,kBAAkB,CAAC;CAChC;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,gCAAgC,GACxC,yBAAyB,CAmN3B"}
@@ -0,0 +1,8 @@
1
+ import type { MediaRenderer, MediaRendererOptions } from "#types/media-renderer";
2
+ /**
3
+ * Mediabunny owns media reading and video decode; Pixi owns the visible
4
+ * default scene adapter. Renderer orchestration stays in the provider-agnostic
5
+ * core.
6
+ */
7
+ export declare function createMediaRenderer(options: MediaRendererOptions): Promise<MediaRenderer>;
8
+ //# sourceMappingURL=media-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-renderer.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAI/B;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,aAAa,CAAC,CAKxB"}
@@ -0,0 +1,25 @@
1
+ import { type AnnotationEditingEngine, type AnnotationOverlayStyle, type AnnotationVisibility, type DetectionFrame, type Point, type PreviewOverlayData } from "supervision-js-core";
2
+ import type { Graphics as PixiGraphics } from "pixi.js";
3
+ export interface PixiAnnotationOverlayLayer {
4
+ attachGraphics(graphics: PixiGraphics): void;
5
+ setStyle(style: AnnotationOverlayStyle | null | undefined): void;
6
+ draw(context: {
7
+ frame: DetectionFrame | undefined;
8
+ selectedDetectionIds: readonly (string | number)[];
9
+ pointer: Point | null;
10
+ marquee: {
11
+ x: number;
12
+ y: number;
13
+ width: number;
14
+ height: number;
15
+ } | null;
16
+ viewportScale: number;
17
+ mediaWidth: number;
18
+ mediaHeight: number;
19
+ visibility?: AnnotationVisibility;
20
+ previewOverlay?: PreviewOverlayData | null;
21
+ now: number;
22
+ }): void;
23
+ }
24
+ export declare function createPixiAnnotationOverlayLayer(editingEngine?: AnnotationEditingEngine, initialStyle?: AnnotationOverlayStyle | null): PixiAnnotationOverlayLayer;
25
+ //# sourceMappingURL=pixi-annotation-overlay-layer.d.ts.map