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.
Files changed (90) hide show
  1. package/dist/index.d.ts +11 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +1232 -107
  4. package/dist/index.js.map +1 -1
  5. package/dist/mask-preparation.worker.js +43 -9
  6. package/dist/mask-preparation.worker.js.map +1 -1
  7. package/dist/render-preparation/mask-frame-artifact.d.ts +6 -0
  8. package/dist/render-preparation/mask-frame-artifact.d.ts.map +1 -1
  9. package/dist/render-preparation/mask-frame-compositor.d.ts +1 -0
  10. package/dist/render-preparation/mask-frame-compositor.d.ts.map +1 -1
  11. package/dist/render-preparation/mask-frame-preparer.d.ts.map +1 -1
  12. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts +1 -0
  13. package/dist/render-preparation/mask-preparation-worker-protocol.d.ts.map +1 -1
  14. package/dist/renderers/annotation-shape-styles.d.ts +17 -0
  15. package/dist/renderers/annotation-shape-styles.d.ts.map +1 -0
  16. package/dist/renderers/media-renderer-core.d.ts.map +1 -1
  17. package/dist/renderers/media-renderer-scene.d.ts +17 -2
  18. package/dist/renderers/media-renderer-scene.d.ts.map +1 -1
  19. package/dist/renderers/pixi-annotation-overlay-layer.d.ts.map +1 -1
  20. package/dist/renderers/pixi-focus-layer.d.ts +1 -0
  21. package/dist/renderers/pixi-focus-layer.d.ts.map +1 -1
  22. package/dist/renderers/pixi-interaction-layer.d.ts +2 -0
  23. package/dist/renderers/pixi-interaction-layer.d.ts.map +1 -1
  24. package/dist/renderers/pixi-interaction-presentation-layer.d.ts +2 -1
  25. package/dist/renderers/pixi-interaction-presentation-layer.d.ts.map +1 -1
  26. package/dist/renderers/pixi-mask-halo.d.ts +94 -0
  27. package/dist/renderers/pixi-mask-halo.d.ts.map +1 -0
  28. package/dist/renderers/pixi-mask-layer.d.ts +10 -1
  29. package/dist/renderers/pixi-mask-layer.d.ts.map +1 -1
  30. package/dist/renderers/pixi-media-scene.d.ts.map +1 -1
  31. package/dist/renderers/pixi-path.d.ts +13 -7
  32. package/dist/renderers/pixi-path.d.ts.map +1 -1
  33. package/dist/renderers/pixi-polygon-layer.d.ts.map +1 -1
  34. package/dist/renderers/pixi-region-layer.d.ts +42 -0
  35. package/dist/renderers/pixi-region-layer.d.ts.map +1 -0
  36. package/dist/renderers/pixi-scene-layer-slot.d.ts +1 -0
  37. package/dist/renderers/pixi-scene-layer-slot.d.ts.map +1 -1
  38. package/dist/renderers/pixi-vector-layer.d.ts +3 -1
  39. package/dist/renderers/pixi-vector-layer.d.ts.map +1 -1
  40. package/dist/sessions/media-session.d.ts.map +1 -1
  41. package/dist/types/media-renderer.d.ts +1 -1
  42. package/dist/types/media-renderer.d.ts.map +1 -1
  43. package/node_modules/supervision-js-core/dist/index.d.ts +19 -3
  44. package/node_modules/supervision-js-core/dist/index.d.ts.map +1 -1
  45. package/node_modules/supervision-js-core/dist/index.js +944 -157
  46. package/node_modules/supervision-js-core/dist/index.js.map +1 -1
  47. package/node_modules/supervision-js-core/dist/interactions/detection-picker.d.ts +18 -0
  48. package/node_modules/supervision-js-core/dist/interactions/detection-picker.d.ts.map +1 -1
  49. package/node_modules/supervision-js-core/dist/styles/annotation-renderer-presentation.d.ts +9 -0
  50. package/node_modules/supervision-js-core/dist/styles/annotation-renderer-presentation.d.ts.map +1 -0
  51. package/node_modules/supervision-js-core/dist/styles/annotation-renderer-registry.d.ts +47 -0
  52. package/node_modules/supervision-js-core/dist/styles/annotation-renderer-registry.d.ts.map +1 -0
  53. package/node_modules/supervision-js-core/dist/styles/box-corner-style.d.ts +14 -0
  54. package/node_modules/supervision-js-core/dist/styles/box-corner-style.d.ts.map +1 -0
  55. package/node_modules/supervision-js-core/dist/styles/box-style.d.ts.map +1 -1
  56. package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts +38 -0
  57. package/node_modules/supervision-js-core/dist/styles/default-annotation-presentation.d.ts.map +1 -1
  58. package/node_modules/supervision-js-core/dist/styles/interaction-style.d.ts.map +1 -1
  59. package/node_modules/supervision-js-core/dist/styles/keypoint-style.d.ts.map +1 -1
  60. package/node_modules/supervision-js-core/dist/styles/marker-style.d.ts +14 -0
  61. package/node_modules/supervision-js-core/dist/styles/marker-style.d.ts.map +1 -0
  62. package/node_modules/supervision-js-core/dist/styles/polygon-style.d.ts.map +1 -1
  63. package/node_modules/supervision-js-core/dist/styles/polyline-style.d.ts.map +1 -1
  64. package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts +18 -2
  65. package/node_modules/supervision-js-core/dist/styles/source-presentation.d.ts.map +1 -1
  66. package/node_modules/supervision-js-core/dist/styles/stroke-style.d.ts +12 -0
  67. package/node_modules/supervision-js-core/dist/styles/stroke-style.d.ts.map +1 -0
  68. package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts +197 -0
  69. package/node_modules/supervision-js-core/dist/types/annotation-renderer.d.ts.map +1 -0
  70. package/node_modules/supervision-js-core/dist/types/box-corner-style.d.ts +31 -0
  71. package/node_modules/supervision-js-core/dist/types/box-corner-style.d.ts.map +1 -0
  72. package/node_modules/supervision-js-core/dist/types/box-style.d.ts +4 -17
  73. package/node_modules/supervision-js-core/dist/types/box-style.d.ts.map +1 -1
  74. package/node_modules/supervision-js-core/dist/types/ellipse-style.d.ts +30 -0
  75. package/node_modules/supervision-js-core/dist/types/ellipse-style.d.ts.map +1 -0
  76. package/node_modules/supervision-js-core/dist/types/interaction.d.ts +12 -0
  77. package/node_modules/supervision-js-core/dist/types/interaction.d.ts.map +1 -1
  78. package/node_modules/supervision-js-core/dist/types/marker-style.d.ts +46 -0
  79. package/node_modules/supervision-js-core/dist/types/marker-style.d.ts.map +1 -0
  80. package/node_modules/supervision-js-core/dist/types/mask-halo-style.d.ts +29 -0
  81. package/node_modules/supervision-js-core/dist/types/mask-halo-style.d.ts.map +1 -0
  82. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts +26 -1
  83. package/node_modules/supervision-js-core/dist/types/media-rendering.d.ts.map +1 -1
  84. package/node_modules/supervision-js-core/dist/types/paint-style.d.ts +36 -0
  85. package/node_modules/supervision-js-core/dist/types/paint-style.d.ts.map +1 -0
  86. package/node_modules/supervision-js-core/dist/types/shape-style.d.ts +112 -0
  87. package/node_modules/supervision-js-core/dist/types/shape-style.d.ts.map +1 -0
  88. package/node_modules/supervision-js-core/dist/utils/shape-geometry.d.ts +50 -0
  89. package/node_modules/supervision-js-core/dist/utils/shape-geometry.d.ts.map +1 -0
  90. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ import type { Detection } from "#types/detections";
