mercator
0.4.0
A terrain generation library for the Worldforge system.
|
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 {
98 #endif // MERCATOR_BUFFER_H
std::vector< DataType > m_data
Pointer to buffer containing data values.
unsigned int getChannels() const
Accessor for the number of data values per height point.
void allocate()
Allocate the storage required by the buffer.
void invalidate()
De-allocate the storage for this buffer.
const DataType & operator()(unsigned int x, unsigned int y, unsigned int channel) const
Retrieve the data value at a given point.
bool isValid() const
Determine if this buffer has valid allocated storage.
Template for managing buffers of data for a segment.
const unsigned int m_channels
The number of data values per height point.
DataType * getData()
Accessor for a pointer to buffer containing data values.
DataType & operator()(unsigned int x, unsigned int y, unsigned int channel)
Retrieve the data value at a given point.
Buffer(unsigned int size, unsigned int channels)
Constructor.
const DataType * getData() const
Accessor for a pointer to buffer containing data values.
const unsigned int m_size
The size of segment, m_res + 1.
unsigned int getSize() const
Accessor for the size of segment, m_res + 1.