@zappar/zappar-cv 2.1.3 → 3.0.0-alpha.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/CHANGELOG.md +11 -0
- package/README.md +2 -2
- package/lib/camera-source.d.ts +1 -0
- package/lib/camera-source.js +18 -3
- package/lib/drawcamera.js +24 -3
- package/lib/gen/zappar-client.d.ts +1 -0
- package/lib/gen/zappar-client.js +230 -26
- package/lib/gen/zappar-cwrap.js +147 -0
- package/lib/gen/zappar-native.d.ts +24 -0
- package/lib/gen/zappar-native.js +7 -0
- package/lib/gen/zappar-server.d.ts +3 -0
- package/lib/gen/zappar-server.js +132 -25
- package/lib/gen/zappar.d.ts +26 -0
- package/lib/gen/zappar.js +1 -0
- package/lib/imagebitmap-camera-source.d.ts +1 -0
- package/lib/imagebitmap-camera-source.js +18 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/mstp-camera-source.d.ts +1 -0
- package/lib/mstp-camera-source.js +18 -3
- package/lib/native.js +57 -0
- package/lib/pipeline.d.ts +4 -0
- package/lib/pipeline.js +85 -4
- package/lib/profile.d.ts +2 -0
- package/lib/profile.js +6 -1
- package/lib/sequencerecorder.d.ts +18 -2
- package/lib/sequencerecorder.js +60 -0
- package/lib/sequencesource.js +16 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/worker-imagebitmap.js +1 -1
- package/lib/worker-server.js +65 -3
- package/lib/workerinterface.d.ts +15 -0
- package/lib/zappar-cv.js +92 -90
- package/lib/zappar-cv.wasm +0 -0
- package/package.json +2 -2
- package/umd/56.zappar-cv.js +1 -1
- package/umd/d728c530a2842970b329.wasm +0 -0
- package/umd/zappar-cv.js +1 -1
- package/umd/zappar-cv.worker.js +1 -1
- package/umd/17b53fcc0ff7ee6350b4.wasm +0 -0
package/lib/gen/zappar-cwrap.js
CHANGED
|
@@ -38,14 +38,30 @@ export function getRuntimeObject(mod) {
|
|
|
38
38
|
"number",
|
|
39
39
|
"number", "number", "number", "number"
|
|
40
40
|
]);
|
|
41
|
+
let pipeline_motion_accelerometer_with_gravity_submit_int_wrapped = mod.cwrap("zappar_pipeline_motion_accelerometer_with_gravity_submit_int", null, [
|
|
42
|
+
"number",
|
|
43
|
+
"number", "number", "number", "number", "number"
|
|
44
|
+
]);
|
|
45
|
+
let pipeline_motion_accelerometer_without_gravity_submit_int_wrapped = mod.cwrap("zappar_pipeline_motion_accelerometer_without_gravity_submit_int", null, [
|
|
46
|
+
"number",
|
|
47
|
+
"number", "number", "number", "number", "number"
|
|
48
|
+
]);
|
|
41
49
|
let pipeline_motion_rotation_rate_submit_wrapped = mod.cwrap("zappar_pipeline_motion_rotation_rate_submit", null, [
|
|
42
50
|
"number",
|
|
43
51
|
"number", "number", "number", "number"
|
|
44
52
|
]);
|
|
53
|
+
let pipeline_motion_rotation_rate_submit_int_wrapped = mod.cwrap("zappar_pipeline_motion_rotation_rate_submit_int", null, [
|
|
54
|
+
"number",
|
|
55
|
+
"number", "number", "number", "number", "number"
|
|
56
|
+
]);
|
|
45
57
|
let pipeline_motion_attitude_submit_wrapped = mod.cwrap("zappar_pipeline_motion_attitude_submit", null, [
|
|
46
58
|
"number",
|
|
47
59
|
"number", "number", "number", "number"
|
|
48
60
|
]);
|
|
61
|
+
let pipeline_motion_attitude_submit_int_wrapped = mod.cwrap("zappar_pipeline_motion_attitude_submit_int", null, [
|
|
62
|
+
"number",
|
|
63
|
+
"number", "number", "number", "number", "number"
|
|
64
|
+
]);
|
|
49
65
|
let pipeline_motion_attitude_matrix_submit_wrapped = mod.cwrap("zappar_pipeline_motion_attitude_matrix_submit", null, [
|
|
50
66
|
"number",
|
|
51
67
|
"number"
|
|
@@ -170,6 +186,40 @@ export function getRuntimeObject(mod) {
|
|
|
170
186
|
"number",
|
|
171
187
|
"number", "number", "number", "number"
|
|
172
188
|
]);
|
|
189
|
+
let world_tracker_create_wrapped = mod.cwrap("zappar_world_tracker_create", "number", ["number"]);
|
|
190
|
+
let world_tracker_destroy_wrapped = mod.cwrap("zappar_world_tracker_destroy", null, ["number"]);
|
|
191
|
+
let world_tracker_enabled_wrapped = mod.cwrap("zappar_world_tracker_enabled", "number", [
|
|
192
|
+
"number"
|
|
193
|
+
]);
|
|
194
|
+
let world_tracker_enabled_set_wrapped = mod.cwrap("zappar_world_tracker_enabled_set", null, [
|
|
195
|
+
"number",
|
|
196
|
+
"number"
|
|
197
|
+
]);
|
|
198
|
+
let world_tracker_quality_wrapped = mod.cwrap("zappar_world_tracker_quality", "number", [
|
|
199
|
+
"number"
|
|
200
|
+
]);
|
|
201
|
+
let world_tracker_plane_count_wrapped = mod.cwrap("zappar_world_tracker_plane_count", "number", [
|
|
202
|
+
"number"
|
|
203
|
+
]);
|
|
204
|
+
let world_tracker_plane_pose_raw_wrapped = mod.cwrap("zappar_world_tracker_plane_pose_raw", "number", [
|
|
205
|
+
"number",
|
|
206
|
+
"number"
|
|
207
|
+
]);
|
|
208
|
+
let world_tracker_world_anchor_valid_wrapped = mod.cwrap("zappar_world_tracker_world_anchor_valid", "number", [
|
|
209
|
+
"number"
|
|
210
|
+
]);
|
|
211
|
+
let world_tracker_world_anchor_pose_raw_wrapped = mod.cwrap("zappar_world_tracker_world_anchor_pose_raw", "number", [
|
|
212
|
+
"number"
|
|
213
|
+
]);
|
|
214
|
+
let world_tracker_ground_anchor_valid_wrapped = mod.cwrap("zappar_world_tracker_ground_anchor_valid", "number", [
|
|
215
|
+
"number"
|
|
216
|
+
]);
|
|
217
|
+
let world_tracker_ground_anchor_pose_raw_wrapped = mod.cwrap("zappar_world_tracker_ground_anchor_pose_raw", "number", [
|
|
218
|
+
"number"
|
|
219
|
+
]);
|
|
220
|
+
let world_tracker_reset_wrapped = mod.cwrap("zappar_world_tracker_reset", null, [
|
|
221
|
+
"number"
|
|
222
|
+
]);
|
|
173
223
|
let dataArrayArgLength = 32;
|
|
174
224
|
let dataArrayArg = mod._malloc(dataArrayArgLength);
|
|
175
225
|
let floatDataArrayArgLength = 16 * 4;
|
|
@@ -284,6 +334,24 @@ export function getRuntimeObject(mod) {
|
|
|
284
334
|
let ret = pipeline_motion_accelerometer_submit_wrapped(o, arg_time, arg_x, arg_y, arg_z);
|
|
285
335
|
return ret;
|
|
286
336
|
},
|
|
337
|
+
pipeline_motion_accelerometer_with_gravity_submit_int: (o, time, interval, x, y, z) => {
|
|
338
|
+
let arg_time = time;
|
|
339
|
+
let arg_interval = interval;
|
|
340
|
+
let arg_x = x;
|
|
341
|
+
let arg_y = y;
|
|
342
|
+
let arg_z = z;
|
|
343
|
+
let ret = pipeline_motion_accelerometer_with_gravity_submit_int_wrapped(o, arg_time, arg_interval, arg_x, arg_y, arg_z);
|
|
344
|
+
return ret;
|
|
345
|
+
},
|
|
346
|
+
pipeline_motion_accelerometer_without_gravity_submit_int: (o, time, interval, x, y, z) => {
|
|
347
|
+
let arg_time = time;
|
|
348
|
+
let arg_interval = interval;
|
|
349
|
+
let arg_x = x;
|
|
350
|
+
let arg_y = y;
|
|
351
|
+
let arg_z = z;
|
|
352
|
+
let ret = pipeline_motion_accelerometer_without_gravity_submit_int_wrapped(o, arg_time, arg_interval, arg_x, arg_y, arg_z);
|
|
353
|
+
return ret;
|
|
354
|
+
},
|
|
287
355
|
pipeline_motion_rotation_rate_submit: (o, time, x, y, z) => {
|
|
288
356
|
let arg_time = time;
|
|
289
357
|
let arg_x = x;
|
|
@@ -292,6 +360,15 @@ export function getRuntimeObject(mod) {
|
|
|
292
360
|
let ret = pipeline_motion_rotation_rate_submit_wrapped(o, arg_time, arg_x, arg_y, arg_z);
|
|
293
361
|
return ret;
|
|
294
362
|
},
|
|
363
|
+
pipeline_motion_rotation_rate_submit_int: (o, time, interval, x, y, z) => {
|
|
364
|
+
let arg_time = time;
|
|
365
|
+
let arg_interval = interval;
|
|
366
|
+
let arg_x = x;
|
|
367
|
+
let arg_y = y;
|
|
368
|
+
let arg_z = z;
|
|
369
|
+
let ret = pipeline_motion_rotation_rate_submit_int_wrapped(o, arg_time, arg_interval, arg_x, arg_y, arg_z);
|
|
370
|
+
return ret;
|
|
371
|
+
},
|
|
295
372
|
pipeline_motion_attitude_submit: (o, time, x, y, z) => {
|
|
296
373
|
let arg_time = time;
|
|
297
374
|
let arg_x = x;
|
|
@@ -300,6 +377,15 @@ export function getRuntimeObject(mod) {
|
|
|
300
377
|
let ret = pipeline_motion_attitude_submit_wrapped(o, arg_time, arg_x, arg_y, arg_z);
|
|
301
378
|
return ret;
|
|
302
379
|
},
|
|
380
|
+
pipeline_motion_attitude_submit_int: (o, time, interval, x, y, z) => {
|
|
381
|
+
let arg_time = time;
|
|
382
|
+
let arg_interval = interval;
|
|
383
|
+
let arg_x = x;
|
|
384
|
+
let arg_y = y;
|
|
385
|
+
let arg_z = z;
|
|
386
|
+
let ret = pipeline_motion_attitude_submit_int_wrapped(o, arg_time, arg_interval, arg_x, arg_y, arg_z);
|
|
387
|
+
return ret;
|
|
388
|
+
},
|
|
303
389
|
pipeline_motion_attitude_matrix_submit: (o, mat) => {
|
|
304
390
|
let arg_mat = getFloatDataArrayForArgIndex(0, mat.byteLength);
|
|
305
391
|
mod.HEAPF32.set(mat, arg_mat / 4);
|
|
@@ -531,5 +617,66 @@ export function getRuntimeObject(mod) {
|
|
|
531
617
|
let ret = instant_world_tracker_anchor_pose_set_from_camera_offset_raw_wrapped(o, arg_x, arg_y, arg_z, arg_orientation);
|
|
532
618
|
return ret;
|
|
533
619
|
},
|
|
620
|
+
world_tracker_create: (pipeline) => {
|
|
621
|
+
let arg_pipeline = pipeline;
|
|
622
|
+
return world_tracker_create_wrapped(arg_pipeline);
|
|
623
|
+
},
|
|
624
|
+
world_tracker_destroy: () => {
|
|
625
|
+
world_tracker_destroy_wrapped();
|
|
626
|
+
},
|
|
627
|
+
world_tracker_enabled: (o) => {
|
|
628
|
+
let ret = world_tracker_enabled_wrapped(o);
|
|
629
|
+
ret = ret === 1;
|
|
630
|
+
return ret;
|
|
631
|
+
},
|
|
632
|
+
world_tracker_enabled_set: (o, enabled) => {
|
|
633
|
+
let arg_enabled = enabled ? 1 : 0;
|
|
634
|
+
let ret = world_tracker_enabled_set_wrapped(o, arg_enabled);
|
|
635
|
+
return ret;
|
|
636
|
+
},
|
|
637
|
+
world_tracker_quality: (o) => {
|
|
638
|
+
let ret = world_tracker_quality_wrapped(o);
|
|
639
|
+
return ret;
|
|
640
|
+
},
|
|
641
|
+
world_tracker_plane_count: (o) => {
|
|
642
|
+
let ret = world_tracker_plane_count_wrapped(o);
|
|
643
|
+
return ret;
|
|
644
|
+
},
|
|
645
|
+
world_tracker_plane_pose_raw: (o, indx) => {
|
|
646
|
+
let arg_indx = indx;
|
|
647
|
+
let ret = world_tracker_plane_pose_raw_wrapped(o, arg_indx);
|
|
648
|
+
let ab = new Float32Array(16);
|
|
649
|
+
ab.set(mod.HEAPF32.subarray(ret / 4, 16 + ret / 4));
|
|
650
|
+
ret = ab;
|
|
651
|
+
return ret;
|
|
652
|
+
},
|
|
653
|
+
world_tracker_world_anchor_valid: (o) => {
|
|
654
|
+
let ret = world_tracker_world_anchor_valid_wrapped(o);
|
|
655
|
+
ret = ret === 1;
|
|
656
|
+
return ret;
|
|
657
|
+
},
|
|
658
|
+
world_tracker_world_anchor_pose_raw: (o) => {
|
|
659
|
+
let ret = world_tracker_world_anchor_pose_raw_wrapped(o);
|
|
660
|
+
let ab = new Float32Array(16);
|
|
661
|
+
ab.set(mod.HEAPF32.subarray(ret / 4, 16 + ret / 4));
|
|
662
|
+
ret = ab;
|
|
663
|
+
return ret;
|
|
664
|
+
},
|
|
665
|
+
world_tracker_ground_anchor_valid: (o) => {
|
|
666
|
+
let ret = world_tracker_ground_anchor_valid_wrapped(o);
|
|
667
|
+
ret = ret === 1;
|
|
668
|
+
return ret;
|
|
669
|
+
},
|
|
670
|
+
world_tracker_ground_anchor_pose_raw: (o) => {
|
|
671
|
+
let ret = world_tracker_ground_anchor_pose_raw_wrapped(o);
|
|
672
|
+
let ab = new Float32Array(16);
|
|
673
|
+
ab.set(mod.HEAPF32.subarray(ret / 4, 16 + ret / 4));
|
|
674
|
+
ret = ab;
|
|
675
|
+
return ret;
|
|
676
|
+
},
|
|
677
|
+
world_tracker_reset: (o) => {
|
|
678
|
+
let ret = world_tracker_reset_wrapped(o);
|
|
679
|
+
return ret;
|
|
680
|
+
},
|
|
534
681
|
};
|
|
535
682
|
}
|
|
@@ -61,6 +61,11 @@ export declare enum image_target_type_t {
|
|
|
61
61
|
IMAGE_TRACKER_TYPE_CYLINDRICAL = 1,
|
|
62
62
|
IMAGE_TRACKER_TYPE_CONICAL = 2
|
|
63
63
|
}
|
|
64
|
+
export declare enum world_tracker_quality_t {
|
|
65
|
+
WORLD_TRACKER_QUALITY_INITIALIZING = 0,
|
|
66
|
+
WORLD_TRACKER_QUALITY_GOOD = 1,
|
|
67
|
+
WORLD_TRACKER_QUALITY_ORIENTATION_ONLY = 2
|
|
68
|
+
}
|
|
64
69
|
export declare type zappar_pipeline_t = number & {
|
|
65
70
|
_: 'zappar_pipeline_t';
|
|
66
71
|
};
|
|
@@ -88,6 +93,9 @@ export declare type zappar_barcode_finder_t = number & {
|
|
|
88
93
|
export declare type zappar_instant_world_tracker_t = number & {
|
|
89
94
|
_: 'zappar_instant_world_tracker_t';
|
|
90
95
|
};
|
|
96
|
+
export declare type zappar_world_tracker_t = number & {
|
|
97
|
+
_: 'zappar_world_tracker_t';
|
|
98
|
+
};
|
|
91
99
|
export interface zappar_cwrap {
|
|
92
100
|
log_level(): log_level_t;
|
|
93
101
|
log_level_set(level: log_level_t): void;
|
|
@@ -103,8 +111,12 @@ export interface zappar_cwrap {
|
|
|
103
111
|
pipeline_camera_frame_camera_attitude(o: zappar_pipeline_t): Float32Array;
|
|
104
112
|
pipeline_camera_frame_device_attitude(o: zappar_pipeline_t): Float32Array;
|
|
105
113
|
pipeline_motion_accelerometer_submit(o: zappar_pipeline_t, time: number, x: number, y: number, z: number): void;
|
|
114
|
+
pipeline_motion_accelerometer_with_gravity_submit_int(o: zappar_pipeline_t, time: number, interval: number, x: number, y: number, z: number): void;
|
|
115
|
+
pipeline_motion_accelerometer_without_gravity_submit_int(o: zappar_pipeline_t, time: number, interval: number, x: number, y: number, z: number): void;
|
|
106
116
|
pipeline_motion_rotation_rate_submit(o: zappar_pipeline_t, time: number, x: number, y: number, z: number): void;
|
|
117
|
+
pipeline_motion_rotation_rate_submit_int(o: zappar_pipeline_t, time: number, interval: number, x: number, y: number, z: number): void;
|
|
107
118
|
pipeline_motion_attitude_submit(o: zappar_pipeline_t, time: number, x: number, y: number, z: number): void;
|
|
119
|
+
pipeline_motion_attitude_submit_int(o: zappar_pipeline_t, time: number, interval: number, x: number, y: number, z: number): void;
|
|
108
120
|
pipeline_motion_attitude_matrix_submit(o: zappar_pipeline_t, mat: Float32Array): void;
|
|
109
121
|
camera_source_create(pipeline: zappar_pipeline_t, device_id: string): zappar_camera_source_t;
|
|
110
122
|
camera_source_destroy(o: zappar_camera_source_t): void;
|
|
@@ -151,4 +163,16 @@ export interface zappar_cwrap {
|
|
|
151
163
|
instant_world_tracker_enabled(o: zappar_instant_world_tracker_t): boolean;
|
|
152
164
|
instant_world_tracker_anchor_pose_raw(o: zappar_instant_world_tracker_t): Float32Array;
|
|
153
165
|
instant_world_tracker_anchor_pose_set_from_camera_offset_raw(o: zappar_instant_world_tracker_t, x: number, y: number, z: number, orientation: instant_world_tracker_transform_orientation_t): void;
|
|
166
|
+
world_tracker_create(pipeline: zappar_pipeline_t): zappar_world_tracker_t;
|
|
167
|
+
world_tracker_destroy(o: zappar_world_tracker_t): void;
|
|
168
|
+
world_tracker_enabled(o: zappar_world_tracker_t): boolean;
|
|
169
|
+
world_tracker_enabled_set(o: zappar_world_tracker_t, enabled: boolean): void;
|
|
170
|
+
world_tracker_quality(o: zappar_world_tracker_t): number;
|
|
171
|
+
world_tracker_plane_count(o: zappar_world_tracker_t): number;
|
|
172
|
+
world_tracker_plane_pose_raw(o: zappar_world_tracker_t, indx: number): Float32Array;
|
|
173
|
+
world_tracker_world_anchor_valid(o: zappar_world_tracker_t): boolean;
|
|
174
|
+
world_tracker_world_anchor_pose_raw(o: zappar_world_tracker_t): Float32Array;
|
|
175
|
+
world_tracker_ground_anchor_valid(o: zappar_world_tracker_t): boolean;
|
|
176
|
+
world_tracker_ground_anchor_pose_raw(o: zappar_world_tracker_t): Float32Array;
|
|
177
|
+
world_tracker_reset(o: zappar_world_tracker_t): void;
|
|
154
178
|
}
|
package/lib/gen/zappar-native.js
CHANGED
|
@@ -73,3 +73,10 @@ export var image_target_type_t;
|
|
|
73
73
|
image_target_type_t[image_target_type_t["IMAGE_TRACKER_TYPE_CONICAL"] = 2] = "IMAGE_TRACKER_TYPE_CONICAL";
|
|
74
74
|
})(image_target_type_t || (image_target_type_t = {}));
|
|
75
75
|
;
|
|
76
|
+
export var world_tracker_quality_t;
|
|
77
|
+
(function (world_tracker_quality_t) {
|
|
78
|
+
world_tracker_quality_t[world_tracker_quality_t["WORLD_TRACKER_QUALITY_INITIALIZING"] = 0] = "WORLD_TRACKER_QUALITY_INITIALIZING";
|
|
79
|
+
world_tracker_quality_t[world_tracker_quality_t["WORLD_TRACKER_QUALITY_GOOD"] = 1] = "WORLD_TRACKER_QUALITY_GOOD";
|
|
80
|
+
world_tracker_quality_t[world_tracker_quality_t["WORLD_TRACKER_QUALITY_ORIENTATION_ONLY"] = 2] = "WORLD_TRACKER_QUALITY_ORIENTATION_ONLY";
|
|
81
|
+
})(world_tracker_quality_t || (world_tracker_quality_t = {}));
|
|
82
|
+
;
|
|
@@ -9,6 +9,7 @@ import { zappar_face_mesh_t } from "./zappar-native";
|
|
|
9
9
|
import { zappar_face_landmark_t } from "./zappar-native";
|
|
10
10
|
import { zappar_barcode_finder_t } from "./zappar-native";
|
|
11
11
|
import { zappar_instant_world_tracker_t } from "./zappar-native";
|
|
12
|
+
import { zappar_world_tracker_t } from "./zappar-native";
|
|
12
13
|
export declare class zappar_server {
|
|
13
14
|
private _impl;
|
|
14
15
|
private _sender;
|
|
@@ -33,6 +34,8 @@ export declare class zappar_server {
|
|
|
33
34
|
_barcode_finder_by_instance: Map<number, zappar_barcode_finder_t>;
|
|
34
35
|
_pipeline_id_by_instant_world_tracker_id: Map<number, number>;
|
|
35
36
|
_instant_world_tracker_by_instance: Map<number, zappar_instant_world_tracker_t>;
|
|
37
|
+
_pipeline_id_by_world_tracker_id: Map<number, number>;
|
|
38
|
+
_world_tracker_by_instance: Map<number, zappar_world_tracker_t>;
|
|
36
39
|
processBuffer(b: ArrayBuffer): void;
|
|
37
40
|
exploreState(): void;
|
|
38
41
|
}
|
package/lib/gen/zappar-server.js
CHANGED
|
@@ -24,20 +24,22 @@ export class zappar_server {
|
|
|
24
24
|
this._barcode_finder_by_instance = new Map();
|
|
25
25
|
this._pipeline_id_by_instant_world_tracker_id = new Map();
|
|
26
26
|
this._instant_world_tracker_by_instance = new Map();
|
|
27
|
+
this._pipeline_id_by_world_tracker_id = new Map();
|
|
28
|
+
this._world_tracker_by_instance = new Map();
|
|
27
29
|
}
|
|
28
30
|
processBuffer(b) {
|
|
29
31
|
this._deserializer.setData(b);
|
|
30
32
|
this._deserializer.forMessages((messageId, msg) => {
|
|
31
33
|
switch (messageId) {
|
|
32
|
-
case
|
|
34
|
+
case 38: {
|
|
33
35
|
this._impl.log_level_set(msg.logLevel());
|
|
34
36
|
break;
|
|
35
37
|
}
|
|
36
|
-
case
|
|
38
|
+
case 35: {
|
|
37
39
|
this._impl.analytics_project_id_set(msg.string(), msg.string());
|
|
38
40
|
break;
|
|
39
41
|
}
|
|
40
|
-
case
|
|
42
|
+
case 31: {
|
|
41
43
|
let clientId = msg.type();
|
|
42
44
|
let handle = this._impl.pipeline_create();
|
|
43
45
|
this._pipeline_by_instance.set(clientId, handle);
|
|
@@ -47,7 +49,7 @@ export class zappar_server {
|
|
|
47
49
|
}));
|
|
48
50
|
break;
|
|
49
51
|
}
|
|
50
|
-
case
|
|
52
|
+
case 32: {
|
|
51
53
|
let clientId = msg.type();
|
|
52
54
|
let obj = this._pipeline_by_instance.get(clientId);
|
|
53
55
|
if (obj === undefined)
|
|
@@ -80,7 +82,23 @@ export class zappar_server {
|
|
|
80
82
|
this._impl.pipeline_motion_accelerometer_submit(obj, msg.timestamp(), msg.float(), msg.float(), msg.float());
|
|
81
83
|
break;
|
|
82
84
|
}
|
|
85
|
+
case 12: {
|
|
86
|
+
let clientId = msg.type();
|
|
87
|
+
let obj = this._pipeline_by_instance.get(clientId);
|
|
88
|
+
if (obj === undefined)
|
|
89
|
+
return;
|
|
90
|
+
this._impl.pipeline_motion_accelerometer_with_gravity_submit_int(obj, msg.timestamp(), msg.timestamp(), msg.float(), msg.float(), msg.float());
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
83
93
|
case 11: {
|
|
94
|
+
let clientId = msg.type();
|
|
95
|
+
let obj = this._pipeline_by_instance.get(clientId);
|
|
96
|
+
if (obj === undefined)
|
|
97
|
+
return;
|
|
98
|
+
this._impl.pipeline_motion_accelerometer_without_gravity_submit_int(obj, msg.timestamp(), msg.timestamp(), msg.float(), msg.float(), msg.float());
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case 15: {
|
|
84
102
|
let clientId = msg.type();
|
|
85
103
|
let obj = this._pipeline_by_instance.get(clientId);
|
|
86
104
|
if (obj === undefined)
|
|
@@ -88,7 +106,15 @@ export class zappar_server {
|
|
|
88
106
|
this._impl.pipeline_motion_rotation_rate_submit(obj, msg.timestamp(), msg.float(), msg.float(), msg.float());
|
|
89
107
|
break;
|
|
90
108
|
}
|
|
91
|
-
case
|
|
109
|
+
case 13: {
|
|
110
|
+
let clientId = msg.type();
|
|
111
|
+
let obj = this._pipeline_by_instance.get(clientId);
|
|
112
|
+
if (obj === undefined)
|
|
113
|
+
return;
|
|
114
|
+
this._impl.pipeline_motion_rotation_rate_submit_int(obj, msg.timestamp(), msg.timestamp(), msg.float(), msg.float(), msg.float());
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
case 16: {
|
|
92
118
|
let clientId = msg.type();
|
|
93
119
|
let obj = this._pipeline_by_instance.get(clientId);
|
|
94
120
|
if (obj === undefined)
|
|
@@ -96,7 +122,15 @@ export class zappar_server {
|
|
|
96
122
|
this._impl.pipeline_motion_attitude_submit(obj, msg.timestamp(), msg.float(), msg.float(), msg.float());
|
|
97
123
|
break;
|
|
98
124
|
}
|
|
99
|
-
case
|
|
125
|
+
case 14: {
|
|
126
|
+
let clientId = msg.type();
|
|
127
|
+
let obj = this._pipeline_by_instance.get(clientId);
|
|
128
|
+
if (obj === undefined)
|
|
129
|
+
return;
|
|
130
|
+
this._impl.pipeline_motion_attitude_submit_int(obj, msg.timestamp(), msg.timestamp(), msg.float(), msg.float(), msg.float());
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
case 17: {
|
|
100
134
|
let clientId = msg.type();
|
|
101
135
|
let obj = this._pipeline_by_instance.get(clientId);
|
|
102
136
|
if (obj === undefined)
|
|
@@ -104,7 +138,7 @@ export class zappar_server {
|
|
|
104
138
|
this._impl.pipeline_motion_attitude_matrix_submit(obj, msg.matrix4x4());
|
|
105
139
|
break;
|
|
106
140
|
}
|
|
107
|
-
case
|
|
141
|
+
case 33: {
|
|
108
142
|
let clientId = msg.type();
|
|
109
143
|
let arg_pipeline_id = msg.type();
|
|
110
144
|
let arg_pipeline = this._pipeline_by_instance.get(arg_pipeline_id);
|
|
@@ -114,7 +148,7 @@ export class zappar_server {
|
|
|
114
148
|
this._pipeline_id_by_camera_source_id.set(clientId, arg_pipeline_id);
|
|
115
149
|
break;
|
|
116
150
|
}
|
|
117
|
-
case
|
|
151
|
+
case 34: {
|
|
118
152
|
let clientId = msg.type();
|
|
119
153
|
let obj = this._camera_source_by_instance.get(clientId);
|
|
120
154
|
if (obj === undefined)
|
|
@@ -123,7 +157,7 @@ export class zappar_server {
|
|
|
123
157
|
this._camera_source_by_instance.delete(clientId);
|
|
124
158
|
break;
|
|
125
159
|
}
|
|
126
|
-
case
|
|
160
|
+
case 39: {
|
|
127
161
|
let clientId = msg.type();
|
|
128
162
|
let arg_pipeline_id = msg.type();
|
|
129
163
|
let arg_pipeline = this._pipeline_by_instance.get(arg_pipeline_id);
|
|
@@ -132,7 +166,7 @@ export class zappar_server {
|
|
|
132
166
|
this._pipeline_id_by_sequence_source_id.set(clientId, arg_pipeline_id);
|
|
133
167
|
break;
|
|
134
168
|
}
|
|
135
|
-
case
|
|
169
|
+
case 40: {
|
|
136
170
|
let clientId = msg.type();
|
|
137
171
|
let obj = this._sequence_source_by_instance.get(clientId);
|
|
138
172
|
if (obj === undefined)
|
|
@@ -150,7 +184,7 @@ export class zappar_server {
|
|
|
150
184
|
this._pipeline_id_by_image_tracker_id.set(clientId, arg_pipeline_id);
|
|
151
185
|
break;
|
|
152
186
|
}
|
|
153
|
-
case
|
|
187
|
+
case 18: {
|
|
154
188
|
let clientId = msg.type();
|
|
155
189
|
let obj = this._image_tracker_by_instance.get(clientId);
|
|
156
190
|
if (obj === undefined)
|
|
@@ -175,7 +209,7 @@ export class zappar_server {
|
|
|
175
209
|
this._impl.image_tracker_enabled_set(obj, msg.bool());
|
|
176
210
|
break;
|
|
177
211
|
}
|
|
178
|
-
case
|
|
212
|
+
case 24: {
|
|
179
213
|
let clientId = msg.type();
|
|
180
214
|
let arg_pipeline_id = msg.type();
|
|
181
215
|
let arg_pipeline = this._pipeline_by_instance.get(arg_pipeline_id);
|
|
@@ -184,7 +218,7 @@ export class zappar_server {
|
|
|
184
218
|
this._pipeline_id_by_face_tracker_id.set(clientId, arg_pipeline_id);
|
|
185
219
|
break;
|
|
186
220
|
}
|
|
187
|
-
case
|
|
221
|
+
case 25: {
|
|
188
222
|
let clientId = msg.type();
|
|
189
223
|
let obj = this._face_tracker_by_instance.get(clientId);
|
|
190
224
|
if (obj === undefined)
|
|
@@ -193,7 +227,7 @@ export class zappar_server {
|
|
|
193
227
|
this._face_tracker_by_instance.delete(clientId);
|
|
194
228
|
break;
|
|
195
229
|
}
|
|
196
|
-
case
|
|
230
|
+
case 26: {
|
|
197
231
|
let clientId = msg.type();
|
|
198
232
|
let obj = this._face_tracker_by_instance.get(clientId);
|
|
199
233
|
if (obj === undefined)
|
|
@@ -201,7 +235,7 @@ export class zappar_server {
|
|
|
201
235
|
this._impl.face_tracker_model_load_from_memory(obj, msg.dataWithLength());
|
|
202
236
|
break;
|
|
203
237
|
}
|
|
204
|
-
case
|
|
238
|
+
case 27: {
|
|
205
239
|
let clientId = msg.type();
|
|
206
240
|
let obj = this._face_tracker_by_instance.get(clientId);
|
|
207
241
|
if (obj === undefined)
|
|
@@ -209,7 +243,7 @@ export class zappar_server {
|
|
|
209
243
|
this._impl.face_tracker_enabled_set(obj, msg.bool());
|
|
210
244
|
break;
|
|
211
245
|
}
|
|
212
|
-
case
|
|
246
|
+
case 28: {
|
|
213
247
|
let clientId = msg.type();
|
|
214
248
|
let obj = this._face_tracker_by_instance.get(clientId);
|
|
215
249
|
if (obj === undefined)
|
|
@@ -217,13 +251,13 @@ export class zappar_server {
|
|
|
217
251
|
this._impl.face_tracker_max_faces_set(obj, msg.int());
|
|
218
252
|
break;
|
|
219
253
|
}
|
|
220
|
-
case
|
|
254
|
+
case 29: {
|
|
221
255
|
let clientId = msg.type();
|
|
222
256
|
let handle = this._impl.face_mesh_create();
|
|
223
257
|
this._face_mesh_by_instance.set(clientId, handle);
|
|
224
258
|
break;
|
|
225
259
|
}
|
|
226
|
-
case
|
|
260
|
+
case 30: {
|
|
227
261
|
let clientId = msg.type();
|
|
228
262
|
let obj = this._face_mesh_by_instance.get(clientId);
|
|
229
263
|
if (obj === undefined)
|
|
@@ -232,14 +266,14 @@ export class zappar_server {
|
|
|
232
266
|
this._face_mesh_by_instance.delete(clientId);
|
|
233
267
|
break;
|
|
234
268
|
}
|
|
235
|
-
case
|
|
269
|
+
case 36: {
|
|
236
270
|
let clientId = msg.type();
|
|
237
271
|
let arg_landmark = msg.faceLandmarkName();
|
|
238
272
|
let handle = this._impl.face_landmark_create(arg_landmark);
|
|
239
273
|
this._face_landmark_by_instance.set(clientId, handle);
|
|
240
274
|
break;
|
|
241
275
|
}
|
|
242
|
-
case
|
|
276
|
+
case 37: {
|
|
243
277
|
let clientId = msg.type();
|
|
244
278
|
let obj = this._face_landmark_by_instance.get(clientId);
|
|
245
279
|
if (obj === undefined)
|
|
@@ -248,7 +282,7 @@ export class zappar_server {
|
|
|
248
282
|
this._face_landmark_by_instance.delete(clientId);
|
|
249
283
|
break;
|
|
250
284
|
}
|
|
251
|
-
case
|
|
285
|
+
case 20: {
|
|
252
286
|
let clientId = msg.type();
|
|
253
287
|
let arg_pipeline_id = msg.type();
|
|
254
288
|
let arg_pipeline = this._pipeline_by_instance.get(arg_pipeline_id);
|
|
@@ -257,7 +291,7 @@ export class zappar_server {
|
|
|
257
291
|
this._pipeline_id_by_barcode_finder_id.set(clientId, arg_pipeline_id);
|
|
258
292
|
break;
|
|
259
293
|
}
|
|
260
|
-
case
|
|
294
|
+
case 21: {
|
|
261
295
|
let clientId = msg.type();
|
|
262
296
|
let obj = this._barcode_finder_by_instance.get(clientId);
|
|
263
297
|
if (obj === undefined)
|
|
@@ -266,7 +300,7 @@ export class zappar_server {
|
|
|
266
300
|
this._barcode_finder_by_instance.delete(clientId);
|
|
267
301
|
break;
|
|
268
302
|
}
|
|
269
|
-
case
|
|
303
|
+
case 22: {
|
|
270
304
|
let clientId = msg.type();
|
|
271
305
|
let obj = this._barcode_finder_by_instance.get(clientId);
|
|
272
306
|
if (obj === undefined)
|
|
@@ -274,7 +308,7 @@ export class zappar_server {
|
|
|
274
308
|
this._impl.barcode_finder_enabled_set(obj, msg.bool());
|
|
275
309
|
break;
|
|
276
310
|
}
|
|
277
|
-
case
|
|
311
|
+
case 23: {
|
|
278
312
|
let clientId = msg.type();
|
|
279
313
|
let obj = this._barcode_finder_by_instance.get(clientId);
|
|
280
314
|
if (obj === undefined)
|
|
@@ -291,7 +325,7 @@ export class zappar_server {
|
|
|
291
325
|
this._pipeline_id_by_instant_world_tracker_id.set(clientId, arg_pipeline_id);
|
|
292
326
|
break;
|
|
293
327
|
}
|
|
294
|
-
case
|
|
328
|
+
case 19: {
|
|
295
329
|
let clientId = msg.type();
|
|
296
330
|
let obj = this._instant_world_tracker_by_instance.get(clientId);
|
|
297
331
|
if (obj === undefined)
|
|
@@ -316,6 +350,40 @@ export class zappar_server {
|
|
|
316
350
|
this._impl.instant_world_tracker_anchor_pose_set_from_camera_offset_raw(obj, msg.float(), msg.float(), msg.float(), msg.instantTrackerTransformOrientation());
|
|
317
351
|
break;
|
|
318
352
|
}
|
|
353
|
+
case 41: {
|
|
354
|
+
let clientId = msg.type();
|
|
355
|
+
let arg_pipeline_id = msg.type();
|
|
356
|
+
let arg_pipeline = this._pipeline_by_instance.get(arg_pipeline_id);
|
|
357
|
+
let handle = this._impl.world_tracker_create(arg_pipeline);
|
|
358
|
+
this._world_tracker_by_instance.set(clientId, handle);
|
|
359
|
+
this._pipeline_id_by_world_tracker_id.set(clientId, arg_pipeline_id);
|
|
360
|
+
break;
|
|
361
|
+
}
|
|
362
|
+
case 42: {
|
|
363
|
+
let clientId = msg.type();
|
|
364
|
+
let obj = this._world_tracker_by_instance.get(clientId);
|
|
365
|
+
if (obj === undefined)
|
|
366
|
+
return;
|
|
367
|
+
this._impl.world_tracker_destroy(obj);
|
|
368
|
+
this._world_tracker_by_instance.delete(clientId);
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
case 43: {
|
|
372
|
+
let clientId = msg.type();
|
|
373
|
+
let obj = this._world_tracker_by_instance.get(clientId);
|
|
374
|
+
if (obj === undefined)
|
|
375
|
+
return;
|
|
376
|
+
this._impl.world_tracker_enabled_set(obj, msg.bool());
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
case 44: {
|
|
380
|
+
let clientId = msg.type();
|
|
381
|
+
let obj = this._world_tracker_by_instance.get(clientId);
|
|
382
|
+
if (obj === undefined)
|
|
383
|
+
return;
|
|
384
|
+
this._impl.world_tracker_reset(obj);
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
319
387
|
}
|
|
320
388
|
});
|
|
321
389
|
}
|
|
@@ -492,5 +560,44 @@ export class zappar_server {
|
|
|
492
560
|
msg.matrix4x4(this._impl.instant_world_tracker_anchor_pose_raw(v));
|
|
493
561
|
});
|
|
494
562
|
}
|
|
563
|
+
for (let [k, v] of this._world_tracker_by_instance) {
|
|
564
|
+
let pipeline = this._pipeline_id_by_world_tracker_id.get(k);
|
|
565
|
+
if (!pipeline)
|
|
566
|
+
continue;
|
|
567
|
+
let serializer = this.serializersByPipelineId.get(pipeline);
|
|
568
|
+
if (!serializer)
|
|
569
|
+
continue;
|
|
570
|
+
serializer.sendMessage(27, msg => {
|
|
571
|
+
msg.type(k);
|
|
572
|
+
msg.int(this._impl.world_tracker_quality(v));
|
|
573
|
+
});
|
|
574
|
+
serializer.sendMessage(21, msg => {
|
|
575
|
+
msg.type(k);
|
|
576
|
+
msg.int(this._impl.world_tracker_plane_count(v));
|
|
577
|
+
});
|
|
578
|
+
for (let i = 0; i < this._impl.world_tracker_plane_count(v); i++) {
|
|
579
|
+
serializer.sendMessage(22, msg => {
|
|
580
|
+
msg.type(k);
|
|
581
|
+
msg.int(i);
|
|
582
|
+
msg.matrix4x4(this._impl.world_tracker_plane_pose_raw(v, i));
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
serializer.sendMessage(23, msg => {
|
|
586
|
+
msg.type(k);
|
|
587
|
+
msg.bool(this._impl.world_tracker_world_anchor_valid(v));
|
|
588
|
+
});
|
|
589
|
+
serializer.sendMessage(24, msg => {
|
|
590
|
+
msg.type(k);
|
|
591
|
+
msg.matrix4x4(this._impl.world_tracker_world_anchor_pose_raw(v));
|
|
592
|
+
});
|
|
593
|
+
serializer.sendMessage(23, msg => {
|
|
594
|
+
msg.type(k);
|
|
595
|
+
msg.bool(this._impl.world_tracker_ground_anchor_valid(v));
|
|
596
|
+
});
|
|
597
|
+
serializer.sendMessage(26, msg => {
|
|
598
|
+
msg.type(k);
|
|
599
|
+
msg.matrix4x4(this._impl.world_tracker_ground_anchor_pose_raw(v));
|
|
600
|
+
});
|
|
601
|
+
}
|
|
495
602
|
}
|
|
496
603
|
}
|
package/lib/gen/zappar.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { log_level_t } from "./zappar-native";
|
|
|
9
9
|
export { log_level_t } from "./zappar-native";
|
|
10
10
|
import { image_target_type_t } from "./zappar-native";
|
|
11
11
|
export { image_target_type_t } from "./zappar-native";
|
|
12
|
+
export { world_tracker_quality_t } from "./zappar-native";
|
|
12
13
|
export declare type zappar_pipeline_t = number & {
|
|
13
14
|
_: 'zappar_pipeline_t';
|
|
14
15
|
};
|
|
@@ -36,6 +37,9 @@ export declare type zappar_barcode_finder_t = number & {
|
|
|
36
37
|
export declare type zappar_instant_world_tracker_t = number & {
|
|
37
38
|
_: 'zappar_instant_world_tracker_t';
|
|
38
39
|
};
|
|
40
|
+
export declare type zappar_world_tracker_t = number & {
|
|
41
|
+
_: 'zappar_world_tracker_t';
|
|
42
|
+
};
|
|
39
43
|
export interface zappar {
|
|
40
44
|
loaded(): boolean;
|
|
41
45
|
camera_default_device_id(userFacing: boolean): string;
|
|
@@ -77,8 +81,12 @@ export interface zappar {
|
|
|
77
81
|
pipeline_camera_frame_device_attitude(o: zappar_pipeline_t): Float32Array;
|
|
78
82
|
pipeline_camera_frame_user_facing(o: zappar_pipeline_t): boolean;
|
|
79
83
|
pipeline_motion_accelerometer_submit(o: zappar_pipeline_t, time: number, x: number, y: number, z: number): void;
|
|
84
|
+
pipeline_motion_accelerometer_with_gravity_submit_int(o: zappar_pipeline_t, time: number, interval: number, x: number, y: number, z: number): void;
|
|
85
|
+
pipeline_motion_accelerometer_without_gravity_submit_int(o: zappar_pipeline_t, time: number, interval: number, x: number, y: number, z: number): void;
|
|
80
86
|
pipeline_motion_rotation_rate_submit(o: zappar_pipeline_t, time: number, x: number, y: number, z: number): void;
|
|
87
|
+
pipeline_motion_rotation_rate_submit_int(o: zappar_pipeline_t, time: number, interval: number, x: number, y: number, z: number): void;
|
|
81
88
|
pipeline_motion_attitude_submit(o: zappar_pipeline_t, time: number, x: number, y: number, z: number): void;
|
|
89
|
+
pipeline_motion_attitude_submit_int(o: zappar_pipeline_t, time: number, interval: number, x: number, y: number, z: number): void;
|
|
82
90
|
pipeline_motion_attitude_matrix_submit(o: zappar_pipeline_t, mat: Float32Array): void;
|
|
83
91
|
pipeline_sequence_record_start(o: zappar_pipeline_t, expected_frames: number): void;
|
|
84
92
|
pipeline_sequence_record_stop(o: zappar_pipeline_t): void;
|
|
@@ -174,4 +182,22 @@ export interface zappar {
|
|
|
174
182
|
instant_world_tracker_anchor_pose(o: zappar_instant_world_tracker_t, camera_pose: Float32Array, mirror: boolean): Float32Array;
|
|
175
183
|
instant_world_tracker_anchor_pose_set_from_camera_offset_raw(o: zappar_instant_world_tracker_t, x: number, y: number, z: number, orientation: instant_world_tracker_transform_orientation_t): void;
|
|
176
184
|
instant_world_tracker_anchor_pose_set_from_camera_offset(o: zappar_instant_world_tracker_t, x: number, y: number, z: number, orientation: instant_world_tracker_transform_orientation_t): void;
|
|
185
|
+
world_tracker_create(pipeline: zappar_pipeline_t): zappar_world_tracker_t;
|
|
186
|
+
world_tracker_destroy(o: zappar_world_tracker_t): void;
|
|
187
|
+
world_tracker_enabled(o: zappar_world_tracker_t): boolean;
|
|
188
|
+
world_tracker_enabled_set(o: zappar_world_tracker_t, enabled: boolean): void;
|
|
189
|
+
world_tracker_quality(o: zappar_world_tracker_t): number;
|
|
190
|
+
world_tracker_plane_count(o: zappar_world_tracker_t): number;
|
|
191
|
+
world_tracker_plane_pose_raw(o: zappar_world_tracker_t, indx: number): Float32Array;
|
|
192
|
+
world_tracker_plane_pose_camera_relative(o: zappar_world_tracker_t, indx: number, mirror: boolean): Float32Array;
|
|
193
|
+
world_tracker_plane_pose(o: zappar_world_tracker_t, indx: number, camera_pose: Float32Array, mirror: boolean): Float32Array;
|
|
194
|
+
world_tracker_world_anchor_valid(o: zappar_world_tracker_t): boolean;
|
|
195
|
+
world_tracker_world_anchor_pose_raw(o: zappar_world_tracker_t): Float32Array;
|
|
196
|
+
world_tracker_world_anchor_pose_camera_relative(o: zappar_world_tracker_t, mirror: boolean): Float32Array;
|
|
197
|
+
world_tracker_world_anchor_pose(o: zappar_world_tracker_t, camera_pose: Float32Array, mirror: boolean): Float32Array;
|
|
198
|
+
world_tracker_ground_anchor_valid(o: zappar_world_tracker_t): boolean;
|
|
199
|
+
world_tracker_ground_anchor_pose_raw(o: zappar_world_tracker_t): Float32Array;
|
|
200
|
+
world_tracker_ground_anchor_pose_camera_relative(o: zappar_world_tracker_t, mirror: boolean): Float32Array;
|
|
201
|
+
world_tracker_ground_anchor_pose(o: zappar_world_tracker_t, camera_pose: Float32Array, mirror: boolean): Float32Array;
|
|
202
|
+
world_tracker_reset(o: zappar_world_tracker_t): void;
|
|
177
203
|
}
|
package/lib/gen/zappar.js
CHANGED
|
@@ -4,3 +4,4 @@ export { frame_pixel_format_t } from "./zappar-native";
|
|
|
4
4
|
export { instant_world_tracker_transform_orientation_t } from "./zappar-native";
|
|
5
5
|
export { log_level_t } from "./zappar-native";
|
|
6
6
|
export { image_target_type_t } from "./zappar-native";
|
|
7
|
+
export { world_tracker_quality_t } from "./zappar-native";
|