Point Cloud Library (PCL)
1.9.1
|
41 #ifndef PCL_COMMON_IO_H_
42 #define PCL_COMMON_IO_H_
45 #include <pcl/pcl_base.h>
46 #include <pcl/PointIndices.h>
47 #include <pcl/conversions.h>
48 #include <pcl/exceptions.h>
62 for (
size_t d = 0; d < cloud.
fields.size (); ++d)
63 if (cloud.
fields[d].name == field_name)
64 return (
static_cast<int>(d));
74 template <
typename Po
intT>
inline int
76 std::vector<pcl::PCLPointField> &fields);
83 template <
typename Po
intT>
inline int
85 std::vector<pcl::PCLPointField> &fields);
92 template <
typename Po
intT>
inline void
99 template <
typename Po
intT>
inline void
100 getFields (std::vector<pcl::PCLPointField> &fields);
106 template <
typename Po
intT>
inline std::string
117 for (
size_t i = 0; i < cloud.
fields.size () - 1; ++i)
118 result += cloud.
fields[i].name +
" ";
159 std::vector<int> &field_sizes);
169 type = std::toupper (type, std::locale::classic ());
269 const std::vector<int> &indices,
281 const std::vector<
int, Eigen::aligned_allocator<int> > &indices,
294 template <
typename Po
int1T,
typename Po
int2T>
inline bool
297 return (
typeid (Point1T) ==
typeid (Point2T));
307 template <
typename Po
intT>
void
309 const std::vector<int> &indices,
319 template <
typename Po
intT>
void
321 const std::vector<
int, Eigen::aligned_allocator<int> > &indices,
331 template <
typename Po
intT>
void
333 const PointIndices &indices,
343 template <
typename Po
intT>
void
345 const std::vector<pcl::PointIndices> &indices,
353 template <
typename Po
intInT,
typename Po
intOutT>
void
364 template <
typename Po
intInT,
typename Po
intOutT>
void
366 const std::vector<int> &indices,
376 template <
typename Po
intInT,
typename Po
intOutT>
void
378 const std::vector<
int, Eigen::aligned_allocator<int> > &indices,
388 template <
typename Po
intInT,
typename Po
intOutT>
void
390 const PointIndices &indices,
400 template <
typename Po
intInT,
typename Po
intOutT>
void
402 const std::vector<pcl::PointIndices> &indices,
424 template <
typename Po
intT>
void
427 int top,
int bottom,
int left,
int right,
441 template <
typename Po
intIn1T,
typename Po
intIn2T,
typename Po
intOutT>
void
485 template <std::
size_t N>
void
491 template <>
inline void
498 template <>
inline void
504 template <>
inline void
507 std::swap (bytes[0], bytes[3]);
508 std::swap (bytes[1], bytes[2]);
514 template <>
inline void
517 std::swap (bytes[0], bytes[7]);
518 std::swap (bytes[1], bytes[6]);
519 std::swap (bytes[2], bytes[5]);
520 std::swap (bytes[3], bytes[4]);
526 template <
typename T>
void
529 pcl::io::swapByte<sizeof(T)> (
reinterpret_cast<char*
> (&value));
534 #include <pcl/common/impl/io.hpp>
536 #endif //#ifndef PCL_COMMON_IO_H_
PCL_EXPORTS bool getPointCloudAsEigen(const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out)
Copy the XYZ dimensions of a pcl::PCLPointCloud2 into Eigen format.
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.
This file defines compatibility wrappers for low level I/O functions.
PCL_EXPORTS bool concatenatePointCloud(const pcl::PCLPointCloud2 &cloud1, const pcl::PCLPointCloud2 &cloud2, pcl::PCLPointCloud2 &cloud_out)
Concatenate two pcl::PCLPointCloud2.
void getFields(const pcl::PointCloud< PointT > &cloud, std::vector< pcl::PCLPointField > &fields)
Get the list of available fields (i.e., dimension/channel)
bool isSamePointType()
Check if two given point types are the same or not.
void swapByte< 4 >(char *bytes)
specialization of swapByte for dimension 4
void swapByte< 2 >(char *bytes)
specialization of swapByte for dimension 2
PCL_EXPORTS void copyPointCloud(const pcl::PCLPointCloud2 &cloud_in, const std::vector< int > &indices, pcl::PCLPointCloud2 &cloud_out)
Extract the indices of a given point cloud as a new point cloud.
PointCloud represents the base class in PCL for storing collections of 3D points.
A point structure representing Euclidean xyz coordinates, and the RGB color.
std::vector< ::pcl::PCLPointField > fields
int getFieldIndex(const pcl::PCLPointCloud2 &cloud, const std::string &field_name)
Get the index of a specified field (i.e., dimension/channel)
void swapByte< 1 >(char *bytes)
specialization of swapByte for dimension 1
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 "_")
int getFieldSize(const int datatype)
Obtains the size of a specific field data type in bytes.
PCL_EXPORTS bool getEigenAsPointCloud(Eigen::MatrixXf &in, pcl::PCLPointCloud2 &out)
Copy the XYZ dimensions from an Eigen MatrixXf into a pcl::PCLPointCloud2 message.
void swapByte< 8 >(char *bytes)
specialization of swapByte for dimension 8
PCL_EXPORTS int interpolatePointIndex(int p, int length, InterpolationType type)
std::string getFieldsList(const pcl::PointCloud< PointT > &cloud)
Get the list of all fields available in a given cloud.
int getFieldType(const int size, char type)
Obtains the type of the PCLPointField from a specific size and type.
void swapByte(char *bytes)
swap bytes order of a char array of length N