C# Class ZXing.Common.BitMatrix

Exibir arquivo Open project: Redth/ZXing.Net.Mobile Class Usage Examples

Public Methods

Method Description
BitMatrix ( int dimension ) : System
BitMatrix ( int width, int height ) : System
Clone ( ) : object

Clones this instance.

Equals ( object obj ) : bool

Determines whether the specified System.Object is equal to this instance.

GetHashCode ( ) : int

Returns a hash code for this instance.

ToString ( ) : String

Returns a System.String that represents this instance.

ToString ( String setString, String unsetString ) : String

Returns a System.String that represents this instance.

ToString ( String setString, String unsetString, String lineSeparator ) : String

Returns a System.String that represents this instance.

clear ( ) : void

Clears all bits (sets to false).

flip ( int x, int y ) : void

Flips the given bit.

flipWhen ( Func shouldBeFlipped ) : void

flip all of the bits, if shouldBeFlipped is true for the coordinates

getBottomRightOnBit ( ) : int[]
getEnclosingRectangle ( ) : int[]

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

getRow ( int y, BitArray row ) : BitArray

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

getTopLeftOnBit ( ) : int[]

This is useful in detecting a corner of a 'pure' barcode.

parse ( String stringRepresentation, String setString, String unsetString ) : BitMatrix
rotate180 ( ) : void

Modifies this {@code BitMatrix} to represent the same but rotated 180 degrees

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

Sets a square region of the bit matrix to true.

setRow ( int y, BitArray row ) : void

Sets the row.

this ( int x, int y ) : bool

Gets the requested bit, where true means black.

xor ( BitMatrix mask ) : void

Exclusive-or (XOR): Flip the bit in this {@code BitMatrix} if the corresponding mask bit is set.

Private Methods

Method Description
BitMatrix ( int width, int height, int bits ) : System
BitMatrix ( int width, int height, int rowSize, int bits ) : System
buildToString ( String setString, String unsetString, String lineSeparator ) : String

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

Clone() public method

Clones this instance.
public Clone ( ) : object
return object

Equals() public method

Determines whether the specified System.Object is equal to this instance.
public Equals ( object obj ) : bool
obj object The to compare with this instance.
return bool

GetHashCode() public method

Returns a hash code for this instance.
public GetHashCode ( ) : int
return int

ToString() public method

Returns a System.String that represents this instance.
public ToString ( ) : String
return String

ToString() public method

Returns a System.String that represents this instance.
public ToString ( String setString, String unsetString ) : String
setString String The set string.
unsetString String The unset string.
return String

ToString() public method

Returns a System.String that represents this instance.
public ToString ( String setString, String unsetString, String lineSeparator ) : String
setString String The set string.
unsetString String The unset string.
lineSeparator String The line separator.
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

flipWhen() public method

flip all of the bits, if shouldBeFlipped is true for the coordinates
public flipWhen ( Func shouldBeFlipped ) : void
shouldBeFlipped Func should return true, if the bit at a given coordinate should be flipped
return void

getBottomRightOnBit() public method

public getBottomRightOnBit ( ) : int[]
return int[]

getEnclosingRectangle() public method

This is useful in detecting the enclosing rectangle of a 'pure' barcode.
public getEnclosingRectangle ( ) : int[]
return int[]

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

getTopLeftOnBit() public method

This is useful in detecting a corner of a 'pure' barcode.
public getTopLeftOnBit ( ) : int[]
return int[]

parse() public static method

public static parse ( String stringRepresentation, String setString, String unsetString ) : BitMatrix
stringRepresentation String
setString String
unsetString String
return BitMatrix

rotate180() public method

Modifies this {@code BitMatrix} to represent the same but rotated 180 degrees
public rotate180 ( ) : void
return void

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

setRow() public method

Sets the row.
public setRow ( int y, BitArray row ) : void
y int row to set
row BitArray {@link BitArray} to copy from
return void

this() public method

Gets the requested bit, where true means black.

public this ( 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

xor() public method

Exclusive-or (XOR): Flip the bit in this {@code BitMatrix} if the corresponding mask bit is set.
public xor ( BitMatrix mask ) : void
mask BitMatrix The mask.
return void