42 template <
typename Sensor>
48 template <
typename Sensor>
52 sensor.GetImageWidth(),
53 sensor.GetImageHeight(),
61 unsigned char *it = output.data();
64 std::memcpy(it,
reinterpret_cast<const void *
>(&header),
sizeof(header));
68 for (
auto e : events) {
69 std::memcpy(it,
reinterpret_cast<const void *
>(&e),
sizeof(
data::DVSEvent));
72 return std::move(output);
#define DEBUG_ASSERT(predicate)
一块原始数据。 请注意,如果需要更多容量,则会分配一个新的内存块,并 删除旧的内存块。这意味着默认情况下,缓冲区只能增长。要释放内存,使用 clear 或 pop。
包装一个传感器生成的原始数据以及一些有用的元信息。
auto begin() noexcept
指向传感器生成的数据的开始迭代器。
static Buffer Serialize(const Sensor &sensor, const DVSEventArray &events, Buffer &&output)
std::vector< data::DVSEvent > DVSEventArray
static SharedPtr< SensorData > Deserialize(RawData &&data)
static const DVSHeader & DeserializeHeader(const RawData &data)
static constexpr auto header_offset
boost::shared_ptr< T > SharedPtr
使用这个SharedPtr(boost::shared_ptr)以保持与boost::python的兼容性, 但未来如果可能的话,我们希望能为std::shared_ptr制作一个Python适配器。