pub struct PointsFrame { /* private fields */ }
Expand description
Holds the raw data pointer and derived data for an RS2 Points 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.
Implementations§
Source§impl PointsFrame
impl PointsFrame
Sourcepub fn vertices(&self) -> &[rs2_vertex]
pub fn vertices(&self) -> &[rs2_vertex]
Gets vertices of the point cloud.
Sourcepub fn texture_coordinates(&self) -> &[[f32; 2]]
pub fn texture_coordinates(&self) -> &[[f32; 2]]
Retrieve the texture coordinates (uv map) for the point cloud.
§Safety
The librealsense2 C++ API directly casts the rs2_pixel*
returned from
rs2_get_frame_texture_coordinates()
into a texture_coordinate*
, thereby re-interpreting
[[c_int; 2]; N]
as [[c_float; 2]; N]
values. Note that C does not generally guarantee
that sizeof(int) == sizeof(float)
.
Sourcepub fn points_count(&self) -> usize
pub fn points_count(&self) -> usize
Gets number of points in the point cloud.
Trait Implementations§
Source§impl Debug for PointsFrame
impl Debug for PointsFrame
Source§impl Drop for PointsFrame
impl Drop for PointsFrame
Source§impl FrameCategory for PointsFrame
impl FrameCategory for PointsFrame
Source§fn extension() -> Rs2Extension
fn extension() -> Rs2Extension
Rs2Extension
for the type implementing this trait.Source§fn kind() -> Rs2StreamKind
fn kind() -> Rs2StreamKind
Source§fn has_correct_kind(&self) -> bool
fn has_correct_kind(&self) -> bool
Source§impl FrameEx for PointsFrame
impl FrameEx for PointsFrame
Source§fn stream_profile(&self) -> &StreamProfile
fn stream_profile(&self) -> &StreamProfile
Source§fn timestamp_domain(&self) -> Rs2TimestampDomain
fn timestamp_domain(&self) -> Rs2TimestampDomain
Source§fn frame_number(&self) -> u64
fn frame_number(&self) -> u64
Source§fn metadata(&self, metadata_kind: Rs2FrameMetadata) -> Option<c_longlong>
fn metadata(&self, metadata_kind: Rs2FrameMetadata) -> Option<c_longlong>
Source§fn supports_metadata(&self, metadata_kind: Rs2FrameMetadata) -> bool
fn supports_metadata(&self, metadata_kind: Rs2FrameMetadata) -> bool
Source§impl TryFrom<NonNull<rs2_frame>> for PointsFrame
impl TryFrom<NonNull<rs2_frame>> for PointsFrame
Source§fn try_from(frame_ptr: NonNull<rs2_frame>) -> Result<Self, Self::Error>
fn try_from(frame_ptr: NonNull<rs2_frame>) -> Result<Self, Self::Error>
Attempt to construct a points frame from a raw pointer to rs2_frame
All members of the PointsFrame
struct are validated and populated during this call.
§Errors
There are a number of errors that may occur if the data in the rs2_frame
is not valid, all
of type FrameConstructionError
.
CouldNotGetTimestamp
CouldNotGetTimestampDomain
CouldNotGetFrameStreamProfile
CouldNotGetPointCount
CouldNotGetData
See FrameConstructionError
documentation for more details.