Zivid  1.0.1+3607.8a7510c4
Zivid API
PointCloud.h
Go to the documentation of this file.
1 /*[
2  * This file is part of the Zivid 3D Camera API
3  *
4  * Copyright 2015-2018 (C) Zivid Labs. All rights reserved.
5  * Contact info@zividlabs.com or see http://www.zividlabs.com
6  *
7  * This code is proprietary and confidential.
8  * Unauthorized copying of this file, via any medium is strictly prohibited.
9 ]*/
10 
11 #pragma once
12 
19 #include "APIExport.h"
20 #include "Point.h"
21 #include <memory>
22 
23 namespace Zivid
24 {
25  class PointCloudImpl;
26 
28  class PointCloud
29  {
30  public:
32  ZIVID_COMMON PointCloud();
33 
35  ZIVID_COMMON PointCloud(size_t rows, size_t cols);
36 
38  ZIVID_COMMON bool isEmpty() const;
39 
41  ZIVID_COMMON size_t width() const;
42 
44  ZIVID_COMMON size_t height() const;
45 
47  ZIVID_COMMON size_t size() const;
48 
53  ZIVID_COMMON Point& operator()(size_t idx);
54 
59  ZIVID_COMMON const Point& operator()(size_t idx) const;
60 
66  ZIVID_COMMON Point& operator()(size_t i, size_t j);
67 
73  ZIVID_COMMON const Point& operator()(size_t i, size_t j) const;
74 
76  ZIVID_COMMON void resize(size_t rows, size_t cols);
77 
79  ZIVID_COMMON Point* dataPtr();
80 
82  ZIVID_COMMON const Point* dataPtr() const;
83 
85  ZIVID_COMMON PointCloud clone();
86 
87  private:
88  explicit PointCloud(const PointCloudImpl &other);
89 
90  private:
91  std::shared_ptr<PointCloudImpl> m_impl;
92  };
93 }
ZIVID_COMMON size_t width() const
Return width (number of columns) of point cloud.
A 3D point with contrast and RGBA values
ZIVID_COMMON Point * dataPtr()
Obtain a pointer to the first point in the point cloud.
ZIVID_COMMON size_t height() const
Return height (number of rows) of point cloud.
A point cloud with x,y,z, contrast and color data laid out on a 2D grid.
Definition: PointCloud.h:28
Definition: Application.h:19
ZIVID_COMMON PointCloud clone()
Make a deep copy of the point cloud.
Definitions for export of DLL interfaces
ZIVID_COMMON void resize(size_t rows, size_t cols)
Resize the point cloud to the given number of rows and columns.
ZIVID_COMMON PointCloud()
Construct an empty point cloud.
ZIVID_COMMON bool isEmpty() const
Return whether point cloud is empty.
A 3D point with contrast and RGBA values.
Definition: Point.h:30
ZIVID_COMMON size_t size() const
Return number of points in point cloud.
ZIVID_COMMON Point & operator()(size_t idx)
Obtain a reference to a point given by a 1D linear index.