Grid (aka 2D array) base class with memory management. More...
#include <Radiant/Grid.hpp>
Public Member Functions | |
| void | clear () |
| Frees up the memory, and sets the width and height of this object to zero. More... | |
| void | copy (const T *src, unsigned w, unsigned h) |
| Copies data from memory. More... | |
| GridMemT (unsigned w=0, unsigned h=0) | |
| Constructs a new grid with the given size. More... | |
| GridMemT (void *data, unsigned w, unsigned h) | |
| Constructs a new grid with the given size. More... | |
| GridMemT (const GridMemT &that) | |
| Constructs a copy. More... | |
| GridMemT & | operator= (const GridMemT &that) |
| Copies a grid. More... | |
| void | resize (unsigned w, unsigned h) |
| Resizes this grid, by allocating new memory as necessary Any old data will be lost in this function call. More... | |
| void | resize (Nimble::Vector2i size) |
| Resizes the grid. More... | |
| ~GridMemT () | |
| Destructor. | |
Protected Attributes | |
| T * | m_data |
| Pointer to the raw data. | |
| unsigned | m_height |
| Height of the grid. | |
| unsigned | m_size |
| Reserved data size in bytes. | |
| unsigned | m_width |
| Width of the grid. | |
Grid (aka 2D array) base class with memory management.
| T | Type of objects to store |
|
inline |
Constructs a new grid with the given size.
| w | The width of the grid |
| h | The height of the grid |
|
inline |
Constructs a new grid with the given size.
| data | pointer to grid data |
| w | The width of the grid |
| h | The height of the grid |
|
inline |
Constructs a copy.
| that | Grid memory to copy |
|
inline |
Frees up the memory, and sets the width and height of this object to zero.
|
inline |
Copies data from memory.
| src | Source image data |
| w | Width of source image |
| h | Height of source image |
|
inline |
Copies a grid.
| that | Source grid |
|
inline |
Resizes this grid, by allocating new memory as necessary Any old data will be lost in this function call.
If the number of elements in the grid stays the same, then only the dimensions of the grid are updated, but not the contents.
| w | The new width of the grid |
| h | The new height of the grid |
|
inline |