@luxonis/visualizer-protobuf 2.15.0 → 2.16.1

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 (103) hide show
  1. package/dist/{FoxgloveServer-DiLI7KZU.js → FoxgloveServer-tJZcJH5-.js} +21 -35
  2. package/dist/comlink-D0blLC4P.js +344 -0
  3. package/dist/{communicator-CkB-oBVq.js → communicator-D9LSiWws.js} +1 -1
  4. package/dist/{foxglove-protocol-RZlF5fna.js → foxglove-protocol-RBwoTi12.js} +1 -1
  5. package/dist/i420ToRgbaToPoitcloud.worker-CQFm7P7B.js +48 -0
  6. package/dist/{index-BwXQcktX.js → index-B2r7A42O.js} +4 -3
  7. package/dist/{index-CU7EP-1Z.js → index-BBF7QY1k.js} +4 -3
  8. package/dist/{index-DWzj93US.js → index-BRBbEfLt.js} +4 -3
  9. package/dist/{index-XYuXuR6J.js → index-Bj3e-oMi.js} +4 -3
  10. package/dist/{index-BHvk_lXs.js → index-BjoXQ__u.js} +4 -3
  11. package/dist/{index-CvOH_4Vb.js → index-BlnWOxsk.js} +4 -3
  12. package/dist/{index-B5Y2BwAY.js → index-BvVi0uRg.js} +4 -3
  13. package/dist/{index-B_XiOSDG.js → index-BvllHttZ.js} +4 -3
  14. package/dist/{index-Dj1nE_e2.js → index-C23TCUNb.js} +5 -4
  15. package/dist/{index-B3np51f5.js → index-C2PLp2cB.js} +4 -3
  16. package/dist/{index-DqahF3Pt.js → index-C3ZYC-qt.js} +4 -3
  17. package/dist/{index-BVlhWOws.js → index-CMdpLs9w.js} +4 -3
  18. package/dist/{index-ClHNc7K7.js → index-Cr9fA6Pt.js} +18 -10
  19. package/dist/{index-D2l8qtZA.js → index-DH9dOOR3.js} +4 -3
  20. package/dist/{index-XshD358Z.js → index-DZlfOfTk.js} +180 -106
  21. package/dist/{index-u_8JsVuJ.js → index-Fxi-epuT.js} +4 -3
  22. package/dist/{index-BlTiOUx8.js → index-QKUoKEdA.js} +4 -3
  23. package/dist/{index-DVFtn83p.js → index-eGfSIJKq.js} +4 -3
  24. package/dist/{index-duY9KDhj.js → index-rGnzrljf.js} +4 -3
  25. package/dist/index.js +4 -3
  26. package/dist/lib/src/components/Panel.d.ts +2 -1
  27. package/dist/lib/src/components/Panel.d.ts.map +1 -1
  28. package/dist/lib/src/components/Panel.js +2 -2
  29. package/dist/lib/src/components/Panel.js.map +1 -1
  30. package/dist/lib/src/components/PanelToolbar.d.ts +2 -1
  31. package/dist/lib/src/components/PanelToolbar.d.ts.map +1 -1
  32. package/dist/lib/src/components/PanelToolbar.js +10 -8
  33. package/dist/lib/src/components/PanelToolbar.js.map +1 -1
  34. package/dist/lib/src/connection/foxglove-connection.d.ts +8 -4
  35. package/dist/lib/src/connection/foxglove-connection.d.ts.map +1 -1
  36. package/dist/lib/src/connection/foxglove-connection.js +28 -13
  37. package/dist/lib/src/connection/foxglove-connection.js.map +1 -1
  38. package/dist/lib/src/messaging/deserialization/pointcloud/i420ToRgbaToPoitcloud.worker.d.ts +2 -0
  39. package/dist/lib/src/messaging/deserialization/pointcloud/i420ToRgbaToPoitcloud.worker.d.ts.map +1 -0
  40. package/dist/lib/src/messaging/deserialization/pointcloud/i420ToRgbaToPoitcloud.worker.js +45 -0
  41. package/dist/lib/src/messaging/deserialization/pointcloud/i420ToRgbaToPoitcloud.worker.js.map +1 -0
  42. package/dist/lib/src/messaging/deserialization/pointcloud/utils.d.ts +1 -0
  43. package/dist/lib/src/messaging/deserialization/pointcloud/utils.d.ts.map +1 -1
  44. package/dist/lib/src/messaging/deserialization/pointcloud/utils.js +8 -0
  45. package/dist/lib/src/messaging/deserialization/pointcloud/utils.js.map +1 -1
  46. package/dist/lib/src/panels/ImagePanel.d.ts +6 -2
  47. package/dist/lib/src/panels/ImagePanel.d.ts.map +1 -1
  48. package/dist/lib/src/panels/ImagePanel.js +2 -2
  49. package/dist/lib/src/panels/ImagePanel.js.map +1 -1
  50. package/dist/lib/src/panels/PointCloudPanel.d.ts +3 -1
  51. package/dist/lib/src/panels/PointCloudPanel.d.ts.map +1 -1
  52. package/dist/lib/src/panels/PointCloudPanel.js +10 -7
  53. package/dist/lib/src/panels/PointCloudPanel.js.map +1 -1
  54. package/dist/lib/src/protobuf.generated/EncodedFrame.d.ts.map +1 -1
  55. package/dist/lib/src/protobuf.generated/EncodedFrame.js +4 -1
  56. package/dist/lib/src/protobuf.generated/EncodedFrame.js.map +1 -1
  57. package/dist/lib/src/protobuf.generated/Event.d.ts.map +1 -1
  58. package/dist/lib/src/protobuf.generated/Event.js +4 -1
  59. package/dist/lib/src/protobuf.generated/Event.js.map +1 -1
  60. package/dist/lib/src/protobuf.generated/ImageAnnotations.d.ts.map +1 -1
  61. package/dist/lib/src/protobuf.generated/ImageAnnotations.js +4 -1
  62. package/dist/lib/src/protobuf.generated/ImageAnnotations.js.map +1 -1
  63. package/dist/lib/src/protobuf.generated/ImgDetections.d.ts.map +1 -1
  64. package/dist/lib/src/protobuf.generated/ImgDetections.js +4 -1
  65. package/dist/lib/src/protobuf.generated/ImgDetections.js.map +1 -1
  66. package/dist/lib/src/protobuf.generated/ImgFrame.d.ts.map +1 -1
  67. package/dist/lib/src/protobuf.generated/ImgFrame.js +4 -1
  68. package/dist/lib/src/protobuf.generated/ImgFrame.js.map +1 -1
  69. package/dist/lib/src/protobuf.generated/PointCloudData.d.ts.map +1 -1
  70. package/dist/lib/src/protobuf.generated/PointCloudData.js +4 -1
  71. package/dist/lib/src/protobuf.generated/PointCloudData.js.map +1 -1
  72. package/dist/lib/src/protobuf.generated/SpatialImgDetections.d.ts.map +1 -1
  73. package/dist/lib/src/protobuf.generated/SpatialImgDetections.js +4 -1
  74. package/dist/lib/src/protobuf.generated/SpatialImgDetections.js.map +1 -1
  75. package/dist/lib/src/protobuf.generated/common.d.ts.map +1 -1
  76. package/dist/lib/src/protobuf.generated/common.js +4 -1
  77. package/dist/lib/src/protobuf.generated/common.js.map +1 -1
  78. package/dist/lib/src/utils/poitcloud-sync.d.ts +8 -0
  79. package/dist/lib/src/utils/poitcloud-sync.d.ts.map +1 -0
  80. package/dist/lib/src/utils/poitcloud-sync.js +48 -0
  81. package/dist/lib/src/utils/poitcloud-sync.js.map +1 -0
  82. package/dist/packages/studio-base/src/panels/ThreeDeeRender/Input.d.ts +1 -1
  83. package/dist/packages/studio-base/src/panels/ThreeDeeRender/Input.d.ts.map +1 -1
  84. package/dist/packages/studio-base/src/panels/ThreeDeeRender/Input.js +1 -1
  85. package/dist/packages/studio-base/src/panels/ThreeDeeRender/Input.js.map +1 -1
  86. package/dist/packages/studio-base/src/panels/ThreeDeeRender/Renderer.js +1 -1
  87. package/dist/packages/studio-base/src/panels/ThreeDeeRender/Renderer.js.map +1 -1
  88. package/dist/packages/studio-base/src/panels/ThreeDeeRender/ThreeDeeRender.d.ts +4 -4
  89. package/dist/packages/studio-base/src/panels/ThreeDeeRender/ThreeDeeRender.d.ts.map +1 -1
  90. package/dist/packages/studio-base/src/panels/ThreeDeeRender/ThreeDeeRender.js +1 -1
  91. package/dist/packages/studio-base/src/panels/ThreeDeeRender/ThreeDeeRender.js.map +1 -1
  92. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageMode.d.ts.map +1 -1
  93. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageMode.js +1 -0
  94. package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageMode.js.map +1 -1
  95. package/dist/packages/studio-base/src/panels/ThreeDeeRender/updatePose.d.ts.map +1 -1
  96. package/dist/packages/studio-base/src/panels/ThreeDeeRender/updatePose.js.map +1 -1
  97. package/dist/{worker-CtuCYYTr.js → worker-8hm-Dhmm.js} +3 -3
  98. package/dist/{worker-Bd7K1fGT.js → worker-vqRhkSaI.js} +2 -2
  99. package/package.json +1 -1
  100. package/dist/lib/src/protobuf.generated/IMUData.d.ts +0 -122
  101. package/dist/lib/src/protobuf.generated/IMUData.d.ts.map +0 -1
  102. package/dist/lib/src/protobuf.generated/IMUData.js +0 -691
  103. package/dist/lib/src/protobuf.generated/IMUData.js.map +0 -1
