2 #ifndef vbl_bit_array_2d_h_ 3 #define vbl_bit_array_2d_h_ 18 # include <vcl_msvc_warnings.h> 50 void fill(
bool value);
54 void enlarge(
unsigned int m,
unsigned int n);
59 bool operator() (
unsigned int i,
unsigned int j)
const;
60 bool operator() (
unsigned int i,
unsigned int j);
62 void put(
unsigned int i,
unsigned int j,
bool const &x);
63 bool get(
unsigned int i,
unsigned int j)
const;
65 void set(
unsigned int i,
unsigned int j,
bool v=
true) {
put(i, j, v); }
67 void flip(
unsigned int i,
unsigned int j) {
put(i, j, !
get(i,j)); }
73 unsigned long size()
const;
81 void construct(
unsigned int m,
unsigned int n);
84 void index(
unsigned int x,
unsigned int y,
unsigned long &byteindex,
unsigned int &bitindex)
const;
89 #endif // vbl_bit_array_2d_h_ void enlarge(unsigned int m, unsigned int n)
Resizes and pads with zeros; keeps existing data.
bool operator!=(vbl_bit_array_2d const &a) const
vbl_bit_array_2d & operator=(vbl_bit_array_2d const &)
Assignment operator.
bool operator()(unsigned int i, unsigned int j) const
bool operator==(vbl_bit_array_2d const &a) const
Comparison.
std::ostream & operator<<(std::ostream &os, const vbl_bit_array_2d &v)
void clear()
make as if default-constructed.
bool get(unsigned int i, unsigned int j) const
void construct(unsigned int m, unsigned int n)
void resize(unsigned int m, unsigned int n)
Delete contents and resize to m rows x n cols.
unsigned int cols() const
void flip(unsigned int i, unsigned int j)
Change the value of a cell.
unsigned long size() const
Number of bytes allocated by the data.
void put(unsigned int i, unsigned int j, bool const &x)
void set(unsigned int i, unsigned int j, bool v=true)
Set the value of a cell; default is to set the value on.
void index(unsigned int x, unsigned int y, unsigned long &byteindex, unsigned int &bitindex) const
void fill(bool value)
Fill with value.
unsigned int columns() const
unsigned int rows() const