Point Cloud Library (PCL)  1.14.1-dev
point_types.hpp
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010, Willow Garage, Inc.
6  * Copyright (c) 2012-, Open Perception, Inc.
7  *
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * * Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  * * Neither the name of the copyright holder(s) nor the names of its
21  * contributors may be used to endorse or promote products derived
22  * from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  *
37  */
38 
39 #pragma once
40 
41 #include <pcl/memory.h> // for PCL_MAKE_ALIGNED_OPERATOR_NEW
42 #include <pcl/pcl_config.h> // for PCL_XYZ_POINT_TYPES, PCL_NORMAL_POINT_TYPES
43 #include <pcl/pcl_macros.h> // for PCL_EXPORTS
44 #include <pcl/PCLPointField.h> // for PCLPointField
45 #include <pcl/point_types.h> // implementee
46 #include <pcl/register_point_struct.h> // for POINT_CLOUD_REGISTER_POINT_STRUCT, POINT_CLOUD_REGISTER_POINT_WRAPPER
47 
48 #include <boost/mpl/and.hpp> // for boost::mpl::and_
49 #include <boost/mpl/bool.hpp> // for boost::mpl::bool_
50 #include <boost/mpl/contains.hpp> // for boost::mpl::contains
51 #include <boost/mpl/fold.hpp> // for boost::mpl::fold
52 #include <boost/mpl/or.hpp> // for boost::mpl::or_
53 #include <boost/mpl/placeholders.hpp> // for boost::mpl::_1, boost::mpl::_2
54 #include <boost/mpl/vector.hpp> // for boost::mpl::vector
55 
56 #include <Eigen/Core> // for MatrixMap
57 
58 #include <algorithm> // for copy_n, fill_n
59 #include <cstdint> // for uint8_t, uint32_t
60 #include <ostream> // for ostream, operator<<
61 #include <type_traits> // for enable_if_t
62 
63 // Define all PCL point types
64 #define PCL_POINT_TYPES \
65  (pcl::PointXYZ) \
66  (pcl::PointXYZI) \
67  (pcl::PointXYZL) \
68  (pcl::Label) \
69  (pcl::PointXYZRGBA) \
70  (pcl::PointXYZRGB) \
71  (pcl::PointXYZRGBL) \
72  (pcl::PointXYZLAB) \
73  (pcl::PointXYZHSV) \
74  (pcl::PointXY) \
75  (pcl::InterestPoint) \
76  (pcl::Axis) \
77  (pcl::Normal) \
78  (pcl::PointNormal) \
79  (pcl::PointXYZRGBNormal) \
80  (pcl::PointXYZINormal) \
81  (pcl::PointXYZLNormal) \
82  (pcl::PointWithRange) \
83  (pcl::PointWithViewpoint) \
84  (pcl::MomentInvariants) \
85  (pcl::PrincipalRadiiRSD) \
86  (pcl::Boundary) \
87  (pcl::PrincipalCurvatures) \
88  (pcl::PFHSignature125) \
89  (pcl::PFHRGBSignature250) \
90  (pcl::PPFSignature) \
91  (pcl::CPPFSignature) \
92  (pcl::PPFRGBSignature) \
93  (pcl::NormalBasedSignature12) \
94  (pcl::FPFHSignature33) \
95  (pcl::VFHSignature308) \
96  (pcl::GASDSignature512) \
97  (pcl::GASDSignature984) \
98  (pcl::GASDSignature7992) \
99  (pcl::GRSDSignature21) \
100  (pcl::ESFSignature640) \
101  (pcl::BRISKSignature512) \
102  (pcl::Narf36) \
103  (pcl::IntensityGradient) \
104  (pcl::PointWithScale) \
105  (pcl::PointSurfel) \
106  (pcl::ShapeContext1980) \
107  (pcl::UniqueShapeContext1960) \
108  (pcl::SHOT352) \
109  (pcl::SHOT1344) \
110  (pcl::PointUV) \
111  (pcl::ReferenceFrame) \
112  (pcl::PointDEM)
113 
114 // Define all point types that include RGB data
115 #define PCL_RGB_POINT_TYPES \
116  (pcl::PointXYZRGBA) \
117  (pcl::PointXYZRGB) \
118  (pcl::PointXYZRGBL) \
119  (pcl::PointXYZRGBNormal) \
120  (pcl::PointSurfel) \
121 
122 // Define all point types with XYZ and label
123 #define PCL_XYZL_POINT_TYPES \
124  (pcl::PointXYZL) \
125  (pcl::PointXYZRGBL) \
126  (pcl::PointXYZLNormal)
127 
128 // Define all point types that represent features
129 #define PCL_FEATURE_POINT_TYPES \
130  (pcl::PFHSignature125) \
131  (pcl::PFHRGBSignature250) \
132  (pcl::PPFSignature) \
133  (pcl::CPPFSignature) \
134  (pcl::PPFRGBSignature) \
135  (pcl::NormalBasedSignature12) \
136  (pcl::FPFHSignature33) \
137  (pcl::VFHSignature308) \
138  (pcl::GASDSignature512) \
139  (pcl::GASDSignature984) \
140  (pcl::GASDSignature7992) \
141  (pcl::GRSDSignature21) \
142  (pcl::ESFSignature640) \
143  (pcl::BRISKSignature512) \
144  (pcl::Narf36)
145 
146 // Define all point types that have descriptorSize() member function
147 #define PCL_DESCRIPTOR_FEATURE_POINT_TYPES \
148  (pcl::PFHSignature125) \
149  (pcl::PFHRGBSignature250) \
150  (pcl::FPFHSignature33) \
151  (pcl::VFHSignature308) \
152  (pcl::GASDSignature512) \
153  (pcl::GASDSignature984) \
154  (pcl::GASDSignature7992) \
155  (pcl::GRSDSignature21) \
156  (pcl::ESFSignature640) \
157  (pcl::BRISKSignature512) \
158  (pcl::Narf36)
159 
160 
161 namespace pcl
162 {
163  namespace detail
164  {
165  namespace traits
166  {
167  template<typename FeaturePointT> struct descriptorSize {};
168 
169  template<> struct descriptorSize<PFHSignature125> { static constexpr const int value = 125; };
170  template<> struct descriptorSize<PFHRGBSignature250> { static constexpr const int value = 250; };
171  template<> struct descriptorSize<ShapeContext1980> { static constexpr const int value = 1980; };
172  template<> struct descriptorSize<UniqueShapeContext1960> { static constexpr const int value = 1960; };
173  template<> struct descriptorSize<SHOT352> { static constexpr const int value = 352; };
174  template<> struct descriptorSize<SHOT1344> { static constexpr const int value = 1344; };
175  template<> struct descriptorSize<FPFHSignature33> { static constexpr const int value = 33; };
176  template<> struct descriptorSize<VFHSignature308> { static constexpr const int value = 308; };
177  template<> struct descriptorSize<GRSDSignature21> { static constexpr const int value = 21; };
178  template<> struct descriptorSize<BRISKSignature512> { static constexpr const int value = 512; };
179  template<> struct descriptorSize<ESFSignature640> { static constexpr const int value = 640; };
180  template<> struct descriptorSize<GASDSignature512> { static constexpr const int value = 512; };
181  template<> struct descriptorSize<GASDSignature984> { static constexpr const int value = 984; };
182  template<> struct descriptorSize<GASDSignature7992> { static constexpr const int value = 7992; };
183  template<> struct descriptorSize<GFPFHSignature16> { static constexpr const int value = 16; };
184  template<> struct descriptorSize<Narf36> { static constexpr const int value = 36; };
185  template<int N> struct descriptorSize<Histogram<N>> { static constexpr const int value = N; };
186 
187 
188  template<typename FeaturePointT>
190  }
191  }
192 
193  using Vector2fMap = Eigen::Map<Eigen::Vector2f>;
194  using Vector2fMapConst = const Eigen::Map<const Eigen::Vector2f>;
195  using Array3fMap = Eigen::Map<Eigen::Array3f>;
196  using Array3fMapConst = const Eigen::Map<const Eigen::Array3f>;
197  using Array4fMap = Eigen::Map<Eigen::Array4f, Eigen::Aligned>;
198  using Array4fMapConst = const Eigen::Map<const Eigen::Array4f, Eigen::Aligned>;
199  using Vector3fMap = Eigen::Map<Eigen::Vector3f>;
200  using Vector3fMapConst = const Eigen::Map<const Eigen::Vector3f>;
201  using Vector4fMap = Eigen::Map<Eigen::Vector4f, Eigen::Aligned>;
202  using Vector4fMapConst = const Eigen::Map<const Eigen::Vector4f, Eigen::Aligned>;
203 
204  using Vector3c = Eigen::Matrix<std::uint8_t, 3, 1>;
205  using Vector3cMap = Eigen::Map<Vector3c>;
206  using Vector3cMapConst = const Eigen::Map<const Vector3c>;
207  using Vector4c = Eigen::Matrix<std::uint8_t, 4, 1>;
208  using Vector4cMap = Eigen::Map<Vector4c, Eigen::Aligned>;
209  using Vector4cMapConst = const Eigen::Map<const Vector4c, Eigen::Aligned>;
210 
211 #define PCL_ADD_UNION_POINT4D \
212  union EIGEN_ALIGN16 { \
213  float data[4]; \
214  struct { \
215  float x; \
216  float y; \
217  float z; \
218  }; \
219  };
220 
221 #define PCL_ADD_EIGEN_MAPS_POINT4D \
222  inline pcl::Vector2fMap getVector2fMap () { return (pcl::Vector2fMap (data)); } \
223  inline pcl::Vector2fMapConst getVector2fMap () const { return (pcl::Vector2fMapConst (data)); } \
224  inline pcl::Vector3fMap getVector3fMap () { return (pcl::Vector3fMap (data)); } \
225  inline pcl::Vector3fMapConst getVector3fMap () const { return (pcl::Vector3fMapConst (data)); } \
226  inline pcl::Vector4fMap getVector4fMap () { return (pcl::Vector4fMap (data)); } \
227  inline pcl::Vector4fMapConst getVector4fMap () const { return (pcl::Vector4fMapConst (data)); } \
228  inline pcl::Array3fMap getArray3fMap () { return (pcl::Array3fMap (data)); } \
229  inline pcl::Array3fMapConst getArray3fMap () const { return (pcl::Array3fMapConst (data)); } \
230  inline pcl::Array4fMap getArray4fMap () { return (pcl::Array4fMap (data)); } \
231  inline pcl::Array4fMapConst getArray4fMap () const { return (pcl::Array4fMapConst (data)); }
232 
233 #define PCL_ADD_POINT4D \
234  PCL_ADD_UNION_POINT4D \
235  PCL_ADD_EIGEN_MAPS_POINT4D
236 
237 #define PCL_ADD_UNION_NORMAL4D \
238  union EIGEN_ALIGN16 { \
239  float data_n[4]; \
240  float normal[3]; \
241  struct { \
242  float normal_x; \
243  float normal_y; \
244  float normal_z; \
245  }; \
246  };
247 
248 #define PCL_ADD_EIGEN_MAPS_NORMAL4D \
249  inline pcl::Vector3fMap getNormalVector3fMap () { return (pcl::Vector3fMap (data_n)); } \
250  inline pcl::Vector3fMapConst getNormalVector3fMap () const { return (pcl::Vector3fMapConst (data_n)); } \
251  inline pcl::Vector4fMap getNormalVector4fMap () { return (pcl::Vector4fMap (data_n)); } \
252  inline pcl::Vector4fMapConst getNormalVector4fMap () const { return (pcl::Vector4fMapConst (data_n)); }
253 
254 #define PCL_ADD_NORMAL4D \
255  PCL_ADD_UNION_NORMAL4D \
256  PCL_ADD_EIGEN_MAPS_NORMAL4D
257 
258 #define PCL_ADD_UNION_RGB \
259  union \
260  { \
261  union \
262  { \
263  struct \
264  { \
265  std::uint8_t b; \
266  std::uint8_t g; \
267  std::uint8_t r; \
268  std::uint8_t a; \
269  }; \
270  float rgb; \
271  }; \
272  std::uint32_t rgba; \
273  };
274 
275 #define PCL_ADD_EIGEN_MAPS_RGB \
276  inline Eigen::Vector3i getRGBVector3i () { return (Eigen::Vector3i (r, g, b)); } \
277  inline const Eigen::Vector3i getRGBVector3i () const { return (Eigen::Vector3i (r, g, b)); } \
278  inline Eigen::Vector4i getRGBVector4i () { return (Eigen::Vector4i (r, g, b, a)); } \
279  inline const Eigen::Vector4i getRGBVector4i () const { return (Eigen::Vector4i (r, g, b, a)); } \
280  inline Eigen::Vector4i getRGBAVector4i () { return (Eigen::Vector4i (r, g, b, a)); } \
281  inline const Eigen::Vector4i getRGBAVector4i () const { return (Eigen::Vector4i (r, g, b, a)); } \
282  inline pcl::Vector3cMap getBGRVector3cMap () { return (pcl::Vector3cMap (reinterpret_cast<std::uint8_t*> (&rgba))); } \
283  inline pcl::Vector3cMapConst getBGRVector3cMap () const { return (pcl::Vector3cMapConst (reinterpret_cast<const std::uint8_t*> (&rgba))); } \
284  inline pcl::Vector4cMap getBGRAVector4cMap () { return (pcl::Vector4cMap (reinterpret_cast<std::uint8_t*> (&rgba))); } \
285  inline pcl::Vector4cMapConst getBGRAVector4cMap () const { return (pcl::Vector4cMapConst (reinterpret_cast<const std::uint8_t*> (&rgba))); }
286 
287 #define PCL_ADD_RGB \
288  PCL_ADD_UNION_RGB \
289  PCL_ADD_EIGEN_MAPS_RGB
290 
291 #define PCL_ADD_INTENSITY \
292  struct \
293  { \
294  float intensity; \
295  }; \
296 
297 #define PCL_ADD_INTENSITY_8U \
298  struct \
299  { \
300  std::uint8_t intensity; \
301  }; \
302 
303 #define PCL_ADD_INTENSITY_32U \
304  struct \
305  { \
306  std::uint32_t intensity; \
307  }; \
308 
309 
310  struct _PointXYZ
311  {
312  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
313 
315  };
316 
317  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZ& p);
318  /** \brief A point structure representing Euclidean xyz coordinates. (SSE friendly)
319  * \ingroup common
320  */
321  struct EIGEN_ALIGN16 PointXYZ : public _PointXYZ
322  {
323  inline constexpr PointXYZ (const _PointXYZ &p): PointXYZ(p.x, p.y, p.z) {}
324 
325  inline constexpr PointXYZ (): PointXYZ(0.f, 0.f, 0.f) {}
326 
327  inline constexpr PointXYZ (float _x, float _y, float _z) : _PointXYZ{{{_x, _y, _z, 1.f}}} {}
328 
329  friend std::ostream& operator << (std::ostream& os, const PointXYZ& p);
331  };
332 
333 
334 #ifdef RGB
335 #undef RGB
336 #endif
337  struct _RGB
338  {
339  PCL_ADD_RGB
340  };
341 
342  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const RGB& p);
343  /** \brief A structure representing RGB color information.
344  *
345  * The RGBA information is available either as separate r, g, b, or as a
346  * packed std::uint32_t rgba value. To pack it, use:
347  *
348  * \code
349  * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b);
350  * \endcode
351  *
352  * To unpack it use:
353  *
354  * \code
355  * int rgb = ...;
356  * std::uint8_t r = (rgb >> 16) & 0x0000ff;
357  * std::uint8_t g = (rgb >> 8) & 0x0000ff;
358  * std::uint8_t b = (rgb) & 0x0000ff;
359  * \endcode
360  *
361  */
362  struct RGB: public _RGB
363  {
364  inline constexpr RGB (const _RGB &p) : RGB{p.r, p.g, p.b, p.a} {}
365 
366  inline constexpr RGB (): RGB(0, 0, 0) {}
367 
368  inline constexpr RGB (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a = 255) : _RGB{{{{_b, _g, _r, _a}}}} {}
369 
370  friend std::ostream& operator << (std::ostream& os, const RGB& p);
371  };
372 
373  struct _Intensity
374  {
375  PCL_ADD_INTENSITY
376  };
377 
378  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity& p);
379  /** \brief A point structure representing the grayscale intensity in single-channel images.
380  * Intensity is represented as a float value.
381  * \ingroup common
382  */
383  struct Intensity: public _Intensity
384  {
385  inline constexpr Intensity (const _Intensity &p) : Intensity{p.intensity} {}
386 
387  inline constexpr Intensity (float _intensity = 0.f) : _Intensity{_intensity} {}
388 
389  friend std::ostream& operator << (std::ostream& os, const Intensity& p);
390  };
391 
392 
394  {
396  };
397 
398  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity8u& p);
399  /** \brief A point structure representing the grayscale intensity in single-channel images.
400  * Intensity is represented as a std::uint8_t value.
401  * \ingroup common
402  */
403  struct Intensity8u: public _Intensity8u
404  {
405  inline constexpr Intensity8u (const _Intensity8u &p) : Intensity8u{p.intensity} {}
406 
407  inline constexpr Intensity8u (std::uint8_t _intensity = 0) : _Intensity8u{_intensity} {}
408 
409 #if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 1101
410  inline constexpr operator unsigned char() const
411  {
412  return intensity;
413  }
414 #endif
415 
416  friend std::ostream& operator << (std::ostream& os, const Intensity8u& p);
417  };
418 
420  {
422  };
423 
424  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity32u& p);
425  /** \brief A point structure representing the grayscale intensity in single-channel images.
426  * Intensity is represented as a std::uint32_t value.
427  * \ingroup common
428  */
430  {
431  inline constexpr Intensity32u (const _Intensity32u &p) : Intensity32u{p.intensity} {}
432 
433  inline constexpr Intensity32u (std::uint32_t _intensity = 0) : _Intensity32u{_intensity} {}
434 
435  friend std::ostream& operator << (std::ostream& os, const Intensity32u& p);
436  };
437 
438  /** \brief A point structure representing Euclidean xyz coordinates, and the intensity value.
439  * \ingroup common
440  */
441  struct EIGEN_ALIGN16 _PointXYZI
442  {
443  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
444  union
445  {
446  struct
447  {
448  float intensity;
449  };
450  float data_c[4];
451  };
453  };
454 
455  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZI& p);
456  struct PointXYZI : public _PointXYZI
457  {
458  inline constexpr PointXYZI (const _PointXYZI &p) : PointXYZI{p.x, p.y, p.z, p.intensity} {}
459 
460  inline constexpr PointXYZI (float _intensity = 0.f) : PointXYZI(0.f, 0.f, 0.f, _intensity) {}
461 
462  inline constexpr PointXYZI (float _x, float _y, float _z, float _intensity = 0.f) : _PointXYZI{{{_x, _y, _z, 1.0f}}, {{_intensity}}} {}
463 
464  friend std::ostream& operator << (std::ostream& os, const PointXYZI& p);
465  };
466 
467 
468  struct EIGEN_ALIGN16 _PointXYZL
469  {
470  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
471  std::uint32_t label;
473  };
474 
475  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZL& p);
476  struct PointXYZL : public _PointXYZL
477  {
478  inline constexpr PointXYZL (const _PointXYZL &p) : PointXYZL{p.x, p.y, p.z, p.label} {}
479 
480  inline constexpr PointXYZL (std::uint32_t _label = 0) : PointXYZL(0.f, 0.f, 0.f, _label) {}
481 
482  inline constexpr PointXYZL (float _x, float _y, float _z, std::uint32_t _label = 0) : _PointXYZL{{{_x, _y, _z, 1.0f}}, _label} {}
483 
484  friend std::ostream& operator << (std::ostream& os, const PointXYZL& p);
485  };
486 
487 
488  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Label& p);
489  struct Label
490  {
491  std::uint32_t label = 0;
492 
493  inline constexpr Label (std::uint32_t _label = 0): label(_label) {}
494 
495  friend std::ostream& operator << (std::ostream& os, const Label& p);
496  };
497 
498 
499  struct EIGEN_ALIGN16 _PointXYZRGBA
500  {
501  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
502  PCL_ADD_RGB
504  };
505 
506  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p);
507  /** \brief A point structure representing Euclidean xyz coordinates, and the RGBA color.
508  *
509  * The RGBA information is available either as separate r, g, b, or as a
510  * packed std::uint32_t rgba value. To pack it, use:
511  *
512  * \code
513  * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b);
514  * \endcode
515  *
516  * To unpack it use:
517  *
518  * \code
519  * int rgb = ...;
520  * std::uint8_t r = (rgb >> 16) & 0x0000ff;
521  * std::uint8_t g = (rgb >> 8) & 0x0000ff;
522  * std::uint8_t b = (rgb) & 0x0000ff;
523  * \endcode
524  *
525  * \ingroup common
526  */
527  struct EIGEN_ALIGN16 PointXYZRGBA : public _PointXYZRGBA
528  {
529  inline constexpr PointXYZRGBA (const _PointXYZRGBA &p) : PointXYZRGBA{p.x, p.y, p.z, p.r, p.g, p.b, p.a} {}
530 
531  inline constexpr PointXYZRGBA (): PointXYZRGBA (0, 0, 0, 255) {}
532 
533  inline constexpr PointXYZRGBA (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a):
534  PointXYZRGBA (0.f, 0.f, 0.f, _r, _g, _b, _a) {}
535 
536  inline constexpr PointXYZRGBA (float _x, float _y, float _z):
537  PointXYZRGBA (_x, _y, _z, 0, 0, 0, 255) {}
538 
539  inline constexpr PointXYZRGBA (float _x, float _y, float _z, std::uint8_t _r,
540  std::uint8_t _g, std::uint8_t _b, std::uint8_t _a) : _PointXYZRGBA{{{_x, _y, _z, 1.0f}}, {{{_b, _g, _r, _a}}}} {}
541 
542  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p);
543  };
544 
545 
546  struct EIGEN_ALIGN16 _PointXYZRGB
547  {
548  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
549  PCL_ADD_RGB
551  };
552 
553  struct EIGEN_ALIGN16 _PointXYZRGBL
554  {
555  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
556  PCL_ADD_RGB
557  std::uint32_t label;
559  };
560 
561  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGB& p);
562  /** \brief A point structure representing Euclidean xyz coordinates, and the RGB color.
563  *
564  * Due to historical reasons (PCL was first developed as a ROS package), the
565  * RGB information is packed into an integer and casted to a float. This is
566  * something we wish to remove in the near future, but in the meantime, the
567  * following code snippet should help you pack and unpack RGB colors in your
568  * PointXYZRGB structure:
569  *
570  * \code
571  * // pack r/g/b into rgb
572  * std::uint8_t r = 255, g = 0, b = 0; // Example: Red color
573  * std::uint32_t rgb = ((std::uint32_t)r << 16 | (std::uint32_t)g << 8 | (std::uint32_t)b);
574  * p.rgb = *reinterpret_cast<float*>(&rgb);
575  * \endcode
576  *
577  * To unpack the data into separate values, use:
578  *
579  * \code
580  * PointXYZRGB p;
581  * // unpack rgb into r/g/b
582  * std::uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
583  * std::uint8_t r = (rgb >> 16) & 0x0000ff;
584  * std::uint8_t g = (rgb >> 8) & 0x0000ff;
585  * std::uint8_t b = (rgb) & 0x0000ff;
586  * \endcode
587  *
588  *
589  * Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
590  *
591  * \ingroup common
592  */
593  struct EIGEN_ALIGN16 PointXYZRGB : public _PointXYZRGB
594  {
595  inline constexpr PointXYZRGB (const _PointXYZRGB &p) : PointXYZRGB{p.x, p.y, p.z, p.r, p.g, p.b} {}
596 
597  inline constexpr PointXYZRGB (): PointXYZRGB (0.f, 0.f, 0.f) {}
598 
599  inline constexpr PointXYZRGB (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b):
600  PointXYZRGB (0.f, 0.f, 0.f, _r, _g, _b) {}
601 
602  inline constexpr PointXYZRGB (float _x, float _y, float _z):
603  PointXYZRGB (_x, _y, _z, 0, 0, 0) {}
604 
605  inline constexpr PointXYZRGB (float _x, float _y, float _z,
606  std::uint8_t _r, std::uint8_t _g, std::uint8_t _b):
607  _PointXYZRGB{{{_x, _y, _z, 1.0f}}, {{{_b, _g, _r, 255}}}} {}
608 
609  friend std::ostream& operator << (std::ostream& os, const PointXYZRGB& p);
611  };
612 
613 
614  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p);
615  struct EIGEN_ALIGN16 PointXYZRGBL : public _PointXYZRGBL
616  {
617  inline constexpr PointXYZRGBL (const _PointXYZRGBL &p) : PointXYZRGBL{p.x, p.y, p.z, p.r, p.g, p.b, p.label, p.a} {}
618 
619  inline constexpr PointXYZRGBL (std::uint32_t _label = 0):
620  PointXYZRGBL (0.f, 0.f, 0.f, 0, 0, 0, _label) {}
621 
622  inline constexpr PointXYZRGBL (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b):
623  PointXYZRGBL (0.f, 0.f, 0.f, _r, _g, _b) {}
624 
625  inline constexpr PointXYZRGBL (float _x, float _y, float _z):
626  PointXYZRGBL (_x, _y, _z, 0, 0, 0) {}
627 
628  inline constexpr PointXYZRGBL (float _x, float _y, float _z,
629  std::uint8_t _r, std::uint8_t _g, std::uint8_t _b,
630  std::uint32_t _label = 0, std::uint8_t _a = 255) :
631  _PointXYZRGBL{{{_x, _y, _z, 1.0f}}, {{{_b, _g, _r, _a}}}, _label} {}
632 
633  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p);
635  };
636 
637 
638  struct EIGEN_ALIGN16 _PointXYZLAB
639  {
640  PCL_ADD_POINT4D // this adds the members x,y,z
641  union
642  {
643  struct
644  {
645  float L;
646  float a;
647  float b;
648  };
649  float data_lab[4];
650  };
652  };
653 
654  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZLAB& p);
655  /** \brief A point structure representing Euclidean xyz coordinates, and the CIELAB color.
656  * \ingroup common
657  */
658  struct PointXYZLAB : public _PointXYZLAB
659  {
660  inline constexpr PointXYZLAB (const _PointXYZLAB &p) : PointXYZLAB{p.x, p.y, p.z, p.L, p.a, p.b} {}
661 
662  inline constexpr PointXYZLAB() : PointXYZLAB{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f} {}
663 
664  inline constexpr PointXYZLAB (float _x, float _y, float _z,
665  float _l, float _a, float _b) :
666  _PointXYZLAB{ {{_x, _y, _z, 1.0f}}, {{_l, _a, _b}} } {}
667 
668  friend std::ostream& operator << (std::ostream& os, const PointXYZLAB& p);
670  };
671 
672 
673  struct EIGEN_ALIGN16 _PointXYZHSV
674  {
675  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
676  union
677  {
678  struct
679  {
680  float h;
681  float s;
682  float v;
683  };
684  float data_c[4];
685  };
687  };
688 
689  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZHSV& p);
690  struct EIGEN_ALIGN16 PointXYZHSV : public _PointXYZHSV
691  {
692  inline constexpr PointXYZHSV (const _PointXYZHSV &p) :
693  PointXYZHSV{p.x, p.y, p.z, p.h, p.s, p.v} {}
694 
695  inline constexpr PointXYZHSV (): PointXYZHSV (0.f, 0.f, 0.f) {}
696 
697  // @TODO: Use strong types??
698  // This is a dangerous type, doesn't behave like others
699  inline constexpr PointXYZHSV (float _h, float _s, float _v):
700  PointXYZHSV (0.f, 0.f, 0.f, _h, _s, _v) {}
701 
702  inline constexpr PointXYZHSV (float _x, float _y, float _z,
703  float _h, float _s, float _v) :
704  _PointXYZHSV{{{_x, _y, _z, 1.0f}}, {{_h, _s, _v}}} {}
705 
706  friend std::ostream& operator << (std::ostream& os, const PointXYZHSV& p);
708  };
709 
710  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXY& p);
711  /** \brief A 2D point structure representing Euclidean xy coordinates.
712  * \ingroup common
713  */
714  // NOLINTBEGIN(modernize-use-default-member-init)
715  struct PointXY
716  {
717  union
718  {
719  float data[2];
720  struct
721  {
722  float x;
723  float y;
724  };
725  };
726 
727  inline constexpr PointXY(float _x, float _y): x(_x), y(_y) {}
728  inline constexpr PointXY(): x(0.0f), y(0.0f) {}
729 
730  inline pcl::Vector2fMap getVector2fMap () { return (pcl::Vector2fMap (data)); }
731  inline pcl::Vector2fMapConst getVector2fMap () const { return (pcl::Vector2fMapConst (data)); }
732 
733  friend std::ostream& operator << (std::ostream& os, const PointXY& p);
734  };
735  // NOLINTEND(modernize-use-default-member-init)
736 
737  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointUV& p);
738  /** \brief A 2D point structure representing pixel image coordinates.
739  * \note We use float to be able to represent subpixels.
740  * \ingroup common
741  */
742  struct PointUV
743  {
744  float u = 0.f;
745  float v = 0.f;
746 
747  inline constexpr PointUV() = default;
748 
749  inline constexpr PointUV(float _u, float _v): u(_u), v(_v) {}
750 
751  friend std::ostream& operator << (std::ostream& os, const PointUV& p);
752  };
753 
754  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const InterestPoint& p);
755  /** \brief A point structure representing an interest point with Euclidean xyz coordinates, and an interest value.
756  * \ingroup common
757  */
758  // @TODO: inheritance trick like on other PointTypes
759  struct EIGEN_ALIGN16 InterestPoint
760  {
761  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
762  union
763  {
764  struct
765  {
766  float strength;
767  };
768  float data_c[4];
769  };
771 
772  friend std::ostream& operator << (std::ostream& os, const InterestPoint& p);
773  };
774 
775  struct EIGEN_ALIGN16 _Normal
776  {
777  PCL_ADD_NORMAL4D // This adds the member normal[3] which can also be accessed using the point (which is float[4])
778  union
779  {
780  struct
781  {
782  float curvature;
783  };
784  float data_c[4];
785  };
787  };
788 
789  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Normal& p);
790  /** \brief A point structure representing normal coordinates and the surface curvature estimate. (SSE friendly)
791  * \ingroup common
792  */
793  struct Normal : public _Normal
794  {
795  inline constexpr Normal (const _Normal &p) : Normal {p.normal_x, p.normal_y, p.normal_z, p.curvature} {}
796 
797  inline constexpr Normal (float _curvature = 0.f): Normal (0.f, 0.f, 0.f, _curvature) {}
798 
799  inline constexpr Normal (float n_x, float n_y, float n_z, float _curvature = 0.f) :
800  _Normal{{{n_x, n_y, n_z, 0.0f}}, {{_curvature}}} {}
801 
802  friend std::ostream& operator << (std::ostream& os, const Normal& p);
804  };
805 
806 
807  struct EIGEN_ALIGN16 _Axis
808  {
809  PCL_ADD_NORMAL4D
811  };
812 
813  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Axis& p);
814  /** \brief A point structure representing an Axis using its normal coordinates. (SSE friendly)
815  * \ingroup common
816  */
817  struct EIGEN_ALIGN16 Axis : public _Axis
818  {
819  inline constexpr Axis (const _Axis &p) : Axis{p.normal_x, p.normal_y, p.normal_z} {}
820 
821  inline constexpr Axis (): Axis (0.f, 0.f, 0.f) {}
822 
823  inline constexpr Axis (float n_x, float n_y, float n_z) : _Axis{{{n_x, n_y, n_z, 0.0f}}} {}
824 
825  friend std::ostream& operator << (std::ostream& os, const Axis& p);
827  };
828 
829 
830  struct EIGEN_ALIGN16 _PointNormal
831  {
832  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
833  PCL_ADD_NORMAL4D // This adds the member normal[3] which can also be accessed using the point (which is float[4])
834  union
835  {
836  struct
837  {
838  float curvature;
839  };
840  float data_c[4];
841  };
843  };
844 
845  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointNormal& p);
846  /** \brief A point structure representing Euclidean xyz coordinates, together with normal coordinates and the surface curvature estimate. (SSE friendly)
847  * \ingroup common
848  */
849  struct PointNormal : public _PointNormal
850  {
851  inline constexpr PointNormal (const _PointNormal &p) : PointNormal{p.x, p.y, p.z, p.normal_x, p.normal_y, p.normal_z, p.curvature} {}
852 
853  inline constexpr PointNormal (float _curvature = 0.f): PointNormal (0.f, 0.f, 0.f, 0.f, 0.f, 0.f, _curvature) {}
854 
855  inline constexpr PointNormal (float _x, float _y, float _z):
856  PointNormal (_x, _y, _z, 0.f, 0.f, 0.f, 0.f) {}
857 
858  inline constexpr PointNormal (float _x, float _y, float _z, float n_x, float n_y, float n_z, float _curvature = 0.f) :
859  _PointNormal{{{_x, _y, _z, 1.0f}}, {{n_x, n_y, n_z, 0.0f}}, {{_curvature}}} {}
860 
861  friend std::ostream& operator << (std::ostream& os, const PointNormal& p);
862  };
863 
864 
865  struct EIGEN_ALIGN16 _PointXYZRGBNormal
866  {
867  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
868  PCL_ADD_NORMAL4D // This adds the member normal[3] which can also be accessed using the point (which is float[4])
869  union
870  {
871  struct
872  {
873  PCL_ADD_UNION_RGB
874  float curvature;
875  };
876  float data_c[4];
877  };
878  PCL_ADD_EIGEN_MAPS_RGB
880  };
881 
882  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p);
883  /** \brief A point structure representing Euclidean xyz coordinates, and the RGB color, together with normal coordinates and the surface curvature estimate.
884  * Due to historical reasons (PCL was first developed as a ROS package), the
885  * RGB information is packed into an integer and casted to a float. This is
886  * something we wish to remove in the near future, but in the meantime, the
887  * following code snippet should help you pack and unpack RGB colors in your
888  * PointXYZRGB structure:
889  *
890  * \code
891  * // pack r/g/b into rgb
892  * std::uint8_t r = 255, g = 0, b = 0; // Example: Red color
893  * std::uint32_t rgb = ((std::uint32_t)r << 16 | (std::uint32_t)g << 8 | (std::uint32_t)b);
894  * p.rgb = *reinterpret_cast<float*>(&rgb);
895  * \endcode
896  *
897  * To unpack the data into separate values, use:
898  *
899  * \code
900  * PointXYZRGB p;
901  * // unpack rgb into r/g/b
902  * std::uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
903  * std::uint8_t r = (rgb >> 16) & 0x0000ff;
904  * std::uint8_t g = (rgb >> 8) & 0x0000ff;
905  * std::uint8_t b = (rgb) & 0x0000ff;
906  * \endcode
907  *
908  *
909  * Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
910  * \ingroup common
911  */
913  {
914  inline constexpr PointXYZRGBNormal (const _PointXYZRGBNormal &p) :
915  PointXYZRGBNormal {p.x, p.y, p.z, p.r, p.g, p.b, p.a, p.normal_x, p.normal_y, p.normal_z, p.curvature} {}
916 
917  inline constexpr PointXYZRGBNormal (float _curvature = 0.f):
918  PointXYZRGBNormal (0.f, 0.f, 0.f, 0, 0, 0, 0.f, 0.f, 0.f, _curvature) {}
919 
920  inline constexpr PointXYZRGBNormal (float _x, float _y, float _z):
921  PointXYZRGBNormal (_x, _y, _z, 0, 0, 0) {}
922 
923  inline constexpr PointXYZRGBNormal (std::uint8_t _r, std::uint8_t _g, std::uint8_t _b):
924  PointXYZRGBNormal (0.f, 0.f, 0.f, _r, _g, _b) {}
925 
926  inline constexpr PointXYZRGBNormal (float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b):
927  PointXYZRGBNormal (_x, _y, _z, _r, _g, _b, 0.f, 0.f, 0.f) {}
928 
929  inline constexpr PointXYZRGBNormal (float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b,
930  float n_x, float n_y, float n_z, float _curvature = 0.f) :
932  {{_x, _y, _z, 1.0f}},
933  {{n_x, n_y, n_z, 0.0f}},
934  {{ {{{_b, _g, _r, 255u}}}, _curvature }}
935  }
936  {}
937 
938  inline constexpr PointXYZRGBNormal (float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b,
939  std::uint8_t _a, float n_x, float n_y, float n_z, float _curvature = 0.f) :
941  {{_x, _y, _z, 1.0f}},
942  {{n_x, n_y, n_z, 0.0f}},
943  {{ {{{_b, _g, _r, _a}}}, _curvature }}
944  }
945  {}
946 
947 
948  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p);
949  };
950 
951  struct EIGEN_ALIGN16 _PointXYZINormal
952  {
953  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
954  PCL_ADD_NORMAL4D // This adds the member normal[3] which can also be accessed using the point (which is float[4])
955  union
956  {
957  struct
958  {
959  float intensity;
960  float curvature;
961  };
962  float data_c[4];
963  };
965  };
966 
967  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZINormal& p);
968  /** \brief A point structure representing Euclidean xyz coordinates, intensity, together with normal coordinates and the surface curvature estimate.
969  * \ingroup common
970  */
972  {
973  inline constexpr PointXYZINormal (const _PointXYZINormal &p) :
974  PointXYZINormal {p.x, p.y, p.z, p.intensity, p.normal_x, p.normal_y, p.normal_z, p.curvature} {}
975 
976  inline constexpr PointXYZINormal (float _intensity = 0.f): PointXYZINormal (0.f, 0.f, 0.f, _intensity) {}
977 
978  inline constexpr PointXYZINormal (float _x, float _y, float _z, float _intensity = 0.f):
979  PointXYZINormal (_x, _y, _z, _intensity, 0.f, 0.f, 0.f) {}
980 
981  inline constexpr PointXYZINormal (float _x, float _y, float _z, float _intensity,
982  float n_x, float n_y, float n_z, float _curvature = 0.f) :
984  {{_x, _y, _z, 1.0f}},
985  {{n_x, n_y, n_z, 0.0f}},
986  {{_intensity, _curvature}}
987  }
988  {}
989 
990  friend std::ostream& operator << (std::ostream& os, const PointXYZINormal& p);
991  };
992 
993 //----
994  struct EIGEN_ALIGN16 _PointXYZLNormal
995  {
996  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
997  PCL_ADD_NORMAL4D // This adds the member normal[3] which can also be accessed using the point (which is float[4])
998  union
999  {
1000  struct
1001  {
1002  std::uint32_t label;
1003  float curvature;
1004  };
1005  float data_c[4];
1006  };
1008  };
1009 
1010  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZLNormal& p);
1011  /** \brief A point structure representing Euclidean xyz coordinates, a label, together with normal coordinates and the surface curvature estimate.
1012  * \ingroup common
1013  */
1015  {
1016  inline constexpr PointXYZLNormal (const _PointXYZLNormal &p) :
1017  PointXYZLNormal {p.x, p.y, p.z, p.label, p.normal_x, p.normal_y, p.normal_z, p.curvature} {}
1018 
1019  inline constexpr PointXYZLNormal (std::uint32_t _label = 0u): PointXYZLNormal (0.f, 0.f, 0.f, _label) {}
1020 
1021  inline constexpr PointXYZLNormal (float _x, float _y, float _z, std::uint32_t _label = 0u) :
1022  PointXYZLNormal (_x, _y, _z, _label, 0.f, 0.f, 0.f) {}
1023 
1024  inline constexpr PointXYZLNormal (float _x, float _y, float _z, std::uint32_t _label,
1025  float n_x, float n_y, float n_z, float _curvature = 0.f) :
1027  {{_x, _y, _z, 1.0f}},
1028  {{n_x, n_y, n_z, 0.0f}},
1029  {{_label, _curvature}}
1030  }
1031  {}
1032 
1033  friend std::ostream& operator << (std::ostream& os, const PointXYZLNormal& p);
1034  };
1035 
1036 // ---
1037 
1038 
1039  struct EIGEN_ALIGN16 _PointWithRange
1040  {
1041  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1042  union
1043  {
1044  struct
1045  {
1046  float range;
1047  };
1048  float data_c[4];
1049  };
1051  };
1052 
1053  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithRange& p);
1054  /** \brief A point structure representing Euclidean xyz coordinates, padded with an extra range float.
1055  * \ingroup common
1056  */
1058  {
1059  inline constexpr PointWithRange (const _PointWithRange &p) : PointWithRange{p.x, p.y, p.z, p.range} {}
1060 
1061  inline constexpr PointWithRange (float _range = 0.f): PointWithRange (0.f, 0.f, 0.f, _range) {}
1062 
1063  inline constexpr PointWithRange (float _x, float _y, float _z, float _range = 0.f) :
1064  _PointWithRange{{{_x, _y, _z, 1.0f}}, {{_range}}} {}
1065 
1066  friend std::ostream& operator << (std::ostream& os, const PointWithRange& p);
1067  };
1068 
1069 
1070  struct EIGEN_ALIGN16 _PointWithViewpoint
1071  {
1072  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1073  union
1074  {
1075  struct
1076  {
1077  float vp_x;
1078  float vp_y;
1079  float vp_z;
1080  };
1081  float data_c[4];
1082  };
1084  };
1085 
1086  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
1087  /** \brief A point structure representing Euclidean xyz coordinates together with the viewpoint from which it was seen.
1088  * \ingroup common
1089  */
1090  struct EIGEN_ALIGN16 PointWithViewpoint : public _PointWithViewpoint
1091  {
1092  inline constexpr PointWithViewpoint (const _PointWithViewpoint &p) : PointWithViewpoint{p.x, p.y, p.z, p.vp_x, p.vp_y, p.vp_z} {}
1093 
1094  inline constexpr PointWithViewpoint (): PointWithViewpoint (0.f, 0.f, 0.f) {}
1095 
1096  inline constexpr PointWithViewpoint (float _x, float _y, float _z): PointWithViewpoint (_x, _y, _z, 0.f, 0.f, 0.f) {}
1097 
1098  inline constexpr PointWithViewpoint (float _x, float _y, float _z, float _vp_x, float _vp_y, float _vp_z) :
1099  _PointWithViewpoint{{{_x, _y, _z, 1.0f}}, {{_vp_x, _vp_y, _vp_z}}} {}
1100 
1101  friend std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
1102  };
1103 
1104  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1105  /** \brief A point structure representing the three moment invariants.
1106  * \ingroup common
1107  */
1109  {
1110  float j1 = 0.f, j2 = 0.f, j3 = 0.f;
1111 
1112  inline constexpr MomentInvariants () = default;
1113 
1114  inline constexpr MomentInvariants (float _j1, float _j2, float _j3): j1 (_j1), j2 (_j2), j3 (_j3) {}
1115 
1116  friend std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1117  };
1118 
1119  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
1120  /** \brief A point structure representing the minimum and maximum surface radii (in meters) computed using RSD.
1121  * \ingroup common
1122  */
1124  {
1125  float r_min = 0.f, r_max = 0.f;
1126 
1127  inline constexpr PrincipalRadiiRSD () = default;
1128 
1129  inline constexpr PrincipalRadiiRSD (float _r_min, float _r_max): r_min (_r_min), r_max (_r_max) {}
1130 
1131  friend std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
1132  };
1133 
1134  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Boundary& p);
1135  /** \brief A point structure representing a description of whether a point is lying on a surface boundary or not.
1136  * \ingroup common
1137  */
1138  struct Boundary
1139  {
1140  std::uint8_t boundary_point = 0;
1141 
1142 #if defined(_LIBCPP_VERSION) && _LIBCPP_VERSION <= 1101
1143  constexpr operator unsigned char() const
1144  {
1145  return boundary_point;
1146  }
1147 #endif
1148 
1149  inline constexpr Boundary (std::uint8_t _boundary = 0): boundary_point (_boundary) {}
1150 
1151  friend std::ostream& operator << (std::ostream& os, const Boundary& p);
1152  };
1153 
1154  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p);
1155  /** \brief A point structure representing the principal curvatures and their magnitudes.
1156  * \ingroup common
1157  */
1159  {
1160  union
1161  {
1162  float principal_curvature[3];
1163  struct
1164  {
1168  };
1169  };
1170  float pc1 = 0.f;
1171  float pc2 = 0.f;
1172 
1173  inline constexpr PrincipalCurvatures (): PrincipalCurvatures (0.f, 0.f) {}
1174 
1175  inline constexpr PrincipalCurvatures (float _pc1, float _pc2): PrincipalCurvatures (0.f, 0.f, 0.f, _pc1, _pc2) {}
1176 
1177  inline constexpr PrincipalCurvatures (float _x, float _y, float _z): PrincipalCurvatures (_x, _y, _z, 0.f, 0.f) {}
1178 
1179  inline constexpr PrincipalCurvatures (float _x, float _y, float _z, float _pc1, float _pc2):
1180  principal_curvature_x (_x), principal_curvature_y (_y), principal_curvature_z (_z), pc1 (_pc1), pc2 (_pc2) {}
1181 
1182  friend std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p);
1183  };
1184 
1185  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHSignature125& p);
1186  /** \brief A point structure representing the Point Feature Histogram (PFH).
1187  * \ingroup common
1188  */
1190  {
1191  float histogram[125] = {0.f};
1192  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<PFHSignature125>; }
1193 
1194  inline constexpr PFHSignature125 () = default;
1195 
1196  friend std::ostream& operator << (std::ostream& os, const PFHSignature125& p);
1197  };
1198 
1199 
1200  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p);
1201  /** \brief A point structure representing the Point Feature Histogram with colors (PFHRGB).
1202  * \ingroup common
1203  */
1205  {
1206  float histogram[250] = {0.f};
1207  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<PFHRGBSignature250>; }
1208 
1209  inline constexpr PFHRGBSignature250 () = default;
1210 
1211  friend std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p);
1212  };
1213 
1214  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFSignature& p);
1215  /** \brief A point structure for storing the Point Pair Feature (PPF) values
1216  * \ingroup common
1217  */
1219  {
1220  float f1 = 0.f, f2 = 0.f, f3 = 0.f, f4 = 0.f;
1221  float alpha_m = 0.f;
1222 
1223  inline constexpr PPFSignature (float _alpha = 0.f): PPFSignature (0.f, 0.f, 0.f, 0.f, _alpha) {}
1224 
1225  inline constexpr PPFSignature (float _f1, float _f2, float _f3, float _f4, float _alpha = 0.f):
1226  f1 (_f1), f2 (_f2), f3 (_f3), f4 (_f4), alpha_m (_alpha) {}
1227 
1228  friend std::ostream& operator << (std::ostream& os, const PPFSignature& p);
1229  };
1230 
1231  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const CPPFSignature& p);
1232  /** \brief A point structure for storing the Point Pair Feature (CPPF) values
1233  * \ingroup common
1234  */
1236  {
1237  float f1, f2, f3, f4, f5, f6, f7, f8, f9, f10;
1238  float alpha_m;
1239 
1240  inline constexpr CPPFSignature (float _alpha = 0.f):
1241  CPPFSignature (0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f, _alpha) {}
1242 
1243  inline constexpr CPPFSignature (float _f1, float _f2, float _f3, float _f4, float _f5, float _f6,
1244  float _f7, float _f8, float _f9, float _f10, float _alpha = 0.f):
1245  f1 (_f1), f2 (_f2), f3 (_f3), f4 (_f4), f5 (_f5), f6 (_f6),
1246  f7 (_f7), f8 (_f8), f9 (_f9), f10 (_f10), alpha_m (_alpha) {}
1247 
1248  friend std::ostream& operator << (std::ostream& os, const CPPFSignature& p);
1249  };
1250 
1251  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p);
1252  /** \brief A point structure for storing the Point Pair Color Feature (PPFRGB) values
1253  * \ingroup common
1254  */
1256  {
1257  float f1 = 0.f, f2 = 0.f, f3 = 0.f, f4 = 0.f;
1258  float r_ratio = 0.f, g_ratio = 0.f, b_ratio = 0.f;
1259  float alpha_m = 0.f;
1260 
1261  inline constexpr PPFRGBSignature (float _alpha = 0.f): PPFRGBSignature (0.f, 0.f, 0.f, 0.f, _alpha) {}
1262 
1263  inline constexpr PPFRGBSignature (float _f1, float _f2, float _f3, float _f4, float _alpha = 0.f):
1264  PPFRGBSignature (_f1, _f2, _f3, _f4, _alpha, 0.f, 0.f, 0.f) {}
1265 
1266  inline constexpr PPFRGBSignature (float _f1, float _f2, float _f3, float _f4, float _alpha, float _r, float _g, float _b):
1267  f1 (_f1), f2 (_f2), f3 (_f3), f4 (_f4), r_ratio (_r), g_ratio (_g), b_ratio (_b), alpha_m (_alpha) {}
1268 
1269  friend std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p);
1270  };
1271 
1272  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p);
1273  /** \brief A point structure representing the Normal Based Signature for
1274  * a feature matrix of 4-by-3
1275  * \ingroup common
1276  */
1278  {
1279  float values[12] = {0.f};
1280 
1281  inline constexpr NormalBasedSignature12 () = default;
1282 
1283  friend std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p);
1284  };
1285 
1286  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ShapeContext1980& p);
1287  /** \brief A point structure representing a Shape Context.
1288  * \ingroup common
1289  */
1291  {
1292  float descriptor[1980] = {0.f};
1293  float rf[9] = {0.f};
1294  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<ShapeContext1980>; }
1295 
1296  inline constexpr ShapeContext1980 () = default;
1297 
1298  friend std::ostream& operator << (std::ostream& os, const ShapeContext1980& p);
1299  };
1300 
1301  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p);
1302  /** \brief A point structure representing a Unique Shape Context.
1303  * \ingroup common
1304  */
1306  {
1307  float descriptor[1960] = {0.f};
1308  float rf[9] = {0.f};
1309  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<UniqueShapeContext1960>; }
1310 
1311  inline constexpr UniqueShapeContext1960 () = default;
1312 
1313  friend std::ostream& operator << (std::ostream& os, const UniqueShapeContext1960& p);
1314  };
1315 
1316  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT352& p);
1317  /** \brief A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape only.
1318  * \ingroup common
1319  */
1320  struct SHOT352
1321  {
1322  float descriptor[352] = {0.f};
1323  float rf[9] = {0.f};
1324  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<SHOT352>; }
1325 
1326  inline constexpr SHOT352 () = default;
1327 
1328  friend std::ostream& operator << (std::ostream& os, const SHOT352& p);
1329  };
1330 
1331 
1332  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT1344& p);
1333  /** \brief A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape+color.
1334  * \ingroup common
1335  */
1336  struct SHOT1344
1337  {
1338  float descriptor[1344] = {0.f};
1339  float rf[9] = {0.f};
1340  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<SHOT1344>; }
1341 
1342  inline constexpr SHOT1344 () = default;
1343 
1344  friend std::ostream& operator << (std::ostream& os, const SHOT1344& p);
1345  };
1346 
1347 
1348  /** \brief A structure representing the Local Reference Frame of a point.
1349  * \ingroup common
1350  */
1351  struct EIGEN_ALIGN16 _ReferenceFrame
1352  {
1353  union
1354  {
1355  float rf[9];
1356  struct
1357  {
1358  float x_axis[3];
1359  float y_axis[3];
1360  float z_axis[3];
1361  };
1362  };
1363 
1364  inline Eigen::Map<Eigen::Vector3f> getXAxisVector3fMap () { return (Eigen::Vector3f::Map (x_axis)); }
1365  inline const Eigen::Map<const Eigen::Vector3f> getXAxisVector3fMap () const { return (Eigen::Vector3f::Map (x_axis)); }
1366  inline Eigen::Map<Eigen::Vector3f> getYAxisVector3fMap () { return (Eigen::Vector3f::Map (y_axis)); }
1367  inline const Eigen::Map<const Eigen::Vector3f> getYAxisVector3fMap () const { return (Eigen::Vector3f::Map (y_axis)); }
1368  inline Eigen::Map<Eigen::Vector3f> getZAxisVector3fMap () { return (Eigen::Vector3f::Map (z_axis)); }
1369  inline const Eigen::Map<const Eigen::Vector3f> getZAxisVector3fMap () const { return (Eigen::Vector3f::Map (z_axis)); }
1370  inline Eigen::Map<Eigen::Matrix3f> getMatrix3fMap () { return (Eigen::Matrix3f::Map (rf)); }
1371  inline const Eigen::Map<const Eigen::Matrix3f> getMatrix3fMap () const { return (Eigen::Matrix3f::Map (rf)); }
1372 
1374  };
1375 
1376  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ReferenceFrame& p);
1377  struct EIGEN_ALIGN16 ReferenceFrame : public _ReferenceFrame
1378  {
1379  inline constexpr ReferenceFrame (const _ReferenceFrame &p) :
1380  ReferenceFrame{p.rf}
1381  {
1382  //std::copy_n(p.rf, 9, rf); // this algorithm is constexpr starting from C++20
1383  }
1384 
1385  inline constexpr ReferenceFrame () :
1386  _ReferenceFrame{ {{0.0f}} }
1387  {
1388  // this algorithm is constexpr starting from C++20
1389  /*std::fill_n(x_axis, 3, 0.f);
1390  std::fill_n(y_axis, 3, 0.f);
1391  std::fill_n(z_axis, 3, 0.f);*/
1392  }
1393 
1394  inline constexpr ReferenceFrame (const float (&_rf)[9]) :
1395  _ReferenceFrame{ {{_rf[0], _rf[1], _rf[2], _rf[3], _rf[4], _rf[5], _rf[6], _rf[7], _rf[8]}} } {}
1396 
1397  friend std::ostream& operator << (std::ostream& os, const ReferenceFrame& p);
1399  };
1400 
1401 
1402  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const FPFHSignature33& p);
1403  /** \brief A point structure representing the Fast Point Feature Histogram (FPFH).
1404  * \ingroup common
1405  */
1407  {
1408  float histogram[33] = {0.f};
1409  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<FPFHSignature33>; }
1410 
1411  inline constexpr FPFHSignature33 () = default;
1412 
1413  friend std::ostream& operator << (std::ostream& os, const FPFHSignature33& p);
1414  };
1415 
1416  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const VFHSignature308& p);
1417  /** \brief A point structure representing the Viewpoint Feature Histogram (VFH).
1418  * \ingroup common
1419  */
1421  {
1422  float histogram[308] = {0.f};
1423  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<VFHSignature308>; }
1424 
1425  inline constexpr VFHSignature308 () = default;
1426 
1427  friend std::ostream& operator << (std::ostream& os, const VFHSignature308& p);
1428  };
1429 
1430  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GRSDSignature21& p);
1431  /** \brief A point structure representing the Global Radius-based Surface Descriptor (GRSD).
1432  * \ingroup common
1433  */
1435  {
1436  float histogram[21] = {0.f};
1437  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<GRSDSignature21>; }
1438 
1439  inline constexpr GRSDSignature21 () = default;
1440 
1441  friend std::ostream& operator << (std::ostream& os, const GRSDSignature21& p);
1442  };
1443 
1444  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BRISKSignature512& p);
1445  /** \brief A point structure representing the Binary Robust Invariant Scalable Keypoints (BRISK).
1446  * \ingroup common
1447  */
1449  {
1450  float scale = 0.f;
1451  float orientation = 0.f;
1452  unsigned char descriptor[64] = {0};
1453  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<BRISKSignature512>; }
1454 
1455  inline constexpr BRISKSignature512 () = default;
1456 
1457  inline constexpr BRISKSignature512 (float _scale, float _orientation): scale (_scale), orientation (_orientation) {}
1458 
1459  friend std::ostream& operator << (std::ostream& os, const BRISKSignature512& p);
1460  };
1461 
1462  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ESFSignature640& p);
1463  /** \brief A point structure representing the Ensemble of Shape Functions (ESF).
1464  * \ingroup common
1465  */
1467  {
1468  float histogram[640] = {0.f};
1469  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<ESFSignature640>; }
1470 
1471  inline constexpr ESFSignature640 () = default;
1472 
1473  friend std::ostream& operator << (std::ostream& os, const ESFSignature640& p);
1474  };
1475 
1476  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature512& p);
1477  /** \brief A point structure representing the Globally Aligned Spatial Distribution (GASD) shape descriptor.
1478  * \ingroup common
1479  */
1481  {
1482  float histogram[512] = {0.f};
1483  static constexpr int descriptorSize() { return detail::traits::descriptorSize_v<GASDSignature512>; }
1484 
1485  inline constexpr GASDSignature512 () = default;
1486 
1487  friend std::ostream& operator << (std::ostream& os, const GASDSignature512& p);
1488  };
1489 
1490  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature984& p);
1491  /** \brief A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descriptor.
1492  * \ingroup common
1493  */
1495  {
1496  float histogram[984] = {0.f};
1497  static constexpr int descriptorSize() { return detail::traits::descriptorSize_v<GASDSignature984>; }
1498 
1499  inline constexpr GASDSignature984 () = default;
1500 
1501  friend std::ostream& operator << (std::ostream& os, const GASDSignature984& p);
1502  };
1503 
1504  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GASDSignature7992& p);
1505  /** \brief A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descriptor.
1506  * \ingroup common
1507  */
1509  {
1510  float histogram[7992] = {0.f};
1511  static constexpr int descriptorSize() { return detail::traits::descriptorSize_v<GASDSignature7992>; }
1512 
1513  inline constexpr GASDSignature7992 () = default;
1514 
1515  friend std::ostream& operator << (std::ostream& os, const GASDSignature7992& p);
1516  };
1517 
1518  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p);
1519  /** \brief A point structure representing the GFPFH descriptor with 16 bins.
1520  * \ingroup common
1521  */
1523  {
1524  float histogram[16] = {0.f};
1525  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<GFPFHSignature16>; }
1526 
1527  inline constexpr GFPFHSignature16 () = default;
1528 
1529  friend std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p);
1530  };
1531 
1532  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Narf36& p);
1533  /** \brief A point structure representing the Narf descriptor.
1534  * \ingroup common
1535  */
1536  struct Narf36
1537  {
1538  float x = 0.f, y = 0.f, z = 0.f, roll = 0.f, pitch = 0.f, yaw = 0.f;
1539  float descriptor[36] = {0.f};
1540  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<Narf36>; }
1541 
1542  inline constexpr Narf36 () = default;
1543 
1544  inline constexpr Narf36 (float _x, float _y, float _z): Narf36 (_x, _y, _z, 0.f, 0.f, 0.f) {}
1545 
1546  inline constexpr Narf36 (float _x, float _y, float _z, float _roll, float _pitch, float _yaw):
1547  x (_x), y (_y), z (_z), roll (_roll), pitch (_pitch), yaw (_yaw) {}
1548 
1549  friend std::ostream& operator << (std::ostream& os, const Narf36& p);
1550  };
1551 
1552  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BorderDescription& p);
1553  /** \brief A structure to store if a point in a range image lies on a border between an obstacle and the background.
1554  * \ingroup common
1555  */
1557  {
1558  int x = 0, y = 0;
1560  //std::vector<const BorderDescription*> neighbors;
1561 
1562  inline constexpr BorderDescription () = default;
1563 
1564  inline constexpr BorderDescription (int _x, int _y) : x(_x), y(_y) {}
1565 
1566  friend std::ostream& operator << (std::ostream& os, const BorderDescription& p);
1567  };
1568 
1569 
1570  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const IntensityGradient& p);
1571  /** \brief A point structure representing the intensity gradient of an XYZI point cloud.
1572  * \ingroup common
1573  */
1575  {
1576  union
1577  {
1578  float gradient[3];
1579  struct
1580  {
1581  float gradient_x;
1582  float gradient_y;
1583  float gradient_z;
1584  };
1585  };
1586 
1587  inline constexpr IntensityGradient (): IntensityGradient (0.f, 0.f, 0.f) {}
1588 
1589  inline constexpr IntensityGradient (float _x, float _y, float _z): gradient_x (_x), gradient_y (_y), gradient_z (_z) {}
1590  friend std::ostream& operator << (std::ostream& os, const IntensityGradient& p);
1591  };
1592 
1593  // TODO: Maybe make other histogram based structs an alias for this
1594  /** \brief A point structure representing an N-D histogram.
1595  * \ingroup common
1596  */
1597  template <int N>
1598  struct Histogram
1599  {
1600  float histogram[N];
1601  static constexpr int descriptorSize () { return detail::traits::descriptorSize_v<Histogram<N>>; }
1602  };
1603 
1604  struct EIGEN_ALIGN16 _PointWithScale
1605  {
1606  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1607 
1608  union
1609  {
1610  /** \brief Diameter of the meaningful keypoint neighborhood. */
1611  float scale;
1612  float size;
1613  };
1614 
1615  /** \brief Computed orientation of the keypoint (-1 if not applicable). */
1616  float angle;
1617  /** \brief The response by which the most strong keypoints have been selected. */
1618  float response;
1619  /** \brief octave (pyramid layer) from which the keypoint has been extracted. */
1620  int octave;
1621 
1623  };
1624 
1625  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithScale& p);
1626  /** \brief A point structure representing a 3-D position and scale.
1627  * \ingroup common
1628  */
1630  {
1631  inline constexpr PointWithScale (const _PointWithScale &p) :
1632  PointWithScale{p.x, p.y, p.z, p.scale, p.angle, p.response, p.octave} {}
1633 
1634  inline constexpr PointWithScale (): PointWithScale (0.f, 0.f, 0.f) {}
1635 
1636  inline constexpr PointWithScale (float _x, float _y, float _z, float _scale = 1.f,
1637  float _angle = -1.f, float _response = 0.f, int _octave = 0) :
1638  _PointWithScale{{{_x, _y, _z, 1.0f}}, {_scale}, _angle, _response, _octave } {}
1639 
1640  friend std::ostream& operator << (std::ostream& os, const PointWithScale& p);
1641  };
1642 
1643 
1644  struct EIGEN_ALIGN16 _PointSurfel
1645  {
1646  PCL_ADD_POINT4D // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1647  PCL_ADD_NORMAL4D // This adds the member normal[3] which can also be accessed using the point (which is float[4])
1648  union
1649  {
1650  struct
1651  {
1652  PCL_ADD_UNION_RGB
1653  float radius;
1654  float confidence;
1655  float curvature;
1656  };
1657  float data_c[4];
1658  };
1659  PCL_ADD_EIGEN_MAPS_RGB
1661  };
1662 
1663  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointSurfel& p);
1664  /** \brief A surfel, that is, a point structure representing Euclidean xyz coordinates, together with normal coordinates, a RGBA color, a radius, a confidence value and the surface curvature estimate.
1665  * \ingroup common
1666  */
1667  struct PointSurfel : public _PointSurfel
1668  {
1669  inline constexpr PointSurfel (const _PointSurfel &p) :
1670  PointSurfel{p.x, p.y, p.z, p.normal_x, p.normal_y, p.normal_z, p.r, p.g, p.b, p.a, p.radius, p.confidence, p.curvature} {}
1671 
1672  inline constexpr PointSurfel () :
1673  PointSurfel{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0u, 0u, 0u, 0u, 0.0f, 0.0f, 0.0f} {}
1674 
1675  inline constexpr PointSurfel (float _x, float _y, float _z, float _nx,
1676  float _ny, float _nz, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a,
1677  float _radius, float _confidence, float _curvature) :
1678  _PointSurfel{
1679  {{_x, _y, _z, 1.0f}},
1680  {{_nx, _ny, _nz, 0.0f}},
1681  {{{{{_b, _g, _r, _a}}}, _radius, _confidence, _curvature}}
1682  } {}
1683 
1684 
1685  friend std::ostream& operator << (std::ostream& os, const PointSurfel& p);
1686  };
1687 
1688  struct EIGEN_ALIGN16 _PointDEM
1689  {
1690  PCL_ADD_POINT4D
1691  float intensity;
1695  };
1696 
1697  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointDEM& p);
1698  /** \brief A point structure representing Digital Elevation Map.
1699  * \ingroup common
1700  */
1701  struct PointDEM : public _PointDEM
1702  {
1703  inline constexpr PointDEM (const _PointDEM &p) :
1704  PointDEM{p.x, p.y, p.z, p.intensity, p.intensity_variance, p.height_variance} {}
1705 
1706  inline constexpr PointDEM (): PointDEM (0.f, 0.f, 0.f) {}
1707 
1708  inline constexpr PointDEM (float _x, float _y, float _z): PointDEM (_x, _y, _z, 0.f, 0.f, 0.f) {}
1709 
1710  inline constexpr PointDEM (float _x, float _y, float _z, float _intensity,
1711  float _intensity_variance, float _height_variance) :
1712  _PointDEM{{{_x, _y, _z, 1.0f}}, _intensity, _intensity_variance, _height_variance} {}
1713 
1714  friend std::ostream& operator << (std::ostream& os, const PointDEM& p);
1715  };
1716 
1717  template <int N> std::ostream&
1718  operator << (std::ostream& os, const Histogram<N>& p)
1719  {
1720  // make constexpr
1721  PCL_IF_CONSTEXPR(N > 0)
1722  {
1723  os << "(" << p.histogram[0];
1724  std::for_each(p.histogram + 1, std::end(p.histogram),
1725  [&os](const auto& hist) { os << ", " << hist; });
1726  os << ")";
1727  }
1728  return (os);
1729  }
1730 } // namespace pcl
1731 
1732 // Register point structs and wrappers
1733 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_RGB,
1734  (std::uint32_t, rgba, rgba)
1735 )
1736 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::RGB, pcl::_RGB)
1737 
1738 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Intensity,
1739  (float, intensity, intensity)
1740 )
1741 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity, pcl::_Intensity)
1742 
1743 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Intensity8u,
1744  (std::uint8_t, intensity, intensity)
1745 )
1746 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity8u, pcl::_Intensity8u)
1747 
1748 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Intensity32u,
1749  (std::uint32_t, intensity, intensity)
1750 )
1751 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity32u, pcl::_Intensity32u)
1752 
1753 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZ,
1754  (float, x, x)
1755  (float, y, y)
1756  (float, z, z)
1757 )
1758 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZ, pcl::_PointXYZ)
1759 
1760 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBA,
1761  (float, x, x)
1762  (float, y, y)
1763  (float, z, z)
1764  (std::uint32_t, rgba, rgba)
1765 )
1766 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBA, pcl::_PointXYZRGBA)
1767 
1768 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGB,
1769  (float, x, x)
1770  (float, y, y)
1771  (float, z, z)
1772  (float, rgb, rgb)
1773 )
1774 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGB, pcl::_PointXYZRGB)
1775 
1776 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBL,
1777  (float, x, x)
1778  (float, y, y)
1779  (float, z, z)
1780  (std::uint32_t, rgba, rgba)
1781  (std::uint32_t, label, label)
1782 )
1783 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBL, pcl::_PointXYZRGBL)
1784 
1785 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZLAB,
1786  (float, x, x)
1787  (float, y, y)
1788  (float, z, z)
1789  (float, L, L)
1790  (float, a, a)
1791  (float, b, b)
1792 )
1793 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZLAB, pcl::_PointXYZLAB)
1794 
1795 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZHSV,
1796  (float, x, x)
1797  (float, y, y)
1798  (float, z, z)
1799  (float, h, h)
1800  (float, s, s)
1801  (float, v, v)
1802 )
1803 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZHSV, pcl::_PointXYZHSV)
1804 
1805 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointXY,
1806  (float, x, x)
1807  (float, y, y)
1808 )
1809 
1810 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointUV,
1811  (float, u, u)
1812  (float, v, v)
1813 )
1814 
1815 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::InterestPoint,
1816  (float, x, x)
1817  (float, y, y)
1818  (float, z, z)
1819  (float, strength, strength)
1820 )
1821 
1822 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZI,
1823  (float, x, x)
1824  (float, y, y)
1825  (float, z, z)
1826  (float, intensity, intensity)
1827 )
1828 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZI, pcl::_PointXYZI)
1829 
1830 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointXYZL,
1831  (float, x, x)
1832  (float, y, y)
1833  (float, z, z)
1834  (std::uint32_t, label, label)
1835 )
1836 
1837 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::Label,
1838  (std::uint32_t, label, label)
1839 )
1840 
1841 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Normal,
1842  (float, normal_x, normal_x)
1843  (float, normal_y, normal_y)
1844  (float, normal_z, normal_z)
1845  (float, curvature, curvature)
1846 )
1847 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Normal, pcl::_Normal)
1848 
1849 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Axis,
1850  (float, normal_x, normal_x)
1851  (float, normal_y, normal_y)
1852  (float, normal_z, normal_z)
1853 )
1854 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Axis, pcl::_Axis)
1855 
1856 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointNormal,
1857  (float, x, x)
1858  (float, y, y)
1859  (float, z, z)
1860  (float, normal_x, normal_x)
1861  (float, normal_y, normal_y)
1862  (float, normal_z, normal_z)
1863  (float, curvature, curvature)
1864 )
1865 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBNormal,
1866  (float, x, x)
1867  (float, y, y)
1868  (float, z, z)
1869  (float, normal_x, normal_x)
1870  (float, normal_y, normal_y)
1871  (float, normal_z, normal_z)
1872  (float, rgb, rgb)
1873  (float, curvature, curvature)
1874 )
1875 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBNormal, pcl::_PointXYZRGBNormal)
1876 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointXYZINormal,
1877  (float, x, x)
1878  (float, y, y)
1879  (float, z, z)
1880  (float, normal_x, normal_x)
1881  (float, normal_y, normal_y)
1882  (float, normal_z, normal_z)
1883  (float, intensity, intensity)
1884  (float, curvature, curvature)
1885 )
1886 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointXYZLNormal,
1887  (float, x, x)
1888  (float, y, y)
1889  (float, z, z)
1890  (float, normal_x, normal_x)
1891  (float, normal_y, normal_y)
1892  (float, normal_z, normal_z)
1893  (std::uint32_t, label, label)
1894  (float, curvature, curvature)
1895 )
1896 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointWithRange,
1897  (float, x, x)
1898  (float, y, y)
1899  (float, z, z)
1900  (float, range, range)
1901 )
1902 
1903 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointWithViewpoint,
1904  (float, x, x)
1905  (float, y, y)
1906  (float, z, z)
1907  (float, vp_x, vp_x)
1908  (float, vp_y, vp_y)
1909  (float, vp_z, vp_z)
1910 )
1911 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointWithViewpoint, pcl::_PointWithViewpoint)
1912 
1913 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::MomentInvariants,
1914  (float, j1, j1)
1915  (float, j2, j2)
1916  (float, j3, j3)
1917 )
1918 
1919 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PrincipalRadiiRSD,
1920  (float, r_min, r_min)
1921  (float, r_max, r_max)
1922 )
1923 
1924 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::Boundary,
1925  (std::uint8_t, boundary_point, boundary_point)
1926 )
1927 
1928 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PrincipalCurvatures,
1929  (float, principal_curvature_x, principal_curvature_x)
1930  (float, principal_curvature_y, principal_curvature_y)
1931  (float, principal_curvature_z, principal_curvature_z)
1932  (float, pc1, pc1)
1933  (float, pc2, pc2)
1934 )
1935 
1936 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PFHSignature125,
1937  (float[125], histogram, pfh)
1938 )
1939 
1940 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PFHRGBSignature250,
1941  (float[250], histogram, pfhrgb)
1942 )
1943 
1944 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PPFSignature,
1945  (float, f1, f1)
1946  (float, f2, f2)
1947  (float, f3, f3)
1948  (float, f4, f4)
1949  (float, alpha_m, alpha_m)
1950 )
1951 
1952 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::CPPFSignature,
1953  (float, f1, f1)
1954  (float, f2, f2)
1955  (float, f3, f3)
1956  (float, f4, f4)
1957  (float, f5, f5)
1958  (float, f6, f6)
1959  (float, f7, f7)
1960  (float, f8, f8)
1961  (float, f9, f9)
1962  (float, f10, f10)
1963  (float, alpha_m, alpha_m)
1964 )
1965 
1966 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PPFRGBSignature,
1967  (float, f1, f1)
1968  (float, f2, f2)
1969  (float, f3, f3)
1970  (float, f4, f4)
1971  (float, r_ratio, r_ratio)
1972  (float, g_ratio, g_ratio)
1973  (float, b_ratio, b_ratio)
1974  (float, alpha_m, alpha_m)
1975 )
1976 
1977 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::NormalBasedSignature12,
1978  (float[12], values, values)
1979 )
1980 
1981 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::ShapeContext1980,
1982  (float[1980], descriptor, shape_context)
1983  (float[9], rf, rf)
1984 )
1985 
1986 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::UniqueShapeContext1960,
1987  (float[1960], descriptor, shape_context)
1988  (float[9], rf, rf)
1989 )
1990 
1991 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::SHOT352,
1992  (float[352], descriptor, shot)
1993  (float[9], rf, rf)
1994 )
1995 
1996 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::SHOT1344,
1997  (float[1344], descriptor, shot)
1998  (float[9], rf, rf)
1999 )
2000 
2001 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::FPFHSignature33,
2002  (float[33], histogram, fpfh)
2003 )
2004 
2005 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::BRISKSignature512,
2006  (float, scale, brisk_scale)
2007  (float, orientation, brisk_orientation)
2008  (unsigned char[64], descriptor, brisk_descriptor512)
2009 )
2010 
2011 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::VFHSignature308,
2012  (float[308], histogram, vfh)
2013 )
2014 
2015 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::GRSDSignature21,
2016  (float[21], histogram, grsd)
2017 )
2018 
2019 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::ESFSignature640,
2020  (float[640], histogram, esf)
2021 )
2022 
2023 POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::GASDSignature512,
2024  (float[512], histogram, gasd)
2025 )
2026 
2027 POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::GASDSignature984,
2028  (float[984], histogram, gasd)
2029 )
2030 
2031 POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::GASDSignature7992,
2032  (float[7992], histogram, gasd)
2033 )
2034 
2035 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::Narf36,
2036  (float[36], descriptor, descriptor)
2037 )
2038 
2039 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::GFPFHSignature16,
2040  (float[16], histogram, gfpfh)
2041 )
2042 
2043 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::IntensityGradient,
2044  (float, gradient_x, gradient_x)
2045  (float, gradient_y, gradient_y)
2046  (float, gradient_z, gradient_z)
2047 )
2048 
2049 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointWithScale,
2050  (float, x, x)
2051  (float, y, y)
2052  (float, z, z)
2053  (float, scale, scale)
2054 )
2055 
2056 POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::PointSurfel,
2057  (float, x, x)
2058  (float, y, y)
2059  (float, z, z)
2060  (float, normal_x, normal_x)
2061  (float, normal_y, normal_y)
2062  (float, normal_z, normal_z)
2063  (std::uint32_t, rgba, rgba)
2064  (float, radius, radius)
2065  (float, confidence, confidence)
2066  (float, curvature, curvature)
2067 )
2068 
2069 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_ReferenceFrame,
2070  (float[3], x_axis, x_axis)
2071  (float[3], y_axis, y_axis)
2072  (float[3], z_axis, z_axis)
2073 )
2074 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::ReferenceFrame, pcl::_ReferenceFrame)
2075 
2076 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointDEM,
2077  (float, x, x)
2078  (float, y, y)
2079  (float, z, z)
2080  (float, intensity, intensity)
2081  (float, intensity_variance, intensity_variance)
2082  (float, height_variance, height_variance)
2083 )
2084 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointDEM, pcl::_PointDEM)
2085 
2086 namespace pcl
2087 {
2088 
2089 // Allow float 'rgb' data to match to the newer uint32 'rgba' tag. This is so
2090 // you can load old 'rgb' PCD files into e.g. a PointCloud<PointXYZRGBA>.
2091 template<typename PointT>
2092 struct FieldMatches<PointT, ::pcl::fields::rgba>
2093 {
2094  bool operator() (const pcl::PCLPointField& field)
2095  {
2096  if (field.name == "rgb")
2097  {
2098  // For fixing the alpha value bug #1141, the rgb field can also match
2099  // uint32.
2100  return ((field.datatype == pcl::PCLPointField::FLOAT32 ||
2102  field.count == 1);
2103  }
2104  else
2105  {
2106  return (field.name == traits::name<PointT, fields::rgba>::value &&
2107  field.datatype == traits::datatype<PointT, fields::rgba>::value &&
2108  field.count == traits::datatype<PointT, fields::rgba>::size);
2109  }
2110  }
2111 };
2112 template<typename PointT>
2113 struct FieldMatches<PointT, fields::rgb>
2114 {
2115  bool operator() (const pcl::PCLPointField& field)
2116  {
2117  if (field.name == "rgba")
2118  {
2119  return (field.datatype == pcl::PCLPointField::UINT32 &&
2120  field.count == 1);
2121  }
2122  else
2123  {
2124  // For fixing the alpha value bug #1141, rgb can also match uint32
2125  return (field.name == traits::name<PointT, fields::rgb>::value &&
2126  (field.datatype == traits::datatype<PointT, fields::rgb>::value ||
2128  field.count == traits::datatype<PointT, fields::rgb>::size);
2129  }
2130  }
2131 };
2132 
2133 
2134 // We're doing a lot of black magic with Boost here, so disable warnings in Maintainer mode, as we will never
2135 // be able to fix them anyway
2136 #if defined _MSC_VER
2137  #pragma warning(disable: 4201)
2138 #endif
2139 
2140 namespace traits
2141 {
2142 
2143  /** \brief Metafunction to check if a given point type has a given field.
2144  *
2145  * Example usage at run-time:
2146  *
2147  * \code
2148  * bool curvature_available = pcl::traits::has_field<PointT, pcl::fields::curvature>::value;
2149  * \endcode
2150  *
2151  * Example usage at compile-time:
2152  *
2153  * \code
2154  * BOOST_MPL_ASSERT_MSG ((pcl::traits::has_field<PointT, pcl::fields::label>::value),
2155  * POINT_TYPE_SHOULD_HAVE_LABEL_FIELD,
2156  * (PointT));
2157  * \endcode
2158  */
2159  template <typename PointT, typename Field>
2160  struct has_field : boost::mpl::contains<typename pcl::traits::fieldList<PointT>::type, Field>::type
2161  { };
2162 
2163  /** Metafunction to check if a given point type has all given fields. */
2164  template <typename PointT, typename Field>
2165  struct has_all_fields : boost::mpl::fold<Field,
2166  boost::mpl::bool_<true>,
2167  boost::mpl::and_<boost::mpl::_1,
2168  has_field<PointT, boost::mpl::_2> > >::type
2169  { };
2170 
2171  /** Metafunction to check if a given point type has any of the given fields. */
2172  template <typename PointT, typename Field>
2173  struct has_any_field : boost::mpl::fold<Field,
2174  boost::mpl::bool_<false>,
2175  boost::mpl::or_<boost::mpl::_1,
2176  has_field<PointT, boost::mpl::_2> > >::type
2177  { };
2178 
2179  /** \brief Traits defined for ease of use with fields already registered before
2180  *
2181  * has_<fields to be detected>: struct with `value` datamember defined at compiletime
2182  * has_<fields to be detected>_v: constexpr boolean
2183  * Has<Fields to be detected>: concept modelling name alias for `enable_if`
2184  */
2185 
2186  /** Metafunction to check if a given point type has x and y fields. */
2187  template <typename PointT>
2188  struct has_xy : has_all_fields<PointT, boost::mpl::vector<pcl::fields::x,
2189  pcl::fields::y> >
2190  { };
2191 
2192  template <typename PointT>
2193  constexpr auto has_xy_v = has_xy<PointT>::value;
2194 
2195  template <typename PointT>
2196  using HasXY = std::enable_if_t<has_xy_v<PointT>, bool>;
2197 
2198  template <typename PointT>
2199  using HasNoXY = std::enable_if_t<!has_xy_v<PointT>, bool>;
2200 
2201  /** Metafunction to check if a given point type has x, y, and z fields. */
2202  template <typename PointT>
2203  struct has_xyz : has_all_fields<PointT, boost::mpl::vector<pcl::fields::x,
2204  pcl::fields::y,
2205  pcl::fields::z> >
2206  { };
2207 
2208  template <typename PointT>
2209  constexpr auto has_xyz_v = has_xyz<PointT>::value;
2210 
2211  template <typename PointT>
2212  using HasXYZ = std::enable_if_t<has_xyz_v<PointT>, bool>;
2213 
2214  template <typename PointT>
2215  using HasNoXYZ = std::enable_if_t<!has_xyz_v<PointT>, bool>;
2216 
2217  /** Metafunction to check if a given point type has normal_x, normal_y, and
2218  * normal_z fields. */
2219  template <typename PointT>
2220  struct has_normal : has_all_fields<PointT, boost::mpl::vector<pcl::fields::normal_x,
2221  pcl::fields::normal_y,
2222  pcl::fields::normal_z> >
2223  { };
2224 
2225  template <typename PointT>
2226  constexpr auto has_normal_v = has_normal<PointT>::value;
2227 
2228  template <typename PointT>
2229  using HasNormal = std::enable_if_t<has_normal_v<PointT>, bool>;
2230 
2231  template <typename PointT>
2232  using HasNoNormal = std::enable_if_t<!has_normal_v<PointT>, bool>;
2233 
2234  /** Metafunction to check if a given point type has curvature field. */
2235  template <typename PointT>
2236  struct has_curvature : has_field<PointT, pcl::fields::curvature>
2237  { };
2238 
2239  template <typename PointT>
2240  constexpr auto has_curvature_v = has_curvature<PointT>::value;
2241 
2242  template <typename PointT>
2243  using HasCurvature = std::enable_if_t<has_curvature_v<PointT>, bool>;
2244 
2245  template <typename PointT>
2246  using HasNoCurvature = std::enable_if_t<!has_curvature_v<PointT>, bool>;
2247 
2248  /** Metafunction to check if a given point type has intensity field. */
2249  template <typename PointT>
2250  struct has_intensity : has_field<PointT, pcl::fields::intensity>
2251  { };
2252 
2253  template <typename PointT>
2254  constexpr auto has_intensity_v = has_intensity<PointT>::value;
2255 
2256  template <typename PointT>
2257  using HasIntensity = std::enable_if_t<has_intensity_v<PointT>, bool>;
2258 
2259  template <typename PointT>
2260  using HasNoIntensity = std::enable_if_t<!has_intensity_v<PointT>, bool>;
2261 
2262  /** Metafunction to check if a given point type has either rgb or rgba field. */
2263  template <typename PointT>
2264  struct has_color : has_any_field<PointT, boost::mpl::vector<pcl::fields::rgb,
2265  pcl::fields::rgba> >
2266  { };
2267 
2268  template <typename PointT>
2269  constexpr auto has_color_v = has_color<PointT>::value;
2270 
2271  template <typename PointT>
2272  using HasColor = std::enable_if_t<has_color_v<PointT>, bool>;
2273 
2274  template <typename PointT>
2275  using HasNoColor = std::enable_if_t<!has_color_v<PointT>, bool>;
2276 
2277  /** Metafunction to check if a given point type has label field. */
2278  template <typename PointT>
2279  struct has_label : has_field<PointT, pcl::fields::label>
2280  { };
2281 
2282  template <typename PointT>
2283  constexpr auto has_label_v = has_label<PointT>::value;
2284 
2285  template <typename PointT>
2286  using HasLabel = std::enable_if_t<has_label_v<PointT>, bool>;
2287 
2288  template <typename PointT>
2289  using HasNoLabel = std::enable_if_t<!has_label_v<PointT>, bool>;
2290 }
2291 
2292 #if defined _MSC_VER
2293  #pragma warning(default: 4201)
2294 #endif
2295 
2296 } // namespace pcl
2297 
Defines all the PCL implemented PointT point type structures.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Definition: memory.h:63
std::bitset< 32 > BorderTraits
Data type to store extended information about a transition from foreground to backgroundSpecification...
Definition: point_types.h:307
Defines functions, macros and traits for allocating and using memory.
static constexpr int descriptorSize_v
std::ostream & operator<<(std::ostream &ostream, int8 value)
Definition: io_operators.h:86
Eigen::Map< Eigen::Vector2f > Vector2fMap
Eigen::Map< Eigen::Vector4f, Eigen::Aligned > Vector4fMap
const Eigen::Map< const Vector4c, Eigen::Aligned > Vector4cMapConst
const Eigen::Map< const Eigen::Vector2f > Vector2fMapConst
Eigen::Map< Vector4c, Eigen::Aligned > Vector4cMap
std::ostream & operator<<(std::ostream &os, const BivariatePolynomialT< real > &p)
const Eigen::Map< const Eigen::Vector3f > Vector3fMapConst
const Eigen::Map< const Vector3c > Vector3cMapConst
Eigen::Map< Eigen::Vector3f > Vector3fMap
Eigen::Matrix< std::uint8_t, 4, 1 > Vector4c
const Eigen::Map< const Eigen::Vector4f, Eigen::Aligned > Vector4fMapConst
const Eigen::Map< const Eigen::Array4f, Eigen::Aligned > Array4fMapConst
Eigen::Matrix< std::uint8_t, 3, 1 > Vector3c
Eigen::Map< Eigen::Array4f, Eigen::Aligned > Array4fMap
const Eigen::Map< const Eigen::Array3f > Array3fMapConst
Eigen::Map< Vector3c > Vector3cMap
Eigen::Map< Eigen::Array3f > Array3fMap
Defines all the PCL and non-PCL macros used.
#define PCL_EXPORTS
Definition: pcl_macros.h:325
#define PCL_IF_CONSTEXPR(x)
Definition: pcl_macros.h:455
float intensity_variance
PCL_ADD_POINT4D float intensity
PCL_ADD_UNION_RGB float radius
float angle
Computed orientation of the keypoint (-1 if not applicable).
float response
The response by which the most strong keypoints have been selected.
int octave
octave (pyramid layer) from which the keypoint has been extracted.
float scale
Diameter of the meaningful keypoint neighborhood.
A point structure representing Euclidean xyz coordinates, and the intensity value.
PCL_ADD_POINT4D std::uint32_t label
PCL_ADD_POINT4D PCL_ADD_RGB std::uint32_t label
PCL_ADD_UNION_RGB float curvature
A structure representing the Local Reference Frame of a point.
const Eigen::Map< const Eigen::Matrix3f > getMatrix3fMap() const
const Eigen::Map< const Eigen::Vector3f > getYAxisVector3fMap() const
Eigen::Map< Eigen::Vector3f > getXAxisVector3fMap()
Eigen::Map< Eigen::Vector3f > getYAxisVector3fMap()
const Eigen::Map< const Eigen::Vector3f > getZAxisVector3fMap() const
Eigen::Map< Eigen::Vector3f > getZAxisVector3fMap()
const Eigen::Map< const Eigen::Vector3f > getXAxisVector3fMap() const
Eigen::Map< Eigen::Matrix3f > getMatrix3fMap()
A point structure representing an Axis using its normal coordinates.
constexpr Axis(float n_x, float n_y, float n_z)
constexpr Axis()
constexpr Axis(const _Axis &p)
A point structure representing the Binary Robust Invariant Scalable Keypoints (BRISK).
constexpr BRISKSignature512()=default
static constexpr int descriptorSize()
constexpr BRISKSignature512(float _scale, float _orientation)
A structure to store if a point in a range image lies on a border between an obstacle and the backgro...
constexpr BorderDescription(int _x, int _y)
constexpr BorderDescription()=default
A point structure representing a description of whether a point is lying on a surface boundary or not...
constexpr Boundary(std::uint8_t _boundary=0)
A point structure for storing the Point Pair Feature (CPPF) values.
constexpr CPPFSignature(float _alpha=0.f)
constexpr CPPFSignature(float _f1, float _f2, float _f3, float _f4, float _f5, float _f6, float _f7, float _f8, float _f9, float _f10, float _alpha=0.f)
A point structure representing the Ensemble of Shape Functions (ESF).
static constexpr int descriptorSize()
constexpr ESFSignature640()=default
A point structure representing the Fast Point Feature Histogram (FPFH).
static constexpr int descriptorSize()
constexpr FPFHSignature33()=default
bool operator()(const PCLPointField &field)
Definition: PCLPointField.h:71
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape descriptor.
static constexpr int descriptorSize()
constexpr GASDSignature512()=default
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descr...
static constexpr int descriptorSize()
constexpr GASDSignature7992()=default
A point structure representing the Globally Aligned Spatial Distribution (GASD) shape and color descr...
constexpr GASDSignature984()=default
static constexpr int descriptorSize()
A point structure representing the GFPFH descriptor with 16 bins.
constexpr GFPFHSignature16()=default
static constexpr int descriptorSize()
A point structure representing the Global Radius-based Surface Descriptor (GRSD).
static constexpr int descriptorSize()
constexpr GRSDSignature21()=default
A point structure representing an N-D histogram.
float histogram[N]
static constexpr int descriptorSize()
A point structure representing the grayscale intensity in single-channel images.
constexpr Intensity32u(const _Intensity32u &p)
constexpr Intensity32u(std::uint32_t _intensity=0)
A point structure representing the grayscale intensity in single-channel images.
constexpr Intensity8u(std::uint8_t _intensity=0)
constexpr Intensity8u(const _Intensity8u &p)
A point structure representing the intensity gradient of an XYZI point cloud.
constexpr IntensityGradient(float _x, float _y, float _z)
constexpr IntensityGradient()
A point structure representing the grayscale intensity in single-channel images.
constexpr Intensity(const _Intensity &p)
constexpr Intensity(float _intensity=0.f)
A point structure representing an interest point with Euclidean xyz coordinates, and an interest valu...
constexpr Label(std::uint32_t _label=0)
A point structure representing the three moment invariants.
constexpr MomentInvariants()=default
constexpr MomentInvariants(float _j1, float _j2, float _j3)
A point structure representing the Narf descriptor.
constexpr Narf36(float _x, float _y, float _z, float _roll, float _pitch, float _yaw)
static constexpr int descriptorSize()
constexpr Narf36(float _x, float _y, float _z)
constexpr Narf36()=default
A point structure representing the Normal Based Signature for a feature matrix of 4-by-3.
constexpr NormalBasedSignature12()=default
A point structure representing normal coordinates and the surface curvature estimate.
constexpr Normal(const _Normal &p)
constexpr Normal(float _curvature=0.f)
constexpr Normal(float n_x, float n_y, float n_z, float _curvature=0.f)
std::string name
Definition: PCLPointField.h:14
std::uint8_t datatype
Definition: PCLPointField.h:17
A point structure representing the Point Feature Histogram with colors (PFHRGB).
constexpr PFHRGBSignature250()=default
static constexpr int descriptorSize()
A point structure representing the Point Feature Histogram (PFH).
constexpr PFHSignature125()=default
static constexpr int descriptorSize()
A point structure for storing the Point Pair Color Feature (PPFRGB) values.
constexpr PPFRGBSignature(float _f1, float _f2, float _f3, float _f4, float _alpha, float _r, float _g, float _b)
constexpr PPFRGBSignature(float _f1, float _f2, float _f3, float _f4, float _alpha=0.f)
constexpr PPFRGBSignature(float _alpha=0.f)
A point structure for storing the Point Pair Feature (PPF) values.
constexpr PPFSignature(float _f1, float _f2, float _f3, float _f4, float _alpha=0.f)
constexpr PPFSignature(float _alpha=0.f)
A point structure representing Digital Elevation Map.
constexpr PointDEM(const _PointDEM &p)
constexpr PointDEM(float _x, float _y, float _z, float _intensity, float _intensity_variance, float _height_variance)
constexpr PointDEM(float _x, float _y, float _z)
constexpr PointDEM()
A point structure representing Euclidean xyz coordinates, together with normal coordinates and the su...
constexpr PointNormal(float _curvature=0.f)
constexpr PointNormal(float _x, float _y, float _z)
constexpr PointNormal(const _PointNormal &p)
constexpr PointNormal(float _x, float _y, float _z, float n_x, float n_y, float n_z, float _curvature=0.f)
A surfel, that is, a point structure representing Euclidean xyz coordinates, together with normal coo...
constexpr PointSurfel(const _PointSurfel &p)
constexpr PointSurfel()
constexpr PointSurfel(float _x, float _y, float _z, float _nx, float _ny, float _nz, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a, float _radius, float _confidence, float _curvature)
A 2D point structure representing pixel image coordinates.
constexpr PointUV(float _u, float _v)
constexpr PointUV()=default
A point structure representing Euclidean xyz coordinates, padded with an extra range float.
constexpr PointWithRange(float _range=0.f)
constexpr PointWithRange(float _x, float _y, float _z, float _range=0.f)
constexpr PointWithRange(const _PointWithRange &p)
A point structure representing a 3-D position and scale.
constexpr PointWithScale()
constexpr PointWithScale(const _PointWithScale &p)
constexpr PointWithScale(float _x, float _y, float _z, float _scale=1.f, float _angle=-1.f, float _response=0.f, int _octave=0)
A point structure representing Euclidean xyz coordinates together with the viewpoint from which it wa...
constexpr PointWithViewpoint(float _x, float _y, float _z)
constexpr PointWithViewpoint(float _x, float _y, float _z, float _vp_x, float _vp_y, float _vp_z)
constexpr PointWithViewpoint(const _PointWithViewpoint &p)
constexpr PointWithViewpoint()
A 2D point structure representing Euclidean xy coordinates.
constexpr PointXY()
pcl::Vector2fMap getVector2fMap()
constexpr PointXY(float _x, float _y)
pcl::Vector2fMapConst getVector2fMap() const
constexpr PointXYZHSV()
constexpr PointXYZHSV(const _PointXYZHSV &p)
constexpr PointXYZHSV(float _h, float _s, float _v)
constexpr PointXYZHSV(float _x, float _y, float _z, float _h, float _s, float _v)
A point structure representing Euclidean xyz coordinates.
constexpr PointXYZ(float _x, float _y, float _z)
constexpr PointXYZ(const _PointXYZ &p)
constexpr PointXYZ()
constexpr PointXYZI(float _x, float _y, float _z, float _intensity=0.f)
constexpr PointXYZI(float _intensity=0.f)
constexpr PointXYZI(const _PointXYZI &p)
A point structure representing Euclidean xyz coordinates, intensity, together with normal coordinates...
constexpr PointXYZINormal(float _intensity=0.f)
constexpr PointXYZINormal(const _PointXYZINormal &p)
constexpr PointXYZINormal(float _x, float _y, float _z, float _intensity, float n_x, float n_y, float n_z, float _curvature=0.f)
constexpr PointXYZINormal(float _x, float _y, float _z, float _intensity=0.f)
A point structure representing Euclidean xyz coordinates, and the CIELAB color.
constexpr PointXYZLAB()
constexpr PointXYZLAB(float _x, float _y, float _z, float _l, float _a, float _b)
constexpr PointXYZLAB(const _PointXYZLAB &p)
constexpr PointXYZL(std::uint32_t _label=0)
constexpr PointXYZL(const _PointXYZL &p)
constexpr PointXYZL(float _x, float _y, float _z, std::uint32_t _label=0)
A point structure representing Euclidean xyz coordinates, a label, together with normal coordinates a...
constexpr PointXYZLNormal(const _PointXYZLNormal &p)
constexpr PointXYZLNormal(float _x, float _y, float _z, std::uint32_t _label=0u)
constexpr PointXYZLNormal(std::uint32_t _label=0u)
constexpr PointXYZLNormal(float _x, float _y, float _z, std::uint32_t _label, float n_x, float n_y, float n_z, float _curvature=0.f)
A point structure representing Euclidean xyz coordinates, and the RGBA color.
constexpr PointXYZRGBA(const _PointXYZRGBA &p)
constexpr PointXYZRGBA()
constexpr PointXYZRGBA(float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a)
constexpr PointXYZRGBA(float _x, float _y, float _z)
constexpr PointXYZRGBA(std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a)
A point structure representing Euclidean xyz coordinates, and the RGB color.
constexpr PointXYZRGB(float _x, float _y, float _z)
constexpr PointXYZRGB()
constexpr PointXYZRGB(const _PointXYZRGB &p)
constexpr PointXYZRGB(float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
constexpr PointXYZRGB(std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
constexpr PointXYZRGBL(std::uint32_t _label=0)
constexpr PointXYZRGBL(float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint32_t _label=0, std::uint8_t _a=255)
constexpr PointXYZRGBL(float _x, float _y, float _z)
constexpr PointXYZRGBL(std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
constexpr PointXYZRGBL(const _PointXYZRGBL &p)
A point structure representing Euclidean xyz coordinates, and the RGB color, together with normal coo...
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)
constexpr PointXYZRGBNormal(std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
constexpr PointXYZRGBNormal(float _curvature=0.f)
constexpr PointXYZRGBNormal(const _PointXYZRGBNormal &p)
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)
constexpr PointXYZRGBNormal(float _x, float _y, float _z, std::uint8_t _r, std::uint8_t _g, std::uint8_t _b)
A point structure representing the principal curvatures and their magnitudes.
constexpr PrincipalCurvatures(float _pc1, float _pc2)
constexpr PrincipalCurvatures(float _x, float _y, float _z)
constexpr PrincipalCurvatures(float _x, float _y, float _z, float _pc1, float _pc2)
A point structure representing the minimum and maximum surface radii (in meters) computed using RSD.
constexpr PrincipalRadiiRSD(float _r_min, float _r_max)
constexpr PrincipalRadiiRSD()=default
A structure representing RGB color information.
constexpr RGB(std::uint8_t _r, std::uint8_t _g, std::uint8_t _b, std::uint8_t _a=255)
constexpr RGB()
constexpr RGB(const _RGB &p)
constexpr ReferenceFrame()
constexpr ReferenceFrame(const float(&_rf)[9])
constexpr ReferenceFrame(const _ReferenceFrame &p)
A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape+col...
static constexpr int descriptorSize()
constexpr SHOT1344()=default
A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape onl...
constexpr SHOT352()=default
static constexpr int descriptorSize()
A point structure representing a Shape Context.
static constexpr int descriptorSize()
constexpr ShapeContext1980()=default
A point structure representing a Unique Shape Context.
static constexpr int descriptorSize()
constexpr UniqueShapeContext1960()=default
A point structure representing the Viewpoint Feature Histogram (VFH).
static constexpr int descriptorSize()
constexpr VFHSignature308()=default