Zivid  1.0.1+3607.8a7510c4
Zivid API
DeviceCloud.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 
15 
16 #include "PointCloud.h"
17 #include "ComputeDevice.h"
18 #include "APIExport.h"
19 
20 #include <memory>
21 #include <utility>
22 #include <chrono>
23 
24 namespace Zivid
25 {
26  class DeviceCloudImpl;
27  class DeviceCloud;
28  class PointCloud;
29 
32  {
33  public:
35  ZIVID_COMMON_COMPUTE DeviceCloud();
36 
38  ZIVID_COMMON_COMPUTE explicit DeviceCloud(const PointCloud& cloud);
39 
41  ZIVID_COMMON_COMPUTE explicit DeviceCloud(const PointCloud& cloud, ComputeDevice device);
42 
44  ZIVID_COMMON_COMPUTE bool isEmpty() const;
45 
47  ZIVID_COMMON_COMPUTE DeviceCloud clone() const;
48 
50  ZIVID_COMMON_COMPUTE PointCloud copyToCPU();
51 
57  ZIVID_COMMON_COMPUTE void lock();
58 
60  ZIVID_COMMON_COMPUTE size_t rows() const;
61 
63  ZIVID_COMMON_COMPUTE size_t cols() const;
64 
66  ZIVID_COMMON_COMPUTE void unlock();
67 
69  ZIVID_COMMON_COMPUTE bool tryLock();
70 
72  ZIVID_COMMON_COMPUTE bool tryLockFor(const std::chrono::milliseconds &duration);
73 
74 #ifndef DOXYGEN_SHOULD_SKIP_THIS
75  ZIVID_COMMON_COMPUTE DeviceCloudImpl &getImpl();
76  ZIVID_COMMON_COMPUTE const DeviceCloudImpl &getImpl() const;
77  ZIVID_COMMON_COMPUTE explicit DeviceCloud(const DeviceCloudImpl &other);
78 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
79 
80  private:
81  std::shared_ptr<DeviceCloudImpl> m_impl;
82  };
83 }
Include file with data type definitions for an organized point cloud.
ZIVID_COMMON_COMPUTE size_t cols() const
Get number of columns in point cloud.
ZIVID_COMMON_COMPUTE size_t rows() const
Get number of rows in point cloud.
ZIVID_COMMON_COMPUTE bool tryLockFor(const std::chrono::milliseconds &duration)
Check if a lock can be obtained for the point cloud (with a specified timeout)
ZIVID_COMMON_COMPUTE void unlock()
Unlock the 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
Definitions for export of DLL interfaces
Point cloud on the Compute device.
Definition: DeviceCloud.h:31
ZIVID_COMMON_COMPUTE bool isEmpty() const
Check if the device cloud is empty.
ZIVID_COMMON_COMPUTE PointCloud copyToCPU()
Copy to the device cloud to a CPU point cloud.
ZIVID_COMMON_COMPUTE bool tryLock()
Check if a lock can be obtained for the point cloud.
A Compute device on which to allocate a device point cloud
A Compute device on which to allocate a device point cloud.
Definition: ComputeDevice.h:28
ZIVID_COMMON_COMPUTE void lock()
Lock the point cloud.
ZIVID_COMMON_COMPUTE DeviceCloud()
Create an empty device cloud.
ZIVID_COMMON_COMPUTE DeviceCloud clone() const
Clone the device cloud.