Skip to content

Commit e3741a3

Browse files
committed
!!! resetting alpha parameter to 0 (this was introduced earlier in trunk, but hasn't made it into any releases yet), as a 255 value corrupts the float<->integer RGB casts precision. We now have an unit test for RGB precision, so this should not happen again.
git-svn-id: svn+ssh://svn.pointclouds.org/pcl/trunk@8345 a9d63959-f2ad-4865-b262-bf0e56cfafb6
1 parent 01a5c5f commit e3741a3

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

common/include/pcl/impl/point_types.hpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ namespace pcl
290290

291291
inline RGB ()
292292
{
293-
r = g = b = 0;
294-
a = 255;
293+
r = g = b = a = 0;
295294
}
296295
};
297296
inline std::ostream&
@@ -486,8 +485,7 @@ namespace pcl
486485
{
487486
x = y = z = 0.0f;
488487
data[3] = 1.0f;
489-
r = g = b = 0;
490-
a = 255;
488+
r = g = b = a = 0;
491489
}
492490
inline Eigen::Vector3i getRGBVector3i ()
493491
{
@@ -573,8 +571,7 @@ namespace pcl
573571
{
574572
x = y = z = 0.0f;
575573
data[3] = 1.0f;
576-
r = g = b = 0;
577-
a = 255;
574+
r = g = b = a = 0;
578575
}
579576
inline PointXYZRGB (uint8_t _r, uint8_t _g, uint8_t _b)
580577
{
@@ -583,7 +580,7 @@ namespace pcl
583580
r = _r;
584581
g = _g;
585582
b = _b;
586-
a = 255;
583+
a = 0;
587584
}
588585

589586
inline Eigen::Vector3i getRGBVector3i ()
@@ -624,7 +621,7 @@ namespace pcl
624621
x = y = z = 0.0f;
625622
data[3] = 1.0f;
626623
r = g = b = 0;
627-
a = 255;
624+
a = 0;
628625
label = 255;
629626
}
630627
inline PointXYZRGBL (uint8_t _r, uint8_t _g, uint8_t _b, uint32_t _label)
@@ -634,7 +631,7 @@ namespace pcl
634631
r = _r;
635632
g = _g;
636633
b = _b;
637-
a = 255;
634+
a = 0;
638635
label = _label;
639636
}
640637
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
@@ -945,8 +942,7 @@ namespace pcl
945942
{
946943
x = y = z = 0.0f;
947944
data[3] = 1.0f;
948-
r = g = b = 0;
949-
a = 255;
945+
r = g = b = a = 0;
950946
normal_x = normal_y = normal_z = data_n[3] = 0.0f;
951947
curvature = 0;
952948
}

0 commit comments

Comments
 (0)