Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Remove register #25

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/include/pcl/common/impl/bivariate_polynomial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ pcl::operator<< (std::ostream& os, const pcl::BivariatePolynomialT<real>& p)
template<typename real> void
pcl::BivariatePolynomialT<real>::writeBinary (std::ostream& os) const
{
os.write (reinterpret_cast<char*> (&degree), sizeof (int));
os.write (reinterpret_cast<const char*> (&degree), sizeof (int));
unsigned int paramCnt = getNoOfParametersFromDegree (this->degree);
os.write (reinterpret_cast<char*> (this->parameters), paramCnt * sizeof (real));
os.write (reinterpret_cast<const char*> (this->parameters), paramCnt * sizeof (real));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
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 @@ -208,7 +208,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
10 changes: 5 additions & 5 deletions io/include/pcl/io/impl/lzf_image_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ pcl::io::LZFDepth16ImageReader::read (
cloud.height = getHeight ();
cloud.is_dense = true;
cloud.resize (getWidth () * getHeight ());
register int depth_idx = 0, point_idx = 0;
int depth_idx = 0, point_idx = 0;
double constant_x = 1.0 / parameters_.focal_length_x,
constant_y = 1.0 / parameters_.focal_length_y;
for (uint32_t v = 0; v < cloud.height; ++v)
{
for (register uint32_t u = 0; u < cloud.width; ++u, ++point_idx, depth_idx += 2)
for (uint32_t u = 0; u < cloud.width; ++u, ++point_idx, depth_idx += 2)
{
PointT &pt = cloud.points[point_idx];
unsigned short val;
Expand Down Expand Up @@ -220,7 +220,7 @@ pcl::io::LZFRGB24ImageReader::read (
cloud.height = getHeight ();
cloud.resize (getWidth () * getHeight ());

register int rgb_idx = 0;
int rgb_idx = 0;
unsigned char *color_r = reinterpret_cast<unsigned char*> (&uncompressed_data[0]);
unsigned char *color_g = reinterpret_cast<unsigned char*> (&uncompressed_data[getWidth () * getHeight ()]);
unsigned char *color_b = reinterpret_cast<unsigned char*> (&uncompressed_data[2 * getWidth () * getHeight ()]);
Expand Down Expand Up @@ -325,7 +325,7 @@ pcl::io::LZFYUV422ImageReader::read (
unsigned char *color_y = reinterpret_cast<unsigned char*> (&uncompressed_data[wh2]);
unsigned char *color_v = reinterpret_cast<unsigned char*> (&uncompressed_data[wh2 + getWidth () * getHeight ()]);

register int y_idx = 0;
int y_idx = 0;
for (int i = 0; i < wh2; ++i, y_idx += 2)
{
int v = color_v[i] - 128;
Expand Down Expand Up @@ -444,7 +444,7 @@ pcl::io::LZFBayer8ImageReader::read (
cloud.width = getWidth ();
cloud.height = getHeight ();
cloud.resize (getWidth () * getHeight ());
register int rgb_idx = 0;
int rgb_idx = 0;
for (size_t i = 0; i < cloud.size (); ++i, rgb_idx += 3)
{
PointT &pt = cloud.points[i];
Expand Down
6 changes: 3 additions & 3 deletions io/src/debayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pcl::io::DeBayer::debayerBilinear (

// padding skip for destination image
unsigned rgb_line_skip = rgb_line_step - width * 3;
register unsigned yIdx, xIdx;
unsigned yIdx, xIdx;
// first two pixel values for first two lines
// Bayer 0 1 2
// 0 G r g
Expand Down Expand Up @@ -428,7 +428,7 @@ pcl::io::DeBayer::debayerEdgeAware (

// padding skip for destination image
unsigned rgb_line_skip = rgb_line_step - width * 3;
register unsigned yIdx, xIdx;
unsigned yIdx, xIdx;
int dh, dv;

// first two pixel values for first two lines
Expand Down Expand Up @@ -816,7 +816,7 @@ pcl::io::DeBayer::debayerEdgeAwareWeighted (

// padding skip for destination image
unsigned rgb_line_skip = rgb_line_step - width * 3;
register unsigned yIdx, xIdx;
unsigned yIdx, xIdx;
int dh, dv;

// first two pixel values for first two lines
Expand Down
28 changes: 14 additions & 14 deletions io/src/image_yuv422.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ pcl::io::ImageYUV422::fillRGB (unsigned width, unsigned height, unsigned char* r
THROW_IO_EXCEPTION ("Downsampling only possible for power of two scale in both dimensions. Request was %d x %d -> %d x %d.", wrapper_->getWidth (), wrapper_->getHeight (), width, height);
}

register const uint8_t* yuv_buffer = (uint8_t*) wrapper_->getData ();
const uint8_t* yuv_buffer = (uint8_t*) wrapper_->getData ();

unsigned rgb_line_skip = 0;
if (rgb_line_step != 0)
rgb_line_skip = rgb_line_step - width * 3;

if (wrapper_->getWidth () == width && wrapper_->getHeight () == height)
{
for ( register unsigned yIdx = 0; yIdx < height; ++yIdx, rgb_buffer += rgb_line_skip )
for (unsigned yIdx = 0; yIdx < height; ++yIdx, rgb_buffer += rgb_line_skip)
{
for ( register unsigned xIdx = 0; xIdx < width; xIdx += 2, rgb_buffer += 6, yuv_buffer += 4 )
for (unsigned xIdx = 0; xIdx < width; xIdx += 2, rgb_buffer += 6, yuv_buffer += 4)
{
int v = yuv_buffer[2] - 128;
int u = yuv_buffer[0] - 128;
Expand All @@ -110,13 +110,13 @@ pcl::io::ImageYUV422::fillRGB (unsigned width, unsigned height, unsigned char* r
}
else
{
register unsigned yuv_step = wrapper_->getWidth () / width;
register unsigned yuv_x_step = yuv_step << 1;
register unsigned yuv_skip = (wrapper_->getHeight () / height - 1) * ( wrapper_->getWidth () << 1 );
unsigned yuv_step = wrapper_->getWidth () / width;
unsigned yuv_x_step = yuv_step << 1;
unsigned yuv_skip = (wrapper_->getHeight () / height - 1) * ( wrapper_->getWidth () << 1 );

for ( register unsigned yIdx = 0; yIdx < wrapper_->getHeight (); yIdx += yuv_step, yuv_buffer += yuv_skip, rgb_buffer += rgb_line_skip )
for (unsigned yIdx = 0; yIdx < wrapper_->getHeight (); yIdx += yuv_step, yuv_buffer += yuv_skip, rgb_buffer += rgb_line_skip)
{
for ( register unsigned xIdx = 0; xIdx < wrapper_->getWidth (); xIdx += yuv_step, rgb_buffer += 3, yuv_buffer += yuv_x_step )
for (unsigned xIdx = 0; xIdx < wrapper_->getWidth (); xIdx += yuv_step, rgb_buffer += 3, yuv_buffer += yuv_x_step)
{
int v = yuv_buffer[2] - 128;
int u = yuv_buffer[0] - 128;
Expand Down Expand Up @@ -144,14 +144,14 @@ pcl::io::ImageYUV422::fillGrayscale (unsigned width, unsigned height, unsigned c
if (gray_line_step != 0)
gray_line_skip = gray_line_step - width;

register unsigned yuv_step = wrapper_->getWidth () / width;
register unsigned yuv_x_step = yuv_step << 1;
register unsigned yuv_skip = (wrapper_->getHeight () / height - 1) * ( wrapper_->getWidth () << 1 );
register const uint8_t* yuv_buffer = ( (uint8_t*) wrapper_->getData () + 1);
unsigned yuv_step = wrapper_->getWidth () / width;
unsigned yuv_x_step = yuv_step << 1;
unsigned yuv_skip = (wrapper_->getHeight () / height - 1) * ( wrapper_->getWidth () << 1 );
const uint8_t* yuv_buffer = ( (uint8_t*) wrapper_->getData () + 1);

for ( register unsigned yIdx = 0; yIdx < wrapper_->getHeight (); yIdx += yuv_step, yuv_buffer += yuv_skip, gray_buffer += gray_line_skip )
for (unsigned yIdx = 0; yIdx < wrapper_->getHeight (); yIdx += yuv_step, yuv_buffer += yuv_skip, gray_buffer += gray_line_skip)
{
for ( register unsigned xIdx = 0; xIdx < wrapper_->getWidth (); xIdx += yuv_step, ++gray_buffer, yuv_buffer += yuv_x_step )
for (unsigned xIdx = 0; xIdx < wrapper_->getWidth (); xIdx += yuv_step, ++gray_buffer, yuv_buffer += yuv_x_step)
{
*gray_buffer = *yuv_buffer;
}
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 @@ -347,20 +347,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 @@ -375,10 +375,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 @@ -417,10 +417,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 @@ -446,15 +446,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 @@ -501,10 +501,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 @@ -530,15 +530,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 @@ -580,11 +580,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 @@ -606,12 +606,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
Loading