Function ouster::sdk::osf::slice_and_cast(const ouster::sdk::core::Frame&, const ouster::sdk::core::LidarFrameFieldTypes&)¶
Defined in File stream_lidar_frame.h
Function Documentation¶
-
std::shared_ptr<ouster::sdk::core::Frame> ouster::sdk::osf::slice_and_cast(const ouster::sdk::core::Frame &src, const ouster::sdk::core::LidarFrameFieldTypes &field_types)¶
Cast
srcto a subset of fields with possible different underlying ChanFieldTypes.The result is a copy of
srccarrying exactlyfield_types:fields thatsrcholds under a different ChanFieldType (or field class, or extra dimensions) are cast into the requested one, fieldssrcalready holds as requested are copied unchanged, and everything else is dropped. Every other part of the frame — dimensions, timestamp / pose / status headers, objects, the associated sensor_info(), and any headers specific to the concrete frame type — comes across untouched.The copy is made through Frame::clone(), so the returned frame has the same concrete type as
src:hand it a LidarFrame and you get a LidarFrame, hand it a CameraFrame and you get a CameraFrame.- Throws:
std::invalid_argument – if a requested field is missing from
src, or if a field needing a cast cannot be cast (casting is supported for two-dimensional fields only).- Parameters:
src[in] The frame to cast.
field_types[in] The field types to cast the frame to.
- Returns:
a copy of
srcwith transformed fields.