MCPcopy Create free account
hub / github.com/Tencent/TAD_Sim / saveJpg

Function saveJpg

simcore/framework/examples/sensor_pb/sensor.cpp:30–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28void sim_sensor::Reset(tx_sim::ResetHelper& helper) { std::cout << "reset\n"; }
29
30void saveJpg(const std::string fname, const std::string buf) {
31 sim_msg::CameraRaw camera;
32 if (!camera.ParseFromString(buf)) {
33 std::cout << "camera error";
34 }
35 if (camera.type() == "JPEG") {
36 std::fstream of(fname, std::ios::out | std::ios::binary);
37 of.write(camera.image_data().c_str(), camera.image_data().size());
38 of.close();
39 }
40}
41
42bool savePcd(const std::string fname, const std::string buf) {
43 sim_msg::LidarRaw lidar;

Callers

nothing calls this directly

Calls 4

typeMethod · 0.45
writeMethod · 0.45
sizeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected