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

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 +141 -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 +214 -18
  18. package/lib/gen/zappar-cwrap.js +179 -3
  19. package/lib/gen/zappar-native.d.ts +29 -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 +26 -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 +1 -174
  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/{501114eb92cddf5f56fe.wasm → 7a7455e00ac55a4f34d3.wasm} +0 -0
  57. package/umd/867.zappar-cv.js +1 -1
  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,64 @@ 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: (o) => {
806
+ let s = this._world_tracker_state_by_instance.get(o);
807
+ if (!s)
808
+ throw new Error("This object has been destroyed");
809
+ return s.projections_data_enabled;
810
+ },
811
+ world_tracker_projections_data_enabled_set: (o, projections_data_enabled) => {
812
+ let s = this._world_tracker_state_by_instance.get(o);
813
+ if (!s)
814
+ throw new Error("This object has been destroyed");
815
+ this.serializer.sendMessage(50, m => {
699
816
  m.type(o);
817
+ m.bool(projections_data_enabled);
700
818
  });
701
819
  },
820
+ world_tracker_projections_data_size: (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_size;
825
+ },
826
+ world_tracker_projections_data: (o) => {
827
+ let s = this._world_tracker_state_by_instance.get(o);
828
+ if (!s)
829
+ throw new Error("This object has been destroyed");
830
+ return s.projections_data;
831
+ },
702
832
  };
703
833
  }
