4 #ifndef LIBREALSENSE_RS2_FRAME_HPP 5 #define LIBREALSENSE_RS2_FRAME_HPP 14 class processing_block;
18 class pipeline_profile;
114 std::stringstream ss;
130 operator bool()
const {
return _profile !=
nullptr; }
190 std::shared_ptr<rs2_stream_profile>
_clone;
323 other.frame_ref =
nullptr;
325 frame_number = other.frame_number;
326 profile = other.profile;
343 : frame_ref(other.frame_ref)
347 frame_number = other.frame_number;
348 profile = other.profile;
357 std::swap(frame_ref, other.frame_ref);
360 std::swap(frame_number, other.frame_number);
361 std::swap(profile, other.profile);
385 operator bool()
const {
return frame_ref !=
nullptr; }
531 unsigned long long frame_number = 0;
611 operator const float*()
const {
return &
x; }
615 operator const float*()
const {
return &
u; }
656 return (
const vertex*)res;
667 std::swap(texture.frame_ref, ptr);
779 auto data =
reinterpret_cast<const float*
>(
get_data());
853 foreach([&result, s](
frame f) {
856 result = std::move(f);
869 if (!f)
throw error(
"Frame of requested stream type was not found!");
933 void foreach(T action)
const 937 for (
size_t i = 0; i < count; i++)
960 throw error(
"Requested index is out of range!");
985 #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:253
iterator begin() const
Definition: rs_frame.hpp:977
Definition: rs_frame.hpp:21
int get_bytes_per_pixel() const
Definition: rs_frame.hpp:606
depth_frame(const frame &f)
Definition: rs_frame.hpp:700
Definition: rs_frame.hpp:535
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:286
void add_ref() const
Definition: rs_frame.hpp:503
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:805
rs2_motion_device_intrinsic get_motion_intrinsics() const
Definition: rs_frame.hpp:275
int _uid
Definition: rs_frame.hpp:193
rs2_vector get_motion_data()
Definition: rs_frame.hpp:777
stream_profile()
Definition: rs_frame.hpp:27
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:43
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:618
void register_extrinsics_to(const stream_profile &to, rs2_extrinsics extrinsics)
Definition: rs_frame.hpp:165
frame operator*()
Definition: rs_frame.hpp:971
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:112
frameset()
Definition: rs_frame.hpp:821
float y
Definition: rs_frame.hpp:610
int _index
Definition: rs_frame.hpp:192
Definition: rs_types.h:107
frame(frame &&other) noexcept
Definition: rs_frame.hpp:321
Definition: rs_frame.hpp:815
bool is() const
Definition: rs_frame.hpp:91
void export_to_ply(const std::string &fname, video_frame texture)
Definition: rs_frame.hpp:664
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:391
bool is() const
Definition: rs_frame.hpp:475
size_t size() const
Definition: rs_frame.hpp:684
float u
Definition: rs_frame.hpp:614
video_frame get_color_frame() const
Definition: rs_frame.hpp:886
int rs2_supports_frame_metadata(const rs2_frame *frame, rs2_frame_metadata_value frame_metadata, rs2_error **error)
Definition: rs_processing.hpp:107
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:610
int fps() const
Definition: rs_frame.hpp:48
frame first(rs2_stream s) const
Definition: rs_frame.hpp:866
void reset()
Definition: rs_frame.hpp:510
iterator & operator++()
Definition: rs_frame.hpp:967
Definition: rs_sensor.h:42
rs2_extrinsics get_extrinsics_to(const stream_profile &to) const
Definition: rs_frame.hpp:151
int rs2_get_frame_height(const rs2_frame *frame, rs2_error **error)
std::shared_ptr< rs2_stream_profile > _clone
Definition: rs_frame.hpp:190
pose_frame(const frame &f)
Definition: rs_frame.hpp:791
void swap(frame &other)
Definition: rs_frame.hpp:355
Definition: rs_types.h:115
Definition: rs_frame.hpp:963
frame & operator=(frame other)
Definition: rs_frame.hpp:333
Definition: rs_sensor.h:62
Definition: rs_frame.hpp:756
int rs2_get_frame_stride_in_bytes(const rs2_frame *frame, rs2_error **error)
const rs2_stream_profile * _profile
Definition: rs_frame.hpp:189
video_frame(const frame &f)
Definition: rs_frame.hpp:542
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:624
float get_distance(int x, int y) const
Definition: rs_frame.hpp:717
Definition: rs_processing.hpp:17
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:194
Definition: rs_types.h:108
motion_frame(const frame &f)
Definition: rs_frame.hpp:763
~frame()
Definition: rs_frame.hpp:368
int rs2_get_frame_width(const rs2_frame *frame, rs2_error **error)
Definition: rs_internal.hpp:73
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:950
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:195
void rs2_delete_stream_profile(rs2_stream_profile *mode)
motion_stream_profile(const stream_profile &sp)
Definition: rs_frame.hpp:260
Definition: rs_types.h:114
rs2_timestamp_domain get_frame_timestamp_domain() const
Definition: rs_frame.hpp:402
T as() const
Definition: rs_frame.hpp:102
T as() const
Definition: rs_frame.hpp:485
video_stream_profile(const stream_profile &sp)
Definition: rs_frame.hpp:208
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:277
bool is_default() const
Definition: rs_frame.hpp:124
void keep()
Definition: rs_frame.hpp:379
unsigned long long rs2_get_frame_number(const rs2_frame *frame, rs2_error **error)
int stream_index() const
Definition: rs_frame.hpp:33
video_frame get_infrared_frame(const size_t index=0) const
Definition: rs_frame.hpp:903
const texture_coordinate * get_texture_coordinates() const
Definition: rs_frame.hpp:676
int get_bits_per_pixel() const
Definition: rs_frame.hpp:594
bool operator==(const iterator &other) const
Definition: rs_frame.hpp:968
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:570
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:136
bool _default
Definition: rs_frame.hpp:198
Definition: rs_frame.hpp:726
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:438
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:978
iterator(const frameset *owner, size_t index=0)
Definition: rs_frame.hpp:966
3D vector in Euclidean coordinate space
Definition: rs_frame.h:79
int get_width() const
Definition: rs_frame.hpp:558
const void * get_data() const
Definition: rs_frame.hpp:450
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:630
Definition: rs_types.h:111
int get_stride_in_bytes() const
Definition: rs_frame.hpp:582
rs2_vertex * rs2_get_frame_vertices(const rs2_frame *frame, rs2_error **error)
disparity_frame(const frame &f)
Definition: rs_frame.hpp:733
frame first_or_default(rs2_stream s) const
Definition: rs_frame.hpp:850
int width() const
Definition: rs_frame.hpp:225
void rs2_frame_add_ref(rs2_frame *frame, rs2_error **error)
Video stream intrinsics.
Definition: rs_types.h:56
Definition: rs_processing.hpp:368
int height() const
Definition: rs_frame.hpp:230
bool operator!=(const iterator &other) const
Definition: rs_frame.hpp:969
bool operator==(const stream_profile &rhs)
Definition: rs_frame.hpp:78
Motion device intrinsics: scale, bias, and variances.
Definition: rs_types.h:69
depth_frame get_depth_frame() const
Definition: rs_frame.hpp:877
Definition: rs_processing.hpp:187
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:178
void rs2_release_frame(rs2_frame *frame)
rs2_metadata_type get_frame_metadata(rs2_frame_metadata_value frame_metadata) const
Definition: rs_frame.hpp:414
frameset(const frame &f)
Definition: rs_frame.hpp:826
Definition: rs_frame.hpp:613
rs2_frame * rs2_extract_frame(rs2_frame *composite, int index, rs2_error **error)
size_t size() const
Definition: rs_frame.hpp:923
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:426
rs2_stream stream_type() const
Definition: rs_frame.hpp:38
float x
Definition: rs_frame.hpp:610
Definition: rs_frame.hpp:201
Definition: rs_frame.hpp:784
frame(const frame &other)
Definition: rs_frame.hpp:342
rs2_intrinsics get_intrinsics() const
Definition: rs_frame.hpp:238
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:297
rs2_frame * get() const
Definition: rs_frame.hpp:495
void rs2_pose_frame_get_pose_data(const rs2_frame *frame, rs2_pose *pose, rs2_error **error)
frame()
Definition: rs_frame.hpp:292
float v
Definition: rs_frame.hpp:614
stream_profile clone(rs2_stream type, int index, rs2_format format) const
Definition: rs_frame.hpp:62
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:747
rs2_stream _type
Definition: rs_frame.hpp:196
Definition: rs_frame.hpp:609
stream_profile get_profile() const
Definition: rs_frame.hpp:462
const vertex * get_vertices() const
Definition: rs_frame.hpp:651
Definition: rs_frame.hpp:693
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:53