6 #ifndef __VISUALIZE_VIDEO_HEATMAP_H__ 7 #define __VISUALIZE_VIDEO_HEATMAP_H__ 22 struct VisualizeVideoHeatmapRequest
30 VisualizeVideoHeatmapRequest() :
31 tableNames(std::vector<std::string>()),
32 xColumnName(std::string()),
33 yColumnName(std::string()),
38 timeIntervals(std::vector<std::vector<double> >()),
41 projection(std::string()),
42 videoStyle(std::string()),
43 sessionKey(std::string()),
44 styleOptions(std::map<std::string, std::string>()),
45 options(std::map<std::string, std::string>())
129 VisualizeVideoHeatmapRequest(
const std::vector<std::string>& tableNames_,
const std::string& xColumnName_,
const std::string& yColumnName_,
const double minX_,
const double maxX_,
const double minY_,
const double maxY_,
const std::vector<std::vector<double> >& timeIntervals_,
const int32_t width_,
const int32_t height_,
const std::string& projection_,
const std::string& videoStyle_,
const std::string& sessionKey_,
const std::map<std::string, std::string>& styleOptions_,
const std::map<std::string, std::string>& options_):
130 tableNames( tableNames_ ),
131 xColumnName( xColumnName_ ),
132 yColumnName( yColumnName_ ),
137 timeIntervals( timeIntervals_ ),
140 projection( projection_ ),
141 videoStyle( videoStyle_ ),
142 sessionKey( sessionKey_ ),
143 styleOptions( styleOptions_ ),
152 std::vector<std::string> tableNames;
153 std::string xColumnName;
154 std::string yColumnName;
159 std::vector<std::vector<double> > timeIntervals;
162 std::string projection;
163 std::string videoStyle;
164 std::string sessionKey;
165 std::map<std::string, std::string> styleOptions;
166 std::map<std::string, std::string> options;
176 template<>
struct codec_traits<
gpudb::VisualizeVideoHeatmapRequest>
178 static void encode(Encoder& e,
const gpudb::VisualizeVideoHeatmapRequest& v)
180 ::avro::encode(e, v.tableNames);
181 ::avro::encode(e, v.xColumnName);
182 ::avro::encode(e, v.yColumnName);
183 ::avro::encode(e, v.minX);
184 ::avro::encode(e, v.maxX);
185 ::avro::encode(e, v.minY);
186 ::avro::encode(e, v.maxY);
187 ::avro::encode(e, v.timeIntervals);
188 ::avro::encode(e, v.width);
189 ::avro::encode(e, v.height);
190 ::avro::encode(e, v.projection);
191 ::avro::encode(e, v.videoStyle);
192 ::avro::encode(e, v.sessionKey);
193 ::avro::encode(e, v.styleOptions);
194 ::avro::encode(e, v.options);
197 static void decode(Decoder& d, gpudb::VisualizeVideoHeatmapRequest& v)
199 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
201 const std::vector<size_t> fo = rd->fieldOrder();
203 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
208 ::avro::decode(d, v.tableNames);
212 ::avro::decode(d, v.xColumnName);
216 ::avro::decode(d, v.yColumnName);
220 ::avro::decode(d, v.minX);
224 ::avro::decode(d, v.maxX);
228 ::avro::decode(d, v.minY);
232 ::avro::decode(d, v.maxY);
236 ::avro::decode(d, v.timeIntervals);
240 ::avro::decode(d, v.width);
244 ::avro::decode(d, v.height);
248 ::avro::decode(d, v.projection);
252 ::avro::decode(d, v.videoStyle);
256 ::avro::decode(d, v.sessionKey);
260 ::avro::decode(d, v.styleOptions);
264 ::avro::decode(d, v.options);
274 ::avro::decode(d, v.tableNames);
275 ::avro::decode(d, v.xColumnName);
276 ::avro::decode(d, v.yColumnName);
277 ::avro::decode(d, v.minX);
278 ::avro::decode(d, v.maxX);
279 ::avro::decode(d, v.minY);
280 ::avro::decode(d, v.maxY);
281 ::avro::decode(d, v.timeIntervals);
282 ::avro::decode(d, v.width);
283 ::avro::decode(d, v.height);
284 ::avro::decode(d, v.projection);
285 ::avro::decode(d, v.videoStyle);
286 ::avro::decode(d, v.sessionKey);
287 ::avro::decode(d, v.styleOptions);
288 ::avro::decode(d, v.options);
307 struct VisualizeVideoHeatmapResponse
315 VisualizeVideoHeatmapResponse() :
319 numFrames(int32_t()),
320 sessionKey(std::string()),
321 data(std::vector<std::vector<uint8_t> >())
333 std::string sessionKey;
334 std::vector<std::vector<uint8_t> > data;
344 template<>
struct codec_traits<
gpudb::VisualizeVideoHeatmapResponse>
346 static void encode(Encoder& e,
const gpudb::VisualizeVideoHeatmapResponse& v)
348 ::avro::encode(e, v.width);
349 ::avro::encode(e, v.height);
350 ::avro::encode(e, v.bgColor);
351 ::avro::encode(e, v.numFrames);
352 ::avro::encode(e, v.sessionKey);
353 ::avro::encode(e, v.data);
356 static void decode(Decoder& d, gpudb::VisualizeVideoHeatmapResponse& v)
358 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
360 const std::vector<size_t> fo = rd->fieldOrder();
362 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
367 ::avro::decode(d, v.width);
371 ::avro::decode(d, v.height);
375 ::avro::decode(d, v.bgColor);
379 ::avro::decode(d, v.numFrames);
383 ::avro::decode(d, v.sessionKey);
387 ::avro::decode(d, v.data);
397 ::avro::decode(d, v.width);
398 ::avro::decode(d, v.height);
399 ::avro::decode(d, v.bgColor);
400 ::avro::decode(d, v.numFrames);
401 ::avro::decode(d, v.sessionKey);
402 ::avro::decode(d, v.data);