@depz/camera-sdk-darwin-arm64 0.0.0-stage → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/LICENSE +182 -0
  2. package/README.md +2 -2
  3. package/depz-engines/libdepz_engine_onnx.dylib +0 -0
  4. package/depz-engines/libdepz_engine_openvino.dylib +0 -0
  5. package/depz_node.node +0 -0
  6. package/doc/EULA +182 -0
  7. package/doc/LICENSE +202 -0
  8. package/doc/NOTICE +41 -0
  9. package/doc/c/api.md +5018 -0
  10. package/doc/c/clarity/api.md +17 -0
  11. package/doc/c/clarity/guide.md +73 -0
  12. package/doc/c/clarity/introduction.md +24 -0
  13. package/doc/c/guide.md +125 -0
  14. package/doc/c/intro.md +62 -0
  15. package/doc/c/minima/api.md +17 -0
  16. package/doc/c/minima/guide.md +83 -0
  17. package/doc/c/minima/introduction.md +26 -0
  18. package/doc/c/odin/api.md +17 -0
  19. package/doc/c/odin/guide.md +44 -0
  20. package/doc/c/odin/introduction.md +24 -0
  21. package/doc/c/odin-mini/api.md +17 -0
  22. package/doc/c/odin-mini/guide.md +44 -0
  23. package/doc/c/odin-mini/introduction.md +24 -0
  24. package/doc/c/varius/api.md +17 -0
  25. package/doc/c/varius/guide.md +83 -0
  26. package/doc/c/varius/introduction.md +70 -0
  27. package/doc/c/varius-v/api.md +17 -0
  28. package/doc/c/varius-v/guide.md +85 -0
  29. package/doc/c/varius-v/introduction.md +32 -0
  30. package/doc/cpp/api.md +1922 -0
  31. package/doc/cpp/clarity/api.md +14 -0
  32. package/doc/cpp/clarity/guide.md +73 -0
  33. package/doc/cpp/clarity/introduction.md +24 -0
  34. package/doc/cpp/guide.md +88 -0
  35. package/doc/cpp/intro.md +29 -0
  36. package/doc/cpp/minima/api.md +14 -0
  37. package/doc/cpp/minima/guide.md +83 -0
  38. package/doc/cpp/minima/introduction.md +26 -0
  39. package/doc/cpp/odin/api.md +14 -0
  40. package/doc/cpp/odin/guide.md +44 -0
  41. package/doc/cpp/odin/introduction.md +24 -0
  42. package/doc/cpp/odin-mini/api.md +14 -0
  43. package/doc/cpp/odin-mini/guide.md +44 -0
  44. package/doc/cpp/odin-mini/introduction.md +24 -0
  45. package/doc/cpp/varius/api.md +14 -0
  46. package/doc/cpp/varius/guide.md +83 -0
  47. package/doc/cpp/varius/introduction.md +70 -0
  48. package/doc/cpp/varius-v/api.md +14 -0
  49. package/doc/cpp/varius-v/guide.md +85 -0
  50. package/doc/cpp/varius-v/introduction.md +32 -0
  51. package/doc/third_party/eigen/COPYING.MPL2 +373 -0
  52. package/doc/third_party/eigen/COPYING.README +18 -0
  53. package/doc/third_party/miniz/LICENSE +22 -0
  54. package/doc/third_party/nlohmann_json/LICENSE.MIT +21 -0
  55. package/doc/third_party/opencv/SoftFloat-COPYING.txt +36 -0
  56. package/doc/third_party/opencv/dlpack-LICENSE +201 -0
  57. package/doc/third_party/opencv/features2d-LICENSE.AKAZE +26 -0
  58. package/doc/third_party/opencv/features2d-LICENSE.KAZE +26 -0
  59. package/doc/third_party/opencv/libjpeg-turbo-LICENSE.md +135 -0
  60. package/doc/third_party/opencv/libjpeg-turbo-README.ijg +260 -0
  61. package/doc/third_party/opencv/libjpeg-turbo-README.md +375 -0
  62. package/doc/third_party/opencv/mscr-chi_table_LICENSE.txt +28 -0
  63. package/doc/third_party/opencv/zlib-LICENSE +22 -0
  64. package/libdepz.1.dylib +0 -0
  65. package/libdepz_depth.1.dylib +0 -0
  66. package/libdepz_inference.1.dylib +0 -0
  67. package/package.json +25 -4
package/doc/cpp/api.md ADDED
@@ -0,0 +1,1922 @@
1
+ <!-- SPDX-License-Identifier: Apache-2.0 -->
2
+ <!-- GENERATED from the headers in include/depz/. Do not edit. -->
3
+ # API reference
4
+
5
+ Generated from the public header `depz/depz.hpp` (`include/depz/`), the
6
+ header-only C++17 wrapper over the C API: its declarations and doc-comments. Edit
7
+ the doc-comments in the header, not this file.
8
+
9
+ ## Contents
10
+
11
+ - **Errors**: [`ErrorCode`](#errorcode), [`code_name`](#code_name), [`DepzError`](#depzerror)
12
+ - **The records: the C structs under the reference's names**: [`CaptureMode`](#capturemode), [`SourceInfo`](#sourceinfo), [`FrameTiming`](#frametiming), [`PipelineInfo`](#pipelineinfo), [`PipelineMetrics`](#pipelinemetrics), [`Control`](#control), [`RecalibrationConfig`](#recalibrationconfig), [`RecalibrationStatus`](#recalibrationstatus), [`RecalibrationEvent`](#recalibrationevent), [`RecordingStatus`](#recordingstatus), [`RecordingResult`](#recordingresult), [`EngineInfo`](#engineinfo), [`ModelVariantInfo`](#modelvariantinfo), [`PipelineConfig`](#pipelineconfig), [`ReplayOptions`](#replayoptions), [`pipeline_config`](#pipeline_config), [`replay_options`](#replay_options), [`recalibration_config`](#recalibration_config)
13
+ - **Base: depz/depz.h**: [`version`](#version), [`host_clock_ns`](#host_clock_ns), [`Context`](#context), [`Calibration`](#calibration), [`CameraInfo`](#camerainfo), [`CameraStatus`](#camerastatus), [`scan_cameras`](#scan_cameras), [`find_camera`](#find_camera), [`Frame`](#frame), [`board_info`](#board_info), [`Source`](#source), [`StageHandle`](#stagehandle), [`Recording`](#recording), [`CameraModel`](#cameramodel), [`camera_model_of_serial`](#camera_model_of_serial), [`camera_model_of_pid`](#camera_model_of_pid), [`camera_model_of_sku`](#camera_model_of_sku), [`ControlSet`](#controlset), [`Recalibration`](#recalibration), [`Pipeline`](#pipeline)
14
+ - **Inference: depz/inference.h**: [`Inference`](#inference), [`EngineOutputs`](#engineoutputs), [`EngineSession`](#enginesession), [`ModelInfo`](#modelinfo), [`list_models`](#list_models), [`is_model_cached`](#is_model_cached), [`download_model`](#download_model), [`describe_engines`](#describe_engines), [`ModelSupport`](#modelsupport), [`model_support`](#model_support), [`InputSizes`](#inputsizes), [`model_input_sizes`](#model_input_sizes), [`model_files`](#model_files), [`ModelDefault`](#modeldefault), [`model_default`](#model_default), [`EngineSlug`](#engineslug), [`parse_engine_slug`](#parse_engine_slug)
15
+ - **Depth: depz/depth.h**: [`make_depth_stage`](#make_depth_stage)
16
+ - **Extensions**: [`FrameSource`](#framesource), [`make_source`](#make_source), [`mkv_source`](#mkv_source), [`StageGeometry`](#stagegeometry), [`Stage`](#stage), [`make_stage`](#make_stage), [`EngineModel`](#enginemodel), [`Engine`](#engine), [`register_engine`](#register_engine), [`unregister_engine`](#unregister_engine), [`Model`](#model), [`make_inference`](#make_inference)
17
+
18
+ ## Conventions
19
+
20
+ DEPZ Camera SDK - the C++ wrapper of the C API (header only).
21
+
22
+ Over depz/depz.h, depz/inference.h and depz/depth.h: RAII handles (a handle
23
+ releases its reference when it goes), failures as one exception type,
24
+ DepzError(code, message, details), with ErrorCode - the reference's model
25
+ (Python depz_camera_sdk.DepzError, ErrorCode; c_api.md section 6) - and
26
+ base classes for the extensions (Python: FrameSource, Stage,
27
+ InferenceEngine, DepthInferenceBase; c_api.md section 12).
28
+
29
+ C++17 or later. Only what a program calls is linked: a program that uses
30
+ only the base needs only libdepz.
31
+
32
+ ## Errors
33
+
34
+ ### ErrorCode
35
+
36
+ ```cpp
37
+ enum class ErrorCode : depz_status {
38
+ OK = DEPZ_OK,
39
+ /* BEGIN errors.json */
40
+ ABORTED = DEPZ_E_ABORTED,
41
+ DOWNLOAD_FAILED = DEPZ_E_DOWNLOAD_FAILED,
42
+ LEGACY_CAMERA = DEPZ_E_LEGACY_CAMERA,
43
+ INVALID_SERIAL = DEPZ_E_INVALID_SERIAL,
44
+ UNRECOGNISED_CAMERA = DEPZ_E_UNRECOGNISED_CAMERA,
45
+ CAMERA_NOT_FOUND = DEPZ_E_CAMERA_NOT_FOUND,
46
+ CAMERA_BUSY = DEPZ_E_CAMERA_BUSY,
47
+ CAMERA_PERMISSION_DENIED = DEPZ_E_CAMERA_PERMISSION_DENIED,
48
+ NO_CALIBRATION = DEPZ_E_NO_CALIBRATION,
49
+ UNSUPPORTED_SCHEME = DEPZ_E_UNSUPPORTED_SCHEME,
50
+ UNKNOWN_CAMERA_FAMILY = DEPZ_E_UNKNOWN_CAMERA_FAMILY,
51
+ USB_BANDWIDTH = DEPZ_E_USB_BANDWIDTH,
52
+ NO_FRAMES = DEPZ_E_NO_FRAMES,
53
+ CAPTURE_STOPPED = DEPZ_E_CAPTURE_STOPPED,
54
+ RECORDING_NEEDS_MIGRATION = DEPZ_E_RECORDING_NEEDS_MIGRATION,
55
+ RECALIBRATION_DEFERRED = DEPZ_E_RECALIBRATION_DEFERRED,
56
+ MODEL_NEEDS_STEREO = DEPZ_E_MODEL_NEEDS_STEREO,
57
+ RECORDING_UNSUPPORTED = DEPZ_E_RECORDING_UNSUPPORTED,
58
+ MODEL_NOT_OFFERED = DEPZ_E_MODEL_NOT_OFFERED,
59
+ MODE_NOT_OFFERED = DEPZ_E_MODE_NOT_OFFERED,
60
+ CALIBRATION_MALFORMED = DEPZ_E_CALIBRATION_MALFORMED,
61
+ CALIBRATION_WEB = DEPZ_E_CALIBRATION_WEB,
62
+ FLASH_DEVICE = DEPZ_E_FLASH_DEVICE,
63
+ FIRMWARE_IMAGE = DEPZ_E_FIRMWARE_IMAGE,
64
+ FLASH_ABORTED = DEPZ_E_FLASH_ABORTED,
65
+ UNAVAILABLE = DEPZ_E_UNAVAILABLE,
66
+ UNSUPPORTED_PLATFORM = DEPZ_E_UNSUPPORTED_PLATFORM,
67
+ INVALID_ARGUMENT = DEPZ_E_INVALID_ARGUMENT,
68
+ NOT_FOUND = DEPZ_E_NOT_FOUND,
69
+ IO_ERROR = DEPZ_E_IO_ERROR,
70
+ TIMEOUT = DEPZ_E_TIMEOUT,
71
+ INTERNAL = DEPZ_E_INTERNAL,
72
+ INVALID_STATE = DEPZ_E_INVALID_STATE,
73
+ BUSY = DEPZ_E_BUSY,
74
+ NOT_IMPLEMENTED = DEPZ_E_NOT_IMPLEMENTED,
75
+ UNSUPPORTED_VERSION = DEPZ_E_UNSUPPORTED_VERSION,
76
+ END_OF_STREAM = DEPZ_E_END_OF_STREAM,
77
+ ENGINE_BUILD_FAILED = DEPZ_E_ENGINE_BUILD_FAILED,
78
+ INVALID_DATA = DEPZ_E_INVALID_DATA,
79
+ CALIBRATION_FAILED = DEPZ_E_CALIBRATION_FAILED
80
+ /* END errors.json */
81
+ };
82
+ ```
83
+
84
+ The error codes: the C status values; the names of contracts/errors.json
85
+ upper-cased, as Python's ErrorCode members. GENERATED by
86
+ scripts/export_contracts.py (the block between the markers).
87
+
88
+ ### code_name
89
+
90
+ ```cpp
91
+ inline const char *code_name(ErrorCode c) noexcept;
92
+ ```
93
+
94
+ The code's name as in errors.json ("camera_busy").
95
+
96
+ ### DepzError
97
+
98
+ ```cpp
99
+ class DepzError : public std::runtime_error {
100
+ // (no public data members)
101
+ };
102
+ ```
103
+
104
+ The one exception of the SDK: code, message (short English, for logs) and
105
+ details (a JSON object).
106
+
107
+ #### DepzError.DepzError
108
+
109
+ ```cpp
110
+ DepzError(ErrorCode code, const std::string &message, std::string details = "{}");
111
+ ```
112
+
113
+ #### DepzError.code
114
+
115
+ ```cpp
116
+ ErrorCode code() const noexcept;
117
+ ```
118
+
119
+ #### DepzError.message
120
+
121
+ ```cpp
122
+ std::string message() const;
123
+ ```
124
+
125
+ #### DepzError.details
126
+
127
+ ```cpp
128
+ const std::string &details() const noexcept;
129
+ ```
130
+
131
+ #### DepzError.last
132
+
133
+ ```cpp
134
+ static DepzError last(depz_status s);
135
+ ```
136
+
137
+ The failure of the last call on this thread that returned s.
138
+
139
+ ## The records: the C structs under the reference's names
140
+
141
+ (contracts/sdk/bindings/cpp_map.json: each alias's Python class)
142
+
143
+ ### CaptureMode
144
+
145
+ ```cpp
146
+ using CaptureMode = depz_mode_t;
147
+ ```
148
+
149
+ ### SourceInfo
150
+
151
+ ```cpp
152
+ using SourceInfo = depz_source_info_t;
153
+ ```
154
+
155
+ ### FrameTiming
156
+
157
+ ```cpp
158
+ using FrameTiming = depz_frame_timing_t;
159
+ ```
160
+
161
+ ### PipelineInfo
162
+
163
+ ```cpp
164
+ using PipelineInfo = depz_pipeline_info_t;
165
+ ```
166
+
167
+ ### PipelineMetrics
168
+
169
+ ```cpp
170
+ using PipelineMetrics = depz_pipeline_metrics_t;
171
+ ```
172
+
173
+ ### Control
174
+
175
+ ```cpp
176
+ using Control = depz_control_t;
177
+ ```
178
+
179
+ ### RecalibrationConfig
180
+
181
+ ```cpp
182
+ using RecalibrationConfig = depz_recal_config_t;
183
+ ```
184
+
185
+ ### RecalibrationStatus
186
+
187
+ ```cpp
188
+ using RecalibrationStatus = depz_recal_status_t;
189
+ ```
190
+
191
+ ### RecalibrationEvent
192
+
193
+ ```cpp
194
+ using RecalibrationEvent = depz_recal_event_t;
195
+ ```
196
+
197
+ ### RecordingStatus
198
+
199
+ ```cpp
200
+ using RecordingStatus = depz_recording_status_t;
201
+ ```
202
+
203
+ ### RecordingResult
204
+
205
+ ```cpp
206
+ using RecordingResult = depz_recording_result_t;
207
+ ```
208
+
209
+ ### EngineInfo
210
+
211
+ ```cpp
212
+ using EngineInfo = depz_engine_info_t;
213
+ ```
214
+
215
+ ### ModelVariantInfo
216
+
217
+ ```cpp
218
+ using ModelVariantInfo = depz_model_variant_t;
219
+ ```
220
+
221
+ ### PipelineConfig
222
+
223
+ ```cpp
224
+ using PipelineConfig = depz_pipeline_config_t;
225
+ ```
226
+
227
+ ### ReplayOptions
228
+
229
+ ```cpp
230
+ using ReplayOptions = depz_replay_options_t;
231
+ ```
232
+
233
+ ### pipeline_config
234
+
235
+ ```cpp
236
+ inline PipelineConfig pipeline_config();
237
+ ```
238
+
239
+ The option records with every default set (their C \*\_init).
240
+
241
+ ### replay_options
242
+
243
+ ```cpp
244
+ inline ReplayOptions replay_options();
245
+ ```
246
+
247
+ See [`pipeline_config`](#pipeline_config).
248
+
249
+ ### recalibration_config
250
+
251
+ ```cpp
252
+ inline RecalibrationConfig recalibration_config();
253
+ ```
254
+
255
+ See [`pipeline_config`](#pipeline_config).
256
+
257
+ ## Base: depz/depz.h
258
+
259
+ ### version
260
+
261
+ ```cpp
262
+ inline const char *version() noexcept;
263
+ ```
264
+
265
+ ### host_clock_ns
266
+
267
+ ```cpp
268
+ inline int64_t host_clock_ns() noexcept;
269
+ ```
270
+
271
+ ### Context
272
+
273
+ ```cpp
274
+ class Context : public detail::Handle<depz_context, depz_context_release> {
275
+ // (no public data members)
276
+ };
277
+ ```
278
+
279
+ #### Context.create
280
+
281
+ ```cpp
282
+ static Context create(const depz_config_t *cfg = nullptr);
283
+ ```
284
+
285
+ cfg nullptr: the defaults (depz_config_init).
286
+
287
+ ### Calibration
288
+
289
+ ```cpp
290
+ class Calibration : public detail::Handle<depz_calibration, depz_calibration_release> {
291
+ // (no public data members)
292
+ };
293
+ ```
294
+
295
+ A calibration: a value; every change makes a new one (Python: Calibration).
296
+
297
+ #### Calibration.from_json
298
+
299
+ ```cpp
300
+ static Calibration from_json(const std::string &json);
301
+ ```
302
+
303
+ #### Calibration.info
304
+
305
+ ```cpp
306
+ depz_calibration_info_t info() const;
307
+ ```
308
+
309
+ #### Calibration.is_stereo
310
+
311
+ ```cpp
312
+ bool is_stereo() const;
313
+ ```
314
+
315
+ #### Calibration.baseline_m
316
+
317
+ ```cpp
318
+ double baseline_m() const;
319
+ ```
320
+
321
+ 0 for a mono calibration.
322
+
323
+ #### Calibration.lens_model
324
+
325
+ ```cpp
326
+ std::string lens_model() const;
327
+ ```
328
+
329
+ "opencv5", "opencv8", "kb4", "eucm", "splined" (Python: LensModel's value).
330
+
331
+ #### Calibration.image_width
332
+
333
+ ```cpp
334
+ int32_t image_width() const;
335
+ ```
336
+
337
+ #### Calibration.image_height
338
+
339
+ ```cpp
340
+ int32_t image_height() const;
341
+ ```
342
+
343
+ #### Calibration.to_json
344
+
345
+ ```cpp
346
+ std::string to_json() const;
347
+ ```
348
+
349
+ The SDK calibration JSON (contracts/calibration/sdk_json.md).
350
+
351
+ #### Calibration.rescaled
352
+
353
+ ```cpp
354
+ Calibration rescaled(int32_t width, int32_t height) const;
355
+ ```
356
+
357
+ #### Calibration.controls
358
+
359
+ ```cpp
360
+ std::vector<depz_control_t> controls() const;
361
+ ```
362
+
363
+ #### Calibration.control_enum_member
364
+
365
+ ```cpp
366
+ depz_enum_member_t control_enum_member(const char *name, size_t i) const;
367
+ ```
368
+
369
+ #### Calibration.with_control
370
+
371
+ ```cpp
372
+ Calibration with_control(const char *name, double value) const;
373
+ ```
374
+
375
+ ```cpp
376
+ Calibration with_control(const char *name, const char *value) const;
377
+ ```
378
+
379
+ #### Calibration.with_canvas
380
+
381
+ ```cpp
382
+ Calibration with_canvas(const depz_canvas_options_t &opt) const;
383
+ ```
384
+
385
+ #### Calibration.canvas_layout
386
+
387
+ ```cpp
388
+ depz_canvas_layout_t canvas_layout() const;
389
+ ```
390
+
391
+ #### Calibration.canvas_projection
392
+
393
+ ```cpp
394
+ bool canvas_projection(depz_eye eye, double out[12]) const;
395
+ ```
396
+
397
+ The eye's canvas projection (3 x 4, row major); false for a latitude-longitude canvas.
398
+
399
+ #### Calibration.canvas_map
400
+
401
+ ```cpp
402
+ void canvas_map(depz_eye eye, std::vector<int16_t> &xy, std::vector<uint16_t> &index) const;
403
+ ```
404
+
405
+ The fixed-point maps of an eye: xy (2 per pixel), index (1 per pixel).
406
+
407
+ #### Calibration.rectify
408
+
409
+ ```cpp
410
+ void rectify(depz_eye eye, const depz_image_t &raw, void *out, int32_t out_stride_bytes) const;
411
+ ```
412
+
413
+ #### Calibration.disparity_to_depth
414
+
415
+ ```cpp
416
+ void disparity_to_depth(const float *disparity, int32_t width, int32_t height, float *depth) const;
417
+ ```
418
+
419
+ #### Calibration.depth_to_point_cloud
420
+
421
+ ```cpp
422
+ void depth_to_point_cloud(const float *depth, int32_t width, int32_t height, float *points) const;
423
+ ```
424
+
425
+ ### CameraInfo
426
+
427
+ ```cpp
428
+ class CameraInfo : public detail::Handle<depz_camera, depz_camera_release> {
429
+ // (no public data members)
430
+ };
431
+ ```
432
+
433
+ A resolved camera: identity, capture modes, calibration; holds no device open.
434
+ Python: CameraInfo.
435
+
436
+ #### CameraInfo.info
437
+
438
+ ```cpp
439
+ depz_camera_info_t info() const;
440
+ ```
441
+
442
+ #### CameraInfo.serial
443
+
444
+ ```cpp
445
+ std::string serial() const;
446
+ ```
447
+
448
+ #### CameraInfo.name
449
+
450
+ ```cpp
451
+ std::string name() const;
452
+ ```
453
+
454
+ #### CameraInfo.camera_family
455
+
456
+ ```cpp
457
+ std::string camera_family() const;
458
+ ```
459
+
460
+ "varius", "minima", "clarity", "odin", "odin_mini".
461
+
462
+ #### CameraInfo.eye_rotation_deg
463
+
464
+ ```cpp
465
+ int32_t eye_rotation_deg() const;
466
+ ```
467
+
468
+ 0, 90, -90 (a Varius V: the SDK turns its eyes).
469
+
470
+ #### CameraInfo.is_stereo
471
+
472
+ ```cpp
473
+ bool is_stereo() const;
474
+ ```
475
+
476
+ #### CameraInfo.modes
477
+
478
+ ```cpp
479
+ std::vector<CaptureMode> modes() const;
480
+ ```
481
+
482
+ The capture modes the SDK offers, the default one marked (is_default).
483
+
484
+ #### CameraInfo.mode
485
+
486
+ ```cpp
487
+ CaptureMode mode() const;
488
+ ```
489
+
490
+ The default capture mode.
491
+
492
+ #### CameraInfo.base_calibration
493
+
494
+ ```cpp
495
+ Calibration base_calibration() const;
496
+ ```
497
+
498
+ The calibration stored in the camera.
499
+
500
+ #### CameraInfo.source
501
+
502
+ ```cpp
503
+ Source source(const char *mode_slug = nullptr, int32_t eye_w = 0, int32_t eye_h = 0) const;
504
+ ```
505
+
506
+ Its live source (Python: CameraSource(camera_info, mode=...)). mode_slug nullptr: the
507
+ default mode; eye_w, eye_h 0, 0: the camera's rule. Opens nothing.
508
+
509
+ ### CameraStatus
510
+
511
+ ```cpp
512
+ struct CameraStatus {
513
+ std::string serial; /* "" for a unit that shows none */
514
+ std::string name;
515
+ depz_camera_state state = DEPZ_CAMERA_UNUSABLE;
516
+ ErrorCode code = ErrorCode::OK; /* OK for a usable camera, else why not */
517
+ std::string message; /* the code's name, for logs */
518
+ std::optional<CameraInfo> camera; /* the resolved camera when usable */
519
+ };
520
+ ```
521
+
522
+ One attached camera and what it can be used for. Python: CameraStatus (camera, code,
523
+ message).
524
+
525
+ #### CameraStatus.usable
526
+
527
+ ```cpp
528
+ bool usable() const noexcept;
529
+ ```
530
+
531
+ ### scan_cameras
532
+
533
+ ```cpp
534
+ inline std::vector<CameraStatus> scan_cameras(const Context &ctx);
535
+ ```
536
+
537
+ Every attached DEPZ camera, in the order the system lists them; each one resolved (with
538
+ the closed part: its flash read). Python: scan_cameras().
539
+
540
+ ### find_camera
541
+
542
+ ```cpp
543
+ inline CameraInfo find_camera(const Context &ctx, const std::string &serial = "");
544
+ ```
545
+
546
+ The attached camera with this serial (letter case ignored), freshly resolved; "" the
547
+ first usable one. None: DepzError(CAMERA_NOT_FOUND). Python: find_camera().
548
+
549
+ ### Frame
550
+
551
+ ```cpp
552
+ class Frame {
553
+ // (no public data members)
554
+ };
555
+ ```
556
+
557
+ A frame: copying it takes one more reference.
558
+
559
+ #### Frame.Frame
560
+
561
+ ```cpp
562
+ explicit Frame(depz_frame *f) noexcept;
563
+ ```
564
+
565
+ takes the reference
566
+
567
+ #### Frame.borrow
568
+
569
+ ```cpp
570
+ static Frame borrow(depz_frame *f) noexcept;
571
+ ```
572
+
573
+ #### Frame.get
574
+
575
+ ```cpp
576
+ depz_frame *get() const noexcept;
577
+ ```
578
+
579
+ #### Frame.info
580
+
581
+ ```cpp
582
+ depz_frame_info_t info() const;
583
+ ```
584
+
585
+ #### Frame.timing
586
+
587
+ ```cpp
588
+ FrameTiming timing() const;
589
+ ```
590
+
591
+ #### Frame.has_image
592
+
593
+ ```cpp
594
+ bool has_image(depz_image_kind kind) const noexcept;
595
+ ```
596
+
597
+ #### Frame.image
598
+
599
+ ```cpp
600
+ depz_image_t image(depz_image_kind kind) const;
601
+ ```
602
+
603
+ Valid while this frame (or a copy) lives.
604
+
605
+ #### Frame.put_image
606
+
607
+ ```cpp
608
+ void put_image(depz_image_kind kind, const depz_image_t &img);
609
+ ```
610
+
611
+ Only inside a stage's process (depz_frame_put_image).
612
+
613
+ ### board_info
614
+
615
+ ```cpp
616
+ inline depz_board_info_t board_info();
617
+ ```
618
+
619
+ ### Source
620
+
621
+ ```cpp
622
+ class Source : public detail::Handle<depz_source, depz_source_release> {
623
+ // (no public data members)
624
+ };
625
+ ```
626
+
627
+ #### Source.open
628
+
629
+ ```cpp
630
+ void open();
631
+ ```
632
+
633
+ #### Source.grab
634
+
635
+ ```cpp
636
+ Frame grab(int32_t timeout_ms);
637
+ ```
638
+
639
+ #### Source.close
640
+
641
+ ```cpp
642
+ void close();
643
+ ```
644
+
645
+ #### Source.info
646
+
647
+ ```cpp
648
+ SourceInfo info() const;
649
+ ```
650
+
651
+ #### Source.recording_tracks_json
652
+
653
+ ```cpp
654
+ std::string recording_tracks_json() const;
655
+ ```
656
+
657
+ A recording's tracks ({title: [[pts_us, packet], ...]}; "{}" before open) and the
658
+ camera.json it carries. Python: MkvSource.recording_tracks(), embedded_camera_info.
659
+
660
+ #### Source.embedded_camera_info_json
661
+
662
+ ```cpp
663
+ std::string embedded_camera_info_json() const;
664
+ ```
665
+
666
+ #### Source.recorded_camera_controls_json
667
+
668
+ ```cpp
669
+ std::string recorded_camera_controls_json() const;
670
+ ```
671
+
672
+ A recording's camera controls and pipeline settings at its position, as JSON
673
+ ("{}" before the first packet). Python: MkvSource.recorded_camera_controls,
674
+ recorded_pipeline.
675
+
676
+ #### Source.recorded_pipeline_json
677
+
678
+ ```cpp
679
+ std::string recorded_pipeline_json() const;
680
+ ```
681
+
682
+ #### Source.replay_info
683
+
684
+ ```cpp
685
+ depz_replay_info_t replay_info() const;
686
+ ```
687
+
688
+ A recording's replay, asked without a grab (Python: MkvSource.frame_count, ...).
689
+
690
+ #### Source.base_calibration
691
+
692
+ ```cpp
693
+ Calibration base_calibration() const;
694
+ ```
695
+
696
+ None (an empty handle) when the source has none (DEPZ_E_UNAVAILABLE).
697
+
698
+ #### Source.active_calibration
699
+
700
+ ```cpp
701
+ Calibration active_calibration() const;
702
+ ```
703
+
704
+ #### Source.pause
705
+
706
+ ```cpp
707
+ void pause();
708
+ ```
709
+
710
+ Replay control (Python: MkvSource.pause, resume, seek_relative_us, step_one_forward / \_backward).
711
+
712
+ #### Source.resume
713
+
714
+ ```cpp
715
+ void resume();
716
+ ```
717
+
718
+ #### Source.seek_us
719
+
720
+ ```cpp
721
+ void seek_us(int64_t pts_us);
722
+ ```
723
+
724
+ #### Source.seek_frame
725
+
726
+ ```cpp
727
+ void seek_frame(int64_t frame);
728
+ ```
729
+
730
+ #### Source.step
731
+
732
+ ```cpp
733
+ void step(int32_t direction);
734
+ ```
735
+
736
+ #### Source.set_loop
737
+
738
+ ```cpp
739
+ void set_loop(bool loop);
740
+ ```
741
+
742
+ #### Source.list_camera_controls
743
+
744
+ ```cpp
745
+ std::vector<Control> list_camera_controls() const;
746
+ ```
747
+
748
+ Its camera controls (Python: CameraSource.list_camera_controls, camera_controls
749
+ get / set): depz_source_controls\_\*.
750
+
751
+ #### Source.camera_control
752
+
753
+ ```cpp
754
+ Control camera_control(const std::string &name) const;
755
+ ```
756
+
757
+ #### Source.set_camera_control
758
+
759
+ ```cpp
760
+ void set_camera_control(const std::string &name, double value);
761
+ ```
762
+
763
+ #### Source.set_initial_controls_json
764
+
765
+ ```cpp
766
+ void set_initial_controls_json(const std::string &values_json);
767
+ ```
768
+
769
+ values_json {name: value}: applied at every open (Python: CameraSource(initial_controls=...)).
770
+
771
+ #### Source.set_exposure_poll_ns
772
+
773
+ ```cpp
774
+ void set_exposure_poll_ns(int64_t poll_ns);
775
+ ```
776
+
777
+ How often the capture reads the timing controls back, ns; 0: only at the open
778
+ (Python: CameraSource(exposure_poll_s=...)).
779
+
780
+ #### Source.set_base_calibration
781
+
782
+ ```cpp
783
+ void set_base_calibration(const Calibration &cal, bool has_correction_store);
784
+ ```
785
+
786
+ A live camera's base calibration in place of the camera's own (an empty Calibration:
787
+ the camera's own again); has_correction_store only with the camera's own calibration.
788
+
789
+ ### StageHandle
790
+
791
+ ```cpp
792
+ class StageHandle : public detail::Handle<depz_stage, depz_stage_release> {
793
+ // (no public data members)
794
+ };
795
+ ```
796
+
797
+ #### StageHandle.info
798
+
799
+ ```cpp
800
+ std::string info() const;
801
+ ```
802
+
803
+ ### Recording
804
+
805
+ ```cpp
806
+ class Recording {
807
+ // (no public data members)
808
+ };
809
+ ```
810
+
811
+ A pipeline's recording (c_api.md section 9a). Python: pipeline.recording, the
812
+ Recording handle. A view: valid while its Pipeline is.
813
+
814
+ #### Recording.Recording
815
+
816
+ ```cpp
817
+ explicit Recording(depz_pipeline *p);
818
+ ```
819
+
820
+ #### Recording.start
821
+
822
+ ```cpp
823
+ void start(const std::string &path, const char *camera_controls_json = nullptr);
824
+ ```
825
+
826
+ camera_controls_json nullptr: as the camera reports them.
827
+
828
+ #### Recording.stop
829
+
830
+ ```cpp
831
+ RecordingResult stop();
832
+ ```
833
+
834
+ #### Recording.pause
835
+
836
+ ```cpp
837
+ void pause();
838
+ ```
839
+
840
+ #### Recording.resume
841
+
842
+ ```cpp
843
+ void resume();
844
+ ```
845
+
846
+ #### Recording.status
847
+
848
+ ```cpp
849
+ RecordingStatus status();
850
+ ```
851
+
852
+ Idle: all zero (Python: None).
853
+
854
+ #### Recording.capture_still
855
+
856
+ ```cpp
857
+ RecordingResult capture_still(const std::string &path, int32_t timeout_ms = 2000);
858
+ ```
859
+
860
+ ### CameraModel
861
+
862
+ ```cpp
863
+ struct CameraModel {
864
+ depz_camera_model_t record{};
865
+ std::vector<std::string> former_skus;
866
+ };
867
+ ```
868
+
869
+ The catalog's camera models (Python: CameraModel, camera_model_of_serial / \_of_pid /
870
+ \_of_sku). Each lookup: false when the catalog has no such model.
871
+
872
+ ### camera_model_of_serial
873
+
874
+ ```cpp
875
+ inline bool camera_model_of_serial(const char *serial, CameraModel &out);
876
+ ```
877
+
878
+ ### camera_model_of_pid
879
+
880
+ ```cpp
881
+ inline bool camera_model_of_pid(const char *pid, CameraModel &out);
882
+ ```
883
+
884
+ ### camera_model_of_sku
885
+
886
+ ```cpp
887
+ inline bool camera_model_of_sku(const char *sku, CameraModel &out);
888
+ ```
889
+
890
+ ### ControlSet
891
+
892
+ ```cpp
893
+ class ControlSet {
894
+ // (no public data members)
895
+ };
896
+ ```
897
+
898
+ The controls of one owner (a scope; a filter's slug or a stage's name with it). Python:
899
+ ControlSet. A view: valid while its Pipeline is.
900
+
901
+ #### ControlSet.ControlSet
902
+
903
+ ```cpp
904
+ ControlSet(depz_pipeline *p, depz_scope scope, std::string owner = "");
905
+ ```
906
+
907
+ #### ControlSet.scope
908
+
909
+ ```cpp
910
+ depz_scope scope() const noexcept;
911
+ ```
912
+
913
+ #### ControlSet.list
914
+
915
+ ```cpp
916
+ std::vector<Control> list() const;
917
+ ```
918
+
919
+ #### ControlSet.get
920
+
921
+ ```cpp
922
+ Control get(const std::string &name) const;
923
+ ```
924
+
925
+ #### ControlSet.enum_values
926
+
927
+ ```cpp
928
+ std::vector<depz_enum_member_t> enum_values(const std::string &name) const;
929
+ ```
930
+
931
+ The members of an enum control (Python: Control.enum_values).
932
+
933
+ #### ControlSet.set
934
+
935
+ ```cpp
936
+ void set(const std::string &name, double value);
937
+ ```
938
+
939
+ Coerced (clamped, snapped): get() gives the value in force.
940
+
941
+ ```cpp
942
+ void set(const std::string &name, const std::string &value);
943
+ ```
944
+
945
+ An enum of words ("continuous").
946
+
947
+ ```cpp
948
+ void set(const std::string &name, const char *value);
949
+ ```
950
+
951
+ #### ControlSet.reset
952
+
953
+ ```cpp
954
+ std::vector<std::string> reset();
955
+ ```
956
+
957
+ Every control of the set back to its default. The names not applied (Python:
958
+ reset() -> list[str]); empty when all were.
959
+
960
+ ### Recalibration
961
+
962
+ ```cpp
963
+ class Recalibration {
964
+ // (no public data members)
965
+ };
966
+ ```
967
+
968
+ A pipeline's recalibration (c_api.md; Python: pipeline.recalibration). A view: valid while
969
+ its Pipeline is.
970
+
971
+ #### Recalibration.Recalibration
972
+
973
+ ```cpp
974
+ explicit Recalibration(depz_pipeline *p);
975
+ ```
976
+
977
+ #### Recalibration.status
978
+
979
+ ```cpp
980
+ RecalibrationStatus status() const;
981
+ ```
982
+
983
+ #### Recalibration.unverified_reason
984
+
985
+ ```cpp
986
+ std::string unverified_reason(uint32_t term) const;
987
+ ```
988
+
989
+ Why one unverified term (a DEPZ_TERM\_\* bit) could not be vouched for; "" when checked.
990
+
991
+ #### Recalibration.configure
992
+
993
+ ```cpp
994
+ void configure(const RecalibrationConfig &cfg);
995
+ ```
996
+
997
+ Changes the settings while the pipeline runs.
998
+
999
+ #### Recalibration.trigger
1000
+
1001
+ ```cpp
1002
+ bool trigger(int32_t wait_ms = 0);
1003
+ ```
1004
+
1005
+ Recalibrates now; wait_ms 0: returns at once. True when a correction was applied.
1006
+
1007
+ #### Recalibration.reset_correction
1008
+
1009
+ ```cpp
1010
+ void reset_correction(int32_t wait_ms = 0);
1011
+ ```
1012
+
1013
+ Back to the camera's base calibration; forgets the stored correction.
1014
+
1015
+ #### Recalibration.set_reference_distance
1016
+
1017
+ ```cpp
1018
+ void set_reference_distance(double true_m, double measured_m, int32_t wait_ms = 0);
1019
+ ```
1020
+
1021
+ A point the pipeline gives at measured_m metres is true_m metres away.
1022
+
1023
+ #### Recalibration.history
1024
+
1025
+ ```cpp
1026
+ std::vector<RecalibrationEvent> history(double since_s = 0.0) const;
1027
+ ```
1028
+
1029
+ This run's changes at or after since_s (wall clock, seconds since the epoch).
1030
+
1031
+ ### Pipeline
1032
+
1033
+ ```cpp
1034
+ class Pipeline : public detail::Handle<depz_pipeline, depz_pipeline_release> {
1035
+ // (no public data members)
1036
+ };
1037
+ ```
1038
+
1039
+ #### Pipeline.create
1040
+
1041
+ ```cpp
1042
+ static Pipeline create(const Source &source, const std::vector<const StageHandle *> &stages, const depz_pipeline_config_t *cfg = nullptr);
1043
+ ```
1044
+
1045
+ cfg nullptr: the defaults (depz_pipeline_config_init).
1046
+
1047
+ #### Pipeline.start
1048
+
1049
+ ```cpp
1050
+ void start(depz_progress_fn progress = nullptr, void *user = nullptr);
1051
+ ```
1052
+
1053
+ #### Pipeline.next
1054
+
1055
+ ```cpp
1056
+ Frame next(int32_t timeout_ms);
1057
+ ```
1058
+
1059
+ The next frame; nothing within timeout_ms: DepzError(ErrorCode::TIMEOUT); the end of a
1060
+ finite source: DepzError(ErrorCode::END_OF_STREAM).
1061
+
1062
+ #### Pipeline.request_photo
1063
+
1064
+ ```cpp
1065
+ void request_photo();
1066
+ ```
1067
+
1068
+ Photo mode: the stages run on the next frame, the photo (depz_pipeline_request_photo).
1069
+
1070
+ #### Pipeline.wait_photo
1071
+
1072
+ ```cpp
1073
+ Frame wait_photo(int32_t timeout_ms);
1074
+ ```
1075
+
1076
+ The photo, the previews before it dropped; nothing within timeout_ms:
1077
+ DepzError(ErrorCode::TIMEOUT); the end of a finite source: DepzError(ErrorCode::END_OF_STREAM).
1078
+
1079
+ #### Pipeline.stop
1080
+
1081
+ ```cpp
1082
+ void stop();
1083
+ ```
1084
+
1085
+ #### Pipeline.reset_camera_source
1086
+
1087
+ ```cpp
1088
+ bool reset_camera_source(int32_t timeout_ms = -1);
1089
+ ```
1090
+
1091
+ The live source closed and opened again in place; false: nothing done (not running, not live).
1092
+
1093
+ #### Pipeline.info
1094
+
1095
+ ```cpp
1096
+ PipelineInfo info();
1097
+ ```
1098
+
1099
+ #### Pipeline.metrics
1100
+
1101
+ ```cpp
1102
+ PipelineMetrics metrics();
1103
+ ```
1104
+
1105
+ #### Pipeline.source_info
1106
+
1107
+ ```cpp
1108
+ SourceInfo source_info();
1109
+ ```
1110
+
1111
+ What its source is (Python: pipeline.source.info).
1112
+
1113
+ #### Pipeline.last_error
1114
+
1115
+ ```cpp
1116
+ std::optional<DepzError> last_error();
1117
+ ```
1118
+
1119
+ The last problem of the running pipeline (a stage that failed, no frames); none: empty.
1120
+
1121
+ #### Pipeline.active_calibration
1122
+
1123
+ ```cpp
1124
+ Calibration active_calibration();
1125
+ ```
1126
+
1127
+ The calibration in force now, with its correction: a snapshot.
1128
+
1129
+ #### Pipeline.set_calibration
1130
+
1131
+ ```cpp
1132
+ void set_calibration(const Calibration &cal);
1133
+ ```
1134
+
1135
+ Rectify with cal from now on; recalibration corrects it from then on (Python:
1136
+ Pipeline.set_calibration).
1137
+
1138
+ #### Pipeline.apply_correction
1139
+
1140
+ ```cpp
1141
+ void apply_correction(double pitch, double roll, double yaw, double ty);
1142
+ ```
1143
+
1144
+ Correct the source's calibration by a correction, radians; absolute against it (Python:
1145
+ Pipeline.apply_correction). Stereo only.
1146
+
1147
+ #### Pipeline.controls
1148
+
1149
+ ```cpp
1150
+ ControlSet controls(depz_scope scope, const std::string &owner = "");
1151
+ ```
1152
+
1153
+ The controls of one owner: DEPZ_SCOPE\_\*, with a filter's slug or a stage's name.
1154
+
1155
+ #### Pipeline.recalibration
1156
+
1157
+ ```cpp
1158
+ Recalibration recalibration();
1159
+ ```
1160
+
1161
+ #### Pipeline.set_stream_enabled
1162
+
1163
+ ```cpp
1164
+ void set_stream_enabled(uint32_t stream, bool enabled, bool cascade = false);
1165
+ ```
1166
+
1167
+ One stream on or off (Python: set_stream_enabled). On switches on what it needs;
1168
+ off is refused while a stream that stays on needs it (DepzError INVALID_ARGUMENT)
1169
+ unless cascade, which switches those off too.
1170
+
1171
+ #### Pipeline.recording
1172
+
1173
+ ```cpp
1174
+ Recording recording();
1175
+ ```
1176
+
1177
+ The pipeline's recording (Python: pipeline.recording).
1178
+
1179
+ #### Pipeline.replay_pause
1180
+
1181
+ ```cpp
1182
+ void replay_pause();
1183
+ ```
1184
+
1185
+ The pipeline's replay (Python: pipeline.replay); a live source: DepzError INVALID_ARGUMENT.
1186
+
1187
+ #### Pipeline.replay_resume
1188
+
1189
+ ```cpp
1190
+ void replay_resume();
1191
+ ```
1192
+
1193
+ #### Pipeline.replay_seek_us
1194
+
1195
+ ```cpp
1196
+ void replay_seek_us(int64_t pts_us);
1197
+ ```
1198
+
1199
+ #### Pipeline.replay_seek_frame
1200
+
1201
+ ```cpp
1202
+ void replay_seek_frame(int64_t frame);
1203
+ ```
1204
+
1205
+ #### Pipeline.replay_step
1206
+
1207
+ ```cpp
1208
+ void replay_step(int32_t direction);
1209
+ ```
1210
+
1211
+ #### Pipeline.replay_status
1212
+
1213
+ ```cpp
1214
+ depz_replay_status_t replay_status();
1215
+ ```
1216
+
1217
+ ## Inference: depz/inference.h
1218
+
1219
+ ### Inference
1220
+
1221
+ ```cpp
1222
+ class Inference : public detail::Handle<depz_inference, depz_inference_release> {
1223
+ // (no public data members)
1224
+ };
1225
+ ```
1226
+
1227
+ #### Inference.create
1228
+
1229
+ ```cpp
1230
+ static Inference create(const Context &ctx, const char *slug, const char *variant, const char *engine = nullptr, int32_t in_w = 0, int32_t in_h = 0, depz_progress_fn progress = nullptr, void *user = nullptr);
1231
+ ```
1232
+
1233
+ #### Inference.info
1234
+
1235
+ ```cpp
1236
+ depz_inference_info_t info() const;
1237
+ ```
1238
+
1239
+ #### Inference.infer
1240
+
1241
+ ```cpp
1242
+ void infer(const depz_image_t &left, const depz_image_t *right, float *out, int32_t out_stride_bytes);
1243
+ ```
1244
+
1245
+ #### Inference.warmup
1246
+
1247
+ ```cpp
1248
+ void warmup();
1249
+ ```
1250
+
1251
+ #### Inference.set_intrinsics
1252
+
1253
+ ```cpp
1254
+ void set_intrinsics(double fx, double fy, double cx, double cy);
1255
+ ```
1256
+
1257
+ #### Inference.control_set
1258
+
1259
+ ```cpp
1260
+ void control_set(const char *name, double value);
1261
+ ```
1262
+
1263
+ ```cpp
1264
+ void control_set(const char *name, const char *value);
1265
+ ```
1266
+
1267
+ ### EngineOutputs
1268
+
1269
+ ```cpp
1270
+ class EngineOutputs : public detail::Handle<depz_engine_outputs, depz_engine_outputs_release> {
1271
+ // (no public data members)
1272
+ };
1273
+ ```
1274
+
1275
+ The outputs of one EngineSession::run_outputs, in the library's memory: each tensor's data is
1276
+ valid while this lives.
1277
+
1278
+ #### EngineOutputs.size
1279
+
1280
+ ```cpp
1281
+ size_t size() const;
1282
+ ```
1283
+
1284
+ #### EngineOutputs.at
1285
+
1286
+ ```cpp
1287
+ depz_tensor_t at(size_t i) const;
1288
+ ```
1289
+
1290
+ ### EngineSession
1291
+
1292
+ ```cpp
1293
+ class EngineSession : public detail::Handle<depz_engine_session, depz_engine_session_release> {
1294
+ // (no public data members)
1295
+ };
1296
+ ```
1297
+
1298
+ #### EngineSession.open
1299
+
1300
+ ```cpp
1301
+ static EngineSession open(const char *engine, const char *model_path);
1302
+ ```
1303
+
1304
+ #### EngineSession.inputs
1305
+
1306
+ ```cpp
1307
+ std::vector<depz_tensor_t> inputs() const;
1308
+ ```
1309
+
1310
+ #### EngineSession.outputs
1311
+
1312
+ ```cpp
1313
+ std::vector<depz_tensor_t> outputs() const;
1314
+ ```
1315
+
1316
+ #### EngineSession.run
1317
+
1318
+ ```cpp
1319
+ void run(const std::vector<depz_tensor_t> &inputs, std::vector<depz_tensor_t> &outputs);
1320
+ ```
1321
+
1322
+ #### EngineSession.run_outputs
1323
+
1324
+ ```cpp
1325
+ EngineOutputs run_outputs(const std::vector<depz_tensor_t> &inputs);
1326
+ ```
1327
+
1328
+ One run whose outputs the library allocates, of the shapes the run gives.
1329
+
1330
+ ### ModelInfo
1331
+
1332
+ ```cpp
1333
+ struct ModelInfo {
1334
+ std::string slug;
1335
+ std::string label;
1336
+ bool neural = false;
1337
+ bool mono = false;
1338
+ bool outputs_depth = false;
1339
+ double max_disparity_px = 0; /* 0: no fixed ceiling, or not known */
1340
+ bool disparity_offset_verified = false;
1341
+ bool consistency_check = false;
1342
+ std::vector<ModelVariantInfo> variants;
1343
+ };
1344
+ ```
1345
+
1346
+ One model family of the catalog with its variants. Python: ModelInfo.
1347
+
1348
+ ### list_models
1349
+
1350
+ ```cpp
1351
+ inline std::vector<ModelInfo> list_models(const Context &ctx);
1352
+ ```
1353
+
1354
+ The catalog's models (contracts/models.json). Python: list_models().
1355
+
1356
+ ### is_model_cached
1357
+
1358
+ ```cpp
1359
+ inline bool is_model_cached(const Context &ctx, const char *slug, const char *variant, const char *engine = nullptr, int32_t in_w = 0, int32_t in_h = 0);
1360
+ ```
1361
+
1362
+ Offline preparation (not needed before Inference::create, which downloads what it lacks):
1363
+ whether the files Inference::create would use for a model, an engine (nullptr: the
1364
+ default rule's) and a size (0, 0: the variant's) are in the cache. Python: is_model_cached().
1365
+
1366
+ ### download_model
1367
+
1368
+ ```cpp
1369
+ inline std::vector<std::string> download_model(const Context &ctx, const char *slug, const char *variant, const char *engine = nullptr, int32_t in_w = 0, int32_t in_h = 0, depz_progress_fn progress = nullptr, void *user = nullptr);
1370
+ ```
1371
+
1372
+ Offline preparation: downloads (and checks) those files; blocks. progress: the "download"
1373
+ bytes, a nonzero return cancels (ErrorCode::ABORTED). Returns the files' absolute paths
1374
+ under the cache root, the entry point first (none for a classical matcher;
1375
+ depz_model_files). Python: download_model().
1376
+
1377
+ ### describe_engines
1378
+
1379
+ ```cpp
1380
+ inline std::vector<EngineInfo> describe_engines(const Context &ctx);
1381
+ ```
1382
+
1383
+ Every engine the SDK knows, in the manifest's order, and whether this host runs it: a
1384
+ snapshot. Python: describe_engines().
1385
+
1386
+ ### ModelSupport
1387
+
1388
+ ```cpp
1389
+ using ModelSupport = depz_model_support_t;
1390
+ ```
1391
+
1392
+ Whether an engine may run a model at a size (in_w, in_h; 0, 0: the variant's own), with the
1393
+ precision and the region rules (Python: model_support()). variant nullptr: the family's rules.
1394
+
1395
+ ### model_support
1396
+
1397
+ ```cpp
1398
+ inline ModelSupport model_support(const Context &ctx, const char *slug, const char *variant, const char *engine, int32_t in_w = 0, int32_t in_h = 0);
1399
+ ```
1400
+
1401
+ See [`ModelSupport`](#modelsupport).
1402
+
1403
+ ### InputSizes
1404
+
1405
+ ```cpp
1406
+ using InputSizes = depz_input_sizes_t;
1407
+ ```
1408
+
1409
+ Which input sizes Inference::create takes for a model on an engine (nullptr: the default
1410
+ rule's): kind DEPZ_INPUT_SIZE_ANY or \_LISTED and the sizes, (h, w). Python:
1411
+ input_size_support().
1412
+
1413
+ ### model_input_sizes
1414
+
1415
+ ```cpp
1416
+ inline InputSizes model_input_sizes(const Context &ctx, const char *slug, const char *engine = nullptr);
1417
+ ```
1418
+
1419
+ See [`InputSizes`](#inputsizes).
1420
+
1421
+ ### model_files
1422
+
1423
+ ```cpp
1424
+ inline std::vector<std::string> model_files(const Context &ctx, const char *slug, const char *variant, const char *engine = nullptr, int32_t in_w = 0, int32_t in_h = 0);
1425
+ ```
1426
+
1427
+ The files download_model fetches (and Inference::create runs) for the same arguments,
1428
+ without fetching anything: absolute paths under the cache root, the entry point first (none
1429
+ for a classical matcher). Python: download_model()'s value.
1430
+
1431
+ ### ModelDefault
1432
+
1433
+ ```cpp
1434
+ using ModelDefault = depz_model_default_t;
1435
+ ```
1436
+
1437
+ The model to run on an engine when nobody chooses one, on this host (a recommendation; the
1438
+ SDK never applies it): has_default 0 when there is none. Python: default_model().
1439
+
1440
+ ### model_default
1441
+
1442
+ ```cpp
1443
+ inline ModelDefault model_default(const Context &ctx, const char *engine);
1444
+ ```
1445
+
1446
+ See [`ModelDefault`](#modeldefault).
1447
+
1448
+ ### EngineSlug
1449
+
1450
+ ```cpp
1451
+ struct EngineSlug {
1452
+ std::string kind, device_or_ep;
1453
+ };
1454
+ ```
1455
+
1456
+ An engine slug's two parts ("openvino-GPU.0": "openvino", "GPU.0"); a malformed slug:
1457
+ DepzError(INVALID_ARGUMENT). Python: parse_engine_slug().
1458
+
1459
+ ### parse_engine_slug
1460
+
1461
+ ```cpp
1462
+ inline EngineSlug parse_engine_slug(const char *slug);
1463
+ ```
1464
+
1465
+ See [`EngineSlug`](#engineslug).
1466
+
1467
+ ## Depth: depz/depth.h
1468
+
1469
+ ### make_depth_stage
1470
+
1471
+ ```cpp
1472
+ inline StageHandle make_depth_stage(const Inference &inf);
1473
+ ```
1474
+
1475
+ ## Extensions
1476
+
1477
+ ### FrameSource
1478
+
1479
+ ```cpp
1480
+ class FrameSource {
1481
+ std::vector<Control> listed_camera_controls_; /* The library's: the last camera_controls(), for the vtable's count / at. */
1482
+ };
1483
+ ```
1484
+
1485
+ An own frame source. Python: FrameSource.
1486
+
1487
+ #### FrameSource.open
1488
+
1489
+ ```cpp
1490
+ virtual void open(depz_source_info_t &info) = 0;
1491
+ ```
1492
+
1493
+ Opens it and describes it (struct_size is set).
1494
+
1495
+ #### FrameSource.grab
1496
+
1497
+ ```cpp
1498
+ virtual bool grab(int32_t timeout_ms, depz_image_t &image, int64_t &pts_us) = 0;
1499
+ ```
1500
+
1501
+ One picture (BGR8, both eyes side by side for stereo) valid until the next
1502
+ call; false: nothing within timeout_ms.
1503
+
1504
+ #### FrameSource.close
1505
+
1506
+ ```cpp
1507
+ virtual void close();
1508
+ ```
1509
+
1510
+ #### FrameSource.records
1511
+
1512
+ ```cpp
1513
+ virtual bool records() const;
1514
+ ```
1515
+
1516
+ A source that gives the camera's own bytes and its anchors, so that a pipeline on it
1517
+ can record it (Python: RawFrame.payload, t0_monotonic_ns / t0_utc_ns): true, and
1518
+ payload / t0 below are its vtable's. Asked once, by make_source.
1519
+
1520
+ #### FrameSource.payload
1521
+
1522
+ ```cpp
1523
+ virtual void payload(const void *&data, size_t &size);
1524
+ ```
1525
+
1526
+ The bytes of the frame the last grab gave, format info.fourcc; valid until the next
1527
+ grab or close.
1528
+
1529
+ #### FrameSource.t0
1530
+
1531
+ ```cpp
1532
+ virtual void t0(depz_source_anchors_t &out);
1533
+ ```
1534
+
1535
+ The anchors of pts_us = 0: set has_t0_monotonic / has_t0_utc for what is known.
1536
+
1537
+ #### FrameSource.calibration
1538
+
1539
+ ```cpp
1540
+ virtual Calibration calibration();
1541
+ ```
1542
+
1543
+ The calibration in force (Python: FrameSource.active_calibration), asked after the
1544
+ open and after every grab: a new one when it changed, else an empty Calibration
1545
+ (unchanged).
1546
+
1547
+ #### FrameSource.lists_camera_controls
1548
+
1549
+ ```cpp
1550
+ virtual bool lists_camera_controls() const;
1551
+ ```
1552
+
1553
+ Its camera controls (Python: FrameSource.list_camera_controls): true, and
1554
+ camera_controls / camera_control_members below are its vtable's list. Asked once, by
1555
+ make_source.
1556
+
1557
+ #### FrameSource.camera_controls
1558
+
1559
+ ```cpp
1560
+ virtual std::vector<Control> camera_controls();
1561
+ ```
1562
+
1563
+ The controls with their values now (has_value 0: unknown; struct_size is set by the
1564
+ library).
1565
+
1566
+ #### FrameSource.camera_control_members
1567
+
1568
+ ```cpp
1569
+ virtual std::vector<depz_enum_member_t> camera_control_members(const std::string &name);
1570
+ ```
1571
+
1572
+ An enum control's members (enum_count of them).
1573
+
1574
+ #### FrameSource.has_camera_control_handle
1575
+
1576
+ ```cpp
1577
+ virtual bool has_camera_control_handle() const;
1578
+ ```
1579
+
1580
+ A control handle (Python: FrameSource.camera_controls not None): true, and
1581
+ camera_control_get / camera_control_set below are its vtable's. Asked once, by
1582
+ make_source.
1583
+
1584
+ #### FrameSource.camera_control_get
1585
+
1586
+ ```cpp
1587
+ virtual std::optional<double> camera_control_get(const std::string &name);
1588
+ ```
1589
+
1590
+ The handle's read of one control; none: not readable.
1591
+
1592
+ #### FrameSource.camera_control_set
1593
+
1594
+ ```cpp
1595
+ virtual bool camera_control_set(const std::string &name, double value);
1596
+ ```
1597
+
1598
+ The value as given; false: the camera refused it.
1599
+
1600
+ ### make_source
1601
+
1602
+ ```cpp
1603
+ inline Source make_source(const Context &ctx, std::unique_ptr<FrameSource> impl);
1604
+ ```
1605
+
1606
+ ### mkv_source
1607
+
1608
+ ```cpp
1609
+ inline Source mkv_source(const Context &ctx, const std::string &path, const depz_replay_options_t *opt = nullptr);
1610
+ ```
1611
+
1612
+ A recording (schema 6) as a source; opt nullptr: the defaults (realtime, paced).
1613
+ Python: MkvSource(path, ...).
1614
+
1615
+ ### StageGeometry
1616
+
1617
+ ```cpp
1618
+ using StageGeometry = depz_stage_geometry_t;
1619
+ ```
1620
+
1621
+ ### Stage
1622
+
1623
+ ```cpp
1624
+ class Stage {
1625
+ // (no public data members)
1626
+ };
1627
+ ```
1628
+
1629
+ An own pipeline stage. Python: Stage (name, streams, prepare(geometry),
1630
+ process(frame), controls(), info()).
1631
+
1632
+ #### Stage.name
1633
+
1634
+ ```cpp
1635
+ virtual std::string name() const = 0;
1636
+ ```
1637
+
1638
+ #### Stage.streams
1639
+
1640
+ ```cpp
1641
+ virtual uint32_t streams() const;
1642
+ ```
1643
+
1644
+ DEPZ_STREAM\_\* bits it adds.
1645
+
1646
+ #### Stage.prepare
1647
+
1648
+ ```cpp
1649
+ virtual void prepare(const StageGeometry &);
1650
+ ```
1651
+
1652
+ #### Stage.process
1653
+
1654
+ ```cpp
1655
+ virtual void process(Frame &frame) = 0;
1656
+ ```
1657
+
1658
+ Reads frame.image(...), adds with frame.put_image(...).
1659
+
1660
+ #### Stage.controls
1661
+
1662
+ ```cpp
1663
+ virtual std::vector<depz_control_t> controls() const;
1664
+ ```
1665
+
1666
+ #### Stage.set_control
1667
+
1668
+ ```cpp
1669
+ virtual void set_control(const std::string &name, double);
1670
+ ```
1671
+
1672
+ #### Stage.info
1673
+
1674
+ ```cpp
1675
+ virtual std::string info() const;
1676
+ ```
1677
+
1678
+ A JSON object.
1679
+
1680
+ #### Stage.reset
1681
+
1682
+ ```cpp
1683
+ virtual void reset();
1684
+ ```
1685
+
1686
+ The frames lost their continuity (a replay's seek): forget per-frame state.
1687
+
1688
+ ### make_stage
1689
+
1690
+ ```cpp
1691
+ inline StageHandle make_stage(std::unique_ptr<Stage> impl);
1692
+ ```
1693
+
1694
+ ### EngineModel
1695
+
1696
+ ```cpp
1697
+ class EngineModel {
1698
+ // (no public data members)
1699
+ };
1700
+ ```
1701
+
1702
+ A model file loaded on an own engine. Python: InferenceEngine (one model).
1703
+
1704
+ #### EngineModel.inputs
1705
+
1706
+ ```cpp
1707
+ virtual std::vector<depz_tensor_t> inputs() const;
1708
+ ```
1709
+
1710
+ The inputs' types and shapes (data NULL), in declared order.
1711
+
1712
+ #### EngineModel.outputs
1713
+
1714
+ ```cpp
1715
+ virtual std::vector<depz_tensor_t> outputs() const;
1716
+ ```
1717
+
1718
+ The outputs' types and shapes (data NULL; -1: free until a run), in declared order.
1719
+
1720
+ #### EngineModel.run
1721
+
1722
+ ```cpp
1723
+ virtual void run(const depz_tensor_t *inputs, size_t n_inputs, depz_tensor_t *outputs, size_t n_outputs) = 0;
1724
+ ```
1725
+
1726
+ ### Engine
1727
+
1728
+ ```cpp
1729
+ class Engine {
1730
+ // (no public data members)
1731
+ };
1732
+ ```
1733
+
1734
+ An own engine. Python: InferenceEngine.
1735
+
1736
+ #### Engine.slug
1737
+
1738
+ ```cpp
1739
+ virtual std::string slug() const = 0;
1740
+ ```
1741
+
1742
+ #### Engine.kind
1743
+
1744
+ ```cpp
1745
+ virtual std::string kind() const;
1746
+ ```
1747
+
1748
+ #### Engine.precisions
1749
+
1750
+ ```cpp
1751
+ virtual std::string precisions() const;
1752
+ ```
1753
+
1754
+ #### Engine.available
1755
+
1756
+ ```cpp
1757
+ virtual bool available() const;
1758
+ ```
1759
+
1760
+ #### Engine.open
1761
+
1762
+ ```cpp
1763
+ virtual std::unique_ptr<EngineModel> open(const std::string &model_path) = 0;
1764
+ ```
1765
+
1766
+ ### register_engine
1767
+
1768
+ ```cpp
1769
+ inline void register_engine(std::unique_ptr<Engine> impl);
1770
+ ```
1771
+
1772
+ ### unregister_engine
1773
+
1774
+ ```cpp
1775
+ inline void unregister_engine(const std::string &slug);
1776
+ ```
1777
+
1778
+ ### Model
1779
+
1780
+ ```cpp
1781
+ class Model {
1782
+ // (no public data members)
1783
+ };
1784
+ ```
1785
+
1786
+ An own depth model. Python: DepthInferenceBase.
1787
+
1788
+ #### Model.slug
1789
+
1790
+ ```cpp
1791
+ virtual std::string slug() const = 0;
1792
+ ```
1793
+
1794
+ #### Model.variant
1795
+
1796
+ ```cpp
1797
+ virtual std::string variant() const;
1798
+ ```
1799
+
1800
+ #### Model.engine
1801
+
1802
+ ```cpp
1803
+ virtual std::string engine() const;
1804
+ ```
1805
+
1806
+ #### Model.label
1807
+
1808
+ ```cpp
1809
+ virtual std::string label() const;
1810
+ ```
1811
+
1812
+ Its display name; "": the default rule (depz_inference_info_t.label). Python: label.
1813
+
1814
+ #### Model.input_width
1815
+
1816
+ ```cpp
1817
+ virtual int32_t input_width() const;
1818
+ ```
1819
+
1820
+ 0, 0: any size.
1821
+
1822
+ #### Model.input_height
1823
+
1824
+ ```cpp
1825
+ virtual int32_t input_height() const;
1826
+ ```
1827
+
1828
+ #### Model.mono
1829
+
1830
+ ```cpp
1831
+ virtual bool mono() const;
1832
+ ```
1833
+
1834
+ #### Model.outputs_depth
1835
+
1836
+ ```cpp
1837
+ virtual bool outputs_depth() const;
1838
+ ```
1839
+
1840
+ #### Model.max_disparity_px
1841
+
1842
+ ```cpp
1843
+ virtual double max_disparity_px() const;
1844
+ ```
1845
+
1846
+ The disparity ceiling, input pixels; 0: none or not known (a slug of the catalog takes the
1847
+ catalog's).
1848
+
1849
+ #### Model.warmup
1850
+
1851
+ ```cpp
1852
+ virtual void warmup();
1853
+ ```
1854
+
1855
+ #### Model.set_intrinsics
1856
+
1857
+ ```cpp
1858
+ virtual void set_intrinsics(double, double, double, double);
1859
+ ```
1860
+
1861
+ #### Model.infer
1862
+
1863
+ ```cpp
1864
+ virtual void infer(const depz_image_t &left, const depz_image_t *right, float *out, int32_t out_stride_bytes) = 0;
1865
+ ```
1866
+
1867
+ right nullptr for a mono model; out: F32 of left's size.
1868
+
1869
+ #### Model.max_concurrent_runs
1870
+
1871
+ ```cpp
1872
+ virtual int32_t max_concurrent_runs() const;
1873
+ ```
1874
+
1875
+ The runs its engine computes at once (depz_model_vtable_t.max_concurrent_runs; 0: 1).
1876
+ With asynchronous runs, the depth stage's parallel_runs (default pipeline_depth: + 1).
1877
+
1878
+ #### Model.asynchronous
1879
+
1880
+ ```cpp
1881
+ virtual bool asynchronous() const;
1882
+ ```
1883
+
1884
+ #### Model.submit
1885
+
1886
+ ```cpp
1887
+ virtual std::unique_ptr<Run> submit(const depz_image_t &, const depz_image_t *);
1888
+ ```
1889
+
1890
+ On the pipeline's worker: queue the run and return (left / right: the library's copies,
1891
+ valid until the run ends).
1892
+
1893
+ #### Model.wait
1894
+
1895
+ ```cpp
1896
+ virtual bool wait(Run &, int32_t);
1897
+ ```
1898
+
1899
+ On the library's run thread: true when done, false not yet (within timeout_ms); an
1900
+ exception fails the run (the library then cancels it).
1901
+
1902
+ #### Model.complete
1903
+
1904
+ ```cpp
1905
+ virtual void complete(Run &, float *, int32_t);
1906
+ ```
1907
+
1908
+ After wait gave true, on the same thread: the map as infer writes it.
1909
+
1910
+ #### Model.cancel
1911
+
1912
+ ```cpp
1913
+ virtual void cancel(Run &) noexcept;
1914
+ ```
1915
+
1916
+ The run's frame was dropped, or its wait failed: no complete follows.
1917
+
1918
+ ### make_inference
1919
+
1920
+ ```cpp
1921
+ inline Inference make_inference(const Context &ctx, std::unique_ptr<Model> impl);
1922
+ ```