6 #ifndef __VISUALIZE_VIDEO_H__
7 #define __VISUALIZE_VIDEO_H__
18 struct VisualizeVideoRequest
26 VisualizeVideoRequest() :
27 tableNames(std::vector<std::string>()),
28 worldTableNames(std::vector<std::string>()),
29 trackIds(std::vector<std::vector<std::string> >()),
30 xColumnName(std::string()),
31 yColumnName(std::string()),
32 geometryColumnName(std::string()),
39 projection(std::string()),
41 timeIntervals(std::vector<std::vector<double> >()),
42 videoStyle(std::string()),
43 sessionKey(std::string()),
44 styleOptions(std::map<std::string, std::vector<std::string> >()),
45 options(std::map<std::string, std::string>())
208 VisualizeVideoRequest(
const std::vector<std::string>& tableNames_,
const std::vector<std::string>& worldTableNames_,
const std::vector<std::vector<std::string> >& trackIds_,
const std::string& xColumnName_,
const std::string& yColumnName_,
const std::string& geometryColumnName_,
const double minX_,
const double maxX_,
const double minY_,
const double maxY_,
const int32_t width_,
const int32_t height_,
const std::string& projection_,
const int64_t bgColor_,
const std::vector<std::vector<double> >& timeIntervals_,
const std::string& videoStyle_,
const std::string& sessionKey_,
const std::map<std::string, std::vector<std::string> >& styleOptions_,
const std::map<std::string, std::string>& options_):
209 tableNames( tableNames_ ),
210 worldTableNames( worldTableNames_ ),
211 trackIds( trackIds_ ),
212 xColumnName( xColumnName_ ),
213 yColumnName( yColumnName_ ),
214 geometryColumnName( geometryColumnName_ ),
221 projection( projection_ ),
223 timeIntervals( timeIntervals_ ),
224 videoStyle( videoStyle_ ),
225 sessionKey( sessionKey_ ),
226 styleOptions( styleOptions_ ),
231 std::vector<std::string> tableNames;
232 std::vector<std::string> worldTableNames;
233 std::vector<std::vector<std::string> > trackIds;
234 std::string xColumnName;
235 std::string yColumnName;
236 std::string geometryColumnName;
243 std::string projection;
245 std::vector<std::vector<double> > timeIntervals;
246 std::string videoStyle;
247 std::string sessionKey;
248 std::map<std::string, std::vector<std::string> > styleOptions;
249 std::map<std::string, std::string> options;
259 template<>
struct codec_traits<gpudb::VisualizeVideoRequest>
261 static void encode(Encoder& e,
const gpudb::VisualizeVideoRequest& v)
263 ::avro::encode(e, v.tableNames);
264 ::avro::encode(e, v.worldTableNames);
265 ::avro::encode(e, v.trackIds);
266 ::avro::encode(e, v.xColumnName);
267 ::avro::encode(e, v.yColumnName);
268 ::avro::encode(e, v.geometryColumnName);
269 ::avro::encode(e, v.minX);
270 ::avro::encode(e, v.maxX);
271 ::avro::encode(e, v.minY);
272 ::avro::encode(e, v.maxY);
273 ::avro::encode(e, v.width);
274 ::avro::encode(e, v.height);
275 ::avro::encode(e, v.projection);
276 ::avro::encode(e, v.bgColor);
277 ::avro::encode(e, v.timeIntervals);
278 ::avro::encode(e, v.videoStyle);
279 ::avro::encode(e, v.sessionKey);
280 ::avro::encode(e, v.styleOptions);
281 ::avro::encode(e, v.options);
284 static void decode(Decoder& d, gpudb::VisualizeVideoRequest& v)
286 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
288 const std::vector<size_t> fo = rd->fieldOrder();
290 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
295 ::avro::decode(d, v.tableNames);
299 ::avro::decode(d, v.worldTableNames);
303 ::avro::decode(d, v.trackIds);
307 ::avro::decode(d, v.xColumnName);
311 ::avro::decode(d, v.yColumnName);
315 ::avro::decode(d, v.geometryColumnName);
319 ::avro::decode(d, v.minX);
323 ::avro::decode(d, v.maxX);
327 ::avro::decode(d, v.minY);
331 ::avro::decode(d, v.maxY);
335 ::avro::decode(d, v.width);
339 ::avro::decode(d, v.height);
343 ::avro::decode(d, v.projection);
347 ::avro::decode(d, v.bgColor);
351 ::avro::decode(d, v.timeIntervals);
355 ::avro::decode(d, v.videoStyle);
359 ::avro::decode(d, v.sessionKey);
363 ::avro::decode(d, v.styleOptions);
367 ::avro::decode(d, v.options);
377 ::avro::decode(d, v.tableNames);
378 ::avro::decode(d, v.worldTableNames);
379 ::avro::decode(d, v.trackIds);
380 ::avro::decode(d, v.xColumnName);
381 ::avro::decode(d, v.yColumnName);
382 ::avro::decode(d, v.geometryColumnName);
383 ::avro::decode(d, v.minX);
384 ::avro::decode(d, v.maxX);
385 ::avro::decode(d, v.minY);
386 ::avro::decode(d, v.maxY);
387 ::avro::decode(d, v.width);
388 ::avro::decode(d, v.height);
389 ::avro::decode(d, v.projection);
390 ::avro::decode(d, v.bgColor);
391 ::avro::decode(d, v.timeIntervals);
392 ::avro::decode(d, v.videoStyle);
393 ::avro::decode(d, v.sessionKey);
394 ::avro::decode(d, v.styleOptions);
395 ::avro::decode(d, v.options);
410 struct VisualizeVideoResponse
418 VisualizeVideoResponse() :
422 numFrames(int32_t()),
423 sessionKey(std::string()),
424 data(std::vector<std::vector<uint8_t> >()),
425 info(std::map<std::string, std::string>())
433 std::string sessionKey;
434 std::vector<std::vector<uint8_t> > data;
435 std::map<std::string, std::string> info;
445 template<>
struct codec_traits<gpudb::VisualizeVideoResponse>
447 static void encode(Encoder& e,
const gpudb::VisualizeVideoResponse& v)
449 ::avro::encode(e, v.width);
450 ::avro::encode(e, v.height);
451 ::avro::encode(e, v.bgColor);
452 ::avro::encode(e, v.numFrames);
453 ::avro::encode(e, v.sessionKey);
454 ::avro::encode(e, v.data);
455 ::avro::encode(e, v.info);
458 static void decode(Decoder& d, gpudb::VisualizeVideoResponse& v)
460 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
462 const std::vector<size_t> fo = rd->fieldOrder();
464 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
469 ::avro::decode(d, v.width);
473 ::avro::decode(d, v.height);
477 ::avro::decode(d, v.bgColor);
481 ::avro::decode(d, v.numFrames);
485 ::avro::decode(d, v.sessionKey);
489 ::avro::decode(d, v.data);
493 ::avro::decode(d, v.info);
503 ::avro::decode(d, v.width);
504 ::avro::decode(d, v.height);
505 ::avro::decode(d, v.bgColor);
506 ::avro::decode(d, v.numFrames);
507 ::avro::decode(d, v.sessionKey);
508 ::avro::decode(d, v.data);
509 ::avro::decode(d, v.info);