Camera¶
Runnable example
python/examples/camera_view.py — streams for 5 s and prints fps and final-frame luminance stats.
resoio.camera.CameraClient ¶
Bases: _BaseClient[CameraStub]
Async client for the Resonite IO Camera service over a UDS.
Use as an async context manager so the gRPC channel is closed
deterministically. Socket resolution mirrors
:class:resoio.ConnectionClient.
Source code in src/resoio/_client.py
stream
async
¶
Stream camera frames from the server.
The capture resolution is the Display modality's responsibility;
frames arrive uncapped (best-effort native fps). Raises
:class:RuntimeError if called outside async with.
Source code in src/resoio/camera.py
shot
async
¶
Take a single frame, then close the stream (one-shot).
Convenience wrapper over :meth:stream for the common
screenshot case: open the server stream, return the first
:class:Frame, and close the stream so no further frames are
pulled. Raises :class:RuntimeError if called outside
async with or if the server closes the stream before
delivering a frame.
Source code in src/resoio/camera.py
resoio.camera.Frame
dataclass
¶
One decoded camera frame.
pixels is an (H, W, 4) RGBA8 view over the protobuf payload
bytes (read-only; call .copy() for a writable array). Row 0 is
the image top. height / width / channels are derived from
pixels.shape. unix_nanos is the server-side capture timestamp
in UTC nanos since the Unix epoch. frame_id is a server-side
monotonic counter that restarts at 0 per stream() call.