@eyepop.ai/eyepop-render-2d 3.22.0 → 3.25.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/dist/eyepop.render2d.index.d.mts +7 -0
- package/dist/eyepop.render2d.index.d.ts +7 -0
- package/dist/eyepop.render2d.index.js +16 -1
- package/dist/eyepop.render2d.index.js.map +1 -1
- package/dist/eyepop.render2d.index.mjs +16 -1
- package/dist/eyepop.render2d.index.mjs.map +1 -1
- package/dist/eyepop.render2d.min.js +1 -1
- package/package.json +2 -2
|
@@ -275,6 +275,13 @@ declare class Renderer2d implements Renderer {
|
|
|
275
275
|
private readonly rules;
|
|
276
276
|
private static readonly defaultRules;
|
|
277
277
|
constructor(options: Renderer2dOptions);
|
|
278
|
+
/**
|
|
279
|
+
* Draw a prediction over the frame it was made on.
|
|
280
|
+
*
|
|
281
|
+
* A selected prediction (`p.selected`) is skipped: it belongs to a past
|
|
282
|
+
* frame, so drawn over the current one its boxes land where the object no
|
|
283
|
+
* longer is, and its past timestamp would rewind the trails.
|
|
284
|
+
*/
|
|
278
285
|
draw(p: Prediction, color?: string): void;
|
|
279
286
|
}
|
|
280
287
|
|
|
@@ -275,6 +275,13 @@ declare class Renderer2d implements Renderer {
|
|
|
275
275
|
private readonly rules;
|
|
276
276
|
private static readonly defaultRules;
|
|
277
277
|
constructor(options: Renderer2dOptions);
|
|
278
|
+
/**
|
|
279
|
+
* Draw a prediction over the frame it was made on.
|
|
280
|
+
*
|
|
281
|
+
* A selected prediction (`p.selected`) is skipped: it belongs to a past
|
|
282
|
+
* frame, so drawn over the current one its boxes land where the object no
|
|
283
|
+
* longer is, and its past timestamp would rewind the trails.
|
|
284
|
+
*/
|
|
278
285
|
draw(p: Prediction, color?: string): void;
|
|
279
286
|
}
|
|
280
287
|
|
|
@@ -520,7 +520,17 @@ var _Renderer2d = class _Renderer2d {
|
|
|
520
520
|
this.rules[i].start(this.context, this.style);
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
+
/**
|
|
524
|
+
* Draw a prediction over the frame it was made on.
|
|
525
|
+
*
|
|
526
|
+
* A selected prediction (`p.selected`) is skipped: it belongs to a past
|
|
527
|
+
* frame, so drawn over the current one its boxes land where the object no
|
|
528
|
+
* longer is, and its past timestamp would rewind the trails.
|
|
529
|
+
*/
|
|
523
530
|
draw(p, color) {
|
|
531
|
+
if (p.selected) {
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
524
534
|
const x_scale = this.context.canvas.width / p.source_width;
|
|
525
535
|
const y_scale = this.context.canvas.height / p.source_height;
|
|
526
536
|
const streamTime = p;
|
|
@@ -3695,6 +3705,10 @@ var RenderTrail = class {
|
|
|
3695
3705
|
if (!context || !style) {
|
|
3696
3706
|
throw new Error("render() called before start()");
|
|
3697
3707
|
}
|
|
3708
|
+
const previous = this.traces.get(element.trackId);
|
|
3709
|
+
if (previous !== void 0 && streamTime.timestamp < previous.timestamp) {
|
|
3710
|
+
return;
|
|
3711
|
+
}
|
|
3698
3712
|
const points = [];
|
|
3699
3713
|
if (this.traceDetails) {
|
|
3700
3714
|
const targets = jp2.query(element, this.traceDetails);
|
|
@@ -3725,7 +3739,7 @@ var RenderTrail = class {
|
|
|
3725
3739
|
const head = {
|
|
3726
3740
|
points,
|
|
3727
3741
|
timestamp: streamTime.timestamp,
|
|
3728
|
-
next:
|
|
3742
|
+
next: previous ?? null
|
|
3729
3743
|
};
|
|
3730
3744
|
this.traces.set(element.trackId, head);
|
|
3731
3745
|
const radius = element.width * xScale / 40;
|
|
@@ -3741,6 +3755,7 @@ var RenderTrail = class {
|
|
|
3741
3755
|
}
|
|
3742
3756
|
}
|
|
3743
3757
|
if (streamTime.timestamp - this.lastTrim > TRIM_INTERVAL) {
|
|
3758
|
+
this.lastTrim = streamTime.timestamp;
|
|
3744
3759
|
this.traces.forEach((traceEntry, trackId) => {
|
|
3745
3760
|
const age = streamTime.timestamp - traceEntry.timestamp;
|
|
3746
3761
|
if (age > this.trailLengthNanos) {
|