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§
Sourcefn stream_profile(&self) -> &StreamProfile
fn stream_profile(&self) -> &StreamProfile
Get the stream profile associated with the frame.
Sourcefn frame_number(&self) -> u64
fn frame_number(&self) -> u64
Get the frame number.
Sourcefn timestamp_domain(&self) -> Rs2TimestampDomain
fn timestamp_domain(&self) -> Rs2TimestampDomain
Get the RealSense timestamp domain for the current timestamp.
Sourcefn metadata(&self, metadata_kind: Rs2FrameMetadata) -> Option<c_longlong>
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.
Sourcefn supports_metadata(&self, metadata_kind: Rs2FrameMetadata) -> bool
fn supports_metadata(&self, metadata_kind: Rs2FrameMetadata) -> bool
Test whether the metadata arguemnt is supported by the frame.
Sourceunsafe fn get_owned_raw(self) -> NonNull<rs2_frame>
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.