Skip to content

Commit

Permalink
Ran clang-tidy after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
gnawme committed Aug 26, 2022
1 parent 41c0b1a commit 4d191b4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions io/src/ply_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ pcl::PLYWriter::writeASCII (const std::string &file_name,
}

unsigned int nr_points = cloud.width * cloud.height;
unsigned int point_size = static_cast<unsigned int> (cloud.data.size () / nr_points);
auto point_size = static_cast<unsigned int> (cloud.data.size () / nr_points);

// Write the header information if available
if (use_camera)
Expand Down Expand Up @@ -1015,7 +1015,7 @@ pcl::PLYWriter::writeContentWithCameraASCII (int nr_points,
}
else
{
const pcl::RGB& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + c * sizeof (pcl::RGB));
const auto& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + c * sizeof (pcl::RGB));
fs << static_cast<int>(color.r) << " " << static_cast<int>(color.g) << " " << static_cast<int>(color.b) << " " << static_cast<int>(color.a);
}
break;
Expand All @@ -1028,7 +1028,7 @@ pcl::PLYWriter::writeContentWithCameraASCII (int nr_points,
}
else
{
const pcl::RGB& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + c * sizeof (pcl::RGB));
const auto& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + c * sizeof (pcl::RGB));
fs << static_cast<int>(color.r) << " " << static_cast<int>(color.g) << " " << static_cast<int>(color.b);
}
break;
Expand Down Expand Up @@ -1130,7 +1130,7 @@ pcl::PLYWriter::writeContentWithRangeGridASCII (int nr_points,
}
else
{
const pcl::RGB& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + c * sizeof (pcl::RGB));
const auto& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + c * sizeof (pcl::RGB));
line << static_cast<int>(color.r) << " " << static_cast<int>(color.g) << " " << static_cast<int>(color.b) << " " << static_cast<int>(color.a);
}
break;
Expand All @@ -1150,7 +1150,7 @@ pcl::PLYWriter::writeContentWithRangeGridASCII (int nr_points,
}
else
{
const pcl::RGB& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + c * sizeof (pcl::RGB));
const auto& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + c * sizeof (pcl::RGB));
line << static_cast<int>(color.r) << " " << static_cast<int>(color.g) << " " << static_cast<int>(color.b);
}
break;
Expand Down Expand Up @@ -1332,7 +1332,7 @@ pcl::PLYWriter::writeBinary (const std::string &file_name,
}
else
{
const pcl::RGB& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + (total + c) * sizeof (pcl::RGB));
const auto& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + (total + c) * sizeof (pcl::RGB));
fpout.write (reinterpret_cast<const char*> (&color.r), sizeof (unsigned char));
fpout.write (reinterpret_cast<const char*> (&color.g), sizeof (unsigned char));
fpout.write (reinterpret_cast<const char*> (&color.b), sizeof (unsigned char));
Expand All @@ -1348,7 +1348,7 @@ pcl::PLYWriter::writeBinary (const std::string &file_name,
}
else
{
const pcl::RGB& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + (total + c) * sizeof (pcl::RGB));
const auto& color = cloud.at<pcl::RGB>(i, cloud.fields[d].offset + (total + c) * sizeof (pcl::RGB));
fpout.write (reinterpret_cast<const char*> (&color.r), sizeof (unsigned char));
fpout.write (reinterpret_cast<const char*> (&color.g), sizeof (unsigned char));
fpout.write (reinterpret_cast<const char*> (&color.b), sizeof (unsigned char));
Expand Down Expand Up @@ -1530,13 +1530,13 @@ pcl::io::savePLYFile (const std::string &file_name, const pcl::PolygonMesh &mesh
(mesh.cloud.fields[d].name == "rgb"))

{
const pcl::RGB& color = mesh.cloud.at<RGB>(i, mesh.cloud.fields[d].offset);
const auto& color = mesh.cloud.at<RGB>(i, mesh.cloud.fields[d].offset);
fs << int (color.r) << " " << int (color.g) << " " << int (color.b) << " ";
}
else if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::UINT32) &&
(mesh.cloud.fields[d].name == "rgba"))
{
const pcl::RGB& color = mesh.cloud.at<RGB>(i, mesh.cloud.fields[d].offset);
const auto& color = mesh.cloud.at<RGB>(i, mesh.cloud.fields[d].offset);
fs << int (color.r) << " " << int (color.g) << " " << int (color.b) << " " << int (color.a) << " ";
}
else if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (
Expand Down Expand Up @@ -1629,15 +1629,15 @@ pcl::io::savePLYFileBinary (const std::string &file_name, const pcl::PolygonMesh
(mesh.cloud.fields[d].name == "rgb"))

{
const pcl::RGB& color = mesh.cloud.at<RGB>(i, mesh.cloud.fields[d].offset);
const auto& color = mesh.cloud.at<RGB>(i, mesh.cloud.fields[d].offset);
fpout.write (reinterpret_cast<const char*> (&color.r), sizeof (unsigned char));
fpout.write (reinterpret_cast<const char*> (&color.g), sizeof (unsigned char));
fpout.write (reinterpret_cast<const char*> (&color.b), sizeof (unsigned char));
}
else if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::UINT32) &&
(mesh.cloud.fields[d].name == "rgba"))
{
const pcl::RGB& color = mesh.cloud.at<RGB>(i, mesh.cloud.fields[d].offset);
const auto& color = mesh.cloud.at<RGB>(i, mesh.cloud.fields[d].offset);
fpout.write (reinterpret_cast<const char*> (&color.r), sizeof (unsigned char));
fpout.write (reinterpret_cast<const char*> (&color.g), sizeof (unsigned char));
fpout.write (reinterpret_cast<const char*> (&color.b), sizeof (unsigned char));
Expand Down

0 comments on commit 4d191b4

Please sign in to comment.