PEEL Shopping
Open source ecommerce : PEEL Shopping
Public Member Functions | Protected Member Functions | Protected Attributes
QRcode Class Reference

Class to create QR-code arrays for TCPDF class. More...

Public Member Functions

 __construct ($code, $eclevel= 'L')
 This is the class constructor. More...
 
 getBarcodeArray ()
 Returns a barcode array which is readable by TCPDF. More...
 

Protected Member Functions

 binarize ($frame)
 Convert the frame in binary form. More...
 
 encodeString ($string)
 Encode the input string to QR code. More...
 
 encodeMask ($mask)
 Encode mask. More...
 
 setFrameAt ($at, $val)
 Set frame value at specified position. More...
 
 getFrameAt ($at)
 Get frame value at specified position. More...
 
 getNextPosition ()
 Return the next frame position. More...
 
 init ($spec)
 Initialize code. More...
 
 getCode ()
 Return Reed-Solomon block code. More...
 
 writeFormatInformation ($width, &$frame, $mask, $level)
 Write Format Information on frame and returns the number of black bits. More...
 
 mask0 ($x, $y)
 mask0 More...
 
 mask1 ($x, $y)
 mask1 More...
 
 mask2 ($x, $y)
 mask2 More...
 
 mask3 ($x, $y)
 mask3 More...
 
 mask4 ($x, $y)
 mask4 More...
 
 mask5 ($x, $y)
 mask5 More...
 
 mask6 ($x, $y)
 mask6 More...
 
 mask7 ($x, $y)
 mask7 More...
 
 generateMaskNo ($maskNo, $width, $frame)
 Return bitmask. More...
 
 makeMaskNo ($maskNo, $width, $s, &$d, $maskGenOnly=false)
 makeMaskNo More...
 
 makeMask ($width, $frame, $maskNo, $level)
 makeMask More...
 
 calcN1N3 ($length)
 calcN1N3 More...
 
 evaluateSymbol ($width, $frame)
 evaluateSymbol More...
 
 mask ($width, $frame, $level)
 mask More...
 
 isdigitat ($str, $pos)
 Return true if the character at specified position is a number. More...
 
 isalnumat ($str, $pos)
 Return true if the character at specified position is an alphanumeric character. More...
 
 identifyMode ($pos)
 identifyMode More...
 
 eatNum ()
 eatNum More...
 
 eatAn ()
 eatAn More...
 
 eatKanji ()
 eatKanji More...
 
 eat8 ()
 eat8 More...
 
 splitString ()
 splitString More...
 
 toUpper ()
 toUpper More...
 
 newInputItem ($mode, $size, $data, $bstream=null)
 newInputItem More...
 
 encodeModeNum ($inputitem, $version)
 encodeModeNum More...
 
 encodeModeAn ($inputitem, $version)
 encodeModeAn More...
 
 encodeMode8 ($inputitem, $version)
 encodeMode8 More...
 
 encodeModeKanji ($inputitem, $version)
 encodeModeKanji More...
 
 encodeModeStructure ($inputitem)
 encodeModeStructure More...
 
 encodeBitStream ($inputitem, $version)
 encodeBitStream More...
 
 appendNewInputItem ($items, $mode, $size, $data)
 Append data to an input object. More...
 
 insertStructuredAppendHeader ($items, $size, $index, $parity)
 insertStructuredAppendHeader More...
 
 calcParity ($items)
 calcParity More...
 
 checkModeNum ($size, $data)
 checkModeNum More...
 
 lookAnTable ($c)
 Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19). More...
 
 checkModeAn ($size, $data)
 checkModeAn More...
 
 estimateBitsModeNum ($size)
 estimateBitsModeNum More...
 
 estimateBitsModeAn ($size)
 estimateBitsModeAn More...
 
 estimateBitsMode8 ($size)
 estimateBitsMode8 More...
 
 estimateBitsModeKanji ($size)
 estimateBitsModeKanji More...
 
 checkModeKanji ($size, $data)
 checkModeKanji More...
 
 check ($mode, $size, $data)
 Validate the input data. More...
 
 estimateBitStreamSize ($items, $version)
 estimateBitStreamSize More...
 
 estimateVersion ($items)
 estimateVersion More...
 
 lengthOfCode ($mode, $version, $bits)
 lengthOfCode More...
 
 createBitStream ($items)
 createBitStream More...
 
 convertData ($items)
 convertData More...
 
 appendPaddingBit ($bstream)
 Append Padding Bit to bitstream. More...
 
 mergeBitStream ($items)
 mergeBitStream More...
 
 getBitStream ($items)
 Returns a stream of bits. More...
 
 getByteStream ($items)
 Pack all bit streams padding bits into a byte array. More...
 
 allocate ($setLength)
 Return an array with zeros. More...
 
 newFromNum ($bits, $num)
 Return new bitstream from number. More...
 
 newFromBytes ($size, $data)
 Return new bitstream from bytes. More...
 
 appendBitstream ($bitstream, $append)
 Append one bitstream to another. More...
 
 appendNum ($bitstream, $bits, $num)
 Append one bitstream created from number to another. More...
 
 appendBytes ($bitstream, $size, $data)
 Append one bitstream created from bytes to another. More...
 
 bitstreamToByte ($bstream)
 Convert bitstream to bytes. More...
 
 qrstrset ($srctab, $x, $y, $repl, $replLen=false)
 Replace a value on the array at the specified position. More...
 
 getDataLength ($version, $level)
 Return maximum data code length (bytes) for the version. More...
 
 getECCLength ($version, $level)
 Return maximum error correction code length (bytes) for the version. More...
 
 getWidth ($version)
 Return the width of the symbol for the version. More...
 
 getRemainder ($version)
 Return the numer of remainder bits. More...
 
 getMinimumVersion ($size, $level)
 Return a version number that satisfies the input code length. More...
 
 lengthIndicator ($mode, $version)
 Return the size of length indicator for the mode and version. More...
 
 maximumWords ($mode, $version)
 Return the maximum length for the mode and version. More...
 
 getEccSpec ($version, $level, $spec)
 Return an array of ECC specification. More...
 
 putAlignmentMarker ($frame, $ox, $oy)
 Put an alignment marker. More...
 
 putAlignmentPattern ($version, $frame, $width)
 Put an alignment pattern. More...
 
 getVersionPattern ($version)
 Return BCH encoded version information pattern that is used for the symbol of version 7 or greater. More...
 
 getFormatInfo ($mask, $level)
 Return BCH encoded format information pattern. More...
 
 putFinderPattern ($frame, $ox, $oy)
 Put a finder pattern. More...
 
 createFrame ($version)
 Return a copy of initialized frame. More...
 
 newFrame ($version)
 Set new frame for the specified version. More...
 
 rsBlockNum ($spec)
 Return block number 0. More...
 
 rsBlockNum1 ($spec)
 Return block number 1. More...
 
 rsDataCodes1 ($spec)
 Return data codes 1. More...
 
 rsEccCodes1 ($spec)
 Return ecc codes 1. More...
 
 rsBlockNum2 ($spec)
 Return block number 2. More...
 
 rsDataCodes2 ($spec)
 Return data codes 2. More...
 
 rsEccCodes2 ($spec)
 Return ecc codes 2. More...
 
 rsDataLength ($spec)
 Return data length. More...
 
 rsEccLength ($spec)
 Return ecc length. More...
 
 init_rs ($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
 Initialize a Reed-Solomon codec and add it to existing rsitems. More...
 
 modnn ($rs, $x)
 modnn More...
 
 init_rs_char ($symsize, $gfpoly, $fcr, $prim, $nroots, $pad)
 Initialize a Reed-Solomon codec and returns an array of values. More...
 
 encode_rs_char ($rs, $data, $parity)
 Encode a Reed-Solomon codec and returns the parity array. More...
 

Protected Attributes

 $barcode_array = array()
 Barcode array to be returned which is readable by TCPDF. More...
 
 $version = 0
 QR code version. More...
 
 $level = QR_ECLEVEL_L
 Levels of error correction. More...
 
 $hint = QR_MODE_8B
 Encoding mode. More...
 
 $casesensitive = true
 Boolean flag, if true the input string will be converted to uppercase. More...
 
 $structured = 0
 Structured QR code (not supported yet). More...
 
 $data
 Mask data. More...
 
 $width
 Width. More...
 
 $frame
 Frame. More...
 
 $x
 X position of bit. More...
 
 $y
 Y position of bit. More...
 
 $dir
 Direction. More...
 
 $bit
 Single bit value. More...
 
 $datacode = array()
 Data code. More...
 
 $ecccode = array()
 Error correction code. More...
 
 $blocks
 Blocks. More...
 
 $rsblocks = array()
 Reed-Solomon blocks. More...
 
 $count
 Counter. More...
 
 $dataLength
 Data length. More...
 
 $eccLength
 Error correction length. More...
 
 $b1
 Value b1. More...
 
 $runLength = array()
 Run length. More...
 
 $dataStr = ''
 Input data string. More...
 
 $items
 Input items. More...
 
 $rsitems = array()
 Reed-Solomon items. More...
 
 $frames = array()
 Array of frames. More...
 
 $anTable
 Alphabet-numeric convesion table. More...
 
 $capacity
 Array Table of the capacity of symbols. More...
 
 $lengthTableBits
 Array Length indicator. More...
 
 $eccTable
 Array Table of the error correction code (Reed-Solomon block). More...
 
 $alignmentPattern
 Array Positions of alignment patterns. More...
 
 $versionPattern
 Array Version information pattern (BCH coded). More...
 
 $formatInfo
 Array Format information. More...
 

Detailed Description

Class to create QR-code arrays for TCPDF class.

QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD. The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness. This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004. Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode.

This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html). Please read comments on this class source file for full copyright and license information.

