-
Notifications
You must be signed in to change notification settings - Fork 1
/
frame_generated.h
240 lines (222 loc) · 6.82 KB
/
frame_generated.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
// automatically generated by the FlatBuffers compiler, do not modify
#ifndef FLATBUFFERS_GENERATED_FRAME_H_
#define FLATBUFFERS_GENERATED_FRAME_H_
#include "flatbuffers/flatbuffers.h"
struct Frame;
struct FrameBuilder;
enum FrameFormat {
FrameFormat_Gray = 0,
FrameFormat_Bgr = 16,
FrameFormat_Bgra = 24,
FrameFormat_MIN = FrameFormat_Gray,
FrameFormat_MAX = FrameFormat_Bgra
};
inline const FrameFormat (&EnumValuesFrameFormat())[3] {
static const FrameFormat values[] = {
FrameFormat_Gray,
FrameFormat_Bgr,
FrameFormat_Bgra
};
return values;
}
inline const char *EnumNameFrameFormat(FrameFormat e) {
switch (e) {
case FrameFormat_Gray: return "Gray";
case FrameFormat_Bgr: return "Bgr";
case FrameFormat_Bgra: return "Bgra";
default: return "";
}
}
struct Frame FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef FrameBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_T = 4,
VT_BEGIN_T = 6,
VT_END_T = 8,
VT_EXPOSURE_BEGIN_T = 10,
VT_EXPOSURE_END_T = 12,
VT_FORMAT = 14,
VT_WIDTH = 16,
VT_HEIGHT = 18,
VT_OFFSET_X = 20,
VT_OFFSET_Y = 22,
VT_PIXELS = 24
};
int64_t t() const {
return GetField<int64_t>(VT_T, 0);
}
int64_t begin_t() const {
return GetField<int64_t>(VT_BEGIN_T, 0);
}
int64_t end_t() const {
return GetField<int64_t>(VT_END_T, 0);
}
int64_t exposure_begin_t() const {
return GetField<int64_t>(VT_EXPOSURE_BEGIN_T, 0);
}
int64_t exposure_end_t() const {
return GetField<int64_t>(VT_EXPOSURE_END_T, 0);
}
FrameFormat format() const {
return static_cast<FrameFormat>(GetField<int8_t>(VT_FORMAT, 0));
}
int16_t width() const {
return GetField<int16_t>(VT_WIDTH, 0);
}
int16_t height() const {
return GetField<int16_t>(VT_HEIGHT, 0);
}
int16_t offset_x() const {
return GetField<int16_t>(VT_OFFSET_X, 0);
}
int16_t offset_y() const {
return GetField<int16_t>(VT_OFFSET_Y, 0);
}
const flatbuffers::Vector<uint8_t> *pixels() const {
return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_PIXELS);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<int64_t>(verifier, VT_T) &&
VerifyField<int64_t>(verifier, VT_BEGIN_T) &&
VerifyField<int64_t>(verifier, VT_END_T) &&
VerifyField<int64_t>(verifier, VT_EXPOSURE_BEGIN_T) &&
VerifyField<int64_t>(verifier, VT_EXPOSURE_END_T) &&
VerifyField<int8_t>(verifier, VT_FORMAT) &&
VerifyField<int16_t>(verifier, VT_WIDTH) &&
VerifyField<int16_t>(verifier, VT_HEIGHT) &&
VerifyField<int16_t>(verifier, VT_OFFSET_X) &&
VerifyField<int16_t>(verifier, VT_OFFSET_Y) &&
VerifyOffset(verifier, VT_PIXELS) &&
verifier.VerifyVector(pixels()) &&
verifier.EndTable();
}
};
struct FrameBuilder {
typedef Frame Table;
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_t(int64_t t) {
fbb_.AddElement<int64_t>(Frame::VT_T, t, 0);
}
void add_begin_t(int64_t begin_t) {
fbb_.AddElement<int64_t>(Frame::VT_BEGIN_T, begin_t, 0);
}
void add_end_t(int64_t end_t) {
fbb_.AddElement<int64_t>(Frame::VT_END_T, end_t, 0);
}
void add_exposure_begin_t(int64_t exposure_begin_t) {
fbb_.AddElement<int64_t>(Frame::VT_EXPOSURE_BEGIN_T, exposure_begin_t, 0);
}
void add_exposure_end_t(int64_t exposure_end_t) {
fbb_.AddElement<int64_t>(Frame::VT_EXPOSURE_END_T, exposure_end_t, 0);
}
void add_format(FrameFormat format) {
fbb_.AddElement<int8_t>(Frame::VT_FORMAT, static_cast<int8_t>(format), 0);
}
void add_width(int16_t width) {
fbb_.AddElement<int16_t>(Frame::VT_WIDTH, width, 0);
}
void add_height(int16_t height) {
fbb_.AddElement<int16_t>(Frame::VT_HEIGHT, height, 0);
}
void add_offset_x(int16_t offset_x) {
fbb_.AddElement<int16_t>(Frame::VT_OFFSET_X, offset_x, 0);
}
void add_offset_y(int16_t offset_y) {
fbb_.AddElement<int16_t>(Frame::VT_OFFSET_Y, offset_y, 0);
}
void add_pixels(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> pixels) {
fbb_.AddOffset(Frame::VT_PIXELS, pixels);
}
explicit FrameBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
FrameBuilder &operator=(const FrameBuilder &);
flatbuffers::Offset<Frame> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<Frame>(end);
return o;
}
};
inline flatbuffers::Offset<Frame> CreateFrame(
flatbuffers::FlatBufferBuilder &_fbb,
int64_t t = 0,
int64_t begin_t = 0,
int64_t end_t = 0,
int64_t exposure_begin_t = 0,
int64_t exposure_end_t = 0,
FrameFormat format = FrameFormat_Gray,
int16_t width = 0,
int16_t height = 0,
int16_t offset_x = 0,
int16_t offset_y = 0,
flatbuffers::Offset<flatbuffers::Vector<uint8_t>> pixels = 0) {
FrameBuilder builder_(_fbb);
builder_.add_exposure_end_t(exposure_end_t);
builder_.add_exposure_begin_t(exposure_begin_t);
builder_.add_end_t(end_t);
builder_.add_begin_t(begin_t);
builder_.add_t(t);
builder_.add_pixels(pixels);
builder_.add_offset_y(offset_y);
builder_.add_offset_x(offset_x);
builder_.add_height(height);
builder_.add_width(width);
builder_.add_format(format);
return builder_.Finish();
}
inline flatbuffers::Offset<Frame> CreateFrameDirect(
flatbuffers::FlatBufferBuilder &_fbb,
int64_t t = 0,
int64_t begin_t = 0,
int64_t end_t = 0,
int64_t exposure_begin_t = 0,
int64_t exposure_end_t = 0,
FrameFormat format = FrameFormat_Gray,
int16_t width = 0,
int16_t height = 0,
int16_t offset_x = 0,
int16_t offset_y = 0,
const std::vector<uint8_t> *pixels = nullptr) {
auto pixels__ = pixels ? _fbb.CreateVector<uint8_t>(*pixels) : 0;
return CreateFrame(
_fbb,
t,
begin_t,
end_t,
exposure_begin_t,
exposure_end_t,
format,
width,
height,
offset_x,
offset_y,
pixels__);
}
inline const Frame *GetFrame(const void *buf) {
return flatbuffers::GetRoot<Frame>(buf);
}
inline const Frame *GetSizePrefixedFrame(const void *buf) {
return flatbuffers::GetSizePrefixedRoot<Frame>(buf);
}
inline bool VerifyFrameBuffer(
flatbuffers::Verifier &verifier) {
return verifier.VerifyBuffer<Frame>(nullptr);
}
inline bool VerifySizePrefixedFrameBuffer(
flatbuffers::Verifier &verifier) {
return verifier.VerifySizePrefixedBuffer<Frame>(nullptr);
}
inline void FinishFrameBuffer(
flatbuffers::FlatBufferBuilder &fbb,
flatbuffers::Offset<Frame> root) {
fbb.Finish(root);
}
inline void FinishSizePrefixedFrameBuffer(
flatbuffers::FlatBufferBuilder &fbb,
flatbuffers::Offset<Frame> root) {
fbb.FinishSizePrefixed(root);
}
#endif // FLATBUFFERS_GENERATED_FRAME_H_