supervision 0.1.2 → 0.1.4
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 +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1232 -107
- package/dist/index.js.map +1 -1
- package/dist/mask-preparation.worker.js +43 -9
- package/dist/mask-preparation.worker.js.map +1 -1
- package/dist/render-preparation/mask-frame-artifact.d.ts +6 -0
- package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
- package/dist/render-preparation/mask-frame-compositor.d.ts +1 -0
- 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-protocol.d.ts +1 -0
- package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
- package/dist/renderers/annotation-shape-styles.d.ts +17 -0
- package/dist/renderers/annotation-shape-styles.d.ts.map +1 -0
- package/dist/renderers/media-renderer-core.d.ts.map +1 -1
- package/dist/renderers/media-renderer-scene.d.ts +17 -2
- package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
- package/dist/renderers/pixi-annotation-overlay-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-focus-layer.d.ts +1 -0
- package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-layer.d.ts +2 -0
- package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts +2 -1
- package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-mask-halo.d.ts +94 -0
- package/dist/renderers/pixi-mask-halo.d.ts.map +1 -0
- package/dist/renderers/pixi-mask-layer.d.ts +10 -1
- package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
- package/dist/renderers/pixi-path.d.ts +13 -7
- package/dist/renderers/pixi-path.d.ts.map +1 -1
- package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
- package/dist/renderers/pixi-region-layer.d.ts +42 -0
- package/dist/renderers/pixi-region-layer.d.ts.map +1 -0
- package/dist/renderers/pixi-scene-layer-slot.d.ts +1 -0
- package/dist/renderers/pixi-scene-layer-slot.d.ts.map +1 -1
- package/dist/renderers/pixi-vector-layer.d.ts +3 -1
- package/dist/renderers/pixi-vector-layer.d.ts.map +1 -1
- package/dist/sessions/media-session.d.ts.map +1 -1
- package/dist/types/media-renderer.d.ts +1 -1
- package/dist/types/media-renderer.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.d.ts +19 -3
- package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/index.js +944 -157
- package/node_modules/supervision-js-core/dist/index.js.map +1 -1
- package/node_modules/supervision-js-core/dist/interactions/detection-picker.d.ts +18 -0
- package/node_modules/supervision-js-core/dist/interactions/detection-picker.d.ts.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 +47 -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/box-corner-style.d.ts +14 -0
- package/node_modules/supervision-js-core/dist/styles/box-corner-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/box-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts +38 -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/interaction-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/keypoint-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/marker-style.d.ts +14 -0
- package/node_modules/supervision-js-core/dist/styles/marker-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/styles/polygon-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts +18 -2
- package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/styles/stroke-style.d.ts +12 -0
- package/node_modules/supervision-js-core/dist/styles/stroke-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts +197 -0
- package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/box-corner-style.d.ts +31 -0
- package/node_modules/supervision-js-core/dist/types/box-corner-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/box-style.d.ts +4 -17
- package/node_modules/supervision-js-core/dist/types/box-style.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/ellipse-style.d.ts +30 -0
- package/node_modules/supervision-js-core/dist/types/ellipse-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/interaction.d.ts +12 -0
- package/node_modules/supervision-js-core/dist/types/interaction.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/marker-style.d.ts +46 -0
- package/node_modules/supervision-js-core/dist/types/marker-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/mask-halo-style.d.ts +29 -0
- package/node_modules/supervision-js-core/dist/types/mask-halo-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +26 -1
- package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
- package/node_modules/supervision-js-core/dist/types/paint-style.d.ts +36 -0
- package/node_modules/supervision-js-core/dist/types/paint-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/types/shape-style.d.ts +112 -0
- package/node_modules/supervision-js-core/dist/types/shape-style.d.ts.map +1 -0
- package/node_modules/supervision-js-core/dist/utils/shape-geometry.d.ts +50 -0
- package/node_modules/supervision-js-core/dist/utils/shape-geometry.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -2,6 +2,24 @@ import { type DetectionFrame } from "#types/detections";
|
|
|
2
2
|
import { type DetectionPickOptions, type DetectionPickPoint, type DetectionPickResult } from "#types/interaction";
|
|
3
3
|
export declare function pickDetectionAtPoint(frame: DetectionFrame | undefined, point: DetectionPickPoint, options?: DetectionPickOptions): DetectionPickResult | null;
|
|
4
4
|
export declare function createDetectionPickKey(pick: DetectionPickResult | null): string | null;
|
|
5
|
+
/**
|
|
6
|
+
* Compares the frame-independent membership of two ordered selections.
|
|
7
|
+
*
|
|
8
|
+
* Detection ids retain their runtime type, so numeric `1` and string `"1"`
|
|
9
|
+
* remain distinct identities. Anonymous detections keep their frame-local
|
|
10
|
+
* index identity.
|
|
11
|
+
*/
|
|
12
|
+
export declare function haveSameDetectionPickIdentities(current: readonly DetectionPickResult[], next: readonly DetectionPickResult[]): boolean;
|
|
5
13
|
export declare function rebaseDetectionPickToFrame(pick: DetectionPickResult | null, frame: DetectionFrame | undefined): DetectionPickResult | null;
|
|
14
|
+
/**
|
|
15
|
+
* Carries a pick forward onto a different frame of the same timeline.
|
|
16
|
+
*
|
|
17
|
+
* Same-frame rebases behave exactly like `rebaseDetectionPickToFrame`. Across
|
|
18
|
+
* frames, the pick follows its detection only when the detection id is defined
|
|
19
|
+
* and unique in both frames, so anonymous and duplicate-id detections keep the
|
|
20
|
+
* per-frame lifetime they have today. Returns `null` when the detection has no
|
|
21
|
+
* followable identity or has left the frame.
|
|
22
|
+
*/
|
|
23
|
+
export declare function followDetectionPickAcrossFrames(pick: DetectionPickResult | null, frame: DetectionFrame | undefined): DetectionPickResult | null;
|
|
6
24
|
export declare function pickDetectionByMaskId(frame: DetectionFrame | undefined, maskId: number, point: DetectionPickPoint): DetectionPickResult | null;
|
|
7
25
|
//# sourceMappingURL=detection-picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detection-picker.d.ts","sourceRoot":"","sources":["../../src/interactions/detection-picker.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AA2B5B,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,cAAc,GAAG,SAAS,EACjC,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,GAAG,IAAI,CA6K5B;AA8CD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,iBActE;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,mBAAmB,GAAG,IAAI,EAChC,KAAK,EAAE,cAAc,GAAG,SAAS,GAChC,mBAAmB,GAAG,IAAI,CA+B5B;
|
|
1
|
+
{"version":3,"file":"detection-picker.d.ts","sourceRoot":"","sources":["../../src/interactions/detection-picker.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,oBAAoB,CAAC;AA2B5B,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,cAAc,GAAG,SAAS,EACjC,KAAK,EAAE,kBAAkB,EACzB,OAAO,GAAE,oBAAyB,GACjC,mBAAmB,GAAG,IAAI,CA6K5B;AA8CD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,mBAAmB,GAAG,IAAI,iBActE;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,SAAS,mBAAmB,EAAE,EACvC,IAAI,EAAE,SAAS,mBAAmB,EAAE,WAmBrC;AAED,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,mBAAmB,GAAG,IAAI,EAChC,KAAK,EAAE,cAAc,GAAG,SAAS,GAChC,mBAAmB,GAAG,IAAI,CA+B5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,mBAAmB,GAAG,IAAI,EAChC,KAAK,EAAE,cAAc,GAAG,SAAS,GAChC,mBAAmB,GAAG,IAAI,CAmC5B;AA8BD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,cAAc,GAAG,SAAS,EACjC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,kBAAkB,GACxB,mBAAmB,GAAG,IAAI,CAoB5B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MediaRendererPresentation } from "#types/media-rendering";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves built-in renderer descriptors into the existing specialized style
|
|
4
|
+
* fields. The browser backend deliberately keeps ownership of its box, mask,
|
|
5
|
+
* label, polygon, polyline, and keypoint pipelines; this normalizer only
|
|
6
|
+
* supplies those pipelines with their configured style.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveAnnotationRendererPresentation(presentation: MediaRendererPresentation): MediaRendererPresentation;
|
|
9
|
+
//# sourceMappingURL=annotation-renderer-presentation.d.ts.map
|
package/node_modules/supervision-js-core/dist/styles/annotation-renderer-presentation.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-renderer-presentation.d.ts","sourceRoot":"","sources":["../../src/styles/annotation-renderer-presentation.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACnD,YAAY,EAAE,yBAAyB,GACtC,yBAAyB,CA+C3B"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { AnnotationRendererKind, AnnotationRendererOfKind } from "#types/annotation-renderer";
|
|
2
|
+
import type { MediaRendererPresentation } from "#types/media-rendering";
|
|
3
|
+
/** The style contract configured by one renderer kind. */
|
|
4
|
+
export declare const styledAnnotationRendererKinds: readonly ["box", "box-corners", "ellipse", "keypoints", "label", "mask", "maskHalo", "marker", "polygon", "polyline"];
|
|
5
|
+
export type StyledAnnotationRendererKind = (typeof styledAnnotationRendererKinds)[number];
|
|
6
|
+
export type AnnotationRendererStyle<TKind extends StyledAnnotationRendererKind> = NonNullable<AnnotationRendererOfKind<TKind>["style"]>;
|
|
7
|
+
/**
|
|
8
|
+
* The presentation field that carries a renderer kind's style.
|
|
9
|
+
*
|
|
10
|
+
* The pairing is derived from the style contracts themselves, so a registry
|
|
11
|
+
* entry that points a kind at the wrong presentation field does not compile.
|
|
12
|
+
*/
|
|
13
|
+
export type AnnotationRendererStyleFieldFor<TKind extends StyledAnnotationRendererKind> = {
|
|
14
|
+
[TField in keyof MediaRendererPresentation]-?: AnnotationRendererStyle<TKind> extends NonNullable<MediaRendererPresentation[TField]> ? NonNullable<MediaRendererPresentation[TField]> extends AnnotationRendererStyle<TKind> ? TField : never : never;
|
|
15
|
+
}[keyof MediaRendererPresentation];
|
|
16
|
+
/** Every presentation field owned by a built-in renderer kind. */
|
|
17
|
+
export type AnnotationRendererStyleField = {
|
|
18
|
+
[TKind in StyledAnnotationRendererKind]: AnnotationRendererStyleFieldFor<TKind>;
|
|
19
|
+
}[StyledAnnotationRendererKind];
|
|
20
|
+
export interface AnnotationRendererKindMetadata<TKind extends StyledAnnotationRendererKind> {
|
|
21
|
+
readonly cardinality: "singleton";
|
|
22
|
+
/** Presentation field this kind reads its configured style from. */
|
|
23
|
+
readonly styleField: AnnotationRendererStyleFieldFor<TKind>;
|
|
24
|
+
/**
|
|
25
|
+
* Builds this kind's canonical default style on demand, so resolving one
|
|
26
|
+
* listed renderer never constructs the styles of the other kinds.
|
|
27
|
+
*/
|
|
28
|
+
readonly createCanonicalStyle: () => AnnotationRendererStyle<TKind>;
|
|
29
|
+
}
|
|
30
|
+
export interface DirectAnnotationRendererKindMetadata {
|
|
31
|
+
readonly cardinality: "multiple";
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The single source of built-in renderer presentation metadata.
|
|
35
|
+
*
|
|
36
|
+
* Adding a kind to {@link annotationRendererKinds} without a complete entry
|
|
37
|
+
* here is a compile error, and every consumer of renderer metadata reads this
|
|
38
|
+
* registry instead of repeating the kind-to-style mapping.
|
|
39
|
+
*/
|
|
40
|
+
export type AnnotationRendererRegistry = {
|
|
41
|
+
readonly [TKind in AnnotationRendererKind]: TKind extends StyledAnnotationRendererKind ? AnnotationRendererKindMetadata<TKind> : DirectAnnotationRendererKindMetadata;
|
|
42
|
+
};
|
|
43
|
+
export declare const annotationRendererRegistry: AnnotationRendererRegistry;
|
|
44
|
+
export declare function isStyleBackedAnnotationRendererKind(kind: AnnotationRendererKind): kind is StyledAnnotationRendererKind;
|
|
45
|
+
/** Presentation fields owned by the given renderer kinds, in the same order. */
|
|
46
|
+
export declare function resolveAnnotationRendererStyleFields(kinds: readonly AnnotationRendererKind[]): readonly AnnotationRendererStyleField[];
|
|
47
|
+
//# sourceMappingURL=annotation-renderer-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-renderer-registry.d.ts","sourceRoot":"","sources":["../../src/styles/annotation-renderer-registry.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAExE,0DAA0D;AAC1D,eAAO,MAAM,6BAA6B,uHAWhC,CAAC;AAEX,MAAM,MAAM,4BAA4B,GACtC,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,uBAAuB,CACjC,KAAK,SAAS,4BAA4B,IACxC,WAAW,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAA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SAAS,4BAA4B,EAAE,CAKzC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Detection } from "#types/detections";
|
|
2
|
+
import type { BaseBoxCornerStyleOptions, BoxCornerDrawInstruction, BoxCornerStyle, BoxCornerStyleContext } from "#types/box-corner-style";
|
|
3
|
+
/**
|
|
4
|
+
* Configurable four-corner decoration derived from a detection rectangle.
|
|
5
|
+
*
|
|
6
|
+
* This is the BoxCornerAnnotator-style facade: it keeps the rectangle semantic
|
|
7
|
+
* and draws only its four open corner segments.
|
|
8
|
+
*/
|
|
9
|
+
export declare class BaseBoxCornerStyle implements BoxCornerStyle {
|
|
10
|
+
protected readonly options: BaseBoxCornerStyleOptions;
|
|
11
|
+
constructor(options?: BaseBoxCornerStyleOptions);
|
|
12
|
+
resolve(detection: Detection, context: BoxCornerStyleContext): BoxCornerDrawInstruction | undefined;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=box-corner-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box-corner-style.d.ts","sourceRoot":"","sources":["../../src/styles/box-corner-style.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAWjC;;;;;GAKG;AACH,qBAAa,kBAAmB,YAAW,cAAc;IACvD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,yBAAyB,CAAC;gBAE1C,OAAO,GAAE,yBAA8B;IAInD,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,qBAAqB,GAC7B,wBAAwB,GAAG,SAAS;CAoExC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box-style.d.ts","sourceRoot":"","sources":["../../src/styles/box-style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"box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3B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,QAAQ,GACd,MAAM,GAAG,SAAS;IAQrB,SAAS,CAAC,aAAa,CACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,eAAe,GACvB,cAAc,GAAG,SAAS;IAe7B,SAAS,CAAC,WAAW,CACnB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,eAAe,GACvB,YAAY,GAAG,SAAS;CAY5B"}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { BaseBoxCornerStyle } from "#styles/box-corner-style";
|
|
2
|
+
import { BaseBoxStyle } from "#styles/box-style";
|
|
3
|
+
import { BaseKeypointStyle } from "#styles/keypoint-style";
|
|
4
|
+
import { BaseLabelStyle } from "#styles/label-style";
|
|
5
|
+
import { BaseMaskStyle } from "#styles/mask-style";
|
|
6
|
+
import { BaseMarkerStyle } from "#styles/marker-style";
|
|
7
|
+
import type { MaskHaloStyle } from "#types/mask-halo-style";
|
|
8
|
+
import { BasePolygonStyle } from "#styles/polygon-style";
|
|
9
|
+
import { BasePolylineStyle } from "#styles/polyline-style";
|
|
10
|
+
import type { EllipseStyle } from "#types/ellipse-style";
|
|
1
11
|
import type { SkeletonDefinitions } from "#types/detections";
|
|
2
12
|
import type { MediaRendererPresentation } from "#types/media-rendering";
|
|
3
13
|
export interface DefaultAnnotationPresentationOptions {
|
|
@@ -17,4 +27,32 @@ export interface DefaultAnnotationPresentationOptions {
|
|
|
17
27
|
* editing, focus, and theme behaviour so consumers can compose those layers.
|
|
18
28
|
*/
|
|
19
29
|
export declare function createDefaultAnnotationPresentation(options?: DefaultAnnotationPresentationOptions): MediaRendererPresentation;
|
|
30
|
+
/**
|
|
31
|
+
* The canonical default style of one built-in layer.
|
|
32
|
+
*
|
|
33
|
+
* These exist so a renderer kind can build only the style it needs instead of
|
|
34
|
+
* the whole default presentation. Keep them equivalent to the matching field of
|
|
35
|
+
* {@link createDefaultAnnotationPresentation}.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createDefaultBoxStyle(options?: DefaultAnnotationPresentationOptions): BaseBoxStyle;
|
|
38
|
+
/** Canonical opt-in BoxCornerAnnotator-style presentation. */
|
|
39
|
+
export declare function createDefaultBoxCornerStyle(options?: DefaultAnnotationPresentationOptions): BaseBoxCornerStyle;
|
|
40
|
+
/**
|
|
41
|
+
* Matches the Python Supervision EllipseAnnotator: an elliptical footprint
|
|
42
|
+
* arc under the detection box, swept from -45deg to 235deg, in the class
|
|
43
|
+
* color.
|
|
44
|
+
*/
|
|
45
|
+
export declare function createDefaultEllipseStyle(options?: DefaultAnnotationPresentationOptions): EllipseStyle;
|
|
46
|
+
export declare function createDefaultKeypointStyle(options?: DefaultAnnotationPresentationOptions): BaseKeypointStyle;
|
|
47
|
+
export declare function createDefaultLabelStyle(options?: DefaultAnnotationPresentationOptions): BaseLabelStyle;
|
|
48
|
+
export declare function createDefaultMaskStyle(options?: DefaultAnnotationPresentationOptions): BaseMaskStyle;
|
|
49
|
+
/** Canonical opt-in marker presentation. */
|
|
50
|
+
export declare function createDefaultMarkerStyle(): BaseMarkerStyle;
|
|
51
|
+
/**
|
|
52
|
+
* Canonical mask halo: a class-colored glow that follows the mask silhouette.
|
|
53
|
+
* Used when the `maskHalo` renderer is listed without an explicit style.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createDefaultMaskHaloStyle(options?: DefaultAnnotationPresentationOptions): MaskHaloStyle;
|
|
56
|
+
export declare function createDefaultPolygonStyle(options?: DefaultAnnotationPresentationOptions): BasePolygonStyle;
|
|
57
|
+
export declare function createDefaultPolylineStyle(options?: DefaultAnnotationPresentationOptions): BasePolylineStyle;
|
|
20
58
|
//# sourceMappingURL=default-annotation-presentation.d.ts.map
|
package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-annotation-presentation.d.ts","sourceRoot":"","sources":["../../src/styles/default-annotation-presentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"default-annotation-presentation.d.ts","sourceRoot":"","sources":["../../src/styles/default-annotation-presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAa,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAGxE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAqBxE,MAAM,WAAW,oCAAoC;IACnD;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CACvB,SAAS,EAAE,MAAM,GAAG,SAAS,KAC1B,MAAM,GAAG,SAAS,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,wEAAwE;IACxE,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CACpD;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,OAAO,GAAE,oCAAyC,GACjD,yBAAyB,CAS3B;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,oCAAyC,GACjD,YAAY,CAuBd;AAED,8DAA8D;AAC9D,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,oCAAyC,GACjD,kBAAkB,CAMpB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,oCAAyC,GACjD,YAAY,CA+Bd;AAED,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,oCAAyC,GACjD,iBAAiB,CAwBnB;AAED,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,oCAAyC,GACjD,cAAc,CAoBhB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,GAAE,oCAAyC,GACjD,aAAa,CAcf;AAED,4CAA4C;AAC5C,wBAAgB,wBAAwB,IAAI,eAAe,CAE1D;AAKD;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,oCAAyC,GACjD,aAAa,CAgBf;AAED,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,oCAAyC,GACjD,gBAAgB,CAclB;AAED,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,oCAAyC,GACjD,iBAAiB,CAUnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction-style.d.ts","sourceRoot":"","sources":["../../src/styles/interaction-style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"interaction-style.d.ts","sourceRoot":"","sources":["../../src/styles/interaction-style.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAEjB,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAatB,MAAM,WAAW,2BAA2B;IAC1C;;;OAG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,EAAE,QAAQ,GACd,MAAM,GAAG,SAAS;IAQrB,SAAS,CAAC,aAAa,CACrB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,uBAAuB,GAC/B,cAAc,GAAG,SAAS;IAe7B,SAAS,CAAC,WAAW,CACnB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,uBAAuB,GAC/B,YAAY,GAAG,SAAS;CAc5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keypoint-style.d.ts","sourceRoot":"","sources":["../../src/styles/keypoint-style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keypoint-style.d.ts","sourceRoot":"","sources":["../../src/styles/keypoint-style.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,mBAAmB,CACvC,OAAO,CAAC,YAAY,CAAC,EACrB,oBAAoB,CACrB,CAAC;IACF,QAAQ,CAAC,YAAY,CAAC,EAAE,mBAAmB,CACzC,OAAO,CAAC,cAAc,CAAC,EACvB,oBAAoB,CACrB,CAAC;IACF,QAAQ,CAAC,UAAU,CAAC,EAAE,mBAAmB,CACvC,OAAO,CAAC,cAAc,CAAC,EACvB,oBAAoB,CACrB,CAAC;IACF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,mBAAmB,CAC7C,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,EAC9B,oBAAoB,CACrB,CAAC;IACF,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IACpE,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;CACvE;AAED,qBAAa,iBAAkB,YAAW,aAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,GAAE,wBAA6B;IAEnE,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,oBAAoB,GAC5B,uBAAuB,GAAG,SAAS;CA8FvC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Detection } from "#types/detections";
|
|
2
|
+
import type { BaseMarkerStyleOptions, MarkerDrawInstruction, MarkerStyle, MarkerStyleContext } from "#types/marker-style";
|
|
3
|
+
/**
|
|
4
|
+
* Configurable marker renderer style anchored to semantic detection geometry.
|
|
5
|
+
*
|
|
6
|
+
* Use `center` for any domain-specific anchor (keypoint, centroid, or custom
|
|
7
|
+
* metadata). Without it, the marker lands at the detection rectangle center.
|
|
8
|
+
*/
|
|
9
|
+
export declare class BaseMarkerStyle implements MarkerStyle {
|
|
10
|
+
protected readonly options: BaseMarkerStyleOptions;
|
|
11
|
+
constructor(options?: BaseMarkerStyleOptions);
|
|
12
|
+
resolve(detection: Detection, context: MarkerStyleContext): MarkerDrawInstruction | undefined;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=marker-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker-style.d.ts","sourceRoot":"","sources":["../../src/styles/marker-style.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAM7B;;;;;GAKG;AACH,qBAAa,eAAgB,YAAW,WAAW;IACjD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;gBAEvC,OAAO,GAAE,sBAA2B;IAIhD,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,kBAAkB,GAC1B,qBAAqB,GAAG,SAAS;CAkFrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polygon-style.d.ts","sourceRoot":"","sources":["../../src/styles/polygon-style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"polygon-style.d.ts","sourceRoot":"","sources":["../../src/styles/polygon-style.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EACZ,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,CAAC,EAAE,mBAAmB,CACjC,OAAO,CAAC,YAAY,CAAC,GAAG,IAAI,EAC5B,mBAAmB,CACpB,CAAC;IACF,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CACnC,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,EAC9B,mBAAmB,CACpB,CAAC;IACF,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC,mBAAmB,CAAC,CAAC;CACtE;AAED,qBAAa,gBAAiB,YAAW,YAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,GAAE,uBAA4B;IAElE,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,mBAAmB,GAC3B,sBAAsB,GAAG,SAAS;CAkCtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyline-style.d.ts","sourceRoot":"","sources":["../../src/styles/polyline-style.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"polyline-style.d.ts","sourceRoot":"","sources":["../../src/styles/polyline-style.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EACV,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CACnC,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,EAC9B,oBAAoB,CACrB,CAAC;IACF,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;CACvE;AAED,qBAAa,iBAAkB,YAAW,aAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,GAAE,wBAA6B;IAEnE,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,oBAAoB,GAC5B,uBAAuB,GAAG,SAAS;CAyBvC"}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
+
import type { BoxCornerStyle } from "#types/box-corner-style";
|
|
2
|
+
import type { AnnotationRendererKind } from "#types/annotation-renderer";
|
|
1
3
|
import type { BoxStyle } from "#types/box-style";
|
|
4
|
+
import type { EllipseStyle } from "#types/ellipse-style";
|
|
2
5
|
import type { LabelStyle } from "#types/label-style";
|
|
3
6
|
import type { MaskStyle } from "#types/mask-style";
|
|
7
|
+
import type { MaskHaloStyle } from "#types/mask-halo-style";
|
|
8
|
+
import type { MarkerStyle } from "#types/marker-style";
|
|
4
9
|
import type { PolygonStyle } from "#types/polygon-style";
|
|
5
10
|
import type { PolylineStyle } from "#types/polyline-style";
|
|
6
11
|
import type { KeypointStyle } from "#types/keypoint-style";
|
|
7
12
|
export interface PresentationStyleSet {
|
|
8
13
|
readonly boxStyle?: BoxStyle | null;
|
|
14
|
+
readonly boxCornerStyle?: BoxCornerStyle | null;
|
|
15
|
+
readonly ellipseStyle?: EllipseStyle | null;
|
|
9
16
|
readonly keypointStyle?: KeypointStyle | null;
|
|
10
17
|
readonly labelStyle?: LabelStyle | null;
|
|
18
|
+
readonly maskHaloStyle?: MaskHaloStyle | null;
|
|
11
19
|
readonly maskStyle?: MaskStyle | null;
|
|
20
|
+
readonly markerStyle?: MarkerStyle | null;
|
|
12
21
|
readonly polygonStyle?: PolygonStyle | null;
|
|
13
22
|
readonly polylineStyle?: PolylineStyle | null;
|
|
14
23
|
}
|
|
@@ -17,6 +26,13 @@ export interface SourcePresentationEntry {
|
|
|
17
26
|
readonly id: string;
|
|
18
27
|
readonly presentation?: SourcePresentation;
|
|
19
28
|
}
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Limits source-level overrides when the host explicitly selects annotation
|
|
31
|
+
* renderers. Omit this option to retain legacy source-override behaviour.
|
|
32
|
+
*/
|
|
33
|
+
export interface SourceAwarePresentationOptions {
|
|
34
|
+
readonly enabledRendererKinds?: readonly AnnotationRendererKind[];
|
|
35
|
+
}
|
|
36
|
+
export declare function createSourceAwarePresentation<TPresentation extends PresentationStyleSet>(globalPresentation: TPresentation, sources: readonly SourcePresentationEntry[], options?: SourceAwarePresentationOptions): TPresentation;
|
|
37
|
+
export declare function createSourceAwarePresentation(globalPresentation: PresentationStyleSet | undefined, sources: readonly SourcePresentationEntry[], options?: SourceAwarePresentationOptions): PresentationStyleSet;
|
|
22
38
|
//# sourceMappingURL=source-presentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-presentation.d.ts","sourceRoot":"","sources":["../../src/styles/source-presentation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"source-presentation.d.ts","sourceRoot":"","sources":["../../src/styles/source-presentation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,cAAc,EAEf,MAAM,yBAAyB,CAAC;AAYjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAEV,QAAQ,EAET,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAEV,YAAY,EAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAEV,UAAU,EAEX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAEV,SAAS,EAEV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAEV,WAAW,EAEZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAEV,YAAY,EAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC9C,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CAC/C;AAED,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,YAAY,CAAC,EAAE,kBAAkB,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACnE;AAED,wBAAgB,6BAA6B,CAC3C,aAAa,SAAS,oBAAoB,EAE1C,kBAAkB,EAAE,aAAa,EACjC,OAAO,EAAE,SAAS,uBAAuB,EAAE,EAC3C,OAAO,CAAC,EAAE,8BAA8B,GACvC,aAAa,CAAC;AACjB,wBAAgB,6BAA6B,CAC3C,kBAAkB,EAAE,oBAAoB,GAAG,SAAS,EACpD,OAAO,EAAE,SAAS,uBAAuB,EAAE,EAC3C,OAAO,CAAC,EAAE,8BAA8B,GACvC,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StrokeStyle } from "#types/paint-style";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the renderer-neutral stroke contract without dropping optional
|
|
4
|
+
* geometry controls as styles move from public configuration to draw
|
|
5
|
+
* instructions.
|
|
6
|
+
*
|
|
7
|
+
* Keep this as the single normalization point for every built-in style. That
|
|
8
|
+
* makes additions to `StrokeStyle` deliberate instead of relying on each style
|
|
9
|
+
* implementation to copy a growing property list correctly.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveStrokeStyle(stroke: Partial<StrokeStyle> | undefined, defaults: StrokeStyle): StrokeStyle;
|
|
12
|
+
//# sourceMappingURL=stroke-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stroke-style.d.ts","sourceRoot":"","sources":["../../src/styles/stroke-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,SAAS,EACxC,QAAQ,EAAE,WAAW,GACpB,WAAW,CAiBb"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import type { BoxStyle } from "#types/box-style";
|
|
2
|
+
import type { BoxCornerStyle } from "#types/box-corner-style";
|
|
3
|
+
import type { EllipseStyle } from "#types/ellipse-style";
|
|
4
|
+
import type { KeypointStyle } from "#types/keypoint-style";
|
|
5
|
+
import type { LabelStyle } from "#types/label-style";
|
|
6
|
+
import type { MaskHaloStyle } from "#types/mask-halo-style";
|
|
7
|
+
import type { MaskStyle } from "#types/mask-style";
|
|
8
|
+
import type { MarkerStyle } from "#types/marker-style";
|
|
9
|
+
import type { PolygonStyle } from "#types/polygon-style";
|
|
10
|
+
import type { PolylineStyle } from "#types/polyline-style";
|
|
11
|
+
import type { AnnotationStyleContext } from "#types/style";
|
|
12
|
+
import type { Detection } from "#types/detections";
|
|
13
|
+
/**
|
|
14
|
+
* The built-in annotation renderer vocabulary.
|
|
15
|
+
*
|
|
16
|
+
* These stay plain string literals so `{ kind: "box" }` remains assignable to
|
|
17
|
+
* the public descriptor union from JavaScript and TypeScript alike.
|
|
18
|
+
*/
|
|
19
|
+
export declare const annotationRendererKinds: readonly ["box", "box-corners", "ellipse", "keypoints", "label", "mask", "maskHalo", "marker", "polygon", "polyline", "region"];
|
|
20
|
+
/** One supported built-in annotation renderer kind. */
|
|
21
|
+
export type AnnotationRendererKind = (typeof annotationRendererKinds)[number];
|
|
22
|
+
/**
|
|
23
|
+
* A renderer configured in a media presentation.
|
|
24
|
+
*
|
|
25
|
+
* Renderers are the public unit of annotation visualization. Every renderer
|
|
26
|
+
* consumes semantic detections and contributes to the renderer-owned scene;
|
|
27
|
+
* individual backends decide how to draw or prepare it.
|
|
28
|
+
*/
|
|
29
|
+
export type AnnotationRenderer = BoxAnnotationRenderer | BoxCornerAnnotationRenderer | EllipseAnnotationRenderer | KeypointAnnotationRenderer | LabelAnnotationRenderer | MaskAnnotationRenderer | MaskHaloAnnotationRenderer | MarkerAnnotationRenderer | PolygonAnnotationRenderer | PolylineAnnotationRenderer | RegionAnnotationRenderer;
|
|
30
|
+
/**
|
|
31
|
+
* The descriptor of one renderer kind.
|
|
32
|
+
*
|
|
33
|
+
* This resolves to `never` for a kind that has no descriptor, which makes an
|
|
34
|
+
* incomplete addition to {@link annotationRendererKinds} fail to compile where
|
|
35
|
+
* the kind's metadata or factory is declared.
|
|
36
|
+
*/
|
|
37
|
+
export type AnnotationRendererOfKind<TKind extends AnnotationRendererKind> = Extract<AnnotationRenderer, {
|
|
38
|
+
kind: TKind;
|
|
39
|
+
}>;
|
|
40
|
+
interface BaseAnnotationRenderer {
|
|
41
|
+
/** Stable identity within one presentation. */
|
|
42
|
+
readonly id: string;
|
|
43
|
+
}
|
|
44
|
+
export interface BoxAnnotationRenderer extends BaseAnnotationRenderer {
|
|
45
|
+
readonly kind: "box";
|
|
46
|
+
readonly style?: BoxStyle | null;
|
|
47
|
+
}
|
|
48
|
+
export interface BoxCornerAnnotationRenderer extends BaseAnnotationRenderer {
|
|
49
|
+
readonly kind: "box-corners";
|
|
50
|
+
readonly style?: BoxCornerStyle | null;
|
|
51
|
+
}
|
|
52
|
+
export interface EllipseAnnotationRenderer extends BaseAnnotationRenderer {
|
|
53
|
+
readonly kind: "ellipse";
|
|
54
|
+
readonly style?: EllipseStyle | null;
|
|
55
|
+
}
|
|
56
|
+
export interface KeypointAnnotationRenderer extends BaseAnnotationRenderer {
|
|
57
|
+
readonly kind: "keypoints";
|
|
58
|
+
readonly style?: KeypointStyle | null;
|
|
59
|
+
}
|
|
60
|
+
export interface LabelAnnotationRenderer extends BaseAnnotationRenderer {
|
|
61
|
+
readonly kind: "label";
|
|
62
|
+
readonly style?: LabelStyle | null;
|
|
63
|
+
}
|
|
64
|
+
export interface MaskAnnotationRenderer extends BaseAnnotationRenderer {
|
|
65
|
+
readonly kind: "mask";
|
|
66
|
+
readonly style?: MaskStyle | null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Soft glow that follows the exact mask silhouette.
|
|
70
|
+
*
|
|
71
|
+
* The backend blurs the prepared mask coverage on the GPU and reuses the
|
|
72
|
+
* mask renderer's prepared artifacts; listing this kind without the mask
|
|
73
|
+
* renderer still prepares the required mask coverage internally.
|
|
74
|
+
*/
|
|
75
|
+
export interface MaskHaloAnnotationRenderer extends BaseAnnotationRenderer {
|
|
76
|
+
readonly kind: "maskHalo";
|
|
77
|
+
readonly style?: MaskHaloStyle | null;
|
|
78
|
+
}
|
|
79
|
+
export interface MarkerAnnotationRenderer extends BaseAnnotationRenderer {
|
|
80
|
+
readonly kind: "marker";
|
|
81
|
+
readonly style?: MarkerStyle | null;
|
|
82
|
+
}
|
|
83
|
+
export interface PolygonAnnotationRenderer extends BaseAnnotationRenderer {
|
|
84
|
+
readonly kind: "polygon";
|
|
85
|
+
readonly style?: PolygonStyle | null;
|
|
86
|
+
}
|
|
87
|
+
export interface PolylineAnnotationRenderer extends BaseAnnotationRenderer {
|
|
88
|
+
readonly kind: "polyline";
|
|
89
|
+
readonly style?: PolylineStyle | null;
|
|
90
|
+
}
|
|
91
|
+
/** Sources currently supported by a region renderer. */
|
|
92
|
+
export declare const RegionRendererSourceKind: {
|
|
93
|
+
readonly Asset: "asset";
|
|
94
|
+
};
|
|
95
|
+
export type RegionRendererSourceKind = (typeof RegionRendererSourceKind)[keyof typeof RegionRendererSourceKind];
|
|
96
|
+
/** Media-space regions currently supported by a region renderer. */
|
|
97
|
+
export declare const RegionRendererRegionKind: {
|
|
98
|
+
readonly Bounds: "bounds";
|
|
99
|
+
readonly KeypointAnchor: "keypoint-anchor";
|
|
100
|
+
};
|
|
101
|
+
export type RegionRendererRegionKind = (typeof RegionRendererRegionKind)[keyof typeof RegionRendererRegionKind];
|
|
102
|
+
/** Composition modes currently supported by a region renderer. */
|
|
103
|
+
export declare const RegionRendererComposeMode: {
|
|
104
|
+
readonly Over: "over";
|
|
105
|
+
};
|
|
106
|
+
export type RegionRendererComposeMode = (typeof RegionRendererComposeMode)[keyof typeof RegionRendererComposeMode];
|
|
107
|
+
export type RegionRendererTargetValue = string | number | readonly (string | number)[];
|
|
108
|
+
export type RegionRendererTargetContext = AnnotationStyleContext;
|
|
109
|
+
/** Selects detections consumed by a region renderer. All configured fields match. */
|
|
110
|
+
export interface RegionRendererTarget {
|
|
111
|
+
readonly id?: RegionRendererTargetValue;
|
|
112
|
+
readonly className?: string | readonly string[];
|
|
113
|
+
readonly sourceId?: string | readonly string[];
|
|
114
|
+
readonly resolve?: (detection: Detection, context: RegionRendererTargetContext) => boolean;
|
|
115
|
+
}
|
|
116
|
+
/** A browser-loadable image or animated GIF. Backend asset types stay private. */
|
|
117
|
+
export interface RegionRendererAssetReference {
|
|
118
|
+
readonly src: string;
|
|
119
|
+
}
|
|
120
|
+
export interface RegionRendererAssetSource {
|
|
121
|
+
readonly kind: typeof RegionRendererSourceKind.Asset;
|
|
122
|
+
readonly asset: RegionRendererAssetReference;
|
|
123
|
+
}
|
|
124
|
+
export interface RegionRendererBoundsRegion {
|
|
125
|
+
readonly kind: typeof RegionRendererRegionKind.Bounds;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Resolves one point-sized region from semantic keypoints.
|
|
129
|
+
*
|
|
130
|
+
* A numeric anchor addresses one keypoint index. `"head"` resolves the visible
|
|
131
|
+
* COCO face keypoints (indices 0 through 4) and falls back to the top of the
|
|
132
|
+
* detection bounds when those points are unavailable.
|
|
133
|
+
*/
|
|
134
|
+
export interface RegionRendererKeypointAnchorRegion {
|
|
135
|
+
readonly kind: typeof RegionRendererRegionKind.KeypointAnchor;
|
|
136
|
+
readonly anchor: number | "head";
|
|
137
|
+
}
|
|
138
|
+
export type RegionRendererRegion = RegionRendererBoundsRegion | RegionRendererKeypointAnchorRegion;
|
|
139
|
+
/** Media-space transform applied after a target region is resolved. */
|
|
140
|
+
export interface RegionRendererTransform {
|
|
141
|
+
/** Uniform scale relative to the resolved region. Defaults to 1. */
|
|
142
|
+
readonly scale?: number;
|
|
143
|
+
/** Region-relative translation. `{ x: 1, y: 1 }` moves one region size. */
|
|
144
|
+
readonly offset?: {
|
|
145
|
+
readonly x: number;
|
|
146
|
+
readonly y: number;
|
|
147
|
+
};
|
|
148
|
+
/** Clockwise rotation in radians. Defaults to 0. */
|
|
149
|
+
readonly rotation?: number;
|
|
150
|
+
/** Sprite opacity from 0 through 1. Defaults to 1. */
|
|
151
|
+
readonly opacity?: number;
|
|
152
|
+
}
|
|
153
|
+
export interface RegionRendererCompose {
|
|
154
|
+
readonly mode: typeof RegionRendererComposeMode.Over;
|
|
155
|
+
/** Stable ordering among region renderers. Defaults to 0. */
|
|
156
|
+
readonly zIndex?: number;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Places a browser-loaded asset over a detection-owned region.
|
|
160
|
+
*
|
|
161
|
+
* This descriptor is intentionally semantic and backend-neutral. Asset
|
|
162
|
+
* loading, texture caching, sprites, and teardown remain backend details.
|
|
163
|
+
*/
|
|
164
|
+
export interface RegionAnnotationRenderer extends BaseAnnotationRenderer {
|
|
165
|
+
readonly kind: "region";
|
|
166
|
+
readonly target: RegionRendererTarget;
|
|
167
|
+
readonly source: RegionRendererAssetSource;
|
|
168
|
+
readonly region: RegionRendererRegion;
|
|
169
|
+
readonly transform?: RegionRendererTransform;
|
|
170
|
+
readonly compose?: RegionRendererCompose;
|
|
171
|
+
}
|
|
172
|
+
/** Creates the descriptor for every supported renderer kind. */
|
|
173
|
+
export type AnnotationRendererFactory = {
|
|
174
|
+
readonly box: (options?: AnnotationRendererStyleOptions<"box">) => BoxAnnotationRenderer;
|
|
175
|
+
readonly boxCorners: (options?: AnnotationRendererStyleOptions<"box-corners">) => BoxCornerAnnotationRenderer;
|
|
176
|
+
readonly ellipse: (options?: AnnotationRendererStyleOptions<"ellipse">) => EllipseAnnotationRenderer;
|
|
177
|
+
readonly keypoints: (options?: AnnotationRendererStyleOptions<"keypoints">) => KeypointAnnotationRenderer;
|
|
178
|
+
readonly label: (options?: AnnotationRendererStyleOptions<"label">) => LabelAnnotationRenderer;
|
|
179
|
+
readonly mask: (options?: AnnotationRendererStyleOptions<"mask">) => MaskAnnotationRenderer;
|
|
180
|
+
readonly maskHalo: (options?: AnnotationRendererStyleOptions<"maskHalo">) => MaskHaloAnnotationRenderer;
|
|
181
|
+
readonly marker: (options?: AnnotationRendererStyleOptions<"marker">) => MarkerAnnotationRenderer;
|
|
182
|
+
readonly polygon: (options?: AnnotationRendererStyleOptions<"polygon">) => PolygonAnnotationRenderer;
|
|
183
|
+
readonly polyline: (options?: AnnotationRendererStyleOptions<"polyline">) => PolylineAnnotationRenderer;
|
|
184
|
+
readonly region: (options: Omit<RegionAnnotationRenderer, "kind">) => RegionAnnotationRenderer;
|
|
185
|
+
};
|
|
186
|
+
type AnnotationRendererStyleOptions<TKind extends Exclude<AnnotationRendererKind, "region">> = Pick<AnnotationRendererOfKind<TKind>, "style">;
|
|
187
|
+
/**
|
|
188
|
+
* Creates built-in annotation renderer descriptors for
|
|
189
|
+
* `MediaRendererPresentation.renderers`.
|
|
190
|
+
*
|
|
191
|
+
* The currently supported renderers retain their established scene ordering:
|
|
192
|
+
* masks, polygons, vectors, labels. A later renderer kind may add a new
|
|
193
|
+
* composition capability without changing that ordering for existing scenes.
|
|
194
|
+
*/
|
|
195
|
+
export declare const annotationRenderers: AnnotationRendererFactory;
|
|
196
|
+
export {};
|
|
197
|
+
//# sourceMappingURL=annotation-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation-ren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CAAC,QAAQ,CAAC,KAC/C,wBAAwB,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,CAChB,OAAO,CAAC,EAAE,8BAA8B,CAAC,SAAS,CAAC,KAChD,yBAAyB,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,CACjB,OAAO,CAAC,EAAE,8BAA8B,CAAC,UAAU,CAAC,KACjD,0BAA0B,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,CACf,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAAE,MAAM,CAAC,KAC5C,wBAAwB,CAAC;CAC/B,CAAC;AAEF,KAAK,8BAA8B,CACjC,KAAK,SAAS,OAAO,CAAC,sBAAsB,EAAE,QAAQ,CAAC,IACrD,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;AAEnD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,yBAYjC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Detection, Point } from "#types/detections";
|
|
2
|
+
import type { OpenStrokeStyle } from "#types/paint-style";
|
|
3
|
+
import type { AnnotationStyleContext, DetectionStylePredicate, DetectionStyleValue } from "#types/style";
|
|
4
|
+
export type BoxCornerStyleContext = AnnotationStyleContext;
|
|
5
|
+
/** Four open corner segments derived from one detection rectangle. */
|
|
6
|
+
export interface BoxCornerDrawInstruction {
|
|
7
|
+
readonly segments: readonly (readonly Point[])[];
|
|
8
|
+
readonly stroke: OpenStrokeStyle;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Style contract of the `box-corners` annotation renderer.
|
|
12
|
+
*
|
|
13
|
+
* The renderer is presentation-only: it never changes semantic detection
|
|
14
|
+
* geometry, picking, or editing. Segment coordinates are in media space while
|
|
15
|
+
* the stroke keeps the usual screen-space width semantics.
|
|
16
|
+
*/
|
|
17
|
+
export interface BoxCornerStyle {
|
|
18
|
+
resolve(detection: Detection, context: BoxCornerStyleContext): BoxCornerDrawInstruction | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface BaseBoxCornerStyleOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Visible length of each corner segment in screen pixels. The renderer
|
|
23
|
+
* converts it to media space so the decoration stays legible while zooming.
|
|
24
|
+
*/
|
|
25
|
+
readonly length?: DetectionStyleValue<number, BoxCornerStyleContext>;
|
|
26
|
+
/** Open-path stroke used by each of the four corners. */
|
|
27
|
+
readonly stroke?: DetectionStyleValue<Partial<OpenStrokeStyle> | null, BoxCornerStyleContext>;
|
|
28
|
+
/** Return false to skip a detection. */
|
|
29
|
+
readonly shouldRender?: DetectionStylePredicate<BoxCornerStyleContext>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=box-corner-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"box-corner-style.d.ts","sourceRoot":"","sources":["../../src/types/box-corner-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAE3D,sEAAsE;AACtE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,KAAK,EAAE,CAAC,EAAE,CAAC;IACjD,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CAClC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,qBAAqB,GAC7B,wBAAwB,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IACrE,yDAAyD;IACzD,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CACnC,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,EAC/B,qBAAqB,CACtB,CAAC;IACF,wCAAwC;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC,qBAAqB,CAAC,CAAC;CACxE"}
|
|
@@ -1,34 +1,21 @@
|
|
|
1
1
|
import type { Detection, Rect } from "#types/detections";
|
|
2
|
+
import type { FillStyle, StrokeStyle } from "#types/paint-style";
|
|
2
3
|
import type { AnnotationStyleContext } from "#types/style";
|
|
4
|
+
export { StrokeAlignment as BoxStrokeAlignment } from "#types/paint-style";
|
|
3
5
|
export declare enum BoxShape {
|
|
4
6
|
Rect = "rect",
|
|
5
7
|
RoundedRect = "roundedRect"
|
|
6
8
|
}
|
|
7
|
-
export declare enum BoxStrokeAlignment {
|
|
8
|
-
Inside = "inside",
|
|
9
|
-
Center = "center",
|
|
10
|
-
Outside = "outside"
|
|
11
|
-
}
|
|
12
9
|
/**
|
|
13
10
|
* Stroke applied to a rendered detection rectangle.
|
|
14
11
|
*
|
|
15
12
|
* This belongs to presentation styling, not to the underlying detection data.
|
|
16
13
|
*/
|
|
17
|
-
export
|
|
18
|
-
readonly color: number;
|
|
19
|
-
readonly alpha: number;
|
|
20
|
-
readonly width: number;
|
|
21
|
-
readonly alignment?: BoxStrokeAlignment;
|
|
22
|
-
/** Alternating dash and gap lengths in screen pixels. */
|
|
23
|
-
readonly dash?: readonly number[];
|
|
24
|
-
}
|
|
14
|
+
export type BoxStrokeStyle = StrokeStyle;
|
|
25
15
|
/**
|
|
26
16
|
* Fill applied behind or inside a rendered detection rectangle.
|
|
27
17
|
*/
|
|
28
|
-
export
|
|
29
|
-
readonly color: number;
|
|
30
|
-
readonly alpha: number;
|
|
31
|
-
}
|
|
18
|
+
export type BoxFillStyle = FillStyle;
|
|
32
19
|
/**
|
|
33
20
|
* Per-frame context passed to a box style while resolving draw instructions.
|
|
34
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"box-style.d.ts","sourceRoot":"","sources":["../../src/types/box-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"box-style.d.ts","sourceRoot":"","sources":["../../src/types/box-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE3E,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,WAAW,gBAAgB;CAC5B;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAChC;AAED;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,eAAe,GACvB,kBAAkB,GAAG,SAAS,CAAC;CACnC"}
|