W3cubDocs

/PointCloudLibrary

A point structure representing Euclidean xyz coordinates, and the RGB color, together with normal coordinates and the surface curvature estimate. More...

#include <pcl/impl/point_types.hpp>

Public Member Functions

PointXYZRGBNormal (const _PointXYZRGBNormal &p)
PointXYZRGBNormal (float _curvature=0.f)
PointXYZRGBNormal (float _x, float _y, float _z)
PointXYZRGBNormal (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
PointXYZRGBNormal (float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
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)

Friends

std::ostream & operator<< (std::ostream &os, const PointXYZRGBNormal &p)

Additional Inherited Members

- Public Attributes inherited from pcl::_PointXYZRGBNormal
PCL_ADD_POINT4D
PCL_ADD_NORMAL4D
union {
struct {
PCL_ADD_UNION_RGB
float curvature
}
float data_c [4]
};
PCL_ADD_EIGEN_MAPS_RGB

Detailed Description

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:

// pack r/g/b into rgb
std::uint8_t r = 255, g = 0, b = 0; // Example: Red color
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:

// unpack rgb into r/g/b
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 1059 of file point_types.hpp.

Constructor & Destructor Documentation

PointXYZRGBNormal() [1/6]

pcl::PointXYZRGBNormal::PointXYZRGBNormal ( const _PointXYZRGBNormal & p )
inline

Definition at line 1061 of file point_types.hpp.

References pcl::_PointXYZRGBNormal::curvature.

PointXYZRGBNormal() [2/6]

pcl::PointXYZRGBNormal::PointXYZRGBNormal ( float _curvature = 0.f )
inline

Definition at line 1069 of file point_types.hpp.

PointXYZRGBNormal() [3/6]

pcl::PointXYZRGBNormal::PointXYZRGBNormal ( float _x,
float _y,
float _z
)
inline

Definition at line 1072 of file point_types.hpp.

PointXYZRGBNormal() [4/6]

pcl::PointXYZRGBNormal::PointXYZRGBNormal ( std::uint8_t _r,
std::uint8_t _g,
std::uint8_t _b
)
inline

Definition at line 1075 of file point_types.hpp.

PointXYZRGBNormal() [5/6]

pcl::PointXYZRGBNormal::PointXYZRGBNormal ( float _x,
float _y,
float _z,
std::uint8_t _r,
std::uint8_t _g,
std::uint8_t _b
)
inline

Definition at line 1078 of file point_types.hpp.

PointXYZRGBNormal() [6/6]

pcl::PointXYZRGBNormal::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
)
inline

Definition at line 1081 of file point_types.hpp.

References pcl::_PointXYZRGBNormal::curvature.

Friends And Related Function Documentation

operator<<

std::ostream& operator<< ( std::ostream & os,
const PointXYZRGBNormal & p
)
friend

The documentation for this struct was generated from the following file:

© 2009–2012, Willow Garage, Inc.
© 2012–, Open Perception, Inc.
Licensed under the BSD License.
https://pointclouds.org/documentation/structpcl_1_1_point_x_y_z_r_g_b_normal.html