47 std::unique_ptr<FrameImpl>
impl_;
50 Frame(std::unique_ptr<FrameImpl> impl);
53 virtual ~
Frame() noexcept;
91 virtual uint64_t index();
104 virtual
void *data();
119 virtual uint32_t dataSize();
132 uint64_t timeStamp();
145 uint64_t timeStampUs();
158 uint64_t systemTimeStamp();
173 template <typename T>
bool is();
188 template <typename T> std::shared_ptr<T> as() {
190 throw "unsupported operation, object's type is not require type";
192 return std::static_pointer_cast<T>(std::const_pointer_cast<
Frame>(shared_from_this()));
256 uint32_t metadataSize();
271 uint8_t pixelAvailableBitSize();
298 float getValueScale();
331 float getPositionValueScale();
352 uint32_t frameCount();
365 std::shared_ptr<DepthFrame> depthFrame();
378 std::shared_ptr<ColorFrame> colorFrame();
391 std::shared_ptr<IRFrame> irFrame();
404 std::shared_ptr<PointsFrame> pointsFrame();
419 std::shared_ptr<Frame> getFrame(
OBFrameType frameType);
503 static std::shared_ptr<Frame> createFrameFromBuffer(
OBFormat format, uint32_t frameWidth, uint32_t frameHeight, uint8_t *buffer, uint32_t bufferSize,
504 BufferDestroyCallback destroyCallback,
void *destroyCallbackContext);
511 static std::shared_ptr<Frame> createFrameSet();
520 static void pushFrame(std::shared_ptr<Frame> frameSet,
OBFrameType frameType, std::shared_ptr<Frame> frame);
528 static void setFrameSystemTimestamp(std::shared_ptr<Frame> frame, uint64_t systemTimestamp);
536 static void setFrameDeviceTimestamp(std::shared_ptr<Frame> frame, uint64_t deviceTimestamp);
544 static void setFrameDeviceTimestampUs(std::shared_ptr<Frame> frame, uint64_t deviceTimestampUs);
548 switch(this->type()) {
562 return (
typeid(T) ==
typeid(
FrameSet));
566 std::cout <<
"ob::Frame::is() not catch frame type: " << (int)this->type() << std::endl;
OBFormat
Enumeration value describing the pixel format.
Data structures for accelerometers and gyroscopes.
OBSensorType
Enumeration value describing the sensor type.
Provide SDK structure and enumeration constant definition (depending on libobsensor/h/ObTypes.h)
std::function< void(void *buffer, void *context)> BufferDestroyCallback
OBFrameType
Describe the Frame type enumeration value.
bool is()
Check if the runtime type of the frame object is compatible with a given type.
virtual ~VideoFrame() noexcept
virtual ~IRFrame() noexcept
std::unique_ptr< FrameImpl > impl_