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.
- package/dist/detections/chunked-detection-frame-source.d.ts.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8856 -4559
- package/dist/index.js.map +1 -1
- package/dist/mask-preparation.worker.js +310 -164
- package/dist/mask-preparation.worker.js.map +1 -1
- package/dist/media/display-pixel-ratio.d.ts +15 -0
- package/dist/media/display-pixel-ratio.d.ts.map +1 -0
- package/dist/media/engine-import-failure.d.ts +16 -0
- package/dist/media/engine-import-failure.d.ts.map +1 -0
- package/dist/media/media-condition-probe.d.ts +51 -0
- package/dist/media/media-condition-probe.d.ts.map +1 -0
- package/dist/media/media-conditions.d.ts +28 -0
- package/dist/media/media-conditions.d.ts.map +1 -0
- package/dist/media/media-errors.d.ts +6 -0
- package/dist/media/media-errors.d.ts.map +1 -1
- package/dist/media/media-normalization.d.ts.map +1 -1
- package/dist/media/media-probe.d.ts.map +1 -1
- package/dist/media/media-source.d.ts +17 -0
- package/dist/media/media-source.d.ts.map +1 -1
- package/dist/media/mediabunny-media-source.d.ts.map +1 -1
- package/dist/media/video-engine-media-source.d.ts +44 -0
- package/dist/media/video-engine-media-source.d.ts.map +1 -0
- package/dist/render-preparation/mask-frame-artifact.d.ts +46 -12
- package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
- package/dist/render-preparation/mask-frame-compositor.d.ts +5 -5
- package/dist/render-preparation/mask-frame-compositor.d.ts.map +1 -1
- package/dist/render-preparation/mask-frame-preparer.d.ts.map +1 -1
- package/dist/render-preparation/mask-preparation-worker-count.d.ts +4 -4
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts +12 -3
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
- package/dist/render-preparation/prepared-render-window.d.ts +23 -0
- package/dist/render-preparation/prepared-render-window.d.ts.map +1 -1
- package/dist/render-preparation/prepared-window-timeline.d.ts +2 -6
- package/dist/render-preparation/prepared-window-timeline.d.ts.map +1 -1
- package/dist/renderers/mask-palette.d.ts +14 -0
- package/dist/renderers/mask-palette.d.ts.map +1 -0
- package/dist/renderers/mask-vertex.d.ts +14 -0
- package/dist/renderers/mask-vertex.d.ts.map +1 -0
- package/dist/renderers/media-renderer-core.d.ts.map +1 -1
- package/dist/renderers/media-renderer-scene.d.ts +37 -0
- package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
- package/dist/renderers/media-renderer-state.d.ts +11 -1
- package/dist/renderers/media-renderer-state.d.ts.map +1 -1
- package/dist/renderers/media-renderer-transport.d.ts +59 -0
- package/dist/renderers/media-renderer-transport.d.ts.map +1 -0
- package/dist/renderers/pixi-box-layer.d.ts +5 -0
- package/dist/renderers/pixi-box-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-focus-layer.d.ts +18 -2
- package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-frame-present.d.ts +77 -0
- package/dist/renderers/pixi-frame-present.d.ts.map +1 -0
- package/dist/renderers/pixi-id-mask-shader.d.ts +12 -2
- package/dist/renderers/pixi-id-mask-shader.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts +13 -2
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-halo.d.ts +24 -0
- package/dist/renderers/pixi-mask-halo.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-layer.d.ts +71 -8
- package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-media-scene.d.ts +67 -0
- package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
- package/dist/renderers/pixi-polygon-layer.d.ts +7 -2
- package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-region-coverage-mask.d.ts +91 -0
- package/dist/renderers/pixi-region-coverage-mask.d.ts.map +1 -0
- package/dist/renderers/pixi-region-effect.d.ts +42 -0
- package/dist/renderers/pixi-region-effect.d.ts.map +1 -0
- package/dist/renderers/pixi-region-layer.d.ts +68 -2
- package/dist/renderers/pixi-region-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-vector-layer.d.ts.map +1 -1
- package/dist/renderers/prepared-annotation-window.d.ts +47 -0
- package/dist/renderers/prepared-annotation-window.d.ts.map +1 -0
- package/dist/renderers/presented-frame-channel.d.ts +107 -0
- package/dist/renderers/presented-frame-channel.d.ts.map +1 -0
- package/dist/renderers/scene-render-scheduler.d.ts +20 -0
- package/dist/renderers/scene-render-scheduler.d.ts.map +1 -0
- package/dist/sessions/media-session-defaults.d.ts +10 -6
- package/dist/sessions/media-session-defaults.d.ts.map +1 -1
- package/dist/sessions/media-session-media.d.ts.map +1 -1
- package/dist/sessions/media-session-state.d.ts.map +1 -1
- package/dist/sessions/media-session.d.ts.map +1 -1
- package/dist/tracking.worker.js +58 -3
- package/dist/tracking.worker.js.map +1 -1
- package/dist/types/media-conditions.d.ts +149 -0
- package/dist/types/media-conditions.d.ts.map +1 -0
- package/dist/types/media-normalization.d.ts +34 -0
- package/dist/types/media-normalization.d.ts.map +1 -1
- package/dist/types/media-renderer.d.ts +31 -1
- package/dist/types/media-renderer.d.ts.map +1 -1
- package/dist/types/media-session.d.ts +89 -8
- package/dist/types/media-session.d.ts.map +1 -1
- package/dist/types/render-preparation.d.ts +101 -4
- package/dist/types/render-preparation.d.ts.map +1 -1
- package/dist/web-video-engine/analysis-session.d.ts +76 -0
- package/dist/web-video-engine/analysis-session.d.ts.map +1 -0
- package/dist/web-video-engine/analysis.d.ts +7 -0
- package/dist/web-video-engine/analysis.d.ts.map +1 -0
- package/dist/web-video-engine/analysis.js +1678 -0
- package/dist/web-video-engine/analysis.js.map +1 -0
- package/dist/web-video-engine/cache-budget.d.ts +19 -0
- package/dist/web-video-engine/cache-budget.d.ts.map +1 -0
- package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts +90 -0
- package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts.map +1 -0
- package/dist/web-video-engine/clock.d.ts +83 -0
- package/dist/web-video-engine/clock.d.ts.map +1 -0
- package/dist/web-video-engine/constants.d.ts +253 -0
- package/dist/web-video-engine/constants.d.ts.map +1 -0
- package/dist/web-video-engine/create-scrub-cursor.d.ts +62 -0
- package/dist/web-video-engine/create-scrub-cursor.d.ts.map +1 -0
- package/dist/web-video-engine/decode-resolution.d.ts +115 -0
- package/dist/web-video-engine/decode-resolution.d.ts.map +1 -0
- package/dist/web-video-engine/decode-scheduler.d.ts +356 -0
- package/dist/web-video-engine/decode-scheduler.d.ts.map +1 -0
- package/dist/web-video-engine/decode-session.d.ts +276 -0
- package/dist/web-video-engine/decode-session.d.ts.map +1 -0
- package/dist/web-video-engine/decode-source.d.ts +250 -0
- package/dist/web-video-engine/decode-source.d.ts.map +1 -0
- package/dist/web-video-engine/diagnostics-store.d.ts +18 -0
- package/dist/web-video-engine/diagnostics-store.d.ts.map +1 -0
- package/dist/web-video-engine/diagnostics.d.ts +316 -0
- package/dist/web-video-engine/diagnostics.d.ts.map +1 -0
- package/dist/web-video-engine/embedded-engine-worker.d.ts +2 -0
- package/dist/web-video-engine/embedded-engine-worker.d.ts.map +1 -0
- package/dist/web-video-engine/engine-core.d.ts +258 -0
- package/dist/web-video-engine/engine-core.d.ts.map +1 -0
- package/dist/web-video-engine/engine.d.ts +26 -0
- package/dist/web-video-engine/engine.d.ts.map +1 -0
- package/dist/web-video-engine/engine.js +873 -0
- package/dist/web-video-engine/engine.js.map +1 -0
- package/dist/web-video-engine/engine.worker.d.ts +2 -0
- package/dist/web-video-engine/engine.worker.d.ts.map +1 -0
- package/dist/web-video-engine/engine.worker.js +31320 -0
- package/dist/web-video-engine/engine.worker.js.map +1 -0
- package/dist/web-video-engine/frame-cache.d.ts +129 -0
- package/dist/web-video-engine/frame-cache.d.ts.map +1 -0
- package/dist/web-video-engine/frame-extractor.d.ts +28 -0
- package/dist/web-video-engine/frame-extractor.d.ts.map +1 -0
- package/dist/web-video-engine/frame-timeline-GINI8Gum.js +560 -0
- package/dist/web-video-engine/frame-timeline-GINI8Gum.js.map +1 -0
- package/dist/web-video-engine/frame-timeline.d.ts +71 -0
- package/dist/web-video-engine/frame-timeline.d.ts.map +1 -0
- package/dist/web-video-engine/frame-walker.d.ts +74 -0
- package/dist/web-video-engine/frame-walker.d.ts.map +1 -0
- package/dist/web-video-engine/index.d.ts +3 -0
- package/dist/web-video-engine/index.d.ts.map +1 -0
- package/dist/web-video-engine/index.js +3 -0
- package/dist/web-video-engine/index.js.map +1 -0
- package/dist/web-video-engine/key-packet.d.ts +65 -0
- package/dist/web-video-engine/key-packet.d.ts.map +1 -0
- package/dist/web-video-engine/keyframe-index.d.ts +91 -0
- package/dist/web-video-engine/keyframe-index.d.ts.map +1 -0
- package/dist/web-video-engine/mirror-store.d.ts +56 -0
- package/dist/web-video-engine/mirror-store.d.ts.map +1 -0
- package/dist/web-video-engine/renderer.d.ts +94 -0
- package/dist/web-video-engine/renderer.d.ts.map +1 -0
- package/dist/web-video-engine/rotation.d.ts +35 -0
- package/dist/web-video-engine/rotation.d.ts.map +1 -0
- package/dist/web-video-engine/scrub-controller.d.ts +376 -0
- package/dist/web-video-engine/scrub-controller.d.ts.map +1 -0
- package/dist/web-video-engine/scrub-cursor.d.ts +342 -0
- package/dist/web-video-engine/scrub-cursor.d.ts.map +1 -0
- package/dist/web-video-engine/scrub-trajectory.d.ts +30 -0
- package/dist/web-video-engine/scrub-trajectory.d.ts.map +1 -0
- package/dist/web-video-engine/source-residency.d.ts +57 -0
- package/dist/web-video-engine/source-residency.d.ts.map +1 -0
- package/dist/web-video-engine/trace-recorder.d.ts +164 -0
- package/dist/web-video-engine/trace-recorder.d.ts.map +1 -0
- package/dist/web-video-engine/types.d.ts +204 -0
- package/dist/web-video-engine/types.d.ts.map +1 -0
- package/dist/web-video-engine/video-engine.d.ts +426 -0
- package/dist/web-video-engine/video-engine.d.ts.map +1 -0
- package/dist/web-video-engine/webgpu-renderer.d.ts +62 -0
- package/dist/web-video-engine/webgpu-renderer.d.ts.map +1 -0
- package/dist/web-video-engine/worker-bridge.d.ts +12 -0
- package/dist/web-video-engine/worker-bridge.d.ts.map +1 -0
- package/dist/web-video-engine/worker-dispatch.d.ts +17 -0
- package/dist/web-video-engine/worker-dispatch.d.ts.map +1 -0
- package/dist/web-video-engine/worker-protocol.d.ts +267 -0
- package/dist/web-video-engine/worker-protocol.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/detections/buffered-detection-timeline.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/detections/composite-detection-frame-source.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.d.ts +4 -3
- package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.js +1075 -266
- package/node_modules/supervision-js-core/dist/index.js.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts +4 -36
- package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts +5 -0
- package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts +92 -7
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/detection-timeline.d.ts +179 -17
- 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 +78 -2
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/polyline-style.d.ts +2 -0
- package/node_modules/supervision-js-core/dist/types/polyline-style.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-conversions.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts +5 -0
- package/node_modules/supervision-js-core/dist/utils/detection-frames.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts +9 -0
- package/node_modules/supervision-js-core/dist/utils/detection-masks.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/detection-ranges.d.ts +18 -0
- package/node_modules/supervision-js-core/dist/utils/detection-ranges.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts +15 -2
- package/node_modules/supervision-js-core/dist/utils/id-mask-frame.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/utils/wait-bound.d.ts +7 -0
- package/node_modules/supervision-js-core/dist/utils/wait-bound.d.ts.map +1 -0
- package/package.json +22 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-renderer-core.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-core.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-renderer-core.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-core.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAE1B,MAAM,uBAAuB,CAAC;AAc/B,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,0BAA0B;IACzC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC1E,WAAW,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC9E;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,oBAAoB,EAC7B,SAAS,EAAE,0BAA0B,GACpC,OAAO,CAAC,aAAa,CAAC,CAu2BxB"}
|
|
@@ -16,6 +16,8 @@ import type { Point, ViewportTransform } from "supervision-js-core";
|
|
|
16
16
|
import type { AnnotationEditingEngine, AnnotationOverlayStyle, PreviewOverlayData } from "supervision-js-core";
|
|
17
17
|
import type { RenderPreparationOptions, RenderPreparationPlaybackGateOptions } from "#types/render-preparation";
|
|
18
18
|
import type { MaskBrushPreviewOptions } from "#editing/mask-brush-editor";
|
|
19
|
+
import type { PresentedFrameSource } from "./presented-frame-channel";
|
|
20
|
+
import type { PreparedAnnotationWindowSnapshot } from "./prepared-annotation-window";
|
|
19
21
|
export interface MediaRendererSceneOptions {
|
|
20
22
|
readonly container: HTMLElement;
|
|
21
23
|
readonly backgroundColor: MediaRendererPresentation["backgroundColor"];
|
|
@@ -51,22 +53,57 @@ export interface MediaRendererSceneOptions {
|
|
|
51
53
|
readonly previewOverlay: (() => PreviewOverlayData | null) | undefined;
|
|
52
54
|
/** Propagates renderer-owned asynchronous visual changes into runtime state. */
|
|
53
55
|
readonly onPresentationUpdate?: (sample: PresentedMediaSample) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Present plane of a media source that decides for itself which frame is on
|
|
58
|
+
* screen. Given one, the scene presents what the producer announces instead
|
|
59
|
+
* of what the renderer pulls, and renders only when something changed.
|
|
60
|
+
*/
|
|
61
|
+
readonly presentedFrames?: PresentedFrameSource;
|
|
54
62
|
}
|
|
55
63
|
export interface PresentedMediaSample {
|
|
64
|
+
/**
|
|
65
|
+
* Which frame the scene has on screen, as its count of the frames it has
|
|
66
|
+
* presented. Two presentations of one media time carry different serials, and
|
|
67
|
+
* every redraw of the frame on screen carries that frame's own.
|
|
68
|
+
*/
|
|
69
|
+
readonly presentedFrameSerial: number;
|
|
56
70
|
readonly mediaTime: number;
|
|
57
71
|
readonly duration?: number;
|
|
58
72
|
readonly activeDetectionFrameTime: number | null;
|
|
59
73
|
readonly activeDetectionFrameIndex: number | null;
|
|
60
74
|
readonly activeDetectionCount: number;
|
|
75
|
+
/** Detection frame the mask raster on screen belongs to, null when no mask is
|
|
76
|
+
* up. Apart from `activeDetectionFrameTime` it names a desync in seconds. */
|
|
77
|
+
readonly drawnMaskFrameTime: number | null;
|
|
78
|
+
/** The raster on screen and the detections over it name different frames,
|
|
79
|
+
* which is the mask layer holding the neighbouring frame's raster over a
|
|
80
|
+
* frame whose own is still being prepared. */
|
|
81
|
+
readonly maskHeldStale: boolean;
|
|
61
82
|
readonly detectionBuffer: DetectionBufferState;
|
|
62
83
|
readonly renderTimings?: MediaFrameRenderTimings;
|
|
63
84
|
}
|
|
64
85
|
export interface MediaRendererScene {
|
|
65
86
|
readonly rendererBackend: string;
|
|
87
|
+
/**
|
|
88
|
+
* Explicit renders issued so far, which a push-presented scene only issues on
|
|
89
|
+
* change. A scene that free-runs on the ticker has no such count.
|
|
90
|
+
*/
|
|
91
|
+
getRenderCount?(): number | null;
|
|
92
|
+
/**
|
|
93
|
+
* Which frames around the playhead have every enabled layer's data cooked. A
|
|
94
|
+
* scene that free-runs on the ticker gates nothing and reports none.
|
|
95
|
+
*/
|
|
96
|
+
getPreparedAnnotationWindow?(): PreparedAnnotationWindowSnapshot | null;
|
|
66
97
|
initializeMedia(dimensions: {
|
|
67
98
|
width: number;
|
|
68
99
|
height: number;
|
|
69
100
|
}): void;
|
|
101
|
+
/**
|
|
102
|
+
* Whether the playhead is moving. Cooking far ahead of a resting playhead is
|
|
103
|
+
* speculation, so the scene narrows what it prepares until the playhead moves
|
|
104
|
+
* again.
|
|
105
|
+
*/
|
|
106
|
+
setPlaybackActive?(active: boolean): void;
|
|
70
107
|
setTimelineContext?(context: MediaRendererSceneTimelineContext): void;
|
|
71
108
|
presentSample(sample: DecodedVideoSample): PresentedMediaSample;
|
|
72
109
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-renderer-scene.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EACV,wBAAwB,EACxB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,wBAAwB,EACxB,oCAAoC,EACrC,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"media-renderer-scene.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EACV,yBAAyB,EACzB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,EACxB,+BAA+B,EAC/B,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EACV,wBAAwB,EACxB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,uBAAuB,EAA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B"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { PlaybackGateReach } from "supervision-js-core";
|
|
1
2
|
import type { DecodedMediaSourceMetadata } from "#media/media-source";
|
|
2
3
|
import type { DetectionBufferState } from "supervision-js-core";
|
|
3
4
|
import { type MediaFrameDiagnostics, type MediaRendererFit, type MediaRendererState, type MediaSourceState } from "#types/media-renderer";
|
|
4
5
|
import type { PresentedMediaSample } from "./media-renderer-scene";
|
|
5
6
|
interface MediaRendererRuntimeStateOptions {
|
|
6
7
|
readonly fit: MediaRendererFit;
|
|
8
|
+
readonly getPlaybackGateReach: () => PlaybackGateReach;
|
|
7
9
|
readonly playbackRate: number;
|
|
8
10
|
readonly getDetectionBufferState: () => DetectionBufferState;
|
|
9
11
|
readonly onFrame?: (diagnostics: MediaFrameDiagnostics) => void;
|
|
@@ -25,14 +27,22 @@ export interface MediaRendererRuntimeState {
|
|
|
25
27
|
width: number;
|
|
26
28
|
};
|
|
27
29
|
setSourceReady(metadata: DecodedMediaSourceMetadata): void;
|
|
28
|
-
|
|
30
|
+
/** A playhead that moved. Emits, so a readout follows a seek before its
|
|
31
|
+
* frame lands. */
|
|
32
|
+
recordPlayheadTime(currentTime: number): void;
|
|
29
33
|
setPlaybackRate(playbackRate: number): void;
|
|
30
34
|
setRendererBackend(rendererBackend: string | null): void;
|
|
31
35
|
recordPresentedSample(sample: PresentedMediaSample): void;
|
|
36
|
+
/** What the scene put on screen, whether on its own or on a repaint the
|
|
37
|
+
* renderer asked for. Counts a frame not counted before, so a redraw counts
|
|
38
|
+
* nothing and one media time presented twice counts twice. */
|
|
32
39
|
recordPresentationUpdate(sample: PresentedMediaSample): void;
|
|
33
40
|
setReady(): void;
|
|
41
|
+
setLoading(): void;
|
|
34
42
|
setPlaying(): void;
|
|
35
43
|
setBuffering(): void;
|
|
44
|
+
setSeeking(seeking: boolean): void;
|
|
45
|
+
setScrubbing(scrubbing: boolean): void;
|
|
36
46
|
setPaused(): void;
|
|
37
47
|
setRenderError(error: unknown): void;
|
|
38
48
|
markDestroyed(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-renderer-state.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-renderer-state.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAGL,KAAK,qBAAqB,EAE1B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE,UAAU,gCAAgC;IACxC,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;IACvD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACxD;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,IAAI,MAAM,CAAC;IACtB,QAAQ,IAAI,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,IAAI,MAAM,GAAG,IAAI,CAAC;IAC9B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ybackState } from "#types/media-renderer";
|
|
2
|
+
import type { PresentedFrameChannel } from "./presented-frame-channel";
|
|
3
|
+
export interface MediaRendererTransport {
|
|
4
|
+
play(): Promise<void>;
|
|
5
|
+
pause(): void;
|
|
6
|
+
togglePlayback(): Promise<void>;
|
|
7
|
+
scrub(mediaTime: number): void;
|
|
8
|
+
commit(mediaTime: number): Promise<void>;
|
|
9
|
+
step(direction: 1 | -1): Promise<void>;
|
|
10
|
+
setPlaybackRate(rate: number): void;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
}
|
|
13
|
+
export interface MediaRendererTransportOptions {
|
|
14
|
+
/** Replay from the start when the producer reports the source ended. */
|
|
15
|
+
readonly loop: boolean;
|
|
16
|
+
readonly channel: PresentedFrameChannel;
|
|
17
|
+
readonly onPlaybackRate: (rate: number) => void;
|
|
18
|
+
readonly onPlaybackState: (state: MediaRendererPlaybackState) => void;
|
|
19
|
+
readonly onPlayheadTime: (mediaTime: number) => void;
|
|
20
|
+
/**
|
|
21
|
+
* The playhead has moved to a frame that is not on screen yet. Reported apart
|
|
22
|
+
* from `onPlaybackState` because the state a seek settles from is the one the
|
|
23
|
+
* transport keeps reporting throughout it.
|
|
24
|
+
*
|
|
25
|
+
* True for a scrub as well as for a landing, so pair it with `onScrubbing` to
|
|
26
|
+
* tell a viewer who is waiting from one who is dragging.
|
|
27
|
+
*/
|
|
28
|
+
readonly onSeeking: (seeking: boolean) => void;
|
|
29
|
+
/**
|
|
30
|
+
* A drag is open on the playhead. Published as the drag opens and closes
|
|
31
|
+
* without waiting for the producer, whose next word on a slow source is
|
|
32
|
+
* seconds away.
|
|
33
|
+
*/
|
|
34
|
+
readonly onScrubbing: (scrubbing: boolean) => void;
|
|
35
|
+
/** Buffered playback. Awaited before the producer is asked to run. */
|
|
36
|
+
readonly waitForReadiness?: (mediaTime: number) => Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* A bounded wait for whatever annotates `mediaTime`, or null when nothing is
|
|
39
|
+
* missing. Asked on every playhead move, so answering null has to be cheap.
|
|
40
|
+
*
|
|
41
|
+
* This is what stops a producer already at speed, so what it waits for has to
|
|
42
|
+
* be something that gives up on its own. Left out, playback is held once and
|
|
43
|
+
* never again, and a producer outrunning whatever feeds it runs on past
|
|
44
|
+
* frames that have nothing to draw.
|
|
45
|
+
*/
|
|
46
|
+
readonly holdForReadiness?: (mediaTime: number) => Promise<void> | null;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The renderer's playback surface over a producer that owns the playhead.
|
|
50
|
+
* Seconds meet milliseconds here and nowhere else.
|
|
51
|
+
*
|
|
52
|
+
* A drag is a pair: every `scrub` belongs to one gesture the producer is told
|
|
53
|
+
* about, and the `commit` that lands it releases that gesture, so a producer
|
|
54
|
+
* that froze itself for the drag is the one deciding whether to resume. The
|
|
55
|
+
* drag and the settle travel as separate signals: which of the two a viewer is
|
|
56
|
+
* looking at is the host's judgement, not the transport's.
|
|
57
|
+
*/
|
|
58
|
+
export declare function createMediaRendererTransport(options: MediaRendererTransportOptions): MediaRendererTransport;
|
|
59
|
+
//# sourceMappingURL=media-renderer-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media-renderer-transport.d.ts","sourceRoot":"","sources":["../../src/renderers/media-renderer-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EACV,qBAAqB,EAEtB,MAAM,2BAA2B,CAAC;AAInC,MAAM,WAAW,sBAAsB;IACrC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,IAAI,IAAI,CAAC;IACd,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,6BAA6B;IAC5C,wEAAwE;IACxE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAC;IACxC,QAAQ,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,QAAQ,CAAC,eAAe,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;IACtE,QAAQ,CAAC,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD;;;;;;;OAOG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACnD,sEAAsE;IACtE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE;;;;;;;;OAQG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,6BAA6B,GACrC,sBAAsB,CA+OxB"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { type BoxStyle } from "supervision-js-core";
|
|
2
2
|
import type { BufferedDetectionTimeline } from "supervision-js-core";
|
|
3
|
+
import type { DetectionFrame } from "supervision-js-core";
|
|
3
4
|
import type { AnnotationStyleContext, Detection } from "supervision-js-core";
|
|
4
5
|
import type { Graphics as PixiGraphics } from "pixi.js";
|
|
5
6
|
import type { Container as PixiContainer } from "pixi.js";
|
|
6
7
|
export interface PixiBoxLayerState {
|
|
8
|
+
/** The frame this layer resolved and drew. The timeline's answer for one
|
|
9
|
+
* media time moves when a load lands, so this is the only record of which
|
|
10
|
+
* frame the screen actually got. */
|
|
11
|
+
readonly activeDetectionFrame: DetectionFrame | undefined;
|
|
7
12
|
readonly activeDetectionFrameTime: number | null;
|
|
8
13
|
readonly activeDetectionFrameIndex: number | null;
|
|
9
14
|
readonly activeDetectionCount: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-box-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-box-layer.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"pixi-box-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-box-layer.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAG1D,MAAM,WAAW,iBAAiB;IAChC;;yCAEqC;IACrC,QAAQ,CAAC,oBAAoB,EAAE,cAAc,GAAG,SAAS,CAAC;IAC1D,QAAQ,CAAC,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD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{ DetectionPickResult } from "supervision-js-core";
|
|
4
4
|
import type { Container as PixiContainer, ImageSource as PixiImageSource, Mesh as PixiMesh, MeshGeometry as PixiMeshGeometry, Shader as PixiShader, Texture as PixiTexture, UniformGroup as PixiUniformGroup } from "pixi.js";
|
|
@@ -30,6 +30,16 @@ type ShaderFactory = {
|
|
|
30
30
|
fragment: string;
|
|
31
31
|
vertex: string;
|
|
32
32
|
};
|
|
33
|
+
gpu: {
|
|
34
|
+
fragment: {
|
|
35
|
+
entryPoint: string;
|
|
36
|
+
source: string;
|
|
37
|
+
};
|
|
38
|
+
vertex: {
|
|
39
|
+
entryPoint: string;
|
|
40
|
+
source: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
33
43
|
resources: Record<string, unknown>;
|
|
34
44
|
}): PixiShader;
|
|
35
45
|
};
|
|
@@ -56,11 +66,17 @@ type PixiFocusGraphics = {
|
|
|
56
66
|
poly?(points: number[], close?: boolean): PixiFocusGraphics;
|
|
57
67
|
};
|
|
58
68
|
export interface PixiFocusMaskArtifact {
|
|
59
|
-
readonly frame:
|
|
69
|
+
readonly frame: PreparedIdMaskFrame;
|
|
60
70
|
readonly texture: PixiTexture;
|
|
61
71
|
}
|
|
62
72
|
export interface PixiFocusLayerFrameContext {
|
|
63
73
|
readonly frame: FocusDrawFrame | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* The detection frame the mask raster on screen belongs to, when the mask
|
|
76
|
+
* layer is holding that raster over the frame being drawn. A cutout cut from
|
|
77
|
+
* that raster is as current as the mask drawn from it.
|
|
78
|
+
*/
|
|
79
|
+
readonly heldMaskFrameTime?: number | null;
|
|
64
80
|
readonly hoveredPick: DetectionPickResult | null;
|
|
65
81
|
readonly idMaskArtifact?: PixiFocusMaskArtifact | null;
|
|
66
82
|
readonly mediaTime: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-focus-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-focus-layer.ts"],"names":[],"mappings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D,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC;IAC1C,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC;IAChD,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAC5B,SAAS,EAAE,mBAAmB,CAAC,WAAW,CAAC,KACxC,OAAO,CAAC;CACd,GAAG,cAAc,CA8gBjB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { PixiBoxLayerState } from "./pixi-box-layer";
|
|
2
|
+
import type { PixiRegionLayerState } from "./pixi-region-layer";
|
|
3
|
+
import type { PresentedFrameId, PresentedVideoFrame } from "./presented-frame-channel";
|
|
4
|
+
type PresentedFrameStamp = Pick<PresentedVideoFrame, "frameId" | "mediaTimeS">;
|
|
5
|
+
/**
|
|
6
|
+
* Every drawing step of a present, each taking the media time in seconds. A
|
|
7
|
+
* step that reads a time from anywhere but its argument breaks the guarantee
|
|
8
|
+
* this module exists to hold.
|
|
9
|
+
*
|
|
10
|
+
* The mask step also takes the producer's name for the frame these pixels are,
|
|
11
|
+
* because it is the one step that keeps a raster between presents and so is the
|
|
12
|
+
* one step that can put a raster from one frame over the pixels of another. A
|
|
13
|
+
* walk with no presented frame hands it null: a pull-path sample and a redraw
|
|
14
|
+
* at a resting playhead both have a media time and no frame identity.
|
|
15
|
+
*/
|
|
16
|
+
export interface FramePresentLayers {
|
|
17
|
+
readonly drawMask: ((mediaTime: number, presentedFrameId: PresentedFrameId | null) => void) | undefined;
|
|
18
|
+
readonly drawBox: (mediaTime: number) => PixiBoxLayerState;
|
|
19
|
+
readonly drawPolygon: ((mediaTime: number) => void) | undefined;
|
|
20
|
+
readonly drawVector: (mediaTime: number) => void;
|
|
21
|
+
readonly drawRegion: (mediaTime: number) => PixiRegionLayerState;
|
|
22
|
+
readonly drawInteraction: ((mediaTime: number) => void) | undefined;
|
|
23
|
+
readonly drawFocus: (mediaTime: number) => void;
|
|
24
|
+
/** Moves the focus layer's fade to where the presented media time puts it. */
|
|
25
|
+
readonly advanceFocus: (mediaTime: number) => void;
|
|
26
|
+
readonly drawInteractionPresentation: (mediaTime: number) => void;
|
|
27
|
+
readonly drawLabel: ((mediaTime: number) => void) | undefined;
|
|
28
|
+
readonly drawAnnotationOverlay: (mediaTime: number) => void;
|
|
29
|
+
}
|
|
30
|
+
export interface FramePresentLayerStates {
|
|
31
|
+
readonly boxState: PixiBoxLayerState;
|
|
32
|
+
readonly regionState: PixiRegionLayerState;
|
|
33
|
+
}
|
|
34
|
+
export interface FramePresentTargets {
|
|
35
|
+
/** Adopts the presented time as the scene's media time, before anything draws. */
|
|
36
|
+
readonly adoptMediaTime: (mediaTime: number) => void;
|
|
37
|
+
readonly fitMediaScene: () => void;
|
|
38
|
+
readonly uploadFrame: (frame: VideoFrame) => void;
|
|
39
|
+
readonly layers: FramePresentLayers;
|
|
40
|
+
readonly render: () => void;
|
|
41
|
+
readonly completePresentation: (mediaTime: number, boxState: PixiBoxLayerState, regionState: PixiRegionLayerState) => void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The atomic present: one frame the producer put on screen becomes one screen.
|
|
45
|
+
*
|
|
46
|
+
* The media time is the one the producer published for the frame these pixels
|
|
47
|
+
* are, and it is the only time any step below sees. Nothing here awaits, so no
|
|
48
|
+
* other frame can be presented between the pixel upload and the annotations
|
|
49
|
+
* drawn over it, and nothing here consults a wall clock, a playhead getter or
|
|
50
|
+
* a store, so no step can disagree with the pixels about which moment is on
|
|
51
|
+
* screen. One render closes the block, after every layer has drawn; the frame
|
|
52
|
+
* is closed on the way out, once, by its only owner.
|
|
53
|
+
*/
|
|
54
|
+
export declare function presentVideoFrame(presented: PresentedVideoFrame, targets: FramePresentTargets): void;
|
|
55
|
+
/**
|
|
56
|
+
* The one declaration of the draw order: a present walks it, and so does a
|
|
57
|
+
* redraw at a resting playhead, so a layer cannot be in one sequence and be
|
|
58
|
+
* missing or out of place in the other.
|
|
59
|
+
*
|
|
60
|
+
* A walk with no presented frame is not a present, and has no frame timestamp
|
|
61
|
+
* to check its steps against.
|
|
62
|
+
*/
|
|
63
|
+
export declare function drawFramePresentLayers(layers: FramePresentLayers, mediaTime: number, presented?: PresentedFrameStamp): FramePresentLayerStates;
|
|
64
|
+
export type FramePresentStep = keyof FramePresentLayers;
|
|
65
|
+
/**
|
|
66
|
+
* The steps a walk would take, each reporting its cost, so a present that
|
|
67
|
+
* wants a timing breakdown still reads the one declared order.
|
|
68
|
+
*/
|
|
69
|
+
export declare function measureFramePresentLayers(layers: FramePresentLayers, measureStep: <T>(step: FramePresentStep, draw: () => T) => T): FramePresentLayers;
|
|
70
|
+
/**
|
|
71
|
+
* Fails when a step is handed anything but the presented media time. It reads
|
|
72
|
+
* as a tautology against the line above it, and that is the point: it is the
|
|
73
|
+
* line that breaks when someone later gives one step a time of its own.
|
|
74
|
+
*/
|
|
75
|
+
export declare function assertPresentedTimestamp(mediaTime: number, presented: PresentedFrameStamp): void;
|
|
76
|
+
export {};
|
|
77
|
+
//# sourceMappingURL=pixi-frame-present.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pixi-frame-present.d.ts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;GAIG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,mBAAmB,GAC7B,IAAI,CAWN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PreparedIdMaskFrame } from "#render-preparation/mask-frame-artifact";
|
|
2
2
|
import type { ImageSource as PixiImageSource, Mesh as PixiMesh, MeshGeometry as PixiMeshGeometry, Shader as PixiShader, Texture as PixiTexture, UniformGroup as PixiUniformGroup } from "pixi.js";
|
|
3
3
|
type PixiIdMaskMesh = PixiMesh<PixiMeshGeometry, PixiShader>;
|
|
4
4
|
type MeshConstructor = new (options: {
|
|
@@ -26,6 +26,16 @@ type ShaderFactory = {
|
|
|
26
26
|
fragment: string;
|
|
27
27
|
vertex: string;
|
|
28
28
|
};
|
|
29
|
+
gpu: {
|
|
30
|
+
fragment: {
|
|
31
|
+
entryPoint: string;
|
|
32
|
+
source: string;
|
|
33
|
+
};
|
|
34
|
+
vertex: {
|
|
35
|
+
entryPoint: string;
|
|
36
|
+
source: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
29
39
|
resources: Record<string, unknown>;
|
|
30
40
|
}): PixiShader;
|
|
31
41
|
};
|
|
@@ -45,7 +55,7 @@ export interface PixiIdMaskShaderRenderer {
|
|
|
45
55
|
readonly mesh: PixiIdMaskMesh;
|
|
46
56
|
clearTexture(): void;
|
|
47
57
|
hide(): void;
|
|
48
|
-
render(frame:
|
|
58
|
+
render(frame: PreparedIdMaskFrame, texture: PixiTexture): void;
|
|
49
59
|
setOpacity(opacity: number): void;
|
|
50
60
|
destroy(): void;
|
|
51
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-id-mask-shader.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-id-mask-shader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pixi-id-mask-shader.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-id-mask-sh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AK,IAAI,CAAC;IACpE,QAAQ,CAAC,wBAAwB,CAAC,EAAE,CAClC,KAAK,EAAE,kBAAkB,EACzB,SAAS,EAAE,MAAM,KACd,mBAAmB,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CACnC,KAAK,EAAE,kBAAkB,EACzB,SAAS,EAAE,MAAM,KACd,mBAAmB,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACjD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,MAAM,CAAC;IACzC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM;QAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACvD,GAAG,oBAAoB,CAikBvB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PreparedIdMaskFrame } from "#render-preparation/mask-frame-artifact";
|
|
2
2
|
import type { Detection, DetectionFrame } from "supervision-js-core";
|
|
3
3
|
import type { DetectionPickResult } from "supervision-js-core";
|
|
4
4
|
import { type InteractionStyle } from "supervision-js-core";
|
|
5
5
|
import type { Container as PixiContainer, Graphics as PixiGraphics, ImageSource as PixiImageSource, Mesh as PixiMesh, MeshGeometry as PixiMeshGeometry, Shader as PixiShader, Text as PixiText, Texture as PixiTexture, UniformGroup as PixiUniformGroup } from "pixi.js";
|
|
6
|
+
export declare const MAX_INTERACTION_STROKE_RADIUS = 12;
|
|
6
7
|
type PixiInteractionMesh = PixiMesh<PixiMeshGeometry, PixiShader>;
|
|
7
8
|
type ContainerConstructor = new () => PixiContainer;
|
|
8
9
|
type GraphicsConstructor = new () => PixiGraphics;
|
|
@@ -35,6 +36,16 @@ type ShaderFactory = {
|
|
|
35
36
|
fragment: string;
|
|
36
37
|
vertex: string;
|
|
37
38
|
};
|
|
39
|
+
gpu: {
|
|
40
|
+
fragment: {
|
|
41
|
+
entryPoint: string;
|
|
42
|
+
source: string;
|
|
43
|
+
};
|
|
44
|
+
vertex: {
|
|
45
|
+
entryPoint: string;
|
|
46
|
+
source: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
38
49
|
resources: Record<string, unknown>;
|
|
39
50
|
}): PixiShader;
|
|
40
51
|
};
|
|
@@ -48,7 +59,7 @@ type UniformGroupConstructor = new (uniforms: Record<string, {
|
|
|
48
59
|
value: Float32Array;
|
|
49
60
|
}>) => PixiUniformGroup;
|
|
50
61
|
export interface PixiInteractionMaskArtifact {
|
|
51
|
-
readonly frame:
|
|
62
|
+
readonly frame: PreparedIdMaskFrame;
|
|
52
63
|
readonly texture: PixiTexture;
|
|
53
64
|
}
|
|
54
65
|
export interface PixiInteractionPresentationLayerFrameContext {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-interaction-presentation-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-interaction-presentation-layer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pixi-interaction-presentation-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-interaction-presentation-layer.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAUnF,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAGL,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,KAAK,EACV,SAAS,IAAI,aAAa,EAC1B,QAAQ,IAAI,YAAY,EACx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;IACxD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,gCAAgC;IAC/C,aAAa,CAAC,UAAU,EAAE;QACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,GAAG,aAAa,CAAC;IAClB,SAAS,CAAC,OAAO,EAAE,4CAA4C,GAAG,IAAI,CAAC;IACvE,mBAAmB,CACjB,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GACpD,IAAI,CAAC;IACR,OAAO,IAAI,IAAI,CAAC;CACjB;AASD,wBAAgB,sCAAsC,CAAC,OAAO,EAAE;IAC9D,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC;IAChD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACpD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,OAAO,CAAC;CACjE,GAAG,gCAAgC,CAyTnC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Detection, MaskHaloDrawInstruction, MaskHaloStyle, MaskHaloStyleContext, MaskStyle } from "supervision-js-core";
|
|
1
2
|
import type { Container as PixiContainer, ImageSource as PixiImageSource, Mesh as PixiMesh, MeshGeometry as PixiMeshGeometry, Shader as PixiShader, Texture as PixiTexture, UniformGroup as PixiUniformGroup } from "pixi.js";
|
|
2
3
|
type PixiMaskHaloMesh = PixiMesh<PixiMeshGeometry, PixiShader>;
|
|
3
4
|
type ContainerConstructor = new () => PixiContainer;
|
|
@@ -26,6 +27,16 @@ type ShaderFactory = {
|
|
|
26
27
|
fragment: string;
|
|
27
28
|
vertex: string;
|
|
28
29
|
};
|
|
30
|
+
gpu: {
|
|
31
|
+
fragment: {
|
|
32
|
+
entryPoint: string;
|
|
33
|
+
source: string;
|
|
34
|
+
};
|
|
35
|
+
vertex: {
|
|
36
|
+
entryPoint: string;
|
|
37
|
+
source: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
29
40
|
resources: Record<string, unknown>;
|
|
30
41
|
}): PixiShader;
|
|
31
42
|
};
|
|
@@ -37,6 +48,19 @@ type UniformGroupConstructor = new (uniforms: Record<string, {
|
|
|
37
48
|
type: "vec4<f32>";
|
|
38
49
|
value: Float32Array;
|
|
39
50
|
}>) => PixiUniformGroup;
|
|
51
|
+
/**
|
|
52
|
+
* The halo a detection actually paints, or `undefined`. A style may answer an
|
|
53
|
+
* instruction that draws nothing, and both the coverage the halo prepares and
|
|
54
|
+
* the passes it renders have to read that the same way: the raster carries one
|
|
55
|
+
* detection id per pixel, so a detection admitted into the coverage but never
|
|
56
|
+
* painted still claims its pixels and buries the ids the glow is drawn from.
|
|
57
|
+
*/
|
|
58
|
+
export declare function resolvePaintedMaskHalo(haloStyle: MaskHaloStyle, detection: Detection, context: MaskHaloStyleContext): MaskHaloDrawInstruction | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* The mask coverage a halo-only presentation prepares. Nothing here reaches the
|
|
61
|
+
* screen, so the fill colour and alpha are arbitrary.
|
|
62
|
+
*/
|
|
63
|
+
export declare function createMaskHaloPreparationStyle(haloStyle: MaskHaloStyle, artifactKey: string): MaskStyle;
|
|
40
64
|
export interface PixiBlurFilterLike {
|
|
41
65
|
strength: number;
|
|
42
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-mask-halo.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-mask-halo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pixi-mask-halo.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-mask-halo.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,SAAS,EACT,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,SAAS,EACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,SAAS,IAAI,aAAa,EAC1B,WAAW,IAAI,eAAe,EAC9B,IAAI,IAAI,QAAQ,EAChB,YAAY,IAAI,gBAAgB,EAChC,MAAM,IAAI,UAAU,EACpB,OAAO,IAAI,WAAW,EACtB,YAAY,IAAI,gBAAgB,EACjC,MAAM,SAAS,CAAC;AAEjB,KAAK,gBAAgB,GAAG,QAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;AAE/D,KAAK,oBAAoB,GAAG,UAAU,aAAa,CAAC;AAEpD,KAAK,eAAe,GAAG,KAAK,OAAO,EAAE;IACnC,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,UAAU,CAAC;CACpB,KAAK,gBAAgB,CAAC;AAEvB,KAAK,sBAAsB,GAAG,KAAK,OAAO,EAAE;IAC1C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,SAAS,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;CACf,KAAK,eAAe,CAAC;AAEtB,KAAK,uBAAuB,GAAG,KAAK,OAAO,EAAE;IAC3C,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,YAAY,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,EAAE,eAAe,CAAC;IAC1B,G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