BitMatrix

Bit matrix.

Represents a 2D matrix of bits. In function arguments below, and throughout the common module, x is the column position, and y is the row position. The ordering is always x, y. The origin is at the top-left.

Constructors

this
this(int width)
Undocumented in source.
this
this(int width, int height)
Undocumented in source.

Members

Functions

clear
void clear()

Clears all bits (set to false).

flip
void flip(int x, int y)

Flips the given bit.

get
bool get(int x, int y)

Gets the requested bit, where true means black.

getBottomRightOnBit
int[] getBottomRightOnBit()

Gets the most bottom right set bit.

getEnclosingRectangle
int[] getEnclosingRectangle()

This is useful in detecting the enclosing rectangle of a 'pure' barcode.

getRow
BitArray getRow(int y, BitArray row)

A fast method to retrieve one row of data from the matrix as a BitArray.

getRow
BitArray getRow(int y)
Undocumented in source. Be warned that the author may not have intended to support it.
getTopLeftOnBit
int[] getTopLeftOnBit()

Gets the most top left set bit.

set
void set(int x, int y)

Sets the given bit to true.

setRegion
void setRegion(int left, int top, int width, int height)

Sets a square region of the bit matrix to true.

setRow
void setRow(int y, BitArray row)

Sets a row of data from a BitArray.

Properties

Bits
BitArrayBitType[] Bits [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
Height
int Height [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
RowSize
int RowSize [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
Width
int Width [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Meta