supervision 0.2.0-next.0 → 0.2.0-next.2

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 (192) hide show
  1. package/dist/constants/media-renderer.d.ts +3 -0
  2. package/dist/constants/media-renderer.d.ts.map +1 -1
  3. package/dist/index.d.ts +5 -5
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +1722 -1395
  6. package/dist/index.js.map +1 -1
  7. package/dist/mask-preparation.worker.js +109 -31
  8. package/dist/mask-preparation.worker.js.map +1 -1
  9. package/dist/media/media-frame-clock.d.ts +4 -0
  10. package/dist/media/media-frame-clock.d.ts.map +1 -0
  11. package/dist/media/media-source-state.d.ts.map +1 -1
  12. package/dist/media/media-source.d.ts +6 -0
  13. package/dist/media/media-source.d.ts.map +1 -1
  14. package/dist/media/video-engine-media-source.d.ts +17 -7
  15. package/dist/media/video-engine-media-source.d.ts.map +1 -1
  16. package/dist/media/video-engine-media-source.js +3 -0
  17. package/dist/media/video-engine-media-source.js.map +1 -0
  18. package/dist/playback/media-playback-controller.d.ts +7 -1
  19. package/dist/playback/media-playback-controller.d.ts.map +1 -1
  20. package/dist/render-preparation/mask-frame-artifact.d.ts +2 -0
  21. package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
  22. package/dist/render-preparation/mask-frame-compositor.d.ts +7 -0
  23. package/dist/render-preparation/mask-frame-compositor.d.ts.map +1 -1
  24. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts +1 -0
  25. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
  26. package/dist/render-preparation/prepared-render-window.d.ts +21 -2
  27. package/dist/render-preparation/prepared-render-window.d.ts.map +1 -1
  28. package/dist/render-preparation/prepared-window-timeline.d.ts +1 -0
  29. package/dist/render-preparation/prepared-window-timeline.d.ts.map +1 -1
  30. package/dist/renderers/injected-pixi.d.ts +38 -0
  31. package/dist/renderers/injected-pixi.d.ts.map +1 -0
  32. package/dist/renderers/media-frame-navigation.d.ts +17 -0
  33. package/dist/renderers/media-frame-navigation.d.ts.map +1 -0
  34. package/dist/renderers/media-renderer-core.d.ts +9 -0
  35. package/dist/renderers/media-renderer-core.d.ts.map +1 -1
  36. package/dist/renderers/media-renderer-scene.d.ts +17 -5
  37. package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
  38. package/dist/renderers/media-renderer-state.d.ts +9 -0
  39. package/dist/renderers/media-renderer-state.d.ts.map +1 -1
  40. package/dist/renderers/media-renderer-transport.d.ts +19 -3
  41. package/dist/renderers/media-renderer-transport.d.ts.map +1 -1
  42. package/dist/renderers/pixi-focus-layer.d.ts +1 -0
  43. package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
  44. package/dist/renderers/pixi-frame-present.d.ts +1 -1
  45. package/dist/renderers/pixi-frame-present.d.ts.map +1 -1
  46. package/dist/renderers/pixi-id-mask-shader.d.ts +4 -33
  47. package/dist/renderers/pixi-id-mask-shader.d.ts.map +1 -1
  48. package/dist/renderers/pixi-interaction-presentation-layer.d.ts +0 -1
  49. package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
  50. package/dist/renderers/pixi-mask-halo.d.ts +4 -33
  51. package/dist/renderers/pixi-mask-halo.d.ts.map +1 -1
  52. package/dist/renderers/pixi-mask-layer.d.ts +28 -29
  53. package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
  54. package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
  55. package/dist/renderers/pixi-polygon-layer.d.ts +2 -0
  56. package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
  57. package/dist/renderers/pixi-region-coverage-mask.d.ts +4 -33
  58. package/dist/renderers/pixi-region-coverage-mask.d.ts.map +1 -1
  59. package/dist/renderers/pixi-region-layer.d.ts +6 -31
  60. package/dist/renderers/pixi-region-layer.d.ts.map +1 -1
  61. package/dist/renderers/pixi-shader-lifecycle.d.ts +14 -0
  62. package/dist/renderers/pixi-shader-lifecycle.d.ts.map +1 -0
  63. package/dist/renderers/prepared-annotation-window.d.ts.map +1 -1
  64. package/dist/renderers/presented-frame-channel.d.ts +34 -1
  65. package/dist/renderers/presented-frame-channel.d.ts.map +1 -1
  66. package/dist/sessions/media-session-defaults.d.ts.map +1 -1
  67. package/dist/sessions/media-session-detections.d.ts.map +1 -1
  68. package/dist/sessions/media-session-state.d.ts.map +1 -1
  69. package/dist/sessions/media-session.d.ts.map +1 -1
  70. package/dist/tracking.worker.js +19 -5
  71. package/dist/tracking.worker.js.map +1 -1
  72. package/dist/types/media-frame-clock.d.ts +16 -0
  73. package/dist/types/media-frame-clock.d.ts.map +1 -0
  74. package/dist/types/media-frame-navigation.d.ts +28 -0
  75. package/dist/types/media-frame-navigation.d.ts.map +1 -0
  76. package/dist/types/media-renderer-display.d.ts +12 -0
  77. package/dist/types/media-renderer-display.d.ts.map +1 -0
  78. package/dist/types/media-renderer.d.ts +13 -0
  79. package/dist/types/media-renderer.d.ts.map +1 -1
  80. package/dist/types/media-session.d.ts +35 -32
  81. package/dist/types/media-session.d.ts.map +1 -1
  82. package/dist/types/render-preparation.d.ts +78 -28
  83. package/dist/types/render-preparation.d.ts.map +1 -1
  84. package/dist/video-engine-media-source-DR-x1UfK.js +483 -0
  85. package/dist/video-engine-media-source-DR-x1UfK.js.map +1 -0
  86. package/dist/web-video-engine/analysis-session.d.ts +0 -1
  87. package/dist/web-video-engine/analysis.d.ts +0 -1
  88. package/dist/web-video-engine/analysis.js +211 -23
  89. package/dist/web-video-engine/cache-budget.d.ts +0 -1
  90. package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts +6 -2
  91. package/dist/web-video-engine/clock.d.ts +0 -1
  92. package/dist/web-video-engine/constants.d.ts +9 -1
  93. package/dist/web-video-engine/create-scrub-cursor.d.ts +6 -3
  94. package/dist/web-video-engine/decode-resolution.d.ts +0 -1
  95. package/dist/web-video-engine/decode-scheduler.d.ts +26 -5
  96. package/dist/web-video-engine/decode-session.d.ts +11 -1
  97. package/dist/web-video-engine/decode-source.d.ts +11 -1
  98. package/dist/web-video-engine/diagnostics-store.d.ts +0 -1
  99. package/dist/web-video-engine/diagnostics.d.ts +19 -19
  100. package/dist/web-video-engine/embedded-engine-worker.d.ts +0 -1
  101. package/dist/web-video-engine/engine-core.d.ts +31 -11
  102. package/dist/web-video-engine/engine.d.ts +3 -4
  103. package/dist/web-video-engine/engine.js +175 -44
  104. package/dist/web-video-engine/engine.worker.d.ts +0 -1
  105. package/dist/web-video-engine/engine.worker.js +5712 -2947
  106. package/dist/web-video-engine/frame-cache.d.ts +121 -12
  107. package/dist/web-video-engine/frame-extractor.d.ts +0 -1
  108. package/dist/web-video-engine/{frame-timeline-GINI8Gum.js → frame-timeline-DreEwsRY.js} +83 -27
  109. package/dist/web-video-engine/frame-timeline.d.ts +10 -1
  110. package/dist/web-video-engine/frame-walker.d.ts +0 -1
  111. package/dist/web-video-engine/index.d.ts +12 -2
  112. package/dist/web-video-engine/index.d.ts.map +1 -1
  113. package/dist/web-video-engine/index.js +2 -2
  114. package/dist/web-video-engine/key-packet.d.ts +0 -1
  115. package/dist/web-video-engine/keyframe-index.d.ts +0 -1
  116. package/dist/web-video-engine/mirror-store.d.ts +0 -1
  117. package/dist/web-video-engine/pausable-deadline.d.ts +11 -0
  118. package/dist/web-video-engine/renderer.d.ts +0 -1
  119. package/dist/web-video-engine/rotation.d.ts +0 -1
  120. package/dist/web-video-engine/scrub-controller.d.ts +8 -5
  121. package/dist/web-video-engine/scrub-cursor.d.ts +15 -7
  122. package/dist/web-video-engine/scrub-trajectory.d.ts +0 -1
  123. package/dist/web-video-engine/source-residency.d.ts +35 -1
  124. package/dist/web-video-engine/trace-recorder.d.ts +0 -1
  125. package/dist/web-video-engine/types.d.ts +18 -22
  126. package/dist/web-video-engine/video-engine.d.ts +39 -17
  127. package/dist/web-video-engine/webgpu-renderer.d.ts +0 -1
  128. package/dist/web-video-engine/worker-bridge.d.ts +0 -1
  129. package/dist/web-video-engine/worker-dispatch.d.ts +0 -1
  130. package/dist/web-video-engine/worker-protocol.d.ts +38 -15
  131. package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts.map +1 -1
  132. package/node_modules/supervision-js-core/dist/index.d.ts +2 -2
  133. package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
  134. package/node_modules/supervision-js-core/dist/index.js +182 -68
  135. package/node_modules/supervision-js-core/dist/index.js.map +1 -1
  136. package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts +20 -3
  137. package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts.map +1 -1
  138. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +28 -26
  139. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
  140. package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts +16 -0
  141. package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts.map +1 -1
  142. package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts.map +1 -1
  143. package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts +19 -0
  144. package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts.map +1 -1
  145. package/package.json +3 -3
  146. package/dist/media/media-condition-probe.d.ts +0 -51
  147. package/dist/media/media-condition-probe.d.ts.map +0 -1
  148. package/dist/media/media-conditions.d.ts +0 -28
  149. package/dist/media/media-conditions.d.ts.map +0 -1
  150. package/dist/types/media-conditions.d.ts +0 -149
  151. package/dist/types/media-conditions.d.ts.map +0 -1
  152. package/dist/web-video-engine/analysis-session.d.ts.map +0 -1
  153. package/dist/web-video-engine/analysis.d.ts.map +0 -1
  154. package/dist/web-video-engine/analysis.js.map +0 -1
  155. package/dist/web-video-engine/cache-budget.d.ts.map +0 -1
  156. package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts.map +0 -1
  157. package/dist/web-video-engine/clock.d.ts.map +0 -1
  158. package/dist/web-video-engine/constants.d.ts.map +0 -1
  159. package/dist/web-video-engine/create-scrub-cursor.d.ts.map +0 -1
  160. package/dist/web-video-engine/decode-resolution.d.ts.map +0 -1
  161. package/dist/web-video-engine/decode-scheduler.d.ts.map +0 -1
  162. package/dist/web-video-engine/decode-session.d.ts.map +0 -1
  163. package/dist/web-video-engine/decode-source.d.ts.map +0 -1
  164. package/dist/web-video-engine/diagnostics-store.d.ts.map +0 -1
  165. package/dist/web-video-engine/diagnostics.d.ts.map +0 -1
  166. package/dist/web-video-engine/embedded-engine-worker.d.ts.map +0 -1
  167. package/dist/web-video-engine/engine-core.d.ts.map +0 -1
  168. package/dist/web-video-engine/engine.d.ts.map +0 -1
  169. package/dist/web-video-engine/engine.js.map +0 -1
  170. package/dist/web-video-engine/engine.worker.d.ts.map +0 -1
  171. package/dist/web-video-engine/engine.worker.js.map +0 -1
  172. package/dist/web-video-engine/frame-cache.d.ts.map +0 -1
  173. package/dist/web-video-engine/frame-extractor.d.ts.map +0 -1
  174. package/dist/web-video-engine/frame-timeline-GINI8Gum.js.map +0 -1
  175. package/dist/web-video-engine/frame-timeline.d.ts.map +0 -1
  176. package/dist/web-video-engine/frame-walker.d.ts.map +0 -1
  177. package/dist/web-video-engine/key-packet.d.ts.map +0 -1
  178. package/dist/web-video-engine/keyframe-index.d.ts.map +0 -1
  179. package/dist/web-video-engine/mirror-store.d.ts.map +0 -1
  180. package/dist/web-video-engine/renderer.d.ts.map +0 -1
  181. package/dist/web-video-engine/rotation.d.ts.map +0 -1
  182. package/dist/web-video-engine/scrub-controller.d.ts.map +0 -1
  183. package/dist/web-video-engine/scrub-cursor.d.ts.map +0 -1
  184. package/dist/web-video-engine/scrub-trajectory.d.ts.map +0 -1
  185. package/dist/web-video-engine/source-residency.d.ts.map +0 -1
  186. package/dist/web-video-engine/trace-recorder.d.ts.map +0 -1
  187. package/dist/web-video-engine/types.d.ts.map +0 -1
  188. package/dist/web-video-engine/video-engine.d.ts.map +0 -1
  189. package/dist/web-video-engine/webgpu-renderer.d.ts.map +0 -1
  190. package/dist/web-video-engine/worker-bridge.d.ts.map +0 -1
  191. package/dist/web-video-engine/worker-dispatch.d.ts.map +0 -1
  192. package/dist/web-video-engine/worker-protocol.d.ts.map +0 -1
