Skip to content

Commit

Permalink
Merge pull request #2761 from SunBlack/remove_deprecated_register_sto…
Browse files Browse the repository at this point in the history
…rage_class_specifier

Fix warning: 'register' storage class specifier is deprecated
  • Loading branch information
taketwo authored Jan 10, 2019
2 parents 74a1ff7 + b0fffb5 commit a023a4f
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 90 deletions.
2 changes: 1 addition & 1 deletion filters/include/pcl/filters/impl/box_clipper3D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ pcl::BoxClipper3D<PointT>::clipPointCloud3D (const pcl::PointCloud<PointT>& clou
if (indices.empty ())
{
clipped.reserve (cloud_in.size ());
for (register unsigned pIdx = 0; pIdx < cloud_in.size (); ++pIdx)
for (unsigned pIdx = 0; pIdx < cloud_in.size (); ++pIdx)
if (clipPoint3D (cloud_in[pIdx]))
clipped.push_back (pIdx);
}
Expand Down
8 changes: 4 additions & 4 deletions filters/include/pcl/filters/impl/plane_clipper3D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,22 +186,22 @@ pcl::PlaneClipper3D<PointT>::clipPointCloud3D (const pcl::PointCloud<PointT>& cl
#if 0
Eigen::MatrixXf points = cloud_in.getMatrixXfMap (4, sizeof (PointT) / sizeof (float), offsetof(PointT,x) / sizeof (float));
Eigen::VectorXf distances = plane_params_.transpose () * points;
for (register unsigned rIdx = 0; rIdx < cloud_in.size (); ++ rIdx)
for (unsigned rIdx = 0; rIdx < cloud_in.size (); ++ rIdx)
{
if (distances (rIdx, 0) >= -plane_params_[3])
clipped.push_back (rIdx);
}
#else
Eigen::Matrix4Xf points (4, cloud_in.size ());
for (register unsigned rIdx = 0; rIdx < cloud_in.size (); ++ rIdx)
for (unsigned rIdx = 0; rIdx < cloud_in.size (); ++ rIdx)
{
points (0, rIdx) = cloud_in[rIdx].x;
points (1, rIdx) = cloud_in[rIdx].y;
points (2, rIdx) = cloud_in[rIdx].z;
points (3, rIdx) = 1;
}
Eigen::VectorXf distances = plane_params_.transpose () * points;
for (register unsigned rIdx = 0; rIdx < cloud_in.size (); ++ rIdx)
for (unsigned rIdx = 0; rIdx < cloud_in.size (); ++ rIdx)
{
if (distances (rIdx, 0) >= 0)
clipped.push_back (rIdx);
Expand All @@ -213,7 +213,7 @@ pcl::PlaneClipper3D<PointT>::clipPointCloud3D (const pcl::PointCloud<PointT>& cl
//cout << "distances: " << distances.rows () << " x " << distances.cols () << endl;
/*/
for (register unsigned pIdx = 0; pIdx < cloud_in.size (); ++pIdx)
for (unsigned pIdx = 0; pIdx < cloud_in.size (); ++pIdx)
if (clipPoint3D (cloud_in[pIdx]))
clipped.push_back (pIdx);
//*/
Expand Down
36 changes: 18 additions & 18 deletions io/src/oni_grabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,20 +351,20 @@ ONIGrabber::convertToXYZPointCloud(const boost::shared_ptr<openni_wrapper::Depth

cloud->points.resize (cloud->height * cloud->width);

register float constant = 1.0f / device_->getDepthFocalLength (depth_width_);
float constant = 1.0f / device_->getDepthFocalLength (depth_width_);

if (device_->isDepthRegistered ())
cloud->header.frame_id = rgb_frame_id_;
else
cloud->header.frame_id = depth_frame_id_;

register int centerX = (cloud->width >> 1);
int centerX = (cloud->width >> 1);
int centerY = (cloud->height >> 1);

float bad_point = std::numeric_limits<float>::quiet_NaN ();

// we have to use Data, since operator[] uses assert -> Debug-mode very slow!
register const unsigned short* depth_map = depth_image->getDepthMetaData ().Data ();
const unsigned short* depth_map = depth_image->getDepthMetaData ().Data ();
if (depth_image->getWidth () != depth_width_ || depth_image->getHeight () != depth_height_)
{
static unsigned buffer_size = 0;
Expand All @@ -379,10 +379,10 @@ ONIGrabber::convertToXYZPointCloud(const boost::shared_ptr<openni_wrapper::Depth
depth_map = depth_buffer.get ();
}

register int depth_idx = 0;
int depth_idx = 0;
for (int v = -centerY; v < centerY; ++v)
{
for (register int u = -centerX; u < centerX; ++u, ++depth_idx)
for (int u = -centerX; u < centerX; ++u, ++depth_idx)
{
pcl::PointXYZ& pt = cloud->points[depth_idx];
// Check for invalid measurements
Expand Down Expand Up @@ -421,10 +421,10 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr ONIGrabber::convertToXYZRGBPointCloud (
cloud->points.resize(cloud->height * cloud->width);

float constant = 1.0f / device_->getImageFocalLength(cloud->width);
register int centerX = (cloud->width >> 1);
int centerX = (cloud->width >> 1);
int centerY = (cloud->height >> 1);

register const XnDepthPixel* depth_map = depth_image->getDepthMetaData().Data();
const XnDepthPixel* depth_map = depth_image->getDepthMetaData().Data();
if (depth_image->getWidth() != depth_width_ || depth_image->getHeight() != depth_height_)
{
static unsigned buffer_size = 0;
Expand All @@ -450,15 +450,15 @@ pcl::PointCloud<pcl::PointXYZRGB>::Ptr ONIGrabber::convertToXYZRGBPointCloud (
image->fillRGB(image_width_, image_height_, rgb_buffer, image_width_ * 3);

// depth_image already has the desired dimensions, but rgb_msg may be higher res.
register int color_idx = 0, depth_idx = 0;
int color_idx = 0, depth_idx = 0;
RGBValue color;
color.Alpha = 0;

float bad_point = std::numeric_limits<float>::quiet_NaN();

for (int v = -centerY; v < centerY; ++v)
{
for (register int u = -centerX; u < centerX; ++u, color_idx += 3, ++depth_idx)
for (int u = -centerX; u < centerX; ++u, color_idx += 3, ++depth_idx)
{
pcl::PointXYZRGB& pt = cloud->points[depth_idx];
/// @todo Different values for these cases
Expand Down Expand Up @@ -505,10 +505,10 @@ pcl::PointCloud<pcl::PointXYZRGBA>::Ptr ONIGrabber::convertToXYZRGBAPointCloud (
cloud->points.resize(cloud->height * cloud->width);

float constant = 1.0f / device_->getImageFocalLength(cloud->width);
register int centerX = (cloud->width >> 1);
int centerX = (cloud->width >> 1);
int centerY = (cloud->height >> 1);

register const XnDepthPixel* depth_map = depth_image->getDepthMetaData().Data();
const XnDepthPixel* depth_map = depth_image->getDepthMetaData().Data();
if (depth_image->getWidth() != depth_width_ || depth_image->getHeight() != depth_height_)
{
static unsigned buffer_size = 0;
Expand All @@ -534,15 +534,15 @@ pcl::PointCloud<pcl::PointXYZRGBA>::Ptr ONIGrabber::convertToXYZRGBAPointCloud (
image->fillRGB(image_width_, image_height_, rgb_buffer, image_width_ * 3);

// depth_image already has the desired dimensions, but rgb_msg may be higher res.
register int color_idx = 0, depth_idx = 0;
int color_idx = 0, depth_idx = 0;
RGBValue color;
color.Alpha = 0;

float bad_point = std::numeric_limits<float>::quiet_NaN();

for (int v = -centerY; v < centerY; ++v)
{
for (register int u = -centerX; u < centerX; ++u, color_idx += 3, ++depth_idx)
for (int u = -centerX; u < centerX; ++u, color_idx += 3, ++depth_idx)
{
pcl::PointXYZRGBA& pt = cloud->points[depth_idx];
/// @todo Different values for these cases
Expand Down Expand Up @@ -584,11 +584,11 @@ pcl::PointCloud<pcl::PointXYZI>::Ptr ONIGrabber::convertToXYZIPointCloud(const b
cloud->points.resize(cloud->height * cloud->width);

float constant = 1.0f / device_->getImageFocalLength(cloud->width);
register int centerX = (cloud->width >> 1);
int centerX = (cloud->width >> 1);
int centerY = (cloud->height >> 1);

register const XnDepthPixel* depth_map = depth_image->getDepthMetaData().Data();
register const XnIRPixel* ir_map = ir_image->getMetaData().Data();
const XnDepthPixel* depth_map = depth_image->getDepthMetaData().Data();
const XnIRPixel* ir_map = ir_image->getMetaData().Data();

if (depth_image->getWidth() != depth_width_ || depth_image->getHeight() != depth_height_)
{
Expand All @@ -610,12 +610,12 @@ pcl::PointCloud<pcl::PointXYZI>::Ptr ONIGrabber::convertToXYZIPointCloud(const b
ir_map = ir_buffer.get ();
}

register int depth_idx = 0;
int depth_idx = 0;
float bad_point = std::numeric_limits<float>::quiet_NaN();

for (int v = -centerY; v < centerY; ++v)
{
for (register int u = -centerX; u < centerX; ++u, ++depth_idx)
for (int u = -centerX; u < centerX; ++u, ++depth_idx)
{
pcl::PointXYZI& pt = cloud->points[depth_idx];
/// @todo Different values for these cases
Expand Down
52 changes: 26 additions & 26 deletions io/src/openni_camera/openni_image_bayer_grbg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
if (debayering_method_ == Bilinear)
{
// first line GRGRGR
for (register unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
gray_buffer[0] = bayer_pixel[0]; // green pixel
gray_buffer[1] = AVG3 (bayer_pixel[0], bayer_pixel[2], bayer_pixel[1 + line_skip]); // interpolated green pixel
Expand All @@ -101,22 +101,22 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
gray_buffer += 2 + gray_line_skip;
bayer_pixel += 2;

for (register unsigned yIdx = 1; yIdx < height - 1; yIdx += 2)
for (unsigned yIdx = 1; yIdx < height - 1; yIdx += 2)
{
// blue line
gray_buffer[0] = AVG3 (bayer_pixel[-line_skip], bayer_pixel[line_skip], bayer_pixel[1]);
gray_buffer[1] = bayer_pixel[1];
gray_buffer += 2;
bayer_pixel += 2;
for (register unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
gray_buffer[0] = AVG4 (bayer_pixel[-line_skip], bayer_pixel[line_skip], bayer_pixel[-1], bayer_pixel[1]);
gray_buffer[1] = bayer_pixel[1];
}
gray_buffer += gray_line_skip;

// red line
for (register unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
gray_buffer[0] = bayer_pixel[0]; // green pixel
gray_buffer[1] = AVG4 (bayer_pixel[0], bayer_pixel[2], bayer_pixel[-line_skip + 1], bayer_pixel[line_skip + 1]); // interpolated green pixel
Expand All @@ -132,7 +132,7 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
gray_buffer[1] = bayer_pixel[1];
gray_buffer += 2;
bayer_pixel += 2;
for (register unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
gray_buffer[0] = AVG3 (bayer_pixel[-1], bayer_pixel[1], bayer_pixel[-line_skip]);
gray_buffer[1] = bayer_pixel[1];
Expand All @@ -142,7 +142,7 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
{
int dv, dh;
// first line GRGRGR
for (register unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
gray_buffer[0] = bayer_pixel[0]; // green pixel
gray_buffer[1] = AVG3 (bayer_pixel[0], bayer_pixel[2], bayer_pixel[1 + line_skip]); // interpolated green pixel
Expand All @@ -152,14 +152,14 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
gray_buffer += 2 + gray_line_skip;
bayer_pixel += 2;

for (register unsigned yIdx = 1; yIdx < height - 1; yIdx += 2)
for (unsigned yIdx = 1; yIdx < height - 1; yIdx += 2)
{
// blue line
gray_buffer[0] = AVG3 (bayer_pixel[-line_skip], bayer_pixel[line_skip], bayer_pixel[1]);
gray_buffer[1] = bayer_pixel[1];
gray_buffer += 2;
bayer_pixel += 2;
for (register unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
dv = abs (bayer_pixel[-line_skip] - bayer_pixel[line_skip]);
dh = abs (bayer_pixel[-1] - bayer_pixel[1]);
Expand All @@ -175,7 +175,7 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
gray_buffer += gray_line_skip;

// red line
for (register unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
gray_buffer[0] = bayer_pixel[0];

Expand All @@ -199,7 +199,7 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
gray_buffer[1] = bayer_pixel[1];
gray_buffer += 2;
bayer_pixel += 2;
for (register unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
gray_buffer[0] = AVG3 (bayer_pixel[-1], bayer_pixel[1], bayer_pixel[-line_skip]);
gray_buffer[1] = bayer_pixel[1];
Expand All @@ -209,7 +209,7 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
{
int dv, dh;
// first line GRGRGR
for (register unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
gray_buffer[0] = bayer_pixel[0]; // green pixel
gray_buffer[1] = AVG3 (bayer_pixel[0], bayer_pixel[2], bayer_pixel[1 + line_skip]); // interpolated green pixel
Expand All @@ -219,14 +219,14 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
gray_buffer += 2 + gray_line_skip;
bayer_pixel += 2;

for (register unsigned yIdx = 1; yIdx < height - 1; yIdx += 2)
for (unsigned yIdx = 1; yIdx < height - 1; yIdx += 2)
{
// blue line
gray_buffer[0] = AVG3 (bayer_pixel[-line_skip], bayer_pixel[line_skip], bayer_pixel[1]);
gray_buffer[1] = bayer_pixel[1];
gray_buffer += 2;
bayer_pixel += 2;
for (register unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
dv = abs (bayer_pixel[-line_skip] - bayer_pixel[line_skip]);
dh = abs (bayer_pixel[-1] - bayer_pixel[1]);
Expand All @@ -242,7 +242,7 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
gray_buffer += gray_line_skip;

// red line
for (register unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 0; xIdx < width - 2; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
gray_buffer[0] = bayer_pixel[0];

Expand All @@ -265,7 +265,7 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
gray_buffer[1] = bayer_pixel[1];
gray_buffer += 2;
bayer_pixel += 2;
for (register unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
for (unsigned xIdx = 2; xIdx < width; xIdx += 2, gray_buffer += 2, bayer_pixel += 2)
{
gray_buffer[0] = AVG3 (bayer_pixel[-1], bayer_pixel[1], bayer_pixel[-line_skip]);
gray_buffer[1] = bayer_pixel[1];
Expand All @@ -281,15 +281,15 @@ openni_wrapper::ImageBayerGRBG::fillGrayscale (
THROW_OPENNI_EXCEPTION ("Downsampling only possible for multiple of 2 in both dimensions. Request was %d x %d -> %d x %d.", image_md_->XRes (), image_md_->YRes (), width, height);

// fast method -> simply takes each or each 2nd pixel-group to get gray values out
register unsigned bayerXStep = image_md_->XRes () / width;
register unsigned bayerYSkip = (image_md_->YRes () / height - 1) * image_md_->XRes ();
unsigned bayerXStep = image_md_->XRes () / width;
unsigned bayerYSkip = (image_md_->YRes () / height - 1) * image_md_->XRes ();

// Downsampling and debayering at once
register const XnUInt8* bayer_buffer = image_md_->Data ();
const XnUInt8* bayer_buffer = image_md_->Data ();

for (register unsigned yIdx = 0; yIdx < height; ++yIdx, bayer_buffer += bayerYSkip, gray_buffer += gray_line_skip) // skip a line
for (unsigned yIdx = 0; yIdx < height; ++yIdx, bayer_buffer += bayerYSkip, gray_buffer += gray_line_skip) // skip a line
{
for (register unsigned xIdx = 0; xIdx < width; ++xIdx, ++gray_buffer, bayer_buffer += bayerXStep)
for (unsigned xIdx = 0; xIdx < width; ++xIdx, ++gray_buffer, bayer_buffer += bayerXStep)
{
*gray_buffer = AVG (bayer_buffer[0], bayer_buffer[ image_md_->XRes () + 1]);
}
Expand All @@ -314,7 +314,7 @@ openni_wrapper::ImageBayerGRBG::fillRGB (

if (image_md_->XRes () == width && image_md_->YRes () == height)
{
register const unsigned char* bayer_pixel = image_md_->Data ();
const unsigned char* bayer_pixel = image_md_->Data ();

int bayer_line_step = image_md_->XRes ();
int bayer_line_step2 = image_md_->XRes () << 1;
Expand All @@ -335,15 +335,15 @@ openni_wrapper::ImageBayerGRBG::fillRGB (
THROW_OPENNI_EXCEPTION ("Downsampling only possible for integer scales in both dimensions. Request was %d x %d -> %d x %d.", image_md_->XRes (), image_md_->YRes (), width, height);

// get each or each 2nd pixel group to find rgb values!
register unsigned bayerXStep = image_md_->XRes () / width;
register unsigned bayerYSkip = (image_md_->YRes () / height - 1) * image_md_->XRes ();
unsigned bayerXStep = image_md_->XRes () / width;
unsigned bayerYSkip = (image_md_->YRes () / height - 1) * image_md_->XRes ();

// Downsampling and debayering at once
register const XnUInt8* bayer_buffer = image_md_->Data ();
const XnUInt8* bayer_buffer = image_md_->Data ();

for (register unsigned yIdx = 0; yIdx < height; ++yIdx, bayer_buffer += bayerYSkip, rgb_buffer += rgb_line_skip) // skip a line
for (unsigned yIdx = 0; yIdx < height; ++yIdx, bayer_buffer += bayerYSkip, rgb_buffer += rgb_line_skip) // skip a line
{
for (register unsigned xIdx = 0; xIdx < width; ++xIdx, rgb_buffer += 3, bayer_buffer += bayerXStep)
for (unsigned xIdx = 0; xIdx < width; ++xIdx, rgb_buffer += 3, bayer_buffer += bayerXStep)
{
rgb_buffer[ 2 ] = bayer_buffer[ image_md_->XRes () ];
rgb_buffer[ 1 ] = AVG (bayer_buffer[0], bayer_buffer[ image_md_->XRes () + 1]);
Expand Down
Loading

0 comments on commit a023a4f

Please sign in to comment.