38 #ifndef PCL_FEATURES_QUANTIZED_MAP
39 #define PCL_FEATURES_QUANTIZED_MAP
42 #include <pcl/pcl_macros.h>
65 inline const unsigned char*
76 for (
size_t row_index = 0; row_index < height; ++row_index)
78 for (
size_t col_index = 0; col_index < width; ++col_index)
83 subMap (col_index, row_index) = (*this) (col_index + x, row_index + y);
91 resize (
size_t width,
size_t height);
93 inline unsigned char &
94 operator() (
const size_t x,
const size_t y)
96 return (data_[y*width_+x]);
99 inline const unsigned char &
100 operator() (
const size_t x,
const size_t y)
const
102 return (data_[y*width_+x]);
111 const int width =
static_cast<int> (width_);
112 const int height =
static_cast<int> (height_);
114 stream.write (reinterpret_cast<const char*> (&width),
sizeof (width));
115 stream.write (reinterpret_cast<const char*> (&height),
sizeof (height));
117 const int num_of_elements =
static_cast<int> (data_.size ());
118 stream.write (reinterpret_cast<const char*> (&num_of_elements),
sizeof (num_of_elements));
119 for (
int element_index = 0; element_index < num_of_elements; ++element_index)
121 stream.write (reinterpret_cast<const char*> (&(data_[element_index])),
sizeof (data_[element_index]));
131 stream.read (reinterpret_cast<char*> (&width),
sizeof (width));
132 stream.read (reinterpret_cast<char*> (&height),
sizeof (height));
134 width_ =
static_cast<size_t> (width);
135 height_ =
static_cast<size_t> (height);
138 stream.read (reinterpret_cast<char*> (&num_of_elements),
sizeof (num_of_elements));
139 data_.resize (num_of_elements);
140 for (
int element_index = 0; element_index < num_of_elements; ++element_index)
142 stream.read (reinterpret_cast<char*> (&(data_[element_index])),
sizeof (data_[element_index]));
std::vector< unsigned char > data_
void serialize(std::ostream &stream) const
void deserialize(std::istream &stream)
QuantizedMap getSubMap(size_t x, size_t y, size_t width, size_t height)
const unsigned char * getData() const
unsigned char * getData()