Trait FrameEx

Source
pub trait FrameEx {
    // Required methods
    fn stream_profile(&self) -> &StreamProfile;
    fn sensor(&self) -> Result<Sensor>;
    fn frame_number(&self) -> u64;
    fn timestamp(&self) -> f64;
    fn timestamp_domain(&self) -> Rs2TimestampDomain;
    fn metadata(&self, metadata_kind: Rs2FrameMetadata) -> Option<c_longlong>;
    fn supports_metadata(&self, metadata_kind: Rs2FrameMetadata) -> bool;
    unsafe fn get_owned_raw(self) -> NonNull<rs2_frame>;
}
Expand description

Describes common functionality across frame types.

Required Methods§

Source

fn stream_profile(&self) -> &StreamProfile

Get the stream profile associated with the frame.

Source

fn sensor(&self) -> Result<Sensor>

Get the sensor associated with the frame.

Source

fn frame_number(&self) -> u64

Get the frame number.

Source

fn timestamp(&self) -> f64

Get the frame timestamp.

Source

fn timestamp_domain(&self) -> Rs2TimestampDomain

Get the RealSense timestamp domain for the current timestamp.

Source

fn metadata(&self, metadata_kind: Rs2FrameMetadata) -> Option<c_longlong>

Get frame metadata.

Returns None if the metadata_kind is not supported by the frame type.

Source

fn supports_metadata(&self, metadata_kind: Rs2FrameMetadata) -> bool

Test whether the metadata arguemnt is supported by the frame.

Source

unsafe fn get_owned_raw(self) -> NonNull<rs2_frame>

Get (and own) the underlying frame pointer for this frame.

This is primarily useful for passing this frame forward to a processing block or blocks (either via frame queue, directly, callback, etc).

§Safety

This does not destroy the underlying frame pointer once self goes out of scope. Instead, the program expects that whatever object was assigned to by this function now manages the lifetime.

Implementors§