@luxonis/visualizer-protobuf 2.16.2 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FoxgloveServer-C39Uooyk.js +1172 -0
- package/dist/{WorkerImageDecoder.worker-DCoSYoLL.js → WorkerImageDecoder.worker-tkX9-IYo.js} +3 -2
- package/dist/_commonjsHelpers-E-ZsRS8r.js +32 -0
- package/dist/{comlink-D0blLC4P.js → comlink-DHMAu6X7.js} +1 -1
- package/dist/{communicator-CkB-oBVq.js → communicator-D49kmBTQ.js} +1 -1
- package/dist/{decodeImage-NYPkamnK.js → decodeImage-C8kB6T3V.js} +1 -1
- package/dist/deserialization.worker-DsG76nP8.js +1326 -0
- package/dist/{foxglove-protocol-RZlF5fna.js → foxglove-protocol-CYoMweAY.js} +1 -1
- package/dist/{i18next-C5Qe4-E1.js → i18next-IYI3-Nuv.js} +1624 -3124
- package/dist/{i420ToRgbaToPoitcloud.worker-CQFm7P7B.js → i420ToRgbaToPoitcloud.worker-CzFC0VI1.js} +1 -1
- package/dist/{index-_CotNV5x.js → index-4PQpGzhb.js} +10 -8
- package/dist/{index-C8kEVNt8.js → index-BFMXTxLw.js} +10 -8
- package/dist/{index-D7BaFI3k.js → index-BQecGu9I.js} +10 -8
- package/dist/{index-BFmZhB_k.js → index-BT9CBn7l.js} +2663 -2658
- package/dist/{index-CGZy-t2h.js → index-BWittpbR.js} +10 -8
- package/dist/{index-BRyhvg1u.js → index-BeQ1w8aW.js} +10 -8
- package/dist/{index-B-NuHgKz.js → index-BomoqOv5.js} +10 -8
- package/dist/{index-qRQvVkdj.js → index-ByIsztCr.js} +10 -8
- package/dist/{index-C7bn4vhH.js → index-CJRhjhJ0.js} +10 -8
- package/dist/{index-De_-85Dx.js → index-CR6XGTJc.js} +26206 -31958
- package/dist/{index-BflsEH7y.js → index-CXIVXFcJ.js} +13 -10
- package/dist/{index-DeqZpaJF.js → index-CXThSQcL.js} +10 -8
- package/dist/{index-BA7oWwVg.js → index-CcIi7pJR.js} +10 -8
- package/dist/{index-BDNOxLbq.js → index-CcP1Qppv.js} +10 -8
- package/dist/{index-BsSLQ0Qh.js → index-Ci0X5xT3.js} +10 -8
- package/dist/{index-D_n427cy.js → index-CrtBH66u.js} +10 -8
- package/dist/{index--q0v8_7h.js → index-DUUnuN10.js} +10 -8
- package/dist/{index-C3EAt3Mi.js → index-DchGURxJ.js} +10 -8
- package/dist/{index-Cls5O6Ds.js → index-DdKOhCXT.js} +10 -8
- package/dist/index.js +10 -8
- package/dist/isArrayLikeObject-Bytw9p-q.js +1503 -0
- package/dist/lib/src/components/Panel.d.ts +1 -0
- package/dist/lib/src/components/Panel.d.ts.map +1 -1
- package/dist/lib/src/components/Panel.js +2 -2
- package/dist/lib/src/components/Panel.js.map +1 -1
- package/dist/lib/src/components/PanelToolbar.d.ts +1 -0
- package/dist/lib/src/components/PanelToolbar.d.ts.map +1 -1
- package/dist/lib/src/components/PanelToolbar.js +6 -3
- package/dist/lib/src/components/PanelToolbar.js.map +1 -1
- package/dist/lib/src/components/measure-render-delay.d.ts.map +1 -1
- package/dist/lib/src/components/measure-render-delay.js +5 -0
- package/dist/lib/src/components/measure-render-delay.js.map +1 -1
- package/dist/lib/src/messaging/{deserialization.d.ts → deserialization.worker.d.ts} +6 -2
- package/dist/lib/src/messaging/deserialization.worker.d.ts.map +1 -0
- package/dist/lib/src/messaging/{deserialization.js → deserialization.worker.js} +28 -3
- package/dist/lib/src/messaging/deserialization.worker.js.map +1 -0
- package/dist/lib/src/messaging/message-handler.d.ts.map +1 -1
- package/dist/lib/src/messaging/message-handler.js +14 -20
- package/dist/lib/src/messaging/message-handler.js.map +1 -1
- package/dist/lib/src/panels/ImagePanel.d.ts +3 -5
- package/dist/lib/src/panels/ImagePanel.d.ts.map +1 -1
- package/dist/lib/src/panels/ImagePanel.js +1 -0
- package/dist/lib/src/panels/ImagePanel.js.map +1 -1
- package/dist/lib/src/panels/PointCloudPanel.d.ts +2 -0
- package/dist/lib/src/panels/PointCloudPanel.d.ts.map +1 -1
- package/dist/lib/src/panels/PointCloudPanel.js +29 -4
- package/dist/lib/src/panels/PointCloudPanel.js.map +1 -1
- package/dist/lib/src/utils/poitcloud-sync.d.ts.map +1 -1
- package/dist/lib/src/utils/poitcloud-sync.js +5 -2
- package/dist/lib/src/utils/poitcloud-sync.js.map +1 -1
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/ThreeDeeRender.d.ts.map +1 -1
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/ThreeDeeRender.js +3 -0
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/ThreeDeeRender.js.map +1 -1
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/CameraStateSettings.js +2 -2
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/CameraStateSettings.js.map +1 -1
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageMode.d.ts.map +1 -1
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageMode.js +0 -1
- package/dist/packages/studio-base/src/panels/ThreeDeeRender/renderables/ImageMode/ImageMode.js.map +1 -1
- package/dist/{FoxgloveServer-DiLI7KZU.js → protobuf-Cr0sn6Ua.js} +996 -2196
- package/dist/tslib.es6-D98N6tjc.js +4116 -0
- package/dist/useMessageReducer-Cg30zaG9.js +422 -0
- package/dist/{worker-CtuCYYTr.js → worker-B5OJw-Fq.js} +5 -3
- package/dist/{worker-Bd7K1fGT.js → worker-aVL4LGa3.js} +5 -3
- package/package.json +1 -1
- package/dist/lib/src/messaging/deserialization.d.ts.map +0 -1
- package/dist/lib/src/messaging/deserialization.js.map +0 -1
|
@@ -1,36 +1,4 @@
|
|
|
1
1
|
import _m0 from 'protobufjs/minimal';
|
|
2
|
-
import require$$0 from 'ms';
|
|
3
|
-
|
|
4
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
5
|
-
|
|
6
|
-
function getDefaultExportFromCjs (x) {
|
|
7
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function getAugmentedNamespace(n) {
|
|
11
|
-
if (n.__esModule) return n;
|
|
12
|
-
var f = n.default;
|
|
13
|
-
if (typeof f == "function") {
|
|
14
|
-
var a = function a () {
|
|
15
|
-
if (this instanceof a) {
|
|
16
|
-
return Reflect.construct(f, arguments, this.constructor);
|
|
17
|
-
}
|
|
18
|
-
return f.apply(this, arguments);
|
|
19
|
-
};
|
|
20
|
-
a.prototype = f.prototype;
|
|
21
|
-
} else a = {};
|
|
22
|
-
Object.defineProperty(a, '__esModule', {value: true});
|
|
23
|
-
Object.keys(n).forEach(function (k) {
|
|
24
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
25
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return n[k];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
return a;
|
|
33
|
-
}
|
|
34
2
|
|
|
35
3
|
/**
|
|
36
4
|
* @license
|
|
@@ -2200,112 +2168,263 @@ function isSet$6(value) {
|
|
|
2200
2168
|
// versions:
|
|
2201
2169
|
// protoc-gen-ts_proto v1.181.1
|
|
2202
2170
|
// protoc v4.25.1
|
|
2203
|
-
// source:
|
|
2171
|
+
// source: EncodedFrame.proto
|
|
2204
2172
|
|
|
2205
|
-
const protobufPackage$5 = "dai.proto.
|
|
2206
|
-
let
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
PointsAnnotationType[PointsAnnotationType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
2213
|
-
return PointsAnnotationType;
|
|
2173
|
+
const protobufPackage$5 = "dai.proto.encoded_frame";
|
|
2174
|
+
let Profile = /*#__PURE__*/function (Profile) {
|
|
2175
|
+
Profile[Profile["JPEG"] = 0] = "JPEG";
|
|
2176
|
+
Profile[Profile["AVC"] = 1] = "AVC";
|
|
2177
|
+
Profile[Profile["HEVC"] = 2] = "HEVC";
|
|
2178
|
+
Profile[Profile["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
2179
|
+
return Profile;
|
|
2214
2180
|
}({});
|
|
2215
|
-
function
|
|
2181
|
+
function profileFromJSON(object) {
|
|
2216
2182
|
switch (object) {
|
|
2217
2183
|
case 0:
|
|
2218
|
-
case "
|
|
2219
|
-
return
|
|
2184
|
+
case "JPEG":
|
|
2185
|
+
return Profile.JPEG;
|
|
2220
2186
|
case 1:
|
|
2221
|
-
case "
|
|
2222
|
-
return
|
|
2187
|
+
case "AVC":
|
|
2188
|
+
return Profile.AVC;
|
|
2223
2189
|
case 2:
|
|
2224
|
-
case "
|
|
2225
|
-
return
|
|
2190
|
+
case "HEVC":
|
|
2191
|
+
return Profile.HEVC;
|
|
2192
|
+
case -1:
|
|
2193
|
+
case "UNRECOGNIZED":
|
|
2194
|
+
default:
|
|
2195
|
+
return Profile.UNRECOGNIZED;
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
function profileToJSON(object) {
|
|
2199
|
+
switch (object) {
|
|
2200
|
+
case Profile.JPEG:
|
|
2201
|
+
return "JPEG";
|
|
2202
|
+
case Profile.AVC:
|
|
2203
|
+
return "AVC";
|
|
2204
|
+
case Profile.HEVC:
|
|
2205
|
+
return "HEVC";
|
|
2206
|
+
case Profile.UNRECOGNIZED:
|
|
2207
|
+
default:
|
|
2208
|
+
return "UNRECOGNIZED";
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
let FrameType = /*#__PURE__*/function (FrameType) {
|
|
2212
|
+
FrameType[FrameType["I"] = 0] = "I";
|
|
2213
|
+
FrameType[FrameType["P"] = 1] = "P";
|
|
2214
|
+
FrameType[FrameType["B"] = 2] = "B";
|
|
2215
|
+
FrameType[FrameType["UNKNOWN"] = 3] = "UNKNOWN";
|
|
2216
|
+
FrameType[FrameType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
2217
|
+
return FrameType;
|
|
2218
|
+
}({});
|
|
2219
|
+
function frameTypeFromJSON(object) {
|
|
2220
|
+
switch (object) {
|
|
2221
|
+
case 0:
|
|
2222
|
+
case "I":
|
|
2223
|
+
return FrameType.I;
|
|
2224
|
+
case 1:
|
|
2225
|
+
case "P":
|
|
2226
|
+
return FrameType.P;
|
|
2227
|
+
case 2:
|
|
2228
|
+
case "B":
|
|
2229
|
+
return FrameType.B;
|
|
2226
2230
|
case 3:
|
|
2227
|
-
case "
|
|
2228
|
-
return
|
|
2229
|
-
case 4:
|
|
2230
|
-
case "LINE_LIST":
|
|
2231
|
-
return PointsAnnotationType.LINE_LIST;
|
|
2231
|
+
case "UNKNOWN":
|
|
2232
|
+
return FrameType.UNKNOWN;
|
|
2232
2233
|
case -1:
|
|
2233
2234
|
case "UNRECOGNIZED":
|
|
2234
2235
|
default:
|
|
2235
|
-
return
|
|
2236
|
+
return FrameType.UNRECOGNIZED;
|
|
2236
2237
|
}
|
|
2237
2238
|
}
|
|
2238
|
-
function
|
|
2239
|
+
function frameTypeToJSON(object) {
|
|
2239
2240
|
switch (object) {
|
|
2240
|
-
case
|
|
2241
|
+
case FrameType.I:
|
|
2242
|
+
return "I";
|
|
2243
|
+
case FrameType.P:
|
|
2244
|
+
return "P";
|
|
2245
|
+
case FrameType.B:
|
|
2246
|
+
return "B";
|
|
2247
|
+
case FrameType.UNKNOWN:
|
|
2241
2248
|
return "UNKNOWN";
|
|
2242
|
-
case
|
|
2243
|
-
return "POINTS";
|
|
2244
|
-
case PointsAnnotationType.LINE_LOOP:
|
|
2245
|
-
return "LINE_LOOP";
|
|
2246
|
-
case PointsAnnotationType.LINE_STRIP:
|
|
2247
|
-
return "LINE_STRIP";
|
|
2248
|
-
case PointsAnnotationType.LINE_LIST:
|
|
2249
|
-
return "LINE_LIST";
|
|
2250
|
-
case PointsAnnotationType.UNRECOGNIZED:
|
|
2249
|
+
case FrameType.UNRECOGNIZED:
|
|
2251
2250
|
default:
|
|
2252
2251
|
return "UNRECOGNIZED";
|
|
2253
2252
|
}
|
|
2254
2253
|
}
|
|
2255
|
-
function
|
|
2254
|
+
function createBaseEncodedFrame() {
|
|
2256
2255
|
return {
|
|
2256
|
+
cam: undefined,
|
|
2257
|
+
instanceNum: 0,
|
|
2258
|
+
width: 0,
|
|
2259
|
+
height: 0,
|
|
2260
|
+
quality: 0,
|
|
2261
|
+
bitrate: 0,
|
|
2262
|
+
profile: 0,
|
|
2263
|
+
lossless: false,
|
|
2264
|
+
type: 0,
|
|
2265
|
+
frameOffset: 0,
|
|
2266
|
+
frameSize: 0,
|
|
2257
2267
|
sequenceNum: 0,
|
|
2258
2268
|
ts: undefined,
|
|
2259
2269
|
tsDevice: undefined,
|
|
2260
|
-
|
|
2270
|
+
transformation: undefined,
|
|
2271
|
+
data: new Uint8Array(0)
|
|
2261
2272
|
};
|
|
2262
2273
|
}
|
|
2263
|
-
const
|
|
2274
|
+
const EncodedFrame = {
|
|
2264
2275
|
encode(message, writer = _m0.Writer.create()) {
|
|
2276
|
+
if (message.cam !== undefined) {
|
|
2277
|
+
CameraSettings.encode(message.cam, writer.uint32(10).fork()).ldelim();
|
|
2278
|
+
}
|
|
2279
|
+
if (message.instanceNum !== 0) {
|
|
2280
|
+
writer.uint32(16).uint32(message.instanceNum);
|
|
2281
|
+
}
|
|
2282
|
+
if (message.width !== 0) {
|
|
2283
|
+
writer.uint32(24).uint32(message.width);
|
|
2284
|
+
}
|
|
2285
|
+
if (message.height !== 0) {
|
|
2286
|
+
writer.uint32(32).uint32(message.height);
|
|
2287
|
+
}
|
|
2288
|
+
if (message.quality !== 0) {
|
|
2289
|
+
writer.uint32(40).uint32(message.quality);
|
|
2290
|
+
}
|
|
2291
|
+
if (message.bitrate !== 0) {
|
|
2292
|
+
writer.uint32(48).uint32(message.bitrate);
|
|
2293
|
+
}
|
|
2294
|
+
if (message.profile !== 0) {
|
|
2295
|
+
writer.uint32(56).int32(message.profile);
|
|
2296
|
+
}
|
|
2297
|
+
if (message.lossless !== false) {
|
|
2298
|
+
writer.uint32(64).bool(message.lossless);
|
|
2299
|
+
}
|
|
2300
|
+
if (message.type !== 0) {
|
|
2301
|
+
writer.uint32(72).int32(message.type);
|
|
2302
|
+
}
|
|
2303
|
+
if (message.frameOffset !== 0) {
|
|
2304
|
+
writer.uint32(80).uint32(message.frameOffset);
|
|
2305
|
+
}
|
|
2306
|
+
if (message.frameSize !== 0) {
|
|
2307
|
+
writer.uint32(88).uint32(message.frameSize);
|
|
2308
|
+
}
|
|
2265
2309
|
if (message.sequenceNum !== 0) {
|
|
2266
|
-
writer.uint32(
|
|
2310
|
+
writer.uint32(96).int64(message.sequenceNum);
|
|
2267
2311
|
}
|
|
2268
2312
|
if (message.ts !== undefined) {
|
|
2269
|
-
Timestamp.encode(message.ts, writer.uint32(
|
|
2313
|
+
Timestamp.encode(message.ts, writer.uint32(106).fork()).ldelim();
|
|
2270
2314
|
}
|
|
2271
2315
|
if (message.tsDevice !== undefined) {
|
|
2272
|
-
Timestamp.encode(message.tsDevice, writer.uint32(
|
|
2316
|
+
Timestamp.encode(message.tsDevice, writer.uint32(114).fork()).ldelim();
|
|
2273
2317
|
}
|
|
2274
|
-
|
|
2275
|
-
|
|
2318
|
+
if (message.transformation !== undefined) {
|
|
2319
|
+
ImgTransformation.encode(message.transformation, writer.uint32(122).fork()).ldelim();
|
|
2320
|
+
}
|
|
2321
|
+
if (message.data.length !== 0) {
|
|
2322
|
+
writer.uint32(130).bytes(message.data);
|
|
2276
2323
|
}
|
|
2277
2324
|
return writer;
|
|
2278
2325
|
},
|
|
2279
2326
|
decode(input, length) {
|
|
2280
2327
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2281
2328
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2282
|
-
const message =
|
|
2329
|
+
const message = createBaseEncodedFrame();
|
|
2283
2330
|
while (reader.pos < end) {
|
|
2284
2331
|
const tag = reader.uint32();
|
|
2285
2332
|
switch (tag >>> 3) {
|
|
2286
2333
|
case 1:
|
|
2287
|
-
if (tag !==
|
|
2334
|
+
if (tag !== 10) {
|
|
2288
2335
|
break;
|
|
2289
2336
|
}
|
|
2290
|
-
message.
|
|
2337
|
+
message.cam = CameraSettings.decode(reader, reader.uint32());
|
|
2291
2338
|
continue;
|
|
2292
2339
|
case 2:
|
|
2293
|
-
if (tag !==
|
|
2340
|
+
if (tag !== 16) {
|
|
2294
2341
|
break;
|
|
2295
2342
|
}
|
|
2296
|
-
message.
|
|
2343
|
+
message.instanceNum = reader.uint32();
|
|
2297
2344
|
continue;
|
|
2298
2345
|
case 3:
|
|
2299
|
-
if (tag !==
|
|
2346
|
+
if (tag !== 24) {
|
|
2300
2347
|
break;
|
|
2301
2348
|
}
|
|
2302
|
-
message.
|
|
2349
|
+
message.width = reader.uint32();
|
|
2303
2350
|
continue;
|
|
2304
2351
|
case 4:
|
|
2305
|
-
if (tag !==
|
|
2352
|
+
if (tag !== 32) {
|
|
2306
2353
|
break;
|
|
2307
2354
|
}
|
|
2308
|
-
message.
|
|
2355
|
+
message.height = reader.uint32();
|
|
2356
|
+
continue;
|
|
2357
|
+
case 5:
|
|
2358
|
+
if (tag !== 40) {
|
|
2359
|
+
break;
|
|
2360
|
+
}
|
|
2361
|
+
message.quality = reader.uint32();
|
|
2362
|
+
continue;
|
|
2363
|
+
case 6:
|
|
2364
|
+
if (tag !== 48) {
|
|
2365
|
+
break;
|
|
2366
|
+
}
|
|
2367
|
+
message.bitrate = reader.uint32();
|
|
2368
|
+
continue;
|
|
2369
|
+
case 7:
|
|
2370
|
+
if (tag !== 56) {
|
|
2371
|
+
break;
|
|
2372
|
+
}
|
|
2373
|
+
message.profile = reader.int32();
|
|
2374
|
+
continue;
|
|
2375
|
+
case 8:
|
|
2376
|
+
if (tag !== 64) {
|
|
2377
|
+
break;
|
|
2378
|
+
}
|
|
2379
|
+
message.lossless = reader.bool();
|
|
2380
|
+
continue;
|
|
2381
|
+
case 9:
|
|
2382
|
+
if (tag !== 72) {
|
|
2383
|
+
break;
|
|
2384
|
+
}
|
|
2385
|
+
message.type = reader.int32();
|
|
2386
|
+
continue;
|
|
2387
|
+
case 10:
|
|
2388
|
+
if (tag !== 80) {
|
|
2389
|
+
break;
|
|
2390
|
+
}
|
|
2391
|
+
message.frameOffset = reader.uint32();
|
|
2392
|
+
continue;
|
|
2393
|
+
case 11:
|
|
2394
|
+
if (tag !== 88) {
|
|
2395
|
+
break;
|
|
2396
|
+
}
|
|
2397
|
+
message.frameSize = reader.uint32();
|
|
2398
|
+
continue;
|
|
2399
|
+
case 12:
|
|
2400
|
+
if (tag !== 96) {
|
|
2401
|
+
break;
|
|
2402
|
+
}
|
|
2403
|
+
message.sequenceNum = longToNumber$5(reader.int64());
|
|
2404
|
+
continue;
|
|
2405
|
+
case 13:
|
|
2406
|
+
if (tag !== 106) {
|
|
2407
|
+
break;
|
|
2408
|
+
}
|
|
2409
|
+
message.ts = Timestamp.decode(reader, reader.uint32());
|
|
2410
|
+
continue;
|
|
2411
|
+
case 14:
|
|
2412
|
+
if (tag !== 114) {
|
|
2413
|
+
break;
|
|
2414
|
+
}
|
|
2415
|
+
message.tsDevice = Timestamp.decode(reader, reader.uint32());
|
|
2416
|
+
continue;
|
|
2417
|
+
case 15:
|
|
2418
|
+
if (tag !== 122) {
|
|
2419
|
+
break;
|
|
2420
|
+
}
|
|
2421
|
+
message.transformation = ImgTransformation.decode(reader, reader.uint32());
|
|
2422
|
+
continue;
|
|
2423
|
+
case 16:
|
|
2424
|
+
if (tag !== 130) {
|
|
2425
|
+
break;
|
|
2426
|
+
}
|
|
2427
|
+
message.data = reader.bytes();
|
|
2309
2428
|
continue;
|
|
2310
2429
|
}
|
|
2311
2430
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -2317,9 +2436,265 @@ const ImageAnnotations = {
|
|
|
2317
2436
|
},
|
|
2318
2437
|
fromJSON(object) {
|
|
2319
2438
|
return {
|
|
2439
|
+
cam: isSet$5(object.cam) ? CameraSettings.fromJSON(object.cam) : undefined,
|
|
2440
|
+
instanceNum: isSet$5(object.instanceNum) ? globalThis.Number(object.instanceNum) : 0,
|
|
2441
|
+
width: isSet$5(object.width) ? globalThis.Number(object.width) : 0,
|
|
2442
|
+
height: isSet$5(object.height) ? globalThis.Number(object.height) : 0,
|
|
2443
|
+
quality: isSet$5(object.quality) ? globalThis.Number(object.quality) : 0,
|
|
2444
|
+
bitrate: isSet$5(object.bitrate) ? globalThis.Number(object.bitrate) : 0,
|
|
2445
|
+
profile: isSet$5(object.profile) ? profileFromJSON(object.profile) : 0,
|
|
2446
|
+
lossless: isSet$5(object.lossless) ? globalThis.Boolean(object.lossless) : false,
|
|
2447
|
+
type: isSet$5(object.type) ? frameTypeFromJSON(object.type) : 0,
|
|
2448
|
+
frameOffset: isSet$5(object.frameOffset) ? globalThis.Number(object.frameOffset) : 0,
|
|
2449
|
+
frameSize: isSet$5(object.frameSize) ? globalThis.Number(object.frameSize) : 0,
|
|
2320
2450
|
sequenceNum: isSet$5(object.sequenceNum) ? globalThis.Number(object.sequenceNum) : 0,
|
|
2321
2451
|
ts: isSet$5(object.ts) ? Timestamp.fromJSON(object.ts) : undefined,
|
|
2322
2452
|
tsDevice: isSet$5(object.tsDevice) ? Timestamp.fromJSON(object.tsDevice) : undefined,
|
|
2453
|
+
transformation: isSet$5(object.transformation) ? ImgTransformation.fromJSON(object.transformation) : undefined,
|
|
2454
|
+
data: isSet$5(object.data) ? bytesFromBase64$2(object.data) : new Uint8Array(0)
|
|
2455
|
+
};
|
|
2456
|
+
},
|
|
2457
|
+
toJSON(message) {
|
|
2458
|
+
const obj = {};
|
|
2459
|
+
if (message.cam !== undefined) {
|
|
2460
|
+
obj.cam = CameraSettings.toJSON(message.cam);
|
|
2461
|
+
}
|
|
2462
|
+
if (message.instanceNum !== 0) {
|
|
2463
|
+
obj.instanceNum = Math.round(message.instanceNum);
|
|
2464
|
+
}
|
|
2465
|
+
if (message.width !== 0) {
|
|
2466
|
+
obj.width = Math.round(message.width);
|
|
2467
|
+
}
|
|
2468
|
+
if (message.height !== 0) {
|
|
2469
|
+
obj.height = Math.round(message.height);
|
|
2470
|
+
}
|
|
2471
|
+
if (message.quality !== 0) {
|
|
2472
|
+
obj.quality = Math.round(message.quality);
|
|
2473
|
+
}
|
|
2474
|
+
if (message.bitrate !== 0) {
|
|
2475
|
+
obj.bitrate = Math.round(message.bitrate);
|
|
2476
|
+
}
|
|
2477
|
+
if (message.profile !== 0) {
|
|
2478
|
+
obj.profile = profileToJSON(message.profile);
|
|
2479
|
+
}
|
|
2480
|
+
if (message.lossless !== false) {
|
|
2481
|
+
obj.lossless = message.lossless;
|
|
2482
|
+
}
|
|
2483
|
+
if (message.type !== 0) {
|
|
2484
|
+
obj.type = frameTypeToJSON(message.type);
|
|
2485
|
+
}
|
|
2486
|
+
if (message.frameOffset !== 0) {
|
|
2487
|
+
obj.frameOffset = Math.round(message.frameOffset);
|
|
2488
|
+
}
|
|
2489
|
+
if (message.frameSize !== 0) {
|
|
2490
|
+
obj.frameSize = Math.round(message.frameSize);
|
|
2491
|
+
}
|
|
2492
|
+
if (message.sequenceNum !== 0) {
|
|
2493
|
+
obj.sequenceNum = Math.round(message.sequenceNum);
|
|
2494
|
+
}
|
|
2495
|
+
if (message.ts !== undefined) {
|
|
2496
|
+
obj.ts = Timestamp.toJSON(message.ts);
|
|
2497
|
+
}
|
|
2498
|
+
if (message.tsDevice !== undefined) {
|
|
2499
|
+
obj.tsDevice = Timestamp.toJSON(message.tsDevice);
|
|
2500
|
+
}
|
|
2501
|
+
if (message.transformation !== undefined) {
|
|
2502
|
+
obj.transformation = ImgTransformation.toJSON(message.transformation);
|
|
2503
|
+
}
|
|
2504
|
+
if (message.data.length !== 0) {
|
|
2505
|
+
obj.data = base64FromBytes$2(message.data);
|
|
2506
|
+
}
|
|
2507
|
+
return obj;
|
|
2508
|
+
},
|
|
2509
|
+
create(base) {
|
|
2510
|
+
return EncodedFrame.fromPartial(base ?? {});
|
|
2511
|
+
},
|
|
2512
|
+
fromPartial(object) {
|
|
2513
|
+
const message = createBaseEncodedFrame();
|
|
2514
|
+
message.cam = object.cam !== undefined && object.cam !== null ? CameraSettings.fromPartial(object.cam) : undefined;
|
|
2515
|
+
message.instanceNum = object.instanceNum ?? 0;
|
|
2516
|
+
message.width = object.width ?? 0;
|
|
2517
|
+
message.height = object.height ?? 0;
|
|
2518
|
+
message.quality = object.quality ?? 0;
|
|
2519
|
+
message.bitrate = object.bitrate ?? 0;
|
|
2520
|
+
message.profile = object.profile ?? 0;
|
|
2521
|
+
message.lossless = object.lossless ?? false;
|
|
2522
|
+
message.type = object.type ?? 0;
|
|
2523
|
+
message.frameOffset = object.frameOffset ?? 0;
|
|
2524
|
+
message.frameSize = object.frameSize ?? 0;
|
|
2525
|
+
message.sequenceNum = object.sequenceNum ?? 0;
|
|
2526
|
+
message.ts = object.ts !== undefined && object.ts !== null ? Timestamp.fromPartial(object.ts) : undefined;
|
|
2527
|
+
message.tsDevice = object.tsDevice !== undefined && object.tsDevice !== null ? Timestamp.fromPartial(object.tsDevice) : undefined;
|
|
2528
|
+
message.transformation = object.transformation !== undefined && object.transformation !== null ? ImgTransformation.fromPartial(object.transformation) : undefined;
|
|
2529
|
+
message.data = object.data ?? new Uint8Array(0);
|
|
2530
|
+
return message;
|
|
2531
|
+
}
|
|
2532
|
+
};
|
|
2533
|
+
function bytesFromBase64$2(b64) {
|
|
2534
|
+
if (globalThis.Buffer) {
|
|
2535
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
2536
|
+
} else {
|
|
2537
|
+
const bin = globalThis.atob(b64);
|
|
2538
|
+
const arr = new Uint8Array(bin.length);
|
|
2539
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
2540
|
+
arr[i] = bin.charCodeAt(i);
|
|
2541
|
+
}
|
|
2542
|
+
return arr;
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
function base64FromBytes$2(arr) {
|
|
2546
|
+
if (globalThis.Buffer) {
|
|
2547
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
2548
|
+
} else {
|
|
2549
|
+
const bin = [];
|
|
2550
|
+
arr.forEach(byte => {
|
|
2551
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
2552
|
+
});
|
|
2553
|
+
return globalThis.btoa(bin.join(""));
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
function longToNumber$5(long) {
|
|
2557
|
+
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
|
2558
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
2559
|
+
}
|
|
2560
|
+
if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
|
|
2561
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
2562
|
+
}
|
|
2563
|
+
return long.toNumber();
|
|
2564
|
+
}
|
|
2565
|
+
if (_m0.util.Long !== Long) {
|
|
2566
|
+
_m0.util.Long = Long;
|
|
2567
|
+
_m0.configure();
|
|
2568
|
+
}
|
|
2569
|
+
function isSet$5(value) {
|
|
2570
|
+
return value !== null && value !== undefined;
|
|
2571
|
+
}
|
|
2572
|
+
const protobufName$5 = "EncodedFrame";
|
|
2573
|
+
|
|
2574
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2575
|
+
// versions:
|
|
2576
|
+
// protoc-gen-ts_proto v1.181.1
|
|
2577
|
+
// protoc v4.25.1
|
|
2578
|
+
// source: ImageAnnotations.proto
|
|
2579
|
+
|
|
2580
|
+
const protobufPackage$4 = "dai.proto.image_annotations";
|
|
2581
|
+
let PointsAnnotationType = /*#__PURE__*/function (PointsAnnotationType) {
|
|
2582
|
+
PointsAnnotationType[PointsAnnotationType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
2583
|
+
PointsAnnotationType[PointsAnnotationType["POINTS"] = 1] = "POINTS";
|
|
2584
|
+
PointsAnnotationType[PointsAnnotationType["LINE_LOOP"] = 2] = "LINE_LOOP";
|
|
2585
|
+
PointsAnnotationType[PointsAnnotationType["LINE_STRIP"] = 3] = "LINE_STRIP";
|
|
2586
|
+
PointsAnnotationType[PointsAnnotationType["LINE_LIST"] = 4] = "LINE_LIST";
|
|
2587
|
+
PointsAnnotationType[PointsAnnotationType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
2588
|
+
return PointsAnnotationType;
|
|
2589
|
+
}({});
|
|
2590
|
+
function pointsAnnotationTypeFromJSON(object) {
|
|
2591
|
+
switch (object) {
|
|
2592
|
+
case 0:
|
|
2593
|
+
case "UNKNOWN":
|
|
2594
|
+
return PointsAnnotationType.UNKNOWN;
|
|
2595
|
+
case 1:
|
|
2596
|
+
case "POINTS":
|
|
2597
|
+
return PointsAnnotationType.POINTS;
|
|
2598
|
+
case 2:
|
|
2599
|
+
case "LINE_LOOP":
|
|
2600
|
+
return PointsAnnotationType.LINE_LOOP;
|
|
2601
|
+
case 3:
|
|
2602
|
+
case "LINE_STRIP":
|
|
2603
|
+
return PointsAnnotationType.LINE_STRIP;
|
|
2604
|
+
case 4:
|
|
2605
|
+
case "LINE_LIST":
|
|
2606
|
+
return PointsAnnotationType.LINE_LIST;
|
|
2607
|
+
case -1:
|
|
2608
|
+
case "UNRECOGNIZED":
|
|
2609
|
+
default:
|
|
2610
|
+
return PointsAnnotationType.UNRECOGNIZED;
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
function pointsAnnotationTypeToJSON(object) {
|
|
2614
|
+
switch (object) {
|
|
2615
|
+
case PointsAnnotationType.UNKNOWN:
|
|
2616
|
+
return "UNKNOWN";
|
|
2617
|
+
case PointsAnnotationType.POINTS:
|
|
2618
|
+
return "POINTS";
|
|
2619
|
+
case PointsAnnotationType.LINE_LOOP:
|
|
2620
|
+
return "LINE_LOOP";
|
|
2621
|
+
case PointsAnnotationType.LINE_STRIP:
|
|
2622
|
+
return "LINE_STRIP";
|
|
2623
|
+
case PointsAnnotationType.LINE_LIST:
|
|
2624
|
+
return "LINE_LIST";
|
|
2625
|
+
case PointsAnnotationType.UNRECOGNIZED:
|
|
2626
|
+
default:
|
|
2627
|
+
return "UNRECOGNIZED";
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
function createBaseImageAnnotations() {
|
|
2631
|
+
return {
|
|
2632
|
+
sequenceNum: 0,
|
|
2633
|
+
ts: undefined,
|
|
2634
|
+
tsDevice: undefined,
|
|
2635
|
+
annotations: []
|
|
2636
|
+
};
|
|
2637
|
+
}
|
|
2638
|
+
const ImageAnnotations = {
|
|
2639
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
2640
|
+
if (message.sequenceNum !== 0) {
|
|
2641
|
+
writer.uint32(8).int64(message.sequenceNum);
|
|
2642
|
+
}
|
|
2643
|
+
if (message.ts !== undefined) {
|
|
2644
|
+
Timestamp.encode(message.ts, writer.uint32(18).fork()).ldelim();
|
|
2645
|
+
}
|
|
2646
|
+
if (message.tsDevice !== undefined) {
|
|
2647
|
+
Timestamp.encode(message.tsDevice, writer.uint32(26).fork()).ldelim();
|
|
2648
|
+
}
|
|
2649
|
+
for (const v of message.annotations) {
|
|
2650
|
+
ImageAnnotation.encode(v, writer.uint32(34).fork()).ldelim();
|
|
2651
|
+
}
|
|
2652
|
+
return writer;
|
|
2653
|
+
},
|
|
2654
|
+
decode(input, length) {
|
|
2655
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2656
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2657
|
+
const message = createBaseImageAnnotations();
|
|
2658
|
+
while (reader.pos < end) {
|
|
2659
|
+
const tag = reader.uint32();
|
|
2660
|
+
switch (tag >>> 3) {
|
|
2661
|
+
case 1:
|
|
2662
|
+
if (tag !== 8) {
|
|
2663
|
+
break;
|
|
2664
|
+
}
|
|
2665
|
+
message.sequenceNum = longToNumber$4(reader.int64());
|
|
2666
|
+
continue;
|
|
2667
|
+
case 2:
|
|
2668
|
+
if (tag !== 18) {
|
|
2669
|
+
break;
|
|
2670
|
+
}
|
|
2671
|
+
message.ts = Timestamp.decode(reader, reader.uint32());
|
|
2672
|
+
continue;
|
|
2673
|
+
case 3:
|
|
2674
|
+
if (tag !== 26) {
|
|
2675
|
+
break;
|
|
2676
|
+
}
|
|
2677
|
+
message.tsDevice = Timestamp.decode(reader, reader.uint32());
|
|
2678
|
+
continue;
|
|
2679
|
+
case 4:
|
|
2680
|
+
if (tag !== 34) {
|
|
2681
|
+
break;
|
|
2682
|
+
}
|
|
2683
|
+
message.annotations.push(ImageAnnotation.decode(reader, reader.uint32()));
|
|
2684
|
+
continue;
|
|
2685
|
+
}
|
|
2686
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2687
|
+
break;
|
|
2688
|
+
}
|
|
2689
|
+
reader.skipType(tag & 7);
|
|
2690
|
+
}
|
|
2691
|
+
return message;
|
|
2692
|
+
},
|
|
2693
|
+
fromJSON(object) {
|
|
2694
|
+
return {
|
|
2695
|
+
sequenceNum: isSet$4(object.sequenceNum) ? globalThis.Number(object.sequenceNum) : 0,
|
|
2696
|
+
ts: isSet$4(object.ts) ? Timestamp.fromJSON(object.ts) : undefined,
|
|
2697
|
+
tsDevice: isSet$4(object.tsDevice) ? Timestamp.fromJSON(object.tsDevice) : undefined,
|
|
2323
2698
|
annotations: globalThis.Array.isArray(object?.annotations) ? object.annotations.map(e => ImageAnnotation.fromJSON(e)) : []
|
|
2324
2699
|
};
|
|
2325
2700
|
},
|
|
@@ -2510,11 +2885,11 @@ const CircleAnnotation = {
|
|
|
2510
2885
|
},
|
|
2511
2886
|
fromJSON(object) {
|
|
2512
2887
|
return {
|
|
2513
|
-
position: isSet$
|
|
2514
|
-
diameter: isSet$
|
|
2515
|
-
thickness: isSet$
|
|
2516
|
-
fillColor: isSet$
|
|
2517
|
-
outlineColor: isSet$
|
|
2888
|
+
position: isSet$4(object.position) ? Point2f.fromJSON(object.position) : undefined,
|
|
2889
|
+
diameter: isSet$4(object.diameter) ? globalThis.Number(object.diameter) : 0,
|
|
2890
|
+
thickness: isSet$4(object.thickness) ? globalThis.Number(object.thickness) : 0,
|
|
2891
|
+
fillColor: isSet$4(object.fillColor) ? Color.fromJSON(object.fillColor) : undefined,
|
|
2892
|
+
outlineColor: isSet$4(object.outlineColor) ? Color.fromJSON(object.outlineColor) : undefined
|
|
2518
2893
|
};
|
|
2519
2894
|
},
|
|
2520
2895
|
toJSON(message) {
|
|
@@ -2634,12 +3009,12 @@ const PointsAnnotation = {
|
|
|
2634
3009
|
},
|
|
2635
3010
|
fromJSON(object) {
|
|
2636
3011
|
return {
|
|
2637
|
-
type: isSet$
|
|
3012
|
+
type: isSet$4(object.type) ? pointsAnnotationTypeFromJSON(object.type) : 0,
|
|
2638
3013
|
points: globalThis.Array.isArray(object?.points) ? object.points.map(e => Point2f.fromJSON(e)) : [],
|
|
2639
|
-
outlineColor: isSet$
|
|
3014
|
+
outlineColor: isSet$4(object.outlineColor) ? Color.fromJSON(object.outlineColor) : undefined,
|
|
2640
3015
|
outlineColors: globalThis.Array.isArray(object?.outlineColors) ? object.outlineColors.map(e => Color.fromJSON(e)) : [],
|
|
2641
|
-
fillColor: isSet$
|
|
2642
|
-
thickness: isSet$
|
|
3016
|
+
fillColor: isSet$4(object.fillColor) ? Color.fromJSON(object.fillColor) : undefined,
|
|
3017
|
+
thickness: isSet$4(object.thickness) ? globalThis.Number(object.thickness) : 0
|
|
2643
3018
|
};
|
|
2644
3019
|
},
|
|
2645
3020
|
toJSON(message) {
|
|
@@ -2753,11 +3128,11 @@ const TextAnnotation = {
|
|
|
2753
3128
|
},
|
|
2754
3129
|
fromJSON(object) {
|
|
2755
3130
|
return {
|
|
2756
|
-
position: isSet$
|
|
2757
|
-
text: isSet$
|
|
2758
|
-
fontSize: isSet$
|
|
2759
|
-
textColor: isSet$
|
|
2760
|
-
backgroundColor: isSet$
|
|
3131
|
+
position: isSet$4(object.position) ? Point2f.fromJSON(object.position) : undefined,
|
|
3132
|
+
text: isSet$4(object.text) ? globalThis.String(object.text) : "",
|
|
3133
|
+
fontSize: isSet$4(object.fontSize) ? globalThis.Number(object.fontSize) : 0,
|
|
3134
|
+
textColor: isSet$4(object.textColor) ? Color.fromJSON(object.textColor) : undefined,
|
|
3135
|
+
backgroundColor: isSet$4(object.backgroundColor) ? Color.fromJSON(object.backgroundColor) : undefined
|
|
2761
3136
|
};
|
|
2762
3137
|
},
|
|
2763
3138
|
toJSON(message) {
|
|
@@ -2792,7 +3167,7 @@ const TextAnnotation = {
|
|
|
2792
3167
|
return message;
|
|
2793
3168
|
}
|
|
2794
3169
|
};
|
|
2795
|
-
function longToNumber$
|
|
3170
|
+
function longToNumber$4(long) {
|
|
2796
3171
|
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
|
2797
3172
|
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
2798
3173
|
}
|
|
@@ -2805,366 +3180,83 @@ if (_m0.util.Long !== Long) {
|
|
|
2805
3180
|
_m0.util.Long = Long;
|
|
2806
3181
|
_m0.configure();
|
|
2807
3182
|
}
|
|
2808
|
-
function isSet$
|
|
3183
|
+
function isSet$4(value) {
|
|
2809
3184
|
return value !== null && value !== undefined;
|
|
2810
3185
|
}
|
|
2811
|
-
const protobufName$
|
|
3186
|
+
const protobufName$4 = "ImageAnnotations";
|
|
2812
3187
|
|
|
2813
3188
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2814
3189
|
// versions:
|
|
2815
3190
|
// protoc-gen-ts_proto v1.181.1
|
|
2816
3191
|
// protoc v4.25.1
|
|
2817
|
-
// source:
|
|
3192
|
+
// source: ImgDetections.proto
|
|
2818
3193
|
|
|
2819
|
-
const protobufPackage$
|
|
2820
|
-
|
|
2821
|
-
Type[Type["YUV422i"] = 0] = "YUV422i";
|
|
2822
|
-
Type[Type["YUV444p"] = 1] = "YUV444p";
|
|
2823
|
-
Type[Type["YUV420p"] = 2] = "YUV420p";
|
|
2824
|
-
Type[Type["YUV422p"] = 3] = "YUV422p";
|
|
2825
|
-
Type[Type["YUV400p"] = 4] = "YUV400p";
|
|
2826
|
-
Type[Type["RGBA8888"] = 5] = "RGBA8888";
|
|
2827
|
-
Type[Type["RGB161616"] = 6] = "RGB161616";
|
|
2828
|
-
Type[Type["RGB888p"] = 7] = "RGB888p";
|
|
2829
|
-
Type[Type["BGR888p"] = 8] = "BGR888p";
|
|
2830
|
-
Type[Type["RGB888i"] = 9] = "RGB888i";
|
|
2831
|
-
Type[Type["BGR888i"] = 10] = "BGR888i";
|
|
2832
|
-
Type[Type["LUT2"] = 11] = "LUT2";
|
|
2833
|
-
Type[Type["LUT4"] = 12] = "LUT4";
|
|
2834
|
-
Type[Type["LUT16"] = 13] = "LUT16";
|
|
2835
|
-
Type[Type["RAW16"] = 14] = "RAW16";
|
|
2836
|
-
Type[Type["RAW14"] = 15] = "RAW14";
|
|
2837
|
-
Type[Type["RAW12"] = 16] = "RAW12";
|
|
2838
|
-
Type[Type["RAW10"] = 17] = "RAW10";
|
|
2839
|
-
Type[Type["RAW8"] = 18] = "RAW8";
|
|
2840
|
-
Type[Type["PACK10"] = 19] = "PACK10";
|
|
2841
|
-
Type[Type["PACK12"] = 20] = "PACK12";
|
|
2842
|
-
Type[Type["YUV444i"] = 21] = "YUV444i";
|
|
2843
|
-
Type[Type["NV12"] = 22] = "NV12";
|
|
2844
|
-
Type[Type["NV21"] = 23] = "NV21";
|
|
2845
|
-
Type[Type["BITSTREAM"] = 24] = "BITSTREAM";
|
|
2846
|
-
Type[Type["HDR"] = 25] = "HDR";
|
|
2847
|
-
Type[Type["RGBF16F16F16p"] = 26] = "RGBF16F16F16p";
|
|
2848
|
-
Type[Type["BGRF16F16F16p"] = 27] = "BGRF16F16F16p";
|
|
2849
|
-
Type[Type["RGBF16F16F16i"] = 28] = "RGBF16F16F16i";
|
|
2850
|
-
Type[Type["BGRF16F16F16i"] = 29] = "BGRF16F16F16i";
|
|
2851
|
-
Type[Type["GRAY8"] = 30] = "GRAY8";
|
|
2852
|
-
Type[Type["GRAYF16"] = 31] = "GRAYF16";
|
|
2853
|
-
Type[Type["RAW32"] = 32] = "RAW32";
|
|
2854
|
-
Type[Type["NONE"] = 33] = "NONE";
|
|
2855
|
-
Type[Type["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
2856
|
-
return Type;
|
|
2857
|
-
}({});
|
|
2858
|
-
function typeFromJSON(object) {
|
|
2859
|
-
switch (object) {
|
|
2860
|
-
case 0:
|
|
2861
|
-
case "YUV422i":
|
|
2862
|
-
return Type.YUV422i;
|
|
2863
|
-
case 1:
|
|
2864
|
-
case "YUV444p":
|
|
2865
|
-
return Type.YUV444p;
|
|
2866
|
-
case 2:
|
|
2867
|
-
case "YUV420p":
|
|
2868
|
-
return Type.YUV420p;
|
|
2869
|
-
case 3:
|
|
2870
|
-
case "YUV422p":
|
|
2871
|
-
return Type.YUV422p;
|
|
2872
|
-
case 4:
|
|
2873
|
-
case "YUV400p":
|
|
2874
|
-
return Type.YUV400p;
|
|
2875
|
-
case 5:
|
|
2876
|
-
case "RGBA8888":
|
|
2877
|
-
return Type.RGBA8888;
|
|
2878
|
-
case 6:
|
|
2879
|
-
case "RGB161616":
|
|
2880
|
-
return Type.RGB161616;
|
|
2881
|
-
case 7:
|
|
2882
|
-
case "RGB888p":
|
|
2883
|
-
return Type.RGB888p;
|
|
2884
|
-
case 8:
|
|
2885
|
-
case "BGR888p":
|
|
2886
|
-
return Type.BGR888p;
|
|
2887
|
-
case 9:
|
|
2888
|
-
case "RGB888i":
|
|
2889
|
-
return Type.RGB888i;
|
|
2890
|
-
case 10:
|
|
2891
|
-
case "BGR888i":
|
|
2892
|
-
return Type.BGR888i;
|
|
2893
|
-
case 11:
|
|
2894
|
-
case "LUT2":
|
|
2895
|
-
return Type.LUT2;
|
|
2896
|
-
case 12:
|
|
2897
|
-
case "LUT4":
|
|
2898
|
-
return Type.LUT4;
|
|
2899
|
-
case 13:
|
|
2900
|
-
case "LUT16":
|
|
2901
|
-
return Type.LUT16;
|
|
2902
|
-
case 14:
|
|
2903
|
-
case "RAW16":
|
|
2904
|
-
return Type.RAW16;
|
|
2905
|
-
case 15:
|
|
2906
|
-
case "RAW14":
|
|
2907
|
-
return Type.RAW14;
|
|
2908
|
-
case 16:
|
|
2909
|
-
case "RAW12":
|
|
2910
|
-
return Type.RAW12;
|
|
2911
|
-
case 17:
|
|
2912
|
-
case "RAW10":
|
|
2913
|
-
return Type.RAW10;
|
|
2914
|
-
case 18:
|
|
2915
|
-
case "RAW8":
|
|
2916
|
-
return Type.RAW8;
|
|
2917
|
-
case 19:
|
|
2918
|
-
case "PACK10":
|
|
2919
|
-
return Type.PACK10;
|
|
2920
|
-
case 20:
|
|
2921
|
-
case "PACK12":
|
|
2922
|
-
return Type.PACK12;
|
|
2923
|
-
case 21:
|
|
2924
|
-
case "YUV444i":
|
|
2925
|
-
return Type.YUV444i;
|
|
2926
|
-
case 22:
|
|
2927
|
-
case "NV12":
|
|
2928
|
-
return Type.NV12;
|
|
2929
|
-
case 23:
|
|
2930
|
-
case "NV21":
|
|
2931
|
-
return Type.NV21;
|
|
2932
|
-
case 24:
|
|
2933
|
-
case "BITSTREAM":
|
|
2934
|
-
return Type.BITSTREAM;
|
|
2935
|
-
case 25:
|
|
2936
|
-
case "HDR":
|
|
2937
|
-
return Type.HDR;
|
|
2938
|
-
case 26:
|
|
2939
|
-
case "RGBF16F16F16p":
|
|
2940
|
-
return Type.RGBF16F16F16p;
|
|
2941
|
-
case 27:
|
|
2942
|
-
case "BGRF16F16F16p":
|
|
2943
|
-
return Type.BGRF16F16F16p;
|
|
2944
|
-
case 28:
|
|
2945
|
-
case "RGBF16F16F16i":
|
|
2946
|
-
return Type.RGBF16F16F16i;
|
|
2947
|
-
case 29:
|
|
2948
|
-
case "BGRF16F16F16i":
|
|
2949
|
-
return Type.BGRF16F16F16i;
|
|
2950
|
-
case 30:
|
|
2951
|
-
case "GRAY8":
|
|
2952
|
-
return Type.GRAY8;
|
|
2953
|
-
case 31:
|
|
2954
|
-
case "GRAYF16":
|
|
2955
|
-
return Type.GRAYF16;
|
|
2956
|
-
case 32:
|
|
2957
|
-
case "RAW32":
|
|
2958
|
-
return Type.RAW32;
|
|
2959
|
-
case 33:
|
|
2960
|
-
case "NONE":
|
|
2961
|
-
return Type.NONE;
|
|
2962
|
-
case -1:
|
|
2963
|
-
case "UNRECOGNIZED":
|
|
2964
|
-
default:
|
|
2965
|
-
return Type.UNRECOGNIZED;
|
|
2966
|
-
}
|
|
2967
|
-
}
|
|
2968
|
-
function typeToJSON(object) {
|
|
2969
|
-
switch (object) {
|
|
2970
|
-
case Type.YUV422i:
|
|
2971
|
-
return "YUV422i";
|
|
2972
|
-
case Type.YUV444p:
|
|
2973
|
-
return "YUV444p";
|
|
2974
|
-
case Type.YUV420p:
|
|
2975
|
-
return "YUV420p";
|
|
2976
|
-
case Type.YUV422p:
|
|
2977
|
-
return "YUV422p";
|
|
2978
|
-
case Type.YUV400p:
|
|
2979
|
-
return "YUV400p";
|
|
2980
|
-
case Type.RGBA8888:
|
|
2981
|
-
return "RGBA8888";
|
|
2982
|
-
case Type.RGB161616:
|
|
2983
|
-
return "RGB161616";
|
|
2984
|
-
case Type.RGB888p:
|
|
2985
|
-
return "RGB888p";
|
|
2986
|
-
case Type.BGR888p:
|
|
2987
|
-
return "BGR888p";
|
|
2988
|
-
case Type.RGB888i:
|
|
2989
|
-
return "RGB888i";
|
|
2990
|
-
case Type.BGR888i:
|
|
2991
|
-
return "BGR888i";
|
|
2992
|
-
case Type.LUT2:
|
|
2993
|
-
return "LUT2";
|
|
2994
|
-
case Type.LUT4:
|
|
2995
|
-
return "LUT4";
|
|
2996
|
-
case Type.LUT16:
|
|
2997
|
-
return "LUT16";
|
|
2998
|
-
case Type.RAW16:
|
|
2999
|
-
return "RAW16";
|
|
3000
|
-
case Type.RAW14:
|
|
3001
|
-
return "RAW14";
|
|
3002
|
-
case Type.RAW12:
|
|
3003
|
-
return "RAW12";
|
|
3004
|
-
case Type.RAW10:
|
|
3005
|
-
return "RAW10";
|
|
3006
|
-
case Type.RAW8:
|
|
3007
|
-
return "RAW8";
|
|
3008
|
-
case Type.PACK10:
|
|
3009
|
-
return "PACK10";
|
|
3010
|
-
case Type.PACK12:
|
|
3011
|
-
return "PACK12";
|
|
3012
|
-
case Type.YUV444i:
|
|
3013
|
-
return "YUV444i";
|
|
3014
|
-
case Type.NV12:
|
|
3015
|
-
return "NV12";
|
|
3016
|
-
case Type.NV21:
|
|
3017
|
-
return "NV21";
|
|
3018
|
-
case Type.BITSTREAM:
|
|
3019
|
-
return "BITSTREAM";
|
|
3020
|
-
case Type.HDR:
|
|
3021
|
-
return "HDR";
|
|
3022
|
-
case Type.RGBF16F16F16p:
|
|
3023
|
-
return "RGBF16F16F16p";
|
|
3024
|
-
case Type.BGRF16F16F16p:
|
|
3025
|
-
return "BGRF16F16F16p";
|
|
3026
|
-
case Type.RGBF16F16F16i:
|
|
3027
|
-
return "RGBF16F16F16i";
|
|
3028
|
-
case Type.BGRF16F16F16i:
|
|
3029
|
-
return "BGRF16F16F16i";
|
|
3030
|
-
case Type.GRAY8:
|
|
3031
|
-
return "GRAY8";
|
|
3032
|
-
case Type.GRAYF16:
|
|
3033
|
-
return "GRAYF16";
|
|
3034
|
-
case Type.RAW32:
|
|
3035
|
-
return "RAW32";
|
|
3036
|
-
case Type.NONE:
|
|
3037
|
-
return "NONE";
|
|
3038
|
-
case Type.UNRECOGNIZED:
|
|
3039
|
-
default:
|
|
3040
|
-
return "UNRECOGNIZED";
|
|
3041
|
-
}
|
|
3042
|
-
}
|
|
3043
|
-
function createBaseImgFrame() {
|
|
3194
|
+
const protobufPackage$3 = "dai.proto.img_detections";
|
|
3195
|
+
function createBaseImgDetections() {
|
|
3044
3196
|
return {
|
|
3197
|
+
sequenceNum: 0,
|
|
3045
3198
|
ts: undefined,
|
|
3046
3199
|
tsDevice: undefined,
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
sourceFb: undefined,
|
|
3050
|
-
cam: undefined,
|
|
3051
|
-
HFovDegrees: 0,
|
|
3052
|
-
instanceNum: 0,
|
|
3053
|
-
transformation: undefined,
|
|
3054
|
-
category: 0,
|
|
3055
|
-
data: new Uint8Array(0)
|
|
3200
|
+
detections: [],
|
|
3201
|
+
transformation: undefined
|
|
3056
3202
|
};
|
|
3057
3203
|
}
|
|
3058
|
-
const
|
|
3204
|
+
const ImgDetections = {
|
|
3059
3205
|
encode(message, writer = _m0.Writer.create()) {
|
|
3060
|
-
if (message.ts !== undefined) {
|
|
3061
|
-
Timestamp.encode(message.ts, writer.uint32(10).fork()).ldelim();
|
|
3062
|
-
}
|
|
3063
|
-
if (message.tsDevice !== undefined) {
|
|
3064
|
-
Timestamp.encode(message.tsDevice, writer.uint32(18).fork()).ldelim();
|
|
3065
|
-
}
|
|
3066
3206
|
if (message.sequenceNum !== 0) {
|
|
3067
|
-
writer.uint32(
|
|
3068
|
-
}
|
|
3069
|
-
if (message.fb !== undefined) {
|
|
3070
|
-
Specs.encode(message.fb, writer.uint32(34).fork()).ldelim();
|
|
3071
|
-
}
|
|
3072
|
-
if (message.sourceFb !== undefined) {
|
|
3073
|
-
Specs.encode(message.sourceFb, writer.uint32(42).fork()).ldelim();
|
|
3207
|
+
writer.uint32(8).int64(message.sequenceNum);
|
|
3074
3208
|
}
|
|
3075
|
-
if (message.
|
|
3076
|
-
|
|
3209
|
+
if (message.ts !== undefined) {
|
|
3210
|
+
Timestamp.encode(message.ts, writer.uint32(18).fork()).ldelim();
|
|
3077
3211
|
}
|
|
3078
|
-
if (message.
|
|
3079
|
-
writer.uint32(
|
|
3212
|
+
if (message.tsDevice !== undefined) {
|
|
3213
|
+
Timestamp.encode(message.tsDevice, writer.uint32(26).fork()).ldelim();
|
|
3080
3214
|
}
|
|
3081
|
-
|
|
3082
|
-
writer.uint32(
|
|
3215
|
+
for (const v of message.detections) {
|
|
3216
|
+
ImgDetection.encode(v, writer.uint32(34).fork()).ldelim();
|
|
3083
3217
|
}
|
|
3084
3218
|
if (message.transformation !== undefined) {
|
|
3085
|
-
ImgTransformation.encode(message.transformation, writer.uint32(
|
|
3086
|
-
}
|
|
3087
|
-
if (message.category !== 0) {
|
|
3088
|
-
writer.uint32(80).uint32(message.category);
|
|
3089
|
-
}
|
|
3090
|
-
if (message.data.length !== 0) {
|
|
3091
|
-
writer.uint32(90).bytes(message.data);
|
|
3219
|
+
ImgTransformation.encode(message.transformation, writer.uint32(42).fork()).ldelim();
|
|
3092
3220
|
}
|
|
3093
3221
|
return writer;
|
|
3094
3222
|
},
|
|
3095
3223
|
decode(input, length) {
|
|
3096
3224
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
3097
3225
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3098
|
-
const message =
|
|
3226
|
+
const message = createBaseImgDetections();
|
|
3099
3227
|
while (reader.pos < end) {
|
|
3100
3228
|
const tag = reader.uint32();
|
|
3101
3229
|
switch (tag >>> 3) {
|
|
3102
3230
|
case 1:
|
|
3103
|
-
if (tag !==
|
|
3231
|
+
if (tag !== 8) {
|
|
3104
3232
|
break;
|
|
3105
3233
|
}
|
|
3106
|
-
message.
|
|
3234
|
+
message.sequenceNum = longToNumber$3(reader.int64());
|
|
3107
3235
|
continue;
|
|
3108
3236
|
case 2:
|
|
3109
3237
|
if (tag !== 18) {
|
|
3110
3238
|
break;
|
|
3111
3239
|
}
|
|
3112
|
-
message.
|
|
3240
|
+
message.ts = Timestamp.decode(reader, reader.uint32());
|
|
3113
3241
|
continue;
|
|
3114
3242
|
case 3:
|
|
3115
|
-
if (tag !==
|
|
3243
|
+
if (tag !== 26) {
|
|
3116
3244
|
break;
|
|
3117
3245
|
}
|
|
3118
|
-
message.
|
|
3246
|
+
message.tsDevice = Timestamp.decode(reader, reader.uint32());
|
|
3119
3247
|
continue;
|
|
3120
3248
|
case 4:
|
|
3121
3249
|
if (tag !== 34) {
|
|
3122
3250
|
break;
|
|
3123
3251
|
}
|
|
3124
|
-
message.
|
|
3252
|
+
message.detections.push(ImgDetection.decode(reader, reader.uint32()));
|
|
3125
3253
|
continue;
|
|
3126
3254
|
case 5:
|
|
3127
3255
|
if (tag !== 42) {
|
|
3128
3256
|
break;
|
|
3129
3257
|
}
|
|
3130
|
-
message.sourceFb = Specs.decode(reader, reader.uint32());
|
|
3131
|
-
continue;
|
|
3132
|
-
case 6:
|
|
3133
|
-
if (tag !== 50) {
|
|
3134
|
-
break;
|
|
3135
|
-
}
|
|
3136
|
-
message.cam = CameraSettings.decode(reader, reader.uint32());
|
|
3137
|
-
continue;
|
|
3138
|
-
case 7:
|
|
3139
|
-
if (tag !== 61) {
|
|
3140
|
-
break;
|
|
3141
|
-
}
|
|
3142
|
-
message.HFovDegrees = reader.float();
|
|
3143
|
-
continue;
|
|
3144
|
-
case 8:
|
|
3145
|
-
if (tag !== 64) {
|
|
3146
|
-
break;
|
|
3147
|
-
}
|
|
3148
|
-
message.instanceNum = reader.uint32();
|
|
3149
|
-
continue;
|
|
3150
|
-
case 9:
|
|
3151
|
-
if (tag !== 74) {
|
|
3152
|
-
break;
|
|
3153
|
-
}
|
|
3154
3258
|
message.transformation = ImgTransformation.decode(reader, reader.uint32());
|
|
3155
3259
|
continue;
|
|
3156
|
-
case 10:
|
|
3157
|
-
if (tag !== 80) {
|
|
3158
|
-
break;
|
|
3159
|
-
}
|
|
3160
|
-
message.category = reader.uint32();
|
|
3161
|
-
continue;
|
|
3162
|
-
case 11:
|
|
3163
|
-
if (tag !== 90) {
|
|
3164
|
-
break;
|
|
3165
|
-
}
|
|
3166
|
-
message.data = reader.bytes();
|
|
3167
|
-
continue;
|
|
3168
3260
|
}
|
|
3169
3261
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3170
3262
|
break;
|
|
@@ -3175,119 +3267,81 @@ const ImgFrame = {
|
|
|
3175
3267
|
},
|
|
3176
3268
|
fromJSON(object) {
|
|
3177
3269
|
return {
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
cam: isSet$4(object.cam) ? CameraSettings.fromJSON(object.cam) : undefined,
|
|
3184
|
-
HFovDegrees: isSet$4(object.HFovDegrees) ? globalThis.Number(object.HFovDegrees) : 0,
|
|
3185
|
-
instanceNum: isSet$4(object.instanceNum) ? globalThis.Number(object.instanceNum) : 0,
|
|
3186
|
-
transformation: isSet$4(object.transformation) ? ImgTransformation.fromJSON(object.transformation) : undefined,
|
|
3187
|
-
category: isSet$4(object.category) ? globalThis.Number(object.category) : 0,
|
|
3188
|
-
data: isSet$4(object.data) ? bytesFromBase64$2(object.data) : new Uint8Array(0)
|
|
3270
|
+
sequenceNum: isSet$3(object.sequenceNum) ? globalThis.Number(object.sequenceNum) : 0,
|
|
3271
|
+
ts: isSet$3(object.ts) ? Timestamp.fromJSON(object.ts) : undefined,
|
|
3272
|
+
tsDevice: isSet$3(object.tsDevice) ? Timestamp.fromJSON(object.tsDevice) : undefined,
|
|
3273
|
+
detections: globalThis.Array.isArray(object?.detections) ? object.detections.map(e => ImgDetection.fromJSON(e)) : [],
|
|
3274
|
+
transformation: isSet$3(object.transformation) ? ImgTransformation.fromJSON(object.transformation) : undefined
|
|
3189
3275
|
};
|
|
3190
3276
|
},
|
|
3191
3277
|
toJSON(message) {
|
|
3192
3278
|
const obj = {};
|
|
3279
|
+
if (message.sequenceNum !== 0) {
|
|
3280
|
+
obj.sequenceNum = Math.round(message.sequenceNum);
|
|
3281
|
+
}
|
|
3193
3282
|
if (message.ts !== undefined) {
|
|
3194
3283
|
obj.ts = Timestamp.toJSON(message.ts);
|
|
3195
3284
|
}
|
|
3196
3285
|
if (message.tsDevice !== undefined) {
|
|
3197
3286
|
obj.tsDevice = Timestamp.toJSON(message.tsDevice);
|
|
3198
3287
|
}
|
|
3199
|
-
if (message.
|
|
3200
|
-
obj.
|
|
3201
|
-
}
|
|
3202
|
-
if (message.fb !== undefined) {
|
|
3203
|
-
obj.fb = Specs.toJSON(message.fb);
|
|
3204
|
-
}
|
|
3205
|
-
if (message.sourceFb !== undefined) {
|
|
3206
|
-
obj.sourceFb = Specs.toJSON(message.sourceFb);
|
|
3207
|
-
}
|
|
3208
|
-
if (message.cam !== undefined) {
|
|
3209
|
-
obj.cam = CameraSettings.toJSON(message.cam);
|
|
3210
|
-
}
|
|
3211
|
-
if (message.HFovDegrees !== 0) {
|
|
3212
|
-
obj.HFovDegrees = message.HFovDegrees;
|
|
3213
|
-
}
|
|
3214
|
-
if (message.instanceNum !== 0) {
|
|
3215
|
-
obj.instanceNum = Math.round(message.instanceNum);
|
|
3288
|
+
if (message.detections?.length) {
|
|
3289
|
+
obj.detections = message.detections.map(e => ImgDetection.toJSON(e));
|
|
3216
3290
|
}
|
|
3217
3291
|
if (message.transformation !== undefined) {
|
|
3218
3292
|
obj.transformation = ImgTransformation.toJSON(message.transformation);
|
|
3219
3293
|
}
|
|
3220
|
-
if (message.category !== 0) {
|
|
3221
|
-
obj.category = Math.round(message.category);
|
|
3222
|
-
}
|
|
3223
|
-
if (message.data.length !== 0) {
|
|
3224
|
-
obj.data = base64FromBytes$2(message.data);
|
|
3225
|
-
}
|
|
3226
3294
|
return obj;
|
|
3227
3295
|
},
|
|
3228
3296
|
create(base) {
|
|
3229
|
-
return
|
|
3297
|
+
return ImgDetections.fromPartial(base ?? {});
|
|
3230
3298
|
},
|
|
3231
3299
|
fromPartial(object) {
|
|
3232
|
-
const message =
|
|
3300
|
+
const message = createBaseImgDetections();
|
|
3301
|
+
message.sequenceNum = object.sequenceNum ?? 0;
|
|
3233
3302
|
message.ts = object.ts !== undefined && object.ts !== null ? Timestamp.fromPartial(object.ts) : undefined;
|
|
3234
3303
|
message.tsDevice = object.tsDevice !== undefined && object.tsDevice !== null ? Timestamp.fromPartial(object.tsDevice) : undefined;
|
|
3235
|
-
message.
|
|
3236
|
-
message.
|
|
3237
|
-
message.sourceFb = object.sourceFb !== undefined && object.sourceFb !== null ? Specs.fromPartial(object.sourceFb) : undefined;
|
|
3238
|
-
message.cam = object.cam !== undefined && object.cam !== null ? CameraSettings.fromPartial(object.cam) : undefined;
|
|
3239
|
-
message.HFovDegrees = object.HFovDegrees ?? 0;
|
|
3240
|
-
message.instanceNum = object.instanceNum ?? 0;
|
|
3241
|
-
message.transformation = object.transformation !== undefined && object.transformation !== null ? ImgTransformation.fromPartial(object.transformation) : undefined;
|
|
3242
|
-
message.category = object.category ?? 0;
|
|
3243
|
-
message.data = object.data ?? new Uint8Array(0);
|
|
3304
|
+
message.detections = object.detections?.map(e => ImgDetection.fromPartial(e)) || [];
|
|
3305
|
+
message.transformation = object.transformation !== undefined && object.transformation !== null ? ImgTransformation.fromPartial(object.transformation) : undefined;
|
|
3244
3306
|
return message;
|
|
3245
3307
|
}
|
|
3246
3308
|
};
|
|
3247
|
-
function
|
|
3309
|
+
function createBaseImgDetection() {
|
|
3248
3310
|
return {
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
p2Offset: 0,
|
|
3256
|
-
p3Offset: 0
|
|
3311
|
+
label: 0,
|
|
3312
|
+
confidence: 0,
|
|
3313
|
+
xmin: 0,
|
|
3314
|
+
ymin: 0,
|
|
3315
|
+
xmax: 0,
|
|
3316
|
+
ymax: 0
|
|
3257
3317
|
};
|
|
3258
3318
|
}
|
|
3259
|
-
const
|
|
3319
|
+
const ImgDetection = {
|
|
3260
3320
|
encode(message, writer = _m0.Writer.create()) {
|
|
3261
|
-
if (message.
|
|
3262
|
-
writer.uint32(8).
|
|
3263
|
-
}
|
|
3264
|
-
if (message.width !== 0) {
|
|
3265
|
-
writer.uint32(16).uint32(message.width);
|
|
3266
|
-
}
|
|
3267
|
-
if (message.height !== 0) {
|
|
3268
|
-
writer.uint32(24).uint32(message.height);
|
|
3321
|
+
if (message.label !== 0) {
|
|
3322
|
+
writer.uint32(8).uint32(message.label);
|
|
3269
3323
|
}
|
|
3270
|
-
if (message.
|
|
3271
|
-
writer.uint32(
|
|
3324
|
+
if (message.confidence !== 0) {
|
|
3325
|
+
writer.uint32(21).float(message.confidence);
|
|
3272
3326
|
}
|
|
3273
|
-
if (message.
|
|
3274
|
-
writer.uint32(
|
|
3327
|
+
if (message.xmin !== 0) {
|
|
3328
|
+
writer.uint32(29).float(message.xmin);
|
|
3275
3329
|
}
|
|
3276
|
-
if (message.
|
|
3277
|
-
writer.uint32(
|
|
3330
|
+
if (message.ymin !== 0) {
|
|
3331
|
+
writer.uint32(37).float(message.ymin);
|
|
3278
3332
|
}
|
|
3279
|
-
if (message.
|
|
3280
|
-
writer.uint32(
|
|
3333
|
+
if (message.xmax !== 0) {
|
|
3334
|
+
writer.uint32(45).float(message.xmax);
|
|
3281
3335
|
}
|
|
3282
|
-
if (message.
|
|
3283
|
-
writer.uint32(
|
|
3336
|
+
if (message.ymax !== 0) {
|
|
3337
|
+
writer.uint32(53).float(message.ymax);
|
|
3284
3338
|
}
|
|
3285
3339
|
return writer;
|
|
3286
3340
|
},
|
|
3287
3341
|
decode(input, length) {
|
|
3288
3342
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
3289
3343
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3290
|
-
const message =
|
|
3344
|
+
const message = createBaseImgDetection();
|
|
3291
3345
|
while (reader.pos < end) {
|
|
3292
3346
|
const tag = reader.uint32();
|
|
3293
3347
|
switch (tag >>> 3) {
|
|
@@ -3295,49 +3349,37 @@ const Specs = {
|
|
|
3295
3349
|
if (tag !== 8) {
|
|
3296
3350
|
break;
|
|
3297
3351
|
}
|
|
3298
|
-
message.
|
|
3352
|
+
message.label = reader.uint32();
|
|
3299
3353
|
continue;
|
|
3300
3354
|
case 2:
|
|
3301
|
-
if (tag !==
|
|
3355
|
+
if (tag !== 21) {
|
|
3302
3356
|
break;
|
|
3303
3357
|
}
|
|
3304
|
-
message.
|
|
3358
|
+
message.confidence = reader.float();
|
|
3305
3359
|
continue;
|
|
3306
3360
|
case 3:
|
|
3307
|
-
if (tag !==
|
|
3361
|
+
if (tag !== 29) {
|
|
3308
3362
|
break;
|
|
3309
3363
|
}
|
|
3310
|
-
message.
|
|
3364
|
+
message.xmin = reader.float();
|
|
3311
3365
|
continue;
|
|
3312
3366
|
case 4:
|
|
3313
|
-
if (tag !==
|
|
3367
|
+
if (tag !== 37) {
|
|
3314
3368
|
break;
|
|
3315
3369
|
}
|
|
3316
|
-
message.
|
|
3370
|
+
message.ymin = reader.float();
|
|
3317
3371
|
continue;
|
|
3318
3372
|
case 5:
|
|
3319
|
-
if (tag !==
|
|
3373
|
+
if (tag !== 45) {
|
|
3320
3374
|
break;
|
|
3321
3375
|
}
|
|
3322
|
-
message.
|
|
3376
|
+
message.xmax = reader.float();
|
|
3323
3377
|
continue;
|
|
3324
3378
|
case 6:
|
|
3325
|
-
if (tag !==
|
|
3326
|
-
break;
|
|
3327
|
-
}
|
|
3328
|
-
message.p1Offset = reader.uint32();
|
|
3329
|
-
continue;
|
|
3330
|
-
case 7:
|
|
3331
|
-
if (tag !== 56) {
|
|
3332
|
-
break;
|
|
3333
|
-
}
|
|
3334
|
-
message.p2Offset = reader.uint32();
|
|
3335
|
-
continue;
|
|
3336
|
-
case 8:
|
|
3337
|
-
if (tag !== 64) {
|
|
3379
|
+
if (tag !== 53) {
|
|
3338
3380
|
break;
|
|
3339
3381
|
}
|
|
3340
|
-
message.
|
|
3382
|
+
message.ymax = reader.float();
|
|
3341
3383
|
continue;
|
|
3342
3384
|
}
|
|
3343
3385
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -3349,84 +3391,51 @@ const Specs = {
|
|
|
3349
3391
|
},
|
|
3350
3392
|
fromJSON(object) {
|
|
3351
3393
|
return {
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
p2Offset: isSet$4(object.p2Offset) ? globalThis.Number(object.p2Offset) : 0,
|
|
3359
|
-
p3Offset: isSet$4(object.p3Offset) ? globalThis.Number(object.p3Offset) : 0
|
|
3394
|
+
label: isSet$3(object.label) ? globalThis.Number(object.label) : 0,
|
|
3395
|
+
confidence: isSet$3(object.confidence) ? globalThis.Number(object.confidence) : 0,
|
|
3396
|
+
xmin: isSet$3(object.xmin) ? globalThis.Number(object.xmin) : 0,
|
|
3397
|
+
ymin: isSet$3(object.ymin) ? globalThis.Number(object.ymin) : 0,
|
|
3398
|
+
xmax: isSet$3(object.xmax) ? globalThis.Number(object.xmax) : 0,
|
|
3399
|
+
ymax: isSet$3(object.ymax) ? globalThis.Number(object.ymax) : 0
|
|
3360
3400
|
};
|
|
3361
3401
|
},
|
|
3362
3402
|
toJSON(message) {
|
|
3363
3403
|
const obj = {};
|
|
3364
|
-
if (message.
|
|
3365
|
-
obj.
|
|
3366
|
-
}
|
|
3367
|
-
if (message.width !== 0) {
|
|
3368
|
-
obj.width = Math.round(message.width);
|
|
3369
|
-
}
|
|
3370
|
-
if (message.height !== 0) {
|
|
3371
|
-
obj.height = Math.round(message.height);
|
|
3404
|
+
if (message.label !== 0) {
|
|
3405
|
+
obj.label = Math.round(message.label);
|
|
3372
3406
|
}
|
|
3373
|
-
if (message.
|
|
3374
|
-
obj.
|
|
3407
|
+
if (message.confidence !== 0) {
|
|
3408
|
+
obj.confidence = message.confidence;
|
|
3375
3409
|
}
|
|
3376
|
-
if (message.
|
|
3377
|
-
obj.
|
|
3410
|
+
if (message.xmin !== 0) {
|
|
3411
|
+
obj.xmin = message.xmin;
|
|
3378
3412
|
}
|
|
3379
|
-
if (message.
|
|
3380
|
-
obj.
|
|
3413
|
+
if (message.ymin !== 0) {
|
|
3414
|
+
obj.ymin = message.ymin;
|
|
3381
3415
|
}
|
|
3382
|
-
if (message.
|
|
3383
|
-
obj.
|
|
3416
|
+
if (message.xmax !== 0) {
|
|
3417
|
+
obj.xmax = message.xmax;
|
|
3384
3418
|
}
|
|
3385
|
-
if (message.
|
|
3386
|
-
obj.
|
|
3419
|
+
if (message.ymax !== 0) {
|
|
3420
|
+
obj.ymax = message.ymax;
|
|
3387
3421
|
}
|
|
3388
3422
|
return obj;
|
|
3389
3423
|
},
|
|
3390
3424
|
create(base) {
|
|
3391
|
-
return
|
|
3425
|
+
return ImgDetection.fromPartial(base ?? {});
|
|
3392
3426
|
},
|
|
3393
3427
|
fromPartial(object) {
|
|
3394
|
-
const message =
|
|
3395
|
-
message.
|
|
3396
|
-
message.
|
|
3397
|
-
message.
|
|
3398
|
-
message.
|
|
3399
|
-
message.
|
|
3400
|
-
message.
|
|
3401
|
-
message.p2Offset = object.p2Offset ?? 0;
|
|
3402
|
-
message.p3Offset = object.p3Offset ?? 0;
|
|
3428
|
+
const message = createBaseImgDetection();
|
|
3429
|
+
message.label = object.label ?? 0;
|
|
3430
|
+
message.confidence = object.confidence ?? 0;
|
|
3431
|
+
message.xmin = object.xmin ?? 0;
|
|
3432
|
+
message.ymin = object.ymin ?? 0;
|
|
3433
|
+
message.xmax = object.xmax ?? 0;
|
|
3434
|
+
message.ymax = object.ymax ?? 0;
|
|
3403
3435
|
return message;
|
|
3404
3436
|
}
|
|
3405
3437
|
};
|
|
3406
|
-
function
|
|
3407
|
-
if (globalThis.Buffer) {
|
|
3408
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
3409
|
-
} else {
|
|
3410
|
-
const bin = globalThis.atob(b64);
|
|
3411
|
-
const arr = new Uint8Array(bin.length);
|
|
3412
|
-
for (let i = 0; i < bin.length; ++i) {
|
|
3413
|
-
arr[i] = bin.charCodeAt(i);
|
|
3414
|
-
}
|
|
3415
|
-
return arr;
|
|
3416
|
-
}
|
|
3417
|
-
}
|
|
3418
|
-
function base64FromBytes$2(arr) {
|
|
3419
|
-
if (globalThis.Buffer) {
|
|
3420
|
-
return globalThis.Buffer.from(arr).toString("base64");
|
|
3421
|
-
} else {
|
|
3422
|
-
const bin = [];
|
|
3423
|
-
arr.forEach(byte => {
|
|
3424
|
-
bin.push(globalThis.String.fromCharCode(byte));
|
|
3425
|
-
});
|
|
3426
|
-
return globalThis.btoa(bin.join(""));
|
|
3427
|
-
}
|
|
3428
|
-
}
|
|
3429
|
-
function longToNumber$4(long) {
|
|
3438
|
+
function longToNumber$3(long) {
|
|
3430
3439
|
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
|
3431
3440
|
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
3432
3441
|
}
|
|
@@ -3439,174 +3448,297 @@ if (_m0.util.Long !== Long) {
|
|
|
3439
3448
|
_m0.util.Long = Long;
|
|
3440
3449
|
_m0.configure();
|
|
3441
3450
|
}
|
|
3442
|
-
function isSet$
|
|
3451
|
+
function isSet$3(value) {
|
|
3443
3452
|
return value !== null && value !== undefined;
|
|
3444
3453
|
}
|
|
3445
|
-
const protobufName$
|
|
3454
|
+
const protobufName$3 = "ImgDetections";
|
|
3446
3455
|
|
|
3447
3456
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3448
3457
|
// versions:
|
|
3449
3458
|
// protoc-gen-ts_proto v1.181.1
|
|
3450
3459
|
// protoc v4.25.1
|
|
3451
|
-
// source:
|
|
3460
|
+
// source: ImgFrame.proto
|
|
3452
3461
|
|
|
3453
|
-
const protobufPackage$
|
|
3454
|
-
let
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
let FrameType = /*#__PURE__*/function (FrameType) {
|
|
3492
|
-
FrameType[FrameType["I"] = 0] = "I";
|
|
3493
|
-
FrameType[FrameType["P"] = 1] = "P";
|
|
3494
|
-
FrameType[FrameType["B"] = 2] = "B";
|
|
3495
|
-
FrameType[FrameType["UNKNOWN"] = 3] = "UNKNOWN";
|
|
3496
|
-
FrameType[FrameType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
3497
|
-
return FrameType;
|
|
3462
|
+
const protobufPackage$2 = "dai.proto.img_frame";
|
|
3463
|
+
let Type = /*#__PURE__*/function (Type) {
|
|
3464
|
+
Type[Type["YUV422i"] = 0] = "YUV422i";
|
|
3465
|
+
Type[Type["YUV444p"] = 1] = "YUV444p";
|
|
3466
|
+
Type[Type["YUV420p"] = 2] = "YUV420p";
|
|
3467
|
+
Type[Type["YUV422p"] = 3] = "YUV422p";
|
|
3468
|
+
Type[Type["YUV400p"] = 4] = "YUV400p";
|
|
3469
|
+
Type[Type["RGBA8888"] = 5] = "RGBA8888";
|
|
3470
|
+
Type[Type["RGB161616"] = 6] = "RGB161616";
|
|
3471
|
+
Type[Type["RGB888p"] = 7] = "RGB888p";
|
|
3472
|
+
Type[Type["BGR888p"] = 8] = "BGR888p";
|
|
3473
|
+
Type[Type["RGB888i"] = 9] = "RGB888i";
|
|
3474
|
+
Type[Type["BGR888i"] = 10] = "BGR888i";
|
|
3475
|
+
Type[Type["LUT2"] = 11] = "LUT2";
|
|
3476
|
+
Type[Type["LUT4"] = 12] = "LUT4";
|
|
3477
|
+
Type[Type["LUT16"] = 13] = "LUT16";
|
|
3478
|
+
Type[Type["RAW16"] = 14] = "RAW16";
|
|
3479
|
+
Type[Type["RAW14"] = 15] = "RAW14";
|
|
3480
|
+
Type[Type["RAW12"] = 16] = "RAW12";
|
|
3481
|
+
Type[Type["RAW10"] = 17] = "RAW10";
|
|
3482
|
+
Type[Type["RAW8"] = 18] = "RAW8";
|
|
3483
|
+
Type[Type["PACK10"] = 19] = "PACK10";
|
|
3484
|
+
Type[Type["PACK12"] = 20] = "PACK12";
|
|
3485
|
+
Type[Type["YUV444i"] = 21] = "YUV444i";
|
|
3486
|
+
Type[Type["NV12"] = 22] = "NV12";
|
|
3487
|
+
Type[Type["NV21"] = 23] = "NV21";
|
|
3488
|
+
Type[Type["BITSTREAM"] = 24] = "BITSTREAM";
|
|
3489
|
+
Type[Type["HDR"] = 25] = "HDR";
|
|
3490
|
+
Type[Type["RGBF16F16F16p"] = 26] = "RGBF16F16F16p";
|
|
3491
|
+
Type[Type["BGRF16F16F16p"] = 27] = "BGRF16F16F16p";
|
|
3492
|
+
Type[Type["RGBF16F16F16i"] = 28] = "RGBF16F16F16i";
|
|
3493
|
+
Type[Type["BGRF16F16F16i"] = 29] = "BGRF16F16F16i";
|
|
3494
|
+
Type[Type["GRAY8"] = 30] = "GRAY8";
|
|
3495
|
+
Type[Type["GRAYF16"] = 31] = "GRAYF16";
|
|
3496
|
+
Type[Type["RAW32"] = 32] = "RAW32";
|
|
3497
|
+
Type[Type["NONE"] = 33] = "NONE";
|
|
3498
|
+
Type[Type["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
3499
|
+
return Type;
|
|
3498
3500
|
}({});
|
|
3499
|
-
function
|
|
3501
|
+
function typeFromJSON(object) {
|
|
3500
3502
|
switch (object) {
|
|
3501
3503
|
case 0:
|
|
3502
|
-
case "
|
|
3503
|
-
return
|
|
3504
|
+
case "YUV422i":
|
|
3505
|
+
return Type.YUV422i;
|
|
3504
3506
|
case 1:
|
|
3505
|
-
case "
|
|
3506
|
-
return
|
|
3507
|
+
case "YUV444p":
|
|
3508
|
+
return Type.YUV444p;
|
|
3507
3509
|
case 2:
|
|
3508
|
-
case "
|
|
3509
|
-
return
|
|
3510
|
+
case "YUV420p":
|
|
3511
|
+
return Type.YUV420p;
|
|
3510
3512
|
case 3:
|
|
3511
|
-
case "
|
|
3512
|
-
return
|
|
3513
|
+
case "YUV422p":
|
|
3514
|
+
return Type.YUV422p;
|
|
3515
|
+
case 4:
|
|
3516
|
+
case "YUV400p":
|
|
3517
|
+
return Type.YUV400p;
|
|
3518
|
+
case 5:
|
|
3519
|
+
case "RGBA8888":
|
|
3520
|
+
return Type.RGBA8888;
|
|
3521
|
+
case 6:
|
|
3522
|
+
case "RGB161616":
|
|
3523
|
+
return Type.RGB161616;
|
|
3524
|
+
case 7:
|
|
3525
|
+
case "RGB888p":
|
|
3526
|
+
return Type.RGB888p;
|
|
3527
|
+
case 8:
|
|
3528
|
+
case "BGR888p":
|
|
3529
|
+
return Type.BGR888p;
|
|
3530
|
+
case 9:
|
|
3531
|
+
case "RGB888i":
|
|
3532
|
+
return Type.RGB888i;
|
|
3533
|
+
case 10:
|
|
3534
|
+
case "BGR888i":
|
|
3535
|
+
return Type.BGR888i;
|
|
3536
|
+
case 11:
|
|
3537
|
+
case "LUT2":
|
|
3538
|
+
return Type.LUT2;
|
|
3539
|
+
case 12:
|
|
3540
|
+
case "LUT4":
|
|
3541
|
+
return Type.LUT4;
|
|
3542
|
+
case 13:
|
|
3543
|
+
case "LUT16":
|
|
3544
|
+
return Type.LUT16;
|
|
3545
|
+
case 14:
|
|
3546
|
+
case "RAW16":
|
|
3547
|
+
return Type.RAW16;
|
|
3548
|
+
case 15:
|
|
3549
|
+
case "RAW14":
|
|
3550
|
+
return Type.RAW14;
|
|
3551
|
+
case 16:
|
|
3552
|
+
case "RAW12":
|
|
3553
|
+
return Type.RAW12;
|
|
3554
|
+
case 17:
|
|
3555
|
+
case "RAW10":
|
|
3556
|
+
return Type.RAW10;
|
|
3557
|
+
case 18:
|
|
3558
|
+
case "RAW8":
|
|
3559
|
+
return Type.RAW8;
|
|
3560
|
+
case 19:
|
|
3561
|
+
case "PACK10":
|
|
3562
|
+
return Type.PACK10;
|
|
3563
|
+
case 20:
|
|
3564
|
+
case "PACK12":
|
|
3565
|
+
return Type.PACK12;
|
|
3566
|
+
case 21:
|
|
3567
|
+
case "YUV444i":
|
|
3568
|
+
return Type.YUV444i;
|
|
3569
|
+
case 22:
|
|
3570
|
+
case "NV12":
|
|
3571
|
+
return Type.NV12;
|
|
3572
|
+
case 23:
|
|
3573
|
+
case "NV21":
|
|
3574
|
+
return Type.NV21;
|
|
3575
|
+
case 24:
|
|
3576
|
+
case "BITSTREAM":
|
|
3577
|
+
return Type.BITSTREAM;
|
|
3578
|
+
case 25:
|
|
3579
|
+
case "HDR":
|
|
3580
|
+
return Type.HDR;
|
|
3581
|
+
case 26:
|
|
3582
|
+
case "RGBF16F16F16p":
|
|
3583
|
+
return Type.RGBF16F16F16p;
|
|
3584
|
+
case 27:
|
|
3585
|
+
case "BGRF16F16F16p":
|
|
3586
|
+
return Type.BGRF16F16F16p;
|
|
3587
|
+
case 28:
|
|
3588
|
+
case "RGBF16F16F16i":
|
|
3589
|
+
return Type.RGBF16F16F16i;
|
|
3590
|
+
case 29:
|
|
3591
|
+
case "BGRF16F16F16i":
|
|
3592
|
+
return Type.BGRF16F16F16i;
|
|
3593
|
+
case 30:
|
|
3594
|
+
case "GRAY8":
|
|
3595
|
+
return Type.GRAY8;
|
|
3596
|
+
case 31:
|
|
3597
|
+
case "GRAYF16":
|
|
3598
|
+
return Type.GRAYF16;
|
|
3599
|
+
case 32:
|
|
3600
|
+
case "RAW32":
|
|
3601
|
+
return Type.RAW32;
|
|
3602
|
+
case 33:
|
|
3603
|
+
case "NONE":
|
|
3604
|
+
return Type.NONE;
|
|
3513
3605
|
case -1:
|
|
3514
3606
|
case "UNRECOGNIZED":
|
|
3515
3607
|
default:
|
|
3516
|
-
return
|
|
3608
|
+
return Type.UNRECOGNIZED;
|
|
3517
3609
|
}
|
|
3518
3610
|
}
|
|
3519
|
-
function
|
|
3611
|
+
function typeToJSON(object) {
|
|
3520
3612
|
switch (object) {
|
|
3521
|
-
case
|
|
3522
|
-
return "
|
|
3523
|
-
case
|
|
3524
|
-
return "
|
|
3525
|
-
case
|
|
3526
|
-
return "
|
|
3527
|
-
case
|
|
3528
|
-
return "
|
|
3529
|
-
case
|
|
3613
|
+
case Type.YUV422i:
|
|
3614
|
+
return "YUV422i";
|
|
3615
|
+
case Type.YUV444p:
|
|
3616
|
+
return "YUV444p";
|
|
3617
|
+
case Type.YUV420p:
|
|
3618
|
+
return "YUV420p";
|
|
3619
|
+
case Type.YUV422p:
|
|
3620
|
+
return "YUV422p";
|
|
3621
|
+
case Type.YUV400p:
|
|
3622
|
+
return "YUV400p";
|
|
3623
|
+
case Type.RGBA8888:
|
|
3624
|
+
return "RGBA8888";
|
|
3625
|
+
case Type.RGB161616:
|
|
3626
|
+
return "RGB161616";
|
|
3627
|
+
case Type.RGB888p:
|
|
3628
|
+
return "RGB888p";
|
|
3629
|
+
case Type.BGR888p:
|
|
3630
|
+
return "BGR888p";
|
|
3631
|
+
case Type.RGB888i:
|
|
3632
|
+
return "RGB888i";
|
|
3633
|
+
case Type.BGR888i:
|
|
3634
|
+
return "BGR888i";
|
|
3635
|
+
case Type.LUT2:
|
|
3636
|
+
return "LUT2";
|
|
3637
|
+
case Type.LUT4:
|
|
3638
|
+
return "LUT4";
|
|
3639
|
+
case Type.LUT16:
|
|
3640
|
+
return "LUT16";
|
|
3641
|
+
case Type.RAW16:
|
|
3642
|
+
return "RAW16";
|
|
3643
|
+
case Type.RAW14:
|
|
3644
|
+
return "RAW14";
|
|
3645
|
+
case Type.RAW12:
|
|
3646
|
+
return "RAW12";
|
|
3647
|
+
case Type.RAW10:
|
|
3648
|
+
return "RAW10";
|
|
3649
|
+
case Type.RAW8:
|
|
3650
|
+
return "RAW8";
|
|
3651
|
+
case Type.PACK10:
|
|
3652
|
+
return "PACK10";
|
|
3653
|
+
case Type.PACK12:
|
|
3654
|
+
return "PACK12";
|
|
3655
|
+
case Type.YUV444i:
|
|
3656
|
+
return "YUV444i";
|
|
3657
|
+
case Type.NV12:
|
|
3658
|
+
return "NV12";
|
|
3659
|
+
case Type.NV21:
|
|
3660
|
+
return "NV21";
|
|
3661
|
+
case Type.BITSTREAM:
|
|
3662
|
+
return "BITSTREAM";
|
|
3663
|
+
case Type.HDR:
|
|
3664
|
+
return "HDR";
|
|
3665
|
+
case Type.RGBF16F16F16p:
|
|
3666
|
+
return "RGBF16F16F16p";
|
|
3667
|
+
case Type.BGRF16F16F16p:
|
|
3668
|
+
return "BGRF16F16F16p";
|
|
3669
|
+
case Type.RGBF16F16F16i:
|
|
3670
|
+
return "RGBF16F16F16i";
|
|
3671
|
+
case Type.BGRF16F16F16i:
|
|
3672
|
+
return "BGRF16F16F16i";
|
|
3673
|
+
case Type.GRAY8:
|
|
3674
|
+
return "GRAY8";
|
|
3675
|
+
case Type.GRAYF16:
|
|
3676
|
+
return "GRAYF16";
|
|
3677
|
+
case Type.RAW32:
|
|
3678
|
+
return "RAW32";
|
|
3679
|
+
case Type.NONE:
|
|
3680
|
+
return "NONE";
|
|
3681
|
+
case Type.UNRECOGNIZED:
|
|
3530
3682
|
default:
|
|
3531
3683
|
return "UNRECOGNIZED";
|
|
3532
3684
|
}
|
|
3533
3685
|
}
|
|
3534
|
-
function
|
|
3686
|
+
function createBaseImgFrame() {
|
|
3535
3687
|
return {
|
|
3536
|
-
cam: undefined,
|
|
3537
|
-
instanceNum: 0,
|
|
3538
|
-
width: 0,
|
|
3539
|
-
height: 0,
|
|
3540
|
-
quality: 0,
|
|
3541
|
-
bitrate: 0,
|
|
3542
|
-
profile: 0,
|
|
3543
|
-
lossless: false,
|
|
3544
|
-
type: 0,
|
|
3545
|
-
frameOffset: 0,
|
|
3546
|
-
frameSize: 0,
|
|
3547
|
-
sequenceNum: 0,
|
|
3548
3688
|
ts: undefined,
|
|
3549
3689
|
tsDevice: undefined,
|
|
3690
|
+
sequenceNum: 0,
|
|
3691
|
+
fb: undefined,
|
|
3692
|
+
sourceFb: undefined,
|
|
3693
|
+
cam: undefined,
|
|
3694
|
+
HFovDegrees: 0,
|
|
3695
|
+
instanceNum: 0,
|
|
3550
3696
|
transformation: undefined,
|
|
3697
|
+
category: 0,
|
|
3551
3698
|
data: new Uint8Array(0)
|
|
3552
3699
|
};
|
|
3553
3700
|
}
|
|
3554
|
-
const
|
|
3701
|
+
const ImgFrame = {
|
|
3555
3702
|
encode(message, writer = _m0.Writer.create()) {
|
|
3556
|
-
if (message.
|
|
3557
|
-
|
|
3558
|
-
}
|
|
3559
|
-
if (message.instanceNum !== 0) {
|
|
3560
|
-
writer.uint32(16).uint32(message.instanceNum);
|
|
3561
|
-
}
|
|
3562
|
-
if (message.width !== 0) {
|
|
3563
|
-
writer.uint32(24).uint32(message.width);
|
|
3564
|
-
}
|
|
3565
|
-
if (message.height !== 0) {
|
|
3566
|
-
writer.uint32(32).uint32(message.height);
|
|
3567
|
-
}
|
|
3568
|
-
if (message.quality !== 0) {
|
|
3569
|
-
writer.uint32(40).uint32(message.quality);
|
|
3570
|
-
}
|
|
3571
|
-
if (message.bitrate !== 0) {
|
|
3572
|
-
writer.uint32(48).uint32(message.bitrate);
|
|
3573
|
-
}
|
|
3574
|
-
if (message.profile !== 0) {
|
|
3575
|
-
writer.uint32(56).int32(message.profile);
|
|
3703
|
+
if (message.ts !== undefined) {
|
|
3704
|
+
Timestamp.encode(message.ts, writer.uint32(10).fork()).ldelim();
|
|
3576
3705
|
}
|
|
3577
|
-
if (message.
|
|
3578
|
-
writer.uint32(
|
|
3706
|
+
if (message.tsDevice !== undefined) {
|
|
3707
|
+
Timestamp.encode(message.tsDevice, writer.uint32(18).fork()).ldelim();
|
|
3579
3708
|
}
|
|
3580
|
-
if (message.
|
|
3581
|
-
writer.uint32(
|
|
3709
|
+
if (message.sequenceNum !== 0) {
|
|
3710
|
+
writer.uint32(24).int64(message.sequenceNum);
|
|
3582
3711
|
}
|
|
3583
|
-
if (message.
|
|
3584
|
-
writer.uint32(
|
|
3712
|
+
if (message.fb !== undefined) {
|
|
3713
|
+
Specs.encode(message.fb, writer.uint32(34).fork()).ldelim();
|
|
3585
3714
|
}
|
|
3586
|
-
if (message.
|
|
3587
|
-
writer.uint32(
|
|
3715
|
+
if (message.sourceFb !== undefined) {
|
|
3716
|
+
Specs.encode(message.sourceFb, writer.uint32(42).fork()).ldelim();
|
|
3588
3717
|
}
|
|
3589
|
-
if (message.
|
|
3590
|
-
writer.uint32(
|
|
3718
|
+
if (message.cam !== undefined) {
|
|
3719
|
+
CameraSettings.encode(message.cam, writer.uint32(50).fork()).ldelim();
|
|
3591
3720
|
}
|
|
3592
|
-
if (message.
|
|
3593
|
-
|
|
3721
|
+
if (message.HFovDegrees !== 0) {
|
|
3722
|
+
writer.uint32(61).float(message.HFovDegrees);
|
|
3594
3723
|
}
|
|
3595
|
-
if (message.
|
|
3596
|
-
|
|
3724
|
+
if (message.instanceNum !== 0) {
|
|
3725
|
+
writer.uint32(64).uint32(message.instanceNum);
|
|
3597
3726
|
}
|
|
3598
3727
|
if (message.transformation !== undefined) {
|
|
3599
|
-
ImgTransformation.encode(message.transformation, writer.uint32(
|
|
3728
|
+
ImgTransformation.encode(message.transformation, writer.uint32(74).fork()).ldelim();
|
|
3729
|
+
}
|
|
3730
|
+
if (message.category !== 0) {
|
|
3731
|
+
writer.uint32(80).uint32(message.category);
|
|
3600
3732
|
}
|
|
3601
3733
|
if (message.data.length !== 0) {
|
|
3602
|
-
writer.uint32(
|
|
3734
|
+
writer.uint32(90).bytes(message.data);
|
|
3603
3735
|
}
|
|
3604
3736
|
return writer;
|
|
3605
3737
|
},
|
|
3606
3738
|
decode(input, length) {
|
|
3607
3739
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
3608
3740
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3609
|
-
const message =
|
|
3741
|
+
const message = createBaseImgFrame();
|
|
3610
3742
|
while (reader.pos < end) {
|
|
3611
3743
|
const tag = reader.uint32();
|
|
3612
3744
|
switch (tag >>> 3) {
|
|
@@ -3614,314 +3746,67 @@ const EncodedFrame = {
|
|
|
3614
3746
|
if (tag !== 10) {
|
|
3615
3747
|
break;
|
|
3616
3748
|
}
|
|
3617
|
-
message.
|
|
3749
|
+
message.ts = Timestamp.decode(reader, reader.uint32());
|
|
3618
3750
|
continue;
|
|
3619
3751
|
case 2:
|
|
3620
|
-
if (tag !==
|
|
3752
|
+
if (tag !== 18) {
|
|
3621
3753
|
break;
|
|
3622
3754
|
}
|
|
3623
|
-
message.
|
|
3755
|
+
message.tsDevice = Timestamp.decode(reader, reader.uint32());
|
|
3624
3756
|
continue;
|
|
3625
3757
|
case 3:
|
|
3626
3758
|
if (tag !== 24) {
|
|
3627
3759
|
break;
|
|
3628
3760
|
}
|
|
3629
|
-
message.
|
|
3761
|
+
message.sequenceNum = longToNumber$2(reader.int64());
|
|
3630
3762
|
continue;
|
|
3631
3763
|
case 4:
|
|
3632
|
-
if (tag !==
|
|
3764
|
+
if (tag !== 34) {
|
|
3633
3765
|
break;
|
|
3634
3766
|
}
|
|
3635
|
-
message.
|
|
3767
|
+
message.fb = Specs.decode(reader, reader.uint32());
|
|
3636
3768
|
continue;
|
|
3637
3769
|
case 5:
|
|
3638
|
-
if (tag !==
|
|
3770
|
+
if (tag !== 42) {
|
|
3639
3771
|
break;
|
|
3640
3772
|
}
|
|
3641
|
-
message.
|
|
3773
|
+
message.sourceFb = Specs.decode(reader, reader.uint32());
|
|
3642
3774
|
continue;
|
|
3643
3775
|
case 6:
|
|
3644
|
-
if (tag !==
|
|
3776
|
+
if (tag !== 50) {
|
|
3645
3777
|
break;
|
|
3646
3778
|
}
|
|
3647
|
-
message.
|
|
3779
|
+
message.cam = CameraSettings.decode(reader, reader.uint32());
|
|
3648
3780
|
continue;
|
|
3649
3781
|
case 7:
|
|
3650
|
-
if (tag !==
|
|
3651
|
-
break;
|
|
3652
|
-
}
|
|
3653
|
-
message.profile = reader.int32();
|
|
3654
|
-
continue;
|
|
3655
|
-
case 8:
|
|
3656
|
-
if (tag !== 64) {
|
|
3657
|
-
break;
|
|
3658
|
-
}
|
|
3659
|
-
message.lossless = reader.bool();
|
|
3660
|
-
continue;
|
|
3661
|
-
case 9:
|
|
3662
|
-
if (tag !== 72) {
|
|
3663
|
-
break;
|
|
3664
|
-
}
|
|
3665
|
-
message.type = reader.int32();
|
|
3666
|
-
continue;
|
|
3667
|
-
case 10:
|
|
3668
|
-
if (tag !== 80) {
|
|
3669
|
-
break;
|
|
3670
|
-
}
|
|
3671
|
-
message.frameOffset = reader.uint32();
|
|
3672
|
-
continue;
|
|
3673
|
-
case 11:
|
|
3674
|
-
if (tag !== 88) {
|
|
3675
|
-
break;
|
|
3676
|
-
}
|
|
3677
|
-
message.frameSize = reader.uint32();
|
|
3678
|
-
continue;
|
|
3679
|
-
case 12:
|
|
3680
|
-
if (tag !== 96) {
|
|
3681
|
-
break;
|
|
3682
|
-
}
|
|
3683
|
-
message.sequenceNum = longToNumber$3(reader.int64());
|
|
3684
|
-
continue;
|
|
3685
|
-
case 13:
|
|
3686
|
-
if (tag !== 106) {
|
|
3687
|
-
break;
|
|
3688
|
-
}
|
|
3689
|
-
message.ts = Timestamp.decode(reader, reader.uint32());
|
|
3690
|
-
continue;
|
|
3691
|
-
case 14:
|
|
3692
|
-
if (tag !== 114) {
|
|
3693
|
-
break;
|
|
3694
|
-
}
|
|
3695
|
-
message.tsDevice = Timestamp.decode(reader, reader.uint32());
|
|
3696
|
-
continue;
|
|
3697
|
-
case 15:
|
|
3698
|
-
if (tag !== 122) {
|
|
3699
|
-
break;
|
|
3700
|
-
}
|
|
3701
|
-
message.transformation = ImgTransformation.decode(reader, reader.uint32());
|
|
3702
|
-
continue;
|
|
3703
|
-
case 16:
|
|
3704
|
-
if (tag !== 130) {
|
|
3705
|
-
break;
|
|
3706
|
-
}
|
|
3707
|
-
message.data = reader.bytes();
|
|
3708
|
-
continue;
|
|
3709
|
-
}
|
|
3710
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
3711
|
-
break;
|
|
3712
|
-
}
|
|
3713
|
-
reader.skipType(tag & 7);
|
|
3714
|
-
}
|
|
3715
|
-
return message;
|
|
3716
|
-
},
|
|
3717
|
-
fromJSON(object) {
|
|
3718
|
-
return {
|
|
3719
|
-
cam: isSet$3(object.cam) ? CameraSettings.fromJSON(object.cam) : undefined,
|
|
3720
|
-
instanceNum: isSet$3(object.instanceNum) ? globalThis.Number(object.instanceNum) : 0,
|
|
3721
|
-
width: isSet$3(object.width) ? globalThis.Number(object.width) : 0,
|
|
3722
|
-
height: isSet$3(object.height) ? globalThis.Number(object.height) : 0,
|
|
3723
|
-
quality: isSet$3(object.quality) ? globalThis.Number(object.quality) : 0,
|
|
3724
|
-
bitrate: isSet$3(object.bitrate) ? globalThis.Number(object.bitrate) : 0,
|
|
3725
|
-
profile: isSet$3(object.profile) ? profileFromJSON(object.profile) : 0,
|
|
3726
|
-
lossless: isSet$3(object.lossless) ? globalThis.Boolean(object.lossless) : false,
|
|
3727
|
-
type: isSet$3(object.type) ? frameTypeFromJSON(object.type) : 0,
|
|
3728
|
-
frameOffset: isSet$3(object.frameOffset) ? globalThis.Number(object.frameOffset) : 0,
|
|
3729
|
-
frameSize: isSet$3(object.frameSize) ? globalThis.Number(object.frameSize) : 0,
|
|
3730
|
-
sequenceNum: isSet$3(object.sequenceNum) ? globalThis.Number(object.sequenceNum) : 0,
|
|
3731
|
-
ts: isSet$3(object.ts) ? Timestamp.fromJSON(object.ts) : undefined,
|
|
3732
|
-
tsDevice: isSet$3(object.tsDevice) ? Timestamp.fromJSON(object.tsDevice) : undefined,
|
|
3733
|
-
transformation: isSet$3(object.transformation) ? ImgTransformation.fromJSON(object.transformation) : undefined,
|
|
3734
|
-
data: isSet$3(object.data) ? bytesFromBase64$1(object.data) : new Uint8Array(0)
|
|
3735
|
-
};
|
|
3736
|
-
},
|
|
3737
|
-
toJSON(message) {
|
|
3738
|
-
const obj = {};
|
|
3739
|
-
if (message.cam !== undefined) {
|
|
3740
|
-
obj.cam = CameraSettings.toJSON(message.cam);
|
|
3741
|
-
}
|
|
3742
|
-
if (message.instanceNum !== 0) {
|
|
3743
|
-
obj.instanceNum = Math.round(message.instanceNum);
|
|
3744
|
-
}
|
|
3745
|
-
if (message.width !== 0) {
|
|
3746
|
-
obj.width = Math.round(message.width);
|
|
3747
|
-
}
|
|
3748
|
-
if (message.height !== 0) {
|
|
3749
|
-
obj.height = Math.round(message.height);
|
|
3750
|
-
}
|
|
3751
|
-
if (message.quality !== 0) {
|
|
3752
|
-
obj.quality = Math.round(message.quality);
|
|
3753
|
-
}
|
|
3754
|
-
if (message.bitrate !== 0) {
|
|
3755
|
-
obj.bitrate = Math.round(message.bitrate);
|
|
3756
|
-
}
|
|
3757
|
-
if (message.profile !== 0) {
|
|
3758
|
-
obj.profile = profileToJSON(message.profile);
|
|
3759
|
-
}
|
|
3760
|
-
if (message.lossless !== false) {
|
|
3761
|
-
obj.lossless = message.lossless;
|
|
3762
|
-
}
|
|
3763
|
-
if (message.type !== 0) {
|
|
3764
|
-
obj.type = frameTypeToJSON(message.type);
|
|
3765
|
-
}
|
|
3766
|
-
if (message.frameOffset !== 0) {
|
|
3767
|
-
obj.frameOffset = Math.round(message.frameOffset);
|
|
3768
|
-
}
|
|
3769
|
-
if (message.frameSize !== 0) {
|
|
3770
|
-
obj.frameSize = Math.round(message.frameSize);
|
|
3771
|
-
}
|
|
3772
|
-
if (message.sequenceNum !== 0) {
|
|
3773
|
-
obj.sequenceNum = Math.round(message.sequenceNum);
|
|
3774
|
-
}
|
|
3775
|
-
if (message.ts !== undefined) {
|
|
3776
|
-
obj.ts = Timestamp.toJSON(message.ts);
|
|
3777
|
-
}
|
|
3778
|
-
if (message.tsDevice !== undefined) {
|
|
3779
|
-
obj.tsDevice = Timestamp.toJSON(message.tsDevice);
|
|
3780
|
-
}
|
|
3781
|
-
if (message.transformation !== undefined) {
|
|
3782
|
-
obj.transformation = ImgTransformation.toJSON(message.transformation);
|
|
3783
|
-
}
|
|
3784
|
-
if (message.data.length !== 0) {
|
|
3785
|
-
obj.data = base64FromBytes$1(message.data);
|
|
3786
|
-
}
|
|
3787
|
-
return obj;
|
|
3788
|
-
},
|
|
3789
|
-
create(base) {
|
|
3790
|
-
return EncodedFrame.fromPartial(base ?? {});
|
|
3791
|
-
},
|
|
3792
|
-
fromPartial(object) {
|
|
3793
|
-
const message = createBaseEncodedFrame();
|
|
3794
|
-
message.cam = object.cam !== undefined && object.cam !== null ? CameraSettings.fromPartial(object.cam) : undefined;
|
|
3795
|
-
message.instanceNum = object.instanceNum ?? 0;
|
|
3796
|
-
message.width = object.width ?? 0;
|
|
3797
|
-
message.height = object.height ?? 0;
|
|
3798
|
-
message.quality = object.quality ?? 0;
|
|
3799
|
-
message.bitrate = object.bitrate ?? 0;
|
|
3800
|
-
message.profile = object.profile ?? 0;
|
|
3801
|
-
message.lossless = object.lossless ?? false;
|
|
3802
|
-
message.type = object.type ?? 0;
|
|
3803
|
-
message.frameOffset = object.frameOffset ?? 0;
|
|
3804
|
-
message.frameSize = object.frameSize ?? 0;
|
|
3805
|
-
message.sequenceNum = object.sequenceNum ?? 0;
|
|
3806
|
-
message.ts = object.ts !== undefined && object.ts !== null ? Timestamp.fromPartial(object.ts) : undefined;
|
|
3807
|
-
message.tsDevice = object.tsDevice !== undefined && object.tsDevice !== null ? Timestamp.fromPartial(object.tsDevice) : undefined;
|
|
3808
|
-
message.transformation = object.transformation !== undefined && object.transformation !== null ? ImgTransformation.fromPartial(object.transformation) : undefined;
|
|
3809
|
-
message.data = object.data ?? new Uint8Array(0);
|
|
3810
|
-
return message;
|
|
3811
|
-
}
|
|
3812
|
-
};
|
|
3813
|
-
function bytesFromBase64$1(b64) {
|
|
3814
|
-
if (globalThis.Buffer) {
|
|
3815
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
3816
|
-
} else {
|
|
3817
|
-
const bin = globalThis.atob(b64);
|
|
3818
|
-
const arr = new Uint8Array(bin.length);
|
|
3819
|
-
for (let i = 0; i < bin.length; ++i) {
|
|
3820
|
-
arr[i] = bin.charCodeAt(i);
|
|
3821
|
-
}
|
|
3822
|
-
return arr;
|
|
3823
|
-
}
|
|
3824
|
-
}
|
|
3825
|
-
function base64FromBytes$1(arr) {
|
|
3826
|
-
if (globalThis.Buffer) {
|
|
3827
|
-
return globalThis.Buffer.from(arr).toString("base64");
|
|
3828
|
-
} else {
|
|
3829
|
-
const bin = [];
|
|
3830
|
-
arr.forEach(byte => {
|
|
3831
|
-
bin.push(globalThis.String.fromCharCode(byte));
|
|
3832
|
-
});
|
|
3833
|
-
return globalThis.btoa(bin.join(""));
|
|
3834
|
-
}
|
|
3835
|
-
}
|
|
3836
|
-
function longToNumber$3(long) {
|
|
3837
|
-
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
|
3838
|
-
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
3839
|
-
}
|
|
3840
|
-
if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
|
|
3841
|
-
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
3842
|
-
}
|
|
3843
|
-
return long.toNumber();
|
|
3844
|
-
}
|
|
3845
|
-
if (_m0.util.Long !== Long) {
|
|
3846
|
-
_m0.util.Long = Long;
|
|
3847
|
-
_m0.configure();
|
|
3848
|
-
}
|
|
3849
|
-
function isSet$3(value) {
|
|
3850
|
-
return value !== null && value !== undefined;
|
|
3851
|
-
}
|
|
3852
|
-
const protobufName$3 = "EncodedFrame";
|
|
3853
|
-
|
|
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
|
|
3859
|
-
|
|
3860
|
-
const protobufPackage$2 = "dai.proto.img_detections";
|
|
3861
|
-
function createBaseImgDetections() {
|
|
3862
|
-
return {
|
|
3863
|
-
sequenceNum: 0,
|
|
3864
|
-
ts: undefined,
|
|
3865
|
-
tsDevice: undefined,
|
|
3866
|
-
detections: [],
|
|
3867
|
-
transformation: undefined
|
|
3868
|
-
};
|
|
3869
|
-
}
|
|
3870
|
-
const ImgDetections = {
|
|
3871
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
3872
|
-
if (message.sequenceNum !== 0) {
|
|
3873
|
-
writer.uint32(8).int64(message.sequenceNum);
|
|
3874
|
-
}
|
|
3875
|
-
if (message.ts !== undefined) {
|
|
3876
|
-
Timestamp.encode(message.ts, writer.uint32(18).fork()).ldelim();
|
|
3877
|
-
}
|
|
3878
|
-
if (message.tsDevice !== undefined) {
|
|
3879
|
-
Timestamp.encode(message.tsDevice, writer.uint32(26).fork()).ldelim();
|
|
3880
|
-
}
|
|
3881
|
-
for (const v of message.detections) {
|
|
3882
|
-
ImgDetection.encode(v, writer.uint32(34).fork()).ldelim();
|
|
3883
|
-
}
|
|
3884
|
-
if (message.transformation !== undefined) {
|
|
3885
|
-
ImgTransformation.encode(message.transformation, writer.uint32(42).fork()).ldelim();
|
|
3886
|
-
}
|
|
3887
|
-
return writer;
|
|
3888
|
-
},
|
|
3889
|
-
decode(input, length) {
|
|
3890
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
3891
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
3892
|
-
const message = createBaseImgDetections();
|
|
3893
|
-
while (reader.pos < end) {
|
|
3894
|
-
const tag = reader.uint32();
|
|
3895
|
-
switch (tag >>> 3) {
|
|
3896
|
-
case 1:
|
|
3897
|
-
if (tag !== 8) {
|
|
3782
|
+
if (tag !== 61) {
|
|
3898
3783
|
break;
|
|
3899
3784
|
}
|
|
3900
|
-
message.
|
|
3785
|
+
message.HFovDegrees = reader.float();
|
|
3901
3786
|
continue;
|
|
3902
|
-
case
|
|
3903
|
-
if (tag !==
|
|
3787
|
+
case 8:
|
|
3788
|
+
if (tag !== 64) {
|
|
3904
3789
|
break;
|
|
3905
3790
|
}
|
|
3906
|
-
message.
|
|
3791
|
+
message.instanceNum = reader.uint32();
|
|
3907
3792
|
continue;
|
|
3908
|
-
case
|
|
3909
|
-
if (tag !==
|
|
3793
|
+
case 9:
|
|
3794
|
+
if (tag !== 74) {
|
|
3910
3795
|
break;
|
|
3911
3796
|
}
|
|
3912
|
-
message.
|
|
3797
|
+
message.transformation = ImgTransformation.decode(reader, reader.uint32());
|
|
3913
3798
|
continue;
|
|
3914
|
-
case
|
|
3915
|
-
if (tag !==
|
|
3799
|
+
case 10:
|
|
3800
|
+
if (tag !== 80) {
|
|
3916
3801
|
break;
|
|
3917
3802
|
}
|
|
3918
|
-
message.
|
|
3803
|
+
message.category = reader.uint32();
|
|
3919
3804
|
continue;
|
|
3920
|
-
case
|
|
3921
|
-
if (tag !==
|
|
3805
|
+
case 11:
|
|
3806
|
+
if (tag !== 90) {
|
|
3922
3807
|
break;
|
|
3923
3808
|
}
|
|
3924
|
-
message.
|
|
3809
|
+
message.data = reader.bytes();
|
|
3925
3810
|
continue;
|
|
3926
3811
|
}
|
|
3927
3812
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -3933,81 +3818,119 @@ const ImgDetections = {
|
|
|
3933
3818
|
},
|
|
3934
3819
|
fromJSON(object) {
|
|
3935
3820
|
return {
|
|
3936
|
-
sequenceNum: isSet$2(object.sequenceNum) ? globalThis.Number(object.sequenceNum) : 0,
|
|
3937
3821
|
ts: isSet$2(object.ts) ? Timestamp.fromJSON(object.ts) : undefined,
|
|
3938
3822
|
tsDevice: isSet$2(object.tsDevice) ? Timestamp.fromJSON(object.tsDevice) : undefined,
|
|
3939
|
-
|
|
3940
|
-
|
|
3823
|
+
sequenceNum: isSet$2(object.sequenceNum) ? globalThis.Number(object.sequenceNum) : 0,
|
|
3824
|
+
fb: isSet$2(object.fb) ? Specs.fromJSON(object.fb) : undefined,
|
|
3825
|
+
sourceFb: isSet$2(object.sourceFb) ? Specs.fromJSON(object.sourceFb) : undefined,
|
|
3826
|
+
cam: isSet$2(object.cam) ? CameraSettings.fromJSON(object.cam) : undefined,
|
|
3827
|
+
HFovDegrees: isSet$2(object.HFovDegrees) ? globalThis.Number(object.HFovDegrees) : 0,
|
|
3828
|
+
instanceNum: isSet$2(object.instanceNum) ? globalThis.Number(object.instanceNum) : 0,
|
|
3829
|
+
transformation: isSet$2(object.transformation) ? ImgTransformation.fromJSON(object.transformation) : undefined,
|
|
3830
|
+
category: isSet$2(object.category) ? globalThis.Number(object.category) : 0,
|
|
3831
|
+
data: isSet$2(object.data) ? bytesFromBase64$1(object.data) : new Uint8Array(0)
|
|
3941
3832
|
};
|
|
3942
3833
|
},
|
|
3943
3834
|
toJSON(message) {
|
|
3944
3835
|
const obj = {};
|
|
3945
|
-
if (message.sequenceNum !== 0) {
|
|
3946
|
-
obj.sequenceNum = Math.round(message.sequenceNum);
|
|
3947
|
-
}
|
|
3948
3836
|
if (message.ts !== undefined) {
|
|
3949
3837
|
obj.ts = Timestamp.toJSON(message.ts);
|
|
3950
3838
|
}
|
|
3951
3839
|
if (message.tsDevice !== undefined) {
|
|
3952
3840
|
obj.tsDevice = Timestamp.toJSON(message.tsDevice);
|
|
3953
3841
|
}
|
|
3954
|
-
if (message.
|
|
3955
|
-
obj.
|
|
3842
|
+
if (message.sequenceNum !== 0) {
|
|
3843
|
+
obj.sequenceNum = Math.round(message.sequenceNum);
|
|
3844
|
+
}
|
|
3845
|
+
if (message.fb !== undefined) {
|
|
3846
|
+
obj.fb = Specs.toJSON(message.fb);
|
|
3847
|
+
}
|
|
3848
|
+
if (message.sourceFb !== undefined) {
|
|
3849
|
+
obj.sourceFb = Specs.toJSON(message.sourceFb);
|
|
3850
|
+
}
|
|
3851
|
+
if (message.cam !== undefined) {
|
|
3852
|
+
obj.cam = CameraSettings.toJSON(message.cam);
|
|
3853
|
+
}
|
|
3854
|
+
if (message.HFovDegrees !== 0) {
|
|
3855
|
+
obj.HFovDegrees = message.HFovDegrees;
|
|
3856
|
+
}
|
|
3857
|
+
if (message.instanceNum !== 0) {
|
|
3858
|
+
obj.instanceNum = Math.round(message.instanceNum);
|
|
3956
3859
|
}
|
|
3957
3860
|
if (message.transformation !== undefined) {
|
|
3958
3861
|
obj.transformation = ImgTransformation.toJSON(message.transformation);
|
|
3959
3862
|
}
|
|
3863
|
+
if (message.category !== 0) {
|
|
3864
|
+
obj.category = Math.round(message.category);
|
|
3865
|
+
}
|
|
3866
|
+
if (message.data.length !== 0) {
|
|
3867
|
+
obj.data = base64FromBytes$1(message.data);
|
|
3868
|
+
}
|
|
3960
3869
|
return obj;
|
|
3961
3870
|
},
|
|
3962
3871
|
create(base) {
|
|
3963
|
-
return
|
|
3872
|
+
return ImgFrame.fromPartial(base ?? {});
|
|
3964
3873
|
},
|
|
3965
3874
|
fromPartial(object) {
|
|
3966
|
-
const message =
|
|
3967
|
-
message.sequenceNum = object.sequenceNum ?? 0;
|
|
3875
|
+
const message = createBaseImgFrame();
|
|
3968
3876
|
message.ts = object.ts !== undefined && object.ts !== null ? Timestamp.fromPartial(object.ts) : undefined;
|
|
3969
3877
|
message.tsDevice = object.tsDevice !== undefined && object.tsDevice !== null ? Timestamp.fromPartial(object.tsDevice) : undefined;
|
|
3970
|
-
message.
|
|
3878
|
+
message.sequenceNum = object.sequenceNum ?? 0;
|
|
3879
|
+
message.fb = object.fb !== undefined && object.fb !== null ? Specs.fromPartial(object.fb) : undefined;
|
|
3880
|
+
message.sourceFb = object.sourceFb !== undefined && object.sourceFb !== null ? Specs.fromPartial(object.sourceFb) : undefined;
|
|
3881
|
+
message.cam = object.cam !== undefined && object.cam !== null ? CameraSettings.fromPartial(object.cam) : undefined;
|
|
3882
|
+
message.HFovDegrees = object.HFovDegrees ?? 0;
|
|
3883
|
+
message.instanceNum = object.instanceNum ?? 0;
|
|
3971
3884
|
message.transformation = object.transformation !== undefined && object.transformation !== null ? ImgTransformation.fromPartial(object.transformation) : undefined;
|
|
3885
|
+
message.category = object.category ?? 0;
|
|
3886
|
+
message.data = object.data ?? new Uint8Array(0);
|
|
3972
3887
|
return message;
|
|
3973
3888
|
}
|
|
3974
3889
|
};
|
|
3975
|
-
function
|
|
3890
|
+
function createBaseSpecs() {
|
|
3976
3891
|
return {
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3892
|
+
type: 0,
|
|
3893
|
+
width: 0,
|
|
3894
|
+
height: 0,
|
|
3895
|
+
stride: 0,
|
|
3896
|
+
bytesPP: 0,
|
|
3897
|
+
p1Offset: 0,
|
|
3898
|
+
p2Offset: 0,
|
|
3899
|
+
p3Offset: 0
|
|
3983
3900
|
};
|
|
3984
3901
|
}
|
|
3985
|
-
const
|
|
3902
|
+
const Specs = {
|
|
3986
3903
|
encode(message, writer = _m0.Writer.create()) {
|
|
3987
|
-
if (message.
|
|
3988
|
-
writer.uint32(8).
|
|
3904
|
+
if (message.type !== 0) {
|
|
3905
|
+
writer.uint32(8).int32(message.type);
|
|
3989
3906
|
}
|
|
3990
|
-
if (message.
|
|
3991
|
-
writer.uint32(
|
|
3907
|
+
if (message.width !== 0) {
|
|
3908
|
+
writer.uint32(16).uint32(message.width);
|
|
3992
3909
|
}
|
|
3993
|
-
if (message.
|
|
3994
|
-
writer.uint32(
|
|
3910
|
+
if (message.height !== 0) {
|
|
3911
|
+
writer.uint32(24).uint32(message.height);
|
|
3995
3912
|
}
|
|
3996
|
-
if (message.
|
|
3997
|
-
writer.uint32(
|
|
3913
|
+
if (message.stride !== 0) {
|
|
3914
|
+
writer.uint32(32).uint32(message.stride);
|
|
3998
3915
|
}
|
|
3999
|
-
if (message.
|
|
4000
|
-
writer.uint32(
|
|
3916
|
+
if (message.bytesPP !== 0) {
|
|
3917
|
+
writer.uint32(40).uint32(message.bytesPP);
|
|
4001
3918
|
}
|
|
4002
|
-
if (message.
|
|
4003
|
-
writer.uint32(
|
|
3919
|
+
if (message.p1Offset !== 0) {
|
|
3920
|
+
writer.uint32(48).uint32(message.p1Offset);
|
|
3921
|
+
}
|
|
3922
|
+
if (message.p2Offset !== 0) {
|
|
3923
|
+
writer.uint32(56).uint32(message.p2Offset);
|
|
3924
|
+
}
|
|
3925
|
+
if (message.p3Offset !== 0) {
|
|
3926
|
+
writer.uint32(64).uint32(message.p3Offset);
|
|
4004
3927
|
}
|
|
4005
3928
|
return writer;
|
|
4006
3929
|
},
|
|
4007
3930
|
decode(input, length) {
|
|
4008
3931
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
4009
3932
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
4010
|
-
const message =
|
|
3933
|
+
const message = createBaseSpecs();
|
|
4011
3934
|
while (reader.pos < end) {
|
|
4012
3935
|
const tag = reader.uint32();
|
|
4013
3936
|
switch (tag >>> 3) {
|
|
@@ -4015,37 +3938,49 @@ const ImgDetection = {
|
|
|
4015
3938
|
if (tag !== 8) {
|
|
4016
3939
|
break;
|
|
4017
3940
|
}
|
|
4018
|
-
message.
|
|
3941
|
+
message.type = reader.int32();
|
|
4019
3942
|
continue;
|
|
4020
3943
|
case 2:
|
|
4021
|
-
if (tag !==
|
|
3944
|
+
if (tag !== 16) {
|
|
4022
3945
|
break;
|
|
4023
3946
|
}
|
|
4024
|
-
message.
|
|
3947
|
+
message.width = reader.uint32();
|
|
4025
3948
|
continue;
|
|
4026
3949
|
case 3:
|
|
4027
|
-
if (tag !==
|
|
3950
|
+
if (tag !== 24) {
|
|
4028
3951
|
break;
|
|
4029
3952
|
}
|
|
4030
|
-
message.
|
|
3953
|
+
message.height = reader.uint32();
|
|
4031
3954
|
continue;
|
|
4032
3955
|
case 4:
|
|
4033
|
-
if (tag !==
|
|
3956
|
+
if (tag !== 32) {
|
|
4034
3957
|
break;
|
|
4035
3958
|
}
|
|
4036
|
-
message.
|
|
3959
|
+
message.stride = reader.uint32();
|
|
4037
3960
|
continue;
|
|
4038
3961
|
case 5:
|
|
4039
|
-
if (tag !==
|
|
3962
|
+
if (tag !== 40) {
|
|
4040
3963
|
break;
|
|
4041
3964
|
}
|
|
4042
|
-
message.
|
|
3965
|
+
message.bytesPP = reader.uint32();
|
|
4043
3966
|
continue;
|
|
4044
3967
|
case 6:
|
|
4045
|
-
if (tag !==
|
|
3968
|
+
if (tag !== 48) {
|
|
4046
3969
|
break;
|
|
4047
3970
|
}
|
|
4048
|
-
message.
|
|
3971
|
+
message.p1Offset = reader.uint32();
|
|
3972
|
+
continue;
|
|
3973
|
+
case 7:
|
|
3974
|
+
if (tag !== 56) {
|
|
3975
|
+
break;
|
|
3976
|
+
}
|
|
3977
|
+
message.p2Offset = reader.uint32();
|
|
3978
|
+
continue;
|
|
3979
|
+
case 8:
|
|
3980
|
+
if (tag !== 64) {
|
|
3981
|
+
break;
|
|
3982
|
+
}
|
|
3983
|
+
message.p3Offset = reader.uint32();
|
|
4049
3984
|
continue;
|
|
4050
3985
|
}
|
|
4051
3986
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -4057,50 +3992,83 @@ const ImgDetection = {
|
|
|
4057
3992
|
},
|
|
4058
3993
|
fromJSON(object) {
|
|
4059
3994
|
return {
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
3995
|
+
type: isSet$2(object.type) ? typeFromJSON(object.type) : 0,
|
|
3996
|
+
width: isSet$2(object.width) ? globalThis.Number(object.width) : 0,
|
|
3997
|
+
height: isSet$2(object.height) ? globalThis.Number(object.height) : 0,
|
|
3998
|
+
stride: isSet$2(object.stride) ? globalThis.Number(object.stride) : 0,
|
|
3999
|
+
bytesPP: isSet$2(object.bytesPP) ? globalThis.Number(object.bytesPP) : 0,
|
|
4000
|
+
p1Offset: isSet$2(object.p1Offset) ? globalThis.Number(object.p1Offset) : 0,
|
|
4001
|
+
p2Offset: isSet$2(object.p2Offset) ? globalThis.Number(object.p2Offset) : 0,
|
|
4002
|
+
p3Offset: isSet$2(object.p3Offset) ? globalThis.Number(object.p3Offset) : 0
|
|
4066
4003
|
};
|
|
4067
4004
|
},
|
|
4068
4005
|
toJSON(message) {
|
|
4069
4006
|
const obj = {};
|
|
4070
|
-
if (message.
|
|
4071
|
-
obj.
|
|
4007
|
+
if (message.type !== 0) {
|
|
4008
|
+
obj.type = typeToJSON(message.type);
|
|
4072
4009
|
}
|
|
4073
|
-
if (message.
|
|
4074
|
-
obj.
|
|
4010
|
+
if (message.width !== 0) {
|
|
4011
|
+
obj.width = Math.round(message.width);
|
|
4075
4012
|
}
|
|
4076
|
-
if (message.
|
|
4077
|
-
obj.
|
|
4013
|
+
if (message.height !== 0) {
|
|
4014
|
+
obj.height = Math.round(message.height);
|
|
4078
4015
|
}
|
|
4079
|
-
if (message.
|
|
4080
|
-
obj.
|
|
4016
|
+
if (message.stride !== 0) {
|
|
4017
|
+
obj.stride = Math.round(message.stride);
|
|
4081
4018
|
}
|
|
4082
|
-
if (message.
|
|
4083
|
-
obj.
|
|
4019
|
+
if (message.bytesPP !== 0) {
|
|
4020
|
+
obj.bytesPP = Math.round(message.bytesPP);
|
|
4084
4021
|
}
|
|
4085
|
-
if (message.
|
|
4086
|
-
obj.
|
|
4022
|
+
if (message.p1Offset !== 0) {
|
|
4023
|
+
obj.p1Offset = Math.round(message.p1Offset);
|
|
4024
|
+
}
|
|
4025
|
+
if (message.p2Offset !== 0) {
|
|
4026
|
+
obj.p2Offset = Math.round(message.p2Offset);
|
|
4027
|
+
}
|
|
4028
|
+
if (message.p3Offset !== 0) {
|
|
4029
|
+
obj.p3Offset = Math.round(message.p3Offset);
|
|
4087
4030
|
}
|
|
4088
4031
|
return obj;
|
|
4089
4032
|
},
|
|
4090
4033
|
create(base) {
|
|
4091
|
-
return
|
|
4034
|
+
return Specs.fromPartial(base ?? {});
|
|
4092
4035
|
},
|
|
4093
4036
|
fromPartial(object) {
|
|
4094
|
-
const message =
|
|
4095
|
-
message.
|
|
4096
|
-
message.
|
|
4097
|
-
message.
|
|
4098
|
-
message.
|
|
4099
|
-
message.
|
|
4100
|
-
message.
|
|
4037
|
+
const message = createBaseSpecs();
|
|
4038
|
+
message.type = object.type ?? 0;
|
|
4039
|
+
message.width = object.width ?? 0;
|
|
4040
|
+
message.height = object.height ?? 0;
|
|
4041
|
+
message.stride = object.stride ?? 0;
|
|
4042
|
+
message.bytesPP = object.bytesPP ?? 0;
|
|
4043
|
+
message.p1Offset = object.p1Offset ?? 0;
|
|
4044
|
+
message.p2Offset = object.p2Offset ?? 0;
|
|
4045
|
+
message.p3Offset = object.p3Offset ?? 0;
|
|
4101
4046
|
return message;
|
|
4102
4047
|
}
|
|
4103
4048
|
};
|
|
4049
|
+
function bytesFromBase64$1(b64) {
|
|
4050
|
+
if (globalThis.Buffer) {
|
|
4051
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
4052
|
+
} else {
|
|
4053
|
+
const bin = globalThis.atob(b64);
|
|
4054
|
+
const arr = new Uint8Array(bin.length);
|
|
4055
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
4056
|
+
arr[i] = bin.charCodeAt(i);
|
|
4057
|
+
}
|
|
4058
|
+
return arr;
|
|
4059
|
+
}
|
|
4060
|
+
}
|
|
4061
|
+
function base64FromBytes$1(arr) {
|
|
4062
|
+
if (globalThis.Buffer) {
|
|
4063
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
4064
|
+
} else {
|
|
4065
|
+
const bin = [];
|
|
4066
|
+
arr.forEach(byte => {
|
|
4067
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
4068
|
+
});
|
|
4069
|
+
return globalThis.btoa(bin.join(""));
|
|
4070
|
+
}
|
|
4071
|
+
}
|
|
4104
4072
|
function longToNumber$2(long) {
|
|
4105
4073
|
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
|
4106
4074
|
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
@@ -4117,7 +4085,7 @@ if (_m0.util.Long !== Long) {
|
|
|
4117
4085
|
function isSet$2(value) {
|
|
4118
4086
|
return value !== null && value !== undefined;
|
|
4119
4087
|
}
|
|
4120
|
-
const protobufName$2 = "
|
|
4088
|
+
const protobufName$2 = "ImgFrame";
|
|
4121
4089
|
|
|
4122
4090
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
4123
4091
|
// versions:
|
|
@@ -5066,22 +5034,22 @@ const protobufName = "SpatialImgDetections";
|
|
|
5066
5034
|
|
|
5067
5035
|
const protobufs = {
|
|
5068
5036
|
encodedFrame: {
|
|
5069
|
-
name: `${protobufPackage$
|
|
5037
|
+
name: `${protobufPackage$5}.${protobufName$5}`,
|
|
5070
5038
|
decoder: EncodedFrame,
|
|
5071
5039
|
kind: 'image'
|
|
5072
5040
|
},
|
|
5073
5041
|
imageFrame: {
|
|
5074
|
-
name: `${protobufPackage$
|
|
5042
|
+
name: `${protobufPackage$2}.${protobufName$2}`,
|
|
5075
5043
|
decoder: ImgFrame,
|
|
5076
5044
|
kind: 'image'
|
|
5077
5045
|
},
|
|
5078
5046
|
imageDetections: {
|
|
5079
|
-
name: `${protobufPackage$
|
|
5047
|
+
name: `${protobufPackage$3}.${protobufName$3}`,
|
|
5080
5048
|
decoder: ImgDetections,
|
|
5081
5049
|
kind: 'annotations'
|
|
5082
5050
|
},
|
|
5083
5051
|
imageDetectionsCustom: {
|
|
5084
|
-
name: `${protobufPackage$
|
|
5052
|
+
name: `${protobufPackage$4}.${protobufName$4}`,
|
|
5085
5053
|
decoder: ImageAnnotations,
|
|
5086
5054
|
kind: 'annotations'
|
|
5087
5055
|
},
|
|
@@ -5101,1172 +5069,4 @@ const protobufsBySchema = Object.fromEntries(Object.entries(protobufs).map(([typ
|
|
|
5101
5069
|
...data
|
|
5102
5070
|
}]));
|
|
5103
5071
|
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
(function (module) {
|
|
5107
|
-
|
|
5108
|
-
var has = Object.prototype.hasOwnProperty
|
|
5109
|
-
, prefix = '~';
|
|
5110
|
-
|
|
5111
|
-
/**
|
|
5112
|
-
* Constructor to create a storage for our `EE` objects.
|
|
5113
|
-
* An `Events` instance is a plain object whose properties are event names.
|
|
5114
|
-
*
|
|
5115
|
-
* @constructor
|
|
5116
|
-
* @private
|
|
5117
|
-
*/
|
|
5118
|
-
function Events() {}
|
|
5119
|
-
|
|
5120
|
-
//
|
|
5121
|
-
// We try to not inherit from `Object.prototype`. In some engines creating an
|
|
5122
|
-
// instance in this way is faster than calling `Object.create(null)` directly.
|
|
5123
|
-
// If `Object.create(null)` is not supported we prefix the event names with a
|
|
5124
|
-
// character to make sure that the built-in object properties are not
|
|
5125
|
-
// overridden or used as an attack vector.
|
|
5126
|
-
//
|
|
5127
|
-
if (Object.create) {
|
|
5128
|
-
Events.prototype = Object.create(null);
|
|
5129
|
-
|
|
5130
|
-
//
|
|
5131
|
-
// This hack is needed because the `__proto__` property is still inherited in
|
|
5132
|
-
// some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
|
|
5133
|
-
//
|
|
5134
|
-
if (!new Events().__proto__) prefix = false;
|
|
5135
|
-
}
|
|
5136
|
-
|
|
5137
|
-
/**
|
|
5138
|
-
* Representation of a single event listener.
|
|
5139
|
-
*
|
|
5140
|
-
* @param {Function} fn The listener function.
|
|
5141
|
-
* @param {*} context The context to invoke the listener with.
|
|
5142
|
-
* @param {Boolean} [once=false] Specify if the listener is a one-time listener.
|
|
5143
|
-
* @constructor
|
|
5144
|
-
* @private
|
|
5145
|
-
*/
|
|
5146
|
-
function EE(fn, context, once) {
|
|
5147
|
-
this.fn = fn;
|
|
5148
|
-
this.context = context;
|
|
5149
|
-
this.once = once || false;
|
|
5150
|
-
}
|
|
5151
|
-
|
|
5152
|
-
/**
|
|
5153
|
-
* Add a listener for a given event.
|
|
5154
|
-
*
|
|
5155
|
-
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
5156
|
-
* @param {(String|Symbol)} event The event name.
|
|
5157
|
-
* @param {Function} fn The listener function.
|
|
5158
|
-
* @param {*} context The context to invoke the listener with.
|
|
5159
|
-
* @param {Boolean} once Specify if the listener is a one-time listener.
|
|
5160
|
-
* @returns {EventEmitter}
|
|
5161
|
-
* @private
|
|
5162
|
-
*/
|
|
5163
|
-
function addListener(emitter, event, fn, context, once) {
|
|
5164
|
-
if (typeof fn !== 'function') {
|
|
5165
|
-
throw new TypeError('The listener must be a function');
|
|
5166
|
-
}
|
|
5167
|
-
|
|
5168
|
-
var listener = new EE(fn, context || emitter, once)
|
|
5169
|
-
, evt = prefix ? prefix + event : event;
|
|
5170
|
-
|
|
5171
|
-
if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
|
|
5172
|
-
else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
|
|
5173
|
-
else emitter._events[evt] = [emitter._events[evt], listener];
|
|
5174
|
-
|
|
5175
|
-
return emitter;
|
|
5176
|
-
}
|
|
5177
|
-
|
|
5178
|
-
/**
|
|
5179
|
-
* Clear event by name.
|
|
5180
|
-
*
|
|
5181
|
-
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
5182
|
-
* @param {(String|Symbol)} evt The Event name.
|
|
5183
|
-
* @private
|
|
5184
|
-
*/
|
|
5185
|
-
function clearEvent(emitter, evt) {
|
|
5186
|
-
if (--emitter._eventsCount === 0) emitter._events = new Events();
|
|
5187
|
-
else delete emitter._events[evt];
|
|
5188
|
-
}
|
|
5189
|
-
|
|
5190
|
-
/**
|
|
5191
|
-
* Minimal `EventEmitter` interface that is molded against the Node.js
|
|
5192
|
-
* `EventEmitter` interface.
|
|
5193
|
-
*
|
|
5194
|
-
* @constructor
|
|
5195
|
-
* @public
|
|
5196
|
-
*/
|
|
5197
|
-
function EventEmitter() {
|
|
5198
|
-
this._events = new Events();
|
|
5199
|
-
this._eventsCount = 0;
|
|
5200
|
-
}
|
|
5201
|
-
|
|
5202
|
-
/**
|
|
5203
|
-
* Return an array listing the events for which the emitter has registered
|
|
5204
|
-
* listeners.
|
|
5205
|
-
*
|
|
5206
|
-
* @returns {Array}
|
|
5207
|
-
* @public
|
|
5208
|
-
*/
|
|
5209
|
-
EventEmitter.prototype.eventNames = function eventNames() {
|
|
5210
|
-
var names = []
|
|
5211
|
-
, events
|
|
5212
|
-
, name;
|
|
5213
|
-
|
|
5214
|
-
if (this._eventsCount === 0) return names;
|
|
5215
|
-
|
|
5216
|
-
for (name in (events = this._events)) {
|
|
5217
|
-
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
|
5218
|
-
}
|
|
5219
|
-
|
|
5220
|
-
if (Object.getOwnPropertySymbols) {
|
|
5221
|
-
return names.concat(Object.getOwnPropertySymbols(events));
|
|
5222
|
-
}
|
|
5223
|
-
|
|
5224
|
-
return names;
|
|
5225
|
-
};
|
|
5226
|
-
|
|
5227
|
-
/**
|
|
5228
|
-
* Return the listeners registered for a given event.
|
|
5229
|
-
*
|
|
5230
|
-
* @param {(String|Symbol)} event The event name.
|
|
5231
|
-
* @returns {Array} The registered listeners.
|
|
5232
|
-
* @public
|
|
5233
|
-
*/
|
|
5234
|
-
EventEmitter.prototype.listeners = function listeners(event) {
|
|
5235
|
-
var evt = prefix ? prefix + event : event
|
|
5236
|
-
, handlers = this._events[evt];
|
|
5237
|
-
|
|
5238
|
-
if (!handlers) return [];
|
|
5239
|
-
if (handlers.fn) return [handlers.fn];
|
|
5240
|
-
|
|
5241
|
-
for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
|
|
5242
|
-
ee[i] = handlers[i].fn;
|
|
5243
|
-
}
|
|
5244
|
-
|
|
5245
|
-
return ee;
|
|
5246
|
-
};
|
|
5247
|
-
|
|
5248
|
-
/**
|
|
5249
|
-
* Return the number of listeners listening to a given event.
|
|
5250
|
-
*
|
|
5251
|
-
* @param {(String|Symbol)} event The event name.
|
|
5252
|
-
* @returns {Number} The number of listeners.
|
|
5253
|
-
* @public
|
|
5254
|
-
*/
|
|
5255
|
-
EventEmitter.prototype.listenerCount = function listenerCount(event) {
|
|
5256
|
-
var evt = prefix ? prefix + event : event
|
|
5257
|
-
, listeners = this._events[evt];
|
|
5258
|
-
|
|
5259
|
-
if (!listeners) return 0;
|
|
5260
|
-
if (listeners.fn) return 1;
|
|
5261
|
-
return listeners.length;
|
|
5262
|
-
};
|
|
5263
|
-
|
|
5264
|
-
/**
|
|
5265
|
-
* Calls each of the listeners registered for a given event.
|
|
5266
|
-
*
|
|
5267
|
-
* @param {(String|Symbol)} event The event name.
|
|
5268
|
-
* @returns {Boolean} `true` if the event had listeners, else `false`.
|
|
5269
|
-
* @public
|
|
5270
|
-
*/
|
|
5271
|
-
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
|
5272
|
-
var evt = prefix ? prefix + event : event;
|
|
5273
|
-
|
|
5274
|
-
if (!this._events[evt]) return false;
|
|
5275
|
-
|
|
5276
|
-
var listeners = this._events[evt]
|
|
5277
|
-
, len = arguments.length
|
|
5278
|
-
, args
|
|
5279
|
-
, i;
|
|
5280
|
-
|
|
5281
|
-
if (listeners.fn) {
|
|
5282
|
-
if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
|
5283
|
-
|
|
5284
|
-
switch (len) {
|
|
5285
|
-
case 1: return listeners.fn.call(listeners.context), true;
|
|
5286
|
-
case 2: return listeners.fn.call(listeners.context, a1), true;
|
|
5287
|
-
case 3: return listeners.fn.call(listeners.context, a1, a2), true;
|
|
5288
|
-
case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
|
5289
|
-
case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
|
5290
|
-
case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
|
5291
|
-
}
|
|
5292
|
-
|
|
5293
|
-
for (i = 1, args = new Array(len -1); i < len; i++) {
|
|
5294
|
-
args[i - 1] = arguments[i];
|
|
5295
|
-
}
|
|
5296
|
-
|
|
5297
|
-
listeners.fn.apply(listeners.context, args);
|
|
5298
|
-
} else {
|
|
5299
|
-
var length = listeners.length
|
|
5300
|
-
, j;
|
|
5301
|
-
|
|
5302
|
-
for (i = 0; i < length; i++) {
|
|
5303
|
-
if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
|
5304
|
-
|
|
5305
|
-
switch (len) {
|
|
5306
|
-
case 1: listeners[i].fn.call(listeners[i].context); break;
|
|
5307
|
-
case 2: listeners[i].fn.call(listeners[i].context, a1); break;
|
|
5308
|
-
case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
|
|
5309
|
-
case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
|
|
5310
|
-
default:
|
|
5311
|
-
if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
|
|
5312
|
-
args[j - 1] = arguments[j];
|
|
5313
|
-
}
|
|
5314
|
-
|
|
5315
|
-
listeners[i].fn.apply(listeners[i].context, args);
|
|
5316
|
-
}
|
|
5317
|
-
}
|
|
5318
|
-
}
|
|
5319
|
-
|
|
5320
|
-
return true;
|
|
5321
|
-
};
|
|
5322
|
-
|
|
5323
|
-
/**
|
|
5324
|
-
* Add a listener for a given event.
|
|
5325
|
-
*
|
|
5326
|
-
* @param {(String|Symbol)} event The event name.
|
|
5327
|
-
* @param {Function} fn The listener function.
|
|
5328
|
-
* @param {*} [context=this] The context to invoke the listener with.
|
|
5329
|
-
* @returns {EventEmitter} `this`.
|
|
5330
|
-
* @public
|
|
5331
|
-
*/
|
|
5332
|
-
EventEmitter.prototype.on = function on(event, fn, context) {
|
|
5333
|
-
return addListener(this, event, fn, context, false);
|
|
5334
|
-
};
|
|
5335
|
-
|
|
5336
|
-
/**
|
|
5337
|
-
* Add a one-time listener for a given event.
|
|
5338
|
-
*
|
|
5339
|
-
* @param {(String|Symbol)} event The event name.
|
|
5340
|
-
* @param {Function} fn The listener function.
|
|
5341
|
-
* @param {*} [context=this] The context to invoke the listener with.
|
|
5342
|
-
* @returns {EventEmitter} `this`.
|
|
5343
|
-
* @public
|
|
5344
|
-
*/
|
|
5345
|
-
EventEmitter.prototype.once = function once(event, fn, context) {
|
|
5346
|
-
return addListener(this, event, fn, context, true);
|
|
5347
|
-
};
|
|
5348
|
-
|
|
5349
|
-
/**
|
|
5350
|
-
* Remove the listeners of a given event.
|
|
5351
|
-
*
|
|
5352
|
-
* @param {(String|Symbol)} event The event name.
|
|
5353
|
-
* @param {Function} fn Only remove the listeners that match this function.
|
|
5354
|
-
* @param {*} context Only remove the listeners that have this context.
|
|
5355
|
-
* @param {Boolean} once Only remove one-time listeners.
|
|
5356
|
-
* @returns {EventEmitter} `this`.
|
|
5357
|
-
* @public
|
|
5358
|
-
*/
|
|
5359
|
-
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
|
5360
|
-
var evt = prefix ? prefix + event : event;
|
|
5361
|
-
|
|
5362
|
-
if (!this._events[evt]) return this;
|
|
5363
|
-
if (!fn) {
|
|
5364
|
-
clearEvent(this, evt);
|
|
5365
|
-
return this;
|
|
5366
|
-
}
|
|
5367
|
-
|
|
5368
|
-
var listeners = this._events[evt];
|
|
5369
|
-
|
|
5370
|
-
if (listeners.fn) {
|
|
5371
|
-
if (
|
|
5372
|
-
listeners.fn === fn &&
|
|
5373
|
-
(!once || listeners.once) &&
|
|
5374
|
-
(!context || listeners.context === context)
|
|
5375
|
-
) {
|
|
5376
|
-
clearEvent(this, evt);
|
|
5377
|
-
}
|
|
5378
|
-
} else {
|
|
5379
|
-
for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
|
5380
|
-
if (
|
|
5381
|
-
listeners[i].fn !== fn ||
|
|
5382
|
-
(once && !listeners[i].once) ||
|
|
5383
|
-
(context && listeners[i].context !== context)
|
|
5384
|
-
) {
|
|
5385
|
-
events.push(listeners[i]);
|
|
5386
|
-
}
|
|
5387
|
-
}
|
|
5388
|
-
|
|
5389
|
-
//
|
|
5390
|
-
// Reset the array, or remove it completely if we have no more listeners.
|
|
5391
|
-
//
|
|
5392
|
-
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
|
|
5393
|
-
else clearEvent(this, evt);
|
|
5394
|
-
}
|
|
5395
|
-
|
|
5396
|
-
return this;
|
|
5397
|
-
};
|
|
5398
|
-
|
|
5399
|
-
/**
|
|
5400
|
-
* Remove all listeners, or those of the specified event.
|
|
5401
|
-
*
|
|
5402
|
-
* @param {(String|Symbol)} [event] The event name.
|
|
5403
|
-
* @returns {EventEmitter} `this`.
|
|
5404
|
-
* @public
|
|
5405
|
-
*/
|
|
5406
|
-
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
|
5407
|
-
var evt;
|
|
5408
|
-
|
|
5409
|
-
if (event) {
|
|
5410
|
-
evt = prefix ? prefix + event : event;
|
|
5411
|
-
if (this._events[evt]) clearEvent(this, evt);
|
|
5412
|
-
} else {
|
|
5413
|
-
this._events = new Events();
|
|
5414
|
-
this._eventsCount = 0;
|
|
5415
|
-
}
|
|
5416
|
-
|
|
5417
|
-
return this;
|
|
5418
|
-
};
|
|
5419
|
-
|
|
5420
|
-
//
|
|
5421
|
-
// Alias methods names because people roll like that.
|
|
5422
|
-
//
|
|
5423
|
-
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
5424
|
-
EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
|
5425
|
-
|
|
5426
|
-
//
|
|
5427
|
-
// Expose the prefix.
|
|
5428
|
-
//
|
|
5429
|
-
EventEmitter.prefixed = prefix;
|
|
5430
|
-
|
|
5431
|
-
//
|
|
5432
|
-
// Allow `EventEmitter` to be imported as module namespace.
|
|
5433
|
-
//
|
|
5434
|
-
EventEmitter.EventEmitter = EventEmitter;
|
|
5435
|
-
|
|
5436
|
-
//
|
|
5437
|
-
// Expose the module.
|
|
5438
|
-
//
|
|
5439
|
-
{
|
|
5440
|
-
module.exports = EventEmitter;
|
|
5441
|
-
}
|
|
5442
|
-
} (eventemitter3));
|
|
5443
|
-
|
|
5444
|
-
var eventemitter3Exports = eventemitter3.exports;
|
|
5445
|
-
var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
|
|
5446
|
-
|
|
5447
|
-
var BinaryOpcode;
|
|
5448
|
-
(function (BinaryOpcode) {
|
|
5449
|
-
BinaryOpcode[BinaryOpcode["MESSAGE_DATA"] = 1] = "MESSAGE_DATA";
|
|
5450
|
-
BinaryOpcode[BinaryOpcode["TIME"] = 2] = "TIME";
|
|
5451
|
-
BinaryOpcode[BinaryOpcode["SERVICE_CALL_RESPONSE"] = 3] = "SERVICE_CALL_RESPONSE";
|
|
5452
|
-
BinaryOpcode[BinaryOpcode["FETCH_ASSET_RESPONSE"] = 4] = "FETCH_ASSET_RESPONSE";
|
|
5453
|
-
})(BinaryOpcode || (BinaryOpcode = {}));
|
|
5454
|
-
var ClientBinaryOpcode;
|
|
5455
|
-
(function (ClientBinaryOpcode) {
|
|
5456
|
-
ClientBinaryOpcode[ClientBinaryOpcode["MESSAGE_DATA"] = 1] = "MESSAGE_DATA";
|
|
5457
|
-
ClientBinaryOpcode[ClientBinaryOpcode["SERVICE_CALL_REQUEST"] = 2] = "SERVICE_CALL_REQUEST";
|
|
5458
|
-
})(ClientBinaryOpcode || (ClientBinaryOpcode = {}));
|
|
5459
|
-
var StatusLevel;
|
|
5460
|
-
(function (StatusLevel) {
|
|
5461
|
-
StatusLevel[StatusLevel["INFO"] = 0] = "INFO";
|
|
5462
|
-
StatusLevel[StatusLevel["WARNING"] = 1] = "WARNING";
|
|
5463
|
-
StatusLevel[StatusLevel["ERROR"] = 2] = "ERROR";
|
|
5464
|
-
})(StatusLevel || (StatusLevel = {}));
|
|
5465
|
-
var ServerCapability;
|
|
5466
|
-
(function (ServerCapability) {
|
|
5467
|
-
ServerCapability["clientPublish"] = "clientPublish";
|
|
5468
|
-
ServerCapability["time"] = "time";
|
|
5469
|
-
ServerCapability["parameters"] = "parameters";
|
|
5470
|
-
ServerCapability["parametersSubscribe"] = "parametersSubscribe";
|
|
5471
|
-
ServerCapability["services"] = "services";
|
|
5472
|
-
ServerCapability["connectionGraph"] = "connectionGraph";
|
|
5473
|
-
ServerCapability["assets"] = "assets";
|
|
5474
|
-
})(ServerCapability || (ServerCapability = {}));
|
|
5475
|
-
var FetchAssetStatus;
|
|
5476
|
-
(function (FetchAssetStatus) {
|
|
5477
|
-
FetchAssetStatus[FetchAssetStatus["SUCCESS"] = 0] = "SUCCESS";
|
|
5478
|
-
FetchAssetStatus[FetchAssetStatus["ERROR"] = 1] = "ERROR";
|
|
5479
|
-
})(FetchAssetStatus || (FetchAssetStatus = {}));
|
|
5480
|
-
|
|
5481
|
-
const textDecoder = new TextDecoder();
|
|
5482
|
-
function parseServerMessage(buffer) {
|
|
5483
|
-
const view = new DataView(buffer);
|
|
5484
|
-
let offset = 0;
|
|
5485
|
-
const op = view.getUint8(offset);
|
|
5486
|
-
offset += 1;
|
|
5487
|
-
switch (op) {
|
|
5488
|
-
case BinaryOpcode.MESSAGE_DATA: {
|
|
5489
|
-
const subscriptionId = view.getUint32(offset, true);
|
|
5490
|
-
offset += 4;
|
|
5491
|
-
const timestamp = view.getBigUint64(offset, true);
|
|
5492
|
-
offset += 8;
|
|
5493
|
-
const data = new DataView(buffer, offset);
|
|
5494
|
-
return { op, subscriptionId, timestamp, data };
|
|
5495
|
-
}
|
|
5496
|
-
case BinaryOpcode.TIME: {
|
|
5497
|
-
const timestamp = view.getBigUint64(offset, true);
|
|
5498
|
-
return { op, timestamp };
|
|
5499
|
-
}
|
|
5500
|
-
case BinaryOpcode.SERVICE_CALL_RESPONSE: {
|
|
5501
|
-
const serviceId = view.getUint32(offset, true);
|
|
5502
|
-
offset += 4;
|
|
5503
|
-
const callId = view.getUint32(offset, true);
|
|
5504
|
-
offset += 4;
|
|
5505
|
-
const encodingLength = view.getUint32(offset, true);
|
|
5506
|
-
offset += 4;
|
|
5507
|
-
const encodingBytes = new DataView(buffer, offset, encodingLength);
|
|
5508
|
-
const encoding = textDecoder.decode(encodingBytes);
|
|
5509
|
-
offset += encodingLength;
|
|
5510
|
-
const data = new DataView(buffer, offset, buffer.byteLength - offset);
|
|
5511
|
-
return { op, serviceId, callId, encoding, data };
|
|
5512
|
-
}
|
|
5513
|
-
case BinaryOpcode.FETCH_ASSET_RESPONSE: {
|
|
5514
|
-
const requestId = view.getUint32(offset, true);
|
|
5515
|
-
offset += 4;
|
|
5516
|
-
const status = view.getUint8(offset);
|
|
5517
|
-
offset += 1;
|
|
5518
|
-
const errorMsgLength = view.getUint32(offset, true);
|
|
5519
|
-
offset += 4;
|
|
5520
|
-
const error = textDecoder.decode(new DataView(buffer, offset, errorMsgLength));
|
|
5521
|
-
offset += errorMsgLength;
|
|
5522
|
-
switch (status) {
|
|
5523
|
-
case FetchAssetStatus.SUCCESS: {
|
|
5524
|
-
const data = new DataView(buffer, offset, buffer.byteLength - offset);
|
|
5525
|
-
return { op, requestId, status, data };
|
|
5526
|
-
}
|
|
5527
|
-
case FetchAssetStatus.ERROR:
|
|
5528
|
-
return { op, requestId, status, error };
|
|
5529
|
-
default:
|
|
5530
|
-
throw new Error(`Unrecognized fetch asset status: ${status}`);
|
|
5531
|
-
}
|
|
5532
|
-
}
|
|
5533
|
-
}
|
|
5534
|
-
throw new Error(`Unrecognized server opcode in binary message: ${op.toString(16)}`);
|
|
5535
|
-
}
|
|
5536
|
-
|
|
5537
|
-
const textEncoder = new TextEncoder();
|
|
5538
|
-
class FoxgloveClient {
|
|
5539
|
-
static SUPPORTED_SUBPROTOCOL = "foxglove.websocket.v1";
|
|
5540
|
-
#emitter = new EventEmitter();
|
|
5541
|
-
#ws;
|
|
5542
|
-
#nextSubscriptionId = 0;
|
|
5543
|
-
#nextAdvertisementId = 0;
|
|
5544
|
-
constructor({ ws }) {
|
|
5545
|
-
this.#ws = ws;
|
|
5546
|
-
this.#reconnect();
|
|
5547
|
-
}
|
|
5548
|
-
on(name, listener) {
|
|
5549
|
-
this.#emitter.on(name, listener);
|
|
5550
|
-
}
|
|
5551
|
-
off(name, listener) {
|
|
5552
|
-
this.#emitter.off(name, listener);
|
|
5553
|
-
}
|
|
5554
|
-
#reconnect() {
|
|
5555
|
-
this.#ws.binaryType = "arraybuffer";
|
|
5556
|
-
this.#ws.onerror = (event) => {
|
|
5557
|
-
this.#emitter.emit("error", event.error);
|
|
5558
|
-
};
|
|
5559
|
-
this.#ws.onopen = (_event) => {
|
|
5560
|
-
if (this.#ws.protocol !== FoxgloveClient.SUPPORTED_SUBPROTOCOL) {
|
|
5561
|
-
throw new Error(`Expected subprotocol ${FoxgloveClient.SUPPORTED_SUBPROTOCOL}, got '${this.#ws.protocol}'`);
|
|
5562
|
-
}
|
|
5563
|
-
this.#emitter.emit("open");
|
|
5564
|
-
};
|
|
5565
|
-
this.#ws.onmessage = (event) => {
|
|
5566
|
-
let message;
|
|
5567
|
-
try {
|
|
5568
|
-
if (event.data instanceof ArrayBuffer) {
|
|
5569
|
-
message = parseServerMessage(event.data);
|
|
5570
|
-
}
|
|
5571
|
-
else {
|
|
5572
|
-
message = JSON.parse(event.data);
|
|
5573
|
-
}
|
|
5574
|
-
}
|
|
5575
|
-
catch (error) {
|
|
5576
|
-
this.#emitter.emit("error", error);
|
|
5577
|
-
return;
|
|
5578
|
-
}
|
|
5579
|
-
switch (message.op) {
|
|
5580
|
-
case "serverInfo":
|
|
5581
|
-
this.#emitter.emit("serverInfo", message);
|
|
5582
|
-
return;
|
|
5583
|
-
case "status":
|
|
5584
|
-
this.#emitter.emit("status", message);
|
|
5585
|
-
return;
|
|
5586
|
-
case "advertise":
|
|
5587
|
-
this.#emitter.emit("advertise", message.channels);
|
|
5588
|
-
return;
|
|
5589
|
-
case "unadvertise":
|
|
5590
|
-
this.#emitter.emit("unadvertise", message.channelIds);
|
|
5591
|
-
return;
|
|
5592
|
-
case "parameterValues":
|
|
5593
|
-
this.#emitter.emit("parameterValues", message);
|
|
5594
|
-
return;
|
|
5595
|
-
case "advertiseServices":
|
|
5596
|
-
this.#emitter.emit("advertiseServices", message.services);
|
|
5597
|
-
return;
|
|
5598
|
-
case "unadvertiseServices":
|
|
5599
|
-
this.#emitter.emit("unadvertiseServices", message.serviceIds);
|
|
5600
|
-
return;
|
|
5601
|
-
case "connectionGraphUpdate":
|
|
5602
|
-
this.#emitter.emit("connectionGraphUpdate", message);
|
|
5603
|
-
return;
|
|
5604
|
-
case BinaryOpcode.MESSAGE_DATA:
|
|
5605
|
-
this.#emitter.emit("message", message);
|
|
5606
|
-
return;
|
|
5607
|
-
case BinaryOpcode.TIME:
|
|
5608
|
-
this.#emitter.emit("time", message);
|
|
5609
|
-
return;
|
|
5610
|
-
case BinaryOpcode.SERVICE_CALL_RESPONSE:
|
|
5611
|
-
this.#emitter.emit("serviceCallResponse", message);
|
|
5612
|
-
return;
|
|
5613
|
-
case BinaryOpcode.FETCH_ASSET_RESPONSE:
|
|
5614
|
-
this.#emitter.emit("fetchAssetResponse", message);
|
|
5615
|
-
return;
|
|
5616
|
-
}
|
|
5617
|
-
this.#emitter.emit("error", new Error(`Unrecognized server opcode: ${message.op}`));
|
|
5618
|
-
};
|
|
5619
|
-
this.#ws.onclose = (event) => {
|
|
5620
|
-
this.#emitter.emit("close", event);
|
|
5621
|
-
};
|
|
5622
|
-
}
|
|
5623
|
-
close() {
|
|
5624
|
-
this.#ws.close();
|
|
5625
|
-
}
|
|
5626
|
-
subscribe(channelId) {
|
|
5627
|
-
const id = this.#nextSubscriptionId++;
|
|
5628
|
-
const subscriptions = [{ id, channelId }];
|
|
5629
|
-
this.#send({ op: "subscribe", subscriptions });
|
|
5630
|
-
return id;
|
|
5631
|
-
}
|
|
5632
|
-
unsubscribe(subscriptionId) {
|
|
5633
|
-
this.#send({ op: "unsubscribe", subscriptionIds: [subscriptionId] });
|
|
5634
|
-
}
|
|
5635
|
-
advertise(clientChannel) {
|
|
5636
|
-
const id = ++this.#nextAdvertisementId;
|
|
5637
|
-
const channels = [{ id, ...clientChannel }];
|
|
5638
|
-
this.#send({ op: "advertise", channels });
|
|
5639
|
-
return id;
|
|
5640
|
-
}
|
|
5641
|
-
unadvertise(channelId) {
|
|
5642
|
-
this.#send({ op: "unadvertise", channelIds: [channelId] });
|
|
5643
|
-
}
|
|
5644
|
-
getParameters(parameterNames, id) {
|
|
5645
|
-
this.#send({ op: "getParameters", parameterNames, id });
|
|
5646
|
-
}
|
|
5647
|
-
setParameters(parameters, id) {
|
|
5648
|
-
this.#send({ op: "setParameters", parameters, id });
|
|
5649
|
-
}
|
|
5650
|
-
subscribeParameterUpdates(parameterNames) {
|
|
5651
|
-
this.#send({ op: "subscribeParameterUpdates", parameterNames });
|
|
5652
|
-
}
|
|
5653
|
-
unsubscribeParameterUpdates(parameterNames) {
|
|
5654
|
-
this.#send({ op: "unsubscribeParameterUpdates", parameterNames });
|
|
5655
|
-
}
|
|
5656
|
-
sendMessage(channelId, data) {
|
|
5657
|
-
const payload = new Uint8Array(5 + data.byteLength);
|
|
5658
|
-
const view = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
|
|
5659
|
-
view.setUint8(0, ClientBinaryOpcode.MESSAGE_DATA);
|
|
5660
|
-
view.setUint32(1, channelId, true);
|
|
5661
|
-
payload.set(data, 5);
|
|
5662
|
-
this.#ws.send(payload);
|
|
5663
|
-
}
|
|
5664
|
-
sendServiceCallRequest(request) {
|
|
5665
|
-
const encoding = textEncoder.encode(request.encoding);
|
|
5666
|
-
const payload = new Uint8Array(1 + 4 + 4 + 4 + encoding.length + request.data.byteLength);
|
|
5667
|
-
const view = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
|
|
5668
|
-
let offset = 0;
|
|
5669
|
-
view.setUint8(offset, ClientBinaryOpcode.SERVICE_CALL_REQUEST);
|
|
5670
|
-
offset += 1;
|
|
5671
|
-
view.setUint32(offset, request.serviceId, true);
|
|
5672
|
-
offset += 4;
|
|
5673
|
-
view.setUint32(offset, request.callId, true);
|
|
5674
|
-
offset += 4;
|
|
5675
|
-
view.setUint32(offset, request.encoding.length, true);
|
|
5676
|
-
offset += 4;
|
|
5677
|
-
payload.set(encoding, offset);
|
|
5678
|
-
offset += encoding.length;
|
|
5679
|
-
const data = new Uint8Array(request.data.buffer, request.data.byteOffset, request.data.byteLength);
|
|
5680
|
-
payload.set(data, offset);
|
|
5681
|
-
this.#ws.send(payload);
|
|
5682
|
-
}
|
|
5683
|
-
subscribeConnectionGraph() {
|
|
5684
|
-
this.#send({ op: "subscribeConnectionGraph" });
|
|
5685
|
-
}
|
|
5686
|
-
unsubscribeConnectionGraph() {
|
|
5687
|
-
this.#send({ op: "unsubscribeConnectionGraph" });
|
|
5688
|
-
}
|
|
5689
|
-
fetchAsset(uri, requestId) {
|
|
5690
|
-
this.#send({ op: "fetchAsset", uri, requestId });
|
|
5691
|
-
}
|
|
5692
|
-
/**
|
|
5693
|
-
* @deprecated Use `sendServiceCallRequest` instead
|
|
5694
|
-
*/
|
|
5695
|
-
sendCallServiceRequest(request) {
|
|
5696
|
-
this.sendServiceCallRequest(request);
|
|
5697
|
-
}
|
|
5698
|
-
#send(message) {
|
|
5699
|
-
this.#ws.send(JSON.stringify(message));
|
|
5700
|
-
}
|
|
5701
|
-
}
|
|
5702
|
-
|
|
5703
|
-
var browser = {exports: {}};
|
|
5704
|
-
|
|
5705
|
-
/**
|
|
5706
|
-
* This is the common logic for both the Node.js and web browser
|
|
5707
|
-
* implementations of `debug()`.
|
|
5708
|
-
*/
|
|
5709
|
-
|
|
5710
|
-
function setup(env) {
|
|
5711
|
-
createDebug.debug = createDebug;
|
|
5712
|
-
createDebug.default = createDebug;
|
|
5713
|
-
createDebug.coerce = coerce;
|
|
5714
|
-
createDebug.disable = disable;
|
|
5715
|
-
createDebug.enable = enable;
|
|
5716
|
-
createDebug.enabled = enabled;
|
|
5717
|
-
createDebug.humanize = require$$0;
|
|
5718
|
-
createDebug.destroy = destroy;
|
|
5719
|
-
|
|
5720
|
-
Object.keys(env).forEach(key => {
|
|
5721
|
-
createDebug[key] = env[key];
|
|
5722
|
-
});
|
|
5723
|
-
|
|
5724
|
-
/**
|
|
5725
|
-
* The currently active debug mode names, and names to skip.
|
|
5726
|
-
*/
|
|
5727
|
-
|
|
5728
|
-
createDebug.names = [];
|
|
5729
|
-
createDebug.skips = [];
|
|
5730
|
-
|
|
5731
|
-
/**
|
|
5732
|
-
* Map of special "%n" handling functions, for the debug "format" argument.
|
|
5733
|
-
*
|
|
5734
|
-
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
|
5735
|
-
*/
|
|
5736
|
-
createDebug.formatters = {};
|
|
5737
|
-
|
|
5738
|
-
/**
|
|
5739
|
-
* Selects a color for a debug namespace
|
|
5740
|
-
* @param {String} namespace The namespace string for the debug instance to be colored
|
|
5741
|
-
* @return {Number|String} An ANSI color code for the given namespace
|
|
5742
|
-
* @api private
|
|
5743
|
-
*/
|
|
5744
|
-
function selectColor(namespace) {
|
|
5745
|
-
let hash = 0;
|
|
5746
|
-
|
|
5747
|
-
for (let i = 0; i < namespace.length; i++) {
|
|
5748
|
-
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
|
|
5749
|
-
hash |= 0; // Convert to 32bit integer
|
|
5750
|
-
}
|
|
5751
|
-
|
|
5752
|
-
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
5753
|
-
}
|
|
5754
|
-
createDebug.selectColor = selectColor;
|
|
5755
|
-
|
|
5756
|
-
/**
|
|
5757
|
-
* Create a debugger with the given `namespace`.
|
|
5758
|
-
*
|
|
5759
|
-
* @param {String} namespace
|
|
5760
|
-
* @return {Function}
|
|
5761
|
-
* @api public
|
|
5762
|
-
*/
|
|
5763
|
-
function createDebug(namespace) {
|
|
5764
|
-
let prevTime;
|
|
5765
|
-
let enableOverride = null;
|
|
5766
|
-
let namespacesCache;
|
|
5767
|
-
let enabledCache;
|
|
5768
|
-
|
|
5769
|
-
function debug(...args) {
|
|
5770
|
-
// Disabled?
|
|
5771
|
-
if (!debug.enabled) {
|
|
5772
|
-
return;
|
|
5773
|
-
}
|
|
5774
|
-
|
|
5775
|
-
const self = debug;
|
|
5776
|
-
|
|
5777
|
-
// Set `diff` timestamp
|
|
5778
|
-
const curr = Number(new Date());
|
|
5779
|
-
const ms = curr - (prevTime || curr);
|
|
5780
|
-
self.diff = ms;
|
|
5781
|
-
self.prev = prevTime;
|
|
5782
|
-
self.curr = curr;
|
|
5783
|
-
prevTime = curr;
|
|
5784
|
-
|
|
5785
|
-
args[0] = createDebug.coerce(args[0]);
|
|
5786
|
-
|
|
5787
|
-
if (typeof args[0] !== 'string') {
|
|
5788
|
-
// Anything else let's inspect with %O
|
|
5789
|
-
args.unshift('%O');
|
|
5790
|
-
}
|
|
5791
|
-
|
|
5792
|
-
// Apply any `formatters` transformations
|
|
5793
|
-
let index = 0;
|
|
5794
|
-
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
5795
|
-
// If we encounter an escaped % then don't increase the array index
|
|
5796
|
-
if (match === '%%') {
|
|
5797
|
-
return '%';
|
|
5798
|
-
}
|
|
5799
|
-
index++;
|
|
5800
|
-
const formatter = createDebug.formatters[format];
|
|
5801
|
-
if (typeof formatter === 'function') {
|
|
5802
|
-
const val = args[index];
|
|
5803
|
-
match = formatter.call(self, val);
|
|
5804
|
-
|
|
5805
|
-
// Now we need to remove `args[index]` since it's inlined in the `format`
|
|
5806
|
-
args.splice(index, 1);
|
|
5807
|
-
index--;
|
|
5808
|
-
}
|
|
5809
|
-
return match;
|
|
5810
|
-
});
|
|
5811
|
-
|
|
5812
|
-
// Apply env-specific formatting (colors, etc.)
|
|
5813
|
-
createDebug.formatArgs.call(self, args);
|
|
5814
|
-
|
|
5815
|
-
const logFn = self.log || createDebug.log;
|
|
5816
|
-
logFn.apply(self, args);
|
|
5817
|
-
}
|
|
5818
|
-
|
|
5819
|
-
debug.namespace = namespace;
|
|
5820
|
-
debug.useColors = createDebug.useColors();
|
|
5821
|
-
debug.color = createDebug.selectColor(namespace);
|
|
5822
|
-
debug.extend = extend;
|
|
5823
|
-
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
|
|
5824
|
-
|
|
5825
|
-
Object.defineProperty(debug, 'enabled', {
|
|
5826
|
-
enumerable: true,
|
|
5827
|
-
configurable: false,
|
|
5828
|
-
get: () => {
|
|
5829
|
-
if (enableOverride !== null) {
|
|
5830
|
-
return enableOverride;
|
|
5831
|
-
}
|
|
5832
|
-
if (namespacesCache !== createDebug.namespaces) {
|
|
5833
|
-
namespacesCache = createDebug.namespaces;
|
|
5834
|
-
enabledCache = createDebug.enabled(namespace);
|
|
5835
|
-
}
|
|
5836
|
-
|
|
5837
|
-
return enabledCache;
|
|
5838
|
-
},
|
|
5839
|
-
set: v => {
|
|
5840
|
-
enableOverride = v;
|
|
5841
|
-
}
|
|
5842
|
-
});
|
|
5843
|
-
|
|
5844
|
-
// Env-specific initialization logic for debug instances
|
|
5845
|
-
if (typeof createDebug.init === 'function') {
|
|
5846
|
-
createDebug.init(debug);
|
|
5847
|
-
}
|
|
5848
|
-
|
|
5849
|
-
return debug;
|
|
5850
|
-
}
|
|
5851
|
-
|
|
5852
|
-
function extend(namespace, delimiter) {
|
|
5853
|
-
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
|
5854
|
-
newDebug.log = this.log;
|
|
5855
|
-
return newDebug;
|
|
5856
|
-
}
|
|
5857
|
-
|
|
5858
|
-
/**
|
|
5859
|
-
* Enables a debug mode by namespaces. This can include modes
|
|
5860
|
-
* separated by a colon and wildcards.
|
|
5861
|
-
*
|
|
5862
|
-
* @param {String} namespaces
|
|
5863
|
-
* @api public
|
|
5864
|
-
*/
|
|
5865
|
-
function enable(namespaces) {
|
|
5866
|
-
createDebug.save(namespaces);
|
|
5867
|
-
createDebug.namespaces = namespaces;
|
|
5868
|
-
|
|
5869
|
-
createDebug.names = [];
|
|
5870
|
-
createDebug.skips = [];
|
|
5871
|
-
|
|
5872
|
-
let i;
|
|
5873
|
-
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|
5874
|
-
const len = split.length;
|
|
5875
|
-
|
|
5876
|
-
for (i = 0; i < len; i++) {
|
|
5877
|
-
if (!split[i]) {
|
|
5878
|
-
// ignore empty strings
|
|
5879
|
-
continue;
|
|
5880
|
-
}
|
|
5881
|
-
|
|
5882
|
-
namespaces = split[i].replace(/\*/g, '.*?');
|
|
5883
|
-
|
|
5884
|
-
if (namespaces[0] === '-') {
|
|
5885
|
-
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
|
5886
|
-
} else {
|
|
5887
|
-
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
5888
|
-
}
|
|
5889
|
-
}
|
|
5890
|
-
}
|
|
5891
|
-
|
|
5892
|
-
/**
|
|
5893
|
-
* Disable debug output.
|
|
5894
|
-
*
|
|
5895
|
-
* @return {String} namespaces
|
|
5896
|
-
* @api public
|
|
5897
|
-
*/
|
|
5898
|
-
function disable() {
|
|
5899
|
-
const namespaces = [
|
|
5900
|
-
...createDebug.names.map(toNamespace),
|
|
5901
|
-
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
|
|
5902
|
-
].join(',');
|
|
5903
|
-
createDebug.enable('');
|
|
5904
|
-
return namespaces;
|
|
5905
|
-
}
|
|
5906
|
-
|
|
5907
|
-
/**
|
|
5908
|
-
* Returns true if the given mode name is enabled, false otherwise.
|
|
5909
|
-
*
|
|
5910
|
-
* @param {String} name
|
|
5911
|
-
* @return {Boolean}
|
|
5912
|
-
* @api public
|
|
5913
|
-
*/
|
|
5914
|
-
function enabled(name) {
|
|
5915
|
-
if (name[name.length - 1] === '*') {
|
|
5916
|
-
return true;
|
|
5917
|
-
}
|
|
5918
|
-
|
|
5919
|
-
let i;
|
|
5920
|
-
let len;
|
|
5921
|
-
|
|
5922
|
-
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|
5923
|
-
if (createDebug.skips[i].test(name)) {
|
|
5924
|
-
return false;
|
|
5925
|
-
}
|
|
5926
|
-
}
|
|
5927
|
-
|
|
5928
|
-
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|
5929
|
-
if (createDebug.names[i].test(name)) {
|
|
5930
|
-
return true;
|
|
5931
|
-
}
|
|
5932
|
-
}
|
|
5933
|
-
|
|
5934
|
-
return false;
|
|
5935
|
-
}
|
|
5936
|
-
|
|
5937
|
-
/**
|
|
5938
|
-
* Convert regexp to namespace
|
|
5939
|
-
*
|
|
5940
|
-
* @param {RegExp} regxep
|
|
5941
|
-
* @return {String} namespace
|
|
5942
|
-
* @api private
|
|
5943
|
-
*/
|
|
5944
|
-
function toNamespace(regexp) {
|
|
5945
|
-
return regexp.toString()
|
|
5946
|
-
.substring(2, regexp.toString().length - 2)
|
|
5947
|
-
.replace(/\.\*\?$/, '*');
|
|
5948
|
-
}
|
|
5949
|
-
|
|
5950
|
-
/**
|
|
5951
|
-
* Coerce `val`.
|
|
5952
|
-
*
|
|
5953
|
-
* @param {Mixed} val
|
|
5954
|
-
* @return {Mixed}
|
|
5955
|
-
* @api private
|
|
5956
|
-
*/
|
|
5957
|
-
function coerce(val) {
|
|
5958
|
-
if (val instanceof Error) {
|
|
5959
|
-
return val.stack || val.message;
|
|
5960
|
-
}
|
|
5961
|
-
return val;
|
|
5962
|
-
}
|
|
5963
|
-
|
|
5964
|
-
/**
|
|
5965
|
-
* XXX DO NOT USE. This is a temporary stub function.
|
|
5966
|
-
* XXX It WILL be removed in the next major release.
|
|
5967
|
-
*/
|
|
5968
|
-
function destroy() {
|
|
5969
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
5970
|
-
}
|
|
5971
|
-
|
|
5972
|
-
createDebug.enable(createDebug.load());
|
|
5973
|
-
|
|
5974
|
-
return createDebug;
|
|
5975
|
-
}
|
|
5976
|
-
|
|
5977
|
-
var common = setup;
|
|
5978
|
-
|
|
5979
|
-
/* eslint-env browser */
|
|
5980
|
-
|
|
5981
|
-
(function (module, exports) {
|
|
5982
|
-
/**
|
|
5983
|
-
* This is the web browser implementation of `debug()`.
|
|
5984
|
-
*/
|
|
5985
|
-
|
|
5986
|
-
exports.formatArgs = formatArgs;
|
|
5987
|
-
exports.save = save;
|
|
5988
|
-
exports.load = load;
|
|
5989
|
-
exports.useColors = useColors;
|
|
5990
|
-
exports.storage = localstorage();
|
|
5991
|
-
exports.destroy = (() => {
|
|
5992
|
-
let warned = false;
|
|
5993
|
-
|
|
5994
|
-
return () => {
|
|
5995
|
-
if (!warned) {
|
|
5996
|
-
warned = true;
|
|
5997
|
-
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
5998
|
-
}
|
|
5999
|
-
};
|
|
6000
|
-
})();
|
|
6001
|
-
|
|
6002
|
-
/**
|
|
6003
|
-
* Colors.
|
|
6004
|
-
*/
|
|
6005
|
-
|
|
6006
|
-
exports.colors = [
|
|
6007
|
-
'#0000CC',
|
|
6008
|
-
'#0000FF',
|
|
6009
|
-
'#0033CC',
|
|
6010
|
-
'#0033FF',
|
|
6011
|
-
'#0066CC',
|
|
6012
|
-
'#0066FF',
|
|
6013
|
-
'#0099CC',
|
|
6014
|
-
'#0099FF',
|
|
6015
|
-
'#00CC00',
|
|
6016
|
-
'#00CC33',
|
|
6017
|
-
'#00CC66',
|
|
6018
|
-
'#00CC99',
|
|
6019
|
-
'#00CCCC',
|
|
6020
|
-
'#00CCFF',
|
|
6021
|
-
'#3300CC',
|
|
6022
|
-
'#3300FF',
|
|
6023
|
-
'#3333CC',
|
|
6024
|
-
'#3333FF',
|
|
6025
|
-
'#3366CC',
|
|
6026
|
-
'#3366FF',
|
|
6027
|
-
'#3399CC',
|
|
6028
|
-
'#3399FF',
|
|
6029
|
-
'#33CC00',
|
|
6030
|
-
'#33CC33',
|
|
6031
|
-
'#33CC66',
|
|
6032
|
-
'#33CC99',
|
|
6033
|
-
'#33CCCC',
|
|
6034
|
-
'#33CCFF',
|
|
6035
|
-
'#6600CC',
|
|
6036
|
-
'#6600FF',
|
|
6037
|
-
'#6633CC',
|
|
6038
|
-
'#6633FF',
|
|
6039
|
-
'#66CC00',
|
|
6040
|
-
'#66CC33',
|
|
6041
|
-
'#9900CC',
|
|
6042
|
-
'#9900FF',
|
|
6043
|
-
'#9933CC',
|
|
6044
|
-
'#9933FF',
|
|
6045
|
-
'#99CC00',
|
|
6046
|
-
'#99CC33',
|
|
6047
|
-
'#CC0000',
|
|
6048
|
-
'#CC0033',
|
|
6049
|
-
'#CC0066',
|
|
6050
|
-
'#CC0099',
|
|
6051
|
-
'#CC00CC',
|
|
6052
|
-
'#CC00FF',
|
|
6053
|
-
'#CC3300',
|
|
6054
|
-
'#CC3333',
|
|
6055
|
-
'#CC3366',
|
|
6056
|
-
'#CC3399',
|
|
6057
|
-
'#CC33CC',
|
|
6058
|
-
'#CC33FF',
|
|
6059
|
-
'#CC6600',
|
|
6060
|
-
'#CC6633',
|
|
6061
|
-
'#CC9900',
|
|
6062
|
-
'#CC9933',
|
|
6063
|
-
'#CCCC00',
|
|
6064
|
-
'#CCCC33',
|
|
6065
|
-
'#FF0000',
|
|
6066
|
-
'#FF0033',
|
|
6067
|
-
'#FF0066',
|
|
6068
|
-
'#FF0099',
|
|
6069
|
-
'#FF00CC',
|
|
6070
|
-
'#FF00FF',
|
|
6071
|
-
'#FF3300',
|
|
6072
|
-
'#FF3333',
|
|
6073
|
-
'#FF3366',
|
|
6074
|
-
'#FF3399',
|
|
6075
|
-
'#FF33CC',
|
|
6076
|
-
'#FF33FF',
|
|
6077
|
-
'#FF6600',
|
|
6078
|
-
'#FF6633',
|
|
6079
|
-
'#FF9900',
|
|
6080
|
-
'#FF9933',
|
|
6081
|
-
'#FFCC00',
|
|
6082
|
-
'#FFCC33'
|
|
6083
|
-
];
|
|
6084
|
-
|
|
6085
|
-
/**
|
|
6086
|
-
* Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|
6087
|
-
* and the Firebug extension (any Firefox version) are known
|
|
6088
|
-
* to support "%c" CSS customizations.
|
|
6089
|
-
*
|
|
6090
|
-
* TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|
6091
|
-
*/
|
|
6092
|
-
|
|
6093
|
-
// eslint-disable-next-line complexity
|
|
6094
|
-
function useColors() {
|
|
6095
|
-
// NB: In an Electron preload script, document will be defined but not fully
|
|
6096
|
-
// initialized. Since we know we're in Chrome, we'll just detect this case
|
|
6097
|
-
// explicitly
|
|
6098
|
-
if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|
6099
|
-
return true;
|
|
6100
|
-
}
|
|
6101
|
-
|
|
6102
|
-
// Internet Explorer and Edge do not support colors.
|
|
6103
|
-
if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
6104
|
-
return false;
|
|
6105
|
-
}
|
|
6106
|
-
|
|
6107
|
-
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
|
6108
|
-
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|
6109
|
-
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
|
6110
|
-
// Is firebug? http://stackoverflow.com/a/398120/376773
|
|
6111
|
-
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
|
6112
|
-
// Is firefox >= v31?
|
|
6113
|
-
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
6114
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
|
|
6115
|
-
// Double check webkit in userAgent just in case we are in a worker
|
|
6116
|
-
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
|
|
6117
|
-
}
|
|
6118
|
-
|
|
6119
|
-
/**
|
|
6120
|
-
* Colorize log arguments if enabled.
|
|
6121
|
-
*
|
|
6122
|
-
* @api public
|
|
6123
|
-
*/
|
|
6124
|
-
|
|
6125
|
-
function formatArgs(args) {
|
|
6126
|
-
args[0] = (this.useColors ? '%c' : '') +
|
|
6127
|
-
this.namespace +
|
|
6128
|
-
(this.useColors ? ' %c' : ' ') +
|
|
6129
|
-
args[0] +
|
|
6130
|
-
(this.useColors ? '%c ' : ' ') +
|
|
6131
|
-
'+' + module.exports.humanize(this.diff);
|
|
6132
|
-
|
|
6133
|
-
if (!this.useColors) {
|
|
6134
|
-
return;
|
|
6135
|
-
}
|
|
6136
|
-
|
|
6137
|
-
const c = 'color: ' + this.color;
|
|
6138
|
-
args.splice(1, 0, c, 'color: inherit');
|
|
6139
|
-
|
|
6140
|
-
// The final "%c" is somewhat tricky, because there could be other
|
|
6141
|
-
// arguments passed either before or after the %c, so we need to
|
|
6142
|
-
// figure out the correct index to insert the CSS into
|
|
6143
|
-
let index = 0;
|
|
6144
|
-
let lastC = 0;
|
|
6145
|
-
args[0].replace(/%[a-zA-Z%]/g, match => {
|
|
6146
|
-
if (match === '%%') {
|
|
6147
|
-
return;
|
|
6148
|
-
}
|
|
6149
|
-
index++;
|
|
6150
|
-
if (match === '%c') {
|
|
6151
|
-
// We only are interested in the *last* %c
|
|
6152
|
-
// (the user may have provided their own)
|
|
6153
|
-
lastC = index;
|
|
6154
|
-
}
|
|
6155
|
-
});
|
|
6156
|
-
|
|
6157
|
-
args.splice(lastC, 0, c);
|
|
6158
|
-
}
|
|
6159
|
-
|
|
6160
|
-
/**
|
|
6161
|
-
* Invokes `console.debug()` when available.
|
|
6162
|
-
* No-op when `console.debug` is not a "function".
|
|
6163
|
-
* If `console.debug` is not available, falls back
|
|
6164
|
-
* to `console.log`.
|
|
6165
|
-
*
|
|
6166
|
-
* @api public
|
|
6167
|
-
*/
|
|
6168
|
-
exports.log = console.debug || console.log || (() => {});
|
|
6169
|
-
|
|
6170
|
-
/**
|
|
6171
|
-
* Save `namespaces`.
|
|
6172
|
-
*
|
|
6173
|
-
* @param {String} namespaces
|
|
6174
|
-
* @api private
|
|
6175
|
-
*/
|
|
6176
|
-
function save(namespaces) {
|
|
6177
|
-
try {
|
|
6178
|
-
if (namespaces) {
|
|
6179
|
-
exports.storage.setItem('debug', namespaces);
|
|
6180
|
-
} else {
|
|
6181
|
-
exports.storage.removeItem('debug');
|
|
6182
|
-
}
|
|
6183
|
-
} catch (error) {
|
|
6184
|
-
// Swallow
|
|
6185
|
-
// XXX (@Qix-) should we be logging these?
|
|
6186
|
-
}
|
|
6187
|
-
}
|
|
6188
|
-
|
|
6189
|
-
/**
|
|
6190
|
-
* Load `namespaces`.
|
|
6191
|
-
*
|
|
6192
|
-
* @return {String} returns the previously persisted debug modes
|
|
6193
|
-
* @api private
|
|
6194
|
-
*/
|
|
6195
|
-
function load() {
|
|
6196
|
-
let r;
|
|
6197
|
-
try {
|
|
6198
|
-
r = exports.storage.getItem('debug');
|
|
6199
|
-
} catch (error) {
|
|
6200
|
-
// Swallow
|
|
6201
|
-
// XXX (@Qix-) should we be logging these?
|
|
6202
|
-
}
|
|
6203
|
-
|
|
6204
|
-
// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|
6205
|
-
if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|
6206
|
-
r = process.env.DEBUG;
|
|
6207
|
-
}
|
|
6208
|
-
|
|
6209
|
-
return r;
|
|
6210
|
-
}
|
|
6211
|
-
|
|
6212
|
-
/**
|
|
6213
|
-
* Localstorage attempts to return the localstorage.
|
|
6214
|
-
*
|
|
6215
|
-
* This is necessary because safari throws
|
|
6216
|
-
* when a user disables cookies/localstorage
|
|
6217
|
-
* and you attempt to access it.
|
|
6218
|
-
*
|
|
6219
|
-
* @return {LocalStorage}
|
|
6220
|
-
* @api private
|
|
6221
|
-
*/
|
|
6222
|
-
|
|
6223
|
-
function localstorage() {
|
|
6224
|
-
try {
|
|
6225
|
-
// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|
6226
|
-
// The Browser also has localStorage in the global context.
|
|
6227
|
-
return localStorage;
|
|
6228
|
-
} catch (error) {
|
|
6229
|
-
// Swallow
|
|
6230
|
-
// XXX (@Qix-) should we be logging these?
|
|
6231
|
-
}
|
|
6232
|
-
}
|
|
6233
|
-
|
|
6234
|
-
module.exports = common(exports);
|
|
6235
|
-
|
|
6236
|
-
const {formatters} = module.exports;
|
|
6237
|
-
|
|
6238
|
-
/**
|
|
6239
|
-
* Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|
6240
|
-
*/
|
|
6241
|
-
|
|
6242
|
-
formatters.j = function (v) {
|
|
6243
|
-
try {
|
|
6244
|
-
return JSON.stringify(v);
|
|
6245
|
-
} catch (error) {
|
|
6246
|
-
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
6247
|
-
}
|
|
6248
|
-
};
|
|
6249
|
-
} (browser, browser.exports));
|
|
6250
|
-
|
|
6251
|
-
var browserExports = browser.exports;
|
|
6252
|
-
var createDebug = /*@__PURE__*/getDefaultExportFromCjs(browserExports);
|
|
6253
|
-
|
|
6254
|
-
createDebug("foxglove:server");
|
|
6255
|
-
new TextEncoder();
|
|
6256
|
-
({
|
|
6257
|
-
subscribe: undefined,
|
|
6258
|
-
unsubscribe: undefined,
|
|
6259
|
-
advertise: ServerCapability.clientPublish,
|
|
6260
|
-
unadvertise: ServerCapability.clientPublish,
|
|
6261
|
-
[ClientBinaryOpcode.MESSAGE_DATA]: ServerCapability.clientPublish,
|
|
6262
|
-
getParameters: ServerCapability.parameters,
|
|
6263
|
-
setParameters: ServerCapability.parameters,
|
|
6264
|
-
subscribeParameterUpdates: ServerCapability.parametersSubscribe,
|
|
6265
|
-
unsubscribeParameterUpdates: ServerCapability.parametersSubscribe,
|
|
6266
|
-
[ClientBinaryOpcode.SERVICE_CALL_REQUEST]: ServerCapability.services,
|
|
6267
|
-
subscribeConnectionGraph: ServerCapability.connectionGraph,
|
|
6268
|
-
unsubscribeConnectionGraph: ServerCapability.connectionGraph,
|
|
6269
|
-
fetchAsset: ServerCapability.assets,
|
|
6270
|
-
});
|
|
6271
|
-
|
|
6272
|
-
export { BinaryOpcode as B, ClientBinaryOpcode as C, EventEmitter as E, FoxgloveClient as F, PointsAnnotationType as P, Type as T, getDefaultExportFromCjs as a, Profile as b, commonjsGlobal as c, getAugmentedNamespace as g, protobufsBySchema as p };
|
|
5072
|
+
export { PointsAnnotationType as P, Type as T, Profile as a, protobufsBySchema as p };
|