diff --git a/2d/include/pcl/2d/impl/edge.hpp b/2d/include/pcl/2d/impl/edge.hpp index 75e35f94641..a79eb7f9388 100644 --- a/2d/include/pcl/2d/impl/edge.hpp +++ b/2d/include/pcl/2d/impl/edge.hpp @@ -259,9 +259,7 @@ Edge::suppressNonMaxima( const int height = edges.height; const int width = edges.width; - maxima.height = height; - maxima.width = width; - maxima.resize(height * width); + maxima.resize(edges.width, edges.height); for (auto& point : maxima) point.intensity = 0.0f; diff --git a/common/include/pcl/common/impl/generate.hpp b/common/include/pcl/common/impl/generate.hpp index ea137ae316d..17b5eafea89 100644 --- a/common/include/pcl/common/impl/generate.hpp +++ b/common/include/pcl/common/impl/generate.hpp @@ -276,9 +276,7 @@ CloudGenerator::fill (int width, int height, pcl::Poin if (!cloud.empty ()) PCL_WARN ("[pcl::common::CloudGenerator] Cloud data will be erased with new data\n!"); - cloud.width = width; - cloud.height = height; - cloud.resize (cloud.width * cloud.height); + cloud.resize (width, height); cloud.is_dense = true; for (auto &point : cloud) diff --git a/common/include/pcl/range_image/impl/range_image.hpp b/common/include/pcl/range_image/impl/range_image.hpp index d4f6ec794ed..7a985b56ef1 100644 --- a/common/include/pcl/range_image/impl/range_image.hpp +++ b/common/include/pcl/range_image/impl/range_image.hpp @@ -194,7 +194,7 @@ RangeImage::createFromPointCloudWithKnownSize (const PointCloudType& point_cloud image_offset_y_ = (std::max) (0, center_pixel_y-pixel_radius_y); points.clear (); - points.resize (width*height, unobserved_point); + points.resize (static_cast(width)*static_cast(height), unobserved_point); int top=height, right=-1, bottom=-1, left=width; doZBuffer (point_cloud, noise_level, min_range, top, right, bottom, left); diff --git a/common/src/PCLPointCloud2.cpp b/common/src/PCLPointCloud2.cpp index 1d52cc2903b..06727604107 100644 --- a/common/src/PCLPointCloud2.cpp +++ b/common/src/PCLPointCloud2.cpp @@ -146,13 +146,13 @@ pcl::PCLPointCloud2::concatenate (pcl::PCLPointCloud2 &cloud1, const pcl::PCLPoi } const auto data1_size = cloud1.data.size (); cloud1.data.resize(data1_size + cloud2.data.size ()); - for (uindex_t cp = 0; cp < size2; ++cp) + for (std::size_t cp = 0; cp < size2; ++cp) { for (const auto& field_data: valid_fields) { const auto& i = field_data.idx1; const auto& j = field_data.idx2; - const auto& size = field_data.size; + const std::size_t size = field_data.size; // Leave the data for the skip fields untouched in cloud1 // Copy only the required data from cloud2 to the correct location for cloud1 memcpy (reinterpret_cast (&cloud1.data[data1_size + cp * cloud1.point_step + cloud1.fields[i].offset]), diff --git a/common/src/gaussian.cpp b/common/src/gaussian.cpp index 2b6a667164f..7702de38453 100644 --- a/common/src/gaussian.cpp +++ b/common/src/gaussian.cpp @@ -145,9 +145,7 @@ pcl::GaussianKernel::convolveRows (const pcl::PointCloud& input, { if (output.height < input.height || output.width < input.width) { - output.width = input.width; - output.height = input.height; - output.resize (input.height * input.width); + output.resize (static_cast(input.width), static_cast(input.height)); // Casting is necessary to resolve ambiguous call to resize } unaliased_input = &input; } @@ -189,9 +187,7 @@ pcl::GaussianKernel::convolveCols (const pcl::PointCloud& input, { if (output.height < input.height || output.width < input.width) { - output.width = input.width; - output.height = input.height; - output.resize (input.height * input.width); + output.resize (static_cast(input.width), static_cast(input.height)); // Casting is necessary to resolve ambiguous call to resize } unaliased_input = &input; } diff --git a/common/src/io.cpp b/common/src/io.cpp index 8b13e740ab4..0be99ddb4a0 100644 --- a/common/src/io.cpp +++ b/common/src/io.cpp @@ -151,7 +151,7 @@ pcl::concatenateFields (const pcl::PCLPointCloud2 &cloud1, //the total size of extra data should be the size of data per point //multiplied by the total number of points in the cloud - std::uint32_t cloud1_unique_data_size = cloud1_unique_point_step * cloud1.width * cloud1.height; + const std::size_t cloud1_unique_data_size = static_cast(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; @@ -177,8 +177,9 @@ pcl::concatenateFields (const pcl::PCLPointCloud2 &cloud1, } // Iterate over each point and perform the appropriate memcpys - int point_offset = 0; - for (uindex_t cp = 0; cp < cloud_out.width * cloud_out.height; ++cp) + std::size_t point_offset = 0; + const std::size_t npts = static_cast(cloud_out.width) * static_cast(cloud_out.height); + for (std::size_t cp = 0; cp < npts; ++cp) { memcpy (&cloud_out.data[point_offset], &cloud2.data[cp * cloud2.point_step], cloud2.point_step); int field_offset = cloud2.point_step; @@ -231,7 +232,7 @@ pcl::getPointCloudAsEigen (const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out) return (false); } - std::size_t npts = in.width * in.height; + std::size_t npts = static_cast(in.width) * static_cast(in.height); out = Eigen::MatrixXf::Ones (4, npts); Eigen::Array4i xyz_offset (in.fields[x_idx].offset, in.fields[y_idx].offset, in.fields[z_idx].offset, 0); @@ -313,11 +314,11 @@ pcl::copyPointCloud ( 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); + cloud_out.data.resize (static_cast(cloud_out.width) * static_cast(cloud_out.height) * static_cast(cloud_out.point_step)); // Iterate over each point for (std::size_t i = 0; i < indices.size (); ++i) - memcpy (&cloud_out.data[i * cloud_out.point_step], &cloud_in.data[indices[i] * cloud_in.point_step], cloud_in.point_step); + memcpy (&cloud_out.data[i * cloud_out.point_step], &cloud_in.data[static_cast(indices[i]) * cloud_in.point_step], cloud_in.point_step); } ////////////////////////////////////////////////////////////////////////// @@ -336,11 +337,11 @@ pcl::copyPointCloud ( 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); + cloud_out.data.resize (static_cast(cloud_out.width) * cloud_out.height * cloud_out.point_step); // Iterate over each point for (std::size_t i = 0; i < indices.size (); ++i) - memcpy (&cloud_out.data[i * cloud_out.point_step], &cloud_in.data[indices[i] * cloud_in.point_step], cloud_in.point_step); + memcpy (&cloud_out.data[i * cloud_out.point_step], &cloud_in.data[static_cast(indices[i]) * cloud_in.point_step], cloud_in.point_step); } //////////////////////////////////////////////////////////////////////////////// diff --git a/common/src/pcl_base.cpp b/common/src/pcl_base.cpp index b53d0a87ead..5a482c2dc90 100644 --- a/common/src/pcl_base.cpp +++ b/common/src/pcl_base.cpp @@ -114,12 +114,12 @@ pcl::PCLBase::initCompute () } // If we have a set of fake indices, but they do not match the number of points in the cloud, update them - if (fake_indices_ && indices_->size () != (input_->width * input_->height)) + if (fake_indices_ && indices_->size () != (static_cast(input_->width) * static_cast(input_->height))) { const auto indices_size = indices_->size (); try { - indices_->resize (input_->width * input_->height); + indices_->resize (static_cast(input_->width) * static_cast(input_->height)); } catch (const std::bad_alloc&) { diff --git a/common/src/range_image.cpp b/common/src/range_image.cpp index 91ba59bf5fc..8c5ba955f0e 100644 --- a/common/src/range_image.cpp +++ b/common/src/range_image.cpp @@ -238,7 +238,7 @@ RangeImage::cropImage (int borderSize, int top, int right, int bottom, int left) width = right-left+1; height = bottom-top+1; image_offset_x_ = left+oldRangeImage.image_offset_x_; image_offset_y_ = top+oldRangeImage.image_offset_y_; - points.resize (width*height); + points.resize (static_cast(width)*static_cast(height)); //std::cout << oldRangeImage.width<<"x"< "<(width)*static_cast(height)]; float* integral_image_ptr = integral_image; - valid_points_num_image = new int[width*height]; + valid_points_num_image = new int[static_cast(width)*static_cast(height)]; int* valid_points_num_image_ptr = valid_points_num_image; for (int y = 0; y < static_cast (height); ++y) { @@ -350,7 +350,7 @@ RangeImage::getHalfImage (RangeImage& half_image) const half_image.height = height/2; half_image.is_dense = is_dense; half_image.clear (); - half_image.resize (half_image.width*half_image.height); + half_image.resize (half_image.width, half_image.height); int src_start_x = 2*half_image.image_offset_x_ - image_offset_x_, src_start_y = 2*half_image.image_offset_y_ - image_offset_y_; @@ -394,7 +394,7 @@ RangeImage::getSubImage (int sub_image_image_offset_x, int sub_image_image_offse sub_image.height = sub_image_height; sub_image.is_dense = is_dense; sub_image.clear (); - sub_image.resize (sub_image.width*sub_image.height); + sub_image.resize (sub_image.width, sub_image.height); int src_start_x = combine_pixels*sub_image.image_offset_x_ - image_offset_x_, src_start_y = combine_pixels*sub_image.image_offset_y_ - image_offset_y_; diff --git a/common/src/range_image_planar.cpp b/common/src/range_image_planar.cpp index 206288016ea..0d513d4bba0 100644 --- a/common/src/range_image_planar.cpp +++ b/common/src/range_image_planar.cpp @@ -69,7 +69,7 @@ namespace pcl focal_length_x_reciprocal_ = focal_length_y_reciprocal_ = 1.0f / focal_length_x_; center_x_ = static_cast (di_width) / static_cast (2 * skip); center_y_ = static_cast (di_height) / static_cast (2 * skip); - points.resize (width*height); + points.resize (static_cast(width)*static_cast(height)); //std::cout << PVARN (*this); @@ -130,7 +130,7 @@ namespace pcl focal_length_y_reciprocal_ = 1.0f / focal_length_y_; center_x_ = static_cast (di_center_x) / static_cast (skip); center_y_ = static_cast (di_center_y) / static_cast (skip); - points.resize (width * height); + points.resize (static_cast(width) * static_cast(height)); for (int y=0; y < static_cast (height); ++y) { @@ -176,7 +176,7 @@ namespace pcl focal_length_y_reciprocal_ = 1.0f / focal_length_y_; center_x_ = static_cast (di_center_x) / static_cast (skip); center_y_ = static_cast (di_center_y) / static_cast (skip); - points.resize (width * height); + points.resize (static_cast(width) * static_cast(height)); for (int y = 0; y < static_cast (height); ++y) { diff --git a/examples/common/example_organized_point_cloud.cpp b/examples/common/example_organized_point_cloud.cpp index 5f17d1562f7..fa37267a9f6 100644 --- a/examples/common/example_organized_point_cloud.cpp +++ b/examples/common/example_organized_point_cloud.cpp @@ -53,10 +53,8 @@ main () CloudType::Ptr cloud (new CloudType); // Make the cloud a 10x10 grid - cloud->height = 10; - cloud->width = 10; cloud->is_dense = true; - cloud->resize(cloud->height * cloud->width); + cloud->resize(10, 10); // Output the (0,0) point std::cout << (*cloud)(0,0) << std::endl; diff --git a/examples/segmentation/example_supervoxels.cpp b/examples/segmentation/example_supervoxels.cpp index 11d8ec1420a..536c8d08672 100644 --- a/examples/segmentation/example_supervoxels.cpp +++ b/examples/segmentation/example_supervoxels.cpp @@ -194,7 +194,7 @@ main (int argc, char ** argv) return (1); } - cloud->points.reserve (depth_dims[0] * depth_dims[1]); + cloud->reserve (static_cast(depth_dims[0]) * static_cast(depth_dims[1])); cloud->width = depth_dims[0]; cloud->height = depth_dims[1]; cloud->is_dense = false; diff --git a/features/include/pcl/features/impl/brisk_2d.hpp b/features/include/pcl/features/impl/brisk_2d.hpp index 8d22f39bd87..cb06ac9f18e 100644 --- a/features/include/pcl/features/impl/brisk_2d.hpp +++ b/features/include/pcl/features/impl/brisk_2d.hpp @@ -107,7 +107,7 @@ BRISK2DEstimation::generateKernel ( points_ += number; // set up the patterns - pattern_points_ = new BriskPatternPoint[points_*scales_*n_rot_]; + pattern_points_ = new BriskPatternPoint[static_cast(points_)*static_cast(scales_)*static_cast(n_rot_)]; BriskPatternPoint* pattern_iterator = pattern_points_; // define the scale discretization: @@ -223,7 +223,7 @@ BRISK2DEstimation::smoothedIntensity const float yf = brisk_point.y + key_y; const int x = static_cast(xf); const int y = static_cast(yf); - const int& imagecols = image_width; + const std::ptrdiff_t imagecols = image_width; // get the sigma: const float sigma_half = brisk_point.sigma; @@ -271,7 +271,7 @@ BRISK2DEstimation::smoothedIntensity const int scaling2 = static_cast (static_cast(scaling) * area / 1024.0f); // the integral image is larger: - const int integralcols = imagecols + 1; + const std::ptrdiff_t integralcols = image_width + 1; // calculate borders const float x_1 = xf - sigma_half; @@ -450,7 +450,7 @@ BRISK2DEstimation::compute ( const auto height = static_cast(input_cloud_->height); // destination for intensity data; will be forwarded to BRISK - std::vector image_data (width*height); + std::vector image_data (static_cast(width)*static_cast(height)); for (std::size_t i = 0; i < image_data.size (); ++i) image_data[i] = static_cast (intensity_ ((*input_cloud_)[i])); @@ -512,7 +512,7 @@ BRISK2DEstimation::compute ( // first, calculate the integral image over the whole image: // current integral image - std::vector integral ((width+1)*(height+1), 0); // the integral image + std::vector integral (static_cast(width+1)*static_cast(height+1), 0); // the integral image for (index_t row_index = 1; row_index < height; ++row_index) { diff --git a/features/include/pcl/features/impl/esf.hpp b/features/include/pcl/features/impl/esf.hpp index f36826f5d19..d8695be362d 100644 --- a/features/include/pcl/features/impl/esf.hpp +++ b/features/include/pcl/features/impl/esf.hpp @@ -53,7 +53,7 @@ pcl::ESFEstimation::computeESF ( PointCloudIn &pc, std::vector &hist) { const int binsize = 64; - unsigned int sample_size = 20000; + const std::size_t sample_size = 20000; // @TODO: Replace with c++ stdlib uniform_random_generator srand (static_cast (time (nullptr))); const auto maxindex = pc.size (); @@ -269,7 +269,7 @@ pcl::ESFEstimation::computeESF ( //float weights[10] = {1, 1, 1, 1, 1, 1, 1, 1 , 1 , 1}; float weights[10] = {0.5f, 0.5f, 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 2.0f, 2.0f, 2.0f}; - hist.reserve (binsize * 10); + hist.reserve (static_cast(binsize) * 10); for (const float &i : h_a3_in) hist.push_back (i * weights[0]); for (const float &i : h_a3_out) diff --git a/features/include/pcl/features/impl/integral_image2D.hpp b/features/include/pcl/features/impl/integral_image2D.hpp index 88902cf6ddc..a8ffd0e5045 100644 --- a/features/include/pcl/features/impl/integral_image2D.hpp +++ b/features/include/pcl/features/impl/integral_image2D.hpp @@ -59,10 +59,11 @@ IntegralImage2D::setInput (const DataType * data, unsigned { width_ = width; height_ = height; - first_order_integral_image_.resize ( (width_ + 1) * (height_ + 1) ); - finite_values_integral_image_.resize ( (width_ + 1) * (height_ + 1) ); + const std::size_t ii_size = static_cast(width_ + 1) * static_cast(height_ + 1); + first_order_integral_image_.resize (ii_size); + finite_values_integral_image_.resize (ii_size); if (compute_second_order_integral_images_) - second_order_integral_image_.resize ( (width_ + 1) * (height_ + 1) ); + second_order_integral_image_.resize (ii_size); } computeIntegralImages (data, row_stride, element_stride); } @@ -230,10 +231,11 @@ IntegralImage2D::setInput (const DataType * data, unsigned width,un { width_ = width; height_ = height; - first_order_integral_image_.resize ( (width_ + 1) * (height_ + 1) ); - finite_values_integral_image_.resize ( (width_ + 1) * (height_ + 1) ); + const std::size_t ii_size = static_cast(width_ + 1) * static_cast(height_ + 1); + first_order_integral_image_.resize (ii_size); + finite_values_integral_image_.resize (ii_size); if (compute_second_order_integral_images_) - second_order_integral_image_.resize ( (width_ + 1) * (height_ + 1) ); + second_order_integral_image_.resize (ii_size); } computeIntegralImages (data, row_stride, element_stride); } diff --git a/features/include/pcl/features/impl/pfh.hpp b/features/include/pcl/features/impl/pfh.hpp index f1828ddeb04..28007834919 100644 --- a/features/include/pcl/features/impl/pfh.hpp +++ b/features/include/pcl/features/impl/pfh.hpp @@ -171,7 +171,7 @@ pcl::PFHEstimation::computeFeature (PointCloudOut std::queue > empty; std::swap (key_list_, empty); - pfh_histogram_.setZero (nr_subdiv_ * nr_subdiv_ * nr_subdiv_); + pfh_histogram_.setZero (static_cast(nr_subdiv_) * nr_subdiv_ * nr_subdiv_); // Allocate enough space to hold the results // \note This resize is irrelevant for a radiusSearch (). diff --git a/features/include/pcl/features/impl/pfhrgb.hpp b/features/include/pcl/features/impl/pfhrgb.hpp index 18bb5baf6d8..e14787e92bd 100644 --- a/features/include/pcl/features/impl/pfhrgb.hpp +++ b/features/include/pcl/features/impl/pfhrgb.hpp @@ -135,7 +135,7 @@ template void pcl::PFHRGBEstimation::computeFeature (PointCloudOut &output) { /// nr_subdiv^3 for RGB and nr_subdiv^3 for the angular features - pfhrgb_histogram_.setZero (2 * nr_subdiv_ * nr_subdiv_ * nr_subdiv_); + pfhrgb_histogram_.setZero (static_cast(2) * nr_subdiv_ * nr_subdiv_ * nr_subdiv_); pfhrgb_tuple_.setZero (7); // Allocate enough space to hold the results diff --git a/features/src/narf.cpp b/features/src/narf.cpp index b391e3fcff5..c2532d4bc07 100644 --- a/features/src/narf.cpp +++ b/features/src/narf.cpp @@ -109,9 +109,9 @@ Narf::deepCopy (const Narf& other) { surface_patch_pixel_size_ = other.surface_patch_pixel_size_; delete[] surface_patch_; - surface_patch_ = new float[surface_patch_pixel_size_*surface_patch_pixel_size_]; + surface_patch_ = new float[static_cast(surface_patch_pixel_size_)*static_cast(surface_patch_pixel_size_)]; } - std::copy(other.surface_patch_, other.surface_patch_ + surface_patch_pixel_size_*surface_patch_pixel_size_, surface_patch_); + std::copy(other.surface_patch_, other.surface_patch_ + static_cast(surface_patch_pixel_size_)*static_cast(surface_patch_pixel_size_), surface_patch_); surface_patch_world_size_ = other.surface_patch_world_size_; surface_patch_rotation_ = other.surface_patch_rotation_; @@ -521,7 +521,7 @@ Narf::saveBinary (std::ostream& file) const pcl::saveBinary(transformation_.matrix(), file); file.write(reinterpret_cast(&surface_patch_pixel_size_), sizeof(surface_patch_pixel_size_)); file.write(reinterpret_cast(surface_patch_), - surface_patch_pixel_size_*surface_patch_pixel_size_*sizeof(*surface_patch_)); + sizeof(*surface_patch_)*surface_patch_pixel_size_*surface_patch_pixel_size_); file.write(reinterpret_cast(&surface_patch_world_size_), sizeof(surface_patch_world_size_)); file.write(reinterpret_cast(&surface_patch_rotation_), sizeof(surface_patch_rotation_)); file.write(reinterpret_cast(&descriptor_size_), sizeof(descriptor_size_)); @@ -573,9 +573,9 @@ Narf::loadBinary (std::istream& file) pcl::loadBinary(position_.matrix(), file); pcl::loadBinary(transformation_.matrix(), file); file.read(reinterpret_cast(&surface_patch_pixel_size_), sizeof(surface_patch_pixel_size_)); - surface_patch_ = new float[surface_patch_pixel_size_*surface_patch_pixel_size_]; + surface_patch_ = new float[static_cast(surface_patch_pixel_size_)*static_cast(surface_patch_pixel_size_)]; file.read(reinterpret_cast(surface_patch_), - surface_patch_pixel_size_*surface_patch_pixel_size_*sizeof(*surface_patch_)); + sizeof(*surface_patch_)*surface_patch_pixel_size_*surface_patch_pixel_size_); file.read(reinterpret_cast(&surface_patch_world_size_), sizeof(surface_patch_world_size_)); file.read(reinterpret_cast(&surface_patch_rotation_), sizeof(surface_patch_rotation_)); file.read(reinterpret_cast(&descriptor_size_), sizeof(descriptor_size_)); diff --git a/features/src/range_image_border_extractor.cpp b/features/src/range_image_border_extractor.cpp index 6590b57aa45..7d331368015 100644 --- a/features/src/range_image_border_extractor.cpp +++ b/features/src/range_image_border_extractor.cpp @@ -201,7 +201,7 @@ RangeImageBorderExtractor::extractBorderScoreImages () float* RangeImageBorderExtractor::updatedScoresAccordingToNeighborValues (const float* border_scores) const { - float* new_scores = new float[range_image_->width*range_image_->height]; + float* new_scores = new float[static_cast(range_image_->width)*static_cast(range_image_->height)]; float* new_scores_ptr = new_scores; for (int y=0; y < static_cast (range_image_->height); ++y) for (int x=0; x < static_cast (range_image_->width); ++x) @@ -213,7 +213,7 @@ std::vector RangeImageBorderExtractor::updatedScoresAccordingToNeighborValues (const std::vector& border_scores) const { std::vector new_border_scores; - new_border_scores.reserve (range_image_->width*range_image_->height); + new_border_scores.reserve (static_cast(range_image_->width)*static_cast(range_image_->height)); for (int y=0; y < static_cast (range_image_->height); ++y) for (int x=0; x < static_cast (range_image_->width); ++x) new_border_scores.push_back (updatedScoreAccordingToNeighborValues(x, y, border_scores.data ())); @@ -248,15 +248,14 @@ RangeImageBorderExtractor::findAndEvaluateShadowBorders () //MEASURE_FUNCTION_TIME; - int width = range_image_->width, + std::size_t width = range_image_->width, height = range_image_->height; shadow_border_informations_ = new ShadowBorderIndices*[width*height]; for (int y = 0; y < static_cast (height); ++y) { for (int x = 0; x < static_cast (width); ++x) { - int index = y*width+x; - ShadowBorderIndices*& shadow_border_indices = shadow_border_informations_[index]; + ShadowBorderIndices*& shadow_border_indices = shadow_border_informations_[y*width+x]; shadow_border_indices = nullptr; int shadow_border_idx; @@ -611,8 +610,8 @@ RangeImageBorderExtractor::blurSurfaceChanges () const RangeImage& range_image = *range_image_; - auto* blurred_directions = new Eigen::Vector3f[range_image.width*range_image.height]; - float* blurred_scores = new float[range_image.width*range_image.height]; + auto* blurred_directions = new Eigen::Vector3f[static_cast(range_image.width)*static_cast(range_image.height)]; + float* blurred_scores = new float[static_cast(range_image.width)*static_cast(range_image.height)]; for (int y=0; y(range_image.height); ++y) { for (int x=0; x(range_image.width); ++x)