704
834
  processMessages(a) {
@@ -865,7 +995,41 @@ export class zappar_client {
865
995
  inst.pose = msg.matrix4x4();
866
996
  break;
867
997
  }
868
- case 27: {
998
+ case 24: {
999
+ let handle = msg.type();
1000
+ let inst = this._zapcode_tracker_state_by_instance.get(handle);
1001
+ if (!inst)
1002
+ return;
1003
+ inst.target_loaded_version = msg.int();
1004
+ break;
1005
+ }
1006
+ case 21: {
1007
+ let handle = msg.type();
1008
+ let inst = this._zapcode_tracker_state_by_instance.get(handle);
1009
+ if (!inst)
1010
+ return;
1011
+ inst.anchor_count = msg.int();
1012
+ break;
1013
+ }
1014
+ case 22: {
1015
+ let handle = msg.type();
1016
+ let inst = this._zapcode_tracker_state_by_instance.get(handle);
1017
+ if (!inst)
1018
+ return;
1019
+ let indx = msg.int();
1020
+ inst.anchor_id[indx] = msg.string();
1021
+ break;
1022
+ }
1023
+ case 23: {
1024
+ let handle = msg.type();
1025
+ let inst = this._zapcode_tracker_state_by_instance.get(handle);
1026
+ if (!inst)
1027
+ return;
1028
+ let indx = msg.int();
1029
+ inst.anchor_pose[indx] = msg.matrix4x4();
1030
+ break;
1031
+ }
1032
+ case 31: {
869
1033
  let handle = msg.type();
870
1034
  let inst = this._world_tracker_state_by_instance.get(handle);
871
1035
  if (!inst)
@@ -873,7 +1037,7 @@ export class zappar_client {
873
1037
  inst.quality = msg.int();
874
1038
  break;
875
1039
  }
876
- case 21: {
1040
+ case 25: {
877
1041
  let handle = msg.type();
878
1042
  let inst = this._world_tracker_state_by_instance.get(handle);
879
1043
  if (!inst)
@@ -881,7 +1045,7 @@ export class zappar_client {
881
1045
  inst.plane_count = msg.int();
882
1046
  break;
883
1047
  }
884
- case 22: {
1048
+ case 26: {
885
1049
  let handle = msg.type();
886
1050
  let inst = this._world_tracker_state_by_instance.get(handle);
887
1051
  if (!inst)
@@ -890,7 +1054,7 @@ export class zappar_client {
890
1054
  inst.plane_pose[indx] = msg.matrix4x4();
891
1055
  break;
892
1056
  }
893
- case 23: {
1057
+ case 27: {
894
1058
  let handle = msg.type();
895
1059
  let inst = this._world_tracker_state_by_instance.get(handle);
896
1060
  if (!inst)
@@ -898,7 +1062,7 @@ export class zappar_client {
898
1062
  inst.world_anchor_valid = msg.bool();
899
1063
  break;
900
1064
  }
901
- case 24: {
1065
+ case 28: {
902
1066
  let handle = msg.type();
903
1067
  let inst = this._world_tracker_state_by_instance.get(handle);
904
1068
  if (!inst)
@@ -906,7 +1070,7 @@ export class zappar_client {
906
1070
  inst.world_anchor_pose = msg.matrix4x4();
907
1071
  break;
908
1072
  }
909
- case 23: {
1073
+ case 27: {
910
1074
  let handle = msg.type();
911
1075
  let inst = this._world_tracker_state_by_instance.get(handle);
912
1076
  if (!inst)
@@ -914,7 +1078,7 @@ export class zappar_client {
914
1078
  inst.world_anchor_valid = msg.bool();
915
1079
  break;
916
1080
  }
917
- case 26: {
1081
+ case 30: {
918
1082
  let handle = msg.type();
919
1083
  let inst = this._world_tracker_state_by_instance.get(handle);
920
1084
  if (!inst)
@@ -922,6 +1086,38 @@ export class zappar_client {
922
1086
  inst.ground_anchor_pose = msg.matrix4x4();
923
1087
  break;
924
1088
  }
1089
+ case 34: {
1090
+ let handle = msg.type();
1091
+ let inst = this._world_tracker_state_by_instance.get(handle);
1092
+ if (!inst)
1093
+ return;
1094
+ inst.tracks_data_size = msg.int();
1095
+ break;
1096
+ }
1097
+ case 33: {
1098
+ let handle = msg.type();
1099
+ let inst = this._world_tracker_state_by_instance.get(handle);
1100
+ if (!inst)
1101
+ return;
1102
+ inst.tracks_data = msg.floatArray();
1103
+ break;
1104
+ }
1105
+ case 37: {
1106
+ let handle = msg.type();
1107
+ let inst = this._world_tracker_state_by_instance.get(handle);
1108
+ if (!inst)
1109
+ return;
1110
+ inst.projections_data_size = msg.int();
1111
+ break;
1112
+ }
1113
+ case 36: {
1114
+ let handle = msg.type();
1115
+ let inst = this._world_tracker_state_by_instance.get(handle);
1116
+ if (!inst)
1117
+ return;
1118
+ inst.projections_data = msg.floatArray();
1119
+ break;
1120
+ }
925
1121
  }
926
1122
  });
927
1123
  }
@@ -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,32 @@ 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_wrapped = mod.cwrap("zappar_world_tracker_projections_data_enabled", "number", [
276
+ "number"
277
+ ]);
278
+ let world_tracker_projections_data_enabled_set_wrapped = mod.cwrap("zappar_world_tracker_projections_data_enabled_set", null, [
279
+ "number",
280
+ "number"
281
+ ]);
282
+ let world_tracker_projections_data_size_wrapped = mod.cwrap("zappar_world_tracker_projections_data_size", "number", [
283
+ "number"
284
+ ]);
285
+ let world_tracker_projections_data_wrapped = mod.cwrap("zappar_world_tracker_projections_data", "number", [
286
+ "number"
287
+ ]);
223
288
  let dataArrayArgLength = 32;
224
289
  let dataArrayArg = mod._malloc(dataArrayArgLength);
225
290
  let floatDataArrayArgLength = 16 * 4;
@@ -257,6 +322,22 @@ export function getRuntimeObject(mod) {
257
322
  pipeline_destroy: () => {
258
323
  pipeline_destroy_wrapped();
259
324
  },
325
+ pipeline_camera_frame_data_raw: (o) => {
326
+ let ret = pipeline_camera_frame_data_raw_wrapped(o);
327
+ return ret;
328
+ },
329
+ pipeline_camera_frame_data_raw_size: (o) => {
330
+ let ret = pipeline_camera_frame_data_raw_size_wrapped(o);
331
+ return ret;
332
+ },
333
+ pipeline_camera_frame_data_raw_width: (o) => {
334
+ let ret = pipeline_camera_frame_data_raw_width_wrapped(o);
335
+ return ret;
336
+ },
337
+ pipeline_camera_frame_data_raw_height: (o) => {
338
+ let ret = pipeline_camera_frame_data_raw_height_wrapped(o);
339
+ return ret;
340
+ },
260
341
  pipeline_frame_update: (o) => {
261
342
  let ret = pipeline_frame_update_wrapped(o);
262
343
  return ret;
@@ -296,7 +377,7 @@ export function getRuntimeObject(mod) {
296
377
  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
378
  return ret;
298
379
  },
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) => {
380
+ 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
381
  let arg_data = data;
301
382
  let arg_dataLength = dataLength;
302
383
  let arg_format = format;
@@ -310,7 +391,8 @@ export function getRuntimeObject(mod) {
310
391
  mod.HEAPF32.set(camera_model, arg_camera_model / 4);
311
392
  let arg_user_facing = user_facing ? 1 : 0;
312
393
  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);
394
+ let arg_halfSample = halfSample ? 1 : 0;
395
+ 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
396
  return ret;
315
397
  },
316
398
  pipeline_camera_frame_camera_attitude: (o) => {
@@ -618,6 +700,56 @@ export function getRuntimeObject(mod) {
618
700
  let ret = instant_world_tracker_anchor_pose_set_from_camera_offset_raw_wrapped(o, arg_x, arg_y, arg_z, arg_orientation);
619
701
  return ret;
620
702
  },
703
+ zapcode_tracker_create: (pipeline) => {
704
+ let arg_pipeline = pipeline;
705
+ return zapcode_tracker_create_wrapped(arg_pipeline);
706
+ },
707
+ zapcode_tracker_destroy: () => {
708
+ zapcode_tracker_destroy_wrapped();
709
+ },
710
+ zapcode_tracker_target_load_from_memory: (o, data) => {
711
+ if (dataArrayArgLength < data.byteLength) {
712
+ mod._free(dataArrayArg);
713
+ dataArrayArgLength = data.byteLength;
714
+ dataArrayArg = mod._malloc(dataArrayArgLength);
715
+ }
716
+ let arg_data = dataArrayArg;
717
+ let arg_len_data = data.byteLength;
718
+ mod.HEAPU8.set(new Uint8Array(data), dataArrayArg);
719
+ let ret = zapcode_tracker_target_load_from_memory_wrapped(o, arg_data, arg_len_data);
720
+ return ret;
721
+ },
722
+ zapcode_tracker_target_loaded_version: (o) => {
723
+ let ret = zapcode_tracker_target_loaded_version_wrapped(o);
724
+ return ret;
725
+ },
726
+ zapcode_tracker_enabled: (o) => {
727
+ let ret = zapcode_tracker_enabled_wrapped(o);
728
+ ret = ret === 1;
729
+ return ret;
730
+ },
731
+ zapcode_tracker_enabled_set: (o, enabled) => {
732
+ let arg_enabled = enabled ? 1 : 0;
733
+ let ret = zapcode_tracker_enabled_set_wrapped(o, arg_enabled);
734
+ return ret;
735
+ },
736
+ zapcode_tracker_anchor_count: (o) => {
737
+ let ret = zapcode_tracker_anchor_count_wrapped(o);
738
+ return ret;
739
+ },
740
+ zapcode_tracker_anchor_id: (o, indx) => {
741
+ let arg_indx = indx;
742
+ let ret = zapcode_tracker_anchor_id_wrapped(o, arg_indx);
743
+ return ret;
744
+ },
745
+ zapcode_tracker_anchor_pose_raw: (o, indx) => {
746
+ let arg_indx = indx;
747
+ let ret = zapcode_tracker_anchor_pose_raw_wrapped(o, arg_indx);
748
+ let ab = new Float32Array(16);
749
+ ab.set(mod.HEAPF32.subarray(ret / 4, 16 + ret / 4));
750
+ ret = ab;
751
+ return ret;
752
+ },
621
753
  world_tracker_create: (pipeline) => {
622
754
  let arg_pipeline = pipeline;
623
755
  return world_tracker_create_wrapped(arg_pipeline);
@@ -679,5 +811,49 @@ export function getRuntimeObject(mod) {
679
811
  let ret = world_tracker_reset_wrapped(o);
680
812
  return ret;
681
813
  },
814
+ world_tracker_tracks_data_enabled: (o) => {
815
+ let ret = world_tracker_tracks_data_enabled_wrapped(o);
816
+ ret = ret === 1;
817
+ return ret;
818
+ },
819
+ world_tracker_tracks_data_enabled_set: (o, tracks_data_enabled) => {
820
+ let arg_tracks_data_enabled = tracks_data_enabled ? 1 : 0;
821
+ let ret = world_tracker_tracks_data_enabled_set_wrapped(o, arg_tracks_data_enabled);
822
+ return ret;
823
+ },
824
+ world_tracker_tracks_data_size: (o) => {
825
+ let ret = world_tracker_tracks_data_size_wrapped(o);
826
+ return ret;
827
+ },
828
+ world_tracker_tracks_data: (o) => {
829
+ let ret = world_tracker_tracks_data_wrapped(o);
830
+ let retsize = world_tracker_tracks_data_size_wrapped(o);
831
+ let ab = new Float32Array(retsize);
832
+ ab.set(mod.HEAPF32.subarray(ret / 4, retsize + ret / 4));
833
+ ret = ab;
834
+ return ret;
835
+ },
836
+ world_tracker_projections_data_enabled: (o) => {
837
+ let ret = world_tracker_projections_data_enabled_wrapped(o);
838
+ ret = ret === 1;
839
+ return ret;
840
+ },
841
+ world_tracker_projections_data_enabled_set: (o, projections_data_enabled) => {
842
+ let arg_projections_data_enabled = projections_data_enabled ? 1 : 0;
843
+ let ret = world_tracker_projections_data_enabled_set_wrapped(o, arg_projections_data_enabled);
844
+ return ret;
845
+ },
846
+ world_tracker_projections_data_size: (o) => {
847
+ let ret = world_tracker_projections_data_size_wrapped(o);
848
+ return ret;
849
+ },
850
+ world_tracker_projections_data: (o) => {
851
+ let ret = world_tracker_projections_data_wrapped(o);
852
+ let retsize = world_tracker_projections_data_size_wrapped(o);
853
+ let ab = new Float32Array(retsize);
854
+ ab.set(mod.HEAPF32.subarray(ret / 4, retsize + ret / 4));
855
+ ret = ab;
856
+ return ret;
857
+ },
682
858
  };
683
859
  }
@@ -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,12 @@ 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(o: zappar_world_tracker_t): boolean;
203
+ world_tracker_projections_data_enabled_set(o: zappar_world_tracker_t, projections_data_enabled: boolean): void;
204
+ world_tracker_projections_data_size(o: zappar_world_tracker_t): number;
205
+ world_tracker_projections_data(o: zappar_world_tracker_t): Float32Array;
178
206
  }
@@ -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;