File: indexing.hpp

package info (click to toggle)
python-pcl 0.3.0~rc1%2Bdfsg-14
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 31,828 kB
  • sloc: python: 3,094; cpp: 283; makefile: 181; sh: 24; ansic: 12
file content (21 lines) | stat: -rw-r--r-- 521 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
namespace {
    // Workaround for a Cython bug in operator[] with templated types and
    // references. Let's hope the compiler optimizes these functions away.
    template <typename T>
    T *getptr(pcl::PointCloud<T> *pc, size_t i)
    {
        return &(*pc)[i];
    }

    template <typename T>
    T *getptr_at(pcl::PointCloud<T> *pc, size_t i)
    {
        return &(pc->at(i));
    }

    template <typename T>
    T *getptr_at2(pcl::PointCloud<T> *pc, int i, int j)
    {
        return &(pc->at(i, j));
    }
}