DvsenseDriver  1.0.3
The SDK for dvsense products.
RawEventStreamFormat.hpp
1 #ifndef __RAW_EVENT_STREAM_FORMAT_HPP__
2 #define __RAW_EVENT_STREAM_FORMAT_HPP__
3 
4 #include <cstdint>
5 #include <memory>
6 #include <string>
7 #include <string_view>
8 #include <sstream>
9 #include <map>
10 
11 #ifdef _WIN32
12  #ifdef DVSENSE_HAL_EXPORTS
13  #define DVSENSE_API __declspec(dllexport)
14  #else
15  #define DVSENSE_API __declspec(dllimport)
16  #endif
17 #else
18 #define DVSENSE_API
19 #endif // _WIN32
20 
21 namespace dvsense
22 {
23 
27  #ifdef _WIN32
28  enum class DVSENSE_API RawEventStreamEncodingType
29  #else
31  #endif // _WIN32
32  {
36  EVT3 = 0,
37 
41  UNKNOWN = -1
42  };
43 
47  class DVSENSE_API RawEventStreamFormat
48  {
49  public:
55  RawEventStreamFormat(std::string format);
56 
62  std::string getEncodingTypeStr() const;
63 
70 
78  bool contains(const std::string &name) const;
79 
87  const std::string &operator[](const std::string_view name) const;
88 
89  private:
95  void parseEncodingType(const std::string &encodingTypeStr);
96 
101  std::string encodingTypeStr;
106  RawEventStreamEncodingType encodingType;
111  std::map<std::string, std::string> options;
112  };
113 
114 } // namespace dvsense
115 
116 #endif // __RAW_EVENT_STREAM_FORMAT_HPP__
A class to describe the format and geometry of raw event stream directly from camera before decoding.
Definition: RawEventStreamFormat.hpp:48
RawEventStreamEncodingType getEncodingType() const
Get the encoding type.
const std::string & operator[](const std::string_view name) const
Accessor to format options, such as width, height, etc.
RawEventStreamFormat(std::string format)
Construct RawEventStreamFormat instance from string read from camera.
bool contains(const std::string &name) const
Check if the format contains a specific option.
std::string getEncodingTypeStr() const
Get the encoding type as a string.
Definition: TypeUtils.hpp:7
RawEventStreamEncodingType
Enum for the different types of raw event stream encoding.
Definition: RawEventStreamFormat.hpp:32
@ EVT3
Encoding type for EVT3.
@ UNKNOWN
Unknown encoding type.