Expand description
Camera-capture POD types — CaptureStreamId + CameraConfig +
CameraFacing + StreamState + … . The stateful CameraStream /
CameraManager (which own the shared ImageRef texture) live in
azul_layout::managers::camera.
POD types for the camera-capture surface
(SUPER_PLAN_2 §4 Priority 6 + research/01).
Camera frames are GPU textures, not scalar samples, so the stateful side
is heavier than the sensors’: azul_layout::managers::camera owns a
CameraStream per capture, each holding a shared ImageRef texture the
capture thread writes into (zero-copy - clones see new bytes via the
ImageRef Arc). A CameraPreview node renders that texture and, by
appearing in the DOM, declares “I need the camera” to the permission
layer (research/01 §“permission-as-DOM”).
Defined here in azul-core so the config / id / status types cross the
FFI without azul-layout (or AVFoundation / Camera2) as a dependency -
these are what an app passes to start_camera and reads back from a
stream. The Nv12 zero-copy output format is a RawImageFormat addition
deferred to the backend tick; configs default to BGRA8.
Structs§
- Camera
Config - Requested capture configuration - the input to
start_camera. Zerowidth/height/fpsmean “let the backend pick its default”. - Capture
Stats - Runtime stats for a capture stream - surfaced for HUD / debugging.
- Capture
Stream Id - Identifies one camera capture stream - assigned by
start_camera, used to read the stream back (get_camera_frame) and to stop / pause / flip it.
Enums§
- Camera
Facing - Which physical camera to open.
- Capture
Error Code - Why a capture stream failed (
StreamState::Error). - Capture
Orientation - Rotation / mirroring the capture needs relative to the display (the sensor’s native orientation rarely matches the UI’s).
- Stream
State - Lifecycle of a capture stream.