Definition at line 291 of file qrcode.php.

Constructor & Destructor Documentation

__construct (   $code,
  $eclevel = 'L' 
)

This is the class constructor.

Creates a QRcode object

Parameters
$code(string) code to represent using QRcode
$eclevel(string) error level:
  • L : About 7% or less errors can be corrected.
  • M : About 15% or less errors can be corrected.
  • Q : About 25% or less errors can be corrected.
  • H : About 30% or less errors can be corrected.
Since
1.0.000

Definition at line 639 of file qrcode.php.

Member Function Documentation

allocate (   $setLength)
protected

Return an array with zeros.

Parameters
$setLength(int) array size
Returns
array

Definition at line 2128 of file qrcode.php.

appendBitstream (   $bitstream,
  $append 
)
protected

Append one bitstream to another.

Parameters
$bitstream(array) original bitstream
$append(array) bitstream to append
Returns
array bitstream

Definition at line 2182 of file qrcode.php.

appendBytes (   $bitstream,
  $size,
  $data 
)
protected

Append one bitstream created from bytes to another.

Parameters
$bitstream(array) original bitstream
$size(int) size
$data(array) bytes
Returns
array bitstream

Definition at line 2214 of file qrcode.php.

appendNewInputItem (   $items,
  $mode,
  $size,
  $data 
)
protected

Append data to an input object.

The data is copied and appended to the input object.

Parameters
$items(arrray) input items
$mode(int) encoding mode.
$size(int) size of data (byte).
$data(array) array of input data.
Returns
items

Definition at line 1695 of file qrcode.php.

appendNum (   $bitstream,
  $bits,
  $num 
)
protected

Append one bitstream created from number to another.

Parameters
$bitstream(array) original bitstream
$bits(int) number of bits
$num(int) number
Returns
array bitstream

Definition at line 2199 of file qrcode.php.

appendPaddingBit (   $bstream)
protected

Append Padding Bit to bitstream.

Parameters
$bstream(array)
Returns
array bitstream

Definition at line 2054 of file qrcode.php.

binarize (   $frame)
protected

Convert the frame in binary form.

Parameters
$frame(array) array to binarize
Returns
array frame in binary form

Definition at line 689 of file qrcode.php.

bitstreamToByte (   $bstream)
protected

Convert bitstream to bytes.

Parameters
$bstream(array) original bitstream
Returns
array of bytes

Definition at line 2227 of file qrcode.php.

calcN1N3 (   $length)
protected

calcN1N3

Parameters
$length(int)
Returns
int demerit

Definition at line 1126 of file qrcode.php.

calcParity (   $items)
protected

calcParity

Parameters
$items(array)
Returns
int parity

Definition at line 1729 of file qrcode.php.

check (   $mode,
  $size,
  $data 
)
protected

Validate the input data.

Parameters
$mode(int) encoding mode.
$size(int) size of data (byte).
$data(array) data to validate
Returns
boolean true in case of valid data, false otherwise

Definition at line 1858 of file qrcode.php.

checkModeAn (   $size,
  $data 
)
protected

checkModeAn

Parameters
$size(int)
$data(array)
Returns
boolean true or false

Definition at line 1771 of file qrcode.php.

checkModeKanji (   $size,
  $data 
)
protected

checkModeKanji

Parameters
$size(int)
$data(array)
Returns
boolean true or false

Definition at line 1838 of file qrcode.php.

checkModeNum (   $size,
  $data 
)
protected

checkModeNum

Parameters
$size(int)
$data(array)
Returns
boolean true or false

