supervision 0.1.7 → 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/detections/chunked-detection-frame-source.d.ts.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9281 -5038
- package/dist/index.js.map +1 -1
- package/dist/mask-preparation.worker.js +409 -185
- 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-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-state.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 +54 -0
- package/dist/media/video-engine-media-source.d.ts.map +1 -0
- 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 +48 -12
- package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
- package/dist/render-preparation/mask-frame-compositor.d.ts +12 -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 +13 -3
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
- package/dist/render-preparation/prepared-render-window.d.ts +44 -2
- 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/injected-pixi.d.ts +38 -0
- package/dist/renderers/injected-pixi.d.ts.map +1 -0
- 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 +9 -0
- package/dist/renderers/media-renderer-core.d.ts.map +1 -1
- package/dist/renderers/media-renderer-scene.d.ts +50 -2
- package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
- package/dist/renderers/media-renderer-state.d.ts +20 -1
- package/dist/renderers/media-renderer-state.d.ts.map +1 -1
- package/dist/renderers/media-renderer-transport.d.ts +72 -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 +19 -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 +6 -25
- 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 +12 -2
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-halo.d.ts +18 -23
- package/dist/renderers/pixi-mask-halo.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-layer.d.ts +94 -32
- 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 +9 -2
- package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-region-coverage-mask.d.ts +62 -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 +43 -2
- 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/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 +138 -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 +73 -4
- package/dist/tracking.worker.js.map +1 -1
- 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 -15
- package/dist/types/media-session.d.ts.map +1 -1
- package/dist/types/render-preparation.d.ts +149 -5
- 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 +75 -0
- package/dist/web-video-engine/analysis.d.ts +6 -0
- package/dist/web-video-engine/analysis.js +1850 -0
- package/dist/web-video-engine/cache-budget.d.ts +18 -0
- package/dist/web-video-engine/canvas-sink-scrub-cursor.d.ts +89 -0
- package/dist/web-video-engine/clock.d.ts +82 -0
- package/dist/web-video-engine/constants.d.ts +261 -0
- package/dist/web-video-engine/create-scrub-cursor.d.ts +65 -0
- package/dist/web-video-engine/decode-resolution.d.ts +114 -0
- package/dist/web-video-engine/decode-scheduler.d.ts +371 -0
- package/dist/web-video-engine/decode-session.d.ts +283 -0
- package/dist/web-video-engine/decode-source.d.ts +258 -0
- package/dist/web-video-engine/diagnostics-store.d.ts +17 -0
- package/dist/web-video-engine/diagnostics.d.ts +316 -0
- package/dist/web-video-engine/embedded-engine-worker.d.ts +1 -0
- package/dist/web-video-engine/engine-core.d.ts +269 -0
- package/dist/web-video-engine/engine.d.ts +25 -0
- package/dist/web-video-engine/engine.js +912 -0
- package/dist/web-video-engine/engine.worker.d.ts +1 -0
- package/dist/web-video-engine/engine.worker.js +33624 -0
- package/dist/web-video-engine/frame-cache.d.ts +236 -0
- package/dist/web-video-engine/frame-extractor.d.ts +27 -0
- package/dist/web-video-engine/frame-timeline-DreEwsRY.js +616 -0
- package/dist/web-video-engine/frame-timeline.d.ts +80 -0
- package/dist/web-video-engine/frame-walker.d.ts +73 -0
- package/dist/web-video-engine/index.d.ts +13 -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 +64 -0
- package/dist/web-video-engine/keyframe-index.d.ts +90 -0
- package/dist/web-video-engine/mirror-store.d.ts +55 -0
- package/dist/web-video-engine/renderer.d.ts +93 -0
- package/dist/web-video-engine/rotation.d.ts +34 -0
- package/dist/web-video-engine/scrub-controller.d.ts +375 -0
- package/dist/web-video-engine/scrub-cursor.d.ts +347 -0
- package/dist/web-video-engine/scrub-trajectory.d.ts +29 -0
- package/dist/web-video-engine/source-residency.d.ts +91 -0
- package/dist/web-video-engine/trace-recorder.d.ts +163 -0
- package/dist/web-video-engine/types.d.ts +200 -0
- package/dist/web-video-engine/video-engine.d.ts +437 -0
- package/dist/web-video-engine/webgpu-renderer.d.ts +61 -0
- package/dist/web-video-engine/worker-bridge.d.ts +11 -0
- package/dist/web-video-engine/worker-dispatch.d.ts +16 -0
- package/dist/web-video-engine/worker-protocol.d.ts +282 -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 +5 -4
- package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.js +1167 -280
- 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 +191 -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 +83 -5
- 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 +32 -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 +34 -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 +24 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pixel ratio a host's display box rasterizes at, for every grid that lands
|
|
3
|
+
* in that box: the presentation surface, the mask rasters drawn onto it, and the
|
|
4
|
+
* decode under both. The ceiling is what keeps a 3x display from costing nine
|
|
5
|
+
* times the texels of a 1x one for sharpness nobody resolves on a moving
|
|
6
|
+
* picture. An id raster carries a detection per pixel and can only be sampled
|
|
7
|
+
* nearest, so a grid it does not share ragged its edges.
|
|
8
|
+
*
|
|
9
|
+
* A ceiling that is not a usable number states nothing, and takes the default.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveDisplayPixelRatio(display: {
|
|
12
|
+
readonly devicePixelRatio: number;
|
|
13
|
+
readonly maxDevicePixelRatio?: number;
|
|
14
|
+
}): number;
|
|
15
|
+
//# sourceMappingURL=display-pixel-ratio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display-pixel-ratio.d.ts","sourceRoot":"","sources":["../../src/media/display-pixel-ratio.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC,GAAG,MAAM,CAeT"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const VIDEO_ENGINE_ENTRY = "supervision/web-video-engine";
|
|
2
|
+
export declare const VIDEO_ENGINE_ANALYSIS_ENTRY = "supervision/web-video-engine/analysis";
|
|
3
|
+
/**
|
|
4
|
+
* The engine is a chunk of this package that the browser fetches on demand, so
|
|
5
|
+
* the raw failure names a URL nobody wrote and reads like a bug in the caller's
|
|
6
|
+
* own code.
|
|
7
|
+
*/
|
|
8
|
+
export declare function rethrowEngineImportFailure(error: unknown, entry: string): never;
|
|
9
|
+
/**
|
|
10
|
+
* An engine that never loaded and an engine that loaded and then threw arrive
|
|
11
|
+
* at the same catch, and only the first is a deployment problem. Loaders that
|
|
12
|
+
* wrap what they caught put the load failure under the error they raise, so the
|
|
13
|
+
* whole cause chain is read, bounded because a chain can be cyclic.
|
|
14
|
+
*/
|
|
15
|
+
export declare function isEngineResolutionFailure(error: unknown): boolean;
|
|
16
|
+
//# sourceMappingURL=engine-import-failure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine-import-failure.d.ts","sourceRoot":"","sources":["../../src/media/engine-import-failure.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,iCAAiC,CAAC;AACjE,eAAO,MAAM,2BAA2B,0CAAmC,CAAC;AAkB5E;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,MAAM,GACZ,KAAK,CAWP;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAUjE"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { MediaErrorKind } from "supervision-js-core";
|
|
2
|
+
/**
|
|
3
|
+
* The vocabulary a media producer may name its own failure in. A producer that
|
|
4
|
+
* states its cause as one of these on `code` is classified by that name; any
|
|
5
|
+
* other code is classified from the message like an uncoded failure.
|
|
6
|
+
*/
|
|
7
|
+
export declare const MEDIA_PRODUCER_ERROR_CODES: readonly ["ABORTED", "BACKEND_CRASHED", "CONTAINER_UNREADABLE", "DECODER_STALLED", "DECODE_UNSUPPORTED", "NO_VIDEO_TRACK", "PRESENTATION_MISMATCH", "RATE_UNSUPPORTED", "SOURCE_UNREADABLE", "VIDEO_TRACK_UNREADABLE"];
|
|
2
8
|
/**
|
|
3
9
|
* A media failure with a stable, documented kind.
|
|
4
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-errors.d.ts","sourceRoot":"","sources":["../../src/media/media-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"media-errors.d.ts","sourceRoot":"","sources":["../../src/media/media-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,wNAW7B,CAAC;AA8BX;;;;;;GAMG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;gBAG5B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAMzC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAE5E;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,eAAe,SAAyB,GACvC,gBAAgB,CASlB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,CAEhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-normalization.d.ts","sourceRoot":"","sources":["../../src/media/media-normalization.ts"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"media-normalization.d.ts","sourceRoot":"","sources":["../../src/media/media-normalization.ts"],"names":[],"mappings":"AAUA,OAAO,EAML,KAAK,yBAAyB,EAE9B,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAChC,MAAM,4BAA4B,CAAC;AAIpC,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,qBAAqB,EACrB,4BAA4B,EAC5B,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,8BAA8B,EACnC,KAAK,+BAA+B,EACpC,KAAK,yBAAyB,EAC9B,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,EAC/B,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,0BAA0B,GAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAUhD,wBAAsB,cAAc,CAClC,MAAM,EAAE,IAAI,EACZ,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,eAAe,CAAC,CAkG1B;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,IAAI,EACZ,OAAO,GAAE,yBAA8B,GACtC,OAAO,CAAC,0BAA0B,CAAC,CA8IrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-probe.d.ts","sourceRoot":"","sources":["../../src/media/media-probe.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"media-probe.d.ts","sourceRoot":"","sources":["../../src/media/media-probe.ts"],"names":[],"mappings":"AAGA,OAAO,EAQL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGtB,MAAM,4BAA4B,CAAC;AAgBpC,wBAAsB,UAAU,CAC9B,MAAM,EAAE,IAAI,EACZ,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CA0F3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-source-state.d.ts","sourceRoot":"","sources":["../../src/media/media-source-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,wBAAgB,6BAA6B,IAAI,gBAAgB,
|
|
1
|
+
{"version":3,"file":"media-source-state.d.ts","sourceRoot":"","sources":["../../src/media/media-source-state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,wBAAgB,6BAA6B,IAAI,gBAAgB,CAoBhE;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,0BAA0B,GACnC,gBAAgB,CAoBlB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { PresentedFrameChannel } from "#renderers/presented-frame-channel";
|
|
1
2
|
export interface DecodedVideoSample {
|
|
2
3
|
readonly timestamp: number;
|
|
3
4
|
readonly duration: number;
|
|
@@ -11,6 +12,15 @@ export interface DecodedVideoSampleSink {
|
|
|
11
12
|
samples(startTimestamp?: number, endTimestamp?: number, options?: {
|
|
12
13
|
skipLiveWait?: boolean;
|
|
13
14
|
}): AsyncGenerator<DecodedVideoSample, void, unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* A sample per timestamp, in the order asked for, `null` where no frame
|
|
17
|
+
* covers it, over a single pass across the track. Optional: a caller with a
|
|
18
|
+
* whole set in hand takes this where a source offers it, and otherwise pays
|
|
19
|
+
* a seek per {@link DecodedVideoSampleSink.getSample}.
|
|
20
|
+
*/
|
|
21
|
+
samplesAtTimestamps?(timestamps: Iterable<number>, options?: {
|
|
22
|
+
skipLiveWait?: boolean;
|
|
23
|
+
}): AsyncGenerator<DecodedVideoSample | null, void, unknown>;
|
|
14
24
|
}
|
|
15
25
|
export interface DisposableMediaInput {
|
|
16
26
|
dispose(): void;
|
|
@@ -34,5 +44,12 @@ export interface DecodedMediaSource {
|
|
|
34
44
|
readonly input: DisposableMediaInput;
|
|
35
45
|
readonly metadata: DecodedMediaSourceMetadata;
|
|
36
46
|
readonly sampleSink: DecodedVideoSampleSink;
|
|
47
|
+
/**
|
|
48
|
+
* A source that owns its own decode clock publishes one, and the renderer
|
|
49
|
+
* composites the frames it announces rather than asking `sampleSink` for a
|
|
50
|
+
* frame at a time the renderer chose. `sampleSink` stays required, and still
|
|
51
|
+
* serves thumbnails and one-off grabs.
|
|
52
|
+
*/
|
|
53
|
+
readonly engine?: PresentedFrameChannel;
|
|
37
54
|
}
|
|
38
55
|
//# sourceMappingURL=media-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-source.d.ts","sourceRoot":"","sources":["../../src/media/media-source.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,IAAI,CACF,OAAO,EAAE,wBAAwB,GAAG,iCAAiC,EACrE,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAAC;IACR,KAAK,IAAI,IAAI,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,SAAS,CACP,SAAS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ourceRoot":"","sources":["../../src/media/mediabunny-media-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACnC,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAID,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,0BAA0B,GAC/D,OAAO,CAAC,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"mediabunny-media-source.d.ts","sourceRoot":"","sources":["../../src/media/mediabunny-media-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACnC,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAID,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,GAAG,GAAG,GAAG,OAAO,GAAG,0BAA0B,GAC/D,OAAO,CAAC,kBAAkB,CAAC,CAsG7B;AAkCD,wBAAgB,mCAAmC,CACjD,WAAW,EAAE,0BAA0B,GACtC,mBAAmB,CAMrB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { DecodedMediaSource } from "#media/media-source";
|
|
2
|
+
import type { PresentedFrameChannel } from "#renderers/presented-frame-channel";
|
|
3
|
+
import type { MediaRendererSource } from "#types/media-renderer";
|
|
4
|
+
import type { BlobVideoSource, DecodeResolutionStrategy, DisplayBoxResolutionOptions, UrlVideoSource, WebVideoEngine, WebVideoEngineOptions } from "#web-video-engine";
|
|
5
|
+
export interface WebVideoEngineMediaSourceOptions extends Omit<WebVideoEngineOptions, "presentation" | "source"> {
|
|
6
|
+
/**
|
|
7
|
+
* The video to open. Two readers open it here, so it has to be one that can
|
|
8
|
+
* be opened twice: the worker-backed engine decodes playback and scrubbing,
|
|
9
|
+
* and the analysis session behind `sampleSink` decodes thumbnails and one-off
|
|
10
|
+
* grabs from scratch. A URL re-fetches and a Blob re-reads. A ReadableStream
|
|
11
|
+
* yields its bytes once, and the engine's load transfers it to the worker,
|
|
12
|
+
* which detaches it here, so the pull path would be left with nothing to
|
|
13
|
+
* read; pass one to {@link WebVideoEngine} directly instead.
|
|
14
|
+
*/
|
|
15
|
+
readonly source: UrlVideoSource | BlobVideoSource;
|
|
16
|
+
/**
|
|
17
|
+
* The box a compositor paints these frames into, in CSS pixels, with the
|
|
18
|
+
* viewer's device pixel ratio.
|
|
19
|
+
*
|
|
20
|
+
* This source runs the engine canvas-less, so nothing on the engine side ever
|
|
21
|
+
* measures a display box and its viewport strategy has nothing to read: left
|
|
22
|
+
* unsaid, frames decode at the source's full resolution however small the box
|
|
23
|
+
* is. Saying it here decodes at the size the frames are actually shown at,
|
|
24
|
+
* which cuts per-frame paint work and buys the scrub cache more slots at the
|
|
25
|
+
* cost of preview sharpness while scrubbing. An explicit `decodeStrategy`
|
|
26
|
+
* wins over this.
|
|
27
|
+
*/
|
|
28
|
+
readonly display?: DisplayBoxResolutionOptions;
|
|
29
|
+
/**
|
|
30
|
+
* Sizes the frames the pull path decodes. The inherited `decodeStrategy`
|
|
31
|
+
* sizes what the engine decodes for its own presentation.
|
|
32
|
+
*/
|
|
33
|
+
readonly frameDecodeStrategy?: DecodeResolutionStrategy;
|
|
34
|
+
}
|
|
35
|
+
export interface WebVideoEngineMediaSource extends DecodedMediaSource {
|
|
36
|
+
/**
|
|
37
|
+
* The loaded engine. Naming the renderer's channel in the type is what fails
|
|
38
|
+
* the build if the engine's transport stops answering that seam.
|
|
39
|
+
*/
|
|
40
|
+
readonly engine: WebVideoEngine & PresentedFrameChannel;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Adapts the web video engine to the decoded-media source seam.
|
|
44
|
+
*
|
|
45
|
+
* The pull path, `sampleSink`, serves one-off reads such as thumbnails and
|
|
46
|
+
* single frame grabs, decoding each request from scratch through the engine's
|
|
47
|
+
* batch analysis entry. The push path serves playback and scrub presentation:
|
|
48
|
+
* the engine holds no canvas, paints nothing, and announces every frame that
|
|
49
|
+
* earns the screen, so a compositor subscribes to `engine` and never pulls
|
|
50
|
+
* samples here.
|
|
51
|
+
*/
|
|
52
|
+
export declare function openWebVideoEngineMediaSource(options: WebVideoEngineMediaSourceOptions): Promise<WebVideoEngineMediaSource>;
|
|
53
|
+
export declare function createWebVideoEngineMediaRendererSource(options: WebVideoEngineMediaSourceOptions): MediaRendererSource;
|
|
54
|
+
//# sourceMappingURL=video-engine-media-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-engine-media-source.d.ts","sourceRoot":"","sources":["../../src/media/video-engine-media-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACxB,2BAA2B,EAE3B,cAAc,EACd,cAAc,EACd,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAoB3B,MAAM,WAAW,gCAAiC,SAAQ,IAAI,CAC5D,qBAAqB,EACrB,cAAc,GAAG,QAAQ,CAC1B;IACC;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,eAAe,CAAC;IAClD;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,2BAA2B,CAAC;IAC/C;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;CACzD;AAED,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;IACnE;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,qBAAqB,CAAC;CACzD;AAED;;;;;;;;;GASG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,gCAAgC,GACxC,OAAO,CAAC,yBAAyB,CAAC,CAiDpC;AAwDD,wBAAgB,uCAAuC,CACrD,OAAO,EAAE,gCAAgC,GACxC,mBAAmB,CAMrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-engine-media-source.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -14,11 +14,17 @@ export declare function createMediaPlaybackController(options: {
|
|
|
14
14
|
readonly initialMediaTime: number;
|
|
15
15
|
readonly playbackRate?: number;
|
|
16
16
|
readonly presentSample: (sample: DecodedVideoSample) => void;
|
|
17
|
-
readonly waitForSample?: (sample: DecodedVideoSample) => Promise<void>;
|
|
17
|
+
readonly waitForSample?: (sample: DecodedVideoSample, signal: AbortSignal) => Promise<void>;
|
|
18
18
|
readonly onCurrentTimeChange: (currentTime: number) => void;
|
|
19
19
|
readonly onEnded: () => void;
|
|
20
20
|
readonly onError: (error: unknown) => void;
|
|
21
21
|
readonly onWaiting?: () => void;
|
|
22
22
|
readonly onResume?: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* The picture has run out of decoded samples and cannot draw the next frame
|
|
25
|
+
* until the source produces one. Prefetch running behind a moving picture
|
|
26
|
+
* does not report here.
|
|
27
|
+
*/
|
|
28
|
+
readonly onSourceWait?: (waiting: boolean) => void;
|
|
23
29
|
}): MediaPlaybackController;
|
|
24
30
|
//# sourceMappingURL=media-playback-controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-playback-controller.d.ts","sourceRoot":"","sources":["../../src/playback/media-playback-controller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAU7B,MAAM,WAAW,uBAAuB;IACtC,IAAI,IAAI,IAAI,CAAC;IACb,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE;IACrD,QAAQ,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAC5C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7D,QAAQ,CAAC,aAAa,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"media-playback-controller.d.ts","sourceRoot":"","sources":["../../src/playback/media-playback-controller.ts"],"names":[],"mappings":"AACA,OAA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CACpD,GAAG,uBAAuB,CAue1B"}
|
|
@@ -1,34 +1,70 @@
|
|
|
1
1
|
export declare enum PreparedMaskFrameKind {
|
|
2
|
-
|
|
2
|
+
IdMask = "idMask",
|
|
3
3
|
RgbaImage = "rgbaImage"
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* How an id raster is laid out for the texture it is uploaded into. WebGPU
|
|
7
|
+
* takes any bytesPerRow, so ids go up one byte per pixel. WebGL aligns every
|
|
8
|
+
* uploaded row to four bytes and rejects a single-channel upload whose width
|
|
9
|
+
* is not a multiple of four, which is what the four-channel layout is for.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum IdMaskTextureFormat {
|
|
12
|
+
R8 = "r8unorm",
|
|
13
|
+
Rgba8 = "rgba8unorm"
|
|
14
|
+
}
|
|
15
|
+
export interface PreparedRegionMaskCoverageEntry {
|
|
16
|
+
readonly data: Uint8Array<ArrayBuffer>;
|
|
17
|
+
readonly detectionIndex: number;
|
|
18
|
+
readonly height: number;
|
|
19
|
+
readonly width: number;
|
|
20
|
+
readonly x: number;
|
|
21
|
+
readonly y: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Overlap-preserving membership planes for exact region crops. Every target
|
|
25
|
+
* owns an alpha crop, so masks remain independent where their pixels overlap.
|
|
26
|
+
*/
|
|
27
|
+
export interface PreparedRegionMaskCoverageFrame {
|
|
28
|
+
readonly entries: readonly PreparedRegionMaskCoverageEntry[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The uncomposited detection-id plane carried alongside the RGBA composite, so
|
|
32
|
+
* id-keyed effects such as the mask halo still have a plane to read when the id
|
|
33
|
+
* raster could not be cooked. It carries its own size because it honors the
|
|
34
|
+
* same raster cap as the id raster while the composite is cooked at the
|
|
35
|
+
* instructions' own resolution.
|
|
36
|
+
*/
|
|
37
|
+
export interface PreparedIdMaskPlane {
|
|
38
|
+
readonly data: Uint8Array<ArrayBuffer>;
|
|
39
|
+
readonly height: number;
|
|
40
|
+
readonly width: number;
|
|
41
|
+
}
|
|
5
42
|
export interface PreparedRgbaMaskFrame {
|
|
6
43
|
readonly height: number;
|
|
7
|
-
|
|
8
|
-
* The uncomposited detection-id plane when preparation falls back to an
|
|
9
|
-
* RGBA image. This keeps id-based effects available without requiring PNG
|
|
10
|
-
* encoding or ImageBitmap support.
|
|
11
|
-
*/
|
|
12
|
-
readonly idMaskData?: Uint8Array<ArrayBuffer>;
|
|
44
|
+
readonly idMaskPlane?: PreparedIdMaskPlane;
|
|
13
45
|
readonly key: string;
|
|
14
46
|
readonly kind: PreparedMaskFrameKind.RgbaImage;
|
|
47
|
+
readonly regionMaskCoverage?: PreparedRegionMaskCoverageFrame;
|
|
15
48
|
readonly source: HTMLCanvasElement | ImageBitmap;
|
|
16
49
|
readonly width: number;
|
|
17
50
|
close(): void;
|
|
18
51
|
}
|
|
19
|
-
export interface
|
|
52
|
+
export interface PreparedIdMaskFrame {
|
|
20
53
|
readonly fillPalette: Float32Array<ArrayBuffer>;
|
|
21
54
|
readonly hasStroke: boolean;
|
|
22
55
|
readonly height: number;
|
|
23
56
|
readonly key: string;
|
|
24
|
-
readonly kind: PreparedMaskFrameKind.
|
|
57
|
+
readonly kind: PreparedMaskFrameKind.IdMask;
|
|
25
58
|
readonly maxStrokeWidth: number;
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
59
|
+
readonly raster: Uint8Array<ArrayBuffer>;
|
|
60
|
+
readonly regionMaskCoverage?: PreparedRegionMaskCoverageFrame;
|
|
61
|
+
/** The frame-wide mask width every stroke on this raster is scaled against. */
|
|
62
|
+
readonly sourceWidth: number;
|
|
28
63
|
readonly strokePalette: Float32Array<ArrayBuffer>;
|
|
29
64
|
readonly strokeWidths: Float32Array<ArrayBuffer>;
|
|
30
65
|
readonly width: number;
|
|
31
66
|
close(): void;
|
|
32
67
|
}
|
|
33
|
-
export type PreparedMaskFrame =
|
|
68
|
+
export type PreparedMaskFrame = PreparedIdMaskFrame | PreparedRgbaMaskFrame;
|
|
69
|
+
export declare function readIdMaskRasterValue(frame: PreparedIdMaskFrame, x: number, y: number): number;
|
|
34
70
|
//# sourceMappingURL=mask-frame-artifact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-frame-artifact.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-artifact.ts"],"names":[],"mappings":"AAAA,oBAAY,qBAAqB;IAC/B,
|
|
1
|
+
{"version":3,"file":"mask-frame-artifact.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-artifact.ts"],"names":[],"mappings":"AAAA,oBAAY,qBAAqB;IAC/B,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED;;;;;GAKG;AACH,oBAAY,mBAAmB;IAC7B,EAAE,YAAY;IACd,KAAK,eAAe;CACrB;AAED,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,OAAO,EAAE,SAAS,+BAA+B,EAAE,CAAC;CAC9D;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,E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ruction } from "#render-preparation/mask-preparation-worker-protocol";
|
|
2
|
+
import type { PreparedIdMaskPlane, PreparedRegionMaskCoverageFrame } from "#render-preparation/mask-frame-artifact";
|
|
2
3
|
import { type IdMaskFrame } from "supervision-js-core";
|
|
3
4
|
export { MAX_ID_MASK_PALETTE_ENTRIES, MAX_ID_MASK_STROKE_WIDTH, createIdMaskFrame, type IdMaskFrame, } from "supervision-js-core";
|
|
4
5
|
export interface CompositedMaskFrame {
|
|
@@ -6,10 +7,16 @@ export interface CompositedMaskFrame {
|
|
|
6
7
|
readonly height: number;
|
|
7
8
|
readonly width: number;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
10
|
+
/** Builds compact, independent alpha crops so overlapping masks stay exact. */
|
|
11
|
+
export declare function createRegionMaskCoverageFrame(instructions: readonly SerializableMaskInstruction[]): PreparedRegionMaskCoverageFrame | undefined;
|
|
12
12
|
export declare function compositeMaskFrame(instructions: readonly SerializableMaskInstruction[]): CompositedMaskFrame | undefined;
|
|
13
|
-
export declare function
|
|
14
|
-
|
|
13
|
+
export declare function createIdMaskRasterFrame(instructions: readonly SerializableMaskInstruction[], maxRasterWidth?: number): IdMaskFrame | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the palette has a slot for every detection this frame masks. An id
|
|
16
|
+
* names a detection by its index in the frame, so one masked detection past the
|
|
17
|
+
* last slot leaves the whole frame without an id raster however few masks it
|
|
18
|
+
* carries.
|
|
19
|
+
*/
|
|
20
|
+
export declare function canIdMaskPaletteNameFrame(instructions: readonly SerializableMaskInstruction[]): boolean;
|
|
21
|
+
export declare function createIdMaskPlane(instructions: readonly SerializableMaskInstruction[], maxRasterWidth?: number): PreparedIdMaskPlane | undefined;
|
|
15
22
|
//# sourceMappingURL=mask-frame-compositor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-frame-compositor.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-compositor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;
|
|
1
|
+
{"version":3,"file":"mask-frame-compositor.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-compositor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,KAAK,EACV,mBAAmB,EAEnB,+BAA+B,EAChC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAQL,KAAK,WAAW,EACjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC;AAsB7B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,+EAA+E;AAC/E,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,SAAS,2BAA2B,EAAE,GACnD,+BAA+B,GAAG,SAAS,CAmB7C;AA6CD,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,SAAS,2BAA2B,EAAE,GACnD,mBAAmB,GAAG,SAAS,CAgBjC;AAED,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,SAAS,2BAA2B,EAAE,EACpD,cAAc,CAAC,EAAE,MAAM,GACtB,WAAW,GAAG,SAAS,CAUzB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,SAAS,2BAA2B,EAAE,WAOrD;AAED,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,SAAS,2BAA2B,EAAE,EACpD,cAAc,CAAC,EAAE,MAAM,GACtB,mBAAmB,GAAG,SAAS,CAajC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-frame-preparer.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-preparer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mask-frame-preparer.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-frame-preparer.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,qBAAqB,EACrB,KAAK,iBAAiB,EAEvB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAEL,KAAK,uBAAuB,EAG7B,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EACL,8BAA8B,EAE9B,6BAA6B,EAC7B,KAAK,wBAAwB,EAE9B,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,CAAC;AAEzD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,aAAa,EAAE,8BAA8B,CAAC;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,6BAA6B,CAAC;CACtD;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,IAAI,uBAAuB,CAAC;IACrC,OAAO,CAAC,GAAG,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAAC;IAC9E,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,wBAAgB,uBAAuB,CACrC,OAAO,GAAE;IACP,QAAQ,CAAC,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;IACtD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CACjC,GACL,iBAAiB,CAsGnB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Automatic mask preparation intentionally uses a small pool.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Automatic mask preparation intentionally uses a small pool. Worker count
|
|
3
|
+
* increases memory pressure and competes with media decode, and every prepared
|
|
4
|
+
* frame crosses back to the main thread as a full-resolution raster. Explicit
|
|
5
|
+
* caller requests are allowed higher, but still bounded.
|
|
6
6
|
*/
|
|
7
7
|
export declare const AUTO_MASK_PREPARATION_WORKER_LIMIT = 4;
|
|
8
8
|
export declare const REQUESTED_MASK_PREPARATION_WORKER_LIMIT = 8;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DetectionMask, Point } from "supervision-js-core";
|
|
2
2
|
import type { MaskStrokeStyle } from "supervision-js-core";
|
|
3
|
-
import type { PreparedMaskFrameKind } from "./mask-frame-artifact";
|
|
3
|
+
import type { PreparedIdMaskPlane, PreparedMaskFrameKind, PreparedRegionMaskCoverageFrame } from "./mask-frame-artifact";
|
|
4
4
|
export declare enum MaskPreparationWorkerMessageType {
|
|
5
5
|
Complete = "complete",
|
|
6
6
|
Empty = "empty",
|
|
@@ -11,7 +11,11 @@ interface SerializableRasterInstructionBase {
|
|
|
11
11
|
readonly alpha: number;
|
|
12
12
|
readonly color: number;
|
|
13
13
|
readonly detectionIndex: number;
|
|
14
|
+
/** Semantic mask used only by exact Region renderer coverage. */
|
|
15
|
+
readonly regionCoverageMask?: DetectionMask;
|
|
14
16
|
readonly stroke?: MaskStrokeStyle;
|
|
17
|
+
/** False when this instruction only carries Region coverage. */
|
|
18
|
+
readonly visible?: boolean;
|
|
15
19
|
}
|
|
16
20
|
export type SerializableMaskInstruction = (SerializableRasterInstructionBase & {
|
|
17
21
|
readonly mask: DetectionMask;
|
|
@@ -27,6 +31,8 @@ export type SerializableMaskInstruction = (SerializableRasterInstructionBase & {
|
|
|
27
31
|
export interface MaskFramePreparationJob {
|
|
28
32
|
readonly instructions: readonly SerializableMaskInstruction[];
|
|
29
33
|
readonly key: string;
|
|
34
|
+
/** Widest id raster to cook; absent, the instructions' own resolution. */
|
|
35
|
+
readonly maxRasterWidth?: number;
|
|
30
36
|
}
|
|
31
37
|
export interface MaskPreparationWorkerPrepareMessage {
|
|
32
38
|
readonly job: MaskFramePreparationJob;
|
|
@@ -37,16 +43,20 @@ export interface MaskPreparationWorkerCompleteMessage {
|
|
|
37
43
|
readonly artifactKind?: PreparedMaskFrameKind;
|
|
38
44
|
readonly fillPalette?: Float32Array<ArrayBuffer>;
|
|
39
45
|
readonly hasStroke?: boolean;
|
|
40
|
-
readonly
|
|
46
|
+
readonly height?: number;
|
|
47
|
+
readonly idMaskPlane?: PreparedIdMaskPlane;
|
|
41
48
|
readonly imageBitmap?: ImageBitmap;
|
|
42
49
|
readonly imageData?: ImageData;
|
|
43
50
|
readonly key: string;
|
|
44
51
|
readonly maxStrokeWidth?: number;
|
|
45
|
-
readonly
|
|
52
|
+
readonly raster?: Uint8Array<ArrayBuffer>;
|
|
53
|
+
readonly regionMaskCoverage?: PreparedRegionMaskCoverageFrame;
|
|
46
54
|
readonly requestId: number;
|
|
55
|
+
readonly sourceWidth?: number;
|
|
47
56
|
readonly strokePalette?: Float32Array<ArrayBuffer>;
|
|
48
57
|
readonly strokeWidths?: Float32Array<ArrayBuffer>;
|
|
49
58
|
readonly type: MaskPreparationWorkerMessageType.Complete;
|
|
59
|
+
readonly width?: number;
|
|
50
60
|
}
|
|
51
61
|
export interface MaskPreparationWorkerEmptyMessage {
|
|
52
62
|
readonly key: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-preparation-worker-protocol.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-preparation-worker-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"mask-preparation-worker-protocol.d.ts","sourceRoot":"","sources":["../../src/render-preparation/mask-preparation-worker-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,K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AQ,CAAC,IAAI,EAAE,gCAAgC,CAAC,KAAK,CAAC;CACvD;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,gCAAgC,CAAC,KAAK,CAAC;CACvD;AAED,MAAM,MAAM,4BAA4B,GAAG,mCAAmC,CAAC;AAE/E,MAAM,MAAM,6BAA6B,GACrC,oCAAoC,GACpC,iCAAiC,GACjC,iCAAiC,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { type PreparedRenderTimelineContext } from "#render-preparation/prepared
|
|
|
4
4
|
import { type BufferedDetectionTimeline } from "supervision-js-core";
|
|
5
5
|
import type { DetectionFrame } from "supervision-js-core";
|
|
6
6
|
import type { MaskStyle } from "supervision-js-core";
|
|
7
|
-
import { RenderPreparationArtifactKind, type RenderPreparationOptions, type
|
|
7
|
+
import { RenderPreparationArtifactKind, type RenderPreparationOptions, type ResolvedRenderPreparationGateThresholds } from "#types/render-preparation";
|
|
8
8
|
export interface PreparedRenderFrame {
|
|
9
9
|
readonly detectionFrame: DetectionFrame;
|
|
10
10
|
readonly key: string;
|
|
@@ -19,13 +19,47 @@ export declare enum PreparedRenderFrameMaskStatus {
|
|
|
19
19
|
}
|
|
20
20
|
export interface PreparedRenderWindow {
|
|
21
21
|
getFrame(mediaTime: number): PreparedRenderFrame | undefined;
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Whether this window's artifact for a media time is cooked, scheduling
|
|
24
|
+
* nothing. True when there is nothing to cook: no style, no frame there.
|
|
25
|
+
*/
|
|
26
|
+
isArtifactPrepared(mediaTime: number): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Frames preparation has finished, counted up across the window's life. Read
|
|
29
|
+
* twice, it separates preparation that is slow from preparation that is
|
|
30
|
+
* stuck: the count moves for a cook that lands however far behind the
|
|
31
|
+
* playhead it is, and a cook that lands and is then evicted still counts.
|
|
32
|
+
*/
|
|
33
|
+
getPreparationProgress(): number;
|
|
34
|
+
/**
|
|
35
|
+
* Whether `waitForReady` would wait, answered without scheduling anything.
|
|
36
|
+
* Asked on every playhead move of a source that has to be stopped to be
|
|
37
|
+
* held, where opening a wait that resolves immediately still costs the stop.
|
|
38
|
+
*/
|
|
39
|
+
needsPlaybackGateWait(mediaTime: number, options: ResolvedRenderPreparationGateThresholds): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Resolves once the media time may be presented. `signal` is how a caller
|
|
42
|
+
* that has moved on says so: aborting resolves the wait and drops the hold it
|
|
43
|
+
* was placing on preparation, because a caller that walked away re-checks
|
|
44
|
+
* whatever it does next anyway. Without one, an abandoned wait holds forever.
|
|
45
|
+
*/
|
|
46
|
+
waitForReady(mediaTime: number, options: ResolvedRenderPreparationGateThresholds, signal?: AbortSignal): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the playhead is moving. A window over a resting playhead covers a
|
|
49
|
+
* paused margin instead of the full prefetch span.
|
|
50
|
+
*/
|
|
51
|
+
setPlaybackActive(active: boolean): void;
|
|
23
52
|
setTimelineContext(context: PreparedRenderTimelineContext): void;
|
|
24
53
|
setMaskStyle(maskStyle: MaskStyle | null | undefined): void;
|
|
25
54
|
destroy(): void;
|
|
26
55
|
}
|
|
27
56
|
export type { PreparedMaskFrame } from "./mask-frame-preparer";
|
|
28
57
|
export type { PreparedRenderTimelineContext } from "./prepared-window-timeline";
|
|
58
|
+
/** How many frames ahead of the playhead a prepared window aims to cover. */
|
|
59
|
+
export declare function resolvePreparedWindowFrameCount(options: {
|
|
60
|
+
readonly prefetchFrameCount?: number;
|
|
61
|
+
readonly renderPreparation?: RenderPreparationOptions;
|
|
62
|
+
}): number;
|
|
29
63
|
export declare function createPreparedRenderWindow(options: {
|
|
30
64
|
readonly artifactKind?: RenderPreparationArtifactKind;
|
|
31
65
|
readonly detectionTimeline: BufferedDetectionTimeline;
|
|
@@ -34,6 +68,8 @@ export declare function createPreparedRenderWindow(options: {
|
|
|
34
68
|
readonly onMaskFrameEvicted?: (key: string) => void;
|
|
35
69
|
readonly onMaskFramePrepared?: (maskFrame: PreparedMaskFrame) => void;
|
|
36
70
|
readonly onMaskFramesCleared?: () => void;
|
|
71
|
+
/** Fires whenever what the window covers may have changed. */
|
|
72
|
+
readonly onPreparedWindowChange?: () => void;
|
|
37
73
|
readonly prefetchFrameCount?: number;
|
|
38
74
|
readonly preparedWindowScanIntervalSeconds?: number;
|
|
39
75
|
readonly renderPreparation?: RenderPreparationOptions;
|
|
@@ -42,5 +78,11 @@ export declare function createPreparedRenderWindow(options: {
|
|
|
42
78
|
readonly maskStyle: MaskStyle;
|
|
43
79
|
readonly mediaTime: number;
|
|
44
80
|
}) => readonly SerializableMaskInstruction[];
|
|
81
|
+
/**
|
|
82
|
+
* The widest id raster a cook may produce. A function because the raster is
|
|
83
|
+
* sized against media dimensions the caller only learns once its display
|
|
84
|
+
* exists, which is after this window does.
|
|
85
|
+
*/
|
|
86
|
+
readonly resolveMaxRasterWidth?: () => number | undefined;
|
|
45
87
|
}): PreparedRenderWindow;
|
|
46
88
|
//# sourceMappingURL=prepared-render-window.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepared-render-window.d.ts","sourceRoot":"","sources":["../../src/render-preparation/prepared-render-window.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAGL,6BAA6B,
|
|
1
|
+
{"version":3,"file":"prepared-render-window.d.ts","sourceRoot":"","sources":["../../src/render-preparation/prepared-render-window.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AACxG,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAEL,KAAK,yBAAyB,EAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAGL,6BAA6B,EAI7B,KAAK,wBAAwB,EAC7B,KAAK,uCAAuC,EAC7C,MAAM,2BAA2B,CAAC;AA8BnC,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IACvC,QAAQ,CAAC,UAAU,EAAE,6BAA6B,CAAC;CACpD;AAED,oBAAY,6BAA6B;IACvC,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,QAAQ,aAAa;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAAC;IAC7D;;;OAGG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/C;;;;;OAKG;IACH,sBAAsB,IAAI,MAAM,CAAC;IACjC;;;;OAIG;IACH,qBAAqB,CACnB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,uCAAuC,GAC/C,OAAO,CAAC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,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,iCAAiC,CAAC,EAAE,MAAM,CAAC;IACpD,QAAQ,CAAC,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;IACtD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE;QACvC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;QAC/B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;QAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC5B,KAAK,SAAS,2BAA2B,EAAE,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;CAC3D,GAAG,oBAAoB,CAkyCvB"}
|
|
@@ -4,13 +4,9 @@ export interface PreparedRenderTimelineContext {
|
|
|
4
4
|
readonly loop: boolean;
|
|
5
5
|
}
|
|
6
6
|
export interface PreparedWindowTimeline {
|
|
7
|
-
clear(): void;
|
|
8
7
|
getFrameDistance(frameTime: number, mediaTime: number): number;
|
|
9
|
-
getWindowFrames(bufferedFrames: readonly DetectionFrame[], mediaTime: number): readonly DetectionFrame[];
|
|
10
|
-
rememberFrames(frames: readonly DetectionFrame[], retainedKeys: ReadonlySet<string>): void;
|
|
8
|
+
getWindowFrames(bufferedFrames: readonly DetectionFrame[], mediaTime: number, bufferEndTime: number | null): readonly DetectionFrame[];
|
|
11
9
|
setContext(context: PreparedRenderTimelineContext): void;
|
|
12
10
|
}
|
|
13
|
-
export declare function createPreparedWindowTimeline(
|
|
14
|
-
readonly getFrameKey: (frame: DetectionFrame) => string;
|
|
15
|
-
}): PreparedWindowTimeline;
|
|
11
|
+
export declare function createPreparedWindowTimeline(): PreparedWindowTimeline;
|
|
16
12
|
//# sourceMappingURL=prepared-window-timeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepared-window-timeline.d.ts","sourceRoot":"","sources":["../../src/render-preparation/prepared-window-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,
|
|
1
|
+
{"version":3,"file":"prepared-window-timeline.d.ts","sourceRoot":"","sources":["../../src/render-preparation/prepared-window-timeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/D,eAAe,CACb,cAAc,EAAE,SAAS,cAAc,EAAE,EACzC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GAAG,IAAI,GAC3B,SAAS,cAAc,EAAE,CAAC;IAC7B,UAAU,CAAC,OAAO,EAAE,6BAA6B,GAAG,IAAI,CAAC;CAC1D;AAED,wBAAgB,4BAA4B,IAAI,sBAAsB,CA6ErE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Mesh as PixiMesh, MeshGeometry as PixiMeshGeometry, Shader as PixiShader } from "pixi.js";
|
|
2
|
+
/**
|
|
3
|
+
* A shader built from the GLSL program alone draws nothing under the WebGPU
|
|
4
|
+
* renderer and raises nothing while doing it, so both programs are required of
|
|
5
|
+
* every renderer that builds one and of every renderer that hands the factory
|
|
6
|
+
* on to another.
|
|
7
|
+
*/
|
|
8
|
+
export type InjectedShaderFactory = {
|
|
9
|
+
from(options: {
|
|
10
|
+
gl: {
|
|
11
|
+
fragment: string;
|
|
12
|
+
vertex: string;
|
|
13
|
+
};
|
|
14
|
+
gpu: {
|
|
15
|
+
fragment: {
|
|
16
|
+
entryPoint: string;
|
|
17
|
+
source: string;
|
|
18
|
+
};
|
|
19
|
+
vertex: {
|
|
20
|
+
entryPoint: string;
|
|
21
|
+
source: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
resources: Record<string, unknown>;
|
|
25
|
+
}): PixiShader;
|
|
26
|
+
};
|
|
27
|
+
export type InjectedMeshGeometryConstructor = new (options: {
|
|
28
|
+
indices: Uint32Array;
|
|
29
|
+
positions: Float32Array;
|
|
30
|
+
shrinkBuffersToFit: boolean;
|
|
31
|
+
topology: "triangle-list";
|
|
32
|
+
uvs: Float32Array;
|
|
33
|
+
}) => PixiMeshGeometry;
|
|
34
|
+
export type InjectedMeshConstructor<TMesh extends PixiMesh<PixiMeshGeometry, PixiShader>> = new (options: {
|
|
35
|
+
geometry: PixiMeshGeometry;
|
|
36
|
+
shader: PixiShader;
|
|
37
|
+
}) => TMesh;
|
|
38
|
+
//# sourceMappingURL=injected-pixi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"injected-pixi.d.ts","sourceRoot":"","sources":["../../src/renderers/injected-pixi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,IAAI,QAAQ,EAChB,YAAY,IAAI,gBAAgB,EAChC,MAAM,IAAI,UAAU,EACrB,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,OAAO,EAAE;QACZ,EAAE,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QACzC,GAAG,EAAE;YACH,QAAQ,EAAE;gBAAE,UAAU,EAAE,MAAM,CAAC;gBAAC,MAAM,EAAE,MAAM,CAAA;aAAE,CAAC;YACjD,MAAM,EAAE;gBAAE,UAAU,EAAE,MAAM,CAAC;gBAAC,MAAM,EAAE,MAAM,CAAA;aAAE,CAAC;SAChD,CAAC;QACF,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,UAAU,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,KAAK,OAAO,EAAE;IAC1D,OAAO,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,YAAY,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,EAAE,eAAe,CAAC;IAC1B,GAAG,EAAE,YAAY,CAAC;CACnB,KAAK,gBAAgB,CAAC;AAEvB,MAAM,MAAM,uBAAuB,CACjC,KAAK,SAAS,QAAQ,CAAC,gBAAgB,EAAE,UAAU,CAAC,IAClD,KAAK,OAAO,EAAE;IAAE,QAAQ,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,UAAU,CAAA;CAAE,KAAK,KAAK,CAAC"}
|