@zappar/zappar-cv 3.0.1-alpha.1 → 3.0.1-alpha.10

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 (60) hide show
  1. package/README.md +2 -2
  2. package/lib/additional.d.ts +8 -1
  3. package/lib/camera-frame-data.d.ts +5 -0
  4. package/lib/camera-frame-data.js +1 -0
  5. package/lib/data-download.d.ts +8 -0
  6. package/lib/data-download.js +8 -0
  7. package/lib/deserializer.d.ts +1 -0
  8. package/lib/deserializer.js +7 -0
  9. package/lib/direct.js +1 -1
  10. package/lib/drawgrid.d.ts +2 -0
  11. package/lib/drawgrid.js +136 -0
  12. package/lib/drawpoints.d.ts +11 -0
  13. package/lib/drawpoints.js +180 -0
  14. package/lib/gen/zappar-bridge.d.ts +140 -0
  15. package/lib/gen/zappar-bridge.js +8 -0
  16. package/lib/gen/zappar-client.d.ts +3 -2
  17. package/lib/gen/zappar-client.js +208 -18
  18. package/lib/gen/zappar-cwrap.js +171 -3
  19. package/lib/gen/zappar-native.d.ts +28 -1
  20. package/lib/gen/zappar-native.js +6 -0
  21. package/lib/gen/zappar-server.d.ts +3 -0
  22. package/lib/gen/zappar-server.js +108 -10
  23. package/lib/gen/zappar.d.ts +25 -0
  24. package/lib/gen/zappar.js +1 -0
  25. package/lib/html-element-source.d.ts +3 -1
  26. package/lib/html-element-source.js +13 -6
  27. package/lib/image-process-gl.d.ts +3 -2
  28. package/lib/image-process-gl.js +9 -7
  29. package/lib/imagebitmap-camera-source.d.ts +3 -1
  30. package/lib/imagebitmap-camera-source.js +10 -4
  31. package/lib/imagetracker.d.ts +3 -2
  32. package/lib/index.d.ts +2 -1
  33. package/lib/index.js +1 -1
  34. package/lib/mstp-camera-source.d.ts +2 -1
  35. package/lib/mstp-camera-source.js +5 -0
  36. package/lib/native.js +67 -3
  37. package/lib/pipeline.d.ts +14 -4
  38. package/lib/pipeline.js +84 -5
  39. package/lib/profile.d.ts +2 -2
  40. package/lib/profile.js +3 -3
  41. package/lib/serializer.d.ts +1 -0
  42. package/lib/serializer.js +1 -0
  43. package/lib/source.d.ts +1 -0
  44. package/lib/version.d.ts +1 -1
  45. package/lib/version.js +1 -1
  46. package/lib/worker-client.js +5 -1
  47. package/lib/worker-imagebitmap.js +5 -4
  48. package/lib/worker-server.d.ts +1 -1
  49. package/lib/worker-server.js +84 -12
  50. package/lib/worker.js +2 -1
  51. package/lib/workerinterface.d.ts +24 -1
  52. package/lib/zappar-cv.js +203 -165
  53. package/lib/zappar-cv.wasm +0 -0
  54. package/package.json +1 -1
  55. package/umd/751.zappar-cv.js +1 -0
  56. package/umd/867.zappar-cv.js +1 -1
  57. package/umd/{501114eb92cddf5f56fe.wasm → ca409d4e8cebe454b816.wasm} +0 -0
  58. package/umd/zappar-cv.js +1 -1
  59. package/umd/zappar-cv.worker.js +1 -1
  60. package/umd/429.zappar-cv.js +0 -1
@@ -20,6 +20,7 @@ export class zappar_client {
20
20
  this._face_landmark_state_by_instance = new Map();
21
21
  this._barcode_finder_state_by_instance = new Map();
22
22
  this._instant_world_tracker_state_by_instance = new Map();
23
+ this._zapcode_tracker_state_by_instance = new Map();
23
24
  this._world_tracker_state_by_instance = new Map();
24
25
  this.impl = {
25
26
  log_level: () => {
@@ -103,11 +104,6 @@ export class zappar_client {
103
104
  m.bool(user_facing);
104
105
  });
105
106
  },
106
- pipeline_camera_frame_submit_raw_pointer: (o, data, dataLength, format, width, height, user_data, camera_to_device_transform, rotation, camera_model, user_facing, timestamp) => {
107
- let s = this._pipeline_state_by_instance.get(o);
108
- if (!s)
109
- throw new Error("This object has been destroyed");
110
- },
111
107
  pipeline_camera_frame_camera_attitude: (o) => {
112
108
  let s = this._pipeline_state_by_instance.get(o);
113
109
  if (!s)
@@ -605,6 +601,80 @@ export class zappar_client {
605
601
  m.instantTrackerTransformOrientation(orientation);
606
602
  });
607
603
  },
