supervision 0.1.2 → 0.1.3
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -16
- package/dist/index.js.map +1 -1
- package/dist/mask-preparation.worker.js.map +1 -1
- package/dist/renderers/media-renderer-core.d.ts.map +1 -1
- package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
- package/dist/sessions/media-session.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.d.ts +3 -1
- package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.js +242 -89
- package/node_modules/supervision-js-core/dist/index.js.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/annotation-renderer-presentation.d.ts +9 -0
- package/node_modules/supervision-js-core/dist/styles/annotation-renderer-presentation.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/annotation-renderer-registry.d.ts +40 -0
- package/node_modules/supervision-js-core/dist/styles/annotation-renderer-registry.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts +19 -0
- package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts +10 -2
- package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts +77 -0
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +10 -1
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
- package/package.json +1 -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":"AAcA,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAE1B,MAAM,uBAAuB,CAAC;AAU/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,CAulBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pixi-focus-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-focus-layer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAGtF,OAAO,KAAK,EAAwB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"pixi-focus-layer.d.ts","sourceRoot":"","sources":["../../src/renderers/pixi-focus-layer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAGtF,OAAO,KAAK,EAAwB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAO/D,OAAO,KAAK,EACV,SAAS,IAAI,aAAa,EAC1B,WAAW,IAAI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G,cAAc,CAwVjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-session.d.ts","sourceRoot":"","sources":["../../src/sessions/media-session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-session.d.ts","sourceRoot":"","sources":["../../src/sessions/media-session.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,YAAY,EAIZ,mBAAmB,EAEpB,MAAM,sBAAsB,CAAC;AAkB9B;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,YAAY,CAAC,CA+RvB"}
|
|
@@ -26,7 +26,9 @@ export type { BasePolylineStyleOptions } from "#styles/polyline-style";
|
|
|
26
26
|
export { BaseKeypointStyle } from "#styles/keypoint-style";
|
|
27
27
|
export type { BaseKeypointStyleOptions } from "#styles/keypoint-style";
|
|
28
28
|
export { createDefaultAnnotationPresentation, type DefaultAnnotationPresentationOptions, } from "#styles/default-annotation-presentation";
|
|
29
|
-
export {
|
|
29
|
+
export { annotationRendererKinds, annotationRenderers, type AnnotationRenderer, type AnnotationRendererFactory, type AnnotationRendererKind, type BoxAnnotationRenderer, type KeypointAnnotationRenderer, type LabelAnnotationRenderer, type MaskAnnotationRenderer, type PolygonAnnotationRenderer, type PolylineAnnotationRenderer, } from "#types/annotation-renderer";
|
|
30
|
+
export { resolveAnnotationRendererPresentation } from "#styles/annotation-renderer-presentation";
|
|
31
|
+
export { createSourceAwarePresentation, type PresentationStyleSet, type SourceAwarePresentationOptions, type SourcePresentation, type SourcePresentationEntry, } from "#styles/source-presentation";
|
|
30
32
|
export { resolveStyleValue } from "#styles/style-value";
|
|
31
33
|
export { copySortedDetectionFrames, decodeCompressedRleMask, decodeCompressedRleCounts, detectionFrameOverlapsRange, encodeCompressedRleCounts, filterDetectionFramesForRange, selectDetectionFrame, validateDetectionFrames, type DecodedDetectionMask, } from "#utils/detection-frames";
|
|
32
34
|
export { convertDetectionBoxToMask, convertDetectionBoxToPolygon, convertDetectionMaskToBox, convertDetectionMaskToPolygon, convertDetectionPolygonToBox, convertDetectionPolygonToMask, mergeDetectionMasks, mergeDetectionPolygonsByClass, polygonToRect, rasterizePolygonToMask, rasterizeRectToMask, rectToPolygon, type MediaDimensions, } from "#utils/detection-conversions";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,yCAAyC,GAC1C,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,mCAAmC,EAAE,MAAM,8CAA8C,CAAC;AACnG,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACpC,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,GACpC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,mCAAmC,EAAE,MAAM,+CAA+C,CAAC;AACpG,OAAO,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AAGjG,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,aAAa,GACd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,4BAA4B,EAC5B,oBAAoB,EACpB,eAAe,EACf,oBAAoB,GACrB,MAAM,kCAAkC,CAAC;AAG1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,mBAAmB,EAAE,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B,GACpB,MAAM,cAAc,CAAC"}
|
|
@@ -3444,94 +3444,126 @@ const DEFAULT_LABEL_FONT_FAMILY = "ui-monospace, SFMono-Regular, Menlo, Monaco,
|
|
|
3444
3444
|
* editing, focus, and theme behaviour so consumers can compose those layers.
|
|
3445
3445
|
*/
|
|
3446
3446
|
function createDefaultAnnotationPresentation(options = {}) {
|
|
3447
|
-
const getClassColor = (detection) => resolveDefaultClassColor(detection, options.getClassColor);
|
|
3448
|
-
const shouldRenderBox = (detection) => !(detection.mask ||
|
|
3449
|
-
detection.polygon ||
|
|
3450
|
-
detection.polyline ||
|
|
3451
|
-
detection.keypoints);
|
|
3452
3447
|
return {
|
|
3453
|
-
boxStyle:
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3448
|
+
boxStyle: createDefaultBoxStyle(options),
|
|
3449
|
+
keypointStyle: createDefaultKeypointStyle(options),
|
|
3450
|
+
labelStyle: createDefaultLabelStyle(options),
|
|
3451
|
+
maskStyle: createDefaultMaskStyle(options),
|
|
3452
|
+
polygonStyle: createDefaultPolygonStyle(options),
|
|
3453
|
+
polylineStyle: createDefaultPolylineStyle(options),
|
|
3454
|
+
};
|
|
3455
|
+
}
|
|
3456
|
+
/**
|
|
3457
|
+
* The canonical default style of one built-in layer.
|
|
3458
|
+
*
|
|
3459
|
+
* These exist so a renderer kind can build only the style it needs instead of
|
|
3460
|
+
* the whole default presentation. Keep them equivalent to the matching field of
|
|
3461
|
+
* {@link createDefaultAnnotationPresentation}.
|
|
3462
|
+
*/
|
|
3463
|
+
function createDefaultBoxStyle(options = {}) {
|
|
3464
|
+
const getClassColor = createClassColorResolver(options);
|
|
3465
|
+
return new BaseBoxStyle({
|
|
3466
|
+
cornerRadius: DEFAULT_BOX_CORNER_RADIUS,
|
|
3467
|
+
fill: (detection) => ({
|
|
3468
|
+
alpha: DEFAULT_FILL_ALPHA,
|
|
3469
|
+
color: getClassColor(detection),
|
|
3466
3470
|
}),
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
edgeStroke: (detection) => ({
|
|
3477
|
-
alpha: 1,
|
|
3478
|
-
color: getClassColor(detection),
|
|
3479
|
-
width: DEFAULT_KEYPOINT_EDGE_WIDTH,
|
|
3480
|
-
}),
|
|
3481
|
-
markerFill: (detection) => ({
|
|
3482
|
-
alpha: 1,
|
|
3483
|
-
color: getClassColor(detection),
|
|
3484
|
-
}),
|
|
3485
|
-
markerStroke: { alpha: 1, color: 0xffffff, width: 1 },
|
|
3486
|
-
radius: DEFAULT_KEYPOINT_RADIUS,
|
|
3471
|
+
shape: BoxShape.RoundedRect,
|
|
3472
|
+
shouldRender: (detection) => !(detection.mask ||
|
|
3473
|
+
detection.polygon ||
|
|
3474
|
+
detection.polyline ||
|
|
3475
|
+
detection.keypoints),
|
|
3476
|
+
stroke: (detection) => ({
|
|
3477
|
+
alpha: 1,
|
|
3478
|
+
color: getClassColor(detection),
|
|
3479
|
+
width: DEFAULT_OUTLINE_WIDTH,
|
|
3487
3480
|
}),
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3481
|
+
});
|
|
3482
|
+
}
|
|
3483
|
+
function createDefaultKeypointStyle(options = {}) {
|
|
3484
|
+
const getClassColor = createClassColorResolver(options);
|
|
3485
|
+
return new BaseKeypointStyle({
|
|
3486
|
+
...(options.skeletonDefinitions === undefined
|
|
3487
|
+
? {}
|
|
3488
|
+
: { definitions: options.skeletonDefinitions }),
|
|
3489
|
+
edgeShadowStroke: {
|
|
3490
|
+
alpha: DEFAULT_KEYPOINT_SHADOW_ALPHA,
|
|
3491
|
+
color: 0x000000,
|
|
3492
|
+
width: DEFAULT_KEYPOINT_SHADOW_WIDTH,
|
|
3493
|
+
},
|
|
3494
|
+
edgeStroke: (detection) => ({
|
|
3495
|
+
alpha: 1,
|
|
3496
|
+
color: getClassColor(detection),
|
|
3497
|
+
width: DEFAULT_KEYPOINT_EDGE_WIDTH,
|
|
3498
|
+
}),
|
|
3499
|
+
markerFill: (detection) => ({
|
|
3500
|
+
alpha: 1,
|
|
3501
|
+
color: getClassColor(detection),
|
|
3502
|
+
}),
|
|
3503
|
+
markerStroke: { alpha: 1, color: 0xffffff, width: 1 },
|
|
3504
|
+
radius: DEFAULT_KEYPOINT_RADIUS,
|
|
3505
|
+
});
|
|
3506
|
+
}
|
|
3507
|
+
function createDefaultLabelStyle(options = {}) {
|
|
3508
|
+
const getClassColor = createClassColorResolver(options);
|
|
3509
|
+
return new BaseLabelStyle({
|
|
3510
|
+
background: (detection) => ({
|
|
3511
|
+
alpha: 1,
|
|
3512
|
+
color: getClassColor(detection),
|
|
3513
|
+
cornerRadius: DEFAULT_LABEL_CORNER_RADIUS,
|
|
3514
|
+
paddingX: DEFAULT_LABEL_PADDING_X,
|
|
3515
|
+
paddingY: DEFAULT_LABEL_PADDING_Y,
|
|
3516
|
+
topCornersOnly: true,
|
|
3504
3517
|
}),
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3518
|
+
includeConfidence: options.includeConfidence,
|
|
3519
|
+
placement: LabelPlacement.Top,
|
|
3520
|
+
textStyle: {
|
|
3521
|
+
fontFamily: DEFAULT_LABEL_FONT_FAMILY,
|
|
3522
|
+
fontSize: DEFAULT_LABEL_FONT_SIZE,
|
|
3523
|
+
fontWeight: "600",
|
|
3524
|
+
},
|
|
3525
|
+
});
|
|
3526
|
+
}
|
|
3527
|
+
function createDefaultMaskStyle(options = {}) {
|
|
3528
|
+
const getClassColor = createClassColorResolver(options);
|
|
3529
|
+
return new BaseMaskStyle({
|
|
3530
|
+
color: (detection) => getClassColor(detection),
|
|
3531
|
+
fillAlpha: DEFAULT_MASK_FILL_ALPHA,
|
|
3532
|
+
mode: MaskRenderMode.FillAndStroke,
|
|
3533
|
+
opacity: 1,
|
|
3534
|
+
stroke: (detection) => ({
|
|
3535
|
+
alpha: 1,
|
|
3536
|
+
color: getClassColor(detection),
|
|
3537
|
+
width: DEFAULT_OUTLINE_WIDTH,
|
|
3515
3538
|
}),
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
width: DEFAULT_OUTLINE_WIDTH,
|
|
3525
|
-
}),
|
|
3539
|
+
});
|
|
3540
|
+
}
|
|
3541
|
+
function createDefaultPolygonStyle(options = {}) {
|
|
3542
|
+
const getClassColor = createClassColorResolver(options);
|
|
3543
|
+
return new BasePolygonStyle({
|
|
3544
|
+
fill: (detection) => ({
|
|
3545
|
+
alpha: DEFAULT_FILL_ALPHA,
|
|
3546
|
+
color: getClassColor(detection),
|
|
3526
3547
|
}),
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
width: DEFAULT_OUTLINE_WIDTH,
|
|
3532
|
-
}),
|
|
3548
|
+
stroke: (detection) => ({
|
|
3549
|
+
alpha: 1,
|
|
3550
|
+
color: getClassColor(detection),
|
|
3551
|
+
width: DEFAULT_OUTLINE_WIDTH,
|
|
3533
3552
|
}),
|
|
3534
|
-
};
|
|
3553
|
+
});
|
|
3554
|
+
}
|
|
3555
|
+
function createDefaultPolylineStyle(options = {}) {
|
|
3556
|
+
const getClassColor = createClassColorResolver(options);
|
|
3557
|
+
return new BasePolylineStyle({
|
|
3558
|
+
stroke: (detection) => ({
|
|
3559
|
+
alpha: 1,
|
|
3560
|
+
color: getClassColor(detection),
|
|
3561
|
+
width: DEFAULT_OUTLINE_WIDTH,
|
|
3562
|
+
}),
|
|
3563
|
+
});
|
|
3564
|
+
}
|
|
3565
|
+
function createClassColorResolver(options) {
|
|
3566
|
+
return (detection) => resolveDefaultClassColor(detection, options.getClassColor);
|
|
3535
3567
|
}
|
|
3536
3568
|
function resolveDefaultClassColor(detection, getClassColor) {
|
|
3537
3569
|
const color = getClassColor?.(detection.className);
|
|
@@ -3540,29 +3572,150 @@ function resolveDefaultClassColor(detection, getClassColor) {
|
|
|
3540
3572
|
: resolveDetectionClassColorStyle(detection.className).fill;
|
|
3541
3573
|
}
|
|
3542
3574
|
|
|
3543
|
-
|
|
3575
|
+
/**
|
|
3576
|
+
* The built-in annotation renderer vocabulary.
|
|
3577
|
+
*
|
|
3578
|
+
* These stay plain string literals so `{ kind: "box" }` remains assignable to
|
|
3579
|
+
* the public descriptor union from JavaScript and TypeScript alike.
|
|
3580
|
+
*/
|
|
3581
|
+
const annotationRendererKinds = [
|
|
3582
|
+
"box",
|
|
3583
|
+
"keypoints",
|
|
3584
|
+
"label",
|
|
3585
|
+
"mask",
|
|
3586
|
+
"polygon",
|
|
3587
|
+
"polyline",
|
|
3588
|
+
];
|
|
3589
|
+
/**
|
|
3590
|
+
* Creates built-in annotation renderer descriptors for
|
|
3591
|
+
* `MediaRendererPresentation.renderers`.
|
|
3592
|
+
*
|
|
3593
|
+
* The currently supported renderers retain their established scene ordering:
|
|
3594
|
+
* masks, polygons, vectors, labels. A later renderer kind may add a new
|
|
3595
|
+
* composition capability without changing that ordering for existing scenes.
|
|
3596
|
+
*/
|
|
3597
|
+
const annotationRenderers = {
|
|
3598
|
+
box: (options) => createAnnotationRenderer("box", options),
|
|
3599
|
+
keypoints: (options) => createAnnotationRenderer("keypoints", options),
|
|
3600
|
+
label: (options) => createAnnotationRenderer("label", options),
|
|
3601
|
+
mask: (options) => createAnnotationRenderer("mask", options),
|
|
3602
|
+
polygon: (options) => createAnnotationRenderer("polygon", options),
|
|
3603
|
+
polyline: (options) => createAnnotationRenderer("polyline", options),
|
|
3604
|
+
};
|
|
3605
|
+
function createAnnotationRenderer(kind, options) {
|
|
3606
|
+
// Every built-in renderer keeps its kind as its stable id. TypeScript cannot
|
|
3607
|
+
// narrow the descriptor union through the generic kind parameter, so the
|
|
3608
|
+
// descriptor shape is asserted here and covered by a focused test.
|
|
3609
|
+
return { id: kind, kind, ...options };
|
|
3610
|
+
}
|
|
3611
|
+
|
|
3612
|
+
const annotationRendererRegistry = {
|
|
3613
|
+
box: { createCanonicalStyle: createDefaultBoxStyle, styleField: "boxStyle" },
|
|
3614
|
+
keypoints: {
|
|
3615
|
+
createCanonicalStyle: createDefaultKeypointStyle,
|
|
3616
|
+
styleField: "keypointStyle",
|
|
3617
|
+
},
|
|
3618
|
+
label: {
|
|
3619
|
+
createCanonicalStyle: createDefaultLabelStyle,
|
|
3620
|
+
styleField: "labelStyle",
|
|
3621
|
+
},
|
|
3622
|
+
mask: {
|
|
3623
|
+
createCanonicalStyle: createDefaultMaskStyle,
|
|
3624
|
+
styleField: "maskStyle",
|
|
3625
|
+
},
|
|
3626
|
+
polygon: {
|
|
3627
|
+
createCanonicalStyle: createDefaultPolygonStyle,
|
|
3628
|
+
styleField: "polygonStyle",
|
|
3629
|
+
},
|
|
3630
|
+
polyline: {
|
|
3631
|
+
createCanonicalStyle: createDefaultPolylineStyle,
|
|
3632
|
+
styleField: "polylineStyle",
|
|
3633
|
+
},
|
|
3634
|
+
};
|
|
3635
|
+
/** Presentation fields owned by the given renderer kinds, in the same order. */
|
|
3636
|
+
function resolveAnnotationRendererStyleFields(kinds) {
|
|
3637
|
+
return kinds.map((kind) => annotationRendererRegistry[kind].styleField);
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
/**
|
|
3641
|
+
* Resolves built-in renderer descriptors into the existing specialized style
|
|
3642
|
+
* fields. The browser backend deliberately keeps ownership of its box, mask,
|
|
3643
|
+
* label, polygon, polyline, and keypoint pipelines; this normalizer only
|
|
3644
|
+
* supplies those pipelines with their configured style.
|
|
3645
|
+
*/
|
|
3646
|
+
function resolveAnnotationRendererPresentation(presentation) {
|
|
3647
|
+
const renderers = presentation.renderers;
|
|
3648
|
+
if (renderers === undefined) {
|
|
3649
|
+
return presentation;
|
|
3650
|
+
}
|
|
3651
|
+
const resolved = {
|
|
3652
|
+
boxStyle: null,
|
|
3653
|
+
keypointStyle: null,
|
|
3654
|
+
labelStyle: null,
|
|
3655
|
+
maskStyle: null,
|
|
3656
|
+
polygonStyle: null,
|
|
3657
|
+
polylineStyle: null,
|
|
3658
|
+
};
|
|
3659
|
+
const rendererIds = new Set();
|
|
3660
|
+
const rendererKinds = new Set();
|
|
3661
|
+
for (const renderer of renderers) {
|
|
3662
|
+
if (rendererIds.has(renderer.id)) {
|
|
3663
|
+
throw new RangeError(`MediaRendererPresentation.renderers contains duplicate renderer id "${renderer.id}".`);
|
|
3664
|
+
}
|
|
3665
|
+
rendererIds.add(renderer.id);
|
|
3666
|
+
if (rendererKinds.has(renderer.kind)) {
|
|
3667
|
+
throw new RangeError(`MediaRendererPresentation.renderers contains duplicate renderer kind "${renderer.kind}".`);
|
|
3668
|
+
}
|
|
3669
|
+
rendererKinds.add(renderer.kind);
|
|
3670
|
+
applyRendererStyle(resolved, presentation, renderer);
|
|
3671
|
+
}
|
|
3672
|
+
return {
|
|
3673
|
+
...presentation,
|
|
3674
|
+
...resolved,
|
|
3675
|
+
};
|
|
3676
|
+
}
|
|
3677
|
+
function applyRendererStyle(resolved, configured, renderer) {
|
|
3678
|
+
const { createCanonicalStyle, styleField } = annotationRendererRegistry[renderer.kind];
|
|
3679
|
+
const configuredStyle = configured[styleField];
|
|
3680
|
+
const style = renderer.style !== undefined
|
|
3681
|
+
? renderer.style
|
|
3682
|
+
: configuredStyle !== undefined
|
|
3683
|
+
? configuredStyle
|
|
3684
|
+
: createCanonicalStyle();
|
|
3685
|
+
// The registry pairs each kind with the presentation field holding the same
|
|
3686
|
+
// style contract, but TypeScript cannot correlate that pairing across a
|
|
3687
|
+
// lookup on a union, so the write is asserted once here.
|
|
3688
|
+
resolved[styleField] = style;
|
|
3689
|
+
}
|
|
3690
|
+
|
|
3691
|
+
function createSourceAwarePresentation(globalPresentation = {}, sources, options = {}) {
|
|
3544
3692
|
if (!sources.some((source) => source.presentation !== undefined)) {
|
|
3545
3693
|
return globalPresentation;
|
|
3546
3694
|
}
|
|
3547
3695
|
const sourcePresentations = new Map(sources.map((source) => [source.id, source.presentation]));
|
|
3696
|
+
const enabledStyleFields = options.enabledRendererKinds === undefined
|
|
3697
|
+
? undefined
|
|
3698
|
+
: new Set(resolveAnnotationRendererStyleFields(options.enabledRendererKinds));
|
|
3699
|
+
const shouldApplySourceStyle = (style) => hasSourceStyle(sources, style) &&
|
|
3700
|
+
(enabledStyleFields === undefined || enabledStyleFields.has(style));
|
|
3548
3701
|
return {
|
|
3549
3702
|
...globalPresentation,
|
|
3550
|
-
boxStyle:
|
|
3703
|
+
boxStyle: shouldApplySourceStyle("boxStyle")
|
|
3551
3704
|
? new SourceAwareBoxStyle(normalizeGlobalBoxStyle(globalPresentation.boxStyle), sourcePresentations)
|
|
3552
3705
|
: globalPresentation.boxStyle,
|
|
3553
|
-
labelStyle:
|
|
3706
|
+
labelStyle: shouldApplySourceStyle("labelStyle")
|
|
3554
3707
|
? new SourceAwareLabelStyle(normalizeGlobalLabelStyle(globalPresentation.labelStyle), sourcePresentations)
|
|
3555
3708
|
: globalPresentation.labelStyle,
|
|
3556
|
-
maskStyle:
|
|
3709
|
+
maskStyle: shouldApplySourceStyle("maskStyle")
|
|
3557
3710
|
? new SourceAwareMaskStyle(normalizeGlobalMaskStyle(globalPresentation.maskStyle), sourcePresentations)
|
|
3558
3711
|
: globalPresentation.maskStyle,
|
|
3559
|
-
polygonStyle:
|
|
3712
|
+
polygonStyle: shouldApplySourceStyle("polygonStyle")
|
|
3560
3713
|
? new SourceAwarePolygonStyle(normalizeGlobalPolygonStyle(globalPresentation.polygonStyle), sourcePresentations)
|
|
3561
3714
|
: globalPresentation.polygonStyle,
|
|
3562
|
-
polylineStyle:
|
|
3715
|
+
polylineStyle: shouldApplySourceStyle("polylineStyle")
|
|
3563
3716
|
? new SourceAwarePolylineStyle(normalizeGlobalPolylineStyle(globalPresentation.polylineStyle), sourcePresentations)
|
|
3564
3717
|
: globalPresentation.polylineStyle,
|
|
3565
|
-
keypointStyle:
|
|
3718
|
+
keypointStyle: shouldApplySourceStyle("keypointStyle")
|
|
3566
3719
|
? new SourceAwareKeypointStyle(normalizeGlobalKeypointStyle(globalPresentation.keypointStyle), sourcePresentations)
|
|
3567
3720
|
: globalPresentation.keypointStyle,
|
|
3568
3721
|
};
|
|
@@ -4273,5 +4426,5 @@ var MediaSessionActivityStatus;
|
|
|
4273
4426
|
MediaSessionActivityStatus["Waiting"] = "waiting";
|
|
4274
4427
|
})(MediaSessionActivityStatus || (MediaSessionActivityStatus = {}));
|
|
4275
4428
|
|
|
4276
|
-
export { AnnotationFrameMutationKind, AnnotationGeometryKind, AnnotationGestureStateKind, AnnotationHandleKind, BaseBoxStyle, BaseFocusStyle, BaseInteractionStyle, BaseKeypointStyle, BaseLabelStyle, BaseMaskStyle, BasePolygonStyle, BasePolylineStyle, BoxShape, BoxStrokeAlignment, DEFAULT_DETECTION_CLASS_STYLES, DEFAULT_DETECTION_COLOR_SEQUENCE, DetectionBufferStatus, DetectionFrameRetentionMode, DetectionFrameSelectionMode, DetectionInteractionState, DetectionMaskEncoding, DetectionMaskPayloadFormat, DetectionPickTarget, FocusTargetMode, KeypointMarkerShape, KeypointVisibility, LabelPlacement, LabelVisibilityMode, MAX_ID_MASK_PALETTE_ENTRIES, MAX_ID_MASK_STROKE_WIDTH, MaskRenderMode, MediaInteractionMode, MediaRendererFit, MediaRendererPlaybackState, MediaSessionActivityKind, MediaSessionActivityStatus, MediaSessionMode, MediaSessionStatus, MediaSourceStatus, SUPERVISION_ROBOFLOW_COLOR, applyAnnotationHandleDrag, canReuseMaskStyleArtifacts, centerRectToTopLeftRect, computeDetectionMaskRect, computeMaskBounds, containsPoint, convertDetectionBoxToMask, convertDetectionBoxToPolygon, convertDetectionMaskToBox, convertDetectionMaskToPolygon, convertDetectionPolygonToBox, convertDetectionPolygonToMask, copySortedDetectionFrames, createAnnotationEditingEngine, createArrayDetectionFrameSource, createBufferedDetectionTimeline, createColdDetectionFrameSource, createCompositeDetectionFrameSource, createDefaultAnnotationPresentation, createDetectionPickKey, createEditableAnnotationFrameSession, createIdMaskFrame, createIdleDetectionBufferState, createMemoryColdDetectionFrameStore, createSourceAwarePresentation, createViewportController, createWritableDetectionFrameSource, decodeCompressedRleCounts, decodeCompressedRleMask, decodeDetectionMaskPayload, deleteAnnotationVertex, detectMaskBorders, detectionFrameOverlapsRange, distanceToSegment, encodeBinaryMask, encodeBinaryMaskWithBounds, encodeCompressedRleCounts, encodeDetectionMaskPayload, extractMaskContour, extractMaskRectRuns, filterDetectionFramesForRange, findClosestAnnotationSegment, getAnnotationHandles, getBufferedDetectionTimelineFrameSnapshot, getDetectionRect, getPointsRect, includeDefined, isDeflatedBase64DetectionMaskPayload, lightenColor, mediaToScreen, mergeDetectionMasks, mergeDetectionPolygonsByClass, normalizeDetectionClassName, offsetDetection, pickAnnotationHandle, pickDetectionAtPoint, pickDetectionByMaskId, pointInPolygon, polygonArea, polygonToRect, rasterizePolygonToMask, rasterizeRectToMask, rebaseDetectionPickToFrame, rectArea, rectToPolygon, resolveAnnotationStyleState, resolveContrastTextColor, resolveDetectionClassColorStyle, resolveMaskStyleOpacity, resolveStyleValue, screenToMedia, selectDetectionFrame, topLeftRectToCenterRect, validateDetectionFrames };
|
|
4429
|
+
export { AnnotationFrameMutationKind, AnnotationGeometryKind, AnnotationGestureStateKind, AnnotationHandleKind, BaseBoxStyle, BaseFocusStyle, BaseInteractionStyle, BaseKeypointStyle, BaseLabelStyle, BaseMaskStyle, BasePolygonStyle, BasePolylineStyle, BoxShape, BoxStrokeAlignment, DEFAULT_DETECTION_CLASS_STYLES, DEFAULT_DETECTION_COLOR_SEQUENCE, DetectionBufferStatus, DetectionFrameRetentionMode, DetectionFrameSelectionMode, DetectionInteractionState, DetectionMaskEncoding, DetectionMaskPayloadFormat, DetectionPickTarget, FocusTargetMode, KeypointMarkerShape, KeypointVisibility, LabelPlacement, LabelVisibilityMode, MAX_ID_MASK_PALETTE_ENTRIES, MAX_ID_MASK_STROKE_WIDTH, MaskRenderMode, MediaInteractionMode, MediaRendererFit, MediaRendererPlaybackState, MediaSessionActivityKind, MediaSessionActivityStatus, MediaSessionMode, MediaSessionStatus, MediaSourceStatus, SUPERVISION_ROBOFLOW_COLOR, annotationRendererKinds, annotationRenderers, applyAnnotationHandleDrag, canReuseMaskStyleArtifacts, centerRectToTopLeftRect, computeDetectionMaskRect, computeMaskBounds, containsPoint, convertDetectionBoxToMask, convertDetectionBoxToPolygon, convertDetectionMaskToBox, convertDetectionMaskToPolygon, convertDetectionPolygonToBox, convertDetectionPolygonToMask, copySortedDetectionFrames, createAnnotationEditingEngine, createArrayDetectionFrameSource, createBufferedDetectionTimeline, createColdDetectionFrameSource, createCompositeDetectionFrameSource, createDefaultAnnotationPresentation, createDetectionPickKey, createEditableAnnotationFrameSession, createIdMaskFrame, createIdleDetectionBufferState, createMemoryColdDetectionFrameStore, createSourceAwarePresentation, createViewportController, createWritableDetectionFrameSource, decodeCompressedRleCounts, decodeCompressedRleMask, decodeDetectionMaskPayload, deleteAnnotationVertex, detectMaskBorders, detectionFrameOverlapsRange, distanceToSegment, encodeBinaryMask, encodeBinaryMaskWithBounds, encodeCompressedRleCounts, encodeDetectionMaskPayload, extractMaskContour, extractMaskRectRuns, filterDetectionFramesForRange, findClosestAnnotationSegment, getAnnotationHandles, getBufferedDetectionTimelineFrameSnapshot, getDetectionRect, getPointsRect, includeDefined, isDeflatedBase64DetectionMaskPayload, lightenColor, mediaToScreen, mergeDetectionMasks, mergeDetectionPolygonsByClass, normalizeDetectionClassName, offsetDetection, pickAnnotationHandle, pickDetectionAtPoint, pickDetectionByMaskId, pointInPolygon, polygonArea, polygonToRect, rasterizePolygonToMask, rasterizeRectToMask, rebaseDetectionPickToFrame, rectArea, rectToPolygon, resolveAnnotationRendererPresentation, resolveAnnotationStyleState, resolveContrastTextColor, resolveDetectionClassColorStyle, resolveMaskStyleOpacity, resolveStyleValue, screenToMedia, selectDetectionFrame, topLeftRectToCenterRect, validateDetectionFrames };
|
|
4277
4430
|
//# sourceMappingURL=index.js.map
|