Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
Public Member Functions | Public Attributes | Friends | List of all members
rs2::frame_source Class Reference

#include <rs_processing.hpp>

Public Member Functions

frame allocate_video_frame (const stream_profile &profile, const frame &original, int new_bpp=0, int new_width=0, int new_height=0, int new_stride=0, rs2_extension frame_type=RS2_EXTENSION_VIDEO_FRAME) const
 
frame allocate_motion_frame (const stream_profile &profile, const frame &original, rs2_extension frame_type=RS2_EXTENSION_MOTION_FRAME) const
 
frame allocate_points (const stream_profile &profile, const frame &original) const
 
frame allocate_composite_frame (std::vector< frame > frames) const
 
void frame_ready (frame result) const
 

Public Attributes

rs2_source_source
 

Friends

template<class T >
class frame_processor_callback
 

Detailed Description

The source used to generate frames, which is usually done by the low level driver for each sensor. frame_source is one of the parameters of processing_block's callback function, which can be used to re-generate the frame and via frame_ready invoke another callback function to notify application frame is ready. Please refer to "video_processing_thread" code snippet in rs-measure.cpp for a detailed usage example.

Member Function Documentation

◆ allocate_composite_frame()

frame rs2::frame_source::allocate_composite_frame ( std::vector< frame frames) const
inline

Allocate composite frame with given params

Parameters
[in]framesFrame vecotor used to create composite frame, the size of composite frame will be the same as vector size.
Returns
The allocated composite frame

◆ allocate_motion_frame()

frame rs2::frame_source::allocate_motion_frame ( const stream_profile profile,
const frame original,
rs2_extension  frame_type = RS2_EXTENSION_MOTION_FRAME 
) const
inline

Allocate a new motion frame with given params

Parameters
[in]profileStream profile going to allocate.
[in]originalOriginal frame.
[in]frame_typeWhich frame type are going to create.
Returns
The allocated frame

◆ allocate_points()

frame rs2::frame_source::allocate_points ( const stream_profile profile,
const frame original 
) const
inline

◆ allocate_video_frame()

frame rs2::frame_source::allocate_video_frame ( const stream_profile profile,
const frame original,
int  new_bpp = 0,
int  new_width = 0,
int  new_height = 0,
int  new_stride = 0,
rs2_extension  frame_type = RS2_EXTENSION_VIDEO_FRAME 
) const
inline

Allocate a new video frame with given params

Parameters
[in]profileStream profile going to allocate.
[in]originalOriginal frame, if new_bpp, new_width, new_height or new_stride is zero, newly created frame will base on original frame's metadata to allocate new frame. If frame_type is RS2_EXTENSION_DEPTH_FRAME, the original of the returned frame will be set to it.
[in]new_bppFrame bit per pixel to create.
[in]new_widthFrame width to create.
[in]new_heightFrame height to create.
[in]new_strideFrame stride to create.
[in]frame_typeWhich frame type are going to create.
Returns
The allocated frame

◆ frame_ready()

void rs2::frame_source::frame_ready ( frame  result) const
inline

Invoke the callback funtion informing the frame is ready.

Parameters
[in]framesframe to send to callback function.

Friends And Related Function Documentation

◆ frame_processor_callback

template<class T >
friend class frame_processor_callback
friend

Member Data Documentation

◆ _source

rs2_source* rs2::frame_source::_source

The documentation for this class was generated from the following file: