20 auto from =
get_pose(), to = r.get_pose();
21 if(from == to)
return {{1,0,0,0,1,0,0,0,1},{0,0,0}};
38 if(selection.provides_stream(stream))
modes.push_back(selection);
45 return std::make_tuple(-selection.get_width(), -selection.get_height(), -selection.get_framerate(), selection.get_format(stream));
56 if(w) *w = selection.get_width();
57 if(h) *h = selection.get_height();
58 if(f) *f = selection.get_format(
stream);
59 if(fps) *fps = selection.get_framerate();
76 throw std::logic_error(
"no mode found");
78 throw std::runtime_error(
to_string() <<
"stream not enabled: " <<
stream);
105 if (!
archive)
throw std::runtime_error(
to_string() <<
"streaming not started!");
112 if (!
archive)
throw std::runtime_error(
to_string() <<
"streaming not started!");
113 return archive->supports_frame_metadata(
stream, frame_metadata);
119 if (!
archive)
throw std::runtime_error(
to_string() <<
"streaming not started!");
126 if (!
archive)
throw std::runtime_error(
to_string() <<
"streaming not started!");
133 if (!
archive)
throw std::runtime_error(
to_string() <<
"streaming not started!");
140 if (!
archive)
throw std::runtime_error(
to_string() <<
"streaming not started!");
147 if (!
archive)
throw std::runtime_error(
to_string() <<
"streaming not started!");
154 if (!
archive)
throw std::runtime_error(
to_string() <<
"streaming not started!");
172 else assert(
false &&
"Cannot deproject image from a non-depth format");
202 align_z_to_other(
image.data(), (
const uint16_t *)from.get_frame_data(), from.get_depth_scale(), from.get_intrinsics(), from.get_extrinsics_to(to), to.get_intrinsics());
206 align_disparity_to_other(
image.data(), (
const uint16_t *)from.get_frame_data(), from.get_depth_scale(), from.get_intrinsics(), from.get_extrinsics_to(to), to.get_intrinsics());
210 align_other_to_z(
image.data(), (
const uint16_t *)to.get_frame_data(), to.get_depth_scale(), to.get_intrinsics(), to.get_extrinsics_to(from), from.get_intrinsics(), from.get_frame_data(), from.get_format());
214 align_other_to_disparity(
image.data(), (
const uint16_t *)to.get_frame_data(), to.get_depth_scale(), to.get_intrinsics(), to.get_extrinsics_to(from), from.get_intrinsics(), from.get_frame_data(), from.get_format());
216 else assert(
false &&
"Cannot align two images if neither have depth data");
void align_other_to_z(byte *other_aligned_to_z, const uint16_t *z_pixels, float z_scale, const rs_intrinsics &z_intrin, const rs_extrinsics &z_to_other, const rs_intrinsics &other_intrin, const byte *other_pixels, rs_format other_format)
const uint8_t * get_frame_data() const override
rs_intrinsics get_intrinsics() const override
const uint8_t * get_frame_data() const override
virtual rs_extrinsics get_extrinsics_to(const rs_stream_interface &other) const override
virtual rsimpl::pose get_pose() const =0
frame_metadata
Types of value provided from the device with each frame.
GLint GLint GLsizei GLsizei height
GLenum GLenum GLsizei void * table
std::vector< int > pad_crop_options
void align_disparity_to_other(byte *disparity_aligned_to_other, const uint16_t *disparity_pixels, float disparity_scale, const rs_intrinsics &disparity_intrin, const rs_extrinsics &disparity_to_other, const rs_intrinsics &other_intrin)
GLenum GLenum GLsizei void * image
bool validate_intrinsics(rs_stream stream) const
double get_frame_timestamp() const override
rs_intrinsics pad_crop_intrinsics(const rs_intrinsics &i, int pad_crop)
subdevice_mode_selection get_mode() const
GLfloat GLfloat GLfloat GLfloat h
void config(uvc::device &device, uint8_t gyro_bw, uint8_t gyro_range, uint8_t accel_bw, uint8_t accel_range, uint32_t time_seed)
std::vector< subdevice_mode > subdevice_modes
void deproject_disparity(float *points, const rs_intrinsics &disparity_intrin, const uint16_t *disparity_pixels, float disparity_scale)
std::shared_ptr< syncronizing_archive > archive
double get_frame_metadata(rs_frame_metadata frame_metadata) const override
std::vector< subdevice_mode_selection > modes
virtual rs_stream get_stream_type() const override
bool supports_frame_metadata(rs_frame_metadata frame_metadata) const override
stream_request requests[RS_STREAM_NATIVE_COUNT]
virtual rs_stream get_stream_type() const =0
void deproject_z(float *points, const rs_intrinsics &z_intrin, const uint16_t *z_pixels, float z_scale)
rs_format get_format() const override
rs_format
Formats: defines how each stream can be encoded.
rs_intrinsics get_rectified_intrinsics() const override
long long get_frame_system_time() const override
native_stream(device_config &config, rs_stream stream, calibration_validator in_validator)
bool is_enabled() const override
GLboolean GLboolean GLboolean GLboolean a
const device_config & config
std::vector< int > compute_rectification_table(const rs_intrinsics &rect_intrin, const rs_extrinsics &rect_to_unrect, const rs_intrinsics &unrect_intrin)
unsigned long long get_frame_number() const override
const static_device_info info
int get_frame_bpp() const override
GLboolean GLboolean GLboolean b
const unsigned char * get_frame_data() const override
Cross-stream extrinsics: encode the topology describing how the different devices are connected...
void align_z_to_other(byte *z_aligned_to_other, const uint16_t *z_pixels, float z_scale, const rs_intrinsics &z_intrin, const rs_extrinsics &z_to_other, const rs_intrinsics &other_intrin)
void rectify_image(uint8_t *rect_pixels, const std::vector< int > &rectification_table, const uint8_t *unrect_pixels, rs_format format)
pose inverse(const pose &a)
rs_stream
Streams are different types of data provided by RealSense devices.
calibration_validator validator
pose get_pose() const override
GLint GLint GLsizei width
GLsizei GLsizei GLchar * source
size_t get_image_size(int width, int height, rs_format format)
float get_depth_scale() const override
int get_frame_stride() const override
const uint8_t * get_frame_data() const override
rs_frame_metadata
Types of value provided from the device with each frame.
void align_other_to_disparity(byte *other_aligned_to_disparity, const uint16_t *disparity_pixels, float disparity_scale, const rs_intrinsics &disparity_intrin, const rs_extrinsics &disparity_to_other, const rs_intrinsics &other_intrin, const byte *other_pixels, rs_format other_format)
GLuint GLenum GLenum transform
GLdouble GLdouble GLdouble r
GLubyte GLubyte GLubyte GLubyte w
std::vector< subdevice_mode_selection > select_modes(const stream_request(&requests)[RS_STREAM_NATIVE_COUNT]) const
bool validate_extrinsics(rs_stream from_stream, rs_stream to_stream) const