@vitavision/overlays 0.1.0 → 0.2.0
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/README.md +2 -2
- package/dist/index.d.ts +421 -0
- package/dist/index.js +651 -0
- package/dist/index.js.map +1 -0
- package/package.json +4 -4
- package/src/TargetOverlay.tsx +4 -4
- package/src/glyphs.ts +9 -67
- package/src/index.ts +2 -2
- package/src/layerItems.ts +3 -4
- package/src/EllipseSet.tsx +0 -228
package/README.md
CHANGED
|
@@ -68,8 +68,8 @@ States follow the overlay grammar: hover 2 px, selected 2.5 px in the selection
|
|
|
68
68
|
For an app that composes the layers itself:
|
|
69
69
|
|
|
70
70
|
- **Lattice**: `cornerGrid`, `gridEdges`, `idByGrid`, `gridKey`, `markerPolygons` (pure; `gridEdges` is stage2d's `latticeEdges` with positions).
|
|
71
|
-
- **Glyphs**: `TARGET_MARKERS` (`directed`, `circle-white`, `circle-black`) for `PointSet`'s `markers`; `
|
|
72
|
-
- **Layers**: `EllipseSet`, a batched
|
|
71
|
+
- **Glyphs**: `TARGET_MARKERS` (`directed`, `circle-white`, `circle-black`) for `PointSet`'s `markers`; the `directed` marker reads a corner's two edge directions from `PointSetItem.angle` and `angle2`.
|
|
72
|
+
- **Layers**: `EllipseSet` and `ellipsePath`, re-exported from `@vitavision/stage2d`: a batched set of ellipses whose size is data. `TargetOverlay` draws its rings with `pickable={false}`.
|
|
73
73
|
- **Mapping**: `cornerNodes`, `markerAreas`, `circlePoints`, `ringCentres`, `ringEllipses`, `edgeBitEllipses` are the detection-to-layer-items functions `TargetOverlay` uses.
|
|
74
74
|
|
|
75
75
|
## License
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import { AreaSetItem, EllipseSet, EllipseSetItem, EllipseSetItem as EllipseSetItem$1, EllipseSetProps, GridNode, MarkerShape, PointSetItem, StagePointerEvent, ellipsePath } 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/lattice.d.ts
|
|
207
|
+
/** A corner that has a place on the board. */
|
|
208
|
+
type GridCorner = TargetCorner & {
|
|
209
|
+
i: number;
|
|
210
|
+
j: number;
|
|
211
|
+
};
|
|
212
|
+
/** The extent of a lattice, inclusive. */
|
|
213
|
+
interface GridBounds {
|
|
214
|
+
/** Smallest `i`. */
|
|
215
|
+
minI: number;
|
|
216
|
+
/** Largest `i`. */
|
|
217
|
+
maxI: number;
|
|
218
|
+
/** Smallest `j`. */
|
|
219
|
+
minJ: number;
|
|
220
|
+
/** Largest `j`. */
|
|
221
|
+
maxJ: number;
|
|
222
|
+
}
|
|
223
|
+
/** The corners of a board, indexed by lattice position. */
|
|
224
|
+
interface CornerGrid {
|
|
225
|
+
/** The corners with an integer `(i, j)`, in input order. A repeated `(i, j)` keeps its first corner. */
|
|
226
|
+
nodes: readonly GridCorner[];
|
|
227
|
+
/** Position in `nodes` by `gridKey(i, j)`. */
|
|
228
|
+
byIndex: ReadonlyMap<string, number>;
|
|
229
|
+
/** Positions in `nodes` grouped by `i` (ascending), each group sorted by `j`. */
|
|
230
|
+
rows: readonly (readonly number[])[];
|
|
231
|
+
/** Positions in `nodes` grouped by `j` (ascending), each group sorted by `i`. */
|
|
232
|
+
cols: readonly (readonly number[])[];
|
|
233
|
+
/** The extent, or `null` for an empty grid. */
|
|
234
|
+
bounds: GridBounds | null;
|
|
235
|
+
}
|
|
236
|
+
/** A segment between two neighbouring corners. */
|
|
237
|
+
interface GridSegment {
|
|
238
|
+
/** Id of the end with the lower index along the edge's axis. */
|
|
239
|
+
a: TargetId;
|
|
240
|
+
/** Id of the end with the higher index. */
|
|
241
|
+
b: TargetId;
|
|
242
|
+
/** Start x. */
|
|
243
|
+
x1: number;
|
|
244
|
+
/** Start y. */
|
|
245
|
+
y1: number;
|
|
246
|
+
/** End x. */
|
|
247
|
+
x2: number;
|
|
248
|
+
/** End y. */
|
|
249
|
+
y2: number;
|
|
250
|
+
}
|
|
251
|
+
/** A marker as a closed polygon. */
|
|
252
|
+
interface MarkerPolygon {
|
|
253
|
+
/** The marker's id. */
|
|
254
|
+
id: TargetId;
|
|
255
|
+
/** Flat `[x0, y0, x1, y1, …]`; the last vertex joins the first. */
|
|
256
|
+
points: number[];
|
|
257
|
+
/** The mean of the vertices. */
|
|
258
|
+
centre: {
|
|
259
|
+
x: number;
|
|
260
|
+
y: number;
|
|
261
|
+
};
|
|
262
|
+
/** The marker's own label, if it has one. */
|
|
263
|
+
label?: string | undefined;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* The key of a lattice position, as `idByGrid` and `CornerGrid.byIndex` use.
|
|
267
|
+
*
|
|
268
|
+
* @param i - Index along the first axis.
|
|
269
|
+
* @param j - Index along the second axis.
|
|
270
|
+
* @returns `"i:j"`.
|
|
271
|
+
*/
|
|
272
|
+
export declare function gridKey(i: number, j: number): string;
|
|
273
|
+
/**
|
|
274
|
+
* Index a board's corners by lattice position.
|
|
275
|
+
*
|
|
276
|
+
* Corners without an integer `(i, j)` are not part of the grid. When two corners claim one
|
|
277
|
+
* position the first wins, as it does in `latticeEdges`.
|
|
278
|
+
*
|
|
279
|
+
* @param corners - The detected corners, in any order, with gaps allowed.
|
|
280
|
+
* @returns The grid.
|
|
281
|
+
*/
|
|
282
|
+
export declare function cornerGrid(corners: readonly TargetCorner[]): CornerGrid;
|
|
283
|
+
/**
|
|
284
|
+
* The edges between neighbouring corners of a grid: `(i, j)` to `(i, j + 1)` are the row edges,
|
|
285
|
+
* `(i, j)` to `(i + 1, j)` the column edges. A missed corner leaves a gap, never a long edge.
|
|
286
|
+
* It is `latticeEdges` from `@vitavision/stage2d` with positions attached.
|
|
287
|
+
*
|
|
288
|
+
* @param grid - From `cornerGrid`.
|
|
289
|
+
* @returns The two edge lists.
|
|
290
|
+
*/
|
|
291
|
+
export declare function gridEdges(grid: CornerGrid): {
|
|
292
|
+
rowEdges: GridSegment[];
|
|
293
|
+
colEdges: GridSegment[];
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* The id of the corner at each lattice position, to map a board cell back to an app's feature.
|
|
297
|
+
*
|
|
298
|
+
* @param corners - The detected corners.
|
|
299
|
+
* @returns Ids by `gridKey(i, j)`. A corner without an integer index is left out; the first of two sharing a position wins.
|
|
300
|
+
*/
|
|
301
|
+
export declare function idByGrid(corners: readonly TargetCorner[]): Map<string, TargetId>;
|
|
302
|
+
/**
|
|
303
|
+
* The markers as polygons, with their centres.
|
|
304
|
+
*
|
|
305
|
+
* @param markers - The detected markers.
|
|
306
|
+
* @returns A polygon per marker that has at least three finite vertices; the others are dropped.
|
|
307
|
+
*/
|
|
308
|
+
export declare function markerPolygons(markers: readonly TargetMarker[]): MarkerPolygon[];
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/puzzleboard.d.ts
|
|
311
|
+
/** The period of the PuzzleBoard master pattern. */
|
|
312
|
+
export declare const PUZZLEBOARD_PERIOD = 501;
|
|
313
|
+
/** One observed edge of a PuzzleBoard decode. */
|
|
314
|
+
interface PuzzleboardEdge {
|
|
315
|
+
/** Row of the edge's first corner, in the image's local frame. */
|
|
316
|
+
row: number;
|
|
317
|
+
/** Column of the edge's first corner, in the image's local frame. */
|
|
318
|
+
col: number;
|
|
319
|
+
/** `"horizontal"` joins local `(col, row)` to `(col + 1, row)`; `"vertical"` to `(col, row + 1)`. */
|
|
320
|
+
orientation: "horizontal" | "vertical";
|
|
321
|
+
/** The decoded bit. */
|
|
322
|
+
bit: 0 | 1;
|
|
323
|
+
/** Decode confidence, [0, 1]. */
|
|
324
|
+
confidence: number;
|
|
325
|
+
}
|
|
326
|
+
/** The map from the local frame to master indices: `master = M · local + translation`, modulo the period. */
|
|
327
|
+
interface PuzzleboardAlignment {
|
|
328
|
+
/** The 2×2 integer matrix `[[a, b], [c, d]]`, acting on local `(i, j)`. */
|
|
329
|
+
transform: {
|
|
330
|
+
a: number;
|
|
331
|
+
b: number;
|
|
332
|
+
c: number;
|
|
333
|
+
d: number;
|
|
334
|
+
};
|
|
335
|
+
/** The translation, added after the matrix. */
|
|
336
|
+
translation: readonly [number, number];
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* The edge bits of a PuzzleBoard decode, placed on the image.
|
|
340
|
+
*
|
|
341
|
+
* An edge is dropped when either of its corners was not detected. Each dot sits at the midpoint
|
|
342
|
+
* of its edge with a radius of a quarter of the edge's length (the bump is about half an edge
|
|
343
|
+
* wide); its opacity is the app's to take from `confidence`.
|
|
344
|
+
*
|
|
345
|
+
* @param edges - The observed edges.
|
|
346
|
+
* @param corners - The labelled corners, whose `i` and `j` are **master** indices.
|
|
347
|
+
* @param alignment - The local-to-master map.
|
|
348
|
+
* @param period - The master pattern's period. Defaults to 501.
|
|
349
|
+
* @returns One `TargetEdgeBit` per edge whose corners were both found, in input order. Empty when there is no alignment.
|
|
350
|
+
*/
|
|
351
|
+
export declare function edgeBitsFromPuzzleboard(edges: readonly PuzzleboardEdge[], corners: readonly TargetCorner[], alignment: PuzzleboardAlignment | null | undefined, period?: number): TargetEdgeBit[];
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region src/glyphs.d.ts
|
|
354
|
+
/** The marker names `TargetOverlay` uses, to pass to `PointSet`'s `markers`. */
|
|
355
|
+
export declare const TARGET_MARKERS: {
|
|
356
|
+
/** Edge directions of a corner, from `angle` and `angle2`. */
|
|
357
|
+
readonly directed: MarkerShape;
|
|
358
|
+
/** A white matched circle. */
|
|
359
|
+
readonly "circle-white": MarkerShape;
|
|
360
|
+
/** A black matched circle. */
|
|
361
|
+
readonly "circle-black": MarkerShape;
|
|
362
|
+
};
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region src/layerItems.d.ts
|
|
365
|
+
/**
|
|
366
|
+
* The nodes of the corner layer.
|
|
367
|
+
*
|
|
368
|
+
* A corner with an `angle` is a `directed` marker (its edge directions, one or two), any other a
|
|
369
|
+
* `plus`. On a board kind the lattice indices are kept, so `GridLayer` joins neighbours; on any
|
|
370
|
+
* other kind they are `NaN`, which `latticeEdges` reads as "not part of a lattice", so no edge is
|
|
371
|
+
* drawn.
|
|
372
|
+
*
|
|
373
|
+
* @param detection - The detection.
|
|
374
|
+
* @returns One node per corner, in order.
|
|
375
|
+
*/
|
|
376
|
+
export declare function cornerNodes(detection: TargetDetection): GridNode[];
|
|
377
|
+
/**
|
|
378
|
+
* The regions of the marker layer: each marker's quad, labelled with its text or its id.
|
|
379
|
+
*
|
|
380
|
+
* @param detection - The detection.
|
|
381
|
+
* @returns One area per marker with a usable quad.
|
|
382
|
+
*/
|
|
383
|
+
export declare function markerAreas(detection: TargetDetection): AreaSetItem[];
|
|
384
|
+
/**
|
|
385
|
+
* The points of the circle layer. Polarity picks the glyph: `circle-white` is a hollow ring,
|
|
386
|
+
* `circle-black` a ring with a dot.
|
|
387
|
+
*
|
|
388
|
+
* @param detection - The detection.
|
|
389
|
+
* @returns One point per circle.
|
|
390
|
+
*/
|
|
391
|
+
export declare function circlePoints(detection: TargetDetection): PointSetItem[];
|
|
392
|
+
/**
|
|
393
|
+
* The points of the ring layer: a `plus` at each centre, picked anywhere inside the outer ellipse
|
|
394
|
+
* (`pickRadius` is the larger semi-axis), labelled with the ring's text or its id.
|
|
395
|
+
*
|
|
396
|
+
* @param rings - The rings.
|
|
397
|
+
* @returns One point per ring.
|
|
398
|
+
*/
|
|
399
|
+
export declare function ringCentres(rings: readonly TargetRing[]): PointSetItem[];
|
|
400
|
+
/**
|
|
401
|
+
* The ellipses of the rings' two edges. The outer is `feature`, the inner `model` (a fitted
|
|
402
|
+
* second edge), and the smaller inner one is told from the outer by size as well as by colour.
|
|
403
|
+
*
|
|
404
|
+
* @param rings - The rings.
|
|
405
|
+
* @returns The outer ellipses, and the inner ones of the rings that have one.
|
|
406
|
+
*/
|
|
407
|
+
export declare function ringEllipses(rings: readonly TargetRing[]): {
|
|
408
|
+
outer: EllipseSetItem$1[];
|
|
409
|
+
inner: EllipseSetItem$1[];
|
|
410
|
+
};
|
|
411
|
+
/**
|
|
412
|
+
* The dots of the edge-bit layer: bit 1 is a solid `feature` circle, bit 0 a dashed `model`
|
|
413
|
+
* one, and the opacity runs from 35 % at confidence 0 to 100 % at confidence 1.
|
|
414
|
+
*
|
|
415
|
+
* @param bits - The edge bits.
|
|
416
|
+
* @returns One ellipse (a circle) per bit.
|
|
417
|
+
*/
|
|
418
|
+
export declare function edgeBitEllipses(bits: readonly TargetEdgeBit[]): EllipseSetItem$1[];
|
|
419
|
+
//#endregion
|
|
420
|
+
export { type CirclePolarity, type CornerGrid, EllipseSet, type EllipseSetItem, type EllipseSetProps, type GridBounds, type GridCorner, type GridSegment, type MarkerPolygon, type PuzzleboardAlignment, type PuzzleboardEdge, type TargetCircle, type TargetCorner, type TargetDetection, type TargetEdgeBit, type TargetEllipse, type TargetHit, type TargetId, type TargetKind, type TargetMarker, type TargetOverlayProps, type TargetPart, type TargetRing, ellipsePath };
|
|
421
|
+
//# sourceMappingURL=index.d.ts.map
|