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 geometryColumnName(std::string()),
32 trackIds(std::vector<std::vector<std::string> >()),
39 projection(std::string()),
41 styleOptions(std::map<std::string, std::vector<std::string> >()),
42 options(std::map<std::string, std::string>())
246 VisualizeImageRequest(
const std::vector<std::string>& tableNames_,
const std::vector<std::string>& worldTableNames_,
const std::string& xColumnName_,
const std::string& yColumnName_,
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_):
247 tableNames( tableNames_ ),
248 worldTableNames( worldTableNames_ ),
249 xColumnName( xColumnName_ ),
250 yColumnName( yColumnName_ ),
251 geometryColumnName( geometryColumnName_ ),
252 trackIds( trackIds_ ),
259 projection( projection_ ),
261 styleOptions( styleOptions_ ),
266 std::vector<std::string> tableNames;
267 std::vector<std::string> worldTableNames;
268 std::string xColumnName;
269 std::string yColumnName;
270 std::string geometryColumnName;
271 std::vector<std::vector<std::string> > trackIds;
278 std::string projection;
280 std::map<std::string, std::vector<std::string> > styleOptions;
281 std::map<std::string, std::string> options;
291 template<>
struct codec_traits<
gpudb::VisualizeImageRequest>
293 static void encode(Encoder& e,
const gpudb::VisualizeImageRequest& v)
295 ::avro::encode(e, v.tableNames);
296 ::avro::encode(e, v.worldTableNames);
297 ::avro::encode(e, v.xColumnName);
298 ::avro::encode(e, v.yColumnName);
299 ::avro::encode(e, v.geometryColumnName);
300 ::avro::encode(e, v.trackIds);
301 ::avro::encode(e, v.minX);
302 ::avro::encode(e, v.maxX);
303 ::avro::encode(e, v.minY);
304 ::avro::encode(e, v.maxY);
305 ::avro::encode(e, v.width);
306 ::avro::encode(e, v.height);
307 ::avro::encode(e, v.projection);
308 ::avro::encode(e, v.bgColor);
309 ::avro::encode(e, v.styleOptions);
310 ::avro::encode(e, v.options);
313 static void decode(Decoder& d, gpudb::VisualizeImageRequest& v)
315 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
317 const std::vector<size_t> fo = rd->fieldOrder();
319 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
324 ::avro::decode(d, v.tableNames);
328 ::avro::decode(d, v.worldTableNames);
332 ::avro::decode(d, v.xColumnName);
336 ::avro::decode(d, v.yColumnName);
340 ::avro::decode(d, v.geometryColumnName);
344 ::avro::decode(d, v.trackIds);
348 ::avro::decode(d, v.minX);
352 ::avro::decode(d, v.maxX);
356 ::avro::decode(d, v.minY);
360 ::avro::decode(d, v.maxY);
364 ::avro::decode(d, v.width);
368 ::avro::decode(d, v.height);
372 ::avro::decode(d, v.projection);
376 ::avro::decode(d, v.bgColor);
380 ::avro::decode(d, v.styleOptions);
384 ::avro::decode(d, v.options);
394 ::avro::decode(d, v.tableNames);
395 ::avro::decode(d, v.worldTableNames);
396 ::avro::decode(d, v.xColumnName);
397 ::avro::decode(d, v.yColumnName);
398 ::avro::decode(d, v.geometryColumnName);
399 ::avro::decode(d, v.trackIds);
400 ::avro::decode(d, v.minX);
401 ::avro::decode(d, v.maxX);
402 ::avro::decode(d, v.minY);
403 ::avro::decode(d, v.maxY);
404 ::avro::decode(d, v.width);
405 ::avro::decode(d, v.height);
406 ::avro::decode(d, v.projection);
407 ::avro::decode(d, v.bgColor);
408 ::avro::decode(d, v.styleOptions);
409 ::avro::decode(d, v.options);
424 struct VisualizeImageResponse
432 VisualizeImageResponse() :
436 imageData(std::vector<uint8_t>())
443 std::vector<uint8_t> imageData;
453 template<>
struct codec_traits<
gpudb::VisualizeImageResponse>
455 static void encode(Encoder& e,
const gpudb::VisualizeImageResponse& v)
457 ::avro::encode(e, v.width);
458 ::avro::encode(e, v.height);
459 ::avro::encode(e, v.bgColor);
460 ::avro::encode(e, v.imageData);
463 static void decode(Decoder& d, gpudb::VisualizeImageResponse& v)
465 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
467 const std::vector<size_t> fo = rd->fieldOrder();
469 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
474 ::avro::decode(d, v.width);
478 ::avro::decode(d, v.height);
482 ::avro::decode(d, v.bgColor);
486 ::avro::decode(d, v.imageData);
496 ::avro::decode(d, v.width);
497 ::avro::decode(d, v.height);
498 ::avro::decode(d, v.bgColor);
499 ::avro::decode(d, v.imageData);