5 #ifndef MERCATOR_BUFFER_H
6 #define MERCATOR_BUFFER_H
13 template<
typename DataType>
28 explicit Buffer(
unsigned int size,
unsigned int channels);
36 DataType &
operator()(
unsigned int x,
unsigned int y,
unsigned int channel) {
47 unsigned int channel)
const {
Template for managing buffers of data for a segment.
const unsigned int m_size
The size of segment, m_res + 1.
const DataType & operator()(unsigned int x, unsigned int y, unsigned int channel) const
Retrieve the data value at a given point.
const unsigned int m_channels
The number of data values per height point.
Buffer(unsigned int size, unsigned int channels)
Constructor.
unsigned int getSize() const
Accessor for the size of segment, m_res + 1.
void invalidate()
De-allocate the storage for this buffer.
DataType & operator()(unsigned int x, unsigned int y, unsigned int channel)
Retrieve the data value at a given point.
DataType * getData()
Accessor for a pointer to buffer containing data values.
unsigned int getChannels() const
Accessor for the number of data values per height point.
const DataType * getData() const
Accessor for a pointer to buffer containing data values.
bool isValid() const
Determine if this buffer has valid allocated storage.
std::vector< DataType > m_data
Pointer to buffer containing data values.
void allocate()
Allocate the storage required by the buffer.