supervision 0.2.0-next.0 → 0.2.0-next.1
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.
- package/dist/constants/media-renderer.d.ts +3 -0
- package/dist/constants/media-renderer.d.ts.map +1 -1
- package/dist/index.d.ts +2 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1246 -1300
- package/dist/index.js.map +1 -1
- package/dist/mask-preparation.worker.js +109 -31
- package/dist/mask-preparation.worker.js.map +1 -1
- package/dist/media/media-source-state.d.ts.map +1 -1
- package/dist/media/video-engine-media-source.d.ts +17 -7
- package/dist/media/video-engine-media-source.d.ts.map +1 -1
- package/dist/media/video-engine-media-source.js +3 -0
- package/dist/media/video-engine-media-source.js.map +1 -0
- package/dist/playback/media-playback-controller.d.ts +7 -1
- package/dist/playback/media-playback-controller.d.ts.map +1 -1
- package/dist/render-preparation/mask-frame-artifact.d.ts +2 -0
- package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
- package/dist/render-preparation/mask-frame-compositor.d.ts +7 -0
- package/dist/render-preparation/mask-frame-compositor.d.ts.map +1 -1
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts +1 -0
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
- package/dist/render-preparation/prepared-render-window.d.ts +21 -2
- package/dist/render-preparation/prepared-render-window.d.ts.map +1 -1
- package/dist/renderers/injected-pixi.d.ts +38 -0
- package/dist/renderers/injected-pixi.d.ts.map +1 -0
- package/dist/renderers/media-renderer-core.d.ts +9 -0
- package/dist/renderers/media-renderer-core.d.ts.map +1 -1
- package/dist/renderers/media-renderer-scene.d.ts +16 -5
- package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
- package/dist/renderers/media-renderer-state.d.ts +9 -0
- package/dist/renderers/media-renderer-state.d.ts.map +1 -1
- package/dist/renderers/media-renderer-transport.d.ts +16 -3
- package/dist/renderers/media-renderer-transport.d.ts.map +1 -1
- package/dist/renderers/pixi-focus-layer.d.ts +1 -0
- package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-frame-present.d.ts +1 -1
- package/dist/renderers/pixi-frame-present.d.ts.map +1 -1
- package/dist/renderers/pixi-id-mask-shader.d.ts +4 -33
- package/dist/renderers/pixi-id-mask-shader.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts +0 -1
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-halo.d.ts +4 -33
- package/dist/renderers/pixi-mask-halo.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-layer.d.ts +28 -29
- package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
- package/dist/renderers/pixi-polygon-layer.d.ts +2 -0
- package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-region-coverage-mask.d.ts +4 -33
- package/dist/renderers/pixi-region-coverage-mask.d.ts.map +1 -1
- package/dist/renderers/pixi-region-layer.d.ts +6 -31
- package/dist/renderers/pixi-region-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-shader-lifecycle.d.ts +14 -0
- package/dist/renderers/pixi-shader-lifecycle.d.ts.map +1 -0
- package/dist/renderers/presented-frame-channel.d.ts +32 -1
- package/dist/renderers/presented-frame-channel.d.ts.map +1 -1
- package/dist/sessions/media-session-defaults.d.ts.map +1 -1
- package/dist/sessions/media-session-state.d.ts.map +1 -1
- package/dist/tracking.worker.js +19 -5
- package/dist/tracking.worker.js.map +1 -1
- package/dist/types/media-session.d.ts +20 -27
- package/dist/types/media-session.d.ts.map +1 -1
- package/dist/types/render-preparation.d.ts +70 -23
- package/dist/types/render-preparation.d.ts.map +1 -1
- package/dist/video-engine-media-source-CUXnOJOV.js +450 -0
- package/dist/video-engine-media-source-CUXnOJOV.js.map +1 -0
- package/dist/web-video-engine/analysis-session.d.ts +0 -1
- package/dist/web-video-engine/analysis.d.ts +0 -1
- package/dist/web-video-engine/analysis.js +195 -23
- package/dist/web-video-engine/cache-budget.d.ts +0 -1
- package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts +0 -1
- package/dist/web-video-engine/clock.d.ts +0 -1
- package/dist/web-video-engine/constants.d.ts +9 -1
- package/dist/web-video-engine/create-scrub-cursor.d.ts +6 -3
- package/dist/web-video-engine/decode-resolution.d.ts +0 -1
- package/dist/web-video-engine/decode-scheduler.d.ts +18 -3
- package/dist/web-video-engine/decode-session.d.ts +8 -1
- package/dist/web-video-engine/decode-source.d.ts +9 -1
- package/dist/web-video-engine/diagnostics-store.d.ts +0 -1
- package/dist/web-video-engine/diagnostics.d.ts +19 -19
- package/dist/web-video-engine/embedded-engine-worker.d.ts +0 -1
- package/dist/web-video-engine/engine-core.d.ts +22 -11
- package/dist/web-video-engine/engine.d.ts +3 -4
- package/dist/web-video-engine/engine.js +76 -37
- package/dist/web-video-engine/engine.worker.d.ts +0 -1
- package/dist/web-video-engine/engine.worker.js +5501 -3197
- package/dist/web-video-engine/frame-cache.d.ts +119 -12
- package/dist/web-video-engine/frame-extractor.d.ts +0 -1
- package/dist/web-video-engine/{frame-timeline-GINI8Gum.js → frame-timeline-DreEwsRY.js} +83 -27
- package/dist/web-video-engine/frame-timeline.d.ts +10 -1
- package/dist/web-video-engine/frame-walker.d.ts +0 -1
- package/dist/web-video-engine/index.d.ts +12 -2
- package/dist/web-video-engine/index.d.ts.map +1 -1
- package/dist/web-video-engine/index.js +2 -2
- package/dist/web-video-engine/key-packet.d.ts +0 -1
- package/dist/web-video-engine/keyframe-index.d.ts +0 -1
- package/dist/web-video-engine/mirror-store.d.ts +0 -1
- package/dist/web-video-engine/renderer.d.ts +0 -1
- package/dist/web-video-engine/rotation.d.ts +0 -1
- package/dist/web-video-engine/scrub-controller.d.ts +0 -1
- package/dist/web-video-engine/scrub-cursor.d.ts +12 -7
- package/dist/web-video-engine/scrub-trajectory.d.ts +0 -1
- package/dist/web-video-engine/source-residency.d.ts +35 -1
- package/dist/web-video-engine/trace-recorder.d.ts +0 -1
- package/dist/web-video-engine/types.d.ts +18 -22
- package/dist/web-video-engine/video-engine.d.ts +27 -16
- package/dist/web-video-engine/webgpu-renderer.d.ts +0 -1
- package/dist/web-video-engine/worker-bridge.d.ts +0 -1
- package/dist/web-video-engine/worker-dispatch.d.ts +0 -1
- package/dist/web-video-engine/worker-protocol.d.ts +29 -14
- package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.d.ts +2 -2
- package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.js +107 -29
- package/node_modules/supervision-js-core/dist/index.js.map +1 -1
- package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts +12 -0
- package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +28 -26
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts +16 -0
- package/node_modules/supervision-js-core/dist/types/session-lifecycle.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts +19 -0
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/media/media-condition-probe.d.ts +0 -51
- package/dist/media/media-condition-probe.d.ts.map +0 -1
- package/dist/media/media-conditions.d.ts +0 -28
- package/dist/media/media-conditions.d.ts.map +0 -1
- package/dist/types/media-conditions.d.ts +0 -149
- package/dist/types/media-conditions.d.ts.map +0 -1
- package/dist/web-video-engine/analysis-session.d.ts.map +0 -1
- package/dist/web-video-engine/analysis.d.ts.map +0 -1
- package/dist/web-video-engine/analysis.js.map +0 -1
- package/dist/web-video-engine/cache-budget.d.ts.map +0 -1
- package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts.map +0 -1
- package/dist/web-video-engine/clock.d.ts.map +0 -1
- package/dist/web-video-engine/constants.d.ts.map +0 -1
- package/dist/web-video-engine/create-scrub-cursor.d.ts.map +0 -1
- package/dist/web-video-engine/decode-resolution.d.ts.map +0 -1
- package/dist/web-video-engine/decode-scheduler.d.ts.map +0 -1
- package/dist/web-video-engine/decode-session.d.ts.map +0 -1
- package/dist/web-video-engine/decode-source.d.ts.map +0 -1
- package/dist/web-video-engine/diagnostics-store.d.ts.map +0 -1
- package/dist/web-video-engine/diagnostics.d.ts.map +0 -1
- package/dist/web-video-engine/embedded-engine-worker.d.ts.map +0 -1
- package/dist/web-video-engine/engine-core.d.ts.map +0 -1
- package/dist/web-video-engine/engine.d.ts.map +0 -1
- package/dist/web-video-engine/engine.js.map +0 -1
- package/dist/web-video-engine/engine.worker.d.ts.map +0 -1
- package/dist/web-video-engine/engine.worker.js.map +0 -1
- package/dist/web-video-engine/frame-cache.d.ts.map +0 -1
- package/dist/web-video-engine/frame-extractor.d.ts.map +0 -1
- package/dist/web-video-engine/frame-timeline-GINI8Gum.js.map +0 -1
- package/dist/web-video-engine/frame-timeline.d.ts.map +0 -1
- package/dist/web-video-engine/frame-walker.d.ts.map +0 -1
- package/dist/web-video-engine/key-packet.d.ts.map +0 -1
- package/dist/web-video-engine/keyframe-index.d.ts.map +0 -1
- package/dist/web-video-engine/mirror-store.d.ts.map +0 -1
- package/dist/web-video-engine/renderer.d.ts.map +0 -1
- package/dist/web-video-engine/rotation.d.ts.map +0 -1
- package/dist/web-video-engine/scrub-controller.d.ts.map +0 -1
- package/dist/web-video-engine/scrub-cursor.d.ts.map +0 -1
- package/dist/web-video-engine/scrub-trajectory.d.ts.map +0 -1
- package/dist/web-video-engine/source-residency.d.ts.map +0 -1
- package/dist/web-video-engine/trace-recorder.d.ts.map +0 -1
- package/dist/web-video-engine/types.d.ts.map +0 -1
- package/dist/web-video-engine/video-engine.d.ts.map +0 -1
- package/dist/web-video-engine/webgpu-renderer.d.ts.map +0 -1
- package/dist/web-video-engine/worker-bridge.d.ts.map +0 -1
- package/dist/web-video-engine/worker-dispatch.d.ts.map +0 -1
- 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 =
|
|
567
|
-
const DEFAULT_BUFFER_BEHIND_SECONDS =
|
|
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.
|
|
@@ -773,6 +773,32 @@ function createBufferedDetectionTimeline(options) {
|
|
|
773
773
|
comparableMediaTime >= state.bufferStartTime &&
|
|
774
774
|
comparableMediaTime <= state.bufferEndTime);
|
|
775
775
|
};
|
|
776
|
+
const inFlightCovers = (mediaTime) => {
|
|
777
|
+
if (!inFlight) {
|
|
778
|
+
return true;
|
|
779
|
+
}
|
|
780
|
+
const comparableMediaTime = getComparableMediaTime(mediaTime);
|
|
781
|
+
return (comparableMediaTime >= inFlight.startTime &&
|
|
782
|
+
comparableMediaTime <= inFlight.endTime);
|
|
783
|
+
};
|
|
784
|
+
const supersedeLoadOutside = (mediaTime) => {
|
|
785
|
+
if (!inFlight || inFlightCovers(mediaTime)) {
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
const keepsCurrentBuffer = isBuffered(mediaTime);
|
|
789
|
+
loadId += 1;
|
|
790
|
+
inFlight = undefined;
|
|
791
|
+
if (keepsCurrentBuffer) {
|
|
792
|
+
state = {
|
|
793
|
+
...state,
|
|
794
|
+
errorMessage: null,
|
|
795
|
+
requestedEndTime: state.bufferEndTime,
|
|
796
|
+
requestedStartTime: state.bufferStartTime,
|
|
797
|
+
status: DetectionBufferStatus.Ready,
|
|
798
|
+
};
|
|
799
|
+
notifyBufferChanged();
|
|
800
|
+
}
|
|
801
|
+
};
|
|
776
802
|
const isInsideBufferedRange = (mediaTime) => {
|
|
777
803
|
const comparableMediaTime = getComparableMediaTime(mediaTime);
|
|
778
804
|
return (bufferedVersionRange !== null &&
|
|
@@ -783,6 +809,11 @@ function createBufferedDetectionTimeline(options) {
|
|
|
783
809
|
};
|
|
784
810
|
const refreshBuffer = async (mediaTime, lead = "full") => {
|
|
785
811
|
if (isBuffered(mediaTime)) {
|
|
812
|
+
// A backwards navigation may land in the retained buffer while a rolling
|
|
813
|
+
// prefetch for the old playhead is about to replace it. The navigation
|
|
814
|
+
// is current truth; do not let that older load evict its detections after
|
|
815
|
+
// the frame has been accepted.
|
|
816
|
+
supersedeLoadOutside(mediaTime);
|
|
786
817
|
return;
|
|
787
818
|
}
|
|
788
819
|
if (isInsideBufferedRange(mediaTime) &&
|
|
@@ -842,6 +873,11 @@ function createBufferedDetectionTimeline(options) {
|
|
|
842
873
|
await refreshBuffer(mediaTime);
|
|
843
874
|
anchorWindowToPlayhead(mediaTime);
|
|
844
875
|
},
|
|
876
|
+
needsBufferPrepare(mediaTime) {
|
|
877
|
+
return (!destroyed &&
|
|
878
|
+
isLoadingEnabled() &&
|
|
879
|
+
(!isBuffered(mediaTime) || !inFlightCovers(mediaTime)));
|
|
880
|
+
},
|
|
845
881
|
needsPlaybackGateWait(mediaTime, prepareOptions) {
|
|
846
882
|
if (destroyed ||
|
|
847
883
|
!isLoadingEnabled() ||
|
|
@@ -859,6 +895,7 @@ function createBufferedDetectionTimeline(options) {
|
|
|
859
895
|
return;
|
|
860
896
|
}
|
|
861
897
|
anchorWindowToPlayhead(mediaTime);
|
|
898
|
+
supersedeLoadOutside(mediaTime);
|
|
862
899
|
if (!shouldPrefetch(mediaTime)) {
|
|
863
900
|
return;
|
|
864
901
|
}
|
|
@@ -4033,9 +4070,16 @@ function computeMaskBounds(data, width, height) {
|
|
|
4033
4070
|
};
|
|
4034
4071
|
}
|
|
4035
4072
|
function computeDetectionMaskRect(mask) {
|
|
4036
|
-
const
|
|
4037
|
-
|
|
4038
|
-
|
|
4073
|
+
const { bounds } = readCompressedRleMask(mask);
|
|
4074
|
+
if (!bounds) {
|
|
4075
|
+
return undefined;
|
|
4076
|
+
}
|
|
4077
|
+
return {
|
|
4078
|
+
height: bounds.height,
|
|
4079
|
+
width: bounds.width,
|
|
4080
|
+
x: bounds.left + bounds.width / 2,
|
|
4081
|
+
y: bounds.top + bounds.height / 2,
|
|
4082
|
+
};
|
|
4039
4083
|
}
|
|
4040
4084
|
function detectMaskBorders(data, width, height) {
|
|
4041
4085
|
assertMaskDimensions(data, width, height);
|
|
@@ -4097,13 +4141,8 @@ function extractMaskRectRuns(data, width, height) {
|
|
|
4097
4141
|
* the pass are that box.
|
|
4098
4142
|
*/
|
|
4099
4143
|
function extractDetectionMaskRectRuns(mask) {
|
|
4100
|
-
if (mask.encoding !== DetectionMaskEncoding.CompressedRle) {
|
|
4101
|
-
throw new Error(`Unsupported detection mask encoding: ${mask.encoding}`);
|
|
4102
|
-
}
|
|
4103
4144
|
const { height, width } = mask;
|
|
4104
|
-
|
|
4105
|
-
const counts = decodeCompressedRleCounts(mask.counts);
|
|
4106
|
-
const bounds = computeCompressedRleBounds(counts, width, height);
|
|
4145
|
+
const { bounds, counts } = readCompressedRleMask(mask);
|
|
4107
4146
|
if (!bounds) {
|
|
4108
4147
|
return undefined;
|
|
4109
4148
|
}
|
|
@@ -4135,6 +4174,17 @@ function extractDetectionMaskRectRuns(mask) {
|
|
|
4135
4174
|
const rects = mergeRowSpansIntoRects(boundsBuffer, boundsWidth, boundsHeight, left, top);
|
|
4136
4175
|
return rects.length > 0 ? rects : undefined;
|
|
4137
4176
|
}
|
|
4177
|
+
function readCompressedRleMask(mask) {
|
|
4178
|
+
if (mask.encoding !== DetectionMaskEncoding.CompressedRle) {
|
|
4179
|
+
throw new Error(`Unsupported detection mask encoding: ${mask.encoding}`);
|
|
4180
|
+
}
|
|
4181
|
+
assertMaskSize(mask.width, mask.height);
|
|
4182
|
+
const counts = decodeCompressedRleCounts(mask.counts);
|
|
4183
|
+
return {
|
|
4184
|
+
bounds: computeCompressedRleBounds(counts, mask.width, mask.height),
|
|
4185
|
+
counts,
|
|
4186
|
+
};
|
|
4187
|
+
}
|
|
4138
4188
|
/** Counts alternate background, foreground, starting on background. */
|
|
4139
4189
|
function isForegroundRun(index) {
|
|
4140
4190
|
return index % 2 === 1;
|
|
@@ -7433,7 +7483,6 @@ function createIdMaskFrame(instructions, options = {}) {
|
|
|
7433
7483
|
const height = width === maskWidth
|
|
7434
7484
|
? maskHeight
|
|
7435
7485
|
: Math.max(1, Math.round((width * maskHeight) / maskWidth));
|
|
7436
|
-
const strokeScale = width / maskWidth;
|
|
7437
7486
|
const scaledAxes = width === maskWidth
|
|
7438
7487
|
? undefined
|
|
7439
7488
|
: createScaledMaskAxes({ height, maskHeight, maskWidth, width });
|
|
@@ -7444,18 +7493,17 @@ function createIdMaskFrame(instructions, options = {}) {
|
|
|
7444
7493
|
let hasStroke = false;
|
|
7445
7494
|
let maxStrokeWidth = 0;
|
|
7446
7495
|
for (const instruction of instructions) {
|
|
7447
|
-
const detectionMaskId = instruction.detectionIndex
|
|
7448
|
-
if (detectionMaskId
|
|
7449
|
-
detectionMaskId >= MAX_ID_MASK_PALETTE_ENTRIES) {
|
|
7496
|
+
const detectionMaskId = resolveIdMaskPaletteId(instruction.detectionIndex);
|
|
7497
|
+
if (detectionMaskId === undefined) {
|
|
7450
7498
|
return undefined;
|
|
7451
7499
|
}
|
|
7452
|
-
|
|
7500
|
+
writeIdMaskPaletteEntry(fillPalette, detectionMaskId, instruction.color, instruction.alpha);
|
|
7453
7501
|
if (instruction.stroke && instruction.stroke.width > 0) {
|
|
7454
|
-
const strokeWidth =
|
|
7502
|
+
const strokeWidth = resolveIdMaskStrokeTexels(instruction.stroke.width, maskWidth, width);
|
|
7455
7503
|
hasStroke = true;
|
|
7456
7504
|
strokeWidths[detectionMaskId] = strokeWidth;
|
|
7457
7505
|
maxStrokeWidth = Math.max(maxStrokeWidth, strokeWidth);
|
|
7458
|
-
|
|
7506
|
+
writeIdMaskPaletteEntry(strokePalette, detectionMaskId, instruction.stroke.color, instruction.stroke.alpha);
|
|
7459
7507
|
}
|
|
7460
7508
|
if (scaledAxes) {
|
|
7461
7509
|
writeScaledMaskRuns(data, scaledAxes, instruction.mask, detectionMaskId);
|
|
@@ -7470,6 +7518,7 @@ function createIdMaskFrame(instructions, options = {}) {
|
|
|
7470
7518
|
hasStroke,
|
|
7471
7519
|
height,
|
|
7472
7520
|
maxStrokeWidth,
|
|
7521
|
+
sourceWidth: maskWidth,
|
|
7473
7522
|
strokePalette,
|
|
7474
7523
|
strokeWidths,
|
|
7475
7524
|
width,
|
|
@@ -7552,10 +7601,14 @@ function resolveRasterWidth(maskWidth, maxWidth) {
|
|
|
7552
7601
|
* A stroke is measured in texels of the raster it is drawn on, so a coarser
|
|
7553
7602
|
* raster measures it in coarser texels. A stroke of a texel or more keeps at
|
|
7554
7603
|
* 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.
|
|
7604
|
+
* own width, which the shader draws as an inner boundary at any scale. The
|
|
7605
|
+
* ceiling is the widest neighbourhood the shaders scan, so a wider stroke would
|
|
7606
|
+
* be drawn at the ceiling anyway and every layer drawing the same annotation
|
|
7607
|
+
* has to arrive at the same width.
|
|
7556
7608
|
*/
|
|
7557
|
-
function
|
|
7558
|
-
|
|
7609
|
+
function resolveIdMaskStrokeTexels(strokeWidth, maskWidth, rasterWidth) {
|
|
7610
|
+
const scale = maskWidth > 0 ? rasterWidth / maskWidth : 1;
|
|
7611
|
+
return Math.min(Math.max(strokeWidth * scale, Math.min(strokeWidth, 1)), MAX_ID_MASK_STROKE_WIDTH);
|
|
7559
7612
|
}
|
|
7560
7613
|
function createScaledMaskAxes(frame) {
|
|
7561
7614
|
return {
|
|
@@ -7572,8 +7625,19 @@ function createMaskAxisMap(sourceLength, targetLength, stride) {
|
|
|
7572
7625
|
}
|
|
7573
7626
|
return map;
|
|
7574
7627
|
}
|
|
7575
|
-
|
|
7576
|
-
|
|
7628
|
+
/**
|
|
7629
|
+
* The palette slot a detection index names, or undefined when the palette has
|
|
7630
|
+
* no slot for it. Slot zero is the background, so the ids start at one and the
|
|
7631
|
+
* last detection the palette can name sits one index below the last slot.
|
|
7632
|
+
*/
|
|
7633
|
+
function resolveIdMaskPaletteId(detectionIndex) {
|
|
7634
|
+
const detectionMaskId = detectionIndex + 1;
|
|
7635
|
+
return detectionMaskId > 0 && detectionMaskId < MAX_ID_MASK_PALETTE_ENTRIES
|
|
7636
|
+
? detectionMaskId
|
|
7637
|
+
: undefined;
|
|
7638
|
+
}
|
|
7639
|
+
function writeIdMaskPaletteEntry(palette, detectionMaskId, color, alpha) {
|
|
7640
|
+
const offset = detectionMaskId * 4;
|
|
7577
7641
|
palette[offset] = ((color >> 16) & 0xff) / 255;
|
|
7578
7642
|
palette[offset + 1] = ((color >> 8) & 0xff) / 255;
|
|
7579
7643
|
palette[offset + 2] = (color & 0xff) / 255;
|
|
@@ -7811,7 +7875,7 @@ var MediaRendererPlaybackState;
|
|
|
7811
7875
|
*/
|
|
7812
7876
|
var MediaErrorKind;
|
|
7813
7877
|
(function (MediaErrorKind) {
|
|
7814
|
-
/** The media could not be opened or read
|
|
7878
|
+
/** The media could not be opened or read, or was refused before any read. */
|
|
7815
7879
|
MediaErrorKind["Unreadable"] = "unreadable";
|
|
7816
7880
|
/** The container or codec is not supported by this platform. */
|
|
7817
7881
|
MediaErrorKind["UnsupportedFormat"] = "unsupportedFormat";
|
|
@@ -7845,8 +7909,8 @@ var MediaSourceStatus;
|
|
|
7845
7909
|
* A source the renderer pulls samples from can be held between any two frames,
|
|
7846
7910
|
* because the renderer decides when each one is drawn. A source that presents
|
|
7847
7911
|
* its own frames owns the playhead, so holding it means stopping the producer
|
|
7848
|
-
* and starting it again,
|
|
7849
|
-
*
|
|
7912
|
+
* and starting it again, and a gate that stops one has to bound its own wait
|
|
7913
|
+
* or a producer nothing answers for never runs again.
|
|
7850
7914
|
*/
|
|
7851
7915
|
var PlaybackGateReach;
|
|
7852
7916
|
(function (PlaybackGateReach) {
|
|
@@ -7857,8 +7921,6 @@ var PlaybackGateReach;
|
|
|
7857
7921
|
* missing, until they arrive or the gate's own wait bound gives up on them.
|
|
7858
7922
|
*/
|
|
7859
7923
|
PlaybackGateReach["EveryFrame"] = "everyFrame";
|
|
7860
|
-
/** Playback waits to begin; frames after that are not held. */
|
|
7861
|
-
PlaybackGateReach["StartOfPlayback"] = "startOfPlayback";
|
|
7862
7924
|
})(PlaybackGateReach || (PlaybackGateReach = {}));
|
|
7863
7925
|
|
|
7864
7926
|
/**
|
|
@@ -7912,7 +7974,23 @@ var MediaSessionActivityKind;
|
|
|
7912
7974
|
MediaSessionActivityKind["Error"] = "error";
|
|
7913
7975
|
MediaSessionActivityKind["MediaNormalizing"] = "mediaNormalizing";
|
|
7914
7976
|
MediaSessionActivityKind["MediaOpening"] = "mediaOpening";
|
|
7977
|
+
/**
|
|
7978
|
+
* The picture is waiting on media the source has not handed over yet, which
|
|
7979
|
+
* is the bytes and their decode rather than anything downstream of them.
|
|
7980
|
+
* `PlaybackBuffering` is what a transport reports once it has already
|
|
7981
|
+
* stopped; this is reported from the read itself, including the reads a seek
|
|
7982
|
+
* makes while the transport still reads as paused.
|
|
7983
|
+
*/
|
|
7984
|
+
MediaSessionActivityKind["MediaSourceReading"] = "mediaSourceReading";
|
|
7915
7985
|
MediaSessionActivityKind["PlaybackBuffering"] = "playbackBuffering";
|
|
7986
|
+
/**
|
|
7987
|
+
* The render-preparation gate held the picture for artifacts that never
|
|
7988
|
+
* arrived and let it go. Nothing is blocked: the frames reaching the screen
|
|
7989
|
+
* are the ones whose artifacts were given up on. What is waited on is
|
|
7990
|
+
* preparation finishing another frame, which is what lets the gate hold the
|
|
7991
|
+
* picture again; `RenderPreparing` covers the holds that are running.
|
|
7992
|
+
*/
|
|
7993
|
+
MediaSessionActivityKind["RenderPreparationAbandoned"] = "renderPreparationAbandoned";
|
|
7916
7994
|
MediaSessionActivityKind["RenderPreparing"] = "renderPreparing";
|
|
7917
7995
|
})(MediaSessionActivityKind || (MediaSessionActivityKind = {}));
|
|
7918
7996
|
/**
|
|
@@ -7925,5 +8003,5 @@ var MediaSessionActivityStatus;
|
|
|
7925
8003
|
MediaSessionActivityStatus["Waiting"] = "waiting";
|
|
7926
8004
|
})(MediaSessionActivityStatus || (MediaSessionActivityStatus = {}));
|
|
7927
8005
|
|
|
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 };
|
|
8006
|
+
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
8007
|
//# sourceMappingURL=index.js.map
|