ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PointCloudIO.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <FileIO.h>
11 
12 #include <memory>
13 #include <string>
14 
15 class ccPointCloud;
16 namespace cloudViewer {
17 namespace io {
18 
21 std::shared_ptr<ccPointCloud> CreatePointCloudFromFile(
22  const std::string &filename,
23  const std::string &format = "auto",
24  bool print_progress = false);
25 
28 std::shared_ptr<ccPointCloud> CreatePointCloudFromMemory(
29  const unsigned char *buffer,
30  const size_t length,
31  const std::string &format,
32  bool print_progress = false);
33 
38 bool ReadPointCloud(const std::string &filename,
39  ccPointCloud &pointcloud,
40  const ReadPointCloudOption &params = {});
41 
46 bool ReadPointCloud(const unsigned char *buffer,
47  const size_t length,
48  ccPointCloud &pointcloud,
49  const ReadPointCloudOption &params = {});
50 
55 bool WritePointCloud(const std::string &filename,
56  const ccPointCloud &pointcloud,
57  const WritePointCloudOption &params = {});
58 
66 bool WritePointCloud(unsigned char *&buffer,
67  size_t &length,
68  const ccPointCloud &pointcloud,
69  const WritePointCloudOption &params = {});
70 
71 bool ReadPointCloudFromXYZ(const std::string &filename,
72  ccPointCloud &pointcloud,
73  const ReadPointCloudOption &params);
74 
75 bool ReadPointCloudInMemoryFromXYZ(const unsigned char *buffer,
76  const size_t length,
77  ccPointCloud &pointcloud,
78  const ReadPointCloudOption &params);
79 
80 bool WritePointCloudToXYZ(const std::string &filename,
81  const ccPointCloud &pointcloud,
82  const WritePointCloudOption &params);
83 
84 bool WritePointCloudInMemoryToXYZ(unsigned char *&buffer,
85  size_t &length,
86  const ccPointCloud &pointcloud,
87  const WritePointCloudOption &params);
88 
89 bool ReadPointCloudFromXYZN(const std::string &filename,
90  ccPointCloud &pointcloud,
91  const ReadPointCloudOption &params);
92 
93 bool WritePointCloudToXYZN(const std::string &filename,
94  const ccPointCloud &pointcloud,
95  const WritePointCloudOption &params);
96 
97 bool ReadPointCloudFromXYZRGB(const std::string &filename,
98  ccPointCloud &pointcloud,
99  const ReadPointCloudOption &params);
100 
101 bool WritePointCloudToXYZRGB(const std::string &filename,
102  const ccPointCloud &pointcloud,
103  const WritePointCloudOption &params);
104 
105 bool ReadPointCloudFromPLY(const std::string &filename,
106  ccPointCloud &pointcloud,
107  const ReadPointCloudOption &params);
108 
109 bool WritePointCloudToPLY(const std::string &filename,
110  const ccPointCloud &pointcloud,
111  const WritePointCloudOption &params);
112 
113 bool ReadPointCloudFromPCD(const std::string &filename,
114  ccPointCloud &pointcloud,
115  const ReadPointCloudOption &params);
116 
117 bool WritePointCloudToPCD(const std::string &filename,
118  const ccPointCloud &pointcloud,
119  const WritePointCloudOption &params);
120 
121 bool ReadPointCloudFromPTS(const std::string &filename,
122  ccPointCloud &pointcloud,
123  const ReadPointCloudOption &params);
124 
125 bool WritePointCloudToPTS(const std::string &filename,
126  const ccPointCloud &pointcloud,
127  const WritePointCloudOption &params);
128 
129 } // namespace io
130 } // namespace cloudViewer
std::string filename
filament::Texture::InternalFormat format
cmdLineReadable * params[]
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
__host__ __device__ float length(float2 v)
Definition: cutil_math.h:1162
bool ReadPointCloudFromPLY(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
bool ReadPointCloudFromXYZN(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
bool WritePointCloudToPCD(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool WritePointCloudToPTS(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool ReadPointCloudFromPCD(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
bool ReadPointCloudFromXYZ(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
bool ReadPointCloud(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
bool ReadPointCloudFromXYZRGB(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
bool WritePointCloud(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool WritePointCloudToXYZ(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool WritePointCloudToPLY(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool WritePointCloudToXYZN(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
std::shared_ptr< ccPointCloud > CreatePointCloudFromFile(const std::string &filename, const std::string &format, bool print_progress)
bool WritePointCloudToXYZRGB(const std::string &filename, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool WritePointCloudInMemoryToXYZ(unsigned char *&buffer, size_t &length, const ccPointCloud &pointcloud, const WritePointCloudOption &params)
bool ReadPointCloudFromPTS(const std::string &filename, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
std::shared_ptr< ccPointCloud > CreatePointCloudFromMemory(const unsigned char *buffer, const size_t length, const std::string &format, bool print_progress)
bool ReadPointCloudInMemoryFromXYZ(const unsigned char *buffer, const size_t length, ccPointCloud &pointcloud, const ReadPointCloudOption &params)
Generic file read and write utility for python interface.