\BaconQrCode\CommonFormatInformation

Encapsulates a QR Code's format information, including the data mask used and error correction level.

Summary

Methods
Properties
Constants
numBitsDiffering()
decodeFormatInformation()
getErrorCorrectionLevel()
getDataMask()
hashCode()
equals()
No public properties found
FORMAT_INFO_MASK_QR
__construct()
doDecodeFormatInformation()
$formatInfoDecodeLookup
$bitsSetInHalfByte
$ecLevel
$dataMask
N/A
No private methods found
No private properties found
N/A

Constants

FORMAT_INFO_MASK_QR

FORMAT_INFO_MASK_QR = 21522

Mask for format information.

Properties

$formatInfoDecodeLookup

$formatInfoDecodeLookup : array

Lookup table for decoding format information.

See ISO 18004:2006, Annex C, Table C.1

Type

array

$bitsSetInHalfByte

$bitsSetInHalfByte : array

Offset i holds the number of 1 bits in the binary representation of i.

Type

array

$dataMask

$dataMask : integer

Data mask.

Type

integer

Methods

numBitsDiffering()

numBitsDiffering(integer  $a, integer  $b) : integer

Checks how many bits are different between two integers.

Parameters

integer $a
integer $b

Returns

integer

decodeFormatInformation()

decodeFormatInformation(integer  $maskedFormatInfo1, integer  $maskedFormatInfo2) : \BaconQrCode\Common\FormatInformation|null

Decodes format information.

Parameters

integer $maskedFormatInfo1
integer $maskedFormatInfo2

Returns

\BaconQrCode\Common\FormatInformation|null

getDataMask()

getDataMask() : integer

Gets the data mask.

Returns

integer

hashCode()

hashCode() : integer

Hashes the code of the EC level.

Returns

integer

equals()

equals(mixed  $other) : boolean

Verifies if this instance equals another one.

Parameters

mixed $other

Returns

boolean

__construct()

__construct(integer  $formatInfo) 

Creates a new format information instance.

Parameters

integer $formatInfo

doDecodeFormatInformation()

doDecodeFormatInformation(integer  $maskedFormatInfo1, integer  $maskedFormatInfo2) : \BaconQrCode\Common\FormatInformation|null

Internal method for decoding format information.

Parameters

integer $maskedFormatInfo1
integer $maskedFormatInfo2

Returns

\BaconQrCode\Common\FormatInformation|null