Definition at line 1747 of file qrcode.php.

convertData (   $items)
protected

convertData

Parameters
$items(array)
Returns
array items

Definition at line 2025 of file qrcode.php.

createBitStream (   $items)
protected

createBitStream

Parameters
$items(array)
Returns
array of items and total bits

Definition at line 2010 of file qrcode.php.

createFrame (   $version)
protected

Return a copy of initialized frame.

Parameters
$version(int) version
Returns
Array of unsigned char.

Definition at line 2529 of file qrcode.php.

eat8 ( )
protected

eat8

Returns
int run

Definition at line 1395 of file qrcode.php.

eatAn ( )
protected

eatAn

Returns
int run

Definition at line 1343 of file qrcode.php.

eatKanji ( )
protected

eatKanji

Returns
int run

Definition at line 1382 of file qrcode.php.

eatNum ( )
protected

eatNum

Returns
int run

Definition at line 1311 of file qrcode.php.

encode_rs_char (   $rs,
  $data,
  $parity 
)
protected

Encode a Reed-Solomon codec and returns the parity array.

Parameters
$rs(array) RS values
$data(array) data
$parity(array) parity
Returns
parity array

Definition at line 2827 of file qrcode.php.

encodeBitStream (   $inputitem,
  $version 
)
protected

encodeBitStream

Parameters
$inputitem(array)
$version(int)
Returns
array input item

Definition at line 1640 of file qrcode.php.

encodeMask (   $mask)
protected

Encode mask.

Parameters
$mask(int) masking mode

Definition at line 720 of file qrcode.php.

encodeMode8 (   $inputitem,
  $version 
)
protected

encodeMode8

Parameters
$inputitem(array)
$version(int)
Returns
array input item

Definition at line 1586 of file qrcode.php.

encodeModeAn (   $inputitem,
  $version 
)
protected

encodeModeAn

Parameters
$inputitem(array)
$version(int)
Returns
array input item

Definition at line 1563 of file qrcode.php.

encodeModeKanji (   $inputitem,
  $version 
)
protected

encodeModeKanji

Parameters
$inputitem(array)
$version(int)
Returns
array input item

Definition at line 1602 of file qrcode.php.

encodeModeNum (   $inputitem,
  $version 
)
protected

encodeModeNum

Parameters
$inputitem(array)
$version(int)
Returns
array input item

Definition at line 1534 of file qrcode.php.

encodeModeStructure (   $inputitem)
protected

encodeModeStructure

Parameters
$inputitem(array)
Returns
array input item

Definition at line 1625 of file qrcode.php.

encodeString (   $string)
protected

Encode the input string to QR code.

Parameters
$string(string) input string to encode

Definition at line 704 of file qrcode.php.

estimateBitsMode8 (   $size)
protected

estimateBitsMode8

Parameters
$size(int)
Returns
int number of bits

Definition at line 1819 of file qrcode.php.

estimateBitsModeAn (   $size)
protected

estimateBitsModeAn

Parameters
$size(int)
Returns
int number of bits

Definition at line 1806 of file qrcode.php.

estimateBitsModeKanji (   $size)
protected

estimateBitsModeKanji

Parameters
$size(int)
Returns
int number of bits

Definition at line 1828 of file qrcode.php.

estimateBitsModeNum (   $size)
protected

estimateBitsModeNum

Parameters
$size(int)
Returns
int number of bits

Definition at line 1785 of file qrcode.php.

estimateBitStreamSize (   $items,
  $version 
)
protected

estimateBitStreamSize

Parameters
$items(array)
$version(int)
Returns
int bits

Definition at line 1891 of file qrcode.php.

estimateVersion (   $items)
protected

estimateVersion

Parameters
$items(array)
Returns
int version

Definition at line 1934 of file qrcode.php.

evaluateSymbol (   $width,
  $frame 
)
protected

evaluateSymbol

Parameters
$width(int)
$frame(array)
Returns
int demerit

Definition at line 1157 of file qrcode.php.

generateMaskNo (   $maskNo,
  $width,
  $frame 
)
protected

Return bitmask.

Parameters
$maskNo(int) mask number
$width(int) width
$frame(array) frame
Returns
array bitmask

Definition at line 1063 of file qrcode.php.

getBarcodeArray ( )

Returns a barcode array which is readable by TCPDF.

Returns
array barcode array readable by TCPDF;

Definition at line 680 of file qrcode.php.

getBitStream (   $items)
protected

Returns a stream of bits.

