OrbbecSDK 2.5.5
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
Loading...
Searching...
No Matches
Frame.h
Go to the documentation of this file.
1// Copyright (c) Orbbec Inc. All Rights Reserved.
2// Licensed under the MIT License.
3
9#pragma once
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15#include "ObTypes.h"
16
29OB_EXPORT ob_frame *ob_create_frame(ob_frame_type frame_type, ob_format format, uint32_t data_size, ob_error **error);
30
44OB_EXPORT ob_frame *ob_create_frame_from_other_frame(const ob_frame *other_frame, bool should_copy_data, ob_error **error);
45
57
72OB_EXPORT ob_frame *ob_create_video_frame(ob_frame_type frame_type, ob_format format, uint32_t width, uint32_t height, uint32_t stride_bytes, ob_error **error);
73
90OB_EXPORT ob_frame *ob_create_frame_from_buffer(ob_frame_type frame_type, ob_format format, uint8_t *buffer, uint32_t buffer_size,
91 ob_frame_destroy_callback *buffer_destroy_cb, void *buffer_destroy_context, ob_error **error);
92
112OB_EXPORT ob_frame *ob_create_video_frame_from_buffer(ob_frame_type frame_type, ob_format format, uint32_t width, uint32_t height, uint32_t stride_bytes,
113 uint8_t *buffer, uint32_t buffer_size, ob_frame_destroy_callback *buffer_destroy_cb,
114 void *buffer_destroy_context, ob_error **error);
115
127
138OB_EXPORT void ob_frame_add_ref(const ob_frame *frame, ob_error **error);
139
147OB_EXPORT void ob_delete_frame(const ob_frame *frame, ob_error **error);
148
157OB_EXPORT void ob_frame_copy_info(const ob_frame *src_frame, ob_frame *dst_frame, ob_error **error);
158
166OB_EXPORT uint64_t ob_frame_get_index(const ob_frame *frame, ob_error **error);
167
176
185
195OB_EXPORT uint64_t ob_frame_get_timestamp_us(const ob_frame *frame, ob_error **error);
196
204OB_EXPORT void ob_frame_set_timestamp_us(ob_frame *frame, uint64_t timestamp_us, ob_error **error);
205
215
223OB_EXPORT void ob_frame_set_system_timestamp_us(ob_frame *frame, uint64_t system_timestamp_us, ob_error **error);
224
240
251OB_EXPORT uint8_t *ob_frame_get_data(const ob_frame *frame, ob_error **error);
252
268OB_EXPORT void ob_frame_update_data(ob_frame *frame, const uint8_t *data, uint32_t data_size, ob_error **error);
269
279OB_EXPORT uint32_t ob_frame_get_data_size(const ob_frame *frame, ob_error **error);
280
291OB_EXPORT uint8_t *ob_frame_get_metadata(const ob_frame *frame, ob_error **error);
292#define ob_video_frame_metadata ob_frame_get_metadata // for compatibility
293
302#define ob_video_frame_metadata_size ob_frame_get_metadata_size // for compatibility
303
318OB_EXPORT void ob_frame_update_metadata(ob_frame *frame, const uint8_t *metadata, uint32_t metadata_size, ob_error **error);
319
328
338
349
357OB_EXPORT void ob_frame_set_stream_profile(ob_frame *frame, const ob_stream_profile *stream_profile, ob_error **error);
358
369
380
388OB_EXPORT uint32_t ob_video_frame_get_width(const ob_frame *frame, ob_error **error);
389
397OB_EXPORT uint32_t ob_video_frame_get_height(const ob_frame *frame, ob_error **error);
398
410
419
429
439
448
458
467OB_EXPORT void ob_depth_frame_set_value_scale(ob_frame *frame, float value_scale, ob_error **error);
468
479
488
497
506
515
525OB_EXPORT uint32_t ob_frameset_get_count(const ob_frame *frameset, ob_error **error);
526
537
548
559
570
582
591OB_EXPORT ob_frame *ob_frameset_get_frame_by_index(const ob_frame *frameset, uint32_t index, ob_error **error);
592
604OB_EXPORT void ob_frameset_push_frame(ob_frame *frameset, const ob_frame *frame, ob_error **error);
605
614
623
624// The following interfaces are deprecated and are retained here for compatibility purposes.
625#define ob_frame_index ob_frame_get_index
626#define ob_frame_format ob_frame_get_format
627#define ob_frame_time_stamp_us ob_frame_get_timestamp_us
628#define ob_frame_set_device_time_stamp_us ob_frame_set_timestamp_us
629#define ob_frame_system_time_stamp_us ob_frame_get_system_timestamp_us
630#define ob_frame_global_time_stamp_us ob_frame_get_global_timestamp_us
631#define ob_frame_data ob_frame_get_data
632#define ob_frame_data_size ob_frame_get_data_size
633#define ob_frame_metadata ob_frame_get_metadata
634#define ob_frame_metadata_size ob_frame_get_metadata_size
635#define ob_video_frame_width ob_video_frame_get_width
636#define ob_video_frame_height ob_video_frame_get_height
637#define ob_video_frame_pixel_available_bit_size ob_video_frame_get_pixel_available_bit_size
638#define ob_points_frame_get_position_value_scale ob_points_frame_get_coordinate_value_scale
639#define ob_frameset_frame_count ob_frameset_get_count
640#define ob_frameset_depth_frame ob_frameset_get_depth_frame
641#define ob_frameset_color_frame ob_frameset_get_color_frame
642#define ob_frameset_ir_frame ob_frameset_get_ir_frame
643#define ob_frameset_points_frame ob_frameset_get_points_frame
644#define ob_accel_frame_value ob_accel_frame_get_value
645#define ob_accel_frame_temperature ob_accel_frame_get_temperature
646#define ob_gyro_frame_value ob_gyro_frame_get_value
647#define ob_gyro_frame_temperature ob_gyro_frame_get_temperature
648#define ob_frameset_get_frame_count ob_frameset_get_count
649
650#define ob_frame_time_stamp(frame, err) (ob_frame_get_timestamp_us(frame, err) / 1000)
651#define ob_frame_system_time_stamp(frame, err) (ob_frame_get_system_timestamp_us(frame, err))
652#define ob_frame_set_system_time_stamp(frame, system_timestamp, err) (ob_frame_set_system_timestamp_us(frame, system_timestamp * 1000, err))
653#define ob_frame_set_device_time_stamp(frame, device_timestamp, err) (ob_frame_set_timestamp_us(frame, device_timestamp * 1000, err))
654
655#ifdef __cplusplus
656}
657#endif
#define OB_EXPORT
Definition Export.h:15
OB_EXPORT void ob_frameset_push_frame(ob_frame *frameset, const ob_frame *frame, ob_error **error)
Push a frame to the frameset.
OB_EXPORT ob_frame * ob_frameset_get_color_frame(const ob_frame *frameset, ob_error **error)
Get the color frame from the frameset.
OB_EXPORT ob_frame * ob_frameset_get_ir_frame(const ob_frame *frameset, ob_error **error)
Get the infrared frame from the frameset.
OB_EXPORT ob_frame * ob_create_video_frame_from_buffer(ob_frame_type frame_type, ob_format format, uint32_t width, uint32_t height, uint32_t stride_bytes, uint8_t *buffer, uint32_t buffer_size, ob_frame_destroy_callback *buffer_destroy_cb, void *buffer_destroy_context, ob_error **error)
Create a video frame object based on an externally created buffer.
OB_EXPORT void ob_frame_copy_info(const ob_frame *src_frame, ob_frame *dst_frame, ob_error **error)
Copy the information of the source frame object to the destination frame object.
OB_EXPORT void ob_frame_update_data(ob_frame *frame, const uint8_t *data, uint32_t data_size, ob_error **error)
Update the data of a frame.
OB_EXPORT void ob_video_frame_set_pixel_type(ob_frame *frame, ob_pixel_type pixel_type, ob_error **error)
Set video frame pixel format.
OB_EXPORT uint8_t * ob_frame_get_data(const ob_frame *frame, ob_error **error)
Get the data buffer of a frame.
OB_EXPORT ob_frame * ob_create_frame_from_buffer(ob_frame_type frame_type, ob_format format, uint8_t *buffer, uint32_t buffer_size, ob_frame_destroy_callback *buffer_destroy_cb, void *buffer_destroy_context, ob_error **error)
Create a frame object based on an externally created buffer.
OB_EXPORT ob_frame * ob_create_frame_from_stream_profile(const ob_stream_profile *stream_profile, ob_error **error)
Create a frame object according to the specified stream profile.
OB_EXPORT void ob_frame_set_system_timestamp_us(ob_frame *frame, uint64_t system_timestamp_us, ob_error **error)
Set the system timestamp of the frame in microseconds.
OB_EXPORT ob_frame * ob_create_frame_from_other_frame(const ob_frame *other_frame, bool should_copy_data, ob_error **error)
Create (clone) a frame object based on the specified other frame object.
OB_EXPORT uint64_t ob_frame_get_timestamp_us(const ob_frame *frame, ob_error **error)
Get the frame timestamp (also known as device timestamp, hardware timestamp) of the frame in microsec...
OB_EXPORT ob_frame * ob_create_video_frame(ob_frame_type frame_type, ob_format format, uint32_t width, uint32_t height, uint32_t stride_bytes, ob_error **error)
Create an video frame object based on the specified parameters.
OB_EXPORT ob_frame_type ob_frame_get_type(const ob_frame *frame, ob_error **error)
Get the frame type.
OB_EXPORT ob_frame * ob_frameset_get_frame(const ob_frame *frameset, ob_frame_type frame_type, ob_error **error)
Get a frame of a specific type from the frameset.
OB_EXPORT ob_frame * ob_create_frameset(ob_error **error)
Create an empty frameset object.
OB_EXPORT ob_format ob_frame_get_format(const ob_frame *frame, ob_error **error)
Get the frame format.
OB_EXPORT ob_accel_value ob_accel_frame_get_value(const ob_frame *frame, ob_error **error)
Get accelerometer frame data.
OB_EXPORT uint32_t ob_video_frame_get_width(const ob_frame *frame, ob_error **error)
Get video frame width.
OB_EXPORT uint8_t ob_video_frame_get_pixel_available_bit_size(const ob_frame *frame, ob_error **error)
Get the effective number of pixels (such as Y16 format frame, but only the lower 10 bits are effectiv...
OB_EXPORT ob_frame * ob_frameset_get_points_frame(const ob_frame *frameset, ob_error **error)
Get point cloud frame from the frameset.
OB_EXPORT float ob_depth_frame_get_value_scale(const ob_frame *frame, ob_error **error)
Get the value scale of the depth frame. The pixel value of the depth frame is multiplied by the scale...
OB_EXPORT ob_stream_profile * ob_frame_get_stream_profile(const ob_frame *frame, ob_error **error)
Get the stream profile of the frame.
OB_EXPORT float ob_points_frame_get_coordinate_value_scale(const ob_frame *frame, ob_error **error)
Get the point coordinate value scale of the points frame. The point position value of the points fram...
OB_EXPORT float ob_accel_frame_get_temperature(const ob_frame *frame, ob_error **error)
Get the temperature when acquiring the accelerometer frame.
OB_EXPORT ob_frame * ob_frameset_get_frame_by_index(const ob_frame *frameset, uint32_t index, ob_error **error)
Get a frame at a specific index from the FrameSet.
OB_EXPORT bool ob_frame_has_metadata(const ob_frame *frame, ob_frame_metadata_type type, ob_error **error)
check if the frame contains the specified metadata
OB_EXPORT void ob_depth_frame_set_value_scale(ob_frame *frame, float value_scale, ob_error **error)
Set the value scale of the depth frame. The pixel value of the depth frame is multiplied by the scale...
OB_EXPORT int64_t ob_frame_get_metadata_value(const ob_frame *frame, ob_frame_metadata_type type, ob_error **error)
Get the metadata value of the frame.
OB_EXPORT uint32_t ob_point_cloud_frame_get_width(const ob_frame *frame, ob_error **error)
Get point cloud frame width.
OB_EXPORT ob_gyro_value ob_gyro_frame_get_value(const ob_frame *frame, ob_error **error)
Get gyroscope frame data.
OB_EXPORT uint64_t ob_frame_get_global_timestamp_us(const ob_frame *frame, ob_error **error)
Get the global timestamp of the frame in microseconds.
OB_EXPORT uint32_t ob_frame_get_metadata_size(const ob_frame *frame, ob_error **error)
Get the metadata size of the frame.
OB_EXPORT void ob_frame_set_timestamp_us(ob_frame *frame, uint64_t timestamp_us, ob_error **error)
Set the frame timestamp (also known as the device timestamp, hardware timestamp) of a frame object.
OB_EXPORT uint32_t ob_frame_get_data_size(const ob_frame *frame, ob_error **error)
Get the frame data size.
OB_EXPORT ob_device * ob_frame_get_device(const ob_frame *frame, ob_error **error)
Get the device of the frame.
OB_EXPORT uint64_t ob_frame_get_system_timestamp_us(const ob_frame *frame, ob_error **error)
Get the system timestamp of the frame in microseconds.
OB_EXPORT void ob_frame_update_metadata(ob_frame *frame, const uint8_t *metadata, uint32_t metadata_size, ob_error **error)
Update the metadata of the frame.
OB_EXPORT ob_sensor_type ob_ir_frame_get_source_sensor_type(const ob_frame *frame, ob_error **ob_error)
Get the source sensor type of the ir frame (left or right for dual camera)
OB_EXPORT float ob_gyro_frame_get_temperature(const ob_frame *frame, ob_error **error)
Get the temperature when acquiring the gyroscope frame.
OB_EXPORT uint64_t ob_frame_get_index(const ob_frame *frame, ob_error **error)
Get the frame index.
OB_EXPORT void ob_frame_add_ref(const ob_frame *frame, ob_error **error)
Increase the reference count of a frame object.
OB_EXPORT ob_frame * ob_frameset_get_depth_frame(const ob_frame *frameset, ob_error **error)
Get the depth frame from the frameset.
OB_EXPORT void ob_video_frame_set_pixel_available_bit_size(ob_frame *frame, uint8_t bit_size, ob_error **error)
Set the effective number of pixels (such as Y16 format frame, but only the lower 10 bits are effectiv...
OB_EXPORT uint32_t ob_point_cloud_frame_get_height(const ob_frame *frame, ob_error **error)
Get point cloud frame height.
OB_EXPORT ob_pixel_type ob_video_frame_get_pixel_type(const ob_frame *frame, ob_error **error)
Get video frame pixel format.
OB_EXPORT void ob_delete_frame(const ob_frame *frame, ob_error **error)
Delete a frame object.
OB_EXPORT ob_sensor * ob_frame_get_sensor(const ob_frame *frame, ob_error **error)
Get the sensor of the frame.
OB_EXPORT ob_frame * ob_create_frame(ob_frame_type frame_type, ob_format format, uint32_t data_size, ob_error **error)
Crate a frame object based on the specified parameters.
OB_EXPORT uint8_t * ob_frame_get_metadata(const ob_frame *frame, ob_error **error)
Get the metadata of the frame.
OB_EXPORT void ob_frame_set_stream_profile(ob_frame *frame, const ob_stream_profile *stream_profile, ob_error **error)
Set (override) the stream profile of the frame.
OB_EXPORT uint32_t ob_frameset_get_count(const ob_frame *frameset, ob_error **error)
Get the number of frames contained in the frameset.
OB_EXPORT uint32_t ob_video_frame_get_height(const ob_frame *frame, ob_error **error)
Get video frame height.
Provide structs commonly used in the SDK, enumerating constant definitions.
struct ob_sensor_t ob_sensor
Definition ObTypes.h:29
struct ob_frame_t ob_frame
Definition ObTypes.h:33
enum OBFormat ob_format
struct ob_stream_profile_t ob_stream_profile
Definition ObTypes.h:31
struct ob_device_t ob_device
Definition ObTypes.h:23
struct OBAccelValue ob_accel_value
struct OBAccelValue ob_gyro_value
void ob_frame_destroy_callback(uint8_t *buffer, void *user_data)
Customize the delete callback.
Definition ObTypes.h:1844
enum OBFrameType ob_frame_type
enum OBSensorType ob_sensor_type
ob_frame_metadata_type
Frame metadata types.
Definition ObTypes.h:1500
enum OBPixelType ob_pixel_type
The error class exposed by the SDK, users can get detailed error information according to the error.
Definition ObTypes.h:117