\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 = 0x5412

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

$ecLevel

$ecLevel : \BaconQrCode\Common\ErrorCorrectionLevel

Error correction level.

Type

ErrorCorrectionLevel

$dataMask

$dataMask : int

Data mask.

Type

int

Methods

numBitsDiffering()

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

Checks how many bits are different between two integers.

Parameters

int $a
int $b

Returns

int —

decodeFormatInformation()

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

Decodes format information.

Parameters

int $maskedFormatInfo1
int $maskedFormatInfo2

Returns

\BaconQrCode\Common\FormatInformation|null —

getErrorCorrectionLevel()

getErrorCorrectionLevel() : \BaconQrCode\Common\ErrorCorrectionLevel

Gets the error correction level.

Returns

\BaconQrCode\Common\ErrorCorrectionLevel —

getDataMask()

getDataMask() : int

Gets the data mask.

Returns

int —

hashCode()

hashCode() : int

Hashes the code of the EC level.

Returns

int —

equals()

equals(mixed  $other) : bool

Verifies if this instance equals another one.

Parameters

mixed $other

Returns

bool —

__construct()

__construct(int  $formatInfo) : mixed

Creates a new format information instance.

Parameters

int $formatInfo

Returns

mixed —

doDecodeFormatInformation()

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

Internal method for decoding format information.

Parameters

int $maskedFormatInfo1
int $maskedFormatInfo2

Returns

\BaconQrCode\Common\FormatInformation|null —