diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/tools/impl/organized_segmentation.hpp b/apps/cloud_composer/include/pcl/apps/cloud_composer/tools/impl/organized_segmentation.hpp index 7054c37812e..1066e01b212 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/tools/impl/organized_segmentation.hpp +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/tools/impl/organized_segmentation.hpp @@ -103,7 +103,7 @@ std::vector boundary_indices; mps.segmentAndRefine (regions, model_coefficients, inlier_indices, labels, label_indices, boundary_indices); - auto plane_labels = boost::make_shared > (); + auto plane_labels = boost::make_shared > (); 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); diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/tools/impl/supervoxels.hpp b/apps/cloud_composer/include/pcl/apps/cloud_composer/tools/impl/supervoxels.hpp index c8f2b7eaa98..e92a0625802 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/tools/impl/supervoxels.hpp +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/tools/impl/supervoxels.hpp @@ -89,10 +89,10 @@ pcl::cloud_composer::SupervoxelsTool::performTemplatedAction (const QList ::Ptr > supervoxel_clusters; + std::map ::Ptr > supervoxel_clusters; super.extract (supervoxel_clusters); - std::map ::Ptr > refined_supervoxel_clusters; + std::map ::Ptr > refined_supervoxel_clusters; super.refineSupervoxels (3, refined_supervoxel_clusters); typename pcl::PointCloud::Ptr color_segments; diff --git a/apps/cloud_composer/src/cloud_browser.cpp b/apps/cloud_composer/src/cloud_browser.cpp index e6c6a09903c..a5ac2de92e2 100644 --- a/apps/cloud_composer/src/cloud_browser.cpp +++ b/apps/cloud_composer/src/cloud_browser.cpp @@ -41,4 +41,4 @@ pcl::cloud_composer::BackgroundDelegate::paint (QPainter *painter, const QStyleO QStyledItemDelegate::paint (painter, option, index); -} \ No newline at end of file +} diff --git a/apps/cloud_composer/src/main.cpp b/apps/cloud_composer/src/main.cpp index 6afac9bc973..939bad15e72 100644 --- a/apps/cloud_composer/src/main.cpp +++ b/apps/cloud_composer/src/main.cpp @@ -10,4 +10,4 @@ main (int argc, char ** argv) pcl::cloud_composer::ComposerMainWindow cc; cc.show (); return (QApplication::exec ()); -} \ No newline at end of file +} diff --git a/apps/cloud_composer/src/merge_selection.cpp b/apps/cloud_composer/src/merge_selection.cpp index c227bb96954..13e4c79b7a5 100644 --- a/apps/cloud_composer/src/merge_selection.cpp +++ b/apps/cloud_composer/src/merge_selection.cpp @@ -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 (input_data); diff --git a/apps/cloud_composer/src/point_selectors/manipulation_event.cpp b/apps/cloud_composer/src/point_selectors/manipulation_event.cpp index 2995f624d27..7021de8bee4 100644 --- a/apps/cloud_composer/src/point_selectors/manipulation_event.cpp +++ b/apps/cloud_composer/src/point_selectors/manipulation_event.cpp @@ -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); -} \ No newline at end of file +} diff --git a/apps/cloud_composer/src/project_model.cpp b/apps/cloud_composer/src/project_model.cpp index 37a6a3eb0cf..d8a92f59e7c 100644 --- a/apps/cloud_composer/src/project_model.cpp +++ b/apps/cloud_composer/src/project_model.cpp @@ -289,12 +289,12 @@ pcl::cloud_composer::ProjectModel::insertNewCloudFromRGBandDepth () depth_pixel = static_cast(depth_image->GetScalarPointer (depth_dims[0]-1,depth_dims[1]-1,0)); color_pixel = static_cast (rgb_image->GetScalarPointer (depth_dims[0]-1,depth_dims[1]-1,0)); - for (uint32_t y=0; yheight; ++y) + for (std::uint32_t y=0; yheight; ++y) { - for (uint32_t x=0; xwidth; ++x, --depth_pixel, color_pixel-=3) + for (std::uint32_t x=0; xwidth; ++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 = "<performTemplatedAction (input_data); @@ -39,4 +39,4 @@ pcl::cloud_composer::TransformClouds::performAction (ConstItemList input_data, P qCritical () << "Transform requires templated types!"; return output; -} \ No newline at end of file +} diff --git a/apps/cloud_composer/tools/organized_segmentation.cpp b/apps/cloud_composer/tools/organized_segmentation.cpp index 1659d92b90d..2f8330e2a19 100644 --- a/apps/cloud_composer/tools/organized_segmentation.cpp +++ b/apps/cloud_composer/tools/organized_segmentation.cpp @@ -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 (input_data); diff --git a/apps/cloud_composer/tools/supervoxels.cpp b/apps/cloud_composer/tools/supervoxels.cpp index ad5815bea1b..6b9be7f5bb6 100644 --- a/apps/cloud_composer/tools/supervoxels.cpp +++ b/apps/cloud_composer/tools/supervoxels.cpp @@ -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 (input_data); diff --git a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/common_types.h b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/common_types.h index 3cdeb11c45a..f963aa9afda 100644 --- a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/common_types.h +++ b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/common_types.h @@ -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) diff --git a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/impl/common_types.hpp b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/impl/common_types.hpp index fdcd0758603..63d5d06de92 100644 --- a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/impl/common_types.hpp +++ b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/impl/common_types.hpp @@ -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 }; diff --git a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/integration.h b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/integration.h index b30fe0ebe16..c968777835a 100644 --- a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/integration.h +++ b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/integration.h @@ -167,7 +167,7 @@ namespace pcl using KdTreePtr = boost::shared_ptr; using KdTreeConstPtr = boost::shared_ptr; - 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. */ diff --git a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/visibility_confidence.h b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/visibility_confidence.h index 889cb5d5ea9..abc7327f8d7 100644 --- a/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/visibility_confidence.h +++ b/apps/in_hand_scanner/include/pcl/apps/in_hand_scanner/visibility_confidence.h @@ -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 diff --git a/apps/in_hand_scanner/src/integration.cpp b/apps/in_hand_scanner/src/integration.cpp index 4deff04a7ed..a47a92f4fb6 100644 --- a/apps/in_hand_scanner/src/integration.cpp +++ b/apps/in_hand_scanner/src/integration.cpp @@ -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 (val > 255.f ? 255 : val)); + return (static_cast (val > 255.f ? 255 : val)); } //////////////////////////////////////////////////////////////////////////////// diff --git a/apps/in_hand_scanner/src/visibility_confidence.cpp b/apps/in_hand_scanner/src/visibility_confidence.cpp index 761a234b42d..d0bda321ff8 100644 --- a/apps/in_hand_scanner/src/visibility_confidence.cpp +++ b/apps/in_hand_scanner/src/visibility_confidence.cpp @@ -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 (); @@ -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); diff --git a/apps/include/pcl/apps/vfh_nn_classifier.h b/apps/include/pcl/apps/vfh_nn_classifier.h index e32ad6b7e7d..b39ba4f1b1b 100644 --- a/apps/include/pcl/apps/vfh_nn_classifier.h +++ b/apps/include/pcl/apps/vfh_nn_classifier.h @@ -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 (training_features_->points.size ()); + training_features_->width = static_cast (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_; diff --git a/apps/modeler/include/pcl/apps/modeler/impl/scene_tree.hpp b/apps/modeler/include/pcl/apps/modeler/impl/scene_tree.hpp index 3e14eae9972..49821584c0d 100755 --- a/apps/modeler/include/pcl/apps/modeler/impl/scene_tree.hpp +++ b/apps/modeler/include/pcl/apps/modeler/impl/scene_tree.hpp @@ -62,4 +62,4 @@ namespace pcl } -#endif // PCL_MODELER_SCENE_TREE_IMPL_H_ \ No newline at end of file +#endif // PCL_MODELER_SCENE_TREE_IMPL_H_ diff --git a/apps/modeler/src/abstract_item.cpp b/apps/modeler/src/abstract_item.cpp index d36db5847c7..ef004f9883d 100755 --- a/apps/modeler/src/abstract_item.cpp +++ b/apps/modeler/src/abstract_item.cpp @@ -81,4 +81,4 @@ pcl::modeler::AbstractItem::showPropertyEditor() setProperties(); parameter_dialog->deleteLater(); -} \ No newline at end of file +} diff --git a/apps/modeler/src/cloud_mesh_item_updater.cpp b/apps/modeler/src/cloud_mesh_item_updater.cpp index 8716cab95ba..3bbe5c050bb 100755 --- a/apps/modeler/src/cloud_mesh_item_updater.cpp +++ b/apps/modeler/src/cloud_mesh_item_updater.cpp @@ -57,4 +57,4 @@ pcl::modeler::CloudMeshItemUpdater::updateCloudMeshItem() cloud_mesh_item_->updateChannels(); deleteLater(); -} \ No newline at end of file +} diff --git a/apps/modeler/src/main_window.cpp b/apps/modeler/src/main_window.cpp index 5fb0c1d4884..163ebd8a846 100755 --- a/apps/modeler/src/main_window.cpp +++ b/apps/modeler/src/main_window.cpp @@ -337,4 +337,4 @@ void pcl::modeler::MainWindow::slotOnWorkerFinished() { statusBar()->showMessage(QString("Working thread finished...")); -} \ No newline at end of file +} diff --git a/apps/modeler/src/parameter.cpp b/apps/modeler/src/parameter.cpp index 1a4eec9a55f..8d639d5f3d1 100755 --- a/apps/modeler/src/parameter.cpp +++ b/apps/modeler/src/parameter.cpp @@ -245,4 +245,4 @@ pcl::modeler::ColorParameter::toModelData() model_data.first = QBrush(QColor(*this)); model_data.second = Qt::BackgroundRole; return (model_data); -} \ No newline at end of file +} diff --git a/apps/modeler/src/thread_controller.cpp b/apps/modeler/src/thread_controller.cpp index d96dc9146c3..8a2693a79af 100755 --- a/apps/modeler/src/thread_controller.cpp +++ b/apps/modeler/src/thread_controller.cpp @@ -93,4 +93,4 @@ void pcl::modeler::ThreadController::slotOnCloudMeshItemUpdate(CloudMeshItem* cloud_mesh_item) { cloud_mesh_item->updateChannels(); -} \ No newline at end of file +} diff --git a/apps/modeler/src/voxel_grid_downsample_worker.cpp b/apps/modeler/src/voxel_grid_downsample_worker.cpp index 41a42fb4cab..6959e69dfcc 100755 --- a/apps/modeler/src/voxel_grid_downsample_worker.cpp +++ b/apps/modeler/src/voxel_grid_downsample_worker.cpp @@ -119,4 +119,4 @@ pcl::modeler::VoxelGridDownampleWorker::processImpl(CloudMeshItem* cloud_mesh_it emitDataUpdated(cloud_mesh_item); return; -} \ No newline at end of file +} diff --git a/apps/point_cloud_editor/src/cloudEditorWidget.cpp b/apps/point_cloud_editor/src/cloudEditorWidget.cpp index e87563baddd..d71d39c74d9 100644 --- a/apps/point_cloud_editor/src/cloudEditorWidget.cpp +++ b/apps/point_cloud_editor/src/cloudEditorWidget.cpp @@ -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; } diff --git a/apps/src/grabcut_2d.cpp b/apps/src/grabcut_2d.cpp index 30f866a42b7..6bb86589fe5 100644 --- a/apps/src/grabcut_2d.cpp +++ b/apps/src/grabcut_2d.cpp @@ -35,7 +35,7 @@ class GrabCutHelper : public pcl::GrabCut using Ptr = boost::shared_ptr; using ConstPtr = boost::shared_ptr; - GrabCutHelper (uint32_t K = 5, float lambda = 50.f) + GrabCutHelper (std::uint32_t K = 5, float lambda = 50.f) : pcl::GrabCut (K, lambda) {} @@ -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; @@ -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) diff --git a/apps/src/ni_linemod.cpp b/apps/src/ni_linemod.cpp index 0feaec2bc8a..d7aa54964af 100644 --- a/apps/src/ni_linemod.cpp +++ b/apps/src/ni_linemod.cpp @@ -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; diff --git a/apps/src/openni_organized_compression.cpp b/apps/src/openni_organized_compression.cpp index 0f7bd325c85..b645fb6d968 100644 --- a/apps/src/openni_organized_compression.cpp +++ b/apps/src/openni_organized_compression.cpp @@ -218,19 +218,19 @@ struct EventHelper const openni_wrapper::DepthImage::Ptr &depth_image, float) { - std::vector disparity_data; - std::vector rgb_data; + std::vector disparity_data; + std::vector 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 (width * sizeof (uint16_t))); + depth_image->fillDepthImageRaw (width, height, &disparity_data[0], static_cast (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 (width * sizeof (uint8_t) * 3)); + image->fillRGB(width, height, &rgb_data[0], static_cast (width * sizeof (std::uint8_t) * 3)); } organizedEncoder_->encodeRawDisparityMapWithColorImage (disparity_data, rgb_data, width, height, outputFile_, doColorEncoding_, bGrayScaleConversion_, bShowStatistics_, pngLevel_); diff --git a/apps/src/openni_organized_edge_detection.cpp b/apps/src/openni_organized_edge_detection.cpp index 91f780885aa..9083b4c050c 100644 --- a/apps/src/openni_organized_edge_detection.cpp +++ b/apps/src/openni_organized_edge_detection.cpp @@ -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; } diff --git a/apps/src/openni_shift_to_depth_conversion.cpp b/apps/src/openni_shift_to_depth_conversion.cpp index 4cc755089b6..949fed59b1b 100644 --- a/apps/src/openni_shift_to_depth_conversion.cpp +++ b/apps/src/openni_shift_to_depth_conversion.cpp @@ -81,17 +81,17 @@ class SimpleOpenNIViewer const openni_wrapper::DepthImage::Ptr &depth_image, float) { - std::vector raw_shift_data; - std::vector raw_depth_data; + std::vector raw_shift_data; + std::vector raw_depth_data; - std::vector rgb_data; + std::vector 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 (width * sizeof (uint16_t))); + depth_image->fillDepthImageRaw (width, height, &raw_shift_data[0], static_cast (width * sizeof (std::uint16_t))); // convert raw shift data to raw depth data raw_depth_data.resize(width*height); @@ -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 (width * sizeof (uint8_t) * 3)); + image->fillRGB(width, height, &rgb_data[0], static_cast (width * sizeof (std::uint8_t) * 3)); } // empty pointcloud @@ -155,8 +155,8 @@ class SimpleOpenNIViewer /* helper method to convert depth&rgb data to pointcloud*/ void - convert (std::vector& depthData_arg, - std::vector& rgbData_arg, + convert (std::vector& depthData_arg, + std::vector& rgbData_arg, size_t width_arg, size_t height_arg, float focalLength_arg, @@ -169,8 +169,8 @@ class SimpleOpenNIViewer cloud_arg.points.reserve (cloud_size); // Define point cloud parameters - cloud_arg.width = static_cast (width_arg); - cloud_arg.height = static_cast (height_arg); + cloud_arg.width = static_cast (width_arg); + cloud_arg.height = static_cast (height_arg); cloud_arg.is_dense = false; // Calculate center of disparity image @@ -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) { diff --git a/apps/src/openni_tracking.cpp b/apps/src/openni_tracking.cpp index e23e81efc5c..97df8a29719 100644 --- a/apps/src/openni_tracking.cpp +++ b/apps/src/openni_tracking.cpp @@ -485,7 +485,7 @@ class OpenNISegmentTracking result.points.push_back(point); } - result.width = static_cast (result.points.size ()); + result.width = static_cast (result.points.size ()); result.height = 1; result.is_dense = true; } @@ -501,7 +501,7 @@ class OpenNISegmentTracking PointType point = cloud->points[index]; result.points.push_back (point); } - result.width = pcl::uint32_t (result.points.size ()); + result.width = std::uint32_t (result.points.size ()); result.height = 1; result.is_dense = true; } diff --git a/apps/src/pcd_organized_edge_detection.cpp b/apps/src/pcd_organized_edge_detection.cpp index 5a58d62d1f8..f6c59b6112f 100644 --- a/apps/src/pcd_organized_edge_detection.cpp +++ b/apps/src/pcd_organized_edge_detection.cpp @@ -170,7 +170,7 @@ compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output // Make gray point clouds for (auto &point : cloud->points) { - uint8_t gray = 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; } diff --git a/apps/src/pcd_select_object_plane.cpp b/apps/src/pcd_select_object_plane.cpp index 97d56ce077e..e6cef7c96e9 100644 --- a/apps/src/pcd_select_object_plane.cpp +++ b/apps/src/pcd_select_object_plane.cpp @@ -438,7 +438,7 @@ class ObjectSelection if (image_viewer_) { // 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 = height - indices[0] / width, u = indices[0] % width; @@ -543,7 +543,7 @@ class ObjectSelection int poff = fields[rgba_index].offset; // BGR to RGB rgb_data_ = new unsigned char [cloud_->width * cloud_->height * 3]; - for (uint32_t i = 0; i < cloud_->width * cloud_->height; ++i) + for (std::uint32_t i = 0; i < cloud_->width * cloud_->height; ++i) { RGB rgb; memcpy (&rgb, reinterpret_cast (&cloud_->points[i]) + poff, sizeof (rgb)); diff --git a/apps/src/stereo_ground_segmentation.cpp b/apps/src/stereo_ground_segmentation.cpp index ee45a67eb26..9c4701f4cd0 100755 --- a/apps/src/stereo_ground_segmentation.cpp +++ b/apps/src/stereo_ground_segmentation.cpp @@ -276,7 +276,7 @@ class HRCSSegmentation cloud->points[region_index.indices[j]].y, cloud->points[region_index.indices[j]].z); ground_cloud->points.push_back (ground_pt); - ground_image->points[region_index.indices[j]].g = static_cast ((cloud->points[region_index.indices[j]].g + 255) / 2); + ground_image->points[region_index.indices[j]].g = static_cast ((cloud->points[region_index.indices[j]].g + 255) / 2); label_image->points[region_index.indices[j]].r = 0; label_image->points[region_index.indices[j]].g = 255; label_image->points[region_index.indices[j]].b = 0; @@ -364,8 +364,8 @@ class HRCSSegmentation cloud->points[region_index.indices[j]].y, cloud->points[region_index.indices[j]].z); ground_cloud->points.push_back (ground_pt); - ground_image->points[region_index.indices[j]].r = static_cast ((cloud->points[region_index.indices[j]].r + 255) / 2); - ground_image->points[region_index.indices[j]].g = static_cast ((cloud->points[region_index.indices[j]].g + 255) / 2); + ground_image->points[region_index.indices[j]].r = static_cast ((cloud->points[region_index.indices[j]].r + 255) / 2); + ground_image->points[region_index.indices[j]].g = static_cast ((cloud->points[region_index.indices[j]].g + 255) / 2); label_image->points[region_index.indices[j]].r = 128; label_image->points[region_index.indices[j]].g = 128; label_image->points[region_index.indices[j]].b = 0; @@ -446,7 +446,7 @@ class HRCSSegmentation { if (!pcl::isFinite (cloud->points[i])) { - ground_image->points[i].b = static_cast((cloud->points[i].b + 255) / 2); + ground_image->points[i].b = static_cast((cloud->points[i].b + 255) / 2); label_image->points[i].r = 0; label_image->points[i].g = 0; label_image->points[i].b = 255; diff --git a/common/include/pcl/PCLHeader.h b/common/include/pcl/PCLHeader.h index 96d681f830b..11f9deddb5b 100644 --- a/common/include/pcl/PCLHeader.h +++ b/common/include/pcl/PCLHeader.h @@ -18,12 +18,12 @@ namespace pcl {} /** \brief Sequence number */ - pcl::uint32_t seq; + std::uint32_t seq; /** \brief A timestamp associated with the time when the data was acquired * * The value represents microseconds since 1970-01-01 00:00:00 (the UNIX epoch). */ - pcl::uint64_t stamp; + std::uint64_t stamp; /** \brief Coordinate frame ID */ std::string frame_id; diff --git a/common/include/pcl/PCLImage.h b/common/include/pcl/PCLImage.h index 13ec16384d5..3d06491c526 100644 --- a/common/include/pcl/PCLImage.h +++ b/common/include/pcl/PCLImage.h @@ -21,14 +21,14 @@ namespace pcl ::pcl::PCLHeader header; - pcl::uint32_t height; - pcl::uint32_t width; + std::uint32_t height; + std::uint32_t width; std::string encoding; - pcl::uint8_t is_bigendian; - pcl::uint32_t step; + std::uint8_t is_bigendian; + std::uint32_t step; - std::vector data; + std::vector data; using Ptr = boost::shared_ptr< ::pcl::PCLImage>; using ConstPtr = boost::shared_ptr; diff --git a/common/include/pcl/PCLPointCloud2.h b/common/include/pcl/PCLPointCloud2.h index 3ab9ac414d3..14d9bd122e5 100644 --- a/common/include/pcl/PCLPointCloud2.h +++ b/common/include/pcl/PCLPointCloud2.h @@ -33,18 +33,18 @@ namespace pcl ::pcl::PCLHeader header; - pcl::uint32_t height; - pcl::uint32_t width; + std::uint32_t height; + std::uint32_t width; std::vector< ::pcl::PCLPointField> fields; - pcl::uint8_t is_bigendian; - pcl::uint32_t point_step; - pcl::uint32_t row_step; + std::uint8_t is_bigendian; + std::uint32_t point_step; + std::uint32_t row_step; - std::vector data; + std::vector data; - pcl::uint8_t is_dense; + std::uint8_t is_dense; public: using Ptr = boost::shared_ptr< ::pcl::PCLPointCloud2>; diff --git a/common/include/pcl/PCLPointField.h b/common/include/pcl/PCLPointField.h index e285bc6c4e2..ea6ec61a627 100644 --- a/common/include/pcl/PCLPointField.h +++ b/common/include/pcl/PCLPointField.h @@ -19,9 +19,9 @@ namespace pcl std::string name; - pcl::uint32_t offset; - pcl::uint8_t datatype; - pcl::uint32_t count; + std::uint32_t offset; + std::uint8_t datatype; + std::uint32_t count; enum PointFieldTypes { INT8 = 1, UINT8 = 2, diff --git a/common/include/pcl/Vertices.h b/common/include/pcl/Vertices.h index 94858062ec1..c3042c1edd0 100644 --- a/common/include/pcl/Vertices.h +++ b/common/include/pcl/Vertices.h @@ -16,7 +16,7 @@ namespace pcl Vertices () {} - std::vector vertices; + std::vector vertices; public: using Ptr = boost::shared_ptr; diff --git a/common/include/pcl/common/centroid.h b/common/include/pcl/common/centroid.h index 9dc0a3d0c6a..8fde539b9b9 100644 --- a/common/include/pcl/common/centroid.h +++ b/common/include/pcl/common/centroid.h @@ -850,7 +850,7 @@ namespace pcl template inline void operator() () { using T = typename pcl::traits::datatype::type; - const uint8_t* raw_ptr = reinterpret_cast(&p_) + pcl::traits::offset::value; + const std::uint8_t* raw_ptr = reinterpret_cast(&p_) + pcl::traits::offset::value; const T* data_ptr = reinterpret_cast(raw_ptr); // Check if the value is invalid diff --git a/common/include/pcl/common/concatenate.h b/common/include/pcl/common/concatenate.h index 07727da84fc..5abc2326c31 100644 --- a/common/include/pcl/common/concatenate.h +++ b/common/include/pcl/common/concatenate.h @@ -68,8 +68,8 @@ namespace pcl BOOST_MPL_ASSERT_MSG ((std::is_same::value), POINT_IN_AND_POINT_OUT_HAVE_DIFFERENT_TYPES_FOR_FIELD, (Key, PointInT&, InT, PointOutT&, OutT)); - memcpy (reinterpret_cast(&p2_) + pcl::traits::offset::value, - reinterpret_cast(&p1_) + pcl::traits::offset::value, + memcpy (reinterpret_cast(&p2_) + pcl::traits::offset::value, + reinterpret_cast(&p1_) + pcl::traits::offset::value, sizeof (InT)); } diff --git a/common/include/pcl/common/impl/accumulators.hpp b/common/include/pcl/common/impl/accumulators.hpp index f7c1b92f9ba..cbf762e4500 100644 --- a/common/include/pcl/common/impl/accumulators.hpp +++ b/common/include/pcl/common/impl/accumulators.hpp @@ -160,10 +160,10 @@ namespace pcl template void get (PointT& t, std::size_t n) const { - t.rgba = static_cast (a / n) << 24 | - static_cast (r / n) << 16 | - static_cast (g / n) << 8 | - static_cast (b / n); + t.rgba = static_cast (a / n) << 24 | + static_cast (r / n) << 16 | + static_cast (g / n) << 8 | + static_cast (b / n); } }; @@ -195,7 +195,7 @@ namespace pcl // Storage // A better performance may be achieved with a heap structure - std::map labels; + std::map labels; AccumulatorLabel () { } diff --git a/common/include/pcl/common/impl/centroid.hpp b/common/include/pcl/common/impl/centroid.hpp index a737b52e73d..65a8d4c1130 100644 --- a/common/include/pcl/common/impl/centroid.hpp +++ b/common/include/pcl/common/impl/centroid.hpp @@ -686,7 +686,7 @@ pcl::demeanPointCloud (const pcl::PointCloud &cloud_in, } else { - cloud_out.width = static_cast (indices.size ()); + cloud_out.width = static_cast (indices.size ()); cloud_out.height = 1; } cloud_out.resize (indices.size ()); diff --git a/common/include/pcl/common/impl/copy_point.hpp b/common/include/pcl/common/impl/copy_point.hpp index 0f08ebfe6d1..a168226280d 100644 --- a/common/include/pcl/common/impl/copy_point.hpp +++ b/common/include/pcl/common/impl/copy_point.hpp @@ -117,10 +117,10 @@ namespace pcl using FieldListInT = typename pcl::traits::fieldList::type; using FieldListOutT = typename pcl::traits::fieldList::type; using FieldList = typename pcl::intersect::type; - const uint32_t offset_in = boost::mpl::if_, + const std::uint32_t offset_in = boost::mpl::if_, pcl::traits::offset, pcl::traits::offset >::type::value; - const uint32_t offset_out = boost::mpl::if_, + const std::uint32_t offset_out = boost::mpl::if_, pcl::traits::offset, pcl::traits::offset >::type::value; pcl::for_each_type (pcl::NdConcatenateFunctor (point_in, point_out)); diff --git a/common/include/pcl/common/impl/eigen.hpp b/common/include/pcl/common/impl/eigen.hpp index a9444ac0268..cca8a3c23c2 100644 --- a/common/include/pcl/common/impl/eigen.hpp +++ b/common/include/pcl/common/impl/eigen.hpp @@ -703,11 +703,11 @@ pcl::getTransformation (Scalar x, Scalar y, Scalar z, template void pcl::saveBinary (const Eigen::MatrixBase& matrix, std::ostream& file) { - uint32_t rows = static_cast (matrix.rows ()), cols = static_cast (matrix.cols ()); + std::uint32_t rows = static_cast (matrix.rows ()), cols = static_cast (matrix.cols ()); file.write (reinterpret_cast (&rows), sizeof (rows)); file.write (reinterpret_cast (&cols), sizeof (cols)); - for (uint32_t i = 0; i < rows; ++i) - for (uint32_t j = 0; j < cols; ++j) + for (std::uint32_t i = 0; i < rows; ++i) + for (std::uint32_t j = 0; j < cols; ++j) { typename Derived::Scalar tmp = matrix(i,j); file.write (reinterpret_cast (&tmp), sizeof (tmp)); @@ -720,14 +720,14 @@ pcl::loadBinary (Eigen::MatrixBase const & matrix_, std::istream& file) { Eigen::MatrixBase &matrix = const_cast &> (matrix_); - uint32_t rows, cols; + std::uint32_t rows, cols; file.read (reinterpret_cast (&rows), sizeof (rows)); file.read (reinterpret_cast (&cols), sizeof (cols)); if (matrix.rows () != static_cast(rows) || matrix.cols () != static_cast(cols)) matrix.derived().resize(rows, cols); - for (uint32_t i = 0; i < rows; ++i) - for (uint32_t j = 0; j < cols; ++j) + for (std::uint32_t i = 0; i < rows; ++i) + for (std::uint32_t j = 0; j < cols; ++j) { typename Derived::Scalar tmp; file.read (reinterpret_cast (&tmp), sizeof (tmp)); diff --git a/common/include/pcl/common/impl/intensity.hpp b/common/include/pcl/common/impl/intensity.hpp index f9e76d9a4ab..92c33a5a4de 100644 --- a/common/include/pcl/common/impl/intensity.hpp +++ b/common/include/pcl/common/impl/intensity.hpp @@ -132,9 +132,9 @@ namespace pcl inline void set (pcl::PointXYZRGB &p, float intensity) const { - p.r = static_cast (intensity * 3.34448160535f); // 1000 / 299 - p.g = static_cast (intensity * 1.70357751278f); // 1000 / 587 - p.b = static_cast (intensity * 8.77192982456f); // 1000 / 114 + p.r = static_cast (intensity * 3.34448160535f); // 1000 / 299 + p.g = static_cast (intensity * 1.70357751278f); // 1000 / 587 + p.b = static_cast (intensity * 8.77192982456f); // 1000 / 114 } inline void @@ -172,9 +172,9 @@ namespace pcl inline void set (pcl::PointXYZRGBA &p, float intensity) const { - p.r = static_cast (intensity * 3.34448160535f); // 1000 / 299 - p.g = static_cast (intensity * 1.70357751278f); // 1000 / 587 - p.b = static_cast (intensity * 8.77192982456f); // 1000 / 114 + p.r = static_cast (intensity * 3.34448160535f); // 1000 / 299 + p.g = static_cast (intensity * 1.70357751278f); // 1000 / 587 + p.b = static_cast (intensity * 8.77192982456f); // 1000 / 114 } inline void @@ -212,9 +212,9 @@ namespace pcl inline void set (pcl::PointXYZRGBNormal &p, float intensity) const { - p.r = static_cast (intensity * 3.34448160535f); // 1000 / 299 - p.g = static_cast (intensity * 1.70357751278f); // 1000 / 587 - p.b = static_cast (intensity * 8.77192982456f); // 1000 / 114 + p.r = static_cast (intensity * 3.34448160535f); // 1000 / 299 + p.g = static_cast (intensity * 1.70357751278f); // 1000 / 587 + p.b = static_cast (intensity * 8.77192982456f); // 1000 / 114 } inline void @@ -252,9 +252,9 @@ namespace pcl inline void set (pcl::PointXYZRGBL &p, float intensity) const { - p.r = static_cast (intensity * 3.34448160535f); // 1000 / 299 - p.g = static_cast (intensity * 1.70357751278f); // 1000 / 587 - p.b = static_cast (intensity * 8.77192982456f); // 1000 / 114 + p.r = static_cast (intensity * 3.34448160535f); // 1000 / 299 + p.g = static_cast (intensity * 1.70357751278f); // 1000 / 587 + p.b = static_cast (intensity * 8.77192982456f); // 1000 / 114 } inline void @@ -327,20 +327,20 @@ namespace pcl inline void set (pcl::PointXYZL &p, float intensity) const { - p.label = static_cast(intensity); + p.label = static_cast(intensity); } inline void demean (pcl::PointXYZL& p, float value) const { - p.label -= static_cast(value); + p.label -= static_cast(value); } inline void add (pcl::PointXYZL& p, float value) const { - p.label += static_cast(value); + p.label += static_cast(value); } }; @@ -362,20 +362,20 @@ namespace pcl inline void set (pcl::PointXYZLNormal &p, float intensity) const { - p.label = static_cast(intensity); + p.label = static_cast(intensity); } inline void demean (pcl::PointXYZLNormal& p, float value) const { - p.label -= static_cast(value); + p.label -= static_cast(value); } inline void add (pcl::PointXYZLNormal& p, float value) const { - p.label += static_cast(value); + p.label += static_cast(value); } }; diff --git a/common/include/pcl/common/impl/io.hpp b/common/include/pcl/common/impl/io.hpp index 19dd00043ce..9bb16c60e6f 100644 --- a/common/include/pcl/common/impl/io.hpp +++ b/common/include/pcl/common/impl/io.hpp @@ -155,7 +155,7 @@ pcl::copyPointCloud (const pcl::PointCloud &cloud_in, // Allocate enough space and copy the basics cloud_out.points.resize (indices.size ()); cloud_out.header = cloud_in.header; - cloud_out.width = static_cast(indices.size ()); + cloud_out.width = static_cast(indices.size ()); cloud_out.height = 1; cloud_out.is_dense = cloud_in.is_dense; cloud_out.sensor_orientation_ = cloud_in.sensor_orientation_; @@ -175,7 +175,7 @@ pcl::copyPointCloud (const pcl::PointCloud &cloud_in, // Allocate enough space and copy the basics cloud_out.points.resize (indices.size ()); cloud_out.header = cloud_in.header; - cloud_out.width = uint32_t (indices.size ()); + cloud_out.width = std::uint32_t (indices.size ()); cloud_out.height = 1; cloud_out.is_dense = cloud_in.is_dense; cloud_out.sensor_orientation_ = cloud_in.sensor_orientation_; @@ -365,7 +365,7 @@ pcl::copyPointCloud (const pcl::PointCloud &cloud_in, pcl::PointCloud &cloud_in, pcl::PointCloud &cloud_in, pcl::PointCloud -pcl::common::UniformGenerator::UniformGenerator(T min, T max, pcl::uint32_t seed) +pcl::common::UniformGenerator::UniformGenerator(T min, T max, std::uint32_t seed) : distribution_ (min, max) { parameters_ = Parameters (min, max, seed); - if(parameters_.seed != static_cast (-1)) + if(parameters_.seed != static_cast (-1)) rng_.seed (seed); } @@ -57,15 +57,15 @@ pcl::common::UniformGenerator::UniformGenerator(const Parameters& parameters) : parameters_ (parameters) , distribution_ (parameters_.min, parameters_.max) { - if(parameters_.seed != static_cast (-1)) + if(parameters_.seed != static_cast (-1)) rng_.seed (parameters_.seed); } ///////////////////////////////////////////////////////////////////////////////////////////////////////// template void -pcl::common::UniformGenerator::setSeed (pcl::uint32_t seed) +pcl::common::UniformGenerator::setSeed (std::uint32_t seed) { - if (seed != static_cast (-1)) + if (seed != static_cast (-1)) { parameters_.seed = seed; rng_.seed(parameters_.seed); @@ -74,7 +74,7 @@ pcl::common::UniformGenerator::setSeed (pcl::uint32_t seed) ///////////////////////////////////////////////////////////////////////////////////////////////////////// template void -pcl::common::UniformGenerator::setParameters (T min, T max, pcl::uint32_t seed) +pcl::common::UniformGenerator::setParameters (T min, T max, std::uint32_t seed) { parameters_.min = min; parameters_.max = max; @@ -82,7 +82,7 @@ pcl::common::UniformGenerator::setParameters (T min, T max, pcl::uint32_t see typename DistributionType::param_type params (parameters_.min, parameters_.max); distribution_.param (params); distribution_.reset (); - if (seed != static_cast (-1)) + if (seed != static_cast (-1)) { parameters_.seed = seed; rng_.seed (parameters_.seed); @@ -97,17 +97,17 @@ pcl::common::UniformGenerator::setParameters (const Parameters& parameters) typename DistributionType::param_type params (parameters_.min, parameters_.max); distribution_.param (params); distribution_.reset (); - if (parameters_.seed != static_cast (-1)) + if (parameters_.seed != static_cast (-1)) rng_.seed (parameters_.seed); } ///////////////////////////////////////////////////////////////////////////////////////////////////////// template -pcl::common::NormalGenerator::NormalGenerator(T mean, T sigma, pcl::uint32_t seed) +pcl::common::NormalGenerator::NormalGenerator(T mean, T sigma, std::uint32_t seed) : distribution_ (mean, sigma) { parameters_ = Parameters (mean, sigma, seed); - if(parameters_.seed != static_cast (-1)) + if(parameters_.seed != static_cast (-1)) rng_.seed (seed); } @@ -118,15 +118,15 @@ pcl::common::NormalGenerator::NormalGenerator(const Parameters& parameters) : parameters_ (parameters) , distribution_ (parameters_.mean, parameters_.sigma) { - if(parameters_.seed != static_cast (-1)) + if(parameters_.seed != static_cast (-1)) rng_.seed (parameters_.seed); } ///////////////////////////////////////////////////////////////////////////////////////////////////////// template void -pcl::common::NormalGenerator::setSeed (pcl::uint32_t seed) +pcl::common::NormalGenerator::setSeed (std::uint32_t seed) { - if (seed != static_cast (-1)) + if (seed != static_cast (-1)) { parameters_.seed = seed; rng_.seed(seed); @@ -135,7 +135,7 @@ pcl::common::NormalGenerator::setSeed (pcl::uint32_t seed) ///////////////////////////////////////////////////////////////////////////////////////////////////////// template void -pcl::common::NormalGenerator::setParameters (T mean, T sigma, pcl::uint32_t seed) +pcl::common::NormalGenerator::setParameters (T mean, T sigma, std::uint32_t seed) { parameters_.mean = mean; parameters_.sigma = sigma; @@ -143,7 +143,7 @@ pcl::common::NormalGenerator::setParameters (T mean, T sigma, pcl::uint32_t s typename DistributionType::param_type params (parameters_.mean, parameters_.sigma); distribution_.param (params); distribution_.reset (); - if (seed != static_cast (-1)) + if (seed != static_cast (-1)) rng_.seed (parameters_.seed); } @@ -155,7 +155,7 @@ pcl::common::NormalGenerator::setParameters (const Parameters& parameters) typename DistributionType::param_type params (parameters_.mean, parameters_.sigma); distribution_.param (params); distribution_.reset (); - if (parameters_.seed != static_cast (-1)) + if (parameters_.seed != static_cast (-1)) rng_.seed (parameters_.seed); } diff --git a/common/include/pcl/common/impl/spring.hpp b/common/include/pcl/common/impl/spring.hpp index 91de3809d60..c8a549fa1eb 100644 --- a/common/include/pcl/common/impl/spring.hpp +++ b/common/include/pcl/common/impl/spring.hpp @@ -54,9 +54,9 @@ pcl::common::expandColumns (const PointCloud& input, PointCloud& "[pcl::common::expandColumns] error: " << "columns expansion requires organised point cloud"); - uint32_t old_height = input.height; - uint32_t old_width = input.width; - uint32_t new_width = old_width + 2*amount; + std::uint32_t old_height = input.height; + std::uint32_t old_width = input.width; + std::uint32_t new_width = old_width + 2*amount; if (&input != &output) output = input; output.reserve (new_width * old_height); @@ -81,9 +81,9 @@ pcl::common::expandRows (const PointCloud& input, PointCloud& ou "[pcl::common::expandRows] error: amount must be ]0.." << (input.height/2) << "] !"); - uint32_t old_height = input.height; - uint32_t new_height = old_height + 2*amount; - uint32_t old_width = input.width; + std::uint32_t old_height = input.height; + std::uint32_t new_height = old_height + 2*amount; + std::uint32_t old_width = input.width; if (&input != &output) output = input; output.reserve (new_height * old_width); @@ -135,9 +135,9 @@ pcl::common::duplicateRows (const PointCloud& input, PointCloud& "[pcl::common::duplicateRows] error: amount must be ]0.." << (input.height/2) << "] !"); - uint32_t old_height = input.height; - uint32_t new_height = old_height + 2*amount; - uint32_t old_width = input.width; + std::uint32_t old_height = input.height; + std::uint32_t new_height = old_height + 2*amount; + std::uint32_t old_width = input.width; if (&input != &output) output = input; output.reserve (new_height * old_width); @@ -192,9 +192,9 @@ pcl::common::mirrorRows (const PointCloud& input, PointCloud& ou "[pcl::common::mirrorRows] error: amount must be ]0.." << (input.height/2) << "] !"); - uint32_t old_height = input.height; - uint32_t new_height = old_height + 2*amount; - uint32_t old_width = input.width; + std::uint32_t old_height = input.height; + std::uint32_t new_height = old_height + 2*amount; + std::uint32_t old_width = input.width; if (&input != &output) output = input; output.reserve (new_height * old_width); @@ -219,8 +219,8 @@ pcl::common::deleteRows (const PointCloud& input, PointCloud& ou "[pcl::common::deleteRows] error: amount must be ]0.." << (input.height/2) << "] !"); - uint32_t old_height = input.height; - uint32_t old_width = input.width; + std::uint32_t old_height = input.height; + std::uint32_t old_width = input.width; output.erase (output.begin (), output.begin () + amount * old_width); output.erase (output.end () - amount * old_width, output.end ()); output.height = old_height - 2*amount; @@ -241,9 +241,9 @@ pcl::common::deleteCols (const PointCloud& input, PointCloud& ou "[pcl::common::deleteCols] error: " << "columns delete requires organised point cloud"); - uint32_t old_height = input.height; - uint32_t old_width = input.width; - uint32_t new_width = old_width - 2 * amount; + std::uint32_t old_height = input.height; + std::uint32_t old_width = input.width; + std::uint32_t new_width = old_width - 2 * amount; for(std::size_t j = 0; j < old_height; j++) { typename PointCloud::iterator start = output.begin () + j * new_width; diff --git a/common/include/pcl/common/random.h b/common/include/pcl/common/random.h index 2838823a1f1..6262172b9e1 100644 --- a/common/include/pcl/common/random.h +++ b/common/include/pcl/common/random.h @@ -80,7 +80,7 @@ namespace pcl public: struct Parameters { - Parameters (T _min = 0, T _max = 1, pcl::uint32_t _seed = 1) + Parameters (T _min = 0, T _max = 1, std::uint32_t _seed = 1) : min (_min) , max (_max) , seed (_seed) @@ -88,7 +88,7 @@ namespace pcl T min; T max; - pcl::uint32_t seed; + std::uint32_t seed; }; /** Constructor @@ -96,7 +96,7 @@ namespace pcl * \param max: included higher bound * \param seed: seeding value */ - UniformGenerator(T min = 0, T max = 1, pcl::uint32_t seed = -1); + UniformGenerator(T min = 0, T max = 1, std::uint32_t seed = -1); /** Constructor * \param parameters uniform distribution parameters and generator seed @@ -107,7 +107,7 @@ namespace pcl * \param[in] seed new generator seed value */ void - setSeed (pcl::uint32_t seed); + setSeed (std::uint32_t seed); /** Set the uniform number generator parameters * \param[in] min minimum allowed value @@ -115,7 +115,7 @@ namespace pcl * \param[in] seed random number generator seed (applied if != -1) */ void - setParameters (T min, T max, pcl::uint32_t seed = -1); + setParameters (T min, T max, std::uint32_t seed = -1); /** Set generator parameters * \param parameters uniform distribution parameters and generator seed @@ -152,7 +152,7 @@ namespace pcl public: struct Parameters { - Parameters (T _mean = 0, T _sigma = 1, pcl::uint32_t _seed = 1) + Parameters (T _mean = 0, T _sigma = 1, std::uint32_t _seed = 1) : mean (_mean) , sigma (_sigma) , seed (_seed) @@ -160,7 +160,7 @@ namespace pcl T mean; T sigma; - pcl::uint32_t seed; + std::uint32_t seed; }; /** Constructor @@ -168,7 +168,7 @@ namespace pcl * \param[in] sigma normal variation * \param[in] seed seeding value */ - NormalGenerator(T mean = 0, T sigma = 1, pcl::uint32_t seed = -1); + NormalGenerator(T mean = 0, T sigma = 1, std::uint32_t seed = -1); /** Constructor * \param parameters normal distribution parameters and seed @@ -179,7 +179,7 @@ namespace pcl * \param[in] seed new seed value */ void - setSeed (pcl::uint32_t seed); + setSeed (std::uint32_t seed); /** Set the normal number generator parameters * \param[in] mean mean of the normal distribution @@ -187,7 +187,7 @@ namespace pcl * \param[in] seed random number generator seed (applied if != -1) */ void - setParameters (T mean, T sigma, pcl::uint32_t seed = -1); + setParameters (T mean, T sigma, std::uint32_t seed = -1); /** Set generator parameters * \param parameters normal distribution parameters and seed diff --git a/common/include/pcl/conversions.h b/common/include/pcl/conversions.h index 45b5e670ba1..041b7205f8d 100644 --- a/common/include/pcl/conversions.h +++ b/common/include/pcl/conversions.h @@ -175,9 +175,9 @@ namespace pcl cloud.is_dense = msg.is_dense == 1; // Copy point data - uint32_t num_points = msg.width * msg.height; + std::uint32_t num_points = msg.width * msg.height; cloud.points.resize (num_points); - uint8_t* cloud_data = reinterpret_cast(&cloud.points[0]); + std::uint8_t* cloud_data = reinterpret_cast(&cloud.points[0]); // Check if we can copy adjacent points in a single memcpy. We can do so if there // is exactly one field to copy and it is the same size as the source and destination @@ -188,8 +188,8 @@ namespace pcl field_map[0].size == msg.point_step && field_map[0].size == sizeof(PointT)) { - uint32_t cloud_row_step = static_cast (sizeof (PointT) * cloud.width); - const uint8_t* msg_data = &msg.data[0]; + std::uint32_t cloud_row_step = static_cast (sizeof (PointT) * cloud.width); + const std::uint8_t* msg_data = &msg.data[0]; // Should usually be able to copy all rows at once if (msg.row_step == cloud_row_step) { @@ -197,7 +197,7 @@ namespace pcl } else { - for (uint32_t i = 0; i < msg.height; ++i, cloud_data += cloud_row_step, msg_data += msg.row_step) + for (std::uint32_t i = 0; i < msg.height; ++i, cloud_data += cloud_row_step, msg_data += msg.row_step) memcpy (cloud_data, msg_data, cloud_row_step); } @@ -205,12 +205,12 @@ namespace pcl else { // If not, memcpy each group of contiguous fields separately - for (uint32_t row = 0; row < msg.height; ++row) + for (std::uint32_t row = 0; row < msg.height; ++row) { - const uint8_t* row_data = &msg.data[row * msg.row_step]; - for (uint32_t col = 0; col < msg.width; ++col) + const std::uint8_t* row_data = &msg.data[row * msg.row_step]; + for (std::uint32_t col = 0; col < msg.width; ++col) { - const uint8_t* msg_data = row_data + col * msg.point_step; + const std::uint8_t* msg_data = row_data + col * msg.point_step; for (const detail::FieldMapping& mapping : field_map) { memcpy (cloud_data + mapping.struct_offset, msg_data + mapping.serialized_offset, mapping.size); @@ -243,7 +243,7 @@ namespace pcl // Ease the user's burden on specifying width/height for unorganized datasets if (cloud.width == 0 && cloud.height == 0) { - msg.width = static_cast(cloud.points.size ()); + msg.width = static_cast(cloud.points.size ()); msg.height = 1; } else @@ -267,7 +267,7 @@ namespace pcl msg.header = cloud.header; msg.point_step = sizeof (PointT); - msg.row_step = static_cast (sizeof (PointT) * msg.width); + msg.row_step = static_cast (sizeof (PointT) * msg.width); msg.is_dense = cloud.is_dense; /// @todo msg.is_bigendian = ?; } @@ -294,14 +294,14 @@ namespace pcl // ensor_msgs::image_encodings::BGR8; msg.encoding = "bgr8"; - msg.step = msg.width * sizeof (uint8_t) * 3; + msg.step = msg.width * sizeof (std::uint8_t) * 3; msg.data.resize (msg.step * msg.height); for (std::size_t y = 0; y < cloud.height; y++) { for (std::size_t x = 0; x < cloud.width; x++) { - uint8_t * pixel = &(msg.data[y * msg.step + x * 3]); - memcpy (pixel, &cloud (x, y).rgb, 3 * sizeof(uint8_t)); + std::uint8_t * pixel = &(msg.data[y * msg.step + x * 3]); + memcpy (pixel, &cloud (x, y).rgb, 3 * sizeof(std::uint8_t)); } } } @@ -332,15 +332,15 @@ namespace pcl // pcl::image_encodings::BGR8; msg.encoding = "bgr8"; - msg.step = static_cast(msg.width * sizeof (uint8_t) * 3); + msg.step = static_cast(msg.width * sizeof (std::uint8_t) * 3); msg.data.resize (msg.step * msg.height); for (std::size_t y = 0; y < cloud.height; y++) { for (std::size_t x = 0; x < cloud.width; x++, rgb_offset += point_step) { - uint8_t * pixel = &(msg.data[y * msg.step + x * 3]); - memcpy (pixel, &(cloud.data[rgb_offset]), 3 * sizeof (uint8_t)); + std::uint8_t * pixel = &(msg.data[y * msg.step + x * 3]); + memcpy (pixel, &(cloud.data[rgb_offset]), 3 * sizeof (std::uint8_t)); } } } diff --git a/common/include/pcl/impl/point_types.hpp b/common/include/pcl/impl/point_types.hpp index 228558e5a5b..a3ce90660d7 100644 --- a/common/include/pcl/impl/point_types.hpp +++ b/common/include/pcl/impl/point_types.hpp @@ -173,10 +173,10 @@ namespace pcl using Vector4fMap = Eigen::Map; using Vector4fMapConst = const Eigen::Map; - using Vector3c = Eigen::Matrix; + using Vector3c = Eigen::Matrix; using Vector3cMap = Eigen::Map; using Vector3cMapConst = const Eigen::Map; - using Vector4c = Eigen::Matrix; + using Vector4c = Eigen::Matrix; using Vector4cMap = Eigen::Map; using Vector4cMapConst = const Eigen::Map; @@ -232,14 +232,14 @@ namespace pcl { \ struct \ { \ - uint8_t b; \ - uint8_t g; \ - uint8_t r; \ - uint8_t a; \ + std::uint8_t b; \ + std::uint8_t g; \ + std::uint8_t r; \ + std::uint8_t a; \ }; \ float rgb; \ }; \ - uint32_t rgba; \ + std::uint32_t rgba; \ }; #define PCL_ADD_EIGEN_MAPS_RGB \ @@ -249,10 +249,10 @@ namespace pcl inline const Eigen::Vector4i getRGBVector4i () const { return (Eigen::Vector4i (r, g, b, a)); } \ inline Eigen::Vector4i getRGBAVector4i () { return (Eigen::Vector4i (r, g, b, a)); } \ inline const Eigen::Vector4i getRGBAVector4i () const { return (Eigen::Vector4i (r, g, b, a)); } \ - inline pcl::Vector3cMap getBGRVector3cMap () { return (pcl::Vector3cMap (reinterpret_cast (&rgba))); } \ - inline pcl::Vector3cMapConst getBGRVector3cMap () const { return (pcl::Vector3cMapConst (reinterpret_cast (&rgba))); } \ - inline pcl::Vector4cMap getBGRAVector4cMap () { return (pcl::Vector4cMap (reinterpret_cast (&rgba))); } \ - inline pcl::Vector4cMapConst getBGRAVector4cMap () const { return (pcl::Vector4cMapConst (reinterpret_cast (&rgba))); } + inline pcl::Vector3cMap getBGRVector3cMap () { return (pcl::Vector3cMap (reinterpret_cast (&rgba))); } \ + inline pcl::Vector3cMapConst getBGRVector3cMap () const { return (pcl::Vector3cMapConst (reinterpret_cast (&rgba))); } \ + inline pcl::Vector4cMap getBGRAVector4cMap () { return (pcl::Vector4cMap (reinterpret_cast (&rgba))); } \ + inline pcl::Vector4cMapConst getBGRAVector4cMap () const { return (pcl::Vector4cMapConst (reinterpret_cast (&rgba))); } #define PCL_ADD_RGB \ PCL_ADD_UNION_RGB \ @@ -267,13 +267,13 @@ namespace pcl #define PCL_ADD_INTENSITY_8U \ struct \ { \ - uint8_t intensity; \ + std::uint8_t intensity; \ }; \ #define PCL_ADD_INTENSITY_32U \ struct \ { \ - uint32_t intensity; \ + std::uint32_t intensity; \ }; \ @@ -324,7 +324,7 @@ namespace pcl /** \brief A structure representing RGB color information. * * The RGBA information is available either as separate r, g, b, or as a - * packed uint32_t rgba value. To pack it, use: + * packed std::uint32_t rgba value. To pack it, use: * * \code * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b); @@ -334,9 +334,9 @@ namespace pcl * * \code * int rgb = ...; - * uint8_t r = (rgb >> 16) & 0x0000ff; - * uint8_t g = (rgb >> 8) & 0x0000ff; - * uint8_t b = (rgb) & 0x0000ff; + * std::uint8_t r = (rgb >> 16) & 0x0000ff; + * std::uint8_t g = (rgb >> 8) & 0x0000ff; + * std::uint8_t b = (rgb) & 0x0000ff; * \endcode * */ @@ -353,7 +353,7 @@ namespace pcl a = 255; } - inline RGB (uint8_t _r, uint8_t _g, uint8_t _b) + inline RGB (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b) { r = _r; g = _g; @@ -397,7 +397,7 @@ namespace pcl PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity8u& p); /** \brief A point structure representing the grayscale intensity in single-channel images. - * Intensity is represented as a uint8_t value. + * Intensity is represented as a std::uint8_t value. * \ingroup common */ struct Intensity8u: public _Intensity8u @@ -429,7 +429,7 @@ namespace pcl PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity32u& p); /** \brief A point structure representing the grayscale intensity in single-channel images. - * Intensity is represented as a uint32_t value. + * Intensity is represented as a std::uint32_t value. * \ingroup common */ struct Intensity32u: public _Intensity32u @@ -492,7 +492,7 @@ namespace pcl struct EIGEN_ALIGN16 _PointXYZL { PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4]) - uint32_t label; + std::uint32_t label; PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -519,7 +519,7 @@ namespace pcl PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Label& p); struct Label { - uint32_t label; + std::uint32_t label; friend std::ostream& operator << (std::ostream& os, const Label& p); }; @@ -536,7 +536,7 @@ namespace pcl /** \brief A point structure representing Euclidean xyz coordinates, and the RGBA color. * * The RGBA information is available either as separate r, g, b, or as a - * packed uint32_t rgba value. To pack it, use: + * packed std::uint32_t rgba value. To pack it, use: * * \code * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b); @@ -546,9 +546,9 @@ namespace pcl * * \code * int rgb = ...; - * uint8_t r = (rgb >> 16) & 0x0000ff; - * uint8_t g = (rgb >> 8) & 0x0000ff; - * uint8_t b = (rgb) & 0x0000ff; + * std::uint8_t r = (rgb >> 16) & 0x0000ff; + * std::uint8_t g = (rgb >> 8) & 0x0000ff; + * std::uint8_t b = (rgb) & 0x0000ff; * \endcode * * \ingroup common @@ -584,7 +584,7 @@ namespace pcl { PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4]) PCL_ADD_RGB; - uint32_t label; + std::uint32_t label; PCL_MAKE_ALIGNED_OPERATOR_NEW }; @@ -599,8 +599,8 @@ namespace pcl * * \code * // pack r/g/b into rgb - * uint8_t r = 255, g = 0, b = 0; // Example: Red color - * uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b); + * std::uint8_t r = 255, g = 0, b = 0; // Example: Red color + * std::uint32_t rgb = ((std::uint32_t)r << 16 | (std::uint32_t)g << 8 | (std::uint32_t)b); * p.rgb = *reinterpret_cast(&rgb); * \endcode * @@ -609,10 +609,10 @@ namespace pcl * \code * PointXYZRGB p; * // unpack rgb into r/g/b - * uint32_t rgb = *reinterpret_cast(&p.rgb); - * uint8_t r = (rgb >> 16) & 0x0000ff; - * uint8_t g = (rgb >> 8) & 0x0000ff; - * uint8_t b = (rgb) & 0x0000ff; + * std::uint32_t rgb = *reinterpret_cast(&p.rgb); + * std::uint8_t r = (rgb >> 16) & 0x0000ff; + * std::uint8_t g = (rgb >> 8) & 0x0000ff; + * std::uint8_t b = (rgb) & 0x0000ff; * \endcode * * @@ -635,7 +635,7 @@ namespace pcl r = g = b = 0; a = 255; } - inline PointXYZRGB (uint8_t _r, uint8_t _g, uint8_t _b) + inline PointXYZRGB (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b) { x = y = z = 0.0f; data[3] = 1.0f; @@ -668,7 +668,7 @@ namespace pcl a = 255; label = 0; } - inline PointXYZRGBL (uint8_t _r, uint8_t _g, uint8_t _b, uint32_t _label) + inline PointXYZRGBL (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint32_t _label) { x = y = z = 0.0f; data[3] = 1.0f; @@ -920,8 +920,8 @@ namespace pcl * * \code * // pack r/g/b into rgb - * uint8_t r = 255, g = 0, b = 0; // Example: Red color - * uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b); + * std::uint8_t r = 255, g = 0, b = 0; // Example: Red color + * std::uint32_t rgb = ((std::uint32_t)r << 16 | (std::uint32_t)g << 8 | (std::uint32_t)b); * p.rgb = *reinterpret_cast(&rgb); * \endcode * @@ -930,10 +930,10 @@ namespace pcl * \code * PointXYZRGB p; * // unpack rgb into r/g/b - * uint32_t rgb = *reinterpret_cast(&p.rgb); - * uint8_t r = (rgb >> 16) & 0x0000ff; - * uint8_t g = (rgb >> 8) & 0x0000ff; - * uint8_t b = (rgb) & 0x0000ff; + * std::uint32_t rgb = *reinterpret_cast(&p.rgb); + * std::uint8_t r = (rgb >> 16) & 0x0000ff; + * std::uint8_t g = (rgb >> 8) & 0x0000ff; + * std::uint8_t b = (rgb) & 0x0000ff; * \endcode * * @@ -1014,7 +1014,7 @@ namespace pcl { struct { - uint32_t label; + std::uint32_t label; float curvature; }; float data_c[4]; @@ -1155,7 +1155,7 @@ namespace pcl */ struct Boundary { - uint8_t boundary_point; + std::uint8_t boundary_point; #if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 1101 operator unsigned char() const diff --git a/common/include/pcl/pcl_macros.h b/common/include/pcl/pcl_macros.h index 6f616e13df2..a376f8ae56a 100644 --- a/common/include/pcl/pcl_macros.h +++ b/common/include/pcl/pcl_macros.h @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -76,15 +77,15 @@ namespace pcl { - using boost::uint8_t; - using boost::int8_t; - using boost::int16_t; - using boost::uint16_t; - using boost::int32_t; - using boost::uint32_t; - using boost::int64_t; - using boost::uint64_t; - using boost::int_fast16_t; + using uint8_t [[deprecated("use std::uint8_t instead of pcl::uint8_t")]] = std::uint8_t; + using int8_t [[deprecated("use std::int8_t instead of pcl::int8_t")]] = std::int8_t; + using uint16_t [[deprecated("use std::uint16_t instead of pcl::uint16_t")]] = std::uint16_t; + using int16_t [[deprecated("use std::uint16_t instead of pcl::int16_t")]] = std::int16_t; + using uint32_t [[deprecated("use std::uint32_t instead of pcl::uint32_t")]] = std::uint32_t; + using int32_t [[deprecated("use std::int32_t instead of pcl::int32_t")]] = std::int32_t; + using uint64_t [[deprecated("use std::uint64_t instead of pcl::uint64_t")]] = std::uint64_t; + using int64_t [[deprecated("use std::int64_t instead of pcl::int64_t")]] = std::int64_t; + using int_fast16_t [[deprecated("use std::int_fast16_t instead of pcl::int_fast16_t")]] = std::int_fast16_t; } #if defined _WIN32 && defined _MSC_VER diff --git a/common/include/pcl/point_cloud.h b/common/include/pcl/point_cloud.h index f7a766639c8..c4e9e996070 100644 --- a/common/include/pcl/point_cloud.h +++ b/common/include/pcl/point_cloud.h @@ -90,7 +90,7 @@ namespace pcl { //boost::fusion::at_key (p2_) = p1_[f_idx_++]; using T = typename pcl::traits::datatype::type; - uint8_t* data_ptr = reinterpret_cast(&p2_) + pcl::traits::offset::value; + std::uint8_t* data_ptr = reinterpret_cast(&p2_) + pcl::traits::offset::value; *reinterpret_cast(data_ptr) = static_cast (p1_[f_idx_++]); } @@ -121,7 +121,7 @@ namespace pcl { //p2_[f_idx_++] = boost::fusion::at_key (p1_); using T = typename pcl::traits::datatype::type; - const uint8_t* data_ptr = reinterpret_cast(&p1_) + pcl::traits::offset::value; + const std::uint8_t* data_ptr = reinterpret_cast(&p1_) + pcl::traits::offset::value; p2_[f_idx_++] = static_cast (*reinterpret_cast(data_ptr)); } @@ -229,7 +229,7 @@ namespace pcl * \param[in] height_ the cloud height * \param[in] value_ default value */ - PointCloud (uint32_t width_, uint32_t height_, const PointT& value_ = PointT ()) + PointCloud (std::uint32_t width_, std::uint32_t height_, const PointT& value_ = PointT ()) : header () , points (width_ * height_, value_) , width (width_) @@ -275,7 +275,7 @@ namespace pcl // This causes a drastic performance hit. Prefer not to use reserve with libstdc++ (default on clang) cloud1.points.insert (cloud1.points.end (), cloud2.points.begin (), cloud2.points.end ()); - cloud1.width = static_cast(cloud1.points.size ()); + cloud1.width = static_cast(cloud1.points.size ()); cloud1.height = 1; cloud1.is_dense = cloud1.is_dense && cloud2.is_dense; return true; @@ -426,9 +426,9 @@ namespace pcl std::vector > points; /** \brief The point cloud width (if organized as an image-structure). */ - uint32_t width; + std::uint32_t width; /** \brief The point cloud height (if organized as an image-structure). */ - uint32_t height; + std::uint32_t height; /** \brief True if no points are invalid (e.g., have NaN or Inf values in any of their floating point fields). */ bool is_dense; @@ -473,7 +473,7 @@ namespace pcl points.resize (n); if (width * height != n) { - width = static_cast (n); + width = static_cast (n); height = 1; } } @@ -496,7 +496,7 @@ namespace pcl push_back (const PointT& pt) { points.push_back (pt); - width = static_cast (points.size ()); + width = static_cast (points.size ()); height = 1; } @@ -509,7 +509,7 @@ namespace pcl emplace_back (Args&& ...args) { points.emplace_back (std::forward (args)...); - width = static_cast (points.size ()); + width = static_cast (points.size ()); height = 1; return points.back(); } @@ -524,7 +524,7 @@ namespace pcl insert (iterator position, const PointT& pt) { iterator it = points.insert (position, pt); - width = static_cast (points.size ()); + width = static_cast (points.size ()); height = 1; return (it); } @@ -539,7 +539,7 @@ namespace pcl insert (iterator position, std::size_t n, const PointT& pt) { points.insert (position, n, pt); - width = static_cast (points.size ()); + width = static_cast (points.size ()); height = 1; } @@ -553,7 +553,7 @@ namespace pcl insert (iterator position, InputIterator first, InputIterator last) { points.insert (position, first, last); - width = static_cast (points.size ()); + width = static_cast (points.size ()); height = 1; } @@ -567,7 +567,7 @@ namespace pcl emplace (iterator position, Args&& ...args) { iterator it = points.emplace (position, std::forward (args)...); - width = static_cast (points.size ()); + width = static_cast (points.size ()); height = 1; return (it); } @@ -581,7 +581,7 @@ namespace pcl erase (iterator position) { iterator it = points.erase (position); - width = static_cast (points.size ()); + width = static_cast (points.size ()); height = 1; return (it); } @@ -596,7 +596,7 @@ namespace pcl erase (iterator first, iterator last) { iterator it = points.erase (first, last); - width = static_cast (points.size ()); + width = static_cast (points.size ()); height = 1; return (it); } diff --git a/common/include/pcl/point_representation.h b/common/include/pcl/point_representation.h index cfb919dbfed..90640a765c8 100644 --- a/common/include/pcl/point_representation.h +++ b/common/include/pcl/point_representation.h @@ -260,7 +260,7 @@ namespace pcl { static void copyPoint (const Pod &p1, float * p2, int &f_idx) { - const uint8_t * data_ptr = reinterpret_cast (&p1) + + const std::uint8_t * data_ptr = reinterpret_cast (&p1) + pcl::traits::offset::value; p2[f_idx++] = *reinterpret_cast (data_ptr); } @@ -271,7 +271,7 @@ namespace pcl { static void copyPoint (const Pod &p1, float * p2, int &f_idx) { - const uint8_t * data_ptr = reinterpret_cast (&p1) + + const std::uint8_t * data_ptr = reinterpret_cast (&p1) + pcl::traits::offset::value; int nr_dims = NrDims; const FieldT * array = reinterpret_cast (data_ptr); diff --git a/common/include/pcl/point_traits.h b/common/include/pcl/point_traits.h index 915274daeeb..add14691a07 100644 --- a/common/include/pcl/point_traits.h +++ b/common/include/pcl/point_traits.h @@ -74,23 +74,23 @@ namespace pcl { // Metafunction to return enum value representing a type template struct asEnum {}; - template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::INT8; }; - template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::UINT8; }; - template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::INT16; }; - template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::UINT16; }; - template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::INT32; }; - template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::UINT32; }; - template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::FLOAT32; }; - template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::FLOAT64; }; + template<> struct asEnum { static const std::uint8_t value = pcl::PCLPointField::INT8; }; + template<> struct asEnum { static const std::uint8_t value = pcl::PCLPointField::UINT8; }; + template<> struct asEnum { static const std::uint8_t value = pcl::PCLPointField::INT16; }; + template<> struct asEnum { static const std::uint8_t value = pcl::PCLPointField::UINT16; }; + template<> struct asEnum { static const std::uint8_t value = pcl::PCLPointField::INT32; }; + template<> struct asEnum { static const std::uint8_t value = pcl::PCLPointField::UINT32; }; + template<> struct asEnum { static const std::uint8_t value = pcl::PCLPointField::FLOAT32; }; + template<> struct asEnum { static const std::uint8_t value = pcl::PCLPointField::FLOAT64; }; // Metafunction to return type of enum value template struct asType {}; - template<> struct asType { using type = int8_t; }; - template<> struct asType { using type = uint8_t; }; - template<> struct asType { using type = int16_t; }; - template<> struct asType { using type = uint16_t; }; - template<> struct asType { using type = int32_t; }; - template<> struct asType { using type = uint32_t; }; + template<> struct asType { using type = std::int8_t; }; + template<> struct asType { using type = std::uint8_t; }; + template<> struct asType { using type = std::int16_t; }; + template<> struct asType { using type = std::uint16_t; }; + template<> struct asType { using type = std::int32_t; }; + template<> struct asType { using type = std::uint32_t; }; template<> struct asType { using type = float; }; template<> struct asType { using type = double; }; @@ -99,7 +99,7 @@ namespace pcl template struct decomposeArray { using type = std::remove_all_extents_t; - static const uint32_t value = sizeof (T) / sizeof (type); + static const std::uint32_t value = sizeof (T) / sizeof (type); }; // For non-POD point types, this is specialized to return the corresponding POD type. @@ -166,8 +166,8 @@ namespace pcl { // Contents of specialization: // using type = ...; - // static const uint8_t value; - // static const uint32_t size; + // static const std::uint8_t value; + // static const std::uint32_t size; // Avoid infinite compile-time recursion BOOST_MPL_ASSERT_MSG((!std::is_same::type>::value), @@ -254,7 +254,7 @@ namespace pcl { exists_ = true; using T = typename pcl::traits::datatype::type; - const uint8_t* data_ptr = reinterpret_cast(&pt_) + pcl::traits::offset::value; + const std::uint8_t* data_ptr = reinterpret_cast(&pt_) + pcl::traits::offset::value; value_ = static_cast (*reinterpret_cast(data_ptr)); } } @@ -303,7 +303,7 @@ namespace pcl if (name_ == pcl::traits::name::value) { using T = typename pcl::traits::datatype::type; - uint8_t* data_ptr = reinterpret_cast(&pt_) + pcl::traits::offset::value; + std::uint8_t* data_ptr = reinterpret_cast(&pt_) + pcl::traits::offset::value; *reinterpret_cast(data_ptr) = static_cast (value_); } } @@ -322,7 +322,7 @@ namespace pcl template inline void setFieldValue (PointT &pt, std::size_t field_offset, const ValT &value) { - uint8_t* data_ptr = reinterpret_cast(&pt) + field_offset; + std::uint8_t* data_ptr = reinterpret_cast(&pt) + field_offset; *reinterpret_cast(data_ptr) = value; } @@ -334,7 +334,7 @@ namespace pcl template inline void getFieldValue (const PointT &pt, std::size_t field_offset, ValT &value) { - const uint8_t* data_ptr = reinterpret_cast(&pt) + field_offset; + const std::uint8_t* data_ptr = reinterpret_cast(&pt) + field_offset; value = *reinterpret_cast(data_ptr); } diff --git a/common/include/pcl/point_types.h b/common/include/pcl/point_types.h index 21fcf8e0450..02c4d2bb196 100644 --- a/common/include/pcl/point_types.h +++ b/common/include/pcl/point_types.h @@ -80,12 +80,12 @@ namespace pcl */ struct Intensity; - /** \brief Members: intensity (uint8_t) + /** \brief Members: intensity (std::uint8_t) * \ingroup common */ struct Intensity8u; - /** \brief Members: intensity (uint32_t) + /** \brief Members: intensity (std::uint32_t) * \ingroup common */ struct Intensity32u; @@ -100,12 +100,12 @@ namespace pcl */ struct PointXYZL; - /** \brief Members: uint32_t label + /** \brief Members: std::uint32_t label * \ingroup common */ struct Label; - /** \brief Members: float x, y, z; uint32_t rgba + /** \brief Members: float x, y, z; std::uint32_t rgba * \ingroup common */ struct PointXYZRGBA; @@ -115,7 +115,7 @@ namespace pcl */ struct PointXYZRGB; - /** \brief Members: float x, y, z, rgb, uint32_t label + /** \brief Members: float x, y, z, rgb, std::uint32_t label * \ingroup common */ struct PointXYZRGBL; @@ -190,7 +190,7 @@ namespace pcl */ struct PrincipalRadiiRSD; - /** \brief Members: uint8_t boundary_point + /** \brief Members: std::uint8_t boundary_point * \ingroup common */ struct Boundary; @@ -295,7 +295,7 @@ namespace pcl */ struct GFPFHSignature16; - /** \brief Members: float scale; float orientation; uint8_t descriptor[64] + /** \brief Members: float scale; float orientation; std::uint8_t descriptor[64] * \ingroup common */ struct BRISKSignature512; @@ -363,7 +363,7 @@ namespace pcl // ============================== POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_RGB, - (uint32_t, rgba, rgba) + (std::uint32_t, rgba, rgba) ) POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::RGB, pcl::_RGB) @@ -373,12 +373,12 @@ POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Intensity, POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity, pcl::_Intensity) POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Intensity8u, - (uint8_t, intensity, intensity) + (std::uint8_t, intensity, intensity) ) POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity8u, pcl::_Intensity8u) POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Intensity32u, - (uint32_t, intensity, intensity) + (std::uint32_t, intensity, intensity) ) POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity32u, pcl::_Intensity32u) @@ -393,7 +393,7 @@ POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBA, (float, x, x) (float, y, y) (float, z, z) - (uint32_t, rgba, rgba) + (std::uint32_t, rgba, rgba) ) POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBA, pcl::_PointXYZRGBA) @@ -409,8 +409,8 @@ POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBL, (float, x, x) (float, y, y) (float, z, z) - (uint32_t, rgba, rgba) - (uint32_t, label, label) + (std::uint32_t, rgba, rgba) + (std::uint32_t, label, label) ) POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBL, pcl::_PointXYZRGBL) @@ -453,11 +453,11 @@ POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointXYZL, (float, x, x) (float, y, y) (float, z, z) - (uint32_t, label, label) + (std::uint32_t, label, label) ) POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::Label, - (uint32_t, label, label) + (std::uint32_t, label, label) ) POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Normal, @@ -509,7 +509,7 @@ POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointXYZLNormal, (float, x, x) (float, y, y) (float, z, z) - (uint32_t, label, label) + (std::uint32_t, label, label) (float, normal_x, normal_x) (float, normal_y, normal_y) (float, normal_z, normal_z) @@ -544,7 +544,7 @@ POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PrincipalRadiiRSD, ) POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::Boundary, - (uint8_t, boundary_point, boundary_point) + (std::uint8_t, boundary_point, boundary_point) ) POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PrincipalCurvatures, @@ -682,7 +682,7 @@ POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::PointSurfel, (float, normal_x, normal_x) (float, normal_y, normal_y) (float, normal_z, normal_z) - (uint32_t, rgba, rgba) + (std::uint32_t, rgba, rgba) (float, radius, radius) (float, confidence, confidence) (float, curvature, curvature) diff --git a/common/include/pcl/point_types_conversion.h b/common/include/pcl/point_types_conversion.h index 4021bcb39ea..28c8c48eaa3 100644 --- a/common/include/pcl/point_types_conversion.h +++ b/common/include/pcl/point_types_conversion.h @@ -81,7 +81,7 @@ namespace pcl PointRGBtoI (const RGB& in, Intensity8u& out) { - out.intensity = static_cast(0.299f * static_cast (in.r) + out.intensity = static_cast(0.299f * static_cast (in.r) + 0.587f * static_cast (in.g) + 0.114f * static_cast (in.b)); } @@ -93,7 +93,7 @@ namespace pcl PointRGBtoI (const RGB& in, Intensity32u& out) { - out.intensity = static_cast(0.299f * static_cast (in.r) + out.intensity = static_cast(0.299f * static_cast (in.r) + 0.587f * static_cast (in.g) + 0.114f * static_cast (in.b)); } @@ -183,7 +183,7 @@ namespace pcl out.x = in.x; out.y = in.y; out.z = in.z; if (in.s == 0) { - out.r = out.g = out.b = static_cast (255 * in.v); + out.r = out.g = out.b = static_cast (255 * in.v); return; } float a = in.h / 60; @@ -197,44 +197,44 @@ namespace pcl { case 0: { - out.r = static_cast (255 * in.v); - out.g = static_cast (255 * t); - out.b = static_cast (255 * p); + out.r = static_cast (255 * in.v); + out.g = static_cast (255 * t); + out.b = static_cast (255 * p); break; } case 1: { - out.r = static_cast (255 * q); - out.g = static_cast (255 * in.v); - out.b = static_cast (255 * p); + out.r = static_cast (255 * q); + out.g = static_cast (255 * in.v); + out.b = static_cast (255 * p); break; } case 2: { - out.r = static_cast (255 * p); - out.g = static_cast (255 * in.v); - out.b = static_cast (255 * t); + out.r = static_cast (255 * p); + out.g = static_cast (255 * in.v); + out.b = static_cast (255 * t); break; } case 3: { - out.r = static_cast (255 * p); - out.g = static_cast (255 * q); - out.b = static_cast (255 * in.v); + out.r = static_cast (255 * p); + out.g = static_cast (255 * q); + out.b = static_cast (255 * in.v); break; } case 4: { - out.r = static_cast (255 * t); - out.g = static_cast (255 * p); - out.b = static_cast (255 * in.v); + out.r = static_cast (255 * t); + out.g = static_cast (255 * p); + out.b = static_cast (255 * in.v); break; } default: { - out.r = static_cast (255 * in.v); - out.g = static_cast (255 * p); - out.b = static_cast (255 * q); + out.r = static_cast (255 * in.v); + out.g = static_cast (255 * p); + out.b = static_cast (255 * q); break; } } diff --git a/common/include/pcl/range_image/impl/range_image.hpp b/common/include/pcl/range_image/impl/range_image.hpp index 116f4e16cee..03f2ee8b116 100644 --- a/common/include/pcl/range_image/impl/range_image.hpp +++ b/common/include/pcl/range_image/impl/range_image.hpp @@ -110,8 +110,8 @@ RangeImage::createFromPointCloud (const PointCloudType& point_cloud, { setAngularResolution (angular_resolution_x, angular_resolution_y); - width = static_cast (pcl_lrint (std::floor (max_angle_width*angular_resolution_x_reciprocal_))); - height = static_cast (pcl_lrint (std::floor (max_angle_height*angular_resolution_y_reciprocal_))); + width = static_cast (pcl_lrint (std::floor (max_angle_width*angular_resolution_x_reciprocal_))); + height = static_cast (pcl_lrint (std::floor (max_angle_height*angular_resolution_y_reciprocal_))); int full_width = static_cast (pcl_lrint (std::floor (pcl::deg2rad (360.0f)*angular_resolution_x_reciprocal_))), full_height = static_cast (pcl_lrint (std::floor (pcl::deg2rad (180.0f)*angular_resolution_y_reciprocal_))); diff --git a/common/include/pcl/range_image/range_image.h b/common/include/pcl/range_image/range_image.h index c801d90193f..f36b1212f18 100644 --- a/common/include/pcl/range_image/range_image.h +++ b/common/include/pcl/range_image/range_image.h @@ -758,8 +758,8 @@ namespace pcl // BaseClass: // roslib::Header header; // std::vector points; - // uint32_t width; - // uint32_t height; + // std::uint32_t width; + // std::uint32_t height; // bool is_dense; static bool debug; /**< Just for... well... debugging purposes. :-) */ diff --git a/common/include/pcl/register_point_struct.h b/common/include/pcl/register_point_struct.h index 6379164c444..4b3f2c2ef6c 100644 --- a/common/include/pcl/register_point_struct.h +++ b/common/include/pcl/register_point_struct.h @@ -105,7 +105,7 @@ namespace pcl plus (std::remove_const_t &l, const T &r) { using type = std::remove_all_extents_t; - static const uint32_t count = sizeof (T) / sizeof (type); + static const std::uint32_t count = sizeof (T) / sizeof (type); for (int i = 0; i < count; ++i) l[i] += r[i]; } @@ -122,7 +122,7 @@ namespace pcl plusscalar (T1 &p, const T2 &scalar) { using type = std::remove_all_extents_t; - static const uint32_t count = sizeof (T1) / sizeof (type); + static const std::uint32_t count = sizeof (T1) / sizeof (type); for (int i = 0; i < count; ++i) p[i] += scalar; } @@ -139,7 +139,7 @@ namespace pcl minus (std::remove_const_t &l, const T &r) { using type = std::remove_all_extents_t; - static const uint32_t count = sizeof (T) / sizeof (type); + static const std::uint32_t count = sizeof (T) / sizeof (type); for (int i = 0; i < count; ++i) l[i] -= r[i]; } @@ -156,7 +156,7 @@ namespace pcl minusscalar (T1 &p, const T2 &scalar) { using type = std::remove_all_extents_t; - static const uint32_t count = sizeof (T1) / sizeof (type); + static const std::uint32_t count = sizeof (T1) / sizeof (type); for (int i = 0; i < count; ++i) p[i] -= scalar; } @@ -173,7 +173,7 @@ namespace pcl mulscalar (T1 &p, const T2 &scalar) { using type = std::remove_all_extents_t; - static const uint32_t count = sizeof (T1) / sizeof (type); + static const std::uint32_t count = sizeof (T1) / sizeof (type); for (int i = 0; i < count; ++i) p[i] *= scalar; } @@ -190,7 +190,7 @@ namespace pcl divscalar (T1 &p, const T2 &scalar) { using type = std::remove_all_extents_t; - static const uint32_t count = sizeof (T1) / sizeof (type); + static const std::uint32_t count = sizeof (T1) / sizeof (type); for (int i = 0; i < count; ++i) p[i] /= scalar; } @@ -339,8 +339,8 @@ namespace pcl { \ using type = boost::mpl::identity::type; \ using decomposed = decomposeArray; \ - static const uint8_t value = asEnum::value; \ - static const uint32_t size = decomposed::value; \ + static const std::uint8_t value = asEnum::value; \ + static const std::uint32_t size = decomposed::value; \ }; \ /***/ diff --git a/common/src/bearing_angle_image.cpp b/common/src/bearing_angle_image.cpp index b51b4118c27..95eae86d996 100644 --- a/common/src/bearing_angle_image.cpp +++ b/common/src/bearing_angle_image.cpp @@ -101,7 +101,7 @@ BearingAngleImage::generateBAImage (PointCloud& point_cloud) points.resize (size, unobserved_point_); double theta; - uint8_t r, g, b, gray; + std::uint8_t r, g, b, gray; // primary transformation process for (decltype(height) i = 0; i < height - 1; ++i) diff --git a/common/src/colors.cpp b/common/src/colors.cpp index 8599159e05c..0ecd5263d23 100644 --- a/common/src/colors.cpp +++ b/common/src/colors.cpp @@ -607,9 +607,9 @@ pcl::getRandomColor (double min, double max) } while (sum <= min || sum >= max); pcl::RGB color; - color.r = uint8_t (r * 255.0); - color.g = uint8_t (g * 255.0); - color.b = uint8_t (b * 255.0); + color.r = std::uint8_t (r * 255.0); + color.g = std::uint8_t (g * 255.0); + color.b = std::uint8_t (b * 255.0); return (color); } diff --git a/common/src/io.cpp b/common/src/io.cpp index e2e8f342c0c..e770cfc5424 100644 --- a/common/src/io.cpp +++ b/common/src/io.cpp @@ -149,13 +149,13 @@ pcl::concatenateFields (const pcl::PCLPointCloud2 &cloud1, } //we need to compute the size of the additional data added from cloud 1 - uint32_t cloud1_unique_point_step = 0; + std::uint32_t cloud1_unique_point_step = 0; for (std::size_t i = 0; i < cloud1_unique_fields.size (); ++i) cloud1_unique_point_step += field_sizes[i]; //the total size of extra data should be the size of data per point //multiplied by the total number of points in the cloud - uint32_t cloud1_unique_data_size = cloud1_unique_point_step * cloud1.width * cloud1.height; + std::uint32_t cloud1_unique_data_size = cloud1_unique_point_step * cloud1.width * cloud1.height; // Point step must increase with the length of each matching field cloud_out.point_step = cloud2.point_step + cloud1_unique_point_step; @@ -421,11 +421,11 @@ pcl::copyPointCloud ( { cloud_out.header = cloud_in.header; cloud_out.height = 1; - cloud_out.width = static_cast (indices.size ()); + cloud_out.width = static_cast (indices.size ()); cloud_out.fields = cloud_in.fields; cloud_out.is_bigendian = cloud_in.is_bigendian; cloud_out.point_step = cloud_in.point_step; - cloud_out.row_step = cloud_in.point_step * static_cast (indices.size ()); + cloud_out.row_step = cloud_in.point_step * static_cast (indices.size ()); cloud_out.is_dense = cloud_in.is_dense; cloud_out.data.resize (cloud_out.width * cloud_out.height * cloud_out.point_step); @@ -444,11 +444,11 @@ pcl::copyPointCloud ( { cloud_out.header = cloud_in.header; cloud_out.height = 1; - cloud_out.width = static_cast (indices.size ()); + cloud_out.width = static_cast (indices.size ()); cloud_out.fields = cloud_in.fields; cloud_out.is_bigendian = cloud_in.is_bigendian; cloud_out.point_step = cloud_in.point_step; - cloud_out.row_step = cloud_in.point_step * static_cast (indices.size ()); + cloud_out.row_step = cloud_in.point_step * static_cast (indices.size ()); cloud_out.is_dense = cloud_in.is_dense; cloud_out.data.resize (cloud_out.width * cloud_out.height * cloud_out.point_step); diff --git a/common/src/range_image.cpp b/common/src/range_image.cpp index 4f3a99482ff..bfcb810c0e9 100644 --- a/common/src/range_image.cpp +++ b/common/src/range_image.cpp @@ -149,8 +149,8 @@ RangeImage::createEmpty (float angular_resolution_x, float angular_resolution_y, RangeImage::CoordinateFrame coordinate_frame, float angle_width, float angle_height) { setAngularResolution(angular_resolution_x, angular_resolution_y); - width = static_cast (pcl_lrint (std::floor (angle_width * angular_resolution_x_reciprocal_))); - height = static_cast (pcl_lrint (std::floor (angle_height * angular_resolution_y_reciprocal_))); + width = static_cast (pcl_lrint (std::floor (angle_width * angular_resolution_x_reciprocal_))); + height = static_cast (pcl_lrint (std::floor (angle_height * angular_resolution_y_reciprocal_))); int full_width = static_cast (pcl_lrint (std::floor (pcl::deg2rad (360.0f)*angular_resolution_x_reciprocal_))), full_height = static_cast (pcl_lrint (std::floor (pcl::deg2rad (180.0f)*angular_resolution_y_reciprocal_))); @@ -860,7 +860,7 @@ RangeImage::extractFarRanges (const pcl::PCLPointCloud2& point_cloud_data, far_ranges.points.push_back (point); } } - far_ranges.width= static_cast (far_ranges.points.size ()); far_ranges.height = 1; + far_ranges.width= static_cast (far_ranges.points.size ()); far_ranges.height = 1; far_ranges.is_dense = false; } diff --git a/cuda/io/include/pcl/cuda/io/disparity_to_cloud.h b/cuda/io/include/pcl/cuda/io/disparity_to_cloud.h index f999fa7db24..24df859433b 100644 --- a/cuda/io/include/pcl/cuda/io/disparity_to_cloud.h +++ b/cuda/io/include/pcl/cuda/io/disparity_to_cloud.h @@ -44,7 +44,7 @@ //#include //#include -#include +#include namespace pcl { @@ -114,7 +114,7 @@ namespace cuda bool downsample = false, int stride = 2, int smoothing_nr_iterations = 0, int smoothing_filter_size = 2); template