jfjoch_viewer: Access binary plot whenever possible
This commit is contained in:
@@ -189,6 +189,17 @@ std::vector<float> JFJochHttpReader::GetPlot_i(const std::string &plot_type, flo
|
||||
return {};
|
||||
|
||||
httplib::Client cli_cmd(addr);
|
||||
|
||||
auto res_bin = cli_cmd.Get("/preview/plot.bin?type=" + plot_type);
|
||||
if (res_bin && res_bin->status == httplib::StatusCode::OK_200) {
|
||||
if (res_bin->body.size() % sizeof(float) != 0) {
|
||||
throw std::runtime_error("Input size is not a multiple of sizeof(float)");
|
||||
}
|
||||
std::vector<float> v(res_bin->body.size() / sizeof(float));
|
||||
std::memcpy(v.data(), res_bin->body.data(), res_bin->body.size());
|
||||
return v;
|
||||
}
|
||||
|
||||
auto res = cli_cmd.Get("/preview/plot?binning=1&experimental_coord=false&fill="
|
||||
+ std::to_string(fill_value) + "&type=" + plot_type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user