Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
librealsense2 API

File-System Structure

Under librealsense2 folder you will find two subfolers:

In addition, you can include <librealsense2/rs.h> and <librealsense2/rs.hpp> to get most of SDK functionality in C and C++ respectively.

<librealsense2/rs_advanced_mode.h> and <librealsense2/rs_advanced_mode.hpp> can be included to get the extra ../doc/rs400_advanced_mode.md "Advanced Mode" functionality (in C and C++ respectively).

<librealsense2/rsutil.h> contains mathematical helper functions for projection of 2D points into 3D space and back.

Files and Classes

rs_types.hpp:

This file contains common functionality like the exception types. See ..doc/error_handling.md "Error Handling"

ClassDescription
errorCommon base-class for all exceptions thrown from the SDK
recoverable_errorBase class for all recorverable (in software) errors
unrecoverable_errorBase class for non-recoverable errors
camera_disconnected_errorCamera Disconnected error
backend_errorError from the underlying OS-specific driver
device_in_recovery_mode_errorDevice requires firmware update
invalid_value_errorInvalid input was passed to a function
wrong_api_call_sequence_errorMethods were called in wrong order
not_implemented_errorFunctionality is not available error

rs_context.hpp:

Context can be used to enumerate and iterate over connected device, and also get notifications of device events.

ClassDescription
contextContext serve as a factory for all SDK devices
device_hubHelper class that simplifies handling device change events
event_informationInformation about device change

rs_device.hpp:

This file defines the concept of RealSense device.

ClassDescription
deviceEncapsulates Intel RealSense device
device_listWrapper around list of devices
debug_protocolDebug-extension that allows to send data directly to the firmware

rs_processing.hpp:

The SDK offers many types of post-processing in form of the Processing Blocks. These primitives can be pipelined using queues and configured using options.

ClassDescription
syncerProcessing block that accepts frames one-by-one and outputs coherent framesets
frame_queueBasic primitive abstracting a concurrent queue of frames
processing_blockBase class for frame processing functions
pointcloudProcessing block that accepts depth and texture frames and outputs 3D points with texture coordinates
asynchronous_syncerNon-blocking version of the syncher processing block
alignProcessing block that accepts frames from different viewports and generates new synthetic frames from a single given viewport
colorizerProcessing block that accepts depth frames in Z16 format and outputs depth frames in RGB format, applying some depth coloring
decimation_filterProcessing block that intelligently reduces the resolution of a depth frame
temporal_filterProcessing block that filters depth data by looking into previous frames
spatial_filterProcessing block that applies edge-preserving smoothing of depth data

rs_sensor.hpp:

RealSense devices contain sensors. Sensors are units of streaming, each sensor can be controlled individually.

ClassDescription
sensorBase class for all supported sensors
roi_sensorSensor that has the ability to focus on a given ROI
notificationAsynchronious message that can be passed to the application
depth_sensorSensor that can provide depth frames

rs_frame.hpp:

The output of sensors are frames. There are different kinds of frames, not all video frames.

ClassDescription
frameBase class for all frames
pointsSet of 3D points with texture coordinates
video_frame2D image (with width, height and bpp)
depth_frameDepth frame
framesetA set of frames
stream_profileBase class for sensor configuration
video_stream_profileVideo stream configuration

rs_pipeline.hpp:

Pipeline is a high-level primitive combining several sensors and processing steps into one simple API.

ClassDescription
pipelineHigh level data-processor combining several sensors, queues and processing blocks
pipeline_profileSelected pipeline configuration
configDesired pipeline configuration

rs_record_playback.hpp:

This file adds playback and record capability using ROS-bag files. See src/media

ClassDescription
playbackDevice that mimiks live device from given input file
recorderDevice that records live device into an output file

rs_internal.hpp:

This file is not intented to be included by SDK users, but rather is used in SDK unit-tests. It allows to record everything that will happen in a specific test into a file and later use that file for dependency injection.

ClassDescription
recording_contextContext that records all backend activity to file
mock_contextContext that replays all activity from file