Parameters
$items(int)
Returns
array padded merged byte stream

Definition at line 2104 of file qrcode.php.

getByteStream (   $items)
protected

Pack all bit streams padding bits into a byte array.

Parameters
$items(int)
Returns
array padded merged byte stream

Definition at line 2114 of file qrcode.php.

getCode ( )
protected

Return Reed-Solomon block code.

Returns
array rsblocks

Definition at line 909 of file qrcode.php.

getDataLength (   $version,
  $level 
)
protected

Return maximum data code length (bytes) for the version.

Parameters
$version(int) version
$level(int) error correction level
Returns
int maximum size (bytes)

Definition at line 2283 of file qrcode.php.

getECCLength (   $version,
  $level 
)
protected

Return maximum error correction code length (bytes) for the version.

Parameters
$version(int) version
$level(int) error correction level
Returns
int ECC size (bytes)

Definition at line 2293 of file qrcode.php.

getEccSpec (   $version,
  $level,
  $spec 
)
protected

Return an array of ECC specification.

Parameters
$version(int) version
$level(int) error correction level
$spec(array) an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code}
Returns
array spec

Definition at line 2384 of file qrcode.php.

getFormatInfo (   $mask,
  $level 
)
protected

Return BCH encoded format information pattern.

Parameters
$mask(array)
$level(int) error correction level
Returns
BCH encoded format information pattern

Definition at line 2491 of file qrcode.php.

getFrameAt (   $at)
protected

Get frame value at specified position.

Parameters
$at(array) x,y position
Returns
value at specified position

Definition at line 794 of file qrcode.php.

getMinimumVersion (   $size,
  $level 
)
protected

Return a version number that satisfies the input code length.

Parameters
$size(int) input code length (bytes)
$level(int) error correction level
Returns
int version number

Definition at line 2321 of file qrcode.php.

getNextPosition ( )
protected

Return the next frame position.

Returns
array of x,y coordinates

Definition at line 802 of file qrcode.php.

getRemainder (   $version)
protected

Return the numer of remainder bits.

Parameters
$version(int) version
Returns
int number of remainder bits

Definition at line 2311 of file qrcode.php.

getVersionPattern (   $version)
protected

Return BCH encoded version information pattern that is used for the symbol of version 7 or greater.

Use lower 18 bits.

Parameters
$version(int) version
Returns
BCH encoded version information pattern

Definition at line 2478 of file qrcode.php.

getWidth (   $version)
protected

Return the width of the symbol for the version.

Parameters
$version(int) version
Returns
int width

Definition at line 2302 of file qrcode.php.

identifyMode (   $pos)
protected

identifyMode

Parameters
$pos(int)
Returns
int mode

Definition at line 1286 of file qrcode.php.

init (   $spec)
protected

Initialize code.

Parameters
$spec(array) array of ECC specification
Returns
0 in case of success, -1 in case of error

Definition at line 858 of file qrcode.php.

init_rs (   $symsize,
  $gfpoly,
  $fcr,
  $prim,
  $nroots,
  $pad 
)
protected

Initialize a Reed-Solomon codec and add it to existing rsitems.

Parameters
$symsize(int) symbol size, bits
$gfpoly(int) Field generator polynomial coefficients
$fcr(int) first root of RS code generator polynomial, index form
$prim(int) primitive element to generate polynomial roots
$nroots(int) RS code generator polynomial degree (number of roots)
$pad(int) padding bytes at front of shortened block
Returns
array Array of RS values:
  • mm = Bits per symbol;
  • nn = Symbols per block;
  • alpha_to = log lookup table array;
  • index_of = Antilog lookup table array;
  • genpoly = Generator polynomial array;
  • nroots = Number of generator;
  • roots = number of parity symbols;
  • fcr = First consecutive root, index form;
  • prim = Primitive element, index form;
  • iprim = prim-th root of 1, index form;
  • pad = Padding bytes in shortened block;
  • gfpoly
.

Definition at line 2702 of file qrcode.php.

init_rs_char (   $symsize,
  $gfpoly,
  $fcr,
  $prim,
  $nroots,
  $pad 
)
protected

Initialize a Reed-Solomon codec and returns an array of values.

