Created
July 23, 2016 13:06
-
-
Save samuelsmal/1f1e3d810960dac5f3d9c0ca5e7049fa to your computer and use it in GitHub Desktop.
accessing the colour information of a point in the point cloud library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// p is a point | |
const auto pv = p.getVector3fMap(); | |
const uint32_t rgb = *reinterpret_cast<const int*>(&p.rgb); | |
int r = int((rgb >> 16) & 0x0000ff); | |
int g = int((rgb >> 8) & 0x0000ff); | |
int b = int((rgb) & 0x0000ff); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment