64 inline const unsigned char*
65 getData ()
const {
return (data_.data()); }
75 for (std::size_t row_index = 0; row_index < height; ++row_index)
77 for (std::size_t col_index = 0; col_index < width; ++col_index)
82 subMap (col_index, row_index) = (*this) (col_index + x, row_index + y);
90 resize (std::size_t width, std::size_t height);
92 inline unsigned char &
93 operator() (
const std::size_t x,
const std::size_t y)
95 return (data_[y*width_+x]);
98 inline const unsigned char &
99 operator() (
const std::size_t x,
const std::size_t y)
const
101 return (data_[y*width_+x]);
110 const int width =
static_cast<int> (width_);
111 const int height =
static_cast<int> (height_);
113 stream.write (
reinterpret_cast<const char*
> (&width),
sizeof (width));
114 stream.write (
reinterpret_cast<const char*
> (&height),
sizeof (height));
116 const int num_of_elements =
static_cast<int> (data_.size ());
117 stream.write (
reinterpret_cast<const char*
> (&num_of_elements),
sizeof (num_of_elements));
118 for (
int element_index = 0; element_index < num_of_elements; ++element_index)
120 stream.write (
reinterpret_cast<const char*
> (&(data_[element_index])),
sizeof (data_[element_index]));
130 stream.read (
reinterpret_cast<char*
> (&width),
sizeof (width));
131 stream.read (
reinterpret_cast<char*
> (&height),
sizeof (height));
133 width_ =
static_cast<std::size_t
> (width);
134 height_ =
static_cast<std::size_t
> (height);
137 stream.read (
reinterpret_cast<char*
> (&num_of_elements),
sizeof (num_of_elements));
138 data_.resize (num_of_elements);
139 for (
int element_index = 0; element_index < num_of_elements; ++element_index)
141 stream.read (
reinterpret_cast<char*
> (&(data_[element_index])),
sizeof (data_[element_index]));
unsigned char * getData()
void resize(std::size_t width, std::size_t height)
std::size_t getHeight() const
void deserialize(std::istream &stream)
void serialize(std::ostream &stream) const
QuantizedMap(std::size_t width, std::size_t height)
QuantizedMap(const QuantizedMap ©_me)
std::size_t getWidth() const
QuantizedMap getSubMap(std::size_t x, std::size_t y, std::size_t width, std::size_t height)
std::vector< unsigned char > data_
const unsigned char * getData() const
static void spreadQuantizedMap(const QuantizedMap &input_map, QuantizedMap &output_map, std::size_t spreading_size)
Defines all the PCL and non-PCL macros used.