Parameters
$symsize(int) symbol size, bits
$gfpoly(int) Field generator polynomial coefficients
$fcr(int) first root of RS code generator polynomial, index form
$prim(int) primitive element to generate polynomial roots
$nroots(int) RS code generator polynomial degree (number of roots)
$pad(int) padding bytes at front of shortened block
Returns
array Array of RS values:
  • mm = Bits per symbol;
  • nn = Symbols per block;
  • alpha_to = log lookup table array;
  • index_of = Antilog lookup table array;
  • genpoly = Generator polynomial array;
  • nroots = Number of generator;
  • roots = number of parity symbols;
  • fcr = First consecutive root, index form;
  • prim = Primitive element, index form;
  • iprim = prim-th root of 1, index form;
  • pad = Padding bytes in shortened block;
  • gfpoly
.

Definition at line 2743 of file qrcode.php.

insertStructuredAppendHeader (   $items,
  $size,
  $index,
  $parity 
)
protected

insertStructuredAppendHeader

Parameters
$items(array)
$size(int)
$index(int)
$parity(int)
Returns
array items

Definition at line 1711 of file qrcode.php.

isalnumat (   $str,
  $pos 
)
protected

Return true if the character at specified position is an alphanumeric character.

Parameters
$str(string) string
$pos(int) characted position
Returns
boolean true of false

Definition at line 1274 of file qrcode.php.

isdigitat (   $str,
  $pos 
)
protected

Return true if the character at specified position is a number.

Parameters
$str(string) string
$pos(int) characted position
Returns
boolean true of false

Definition at line 1261 of file qrcode.php.

lengthIndicator (   $mode,
  $version 
)
protected

Return the size of length indicator for the mode and version.

Parameters
$mode(int) encoding mode
$version(int) version
Returns
int the size of the appropriate length indicator (bits).

Definition at line 2338 of file qrcode.php.

lengthOfCode (   $mode,
  $version,
  $bits 
)
protected

lengthOfCode

Parameters
$mode(int)
$version(int)
$bits(int)
Returns
int size

Definition at line 1955 of file qrcode.php.

lookAnTable (   $c)
protected

Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19).

Parameters
$c(int) character value
Returns
value

Definition at line 1761 of file qrcode.php.

makeMask (   $width,
  $frame,
  $maskNo,
  $level 
)
protected

makeMask

Parameters
$width(int)
$frame(array)
$maskNo(int)
$level(int)
Returns
array mask

Definition at line 1114 of file qrcode.php.

makeMaskNo (   $maskNo,
  $width,
  $s,
$d,
  $maskGenOnly = false 
)
protected

makeMaskNo

Parameters
$maskNo(int)
$width(int)
$s(int)
$d(int)
$maskGenOnly(boolean)
Returns
int b

Definition at line 1087 of file qrcode.php.

mask (   $width,
  $frame,
  $level 
)
protected

mask

Parameters
$width(int)
$frame(array)
$level(int)
Returns
array best mask

Definition at line 1219 of file qrcode.php.

mask0 (   $x,
  $y 
)
protected

mask0

Parameters
$x(int) X position
$y(int) Y position
Returns
int mask

Definition at line 982 of file qrcode.php.

mask1 (   $x,
  $y 
)
protected

mask1

Parameters
$x(int) X position
$y(int) Y position
Returns
int mask

Definition at line 992 of file qrcode.php.

mask2 (   $x,
  $y 
)
protected

mask2

Parameters
$x(int) X position
$y(int) Y position
Returns
int mask

Definition at line 1002 of file qrcode.php.

mask3 (   $x,
  $y 
)
protected

mask3

Parameters
$x(int) X position
$y(int) Y position
Returns
int mask

Definition at line 1012 of file qrcode.php.

mask4 (   $x,
  $y 
)
protected

mask4

Parameters
$x(int) X position
$y(int) Y position
Returns
int mask

Definition at line 1022 of file qrcode.php.

mask5 (   $x,
  $y 
)
protected

mask5

Parameters
$x(int) X position
$y(int) Y position
Returns
int mask

Definition at line 1032 of file qrcode.php.

mask6 (   $x,
  $y 
)
protected

mask6

Parameters
$x(int) X position
$y(int) Y position
Returns
int mask

Definition at line 1042 of file qrcode.php.

mask7 (   $x,
  $y 
)
protected

mask7

Parameters
$x(int) X position
$y(int) Y position
Returns
int mask

Definition at line 1052 of file qrcode.php.

maximumWords (   $mode,
  $version 
)
protected

Return the maximum length for the mode and version.

Parameters
$mode(int) encoding mode
$version(int) version
Returns
int the maximum length (bytes)

Definition at line 2358 of file qrcode.php.

mergeBitStream (   $items)
protected

mergeBitStream

Parameters
$items(array) items
Returns
array bitstream

Definition at line 2087 of file qrcode.php.

modnn (   $rs,
  $x 
)
protected

modnn

Parameters
$rs(array) RS values
$x(int) X position
Returns
int X osition

Definition at line 2725 of file qrcode.php.

newFrame (   $version)
protected

Set new frame for the specified version.

Parameters
$version(int) version
Returns
Array of unsigned char.

Definition at line 2594 of file qrcode.php.

newFromBytes (   $size,
  $data 
)
protected

Return new bitstream from bytes.

Parameters
$size(int) size
$data(array) bytes
Returns
array bitstream

Definition at line 2158 of file qrcode.php.

newFromNum (   $bits,
  $num 
)
protected

Return new bitstream from number.

Parameters
$bits(int) number of bits
$num(int) number
Returns
array bitstream

Definition at line 2138 of file qrcode.php.

newInputItem (   $mode,
  $size,
  $data,
  $bstream = null 
)
protected

newInputItem

Parameters
$mode(int)
$size(int)
$data(array)
$bstream(array)
Returns
array input item

Definition at line 1512 of file qrcode.php.

putAlignmentMarker (   $frame,
  $ox,
  $oy 
)
protected

Put an alignment marker.

Parameters
$frame(array) frame
$ox(int) X center coordinate of the pattern
$oy(int) Y center coordinate of the pattern
Returns
array frame

Definition at line 2415 of file qrcode.php.

putAlignmentPattern (   $version,
  $frame,
  $width 
)
protected

Put an alignment pattern.

Parameters
$version(int) version
$frame(array) frame
$width(int) width
Returns
array frame

Definition at line 2438 of file qrcode.php.

putFinderPattern (   $frame,
  $ox,
  $oy 
)
protected

Put a finder pattern.

Parameters
$frame(array) frame
$ox(int) X center coordinate of the pattern
$oy(int) Y center coordinate of the pattern
Returns
array frame

Definition at line 2508 of file qrcode.php.

qrstrset (   $srctab,
  $x,
  $y,
  $repl,
  $replLen = false 
)
protected

Replace a value on the array at the specified position.

Parameters
$srctab(array)
$x(int) X position
$y(int) Y position
$repl(string) value to replace
$replLen(int) length of the repl string
Returns
array srctab

Definition at line 2272 of file qrcode.php.

rsBlockNum (   $spec)
protected

Return block number 0.

Parameters
$spec(array)
Returns
int value

Definition at line 2612 of file qrcode.php.

rsBlockNum1 (   $spec)
protected

Return block number 1.

Parameters
$spec(array)
Returns
int value

Definition at line 2621 of file qrcode.php.

rsBlockNum2 (   $spec)
protected

Return block number 2.

Parameters
$spec(array)
Returns
int value

Definition at line 2648 of file qrcode.php.

rsDataCodes1 (   $spec)
protected

Return data codes 1.

Parameters
$spec(array)
Returns
int value

Definition at line 2630 of file qrcode.php.

rsDataCodes2 (   $spec)
protected

Return data codes 2.

Parameters
$spec(array)
Returns
int value

Definition at line 2657 of file qrcode.php.

rsDataLength (   $spec)
protected

Return data length.

Parameters
$spec(array)
Returns
int value

Definition at line 2675 of file qrcode.php.

rsEccCodes1 (   $spec)
protected

Return ecc codes 1.

Parameters
$spec(array)
Returns
int value

Definition at line 2639 of file qrcode.php.

rsEccCodes2 (   $spec)
protected

Return ecc codes 2.

Parameters
$spec(array)
Returns
int value

Definition at line 2666 of file qrcode.php.

rsEccLength (   $spec)
protected

Return ecc length.

Parameters
$spec(array)
Returns
int value

Definition at line 2684 of file qrcode.php.

setFrameAt (   $at,
  $val 
)
protected

Set frame value at specified position.

Parameters
$at(array) x,y position
$val(int) value of the character to set

Definition at line 785 of file qrcode.php.

splitString ( )
protected

splitString

Returns
(int)

Definition at line 1444 of file qrcode.php.

toUpper ( )
protected

toUpper

Definition at line 1483 of file qrcode.php.

writeFormatInformation (   $width,
$frame,
  $mask,
  $level 
)
protected

Write Format Information on frame and returns the number of black bits.

Parameters
$width(int) frame width
$frame(array) frame
$mask(array) masking mode
$level(int) error correction level
Returns
int blacks

Definition at line 940 of file qrcode.php.

