Skip to content

Instantly share code, notes, and snippets.

@samuelsmal
Created July 23, 2016 13:06
Show Gist options
  • Save samuelsmal/1f1e3d810960dac5f3d9c0ca5e7049fa to your computer and use it in GitHub Desktop.
Save samuelsmal/1f1e3d810960dac5f3d9c0ca5e7049fa to your computer and use it in GitHub Desktop.
accessing the colour information of a point in the point cloud library
// 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