Type Alias DepthFrame

Source
pub type DepthFrame = ImageFrame<Depth>;
Expand description

An ImageFrame type holding the raw pointer and derived metadata for an RS2 Depth frame.

All fields in this struct are initialized during struct creation (via try_from). Everything called from here during runtime should be valid as long as the Frame is in scope… like normal Rust.

Aliased Type§

pub struct DepthFrame { /* private fields */ }

Implementations§

Source§

impl DepthFrame

Source

pub fn distance(&self, col: usize, row: usize) -> Result<f32, DepthError>

Given the 2D depth coordinate (x,y) provide the corresponding depth in metric units.

§Warning

It is fairly expensive to use this in practice as it will copy the underlying pixel into a f32 value that gives you the direct distance. In practice getting DepthFrame::depth_units and then applying that to the raw data with ImageFrame::get is a much more efficient way to handle this.

Source

pub fn depth_units(&self) -> Result<f32>

Get the metric units currently used for reporting depth information.

Trait Implementations§

Source§

impl FrameCategory for DepthFrame

Source§

fn extension() -> Rs2Extension

Identifies the corresponding Rs2Extension for the type implementing this trait.
Source§

fn kind() -> Rs2StreamKind

Identifies the stream kind corresponding to a given type implementing this trait.
Source§

fn has_correct_kind(&self) -> bool

Predicate for checking if the RS2 frame’s stream has the same kind as the frame category.