supervision 0.1.7 → 0.2.0-next.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 (215) hide show
  1. package/dist/detections/chunked-detection-frame-source.d.ts.map +1 -1
  2. package/dist/index.d.ts +11 -4
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +8856 -4559
  5. package/dist/index.js.map +1 -1
  6. package/dist/mask-preparation.worker.js +310 -164
  7. package/dist/mask-preparation.worker.js.map +1 -1
  8. package/dist/media/display-pixel-ratio.d.ts +15 -0
  9. package/dist/media/display-pixel-ratio.d.ts.map +1 -0
  10. package/dist/media/engine-import-failure.d.ts +16 -0
  11. package/dist/media/engine-import-failure.d.ts.map +1 -0
  12. package/dist/media/media-condition-probe.d.ts +51 -0
  13. package/dist/media/media-condition-probe.d.ts.map +1 -0
  14. package/dist/media/media-conditions.d.ts +28 -0
  15. package/dist/media/media-conditions.d.ts.map +1 -0
  16. package/dist/media/media-errors.d.ts +6 -0
  17. package/dist/media/media-errors.d.ts.map +1 -1
  18. package/dist/media/media-normalization.d.ts.map +1 -1
  19. package/dist/media/media-probe.d.ts.map +1 -1
  20. package/dist/media/media-source.d.ts +17 -0
  21. package/dist/media/media-source.d.ts.map +1 -1
  22. package/dist/media/mediabunny-media-source.d.ts.map +1 -1
  23. package/dist/media/video-engine-media-source.d.ts +44 -0
  24. package/dist/media/video-engine-media-source.d.ts.map +1 -0
  25. package/dist/render-preparation/mask-frame-artifact.d.ts +46 -12
  26. package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
  27. package/dist/render-preparation/mask-frame-compositor.d.ts +5 -5
  28. package/dist/render-preparation/mask-frame-compositor.d.ts.map +1 -1
  29. package/dist/render-preparation/mask-frame-preparer.d.ts.map +1 -1
  30. package/dist/render-preparation/mask-preparation-worker-count.d.ts +4 -4
  31. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts +12 -3
  32. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
  33. package/dist/render-preparation/prepared-render-window.d.ts +23 -0
  34. package/dist/render-preparation/prepared-render-window.d.ts.map +1 -1
  35. package/dist/render-preparation/prepared-window-timeline.d.ts +2 -6
  36. package/dist/render-preparation/prepared-window-timeline.d.ts.map +1 -1
  37. package/dist/renderers/mask-palette.d.ts +14 -0
  38. package/dist/renderers/mask-palette.d.ts.map +1 -0
  39. package/dist/renderers/mask-vertex.d.ts +14 -0
  40. package/dist/renderers/mask-vertex.d.ts.map +1 -0
  41. package/dist/renderers/media-renderer-core.d.ts.map +1 -1
  42. package/dist/renderers/media-renderer-scene.d.ts +37 -0
  43. package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
  44. package/dist/renderers/media-renderer-state.d.ts +11 -1
  45. package/dist/renderers/media-renderer-state.d.ts.map +1 -1
  46. package/dist/renderers/media-renderer-transport.d.ts +59 -0
  47. package/dist/renderers/media-renderer-transport.d.ts.map +1 -0
  48. package/dist/renderers/pixi-box-layer.d.ts +5 -0
  49. package/dist/renderers/pixi-box-layer.d.ts.map +1 -1
  50. package/dist/renderers/pixi-focus-layer.d.ts +18 -2
  51. package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
  52. package/dist/renderers/pixi-frame-present.d.ts +77 -0
  53. package/dist/renderers/pixi-frame-present.d.ts.map +1 -0
  54. package/dist/renderers/pixi-id-mask-shader.d.ts +12 -2
  55. package/dist/renderers/pixi-id-mask-shader.d.ts.map +1 -1
  56. package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -1
  57. package/dist/renderers/pixi-interaction-presentation-layer.d.ts +13 -2
  58. package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
  59. package/dist/renderers/pixi-mask-halo.d.ts +24 -0
  60. package/dist/renderers/pixi-mask-halo.d.ts.map +1 -1
  61. package/dist/renderers/pixi-mask-layer.d.ts +71 -8
  62. package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
  63. package/dist/renderers/pixi-media-scene.d.ts +67 -0
  64. package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
  65. package/dist/renderers/pixi-polygon-layer.d.ts +7 -2
  66. package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
  67. package/dist/renderers/pixi-region-coverage-mask.d.ts +91 -0
  68. package/dist/renderers/pixi-region-coverage-mask.d.ts.map +1 -0
  69. package/dist/renderers/pixi-region-effect.d.ts +42 -0
  70. package/dist/renderers/pixi-region-effect.d.ts.map +1 -0
  71. package/dist/renderers/pixi-region-layer.d.ts +68 -2
  72. package/dist/renderers/pixi-region-layer.d.ts.map +1 -1
  73. package/dist/renderers/pixi-vector-layer.d.ts.map +1 -1
  74. package/dist/renderers/prepared-annotation-window.d.ts +47 -0
  75. package/dist/renderers/prepared-annotation-window.d.ts.map +1 -0
  76. package/dist/renderers/presented-frame-channel.d.ts +107 -0
  77. package/dist/renderers/presented-frame-channel.d.ts.map +1 -0
  78. package/dist/renderers/scene-render-scheduler.d.ts +20 -0
  79. package/dist/renderers/scene-render-scheduler.d.ts.map +1 -0
  80. package/dist/sessions/media-session-defaults.d.ts +10 -6
  81. package/dist/sessions/media-session-defaults.d.ts.map +1 -1
  82. package/dist/sessions/media-session-media.d.ts.map +1 -1
  83. package/dist/sessions/media-session-state.d.ts.map +1 -1
  84. package/dist/sessions/media-session.d.ts.map +1 -1
  85. package/dist/tracking.worker.js +58 -3
  86. package/dist/tracking.worker.js.map +1 -1
  87. package/dist/types/media-conditions.d.ts +149 -0
  88. package/dist/types/media-conditions.d.ts.map +1 -0
  89. package/dist/types/media-normalization.d.ts +34 -0
  90. package/dist/types/media-normalization.d.ts.map +1 -1
  91. package/dist/types/media-renderer.d.ts +31 -1
  92. package/dist/types/media-renderer.d.ts.map +1 -1
  93. package/dist/types/media-session.d.ts +89 -8
  94. package/dist/types/media-session.d.ts.map +1 -1
  95. package/dist/types/render-preparation.d.ts +101 -4
  96. package/dist/types/render-preparation.d.ts.map +1 -1
  97. package/dist/web-video-engine/analysis-session.d.ts +76 -0
  98. package/dist/web-video-engine/analysis-session.d.ts.map +1 -0
  99. package/dist/web-video-engine/analysis.d.ts +7 -0
  100. package/dist/web-video-engine/analysis.d.ts.map +1 -0
  101. package/dist/web-video-engine/analysis.js +1678 -0
  102. package/dist/web-video-engine/analysis.js.map +1 -0
  103. package/dist/web-video-engine/cache-budget.d.ts +19 -0
  104. package/dist/web-video-engine/cache-budget.d.ts.map +1 -0
  105. package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts +90 -0
  106. package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts.map +1 -0
  107. package/dist/web-video-engine/clock.d.ts +83 -0
  108. package/dist/web-video-engine/clock.d.ts.map +1 -0
  109. package/dist/web-video-engine/constants.d.ts +253 -0
  110. package/dist/web-video-engine/constants.d.ts.map +1 -0
  111. package/dist/web-video-engine/create-scrub-cursor.d.ts +62 -0
  112. package/dist/web-video-engine/create-scrub-cursor.d.ts.map +1 -0
  113. package/dist/web-video-engine/decode-resolution.d.ts +115 -0
  114. package/dist/web-video-engine/decode-resolution.d.ts.map +1 -0
  115. package/dist/web-video-engine/decode-scheduler.d.ts +356 -0
  116. package/dist/web-video-engine/decode-scheduler.d.ts.map +1 -0
  117. package/dist/web-video-engine/decode-session.d.ts +276 -0
  118. package/dist/web-video-engine/decode-session.d.ts.map +1 -0
  119. package/dist/web-video-engine/decode-source.d.ts +250 -0
  120. package/dist/web-video-engine/decode-source.d.ts.map +1 -0
  121. package/dist/web-video-engine/diagnostics-store.d.ts +18 -0
  122. package/dist/web-video-engine/diagnostics-store.d.ts.map +1 -0
  123. package/dist/web-video-engine/diagnostics.d.ts +316 -0
  124. package/dist/web-video-engine/diagnostics.d.ts.map +1 -0
  125. package/dist/web-video-engine/embedded-engine-worker.d.ts +2 -0
  126. package/dist/web-video-engine/embedded-engine-worker.d.ts.map +1 -0
  127. package/dist/web-video-engine/engine-core.d.ts +258 -0
  128. package/dist/web-video-engine/engine-core.d.ts.map +1 -0
  129. package/dist/web-video-engine/engine.d.ts +26 -0
  130. package/dist/web-video-engine/engine.d.ts.map +1 -0
  131. package/dist/web-video-engine/engine.js +873 -0
  132. package/dist/web-video-engine/engine.js.map +1 -0
  133. package/dist/web-video-engine/engine.worker.d.ts +2 -0
  134. package/dist/web-video-engine/engine.worker.d.ts.map +1 -0
  135. package/dist/web-video-engine/engine.worker.js +31320 -0
  136. package/dist/web-video-engine/engine.worker.js.map +1 -0
  137. package/dist/web-video-engine/frame-cache.d.ts +129 -0
  138. package/dist/web-video-engine/frame-cache.d.ts.map +1 -0
  139. package/dist/web-video-engine/frame-extractor.d.ts +28 -0
  140. package/dist/web-video-engine/frame-extractor.d.ts.map +1 -0
  141. package/dist/web-video-engine/frame-timeline-GINI8Gum.js +560 -0
  142. package/dist/web-video-engine/frame-timeline-GINI8Gum.js.map +1 -0
  143. package/dist/web-video-engine/frame-timeline.d.ts +71 -0
  144. package/dist/web-video-engine/frame-timeline.d.ts.map +1 -0
  145. package/dist/web-video-engine/frame-walker.d.ts +74 -0
  146. package/dist/web-video-engine/frame-walker.d.ts.map +1 -0
  147. package/dist/web-video-engine/index.d.ts +3 -0
  148. package/dist/web-video-engine/index.d.ts.map +1 -0
  149. package/dist/web-video-engine/index.js +3 -0
  150. package/dist/web-video-engine/index.js.map +1 -0
  151. package/dist/web-video-engine/key-packet.d.ts +65 -0
  152. package/dist/web-video-engine/key-packet.d.ts.map +1 -0
  153. package/dist/web-video-engine/keyframe-index.d.ts +91 -0
  154. package/dist/web-video-engine/keyframe-index.d.ts.map +1 -0
  155. package/dist/web-video-engine/mirror-store.d.ts +56 -0
  156. package/dist/web-video-engine/mirror-store.d.ts.map +1 -0
  157. package/dist/web-video-engine/renderer.d.ts +94 -0
  158. package/dist/web-video-engine/renderer.d.ts.map +1 -0
  159. package/dist/web-video-engine/rotation.d.ts +35 -0
  160. package/dist/web-video-engine/rotation.d.ts.map +1 -0
  161. package/dist/web-video-engine/scrub-controller.d.ts +376 -0
  162. package/dist/web-video-engine/scrub-controller.d.ts.map +1 -0
  163. package/dist/web-video-engine/scrub-cursor.d.ts +342 -0
  164. package/dist/web-video-engine/scrub-cursor.d.ts.map +1 -0
  165. package/dist/web-video-engine/scrub-trajectory.d.ts +30 -0
  166. package/dist/web-video-engine/scrub-trajectory.d.ts.map +1 -0
  167. package/dist/web-video-engine/source-residency.d.ts +57 -0
  168. package/dist/web-video-engine/source-residency.d.ts.map +1 -0
  169. package/dist/web-video-engine/trace-recorder.d.ts +164 -0
  170. package/dist/web-video-engine/trace-recorder.d.ts.map +1 -0
  171. package/dist/web-video-engine/types.d.ts +204 -0
  172. package/dist/web-video-engine/types.d.ts.map +1 -0
  173. package/dist/web-video-engine/video-engine.d.ts +426 -0
  174. package/dist/web-video-engine/video-engine.d.ts.map +1 -0
  175. package/dist/web-video-engine/webgpu-renderer.d.ts +62 -0
  176. package/dist/web-video-engine/webgpu-renderer.d.ts.map +1 -0
  177. package/dist/web-video-engine/worker-bridge.d.ts +12 -0
  178. package/dist/web-video-engine/worker-bridge.d.ts.map +1 -0
  179. package/dist/web-video-engine/worker-dispatch.d.ts +17 -0
  180. package/dist/web-video-engine/worker-dispatch.d.ts.map +1 -0
  181. package/dist/web-video-engine/worker-protocol.d.ts +267 -0
  182. package/dist/web-video-engine/worker-protocol.d.ts.map +1 -0
  183. package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts.map +1 -1
  184. package/node_modules/supervision-js-core/dist/detections/composite-detection-frame-source.d.ts.map +1 -1
  185. package/node_modules/supervision-js-core/dist/index.d.ts +4 -3
  186. package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
  187. package/node_modules/supervision-js-core/dist/index.js +1075 -266
  188. package/node_modules/supervision-js-core/dist/index.js.map +1 -1
  189. package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts.map +1 -1
  190. package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts +4 -36
  191. package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts.map +1 -1
  192. package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts +5 -0
  193. package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts.map +1 -1
  194. package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts +92 -7
  195. package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts.map +1 -1
  196. package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts +179 -17
  197. package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts.map +1 -1
  198. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +78 -2
  199. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
  200. package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts +2 -0
  201. package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts.map +1 -1
  202. package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts +16 -0
  203. package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts.map +1 -1
  204. package/node_modules/supervision-js-core/dist/utils/detection-conversions.d.ts.map +1 -1
  205. package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts +5 -0
  206. package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts.map +1 -1
  207. package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts +9 -0
  208. package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts.map +1 -1
  209. package/node_modules/supervision-js-core/dist/utils/detection-ranges.d.ts +18 -0
  210. package/node_modules/supervision-js-core/dist/utils/detection-ranges.d.ts.map +1 -0
  211. package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts +15 -2
  212. package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts.map +1 -1
  213. package/node_modules/supervision-js-core/dist/utils/wait-bound.d.ts +7 -0
  214. package/node_modules/supervision-js-core/dist/utils/wait-bound.d.ts.map +1 -0
  215. package/package.json +22 -1
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The pixel ratio a host's display box rasterizes at, for every grid that lands
3
+ * in that box: the presentation surface, the mask rasters drawn onto it, and the
4
+ * decode under both. The ceiling is what keeps a 3x display from costing nine
5
+ * times the texels of a 1x one for sharpness nobody resolves on a moving
6
+ * picture. An id raster carries a detection per pixel and can only be sampled
7
+ * nearest, so a grid it does not share ragged its edges.
8
+ *
9
+ * A ceiling that is not a usable number states nothing, and takes the default.
10
+ */
11
+ export declare function resolveDisplayPixelRatio(display: {
12
+ readonly devicePixelRatio: number;
13
+ readonly maxDevicePixelRatio?: number;
14
+ }): number;
15
+ //# sourceMappingURL=display-pixel-ratio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display-pixel-ratio.d.ts","sourceRoot":"","sources":["../../src/media/display-pixel-ratio.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC,GAAG,MAAM,CAeT"}
@@ -0,0 +1,16 @@
1
+ export declare const VIDEO_ENGINE_ENTRY = "supervision/web-video-engine";
2
+ export declare const VIDEO_ENGINE_ANALYSIS_ENTRY = "supervision/web-video-engine/analysis";
3
+ /**
4
+ * The engine is a chunk of this package that the browser fetches on demand, so
5
+ * the raw failure names a URL nobody wrote and reads like a bug in the caller's
6
+ * own code.
7
+ */
8
+ export declare function rethrowEngineImportFailure(error: unknown, entry: string): never;
9
+ /**
10
+ * An engine that never loaded and an engine that loaded and then threw arrive
11
+ * at the same catch, and only the first is a deployment problem. Loaders that
12
+ * wrap what they caught put the load failure under the error they raise, so the
13
+ * whole cause chain is read, bounded because a chain can be cyclic.
14
+ */
15
+ export declare function isEngineResolutionFailure(error: unknown): boolean;
16
+ //# sourceMappingURL=engine-import-failure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine-import-failure.d.ts","sourceRoot":"","sources":["../../src/media/engine-import-failure.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,iCAAiC,CAAC;AACjE,eAAO,MAAM,2BAA2B,0CAAmC,CAAC;AAkB5E;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,GACZ,KAAK,CAWP;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAUjE"}
@@ -0,0 +1,51 @@
1
+ import { MediaIndexPlacement, type MediaConditionPolicy, type MediaConditionReport, type MediaTimingFacts } from "#types/media-conditions";
2
+ /** Bytes at `[start, end)`, however the caller gets them. */
3
+ export type MediaByteReader = (start: number, end: number) => Promise<Uint8Array>;
4
+ export interface MediaConditionProbeOptions extends MediaConditionPolicy {
5
+ /**
6
+ * How many packets of the track to measure timing over. The walk reads
7
+ * metadata only: on an ISO base media file the sample table is already in
8
+ * memory once the file opens, so raising this costs processing rather than
9
+ * bytes; on Matroska and MPEG-TS there is no such table and every packet
10
+ * costs a read of the media data itself.
11
+ */
12
+ readonly samplePackets?: number;
13
+ /**
14
+ * Whether the bytes stand for a file that will be opened over a link. It is
15
+ * what makes a trailing index cost anything, and a probe run against a
16
+ * downloaded copy of a remote file has to be told.
17
+ */
18
+ readonly remote?: boolean;
19
+ }
20
+ /**
21
+ * Measures a source once and says which conversion conditions hold.
22
+ *
23
+ * Deliberately cheap, because "convert only when necessary" is worth nothing if
24
+ * finding out costs what converting would. Nothing here decodes a frame or
25
+ * reads a byte of media data on an indexed container: the container's own box
26
+ * headers answer where the index sits, and the packet walk runs metadata-only
27
+ * over a bounded prefix.
28
+ */
29
+ export declare function probeMediaConditions(source: Blob, options?: MediaConditionProbeOptions): Promise<MediaConditionReport>;
30
+ /**
31
+ * Where an ISO base media file keeps its frame index, read from the top-level
32
+ * box headers alone.
33
+ *
34
+ * Each header states the size of its own box, so the walk hops from one to the
35
+ * next and never reads a box's contents: eight to sixteen bytes per box, and no
36
+ * more boxes than it takes to see `moov` or `moof`. Over a link that is a
37
+ * handful of range requests whatever the file weighs.
38
+ */
39
+ export declare function readIndexPlacement(read: MediaByteReader, size: number): Promise<MediaIndexPlacement>;
40
+ /**
41
+ * Turns a walk of packet timestamps into the timing facts, in ticks.
42
+ *
43
+ * Decode order is not presentation order, so the table is sorted before its
44
+ * gaps are read. A walk that stopped at the cap has read every packet up to a
45
+ * decode position and no further, which leaves the tail of the sorted table
46
+ * missing frames that sit between ones it did read; the deepest reordering seen
47
+ * bounds how much of that tail is untrustworthy, and it is dropped. A walk that
48
+ * ran to the end of the track has no such tail.
49
+ */
50
+ export declare function summarizeTiming(decodeOrderTicks: readonly number[], tickRate: number, sampleComplete: boolean): MediaTimingFacts;
51
+ //# sourceMappingURL=media-condition-probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-condition-probe.d.ts","sourceRoot":"","sources":["../../src/media/media-condition-probe.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EAEnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,6DAA6D;AAC7D,MAAM,MAAM,eAAe,GAAG,CAC5B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,KACR,OAAO,CAAC,UAAU,CAAC,CAAC;AAEzB,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAWD;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,IAAI,EACZ,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,oBAAoB,CAAC,CAyB/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,eAAe,EACrB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,mBAAmB,CAAC,CAiE9B;AAkGD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,gBAAgB,EAAE,SAAS,MAAM,EAAE,EACnC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,OAAO,GACtB,gBAAgB,CA2BlB"}
@@ -0,0 +1,28 @@
1
+ import { type ConversionFrameEffectReport, type MediaConditionFacts, type MediaConditionPolicy, type MediaConditionReport, type MediaTimingFacts } from "#types/media-conditions";
2
+ import { type MediaNormalizationVideoOptions } from "#types/media-normalization";
3
+ /**
4
+ * Which conditions a source's measured facts hold, and what to do about each.
5
+ *
6
+ * Pure: everything it reasons over was measured once by the probe. The two
7
+ * verdicts are separate because the conditions are: a source whose frames do
8
+ * not arrive on a steady grid plays perfectly and cannot be addressed by frame
9
+ * index, and answering that with one verdict would either refuse a clip that
10
+ * plays or hand out indices that name the wrong picture.
11
+ */
12
+ export declare function evaluateMediaConditions(facts: MediaConditionFacts, policy?: MediaConditionPolicy): MediaConditionReport;
13
+ /**
14
+ * What a conversion would do to the frame sequence, judged against the options
15
+ * as {@link normalizeMedia} will actually run them rather than as they were
16
+ * written: leaving the rate unstated does not keep the source's timing here,
17
+ * it takes the 30 hertz default.
18
+ *
19
+ * A stated rate is only safe on a source that already runs at exactly that
20
+ * rate. On anything else the conversion writes a different number of pictures
21
+ * at different times, and a detection carrying a source frame index then names
22
+ * a picture that was never at that position.
23
+ */
24
+ export declare function describeConversionFrameEffect(options: {
25
+ readonly video?: MediaNormalizationVideoOptions;
26
+ readonly timing?: MediaTimingFacts | null;
27
+ }): ConversionFrameEffectReport;
28
+ //# sourceMappingURL=media-conditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-conditions.d.ts","sourceRoot":"","sources":["../../src/media/media-conditions.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,2BAA2B,EAEhC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,4BAA4B,CAAC;AAoBpC;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,mBAAmB,EAC1B,MAAM,GAAE,oBAAyB,GAChC,oBAAoB,CA2FtB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE;IACrD,QAAQ,CAAC,KAAK,CAAC,EAAE,8BAA8B,CAAC;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC3C,GAAG,2BAA2B,CA4C9B"}
@@ -1,4 +1,10 @@
1
1
  import { MediaErrorKind } from "supervision-js-core";
