48 template <
class DATA_TYPE, std::
size_t NUM_OF_CHANNELS>
60 resize(std::size_t width, std::size_t height)
62 data_.resize(NUM_OF_CHANNELS * width * height);
82 operator()(
const std::size_t col_index,
const std::size_t row_index)
84 return &(data_[NUM_OF_CHANNELS * (row_index * width_ + col_index)]);
92 inline const DATA_TYPE*
93 operator()(
const std::size_t col_index,
const std::size_t row_index)
const
95 return &(data_[NUM_OF_CHANNELS * (row_index * width_ + col_index)]);
106 const std::size_t row_index,
107 const std::size_t channel)
109 return data_[NUM_OF_CHANNELS * (row_index * width_ + col_index) + channel];
118 inline const DATA_TYPE&
120 const std::size_t row_index,
121 const std::size_t channel)
const
123 return data_[NUM_OF_CHANNELS * (row_index * width_ + col_index) + channel];
128 std::vector<DATA_TYPE> data_;
136 template <
class DATA_TYPE, std::
size_t NUM_OF_CHANNELS>
148 addData(
const std::size_t width,
const std::size_t height)
152 data->
resize(width, height);
154 data_set_.push_back(data);
161 for (std::size_t data_set_index = 0; data_set_index < data_set_.size();
163 delete data_set_[data_set_index];
182 const std::size_t col,
183 const std::size_t row)
185 return (*data_set_[data_set_id])(col, row);
194 inline const DATA_TYPE*
196 const std::size_t col,
197 const std::size_t row)
const
199 return (*data_set_[data_set_id])(col, row);
211 const std::size_t col,
212 const std::size_t row,
213 const std::size_t channel)
215 return (*data_set_[data_set_id])(col, row, channel);
225 inline const DATA_TYPE&
227 const std::size_t col,
228 const std::size_t row,
229 const std::size_t channel)
const
231 return (*data_set_[data_set_id])(col, row, channel);
236 std::vector<MultiChannel2DData<DATA_TYPE, NUM_OF_CHANNELS>*> data_set_;
Holds two-dimensional multi-channel data.
void resize(std::size_t width, std::size_t height)
Resizes the internal data storage.
void clear()
Clears the internal data storage and sets width and height to 0.
DATA_TYPE & operator()(const std::size_t col_index, const std::size_t row_index, const std::size_t channel)
Returns a reference to the internal data at the specified location.
MultiChannel2DData()
Constructor.
DATA_TYPE * operator()(const std::size_t col_index, const std::size_t row_index)
Returns a pointer to the internal data at the specified location.
const DATA_TYPE * operator()(const std::size_t col_index, const std::size_t row_index) const
Returns a pointer to the internal data at the specified location.
const DATA_TYPE & operator()(const std::size_t col_index, const std::size_t row_index, const std::size_t channel) const
Returns a reference to the internal data at the specified location.
Holds a set of two-dimensional multi-channel data.
void clear()
Releases the data stored in the data set.
void releaseDataSet()
Releases the data stored in the data set.
const DATA_TYPE * operator()(const std::size_t data_set_id, const std::size_t col, const std::size_t row) const
Returns a pointer to the specified data block at the specified location.
DATA_TYPE * operator()(const std::size_t data_set_id, const std::size_t col, const std::size_t row)
Returns a pointer to the specified data block at the specified location.
void addData(const std::size_t width, const std::size_t height)
Adds a new two-dimensional data block to the data set.
const DATA_TYPE & operator()(const std::size_t data_set_id, const std::size_t col, const std::size_t row, const std::size_t channel) const
Returns a reference to the specified data block at the specified location.
DATA_TYPE & operator()(const std::size_t data_set_id, const std::size_t col, const std::size_t row, const std::size_t channel)
Returns a reference to the specified data block at the specified location.
MultiChannel2DDataSet()
Constructor.
Define standard C methods and C++ classes that are common to all methods.