#include <darts/array2d.h>
template<typename T>
Array2d class
Generic, resizable, 2D array class.
Derived classes
-
template<typename T>class Image
- An image with a generic pixel type.
Constructors, destructors, conversion operators
Public functions
- auto operator=(const Array2d&) -> Array2d&
- assignment operator
- auto index_1d(int x, int y) const -> int
- Convert the 2d index into a linear index.
- auto index_2d(int i) const -> std::pair<int, int>
- Convert the 1d index into a 2d index.
- void resize(const Vec2i& size)
- Resize to (size.x) x (size.y)
- void reset(const T& value = T(0))
- Set all elements to
value
- void operator=(const T&)
- Set all elements to
value
Protected variables
Element access
- auto at(int x, int y) -> T&
- bounds-checked 2d access
- auto at(int x, int y) const -> const T&
- bounds-checked 2d access
- auto operator()(int x, int y) -> T&
- unchecked 2d access
- auto operator()(int x, int y) const -> const T&
- unchecked 2d access
- auto at(int i) -> T&
- bounds-checked linear access
- auto at(int i) const -> const T&
- bounds-checked linear access
- auto operator()(int i) -> T&
- unchecked linear access
- auto operator()(int i) const -> const T&
- unchecked linear access
- auto row(int y) const -> const T*
- pointer to
y
-th row