2
+ /**
3
+ * The vocabulary a media producer may name its own failure in. A producer that
4
+ * states its cause as one of these on `code` is classified by that name; any
5
+ * other code is classified from the message like an uncoded failure.
6
+ */
7
+ export declare const MEDIA_PRODUCER_ERROR_CODES: readonly ["ABORTED", "BACKEND_CRASHED", "CONTAINER_UNREADABLE", "DECODER_STALLED", "DECODE_UNSUPPORTED", "NO_VIDEO_TRACK", "PRESENTATION_MISMATCH", "RATE_UNSUPPORTED", "SOURCE_UNREADABLE", "VIDEO_TRACK_UNREADABLE"];
2
8
  /**
3
9
  * A media failure with a stable, documented kind.
4
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"media-errors.d.ts","sourceRoot":"","sources":["../../src/media/media-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAQrD;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;gBAG5B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAMzC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAE5E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,eAAe,SAAyB,GACvC,gBAAgB,CAUlB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAEhE"}
1
+ {"version":3,"file":"media-errors.d.ts","sourceRoot":"","sources":["../../src/media/media-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,wNAW7B,CAAC;AA8BX;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;gBAG5B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAMzC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAE5E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,eAAe,SAAyB,GACvC,gBAAgB,CASlB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAEhE"}
@@ -1 +1 @@
1
- {"version":3,"file":"media-normalization.d.ts","sourceRoot":"","sources":["../../src/media/media-normalization.ts"],"names":[],"mappings":"AAUA,OAAO,EAKL,KAAK,yBAAyB,EAE9B,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAChC,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC9B,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,0BAA0B,GAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAWhD,wBAAsB,cAAc,CAClC,MAAM,EAAE,IAAI,EACZ,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,eAAe,CAAC,CAkG1B;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,IAAI,EACZ,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,0BAA0B,CAAC,CA8IrC"}
1
+ {"version":3,"file":"media-normalization.d.ts","sourceRoot":"","sources":["../../src/media/media-normalization.ts"],"names":[],"mappings":"AAUA,OAAO,EAML,KAAK,yBAAyB,EAE9B,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAChC,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC9B,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,0BAA0B,GAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAUhD,wBAAsB,cAAc,CAClC,MAAM,EAAE,IAAI,EACZ,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,eAAe,CAAC,CAkG1B;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,IAAI,EACZ,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,0BAA0B,CAAC,CA8IrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"media-probe.d.ts","sourceRoot":"","sources":["../../src/media/media-probe.ts"],"names":[],"mappings":"AAGA,OAAO,EAOL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGtB,MAAM,4BAA4B,CAAC;AAiBpC,wBAAsB,UAAU,CAC9B,MAAM,EAAE,IAAI,EACZ,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CA0F3B"}
1
+ {"version":3,"file":"media-probe.d.ts","sourceRoot":"","sources":["../../src/media/media-probe.ts"],"names":[],"mappings":"AAGA,OAAO,EAQL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGtB,MAAM,4BAA4B,CAAC;AAgBpC,wBAAsB,UAAU,CAC9B,MAAM,EAAE,IAAI,EACZ,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CA0F3B"}
@@ -1,3 +1,4 @@
1
+ import type { PresentedFrameChannel } from "#renderers/presented-frame-channel";
1
2
  export interface DecodedVideoSample {
2
3
  readonly timestamp: number;
3
4
  readonly duration: number;
@@ -11,6 +12,15 @@ export interface DecodedVideoSampleSink {
11
12
  samples(startTimestamp?: number, endTimestamp?: number, options?: {
12
13
  skipLiveWait?: boolean;
13
14
  }): AsyncGenerator<DecodedVideoSample, void, unknown>;
15
+ /**
16
+ * A sample per timestamp, in the order asked for, `null` where no frame
17
+ * covers it, over a single pass across the track. Optional: a caller with a
18
+ * whole set in hand takes this where a source offers it, and otherwise pays
19
+ * a seek per {@link DecodedVideoSampleSink.getSample}.
20
+ */
21
+ samplesAtTimestamps?(timestamps: Iterable<number>, options?: {
22
+ skipLiveWait?: boolean;
23
+ }): AsyncGenerator<DecodedVideoSample | null, void, unknown>;
14
24
  }
