summaryrefslogtreecommitdiff
path: root/pcl
diff options
context:
space:
mode:
authorJohn Stowers <john.stowers@gmail.com>2014-09-25 18:14:43 +0200
committerJohn Stowers <john.stowers@gmail.com>2014-09-25 18:14:43 +0200
commitc6a4fd63fd3b2bcd0f3fc75cbc43cba0ad01b7e9 (patch)
tree0282d7e79286f12cac32dde35be9795cdd717cac /pcl
parent23c62bdec9e36fad3a85f4ad4a036e3e45504e49 (diff)
parentc01188b6875635af2e195a1a51763d51628709cc (diff)
Merge pull request #47 from larsmans/pickle
pickle support for pcl.PointCloud
Diffstat (limited to 'pcl')
-rw-r--r--pcl/_pcl.pyx6
1 files changed, 6 insertions, 0 deletions
diff --git a/pcl/_pcl.pyx b/pcl/_pcl.pyx
index f7cfb92..3502e38 100644
--- a/pcl/_pcl.pyx
+++ b/pcl/_pcl.pyx
@@ -165,6 +165,12 @@ cdef class PointCloud:
def __repr__(self):
return "<PointCloud of %d points>" % self.size
+ # Pickle support. XXX this copies the entire pointcloud; it would be nice
+ # to have an asarray member that returns a view, or even better, implement
+ # the buffer protocol (https://docs.python.org/c-api/buffer.html).
+ def __reduce__(self):
+ return type(self), (self.to_array(),)
+
@cython.boundscheck(False)
def from_array(self, cnp.ndarray[cnp.float32_t, ndim=2] arr not None):
"""