6 #ifndef __VISUALIZE_IMAGE_H__
7 #define __VISUALIZE_IMAGE_H__
18 struct VisualizeImageRequest
26 VisualizeImageRequest() :
27 tableNames(std::vector<std::string>()),
28 worldTableNames(std::vector<std::string>()),
29 xColumnName(std::string()),
30 yColumnName(std::string()),
31 symbolColumnName(std::string()),
32 geometryColumnName(std::string()),
33 trackIds(std::vector<std::vector<std::string> >()),
40 projection(std::string()),
42 styleOptions(std::map<std::string, std::vector<std::string> >()),
43 options(std::map<std::string, std::string>())
248 VisualizeImageRequest(
const std::vector<std::string>& tableNames_,
const std::vector<std::string>& worldTableNames_,
const std::string& xColumnName_,
const std::string& yColumnName_,
const std::string& symbolColumnName_,
const std::string& geometryColumnName_,
const std::vector<std::vector<std::string> >& trackIds_,
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::map<std::string, std::vector<std::string> >& styleOptions_,
const std::map<std::string, std::string>& options_):
249 tableNames( tableNames_ ),
250 worldTableNames( worldTableNames_ ),
251 xColumnName( xColumnName_ ),
252 yColumnName( yColumnName_ ),
253 symbolColumnName( symbolColumnName_ ),
254 geometryColumnName( geometryColumnName_ ),
255 trackIds( trackIds_ ),
262 projection( projection_ ),
264 styleOptions( styleOptions_ ),
269 std::vector<std::string> tableNames;
270 std::vector<std::string> worldTableNames;
271 std::string xColumnName;
272 std::string yColumnName;
273 std::string symbolColumnName;
274 std::string geometryColumnName;
275 std::vector<std::vector<std::string> > trackIds;
282 std::string projection;
284 std::map<std::string, std::vector<std::string> > styleOptions;
285 std::map<std::string, std::string> options;
295 template<>
struct codec_traits<gpudb::VisualizeImageRequest>
297 static void encode(Encoder& e,
const gpudb::VisualizeImageRequest& v)
299 ::avro::encode(e, v.tableNames);
300 ::avro::encode(e, v.worldTableNames);
301 ::avro::encode(e, v.xColumnName);
302 ::avro::encode(e, v.yColumnName);
303 ::avro::encode(e, v.symbolColumnName);
304 ::avro::encode(e, v.geometryColumnName);
305 ::avro::encode(e, v.trackIds);
306 ::avro::encode(e, v.minX);
307 ::avro::encode(e, v.maxX);
308 ::avro::encode(e, v.minY);
309 ::avro::encode(e, v.maxY);
310 ::avro::encode(e, v.width);
311 ::avro::encode(e, v.height);
312 ::avro::encode(e, v.projection);
313 ::avro::encode(e, v.bgColor);
314 ::avro::encode(e, v.styleOptions);
315 ::avro::encode(e, v.options);
318 static void decode(Decoder& d, gpudb::VisualizeImageRequest& v)
320 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
322 const std::vector<size_t> fo = rd->fieldOrder();
324 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
329 ::avro::decode(d, v.tableNames);
333 ::avro::decode(d, v.worldTableNames);
337 ::avro::decode(d, v.xColumnName);
341 ::avro::decode(d, v.yColumnName);
345 ::avro::decode(d, v.symbolColumnName);
349 ::avro::decode(d, v.geometryColumnName);
353 ::avro::decode(d, v.trackIds);
357 ::avro::decode(d, v.minX);
361 ::avro::decode(d, v.maxX);
365 ::avro::decode(d, v.minY);
369 ::avro::decode(d, v.maxY);
373 ::avro::decode(d, v.width);
377 ::avro::decode(d, v.height);
381 ::avro::decode(d, v.projection);
385 ::avro::decode(d, v.bgColor);
389 ::avro::decode(d, v.styleOptions);
393 ::avro::decode(d, v.options);
403 ::avro::decode(d, v.tableNames);
404 ::avro::decode(d, v.worldTableNames);
405 ::avro::decode(d, v.xColumnName);
406 ::avro::decode(d, v.yColumnName);
407 ::avro::decode(d, v.symbolColumnName);
408 ::avro::decode(d, v.geometryColumnName);
409 ::avro::decode(d, v.trackIds);
410 ::avro::decode(d, v.minX);
411 ::avro::decode(d, v.maxX);
412 ::avro::decode(d, v.minY);
413 ::avro::decode(d, v.maxY);
414 ::avro::decode(d, v.width);
415 ::avro::decode(d, v.height);
416 ::avro::decode(d, v.projection);
417 ::avro::decode(d, v.bgColor);
418 ::avro::decode(d, v.styleOptions);
419 ::avro::decode(d, v.options);
434 struct VisualizeImageResponse
442 VisualizeImageResponse() :
446 imageData(std::vector<uint8_t>()),
447 info(std::map<std::string, std::string>())
454 std::vector<uint8_t> imageData;
455 std::map<std::string, std::string> info;
465 template<>
struct codec_traits<gpudb::VisualizeImageResponse>
467 static void encode(Encoder& e,
const gpudb::VisualizeImageResponse& v)
469 ::avro::encode(e, v.width);
470 ::avro::encode(e, v.height);
471 ::avro::encode(e, v.bgColor);
472 ::avro::encode(e, v.imageData);
473 ::avro::encode(e, v.info);
476 static void decode(Decoder& d, gpudb::VisualizeImageResponse& v)
478 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
480 const std::vector<size_t> fo = rd->fieldOrder();
482 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
487 ::avro::decode(d, v.width);
491 ::avro::decode(d, v.height);
495 ::avro::decode(d, v.bgColor);
499 ::avro::decode(d, v.imageData);
503 ::avro::decode(d, v.info);
513 ::avro::decode(d, v.width);
514 ::avro::decode(d, v.height);
515 ::avro::decode(d, v.bgColor);
516 ::avro::decode(d, v.imageData);
517 ::avro::decode(d, v.info);