15
25
  export interface DisposableMediaInput {
16
26
  dispose(): void;
@@ -34,5 +44,12 @@ export interface DecodedMediaSource {
34
44
  readonly input: DisposableMediaInput;
35
45
  readonly metadata: DecodedMediaSourceMetadata;
36
46
  readonly sampleSink: DecodedVideoSampleSink;
47
+ /**
48
+ * A source that owns its own decode clock publishes one, and the renderer
49
+ * composites the frames it announces rather than asking `sampleSink` for a
50
+ * frame at a time the renderer chose. `sampleSink` stays required, and still
51
+ * serves thumbnails and one-off grabs.
52
+ */
53
+ readonly engine?: PresentedFrameChannel;
37
54
  }
38
55
  //# sourceMappingURL=media-source.d.ts.map
@@ -1 +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,CACP,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,GACnC,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;IACtC,OAAO,CACL,cAAc,CAAC,EAAE,MAAM,EACvB,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,GACnC,cAAc,CAAC,kBAAkB,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;CACtD;AAED,MAAM,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,GACtC,mBAAmB,CAMrB"}
1
+ {"version":3,"file":"mediabunny-media-source.d.ts","sourceRoot":"","sources":["../../src/media/mediabunny-media-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,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,CAsG7B;AAkCD,wBAAgB,mCAAmC,CACjD,WAAW,EAAE,0BAA0B,GACtC,mBAAmB,CAMrB"}
@@ -0,0 +1,44 @@
1
+ import type { DecodedMediaSource } from "#media/media-source";
2
+ import type { PresentedFrameChannel } from "#renderers/presented-frame-channel";
3
+ import type { MediaRendererSource } from "#types/media-renderer";
4
+ import type { DecodeResolutionStrategy, DisplayBoxResolutionOptions, VideoEngine, VideoEngineOptions } from "#web-video-engine";
5
+ export interface VideoEngineMediaSourceOptions extends Omit<VideoEngineOptions, "presentation"> {
6
+ /**
7
+ * The box a compositor paints these frames into, in CSS pixels, with the
8
+ * viewer's device pixel ratio.
9
+ *
10
+ * This source runs the engine canvas-less, so nothing on the engine side ever
11
+ * measures a display box and its viewport strategy has nothing to read: left
12
+ * unsaid, frames decode at the source's full resolution however small the box
13
+ * is. Saying it here decodes at the size the frames are actually shown at,
14
+ * which cuts per-frame paint work and buys the scrub cache more slots at the
15
+ * cost of preview sharpness while scrubbing. An explicit `decodeStrategy`
16
+ * wins over this.
17
+ */
18
+ readonly display?: DisplayBoxResolutionOptions;
19
+ /**
20
+ * Sizes the frames the pull path decodes. The inherited `decodeStrategy`
21
+ * sizes what the engine decodes for its own presentation.
22
+ */
23
+ readonly frameDecodeStrategy?: DecodeResolutionStrategy;
24
+ }
25
+ export interface VideoEngineMediaSource extends DecodedMediaSource {
26
+ /**
27
+ * The loaded engine. Naming the renderer's channel in the type is what fails
28
+ * the build if the engine's transport stops answering that seam.
29
+ */
30
+ readonly engine: VideoEngine & PresentedFrameChannel;
31
+ }
32
+ /**
33
+ * Adapts Roboflow's video engine to the decoded-media source seam.
34
+ *
35
+ * The pull path, `sampleSink`, serves one-off reads such as thumbnails and
36
+ * single frame grabs, decoding each request from scratch through the engine's
37
+ * batch analysis entry. The push path serves playback and scrub presentation:
38
+ * the engine holds no canvas, paints nothing, and announces every frame that
39
+ * earns the screen, so a compositor subscribes to `engine` and never pulls
40
+ * samples here.
41
+ */
42
+ export declare function openVideoEngineMediaSource(options: VideoEngineMediaSourceOptions): Promise<VideoEngineMediaSource>;
43
+ export declare function createVideoEngineMediaRendererSource(options: VideoEngineMediaSourceOptions): MediaRendererSource;
44
+ //# sourceMappingURL=video-engine-media-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-engine-media-source.d.ts","sourceRoot":"","sources":["../../src/media/video-engine-media-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EACV,wBAAwB,EACxB,2BAA2B,EAE3B,WAAW,EACX,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AAkB3B,MAAM,WAAW,6BAA8B,SAAQ,IAAI,CACzD,kBAAkB,EAClB,cAAc,CACf;IACC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,2BAA2B,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;CACzD;AAED,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,qBAAqB,CAAC;CACtD;AAED;;;;;;;;;GASG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,sBAAsB,CAAC,CAiCjC;AAED,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,6BAA6B,GACrC,mBAAmB,CAMrB"}
@@ -1,34 +1,68 @@
1
1
  export declare enum PreparedMaskFrameKind {
2
- PngIdMask = "pngIdMask",
2
+ IdMask = "idMask",
3
3
  RgbaImage = "rgbaImage"
4
4
  }
5
+ /**
6
+ * How an id raster is laid out for the texture it is uploaded into. WebGPU
7
+ * takes any bytesPerRow, so ids go up one byte per pixel. WebGL aligns every
8
+ * uploaded row to four bytes and rejects a single-channel upload whose width
9
+ * is not a multiple of four, which is what the four-channel layout is for.
10
+ */
11
+ export declare enum IdMaskTextureFormat {
12
+ R8 = "r8unorm",
13
+ Rgba8 = "rgba8unorm"
14
+ }
15
+ export interface PreparedRegionMaskCoverageEntry {
16
+ readonly data: Uint8Array<ArrayBuffer>;
17
+ readonly detectionIndex: number;
18
+ readonly height: number;
19
+ readonly width: number;
20
+ readonly x: number;
21
+ readonly y: number;
22
+ }
23
+ /**
24
+ * Overlap-preserving membership planes for exact region crops. Every target
25
+ * owns an alpha crop, so masks remain independent where their pixels overlap.
26
+ */
27
+ export interface PreparedRegionMaskCoverageFrame {
28
+ readonly entries: readonly PreparedRegionMaskCoverageEntry[];
29
+ }
30
+ /**
31
+ * The uncomposited detection-id plane carried alongside the RGBA composite, so
32
+ * id-keyed effects such as the mask halo still have a plane to read when the id
33
+ * raster could not be cooked. It carries its own size because it honors the
34
+ * same raster cap as the id raster while the composite is cooked at the
35
+ * instructions' own resolution.
36
+ */
37
+ export interface PreparedIdMaskPlane {
38
+ readonly data: Uint8Array<ArrayBuffer>;
39
+ readonly height: number;
40
+ readonly width: number;
41
+ }
5
42
  export interface PreparedRgbaMaskFrame {
6
43
  readonly height: number;
7
- /**
8
- * The uncomposited detection-id plane when preparation falls back to an
9
- * RGBA image. This keeps id-based effects available without requiring PNG
10
- * encoding or ImageBitmap support.
11
- */
12
- readonly idMaskData?: Uint8Array<ArrayBuffer>;
44
+ readonly idMaskPlane?: PreparedIdMaskPlane;
13
45
  readonly key: string;
14
46
  readonly kind: PreparedMaskFrameKind.RgbaImage;
47
+ readonly regionMaskCoverage?: PreparedRegionMaskCoverageFrame;
15
48
  readonly source: HTMLCanvasElement | ImageBitmap;
16
49
  readonly width: number;
17
50
  close(): void;
18
51
  }
19
- export interface PreparedPngIdMaskFrame {
52
+ export interface PreparedIdMaskFrame {
20
53
  readonly fillPalette: Float32Array<ArrayBuffer>;
21
54
  readonly hasStroke: boolean;
22
55
  readonly height: number;
23
56
  readonly key: string;
24
- readonly kind: PreparedMaskFrameKind.PngIdMask;
57
+ readonly kind: PreparedMaskFrameKind.IdMask;
25
58
  readonly maxStrokeWidth: number;
26
- readonly png: Uint8Array<ArrayBuffer>;
27
- readonly source: ImageBitmap;
59
+ readonly raster: Uint8Array<ArrayBuffer>;
60
+ readonly regionMaskCoverage?: PreparedRegionMaskCoverageFrame;
28
61
  readonly strokePalette: Float32Array<ArrayBuffer>;
29
62
  readonly strokeWidths: Float32Array<ArrayBuffer>;
30
63
  readonly width: number;
31
64
  close(): void;
32
65
  }
33
- export type PreparedMaskFrame = PreparedPngIdMaskFrame | PreparedRgbaMaskFrame;
66
+ export type PreparedMaskFrame = PreparedIdMaskFrame | PreparedRgbaMaskFrame;
67
+ export declare function readIdMaskRasterValue(frame: PreparedIdMaskFrame, x: number, y: number): number;
34
68
  //# sourceMappingURL=mask-frame-artifact.d.ts.map
@@ -1 +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;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAC9C,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,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AAE,iBAAiB,GAAG,WAAW,CAAC;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,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,MAAM,CAAC;IAC5C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACzC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,+BAA+B,CAAC;IAC9D,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,mBAAmB,GAAG,qBAAqB,CAAC;AAE5E,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,mBAAmB,EAC1B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,UAGV"}
@@ -1,4 +1,5 @@
1
1
  import type { SerializableMaskInstruction } from "#render-preparation/mask-preparation-worker-protocol";
2
+ import type { PreparedIdMaskPlane, PreparedRegionMaskCoverageFrame } from "#render-preparation/mask-frame-artifact";
2
3
  import { type IdMaskFrame } from "supervision-js-core";
3
4
  export { MAX_ID_MASK_PALETTE_ENTRIES, MAX_ID_MASK_STROKE_WIDTH, createIdMaskFrame, type IdMaskFrame, } from "supervision-js-core";
4
5
  export interface CompositedMaskFrame {
@@ -6,10 +7,9 @@ export interface CompositedMaskFrame {
6
7
  readonly height: number;
7
8
  readonly width: number;
8
9
  }
9
- export interface PngIdMaskFrame extends IdMaskFrame {
10
- readonly png: Uint8Array<ArrayBuffer>;
11
- }
10
+ /** Builds compact, independent alpha crops so overlapping masks stay exact. */
11
+ export declare function createRegionMaskCoverageFrame(instructions: readonly SerializableMaskInstruction[]): PreparedRegionMaskCoverageFrame | undefined;
12
12
  export declare function compositeMaskFrame(instructions: readonly SerializableMaskInstruction[]): CompositedMaskFrame | undefined;
13
- export declare function createMaskIdFrame(instructions: readonly SerializableMaskInstruction[]): IdMaskFrame | undefined;
14
- export declare function createPngIdMaskFrame(instructions: readonly SerializableMaskInstruction[]): Promise<PngIdMaskFrame | undefined>;
13
+ export declare function createIdMaskRasterFrame(instructions: readonly SerializableMaskInstruction[], maxRasterWidth?: number): IdMaskFrame | undefined;
14
+ export declare function createIdMaskPlane(instructions: readonly SerializableMaskInstruction[], maxRasterWidth?: number): PreparedIdMaskPlane | undefined;
15
15
  //# sourceMappingURL=mask-frame-compositor.d.ts.map
@@ -1 +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,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,SAAS,2BAA2B,EAAE,2BAGrD;AAED,wBAAsB,oBAAoB,CACxC,YAAY,EAAE,SAAS,2BAA2B,EAAE,GACnD,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAerC"}
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;AACxG,OAAO,KAAK,EACV,mBAAmB,EAEnB,+BAA+B,EAChC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAML,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAe7B,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,+EAA+E;AAC/E,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,SAAS,2BAA2B,EAAE,GACnD,+BAA+B,GAAG,SAAS,CAmB7C;AA6CD,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,SAAS,2BAA2B,EAAE,GACnD,mBAAmB,GAAG,SAAS,CAgBjC;AAED,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,SAAS,2BAA2B,EAAE,EACpD,cAAc,CAAC,EAAE,MAAM,GACtB,WAAW,GAAG,SAAS,CAUzB;AAED,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,SAAS,2BAA2B,EAAE,EACpD,cAAc,CAAC,EAAE,MAAM,GACtB,mBAAmB,GAAG,SAAS,CAMjC"}
@@ -1 +1 @@
1
- {"version":3,"file":"mask-frame-preparer.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-preparer.ts"],"names":[],"mappings":"AAMA,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"}
1
+ {"version":3,"file":"mask-frame-preparer.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-preparer.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,EACrB,KAAK,iBAAiB,EAEvB,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"}
@@ -1,8 +1,8 @@
1
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.
2
+ * Automatic mask preparation intentionally uses a small pool. Worker count
3
+ * increases memory pressure and competes with media decode, and every prepared
4
+ * frame crosses back to the main thread as a full-resolution raster. Explicit
5
+ * caller requests are allowed higher, but still bounded.
6
6
  */
7
7
  export declare const AUTO_MASK_PREPARATION_WORKER_LIMIT = 4;
8
8
  export declare const REQUESTED_MASK_PREPARATION_WORKER_LIMIT = 8;
@@ -1,6 +1,6 @@
1
1
  import type { DetectionMask, Point } from "supervision-js-core";
2
2
  import type { MaskStrokeStyle } from "supervision-js-core";
3
- import type { PreparedMaskFrameKind } from "./mask-frame-artifact";
3
+ import type { PreparedIdMaskPlane, PreparedMaskFrameKind, PreparedRegionMaskCoverageFrame } from "./mask-frame-artifact";
4
4
  export declare enum MaskPreparationWorkerMessageType {
5
5
  Complete = "complete",
6
6
  Empty = "empty",
@@ -11,7 +11,11 @@ interface SerializableRasterInstructionBase {
11
11
  readonly alpha: number;
12
12
  readonly color: number;
13
13
  readonly detectionIndex: number;
14
+ /** Semantic mask used only by exact Region renderer coverage. */
15
+ readonly regionCoverageMask?: DetectionMask;
14
16
  readonly stroke?: MaskStrokeStyle;
17
+ /** False when this instruction only carries Region coverage. */
18
+ readonly visible?: boolean;
15
19
  }
16
20
  export type SerializableMaskInstruction = (SerializableRasterInstructionBase & {
17
21
  readonly mask: DetectionMask;
@@ -27,6 +31,8 @@ export type SerializableMaskInstruction = (SerializableRasterInstructionBase & {
27
31
  export interface MaskFramePreparationJob {
28
32
  readonly instructions: readonly SerializableMaskInstruction[];
29
33
  readonly key: string;
34
+ /** Widest id raster to cook; absent, the instructions' own resolution. */
35
+ readonly maxRasterWidth?: number;
30
36
  }
31
37
  export interface MaskPreparationWorkerPrepareMessage {
32
38
  readonly job: MaskFramePreparationJob;
@@ -37,16 +43,19 @@ export interface MaskPreparationWorkerCompleteMessage {
37
43
  readonly artifactKind?: PreparedMaskFrameKind;
38
44
  readonly fillPalette?: Float32Array<ArrayBuffer>;
39
45
  readonly hasStroke?: boolean;
40
- readonly idMaskData?: Uint8Array<ArrayBuffer>;
46
+ readonly height?: number;
47
+ readonly idMaskPlane?: PreparedIdMaskPlane;
41
48
  readonly imageBitmap?: ImageBitmap;
42
49
  readonly imageData?: ImageData;
43
50
  readonly key: string;
44
51
  readonly maxStrokeWidth?: number;
45
- readonly png?: Uint8Array<ArrayBuffer>;
52
+ readonly raster?: Uint8Array<ArrayBuffer>;
53
+ readonly regionMaskCoverage?: PreparedRegionMaskCoverageFrame;
46
54
  readonly requestId: number;
47
55
  readonly strokePalette?: Float32Array<ArrayBuffer>;
48
56
  readonly strokeWidths?: Float32Array<ArrayBuffer>;
49
57
  readonly type: MaskPreparationWorkerMessageType.Complete;
58
+ readonly width?: number;
50
59
  }
51
60
  export interface MaskPreparationWorkerEmptyMessage {
52
61
  readonly key: string;
@@ -1 +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,CAAC;CACH,CAAC,CAAC;AAEP,MAAM,WAAW,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AAC;CACvD;AAED,MAAM,WAAW,iCAAiC;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"}
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,EACV,mBAAmB,EACnB,qBAAqB,EACrB,+BAA+B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,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,iEAAiE;IACjE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,aAAa,CAAC;IAC5C,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC,gEAAgE;IAChE,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,MAAM,2BAA2B,GACnC,CAAC,iCAAiC,GAAG;IACnC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,OAAO,C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WAAW,CAAC,CAAC;IAC1C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,+BAA+B,CAAC;IAC9D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACnD,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IAClD,QAAQ,CAAC,IAAI,EAAE,gCAAgC,CAAC,QAAQ,CAAC;IACzD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iCAAiC;IAChD,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,WAAW,iCAAiC;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"}
@@ -19,13 +19,28 @@ export declare enum PreparedRenderFrameMaskStatus {
19
19
  }
20
20
  export interface PreparedRenderWindow {
21
21
  getFrame(mediaTime: number): PreparedRenderFrame | undefined;
22
+ /**
23
+ * Whether this window's artifact for a media time is cooked, scheduling
24
+ * nothing. True when there is nothing to cook: no style, no frame there.
25
+ */
26
+ isArtifactPrepared(mediaTime: number): boolean;
22
27
  waitForReady(mediaTime: number, options: RenderPreparationPlaybackGateOptions): Promise<void>;
28
+ /**
29
+ * Whether the playhead is moving. A window over a resting playhead covers a
30
+ * paused margin instead of the full prefetch span.
31
+ */
32
+ setPlaybackActive(active: boolean): void;
23
33
  setTimelineContext(context: PreparedRenderTimelineContext): void;
24
34
  setMaskStyle(maskStyle: MaskStyle | null | undefined): void;
25
35
  destroy(): void;
26
36
  }
27
37
  export type { PreparedMaskFrame } from "./mask-frame-preparer";
28
38
  export type { PreparedRenderTimelineContext } from "./prepared-window-timeline";
39
+ /** How many frames ahead of the playhead a prepared window aims to cover. */
40
+ export declare function resolvePreparedWindowFrameCount(options: {
41
+ readonly prefetchFrameCount?: number;
42
+ readonly renderPreparation?: RenderPreparationOptions;
43
+ }): number;
29
44
  export declare function createPreparedRenderWindow(options: {
30
45
  readonly artifactKind?: RenderPreparationArtifactKind;
31
46
  readonly detectionTimeline: BufferedDetectionTimeline;
@@ -34,6 +49,8 @@ export declare function createPreparedRenderWindow(options: {
34
49
  readonly onMaskFrameEvicted?: (key: string) => void;
35
50
  readonly onMaskFramePrepared?: (maskFrame: PreparedMaskFrame) => void;
36
51
  readonly onMaskFramesCleared?: () => void;
52
+ /** Fires whenever what the window covers may have changed. */
53
+ readonly onPreparedWindowChange?: () => void;
37
54
  readonly prefetchFrameCount?: number;
38
55
  readonly preparedWindowScanIntervalSeconds?: number;
39
56
  readonly renderPreparation?: RenderPreparationOptions;
@@ -42,5 +59,11 @@ export declare function createPreparedRenderWindow(options: {
42
59
  readonly maskStyle: MaskStyle;
43
60
  readonly mediaTime: number;
44
61
  }) => readonly SerializableMaskInstruction[];
62
+ /**
63
+ * The widest id raster a cook may produce. A function because the raster is
64
+ * sized against media dimensions the caller only learns once its display
65
+ * exists, which is after this window does.
66
+ */
67
+ readonly resolveMaxRasterWidth?: () => number | undefined;
45
68
  }): PreparedRenderWindow;
46
69
  //# sourceMappingURL=prepared-render-window.d.ts.map
@@ -1 +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,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clear(): void;
8
7
  getFrameDistance(frameTime: number, mediaTime: number): number;
9
- getWindowFrames(bufferedFrames: readonly DetectionFrame[], mediaTime: number): readonly DetectionFrame[];
10
- rememberFrames(frames: readonly DetectionFrame[], retainedKeys: ReadonlySet<string>): void;
8
+ getWindowFrames(bufferedFrames: readonly DetectionFrame[], mediaTime: number, bufferEndTime: number | null): readonly DetectionFrame[];
11
9
  setContext(context: PreparedRenderTimelineContext): void;
12
10
  }
13
- export declare function createPreparedWindowTimeline(options: {
14
- readonly getFrameKey: (frame: DetectionFrame) => string;
15
- }): PreparedWindowTimeline;
11
+ export declare function createPreparedWindowTimeline(): PreparedWindowTimeline;
16
12
  //# sourceMappingURL=prepared-window-timeline.d.ts.map
@@ -1 +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"}
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,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,EACjB,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,SAAS,cAAc,EAAE,CAAC;IAC7B,UAAU,CAAC,OAAO,EAAE,6BAA6B,GAAG,IAAI,CAAC;CAC1D;AAED,wBAAgB,4BAA4B,IAAI,sBAAsB,CA6ErE"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * GLSL charges a uniform array of scalars one uniform vector per element, the
3
+ * same as an array of vec4, so the stroke widths ride four to a vector and an
4
+ * entry costs 2.25 vectors instead of 3. The lanes only line up while the entry
5
+ * count stays a multiple of four.
6
+ */
7
+ export declare const ID_MASK_STROKE_WIDTH_LANES: number;
8
+ export declare const idMaskPaletteGlsl = "\nuniform vec4 uFillPalette[80];\nuniform vec4 uStrokePalette[80];\nuniform vec4 uStrokeWidths[20];\n\nint paletteIndex(float maskId) {\n return int(clamp(maskId, 0.0, float(79)));\n}\n\nvec4 readFill(float maskId) {\n return uFillPalette[paletteIndex(maskId)];\n}\n\nvec4 readStroke(float maskId) {\n return uStrokePalette[paletteIndex(maskId)];\n}\n\nfloat readStrokeWidth(float maskId) {\n int index = paletteIndex(maskId);\n\n return uStrokeWidths[index / 4][index % 4];\n}\n";
9
+ export declare const idMaskFillPaletteWgslField = "uFillPalette: array<vec4<f32>, 80>,";
10
+ export declare const idMaskStrokePaletteWgslField = "uStrokePalette: array<vec4<f32>, 80>,";
11
+ export declare const idMaskStrokeWidthsWgslField = "uStrokeWidths: array<vec4<f32>, 20>,";
12
+ /** Reads the uniform group a fragment stage must bind under the name maskUniforms. */
13
+ export declare const idMaskPaletteWgsl = "\nfn paletteIndex(maskId: f32) -> i32 {\n return i32(clamp(maskId, 0.0, 79.0));\n}\n\nfn readFill(maskId: f32) -> vec4<f32> {\n return maskUniforms.uFillPalette[paletteIndex(maskId)];\n}\n\nfn readStroke(maskId: f32) -> vec4<f32> {\n return maskUniforms.uStrokePalette[paletteIndex(maskId)];\n}\n\nfn readStrokeWidth(maskId: f32) -> f32 {\n let index = paletteIndex(maskId);\n\n return maskUniforms.uStrokeWidths[index / 4][index % 4];\n}\n";
14
+ //# sourceMappingURL=mask-palette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-palette.d.ts","sourceRoot":"","sources":["../../src/renderers/mask-palette.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,QAAkC,CAAC;AAE1E,eAAO,MAAM,iBAAiB,yeAsB7B,CAAC;AAEF,eAAO,MAAM,0BAA0B,wCAAoE,CAAC;AAE5G,eAAO,MAAM,4BAA4B,0CAAsE,CAAC;AAEhH,eAAO,MAAM,2BAA2B,yCAAoE,CAAC;AAE7G,sFAAsF;AACtF,eAAO,MAAM,iBAAiB,kcAkB7B,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The vertex stage every mask shader draws with. Only the tint varies: a
3
+ * fragment stage that multiplies the mask by the world color reads vColor,
4
+ * one that samples the mask alone takes no such input.
5
+ */
6
+ export declare const tintedMaskVertexWgsl = "\nstruct GlobalUniforms {\n uProjectionMatrix: mat3x3<f32>,\n uWorldTransformMatrix: mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n}\n\nstruct LocalUniforms {\n uTransformMatrix: mat3x3<f32>,\n uColor: vec4<f32>,\n uRound: f32,\n}\n\n@group(0) @binding(0) var<uniform> globalUniforms: GlobalUniforms;\n@group(1) @binding(0) var<uniform> localUniforms: LocalUniforms;\n\nstruct VertexOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) vUV: vec2<f32>,\n @location(1) vColor: vec4<f32>,\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition: vec2<f32>,\n @location(1) aUV: vec2<f32>,\n) -> VertexOutput {\n let modelViewProjectionMatrix =\n globalUniforms.uProjectionMatrix *\n globalUniforms.uWorldTransformMatrix *\n localUniforms.uTransformMatrix;\n\n var output: VertexOutput;\n\n output.position = vec4<f32>(\n (modelViewProjectionMatrix * vec3<f32>(aPosition, 1.0)).xy,\n 0.0,\n 1.0\n );\n output.vUV = aUV;\n output.vColor = globalUniforms.uWorldColorAlpha * localUniforms.uColor;\n\n return output;\n}\n";
7
+ export declare const untintedMaskVertexWgsl = "\nstruct GlobalUniforms {\n uProjectionMatrix: mat3x3<f32>,\n uWorldTransformMatrix: mat3x3<f32>,\n uWorldColorAlpha: vec4<f32>,\n uResolution: vec2<f32>,\n}\n\nstruct LocalUniforms {\n uTransformMatrix: mat3x3<f32>,\n uColor: vec4<f32>,\n uRound: f32,\n}\n\n@group(0) @binding(0) var<uniform> globalUniforms: GlobalUniforms;\n@group(1) @binding(0) var<uniform> localUniforms: LocalUniforms;\n\nstruct VertexOutput {\n @builtin(position) position: vec4<f32>,\n @location(0) vUV: vec2<f32>,\n}\n\n@vertex\nfn mainVertex(\n @location(0) aPosition: vec2<f32>,\n @location(1) aUV: vec2<f32>,\n) -> VertexOutput {\n let modelViewProjectionMatrix =\n globalUniforms.uProjectionMatrix *\n globalUniforms.uWorldTransformMatrix *\n localUniforms.uTransformMatrix;\n\n var output: VertexOutput;\n\n output.position = vec4<f32>(\n (modelViewProjectionMatrix * vec3<f32>(aPosition, 1.0)).xy,\n 0.0,\n 1.0\n );\n output.vUV = aUV;\n\n return output;\n}\n";
8
+ /**
9
+ * The GL counterpart of the tinted vertex stage. Pixi caches a program under
10
+ * both of its stages' source text, so shaders that share this one still get a
11
+ * program each from their own fragment stage.
12
+ */
13
+ export declare const tintedMaskVertexGlsl = "#version 300 es\nprecision highp float;\n\nin vec2 aPosition;\nin vec2 aUV;\n\nuniform mat3 uProjectionMatrix;\nuniform mat3 uWorldTransformMatrix;\nuniform vec4 uWorldColorAlpha;\nuniform mat3 uTransformMatrix;\nuniform vec4 uColor;\n\nout vec2 vUV;\nout vec4 vColor;\n\nvoid main(void) {\n mat3 modelViewProjectionMatrix =\n uProjectionMatrix * uWorldTransformMatrix * uTransformMatrix;\n\n gl_Position =\n vec4((modelViewProjectionMatrix * vec3(aPosition, 1.0)).xy, 0.0, 1.0);\n vUV = aUV;\n vColor = uWorldColorAlpha * uColor;\n}\n";
14
+ //# sourceMappingURL=mask-vertex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-vertex.d.ts","sourceRoot":"","sources":["../../src/renderers/mask-vertex.ts"],"names":[],"mappings":"AAuDA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,mkCAA+F,CAAC;AAEjI,eAAO,MAAM,sBAAsB,q9BAAgE,CAAC;AAEpG;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,siBAwBhC,CAAC"}