Point Cloud Library (PCL)  1.11.1-dev
io.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2011, 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  * $Id$
38  *
39  */
40 
41 #pragma once
42 
43 #include <numeric>
44 #include <string>
45 
46 #include <pcl/PointIndices.h>
47 #include <pcl/conversions.h>
48 #include <pcl/exceptions.h>
49 #include <pcl/pcl_macros.h>
50 #include <pcl/PolygonMesh.h>
51 #include <locale>
52 
53 namespace pcl
54 {
55  /** \brief Get the index of a specified field (i.e., dimension/channel)
56  * \param[in] cloud the point cloud message
57  * \param[in] field_name the string defining the field name
58  * \ingroup common
59  */
60  inline int
61  getFieldIndex (const pcl::PCLPointCloud2 &cloud, const std::string &field_name)
62  {
63  // Get the index we need
64  const auto result = std::find_if(cloud.fields.begin (), cloud.fields.end (),
65  [&field_name](const auto field) { return field.name == field_name; });
66  if (result == cloud.fields.end ())
67  return -1;
68  return std::distance(cloud.fields.begin (), result);
69  }
70 
71  /** \brief Get the index of a specified field (i.e., dimension/channel)
72  * \tparam PointT datatype for which fields is being queries
73  * \param[in] field_name the string defining the field name
74  * \param[out] fields a vector to the original \a PCLPointField vector that the raw PointCloud message contains
75  * \ingroup common
76  */
77  template <typename PointT> inline int
78  getFieldIndex (const std::string &field_name,
79  std::vector<pcl::PCLPointField> &fields);
80  /** \brief Get the index of a specified field (i.e., dimension/channel)
81  * \tparam PointT datatype for which fields is being queries
82  * \param[in] field_name the string defining the field name
83  * \param[in] fields a vector to the original \a PCLPointField vector that the raw PointCloud message contains
84  * \ingroup common
85  */
86  template <typename PointT> inline int
87  getFieldIndex (const std::string &field_name,
88  const std::vector<pcl::PCLPointField> &fields);
89 
90  /** \brief Get the list of available fields (i.e., dimension/channel)
91  * \tparam PointT datatype whose details are requested
92  * \ingroup common
93  */
94  template <typename PointT> inline std::vector<pcl::PCLPointField>
95  getFields ();
96 
97  /** \brief Get the list of all fields available in a given cloud
98  * \param[in] cloud the point cloud message
99  * \ingroup common
100  */
101  template <typename PointT> inline std::string
102  getFieldsList (const pcl::PointCloud<PointT> &cloud);
103 
104  /** \brief Get the available point cloud fields as a space separated string
105  * \param[in] cloud a pointer to the PointCloud message
106  * \ingroup common
107  */
108  inline std::string
110  {
111  return std::accumulate(std::next (cloud.fields.begin ()), cloud.fields.end (), cloud.fields[0].name,
112  [](const auto& acc, const auto& field) { return acc + " " + field.name; });
113  }
114 
115  /** \brief Obtains the size of a specific field data type in bytes
116  * \param[in] datatype the field data type (see PCLPointField.h)
117  * \ingroup common
118  */
119  inline int
120  getFieldSize (const int datatype)
121  {
122  switch (datatype)
123  {
126  return (1);
127 
130  return (2);
131 
135  return (4);
136 
138  return (8);
139 
140  default:
141  return (0);
142  }
143  }
144 
145  /** \brief Obtain a vector with the sizes of all valid fields (e.g., not "_")
146  * \param[in] fields the input vector containing the fields
147  * \param[out] field_sizes the resultant field sizes in bytes
148  */
149  PCL_EXPORTS void
150  getFieldsSizes (const std::vector<pcl::PCLPointField> &fields,
151  std::vector<int> &field_sizes);
152 
153  /** \brief Obtains the type of the PCLPointField from a specific size and type
154  * \param[in] size the size in bytes of the data field
155  * \param[in] type a char describing the type of the field ('F' = float, 'I' = signed, 'U' = unsigned)
156  * \ingroup common
157  */
158  inline int
159  getFieldType (const int size, char type)
160  {
161  type = std::toupper (type, std::locale::classic ());
162  switch (size)
163  {
164  case 1:
165  if (type == 'I')
166  return (pcl::PCLPointField::INT8);
167  if (type == 'U')
168  return (pcl::PCLPointField::UINT8);
169  break;
170 
171  case 2:
172  if (type == 'I')
173  return (pcl::PCLPointField::INT16);
174  if (type == 'U')
176  break;
177 
178  case 4:
179  if (type == 'I')
180  return (pcl::PCLPointField::INT32);
181  if (type == 'U')
183  if (type == 'F')
185  break;
186 
187  case 8:
188  if (type == 'F')
190  break;
191  }
192  return (-1);
193  }
194 
195  /** \brief Obtains the type of the PCLPointField from a specific PCLPointField as a char
196  * \param[in] type the PCLPointField field type
197  * \ingroup common
198  */
199  inline char
200  getFieldType (const int type)
201  {
202  switch (type)
203  {
207  return ('I');
208 
212  return ('U');
213 
216  return ('F');
217  default:
218  return ('?');
219  }
220  }
221 
223  {
228  };
229 
230  /** \brief \return the right index according to the interpolation type.
231  * \note this is adapted from OpenCV
232  * \param p the index of point to interpolate
233  * \param length the top/bottom row or left/right column index
234  * \param type the requested interpolation
235  * \throws pcl::BadArgumentException if type is unknown
236  */
237  PCL_EXPORTS int
238  interpolatePointIndex (int p, int length, InterpolationType type);
239 
240  /** \brief Concatenate two pcl::PointCloud<PointT>
241  * \param[in] cloud1 the first input point cloud dataset
242  * \param[in] cloud2 the second input point cloud dataset
243  * \param[out] cloud_out the resultant output point cloud dataset
244  * \return true if successful, false otherwise
245  * \ingroup common
246  */
247  template <typename PointT>
248  PCL_EXPORTS bool
250  const pcl::PointCloud<PointT> &cloud2,
251  pcl::PointCloud<PointT> &cloud_out)
252  {
253  return pcl::PointCloud<PointT>::concatenate(cloud1, cloud2, cloud_out);
254  }
255 
256  /** \brief Concatenate two pcl::PCLPointCloud2
257  *
258  * \warning This function subtly differs from the deprecated concatenatePointCloud()
259  * The difference is that this function will concatenate IFF the non-skip fields
260  * are in the correct order and same in number. The deprecated function skipped
261  * fields even if both clouds didn't agree on the number of output fields
262  * \param[in] cloud1 the first input point cloud dataset
263  * \param[in] cloud2 the second input point cloud dataset
264  * \param[out] cloud_out the resultant output point cloud dataset
265  * \return true if successful, false otherwise
266  * \ingroup common
267  */
268  PCL_EXPORTS inline bool
270  const pcl::PCLPointCloud2 &cloud2,
271  pcl::PCLPointCloud2 &cloud_out)
272  {
273  return pcl::PCLPointCloud2::concatenate(cloud1, cloud2, cloud_out);
274  }
275 
276  /** \brief Concatenate two pcl::PolygonMesh
277  * \param[in] mesh1 the first input mesh
278  * \param[in] mesh2 the second input mesh
279  * \param[out] mesh_out the resultant output mesh
280  * \return true if successful, false otherwise
281  * \ingroup common
282  */
283  PCL_EXPORTS inline bool
285  const pcl::PolygonMesh &mesh2,
286  pcl::PolygonMesh &mesh_out)
287  {
288  return pcl::PolygonMesh::concatenate(mesh1, mesh2, mesh_out);
289  }
290 
291  /** \brief Concatenate two pcl::PCLPointCloud2
292  * \param[in] cloud1 the first input point cloud dataset
293  * \param[in] cloud2 the second input point cloud dataset
294  * \param[out] cloud_out the resultant output point cloud dataset
295  * \return true if successful, false otherwise (e.g., name/number of fields differs)
296  * \ingroup common
297  */
298  PCL_DEPRECATED(1, 12, "use pcl::concatenate() instead, but beware of subtle difference in behavior (see documentation)")
299  PCL_EXPORTS bool
300  concatenatePointCloud (const pcl::PCLPointCloud2 &cloud1,
301  const pcl::PCLPointCloud2 &cloud2,
302  pcl::PCLPointCloud2 &cloud_out);
303 
304  /** \brief Extract the indices of a given point cloud as a new point cloud
305  * \param[in] cloud_in the input point cloud dataset
306  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
307  * \param[out] cloud_out the resultant output point cloud dataset
308  * \note Assumes unique indices.
309  * \ingroup common
310  */
311  PCL_EXPORTS void
312  copyPointCloud (const pcl::PCLPointCloud2 &cloud_in,
313  const Indices &indices,
314  pcl::PCLPointCloud2 &cloud_out);
315 
316  /** \brief Extract the indices of a given point cloud as a new point cloud
317  * \param[in] cloud_in the input point cloud dataset
318  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
319  * \param[out] cloud_out the resultant output point cloud dataset
320  * \note Assumes unique indices.
321  * \ingroup common
322  */
323  PCL_EXPORTS void
324  copyPointCloud (const pcl::PCLPointCloud2 &cloud_in,
325  const IndicesAllocator< Eigen::aligned_allocator<int> > &indices,
326  pcl::PCLPointCloud2 &cloud_out);
327 
328  /** \brief Copy fields and point cloud data from \a cloud_in to \a cloud_out
329  * \param[in] cloud_in the input point cloud dataset
330  * \param[out] cloud_out the resultant output point cloud dataset
331  * \ingroup common
332  */
333  PCL_EXPORTS void
334  copyPointCloud (const pcl::PCLPointCloud2 &cloud_in,
335  pcl::PCLPointCloud2 &cloud_out);
336 
337  /** \brief Check if two given point types are the same or not. */
338  template <typename Point1T, typename Point2T> inline bool
340  {
341  return (typeid (Point1T) == typeid (Point2T));
342  }
343 
344  /** \brief Extract the indices of a given point cloud as a new point cloud
345  * \param[in] cloud_in the input point cloud dataset
346  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
347  * \param[out] cloud_out the resultant output point cloud dataset
348  * \note Assumes unique indices.
349  * \ingroup common
350  */
351  template <typename PointT, typename IndicesVectorAllocator = std::allocator<int>> void
352  copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
353  const IndicesAllocator< IndicesVectorAllocator> &indices,
354  pcl::PointCloud<PointT> &cloud_out);
355 
356  /** \brief Extract the indices of a given point cloud as a new point cloud
357  * \param[in] cloud_in the input point cloud dataset
358  * \param[in] indices the PointIndices structure representing the points to be copied from cloud_in
359  * \param[out] cloud_out the resultant output point cloud dataset
360  * \note Assumes unique indices.
361  * \ingroup common
362  */
363  template <typename PointT> void
364  copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
365  const PointIndices &indices,
366  pcl::PointCloud<PointT> &cloud_out);
367 
368  /** \brief Extract the indices of a given point cloud as a new point cloud
369  * \param[in] cloud_in the input point cloud dataset
370  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
371  * \param[out] cloud_out the resultant output point cloud dataset
372  * \note Assumes unique indices.
373  * \ingroup common
374  */
375  template <typename PointT> void
376  copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
377  const std::vector<pcl::PointIndices> &indices,
378  pcl::PointCloud<PointT> &cloud_out);
379 
380  /** \brief Copy all the fields from a given point cloud into a new point cloud
381  * \param[in] cloud_in the input point cloud dataset
382  * \param[out] cloud_out the resultant output point cloud dataset
383  * \ingroup common
384  */
385  template <typename PointInT, typename PointOutT> void
386  copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
387  pcl::PointCloud<PointOutT> &cloud_out);
388 
389  /** \brief Extract the indices of a given point cloud as a new point cloud
390  * \param[in] cloud_in the input point cloud dataset
391  * \param[in] indices the vector of indices representing the points to be copied from \a cloud_in
392  * \param[out] cloud_out the resultant output point cloud dataset
393  * \note Assumes unique indices.
394  * \ingroup common
395  */
396  template <typename PointInT, typename PointOutT, typename IndicesVectorAllocator = std::allocator<int>> void
397  copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
398  const IndicesAllocator<IndicesVectorAllocator> &indices,
399  pcl::PointCloud<PointOutT> &cloud_out);
400 
401  /** \brief Extract the indices of a given point cloud as a new point cloud
402  * \param[in] cloud_in the input point cloud dataset
403  * \param[in] indices the PointIndices structure representing the points to be copied from cloud_in
404  * \param[out] cloud_out the resultant output point cloud dataset
405  * \note Assumes unique indices.
406  * \ingroup common
407  */
408  template <typename PointInT, typename PointOutT> void
409  copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
410  const PointIndices &indices,
411  pcl::PointCloud<PointOutT> &cloud_out);
412 
413  /** \brief Extract the indices of a given point cloud as a new point cloud
414  * \param[in] cloud_in the input point cloud dataset
415  * \param[in] indices the vector of indices representing the points to be copied from cloud_in
416  * \param[out] cloud_out the resultant output point cloud dataset
417  * \note Assumes unique indices.
418  * \ingroup common
419  */
420  template <typename PointInT, typename PointOutT> void
421  copyPointCloud (const pcl::PointCloud<PointInT> &cloud_in,
422  const std::vector<pcl::PointIndices> &indices,
423  pcl::PointCloud<PointOutT> &cloud_out);
424 
425  /** \brief Copy a point cloud inside a larger one interpolating borders.
426  * \param[in] cloud_in the input point cloud dataset
427  * \param[out] cloud_out the resultant output point cloud dataset
428  * \param top
429  * \param bottom
430  * \param left
431  * \param right
432  * Position of cloud_in inside cloud_out is given by \a top, \a left, \a bottom \a right.
433  * \param[in] border_type the interpolating method (pcl::BORDER_XXX)
434  * BORDER_REPLICATE: aaaaaa|abcdefgh|hhhhhhh
435  * BORDER_REFLECT: fedcba|abcdefgh|hgfedcb
436  * BORDER_REFLECT_101: gfedcb|abcdefgh|gfedcba
437  * BORDER_WRAP: cdefgh|abcdefgh|abcdefg
438  * BORDER_CONSTANT: iiiiii|abcdefgh|iiiiiii with some specified 'i'
439  * BORDER_TRANSPARENT: mnopqr|abcdefgh|tuvwxyz where m-r and t-z are original values of cloud_out
440  * \param value
441  * \throw pcl::BadArgumentException if any of top, bottom, left or right is negative.
442  * \ingroup common
443  */
444  template <typename PointT> void
445  copyPointCloud (const pcl::PointCloud<PointT> &cloud_in,
446  pcl::PointCloud<PointT> &cloud_out,
447  int top, int bottom, int left, int right,
448  pcl::InterpolationType border_type, const PointT& value);
449 
450  /** \brief Concatenate two datasets representing different fields.
451  *
452  * \note If the input datasets have overlapping fields (i.e., both contain
453  * the same fields), then the data in the second cloud (cloud2_in) will
454  * overwrite the data in the first (cloud1_in).
455  *
456  * \param[in] cloud1_in the first input dataset
457  * \param[in] cloud2_in the second input dataset (overwrites the fields of the first dataset for those that are shared)
458  * \param[out] cloud_out the resultant output dataset created by the concatenation of all the fields in the input datasets
459  * \ingroup common
460  */
461  template <typename PointIn1T, typename PointIn2T, typename PointOutT> void
463  const pcl::PointCloud<PointIn2T> &cloud2_in,
464  pcl::PointCloud<PointOutT> &cloud_out);
465 
466  /** \brief Concatenate two datasets representing different fields.
467  *
468  * \note If the input datasets have overlapping fields (i.e., both contain
469  * the same fields), then the data in the second cloud (cloud2_in) will
470  * overwrite the data in the first (cloud1_in).
471  *
472  * \param[in] cloud1_in the first input dataset
473  * \param[in] cloud2_in the second input dataset (overwrites the fields of the first dataset for those that are shared)
474  * \param[out] cloud_out the output dataset created by concatenating all the fields in the input datasets
475  * \ingroup common
476  */
477  PCL_EXPORTS bool
478  concatenateFields (const pcl::PCLPointCloud2 &cloud1_in,
479  const pcl::PCLPointCloud2 &cloud2_in,
480  pcl::PCLPointCloud2 &cloud_out);
481 
482  /** \brief Copy the XYZ dimensions of a pcl::PCLPointCloud2 into Eigen format
483  * \param[in] in the point cloud message
484  * \param[out] out the resultant Eigen MatrixXf format containing XYZ0 / point
485  * \ingroup common
486  */
487  PCL_EXPORTS bool
488  getPointCloudAsEigen (const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out);
489 
490  /** \brief Copy the XYZ dimensions from an Eigen MatrixXf into a pcl::PCLPointCloud2 message
491  * \param[in] in the Eigen MatrixXf format containing XYZ0 / point
492  * \param[out] out the resultant point cloud message
493  * \note the method assumes that the PCLPointCloud2 message already has the fields set up properly !
494  * \ingroup common
495  */
496  PCL_EXPORTS bool
497  getEigenAsPointCloud (Eigen::MatrixXf &in, pcl::PCLPointCloud2 &out);
498 
499  namespace io
500  {
501  /** \brief swap bytes order of a char array of length N
502  * \param bytes char array to swap
503  * \ingroup common
504  */
505  template <std::size_t N> void
506  swapByte (char* bytes);
507 
508  /** \brief specialization of swapByte for dimension 1
509  * \param bytes char array to swap
510  */
511  template <> inline void
512  swapByte<1> (char* bytes) { bytes[0] = bytes[0]; }
513 
514 
515  /** \brief specialization of swapByte for dimension 2
516  * \param bytes char array to swap
517  */
518  template <> inline void
519  swapByte<2> (char* bytes) { std::swap (bytes[0], bytes[1]); }
520 
521  /** \brief specialization of swapByte for dimension 4
522  * \param bytes char array to swap
523  */
524  template <> inline void
525  swapByte<4> (char* bytes)
526  {
527  std::swap (bytes[0], bytes[3]);
528  std::swap (bytes[1], bytes[2]);
529  }
530 
531  /** \brief specialization of swapByte for dimension 8
532  * \param bytes char array to swap
533  */
534  template <> inline void
535  swapByte<8> (char* bytes)
536  {
537  std::swap (bytes[0], bytes[7]);
538  std::swap (bytes[1], bytes[6]);
539  std::swap (bytes[2], bytes[5]);
540  std::swap (bytes[3], bytes[4]);
541  }
542 
543  /** \brief swaps byte of an arbitrary type T casting it to char*
544  * \param value the data you want its bytes swapped
545  */
546  template <typename T> void
547  swapByte (T& value)
548  {
549  pcl::io::swapByte<sizeof(T)> (reinterpret_cast<char*> (&value));
550  }
551  }
552 }
553 
554 #include <pcl/common/impl/io.hpp>
pcl::getPointCloudAsEigen
PCL_EXPORTS bool getPointCloudAsEigen(const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out)
Copy the XYZ dimensions of a pcl::PCLPointCloud2 into Eigen format.
pcl::concatenateFields
void concatenateFields(const pcl::PointCloud< PointIn1T > &cloud1_in, const pcl::PointCloud< PointIn2T > &cloud2_in, pcl::PointCloud< PointOutT > &cloud_out)
Concatenate two datasets representing different fields.
Definition: io.hpp:308
pcl_macros.h
Defines all the PCL and non-PCL macros used.
pcl
Definition: convolution.h:46
pcl::concatenatePointCloud
PCL_EXPORTS bool concatenatePointCloud(const pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2, pcl::PCLPointCloud2 &cloud_out)
Concatenate two pcl::PCLPointCloud2.
Eigen
Definition: bfgs.h:10
pcl::geometry::distance
float distance(const PointT &p1, const PointT &p2)
Definition: geometry.h:60
pcl::isSamePointType
bool isSamePointType()
Check if two given point types are the same or not.
Definition: io.h:339
pcl::io::swapByte< 4 >
void swapByte< 4 >(char *bytes)
specialization of swapByte for dimension 4
Definition: io.h:525
pcl::io::swapByte< 2 >
void swapByte< 2 >(char *bytes)
specialization of swapByte for dimension 2
Definition: io.h:519
pcl::BORDER_CONSTANT
@ BORDER_CONSTANT
Definition: io.h:224
pcl::PCLPointField::INT8
@ INT8
Definition: PCLPointField.h:20
pcl::getFields
void getFields(const pcl::PointCloud< PointT > &, std::vector< pcl::PCLPointField > &fields)
Definition: io.hpp:84
pcl::BORDER_DEFAULT
@ BORDER_DEFAULT
Definition: io.h:227
pcl::BORDER_REPLICATE
@ BORDER_REPLICATE
Definition: io.h:224
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: distances.h:55
pcl::PCLPointField::INT32
@ INT32
Definition: PCLPointField.h:24
pcl::BORDER_TRANSPARENT
@ BORDER_TRANSPARENT
Definition: io.h:226
pcl::PointXYZRGB
A point structure representing Euclidean xyz coordinates, and the RGB color.
Definition: point_types.hpp:628
pcl::copyPointCloud
void copyPointCloud(const pcl::PointCloud< PointInT > &cloud_in, pcl::PointCloud< PointOutT > &cloud_out)
Copy all the fields from a given point cloud into a new point cloud.
Definition: io.hpp:121
pcl::PCLPointField::FLOAT32
@ FLOAT32
Definition: PCLPointField.h:26
pcl::PCLPointCloud2::concatenate
static bool concatenate(pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2)
Inplace concatenate two pcl::PCLPointCloud2.
pcl::PCLPointField::UINT32
@ UINT32
Definition: PCLPointField.h:25
pcl::io::swapByte< 1 >
void swapByte< 1 >(char *bytes)
specialization of swapByte for dimension 1
Definition: io.h:512
pcl::BORDER_REFLECT_101
@ BORDER_REFLECT_101
Definition: io.h:226
pcl::PCLPointField::UINT8
@ UINT8
Definition: PCLPointField.h:21
PCL_DEPRECATED
#define PCL_DEPRECATED(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated items for the Major....
Definition: pcl_macros.h:156
pcl::PCLPointCloud2::fields
std::vector<::pcl::PCLPointField > fields
Definition: PCLPointCloud2.h:23
pcl::BORDER_WRAP
@ BORDER_WRAP
Definition: io.h:225
pcl::PCLPointField::INT16
@ INT16
Definition: PCLPointField.h:22
pcl::PCLPointField::UINT16
@ UINT16
Definition: PCLPointField.h:23
pcl::getFieldsSizes
PCL_EXPORTS void getFieldsSizes(const std::vector< pcl::PCLPointField > &fields, std::vector< int > &field_sizes)
Obtain a vector with the sizes of all valid fields (e.g., not "_")
pcl::PolygonMesh
Definition: PolygonMesh.h:14
pcl::getFieldSize
int getFieldSize(const int datatype)
Obtains the size of a specific field data type in bytes.
Definition: io.h:120
pcl::PCLPointField::FLOAT64
@ FLOAT64
Definition: PCLPointField.h:27
pcl::getEigenAsPointCloud
PCL_EXPORTS bool getEigenAsPointCloud(Eigen::MatrixXf &in, pcl::PCLPointCloud2 &out)
Copy the XYZ dimensions from an Eigen MatrixXf into a pcl::PCLPointCloud2 message.
pcl::InterpolationType
InterpolationType
Definition: io.h:222
pcl::Indices
IndicesAllocator<> Indices
Type used for indices in PCL.
Definition: types.h:131
pcl::PCLPointCloud2
Definition: PCLPointCloud2.h:16
pcl::PointCloud::concatenate
static bool concatenate(pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2)
Definition: point_cloud.h:230
pcl::concatenate
PCL_EXPORTS bool concatenate(const pcl::PointCloud< PointT > &cloud1, const pcl::PointCloud< PointT > &cloud2, pcl::PointCloud< PointT > &cloud_out)
Concatenate two pcl::PointCloud<PointT>
Definition: io.h:249
pcl::io::swapByte< 8 >
void swapByte< 8 >(char *bytes)
specialization of swapByte for dimension 8
Definition: io.h:535
pcl::BORDER_REFLECT
@ BORDER_REFLECT
Definition: io.h:225
pcl::IndicesAllocator
std::vector< index_t, Allocator > IndicesAllocator
Type used for indices in PCL.
Definition: types.h:126
pcl::interpolatePointIndex
PCL_EXPORTS int interpolatePointIndex(int p, int length, InterpolationType type)
pcl::getFieldIndex
int getFieldIndex(const pcl::PointCloud< PointT > &, const std::string &field_name, std::vector< pcl::PCLPointField > &fields)
Definition: io.hpp:53
pcl::getFieldsList
std::string getFieldsList(const pcl::PointCloud< PointT > &)
Get the list of all fields available in a given cloud.
Definition: io.hpp:108
pcl::PolygonMesh::concatenate
static bool concatenate(pcl::PolygonMesh &mesh1, const pcl::PolygonMesh &mesh2)
Inplace concatenate two pcl::PolygonMesh.
Definition: PolygonMesh.h:31
pcl::getFieldType
int getFieldType(const int size, char type)
Obtains the type of the PCLPointField from a specific size and type.
Definition: io.h:159
pcl::io::swapByte
void swapByte(char *bytes)
swap bytes order of a char array of length N
PCL_EXPORTS
#define PCL_EXPORTS
Definition: pcl_macros.h:323