Point Cloud Library (PCL)
1.7.0
Main Page
Modules
Namespaces
Classes
io
include
pcl
io
tar.h
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Point Cloud Library (PCL) - www.pointclouds.org
5
* Copyright (c) 2010-2012, Willow Garage, Inc.
6
*
7
* All rights reserved.
8
*
9
* Redistribution and use in source and binary forms, with or without
10
* modification, are permitted provided that the following conditions
11
* are met:
12
*
13
* * Redistributions of source code must retain the above copyright
14
* notice, this list of conditions and the following disclaimer.
15
* * Redistributions in binary form must reproduce the above
16
* copyright notice, this list of conditions and the following
17
* disclaimer in the documentation and/or other materials provided
18
* with the distribution.
19
* * Neither the name of the copyright holder(s) nor the names of its
20
* contributors may be used to endorse or promote products derived
21
* from this software without specific prior written permission.
22
*
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34
* POSSIBILITY OF SUCH DAMAGE.
35
*
36
*/
37
38
#ifndef PCL_IO_TAR_H_
39
#define PCL_IO_TAR_H_
40
41
#include <pcl/point_cloud.h>
42
43
namespace
pcl
44
{
45
namespace
io
46
{
47
/** \brief A TAR file's header, as described on
48
* http://en.wikipedia.org/wiki/Tar_%28file_format%29.
49
*/
50
struct
TARHeader
51
{
52
char
file_name
[100];
53
char
file_mode
[8];
54
char
uid
[8];
55
char
gid
[8];
56
char
file_size
[12];
57
char
mtime
[12];
58
char
chksum
[8];
59
char
file_type
[1];
60
char
link_file_name
[100];
61
char
ustar
[6];
62
char
ustar_version
[2];
63
char
uname
[32];
64
char
gname
[32];
65
char
dev_major
[8];
66
char
dev_minor
[8];
67
char
file_name_prefix
[155];
68
char
_padding
[12];
69
70
/** \brief . */
71
unsigned
int
72
getFileSize
()
73
{
74
unsigned
int
output = 0;
75
char
*str =
file_size
;
76
for
(
int
i = 0; i < 11; i++)
77
{
78
output = output * 8 + *str -
'0'
;
79
str++;
80
}
81
return
(output);
82
}
83
};
84
85
/** \brief Save a PointCloud dataset into a TAR file.
86
* Append if the file exists, or create a new one if not.
87
*
88
* \param[in] tar_filename the name of the TAR file to save the cloud to
89
* \param[in] cloud the point cloud dataset to save
90
* \param[in] pcd_filename the internal name of the PCD file that should be stored in the TAR header
91
* \remark till implemented will return FALSE
92
*/
93
template
<
typename
Po
int
T>
bool
94
saveTARPointCloud
(
const
std::string &tar_filename,
95
const
PointCloud<PointT>
&cloud,
96
const
std::string &pcd_filename)
97
{
98
return
(
false
);
99
}
100
}
101
}
102
#endif // PCL_IO_TAR_H_
103