OrbbecSDK 2.0.18
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
Loading...
Searching...
No Matches
ob::Frame Class Reference

Define the frame class, which is the base class of all frame types. More...

#include <Frame.hpp>

+ Inheritance diagram for ob::Frame:

Public Member Functions

 Frame (const ob_frame *impl)
 Construct a new Frame object with a given pointer to the internal frame object.
 
const ob_framegetImpl () const
 Get the internal (impl) frame object.
 
virtual ~Frame () noexcept
 Destroy the Frame object.
 
virtual OBFrameType getType () const
 Get the type of frame.
 
virtual OBFormat getFormat () const
 Get the format of the frame.
 
virtual uint64_t getIndex () const
 Get the sequence number of the frame.
 
virtual uint8_t * getData () const
 Get frame data.
 
virtual uint32_t getDataSize () const
 Get the size of the frame data.
 
uint64_t getTimeStampUs () const
 Get the hardware timestamp of the frame in microseconds.
 
uint64_t getSystemTimeStampUs () const
 Get the system timestamp of the frame in microseconds.
 
uint64_t getGlobalTimeStampUs () const
 Get the global timestamp of the frame in microseconds.
 
uint8_t * getMetadata () const
 Get the metadata pointer of the frame.
 
uint32_t getMetadataSize () const
 Get the size of the metadata of the frame.
 
bool hasMetadata (OBFrameMetadataType type) const
 Check if the frame object has metadata of a given type.
 
int64_t getMetadataValue (OBFrameMetadataType type) const
 Get the metadata value.
 
std::shared_ptr< StreamProfilegetStreamProfile () const
 get StreamProfile of the frame
 
std::shared_ptr< SensorgetSensor () const
 get owner sensor of the frame
 
std::shared_ptr< DevicegetDevice () const
 get owner device of the frame
 
template<typename T >
bool is () const
 Check if the runtime type of the frame object is compatible with a given type.
 
template<typename T >
std::shared_ptr< T > as ()
 Convert the frame object to a target type.
 
template<typename T >
std::shared_ptr< const T > as () const
 Convert the frame object to a target type.
 
OBFrameType type () const
 
virtual OBFormat format () const
 
virtual uint64_t index () const
 
virtual void * data () const
 
virtual uint32_t dataSize () const
 
uint64_t timeStamp () const
 
uint64_t timeStampUs () const
 
uint64_t systemTimeStamp () const
 
uint64_t systemTimeStampUs () const
 
uint64_t globalTimeStampUs () const
 
uint8_t * metadata () const
 
uint32_t metadataSize () const
 

Protected Attributes

const ob_frameimpl_ = nullptr
 The pointer to the internal (c api level) frame object.
 

Detailed Description

Define the frame class, which is the base class of all frame types.

Definition at line 45 of file Frame.hpp.

Constructor & Destructor Documentation

◆ 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
implThe pointer to the internal frame object.

Definition at line 62 of file Frame.hpp.

◆ ~Frame()

virtual ob::Frame::~Frame ( )
inlinevirtualnoexcept

Destroy the Frame object.

Definition at line 76 of file Frame.hpp.

Member Function Documentation

◆ 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()

virtual OBFrameType ob::Frame::getType ( ) const
inlinevirtual

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()

bool ob::Frame::hasMetadata ( OBFrameMetadataType type) const
inline

Check if the frame object has metadata of a given type.

Parameters
typeThe metadata type. refer to OBFrameMetadataType
Returns
bool The result.

Definition at line 233 of file Frame.hpp.

◆ getMetadataValue()

int64_t ob::Frame::getMetadataValue ( OBFrameMetadataType type) const
inline

Get the metadata value.

Parameters
typeThe metadata type. refer to OBFrameMetadataType
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
TThe given type.
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
TThe target type.
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
TThe target type.
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()

OBFrameType ob::Frame::type ( ) const
inline

Definition at line 339 of file Frame.hpp.

Referenced by getMetadataValue(), getType(), and hasMetadata().

◆ format()

virtual OBFormat ob::Frame::format ( ) const
inlinevirtual

Definition at line 343 of file Frame.hpp.

Referenced by getFormat().

◆ index()

virtual uint64_t ob::Frame::index ( ) const
inlinevirtual

Definition at line 347 of file Frame.hpp.

Referenced by getIndex().

◆ data()

virtual void * ob::Frame::data ( ) const
inlinevirtual

Definition at line 351 of file Frame.hpp.

Referenced by data(), and getData().

◆ dataSize()

virtual uint32_t ob::Frame::dataSize ( ) const
inlinevirtual

Definition at line 356 of file Frame.hpp.

Referenced by getDataSize().

◆ timeStamp()

uint64_t ob::Frame::timeStamp ( ) const
inline

Definition at line 360 of file Frame.hpp.

◆ timeStampUs()

uint64_t ob::Frame::timeStampUs ( ) const
inline

Definition at line 364 of file Frame.hpp.

Referenced by getTimeStampUs().

◆ systemTimeStamp()

uint64_t ob::Frame::systemTimeStamp ( ) const
inline

Definition at line 368 of file Frame.hpp.

◆ systemTimeStampUs()

uint64_t ob::Frame::systemTimeStampUs ( ) const
inline

Definition at line 372 of file Frame.hpp.

Referenced by getSystemTimeStampUs().

◆ globalTimeStampUs()

uint64_t ob::Frame::globalTimeStampUs ( ) const
inline

Definition at line 376 of file Frame.hpp.

Referenced by getGlobalTimeStampUs().

◆ metadata()

uint8_t * ob::Frame::metadata ( ) const
inline

Definition at line 380 of file Frame.hpp.

Referenced by getMetadata().

◆ metadataSize()

uint32_t ob::Frame::metadataSize ( ) const
inline

Definition at line 384 of file Frame.hpp.

Referenced by getMetadataSize().

Member Data Documentation

◆ impl_


The documentation for this class was generated from the following file: