|
constexpr | PointXYZRGBNormal (const _PointXYZRGBNormal &p) |
|
constexpr | PointXYZRGBNormal (float _curvature=0.f) |
|
constexpr | PointXYZRGBNormal (float _x, float _y, float _z) |
|
constexpr | PointXYZRGBNormal (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b) |
|
constexpr | PointXYZRGBNormal (float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b) |
|
constexpr | PointXYZRGBNormal (float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, float n_x, float n_y, float n_z, float _curvature=0.f) |
|
constexpr | PointXYZRGBNormal (float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a, float n_x, float n_y, float n_z, float _curvature=0.f) |
|
A point structure representing Euclidean xyz coordinates, and the RGB color, together with normal coordinates and the surface curvature estimate.
Due to historical reasons (PCL was first developed as a ROS package), the RGB information is packed into an integer and casted to a float. This is something we wish to remove in the near future, but in the meantime, the following code snippet should help you pack and unpack RGB colors in your PointXYZRGB structure:
std::uint8_t r = 255, g = 0, b = 0;
std::uint32_t rgb = ((std::uint32_t)r << 16 | (std::uint32_t)g << 8 | (std::uint32_t)b);
p.rgb = *reinterpret_cast<float*>(&rgb);
To unpack the data into separate values, use:
std::uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
std::uint8_t r = (rgb >> 16) & 0x0000ff;
std::uint8_t g = (rgb >> 8) & 0x0000ff;
std::uint8_t b = (rgb) & 0x0000ff;
Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
Definition at line 912 of file point_types.hpp.