Template for managing buffers of data for a segment.
More...
#include <Buffer.h>
|
| Buffer (const Segment &segment, unsigned int channels=4) |
| Constructor. More...
|
|
DataType & | operator() (unsigned int x, unsigned int y, unsigned int channel) |
| Retrieve the data value at a given point. More...
|
|
const DataType & | operator() (unsigned int x, unsigned int y, unsigned int channel) const |
| Retrieve the data value at a given point. More...
|
|
const Segment & | getSegment () const |
| Accessor for the terrain height segment this buffer is associated with.
|
|
unsigned int | getSize () const |
| Accessor for the size of segment, m_res + 1.
|
|
unsigned int | getChannels () const |
| Accessor for the number of data values per height point.
|
|
DataType * | getData () |
| Accessor for a pointer to buffer containing data values.
|
|
void | allocate () |
| Allocate the storage required by the buffer. More...
|
|
bool | isValid () const |
| Determine if this buffer has valid allocated storage. More...
|
|
void | invalidate () |
| De-allocate the storage for this buffer. More...
|
|
|
const Segment & | m_segment |
| The terrain height segment this buffer is associated with.
|
|
|
const unsigned int | m_channels |
| The number of data values per height point.
|
|
const unsigned int | m_size |
| The size of segment, m_res + 1.
|
|
DataType * | m_data |
| Pointer to buffer containing data values.
|
|
template<typename DataType>
class Mercator::Buffer< DataType >
Template for managing buffers of data for a segment.
template<typename DataType >
Constructor.
- Parameters
-
segment | terrain height segment this buffer is associated with. |
channels | number of data values per height point. |
template<typename DataType>
Allocate the storage required by the buffer.
Allocate memory based on the size and number of channels required by the buffer.
template<typename DataType>
De-allocate the storage for this buffer.
Free the storage allocate for this buffer.
template<typename DataType>
Determine if this buffer has valid allocated storage.
- Returns
- true if storage is allocated.
template<typename DataType>
DataType& Mercator::Buffer< DataType >::operator() |
( |
unsigned int |
x, |
|
|
unsigned int |
y, |
|
|
unsigned int |
channel |
|
) |
| |
|
inline |
Retrieve the data value at a given point.
Access the data value associated with given point in the segment in a given channel in this buffer.
- Returns
- a reference to the value at the point requested.
template<typename DataType>
const DataType& Mercator::Buffer< DataType >::operator() |
( |
unsigned int |
x, |
|
|
unsigned int |
y, |
|
|
unsigned int |
channel |
|
) |
| const |
|
inline |
Retrieve the data value at a given point.
Return the data value associated with given point in the segment in a given channel in this buffer.
- Returns
- the value at the point requested.
The documentation for this class was generated from the following files: