Skip to content

Commit

Permalink
Fix issues describled in #1324 (Color offset problem and wrong variab…
Browse files Browse the repository at this point in the history
…le used)
  • Loading branch information
the-glu committed Sep 8, 2015
1 parent 7cc4806 commit 8167c96
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ pcl::visualization::PointCloudColorHandlerRGBField<PointT>::getColor (vtkSmartPo
!pcl_isfinite (cloud_->points[cp].z))
continue;

memcpy (&rgb, (reinterpret_cast<const char *> (&cloud_->points[cp])) + rgba_index, sizeof (pcl::RGB));
memcpy (&rgb, (reinterpret_cast<const char *> (&cloud_->points[cp])) + fields[rgba_index].offset, sizeof (pcl::RGB));
colors[j ] = rgb.r;
colors[j + 1] = rgb.g;
colors[j + 2] = rgb.b;
Expand All @@ -183,10 +183,10 @@ pcl::visualization::PointCloudColorHandlerRGBField<PointT>::getColor (vtkSmartPo
for (vtkIdType cp = 0; cp < nr_points; ++cp)
{
int idx = static_cast<int> (cp) * 3;
memcpy (&rgb, (reinterpret_cast<const char *> (&cloud_->points[cp])) + rgba_index, sizeof (pcl::RGB));
colors[j ] = rgb.r;
colors[j + 1] = rgb.g;
colors[j + 2] = rgb.b;
memcpy (&rgb, (reinterpret_cast<const char *> (&cloud_->points[cp])) + fields[rgba_index].offset, sizeof (pcl::RGB));
colors[idx ] = rgb.r;
colors[idx + 1] = rgb.g;
colors[idx + 2] = rgb.b;
}
}
return (true);
Expand Down

0 comments on commit 8167c96

Please sign in to comment.