Point Cloud Library (PCL) 1.13.0
Loading...
Searching...
No Matches
NCVPyramid.hpp
1/*
2 * Software License Agreement (BSD License)
3 *
4 * Point Cloud Library (PCL) - www.pointclouds.org
5 * Copyright (C) 2009-2010, NVIDIA Corporation, all rights reserved.
6 * Third party copyrights are property of their respective owners.
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 Willow Garage, Inc. 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 * Ported to PCL by Koen Buys : Attention Work in progress!
39 */
40
41
42#ifndef _ncvpyramid_hpp_
43#define _ncvpyramid_hpp_
44
45#include <memory>
46#include <vector>
47#include "NCV.hpp"
48
49#if 0 //def _WIN32
50
51template <class T>
52class NCV_EXPORTS NCVMatrixStack
53{
54public:
55 NCVMatrixStack() {this->_arr.clear();}
56 ~NCVMatrixStack()
57 {
58 const Ncv32u nElem = this->_arr.size();
59 for (Ncv32u i=0; i<nElem; i++)
60 {
61 pop_back();
62 }
63 }
64 void push_back(NCVMatrix<T> *elem) {this->_arr.push_back(std::tr1::shared_ptr< NCVMatrix<T> >(elem));}
65 void pop_back() {this->_arr.pop_back();}
66 NCVMatrix<T> * operator [] (int i) const {return this->_arr[i].get();}
67private:
68 std::vector< std::tr1::shared_ptr< NCVMatrix<T> > > _arr;
69};
70
71
72template <class T>
73class NCV_EXPORTS NCVImagePyramid
74{
75public:
76
77 NCVImagePyramid(const NCVMatrix<T> &img,
78 Ncv8u nLayers,
79 INCVMemAllocator &alloc,
80 cudaStream_t cuStream);
81 ~NCVImagePyramid();
82 NcvBool isInitialized() const;
83 NCVStatus getLayer(NCVMatrix<T> &outImg,
84 NcvSize32u outRoi,
85 NcvBool bTrilinear,
86 cudaStream_t cuStream) const;
87
88private:
89
90 NcvBool _isInitialized;
91 const NCVMatrix<T> *layer0;
92 NCVMatrixStack<T> pyramid;
93 Ncv32u nLayers;
94};
95
96#endif //_WIN32
97
98#endif //_ncvpyramid_hpp_
INCVMemAllocator (Interface)
Definition NCV.hpp:403
NCVMatrix (2D)
Definition NCV.hpp:675