Points: use Color::getPackedARGB() for pcl colors
This commit is contained in:
@@ -2119,14 +2119,8 @@ void PcdWriter::write(const std::string& filename)
|
||||
|
||||
if (hasColors) {
|
||||
for (std::size_t i=0; i<numPoints; i++) {
|
||||
App::Color c = colors[i];
|
||||
// http://docs.pointclouds.org/1.3.0/structpcl_1_1_r_g_b.html
|
||||
uint32_t packed = static_cast<uint32_t>(c.a*255.0f + 0.5f) << 24 |
|
||||
static_cast<uint32_t>(c.r*255.0f + 0.5f) << 16 |
|
||||
static_cast<uint32_t>(c.g*255.0f + 0.5f) << 8 |
|
||||
static_cast<uint32_t>(c.b*255.0f + 0.5f);
|
||||
|
||||
data(i,col) = packed;
|
||||
data(i,col) = colors[i].getPackedARGB();
|
||||
}
|
||||
col += 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user