604
+ // #### zapcode_tracker ####
605
+ zapcode_tracker_create: (pipeline) => {
606
+ let newId = (this._latestId++);
607
+ let s = {
608
+ enabled: true,
609
+ target_loaded_version: -1,
610
+ anchor_count: 0,
611
+ anchor_id: [],
612
+ anchor_pose: [],
613
+ };
614
+ this._zapcode_tracker_state_by_instance.set(newId, s);
615
+ this.serializer.sendMessage(41, m => {
616
+ m.type(newId);
617
+ m.type(pipeline);
618
+ });
619
+ return newId;
620
+ },
621
+ zapcode_tracker_destroy: (o) => {
622
+ let s = this._zapcode_tracker_state_by_instance.get(o);
623
+ if (!s)
624
+ throw new Error("This object has been destroyed");
625
+ this._zapcode_tracker_state_by_instance.delete(o);
626
+ this.serializer.sendMessage(44, m => {
627
+ m.type(o);
628
+ });
629
+ },
630
+ zapcode_tracker_target_load_from_memory: (o, data) => {
631
+ let s = this._zapcode_tracker_state_by_instance.get(o);
632
+ if (!s)
633
+ throw new Error("This object has been destroyed");
634
+ this.serializer.sendMessage(43, m => {
635
+ m.type(o);
636
+ m.dataWithLength(data);
637
+ });
638
+ },
639
+ zapcode_tracker_target_loaded_version: (o) => {
640
+ let s = this._zapcode_tracker_state_by_instance.get(o);
641
+ if (!s)
642
+ throw new Error("This object has been destroyed");
643
+ return s.target_loaded_version;
644
+ },
645
+ zapcode_tracker_enabled: (o) => {
646
+ let s = this._zapcode_tracker_state_by_instance.get(o);
647
+ if (!s)
648
+ throw new Error("This object has been destroyed");
649
+ return s.enabled;
650
+ },
651
+ zapcode_tracker_enabled_set: (o, enabled) => {
652
+ let s = this._zapcode_tracker_state_by_instance.get(o);
653
+ if (!s)
654
+ throw new Error("This object has been destroyed");
655
+ this.serializer.sendMessage(42, m => {
656
+ m.type(o);
657
+ m.bool(enabled);
658
+ });
659
+ },
660
+ zapcode_tracker_anchor_count: (o) => {
661
+ let s = this._zapcode_tracker_state_by_instance.get(o);
662
+ if (!s)
663
+ throw new Error("This object has been destroyed");
664
+ return s.anchor_count;
665
+ },
666
+ zapcode_tracker_anchor_id: (o, indx) => {
667
+ let s = this._zapcode_tracker_state_by_instance.get(o);
668
+ if (!s)
669
+ throw new Error("This object has been destroyed");
670
+ return s.anchor_id[indx];
671
+ },
672
+ zapcode_tracker_anchor_pose_raw: (o, indx) => {
673
+ let s = this._zapcode_tracker_state_by_instance.get(o);
674
+ if (!s)
675
+ throw new Error("This object has been destroyed");
676
+ return s.anchor_pose[indx];
677
+ },
608
678
  // #### world_tracker ####
