Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert pcl::int_t to std::int_t #3422

Merged
merged 7 commits into from
Oct 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
std::vector<pcl::PointIndices> boundary_indices;
mps.segmentAndRefine (regions, model_coefficients, inlier_indices, labels, label_indices, boundary_indices);

auto plane_labels = boost::make_shared<std::set<uint32_t> > ();
auto plane_labels = boost::make_shared<std::set<std::uint32_t> > ();
for (size_t i = 0; i < label_indices.size (); ++i)
if (label_indices[i].indices.size () > (size_t) min_plane_size)
plane_labels->insert (i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ pcl::cloud_composer::SupervoxelsTool::performTemplatedAction (const QList <const
super.setColorImportance (rgb_weight);
super.setSpatialImportance (spatial_weight);
super.setNormalImportance (normal_weight);
std::map <uint32_t, typename pcl::Supervoxel<PointT>::Ptr > supervoxel_clusters;
std::map <std::uint32_t, typename pcl::Supervoxel<PointT>::Ptr > supervoxel_clusters;
super.extract (supervoxel_clusters);

std::map <uint32_t, typename pcl::Supervoxel<PointT>::Ptr > refined_supervoxel_clusters;
std::map <std::uint32_t, typename pcl::Supervoxel<PointT>::Ptr > refined_supervoxel_clusters;
super.refineSupervoxels (3, refined_supervoxel_clusters);

typename pcl::PointCloud<PointXYZRGBA>::Ptr color_segments;
Expand Down
2 changes: 1 addition & 1 deletion apps/cloud_composer/src/cloud_browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ pcl::cloud_composer::BackgroundDelegate::paint (QPainter *painter, const QStyleO
QStyledItemDelegate::paint (painter, option, index);


}
}
2 changes: 1 addition & 1 deletion apps/cloud_composer/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ main (int argc, char ** argv)
pcl::cloud_composer::ComposerMainWindow cc;
cc.show ();
return (QApplication::exec ());
}
}
2 changes: 1 addition & 1 deletion apps/cloud_composer/src/merge_selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pcl::cloud_composer::MergeSelection::performAction (ConstItemList input_data, Po
{
if (type != PointTypeFlags::NONE)
{
switch ((uint8_t) type)
switch ((std::uint8_t) type)
{
case (PointTypeFlags::XYZ):
return this->performTemplatedAction<pcl::PointXYZ> (input_data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ pcl::cloud_composer::ManipulationEvent::addManipulation (const QString& id, cons
id_start_map_.insert (id, start);
id_end_map_.insert (id, end);

}
}
6 changes: 3 additions & 3 deletions apps/cloud_composer/src/project_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,12 +289,12 @@ pcl::cloud_composer::ProjectModel::insertNewCloudFromRGBandDepth ()
depth_pixel = static_cast<unsigned short*>(depth_image->GetScalarPointer (depth_dims[0]-1,depth_dims[1]-1,0));
color_pixel = static_cast<unsigned char*> (rgb_image->GetScalarPointer (depth_dims[0]-1,depth_dims[1]-1,0));

for (uint32_t y=0; y<cloud->height; ++y)
for (std::uint32_t y=0; y<cloud->height; ++y)
{
for (uint32_t x=0; x<cloud->width; ++x, --depth_pixel, color_pixel-=3)
for (std::uint32_t x=0; x<cloud->width; ++x, --depth_pixel, color_pixel-=3)
{
PointXYZRGB new_point;
// uint8_t* p_i = &(cloud_blob->data[y * cloud_blob->row_step + x * cloud_blob->point_step]);
// std::uint8_t* p_i = &(cloud_blob->data[y * cloud_blob->row_step + x * cloud_blob->point_step]);
float depth = (float)(*depth_pixel) * scale;
// qDebug () << "Depth = "<<depth;
if (depth == 0.0f)
Expand Down
2 changes: 1 addition & 1 deletion apps/cloud_composer/src/signal_multiplexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ pcl::cloud_composer::SignalMultiplexer::setCurrentObject (QObject* newObject)

//let the world know about who's on top now
emit currentObjectChanged (object);
}
}
4 changes: 2 additions & 2 deletions apps/cloud_composer/src/transform_clouds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pcl::cloud_composer::TransformClouds::performAction (ConstItemList input_data, P
{
if (type != PointTypeFlags::NONE)
{
switch ((uint8_t) type)
switch ((std::uint8_t) type)
{
case (PointTypeFlags::XYZ):
return this->performTemplatedAction<pcl::PointXYZ> (input_data);
Expand All @@ -39,4 +39,4 @@ pcl::cloud_composer::TransformClouds::performAction (ConstItemList input_data, P
qCritical () << "Transform requires templated types!";

return output;
}
}
2 changes: 1 addition & 1 deletion apps/cloud_composer/tools/organized_segmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pcl::cloud_composer::OrganizedSegmentationTool::performAction (ConstItemList inp
{
if (type != PointTypeFlags::NONE)
{
switch ((uint8_t) type)
switch ((std::uint8_t) type)
{
case (PointTypeFlags::XYZ):
return this->performTemplatedAction<pcl::PointXYZ> (input_data);
Expand Down
2 changes: 1 addition & 1 deletion apps/cloud_composer/tools/supervoxels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pcl::cloud_composer::SupervoxelsTool::performAction (ConstItemList input_data, P
{
if (type != PointTypeFlags::NONE)
{
switch ((uint8_t) type)
switch ((std::uint8_t) type)
{
case (PointTypeFlags::XYZ | PointTypeFlags::RGB):
return this->performTemplatedAction<pcl::PointXYZRGB> (input_data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::ihs::_PointIHS,
(float, rgb, rgb)
(float, weight, weight)
(unsigned int, age, age)
(uint32_t, directions, directions)
(std::uint32_t, directions, directions)
)
POINT_CLOUD_REGISTER_POINT_WRAPPER (pcl::ihs::PointIHS, pcl::ihs::_PointIHS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ namespace pcl
PCL_ADD_POINT4D
PCL_ADD_NORMAL4D
PCL_ADD_RGB
float weight;
float weight;
unsigned int age;
uint32_t directions;
std::uint32_t directions;

PCL_MAKE_ALIGNED_OPERATOR_NEW
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ namespace pcl
using KdTreePtr = boost::shared_ptr<KdTree>;
using KdTreeConstPtr = boost::shared_ptr<const KdTree>;

uint8_t
std::uint8_t
trimRGB (const float val) const;

/** \brief Adds two triangles between points 0-1-3 and 1-2-3 to the mesh. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ namespace pcl
PCL_EXPORTS void
addDirection (const Eigen::Vector4f& normal,
const Eigen::Vector4f& direction,
uint32_t& directions);
std::uint32_t& directions);

PCL_EXPORTS unsigned int
countDirections (const uint32_t directions);
countDirections (const std::uint32_t directions);

} // End namespace ihs
} // End namespace pcl
4 changes: 2 additions & 2 deletions apps/in_hand_scanner/src/integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,10 @@ pcl::ihs::Integration::getMinDirections () const

////////////////////////////////////////////////////////////////////////////////

uint8_t
std::uint8_t
pcl::ihs::Integration::trimRGB (const float val) const
{
return (static_cast <uint8_t> (val > 255.f ? 255 : val));
return (static_cast <std::uint8_t> (val > 255.f ? 255 : val));
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions apps/in_hand_scanner/src/visibility_confidence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ namespace pcl
void
pcl::ihs::addDirection (const Eigen::Vector4f& normal,
const Eigen::Vector4f& direction,
uint32_t& directions)
std::uint32_t& directions)
{
// Find the rotation that aligns the normal with [0; 0; 1]
const float dot = normal.z ();
Expand Down Expand Up @@ -147,7 +147,7 @@ pcl::ihs::addDirection (const Eigen::Vector4f& normal,
////////////////////////////////////////////////////////////////////////////////

unsigned int
pcl::ihs::countDirections (const uint32_t directions)
pcl::ihs::countDirections (const std::uint32_t directions)
{
// http://stackoverflow.com/questions/109023/best-algorithm-to-count-the-number-of-set-bits-in-a-32-bit-integer/109025#109025
unsigned int i = directions - ((directions >> 1) & 0x55555555);
Expand Down
2 changes: 1 addition & 1 deletion apps/include/pcl/apps/vfh_nn_classifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ namespace pcl
training_features_->points.insert (training_features_->points.end (), training_features->points.begin (), training_features->points.end ());
training_features_->header = training_features->header;
training_features_->height = 1;
training_features_->width = static_cast<uint32_t> (training_features_->points.size ());
training_features_->width = static_cast<std::uint32_t> (training_features_->points.size ());
training_features_->is_dense &= training_features->is_dense;
training_features_->sensor_origin_ = training_features->sensor_origin_;
training_features_->sensor_orientation_ = training_features->sensor_orientation_;
Expand Down
2 changes: 1 addition & 1 deletion apps/modeler/include/pcl/apps/modeler/impl/scene_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ namespace pcl
}


#endif // PCL_MODELER_SCENE_TREE_IMPL_H_
#endif // PCL_MODELER_SCENE_TREE_IMPL_H_
2 changes: 1 addition & 1 deletion apps/modeler/src/abstract_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ pcl::modeler::AbstractItem::showPropertyEditor()
setProperties();

parameter_dialog->deleteLater();
}
}
2 changes: 1 addition & 1 deletion apps/modeler/src/cloud_mesh_item_updater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ pcl::modeler::CloudMeshItemUpdater::updateCloudMeshItem()
cloud_mesh_item_->updateChannels();

deleteLater();
}
}
2 changes: 1 addition & 1 deletion apps/modeler/src/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,4 @@ void
pcl::modeler::MainWindow::slotOnWorkerFinished()
{
statusBar()->showMessage(QString("Working thread finished..."));
}
}
2 changes: 1 addition & 1 deletion apps/modeler/src/parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,4 @@ pcl::modeler::ColorParameter::toModelData()
model_data.first = QBrush(QColor(*this));
model_data.second = Qt::BackgroundRole;
return (model_data);
}
}
2 changes: 1 addition & 1 deletion apps/modeler/src/thread_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ void
pcl::modeler::ThreadController::slotOnCloudMeshItemUpdate(CloudMeshItem* cloud_mesh_item)
{
cloud_mesh_item->updateChannels();
}
}
2 changes: 1 addition & 1 deletion apps/modeler/src/voxel_grid_downsample_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,4 @@ pcl::modeler::VoxelGridDownampleWorker::processImpl(CloudMeshItem* cloud_mesh_it
emitDataUpdated(cloud_mesh_item);

return;
}
}
2 changes: 1 addition & 1 deletion apps/point_cloud_editor/src/cloudEditorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ CloudEditorWidget::swapRBValues ()
return;
for (unsigned int i = 0; i < cloud_ptr_ -> size(); i++)
{
uint8_t cc = (*cloud_ptr_)[i].r;
std::uint8_t cc = (*cloud_ptr_)[i].r;
(*cloud_ptr_)[i].r = (*cloud_ptr_)[i].b;
(*cloud_ptr_)[i].b = cc;
}
Expand Down
6 changes: 3 additions & 3 deletions apps/src/grabcut_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class GrabCutHelper : public pcl::GrabCut<pcl::PointXYZRGB>
using Ptr = boost::shared_ptr<GrabCutHelper>;
using ConstPtr = boost::shared_ptr<const GrabCutHelper>;

GrabCutHelper (uint32_t K = 5, float lambda = 50.f)
GrabCutHelper (std::uint32_t K = 5, float lambda = 50.f)
: pcl::GrabCut<pcl::PointXYZRGB> (K, lambda)
{}

Expand Down Expand Up @@ -264,7 +264,7 @@ int xstart, ystart, xend, yend;
bool box = false;
bool left = false, right = false;
bool refining_ = false;
uint32_t width, height;
std::uint32_t width, height;
GrabCutHelper grabcut;
pcl::segmentation::grabcut::Image::Ptr display_image;

Expand Down Expand Up @@ -512,7 +512,7 @@ int main (int argc, char** argv)

if (scene->isOrganized ())
{
pcl::uint32_t height_1 = scene->height -1;
std::uint32_t height_1 = scene->height -1;
for (std::size_t i = 0; i < scene->height; ++i)
{
for (std::size_t j = 0; j < scene->width; ++j)
Expand Down
2 changes: 1 addition & 1 deletion apps/src/ni_linemod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class NILinemod
search_.nearestKSearch (picked_pt, 1, indices, distances);

// Get the [u, v] in pixel coordinates for the ImageViewer. Remember that 0,0 is bottom left.
uint32_t width = search_.getInputCloud ()->width;
std::uint32_t width = search_.getInputCloud ()->width;
// height = search_.getInputCloud ()->height;
int v = indices[0] / width,
u = indices[0] % width;
Expand Down
12 changes: 6 additions & 6 deletions apps/src/openni_organized_compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,19 @@ struct EventHelper
const openni_wrapper::DepthImage::Ptr &depth_image, float)
{

std::vector<uint16_t> disparity_data;
std::vector<uint8_t> rgb_data;
std::vector<std::uint16_t> disparity_data;
std::vector<std::uint8_t> rgb_data;

uint32_t width=depth_image->getWidth ();
uint32_t height=depth_image->getHeight ();
std::uint32_t width=depth_image->getWidth ();
std::uint32_t height=depth_image->getHeight ();

disparity_data.resize(width*height);
depth_image->fillDepthImageRaw (width, height, &disparity_data[0], static_cast<unsigned int> (width * sizeof (uint16_t)));
depth_image->fillDepthImageRaw (width, height, &disparity_data[0], static_cast<unsigned int> (width * sizeof (std::uint16_t)));

if (image->getEncoding() != openni_wrapper::Image::RGB)
{
rgb_data.resize(width*height*3);
image->fillRGB(width, height, &rgb_data[0], static_cast<unsigned int> (width * sizeof (uint8_t) * 3));
image->fillRGB(width, height, &rgb_data[0], static_cast<unsigned int> (width * sizeof (std::uint8_t) * 3));
}

organizedEncoder_->encodeRawDisparityMapWithColorImage (disparity_data, rgb_data, width, height, outputFile_, doColorEncoding_, bGrayScaleConversion_, bShowStatistics_, pngLevel_);
Expand Down
2 changes: 1 addition & 1 deletion apps/src/openni_organized_edge_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class OpenNIOrganizedEdgeDetection
// Make gray point cloud
for (auto &point : cloud_.points)
{
pcl::uint8_t gray = pcl::uint8_t((point.r + point.g + point.b)/3);
std::uint8_t gray = std::uint8_t((point.r + point.g + point.b)/3);
point.r = point.g = point.b = gray;
}

Expand Down
24 changes: 12 additions & 12 deletions apps/src/openni_shift_to_depth_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ class SimpleOpenNIViewer
const openni_wrapper::DepthImage::Ptr &depth_image, float)
{

std::vector<uint16_t> raw_shift_data;
std::vector<uint16_t> raw_depth_data;
std::vector<std::uint16_t> raw_shift_data;
std::vector<std::uint16_t> raw_depth_data;

std::vector<uint8_t> rgb_data;
std::vector<std::uint8_t> rgb_data;

uint32_t width=depth_image->getWidth ();
uint32_t height=depth_image->getHeight ();
std::uint32_t width=depth_image->getWidth ();
std::uint32_t height=depth_image->getHeight ();

// copy raw shift data from depth_image
raw_shift_data.resize(width*height);
depth_image->fillDepthImageRaw (width, height, &raw_shift_data[0], static_cast<unsigned int> (width * sizeof (uint16_t)));
depth_image->fillDepthImageRaw (width, height, &raw_shift_data[0], static_cast<unsigned int> (width * sizeof (std::uint16_t)));

// convert raw shift data to raw depth data
raw_depth_data.resize(width*height);
Expand All @@ -102,7 +102,7 @@ class SimpleOpenNIViewer
{
// copy raw rgb data from image
rgb_data.resize(width*height*3);
image->fillRGB(width, height, &rgb_data[0], static_cast<unsigned int> (width * sizeof (uint8_t) * 3));
image->fillRGB(width, height, &rgb_data[0], static_cast<unsigned int> (width * sizeof (std::uint8_t) * 3));
}

// empty pointcloud
Expand Down Expand Up @@ -155,8 +155,8 @@ class SimpleOpenNIViewer

/* helper method to convert depth&rgb data to pointcloud*/
void
convert (std::vector<uint16_t>& depthData_arg,
std::vector<uint8_t>& rgbData_arg,
convert (std::vector<std::uint16_t>& depthData_arg,
std::vector<std::uint8_t>& rgbData_arg,
size_t width_arg,
size_t height_arg,
float focalLength_arg,
Expand All @@ -169,8 +169,8 @@ class SimpleOpenNIViewer
cloud_arg.points.reserve (cloud_size);

// Define point cloud parameters
cloud_arg.width = static_cast<uint32_t> (width_arg);
cloud_arg.height = static_cast<uint32_t> (height_arg);
cloud_arg.width = static_cast<std::uint32_t> (width_arg);
cloud_arg.height = static_cast<std::uint32_t> (height_arg);
cloud_arg.is_dense = false;

// Calculate center of disparity image
Expand All @@ -186,7 +186,7 @@ class SimpleOpenNIViewer
{
PointXYZRGB newPoint;

const uint16_t& pixel_depth = depthData_arg[i];
const std::uint16_t& pixel_depth = depthData_arg[i];

if (pixel_depth)
{
Expand Down
Loading