Point Cloud Library (PCL)  1.14.1-dev
spring.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  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of the copyright holder(s) nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  * $Id$
37  *
38  */
39 
40 #pragma once
41 
42 #include <pcl/point_cloud.h>
43 
44 namespace pcl
45 {
46  namespace common
47  {
48  /** expand point cloud inserting \a amount rows at the
49  * top and the bottom of a point cloud and filling them with
50  * custom values.
51  * \param[in] input the input point cloud
52  * \param[out] output the output point cloud
53  * \param[in] val the point value to be inserted
54  * \param[in] amount the amount of rows to be added
55  */
56  template <typename PointT> void
57  expandRows (const PointCloud<PointT>& input, PointCloud<PointT>& output,
58  const PointT& val, const std::size_t& amount);
59 
60  /** expand point cloud inserting \a amount columns at
61  * the right and the left of a point cloud and filling them with
62  * custom values.
63  * \param[in] input the input point cloud
64  * \param[out] output the output point cloud
65  * \param[in] val the point value to be inserted
66  * \param[in] amount the amount of columns to be added
67  */
68  template <typename PointT> void
69  expandColumns (const PointCloud<PointT>& input, PointCloud<PointT>& output,
70  const PointT& val, const std::size_t& amount);
71 
72  /** expand point cloud duplicating the \a amount top and bottom rows times.
73  * \param[in] input the input point cloud
74  * \param[out] output the output point cloud
75  * \param[in] amount the amount of rows to be added
76  */
77  template <typename PointT> void
78  duplicateRows (const PointCloud<PointT>& input, PointCloud<PointT>& output,
79  const std::size_t& amount);
80 
81  /** expand point cloud duplicating the \a amount right and left columns
82  * times.
83  * \param[in] input the input point cloud
84  * \param[out] output the output point cloud
85  * \param[in] amount the amount of cilumns to be added
86  */
87  template <typename PointT> void
89  const std::size_t& amount);
90 
91  /** expand point cloud mirroring \a amount top and bottom rows.
92  * \param[in] input the input point cloud
93  * \param[out] output the output point cloud
94  * \param[in] amount the amount of rows to be added
95  */
96  template <typename PointT> void
97  mirrorRows (const PointCloud<PointT>& input, PointCloud<PointT>& output,
98  const std::size_t& amount);
99 
100  /** expand point cloud mirroring \a amount right and left columns.
101  * \param[in] input the input point cloud
102  * \param[out] output the output point cloud
103  * \param[in] amount the amount of rows to be added
104  */
105  template <typename PointT> void
106  mirrorColumns (const PointCloud<PointT>& input, PointCloud<PointT>& output,
107  const std::size_t& amount);
108 
109  /** delete \a amount rows in top and bottom of point cloud
110  * \param[in] input the input point cloud
111  * \param[out] output the output point cloud
112  * \param[in] amount the amount of rows to be added
113  */
114  template <typename PointT> void
115  deleteRows (const PointCloud<PointT>& input, PointCloud<PointT>& output,
116  const std::size_t& amount);
117 
118  /** delete \a amount columns in top and bottom of point cloud
119  * \param[in] input the input point cloud
120  * \param[out] output the output point cloud
121  * \param[in] amount the amount of rows to be added
122  */
123  template <typename PointT> void
124  deleteCols (const PointCloud<PointT>& input, PointCloud<PointT>& output,
125  const std::size_t& amount);
126  };
127 }
128 
129 #include <pcl/common/impl/spring.hpp>
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: point_cloud.h:173
void expandRows(const PointCloud< PointT > &input, PointCloud< PointT > &output, const PointT &val, const std::size_t &amount)
expand point cloud inserting amount rows at the top and the bottom of a point cloud and filling them ...
Definition: spring.hpp:84
void duplicateRows(const PointCloud< PointT > &input, PointCloud< PointT > &output, const std::size_t &amount)
expand point cloud duplicating the amount top and bottom rows times.
Definition: spring.hpp:138
void deleteRows(const PointCloud< PointT > &input, PointCloud< PointT > &output, const std::size_t &amount)
delete amount rows in top and bottom of point cloud
Definition: spring.hpp:222
void expandColumns(const PointCloud< PointT > &input, PointCloud< PointT > &output, const PointT &val, const std::size_t &amount)
expand point cloud inserting amount columns at the right and the left of a point cloud and filling th...
Definition: spring.hpp:52
void mirrorRows(const PointCloud< PointT > &input, PointCloud< PointT > &output, const std::size_t &amount)
expand point cloud mirroring amount top and bottom rows.
Definition: spring.hpp:195
void duplicateColumns(const PointCloud< PointT > &input, PointCloud< PointT > &output, const std::size_t &amount)
expand point cloud duplicating the amount right and left columns times.
Definition: spring.hpp:105
void mirrorColumns(const PointCloud< PointT > &input, PointCloud< PointT > &output, const std::size_t &amount)
expand point cloud mirroring amount right and left columns.
Definition: spring.hpp:163
void deleteCols(const PointCloud< PointT > &input, PointCloud< PointT > &output, const std::size_t &amount)
delete amount columns in top and bottom of point cloud
Definition: spring.hpp:239
A point structure representing Euclidean xyz coordinates, and the RGB color.