Skip to content

Commit afafe4f

Browse files
committed
Make pyramid filters inherit from PCLBase.
1 parent 1441409 commit afafe4f

File tree

2 files changed

+27
-25
lines changed

2 files changed

+27
-25
lines changed

filters/include/pcl/filters/pyramid.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@
4242
#include <pcl/memory.h>
4343
#include <pcl/pcl_macros.h>
4444
#include <pcl/point_cloud.h>
45+
#include <pcl/pcl_base.h>
4546
#include <pcl/pcl_config.h>
4647

48+
4749
namespace pcl
4850
{
4951
namespace filters
@@ -59,9 +61,9 @@ namespace pcl
5961
* \author Nizar Sallem
6062
*/
6163
template <typename PointT>
62-
class Pyramid
64+
class Pyramid : public PCLBase<PointT>
6365
{
64-
public:
66+
public:
6567
using PointCloudPtr = typename PointCloud<PointT>::Ptr;
6668
using PointCloudConstPtr = typename PointCloud<PointT>::ConstPtr;
6769
using Ptr = shared_ptr< Pyramid<PointT> >;

filters/src/pyramid.cpp

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ Pyramid<pcl::PointXYZRGB>::compute(
6060
int kernel_center_y = kernel_rows / 2;
6161

6262
output.resize(levels_ + 1);
63-
output[0].reset(new pcl::PointCloud<pcl::PointXYZRGB>);
63+
output[0].reset(new PointCloud);
6464
*(output[0]) = *input_;
6565

6666
if (input_->is_dense) {
6767
for (int l = 1; l <= levels_; ++l) {
68-
output[l].reset(new pcl::PointCloud<pcl::PointXYZRGB>(output[l - 1]->width / 2,
69-
output[l - 1]->height / 2));
70-
const PointCloud<pcl::PointXYZRGB>& previous = *output[l - 1];
71-
PointCloud<pcl::PointXYZRGB>& next = *output[l];
68+
output[l].reset(new PointCloud(output[l - 1]->width / 2,
69+
output[l - 1]->height / 2));
70+
const PointCloud& previous = *output[l - 1];
71+
PointCloud& next = *output[l];
7272
#pragma omp parallel for default(none) \
7373
shared(next, previous, kernel_rows, kernel_cols, kernel_center_x, kernel_center_y) \
7474
num_threads(num_threads_)
@@ -111,10 +111,10 @@ Pyramid<pcl::PointXYZRGB>::compute(
111111
}
112112
else {
113113
for (int l = 1; l <= levels_; ++l) {
114-
output[l].reset(new pcl::PointCloud<pcl::PointXYZRGB>(output[l - 1]->width / 2,
115-
output[l - 1]->height / 2));
116-
const PointCloud<pcl::PointXYZRGB>& previous = *output[l - 1];
117-
PointCloud<pcl::PointXYZRGB>& next = *output[l];
114+
output[l].reset(new PointCloud(output[l - 1]->width / 2,
115+
output[l - 1]->height / 2));
116+
const PointCloud& previous = *output[l - 1];
117+
PointCloud& next = *output[l];
118118
#pragma omp parallel for default(none) \
119119
shared(next, previous, kernel_rows, kernel_cols, kernel_center_x, kernel_center_y) \
120120
num_threads(num_threads_)
@@ -187,15 +187,15 @@ Pyramid<pcl::PointXYZRGBA>::compute(
187187
int kernel_center_y = kernel_rows / 2;
188188

189189
output.resize(levels_ + 1);
190-
output[0].reset(new pcl::PointCloud<pcl::PointXYZRGBA>);
190+
output[0].reset(new PointCloud);
191191
*(output[0]) = *input_;
192192

193193
if (input_->is_dense) {
194194
for (int l = 1; l <= levels_; ++l) {
195-
output[l].reset(new pcl::PointCloud<pcl::PointXYZRGBA>(
195+
output[l].reset(new PointCloud(
196196
output[l - 1]->width / 2, output[l - 1]->height / 2));
197-
const PointCloud<pcl::PointXYZRGBA>& previous = *output[l - 1];
198-
PointCloud<pcl::PointXYZRGBA>& next = *output[l];
197+
const PointCloud& previous = *output[l - 1];
198+
PointCloud& next = *output[l];
199199
#pragma omp parallel for default(none) \
200200
shared(next, previous, kernel_rows, kernel_cols, kernel_center_x, kernel_center_y) \
201201
num_threads(num_threads_)
@@ -240,10 +240,10 @@ Pyramid<pcl::PointXYZRGBA>::compute(
240240
}
241241
else {
242242
for (int l = 1; l <= levels_; ++l) {
243-
output[l].reset(new pcl::PointCloud<pcl::PointXYZRGBA>(
243+
output[l].reset(new PointCloud(
244244
output[l - 1]->width / 2, output[l - 1]->height / 2));
245-
const PointCloud<pcl::PointXYZRGBA>& previous = *output[l - 1];
246-
PointCloud<pcl::PointXYZRGBA>& next = *output[l];
245+
const PointCloud& previous = *output[l - 1];
246+
PointCloud& next = *output[l];
247247
#pragma omp parallel for default(none) \
248248
shared(next, previous, kernel_rows, kernel_cols, kernel_center_x, kernel_center_y) \
249249
num_threads(num_threads_)
@@ -325,15 +325,15 @@ Pyramid<pcl::RGB>::compute(std::vector<Pyramid<pcl::RGB>::PointCloudPtr>& output
325325
int kernel_center_y = kernel_rows / 2;
326326

327327
output.resize(levels_ + 1);
328-
output[0].reset(new pcl::PointCloud<pcl::RGB>);
328+
output[0].reset(new PointCloud);
329329
*(output[0]) = *input_;
330330

331331
if (input_->is_dense) {
332332
for (int l = 1; l <= levels_; ++l) {
333-
output[l].reset(new pcl::PointCloud<pcl::RGB>(output[l - 1]->width / 2,
333+
output[l].reset(new PointCloud(output[l - 1]->width / 2,
334334
output[l - 1]->height / 2));
335-
const PointCloud<pcl::RGB>& previous = *output[l - 1];
336-
PointCloud<pcl::RGB>& next = *output[l];
335+
const PointCloud& previous = *output[l - 1];
336+
PointCloud& next = *output[l];
337337
#pragma omp parallel for default(none) \
338338
shared(next, previous, kernel_rows, kernel_cols, kernel_center_x, kernel_center_y) \
339339
num_threads(num_threads_)
@@ -368,10 +368,10 @@ Pyramid<pcl::RGB>::compute(std::vector<Pyramid<pcl::RGB>::PointCloudPtr>& output
368368
}
369369
else {
370370
for (int l = 1; l <= levels_; ++l) {
371-
output[l].reset(new pcl::PointCloud<pcl::RGB>(output[l - 1]->width / 2,
371+
output[l].reset(new PointCloud(output[l - 1]->width / 2,
372372
output[l - 1]->height / 2));
373-
const PointCloud<pcl::RGB>& previous = *output[l - 1];
374-
PointCloud<pcl::RGB>& next = *output[l];
373+
const PointCloud& previous = *output[l - 1];
374+
PointCloud& next = *output[l];
375375
#pragma omp parallel for default(none) \
376376
shared(next, previous, kernel_rows, kernel_cols, kernel_center_x, kernel_center_y) \
377377
num_threads(num_threads_)

0 commit comments

Comments
 (0)