@@ -563,8 +563,8 @@ function startWaitBound(timeoutMs) {
563
563
  return { cancel: () => clearTimeout(handle), expired };
564
564
  }
565
565
 
566
- const DEFAULT_BUFFER_AHEAD_SECONDS = 5;
567
- const DEFAULT_BUFFER_BEHIND_SECONDS = 0.5;
566
+ const DEFAULT_BUFFER_AHEAD_SECONDS = 10;
567
+ const DEFAULT_BUFFER_BEHIND_SECONDS = 5;
568
568
  /**
569
569
  * Share of the ahead window that must still lead the playhead when the next
570
570
  * window is fetched.
@@ -615,6 +615,7 @@ function createBufferedDetectionTimeline(options) {
615
615
  duration: null,
616
616
  loop: false,
617
617
  };
618
+ let timelineFirstTimestamp = 0;
618
619
  let inFlight;
619
620
  let incrementalRefresh;
620
621
  /** Source version the gate last gave up on, or null while it still waits. */
@@ -754,14 +755,15 @@ function createBufferedDetectionTimeline(options) {
754
755
  state.bufferEndTime === null) {
755
756
  return;
756
757
  }
757
- const laps = Math.round((getComparableMediaTime(mediaTime) - mediaTime) / duration);
758
+ const loopSpan = duration - timelineFirstTimestamp;
759
+ const laps = Math.round((getComparableMediaTime(mediaTime) - mediaTime) / loopSpan);
758
760
  if (laps === 0) {
759
761
  return;
760
762
  }
