DvsenseDriver  1.3.0
The SDK for dvsense products.
Loading...
Searching...
No Matches
EventTypes.hpp
1#ifndef __EVENT_TYPES_HPP__
2#define __EVENT_TYPES_HPP__
3
4#include <cstddef>
5#include <cstdint>
6#include <vector>
7#include <functional>
8#include <memory>
9#include "DvsenseBase/Utils/TypeUtils.hpp"
10#ifdef _WIN32
11#define DVSENSE_API __declspec(dllexport)
12#else
13#define DVSENSE_API
14#endif // _WIN32
15namespace dvsense
16{
18 {
19 };
20
21 class DVSENSE_API Event2D : public EventBase
22 {
23 public:
25 uint16_t x,
26 uint16_t y,
27 uint8_t polarity,
29 Event2D() : x(0), y(0), timestamp(0), polarity(0) {}
30 uint16_t x;
31 uint16_t y;
33 uint8_t polarity;
36 };
37
38 class DVSENSE_API EventTriggerIn : public EventBase
39 {
40 public:
46 short polarity;
48 short id;
49 };
50
61
62 using Event2DVector = std::vector<Event2D>;
64 using EventsStreamHandleCallback = std::function<void(EventIterator_t begin, EventIterator_t end)>;
69 using SharedEventsStreamHandleCallback = std::function<void(std::shared_ptr<Event2DVector>)>;
70 using DvsTriggerInCallback = std::function<void(const EventTriggerIn)>;
71 using DsStatisticInfoCallback = std::function<void(const DsStatisticInfo)>;
72} // namespace dvsense
73
74#endif // __EVENT_TYPES_HPP__
Definition EventTypes.hpp:52
DsStatisticInfo(uint64_t bandwidth_byte, uint64_t events_count)
Definition EventTypes.hpp:54
DsStatisticInfo()
Definition EventTypes.hpp:57
uint64_t events_count
Definition EventTypes.hpp:59
uint64_t bandwidth_byte
Definition EventTypes.hpp:58
Definition EventTypes.hpp:22
uint16_t x
Definition EventTypes.hpp:30
Event2D(uint16_t x, uint16_t y, uint8_t polarity, TimeStamp timestamp)
Definition EventTypes.hpp:24
Event2D()
Definition EventTypes.hpp:29
TimeStamp timestamp
timestamp in microseconds
Definition EventTypes.hpp:35
uint16_t y
Definition EventTypes.hpp:31
uint8_t polarity
0: decrease, 1: increase
Definition EventTypes.hpp:33
Definition EventTypes.hpp:18
Definition EventTypes.hpp:39
EventTriggerIn(short id, short polarity, TimeStamp timestamp)
Definition EventTypes.hpp:41
TimeStamp timestamp
Definition EventTypes.hpp:47
short polarity
Definition EventTypes.hpp:46
EventTriggerIn()
Definition EventTypes.hpp:45
short id
Definition EventTypes.hpp:48
Definition ApsTypes.h:19
std::function< void(std::shared_ptr< Event2DVector >)> SharedEventsStreamHandleCallback
Event-batch callback with shared ownership, valid until its last owner releases it.
Definition EventTypes.hpp:69
std::function< void(const DsStatisticInfo)> DsStatisticInfoCallback
Definition EventTypes.hpp:71
Event2D * EventIterator_t
Definition EventTypes.hpp:63
std::function< void(const EventTriggerIn)> DvsTriggerInCallback
Definition EventTypes.hpp:70
std::vector< Event2D > Event2DVector
Definition EventTypes.hpp:62
std::function< void(EventIterator_t begin, EventIterator_t end)> EventsStreamHandleCallback
Definition EventTypes.hpp:64
uint64_t TimeStamp
Definition TypeUtils.hpp:10