40 #ifndef PCL_IO_PCD_IO_IMPL_H_
41 #define PCL_IO_PCD_IO_IMPL_H_
43 #include <boost/algorithm/string/trim.hpp>
48 #include <pcl/common/io.h>
49 #include <pcl/console/print.h>
50 #include <pcl/io/low_level_io.h>
51 #include <pcl/io/pcd_io.h>
53 #include <pcl/io/lzf.h>
56 template <
typename Po
intT> std::string
59 std::ostringstream oss;
60 oss.imbue (std::locale::classic ());
62 oss <<
"# .PCD v0.7 - Point Cloud Data file format"
66 const auto fields = pcl::getFields<PointT> ();
68 std::stringstream field_names, field_types, field_sizes, field_counts;
69 for (
const auto &field : fields)
71 if (field.name ==
"_")
74 field_names <<
" " << field.name;
76 if (
"rgb" == field.name)
77 field_types <<
" " <<
"U";
80 int count = std::abs (
static_cast<int> (field.count));
81 if (count == 0) count = 1;
82 field_counts <<
" " << count;
84 oss << field_names.str ();
85 oss <<
"\nSIZE" << field_sizes.str ()
86 <<
"\nTYPE" << field_types.str ()
87 <<
"\nCOUNT" << field_counts.str ();
89 if (nr_points != std::numeric_limits<int>::max ())
90 oss <<
"\nWIDTH " << nr_points <<
"\nHEIGHT " << 1 <<
"\n";
92 oss <<
"\nWIDTH " << cloud.
width <<
"\nHEIGHT " << cloud.
height <<
"\n";
101 if (nr_points != std::numeric_limits<int>::max ())
102 oss <<
"POINTS " << nr_points <<
"\n";
104 oss <<
"POINTS " << cloud.
size () <<
"\n";
110 template <
typename Po
intT>
int
116 PCL_WARN (
"[pcl::PCDWriter::writeBinary] Input point cloud has no data!\n");
118 std::ostringstream oss;
119 oss << generateHeader<PointT> (cloud) <<
"DATA binary\n";
121 const auto data_idx =
static_cast<unsigned int> (oss.tellp ());
124 HANDLE h_native_file = CreateFileA (file_name.c_str (), GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
125 if (h_native_file == INVALID_HANDLE_VALUE)
127 throw pcl::IOException (
"[pcl::PCDWriter::writeBinary] Error during CreateFile!");
130 int fd =
io::raw_open (file_name.c_str (), O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
133 throw pcl::IOException (
"[pcl::PCDWriter::writeBinary] Error during open!");
137 boost::interprocess::file_lock file_lock;
138 setLockingPermissions (file_name, file_lock);
140 auto fields = pcl::getFields<PointT> ();
141 std::vector<int> fields_sizes;
142 std::size_t fsize = 0;
143 std::size_t data_size = 0;
146 for (
const auto &field : fields)
148 if (field.name ==
"_")
153 fields_sizes.push_back (fs);
154 fields[nri++] = field;
158 data_size = cloud.
size () * fsize;
162 HANDLE fm = CreateFileMappingA (h_native_file, NULL, PAGE_READWRITE, (DWORD) ((data_idx + data_size) >> 32), (DWORD) (data_idx + data_size), NULL);
165 throw pcl::IOException(
"[pcl::PCDWriter::writeBinary] Error during memory map creation ()!");
167 char *map =
static_cast<char*
>(MapViewOfFile (fm, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, data_idx + data_size));
171 throw pcl::IOException(
"[pcl::PCDWriter::writeBinary] Error mapping view of file!");
178 if (allocate_res != 0)
181 resetLockingPermissions (file_name, file_lock);
182 PCL_ERROR (
"[pcl::PCDWriter::writeBinary] raw_fallocate(length=%zu) returned %i. errno: %d strerror: %s\n",
183 data_idx + data_size, allocate_res, errno, strerror (errno));
185 throw pcl::IOException (
"[pcl::PCDWriter::writeBinary] Error during raw_fallocate ()!");
188 char *map =
static_cast<char*
> (::mmap (
nullptr, data_idx + data_size, PROT_WRITE, MAP_SHARED, fd, 0));
189 if (map ==
reinterpret_cast<char*
> (-1))
192 resetLockingPermissions (file_name, file_lock);
193 throw pcl::IOException (
"[pcl::PCDWriter::writeBinary] Error during mmap ()!");
198 memcpy (&map[0], oss.str ().c_str (), data_idx);
201 char *out = &map[0] + data_idx;
202 for (
const auto& point: cloud)
205 for (
const auto &field : fields)
207 memcpy (out,
reinterpret_cast<const char*
> (&point) + field.offset, fields_sizes[nrj]);
208 out += fields_sizes[nrj++];
214 if (map_synchronization_)
215 msync (map, data_idx + data_size, MS_SYNC);
220 UnmapViewOfFile (map);
222 if (::munmap (map, (data_idx + data_size)) == -1)
225 resetLockingPermissions (file_name, file_lock);
226 throw pcl::IOException (
"[pcl::PCDWriter::writeBinary] Error during munmap ()!");
231 CloseHandle (h_native_file);
235 resetLockingPermissions (file_name, file_lock);
240 template <
typename Po
intT>
int
246 PCL_WARN (
"[pcl::PCDWriter::writeBinaryCompressed] Input point cloud has no data!\n");
248 std::ostringstream oss;
249 oss << generateHeader<PointT> (cloud) <<
"DATA binary_compressed\n";
251 const auto data_idx =
static_cast<unsigned int> (oss.tellp ());
254 HANDLE h_native_file = CreateFileA (file_name.c_str (), GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
255 if (h_native_file == INVALID_HANDLE_VALUE)
257 throw pcl::IOException (
"[pcl::PCDWriter::writeBinaryCompressed] Error during CreateFile!");
260 int fd =
io::raw_open (file_name.c_str (), O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
263 throw pcl::IOException (
"[pcl::PCDWriter::writeBinaryCompressed] Error during open!");
268 boost::interprocess::file_lock file_lock;
269 setLockingPermissions (file_name, file_lock);
271 auto fields = pcl::getFields<PointT> ();
272 std::size_t fsize = 0;
273 std::size_t data_size = 0;
275 std::vector<int> fields_sizes (fields.size ());
277 for (
const auto &field : fields)
279 if (field.name ==
"_")
283 fsize += fields_sizes[nri];
287 fields_sizes.resize (nri);
291 data_size = cloud.
size () * fsize;
295 if (data_size * 3 / 2 > std::numeric_limits<std::uint32_t>::max ())
297 PCL_ERROR (
"[pcl::PCDWriter::writeBinaryCompressed] The input data exceeds the maximum size for compressed version 0.7 pcds of %l bytes.\n",
298 static_cast<std::size_t
> (std::numeric_limits<std::uint32_t>::max ()) * 2 / 3);
307 char *only_valid_data =
static_cast<char*
> (malloc (data_size));
317 std::vector<char*> pters (fields.size ());
318 std::size_t toff = 0;
319 for (std::size_t i = 0; i < pters.size (); ++i)
321 pters[i] = &only_valid_data[toff];
322 toff +=
static_cast<std::size_t
>(fields_sizes[i]) * cloud.
size();
326 for (
const auto& point: cloud)
328 for (std::size_t j = 0; j < fields.size (); ++j)
330 memcpy (pters[j],
reinterpret_cast<const char*
> (&point) + fields[j].offset, fields_sizes[j]);
332 pters[j] += fields_sizes[j];
336 char* temp_buf =
static_cast<char*
> (malloc (
static_cast<std::size_t
> (
static_cast<float> (data_size) * 1.5f + 8.0f)));
337 unsigned int compressed_final_size = 0;
338 if (data_size != 0) {
341 static_cast<std::uint32_t
> (data_size),
343 static_cast<std::uint32_t
> (
static_cast<float>(data_size) * 1.5f));
345 if (compressed_size > 0)
347 char *header = &temp_buf[0];
348 memcpy (&header[0], &compressed_size,
sizeof (
unsigned int));
349 memcpy (&header[4], &data_size,
sizeof (
unsigned int));
350 data_size = compressed_size + 8;
351 compressed_final_size =
static_cast<std::uint32_t
> (data_size) + data_idx;
358 resetLockingPermissions (file_name, file_lock);
359 PCL_WARN(
"[pcl::PCDWriter::writeBinaryCompressed] Error during compression!\n");
366 compressed_final_size = 8 + data_idx;
367 auto *header =
reinterpret_cast<std::uint32_t*
>(&temp_buf[0]);
375 HANDLE fm = CreateFileMapping (h_native_file, NULL, PAGE_READWRITE, 0, compressed_final_size, NULL);
376 char *map =
static_cast<char*
>(MapViewOfFile (fm, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, compressed_final_size));
382 if (allocate_res != 0)
385 resetLockingPermissions (file_name, file_lock);
386 PCL_ERROR (
"[pcl::PCDWriter::writeBinaryCompressed] raw_fallocate(length=%u) returned %i. errno: %d strerror: %s\n",
387 compressed_final_size, allocate_res, errno, strerror (errno));
389 throw pcl::IOException (
"[pcl::PCDWriter::writeBinaryCompressed] Error during raw_fallocate ()!");
392 char *map =
static_cast<char*
> (::mmap (
nullptr, compressed_final_size, PROT_WRITE, MAP_SHARED, fd, 0));
393 if (map ==
reinterpret_cast<char*
> (-1))
396 resetLockingPermissions (file_name, file_lock);
397 throw pcl::IOException (
"[pcl::PCDWriter::writeBinaryCompressed] Error during mmap ()!");
402 memcpy (&map[0], oss.str ().c_str (), data_idx);
404 memcpy (&map[data_idx], temp_buf, data_size);
408 if (map_synchronization_)
409 msync (map, compressed_final_size, MS_SYNC);
414 UnmapViewOfFile (map);
416 if (::munmap (map, (compressed_final_size)) == -1)
419 resetLockingPermissions (file_name, file_lock);
420 throw pcl::IOException (
"[pcl::PCDWriter::writeBinaryCompressed] Error during munmap ()!");
426 CloseHandle (h_native_file);
430 resetLockingPermissions (file_name, file_lock);
432 free (only_valid_data);
438 template <
typename Po
intT>
int
444 PCL_WARN (
"[pcl::PCDWriter::writeASCII] Input point cloud has no data!\n");
449 throw pcl::IOException (
"[pcl::PCDWriter::writeASCII] Number of points different than width * height!");
453 fs.open (file_name.c_str (), std::ios::binary);
455 if (!fs.is_open () || fs.fail ())
457 throw pcl::IOException (
"[pcl::PCDWriter::writeASCII] Could not open file for writing!");
461 boost::interprocess::file_lock file_lock;
462 setLockingPermissions (file_name, file_lock);
464 fs.precision (precision);
465 fs.imbue (std::locale::classic ());
467 const auto fields = pcl::getFields<PointT> ();
470 fs << generateHeader<PointT> (cloud) <<
"DATA ascii\n";
472 std::ostringstream stream;
473 stream.precision (precision);
474 stream.imbue (std::locale::classic ());
476 for (
const auto& point: cloud)
478 for (std::size_t d = 0; d < fields.size (); ++d)
481 if (fields[d].name ==
"_")
484 int count = fields[d].count;
488 for (
int c = 0; c < count; ++c)
490 switch (fields[d].datatype)
495 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (
bool),
sizeof (
bool));
496 stream << boost::numeric_cast<std::int32_t>(value);
502 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (std::int8_t),
sizeof (std::int8_t));
503 stream << boost::numeric_cast<std::int32_t>(value);
509 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (std::uint8_t),
sizeof (std::uint8_t));
510 stream << boost::numeric_cast<std::uint32_t>(value);
516 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (std::int16_t),
sizeof (std::int16_t));
517 stream << boost::numeric_cast<std::int16_t>(value);
523 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (std::uint16_t),
sizeof (std::uint16_t));
524 stream << boost::numeric_cast<std::uint16_t>(value);
530 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (std::int32_t),
sizeof (std::int32_t));
531 stream << boost::numeric_cast<std::int32_t>(value);
537 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (std::uint32_t),
sizeof (std::uint32_t));
538 stream << boost::numeric_cast<std::uint32_t>(value);
544 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (std::int64_t),
sizeof (std::int64_t));
545 stream << boost::numeric_cast<std::int64_t>(value);
551 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (std::uint64_t),
sizeof (std::uint64_t));
552 stream << boost::numeric_cast<std::uint64_t>(value);
562 if (
"rgb" == fields[d].name)
565 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (
float),
sizeof (
float));
566 stream << boost::numeric_cast<std::uint32_t>(value);
570 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (
float),
sizeof (
float));
571 if (std::isnan (value))
574 stream << boost::numeric_cast<float>(value);
580 memcpy (&value,
reinterpret_cast<const char*
> (&point) + fields[d].offset + c *
sizeof (
double),
sizeof (
double));
581 if (std::isnan (value))
584 stream << boost::numeric_cast<double>(value);
588 PCL_WARN (
"[pcl::PCDWriter::writeASCII] Incorrect field data type specified (%d)!\n", fields[d].datatype);
592 if (d < fields.size () - 1 || c <
static_cast<int> (fields[d].count - 1))
597 std::string result = stream.str ();
598 boost::trim (result);
600 fs << result <<
"\n";
603 resetLockingPermissions (file_name, file_lock);
609 template <
typename Po
intT>
int
614 if (cloud.
empty () || indices.empty ())
616 PCL_WARN (
"[pcl::PCDWriter::writeBinary] Input point cloud has no data or empty indices given!\n");
618 std::ostringstream oss;
619 oss << generateHeader<PointT> (cloud,
static_cast<int> (indices.size ())) <<
"DATA binary\n";
621 const auto data_idx =
static_cast<unsigned int> (oss.tellp ());
624 HANDLE h_native_file = CreateFileA (file_name.c_str (), GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
625 if (h_native_file == INVALID_HANDLE_VALUE)
627 throw pcl::IOException (
"[pcl::PCDWriter::writeBinary] Error during CreateFile!");
630 int fd =
io::raw_open (file_name.c_str (), O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
633 throw pcl::IOException (
"[pcl::PCDWriter::writeBinary] Error during open!");
637 boost::interprocess::file_lock file_lock;
638 setLockingPermissions (file_name, file_lock);
640 auto fields = pcl::getFields<PointT> ();
641 std::vector<int> fields_sizes;
642 std::size_t fsize = 0;
643 std::size_t data_size = 0;
646 for (
const auto &field : fields)
648 if (field.name ==
"_")
653 fields_sizes.push_back (fs);
654 fields[nri++] = field;
658 data_size = indices.size () * fsize;
662 HANDLE fm = CreateFileMapping (h_native_file, NULL, PAGE_READWRITE, (DWORD) ((data_idx + data_size) >> 32), (DWORD) (data_idx + data_size), NULL);
663 char *map =
static_cast<char*
>(MapViewOfFile (fm, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, data_idx + data_size));
669 if (allocate_res != 0)
672 resetLockingPermissions (file_name, file_lock);
673 PCL_ERROR (
"[pcl::PCDWriter::writeBinary] raw_fallocate(length=%zu) returned %i. errno: %d strerror: %s\n",
674 data_idx + data_size, allocate_res, errno, strerror (errno));
676 throw pcl::IOException (
"[pcl::PCDWriter::writeBinary] Error during raw_fallocate ()!");
679 char *map =
static_cast<char*
> (::mmap (
nullptr, data_idx + data_size, PROT_WRITE, MAP_SHARED, fd, 0));
680 if (map ==
reinterpret_cast<char*
> (-1))
683 resetLockingPermissions (file_name, file_lock);
684 throw pcl::IOException (
"[pcl::PCDWriter::writeBinary] Error during mmap ()!");
689 memcpy (&map[0], oss.str ().c_str (), data_idx);
691 char *out = &map[0] + data_idx;
693 for (
const auto &index : indices)
696 for (
const auto &field : fields)
698 memcpy (out,
reinterpret_cast<const char*
> (&cloud[index]) + field.offset, fields_sizes[nrj]);
699 out += fields_sizes[nrj++];
705 if (map_synchronization_)
706 msync (map, data_idx + data_size, MS_SYNC);
711 UnmapViewOfFile (map);
713 if (::munmap (map, (data_idx + data_size)) == -1)
716 resetLockingPermissions (file_name, file_lock);
717 throw pcl::IOException (
"[pcl::PCDWriter::writeBinary] Error during munmap ()!");
722 CloseHandle(h_native_file);
727 resetLockingPermissions (file_name, file_lock);
732 template <
typename Po
intT>
int
738 if (cloud.
empty () || indices.empty ())
740 PCL_WARN (
"[pcl::PCDWriter::writeASCII] Input point cloud has no data or empty indices given!\n");
745 throw pcl::IOException (
"[pcl::PCDWriter::writeASCII] Number of points different than width * height!");
749 fs.open (file_name.c_str (), std::ios::binary);
750 if (!fs.is_open () || fs.fail ())
752 throw pcl::IOException (
"[pcl::PCDWriter::writeASCII] Could not open file for writing!");
756 boost::interprocess::file_lock file_lock;
757 setLockingPermissions (file_name, file_lock);
759 fs.precision (precision);
760 fs.imbue (std::locale::classic ());
762 const auto fields = pcl::getFields<PointT> ();
765 fs << generateHeader<PointT> (cloud,
static_cast<int> (indices.size ())) <<
"DATA ascii\n";
767 std::ostringstream stream;
768 stream.precision (precision);
769 stream.imbue (std::locale::classic ());
772 for (
const auto &index : indices)
774 for (std::size_t d = 0; d < fields.size (); ++d)
777 if (fields[d].name ==
"_")
780 int count = fields[d].count;
784 for (
int c = 0; c < count; ++c)
786 switch (fields[d].datatype)
791 memcpy (&value,
reinterpret_cast<const char*
> (&cloud.
points[index]) + fields[d].offset + c * sizeof (
bool),
sizeof (
bool));
792 stream << boost::numeric_cast<std::int32_t>(value);
798 memcpy (&value,
reinterpret_cast<const char*
> (&cloud[index]) + fields[d].offset + c *
sizeof (std::int8_t),
sizeof (std::int8_t));
799 stream << boost::numeric_cast<std::int32_t>(value);
805 memcpy (&value,
reinterpret_cast<const char*
> (&cloud[index]) + fields[d].offset + c *
sizeof (std::uint8_t),
sizeof (std::uint8_t));
806 stream << boost::numeric_cast<std::uint32_t>(value);
812 memcpy (&value,
reinterpret_cast<const char*
> (&cloud[index]) + fields[d].offset + c *
sizeof (std::int16_t),
sizeof (std::int16_t));
813 stream << boost::numeric_cast<std::int16_t>(value);
819 memcpy (&value,
reinterpret_cast<const char*
> (&cloud[index]) + fields[d].offset + c *
sizeof (std::uint16_t),
sizeof (std::uint16_t));
820 stream << boost::numeric_cast<std::uint16_t>(value);
826 memcpy (&value,
reinterpret_cast<const char*
> (&cloud[index]) + fields[d].offset + c *
sizeof (std::int32_t),
sizeof (std::int32_t));
827 stream << boost::numeric_cast<std::int32_t>(value);
833 memcpy (&value,
reinterpret_cast<const char*
> (&cloud[index]) + fields[d].offset + c *
sizeof (std::uint32_t),
sizeof (std::uint32_t));
834 stream << boost::numeric_cast<std::uint32_t>(value);
840 memcpy (&value,
reinterpret_cast<const char*
> (&cloud.
points[index]) + fields[d].offset + c * sizeof (std::int64_t),
sizeof (std::int64_t));
841 stream << boost::numeric_cast<std::int64_t>(value);
847 memcpy (&value,
reinterpret_cast<const char*
> (&cloud.
points[index]) + fields[d].offset + c * sizeof (std::uint64_t),
sizeof (std::uint64_t));
848 stream << boost::numeric_cast<std::uint64_t>(value);
858 if (
"rgb" == fields[d].name)
861 memcpy (&value,
reinterpret_cast<const char*
> (&cloud[index]) + fields[d].offset + c *
sizeof (
float),
sizeof (
float));
862 stream << boost::numeric_cast<std::uint32_t>(value);
867 memcpy (&value,
reinterpret_cast<const char*
> (&cloud[index]) + fields[d].offset + c *
sizeof (
float),
sizeof (
float));
868 if (std::isnan (value))
871 stream << boost::numeric_cast<float>(value);
878 memcpy (&value,
reinterpret_cast<const char*
> (&cloud[index]) + fields[d].offset + c *
sizeof (
double),
sizeof (
double));
879 if (std::isnan (value))
882 stream << boost::numeric_cast<double>(value);
886 PCL_WARN (
"[pcl::PCDWriter::writeASCII] Incorrect field data type specified (%d)!\n", fields[d].datatype);
890 if (d < fields.size () - 1 || c <
static_cast<int> (fields[d].count - 1))
895 std::string result = stream.str ();
896 boost::trim (result);
898 fs << result <<
"\n";
902 resetLockingPermissions (file_name, file_lock);
An exception that is thrown during an IO error (typical read/write errors)
int writeBinary(const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin=Eigen::Vector4f::Zero(), const Eigen::Quaternionf &orientation=Eigen::Quaternionf::Identity())
Save point cloud data to a PCD file containing n-D points, in BINARY format.
int writeASCII(const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin=Eigen::Vector4f::Zero(), const Eigen::Quaternionf &orientation=Eigen::Quaternionf::Identity(), const int precision=8)
Save point cloud data to a PCD file containing n-D points, in ASCII format.
static std::string generateHeader(const pcl::PointCloud< PointT > &cloud, const int nr_points=std::numeric_limits< int >::max())
Generate the header of a PCD file format.
int writeBinaryCompressed(const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin=Eigen::Vector4f::Zero(), const Eigen::Quaternionf &orientation=Eigen::Quaternionf::Identity())
Save point cloud data to a PCD file containing n-D points, in BINARY_COMPRESSED format.
PointCloud represents the base class in PCL for storing collections of 3D points.
Eigen::Quaternionf sensor_orientation_
Sensor acquisition pose (rotation).
std::uint32_t width
The point cloud width (if organized as an image-structure).
std::uint32_t height
The point cloud height (if organized as an image-structure).
Eigen::Vector4f sensor_origin_
Sensor acquisition pose (origin/translation).
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
int getFieldSize(const int datatype)
Obtains the size of a specific field data type in bytes.
int getFieldType(const int size, char type)
Obtains the type of the PCLPointField from a specific size and type.
int raw_fallocate(int fd, long length)
int raw_open(const char *pathname, int flags, int mode)
PCL_EXPORTS unsigned int lzfCompress(const void *const in_data, unsigned int in_len, void *out_data, unsigned int out_len)
Compress in_len bytes stored at the memory block starting at in_data and write the result to out_data...
IndicesAllocator<> Indices
Type used for indices in PCL.