pub struct ColorFrameCapture { /* private fields */ }Expand description
Manages the Kinect sensor and provides access to color frame data.
This struct is responsible for initializing and holding the necessary Kinect resources to capture color frames.
Implementations§
Source§impl ColorFrameCapture
impl ColorFrameCapture
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
Creates a new ColorFrameCapture instance.
This function initializes the default Kinect sensor, opens it, and sets up the color frame source and reader.
§Errors
Returns an error if the Kinect sensor cannot be initialized, opened, or if the color frame source is not active.
Sourcepub fn new_with_format(
color_image_format: ColorImageFormat,
) -> Result<Self, Error>
pub fn new_with_format( color_image_format: ColorImageFormat, ) -> Result<Self, Error>
Creates a new ColorFrameCapture instance with the specified color image format.
Sourcepub fn iter(&self) -> Result<ColorFrameCaptureIter, Error>
pub fn iter(&self) -> Result<ColorFrameCaptureIter, Error>
Returns an iterator over color frames.
The iterator will block waiting for new frames. Each item yielded by
the iterator is a Result<ColorFrameData, 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.