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

* pass ModelDataRaw by reference

* pass NVGpaint by refer
This commit is contained in:
Dean Lee 2020-05-31 01:08:44 +08:00 committed by GitHub
parent 94b2d4d522
commit af36aa28ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -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());

View file

@ -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

View file

@ -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);

View file

@ -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