Field Documentation

$alignmentPattern
protected
Initial value:
= array(
array( 0, 0),
array( 0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0),
array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50),
array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48),
array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62),
array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58),
array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52),
array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54),
array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58)
)

Array Positions of alignment patterns.

This array includes only the second and the third position of the alignment patterns. Rest of them can be calculated from the distance between them. See Table 1 in Appendix E (pp.71) of JIS X0510:2004.

Definition at line 589 of file qrcode.php.

$anTable
protected
Initial value:
= array(
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1,
-1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
)

Alphabet-numeric convesion table.

Definition at line 463 of file qrcode.php.

$b1
protected

Value b1.

Definition at line 421 of file qrcode.php.

$barcode_array = array()
protected

Barcode array to be returned which is readable by TCPDF.

Definition at line 297 of file qrcode.php.

$bit
protected

Single bit value.

Definition at line 371 of file qrcode.php.

$blocks
protected

Blocks.

Definition at line 391 of file qrcode.php.

$capacity
protected

Array Table of the capacity of symbols.

See Table 1 (pp.13) and Table 12-16 (pp.30-36), JIS X0510:2004.

Definition at line 479 of file qrcode.php.

$casesensitive = true
protected

Boolean flag, if true the input string will be converted to uppercase.

Definition at line 321 of file qrcode.php.

$count
protected

Counter.

Definition at line 403 of file qrcode.php.

$data
protected

Mask data.

Definition at line 333 of file qrcode.php.

$datacode = array()
protected

Data code.

Definition at line 379 of file qrcode.php.

$dataLength
protected

Data length.

Definition at line 409 of file qrcode.php.

$dataStr = ''
protected

Input data string.

Definition at line 437 of file qrcode.php.

$dir
protected

Direction.

Definition at line 365 of file qrcode.php.

$ecccode = array()
protected

Error correction code.

Definition at line 385 of file qrcode.php.

$eccLength
protected

Error correction length.

Definition at line 415 of file qrcode.php.

$eccTable
protected

Array Table of the error correction code (Reed-Solomon block).

See Table 12-16 (pp.30-36), JIS X0510:2004.

Definition at line 539 of file qrcode.php.

$formatInfo
protected
Initial value:
= array(
array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976),
array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0),
array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed),
array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b)
)

Array Format information.

Definition at line 619 of file qrcode.php.

$frame
protected

Frame.

Definition at line 347 of file qrcode.php.

$frames = array()
protected

Array of frames.

Definition at line 457 of file qrcode.php.

$hint = QR_MODE_8B
protected

Encoding mode.

Definition at line 315 of file qrcode.php.

$items
protected

Input items.

Definition at line 443 of file qrcode.php.

$lengthTableBits
protected
Initial value:
= array(
array(10, 12, 14),
array( 9, 11, 13),
array( 8, 16, 16),
array( 8, 10, 12)
)

Array Length indicator.

Definition at line 527 of file qrcode.php.

$level = QR_ECLEVEL_L
protected

Levels of error correction.

See definitions for possible values.

Definition at line 309 of file qrcode.php.

$rsblocks = array()
protected

Reed-Solomon blocks.

Definition at line 397 of file qrcode.php.

$rsitems = array()
protected

Reed-Solomon items.

Definition at line 451 of file qrcode.php.

$runLength = array()
protected

Run length.

Definition at line 429 of file qrcode.php.

$structured = 0
protected

Structured QR code (not supported yet).

Definition at line 327 of file qrcode.php.

$version = 0
protected

QR code version.

Size of QRcode is defined as version. Version is from 1 to 40. Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177*177 matrix.

Definition at line 303 of file qrcode.php.

$versionPattern
protected
Initial value:
= array(
0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d,
0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9,
0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75,
0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64,
0x27541, 0x28c69
)

Array Version information pattern (BCH coded).

See Table 1 in Appendix D (pp.68) of JIS X0510:2004. size: [QRSPEC_VERSION_MAX - 6]

Definition at line 607 of file qrcode.php.

$width
protected

Width.

Definition at line 341 of file qrcode.php.

$x
protected

X position of bit.

Definition at line 353 of file qrcode.php.

$y
protected

Y position of bit.

Definition at line 359 of file qrcode.php.


The documentation for this class was generated from the following file:

This documentation for Open ecommerce PEEL Shopping and PEEL.fr has been generated by Doxygen on Thu Oct 15 2015 14:41:43 - Peel ecommerce is a product of Agence web Advisto SAS. All rights reserved.