Point Cloud Library (PCL) 1.13.0
Loading...
Searching...
No Matches
dense_quantized_multi_mod_template.h
1/*
2 * Software License Agreement (BSD License)
3 *
4 * Point Cloud Library (PCL) - www.pointclouds.org
5 * Copyright (c) 2010-2011, 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 Willow Garage, Inc. 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#pragma once
39
40#include <vector>
41
42#include <pcl/recognition/region_xy.h>
43
44namespace pcl
45{
46
48 {
49 std::vector<unsigned char> features;
50
51 void
52 serialize (std::ostream & stream) const
53 {
54 const auto num_of_features = static_cast<std::size_t> (features.size ());
55 write (stream, num_of_features);
56 for (std::size_t feature_index = 0; feature_index < num_of_features; ++feature_index)
57 {
58 write (stream, features[feature_index]);
59 }
60 }
61
62 void
63 deserialize (std::istream & stream)
64 {
65 features.clear ();
66
67 std::size_t num_of_features;
68 read (stream, num_of_features);
69 features.resize (num_of_features);
70 for (std::size_t feature_index = 0; feature_index < num_of_features; ++feature_index)
71 {
72 read (stream, features[feature_index]);
73 }
74 }
75 };
76
78 {
79 std::vector<DenseQuantizedSingleModTemplate> modalities;
81
83
84 void
85 serialize (std::ostream & stream) const
86 {
87 const auto num_of_modalities = static_cast<std::size_t> (modalities.size ());
88 write (stream, num_of_modalities);
89 for (std::size_t modality_index = 0; modality_index < num_of_modalities; ++modality_index)
90 {
91 modalities[modality_index].serialize (stream);
92 }
93
94 region.serialize (stream);
95 }
96
97 void
98 deserialize (std::istream & stream)
99 {
100 modalities.clear ();
101
102 std::size_t num_of_modalities;
103 read (stream, num_of_modalities);
104 modalities.resize (num_of_modalities);
105 for (std::size_t modality_index = 0; modality_index < num_of_modalities; ++modality_index)
106 {
107 modalities[modality_index].deserialize (stream);
108 }
109
110 region.deserialize (stream);
111 }
112 };
113
114}
void read(std::istream &stream, Type &value)
Function for reading data from a stream.
Definition region_xy.h:46
void write(std::ostream &stream, Type value)
Function for writing data to a stream.
Definition region_xy.h:63
std::vector< DenseQuantizedSingleModTemplate > modalities
Defines a region in XY-space.
Definition region_xy.h:82
void deserialize(::std::istream &stream)
Deserializes the object from the specified stream.
Definition region_xy.h:109
void serialize(std::ostream &stream) const
Serializes the object to the specified stream.
Definition region_xy.h:98