44 std::unique_ptr<FrameImpl>
impl_;
47 explicit Frame(std::unique_ptr<FrameImpl> impl);
71 virtual uint64_t index();
87 virtual uint32_t dataSize();
103 uint64_t timeStampUs();
111 uint64_t systemTimeStamp();
119 uint64_t systemTimeStampUs();
131 uint64_t globalTimeStampUs();
145 uint32_t metadataSize();
190 template <typename T>
bool is();
198 template <typename T> std::shared_ptr<T> as() {
200 throw std::runtime_error(
"unsupported operation, object's type is not require type");
203 return std::dynamic_pointer_cast<T>(shared_from_this());
241 uint8_t pixelAvailableBitSize();
268 float getValueScale();
275 explicit IRFrame(std::unique_ptr<FrameImpl> impl);
298 float getPositionValueScale();
308 explicit FrameSet(std::unique_ptr<FrameImpl> impl);
319 uint32_t frameCount();
363 std::shared_ptr<
Frame> getFrame(
int index);
512template <
typename T>
bool Frame::is() {
513 switch(this->type()) {
527 return (
typeid(T) ==
typeid(
FrameSet));
533 std::cout <<
"ob::Frame::is() did not catch frame type: " << (int)this->type() << std::endl;
OBSensorType
Enumeration value describing the sensor type.
OBFormat
Enumeration value describing the pixel format.
enum ob_frame_metadata_type OBFrameMetadataType
OBFrameType
Enumeration value describing the type of frame.
Provides SDK structure and enumeration constant definitions (depending on libobsensor/h/ObTypes....
Define the AccelFrame class, which inherits from the Frame class.
AccelFrame(std::unique_ptr< FrameImpl > impl)
~AccelFrame() noexcept override=default
~ColorFrame() noexcept override=default
ColorFrame(std::unique_ptr< FrameImpl > impl)
~DepthFrame() noexcept override=default
DepthFrame(std::unique_ptr< FrameImpl > impl)
The Filter class is the base class for all filters in the SDK.
Define the FrameHelper class.
static std::shared_ptr< Frame > createFrame(OBFrameType type, OBFormat format, uint32_t width, uint32_t height, uint32_t strideBytes)
Create a Frame object.
static void setFrameDeviceTimestamp(std::shared_ptr< Frame > frame, uint64_t deviceTimestamp)
Set the device timestamp of the frame.
static std::shared_ptr< Frame > createFrameFromBuffer(OBFormat format, uint32_t width, uint32_t height, uint8_t *buffer, uint32_t bufferSize, BufferDestroyCallback destroyCallback, void *destroyCallbackContext)
Create a frame object based on an externally created buffer.
static void setFrameDeviceTimestampUs(std::shared_ptr< Frame > frame, uint64_t deviceTimestampUs)
Set the device timestamp of the frame.
static void pushFrame(std::shared_ptr< Frame > frameSet, OBFrameType frameType, std::shared_ptr< Frame > frame)
Add a frame of a specific type to the FrameSet.
static std::shared_ptr< FrameSet > createFrameSet()
Create an empty FrameSet object.
static void setFrameSystemTimestamp(std::shared_ptr< Frame > frame, uint64_t systemTimestamp)
Set the system timestamp of the frame.
Define the FrameSet class, which inherits from the Frame class.
~FrameSet() noexcept override
FrameSet(std::unique_ptr< FrameImpl > impl)
virtual ~Frame() noexcept
std::unique_ptr< FrameImpl > impl_
Frame(std::unique_ptr< FrameImpl > impl)
Define the GyroFrame class, which inherits from the Frame class.
~GyroFrame() noexcept override=default
GyroFrame(std::unique_ptr< FrameImpl > impl)
IRFrame(std::unique_ptr< FrameImpl > impl)
~IRFrame() noexcept override=default
~PointsFrame() noexcept override=default
PointsFrame(std::unique_ptr< FrameImpl > impl)
PointsFrame(Frame &frame)
Define the RawPhaseFrame class, which inherits from the VideoFrame class.
RawPhaseFrame(std::unique_ptr< FrameImpl > impl)
RawPhaseFrame(Frame &frame)
~RawPhaseFrame() noexcept override=default
VideoFrame(std::unique_ptr< FrameImpl > impl)
~VideoFrame() noexcept override=default
std::function< void(void *buffer, void *context)> BufferDestroyCallback
Data structures for accelerometers and gyroscopes.