@zappar/zappar-cv 3.0.1-alpha.16 → 3.0.1-alpha.19

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 (42) hide show
  1. package/README.md +2 -2
  2. package/lib/additional.d.ts +1 -0
  3. package/lib/deserializer.d.ts +4 -1
  4. package/lib/deserializer.js +3 -0
  5. package/lib/drawaxis.js +4 -39
  6. package/lib/gen/zappar-bridge.d.ts +34 -10
  7. package/lib/gen/zappar-bridge.js +3 -0
  8. package/lib/gen/zappar-client.d.ts +1 -0
  9. package/lib/gen/zappar-client.js +238 -48
  10. package/lib/gen/zappar-cwrap.js +164 -38
  11. package/lib/gen/zappar-native.d.ts +46 -12
  12. package/lib/gen/zappar-native.js +23 -1
  13. package/lib/gen/zappar-server.d.ts +3 -0
  14. package/lib/gen/zappar-server.js +128 -28
  15. package/lib/gen/zappar.d.ts +41 -12
  16. package/lib/gen/zappar.js +3 -0
  17. package/lib/html-element-source.d.ts +1 -0
  18. package/lib/html-element-source.js +5 -1
  19. package/lib/index.d.ts +1 -1
  20. package/lib/index.js +1 -1
  21. package/lib/mstp-camera-source.js +2 -1
  22. package/lib/native.js +48 -4
  23. package/lib/permission.js +35 -9
  24. package/lib/pipeline.d.ts +1 -1
  25. package/lib/pipeline.js +3 -2
  26. package/lib/sequencesource.js +1 -1
  27. package/lib/serializer.d.ts +4 -1
  28. package/lib/serializer.js +3 -0
  29. package/lib/tr.js +1 -1
  30. package/lib/version.d.ts +1 -1
  31. package/lib/version.js +1 -1
  32. package/lib/worker-imagebitmap.js +1 -1
  33. package/lib/worker-server.js +2 -2
  34. package/lib/workerinterface.d.ts +1 -0
  35. package/lib/zappar-cv.js +1 -1
  36. package/lib/zappar-cv.wasm +0 -0
  37. package/package.json +1 -1
  38. package/umd/{6cf17bab4f58a189fc94.wasm → 3c548945c91fd14a0d90.wasm} +0 -0
  39. package/umd/751.zappar-cv.js +1 -1
  40. package/umd/867.zappar-cv.js +1 -1
  41. package/umd/zappar-cv.js +1 -1
  42. package/umd/zappar-cv.worker.js +1 -1
@@ -97,7 +97,7 @@ export class SequenceSource extends Source {
97
97
  // updates will be one frame later
98
98
  this._submitMotionUpdates(pipeline);
99
99
  const token = pipeline.registerToken(info);
100
- pipeline.sendDataToWorker(info.data || new ArrayBuffer(0), token, info.dataWidth, info.dataHeight, info.userFacing, info.cameraToDevice, info.cameraModel);
100
+ pipeline.sendDataToWorker(info.data || new ArrayBuffer(0), token, info.dataWidth, info.dataHeight, info.userFacing, info.cameraToDevice, info.cameraModel, -1);
101
101
  }