761
763
  state = {
762
764
  ...state,
763
- bufferEndTime: state.bufferEndTime - laps * duration,
764
- bufferStartTime: state.bufferStartTime - laps * duration,
765
+ bufferEndTime: state.bufferEndTime - laps * loopSpan,
766
+ bufferStartTime: state.bufferStartTime - laps * loopSpan,
765
767
  };
766
768
  notifyBufferChanged();
767
769
  };
@@ -773,6 +775,32 @@ function createBufferedDetectionTimeline(options) {
773
775
  comparableMediaTime >= state.bufferStartTime &&
774
776
  comparableMediaTime <= state.bufferEndTime);
775
777
  };
778
+ const inFlightCovers = (mediaTime) => {
779
+ if (!inFlight) {
780
+ return true;
781
+ }
782
+ const comparableMediaTime = getComparableMediaTime(mediaTime);
783
+ return (comparableMediaTime >= inFlight.startTime &&
784
+ comparableMediaTime <= inFlight.endTime);
785
+ };
786
+ const supersedeLoadOutside = (mediaTime) => {
787
+ if (!inFlight || inFlightCovers(mediaTime)) {
788
+ return;
789
+ }
790
+ const keepsCurrentBuffer = isBuffered(mediaTime);
791
+ loadId += 1;
792
+ inFlight = undefined;
793
+ if (keepsCurrentBuffer) {
794
+ state = {
795
+ ...state,
796
+ errorMessage: null,
797
+ requestedEndTime: state.bufferEndTime,
798
+ requestedStartTime: state.bufferStartTime,
799
+ status: DetectionBufferStatus.Ready,
800
+ };
801
+ notifyBufferChanged();
802
+ }
803
+ };
776
804
  const isInsideBufferedRange = (mediaTime) => {
777
805
  const comparableMediaTime = getComparableMediaTime(mediaTime);
778
806
  return (bufferedVersionRange !== null &&
@@ -783,6 +811,11 @@ function createBufferedDetectionTimeline(options) {
783
811
  };
784
812
  const refreshBuffer = async (mediaTime, lead = "full") => {
785
813
  if (isBuffered(mediaTime)) {
814
+ // A backwards navigation may land in the retained buffer while a rolling
815
+ // prefetch for the old playhead is about to replace it. The navigation
816
+ // is current truth; do not let that older load evict its detections after
817
+ // the frame has been accepted.
818
+ supersedeLoadOutside(mediaTime);
786
819
  return;
787
820
  }
788
821
  if (isInsideBufferedRange(mediaTime) &&
@@ -833,16 +866,27 @@ function createBufferedDetectionTimeline(options) {
833
866
  if (destroyed || !isLoadingEnabled()) {
834
867
  return;
835
868
  }
869
+ adoptFirstTimestamp(prepareOptions?.firstTimestamp);
870
+ const navigationMediaTime = getNavigationMediaTime(mediaTime);
836
871
  if (shouldWaitForPlaybackGate(prepareOptions)) {
837
- await waitForPlaybackGate(mediaTime, prepareOptions);
872
+ await waitForPlaybackGate(navigationMediaTime, prepareOptions);
838
873
  if (destroyed) {
839
874
  return;
840
875
  }
841
876
  }
842
- await refreshBuffer(mediaTime);
843
- anchorWindowToPlayhead(mediaTime);
877
+ await refreshBuffer(navigationMediaTime);
878
+ anchorWindowToPlayhead(navigationMediaTime);
879
+ },
880
+ needsBufferPrepare(mediaTime) {
881
+ const navigationMediaTime = getNavigationMediaTime(mediaTime);
882
+ return (!destroyed &&
883
+ isLoadingEnabled() &&
884
+ (!isInsideBufferedRange(navigationMediaTime) ||
885
+ !inFlightCovers(navigationMediaTime)));
844
886
  },
845
887
  needsPlaybackGateWait(mediaTime, prepareOptions) {
888
+ adoptFirstTimestamp(prepareOptions?.firstTimestamp);
889
+ const navigationMediaTime = getNavigationMediaTime(mediaTime);
846
890
  if (destroyed ||
847
891
  !isLoadingEnabled() ||
848
892
  !playbackGate?.enabled ||
@@ -852,27 +896,31 @@ function createBufferedDetectionTimeline(options) {
852
896
  return false;
853
897
  }
854
898
  const availableRanges = options.source.getAvailableRanges();
855
- return !createPlaybackGateCoveragePlan(mediaTime, prepareOptions).sourceRanges.every((range) => isRangeCovered(range, availableRanges));
899
+ return !createPlaybackGateCoveragePlan(navigationMediaTime, prepareOptions).sourceRanges.every((range) => isRangeCovered(range, availableRanges));
856
900
  },
857
901
  prefetch(mediaTime) {
858
902
  if (destroyed || !isLoadingEnabled()) {
859
903
  return;
860
904
  }
861
- anchorWindowToPlayhead(mediaTime);
862
- if (!shouldPrefetch(mediaTime)) {
905
+ const navigationMediaTime = getNavigationMediaTime(mediaTime);
906
+ anchorWindowToPlayhead(navigationMediaTime);
907
+ supersedeLoadOutside(navigationMediaTime);
908
+ if (!shouldPrefetch(navigationMediaTime)) {
863
909
  return;
864
910
  }
865
- pendingPrefetch = { loadId, mediaTime };
911
+ pendingPrefetch = { loadId, mediaTime: navigationMediaTime };
866
912
  pumpPrefetchQueue();
867
913
  },
868
914
  selectFrame(mediaTime) {
869
- if (!isBuffered(mediaTime)) {
915
+ const navigationMediaTime = getNavigationMediaTime(mediaTime);
916
+ if (!isInsideBufferedRange(navigationMediaTime)) {
870
917
  return undefined;
871
918
  }
872
- return selectDetectionFrame(buffer, getSourceMediaTime(mediaTime), options);
919
+ return selectDetectionFrame(buffer, getSourceMediaTime(navigationMediaTime), options);
873
920
  },
874
921
  setTimelineContext(context) {
875
922
  timelineContext = context;
923
+ adoptFirstTimestamp(context.firstTimestamp);
876
924
  bufferedSourceVersion = null;
877
925
  bufferedVersionRange = null;
878
926
  },
@@ -1008,12 +1056,12 @@ function createBufferedDetectionTimeline(options) {
1008
1056
  }
1009
1057
  function createPlaybackGateCoveragePlan(mediaTime, prepareOptions) {
1010
1058
  const requiredAheadSeconds = Math.max(0, playbackGate?.requiredAheadSeconds ?? 0);
1011
- const comparableMediaTime = getComparableMediaTime(mediaTime);
1059
+ const comparableMediaTime = Math.max(timelineFirstTimestamp, getComparableMediaTime(mediaTime));
1012
1060
  const endTime = getRequiredCoverageEndTime({
1013
1061
  // A looping window counts past the end of media and wraps into the
1014
1062
  // replay, so clamping it to duration would ask for less than it needs.
1015
1063
  duration: isLoopingTimeline() ? null : prepareOptions?.duration,
1016
- firstTimestamp: prepareOptions?.firstTimestamp,
1064
+ firstTimestamp: timelineFirstTimestamp,
1017
1065
  mediaTime: comparableMediaTime,
1018
1066
  requiredAheadSeconds,
1019
1067
  });
@@ -1100,21 +1148,23 @@ function createBufferedDetectionTimeline(options) {
1100
1148
  * a looping timeline. A plan is stated on the first lap and the window on the
1101
1149
  * playhead's, so across the loop point the two state the same edge a whole lap
1102
1150
  * apart; measured straight, that reads as a window a full lap stale and
1103
- * rebuilds it on every frame until the plan stops reaching behind zero.
1151
+ * rebuilds it on every frame until the plan stops reaching behind the first
1152
+ * playable timestamp.
1104
1153
  */
1105
1154
  function getWindowDrift(planTime, bufferTime) {
1106
1155
  const drift = Math.abs(planTime - bufferTime);
1107
1156
  if (!isLoopingTimeline() || timelineContext.duration === null) {
1108
1157
  return drift;
1109
1158
  }
1110
- const wrappedDrift = modulo(drift, timelineContext.duration);
1111
- return Math.min(wrappedDrift, timelineContext.duration - wrappedDrift);
1159
+ const loopSpan = timelineContext.duration - timelineFirstTimestamp;
1160
+ const wrappedDrift = modulo(drift, loopSpan);
1161
+ return Math.min(wrappedDrift, loopSpan - wrappedDrift);
1112
1162
  }
1113
1163
  function createLoadPlan(requestedStartTime, requestedEndTime) {
1114
1164
  const startTime = Math.min(requestedStartTime, requestedEndTime);
1115
1165
  const endTime = Math.max(startTime, requestedEndTime);
1116
1166
  if (!isLoopingTimeline()) {
1117
- const clampedStartTime = Math.max(0, startTime);
1167
+ const clampedStartTime = Math.max(timelineFirstTimestamp, startTime);
1118
1168
  const clampedEndTime = Math.max(clampedStartTime, endTime);
1119
1169
  return {
1120
1170
  endTime: clampedEndTime,
@@ -1128,22 +1178,25 @@ function createBufferedDetectionTimeline(options) {
1128
1178
  };
1129
1179
  }
1130
1180
  const duration = timelineContext.duration ?? 0;
1131
- if (endTime - startTime >= duration) {
1181
+ const loopSpan = duration - timelineFirstTimestamp;
1182
+ if (endTime - startTime >= loopSpan) {
1132
1183
  return {
1133
1184
  endTime: duration,
1134
- sourceRanges: [{ endTime: duration, startTime: 0 }],
1135
- startTime: 0,
1185
+ sourceRanges: [
1186
+ { endTime: duration, startTime: timelineFirstTimestamp },
1187
+ ],
1188
+ startTime: timelineFirstTimestamp,
1136
1189
  };
1137
1190
  }
1138
1191
  // Both ends move by the same whole number of laps, so the window keeps its
1139
1192
  // span and its source ranges while its start reads on the media clock: a
1140
1193
  // window counted in the laps playback accumulated is one no host can hold
1141
1194
  // against a current time.
1142
- const laps = Math.floor(startTime / duration);
1195
+ const laps = Math.floor((startTime - timelineFirstTimestamp) / loopSpan);
1143
1196
  return {
1144
- endTime: endTime - laps * duration,
1145
- sourceRanges: getLoopingSourceRanges(startTime, endTime, duration),
1146
- startTime: startTime - laps * duration,
1197
+ endTime: endTime - laps * loopSpan,
1198
+ sourceRanges: getLoopingSourceRanges(startTime, endTime, duration, timelineFirstTimestamp),
1199
+ startTime: startTime - laps * loopSpan,
1147
1200
  };
1148
1201
  }
1149
1202
  function getBufferedSourceRanges() {
@@ -1155,7 +1208,7 @@ function createBufferedDetectionTimeline(options) {
1155
1208
  function isLoopingTimeline() {
1156
1209
  return (timelineContext.loop &&
1157
1210
  timelineContext.duration !== null &&
1158
- timelineContext.duration > 0);
1211
+ timelineContext.duration > timelineFirstTimestamp);
1159
1212
  }
1160
1213
  function getComparableMediaTime(mediaTime) {
1161
1214
  if (!isLoopingTimeline() ||
@@ -1164,23 +1217,42 @@ function createBufferedDetectionTimeline(options) {
1164
1217
  timelineContext.duration === null) {
1165
1218
  return mediaTime;
1166
1219
  }
1167
- const duration = timelineContext.duration;
1168
- // The representative of mediaTime (mod duration) anchored at the window
1220
+ const loopSpan = timelineContext.duration - timelineFirstTimestamp;
1221
+ // The representative of mediaTime (mod the loop span) anchored at the window
1169
1222
  // start. The mapping must depend only on where the window sits, never on
1170
1223
  // how many laps playback has accumulated, or membership drifts away from
1171
1224
  // what the buffer actually holds. A time less than one lap past the
1172
1225
  // anchor never wraps, so ordinary forward playback cannot ratchet.
1173
1226
  return (state.bufferStartTime +
1174
- modulo(mediaTime - state.bufferStartTime, duration));
1227
+ modulo(mediaTime - state.bufferStartTime, loopSpan));
1175
1228
  }
1176
1229
  function getSourceMediaTime(mediaTime) {
1177
1230
  if (!isLoopingTimeline() || timelineContext.duration === null) {
1178
1231
  return mediaTime;
1179
1232
  }
1180
- if (mediaTime >= 0 && mediaTime <= timelineContext.duration) {
1233
+ if (mediaTime >= timelineFirstTimestamp &&
1234
+ mediaTime <= timelineContext.duration) {
1181
1235
  return mediaTime;
1182
1236
  }
1183
- return modulo(mediaTime, timelineContext.duration);
1237
+ const loopSpan = timelineContext.duration - timelineFirstTimestamp;
1238
+ return (timelineFirstTimestamp +
1239
+ modulo(mediaTime - timelineFirstTimestamp, loopSpan));
1240
+ }
1241
+ function getNavigationMediaTime(mediaTime) {
1242
+ return Math.max(timelineFirstTimestamp, mediaTime);
1243
+ }
1244
+ function adoptFirstTimestamp(firstTimestamp) {
1245
+ if (firstTimestamp === undefined ||
1246
+ !Number.isFinite(firstTimestamp) ||
1247
+ firstTimestamp === timelineFirstTimestamp) {
1248
+ return;
1249
+ }
1250
+ timelineFirstTimestamp = firstTimestamp;
1251
+ loadId += 1;
1252
+ inFlight = undefined;
1253
+ pendingPrefetch = undefined;
1254
+ bufferedSourceVersion = null;
1255
+ bufferedVersionRange = null;
1184
1256
  }
1185
1257
  }
1186
1258
  function createIdleDetectionBufferState() {
@@ -1211,13 +1283,14 @@ function getRequiredCoverageEndTime(options) {
1211
1283
  if (options.duration === null || options.duration === undefined) {
1212
1284
  return requestedEndTime;
1213
1285
  }
1214
- return Math.min(requestedEndTime, (options.firstTimestamp ?? 0) + Math.max(options.duration, 0));
1286
+ return Math.min(requestedEndTime, Math.max(options.firstTimestamp ?? 0, options.duration));
1215
1287
  }
1216
- function getLoopingSourceRanges(startTime, endTime, duration) {
1217
- const normalizedStartTime = modulo(startTime, duration);
1218
- const normalizedEndTime = modulo(endTime, duration);
1219
- const startCycle = Math.floor(startTime / duration);
1220
- const endCycle = Math.floor(endTime / duration);
1288
+ function getLoopingSourceRanges(startTime, endTime, duration, firstTimestamp = 0) {
1289
+ const loopSpan = duration - firstTimestamp;
1290
+ const normalizedStartTime = firstTimestamp + modulo(startTime - firstTimestamp, loopSpan);
1291
+ const normalizedEndTime = firstTimestamp + modulo(endTime - firstTimestamp, loopSpan);
1292
+ const startCycle = Math.floor((startTime - firstTimestamp) / loopSpan);
1293
+ const endCycle = Math.floor((endTime - firstTimestamp) / loopSpan);
1221
1294
  if (startCycle === endCycle) {
1222
1295
  return [{ endTime: normalizedEndTime, startTime: normalizedStartTime }];
1223
1296
  }
@@ -1225,8 +1298,8 @@ function getLoopingSourceRanges(startTime, endTime, duration) {
1225
1298
  if (normalizedStartTime < duration) {
1226
1299
  ranges.push({ endTime: duration, startTime: normalizedStartTime });
1227
1300
  }
1228
- if (normalizedEndTime > 0) {
1229
- ranges.push({ endTime: normalizedEndTime, startTime: 0 });
1301
+ if (normalizedEndTime > firstTimestamp) {
1302
+ ranges.push({ endTime: normalizedEndTime, startTime: firstTimestamp });
1230
1303
  }
1231
1304
  return ranges;
1232
1305
  }
@@ -4033,9 +4106,16 @@ function computeMaskBounds(data, width, height) {
4033
4106
  };
4034
4107
  }
4035
4108
  function computeDetectionMaskRect(mask) {
4036
- const decoded = decodeCompressedRleMask(mask);
4037
- const bounds = computeMaskBounds(decoded.data, decoded.width, decoded.height);
4038
- return bounds ?? undefined;
4109
+ const { bounds } = readCompressedRleMask(mask);
4110
+ if (!bounds) {
4111
+ return undefined;
4112
+ }
4113
+ return {
4114
+ height: bounds.height,
4115
+ width: bounds.width,
4116
+ x: bounds.left + bounds.width / 2,
4117
+ y: bounds.top + bounds.height / 2,
4118
+ };
4039
4119
  }
4040
4120
  function detectMaskBorders(data, width, height) {
4041
4121
  assertMaskDimensions(data, width, height);
@@ -4097,13 +4177,8 @@ function extractMaskRectRuns(data, width, height) {
4097
4177
  * the pass are that box.
4098
4178
  */
4099
4179
  function extractDetectionMaskRectRuns(mask) {
4100
- if (mask.encoding !== DetectionMaskEncoding.CompressedRle) {
4101
- throw new Error(`Unsupported detection mask encoding: ${mask.encoding}`);
4102
- }
4103
4180
  const { height, width } = mask;
4104
- assertMaskSize(width, height);
4105
- const counts = decodeCompressedRleCounts(mask.counts);
4106
- const bounds = computeCompressedRleBounds(counts, width, height);
4181
+ const { bounds, counts } = readCompressedRleMask(mask);
4107
4182
  if (!bounds) {
4108
4183
  return undefined;
4109
4184
  }
@@ -4135,6 +4210,17 @@ function extractDetectionMaskRectRuns(mask) {
4135
4210
  const rects = mergeRowSpansIntoRects(boundsBuffer, boundsWidth, boundsHeight, left, top);
4136
4211
  return rects.length > 0 ? rects : undefined;
4137
4212
  }
4213
+ function readCompressedRleMask(mask) {
4214
+ if (mask.encoding !== DetectionMaskEncoding.CompressedRle) {
4215
+ throw new Error(`Unsupported detection mask encoding: ${mask.encoding}`);
4216
+ }
4217
+ assertMaskSize(mask.width, mask.height);
4218
+ const counts = decodeCompressedRleCounts(mask.counts);
4219
+ return {
4220
+ bounds: computeCompressedRleBounds(counts, mask.width, mask.height),
4221
+ counts,
4222
+ };
4223
+ }
4138
4224
  /** Counts alternate background, foreground, starting on background. */
4139
4225
  function isForegroundRun(index) {
4140
4226
  return index % 2 === 1;
@@ -7433,7 +7519,6 @@ function createIdMaskFrame(instructions, options = {}) {
7433
7519
  const height = width === maskWidth
7434
7520
  ? maskHeight
7435
7521
  : Math.max(1, Math.round((width * maskHeight) / maskWidth));
7436
- const strokeScale = width / maskWidth;
7437
7522
  const scaledAxes = width === maskWidth
7438
7523
  ? undefined
7439
7524
  : createScaledMaskAxes({ height, maskHeight, maskWidth, width });
@@ -7444,18 +7529,17 @@ function createIdMaskFrame(instructions, options = {}) {
7444
7529
  let hasStroke = false;
7445
7530
  let maxStrokeWidth = 0;
7446
7531
  for (const instruction of instructions) {
7447
- const detectionMaskId = instruction.detectionIndex + 1;
7448
- if (detectionMaskId <= 0 ||
7449
- detectionMaskId >= MAX_ID_MASK_PALETTE_ENTRIES) {
7532
+ const detectionMaskId = resolveIdMaskPaletteId(instruction.detectionIndex);
7533
+ if (detectionMaskId === undefined) {
7450
7534
  return undefined;
7451
7535
  }
7452
- writePaletteEntry(fillPalette, detectionMaskId, instruction.color, instruction.alpha);
7536
+ writeIdMaskPaletteEntry(fillPalette, detectionMaskId, instruction.color, instruction.alpha);
7453
7537
  if (instruction.stroke && instruction.stroke.width > 0) {
7454
- const strokeWidth = Math.min(resolveStrokeTexels(instruction.stroke.width, strokeScale), MAX_ID_MASK_STROKE_WIDTH);
7538
+ const strokeWidth = resolveIdMaskStrokeTexels(instruction.stroke.width, maskWidth, width);
7455
7539
  hasStroke = true;
7456
7540
  strokeWidths[detectionMaskId] = strokeWidth;
7457
7541
  maxStrokeWidth = Math.max(maxStrokeWidth, strokeWidth);
7458
- writePaletteEntry(strokePalette, detectionMaskId, instruction.stroke.color, instruction.stroke.alpha);
7542
+ writeIdMaskPaletteEntry(strokePalette, detectionMaskId, instruction.stroke.color, instruction.stroke.alpha);
7459
7543
  }
7460
7544
  if (scaledAxes) {
7461
7545
  writeScaledMaskRuns(data, scaledAxes, instruction.mask, detectionMaskId);
@@ -7470,6 +7554,7 @@ function createIdMaskFrame(instructions, options = {}) {
7470
7554
  hasStroke,
7471
7555
  height,
7472
7556
  maxStrokeWidth,
7557
+ sourceWidth: maskWidth,
7473
7558
  strokePalette,
7474
7559
  strokeWidths,
7475
7560
  width,
@@ -7552,10 +7637,14 @@ function resolveRasterWidth(maskWidth, maxWidth) {
7552
7637
  * A stroke is measured in texels of the raster it is drawn on, so a coarser
7553
7638
  * raster measures it in coarser texels. A stroke of a texel or more keeps at
7554
7639
  * least one, the thinnest line the shader can draw; a narrower one keeps its
7555
- * own width, which the shader draws as an inner boundary at any scale.
7640
+ * own width, which the shader draws as an inner boundary at any scale. The
7641
+ * ceiling is the widest neighbourhood the shaders scan, so a wider stroke would
7642
+ * be drawn at the ceiling anyway and every layer drawing the same annotation
7643
+ * has to arrive at the same width.
7556
7644
  */
7557
- function resolveStrokeTexels(strokeWidth, scale) {
7558
- return Math.max(strokeWidth * scale, Math.min(strokeWidth, 1));
7645
+ function resolveIdMaskStrokeTexels(strokeWidth, maskWidth, rasterWidth) {
7646
+ const scale = maskWidth > 0 ? rasterWidth / maskWidth : 1;
7647
+ return Math.min(Math.max(strokeWidth * scale, Math.min(strokeWidth, 1)), MAX_ID_MASK_STROKE_WIDTH);
7559
7648
  }
7560
7649
  function createScaledMaskAxes(frame) {
7561
7650
  return {
@@ -7572,8 +7661,19 @@ function createMaskAxisMap(sourceLength, targetLength, stride) {
7572
7661
  }
7573
7662
  return map;
7574
7663
  }
7575
- function writePaletteEntry(palette, id, color, alpha) {
7576
- const offset = id * 4;
7664
+ /**
7665
+ * The palette slot a detection index names, or undefined when the palette has
7666
+ * no slot for it. Slot zero is the background, so the ids start at one and the
7667
+ * last detection the palette can name sits one index below the last slot.
7668
+ */
7669
+ function resolveIdMaskPaletteId(detectionIndex) {
7670
+ const detectionMaskId = detectionIndex + 1;
7671
+ return detectionMaskId > 0 && detectionMaskId < MAX_ID_MASK_PALETTE_ENTRIES
7672
+ ? detectionMaskId
7673
+ : undefined;
7674
+ }
7675
+ function writeIdMaskPaletteEntry(palette, detectionMaskId, color, alpha) {
7676
+ const offset = detectionMaskId * 4;
7577
7677
  palette[offset] = ((color >> 16) & 0xff) / 255;
7578
7678
  palette[offset + 1] = ((color >> 8) & 0xff) / 255;
7579
7679
  palette[offset + 2] = (color & 0xff) / 255;
@@ -7811,7 +7911,7 @@ var MediaRendererPlaybackState;
7811
7911
  */
7812
7912
  var MediaErrorKind;
7813
7913
  (function (MediaErrorKind) {
7814
- /** The media could not be opened or read at all. */
7914
+ /** The media could not be opened or read, or was refused before any read. */
7815
7915
  MediaErrorKind["Unreadable"] = "unreadable";
7816
7916
  /** The container or codec is not supported by this platform. */
7817
7917
  MediaErrorKind["UnsupportedFormat"] = "unsupportedFormat";
@@ -7845,8 +7945,8 @@ var MediaSourceStatus;
7845
7945
  * A source the renderer pulls samples from can be held between any two frames,
7846
7946
  * because the renderer decides when each one is drawn. A source that presents
7847
7947
  * its own frames owns the playhead, so holding it means stopping the producer
7848
- * and starting it again, which the detection gate does and the
7849
- * render-preparation gate does not.
7948
+ * and starting it again, and a gate that stops one has to bound its own wait
7949
+ * or a producer nothing answers for never runs again.
7850
7950
  */
7851
7951
  var PlaybackGateReach;
7852
7952
  (function (PlaybackGateReach) {
@@ -7857,8 +7957,6 @@ var PlaybackGateReach;
7857
7957
  * missing, until they arrive or the gate's own wait bound gives up on them.
7858
7958
  */
7859
7959
  PlaybackGateReach["EveryFrame"] = "everyFrame";
7860
- /** Playback waits to begin; frames after that are not held. */
7861
- PlaybackGateReach["StartOfPlayback"] = "startOfPlayback";
7862
7960
  })(PlaybackGateReach || (PlaybackGateReach = {}));
7863
7961
 
7864
7962
  /**
@@ -7912,7 +8010,23 @@ var MediaSessionActivityKind;
7912
8010
  MediaSessionActivityKind["Error"] = "error";
7913
8011
  MediaSessionActivityKind["MediaNormalizing"] = "mediaNormalizing";
7914
8012
  MediaSessionActivityKind["MediaOpening"] = "mediaOpening";
8013
+ /**
8014
+ * The picture is waiting on media the source has not handed over yet, which
8015
+ * is the bytes and their decode rather than anything downstream of them.
8016
+ * `PlaybackBuffering` is what a transport reports once it has already
8017
+ * stopped; this is reported from the read itself, including the reads a seek
8018
+ * makes while the transport still reads as paused.
8019
+ */
8020
+ MediaSessionActivityKind["MediaSourceReading"] = "mediaSourceReading";
7915
8021
  MediaSessionActivityKind["PlaybackBuffering"] = "playbackBuffering";
8022
+ /**
8023
+ * The render-preparation gate held the picture for artifacts that never
8024
+ * arrived and let it go. Nothing is blocked: the frames reaching the screen
8025
+ * are the ones whose artifacts were given up on. What is waited on is
8026
+ * preparation finishing another frame, which is what lets the gate hold the
8027
+ * picture again; `RenderPreparing` covers the holds that are running.
8028
+ */
8029
+ MediaSessionActivityKind["RenderPreparationAbandoned"] = "renderPreparationAbandoned";
7916
8030
  MediaSessionActivityKind["RenderPreparing"] = "renderPreparing";
7917
8031
  })(MediaSessionActivityKind || (MediaSessionActivityKind = {}));
7918
8032
  /**
@@ -7925,5 +8039,5 @@ var MediaSessionActivityStatus;
7925
8039
  MediaSessionActivityStatus["Waiting"] = "waiting";
7926
8040
  })(MediaSessionActivityStatus || (MediaSessionActivityStatus = {}));
7927
8041
 
7928
- export { AnnotationFrameMutationKind, AnnotationGeometryKind, AnnotationGestureStateKind, AnnotationHandleKind, BaseBoxCornerStyle, BaseBoxStyle, BaseFocusStyle, BaseInteractionStyle, BaseKeypointStyle, BaseLabelStyle, BaseMarkerStyle, BaseMaskStyle, BasePolygonStyle, BasePolylineStyle, BoxShape, StrokeAlignment as BoxStrokeAlignment, DEFAULT_DETECTION_CLASS_STYLES, DEFAULT_DETECTION_COLOR_SEQUENCE, DetectionBufferStatus, DetectionFrameRetentionMode, DetectionFrameSelectionMode, DetectionInteractionState, DetectionMaskEncoding, DetectionMaskPayloadFormat, DetectionPickTarget, FocusTargetMode, KeypointMarkerShape, KeypointVisibility, LabelPlacement, LabelVisibilityMode, MAX_ID_MASK_PALETTE_ENTRIES, MAX_ID_MASK_STROKE_WIDTH, MarkerShape, MarkerSizeSpace, MaskRenderMode, MediaErrorKind, MediaInteractionMode, MediaRendererFit, MediaRendererPlaybackState, MediaSessionActivityKind, MediaSessionActivityStatus, MediaSessionMode, MediaSessionStatus, MediaSourceStatus, PlaybackGateReach, RegionRendererComposeMode, RegionRendererCoverageKind, RegionRendererMediaEffectKind, RegionRendererRegionKind, RegionRendererSizeSpace, RegionRendererSourceKind, SUPERVISION_ROBOFLOW_COLOR, ShapeInstructionKind, StrokeAlignment, TrackingGeometry, annotationRendererKinds, annotationRenderers, applyAnnotationHandleDrag, canReuseMaskStyleArtifacts, centerRectToTopLeftRect, computeDetectionMaskRect, computeMaskBounds, containsPoint, convertDetectionBoxToMask, convertDetectionBoxToPolygon, convertDetectionMaskToBox, convertDetectionMaskToPolygon, convertDetectionPolygonToBox, convertDetectionPolygonToMask, copySortedDetectionFrames, createAnnotationEditingEngine, createArrayDetectionFrameSource, createBufferedDetectionTimeline, createByteTrackTracker, createCBIoUTracker, createColdDetectionFrameSource, createCompositeDetectionFrameSource, createDefaultAnnotationPresentation, createDetectionPickKey, createEditableAnnotationFrameSession, createIdMaskFrame, createIdleDetectionBufferState, createMemoryColdDetectionFrameStore, createOCSortTracker, createProjectedDetectionFrameSource, createSortTracker, createSourceAwarePresentation, createViewportController, createWritableDetectionFrameSource, decodeCompressedRleCounts, decodeCompressedRleMask, decodeDetectionMaskPayload, deleteAnnotationVertex, detectMaskBorders, detectionFrameOverlapsRange, detectionPostProcessors, distanceToSegment, encodeBinaryMask, encodeBinaryMaskWithBounds, encodeCompressedRleCounts, encodeDetectionMaskPayload, extractDetectionMaskRectRuns, extractMaskContour, extractMaskRectRuns, filterDetectionFramesForRange, findClosestAnnotationSegment, followDetectionPickAcrossFrames, getAnnotationHandles, getBufferedDetectionTimelineFrameSnapshot, getDetectionRect, getPointsRect, haveSameDetectionPickIdentities, includeDefined, isDeflatedBase64DetectionMaskPayload, lightenColor, mediaToScreen, mergeDetectionMasks, mergeDetectionPolygonsByClass, normalizeDetectionClassName, offsetDetection, pickAnnotationHandle, pickDetectionAtPoint, pickDetectionByMaskId, pointInPolygon, polygonArea, polygonToRect, projectDetectionFrame, projectDetectionFrameForTracking, projectDetectionFrames, rasterizePolygonToMask, rasterizeRectToMask, rebaseDetectionPickToFrame, rectArea, rectToPolygon, resolveAnnotationRendererPresentation, resolveAnnotationRendererStyleFields, resolveAnnotationStyleState, resolveContrastTextColor, resolveDetectionClassColorStyle, resolveEllipseSegmentCount, resolveMarkerGeometry, resolveMaskStyleOpacity, resolveStyleValue, sampleEllipseArc, screenToMedia, selectDetectionFrame, topLeftRectToCenterRect, validateDetectionFrames };
8042
+ export { AnnotationFrameMutationKind, AnnotationGeometryKind, AnnotationGestureStateKind, AnnotationHandleKind, BaseBoxCornerStyle, BaseBoxStyle, BaseFocusStyle, BaseInteractionStyle, BaseKeypointStyle, BaseLabelStyle, BaseMarkerStyle, BaseMaskStyle, BasePolygonStyle, BasePolylineStyle, BoxShape, StrokeAlignment as BoxStrokeAlignment, DEFAULT_DETECTION_CLASS_STYLES, DEFAULT_DETECTION_COLOR_SEQUENCE, DetectionBufferStatus, DetectionFrameRetentionMode, DetectionFrameSelectionMode, DetectionInteractionState, DetectionMaskEncoding, DetectionMaskPayloadFormat, DetectionPickTarget, FocusTargetMode, KeypointMarkerShape, KeypointVisibility, LabelPlacement, LabelVisibilityMode, MAX_ID_MASK_PALETTE_ENTRIES, MAX_ID_MASK_STROKE_WIDTH, MarkerShape, MarkerSizeSpace, MaskRenderMode, MediaErrorKind, MediaInteractionMode, MediaRendererFit, MediaRendererPlaybackState, MediaSessionActivityKind, MediaSessionActivityStatus, MediaSessionMode, MediaSessionStatus, MediaSourceStatus, PlaybackGateReach, RegionRendererComposeMode, RegionRendererCoverageKind, RegionRendererMediaEffectKind, RegionRendererRegionKind, RegionRendererSizeSpace, RegionRendererSourceKind, SUPERVISION_ROBOFLOW_COLOR, ShapeInstructionKind, StrokeAlignment, TrackingGeometry, annotationRendererKinds, annotationRenderers, applyAnnotationHandleDrag, canReuseMaskStyleArtifacts, centerRectToTopLeftRect, computeDetectionMaskRect, computeMaskBounds, containsPoint, convertDetectionBoxToMask, convertDetectionBoxToPolygon, convertDetectionMaskToBox, convertDetectionMaskToPolygon, convertDetectionPolygonToBox, convertDetectionPolygonToMask, copySortedDetectionFrames, createAnnotationEditingEngine, createArrayDetectionFrameSource, createBufferedDetectionTimeline, createByteTrackTracker, createCBIoUTracker, createColdDetectionFrameSource, createCompositeDetectionFrameSource, createDefaultAnnotationPresentation, createDetectionPickKey, createEditableAnnotationFrameSession, createIdMaskFrame, createIdleDetectionBufferState, createMemoryColdDetectionFrameStore, createOCSortTracker, createProjectedDetectionFrameSource, createSortTracker, createSourceAwarePresentation, createViewportController, createWritableDetectionFrameSource, decodeCompressedRleCounts, decodeCompressedRleMask, decodeDetectionMaskPayload, deleteAnnotationVertex, detectMaskBorders, detectionFrameOverlapsRange, detectionPostProcessors, distanceToSegment, encodeBinaryMask, encodeBinaryMaskWithBounds, encodeCompressedRleCounts, encodeDetectionMaskPayload, extractDetectionMaskRectRuns, extractMaskContour, extractMaskRectRuns, filterDetectionFramesForRange, findClosestAnnotationSegment, followDetectionPickAcrossFrames, getAnnotationHandles, getBufferedDetectionTimelineFrameSnapshot, getDetectionRect, getPointsRect, haveSameDetectionPickIdentities, includeDefined, isDeflatedBase64DetectionMaskPayload, lightenColor, mediaToScreen, mergeDetectionMasks, mergeDetectionPolygonsByClass, normalizeDetectionClassName, offsetDetection, pickAnnotationHandle, pickDetectionAtPoint, pickDetectionByMaskId, pointInPolygon, polygonArea, polygonToRect, projectDetectionFrame, projectDetectionFrameForTracking, projectDetectionFrames, rasterizePolygonToMask, rasterizeRectToMask, rebaseDetectionPickToFrame, rectArea, rectToPolygon, resolveAnnotationRendererPresentation, resolveAnnotationRendererStyleFields, resolveAnnotationStyleState, resolveContrastTextColor, resolveDetectionClassColorStyle, resolveEllipseSegmentCount, resolveIdMaskPaletteId, resolveIdMaskStrokeTexels, resolveMarkerGeometry, resolveMaskStyleOpacity, resolveStyleValue, sampleEllipseArc, screenToMedia, selectDetectionFrame, topLeftRectToCenterRect, validateDetectionFrames, writeIdMaskPaletteEntry };
7929
8043
  //# sourceMappingURL=index.js.map