23 #ifndef GAMOS_ARRAY2D_H 24 #define GAMOS_ARRAY2D_H 26 #include "common/array.h" 27 #include "common/rect.h" 53 Array2D(size_type w, size_type h) {
74 void resize(size_type w, size_type h) {
81 T &at(size_type x, size_type y) {
93 T &operator()(size_type x, size_type y) {
94 return at(x + y * _w);
98 return at(p.
x + p.
y * _w);
101 T *getLinePtr(size_type y) {
102 return &(at(y * _w));
105 const T *getLinePtr(size_type y)
const {
106 return &(at(y * _w));
113 size_type getIndex(size_type x, size_type y)
const {
114 size_t n = x + y * _w;
121 if (
id >= 0 &&
id <
size())
126 size_type width()
const {
130 size_type height()
const {
140 bool isNotNull()
const {
141 return _w > 0 && _h > 0;
144 bool isNull()
const {
145 return _w == 0 || _h == 0;
149 return _w > 0 && _h > 0 && (
size() == _w * _h);
uint16 size_type
Definition: array2d.h:34
void clear()
Definition: array.h:321
T & operator[](size_type idx)
Definition: array.h:274
size_type size() const
Definition: array.h:316
void resize(size_type newSize)
Definition: array.h:412