C# Class zxingwp7.common.BitMatrix

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.

Internally the bits are represented in a 1-D array of 32-bit ints. However, each row begins with a new int. This is done intentionally so that we can copy out a row into a BitArray very efficiently.

The ordering of bits is row-major. Within each int, the least significant bits are used first, meaning they represent lower x values. This is compatible with BitArray's implementation.

Exibir arquivo Open project: henningms/zxing2.0-wp7 Class Usage Examples

Public Properties

Property Type Description
bits int[]
height int
rowSize int
width int

Public Methods

Method Description
BitMatrix ( int dimension ) : System
BitMatrix ( int width, int height ) : System
ToString ( ) : String
clear ( ) : void

Clears all bits (sets to false).

flip ( int x, int y ) : void

Flips the given bit.

getRow ( int y, BitArray row ) : BitArray

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

get_Renamed ( int x, int y ) : bool

Gets the requested bit, where true means black.

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

Sets a square region of the bit matrix to true.

set_Renamed ( int x, int y ) : void

Sets the given bit to true.

Method Details

BitMatrix() public method

public BitMatrix ( int dimension ) : System
dimension int
return System

BitMatrix() public method

public BitMatrix ( int width, int height ) : System
width int
height int
return System

ToString() public method

public ToString ( ) : String
return String

clear() public method

Clears all bits (sets to false).
public clear ( ) : void
return void

flip() public method

Flips the given bit.

public flip ( int x, int y ) : void
x int The horizontal component (i.e. which column) ///
y int The vertical component (i.e. which row) ///
return void

getRow() public method

A fast method to retrieve one row of data from the matrix as a BitArray.
public getRow ( int y, BitArray row ) : BitArray
y int The row to retrieve ///
row BitArray An optional caller-allocated BitArray, will be allocated if null or too small ///
return BitArray

get_Renamed() public method

Gets the requested bit, where true means black.

public get_Renamed ( int x, int y ) : bool
x int The horizontal component (i.e. which column) ///
y int The vertical component (i.e. which row) ///
return bool

setRegion() public method

Sets a square region of the bit matrix to true.

public setRegion ( int left, int top, int width, int height ) : void
left int The horizontal position to begin at (inclusive) ///
top int The vertical position to begin at (inclusive) ///
width int The width of the region ///
height int The height of the region ///
return void

set_Renamed() public method

Sets the given bit to true.

public set_Renamed ( int x, int y ) : void
x int The horizontal component (i.e. which column) ///
y int The vertical component (i.e. which row) ///
return void

Property Details

bits public_oe property

public int[] bits
return int[]

height public_oe property

public int height
return int

rowSize public_oe property

public int rowSize
return int

width public_oe property

public int width
return int