MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / saveCloud

Function saveCloud

tools/uniform_sampling.cpp:123–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void
124saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output)
125{
126 TicToc tt;
127 tt.tic ();
128
129 print_highlight ("Saving "); print_value ("%s ", filename.c_str ());
130
131 PCDWriter w_pcd;
132 PLYWriter w_ply;
133 std::string output_ext = pcl_fs::path (filename).extension ().string ();
134 std::transform (output_ext.begin (), output_ext.end (), output_ext.begin (), ::tolower);
135
136 if (output_ext == ".pcd")
137 {
138 w_pcd.writeBinaryCompressed (filename, output);
139 }
140 else if (output_ext == ".ply")
141 {
142 w_ply.writeBinary (filename, output);
143 }
144 else if (output_ext == ".vtk")
145 {
146 w_ply.writeBinary (filename, output);
147 }
148
149 print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms : "); print_value ("%d", output.width * output.height); print_info (" points]\n");
150}
151
152/* ---[ */
153int

Callers 1

mainFunction · 0.70

Calls 8

print_valueFunction · 0.85
ticMethod · 0.80
tocMethod · 0.80
transformFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
writeBinaryCompressedMethod · 0.45
writeBinaryMethod · 0.45

Tested by

no test coverage detected