robotpy-cscore 2025.2.1.2__cp311-cp311-manylinux_2_36_aarch64.whl

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.

Potentially problematic release.


This version of robotpy-cscore might be problematic. Click here for more details.

cscore/_cscore.pyi ADDED
@@ -0,0 +1,1711 @@
1
+ from __future__ import annotations
2
+ import numpy
3
+ import typing
4
+ import wpiutil
5
+ import wpiutil._wpiutil
6
+ __all__ = ['AxisCamera', 'CameraServer', 'CvSink', 'CvSource', 'HttpCamera', 'ImageSink', 'ImageSource', 'MjpegServer', 'RawEvent', 'UsbCamera', 'UsbCameraInfo', 'VideoCamera', 'VideoEvent', 'VideoListener', 'VideoMode', 'VideoProperty', 'VideoSink', 'VideoSource', 'runMainRunLoop', 'runMainRunLoopTimeout', 'stopMainRunLoop']
7
+ class AxisCamera(HttpCamera):
8
+ """
9
+ A source that represents an Axis IP camera.
10
+
11
+ :deprecated: Use HttpCamera instead.
12
+ """
13
+ @staticmethod
14
+ def _pybind11_conduit_v1_(*args, **kwargs):
15
+ ...
16
+ @typing.overload
17
+ def __init__(self, name: str, host: str) -> None:
18
+ """
19
+ Create a source for an Axis IP camera.
20
+
21
+ :param name: Source name (arbitrary unique identifier)
22
+ :param host: Camera host IP or DNS name (e.g. "10.x.y.11")
23
+ """
24
+ @typing.overload
25
+ def __init__(self, name: str, host: str) -> None:
26
+ """
27
+ Create a source for an Axis IP camera.
28
+
29
+ :param name: Source name (arbitrary unique identifier)
30
+ :param host: Camera host IP or DNS name (e.g. "10.x.y.11")
31
+ """
32
+ @typing.overload
33
+ def __init__(self, name: str, host: str) -> None:
34
+ """
35
+ Create a source for an Axis IP camera.
36
+
37
+ :param name: Source name (arbitrary unique identifier)
38
+ :param host: Camera host IP or DNS name (e.g. "10.x.y.11")
39
+ """
40
+ @typing.overload
41
+ def __init__(self, name: str, hosts: list[str]) -> None:
42
+ """
43
+ Create a source for an Axis IP camera.
44
+
45
+ :param name: Source name (arbitrary unique identifier)
46
+ :param hosts: Array of Camera host IPs/DNS names
47
+ """
48
+ class CameraServer:
49
+ """
50
+ Singleton class for creating and keeping camera servers.
51
+
52
+ Also publishes camera information to NetworkTables.
53
+ """
54
+ kBasePort: typing.ClassVar[int] = 1181
55
+ @staticmethod
56
+ def _pybind11_conduit_v1_(*args, **kwargs):
57
+ ...
58
+ @staticmethod
59
+ @typing.overload
60
+ def addAxisCamera(host: str) -> AxisCamera:
61
+ """
62
+ Adds an Axis IP camera.
63
+
64
+ This overload calls AddAxisCamera() with name "Axis Camera".
65
+
66
+ :deprecated: Call StartAutomaticCapture with a HttpCamera instead.
67
+
68
+ :param host: Camera host IP or DNS name (e.g. "10.x.y.11")
69
+ """
70
+ @staticmethod
71
+ @typing.overload
72
+ def addAxisCamera(hosts: list[str]) -> AxisCamera:
73
+ """
74
+ Adds an Axis IP camera.
75
+
76
+ This overload calls AddAxisCamera() with name "Axis Camera".
77
+
78
+ :deprecated: Call StartAutomaticCapture with a HttpCamera instead.
79
+
80
+ :param hosts: Array of Camera host IPs/DNS names
81
+ """
82
+ @staticmethod
83
+ @typing.overload
84
+ def addAxisCamera(name: str, host: str) -> AxisCamera:
85
+ """
86
+ Adds an Axis IP camera.
87
+
88
+ :deprecated: Call StartAutomaticCapture with a HttpCamera instead.
89
+
90
+ :param name: The name to give the camera
91
+ :param host: Camera host IP or DNS name (e.g. "10.x.y.11")
92
+ """
93
+ @staticmethod
94
+ @typing.overload
95
+ def addAxisCamera(name: str, hosts: list[str]) -> AxisCamera:
96
+ """
97
+ Adds an Axis IP camera.
98
+
99
+ :deprecated: Call StartAutomaticCapture with a HttpCamera instead.
100
+
101
+ :param name: The name to give the camera
102
+ :param hosts: Array of Camera host IPs/DNS names
103
+ """
104
+ @staticmethod
105
+ def addCamera(camera: VideoSource) -> None:
106
+ """
107
+ Adds an already created camera.
108
+
109
+ :param camera: Camera
110
+ """
111
+ @staticmethod
112
+ @typing.overload
113
+ def addServer(name: str) -> MjpegServer:
114
+ """
115
+ Adds a MJPEG server at the next available port.
116
+
117
+ :param name: Server name
118
+ """
119
+ @staticmethod
120
+ @typing.overload
121
+ def addServer(name: str, port: int) -> MjpegServer:
122
+ """
123
+ Adds a MJPEG server.
124
+
125
+ :param name: Server name
126
+ :param port: Port number
127
+ """
128
+ @staticmethod
129
+ @typing.overload
130
+ def addServer(server: VideoSink) -> None:
131
+ """
132
+ Adds an already created server.
133
+
134
+ :param server: Server
135
+ """
136
+ @staticmethod
137
+ def addSwitchedCamera(name: str) -> MjpegServer:
138
+ """
139
+ Adds a virtual camera for switching between two streams. Unlike the
140
+ other addCamera methods, this returns a VideoSink rather than a
141
+ VideoSource. Calling SetSource() on the returned object can be used
142
+ to switch the actual source of the stream.
143
+ """
144
+ @staticmethod
145
+ def enableLogging(level: int | None = None) -> None:
146
+ """
147
+ Enable cscore logging
148
+ """
149
+ @staticmethod
150
+ @typing.overload
151
+ def getServer() -> VideoSink:
152
+ """
153
+ Get server for the primary camera feed.
154
+
155
+ This is only valid to call after a camera feed has been added with
156
+ StartAutomaticCapture() or AddServer().
157
+ """
158
+ @staticmethod
159
+ @typing.overload
160
+ def getServer(name: str) -> VideoSink:
161
+ """
162
+ Gets a server by name.
163
+
164
+ :param name: Server name
165
+ """
166
+ @staticmethod
167
+ @typing.overload
168
+ def getVideo() -> CvSink:
169
+ """
170
+ Get OpenCV access to the primary camera feed. This allows you to
171
+ get images from the camera for image processing on the roboRIO.
172
+
173
+ This is only valid to call after a camera feed has been added
174
+ with startAutomaticCapture() or addServer().
175
+ """
176
+ @staticmethod
177
+ @typing.overload
178
+ def getVideo(camera: VideoSource) -> CvSink:
179
+ """
180
+ Get OpenCV access to the specified camera. This allows you to get
181
+ images from the camera for image processing on the roboRIO.
182
+
183
+ :param camera: Camera (e.g. as returned by startAutomaticCapture).
184
+ """
185
+ @staticmethod
186
+ @typing.overload
187
+ def getVideo(camera: VideoSource, pixelFormat: VideoMode.PixelFormat) -> CvSink:
188
+ """
189
+ Get OpenCV access to the specified camera. This allows you to get
190
+ images from the camera for image processing on the roboRIO.
191
+
192
+ :param camera: Camera (e.g. as returned by startAutomaticCapture).
193
+ :param pixelFormat: The desired pixelFormat of captured frames from the
194
+ camera
195
+ """
196
+ @staticmethod
197
+ @typing.overload
198
+ def getVideo(name: str) -> CvSink:
199
+ """
200
+ Get OpenCV access to the specified camera. This allows you to get
201
+ images from the camera for image processing on the roboRIO.
202
+
203
+ :param name: Camera name
204
+ """
205
+ @staticmethod
206
+ @typing.overload
207
+ def getVideo(name: str, pixelFormat: VideoMode.PixelFormat) -> CvSink:
208
+ """
209
+ Get OpenCV access to the specified camera. This allows you to get
210
+ images from the camera for image processing on the roboRIO.
211
+
212
+ :param name: Camera name
213
+ :param pixelFormat: The desired pixelFormat of captured frames from the
214
+ camera
215
+ """
216
+ @staticmethod
217
+ def putVideo(name: str, width: int, height: int) -> CvSource:
218
+ """
219
+ Create a MJPEG stream with OpenCV input. This can be called to pass custom
220
+ annotated images to the dashboard.
221
+
222
+ :param name: Name to give the stream
223
+ :param width: Width of the image being sent
224
+ :param height: Height of the image being sent
225
+ """
226
+ @staticmethod
227
+ def removeCamera(name: str) -> None:
228
+ """
229
+ Removes a camera by name.
230
+
231
+ :param name: Camera name
232
+ """
233
+ @staticmethod
234
+ def removeServer(name: str) -> None:
235
+ """
236
+ Removes a server by name.
237
+
238
+ :param name: Server name
239
+ """
240
+ @staticmethod
241
+ @typing.overload
242
+ def startAutomaticCapture() -> UsbCamera:
243
+ """
244
+ Start automatically capturing images to send to the dashboard.
245
+
246
+ You should call this method to see a camera feed on the dashboard. If you
247
+ also want to perform vision processing on the roboRIO, use getVideo() to
248
+ get access to the camera images.
249
+
250
+ The first time this overload is called, it calls StartAutomaticCapture()
251
+ with device 0, creating a camera named "USB Camera 0". Subsequent calls
252
+ increment the device number (e.g. 1, 2, etc).
253
+ """
254
+ @staticmethod
255
+ @typing.overload
256
+ def startAutomaticCapture(dev: int) -> UsbCamera:
257
+ """
258
+ Start automatically capturing images to send to the dashboard.
259
+
260
+ This overload calls StartAutomaticCapture() with a name of "USB Camera
261
+ {dev}".
262
+
263
+ :param dev: The device number of the camera interface
264
+ """
265
+ @staticmethod
266
+ @typing.overload
267
+ def startAutomaticCapture(name: str, dev: int) -> UsbCamera:
268
+ """
269
+ Start automatically capturing images to send to the dashboard.
270
+
271
+ :param name: The name to give the camera
272
+ :param dev: The device number of the camera interface
273
+ """
274
+ @staticmethod
275
+ @typing.overload
276
+ def startAutomaticCapture(name: str, path: str) -> UsbCamera:
277
+ """
278
+ Start automatically capturing images to send to the dashboard.
279
+
280
+ :param name: The name to give the camera
281
+ :param path: The device path (e.g. "/dev/video0") of the camera
282
+ """
283
+ @staticmethod
284
+ @typing.overload
285
+ def startAutomaticCapture(camera: VideoSource) -> MjpegServer:
286
+ """
287
+ Start automatically capturing images to send to the dashboard from
288
+ an existing camera.
289
+
290
+ :param camera: Camera
291
+ """
292
+ @staticmethod
293
+ def waitForever() -> None:
294
+ """
295
+ Infinitely loops until the process dies
296
+ """
297
+ class CvSink(ImageSink):
298
+ """
299
+ A sink for user code to accept video frames as OpenCV images.
300
+ """
301
+ @staticmethod
302
+ def _pybind11_conduit_v1_(*args, **kwargs):
303
+ ...
304
+ def __init__(self, name: str, pixelFormat: VideoMode.PixelFormat = ...) -> None:
305
+ """
306
+ Create a sink for accepting OpenCV images.
307
+
308
+ WaitForFrame() must be called on the created sink to get each new
309
+ image.
310
+
311
+ :param name: Source name (arbitrary unique identifier)
312
+ :param pixelFormat: The pixel format to read
313
+ """
314
+ def grabFrame(self, image: numpy.ndarray, timeout: float = 0.225) -> tuple[int, numpy.ndarray]:
315
+ """
316
+ Wait for the next frame and get the image.
317
+ Times out (returning 0) after timeout seconds.
318
+ The provided image will have the pixelFormat this class was constructed
319
+ with.
320
+
321
+ :returns: Frame time, or 0 on error (call GetError() to obtain the error
322
+ message); the frame time is in the same time base as wpi::Now(),
323
+ and is in 1 us increments.
324
+ """
325
+ def grabFrameDirect(self, image: numpy.ndarray, timeout: float = 0.225) -> int:
326
+ """
327
+ Wait for the next frame and get the image.
328
+ Times out (returning 0) after timeout seconds.
329
+ The provided image will have the pixelFormat this class was constructed
330
+ with. The data is backed by data in the CvSink. It will be invalidated by
331
+ any grabFrame*() call on the sink.
332
+
333
+ :returns: Frame time, or 0 on error (call GetError() to obtain the error
334
+ message); the frame time is in the same time base as wpi::Now(),
335
+ and is in 1 us increments.
336
+ """
337
+ def grabFrameDirectLastTime(self, image: numpy.ndarray, lastFrameTime: int, timeout: float = 0.225) -> int:
338
+ """
339
+ Wait for the next frame and get the image.
340
+ Times out (returning 0) after timeout seconds.
341
+ The provided image will have the pixelFormat this class was constructed
342
+ with. The data is backed by data in the CvSink. It will be invalidated by
343
+ any grabFrame*() call on the sink.
344
+
345
+ If lastFrameTime is provided and non-zero, the sink will fill image with
346
+ the first frame from the source that is not equal to lastFrameTime. If
347
+ lastFrameTime is zero, the time of the current frame owned by the CvSource
348
+ is used, and this function will block until the connected CvSource provides
349
+ a new frame.
350
+
351
+ :returns: Frame time, or 0 on error (call GetError() to obtain the error
352
+ message); the frame time is in the same time base as wpi::Now(),
353
+ and is in 1 us increments.
354
+ """
355
+ def grabFrameNoTimeout(self, image: numpy.ndarray) -> tuple[int, numpy.ndarray]:
356
+ """
357
+ Wait for the next frame and get the image. May block forever.
358
+ The provided image will have the pixelFormat this class was constructed
359
+ with.
360
+
361
+ :returns: Frame time, or 0 on error (call GetError() to obtain the error
362
+ message); the frame time is in the same time base as wpi::Now(),
363
+ and is in 1 us increments.
364
+ """
365
+ def grabFrameNoTimeoutDirect(self, image: numpy.ndarray) -> int:
366
+ """
367
+ Wait for the next frame and get the image. May block forever.
368
+ The provided image will have the pixelFormat this class was constructed
369
+ with. The data is backed by data in the CvSink. It will be invalidated by
370
+ any grabFrame*() call on the sink.
371
+
372
+ :returns: Frame time, or 0 on error (call GetError() to obtain the error
373
+ message); the frame time is in the same time base as wpi::Now(),
374
+ and is in 1 us increments.
375
+ """
376
+ def lastFrameTime(self) -> int:
377
+ """
378
+ Get the last time a frame was grabbed. This uses the same time base as
379
+ wpi::Now().
380
+
381
+ :returns: Time in 1 us increments.
382
+ """
383
+ def lastFrameTimeSource(self) -> wpiutil._wpiutil.TimestampSource:
384
+ """
385
+ Get the time source for the timestamp the last frame was grabbed at.
386
+
387
+ :returns: Time source
388
+ """
389
+ class CvSource(ImageSource):
390
+ """
391
+ A source for user code to provide OpenCV images as video frames.
392
+ """
393
+ @staticmethod
394
+ def _pybind11_conduit_v1_(*args, **kwargs):
395
+ ...
396
+ @typing.overload
397
+ def __init__(self, name: str, mode: VideoMode) -> None:
398
+ """
399
+ Create an OpenCV source.
400
+
401
+ :param name: Source name (arbitrary unique identifier)
402
+ :param mode: Video mode being generated
403
+ """
404
+ @typing.overload
405
+ def __init__(self, name: str, pixelFormat: VideoMode.PixelFormat, width: int, height: int, fps: int) -> None:
406
+ """
407
+ Create an OpenCV source.
408
+
409
+ :param name: Source name (arbitrary unique identifier)
410
+ :param pixelFormat: Pixel format
411
+ :param width: width
412
+ :param height: height
413
+ :param fps: fps
414
+ """
415
+ @typing.overload
416
+ def putFrame(self, image: numpy.ndarray) -> None:
417
+ """
418
+ Put an OpenCV image and notify sinks
419
+
420
+ The image format is guessed from the number of channels. The channel
421
+ mapping is as follows. 1: kGray 2: kYUYV 3: BGR 4: BGRA Any other channel
422
+ numbers will throw an error. If your image is an in alternate format, use
423
+ the overload that takes a PixelFormat.
424
+
425
+ :param image: OpenCV Image
426
+ """
427
+ @typing.overload
428
+ def putFrame(self, image: numpy.ndarray, pixelFormat: VideoMode.PixelFormat, skipVerification: bool) -> None:
429
+ """
430
+ Put an OpenCV image and notify sinks.
431
+
432
+ The format of the Mat must match the PixelFormat. You will corrupt memory
433
+ if they dont. With skipVerification false, we will verify the number of
434
+ channels matches the pixel format. If skipVerification is true, this step
435
+ is skipped and is passed straight through.
436
+
437
+ :param image: OpenCV image
438
+ :param pixelFormat: The pixel format of the image
439
+ :param skipVerification: skip verifying pixel format
440
+ """
441
+ class HttpCamera(VideoCamera):
442
+ """
443
+ A source that represents a MJPEG-over-HTTP (IP) camera.
444
+ """
445
+ class HttpCameraKind:
446
+ """
447
+ HTTP camera kind.
448
+
449
+ Members:
450
+
451
+ kUnknown : Unknown camera kind.
452
+
453
+ kMJPGStreamer : MJPG Streamer camera.
454
+
455
+ kCSCore : CS Core camera.
456
+
457
+ kAxis : Axis camera.
458
+ """
459
+ __members__: typing.ClassVar[dict[str, HttpCamera.HttpCameraKind]] # value = {'kUnknown': <HttpCameraKind.kUnknown: 0>, 'kMJPGStreamer': <HttpCameraKind.kMJPGStreamer: 1>, 'kCSCore': <HttpCameraKind.kCSCore: 2>, 'kAxis': <HttpCameraKind.kAxis: 3>}
460
+ kAxis: typing.ClassVar[HttpCamera.HttpCameraKind] # value = <HttpCameraKind.kAxis: 3>
461
+ kCSCore: typing.ClassVar[HttpCamera.HttpCameraKind] # value = <HttpCameraKind.kCSCore: 2>
462
+ kMJPGStreamer: typing.ClassVar[HttpCamera.HttpCameraKind] # value = <HttpCameraKind.kMJPGStreamer: 1>
463
+ kUnknown: typing.ClassVar[HttpCamera.HttpCameraKind] # value = <HttpCameraKind.kUnknown: 0>
464
+ @staticmethod
465
+ def _pybind11_conduit_v1_(*args, **kwargs):
466
+ ...
467
+ def __eq__(self, other: typing.Any) -> bool:
468
+ ...
469
+ def __getstate__(self) -> int:
470
+ ...
471
+ def __hash__(self) -> int:
472
+ ...
473
+ def __index__(self) -> int:
474
+ ...
475
+ def __init__(self, value: int) -> None:
476
+ ...
477
+ def __int__(self) -> int:
478
+ ...
479
+ def __ne__(self, other: typing.Any) -> bool:
480
+ ...
481
+ def __repr__(self) -> str:
482
+ ...
483
+ def __setstate__(self, state: int) -> None:
484
+ ...
485
+ def __str__(self) -> str:
486
+ ...
487
+ @property
488
+ def name(self) -> str:
489
+ ...
490
+ @property
491
+ def value(self) -> int:
492
+ ...
493
+ @staticmethod
494
+ def _pybind11_conduit_v1_(*args, **kwargs):
495
+ ...
496
+ @typing.overload
497
+ def __init__(self, name: str, url: str, kind: HttpCamera.HttpCameraKind = ...) -> None:
498
+ """
499
+ Create a source for a MJPEG-over-HTTP (IP) camera.
500
+
501
+ :param name: Source name (arbitrary unique identifier)
502
+ :param url: Camera URL (e.g. "http://10.x.y.11/video/stream.mjpg")
503
+ :param kind: Camera kind (e.g. kAxis)
504
+ """
505
+ @typing.overload
506
+ def __init__(self, name: str, url: str, kind: HttpCamera.HttpCameraKind = ...) -> None:
507
+ """
508
+ Create a source for a MJPEG-over-HTTP (IP) camera.
509
+
510
+ :param name: Source name (arbitrary unique identifier)
511
+ :param url: Camera URL (e.g. "http://10.x.y.11/video/stream.mjpg")
512
+ :param kind: Camera kind (e.g. kAxis)
513
+ """
514
+ @typing.overload
515
+ def __init__(self, name: str, url: str, kind: HttpCamera.HttpCameraKind = ...) -> None:
516
+ """
517
+ Create a source for a MJPEG-over-HTTP (IP) camera.
518
+
519
+ :param name: Source name (arbitrary unique identifier)
520
+ :param url: Camera URL (e.g. "http://10.x.y.11/video/stream.mjpg")
521
+ :param kind: Camera kind (e.g. kAxis)
522
+ """
523
+ @typing.overload
524
+ def __init__(self, name: str, urls: list[str], kind: HttpCamera.HttpCameraKind = ...) -> None:
525
+ """
526
+ Create a source for a MJPEG-over-HTTP (IP) camera.
527
+
528
+ :param name: Source name (arbitrary unique identifier)
529
+ :param urls: Array of Camera URLs
530
+ :param kind: Camera kind (e.g. kAxis)
531
+ """
532
+ def getHttpCameraKind(self) -> HttpCamera.HttpCameraKind:
533
+ """
534
+ Get the kind of HTTP camera.
535
+
536
+ Autodetection can result in returning a different value than the camera
537
+ was created with.
538
+ """
539
+ def getUrls(self) -> list[str]:
540
+ """
541
+ Get the URLs used to connect to the camera.
542
+ """
543
+ def setUrls(self, urls: list[str]) -> None:
544
+ """
545
+ Change the URLs used to connect to the camera.
546
+ """
547
+ class ImageSink(VideoSink):
548
+ """
549
+ A base class for single image reading sinks.
550
+ """
551
+ @staticmethod
552
+ def _pybind11_conduit_v1_(*args, **kwargs):
553
+ ...
554
+ def getError(self) -> str:
555
+ """
556
+ Get error string. Call this if WaitForFrame() returns 0 to determine
557
+ what the error is.
558
+ """
559
+ def setDescription(self, description: str) -> None:
560
+ """
561
+ Set sink description.
562
+
563
+ :param description: Description
564
+ """
565
+ def setEnabled(self, enabled: bool) -> None:
566
+ """
567
+ Enable or disable getting new frames.
568
+
569
+ Disabling will cause processFrame (for callback-based CvSinks) to not
570
+ be called and WaitForFrame() to not return. This can be used to save
571
+ processor resources when frames are not needed.
572
+ """
573
+ class ImageSource(VideoSource):
574
+ """
575
+ A base class for single image providing sources.
576
+ """
577
+ @staticmethod
578
+ def _pybind11_conduit_v1_(*args, **kwargs):
579
+ ...
580
+ def createBooleanProperty(self, name: str, defaultValue: bool, value: bool) -> VideoProperty:
581
+ """
582
+ Create a boolean property.
583
+
584
+ :param name: Property name
585
+ :param defaultValue: Default value
586
+ :param value: Current value
587
+
588
+ :returns: Property
589
+ """
590
+ def createIntegerProperty(self, name: str, minimum: int, maximum: int, step: int, defaultValue: int, value: int) -> VideoProperty:
591
+ """
592
+ Create an integer property.
593
+
594
+ :param name: Property name
595
+ :param minimum: Minimum value
596
+ :param maximum: Maximum value
597
+ :param step: Step value
598
+ :param defaultValue: Default value
599
+ :param value: Current value
600
+
601
+ :returns: Property
602
+ """
603
+ def createProperty(self, name: str, kind: VideoProperty.Kind, minimum: int, maximum: int, step: int, defaultValue: int, value: int) -> VideoProperty:
604
+ """
605
+ Create a property.
606
+
607
+ :param name: Property name
608
+ :param kind: Property kind
609
+ :param minimum: Minimum value
610
+ :param maximum: Maximum value
611
+ :param step: Step value
612
+ :param defaultValue: Default value
613
+ :param value: Current value
614
+
615
+ :returns: Property
616
+ """
617
+ def createStringProperty(self, name: str, value: str) -> VideoProperty:
618
+ """
619
+ Create a string property.
620
+
621
+ :param name: Property name
622
+ :param value: Current value
623
+
624
+ :returns: Property
625
+ """
626
+ def notifyError(self, msg: str) -> None:
627
+ """
628
+ Signal sinks that an error has occurred. This should be called instead
629
+ of NotifyFrame when an error occurs.
630
+
631
+ :param msg: Notification message.
632
+ """
633
+ def setConnected(self, connected: bool) -> None:
634
+ """
635
+ Set source connection status. Defaults to true.
636
+
637
+ :param connected: True for connected, false for disconnected
638
+ """
639
+ def setDescription(self, description: str) -> None:
640
+ """
641
+ Set source description.
642
+
643
+ :param description: Description
644
+ """
645
+ def setEnumPropertyChoices(self, property: VideoProperty, choices: list[str]) -> None:
646
+ """
647
+ Configure enum property choices.
648
+
649
+ :param property: Property
650
+ :param choices: Choices
651
+ """
652
+ class MjpegServer(VideoSink):
653
+ """
654
+ A sink that acts as a MJPEG-over-HTTP network server.
655
+ """
656
+ @staticmethod
657
+ def _pybind11_conduit_v1_(*args, **kwargs):
658
+ ...
659
+ @typing.overload
660
+ def __init__(self) -> None:
661
+ ...
662
+ @typing.overload
663
+ def __init__(self, name: str, listenAddress: str, port: int) -> None:
664
+ """
665
+ Create a MJPEG-over-HTTP server sink.
666
+
667
+ :param name: Sink name (arbitrary unique identifier)
668
+ :param listenAddress: TCP listen address (empty string for all addresses)
669
+ :param port: TCP port number
670
+ """
671
+ @typing.overload
672
+ def __init__(self, name: str, port: int) -> None:
673
+ """
674
+ Create a MJPEG-over-HTTP server sink.
675
+
676
+ :param name: Sink name (arbitrary unique identifier)
677
+ :param port: TCP port number
678
+ """
679
+ def getListenAddress(self) -> str:
680
+ """
681
+ Get the listen address of the server.
682
+ """
683
+ def getPort(self) -> int:
684
+ """
685
+ Get the port number of the server.
686
+ """
687
+ def setCompression(self, quality: int) -> None:
688
+ """
689
+ Set the compression for clients that don't specify it.
690
+
691
+ Setting this will result in increased CPU usage for MJPEG source cameras
692
+ as it will decompress and recompress the image instead of using the
693
+ camera's MJPEG image directly.
694
+
695
+ :param quality: JPEG compression quality (0-100), -1 for unspecified
696
+ """
697
+ def setDefaultCompression(self, quality: int) -> None:
698
+ """
699
+ Set the default compression used for non-MJPEG sources. If not set,
700
+ 80 is used. This function has no effect on MJPEG source cameras; use
701
+ SetCompression() instead to force recompression of MJPEG source images.
702
+
703
+ :param quality: JPEG compression quality (0-100)
704
+ """
705
+ def setFPS(self, fps: int) -> None:
706
+ """
707
+ Set the stream frames per second (FPS) for clients that don't specify it.
708
+
709
+ It is not necessary to set this if it is the same as the source FPS.
710
+
711
+ :param fps: FPS, 0 for unspecified
712
+ """
713
+ def setResolution(self, width: int, height: int) -> None:
714
+ """
715
+ Set the stream resolution for clients that don't specify it.
716
+
717
+ It is not necessary to set this if it is the same as the source
718
+ resolution.
719
+
720
+ Setting this different than the source resolution will result in
721
+ increased CPU usage, particularly for MJPEG source cameras, as it will
722
+ decompress, resize, and recompress the image, instead of using the
723
+ camera's MJPEG image directly.
724
+
725
+ :param width: width, 0 for unspecified
726
+ :param height: height, 0 for unspecified
727
+ """
728
+ class RawEvent:
729
+ """
730
+ Listener event
731
+ """
732
+ @staticmethod
733
+ def _pybind11_conduit_v1_(*args, **kwargs):
734
+ ...
735
+ class UsbCamera(VideoCamera):
736
+ """
737
+ A source that represents a USB camera.
738
+ """
739
+ @staticmethod
740
+ def _pybind11_conduit_v1_(*args, **kwargs):
741
+ ...
742
+ @staticmethod
743
+ def enumerateUsbCameras() -> list[UsbCameraInfo]:
744
+ """
745
+ Enumerate USB cameras on the local system.
746
+
747
+ :returns: Vector of USB camera information (one for each camera)
748
+ """
749
+ @typing.overload
750
+ def __init__(self) -> None:
751
+ ...
752
+ @typing.overload
753
+ def __init__(self, name: str, dev: int) -> None:
754
+ """
755
+ Create a source for a USB camera based on device number.
756
+
757
+ :param name: Source name (arbitrary unique identifier)
758
+ :param dev: Device number (e.g. 0 for /dev/video0)
759
+ """
760
+ @typing.overload
761
+ def __init__(self, name: str, path: str) -> None:
762
+ """
763
+ Create a source for a USB camera based on device path.
764
+
765
+ :param name: Source name (arbitrary unique identifier)
766
+ :param path: Path to device (e.g. "/dev/video0" on Linux)
767
+ """
768
+ def getInfo(self) -> UsbCameraInfo:
769
+ """
770
+ Get the full camera information for the device.
771
+ """
772
+ def getPath(self) -> str:
773
+ """
774
+ Get the path to the device.
775
+ """
776
+ def setConnectVerbose(self, level: int) -> None:
777
+ """
778
+ Set how verbose the camera connection messages are.
779
+
780
+ :param level: 0=don't display Connecting message, 1=do display message
781
+ """
782
+ def setPath(self, path: str) -> None:
783
+ """
784
+ Change the path to the device.
785
+ """
786
+ class UsbCameraInfo:
787
+ """
788
+ USB camera information
789
+ """
790
+ @staticmethod
791
+ def _pybind11_conduit_v1_(*args, **kwargs):
792
+ ...
793
+ def __init__(self) -> None:
794
+ ...
795
+ @property
796
+ def dev(self) -> int:
797
+ """
798
+ Device number (e.g. N in '/dev/videoN' on Linux)
799
+ """
800
+ @dev.setter
801
+ def dev(self, arg0: int) -> None:
802
+ ...
803
+ @property
804
+ def name(self) -> str:
805
+ """
806
+ Vendor/model name of the camera as provided by the USB driver
807
+ """
808
+ @name.setter
809
+ def name(self, arg0: str) -> None:
810
+ ...
811
+ @property
812
+ def otherPaths(self) -> list[str]:
813
+ """
814
+ Other path aliases to device (e.g. '/dev/v4l/by-id/...' etc on Linux)
815
+ """
816
+ @otherPaths.setter
817
+ def otherPaths(self, arg0: list[str]) -> None:
818
+ ...
819
+ @property
820
+ def path(self) -> str:
821
+ """
822
+ Path to device if available (e.g. '/dev/video0' on Linux)
823
+ """
824
+ @path.setter
825
+ def path(self, arg0: str) -> None:
826
+ ...
827
+ @property
828
+ def productId(self) -> int:
829
+ """
830
+ USB Product Id
831
+ """
832
+ @productId.setter
833
+ def productId(self, arg0: int) -> None:
834
+ ...
835
+ @property
836
+ def vendorId(self) -> int:
837
+ """
838
+ USB Vendor Id
839
+ """
840
+ @vendorId.setter
841
+ def vendorId(self, arg0: int) -> None:
842
+ ...
843
+ class VideoCamera(VideoSource):
844
+ """
845
+ A source that represents a video camera.
846
+ """
847
+ class WhiteBalance:
848
+ """
849
+ White balance.
850
+
851
+ Members:
852
+
853
+ kFixedIndoor : Fixed indoor white balance.
854
+
855
+ kFixedOutdoor1 : Fixed outdoor white balance 1.
856
+
857
+ kFixedOutdoor2 : Fixed outdoor white balance 2.
858
+
859
+ kFixedFluorescent1 : Fixed fluorescent white balance 1.
860
+
861
+ kFixedFlourescent2 : Fixed fluorescent white balance 2.
862
+ """
863
+ __members__: typing.ClassVar[dict[str, VideoCamera.WhiteBalance]] # value = {'kFixedIndoor': <WhiteBalance.kFixedIndoor: 3000>, 'kFixedOutdoor1': <WhiteBalance.kFixedOutdoor1: 4000>, 'kFixedOutdoor2': <WhiteBalance.kFixedOutdoor2: 5000>, 'kFixedFluorescent1': <WhiteBalance.kFixedFluorescent1: 5100>, 'kFixedFlourescent2': <WhiteBalance.kFixedFlourescent2: 5200>}
864
+ kFixedFlourescent2: typing.ClassVar[VideoCamera.WhiteBalance] # value = <WhiteBalance.kFixedFlourescent2: 5200>
865
+ kFixedFluorescent1: typing.ClassVar[VideoCamera.WhiteBalance] # value = <WhiteBalance.kFixedFluorescent1: 5100>
866
+ kFixedIndoor: typing.ClassVar[VideoCamera.WhiteBalance] # value = <WhiteBalance.kFixedIndoor: 3000>
867
+ kFixedOutdoor1: typing.ClassVar[VideoCamera.WhiteBalance] # value = <WhiteBalance.kFixedOutdoor1: 4000>
868
+ kFixedOutdoor2: typing.ClassVar[VideoCamera.WhiteBalance] # value = <WhiteBalance.kFixedOutdoor2: 5000>
869
+ @staticmethod
870
+ def _pybind11_conduit_v1_(*args, **kwargs):
871
+ ...
872
+ def __eq__(self, other: typing.Any) -> bool:
873
+ ...
874
+ def __getstate__(self) -> int:
875
+ ...
876
+ def __hash__(self) -> int:
877
+ ...
878
+ def __index__(self) -> int:
879
+ ...
880
+ def __init__(self, value: int) -> None:
881
+ ...
882
+ def __int__(self) -> int:
883
+ ...
884
+ def __ne__(self, other: typing.Any) -> bool:
885
+ ...
886
+ def __repr__(self) -> str:
887
+ ...
888
+ def __setstate__(self, state: int) -> None:
889
+ ...
890
+ def __str__(self) -> str:
891
+ ...
892
+ @property
893
+ def name(self) -> str:
894
+ ...
895
+ @property
896
+ def value(self) -> int:
897
+ ...
898
+ @staticmethod
899
+ def _pybind11_conduit_v1_(*args, **kwargs):
900
+ ...
901
+ def __init__(self) -> None:
902
+ ...
903
+ def getBrightness(self) -> int:
904
+ """
905
+ Get the brightness, as a percentage (0-100).
906
+ """
907
+ def setBrightness(self, brightness: int) -> None:
908
+ """
909
+ Set the brightness, as a percentage (0-100).
910
+ """
911
+ def setExposureAuto(self) -> None:
912
+ """
913
+ Set the exposure to auto aperture.
914
+ """
915
+ def setExposureHoldCurrent(self) -> None:
916
+ """
917
+ Set the exposure to hold current.
918
+ """
919
+ def setExposureManual(self, value: int) -> None:
920
+ """
921
+ Set the exposure to manual, as a percentage (0-100).
922
+ """
923
+ def setWhiteBalanceAuto(self) -> None:
924
+ """
925
+ Set the white balance to auto.
926
+ """
927
+ def setWhiteBalanceHoldCurrent(self) -> None:
928
+ """
929
+ Set the white balance to hold current.
930
+ """
931
+ def setWhiteBalanceManual(self, value: int) -> None:
932
+ """
933
+ Set the white balance to manual, with specified color temperature.
934
+ """
935
+ class VideoEvent(RawEvent):
936
+ """
937
+ An event generated by the library and provided to event listeners.
938
+ """
939
+ @staticmethod
940
+ def _pybind11_conduit_v1_(*args, **kwargs):
941
+ ...
942
+ def __init__(self) -> None:
943
+ ...
944
+ def getProperty(self) -> VideoProperty:
945
+ """
946
+ Returns the property associated with the event (if any).
947
+
948
+ :returns: The property associated with the event (if any).
949
+ """
950
+ def getSink(self) -> VideoSink:
951
+ """
952
+ Returns the sink associated with the event (if any).
953
+
954
+ :returns: The sink associated with the event (if any).
955
+ """
956
+ def getSource(self) -> VideoSource:
957
+ """
958
+ Returns the source associated with the event (if any).
959
+
960
+ :returns: The source associated with the event (if any).
961
+ """
962
+ class VideoListener:
963
+ """
964
+ An event listener. This calls back to a designated callback function when
965
+ an event matching the specified mask is generated by the library.
966
+ """
967
+ @staticmethod
968
+ def _pybind11_conduit_v1_(*args, **kwargs):
969
+ ...
970
+ @typing.overload
971
+ def __init__(self) -> None:
972
+ ...
973
+ @typing.overload
974
+ def __init__(self, callback: typing.Callable[[VideoEvent], None], eventMask: int, immediateNotify: bool) -> None:
975
+ """
976
+ Create an event listener.
977
+
978
+ :param callback: Callback function
979
+ :param eventMask: Bitmask of VideoEvent::Kind values
980
+ :param immediateNotify: Whether callback should be immediately called with
981
+ a representative set of events for the current library state.
982
+ """
983
+ class VideoMode:
984
+ """
985
+ Video mode
986
+ """
987
+ class PixelFormat:
988
+ """
989
+ Members:
990
+
991
+ kUnknown
992
+
993
+ kMJPEG
994
+
995
+ kYUYV
996
+
997
+ kRGB565
998
+
999
+ kBGR
1000
+
1001
+ kGray
1002
+
1003
+ kY16
1004
+
1005
+ kUYVY
1006
+
1007
+ kBGRA
1008
+ """
1009
+ __members__: typing.ClassVar[dict[str, VideoMode.PixelFormat]] # value = {'kUnknown': <PixelFormat.kUnknown: 0>, 'kMJPEG': <PixelFormat.kMJPEG: 1>, 'kYUYV': <PixelFormat.kYUYV: 2>, 'kRGB565': <PixelFormat.kRGB565: 3>, 'kBGR': <PixelFormat.kBGR: 4>, 'kGray': <PixelFormat.kGray: 5>, 'kY16': <PixelFormat.kY16: 6>, 'kUYVY': <PixelFormat.kUYVY: 7>, 'kBGRA': <PixelFormat.kBGRA: 8>}
1010
+ kBGR: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kBGR: 4>
1011
+ kBGRA: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kBGRA: 8>
1012
+ kGray: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kGray: 5>
1013
+ kMJPEG: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kMJPEG: 1>
1014
+ kRGB565: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kRGB565: 3>
1015
+ kUYVY: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kUYVY: 7>
1016
+ kUnknown: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kUnknown: 0>
1017
+ kY16: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kY16: 6>
1018
+ kYUYV: typing.ClassVar[VideoMode.PixelFormat] # value = <PixelFormat.kYUYV: 2>
1019
+ @staticmethod
1020
+ def _pybind11_conduit_v1_(*args, **kwargs):
1021
+ ...
1022
+ def __eq__(self, other: typing.Any) -> bool:
1023
+ ...
1024
+ def __getstate__(self) -> int:
1025
+ ...
1026
+ def __hash__(self) -> int:
1027
+ ...
1028
+ def __index__(self) -> int:
1029
+ ...
1030
+ def __init__(self, value: int) -> None:
1031
+ ...
1032
+ def __int__(self) -> int:
1033
+ ...
1034
+ def __ne__(self, other: typing.Any) -> bool:
1035
+ ...
1036
+ def __repr__(self) -> str:
1037
+ ...
1038
+ def __setstate__(self, state: int) -> None:
1039
+ ...
1040
+ def __str__(self) -> str:
1041
+ ...
1042
+ @property
1043
+ def name(self) -> str:
1044
+ ...
1045
+ @property
1046
+ def value(self) -> int:
1047
+ ...
1048
+ __hash__: typing.ClassVar[None] = None
1049
+ fps: int
1050
+ height: int
1051
+ pixelFormat: int
1052
+ width: int
1053
+ @staticmethod
1054
+ def _pybind11_conduit_v1_(*args, **kwargs):
1055
+ ...
1056
+ def __eq__(self, arg0: VideoMode) -> bool:
1057
+ ...
1058
+ @typing.overload
1059
+ def __init__(self) -> None:
1060
+ ...
1061
+ @typing.overload
1062
+ def __init__(self, pixelFormat_: VideoMode.PixelFormat, width_: int, height_: int, fps_: int) -> None:
1063
+ ...
1064
+ def compareWithoutFps(self, other: VideoMode) -> bool:
1065
+ ...
1066
+ class VideoProperty:
1067
+ """
1068
+ A source or sink property.
1069
+ """
1070
+ class Kind:
1071
+ """
1072
+ Members:
1073
+
1074
+ kNone : No specific property.
1075
+
1076
+ kBoolean : Boolean property.
1077
+
1078
+ kInteger : Integer property.
1079
+
1080
+ kString : String property.
1081
+
1082
+ kEnum : Enum property.
1083
+ """
1084
+ __members__: typing.ClassVar[dict[str, VideoProperty.Kind]] # value = {'kNone': <Kind.kNone: 0>, 'kBoolean': <Kind.kBoolean: 1>, 'kInteger': <Kind.kInteger: 2>, 'kString': <Kind.kString: 4>, 'kEnum': <Kind.kEnum: 8>}
1085
+ kBoolean: typing.ClassVar[VideoProperty.Kind] # value = <Kind.kBoolean: 1>
1086
+ kEnum: typing.ClassVar[VideoProperty.Kind] # value = <Kind.kEnum: 8>
1087
+ kInteger: typing.ClassVar[VideoProperty.Kind] # value = <Kind.kInteger: 2>
1088
+ kNone: typing.ClassVar[VideoProperty.Kind] # value = <Kind.kNone: 0>
1089
+ kString: typing.ClassVar[VideoProperty.Kind] # value = <Kind.kString: 4>
1090
+ @staticmethod
1091
+ def _pybind11_conduit_v1_(*args, **kwargs):
1092
+ ...
1093
+ def __eq__(self, other: typing.Any) -> bool:
1094
+ ...
1095
+ def __getstate__(self) -> int:
1096
+ ...
1097
+ def __hash__(self) -> int:
1098
+ ...
1099
+ def __index__(self) -> int:
1100
+ ...
1101
+ def __init__(self, value: int) -> None:
1102
+ ...
1103
+ def __int__(self) -> int:
1104
+ ...
1105
+ def __ne__(self, other: typing.Any) -> bool:
1106
+ ...
1107
+ def __repr__(self) -> str:
1108
+ ...
1109
+ def __setstate__(self, state: int) -> None:
1110
+ ...
1111
+ def __str__(self) -> str:
1112
+ ...
1113
+ @property
1114
+ def name(self) -> str:
1115
+ ...
1116
+ @property
1117
+ def value(self) -> int:
1118
+ ...
1119
+ @staticmethod
1120
+ def _pybind11_conduit_v1_(*args, **kwargs):
1121
+ ...
1122
+ def __init__(self) -> None:
1123
+ ...
1124
+ def get(self) -> int:
1125
+ """
1126
+ Returns property value.
1127
+
1128
+ :returns: Property value.
1129
+ """
1130
+ def getChoices(self) -> list[str]:
1131
+ """
1132
+ Returns the possible values for the enum property value.
1133
+
1134
+ This function is enum-specific.
1135
+
1136
+ :returns: The possible values for the enum property value.
1137
+ """
1138
+ def getDefault(self) -> int:
1139
+ """
1140
+ Returns property default value.
1141
+
1142
+ :returns: Property default value.
1143
+ """
1144
+ def getKind(self) -> VideoProperty.Kind:
1145
+ """
1146
+ Returns property kind.
1147
+
1148
+ :returns: Property kind.
1149
+ """
1150
+ def getLastStatus(self) -> int:
1151
+ """
1152
+ Returns the last status.
1153
+
1154
+ :returns: The last status.
1155
+ """
1156
+ def getMax(self) -> int:
1157
+ """
1158
+ Returns property maximum value.
1159
+
1160
+ :returns: Property maximum value.
1161
+ """
1162
+ def getMin(self) -> int:
1163
+ """
1164
+ Returns property minimum value.
1165
+
1166
+ :returns: Property minimum value.
1167
+ """
1168
+ def getName(self) -> str:
1169
+ """
1170
+ Returns property name.
1171
+
1172
+ :returns: Property name.
1173
+ """
1174
+ def getStep(self) -> int:
1175
+ """
1176
+ Returns property step size.
1177
+
1178
+ :returns: Property step size.
1179
+ """
1180
+ @typing.overload
1181
+ def getString(self) -> str:
1182
+ """
1183
+ Returns the string property value.
1184
+
1185
+ This function is string-specific.
1186
+
1187
+ :returns: The string property value.
1188
+ """
1189
+ @typing.overload
1190
+ def getString(self, buf: list[str]) -> str:
1191
+ """
1192
+ Returns the string property value as a reference to the given buffer.
1193
+
1194
+ This function is string-specific.
1195
+
1196
+ :param buf: The backing storage to which to write the property value.
1197
+
1198
+ :returns: The string property value as a reference to the given buffer.
1199
+ """
1200
+ def isBoolean(self) -> bool:
1201
+ """
1202
+ Returns true if property is a boolean.
1203
+
1204
+ :returns: True if property is a boolean.
1205
+ """
1206
+ def isEnum(self) -> bool:
1207
+ """
1208
+ Returns true if property is an enum.
1209
+
1210
+ :returns: True if property is an enum.
1211
+ """
1212
+ def isInteger(self) -> bool:
1213
+ """
1214
+ Returns true if property is an integer.
1215
+
1216
+ :returns: True if property is an integer.
1217
+ """
1218
+ def isString(self) -> bool:
1219
+ """
1220
+ Returns true if property is a string.
1221
+
1222
+ :returns: True if property is a string.
1223
+ """
1224
+ def set(self, value: int) -> None:
1225
+ """
1226
+ Sets property value.
1227
+
1228
+ :param value: Property value.
1229
+ """
1230
+ def setString(self, value: str) -> None:
1231
+ """
1232
+ Sets the string property value.
1233
+
1234
+ This function is string-specific.
1235
+
1236
+ :param value: String property value.
1237
+ """
1238
+ class VideoSink:
1239
+ """
1240
+ A sink for video that accepts a sequence of frames.
1241
+ """
1242
+ class Kind:
1243
+ """
1244
+ Members:
1245
+
1246
+ kUnknown : Unknown sink type.
1247
+
1248
+ kMjpeg : MJPEG video sink.
1249
+
1250
+ kCv : CV video sink.
1251
+
1252
+ kRaw : Raw video sink.
1253
+ """
1254
+ __members__: typing.ClassVar[dict[str, VideoSink.Kind]] # value = {'kUnknown': <Kind.kUnknown: 0>, 'kMjpeg': <Kind.kMjpeg: 2>, 'kCv': <Kind.kCv: 4>, 'kRaw': <Kind.kRaw: 8>}
1255
+ kCv: typing.ClassVar[VideoSink.Kind] # value = <Kind.kCv: 4>
1256
+ kMjpeg: typing.ClassVar[VideoSink.Kind] # value = <Kind.kMjpeg: 2>
1257
+ kRaw: typing.ClassVar[VideoSink.Kind] # value = <Kind.kRaw: 8>
1258
+ kUnknown: typing.ClassVar[VideoSink.Kind] # value = <Kind.kUnknown: 0>
1259
+ @staticmethod
1260
+ def _pybind11_conduit_v1_(*args, **kwargs):
1261
+ ...
1262
+ def __eq__(self, other: typing.Any) -> bool:
1263
+ ...
1264
+ def __getstate__(self) -> int:
1265
+ ...
1266
+ def __hash__(self) -> int:
1267
+ ...
1268
+ def __index__(self) -> int:
1269
+ ...
1270
+ def __init__(self, value: int) -> None:
1271
+ ...
1272
+ def __int__(self) -> int:
1273
+ ...
1274
+ def __ne__(self, other: typing.Any) -> bool:
1275
+ ...
1276
+ def __repr__(self) -> str:
1277
+ ...
1278
+ def __setstate__(self, state: int) -> None:
1279
+ ...
1280
+ def __str__(self) -> str:
1281
+ ...
1282
+ @property
1283
+ def name(self) -> str:
1284
+ ...
1285
+ @property
1286
+ def value(self) -> int:
1287
+ ...
1288
+ __hash__: typing.ClassVar[None] = None
1289
+ @staticmethod
1290
+ def _pybind11_conduit_v1_(*args, **kwargs):
1291
+ ...
1292
+ @staticmethod
1293
+ def enumerateSinks() -> list[VideoSink]:
1294
+ """
1295
+ Enumerate all existing sinks.
1296
+
1297
+ :returns: Vector of sinks.
1298
+ """
1299
+ def __eq__(self, arg0: VideoSink) -> bool:
1300
+ ...
1301
+ def __init__(self) -> None:
1302
+ ...
1303
+ def enumerateProperties(self) -> list[VideoProperty]:
1304
+ """
1305
+ Enumerate all properties of this sink.
1306
+ """
1307
+ def getConfigJson(self) -> str:
1308
+ """
1309
+ Get a JSON configuration string.
1310
+
1311
+ :returns: JSON configuration string
1312
+ """
1313
+ def getConfigJsonObject(self) -> wpiutil.json:
1314
+ """
1315
+ Get a JSON configuration object.
1316
+
1317
+ :returns: JSON configuration object
1318
+ """
1319
+ def getDescription(self) -> str:
1320
+ """
1321
+ Get the sink description. This is sink-kind specific.
1322
+ """
1323
+ def getHandle(self) -> int:
1324
+ """
1325
+ Returns the VideoSink handle.
1326
+
1327
+ :returns: The VideoSink handle.
1328
+ """
1329
+ def getKind(self) -> VideoSink.Kind:
1330
+ """
1331
+ Get the kind of the sink.
1332
+ """
1333
+ def getLastStatus(self) -> int:
1334
+ ...
1335
+ def getName(self) -> str:
1336
+ """
1337
+ Get the name of the sink. The name is an arbitrary identifier
1338
+ provided when the sink is created, and should be unique.
1339
+ """
1340
+ def getProperty(self, name: str) -> VideoProperty:
1341
+ """
1342
+ Get a property of the sink.
1343
+
1344
+ :param name: Property name
1345
+
1346
+ :returns: Property (kind Property::kNone if no property with
1347
+ the given name exists)
1348
+ """
1349
+ def getSource(self) -> VideoSource:
1350
+ """
1351
+ Get the connected source.
1352
+
1353
+ :returns: Connected source (empty if none connected).
1354
+ """
1355
+ def getSourceProperty(self, name: str) -> VideoProperty:
1356
+ """
1357
+ Get a property of the associated source.
1358
+
1359
+ :param name: Property name
1360
+
1361
+ :returns: Property (kind Property::kNone if no property with
1362
+ the given name exists or no source connected)
1363
+ """
1364
+ @typing.overload
1365
+ def setConfigJson(self, config: str) -> bool:
1366
+ """
1367
+ Set properties from a JSON configuration string.
1368
+
1369
+ The format of the JSON input is:
1370
+
1371
+ ::
1372
+
1373
+ {
1374
+ "properties": [
1375
+ {
1376
+ "name": property name
1377
+ "value": property value
1378
+ }
1379
+ ]
1380
+ }
1381
+
1382
+ :param config: configuration
1383
+
1384
+ :returns: True if set successfully
1385
+ """
1386
+ @typing.overload
1387
+ def setConfigJson(self, config: wpiutil.json) -> bool:
1388
+ """
1389
+ Set properties from a JSON configuration object.
1390
+
1391
+ :param config: configuration
1392
+
1393
+ :returns: True if set successfully
1394
+ """
1395
+ def setSource(self, source: VideoSource) -> None:
1396
+ """
1397
+ Configure which source should provide frames to this sink. Each sink
1398
+ can accept frames from only a single source, but a single source can
1399
+ provide frames to multiple clients.
1400
+
1401
+ :param source: Source
1402
+ """
1403
+ class VideoSource:
1404
+ """
1405
+ A source for video that provides a sequence of frames.
1406
+ """
1407
+ class ConnectionStrategy:
1408
+ """
1409
+ Connection strategy. Used for SetConnectionStrategy().
1410
+
1411
+ Members:
1412
+
1413
+ kConnectionAutoManage : Automatically connect or disconnect based on whether any sinks are
1414
+ connected to this source. This is the default behavior.
1415
+
1416
+ kConnectionKeepOpen : Try to keep the connection open regardless of whether any sinks are
1417
+ connected.
1418
+
1419
+ kConnectionForceClose : Never open the connection. If this is set when the connection is open,
1420
+ close the connection.
1421
+ """
1422
+ __members__: typing.ClassVar[dict[str, VideoSource.ConnectionStrategy]] # value = {'kConnectionAutoManage': <ConnectionStrategy.kConnectionAutoManage: 0>, 'kConnectionKeepOpen': <ConnectionStrategy.kConnectionKeepOpen: 1>, 'kConnectionForceClose': <ConnectionStrategy.kConnectionForceClose: 2>}
1423
+ kConnectionAutoManage: typing.ClassVar[VideoSource.ConnectionStrategy] # value = <ConnectionStrategy.kConnectionAutoManage: 0>
1424
+ kConnectionForceClose: typing.ClassVar[VideoSource.ConnectionStrategy] # value = <ConnectionStrategy.kConnectionForceClose: 2>
1425
+ kConnectionKeepOpen: typing.ClassVar[VideoSource.ConnectionStrategy] # value = <ConnectionStrategy.kConnectionKeepOpen: 1>
1426
+ @staticmethod
1427
+ def _pybind11_conduit_v1_(*args, **kwargs):
1428
+ ...
1429
+ def __eq__(self, other: typing.Any) -> bool:
1430
+ ...
1431
+ def __getstate__(self) -> int:
1432
+ ...
1433
+ def __hash__(self) -> int:
1434
+ ...
1435
+ def __index__(self) -> int:
1436
+ ...
1437
+ def __init__(self, value: int) -> None:
1438
+ ...
1439
+ def __int__(self) -> int:
1440
+ ...
1441
+ def __ne__(self, other: typing.Any) -> bool:
1442
+ ...
1443
+ def __repr__(self) -> str:
1444
+ ...
1445
+ def __setstate__(self, state: int) -> None:
1446
+ ...
1447
+ def __str__(self) -> str:
1448
+ ...
1449
+ @property
1450
+ def name(self) -> str:
1451
+ ...
1452
+ @property
1453
+ def value(self) -> int:
1454
+ ...
1455
+ class Kind:
1456
+ """
1457
+ Video source kind.
1458
+
1459
+ Members:
1460
+
1461
+ kUnknown : Unknown video source.
1462
+
1463
+ kUsb : USB video source.
1464
+
1465
+ kHttp : HTTP video source.
1466
+
1467
+ kCv : CV video source.
1468
+
1469
+ kRaw : Raw video source.
1470
+ """
1471
+ __members__: typing.ClassVar[dict[str, VideoSource.Kind]] # value = {'kUnknown': <Kind.kUnknown: 0>, 'kUsb': <Kind.kUsb: 1>, 'kHttp': <Kind.kHttp: 2>, 'kCv': <Kind.kCv: 4>, 'kRaw': <Kind.kRaw: 8>}
1472
+ kCv: typing.ClassVar[VideoSource.Kind] # value = <Kind.kCv: 4>
1473
+ kHttp: typing.ClassVar[VideoSource.Kind] # value = <Kind.kHttp: 2>
1474
+ kRaw: typing.ClassVar[VideoSource.Kind] # value = <Kind.kRaw: 8>
1475
+ kUnknown: typing.ClassVar[VideoSource.Kind] # value = <Kind.kUnknown: 0>
1476
+ kUsb: typing.ClassVar[VideoSource.Kind] # value = <Kind.kUsb: 1>
1477
+ @staticmethod
1478
+ def _pybind11_conduit_v1_(*args, **kwargs):
1479
+ ...
1480
+ def __eq__(self, other: typing.Any) -> bool:
1481
+ ...
1482
+ def __getstate__(self) -> int:
1483
+ ...
1484
+ def __hash__(self) -> int:
1485
+ ...
1486
+ def __index__(self) -> int:
1487
+ ...
1488
+ def __init__(self, value: int) -> None:
1489
+ ...
1490
+ def __int__(self) -> int:
1491
+ ...
1492
+ def __ne__(self, other: typing.Any) -> bool:
1493
+ ...
1494
+ def __repr__(self) -> str:
1495
+ ...
1496
+ def __setstate__(self, state: int) -> None:
1497
+ ...
1498
+ def __str__(self) -> str:
1499
+ ...
1500
+ @property
1501
+ def name(self) -> str:
1502
+ ...
1503
+ @property
1504
+ def value(self) -> int:
1505
+ ...
1506
+ __hash__: typing.ClassVar[None] = None
1507
+ @staticmethod
1508
+ def _pybind11_conduit_v1_(*args, **kwargs):
1509
+ ...
1510
+ @staticmethod
1511
+ def enumerateSources() -> list[VideoSource]:
1512
+ """
1513
+ Enumerate all existing sources.
1514
+
1515
+ :returns: Vector of sources.
1516
+ """
1517
+ def __eq__(self, arg0: VideoSource) -> bool:
1518
+ ...
1519
+ def __init__(self) -> None:
1520
+ ...
1521
+ def enumerateProperties(self) -> list[VideoProperty]:
1522
+ """
1523
+ Enumerate all properties of this source.
1524
+ """
1525
+ def enumerateSinks(self) -> list[VideoSink]:
1526
+ """
1527
+ Enumerate all sinks connected to this source.
1528
+
1529
+ :returns: Vector of sinks.
1530
+ """
1531
+ def enumerateVideoModes(self) -> list[VideoMode]:
1532
+ """
1533
+ Enumerate all known video modes for this source.
1534
+ """
1535
+ def getActualDataRate(self) -> float:
1536
+ """
1537
+ Get the data rate (in bytes per second).
1538
+
1539
+ SetTelemetryPeriod() must be called for this to be valid.
1540
+
1541
+ :returns: Data rate averaged over the telemetry period.
1542
+ """
1543
+ def getActualFPS(self) -> float:
1544
+ """
1545
+ Get the actual FPS.
1546
+
1547
+ SetTelemetryPeriod() must be called for this to be valid.
1548
+
1549
+ :returns: Actual FPS averaged over the telemetry period.
1550
+ """
1551
+ def getConfigJson(self) -> str:
1552
+ """
1553
+ Get a JSON configuration string.
1554
+
1555
+ :returns: JSON configuration string
1556
+ """
1557
+ def getConfigJsonObject(self) -> wpiutil.json:
1558
+ """
1559
+ Get a JSON configuration object.
1560
+
1561
+ :returns: JSON configuration object
1562
+ """
1563
+ def getDescription(self) -> str:
1564
+ """
1565
+ Get the source description. This is source-kind specific.
1566
+ """
1567
+ def getHandle(self) -> int:
1568
+ ...
1569
+ def getKind(self) -> VideoSource.Kind:
1570
+ """
1571
+ Get the kind of the source.
1572
+ """
1573
+ def getLastFrameTime(self) -> int:
1574
+ """
1575
+ Get the last time a frame was captured.
1576
+ This uses the same time base as wpi::Now().
1577
+
1578
+ :returns: Time in 1 us increments.
1579
+ """
1580
+ def getLastStatus(self) -> int:
1581
+ ...
1582
+ def getName(self) -> str:
1583
+ """
1584
+ Get the name of the source. The name is an arbitrary identifier
1585
+ provided when the source is created, and should be unique.
1586
+ """
1587
+ def getProperty(self, name: str) -> VideoProperty:
1588
+ """
1589
+ Get a property.
1590
+
1591
+ :param name: Property name
1592
+
1593
+ :returns: Property contents (of kind Property::kNone if no property with
1594
+ the given name exists)
1595
+ """
1596
+ def getVideoMode(self) -> VideoMode:
1597
+ """
1598
+ Get the current video mode.
1599
+ """
1600
+ def isConnected(self) -> bool:
1601
+ """
1602
+ Is the source currently connected to whatever is providing the images?
1603
+ """
1604
+ def isEnabled(self) -> bool:
1605
+ """
1606
+ Gets source enable status. This is determined with a combination of
1607
+ connection strategy and the number of sinks connected.
1608
+
1609
+ :returns: True if enabled, false otherwise.
1610
+ """
1611
+ @typing.overload
1612
+ def setConfigJson(self, config: str) -> bool:
1613
+ """
1614
+ Set video mode and properties from a JSON configuration string.
1615
+
1616
+ The format of the JSON input is:
1617
+
1618
+ ::
1619
+
1620
+ {
1621
+ "pixel format": "MJPEG", "YUYV", etc
1622
+ "width": video mode width
1623
+ "height": video mode height
1624
+ "fps": video mode fps
1625
+ "brightness": percentage brightness
1626
+ "white balance": "auto", "hold", or value
1627
+ "exposure": "auto", "hold", or value
1628
+ "properties": [
1629
+ {
1630
+ "name": property name
1631
+ "value": property value
1632
+ }
1633
+ ]
1634
+ }
1635
+
1636
+ :param config: configuration
1637
+
1638
+ :returns: True if set successfully
1639
+ """
1640
+ @typing.overload
1641
+ def setConfigJson(self, config: wpiutil.json) -> bool:
1642
+ """
1643
+ Set video mode and properties from a JSON configuration object.
1644
+
1645
+ :param config: configuration
1646
+
1647
+ :returns: True if set successfully
1648
+ """
1649
+ def setConnectionStrategy(self, strategy: VideoSource.ConnectionStrategy) -> None:
1650
+ """
1651
+ Sets the connection strategy. By default, the source will automatically
1652
+ connect or disconnect based on whether any sinks are connected.
1653
+
1654
+ This function is non-blocking; look for either a connection open or
1655
+ close event or call IsConnected() to determine the connection state.
1656
+
1657
+ :param strategy: connection strategy (auto, keep open, or force close)
1658
+ """
1659
+ def setFPS(self, fps: int) -> bool:
1660
+ """
1661
+ Set the frames per second (FPS).
1662
+
1663
+ :param fps: desired FPS
1664
+
1665
+ :returns: True if set successfully
1666
+ """
1667
+ def setPixelFormat(self, pixelFormat: VideoMode.PixelFormat) -> bool:
1668
+ """
1669
+ Set the pixel format.
1670
+
1671
+ :param pixelFormat: desired pixel format
1672
+
1673
+ :returns: True if set successfully
1674
+ """
1675
+ def setResolution(self, width: int, height: int) -> bool:
1676
+ """
1677
+ Set the resolution.
1678
+
1679
+ :param width: desired width
1680
+ :param height: desired height
1681
+
1682
+ :returns: True if set successfully
1683
+ """
1684
+ @typing.overload
1685
+ def setVideoMode(self, mode: VideoMode) -> bool:
1686
+ """
1687
+ Set the video mode.
1688
+
1689
+ :param mode: Video mode
1690
+ """
1691
+ @typing.overload
1692
+ def setVideoMode(self, pixelFormat: VideoMode.PixelFormat, width: int, height: int, fps: int) -> bool:
1693
+ """
1694
+ Set the video mode.
1695
+
1696
+ :param pixelFormat: desired pixel format
1697
+ :param width: desired width
1698
+ :param height: desired height
1699
+ :param fps: desired FPS
1700
+
1701
+ :returns: True if set successfully
1702
+ """
1703
+ def _setLogger(func: typing.Callable[[int, str, int, str], None], min_level: int) -> None:
1704
+ ...
1705
+ def runMainRunLoop() -> None:
1706
+ ...
1707
+ def runMainRunLoopTimeout(timeoutSeconds: float) -> int:
1708
+ ...
1709
+ def stopMainRunLoop() -> None:
1710
+ ...
1711
+ _cleanup: typing.Any # value = <capsule object>