Array2D representation where origin is at bottom left.
More...
#include <panel.h>
|
| Array2D ()=delete |
| Disable default constructor because we need dimensions.
|
|
| Array2D (unsigned width, unsigned height, T fillValue={}) |
| Construct a new Array2D object.
|
|
T & | at (unsigned x, unsigned y) |
| Get mutable reference to cell at a given coordinate.
|
|
const T & | at (unsigned x, unsigned y) const |
| Const reference to cell at a given coordinate. Useful to read a value and allowing the compiler to protect against modifications.
|
|
unsigned | Width () const noexcept |
| Cells in horizontal dimension.
|
|
unsigned | Height () const noexcept |
| Cells in vertical dimension.
|
|
|
std::vector< std::vector< T > > | m_cells |
| 2D grid of cells. Kept private in case we actually get an ND-Array that would be better than this vector of vectors
|
|
template<typename T>
class argos_lib::led::Array2D< T >
Array2D representation where origin is at bottom left.
◆ Array2D() [1/2]
Disable default constructor because we need dimensions.
◆ Array2D() [2/2]
Construct a new Array2D object.
- Parameters
-
width | Number of cells in horizontal axis |
height | Number of cells in vertical axis |
fillValue | Initial value for all cells |
◆ at() [1/2]
Get mutable reference to cell at a given coordinate.
- Note
- This can throw an out_of_range exception if a cell is requested outside the bounds of the array dimensions.
- Parameters
-
x | Coordinate in x dimesion. 0 is leftmost cell. |
y | Coordinate in y dimension. 0 is bottommost cell. |
- Returns
- Cell at specified coordinate
◆ at() [2/2]
Const reference to cell at a given coordinate. Useful to read a value and allowing the compiler to protect against modifications.
- Note
- This can throw an out_of_range exception if a cell is requested outside the bounds of the array dimensions.
- Parameters
-
x | Coordinate in x dimesion. 0 is leftmost cell. |
y | Coordinate in y dimension. 0 is bottommost cell. |
- Returns
- Cell at specified coordinate
◆ Height()
Cells in vertical dimension.
- Returns
- Array height in cells
◆ Width()
Cells in horizontal dimension.
- Returns
- Array width in cells
◆ m_cells
2D grid of cells. Kept private in case we actually get an ND-Array that would be better than this vector of vectors
The documentation for this class was generated from the following file:
- src/argos_lib/include/argos_lib/led/panel.h