6 #ifndef __VISUALIZE_IMAGE_LABELS_H__
7 #define __VISUALIZE_IMAGE_LABELS_H__
22 struct VisualizeImageLabelsRequest
30 VisualizeImageLabelsRequest() :
31 tableName(std::string()),
32 xColumnName(std::string()),
33 yColumnName(std::string()),
34 xOffset(std::string()),
35 yOffset(std::string()),
36 textString(std::string()),
38 textColor(std::string()),
39 textAngle(std::string()),
40 textScale(std::string()),
41 drawBox(std::string()),
42 drawLeader(std::string()),
43 lineWidth(std::string()),
44 lineColor(std::string()),
45 fillColor(std::string()),
46 leaderXColumnName(std::string()),
47 leaderYColumnName(std::string()),
54 projection(std::string()),
55 options(std::map<std::string, std::string>())
111 VisualizeImageLabelsRequest(
const std::string& tableName_,
const std::string& xColumnName_,
const std::string& yColumnName_,
const std::string& xOffset_,
const std::string& yOffset_,
const std::string& textString_,
const std::string& font_,
const std::string& textColor_,
const std::string& textAngle_,
const std::string& textScale_,
const std::string& drawBox_,
const std::string& drawLeader_,
const std::string& lineWidth_,
const std::string& lineColor_,
const std::string& fillColor_,
const std::string& leaderXColumnName_,
const std::string& leaderYColumnName_,
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 std::map<std::string, std::string>& options_):
112 tableName( tableName_ ),
113 xColumnName( xColumnName_ ),
114 yColumnName( yColumnName_ ),
117 textString( textString_ ),
119 textColor( textColor_ ),
120 textAngle( textAngle_ ),
121 textScale( textScale_ ),
123 drawLeader( drawLeader_ ),
124 lineWidth( lineWidth_ ),
125 lineColor( lineColor_ ),
126 fillColor( fillColor_ ),
127 leaderXColumnName( leaderXColumnName_ ),
128 leaderYColumnName( leaderYColumnName_ ),
135 projection( projection_ ),
144 std::string tableName;
145 std::string xColumnName;
146 std::string yColumnName;
149 std::string textString;
151 std::string textColor;
152 std::string textAngle;
153 std::string textScale;
155 std::string drawLeader;
156 std::string lineWidth;
157 std::string lineColor;
158 std::string fillColor;
159 std::string leaderXColumnName;
160 std::string leaderYColumnName;
167 std::string projection;
168 std::map<std::string, std::string> options;
178 template<>
struct codec_traits<gpudb::VisualizeImageLabelsRequest>
180 static void encode(Encoder& e,
const gpudb::VisualizeImageLabelsRequest& v)
182 ::avro::encode(e, v.tableName);
183 ::avro::encode(e, v.xColumnName);
184 ::avro::encode(e, v.yColumnName);
185 ::avro::encode(e, v.xOffset);
186 ::avro::encode(e, v.yOffset);
187 ::avro::encode(e, v.textString);
188 ::avro::encode(e, v.font);
189 ::avro::encode(e, v.textColor);
190 ::avro::encode(e, v.textAngle);
191 ::avro::encode(e, v.textScale);
192 ::avro::encode(e, v.drawBox);
193 ::avro::encode(e, v.drawLeader);
194 ::avro::encode(e, v.lineWidth);
195 ::avro::encode(e, v.lineColor);
196 ::avro::encode(e, v.fillColor);
197 ::avro::encode(e, v.leaderXColumnName);
198 ::avro::encode(e, v.leaderYColumnName);
199 ::avro::encode(e, v.minX);
200 ::avro::encode(e, v.maxX);
201 ::avro::encode(e, v.minY);
202 ::avro::encode(e, v.maxY);
203 ::avro::encode(e, v.width);
204 ::avro::encode(e, v.height);
205 ::avro::encode(e, v.projection);
206 ::avro::encode(e, v.options);
209 static void decode(Decoder& d, gpudb::VisualizeImageLabelsRequest& v)
211 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
213 const std::vector<size_t> fo = rd->fieldOrder();
215 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
220 ::avro::decode(d, v.tableName);
224 ::avro::decode(d, v.xColumnName);
228 ::avro::decode(d, v.yColumnName);
232 ::avro::decode(d, v.xOffset);
236 ::avro::decode(d, v.yOffset);
240 ::avro::decode(d, v.textString);
244 ::avro::decode(d, v.font);
248 ::avro::decode(d, v.textColor);
252 ::avro::decode(d, v.textAngle);
256 ::avro::decode(d, v.textScale);
260 ::avro::decode(d, v.drawBox);
264 ::avro::decode(d, v.drawLeader);
268 ::avro::decode(d, v.lineWidth);
272 ::avro::decode(d, v.lineColor);
276 ::avro::decode(d, v.fillColor);
280 ::avro::decode(d, v.leaderXColumnName);
284 ::avro::decode(d, v.leaderYColumnName);
288 ::avro::decode(d, v.minX);
292 ::avro::decode(d, v.maxX);
296 ::avro::decode(d, v.minY);
300 ::avro::decode(d, v.maxY);
304 ::avro::decode(d, v.width);
308 ::avro::decode(d, v.height);
312 ::avro::decode(d, v.projection);
316 ::avro::decode(d, v.options);
326 ::avro::decode(d, v.tableName);
327 ::avro::decode(d, v.xColumnName);
328 ::avro::decode(d, v.yColumnName);
329 ::avro::decode(d, v.xOffset);
330 ::avro::decode(d, v.yOffset);
331 ::avro::decode(d, v.textString);
332 ::avro::decode(d, v.font);
333 ::avro::decode(d, v.textColor);
334 ::avro::decode(d, v.textAngle);
335 ::avro::decode(d, v.textScale);
336 ::avro::decode(d, v.drawBox);
337 ::avro::decode(d, v.drawLeader);
338 ::avro::decode(d, v.lineWidth);
339 ::avro::decode(d, v.lineColor);
340 ::avro::decode(d, v.fillColor);
341 ::avro::decode(d, v.leaderXColumnName);
342 ::avro::decode(d, v.leaderYColumnName);
343 ::avro::decode(d, v.minX);
344 ::avro::decode(d, v.maxX);
345 ::avro::decode(d, v.minY);
346 ::avro::decode(d, v.maxY);
347 ::avro::decode(d, v.width);
348 ::avro::decode(d, v.height);
349 ::avro::decode(d, v.projection);
350 ::avro::decode(d, v.options);
369 struct VisualizeImageLabelsResponse
377 VisualizeImageLabelsResponse() :
381 imageData(std::vector<uint8_t>())
392 std::vector<uint8_t> imageData;
402 template<>
struct codec_traits<gpudb::VisualizeImageLabelsResponse>
404 static void encode(Encoder& e,
const gpudb::VisualizeImageLabelsResponse& v)
406 ::avro::encode(e, v.width);
407 ::avro::encode(e, v.height);
408 ::avro::encode(e, v.bgColor);
409 ::avro::encode(e, v.imageData);
412 static void decode(Decoder& d, gpudb::VisualizeImageLabelsResponse& v)
414 if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
416 const std::vector<size_t> fo = rd->fieldOrder();
418 for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
423 ::avro::decode(d, v.width);
427 ::avro::decode(d, v.height);
431 ::avro::decode(d, v.bgColor);
435 ::avro::decode(d, v.imageData);
445 ::avro::decode(d, v.width);
446 ::avro::decode(d, v.height);
447 ::avro::decode(d, v.bgColor);
448 ::avro::decode(d, v.imageData);