|
MxEngine
|
#include <Array2D.h>
Public Types | |
| using | BaseStorage = Base< T > |
Public Member Functions | |
| Array2D () | |
| Array2D (const Array2D &)=default | |
| Array2D (Array2D &&)=default | |
| Array2D & | operator= (const Array2D &)=default |
| Array2D & | operator= (Array2D &&)=default |
| size_t | size () const |
| size_t | width () const |
| size_t | height () const |
| T * | data () |
| const T * | data () const |
| ArrayView< T > | operator[] (size_t idx) |
| ArrayView< const T > | operator[] (size_t idx) const |
| void | resize (size_t width, size_t height, T value=T()) |
| void | rearrange (size_t width, size_t height) |
| void | clear () |
| auto | begin () |
| auto | end () |
| auto | begin () const |
| auto | end () const |
Rectangular array sized [width * height] where all elements are fitted into one contiguous memory block Each element is accessed as Array[width_idx][height_idx], indexing Array[width_idx] requires one multiplication operation
|
inline |
constructs zero-sized Array2D (i.e. width = height = 0)
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
returns row of Array2D. Requires one multiplication instruction. Row cannot be used if Array2D was deleted
| idx | width index of Array2D |
|
inline |
returns row of Array2D. Requires one multiplication instruction. Row cannot be used if Array2D was deleted
| idx | width index of Array2D |
|
inline |
rearranges array, changing its width and size as long as width * height results in same total elements. if width * height != array.width() * array.height(), result rearrange call is undefined
| width | new array width |
| height | new array height |
|
inline |
resizes array, filling it with new values. All existing elements are packed into first array rows
| width | new array width |
| height | new array height |
| value | optional value to fill new elements (existing are not changed) |
|
inline |
|
inline |
1.8.12