Public Member Functions | Friends
pcl::PointXYZRGBNormal Struct Reference

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: More...

#include <point_types.hpp>

Inheritance diagram for pcl::PointXYZRGBNormal:
Inheritance graph
[legend]

List of all members.

Public Member Functions

Eigen::Vector3i getRGBVector3i ()
const Eigen::Vector3i getRGBVector3i () const
Eigen::Vector4i getRGBVector4i ()
const Eigen::Vector4i getRGBVector4i () const
 PointXYZRGBNormal (const _PointXYZRGBNormal &p)
 PointXYZRGBNormal ()

Friends

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

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
 uint8_t r = 255, g = 0, b = 0;    // Example: Red color
 uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b);
 p.rgb = *reinterpret_cast<float*>(&rgb);

To unpack the data into separate values, use:

 PointXYZRGB p;
 // unpack rgb into r/g/b
 uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
 uint8_t r = (rgb >> 16) & 0x0000ff;
 uint8_t g = (rgb >> 8)  & 0x0000ff;
 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 900 of file point_types.hpp.


Constructor & Destructor Documentation

Definition at line 902 of file point_types.hpp.

Definition at line 910 of file point_types.hpp.


Member Function Documentation

Eigen::Vector3i pcl::PointXYZRGBNormal::getRGBVector3i ( ) [inline]

Definition at line 919 of file point_types.hpp.

const Eigen::Vector3i pcl::PointXYZRGBNormal::getRGBVector3i ( ) const [inline]

Definition at line 923 of file point_types.hpp.

Eigen::Vector4i pcl::PointXYZRGBNormal::getRGBVector4i ( ) [inline]

Definition at line 924 of file point_types.hpp.

const Eigen::Vector4i pcl::PointXYZRGBNormal::getRGBVector4i ( ) const [inline]

Definition at line 928 of file point_types.hpp.


Friends And Related Function Documentation

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

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


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:43:02