102
102
  destroy() {
103
103
  byId.delete(this._impl);
@@ -1,4 +1,4 @@
1
- import { barcode_format_t, face_landmark_name_t, instant_world_tracker_transform_orientation_t, log_level_t } from "./gen/zappar-native";
1
+ import { barcode_format_t, face_landmark_name_t, instant_world_tracker_transform_orientation_t, transform_orientation_t, log_level_t, plane_orientation_t, anchor_status_t } from "./gen/zappar-native";
2
2
  export interface MessageAppender {
3
3
  int: (i: number) => void;
4
4
  bool: (i: boolean) => void;
@@ -17,6 +17,9 @@ export interface MessageAppender {
17
17
  barcodeFormat: (f: barcode_format_t) => void;
18
18
  faceLandmarkName: (f: face_landmark_name_t) => void;
19
19
  instantTrackerTransformOrientation: (f: instant_world_tracker_transform_orientation_t) => void;
20
+ transformOrientation: (f: transform_orientation_t) => void;
21
+ planeOrientation: (f: plane_orientation_t) => void;
22
+ anchorStatus: (f: anchor_status_t) => void;
20
23
  logLevel: (f: log_level_t) => void;
21
24
  }
22
25
  export declare class MessageSerializer {
package/lib/serializer.js CHANGED
@@ -31,6 +31,9 @@ export class MessageSerializer {
31
31
  barcodeFormat: i => this.int(i),
32
32
  faceLandmarkName: i => this.int(i),
33
33
  instantTrackerTransformOrientation: i => this.int(i),
34
+ transformOrientation: i => this.int(i),
35
+ planeOrientation: i => this.int(i),
36
+ anchorStatus: i => this.int(i),
34
37
  logLevel: i => this.int(i),
35
38
  };
36
39
  this._freeBufferPool.push(new ArrayBuffer(16));
package/lib/tr.js CHANGED
@@ -35,7 +35,7 @@ export function tr(str) {
35
35
  }
36
36
  switch (str) {
37
37
  case STRINGS.PermissionTitle: return "Almost there...";
38
- case STRINGS.PermissionDescription: return "In order to provide this augmented reality experience, we need access to your device's camera and motion sensors.";
38
+ case STRINGS.PermissionDescription: return "In order to provide this immersive experience, we need access to your device's camera and motion sensors.";
39
39
  case STRINGS.PermissionButton: return "Grant Access";
40
40
  }
41
41
  return "";
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "3.0.1-alpha.16";
1
+ export declare const VERSION = "3.0.1-alpha.19";
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "3.0.1-alpha.16";
1
+ export const VERSION = "3.0.1-alpha.19";
@@ -53,7 +53,7 @@ export function handleImageBitmap(m, r, server, mgr) {
53
53
  mgr.postOutgoingMessage(msg, [m.i]);
54
54
  let pipeline = server._pipeline_by_instance.get(m.p);
55
55
  if (pipeline) {
56
- r.pipeline_camera_frame_submit(pipeline, pixels, info.dataWidth, info.dataHeight, m.tokenId, m.cameraToDevice, m.cameraModel, info.userFacing);
56
+ r.pipeline_camera_frame_submit(pipeline, pixels, info.dataWidth, info.dataHeight, m.tokenId, m.cameraToDevice, m.cameraModel, info.userFacing, performance.now());
57
57
  r.pipeline_frame_update(pipeline);
58
58
  server.exploreState();
59
59
  }
@@ -64,7 +64,7 @@ export function launchWorkerServer(wasmUrl, module, shouldRecordData) {
64
64
  let pipeline = server._pipeline_by_instance.get(msgt.p);
65
65
  let att;
66
66
  if (pipeline) {
67
- r.pipeline_camera_frame_submit(pipeline, msgt.d, msgt.width, msgt.height, msgt.token, msgt.c2d, msgt.cm, msgt.userFacing);
67
+ r.pipeline_camera_frame_submit(pipeline, msgt.d, msgt.width, msgt.height, msgt.token, msgt.c2d, msgt.cm, msgt.userFacing, msgt.captureTime);
68
68
  r.pipeline_frame_update(pipeline);
69
69
  att = r.pipeline_camera_frame_device_attitude(pipeline);
70
70
  server.exploreState();
@@ -288,7 +288,7 @@ function consumeReader(mod, r, reader, p, userFacing, server, source, workerMess
288
288
  const pipeline = server._pipeline_by_instance.get(p);
289
289
  if (pipeline) {
290
290
  try {
291
- r.pipeline_camera_frame_submit_raw_pointer(pipeline, streamDataBufferPointer, size, framePixelFormatFromFormat(frame.format), width, height, token, cameraToDeviceTransform, latestCameraToScreenRotation, cameraModel, userFacing, (_b = frame.timestamp) !== null && _b !== void 0 ? _b : -1, downSample);
291
+ r.pipeline_camera_frame_submit_raw_pointer(pipeline, streamDataBufferPointer, size, framePixelFormatFromFormat(frame.format), width, height, token, cameraToDeviceTransform, latestCameraToScreenRotation, cameraModel, userFacing, ((_b = frame.timestamp) !== null && _b !== void 0 ? _b : -1) * 1e-6, downSample);
292
292
  handleMessages(mod, workerMessageAPI);
293
293
  if (dataDownloadAPI)
294
294
  handleDataDownload(mod, dataDownloadAPI);
@@ -11,6 +11,7 @@ export interface CameraFrameC2S {
11
11
  token: number;
12
12
  width: number;
13
13
  height: number;
14
+ captureTime: number;
14
15
  }
15
16
  export interface CameraFrameReturnS2C {
16
17
  t: "cameraFrameRecycleS2C";