Define the frame class, which is the base class of all frame types.
More...
#include <Frame.hpp>
|
const ob_frame * | impl_ = nullptr |
| The pointer to the internal (c api level) frame object.
|
|
Define the frame class, which is the base class of all frame types.
Definition at line 45 of file Frame.hpp.
◆ Frame()
ob::Frame::Frame |
( |
const ob_frame * | impl | ) |
|
|
inlineexplicit |
Construct a new Frame object with a given pointer to the internal frame object.
- Attention
- After calling this constructor, the frame object will own the internal frame object, and the internal frame object will be deleted when the frame object is destroyed.
-
The internal frame object should not be deleted by the caller.
- Parameters
-
impl | The pointer to the internal frame object. |
Definition at line 62 of file Frame.hpp.
◆ ~Frame()
virtual ob::Frame::~Frame |
( |
| ) |
|
|
inlinevirtualnoexcept |
◆ getImpl()
const ob_frame * ob::Frame::getImpl |
( |
| ) |
const |
|
inline |
Get the internal (impl) frame object.
- Returns
- const ob_frame* the pointer to the internal frame object.
Definition at line 69 of file Frame.hpp.
◆ getType()
Get the type of frame.
- Returns
- OBFrameType The type of frame.
Definition at line 90 of file Frame.hpp.
Referenced by type().
◆ getFormat()
virtual OBFormat ob::Frame::getFormat |
( |
| ) |
const |
|
inlinevirtual |
Get the format of the frame.
- Returns
- OBFormat The format of the frame.
Definition at line 103 of file Frame.hpp.
Referenced by format().
◆ getIndex()
virtual uint64_t ob::Frame::getIndex |
( |
| ) |
const |
|
inlinevirtual |
Get the sequence number of the frame.
- Note
- The sequence number for each frame is managed by the SDK. It increments by 1 for each frame on each stream.
- Returns
- uint64_t The sequence number of the frame.
Definition at line 118 of file Frame.hpp.
Referenced by index().
◆ getData()
virtual uint8_t * ob::Frame::getData |
( |
| ) |
const |
|
inlinevirtual |
Get frame data.
- Returns
- const uint8_t * The frame data pointer.
Definition at line 131 of file Frame.hpp.
Referenced by data().
◆ getDataSize()
virtual uint32_t ob::Frame::getDataSize |
( |
| ) |
const |
|
inlinevirtual |
Get the size of the frame data.
- Returns
- uint32_t The size of the frame data. For point cloud data, this returns the number of bytes occupied by all point sets. To find the number of points, divide the dataSize by the structure size of the corresponding point type.
Definition at line 146 of file Frame.hpp.
Referenced by dataSize().
◆ getTimeStampUs()
uint64_t ob::Frame::getTimeStampUs |
( |
| ) |
const |
|
inline |
Get the hardware timestamp of the frame in microseconds.
The hardware timestamp is the time point when the frame was captured by the device, on device clock domain.
- Returns
- uint64_t The hardware timestamp of the frame in microseconds.
Definition at line 160 of file Frame.hpp.
Referenced by timeStamp(), and timeStampUs().
◆ getSystemTimeStampUs()
uint64_t ob::Frame::getSystemTimeStampUs |
( |
| ) |
const |
|
inline |
Get the system timestamp of the frame in microseconds.
The system timestamp is the time point when the frame was received by the host, on host clock domain.
- Returns
- uint64_t The system timestamp of the frame in microseconds.
Definition at line 174 of file Frame.hpp.
Referenced by systemTimeStamp(), and systemTimeStampUs().
◆ getGlobalTimeStampUs()
uint64_t ob::Frame::getGlobalTimeStampUs |
( |
| ) |
const |
|
inline |
Get the global timestamp of the frame in microseconds.
The global timestamp is the time point when the frame was was captured by the device, and has been converted to the host clock domain. The conversion process base on the device timestamp and can eliminate the timer drift of the device
- Attention
- The global timestamp disable by default. If global timestamp is not enabled, the function will return 0. To enable the global timestamp, please call Device::enableGlobalTimestamp() function.
-
Only some devices support getting the global timestamp. Check the device support status by Device::isGlobalTimestampSupported() function.
- Returns
- uint64_t The global timestamp of the frame in microseconds.
Definition at line 193 of file Frame.hpp.
Referenced by globalTimeStampUs().
◆ getMetadata()
uint8_t * ob::Frame::getMetadata |
( |
| ) |
const |
|
inline |
Get the metadata pointer of the frame.
- Returns
- const uint8_t * The metadata pointer of the frame.
Definition at line 206 of file Frame.hpp.
Referenced by metadata().
◆ getMetadataSize()
uint32_t ob::Frame::getMetadataSize |
( |
| ) |
const |
|
inline |
Get the size of the metadata of the frame.
- Returns
- uint32_t The size of the metadata of the frame.
Definition at line 219 of file Frame.hpp.
Referenced by metadataSize().
◆ hasMetadata()
Check if the frame object has metadata of a given type.
- Parameters
-
- Returns
- bool The result.
Definition at line 233 of file Frame.hpp.
◆ getMetadataValue()
Get the metadata value.
- Parameters
-
- Returns
- int64_t The metadata value.
Definition at line 247 of file Frame.hpp.
◆ getStreamProfile()
std::shared_ptr< StreamProfile > ob::Frame::getStreamProfile |
( |
| ) |
const |
|
inline |
get StreamProfile of the frame
- Returns
- std::shared_ptr<StreamProfile> The StreamProfile of the frame, may return nullptr if the frame is not captured from a stream.
Definition at line 260 of file Frame.hpp.
◆ getSensor()
std::shared_ptr< Sensor > ob::Frame::getSensor |
( |
| ) |
const |
|
inline |
get owner sensor of the frame
- Returns
- std::shared_ptr<Sensor> The owner sensor of the frame, return nullptr if the frame is not owned by any sensor or the sensor is destroyed
Definition at line 272 of file Frame.hpp.
◆ getDevice()
std::shared_ptr< Device > ob::Frame::getDevice |
( |
| ) |
const |
|
inline |
get owner device of the frame
- Returns
- std::shared_ptr<Device> The owner device of the frame, return nullptr if the frame is not owned by any device or the device is destroyed
Definition at line 285 of file Frame.hpp.
◆ is()
template<typename T >
bool ob::Frame::is |
( |
| ) |
const |
Check if the runtime type of the frame object is compatible with a given type.
- Template Parameters
-
- Returns
- bool The result.
Definition at line 1000 of file Frame.hpp.
Referenced by as(), and as().
◆ as() [1/2]
template<typename T >
std::shared_ptr< T > ob::Frame::as |
( |
| ) |
|
|
inline |
Convert the frame object to a target type.
- Template Parameters
-
- Returns
- std::shared_ptr<T> The result. If it cannot be converted, an exception will be thrown.
Definition at line 307 of file Frame.hpp.
◆ as() [2/2]
template<typename T >
std::shared_ptr< const T > ob::Frame::as |
( |
| ) |
const |
|
inline |
Convert the frame object to a target type.
- Template Parameters
-
- Returns
- std::shared_ptr<T> The result. If it cannot be converted, an exception will be thrown.
Definition at line 325 of file Frame.hpp.
◆ type()
◆ format()
virtual OBFormat ob::Frame::format |
( |
| ) |
const |
|
inlinevirtual |
◆ index()
virtual uint64_t ob::Frame::index |
( |
| ) |
const |
|
inlinevirtual |
◆ data()
virtual void * ob::Frame::data |
( |
| ) |
const |
|
inlinevirtual |
◆ dataSize()
virtual uint32_t ob::Frame::dataSize |
( |
| ) |
const |
|
inlinevirtual |
◆ timeStamp()
uint64_t ob::Frame::timeStamp |
( |
| ) |
const |
|
inline |
◆ timeStampUs()
uint64_t ob::Frame::timeStampUs |
( |
| ) |
const |
|
inline |
◆ systemTimeStamp()
uint64_t ob::Frame::systemTimeStamp |
( |
| ) |
const |
|
inline |
◆ systemTimeStampUs()
uint64_t ob::Frame::systemTimeStampUs |
( |
| ) |
const |
|
inline |
◆ globalTimeStampUs()
uint64_t ob::Frame::globalTimeStampUs |
( |
| ) |
const |
|
inline |
◆ metadata()
uint8_t * ob::Frame::metadata |
( |
| ) |
const |
|
inline |
◆ metadataSize()
uint32_t ob::Frame::metadataSize |
( |
| ) |
const |
|
inline |
◆ impl_
const ob_frame* ob::Frame::impl_ = nullptr |
|
protected |
The pointer to the internal (c api level) frame object.
Definition at line 50 of file Frame.hpp.
Referenced by as(), as(), getData(), getDataSize(), getDevice(), getFormat(), getGlobalTimeStampUs(), ob::VideoFrame::getHeight(), getImpl(), getIndex(), getMetadata(), getMetadataSize(), getMetadataValue(), ob::VideoFrame::getPixelAvailableBitSize(), ob::VideoFrame::getPixelType(), getSensor(), getStreamProfile(), getSystemTimeStampUs(), getTimeStampUs(), getType(), ob::DepthFrame::getValueScale(), ob::VideoFrame::getWidth(), hasMetadata(), and ~Frame().
The documentation for this class was generated from the following file:
- C:/Users/hzcyf/Projects/openorbbecsdkgroup/OpenOrbbecSDK/include/libobsensor/hpp/Frame.hpp