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_;
MultiChannel2DData()
Constructor.
void resize(size_t width, size_t height)
Resizes the internal data storage.
void releaseDataSet()
Releases the data stored in the data set.
This file defines compatibility wrappers for low level I/O functions.
MultiChannel2DDataSet< float, 3 > RGB2DDataSet
void addData(const size_t width, const size_t height)
Adds a new two-dimensional data block to the data set.
virtual ~MultiChannel2DData()
Destructor.
virtual ~MultiChannel2DDataSet()
Destructor.
Define standard C methods and C++ classes that are common to all methods.
Holds a set of two-dimensional multi-channel data.
void clear()
Clears the internal data storage and sets width and height to 0.
MultiChannel2DDataSet< float, 4 > RGBD2DDataSet
Holds two-dimensional multi-channel data.
MultiChannel2DDataSet()
Constructor.
MultiChannel2DDataSet< float, 1 > Depth2DDataSet
void clear()
Releases the data stored in the data set.
MultiChannel2DDataSet< float, 2 > IntensityDepth2DDataSet