pub struct BodyFrameCapture { /* private fields */ }Expand description
Manages the Kinect sensor and provides access to body frame data.
This struct is responsible for initializing and holding the necessary Kinect resources to capture body frames.
Implementations§
Source§impl BodyFrameCapture
impl BodyFrameCapture
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
Creates a new BodyFrameCapture instance.
This function initializes the default Kinect sensor, opens it, and sets up the body frame source and reader.
§Errors
Returns an error if the Kinect sensor cannot be initialized, opened, or if the body frame source is not active.
Sourcepub fn iter(&self) -> Result<BodyFrameCaptureIter, Error>
pub fn iter(&self) -> Result<BodyFrameCaptureIter, Error>
Returns an iterator over body frames.
The iterator will block waiting for new frames. Each item yielded by
the iterator is a Result<BodyFrameData, Error>, allowing for error
handling during frame acquisition.
§Errors
Returns an error if it fails to subscribe to the frame arrived event, which is necessary for the iterator to function.