4 #ifndef LIBREALSENSE_RS2_FRAME_HPP 5 #define LIBREALSENSE_RS2_FRAME_HPP 14 class processing_block;
18 class pipeline_profile;
77 operator bool()
const {
return _profile !=
nullptr; }
118 std::shared_ptr<rs2_stream_profile>
_clone;
229 other.frame_ref =
nullptr;
231 frame_number = other.frame_number;
232 profile = other.profile;
241 : frame_ref(other.frame_ref)
245 frame_number = other.frame_number;
246 profile = other.profile;
251 std::swap(frame_ref, other.frame_ref);
254 std::swap(frame_number, other.frame_number);
255 std::swap(profile, other.profile);
272 operator bool()
const {
return frame_ref !=
nullptr; }
403 unsigned long long frame_number = 0;
475 operator const float*()
const {
return &
x; }
479 operator const float*()
const {
return &
u; }
510 return (
const vertex*)res;
516 std::swap(texture.frame_ref, ptr);
601 auto data =
reinterpret_cast<const float*
>(
get_data());
656 foreach([&result, s](
frame f) {
659 result = std::move(f);
668 if (!f)
throw error(
"Frame of requested stream type was not found!");
714 void foreach(T action)
const 718 for (
size_t i = 0; i < count; i++)
737 throw error(
"Requested index is out of range!");
762 #endif // LIBREALSENSE_RS2_FRAME_HPP Definition: rs_types.hpp:69
void rs2_register_extrinsics(const rs2_stream_profile *from, const rs2_stream_profile *to, rs2_extrinsics extrin, rs2_error **error)
Definition: rs_frame.hpp:174
iterator begin() const
Definition: rs_frame.hpp:754
Definition: rs_frame.hpp:21
int get_bytes_per_pixel() const
Definition: rs_frame.hpp:470
depth_frame(const frame &f)
Definition: rs_frame.hpp:542
Definition: rs_frame.hpp:407
void rs2_export_to_ply(const rs2_frame *frame, const char *fname, rs2_frame *texture, rs2_error **error)
Definition: rs_sensor.hpp:232
Definition: rs_frame.hpp:202
void add_ref() const
Definition: rs_frame.hpp:375
int rs2_get_frame_points_count(const rs2_frame *frame, rs2_error **error)
const rs2_stream_profile * rs2_get_frame_stream_profile(const rs2_frame *frame, rs2_error **error)
rs2_pose get_pose_data()
Definition: rs_frame.hpp:620
rs2_motion_device_intrinsic get_motion_intrinsics() const
Definition: rs_frame.hpp:191
int _uid
Definition: rs_frame.hpp:121
rs2_vector get_motion_data()
Definition: rs_frame.hpp:599
stream_profile()
Definition: rs_frame.hpp:24
Definition: rs_pipeline.hpp:18
int rs2_is_frame_extendable_to(const rs2_frame *frame, rs2_extension extension_type, rs2_error **error)
rs2_format format() const
Definition: rs_frame.hpp:28
Definition: rs_types.h:105
void rs2_get_video_stream_resolution(const rs2_stream_profile *mode, int *width, int *height, rs2_error **error)
Definition: rs_frame.hpp:482
void register_extrinsics_to(const stream_profile &to, rs2_extrinsics extrinsics)
Definition: rs_frame.hpp:93
frame operator*()
Definition: rs_frame.hpp:748
void rs2_keep_frame(rs2_frame *frame)
void rs2_get_extrinsics(const rs2_stream_profile *from, const rs2_stream_profile *to, rs2_extrinsics *extrin, rs2_error **error)
std::string stream_name() const
Definition: rs_frame.hpp:67
frameset()
Definition: rs_frame.hpp:633
float y
Definition: rs_frame.hpp:474
int _index
Definition: rs_frame.hpp:120
Definition: rs_types.h:107
frame(frame &&other) noexcept
Definition: rs_frame.hpp:227
Definition: rs_frame.hpp:630
bool is() const
Definition: rs_frame.hpp:54
void export_to_ply(const std::string &fname, video_frame texture)
Definition: rs_frame.hpp:513
rs2_time_t rs2_get_frame_timestamp(const rs2_frame *frame, rs2_error **error)
int rs2_stream_profile_is(const rs2_stream_profile *mode, rs2_extension type, rs2_error **error)
Definition: rs_context.hpp:11
rs2_pixel * rs2_get_frame_texture_coordinates(const rs2_frame *frame, rs2_error **error)
double get_timestamp() const
Definition: rs_frame.hpp:278
bool is() const
Definition: rs_frame.hpp:354
size_t size() const
Definition: rs_frame.hpp:530
float u
Definition: rs_frame.hpp:478
video_frame get_color_frame() const
Definition: rs_frame.hpp:678
int rs2_supports_frame_metadata(const rs2_frame *frame, rs2_frame_metadata_value frame_metadata, rs2_error **error)
Definition: rs_processing.hpp:79
rs2_stream_profile * rs2_clone_stream_profile(const rs2_stream_profile *mode, rs2_stream stream, int index, rs2_format format, rs2_error **error)
float z
Definition: rs_frame.hpp:474
int fps() const
Definition: rs_frame.hpp:30
frame first(rs2_stream s) const
Definition: rs_frame.hpp:665
void reset()
Definition: rs_frame.hpp:382
iterator & operator++()
Definition: rs_frame.hpp:744
Definition: rs_sensor.h:42
rs2_extrinsics get_extrinsics_to(const stream_profile &to) const
Definition: rs_frame.hpp:85
int rs2_get_frame_height(const rs2_frame *frame, rs2_error **error)
std::shared_ptr< rs2_stream_profile > _clone
Definition: rs_frame.hpp:118
pose_frame(const frame &f)
Definition: rs_frame.hpp:609
void swap(frame &other)
Definition: rs_frame.hpp:249
Definition: rs_types.h:115
Definition: rs_frame.hpp:740
frame & operator=(frame other)
Definition: rs_frame.hpp:235
Definition: rs_sensor.h:62
Definition: rs_frame.hpp:585
int rs2_get_frame_stride_in_bytes(const rs2_frame *frame, rs2_error **error)
const rs2_stream_profile * _profile
Definition: rs_frame.hpp:117
video_frame(const frame &f)
Definition: rs_frame.hpp:410
void rs2_get_stream_profile_data(const rs2_stream_profile *mode, rs2_stream *stream, rs2_format *format, int *index, int *unique_id, int *framerate, rs2_error **error)
points()
Definition: rs_frame.hpp:485
float get_distance(int x, int y) const
Definition: rs_frame.hpp:553
Definition: rs_processing.hpp:13
int rs2_embedded_frames_count(rs2_frame *composite, rs2_error **error)
int rs2_is_stream_profile_default(const rs2_stream_profile *mode, rs2_error **error)
int _framerate
Definition: rs_frame.hpp:122
Definition: rs_types.h:108
motion_frame(const frame &f)
Definition: rs_frame.hpp:588
~frame()
Definition: rs_frame.hpp:262
int rs2_get_frame_width(const rs2_frame *frame, rs2_error **error)
Definition: rs_internal.hpp:72
float rs2_depth_frame_get_distance(const rs2_frame *frame_ref, int x, int y, rs2_error **error)
frame operator[](size_t index) const
Definition: rs_frame.hpp:727
Definition: rs_types.h:106
rs2_timestamp_domain rs2_get_frame_timestamp_domain(const rs2_frame *frameset, rs2_error **error)
Definition: rs_frame.h:90
rs2_format _format
Definition: rs_frame.hpp:123
void rs2_delete_stream_profile(rs2_stream_profile *mode)
motion_stream_profile(const stream_profile &sp)
Definition: rs_frame.hpp:177
Definition: rs_types.h:114
rs2_timestamp_domain get_frame_timestamp_domain() const
Definition: rs_frame.hpp:289
T as() const
Definition: rs_frame.hpp:61
T as() const
Definition: rs_frame.hpp:361
video_stream_profile(const stream_profile &sp)
Definition: rs_frame.hpp:132
struct rs2_stream_profile rs2_stream_profile
Definition: rs_types.h:158
Definition: rs_sensor.h:57
rs2_format
Format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:55
Definition: rs_processing.hpp:204
bool is_default() const
Definition: rs_frame.hpp:75
void keep()
Definition: rs_frame.hpp:270
unsigned long long rs2_get_frame_number(const rs2_frame *frame, rs2_error **error)
int stream_index() const
Definition: rs_frame.hpp:26
video_frame get_infrared_frame(const size_t index=0) const
Definition: rs_frame.hpp:691
const texture_coordinate * get_texture_coordinates() const
Definition: rs_frame.hpp:522
int get_bits_per_pixel() const
Definition: rs_frame.hpp:462
bool operator==(const iterator &other) const
Definition: rs_frame.hpp:745
static void handle(rs2_error *e)
Definition: rs_types.hpp:121
Definition: rs_sensor.h:41
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:38
int get_height() const
Definition: rs_frame.hpp:438
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:79
bool _default
Definition: rs_frame.hpp:126
Definition: rs_frame.hpp:562
void rs2_get_video_stream_intrinsics(const rs2_stream_profile *mode, rs2_intrinsics *intrinsics, rs2_error **error)
Definition: rs_sensor.h:43
unsigned long long get_frame_number() const
Definition: rs_frame.hpp:325
Cross-stream extrinsics: encode the topology describing how the different devices are connected...
Definition: rs_sensor.h:82
Definition: rs_types.h:104
iterator end() const
Definition: rs_frame.hpp:755
iterator(const frameset *owner, size_t index=0)
Definition: rs_frame.hpp:743
3D vector in Euclidean coordinate space
Definition: rs_frame.h:79
int get_width() const
Definition: rs_frame.hpp:426
const void * get_data() const
Definition: rs_frame.hpp:337
const char * rs2_stream_to_string(rs2_stream stream)
Definition: rs_sensor.h:40
long long rs2_metadata_type
Definition: rs_types.h:181
points(const frame &f)
Definition: rs_frame.hpp:487
Definition: rs_types.h:111
int get_stride_in_bytes() const
Definition: rs_frame.hpp:450
rs2_vertex * rs2_get_frame_vertices(const rs2_frame *frame, rs2_error **error)
disparity_frame(const frame &f)
Definition: rs_frame.hpp:565
frame first_or_default(rs2_stream s) const
Definition: rs_frame.hpp:653
int width() const
Definition: rs_frame.hpp:149
void rs2_frame_add_ref(rs2_frame *frame, rs2_error **error)
Video stream intrinsics.
Definition: rs_types.h:56
Definition: rs_processing.hpp:273
int height() const
Definition: rs_frame.hpp:154
bool operator!=(const iterator &other) const
Definition: rs_frame.hpp:746
bool operator==(const stream_profile &rhs)
Definition: rs_frame.hpp:45
Motion device intrinsics: scale, bias, and variances.
Definition: rs_types.h:69
depth_frame get_depth_frame() const
Definition: rs_frame.hpp:672
Definition: rs_processing.hpp:134
float rs2_depth_stereo_frame_get_baseline(const rs2_frame *frame_ref, rs2_error **error)
stream_profile(const rs2_stream_profile *profile)
Definition: rs_frame.hpp:106
void rs2_release_frame(rs2_frame *frame)
rs2_metadata_type get_frame_metadata(rs2_frame_metadata_value frame_metadata) const
Definition: rs_frame.hpp:301
frameset(const frame &f)
Definition: rs_frame.hpp:634
Definition: rs_frame.hpp:477
rs2_frame * rs2_extract_frame(rs2_frame *composite, int index, rs2_error **error)
size_t size() const
Definition: rs_frame.hpp:708
Definition: rs_types.h:116
rs2_metadata_type rs2_get_frame_metadata(const rs2_frame *frame, rs2_frame_metadata_value frame_metadata, rs2_error **error)
struct rs2_error rs2_error
Definition: rs_types.h:149
bool supports_frame_metadata(rs2_frame_metadata_value frame_metadata) const
Definition: rs_frame.hpp:313
rs2_stream stream_type() const
Definition: rs_frame.hpp:27
float x
Definition: rs_frame.hpp:474
Definition: rs_frame.hpp:129
Definition: rs_frame.hpp:606
frame(const frame &other)
Definition: rs_frame.hpp:240
rs2_intrinsics get_intrinsics() const
Definition: rs_frame.hpp:159
void rs2_get_motion_intrinsics(const rs2_stream_profile *mode, rs2_motion_device_intrinsic *intrinsics, rs2_error **error)
frame(rs2_frame *frame_ref)
Definition: rs_frame.hpp:206
rs2_frame * get() const
Definition: rs_frame.hpp:367
void rs2_pose_frame_get_pose_data(const rs2_frame *frame, rs2_pose *pose, rs2_error **error)
frame()
Definition: rs_frame.hpp:205
float v
Definition: rs_frame.hpp:478
stream_profile clone(rs2_stream type, int index, rs2_format format) const
Definition: rs_frame.hpp:34
int rs2_get_frame_bits_per_pixel(const rs2_frame *frame, rs2_error **error)
rs2_frame_metadata_value
Per-Frame-Metadata are set of read-only properties that might be exposed for each individual frame...
Definition: rs_frame.h:28
struct rs2_frame rs2_frame
Definition: rs_types.h:151
const void * rs2_get_frame_data(const rs2_frame *frame, rs2_error **error)
float get_baseline(void) const
Definition: rs_frame.hpp:576
rs2_stream _type
Definition: rs_frame.hpp:124
Definition: rs_frame.hpp:473
stream_profile get_profile() const
Definition: rs_frame.hpp:345
const vertex * get_vertices() const
Definition: rs_frame.hpp:505
Definition: rs_frame.hpp:539
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
Definition: rs_frame.h:19
int unique_id() const
Definition: rs_frame.hpp:32