33 class OB_EXTENSION_API
Frame :
public std::enable_shared_from_this< Frame > {
35 std::unique_ptr< FrameImpl > impl_;
38 Frame( std::unique_ptr< FrameImpl > impl );
47 virtual OBFrameType type();
54 virtual OBFormat format();
61 virtual uint64_t index();
75 virtual uint32_t dataSize();
83 template <
typename T >
bool is();
91 template <
typename T > std::shared_ptr< T >
as() {
95 return std::static_pointer_cast< T >( std::const_pointer_cast<
Frame >( shared_from_this() ) );
126 uint64_t timeStamp();
133 uint64_t systemTimeStamp();
147 uint32_t metadataSize();
168 float getValueScale();
189 uint32_t frameCount();
196 std::shared_ptr< DepthFrame > depthFrame();
203 std::shared_ptr< ColorFrame > colorFrame();
210 std::shared_ptr< IRFrame > irFrame();
218 std::shared_ptr< Frame > getFrame( OBSensorType sensorType );
225 switch ( this->type() ) {
227 return (
typeid( T ) ==
typeid(
IRFrame ) ||
typeid( T ) ==
typeid(
VideoFrame ) );
233 return (
typeid( T ) ==
typeid(
FrameSet ) );
bool is()
检查帧对象的运行时类型是否与给定类型兼容
提供SDK的结构体、枚举常量定义(依赖libobsensor/h/ObTypes.h)
std::shared_ptr< T > as()
帧对象类型转换