38 #ifndef PCL_ML_MULTI_CHANNEL_2D_DATA_SET_H_
39 #define PCL_ML_MULTI_CHANNEL_2D_DATA_SET_H_
50 template <
class DATA_TYPE,
size_t NUM_OF_CHANNELS>
67 data_.resize (NUM_OF_CHANNELS*width*height);
87 operator() (
const size_t col_index,
const size_t row_index)
89 return &(data_[NUM_OF_CHANNELS*(row_index*width_ + col_index)]);
96 inline const DATA_TYPE *
97 operator() (
const size_t col_index,
const size_t row_index)
const
99 return &(data_[NUM_OF_CHANNELS*(row_index*width_ + col_index)]);
108 operator() (
const size_t col_index,
const size_t row_index,
const size_t channel)
110 return data_[NUM_OF_CHANNELS*(row_index*width_ + col_index) + channel];
118 inline const DATA_TYPE &
119 operator() (
const size_t col_index,
const size_t row_index,
const size_t channel)
const
121 return data_[NUM_OF_CHANNELS*(row_index*width_ + col_index) + channel];
127 std::vector<DATA_TYPE> data_;
137 template <
class DATA_TYPE,
size_t NUM_OF_CHANNELS>
152 addData (
const size_t width,
const size_t height)
155 data->
resize (width, height);
157 data_set_.push_back (data);
164 for (
size_t data_set_index = 0; data_set_index < data_set_.size (); ++data_set_index)
166 delete data_set_[data_set_index];
183 operator() (
const size_t data_set_id,
const size_t col,
const size_t row)
185 return (*data_set_[data_set_id]) (col, row);
193 inline const DATA_TYPE *
194 operator() (
const size_t data_set_id,
const size_t col,
const size_t row)
const
196 return (*data_set_[data_set_id]) (col, row);
206 operator() (
const size_t data_set_id,
const size_t col,
const size_t row,
const size_t channel)
208 return (*data_set_[data_set_id]) (col, row, channel);
217 inline const DATA_TYPE &
218 operator() (
const size_t data_set_id,
const size_t col,
const size_t row,
const size_t channel)
const
220 return (*data_set_[data_set_id]) (col, row, channel);
226 std::vector<MultiChannel2DData<DATA_TYPE, NUM_OF_CHANNELS>*> data_set_;