pub type DisparityFrame = ImageFrame<Disparity>;
Expand description
An ImageFrame type holding the raw pointer and derived metadata for an RS2 Disparity 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 DisparityFrame { /* private fields */ }
Implementations§
Source§impl DisparityFrame
impl DisparityFrame
Sourcepub fn distance(&self, col: usize, row: usize) -> Result<f32, DepthError>
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
Like with depth frames, this method is fairly expensive to use in practice. The disparity can be converted to depth fairly easily, but this will effectively copy every pixel if you loop through the data with this method for every index.
It is often much more efficient to directly stream the
Rs2Format::Distance
format if you want the distance
directly, and access the frame data with ImageFrame::get
.
Sourcepub fn depth_units(&self) -> Result<f32>
pub fn depth_units(&self) -> Result<f32>
Get the metric units currently used for reporting depth information.
Trait Implementations§
Source§impl FrameCategory for DisparityFrame
impl FrameCategory for DisparityFrame
Source§fn extension() -> Rs2Extension
fn extension() -> Rs2Extension
Rs2Extension
for the type implementing this trait.