@@ -1498,11 +1498,9 @@ Long.fromBytesBE = function fromBytesBE(bytes, unsigned) {
1498
1498
  );
1499
1499
  };
1500
1500
 
1501
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
1502
- // versions:
1503
- // protoc-gen-ts_proto v1.181.1
1504
- // protoc v4.25.1
1505
- // source: common.proto
1501
+ // This Source Code Form is subject to the terms of the Mozilla Public
1502
+ // License, v2.0. If a copy of the MPL was not distributed with this
1503
+ // file, You can obtain one at http://mozilla.org/MPL/2.0/
1506
1504
 
1507
1505
  let CameraModel = /*#__PURE__*/function (CameraModel) {
1508
1506
  CameraModel[CameraModel["PERSPECTIVE"] = 0] = "PERSPECTIVE";
@@ -2196,11 +2194,9 @@ function isSet$6(value) {
2196
2194
  return value !== null && value !== undefined;
2197
2195
  }
2198
2196
 
2199
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2200
- // versions:
2201
- // protoc-gen-ts_proto v1.181.1
2202
- // protoc v4.25.1
2203
- // source: ImageAnnotations.proto
2197
+ // This Source Code Form is subject to the terms of the Mozilla Public
2198
+ // License, v2.0. If a copy of the MPL was not distributed with this
2199
+ // file, You can obtain one at http://mozilla.org/MPL/2.0/
2204
2200
 
2205
2201
  const protobufPackage$5 = "dai.proto.image_annotations";
2206
2202
  let PointsAnnotationType = /*#__PURE__*/function (PointsAnnotationType) {
@@ -2810,11 +2806,9 @@ function isSet$5(value) {
2810
2806
  }
2811
2807
  const protobufName$5 = "ImageAnnotations";
2812
2808
 
2813
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2814
- // versions:
2815
- // protoc-gen-ts_proto v1.181.1
2816
- // protoc v4.25.1
2817
- // source: ImgFrame.proto
2809
+ // This Source Code Form is subject to the terms of the Mozilla Public
2810
+ // License, v2.0. If a copy of the MPL was not distributed with this
2811
+ // file, You can obtain one at http://mozilla.org/MPL/2.0/
2818
2812
 
2819
2813
  const protobufPackage$4 = "dai.proto.img_frame";
2820
2814
  let Type = /*#__PURE__*/function (Type) {
@@ -3444,11 +3438,9 @@ function isSet$4(value) {
3444
3438
  }
3445
3439
  const protobufName$4 = "ImgFrame";
3446
3440
 
3447
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3448
- // versions:
3449
- // protoc-gen-ts_proto v1.181.1
3450
- // protoc v4.25.1
3451
- // source: EncodedFrame.proto
3441
+ // This Source Code Form is subject to the terms of the Mozilla Public
3442
+ // License, v2.0. If a copy of the MPL was not distributed with this
3443
+ // file, You can obtain one at http://mozilla.org/MPL/2.0/
3452
3444
 
3453
3445
  const protobufPackage$3 = "dai.proto.encoded_frame";
3454
3446
  let Profile = /*#__PURE__*/function (Profile) {
@@ -3851,11 +3843,9 @@ function isSet$3(value) {
3851
3843
  }
3852
3844
  const protobufName$3 = "EncodedFrame";
3853
3845
 
3854
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3855
- // versions:
3856
- // protoc-gen-ts_proto v1.181.1
3857
- // protoc v4.25.1
3858
- // source: ImgDetections.proto
3846
+ // This Source Code Form is subject to the terms of the Mozilla Public
3847
+ // License, v2.0. If a copy of the MPL was not distributed with this
3848
+ // file, You can obtain one at http://mozilla.org/MPL/2.0/
3859
3849
 
3860
3850
  const protobufPackage$2 = "dai.proto.img_detections";
3861
3851
  function createBaseImgDetections() {
@@ -4119,11 +4109,9 @@ function isSet$2(value) {
4119
4109
  }
4120
4110
  const protobufName$2 = "ImgDetections";
4121
4111
 
4122
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
4123
- // versions:
4124
- // protoc-gen-ts_proto v1.181.1
4125
- // protoc v4.25.1
4126
- // source: PointCloudData.proto
4112
+ // This Source Code Form is subject to the terms of the Mozilla Public
4113
+ // License, v2.0. If a copy of the MPL was not distributed with this
4114
+ // file, You can obtain one at http://mozilla.org/MPL/2.0/
4127
4115
 
4128
4116
  const protobufPackage$1 = "dai.proto.point_cloud_data";
4129
4117
  function createBasePointCloudData() {
@@ -4431,11 +4419,9 @@ function isSet$1(value) {
4431
4419
  }
4432
4420
  const protobufName$1 = "PointCloudData";
4433
4421
 
4434
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
4435
- // versions:
4436
- // protoc-gen-ts_proto v1.181.1
4437
- // protoc v4.25.1
4438
- // source: SpatialImgDetections.proto
4422
+ // This Source Code Form is subject to the terms of the Mozilla Public
4423
+ // License, v2.0. If a copy of the MPL was not distributed with this
4424
+ // file, You can obtain one at http://mozilla.org/MPL/2.0/
4439
4425
 
4440
4426
  const protobufPackage = "dai.proto.spatial_img_detections";
4441
4427
  let SpatialLocationCalculatorAlgorithm = /*#__PURE__*/function (SpatialLocationCalculatorAlgorithm) {
@@ -0,0 +1,344 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2019 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ const proxyMarker = Symbol("Comlink.proxy");
7
+ const createEndpoint = Symbol("Comlink.endpoint");
8
+ const releaseProxy = Symbol("Comlink.releaseProxy");
9
+ const finalizer = Symbol("Comlink.finalizer");
10
+ const throwMarker = Symbol("Comlink.thrown");
11
+ const isObject = (val) => (typeof val === "object" && val !== null) || typeof val === "function";
12
+ /**
13
+ * Internal transfer handle to handle objects marked to proxy.
14
+ */
15
+ const proxyTransferHandler = {
16
+ canHandle: (val) => isObject(val) && val[proxyMarker],
17
+ serialize(obj) {
18
+ const { port1, port2 } = new MessageChannel();
19
+ expose(obj, port1);
20
+ return [port2, [port2]];
21
+ },
22
+ deserialize(port) {
23
+ port.start();
24
+ return wrap(port);
25
+ },
26
+ };
27
+ /**
28
+ * Internal transfer handler to handle thrown exceptions.
29
+ */
30
+ const throwTransferHandler = {
31
+ canHandle: (value) => isObject(value) && throwMarker in value,
32
+ serialize({ value }) {
33
+ let serialized;
34
+ if (value instanceof Error) {
35
+ serialized = {
36
+ isError: true,
37
+ value: {
38
+ message: value.message,
39
+ name: value.name,
40
+ stack: value.stack,
41
+ },
42
+ };
43
+ }
44
+ else {
45
+ serialized = { isError: false, value };
46
+ }
47
+ return [serialized, []];
48
+ },
49
+ deserialize(serialized) {
50
+ if (serialized.isError) {
51
+ throw Object.assign(new Error(serialized.value.message), serialized.value);
52
+ }
53
+ throw serialized.value;
54
+ },
55
+ };
56
+ /**
57
+ * Allows customizing the serialization of certain values.
58
+ */
59
+ const transferHandlers = new Map([
60
+ ["proxy", proxyTransferHandler],
61
+ ["throw", throwTransferHandler],
62
+ ]);
63
+ function isAllowedOrigin(allowedOrigins, origin) {
64
+ for (const allowedOrigin of allowedOrigins) {
65
+ if (origin === allowedOrigin || allowedOrigin === "*") {
66
+ return true;
67
+ }
68
+ if (allowedOrigin instanceof RegExp && allowedOrigin.test(origin)) {
69
+ return true;
70
+ }
71
+ }
72
+ return false;
73
+ }
74
+ function expose(obj, ep = globalThis, allowedOrigins = ["*"]) {
75
+ ep.addEventListener("message", function callback(ev) {
76
+ if (!ev || !ev.data) {
77
+ return;
78
+ }
79
+ if (!isAllowedOrigin(allowedOrigins, ev.origin)) {
80
+ console.warn(`Invalid origin '${ev.origin}' for comlink proxy`);
81
+ return;
82
+ }
83
+ const { id, type, path } = Object.assign({ path: [] }, ev.data);
84
+ const argumentList = (ev.data.argumentList || []).map(fromWireValue);
85
+ let returnValue;
86
+ try {
87
+ const parent = path.slice(0, -1).reduce((obj, prop) => obj[prop], obj);
88
+ const rawValue = path.reduce((obj, prop) => obj[prop], obj);
89
+ switch (type) {
90
+ case "GET" /* MessageType.GET */:
91
+ {
92
+ returnValue = rawValue;
93
+ }
94
+ break;
95
+ case "SET" /* MessageType.SET */:
96
+ {
97
+ parent[path.slice(-1)[0]] = fromWireValue(ev.data.value);
98
+ returnValue = true;
99
+ }
100
+ break;
101
+ case "APPLY" /* MessageType.APPLY */:
102
+ {
103
+ returnValue = rawValue.apply(parent, argumentList);
104
+ }
105
+ break;
106
+ case "CONSTRUCT" /* MessageType.CONSTRUCT */:
107
+ {
108
+ const value = new rawValue(...argumentList);
109
+ returnValue = proxy(value);
110
+ }
111
+ break;
112
+ case "ENDPOINT" /* MessageType.ENDPOINT */:
113
+ {
114
+ const { port1, port2 } = new MessageChannel();
115
+ expose(obj, port2);
116
+ returnValue = transfer(port1, [port1]);
117
+ }
118
+ break;
119
+ case "RELEASE" /* MessageType.RELEASE */:
120
+ {
121
+ returnValue = undefined;
122
+ }
123
+ break;
124
+ default:
125
+ return;
126
+ }
127
+ }
128
+ catch (value) {
129
+ returnValue = { value, [throwMarker]: 0 };
130
+ }
131
+ Promise.resolve(returnValue)
132
+ .catch((value) => {
133
+ return { value, [throwMarker]: 0 };
134
+ })
135
+ .then((returnValue) => {
136
+ const [wireValue, transferables] = toWireValue(returnValue);
137
+ ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);
138
+ if (type === "RELEASE" /* MessageType.RELEASE */) {
139
+ // detach and deactive after sending release response above.
140
+ ep.removeEventListener("message", callback);
141
+ closeEndPoint(ep);
142
+ if (finalizer in obj && typeof obj[finalizer] === "function") {
143
+ obj[finalizer]();
144
+ }
145
+ }
146
+ })
147
+ .catch((error) => {
148
+ // Send Serialization Error To Caller
149
+ const [wireValue, transferables] = toWireValue({
150
+ value: new TypeError("Unserializable return value"),
151
+ [throwMarker]: 0,
152
+ });
153
+ ep.postMessage(Object.assign(Object.assign({}, wireValue), { id }), transferables);
154
+ });
155
+ });
156
+ if (ep.start) {
157
+ ep.start();
158
+ }
159
+ }
160
+ function isMessagePort(endpoint) {
161
+ return endpoint.constructor.name === "MessagePort";
162
+ }
163
+ function closeEndPoint(endpoint) {
164
+ if (isMessagePort(endpoint))
165
+ endpoint.close();
166
+ }
167
+ function wrap(ep, target) {
168
+ const pendingListeners = new Map();
169
+ ep.addEventListener("message", function handleMessage(ev) {
170
+ const { data } = ev;
171
+ if (!data || !data.id) {
172
+ return;
173
+ }
174
+ const resolver = pendingListeners.get(data.id);
175
+ if (!resolver) {
176
+ return;
177
+ }
178
+ try {
179
+ resolver(data);
180
+ }
181
+ finally {
182
+ pendingListeners.delete(data.id);
183
+ }
184
+ });
185
+ return createProxy(ep, pendingListeners, [], target);
186
+ }
187
+ function throwIfProxyReleased(isReleased) {
188
+ if (isReleased) {
189
+ throw new Error("Proxy has been released and is not useable");
190
+ }
191
+ }
192
+ function releaseEndpoint(ep) {
193
+ return requestResponseMessage(ep, new Map(), {
194
+ type: "RELEASE" /* MessageType.RELEASE */,
195
+ }).then(() => {
196
+ closeEndPoint(ep);
197
+ });
198
+ }
199
+ const proxyCounter = new WeakMap();
200
+ const proxyFinalizers = "FinalizationRegistry" in globalThis &&
201
+ new FinalizationRegistry((ep) => {
202
+ const newCount = (proxyCounter.get(ep) || 0) - 1;
203
+ proxyCounter.set(ep, newCount);
204
+ if (newCount === 0) {
205
+ releaseEndpoint(ep);
206
+ }
207
+ });
208
+ function registerProxy(proxy, ep) {
209
+ const newCount = (proxyCounter.get(ep) || 0) + 1;
210
+ proxyCounter.set(ep, newCount);
211
+ if (proxyFinalizers) {
212
+ proxyFinalizers.register(proxy, ep, proxy);
213
+ }
214
+ }
215
+ function unregisterProxy(proxy) {
216
+ if (proxyFinalizers) {
217
+ proxyFinalizers.unregister(proxy);
218
+ }
219
+ }
220
+ function createProxy(ep, pendingListeners, path = [], target = function () { }) {
221
+ let isProxyReleased = false;
222
+ const proxy = new Proxy(target, {
223
+ get(_target, prop) {
224
+ throwIfProxyReleased(isProxyReleased);
225
+ if (prop === releaseProxy) {
226
+ return () => {
227
+ unregisterProxy(proxy);
228
+ releaseEndpoint(ep);
229
+ pendingListeners.clear();
230
+ isProxyReleased = true;
231
+ };
232
+ }
233
+ if (prop === "then") {
234
+ if (path.length === 0) {
235
+ return { then: () => proxy };
236
+ }
237
+ const r = requestResponseMessage(ep, pendingListeners, {
238
+ type: "GET" /* MessageType.GET */,
239
+ path: path.map((p) => p.toString()),
240
+ }).then(fromWireValue);
241
+ return r.then.bind(r);
242
+ }
243
+ return createProxy(ep, pendingListeners, [...path, prop]);
244
+ },
245
+ set(_target, prop, rawValue) {
246
+ throwIfProxyReleased(isProxyReleased);
247
+ // FIXME: ES6 Proxy Handler `set` methods are supposed to return a
248
+ // boolean. To show good will, we return true asynchronously ¯\_(ツ)_/¯
249
+ const [value, transferables] = toWireValue(rawValue);
250
+ return requestResponseMessage(ep, pendingListeners, {
251
+ type: "SET" /* MessageType.SET */,
252
+ path: [...path, prop].map((p) => p.toString()),
253
+ value,
254
+ }, transferables).then(fromWireValue);
255
+ },
256
+ apply(_target, _thisArg, rawArgumentList) {
257
+ throwIfProxyReleased(isProxyReleased);
258
+ const last = path[path.length - 1];
259
+ if (last === createEndpoint) {
260
+ return requestResponseMessage(ep, pendingListeners, {
261
+ type: "ENDPOINT" /* MessageType.ENDPOINT */,
262
+ }).then(fromWireValue);
263
+ }
264
+ // We just pretend that `bind()` didn’t happen.
265
+ if (last === "bind") {
266
+ return createProxy(ep, pendingListeners, path.slice(0, -1));
267
+ }
268
+ const [argumentList, transferables] = processArguments(rawArgumentList);
269
+ return requestResponseMessage(ep, pendingListeners, {
270
+ type: "APPLY" /* MessageType.APPLY */,
271
+ path: path.map((p) => p.toString()),
272
+ argumentList,
273
+ }, transferables).then(fromWireValue);
274
+ },
275
+ construct(_target, rawArgumentList) {
276
+ throwIfProxyReleased(isProxyReleased);
277
+ const [argumentList, transferables] = processArguments(rawArgumentList);
278
+ return requestResponseMessage(ep, pendingListeners, {
279
+ type: "CONSTRUCT" /* MessageType.CONSTRUCT */,
280
+ path: path.map((p) => p.toString()),
281
+ argumentList,
282
+ }, transferables).then(fromWireValue);
283
+ },
284
+ });
285
+ registerProxy(proxy, ep);
286
+ return proxy;
287
+ }
288
+ function myFlat(arr) {
289
+ return Array.prototype.concat.apply([], arr);
290
+ }
291
+ function processArguments(argumentList) {
292
+ const processed = argumentList.map(toWireValue);
293
+ return [processed.map((v) => v[0]), myFlat(processed.map((v) => v[1]))];
294
+ }
295
+ const transferCache = new WeakMap();
296
+ function transfer(obj, transfers) {
297
+ transferCache.set(obj, transfers);
298
+ return obj;
299
+ }
300
+ function proxy(obj) {
301
+ return Object.assign(obj, { [proxyMarker]: true });
302
+ }
303
+ function toWireValue(value) {
304
+ for (const [name, handler] of transferHandlers) {
305
+ if (handler.canHandle(value)) {
306
+ const [serializedValue, transferables] = handler.serialize(value);
307
+ return [
308
+ {
309
+ type: "HANDLER" /* WireValueType.HANDLER */,
310
+ name,
311
+ value: serializedValue,
312
+ },
313
+ transferables,
314
+ ];
315
+ }
316
+ }
317
+ return [
318
+ {
319
+ type: "RAW" /* WireValueType.RAW */,
320
+ value,
321
+ },
322
+ transferCache.get(value) || [],
323
+ ];
324
+ }
325
+ function fromWireValue(value) {
326
+ switch (value.type) {
327
+ case "HANDLER" /* WireValueType.HANDLER */:
328
+ return transferHandlers.get(value.name).deserialize(value.value);
329
+ case "RAW" /* WireValueType.RAW */:
330
+ return value.value;
331
+ }
332
+ }
333
+ function requestResponseMessage(ep, pendingListeners, msg, transfers) {
334
+ return new Promise((resolve) => {
335
+ const id = Math.trunc(Math.random() * Number.MAX_SAFE_INTEGER).toString();
336
+ pendingListeners.set(id, resolve);
337
+ if (ep.start) {
338
+ ep.start();
339
+ }
340
+ ep.postMessage(Object.assign({ id }, msg), transfers);
341
+ });
342
+ }
343
+
344
+ export { expose as e, wrap as w };
@@ -1,4 +1,4 @@
1
- import { p as protobufsBySchema } from './FoxgloveServer-DiLI7KZU.js';
1
+ import { p as protobufsBySchema } from './FoxgloveServer-tJZcJH5-.js';
2
2
 
3
3
  // This Source Code Form is subject to the terms of the Mozilla Public
4
4
  // License, v2.0. If a copy of the MPL was not distributed with this
@@ -1,4 +1,4 @@
1
- import { C as ClientBinaryOpcode, B as BinaryOpcode } from './FoxgloveServer-DiLI7KZU.js';
1
+ import { C as ClientBinaryOpcode, B as BinaryOpcode } from './FoxgloveServer-tJZcJH5-.js';
2
2
 
3
3
  // This Source Code Form is subject to the terms of the Mozilla Public
4
4
  // License, v2.0. If a copy of the MPL was not distributed with this
@@ -0,0 +1,48 @@
1
+ import { e as expose } from './comlink-D0blLC4P.js';
2
+
3
+ // This Source Code Form is subject to the terms of the Mozilla Public
4
+ // License, v2.0. If a copy of the MPL was not distributed with this
5
+ // file, You can obtain one at http://mozilla.org/MPL/2.0/
6
+ function i420ToRgbaToPointcloud(i420Data, i420Width, i420Height, depthWidth, depthHeight, data) {
7
+ const frameSize = i420Width * i420Height;
8
+ const uOffset = frameSize;
9
+ const vOffset = frameSize + frameSize / 4;
10
+ const pointCount = data.byteLength / 16;
11
+ const buffer = new ArrayBuffer(data.byteLength);
12
+ const view = new DataView(buffer);
13
+ const dataView = new DataView(data.buffer);
14
+ for (let i = 0; i < pointCount; i++) {
15
+ const depthX = i % depthWidth;
16
+ const depthY = Math.floor(i / depthWidth);
17
+ const i420X = Math.round(depthX * (i420Width / depthWidth));
18
+ const i420Y = Math.round(depthY * (i420Height / depthHeight));
19
+ if (i420X >= i420Width || i420Y >= i420Height) {
20
+ continue;
21
+ }
22
+ const index = i420Y * i420Width + i420X;
23
+ const uvIndex = Math.floor(i420Y / 2) * (i420Width / 2) + Math.floor(i420X / 2);
24
+ const Y = i420Data[index] ?? 0;
25
+ const U = (i420Data[uOffset + uvIndex] ?? 128) - 128;
26
+ const V = (i420Data[vOffset + uvIndex] ?? 128) - 128;
27
+ let R = Y + 1.402 * V;
28
+ let G = Y - 0.344136 * U - 0.714136 * V;
29
+ let B = Y + 1.772 * U;
30
+ R = Math.min(255, Math.max(0, R));
31
+ G = Math.min(255, Math.max(0, G));
32
+ B = Math.min(255, Math.max(0, B));
33
+ const offset = i * 16;
34
+ view.setFloat32(offset, dataView.getFloat32(offset, true), true); // x
35
+ view.setFloat32(offset + 4, dataView.getFloat32(offset + 4, true), true); // y
36
+ view.setFloat32(offset + 8, dataView.getFloat32(offset + 8, true), true); // z
37
+ view.setUint8(offset + 12, R); // Red
38
+ view.setUint8(offset + 13, G); // Green
39
+ view.setUint8(offset + 14, B); // Blue
40
+ view.setUint8(offset + 15, 255); // Alpha (fully opaque)
41
+ }
42
+ return new Uint8Array(buffer);
43
+ }
44
+
45
+ // Expose the function using Comlink
46
+ expose({
47
+ i420ToRgbaToPointcloud
48
+ });
@@ -1,13 +1,14 @@
1
- import { au as ExternalTokenizer, aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, an as indentNodeProp, ao as continuedIndent, ap as foldNodeProp, aB as foldInside, at as LanguageSupport } from './index-XshD358Z.js';
2
- import './FoxgloveServer-DiLI7KZU.js';
1
+ import { au as ExternalTokenizer, aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, an as indentNodeProp, ao as continuedIndent, ap as foldNodeProp, aB as foldInside, at as LanguageSupport } from './index-DZlfOfTk.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
3
3
  import 'protobufjs/minimal';
4
4
  import 'ms';
5
+ import './comlink-D0blLC4P.js';
5
6
  import 'react';
6
7
  import 'zustand';
7
8
  import 'react-mosaic-component';
8
9
  import '@mui/material';
9
10
  import './i18next-C5Qe4-E1.js';
10
- import './foxglove-protocol-RZlF5fna.js';
11
+ import './foxglove-protocol-RBwoTi12.js';
11
12
  import 'react-dnd';
12
13
  import 'react-dnd-html5-backend';
13
14
  import '@emotion/react';
@@ -1,13 +1,14 @@
1
- import { aq as styleTags, ar as tags, aN as javascriptLanguage, as as LRLanguage, at as LanguageSupport, av as LRParser, aK as html, aL as parseMixed, au as ExternalTokenizer } from './index-XshD358Z.js';
2
- import './FoxgloveServer-DiLI7KZU.js';
1
+ import { aq as styleTags, ar as tags, aN as javascriptLanguage, as as LRLanguage, at as LanguageSupport, av as LRParser, aK as html, aL as parseMixed, au as ExternalTokenizer } from './index-DZlfOfTk.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
3
3
  import 'protobufjs/minimal';
4
4
  import 'ms';
5
+ import './comlink-D0blLC4P.js';
5
6
  import 'react';
6
7
  import 'zustand';
7
8
  import 'react-mosaic-component';
8
9
  import '@mui/material';
9
10
  import './i18next-C5Qe4-E1.js';
10
- import './foxglove-protocol-RZlF5fna.js';
11
+ import './foxglove-protocol-RBwoTi12.js';
11
12
  import 'react-dnd';
12
13
  import 'react-dnd-html5-backend';
13
14
  import '@emotion/react';
@@ -1,13 +1,14 @@
1
- import { aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, an as indentNodeProp, ao as continuedIndent, az as flatIndent, aA as delimitedIndent, ap as foldNodeProp, aB as foldInside, at as LanguageSupport } from './index-XshD358Z.js';
2
- import './FoxgloveServer-DiLI7KZU.js';
1
+ import { aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, an as indentNodeProp, ao as continuedIndent, az as flatIndent, aA as delimitedIndent, ap as foldNodeProp, aB as foldInside, at as LanguageSupport } from './index-DZlfOfTk.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
3
3
  import 'protobufjs/minimal';
4
4
  import 'ms';
5
+ import './comlink-D0blLC4P.js';
5
6
  import 'react';
6
7
  import 'zustand';
7
8
  import 'react-mosaic-component';
8
9
  import '@mui/material';
9
10
  import './i18next-C5Qe4-E1.js';
10
- import './foxglove-protocol-RZlF5fna.js';
11
+ import './foxglove-protocol-RBwoTi12.js';
11
12
  import 'react-dnd';
12
13
  import 'react-dnd-html5-backend';
13
14
  import '@emotion/react';
@@ -1,13 +1,14 @@
1
- import { an as indentNodeProp, ao as continuedIndent, ap as foldNodeProp, aq as styleTags, ar as tags, as as LRLanguage, at as LanguageSupport, au as ExternalTokenizer, av as LRParser, aw as ifNotIn, ax as completeFromList, ay as syntaxTree } from './index-XshD358Z.js';
2
- import './FoxgloveServer-DiLI7KZU.js';
1
+ import { an as indentNodeProp, ao as continuedIndent, ap as foldNodeProp, aq as styleTags, ar as tags, as as LRLanguage, at as LanguageSupport, au as ExternalTokenizer, av as LRParser, aw as ifNotIn, ax as completeFromList, ay as syntaxTree } from './index-DZlfOfTk.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
3
3
  import 'protobufjs/minimal';
4
4
  import 'ms';
5
+ import './comlink-D0blLC4P.js';
5
6
  import 'react';
6
7
  import 'zustand';
7
8
  import 'react-mosaic-component';
8
9
  import '@mui/material';
9
10
  import './i18next-C5Qe4-E1.js';
10
- import './foxglove-protocol-RZlF5fna.js';
11
+ import './foxglove-protocol-RBwoTi12.js';
11
12
  import 'react-dnd';
12
13
  import 'react-dnd-html5-backend';
13
14
  import '@emotion/react';
@@ -1,13 +1,14 @@
1
- import { aC as ContextTracker, au as ExternalTokenizer, aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, an as indentNodeProp, aA as delimitedIndent, ap as foldNodeProp, aB as foldInside, at as LanguageSupport, aL as parseMixed } from './index-XshD358Z.js';
2
- import './FoxgloveServer-DiLI7KZU.js';
1
+ import { aC as ContextTracker, au as ExternalTokenizer, aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, an as indentNodeProp, aA as delimitedIndent, ap as foldNodeProp, aB as foldInside, at as LanguageSupport, aL as parseMixed } from './index-DZlfOfTk.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
3
3
  import 'protobufjs/minimal';
4
4
  import 'ms';
5
+ import './comlink-D0blLC4P.js';
5
6
  import 'react';
6
7
  import 'zustand';
7
8
  import 'react-mosaic-component';
8
9
  import '@mui/material';
9
10
  import './i18next-C5Qe4-E1.js';
10
- import './foxglove-protocol-RZlF5fna.js';
11
+ import './foxglove-protocol-RBwoTi12.js';
11
12
  import 'react-dnd';
12
13
  import 'react-dnd-html5-backend';
13
14
  import '@emotion/react';
@@ -1,13 +1,14 @@
1
- import { aq as styleTags, ar as tags, as as LRLanguage, at as LanguageSupport, av as LRParser, aD as LocalTokenGroup, aK as html, aL as parseMixed, aN as javascriptLanguage } from './index-XshD358Z.js';
2
- import './FoxgloveServer-DiLI7KZU.js';
1
+ import { aq as styleTags, ar as tags, as as LRLanguage, at as LanguageSupport, av as LRParser, aD as LocalTokenGroup, aK as html, aL as parseMixed, aN as javascriptLanguage } from './index-DZlfOfTk.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
3
3
  import 'protobufjs/minimal';
4
4
  import 'ms';
5
+ import './comlink-D0blLC4P.js';
5
6
  import 'react';
6
7
  import 'zustand';
7
8
  import 'react-mosaic-component';
8
9
  import '@mui/material';
9
10
  import './i18next-C5Qe4-E1.js';
10
- import './foxglove-protocol-RZlF5fna.js';
11
+ import './foxglove-protocol-RBwoTi12.js';
11
12
  import 'react-dnd';
12
13
  import 'react-dnd-html5-backend';
13
14
  import '@emotion/react';
@@ -1,13 +1,14 @@
1
- import { au as ExternalTokenizer, aC as ContextTracker, aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, ap as foldNodeProp, aB as foldInside, an as indentNodeProp, ao as continuedIndent, aH as defineCSSCompletionSource, at as LanguageSupport } from './index-XshD358Z.js';
2
- import './FoxgloveServer-DiLI7KZU.js';
1
+ import { au as ExternalTokenizer, aC as ContextTracker, aq as styleTags, ar as tags, av as LRParser, as as LRLanguage, ap as foldNodeProp, aB as foldInside, an as indentNodeProp, ao as continuedIndent, aH as defineCSSCompletionSource, at as LanguageSupport } from './index-DZlfOfTk.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
3
3
  import 'protobufjs/minimal';
4
4
  import 'ms';
5
+ import './comlink-D0blLC4P.js';
5
6
  import 'react';
6
7
  import 'zustand';
7
8
  import 'react-mosaic-component';
8
9
  import '@mui/material';
9
10
  import './i18next-C5Qe4-E1.js';
10
- import './foxglove-protocol-RZlF5fna.js';
11
+ import './foxglove-protocol-RBwoTi12.js';
11
12
  import 'react-dnd';
12
13
  import 'react-dnd-html5-backend';
13
14
  import '@emotion/react';
@@ -1,13 +1,14 @@
1
- import { as as LRLanguage, an as indentNodeProp, aA as delimitedIndent, ap as foldNodeProp, aB as foldInside, aq as styleTags, ar as tags, at as LanguageSupport, av as LRParser } from './index-XshD358Z.js';
2
- import './FoxgloveServer-DiLI7KZU.js';
1
+ import { as as LRLanguage, an as indentNodeProp, aA as delimitedIndent, ap as foldNodeProp, aB as foldInside, aq as styleTags, ar as tags, at as LanguageSupport, av as LRParser } from './index-DZlfOfTk.js';
2
+ import './FoxgloveServer-tJZcJH5-.js';
3
3
  import 'protobufjs/minimal';
4
4
  import 'ms';
5
+ import './comlink-D0blLC4P.js';
5
6
  import 'react';
6
7
  import 'zustand';
7
8
  import 'react-mosaic-component';
8
9
  import '@mui/material';
9
10
  import './i18next-C5Qe4-E1.js';
10
- import './foxglove-protocol-RZlF5fna.js';
11
+ import './foxglove-protocol-RBwoTi12.js';
11
12
  import 'react-dnd';
12
13
  import 'react-dnd-html5-backend';
13
14
  import '@emotion/react';