@vitavision/overlays 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,512 @@
1
+ import { AreaSetItem, GridNode, MarkerShape, OverlayRole, PointSetItem, StagePointerEvent } from "@vitavision/stage2d";
2
+ //#region src/model.d.ts
3
+ /**
4
+ * The input model: one detection run, independent of the library that produced it.
5
+ *
6
+ * Every detector in the vitavision family (calib-targets' chessboard, ChArUco, marker board and
7
+ * PuzzleBoard, ringgrid, chess-corners) returns its own result shape. An app maps that shape to a
8
+ * `TargetDetection` once, and the overlay never learns which library ran. Nothing here imports a
9
+ * detector package: these are plain data types.
10
+ *
11
+ * Conventions, the same as `@vitavision/stage2d`:
12
+ * - Positions are **image pixels, with the centre of pixel `i` at coordinate `i`** (the frame
13
+ * the WASM detectors report, `image_px_center`). The stage places them; do not add 0.5.
14
+ * - `y` points down. Angles are **radians, clockwise on screen** (from +x towards +y).
15
+ * - Lengths named `rx`, `ry` and `radius` are image pixels, so they scale with the image.
16
+ *
17
+ * Pure: no React, no DOM.
18
+ */
19
+ /** An item's identity. Ids are unique within one detection, across corners, markers, circles and rings. */
20
+ type TargetId = string | number;
21
+ /** What a detection is of. It chooses defaults, not what is drawn: whatever is present is drawn. */
22
+ type TargetKind = "chessboard" | "charuco" | "markerboard" | "puzzleboard" | "ringgrid" | "corners" | "circles";
23
+ /** Every `TargetKind`. */
24
+ export declare const TARGET_KINDS: readonly TargetKind[];
25
+ /**
26
+ * Whether a detection of this kind draws lattice edges between corner neighbours.
27
+ *
28
+ * @param kind - The detection's kind.
29
+ * @returns `true` for the four calibration boards, `false` for loose corners, circles and rings.
30
+ */
31
+ export declare function isLatticeKind(kind: TargetKind): boolean;
32
+ /** One detected corner or X-junction. */
33
+ interface TargetCorner {
34
+ /** Its identity. Callbacks report this id back. */
35
+ id: TargetId;
36
+ /** Horizontal position, image pixels. */
37
+ x: number;
38
+ /** Vertical position, image pixels. */
39
+ y: number;
40
+ /** Lattice index along the first board axis, an integer. Absent for a corner with no place on a board. */
41
+ i?: number | undefined;
42
+ /** Lattice index along the second board axis, an integer. */
43
+ j?: number | undefined;
44
+ /**
45
+ * The detector's confidence. It is carried for the app (a list, a filter) and never drawn as a
46
+ * colour: a score is not a verdict (visual-language §5).
47
+ */
48
+ score?: number | undefined;
49
+ /** Orientation of the first edge through the corner, radians. Axes are lines, so `angle` and `angle + π` are the same. */
50
+ angle?: number | undefined;
51
+ /** Orientation of the second edge through the corner, radians. Needs `angle`. */
52
+ angle2?: number | undefined;
53
+ /** Text beside it. Defaults to the lattice index `i,j` on a board, else the id. */
54
+ label?: string | undefined;
55
+ }
56
+ /** One decoded fiducial marker (ArUco, AprilTag): a quad. */
57
+ interface TargetMarker {
58
+ /** Its identity. For an ArUco marker, usually its dictionary id. */
59
+ id: TargetId;
60
+ /**
61
+ * The quad's corners in the marker's own order, `[x0, y0, x1, y1, x2, y2, x3, y3]`. Corner 0 is
62
+ * ticked, so the order reads as the marker's orientation.
63
+ */
64
+ corners: readonly number[];
65
+ /** Text drawn inside it. Defaults to the id. */
66
+ label?: string | undefined;
67
+ }
68
+ /** The printed colour of a circle in a marker board. */
69
+ type CirclePolarity = "white" | "black";
70
+ /** One detected circle of a marker board, matched or not to the board model. */
71
+ interface TargetCircle {
72
+ /** Its identity. */
73
+ id: TargetId;
74
+ /** Centre x, image pixels. */
75
+ x: number;
76
+ /** Centre y, image pixels. */
77
+ y: number;
78
+ /** Printed polarity. It is drawn as a shape (hollow ring, or ring with a centre dot), not as a colour. */
79
+ polarity: CirclePolarity;
80
+ /** The board cell it matched, first axis. */
81
+ i?: number | undefined;
82
+ /** The board cell it matched, second axis. */
83
+ j?: number | undefined;
84
+ /** Text beside it. Defaults to `(i, j)` when both are set. */
85
+ label?: string | undefined;
86
+ }
87
+ /** A fitted ellipse. */
88
+ interface TargetEllipse {
89
+ /** Semi-axis along the rotated x axis, image pixels. */
90
+ rx: number;
91
+ /** Semi-axis along the rotated y axis, image pixels. */
92
+ ry: number;
93
+ /** Rotation of the `rx` axis, radians clockwise on screen. */
94
+ angle: number;
95
+ }
96
+ /** One ring marker of a ring grid: two concentric fitted ellipses and a centre. */
97
+ interface TargetRing {
98
+ /** Its identity. */
99
+ id: TargetId;
100
+ /** Centre x, image pixels. */
101
+ x: number;
102
+ /** Centre y, image pixels. */
103
+ y: number;
104
+ /** The outer edge of the ring. */
105
+ outer: TargetEllipse;
106
+ /** The inner edge of the ring, when the detector fitted one. */
107
+ inner?: TargetEllipse | undefined;
108
+ /** Text beside the centre. Defaults to the id. */
109
+ label?: string | undefined;
110
+ }
111
+ /**
112
+ * One decoded bit of a PuzzleBoard, drawn as a dot on the edge between two corners.
113
+ * `edgeBitsFromPuzzleboard` builds these from a PuzzleBoard result.
114
+ */
115
+ interface TargetEdgeBit {
116
+ /** Its identity. Not reported by callbacks: edge bits are not picked. */
117
+ id: TargetId;
118
+ /** Midpoint x of the edge, image pixels. */
119
+ x: number;
120
+ /** Midpoint y of the edge, image pixels. */
121
+ y: number;
122
+ /** The dot's radius, image pixels: about a quarter of the edge. */
123
+ radius: number;
124
+ /** The decoded bit. 1 is a solid dot, 0 a dashed one. */
125
+ bit: 0 | 1;
126
+ /** Decode confidence in [0, 1]. It sets the dot's opacity. */
127
+ confidence: number;
128
+ }
129
+ /** One detection run: what a detector found in one image. */
130
+ interface TargetDetection {
131
+ /** What was detected. */
132
+ kind: TargetKind;
133
+ /** Corners and X-junctions. */
134
+ corners?: readonly TargetCorner[] | undefined;
135
+ /** Decoded fiducial markers. */
136
+ markers?: readonly TargetMarker[] | undefined;
137
+ /** Marker-board circles. */
138
+ circles?: readonly TargetCircle[] | undefined;
139
+ /** Ring markers. */
140
+ rings?: readonly TargetRing[] | undefined;
141
+ /** PuzzleBoard edge bits. */
142
+ edgeBits?: readonly TargetEdgeBit[] | undefined;
143
+ }
144
+ /** The part of a detection an item belongs to. */
145
+ type TargetPart = "corner" | "marker" | "circle" | "ring";
146
+ /** Which item the pointer is on. */
147
+ interface TargetHit {
148
+ /** The item's id, as given in the detection. */
149
+ id: TargetId;
150
+ /** The collection it came from. */
151
+ part: TargetPart;
152
+ }
153
+ //#endregion
154
+ //#region src/TargetOverlay.d.ts
155
+ /** Props of `TargetOverlay`. */
156
+ interface TargetOverlayProps {
157
+ /** The detection to draw. Pass a stable object: a new one rebuilds every layer's index. */
158
+ detection: TargetDetection;
159
+ /** Draw the lattice edges between neighbouring corners, one dashed axis and one solid. On by default. */
160
+ showEdges?: boolean | undefined;
161
+ /** Show labels (lattice indices, marker ids, ring ids) where the zoom leaves room for them. On by default. */
162
+ showLabels?: boolean | undefined;
163
+ /**
164
+ * The hovered id, when the app controls hover (a list beside the stage hovers items too). It
165
+ * applies to every part that has the id; keep ids unique within a detection.
166
+ */
167
+ hoveredId?: TargetId | null | undefined;
168
+ /** The selected ids, drawn at 2.5 px in the selection colour; points get a ring. */
169
+ selectedIds?: Iterable<TargetId> | undefined;
170
+ /**
171
+ * Called when the item under the pointer changes, once per change; `null` when it leaves every
172
+ * item. The `id` is the one given in the detection, so the app maps it back to its feature.
173
+ */
174
+ onHoverChange?: ((hit: TargetHit | null) => void) | undefined;
175
+ /**
176
+ * A press landed on an item. Setting it makes the layers claim presses on their items, so the
177
+ * stage does not pan from them. A mounted `StageSurface` hears a press first; there, ask
178
+ * `useStageHitTest` what is under it instead.
179
+ */
180
+ onItemPress?: ((hit: TargetHit, event: StagePointerEvent) => void) | undefined;
181
+ /**
182
+ * Dim the whole overlay (`true`), or the listed ids, or those a predicate accepts, to 35 %
183
+ * opacity. They still take hover and presses. Pass a stable value: a new one re-batches.
184
+ */
185
+ dimmed?: boolean | Iterable<TargetId> | ((id: TargetId) => boolean) | undefined;
186
+ /** Prefix of the hit-test layer ids (`<prefix>-corners`, `-markers`, `-circles`, `-rings`). Defaults to generated ids. */
187
+ layerIdPrefix?: string | undefined;
188
+ }
189
+ /**
190
+ * A detected calibration target inside an `ImageStage`.
191
+ *
192
+ * - **Batched**: one path per appearance in each layer, picking through spatial indices. Labels
193
+ * appear only where items are 24 screen px apart, at most 200 at a time.
194
+ * - **States**: hover 2 px, selected 2.5 px in the selection colour with a ring, dimmed at 35 %.
195
+ * - **Colour**: roles only (`feature`, `model`, `structure`, `selection`). Scores are never drawn
196
+ * as red, amber or green; polarity and bits are carried by shape (hollow or dotted, solid or
197
+ * dashed), not by hue.
198
+ * - **Callbacks** report `{ id, part }` with the id from the detection. A press and a hover move
199
+ * between layers (a corner, then the marker under it) without a flicker: the change is reported
200
+ * once.
201
+ *
202
+ * The layers it renders carry their own accessible names ("Corners: 54 points, 0 selected").
203
+ */
204
+ export declare function TargetOverlay({ detection, showEdges, showLabels, hoveredId, selectedIds, onHoverChange, onItemPress, dimmed, layerIdPrefix }: TargetOverlayProps): import("react").JSX.Element;
205
+ //#endregion
206
+ //#region src/EllipseSet.d.ts
207
+ /** One ellipse of an `EllipseSet`. */
208
+ interface EllipseSetItem {
209
+ /** Its identity, for hover, selection and dimming. */
210
+ id: TargetId;
211
+ /** Centre x, image pixels. */
212
+ x: number;
213
+ /** Centre y, image pixels. */
214
+ y: number;
215
+ /** Semi-axis along the rotated x axis, image pixels. */
216
+ rx: number;
217
+ /** Semi-axis along the rotated y axis, image pixels. */
218
+ ry: number;
219
+ /** Rotation of the `rx` axis, radians clockwise on screen. Defaults to 0. */
220
+ angle?: number | undefined;
221
+ /** The overlay role it is painted in. Defaults to the layer's `role`. */
222
+ role?: OverlayRole | undefined;
223
+ /** Draw it dashed (4 3 screen px), so two kinds differ by more than colour. */
224
+ dashed?: boolean | undefined;
225
+ /** Opacity in [0, 1], rounded to a tenth so ellipses still share paths. Defaults to 1. */
226
+ opacity?: number | undefined;
227
+ }
228
+ /** Props of `EllipseSet`. */
229
+ interface EllipseSetProps {
230
+ /** The ellipses, in image coordinates. */
231
+ items: readonly EllipseSetItem[];
232
+ /** The role of an item that names none. Defaults to `"feature"`. */
233
+ role?: OverlayRole | undefined;
234
+ /** The hovered id: its ellipses are drawn at 2 px. */
235
+ hoveredId?: TargetId | null | undefined;
236
+ /** The selected ids, drawn at 2.5 px in the selection colour. */
237
+ selectedIds?: Iterable<TargetId> | undefined;
238
+ /** Ids drawn at 35 % opacity, as a set or a predicate. Pass a stable value: a new one re-batches the layer. */
239
+ dimmed?: Iterable<TargetId> | ((id: TargetId) => boolean) | undefined;
240
+ /** Draw the dark band under every stroke. On by default. */
241
+ halo?: boolean | undefined;
242
+ /**
243
+ * The smallest semi-axis, in screen pixels: a dot whose data size would vanish at the fitted
244
+ * zoom is still drawn this large. Omit for none.
245
+ */
246
+ minRadius?: number | undefined;
247
+ /** CSS colour of selected ellipses. Defaults to the overlay `selection` role. */
248
+ selectionStroke?: string | undefined;
249
+ /** Name the layer as an image for assistive technology. Without it the layer is decorative (`aria-hidden`). */
250
+ label?: string | undefined;
251
+ }
252
+ /**
253
+ * A batched set of ellipses inside an `ImageStage`.
254
+ *
255
+ * - **Geometry** is data: `rx`, `ry` and the centre are image pixels and scale with the image;
256
+ * the stroke is a screen constant.
257
+ * - **States** follow visual-language §5: 1.5 screen px (1 for `model` and `structure`), hover
258
+ * 2, selected 2.5 in the selection colour, dimmed at 35 % opacity. Every stroke has a halo.
259
+ * - **Batching** is by (role, dash, opacity, dimming): a thousand rings are a dozen elements.
260
+ *
261
+ * The SVG carries `data-ellipses` (the count).
262
+ */
263
+ export declare function EllipseSet({ items, role, hoveredId, selectedIds, dimmed, halo, minRadius, selectionStroke, label }: EllipseSetProps): import("react").JSX.Element;
264
+ //#endregion
265
+ //#region src/lattice.d.ts
266
+ /** A corner that has a place on the board. */
267
+ type GridCorner = TargetCorner & {
268
+ i: number;
269
+ j: number;
270
+ };
271
+ /** The extent of a lattice, inclusive. */
272
+ interface GridBounds {
273
+ /** Smallest `i`. */
274
+ minI: number;
275
+ /** Largest `i`. */
276
+ maxI: number;
277
+ /** Smallest `j`. */
278
+ minJ: number;
279
+ /** Largest `j`. */
280
+ maxJ: number;
281
+ }
282
+ /** The corners of a board, indexed by lattice position. */
283
+ interface CornerGrid {
284
+ /** The corners with an integer `(i, j)`, in input order. A repeated `(i, j)` keeps its first corner. */
285
+ nodes: readonly GridCorner[];
286
+ /** Position in `nodes` by `gridKey(i, j)`. */
287
+ byIndex: ReadonlyMap<string, number>;
288
+ /** Positions in `nodes` grouped by `i` (ascending), each group sorted by `j`. */
289
+ rows: readonly (readonly number[])[];
290
+ /** Positions in `nodes` grouped by `j` (ascending), each group sorted by `i`. */
291
+ cols: readonly (readonly number[])[];
292
+ /** The extent, or `null` for an empty grid. */
293
+ bounds: GridBounds | null;
294
+ }
295
+ /** A segment between two neighbouring corners. */
296
+ interface GridSegment {
297
+ /** Id of the end with the lower index along the edge's axis. */
298
+ a: TargetId;
299
+ /** Id of the end with the higher index. */
300
+ b: TargetId;
301
+ /** Start x. */
302
+ x1: number;
303
+ /** Start y. */
304
+ y1: number;
305
+ /** End x. */
306
+ x2: number;
307
+ /** End y. */
308
+ y2: number;
309
+ }
310
+ /** A marker as a closed polygon. */
311
+ interface MarkerPolygon {
312
+ /** The marker's id. */
313
+ id: TargetId;
314
+ /** Flat `[x0, y0, x1, y1, …]`; the last vertex joins the first. */
315
+ points: number[];
316
+ /** The mean of the vertices. */
317
+ centre: {
318
+ x: number;
319
+ y: number;
320
+ };
321
+ /** The marker's own label, if it has one. */
322
+ label?: string | undefined;
323
+ }
324
+ /**
325
+ * The key of a lattice position, as `idByGrid` and `CornerGrid.byIndex` use.
326
+ *
327
+ * @param i - Index along the first axis.
328
+ * @param j - Index along the second axis.
329
+ * @returns `"i:j"`.
330
+ */
331
+ export declare function gridKey(i: number, j: number): string;
332
+ /**
333
+ * Index a board's corners by lattice position.
334
+ *
335
+ * Corners without an integer `(i, j)` are not part of the grid. When two corners claim one
336
+ * position the first wins, as it does in `latticeEdges`.
337
+ *
338
+ * @param corners - The detected corners, in any order, with gaps allowed.
339
+ * @returns The grid.
340
+ */
341
+ export declare function cornerGrid(corners: readonly TargetCorner[]): CornerGrid;
342
+ /**
343
+ * The edges between neighbouring corners of a grid: `(i, j)` to `(i, j + 1)` are the row edges,
344
+ * `(i, j)` to `(i + 1, j)` the column edges. A missed corner leaves a gap, never a long edge.
345
+ * It is `latticeEdges` from `@vitavision/stage2d` with positions attached.
346
+ *
347
+ * @param grid - From `cornerGrid`.
348
+ * @returns The two edge lists.
349
+ */
350
+ export declare function gridEdges(grid: CornerGrid): {
351
+ rowEdges: GridSegment[];
352
+ colEdges: GridSegment[];
353
+ };
354
+ /**
355
+ * The id of the corner at each lattice position, to map a board cell back to an app's feature.
356
+ *
357
+ * @param corners - The detected corners.
358
+ * @returns Ids by `gridKey(i, j)`. A corner without an integer index is left out; the first of two sharing a position wins.
359
+ */
360
+ export declare function idByGrid(corners: readonly TargetCorner[]): Map<string, TargetId>;
361
+ /**
362
+ * The markers as polygons, with their centres.
363
+ *
364
+ * @param markers - The detected markers.
365
+ * @returns A polygon per marker that has at least three finite vertices; the others are dropped.
366
+ */
367
+ export declare function markerPolygons(markers: readonly TargetMarker[]): MarkerPolygon[];
368
+ //#endregion
369
+ //#region src/puzzleboard.d.ts
370
+ /** The period of the PuzzleBoard master pattern. */
371
+ export declare const PUZZLEBOARD_PERIOD = 501;
372
+ /** One observed edge of a PuzzleBoard decode. */
373
+ interface PuzzleboardEdge {
374
+ /** Row of the edge's first corner, in the image's local frame. */
375
+ row: number;
376
+ /** Column of the edge's first corner, in the image's local frame. */
377
+ col: number;
378
+ /** `"horizontal"` joins local `(col, row)` to `(col + 1, row)`; `"vertical"` to `(col, row + 1)`. */
379
+ orientation: "horizontal" | "vertical";
380
+ /** The decoded bit. */
381
+ bit: 0 | 1;
382
+ /** Decode confidence, [0, 1]. */
383
+ confidence: number;
384
+ }
385
+ /** The map from the local frame to master indices: `master = M · local + translation`, modulo the period. */
386
+ interface PuzzleboardAlignment {
387
+ /** The 2×2 integer matrix `[[a, b], [c, d]]`, acting on local `(i, j)`. */
388
+ transform: {
389
+ a: number;
390
+ b: number;
391
+ c: number;
392
+ d: number;
393
+ };
394
+ /** The translation, added after the matrix. */
395
+ translation: readonly [number, number];
396
+ }
397
+ /**
398
+ * The edge bits of a PuzzleBoard decode, placed on the image.
399
+ *
400
+ * An edge is dropped when either of its corners was not detected. Each dot sits at the midpoint
401
+ * of its edge with a radius of a quarter of the edge's length (the bump is about half an edge
402
+ * wide); its opacity is the app's to take from `confidence`.
403
+ *
404
+ * @param edges - The observed edges.
405
+ * @param corners - The labelled corners, whose `i` and `j` are **master** indices.
406
+ * @param alignment - The local-to-master map.
407
+ * @param period - The master pattern's period. Defaults to 501.
408
+ * @returns One `TargetEdgeBit` per edge whose corners were both found, in input order. Empty when there is no alignment.
409
+ */
410
+ export declare function edgeBitsFromPuzzleboard(edges: readonly PuzzleboardEdge[], corners: readonly TargetCorner[], alignment: PuzzleboardAlignment | null | undefined, period?: number): TargetEdgeBit[];
411
+ //#endregion
412
+ //#region src/glyphs.d.ts
413
+ /**
414
+ * Fold one or two edge directions into the single `angle` number a `MarkerShape` receives.
415
+ *
416
+ * Directions are lines (`θ` and `θ + π` are the same line), so each is taken modulo π. With one
417
+ * direction the result is that angle in [0, π). With two they are quantised to 2⁻²⁶ of a half
418
+ * turn (4.7e-8 rad, under a millionth of a screen pixel on a 10 px glyph) and packed into one
419
+ * integer-valued double above 8, which stays exact because it is below 2⁵³. `unpackAxes` is the
420
+ * inverse.
421
+ *
422
+ * @param angle - The first direction, radians.
423
+ * @param angle2 - The second direction, radians. Optional.
424
+ * @returns A number to put in `PointSetItem.angle` for the `directed` marker.
425
+ */
426
+ export declare function packAxes(angle: number, angle2?: number): number;
427
+ /**
428
+ * The directions folded into `angle` by `packAxes`.
429
+ *
430
+ * @param packed - A value from `packAxes`, or a plain angle in radians.
431
+ * @returns One direction for a plain angle, two for a packed value; each in [0, π).
432
+ */
433
+ export declare function unpackAxes(packed: number): number[];
434
+ /** The marker names `TargetOverlay` uses, to pass to `PointSet`'s `markers`. */
435
+ export declare const TARGET_MARKERS: {
436
+ /** Edge directions of a corner; see `packAxes`. */
437
+ readonly directed: MarkerShape;
438
+ /** A white matched circle. */
439
+ readonly "circle-white": MarkerShape;
440
+ /** A black matched circle. */
441
+ readonly "circle-black": MarkerShape;
442
+ };
443
+ /**
444
+ * An ellipse as two arcs, exactly: no polygon approximation, so it stays round at any zoom.
445
+ *
446
+ * @param cx - Centre x, image pixels.
447
+ * @param cy - Centre y, image pixels.
448
+ * @param rx - Semi-axis along the rotated x axis, image pixels.
449
+ * @param ry - Semi-axis along the rotated y axis, image pixels.
450
+ * @param angle - Rotation of the `rx` axis, radians clockwise on screen.
451
+ * @returns Path data, or `""` for a degenerate ellipse (a non-finite value, or a radius not above zero).
452
+ */
453
+ export declare function ellipsePath(cx: number, cy: number, rx: number, ry: number, angle?: number): string;
454
+ //#endregion
455
+ //#region src/layerItems.d.ts
456
+ /**
457
+ * The nodes of the corner layer.
458
+ *
459
+ * A corner with an `angle` is a `directed` marker (its edge directions, one or two), any other a
460
+ * `plus`. On a board kind the lattice indices are kept, so `GridLayer` joins neighbours; on any
461
+ * other kind they are `NaN`, which `latticeEdges` reads as "not part of a lattice", so no edge is
462
+ * drawn.
463
+ *
464
+ * @param detection - The detection.
465
+ * @returns One node per corner, in order.
466
+ */
467
+ export declare function cornerNodes(detection: TargetDetection): GridNode[];
468
+ /**
469
+ * The regions of the marker layer: each marker's quad, labelled with its text or its id.
470
+ *
471
+ * @param detection - The detection.
472
+ * @returns One area per marker with a usable quad.
473
+ */
474
+ export declare function markerAreas(detection: TargetDetection): AreaSetItem[];
475
+ /**
476
+ * The points of the circle layer. Polarity picks the glyph: `circle-white` is a hollow ring,
477
+ * `circle-black` a ring with a dot.
478
+ *
479
+ * @param detection - The detection.
480
+ * @returns One point per circle.
481
+ */
482
+ export declare function circlePoints(detection: TargetDetection): PointSetItem[];
483
+ /**
484
+ * The points of the ring layer: a `plus` at each centre, picked anywhere inside the outer ellipse
485
+ * (`pickRadius` is the larger semi-axis), labelled with the ring's text or its id.
486
+ *
487
+ * @param rings - The rings.
488
+ * @returns One point per ring.
489
+ */
490
+ export declare function ringCentres(rings: readonly TargetRing[]): PointSetItem[];
491
+ /**
492
+ * The ellipses of the rings' two edges. The outer is `feature`, the inner `model` (a fitted
493
+ * second edge), and the smaller inner one is told from the outer by size as well as by colour.
494
+ *
495
+ * @param rings - The rings.
496
+ * @returns The outer ellipses, and the inner ones of the rings that have one.
497
+ */
498
+ export declare function ringEllipses(rings: readonly TargetRing[]): {
499
+ outer: EllipseSetItem[];
500
+ inner: EllipseSetItem[];
501
+ };
502
+ /**
503
+ * The dots of the edge-bit layer: bit 1 is a solid `feature` circle, bit 0 a dashed `model`
504
+ * one, and the opacity runs from 35 % at confidence 0 to 100 % at confidence 1.
505
+ *
506
+ * @param bits - The edge bits.
507
+ * @returns One ellipse (a circle) per bit.
508
+ */
509
+ export declare function edgeBitEllipses(bits: readonly TargetEdgeBit[]): EllipseSetItem[];
510
+ //#endregion
511
+ export type { CirclePolarity, CornerGrid, EllipseSetItem, EllipseSetProps, GridBounds, GridCorner, GridSegment, MarkerPolygon, PuzzleboardAlignment, PuzzleboardEdge, TargetCircle, TargetCorner, TargetDetection, TargetEdgeBit, TargetEllipse, TargetHit, TargetId, TargetKind, TargetMarker, TargetOverlayProps, TargetPart, TargetRing };
512
+ //# sourceMappingURL=index.d.ts.map