609
679
  world_tracker_create: (pipeline) => {
610
680
  let newId = (this._latestId++);
@@ -612,14 +682,20 @@ export class zappar_client {
612
682
  enabled: true,
613
683
  plane_count: 0,
614
684
  plane_pose: [],
615
- world_anchor_valid: true,
685
+ world_anchor_valid: false,
616
686
  world_anchor_pose: new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
617
- ground_anchor_valid: true,
687
+ ground_anchor_valid: false,
618
688
  ground_anchor_pose: new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
689
+ tracks_data_enabled: false,
690
+ tracks_data: new Float32Array([]),
691
+ tracks_data_size: 0,
692
+ projections_data_enabled: false,
693
+ projections_data: new Float32Array([]),
694
+ projections_data_size: 0,
619
695
  quality: 0,
620
696
  };
621
697
  this._world_tracker_state_by_instance.set(newId, s);
622
- this.serializer.sendMessage(41, m => {
698
+ this.serializer.sendMessage(45, m => {
623
699
  m.type(newId);
624
700
  m.type(pipeline);
625
701
  });
@@ -630,7 +706,7 @@ export class zappar_client {
630
706
  if (!s)
631
707
  throw new Error("This object has been destroyed");
632
708
  this._world_tracker_state_by_instance.delete(o);
633
- this.serializer.sendMessage(42, m => {
709
+ this.serializer.sendMessage(46, m => {
634
710
  m.type(o);
635
711
  });
636
712
  },
@@ -644,7 +720,7 @@ export class zappar_client {
644
720
  let s = this._world_tracker_state_by_instance.get(o);
645
721
  if (!s)
646
722
  throw new Error("This object has been destroyed");
647
- this.serializer.sendMessage(43, m => {
723
+ this.serializer.sendMessage(47, m => {
648
724
  m.type(o);
649
725
  m.bool(enabled);
650
726
  });
@@ -695,10 +771,58 @@ export class zappar_client {
695
771
  let s = this._world_tracker_state_by_instance.get(o);
696
772
  if (!s)
697
773
  throw new Error("This object has been destroyed");
698
- this.serializer.sendMessage(44, m => {
774
+ this.serializer.sendMessage(48, m => {
775
+ m.type(o);
776
+ });
777
+ },
778
+ world_tracker_tracks_data_enabled: (o) => {
779
+ let s = this._world_tracker_state_by_instance.get(o);
780
+ if (!s)
781
+ throw new Error("This object has been destroyed");
782
+ return s.tracks_data_enabled;
783
+ },
784
+ world_tracker_tracks_data_enabled_set: (o, tracks_data_enabled) => {
785
+ let s = this._world_tracker_state_by_instance.get(o);
786
+ if (!s)
787
+ throw new Error("This object has been destroyed");
788
+ this.serializer.sendMessage(49, m => {
789
+ m.type(o);
790
+ m.bool(tracks_data_enabled);
791
+ });
792
+ },
793
+ world_tracker_tracks_data_size: (o) => {
794
+ let s = this._world_tracker_state_by_instance.get(o);
795
+ if (!s)
796
+ throw new Error("This object has been destroyed");
797
+ return s.tracks_data_size;
798
+ },
799
+ world_tracker_tracks_data: (o) => {
800
+ let s = this._world_tracker_state_by_instance.get(o);
801
+ if (!s)
802
+ throw new Error("This object has been destroyed");
803
+ return s.tracks_data;
804
+ },
805
+ world_tracker_projections_data_enabled_set: (o, tracks_data_enabled) => {
806
+ let s = this._world_tracker_state_by_instance.get(o);
807
+ if (!s)
808
+ throw new Error("This object has been destroyed");
809
+ this.serializer.sendMessage(50, m => {
699
810
  m.type(o);
811
+ m.bool(tracks_data_enabled);
700
812
  });
701
813
  },
814
+ world_tracker_projections_data_size: (o) => {
815
+ let s = this._world_tracker_state_by_instance.get(o);
816
+ if (!s)
817
+ throw new Error("This object has been destroyed");
818
+ return s.projections_data_size;
819
+ },
820
+ world_tracker_projections_data: (o) => {
821
+ let s = this._world_tracker_state_by_instance.get(o);
822
+ if (!s)
823
+ throw new Error("This object has been destroyed");
824
+ return s.projections_data;
825
+ },
702
826
  };
703
827
  }
704
828
  processMessages(a) {
@@ -865,7 +989,41 @@ export class zappar_client {
865
989
  inst.pose = msg.matrix4x4();
866
990
  break;
867
991
  }
868
- case 27: {
992
+ case 24: {
993
+ let handle = msg.type();
994
+ let inst = this._zapcode_tracker_state_by_instance.get(handle);
995
+ if (!inst)
996
+ return;
997
+ inst.target_loaded_version = msg.int();
998
+ break;
999
+ }
1000
+ case 21: {
1001
+ let handle = msg.type();
1002
+ let inst = this._zapcode_tracker_state_by_instance.get(handle);
1003
+ if (!inst)
1004
+ return;
1005
+ inst.anchor_count = msg.int();
1006
+ break;
1007
+ }
1008
+ case 22: {
1009
+ let handle = msg.type();
1010
+ let inst = this._zapcode_tracker_state_by_instance.get(handle);
1011
+ if (!inst)
1012
+ return;
1013
+ let indx = msg.int();
1014
+ inst.anchor_id[indx] = msg.string();
1015
+ break;
1016
+ }
1017
+ case 23: {
1018
+ let handle = msg.type();
1019
+ let inst = this._zapcode_tracker_state_by_instance.get(handle);
1020
+ if (!inst)
1021
+ return;
1022
+ let indx = msg.int();
1023
+ inst.anchor_pose[indx] = msg.matrix4x4();
1024
+ break;
1025
+ }
1026
+ case 31: {
869
1027
  let handle = msg.type();
870
1028
  let inst = this._world_tracker_state_by_instance.get(handle);
871
1029
  if (!inst)
@@ -873,7 +1031,7 @@ export class zappar_client {
873
1031
  inst.quality = msg.int();
874
1032
  break;
875
1033
  }
876
- case 21: {
1034
+ case 25: {
877
1035
  let handle = msg.type();
878
1036
  let inst = this._world_tracker_state_by_instance.get(handle);
879
1037
  if (!inst)
@@ -881,7 +1039,7 @@ export class zappar_client {
881
1039
  inst.plane_count = msg.int();
882
1040
  break;
883
1041
  }
884
- case 22: {
1042
+ case 26: {
885
1043
  let handle = msg.type();
886
1044
  let inst = this._world_tracker_state_by_instance.get(handle);
887
1045
  if (!inst)
@@ -890,7 +1048,7 @@ export class zappar_client {
890
1048
  inst.plane_pose[indx] = msg.matrix4x4();
891
1049
  break;
892
1050
  }
893
- case 23: {
1051
+ case 27: {
894
1052
  let handle = msg.type();
895
1053
  let inst = this._world_tracker_state_by_instance.get(handle);
896
1054
  if (!inst)
@@ -898,7 +1056,7 @@ export class zappar_client {
898
1056
  inst.world_anchor_valid = msg.bool();
899
1057
  break;
900
1058
  }
901
- case 24: {
1059
+ case 28: {
902
1060
  let handle = msg.type();
903
1061
  let inst = this._world_tracker_state_by_instance.get(handle);
904
1062
  if (!inst)
@@ -906,7 +1064,7 @@ export class zappar_client {
906
1064
  inst.world_anchor_pose = msg.matrix4x4();
907
1065
  break;
908
1066
  }
909
- case 23: {
1067
+ case 27: {
910
1068
  let handle = msg.type();
911
1069
  let inst = this._world_tracker_state_by_instance.get(handle);
912
1070
  if (!inst)
@@ -914,7 +1072,7 @@ export class zappar_client {
914
1072
  inst.world_anchor_valid = msg.bool();
915
1073
  break;
916
1074
  }
917
- case 26: {
1075
+ case 30: {
918
1076
  let handle = msg.type();
919
1077
  let inst = this._world_tracker_state_by_instance.get(handle);
920
1078
  if (!inst)
@@ -922,6 +1080,38 @@ export class zappar_client {
922
1080
  inst.ground_anchor_pose = msg.matrix4x4();
923
1081
  break;
924
1082
  }
1083
+ case 34: {
1084
+ let handle = msg.type();
1085
+ let inst = this._world_tracker_state_by_instance.get(handle);
1086
+ if (!inst)
1087
+ return;
1088
+ inst.tracks_data_size = msg.int();
1089
+ break;
1090
+ }
1091
+ case 33: {
1092
+ let handle = msg.type();
1093
+ let inst = this._world_tracker_state_by_instance.get(handle);
1094
+ if (!inst)
1095
+ return;
1096
+ inst.tracks_data = msg.floatArray();
1097
+ break;
1098
+ }
1099
+ case 37: {
1100
+ let handle = msg.type();
1101
+ let inst = this._world_tracker_state_by_instance.get(handle);
1102
+ if (!inst)
1103
+ return;
1104
+ inst.projections_data_size = msg.int();
1105
+ break;
1106
+ }
1107
+ case 36: {
1108
+ let handle = msg.type();
1109
+ let inst = this._world_tracker_state_by_instance.get(handle);
1110
+ if (!inst)
1111
+ return;
1112
+ inst.projections_data = msg.floatArray();
1113
+ break;
1114
+ }
925
1115
  }
926
1116
  });
927
1117
  }
@@ -8,6 +8,18 @@ export function getRuntimeObject(mod) {
8
8
  ]);
9
9
  let pipeline_create_wrapped = mod.cwrap("zappar_pipeline_create", "number", []);
10
10
  let pipeline_destroy_wrapped = mod.cwrap("zappar_pipeline_destroy", null, ["number"]);
11
+ let pipeline_camera_frame_data_raw_wrapped = mod.cwrap("zappar_pipeline_camera_frame_data_raw", "number", [
12
+ "number"
13
+ ]);
14
+ let pipeline_camera_frame_data_raw_size_wrapped = mod.cwrap("zappar_pipeline_camera_frame_data_raw_size", "number", [
15
+ "number"
16
+ ]);
17
+ let pipeline_camera_frame_data_raw_width_wrapped = mod.cwrap("zappar_pipeline_camera_frame_data_raw_width", "number", [
18
+ "number"
19
+ ]);
20
+ let pipeline_camera_frame_data_raw_height_wrapped = mod.cwrap("zappar_pipeline_camera_frame_data_raw_height", "number", [
21
+ "number"
22
+ ]);
11
23
  let pipeline_frame_update_wrapped = mod.cwrap("zappar_pipeline_frame_update", null, [
12
24
  "number"
13
25
  ]);
@@ -26,7 +38,7 @@ export function getRuntimeObject(mod) {
26
38
  ]);
27
39
  let pipeline_camera_frame_submit_raw_pointer_wrapped = mod.cwrap("zappar_pipeline_camera_frame_submit_raw_pointer", null, [
28
40
  "number",
29
- "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"
41
+ "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number", "number"
30
42
  ]);
31
43
  let pipeline_camera_frame_camera_attitude_wrapped = mod.cwrap("zappar_pipeline_camera_frame_camera_attitude", "number", [
32
44
  "number"
@@ -186,6 +198,33 @@ export function getRuntimeObject(mod) {
186
198
  "number",
187
199
  "number", "number", "number", "number"
188
200
  ]);
201
+ let zapcode_tracker_create_wrapped = mod.cwrap("zappar_zapcode_tracker_create", "number", ["number"]);
202
+ let zapcode_tracker_destroy_wrapped = mod.cwrap("zappar_zapcode_tracker_destroy", null, ["number"]);
203
+ let zapcode_tracker_target_load_from_memory_wrapped = mod.cwrap("zappar_zapcode_tracker_target_load_from_memory", null, [
204
+ "number",
205
+ "number", "number"
206
+ ]);
207
+ let zapcode_tracker_target_loaded_version_wrapped = mod.cwrap("zappar_zapcode_tracker_target_loaded_version", "number", [
208
+ "number"
209
+ ]);
210
+ let zapcode_tracker_enabled_wrapped = mod.cwrap("zappar_zapcode_tracker_enabled", "number", [
211
+ "number"
212
+ ]);
213
+ let zapcode_tracker_enabled_set_wrapped = mod.cwrap("zappar_zapcode_tracker_enabled_set", null, [
214
+ "number",
215
+ "number"
216
+ ]);
217
+ let zapcode_tracker_anchor_count_wrapped = mod.cwrap("zappar_zapcode_tracker_anchor_count", "number", [
218
+ "number"
219
+ ]);
220
+ let zapcode_tracker_anchor_id_wrapped = mod.cwrap("zappar_zapcode_tracker_anchor_id", "string", [
221
+ "number",
222
+ "number"
223
+ ]);
224
+ let zapcode_tracker_anchor_pose_raw_wrapped = mod.cwrap("zappar_zapcode_tracker_anchor_pose_raw", "number", [
225
+ "number",
226
+ "number"
227
+ ]);
189
228
  let world_tracker_create_wrapped = mod.cwrap("zappar_world_tracker_create", "number", ["number"]);
190
229
  let world_tracker_destroy_wrapped = mod.cwrap("zappar_world_tracker_destroy", null, ["number"]);
191
230
  let world_tracker_enabled_wrapped = mod.cwrap("zappar_world_tracker_enabled", "number", [
@@ -220,6 +259,29 @@ export function getRuntimeObject(mod) {
220
259
  let world_tracker_reset_wrapped = mod.cwrap("zappar_world_tracker_reset", null, [
221
260
  "number"
222
261
  ]);
262
+ let world_tracker_tracks_data_enabled_wrapped = mod.cwrap("zappar_world_tracker_tracks_data_enabled", "number", [
263
+ "number"
264
+ ]);
265
+ let world_tracker_tracks_data_enabled_set_wrapped = mod.cwrap("zappar_world_tracker_tracks_data_enabled_set", null, [
266
+ "number",
267
+ "number"
268
+ ]);
269
+ let world_tracker_tracks_data_size_wrapped = mod.cwrap("zappar_world_tracker_tracks_data_size", "number", [
270
+ "number"
271
+ ]);
272
+ let world_tracker_tracks_data_wrapped = mod.cwrap("zappar_world_tracker_tracks_data", "number", [
273
+ "number"
274
+ ]);
275
+ let world_tracker_projections_data_enabled_set_wrapped = mod.cwrap("zappar_world_tracker_projections_data_enabled_set", null, [
276
+ "number",
277
+ "number"
278
+ ]);
279
+ let world_tracker_projections_data_size_wrapped = mod.cwrap("zappar_world_tracker_projections_data_size", "number", [
280
+ "number"
281
+ ]);
282
+ let world_tracker_projections_data_wrapped = mod.cwrap("zappar_world_tracker_projections_data", "number", [
283
+ "number"
284
+ ]);
223
285
  let dataArrayArgLength = 32;
224
286
  let dataArrayArg = mod._malloc(dataArrayArgLength);
225
287
  let floatDataArrayArgLength = 16 * 4;
@@ -257,6 +319,22 @@ export function getRuntimeObject(mod) {
257
319
  pipeline_destroy: () => {
258
320
  pipeline_destroy_wrapped();
259
321
  },
322
+ pipeline_camera_frame_data_raw: (o) => {
323
+ let ret = pipeline_camera_frame_data_raw_wrapped(o);
324
+ return ret;
325
+ },
326
+ pipeline_camera_frame_data_raw_size: (o) => {
327
+ let ret = pipeline_camera_frame_data_raw_size_wrapped(o);
328
+ return ret;
329
+ },
330
+ pipeline_camera_frame_data_raw_width: (o) => {
331
+ let ret = pipeline_camera_frame_data_raw_width_wrapped(o);
332
+ return ret;
333
+ },
334
+ pipeline_camera_frame_data_raw_height: (o) => {
335
+ let ret = pipeline_camera_frame_data_raw_height_wrapped(o);
336
+ return ret;
337
+ },
260
338
  pipeline_frame_update: (o) => {
261
339
  let ret = pipeline_frame_update_wrapped(o);
262
340
  return ret;
@@ -296,7 +374,7 @@ export function getRuntimeObject(mod) {
296
374
  let ret = pipeline_camera_frame_submit_wrapped(o, arg_data, arg_len_data, arg_width, arg_height, arg_user_data, arg_camera_to_device_transform, arg_camera_model, arg_user_facing);
297
375
  return ret;
298
376
  },
299
- pipeline_camera_frame_submit_raw_pointer: (o, data, dataLength, format, width, height, user_data, camera_to_device_transform, rotation, camera_model, user_facing, timestamp) => {
377
+ pipeline_camera_frame_submit_raw_pointer: (o, data, dataLength, format, width, height, user_data, camera_to_device_transform, rotation, camera_model, user_facing, timestamp, halfSample) => {
300
378
  let arg_data = data;
301
379
  let arg_dataLength = dataLength;
302
380
  let arg_format = format;
@@ -310,7 +388,8 @@ export function getRuntimeObject(mod) {
310
388
  mod.HEAPF32.set(camera_model, arg_camera_model / 4);
311
389
  let arg_user_facing = user_facing ? 1 : 0;
312
390
  let arg_timestamp = timestamp;
313
- let ret = pipeline_camera_frame_submit_raw_pointer_wrapped(o, arg_data, arg_dataLength, arg_format, arg_width, arg_height, arg_user_data, arg_camera_to_device_transform, arg_rotation, arg_camera_model, arg_user_facing, arg_timestamp);
391
+ let arg_halfSample = halfSample ? 1 : 0;
392
+ let ret = pipeline_camera_frame_submit_raw_pointer_wrapped(o, arg_data, arg_dataLength, arg_format, arg_width, arg_height, arg_user_data, arg_camera_to_device_transform, arg_rotation, arg_camera_model, arg_user_facing, arg_timestamp, arg_halfSample);
314
393
  return ret;
315
394
  },
316
395
  pipeline_camera_frame_camera_attitude: (o) => {
@@ -618,6 +697,56 @@ export function getRuntimeObject(mod) {
618
697
  let ret = instant_world_tracker_anchor_pose_set_from_camera_offset_raw_wrapped(o, arg_x, arg_y, arg_z, arg_orientation);
619
698
  return ret;
620
699
  },
700
+ zapcode_tracker_create: (pipeline) => {
701
+ let arg_pipeline = pipeline;
702
+ return zapcode_tracker_create_wrapped(arg_pipeline);
703
+ },
704
+ zapcode_tracker_destroy: () => {
705
+ zapcode_tracker_destroy_wrapped();
706
+ },
707
+ zapcode_tracker_target_load_from_memory: (o, data) => {
708
+ if (dataArrayArgLength < data.byteLength) {
709
+ mod._free(dataArrayArg);
710
+ dataArrayArgLength = data.byteLength;
711
+ dataArrayArg = mod._malloc(dataArrayArgLength);
712
+ }
713
+ let arg_data = dataArrayArg;
714
+ let arg_len_data = data.byteLength;
715
+ mod.HEAPU8.set(new Uint8Array(data), dataArrayArg);
716
+ let ret = zapcode_tracker_target_load_from_memory_wrapped(o, arg_data, arg_len_data);
717
+ return ret;
718
+ },
719
+ zapcode_tracker_target_loaded_version: (o) => {
720
+ let ret = zapcode_tracker_target_loaded_version_wrapped(o);
721
+ return ret;
722
+ },
723
+ zapcode_tracker_enabled: (o) => {
724
+ let ret = zapcode_tracker_enabled_wrapped(o);
725
+ ret = ret === 1;
726
+ return ret;
727
+ },
728
+ zapcode_tracker_enabled_set: (o, enabled) => {
729
+ let arg_enabled = enabled ? 1 : 0;
730
+ let ret = zapcode_tracker_enabled_set_wrapped(o, arg_enabled);
731
+ return ret;
732
+ },
733
+ zapcode_tracker_anchor_count: (o) => {
734
+ let ret = zapcode_tracker_anchor_count_wrapped(o);
735
+ return ret;
736
+ },
737
+ zapcode_tracker_anchor_id: (o, indx) => {
738
+ let arg_indx = indx;
739
+ let ret = zapcode_tracker_anchor_id_wrapped(o, arg_indx);
740
+ return ret;
741
+ },
742
+ zapcode_tracker_anchor_pose_raw: (o, indx) => {
743
+ let arg_indx = indx;
744
+ let ret = zapcode_tracker_anchor_pose_raw_wrapped(o, arg_indx);
745
+ let ab = new Float32Array(16);
746
+ ab.set(mod.HEAPF32.subarray(ret / 4, 16 + ret / 4));
747
+ ret = ab;
748
+ return ret;
749
+ },
621
750
  world_tracker_create: (pipeline) => {
622
751
  let arg_pipeline = pipeline;
623
752
  return world_tracker_create_wrapped(arg_pipeline);
@@ -679,5 +808,44 @@ export function getRuntimeObject(mod) {
679
808
  let ret = world_tracker_reset_wrapped(o);
680
809
  return ret;
681
810
  },
811
+ world_tracker_tracks_data_enabled: (o) => {
812
+ let ret = world_tracker_tracks_data_enabled_wrapped(o);
813
+ ret = ret === 1;
814
+ return ret;
815
+ },
816
+ world_tracker_tracks_data_enabled_set: (o, tracks_data_enabled) => {
817
+ let arg_tracks_data_enabled = tracks_data_enabled ? 1 : 0;
818
+ let ret = world_tracker_tracks_data_enabled_set_wrapped(o, arg_tracks_data_enabled);
819
+ return ret;
820
+ },
821
+ world_tracker_tracks_data_size: (o) => {
822
+ let ret = world_tracker_tracks_data_size_wrapped(o);
823
+ return ret;
824
+ },
825
+ world_tracker_tracks_data: (o) => {
826
+ let ret = world_tracker_tracks_data_wrapped(o);
827
+ let retsize = world_tracker_tracks_data_size_wrapped(o);
828
+ let ab = new Float32Array(retsize);
829
+ ab.set(mod.HEAPF32.subarray(ret / 4, retsize + ret / 4));
830
+ ret = ab;
831
+ return ret;
832
+ },
833
+ world_tracker_projections_data_enabled_set: (o, tracks_data_enabled) => {
834
+ let arg_tracks_data_enabled = tracks_data_enabled ? 1 : 0;
835
+ let ret = world_tracker_projections_data_enabled_set_wrapped(o, arg_tracks_data_enabled);
836
+ return ret;
837
+ },
838
+ world_tracker_projections_data_size: (o) => {
839
+ let ret = world_tracker_projections_data_size_wrapped(o);
840
+ return ret;
841
+ },
842
+ world_tracker_projections_data: (o) => {
843
+ let ret = world_tracker_projections_data_wrapped(o);
844
+ let retsize = world_tracker_projections_data_size_wrapped(o);
845
+ let ab = new Float32Array(retsize);
846
+ ab.set(mod.HEAPF32.subarray(ret / 4, retsize + ret / 4));
847
+ ret = ab;
848
+ return ret;
849
+ },
682
850
  };
683
851
  }
@@ -66,6 +66,10 @@ export declare enum world_tracker_quality_t {
66
66
  WORLD_TRACKER_QUALITY_GOOD = 1,
67
67
  WORLD_TRACKER_QUALITY_ORIENTATION_ONLY = 2
68
68
  }
69
+ export declare enum camera_profile_t {
70
+ DEFAULT = 0,
71
+ HIGH = 1
72
+ }
69
73
  export declare type zappar_pipeline_t = number & {
70
74
  _: 'zappar_pipeline_t';
71
75
  };
@@ -93,6 +97,9 @@ export declare type zappar_barcode_finder_t = number & {
93
97
  export declare type zappar_instant_world_tracker_t = number & {
94
98
  _: 'zappar_instant_world_tracker_t';
95
99
  };
100
+ export declare type zappar_zapcode_tracker_t = number & {
101
+ _: 'zappar_zapcode_tracker_t';
102
+ };
96
103
  export declare type zappar_world_tracker_t = number & {
97
104
  _: 'zappar_world_tracker_t';
98
105
  };
@@ -102,12 +109,16 @@ export interface zappar_cwrap {
102
109
  analytics_project_id_set(id: string, uid: string): void;
103
110
  pipeline_create(): zappar_pipeline_t;
104
111
  pipeline_destroy(o: zappar_pipeline_t): void;
112
+ pipeline_camera_frame_data_raw(o: zappar_pipeline_t): number;
113
+ pipeline_camera_frame_data_raw_size(o: zappar_pipeline_t): number;
114
+ pipeline_camera_frame_data_raw_width(o: zappar_pipeline_t): number;
115
+ pipeline_camera_frame_data_raw_height(o: zappar_pipeline_t): number;
105
116
  pipeline_frame_update(o: zappar_pipeline_t): void;
106
117
  pipeline_frame_number(o: zappar_pipeline_t): number;
107
118
  pipeline_camera_model(o: zappar_pipeline_t): Float32Array;
108
119
  pipeline_camera_frame_user_data(o: zappar_pipeline_t): number;
109
120
  pipeline_camera_frame_submit(o: zappar_pipeline_t, data: ArrayBuffer, width: number, height: number, user_data: number, camera_to_device_transform: Float32Array, camera_model: Float32Array, user_facing: boolean): void;
110
- pipeline_camera_frame_submit_raw_pointer(o: zappar_pipeline_t, data: number, dataLength: number, format: frame_pixel_format_t, width: number, height: number, user_data: number, camera_to_device_transform: Float32Array, rotation: number, camera_model: Float32Array, user_facing: boolean, timestamp: number): void;
121
+ pipeline_camera_frame_submit_raw_pointer(o: zappar_pipeline_t, data: number, dataLength: number, format: frame_pixel_format_t, width: number, height: number, user_data: number, camera_to_device_transform: Float32Array, rotation: number, camera_model: Float32Array, user_facing: boolean, timestamp: number, halfSample: boolean): void;
111
122
  pipeline_camera_frame_camera_attitude(o: zappar_pipeline_t): Float32Array;
112
123
  pipeline_camera_frame_device_attitude(o: zappar_pipeline_t): Float32Array;
113
124
  pipeline_motion_accelerometer_submit(o: zappar_pipeline_t, time: number, x: number, y: number, z: number): void;
@@ -163,6 +174,15 @@ export interface zappar_cwrap {
163
174
  instant_world_tracker_enabled(o: zappar_instant_world_tracker_t): boolean;
164
175
  instant_world_tracker_anchor_pose_raw(o: zappar_instant_world_tracker_t): Float32Array;
165
176
  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;
177
+ zapcode_tracker_create(pipeline: zappar_pipeline_t): zappar_zapcode_tracker_t;
178
+ zapcode_tracker_destroy(o: zappar_zapcode_tracker_t): void;
179
+ zapcode_tracker_target_load_from_memory(o: zappar_zapcode_tracker_t, data: ArrayBuffer): void;
180
+ zapcode_tracker_target_loaded_version(o: zappar_zapcode_tracker_t): number;
181
+ zapcode_tracker_enabled(o: zappar_zapcode_tracker_t): boolean;
182
+ zapcode_tracker_enabled_set(o: zappar_zapcode_tracker_t, enabled: boolean): void;
183
+ zapcode_tracker_anchor_count(o: zappar_zapcode_tracker_t): number;
184
+ zapcode_tracker_anchor_id(o: zappar_zapcode_tracker_t, indx: number): string;
185
+ zapcode_tracker_anchor_pose_raw(o: zappar_zapcode_tracker_t, indx: number): Float32Array;
166
186
  world_tracker_create(pipeline: zappar_pipeline_t): zappar_world_tracker_t;
167
187
  world_tracker_destroy(o: zappar_world_tracker_t): void;
168
188
  world_tracker_enabled(o: zappar_world_tracker_t): boolean;
@@ -175,4 +195,11 @@ export interface zappar_cwrap {
175
195
  world_tracker_ground_anchor_valid(o: zappar_world_tracker_t): boolean;
176
196
  world_tracker_ground_anchor_pose_raw(o: zappar_world_tracker_t): Float32Array;
177
197
  world_tracker_reset(o: zappar_world_tracker_t): void;
198
+ world_tracker_tracks_data_enabled(o: zappar_world_tracker_t): boolean;
199
+ world_tracker_tracks_data_enabled_set(o: zappar_world_tracker_t, tracks_data_enabled: boolean): void;
200
+ world_tracker_tracks_data_size(o: zappar_world_tracker_t): number;
201
+ world_tracker_tracks_data(o: zappar_world_tracker_t): Float32Array;
202
+ world_tracker_projections_data_enabled_set(o: zappar_world_tracker_t, tracks_data_enabled: boolean): void;
203
+ world_tracker_projections_data_size(o: zappar_world_tracker_t): number;
204
+ world_tracker_projections_data(o: zappar_world_tracker_t): Float32Array;
178
205
  }
@@ -80,3 +80,9 @@ export var world_tracker_quality_t;
80
80
  world_tracker_quality_t[world_tracker_quality_t["WORLD_TRACKER_QUALITY_ORIENTATION_ONLY"] = 2] = "WORLD_TRACKER_QUALITY_ORIENTATION_ONLY";
81
81
  })(world_tracker_quality_t || (world_tracker_quality_t = {}));
82
82
  ;
83
+ export var camera_profile_t;
84
+ (function (camera_profile_t) {
85
+ camera_profile_t[camera_profile_t["DEFAULT"] = 0] = "DEFAULT";
86
+ camera_profile_t[camera_profile_t["HIGH"] = 1] = "HIGH";
87
+ })(camera_profile_t || (camera_profile_t = {}));
88
+ ;
@@ -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_zapcode_tracker_t } from "./zappar-native";
12
13
  import { zappar_world_tracker_t } from "./zappar-native";
13
14
  export declare class zappar_server {
14
15
  private _impl;
@@ -34,6 +35,8 @@ export declare class zappar_server {
34
35
  _barcode_finder_by_instance: Map<number, zappar_barcode_finder_t>;
35
36
  _pipeline_id_by_instant_world_tracker_id: Map<number, number>;
36
37
  _instant_world_tracker_by_instance: Map<number, zappar_instant_world_tracker_t>;
38
+ _pipeline_id_by_zapcode_tracker_id: Map<number, number>;
39
+ _zapcode_tracker_by_instance: Map<number, zappar_zapcode_tracker_t>;
37
40
  _pipeline_id_by_world_tracker_id: Map<number, number>;
38
41
  _world_tracker_by_instance: Map<number, zappar_world_tracker_t>;
39
42
  processBuffer(b: ArrayBuffer): void;