Class frame

Inheritance Relationships

Derived Types

Class Documentation

class frame

Subclassed by rs2::frameset, rs2::gl::gpu_frame, rs2::motion_frame, rs2::points, rs2::pose_frame, rs2::video_frame

Public Functions

inline frame()

Base class for multiple frame extensions

inline frame(rs2_frame *ref)

Base class for multiple frame extensions with internal frame handle

Parameters:

rs2_frame[in] frame_ref - internal frame instance

inline frame(frame &&other) noexcept

Change the internal frame handle to the one in parameter, then put the other frame internal frame handle to nullptr

Parameters:

frame[in] other - another frame instance to be pointed to

inline frame &operator=(frame other)

Change the internal frame handle to the one in parameter, the function exchange the internal frame handle.

Parameters:

frame[in] other - another frame instance to be pointed to

inline frame(const frame &other)

Set the internal frame handle to the one in parameter, the function create additional reference if internal reference exist.

Parameters:

frame[in] other - another frame instance to be pointed to

inline void swap(frame &other)

Swap the internal frame handle with the one in parameter

Parameters:

frame[in] other - another frame instance to be swaped

inline ~frame()

releases the frame handle

inline void keep()

keep the frame, otherwise if no refernce to the frame, the frame will be released.

inline operator bool() const

Parenthesis operator check if internal frame handle is valid.

Returns:

bool - true or false.

inline rs2_sensor *get_sensor()
inline double get_timestamp() const

retrieve the time at which the frame was captured During the frame’s lifetime it receives timestamps both at the device and host levels. The different timestamps are gathered and managed under the frame’s Metadata attributes. Chronologically the list of timestamps comprises of: SENSOR_TIMESTAMP - Device clock. For video sensors designates the middle of exposure. Requires metadata support. FRAME_TIMESTAMP - Device clock. Stamped at the beginning of frame readout and transfer. Requires metadata support. BACKEND_TIMESTAMP - Host (EPOCH) clock in Kernel space. Frame transfer from USB Controller to the USB Driver. TIME_OF_ARRIVAL - Host (EPOCH) clock in User space. Frame transfer from the USB Driver to Librealsense.

During runtime the SDK dynamically selects the most correct representaion, based on both device and host capabilities: In case the frame metadata is not configured:

  • The function call provides the TIME_OF_ARRIVAL stamp. In case the metadata is available the function returns:

  • HW Timestamp (FRAME_TIMESTAMP), or

  • Global Timestamp Host-corrected derivative of HW Timestamp required for multi-sensor/device synchronization

  • The user can select between the unmodified and the host-calculated Hardware Timestamp by toggling the RS2_OPTION_GLOBAL_TIME_ENABLED option. To query which of the three alternatives is active use get_frame_timestamp_domain() function call

Returns:

the timestamp of the frame, in milliseconds according to the elaborated flow

inline rs2_timestamp_domain get_frame_timestamp_domain() const

retrieve the timestamp domain

Returns:

timestamp domain (clock name) for timestamp values

inline rs2_metadata_type get_frame_metadata(rs2_frame_metadata_value frame_metadata) const

retrieve the current value of a single frame_metadata

Parameters:

frame_metadata[in] the frame_metadata whose value should be retrieved

Returns:

the value of the frame_metadata

inline bool supports_frame_metadata(rs2_frame_metadata_value frame_metadata) const

determine if the device allows a specific metadata to be queried

Parameters:

frame_metadata[in] the frame_metadata to check for support

Returns:

true if the frame_metadata can be queried

inline unsigned long long get_frame_number() const

retrieve frame number (from frame handle)

Returns:

the frame number of the frame, in milliseconds since the device was started

inline const int get_data_size() const

retrieve data size from frame handle

Returns:

the number of bytes in frame

inline const void *get_data() const

retrieve data from frame handle

Returns:

the pointer to the start of the frame data

inline stream_profile get_profile() const

retrieve stream profile from frame handle

Returns:

stream_profile - the pointer to the stream profile

template<class T>
inline bool is() const

Template function, checking if current instance is the type of another class

Returns:

bool - true or false.

template<class T>
inline T as() const

Template function, cast current instance as the type of another class

Returns:

class instance.

inline rs2_frame *get() const

Retrieve back the internal frame handle

Returns:

rs2_frame - internal frame handle.

inline explicit operator rs2_frame*()
inline frame apply_filter(filter_interface &filter)

Protected Functions

inline void add_ref() const

add additional reference to a frame without duplicating frame data

Parameters:

result[out] new frame reference, release by destructor

Returns:

true if cloning was successful

inline void reset()

Friends

friend class rs2::frame_source
friend class rs2::frame_queue
friend class rs2::syncer
friend class rs2::processing_block
friend class rs2::pointcloud
friend class rs2::points