2
+ import type { ClosedEllipseShapeInstruction, EllipseArcShapeInstruction } from "#types/shape-style";
3
+ import type { AnnotationStyleContext } from "#types/style";
4
+ export type EllipseStyleContext = AnnotationStyleContext;
5
+ /**
6
+ * One closed ellipse drawn for a detection, in media coordinates.
7
+ *
8
+ * The annotation renderer omits only the internal shape discriminator; all
9
+ * geometry and paint constraints come from the shared ellipse primitive.
10
+ */
11
+ export type ClosedEllipseDrawInstruction = Omit<ClosedEllipseShapeInstruction, "kind">;
12
+ /**
13
+ * One elliptical arc drawn for a detection, in media coordinates.
14
+ *
15
+ * Angles are radians measured from the positive x axis before `rotation` is
16
+ * applied.
17
+ */
18
+ export type EllipseArcDrawInstruction = Omit<EllipseArcShapeInstruction, "kind">;
19
+ export type EllipseDrawInstruction = ClosedEllipseDrawInstruction | EllipseArcDrawInstruction;
20
+ /**
21
+ * Style contract of the `ellipse` annotation renderer.
22
+ *
23
+ * Resolves per detection to the ellipse drawn for it, or `undefined` to skip
24
+ * the detection. Ellipses are presentation only: they are never pickable and
25
+ * never become editable annotations.
26
+ */
27
+ export interface EllipseStyle {
28
+ resolve(detection: Detection, context: EllipseStyleContext): EllipseDrawInstruction | undefined;
29
+ }
30
+ //# sourceMappingURL=ellipse-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ellipse-style.d.ts","sourceRoot":"","sources":["../../src/types/ellipse-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,6BAA6B,EAC7B,MAAM,CACP,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,0BAA0B,EAC1B,MAAM,CACP,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAChC,4BAA4B,GAAG,yBAAyB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,mBAAmB,GAC3B,sBAAsB,GAAG,SAAS,CAAC;CACvC"}
@@ -56,8 +56,20 @@ export type DetectionSelectionOptions = DetectionSelectionOptionsBase & ({
56
56
  export interface MediaInteractionOptions extends DetectionPickOptions {
57
57
  readonly mode?: MediaInteractionMode;
58
58
  readonly onHover?: (pick: DetectionPickResult | null) => void;
59
+ /**
60
+ * Reports selection identity changes. A stable, frame-unique detection id
61
+ * may keep rendering as selected across later frames without re-emitting
62
+ * this callback. The pick is the immutable frame snapshot where the
63
+ * selection event occurred; use the detection id with the active frame when
64
+ * current geometry is required.
65
+ */
59
66
  readonly onSelect?: (pick: DetectionPickResult | null) => void;
60
67
  readonly multiSelect?: boolean;
68
+ /**
69
+ * Reports selection membership changes, not per-frame geometry updates for
70
+ * stable detection ids. Each pick is the snapshot that produced that
71
+ * membership event.
72
+ */
61
73
  readonly onSelectionChange?: (picks: readonly DetectionPickResult[]) => void;
62
74
  readonly onMarqueeChange?: (rect: {
63
75
  readonly x: number;
@@ -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,CAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,mBAAmB,EAAE,KAAK,IAAI,CAAC;IAC7E,QAAQ,CAAC,eAAe,CAAC,EAAE,CACzB,IAAI,EAAE;QACJ,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,GAAG,IAAI,KACL,IAAI,CAAC;CACX"}
@@ -0,0 +1,46 @@
1
+ import type { Detection, Point } from "#types/detections";
2
+ import type { FillStyle, OpenStrokeStyle, StrokeStyle } from "#types/paint-style";
3
+ import { MarkerShape, MarkerSizeSpace } from "#types/shape-style";
4
+ import type { AnnotationStyleContext, DetectionStylePredicate, DetectionStyleValue } from "#types/style";
5
+ export type MarkerStyleContext = AnnotationStyleContext;
6
+ interface MarkerDrawInstructionBase {
7
+ readonly center: Point;
8
+ readonly shape: MarkerShape;
9
+ /** Marker diameter in the declared size space. */
10
+ readonly size: number;
11
+ readonly sizeSpace: MarkerSizeSpace;
12
+ readonly rotation?: number;
13
+ }
14
+ export interface ClosedMarkerDrawInstruction extends MarkerDrawInstructionBase {
15
+ readonly shape: MarkerShape.Circle | MarkerShape.Square | MarkerShape.Triangle;
16
+ readonly fill?: FillStyle;
17
+ readonly stroke?: StrokeStyle;
18
+ }
19
+ export interface CrossMarkerDrawInstruction extends MarkerDrawInstructionBase {
20
+ readonly shape: MarkerShape.Cross;
21
+ readonly fill?: never;
22
+ readonly stroke?: OpenStrokeStyle;
23
+ }
24
+ export type MarkerDrawInstruction = ClosedMarkerDrawInstruction | CrossMarkerDrawInstruction;
25
+ /**
26
+ * Style contract of the `marker` annotation renderer.
27
+ *
28
+ * A style maps a semantic detection to one positioned marker. The renderer is
29
+ * presentation-only and does not change picking or editing geometry.
30
+ */
31
+ export interface MarkerStyle {
32
+ resolve(detection: Detection, context: MarkerStyleContext): MarkerDrawInstruction | undefined;
33
+ }
34
+ export interface BaseMarkerStyleOptions {
35
+ /** Optional media-space anchor. The default is the detection-rect center. */
36
+ readonly center?: DetectionStyleValue<Point | undefined, MarkerStyleContext>;
37
+ readonly shape?: DetectionStyleValue<MarkerShape, MarkerStyleContext>;
38
+ readonly size?: DetectionStyleValue<number, MarkerStyleContext>;
39
+ readonly sizeSpace?: DetectionStyleValue<MarkerSizeSpace, MarkerStyleContext>;
40
+ readonly rotation?: DetectionStyleValue<number | undefined, MarkerStyleContext>;
41
+ readonly fill?: DetectionStyleValue<Partial<FillStyle> | null, MarkerStyleContext>;
42
+ readonly stroke?: DetectionStyleValue<Partial<StrokeStyle> | null, MarkerStyleContext>;
43
+ readonly shouldRender?: DetectionStylePredicate<MarkerStyleContext>;
44
+ }
45
+ export {};
46
+ //# sourceMappingURL=marker-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marker-style.d.ts","sourceRoot":"","sources":["../../src/types/marker-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAExD,UAAU,yBAAyB;IACjC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,QAAQ,C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AAO,CAAC,SAAS,CAAC,GAAG,IAAI,EACzB,kBAAkB,CACnB,CAAC;IACF,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CACnC,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,EAC3B,kBAAkB,CACnB,CAAC;IACF,QAAQ,CAAC,YAAY,CAAC,EAAE,uBAAuB,CAAC,kBAAkB,CAAC,CAAC;CACrE"}
@@ -0,0 +1,29 @@
1
+ import type { Detection } from "#types/detections";
2
+ import type { AnnotationStyleContext } from "#types/style";
3
+ export type MaskHaloStyleContext = AnnotationStyleContext;
4
+ /**
5
+ * Renderer-neutral mask halo drawing instruction.
6
+ *
7
+ * The backend blurs the prepared mask coverage on the GPU, so the glow
8
+ * follows the exact mask silhouette. Each detection's spread is honored:
9
+ * detections requesting different spreads render in separate blur passes.
10
+ */
11
+ export interface MaskHaloDrawInstruction {
12
+ /** Peak glow alpha at the silhouette. */
13
+ readonly alpha: number;
14
+ readonly color: number;
15
+ /** Blur radius in screen pixels. */
16
+ readonly spread: number;
17
+ }
18
+ /**
19
+ * Mask halo presentation contract.
20
+ *
21
+ * The halo renderer consumes semantic detections with masks and returns a
22
+ * glow instruction per detection, or `undefined` to skip one. Halos are
23
+ * presentation only: never pickable or editable, and they reuse the prepared
24
+ * mask artifact without invalidating it.
25
+ */
26
+ export interface MaskHaloStyle {
27
+ resolve(detection: Detection, context: MaskHaloStyleContext): MaskHaloDrawInstruction | undefined;
28
+ }
29
+ //# sourceMappingURL=mask-halo-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-halo-style.d.ts","sourceRoot":"","sources":["../../src/types/mask-halo-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC,yCAAyC;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,oBAAoB,GAC5B,uBAAuB,GAAG,SAAS,CAAC;CACxC"}
@@ -1,16 +1,21 @@
1
1
  import type { DetectionBufferState } from "#types/detection-timeline";
2
2
  import type { DetectionFrame } from "#types/detections";
3
3
  import type { BoxStyle } from "#types/box-style";
4
+ import type { BoxCornerStyle } from "#types/box-corner-style";
4
5
  import type { FocusStyle } from "#types/focus-style";
5
6
  import type { InteractionStyle } from "#types/interaction-style";
6
7
  import type { LabelStyle } from "#types/label-style";
8
+ import type { MaskHaloStyle } from "#types/mask-halo-style";
7
9
  import type { MaskStyle } from "#types/mask-style";
10
+ import type { MarkerStyle } from "#types/marker-style";
8
11
  import type { Point } from "#types/detections";
9
12
  import type { ViewportTransform } from "#types/viewport";
10
13
  import type { PolygonStyle } from "#types/polygon-style";
11
14
  import type { PolylineStyle } from "#types/polyline-style";
15
+ import type { EllipseStyle } from "#types/ellipse-style";
12
16
  import type { KeypointStyle } from "#types/keypoint-style";
13
17
  import type { AnnotationOverlayStyle } from "#types/editing";
18
+ import type { AnnotationRenderer } from "#types/annotation-renderer";
14
19
  export declare enum MediaRendererFit {
15
20
  /**
16
21
  * Preserve media aspect ratio and fit the full frame inside the canvas.
@@ -91,6 +96,13 @@ export interface MediaRendererDiagnosticsOptions {
91
96
  * it permanently in latency-sensitive apps unless needed.
92
97
  */
93
98
  readonly frameTimings?: boolean;
99
+ /** Receives browser asset failures without failing media playback. */
100
+ readonly onAssetError?: (error: MediaRendererAssetError) => void;
101
+ }
102
+ export interface MediaRendererAssetError {
103
+ readonly rendererId: string;
104
+ readonly src: string;
105
+ readonly error: unknown;
94
106
  }
95
107
  /**
96
108
  * Snapshot of the opened media source.
@@ -136,7 +148,7 @@ export interface MediaRendererState {
136
148
  readonly source: MediaSourceState;
137
149
  }
138
150
  /**
139
- * Current presentation styles used by renderer layers.
151
+ * Current annotation renderer, interaction, visibility, and scene presentation.
140
152
  */
141
153
  export interface MediaRendererPresentation {
142
154
  /**
@@ -146,13 +158,26 @@ export interface MediaRendererPresentation {
146
158
  */
147
159
  readonly backgroundColor?: number;
148
160
  readonly annotationOverlayStyle?: AnnotationOverlayStyle | null;
161
+ /**
162
+ * Built-in renderers that contribute semantic annotations to the
163
+ * renderer-owned scene. When present, this list selects the enabled
164
+ * built-in layers. Style-backed descriptors resolve into their established
165
+ * presentation fields, while direct descriptors such as `region` retain
166
+ * their semantic configuration for the backend. Existing style fields remain
167
+ * supported for compatibility and source-specific presentation overrides.
168
+ */
169
+ readonly renderers?: readonly AnnotationRenderer[];
149
170
  readonly boxStyle?: BoxStyle | null;
171
+ readonly boxCornerStyle?: BoxCornerStyle | null;
150
172
  readonly focusStyle?: FocusStyle | null;
151
173
  readonly interactionStyle?: InteractionStyle | null;
152
174
  readonly labelStyle?: LabelStyle | null;
175
+ readonly maskHaloStyle?: MaskHaloStyle | null;
153
176
  readonly maskStyle?: MaskStyle | null;
177
+ readonly markerStyle?: MarkerStyle | null;
154
178
  readonly polygonStyle?: PolygonStyle | null;
155
179
  readonly polylineStyle?: PolylineStyle | null;
180
+ readonly ellipseStyle?: EllipseStyle | null;
156
181
  readonly keypointStyle?: KeypointStyle | null;
157
182
  readonly visibility?: AnnotationVisibility;
158
183
  }
@@ -1 +1 @@
1
- {"version":3,"file":"media-rendering.d.ts","sourceRoot":"","sources":["../../src/types/media-rendering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,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,eAAe,CAAC,YAAY,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC/D,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACtD,qBAAqB,CAAC,CAAC,WAAW,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACnE,oBAAoB,CAAC,IAAI,iBAAiB,CAAC;IAC3C,oBAAoB,CAAC,CACnB,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC,GACpD,IAAI,CAAC;IACR,iBAAiB,CAAC,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;IACpC,aAAa,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;IACpC,aAAa,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7C,cAAc,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACpD,qBAAqB,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3D,uBAAuB,IAAI,cAAc,GAAG,IAAI,CAAC;IACjD,QAAQ,IAAI,kBAAkB,CAAC;CAChC"}
@@ -0,0 +1,36 @@
1
+ /** Alignment for strokes applied to closed rendered geometry. */
2
+ export declare enum StrokeAlignment {
3
+ Inside = "inside",
4
+ Center = "center",
5
+ Outside = "outside"
6
+ }
7
+ /** Shape used at the exposed endpoints of an open stroke. */
8
+ export type StrokeCap = "butt" | "round" | "square";
9
+ /** Shape used where consecutive stroke segments meet. */
10
+ export type StrokeJoin = "bevel" | "miter" | "round";
11
+ /** Renderer-neutral stroke paint shared by boxes, paths, and shape primitives. */
12
+ export interface StrokeStyle {
13
+ readonly color: number;
14
+ readonly alpha: number;
15
+ readonly width: number;
16
+ readonly alignment?: StrokeAlignment;
17
+ readonly cap?: StrokeCap;
18
+ readonly join?: StrokeJoin;
19
+ /** Maximum miter length as a multiple of the stroke width. */
20
+ readonly miterLimit?: number;
21
+ /** Alternating dash and gap lengths in screen pixels. */
22
+ readonly dash?: readonly number[];
23
+ }
24
+ /**
25
+ * Stroke paint for open geometry. Alignment is intentionally unavailable:
26
+ * inside and outside have no stable meaning without a closed region.
27
+ */
28
+ export type OpenStrokeStyle = Omit<StrokeStyle, "alignment"> & {
29
+ readonly alignment?: never;
30
+ };
31
+ /** Renderer-neutral fill paint shared by closed geometry. */
32
+ export interface FillStyle {
33
+ readonly color: number;
34
+ readonly alpha: number;
35
+ }
36
+ //# sourceMappingURL=paint-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paint-style.d.ts","sourceRoot":"","sources":["../../src/types/paint-style.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,oBAAY,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED,6DAA6D;AAC7D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpD,yDAAyD;AACzD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAErD,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC;IACrC,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B,8DAA8D;IAC9D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,yDAAyD;IACzD,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG;IAC7D,QAAQ,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC;CAC5B,CAAC;AAEF,6DAA6D;AAC7D,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB"}
@@ -0,0 +1,112 @@
1
+ import type { Detection, Point } from "#types/detections";
2
+ import type { FillStyle, OpenStrokeStyle, StrokeStyle } from "#types/paint-style";
3
+ import type { AnnotationStyleContext } from "#types/style";
4
+ /**
5
+ * Discriminator for renderer-neutral shape draw instructions.
6
+ */
7
+ export declare enum ShapeInstructionKind {
8
+ Ellipse = "ellipse",
9
+ Marker = "marker",
10
+ Path = "path"
11
+ }
12
+ export declare enum MarkerShape {
13
+ Circle = "circle",
14
+ Cross = "cross",
15
+ Square = "square",
16
+ Triangle = "triangle"
17
+ }
18
+ /**
19
+ * Coordinate space for marker sizing. Media sizes scale with the viewport;
20
+ * screen sizes stay constant on screen, matching stroke-width semantics.
21
+ */
22
+ export declare enum MarkerSizeSpace {
23
+ Media = "media",
24
+ Screen = "screen"
25
+ }
26
+ /**
27
+ * Ellipse or elliptical arc in media coordinates.
28
+ *
29
+ * Omitting both angles draws a closed ellipse. Angles are radians measured
30
+ * from the positive x axis before `rotation` is applied.
31
+ */
32
+ interface EllipseShapeInstructionBase {
33
+ readonly kind: ShapeInstructionKind.Ellipse;
34
+ readonly center: Point;
35
+ readonly radiusX: number;
36
+ readonly radiusY: number;
37
+ /** Rotation in radians around the center. */
38
+ readonly rotation?: number;
39
+ }
40
+ export interface ClosedEllipseShapeInstruction extends EllipseShapeInstructionBase {
41
+ readonly startAngle?: never;
42
+ readonly endAngle?: never;
43
+ readonly fill?: FillStyle;
44
+ readonly stroke?: StrokeStyle;
45
+ }
46
+ export interface EllipseArcShapeInstruction extends EllipseShapeInstructionBase {
47
+ readonly startAngle: number;
48
+ readonly endAngle: number;
49
+ readonly fill?: never;
50
+ readonly stroke?: OpenStrokeStyle;
51
+ }
52
+ export type EllipseShapeInstruction = ClosedEllipseShapeInstruction | EllipseArcShapeInstruction;
53
+ /**
54
+ * Anchored marker at a media-space point.
55
+ *
56
+ * At rotation `0` a triangle points toward positive y (down in media space).
57
+ * `center` is always the geometric center; semantic anchoring belongs to the
58
+ * renderer that creates this lower-level instruction.
59
+ */
60
+ interface MarkerShapeInstructionBase {
61
+ readonly kind: ShapeInstructionKind.Marker;
62
+ readonly center: Point;
63
+ /** Marker diameter in the declared size space. */
64
+ readonly size: number;
65
+ readonly sizeSpace: MarkerSizeSpace;
66
+ /** Rotation in radians around the center. */
67
+ readonly rotation?: number;
68
+ }
69
+ export interface ClosedMarkerShapeInstruction extends MarkerShapeInstructionBase {
70
+ readonly shape: MarkerShape.Circle | MarkerShape.Square | MarkerShape.Triangle;
71
+ readonly fill?: FillStyle;
72
+ readonly stroke?: StrokeStyle;
73
+ }
74
+ export interface CrossMarkerShapeInstruction extends MarkerShapeInstructionBase {
75
+ readonly shape: MarkerShape.Cross;
76
+ readonly fill?: never;
77
+ readonly stroke?: OpenStrokeStyle;
78
+ }
79
+ export type MarkerShapeInstruction = ClosedMarkerShapeInstruction | CrossMarkerShapeInstruction;
80
+ /**
81
+ * One or more disconnected subpaths sharing a single style.
82
+ */
83
+ interface PathShapeInstructionBase {
84
+ readonly kind: ShapeInstructionKind.Path;
85
+ readonly segments: readonly (readonly Point[])[];
86
+ }
87
+ export interface ClosedPathShapeInstruction extends PathShapeInstructionBase {
88
+ readonly closed: true;
89
+ readonly fill?: FillStyle;
90
+ readonly stroke: StrokeStyle;
91
+ }
92
+ export interface OpenPathShapeInstruction extends PathShapeInstructionBase {
93
+ readonly closed: false;
94
+ readonly fill?: never;
95
+ readonly stroke: OpenStrokeStyle;
96
+ }
97
+ export type PathShapeInstruction = ClosedPathShapeInstruction | OpenPathShapeInstruction;
98
+ export type ShapeDrawInstruction = EllipseShapeInstruction | MarkerShapeInstruction | PathShapeInstruction;
99
+ export type ShapeStyleContext = AnnotationStyleContext;
100
+ /**
101
+ * Shape decoration contract.
102
+ *
103
+ * A style receives semantic detections and returns renderer-neutral shape
104
+ * instructions derived from them. Shape decorations are presentation only:
105
+ * they are not pickable and never become editable annotations. Return
106
+ * `undefined` or an empty array to skip a detection.
107
+ */
108
+ export interface ShapeStyle {
109
+ resolve(detection: Detection, context: ShapeStyleContext): readonly ShapeDrawInstruction[] | undefined;
110
+ }
111
+ export {};
112
+ //# sourceMappingURL=shape-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape-style.d.ts","sourceRoot":"","sources":["../../src/types/shape-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EACV,SAAS,EACT,eAAe,EACf,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED;;;GAGG;AACH,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED;;;;;GAKG;AACH,UAAU,2BAA2B;IACnC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,6CAA6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,CAAC,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;CACnC;AAED,MAAM,MAAM,sBAAsB,GAChC,4BAA4B,GAAG,2BAA2B,CAAC;AAE7D;;GAEG;AACH,UAAU,wBAAwB;IAChC,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC,IAAI,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,SAAS,KAAK,EAAE,CAAC,EAAE,CAAC;CAClD;AAED,MAAM,WAAW,0BAA2B,SAAQ,wBAAwB;IAC1E,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED,MAAM,WAAW,wBAAyB,SAAQ,wBAAwB;IACxE,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,MAAM,oBAAoB,GAC9B,0BAA0B,GAAG,wBAAwB,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAC9B,uBAAuB,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAE1E,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,CACL,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,iBAAiB,GACzB,SAAS,oBAAoB,EAAE,GAAG,SAAS,CAAC;CAChD"}
@@ -0,0 +1,50 @@
1
+ import type { Point } from "#types/detections";
2
+ import { MarkerShape, MarkerSizeSpace } from "#types/shape-style";
3
+ export interface EllipseGeometry {
4
+ readonly center: Point;
5
+ readonly radiusX: number;
6
+ readonly radiusY: number;
7
+ readonly rotation?: number;
8
+ readonly startAngle?: number;
9
+ readonly endAngle?: number;
10
+ }
11
+ export interface MarkerGeometryInput {
12
+ readonly center: Point;
13
+ readonly shape: MarkerShape;
14
+ readonly size: number;
15
+ readonly sizeSpace: MarkerSizeSpace;
16
+ readonly rotation?: number;
17
+ }
18
+ export interface SampledShapePath {
19
+ readonly closed: boolean;
20
+ readonly points: readonly Point[];
21
+ }
22
+ /**
23
+ * Samples an ellipse or elliptical arc into a deterministic polyline so every
24
+ * backend rasterizes the same structural geometry, including dashed strokes.
25
+ *
26
+ * A closed ellipse returns `segmentCount` points without repeating the first
27
+ * point; an open arc returns `segmentCount + 1` points including both
28
+ * endpoints.
29
+ */
30
+ export declare function sampleEllipseArc(ellipse: EllipseGeometry, segmentCount?: number): SampledShapePath;
31
+ /**
32
+ * Chooses a bounded segment count from the ellipse's on-screen radius. The
33
+ * result targets sub-pixel chord error without making tiny markers expensive.
34
+ */
35
+ export declare function resolveEllipseSegmentCount(ellipse: EllipseGeometry, viewportScale?: number, maxErrorPixels?: number): number;
36
+ export type MarkerGeometry = {
37
+ readonly kind: "circle";
38
+ readonly center: Point;
39
+ readonly radius: number;
40
+ } | {
41
+ readonly kind: "subpaths";
42
+ readonly closed: boolean;
43
+ readonly subpaths: readonly (readonly Point[])[];
44
+ };
45
+ /**
46
+ * Resolves a marker instruction into media-space geometry. Screen-space sizes
47
+ * are divided by the viewport scale, matching stroke-width semantics.
48
+ */
49
+ export declare function resolveMarkerGeometry(marker: MarkerGeometryInput, viewportScale?: number): MarkerGeometry;
50
+ //# sourceMappingURL=shape-geometry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shape-geometry.d.ts","sourceRoot":"","sources":["../../src/utils/shape-geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,oB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S,CAAC,SAAS,KAAK,EAAE,CAAC,EAAE,CAAC;CAClD,CAAC;AAEN;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,mBAAmB,EAC3B,aAAa,SAAI,GAChB,cAAc,CAmEhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supervision",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Browser-native computer vision media rendering and annotation engine.",
5
5
  "repository": {
6
6
  "type": "git",