pub struct BodyIndexFrameData {
pub width: u32,
pub height: u32,
pub timestamp: u64,
pub data: Arc<[u8]>,
}Fields§
§width: u32§height: u32§timestamp: u64§data: Arc<[u8]>Implementations§
Source§impl BodyIndexFrameData
impl BodyIndexFrameData
pub fn new(body_index_frame: &BodyIndexFrame) -> Result<Self, Error>
Sourcepub fn get_body_index_at(&self, x: u32, y: u32) -> Option<u8>
pub fn get_body_index_at(&self, x: u32, y: u32) -> Option<u8>
Gets the body index for a specific pixel (x, y). Returns None if the coordinates are out of bounds. Returns Some(body_index) where body_index is 0-5 for tracked bodies, or 255 for background pixels.
Sourcepub fn is_body_pixel(&self, x: u32, y: u32) -> bool
pub fn is_body_pixel(&self, x: u32, y: u32) -> bool
Returns true if the pixel at (x, y) belongs to a tracked body.
Sourcepub fn is_background_pixel(&self, x: u32, y: u32) -> bool
pub fn is_background_pixel(&self, x: u32, y: u32) -> bool
Returns true if the pixel at (x, y) is background.
Sourcepub fn get_body_statistics(&self) -> BodyIndexStatistics
pub fn get_body_statistics(&self) -> BodyIndexStatistics
Gets statistics about body coverage in the frame.
Trait Implementations§
Source§impl Clone for BodyIndexFrameData
impl Clone for BodyIndexFrameData
Source§fn clone(&self) -> BodyIndexFrameData
fn clone(&self) -> BodyIndexFrameData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BodyIndexFrameData
impl Debug for BodyIndexFrameData
Auto Trait Implementations§
impl Freeze for BodyIndexFrameData
impl RefUnwindSafe for BodyIndexFrameData
impl Send for BodyIndexFrameData
impl Sync for BodyIndexFrameData
impl Unpin for BodyIndexFrameData
impl UnwindSafe for BodyIndexFrameData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more