driving.cc: Pass ModelDataRaw by reference (#1600)

* pass ModelDataRaw by reference

* pass NVGpaint by refer
old-commit-hash: af36aa28ab
commatwo_master
Dean Lee 5 years ago committed by GitHub
parent 0df6d7d187
commit b72fcb69e2
  1. 4
      selfdrive/modeld/models/driving.cc
  2. 4
      selfdrive/modeld/models/driving.h
  3. 2
      selfdrive/ui/paint.cc
  4. 2
      selfdrive/ui/ui.hpp

@ -247,7 +247,7 @@ void fill_longi(cereal::ModelData::LongitudinalData::Builder longi, const float
}
void model_publish(PubMaster &pm, uint32_t frame_id,
const ModelDataRaw net_outputs, uint64_t timestamp_eof) {
const ModelDataRaw &net_outputs, uint64_t timestamp_eof) {
// make msg
capnp::MallocMessageBuilder msg;
cereal::Event::Builder event = msg.initRoot<cereal::Event>();
@ -296,7 +296,7 @@ void model_publish(PubMaster &pm, uint32_t frame_id,
}
void posenet_publish(PubMaster &pm, uint32_t frame_id,
const ModelDataRaw net_outputs, uint64_t timestamp_eof) {
const ModelDataRaw &net_outputs, uint64_t timestamp_eof) {
capnp::MallocMessageBuilder msg;
cereal::Event::Builder event = msg.initRoot<cereal::Event>();
event.setLogMonoTime(nanos_since_boot());

@ -72,7 +72,7 @@ void model_free(ModelState* s);
void poly_fit(float *in_pts, float *in_stds, float *out);
void model_publish(PubMaster &pm, uint32_t frame_id,
const ModelDataRaw data, uint64_t timestamp_eof);
const ModelDataRaw &data, uint64_t timestamp_eof);
void posenet_publish(PubMaster &pm, uint32_t frame_id,
const ModelDataRaw data, uint64_t timestamp_eof);
const ModelDataRaw &data, uint64_t timestamp_eof);
#endif

@ -791,7 +791,7 @@ void ui_draw_rect(NVGcontext *vg, float x, float y, float w, float h, NVGcolor c
}
}
void ui_draw_rect(NVGcontext *vg, float x, float y, float w, float h, NVGpaint paint, float r){
void ui_draw_rect(NVGcontext *vg, float x, float y, float w, float h, NVGpaint &paint, float r){
nvgBeginPath(vg);
r > 0? nvgRoundedRect(vg, x, y, w, h, r) : nvgRect(vg, x, y, w, h);
nvgFillPaint(vg, paint);

@ -292,7 +292,7 @@ void ui_draw(UIState *s);
void ui_draw_sidebar(UIState *s);
void ui_draw_image(NVGcontext *vg, float x, float y, float w, float h, int image, float alpha);
void ui_draw_rect(NVGcontext *vg, float x, float y, float w, float h, NVGcolor color, float r = 0, int width = 0);
void ui_draw_rect(NVGcontext *vg, float x, float y, float w, float h, NVGpaint paint, float r = 0);
void ui_draw_rect(NVGcontext *vg, float x, float y, float w, float h, NVGpaint &paint, float r = 0);
void ui_nvg_init(UIState *s);
#endif

Loading…
Cancel
Save