PHP QrCode Liblary  2.0
 All Classes Functions Variables Groups Pages
Static Public Member Functions | Static Public Attributes | List of all members
QRspec Class Reference

QR-Code specification and Code Frame handling. More...

Static Public Member Functions

static getDataLength ($version, $level)
 Calculates data length for specified code configuration. More...
 
static getECCLength ($version, $level)
 Calculates count of Error Correction Codes for specified code configuration. More...
 
static getWidth ($version)
 Gets pixel width of code. More...
 
static getRemainder ($version)
 Gets reminder chars length. More...
 
static getMinimumVersion ($size, $level)
 Finds minimal code version capable of hosting specified data length. More...
 
static lengthIndicator ($mode, $version)
 
static maximumWords ($mode, $version)
 
static getEccSpec ($version, $level, array &$spec)
 
static putAlignmentMarker (array &$frame, $ox, $oy)
 Puts an alignment marker. More...
 
static putAlignmentPattern ($version, &$frame, $width)
 
static getVersionPattern ($version)
 
static getFormatInfo ($mask, $level)
 
static putFinderPattern (&$frame, $ox, $oy)
 Put a finder pattern. More...
 
static createFrame ($version)
 
static debug ($frame, $binary_mode=false)
 Dumps debug HTML of frame. More...
 
static serial ($frame)
 Serializes frame. More...
 
static unserial ($code)
 Deserializes frame. More...
 
static newFrame ($version)
 
static set (&$frame, $x, $y, $repl, $replLen=false)
 Sets code frame with speciffied code. More...
 
Reed-Solomon related shorthand getters.

Syntax-sugar to access code speciffication by getter name, not by spec array field.

static rsBlockNum ($spec)
 
static rsBlockNum1 ($spec)
 
static rsDataCodes1 ($spec)
 
static rsEccCodes1 ($spec)
 
static rsBlockNum2 ($spec)
 
static rsDataCodes2 ($spec)
 
static rsEccCodes2 ($spec)
 
static rsDataLength ($spec)
 
static rsEccLength ($spec)
 

Static Public Attributes

static $capacity
 Array specifying properties of QR-Code "versions". More...
 
static $lengthTableBits
 Length bits Table.
 
static $eccTable
 Table of the error correction code (Reed-Solomon block). More...
 
static $alignmentPattern
 Positions of alignment patterns. More...
 
static $versionPattern
 Version information pattern (BCH coded). More...
 
static $formatInfo
 Format information. More...
 
static $frames = array()
 Cache of initial frames. More...
 

Detailed Description

QR-Code specification and Code Frame handling.

Contains code specifications, calculates base frame, code structure and base properties

Member Function Documentation

static QRspec::debug (   $frame,
  $binary_mode = false 
)
static

Dumps debug HTML of frame.

Parameters
Array$framecode frame
Boolean$binary_modein binary mode only contents is dumped, without styling
static QRspec::getDataLength (   $version,
  $level 
)
static

Calculates data length for specified code configuration.

Parameters
Integer$versionCode version
Integer$levelECC level
Returns
Code data capacity
static QRspec::getECCLength (   $version,
  $level 
)
static

Calculates count of Error Correction Codes for specified code configuration.

Parameters
Integer$versionCode version
Integer$levelECC level
Returns
ECC code count
static QRspec::getMinimumVersion (   $size,
  $level 
)
static

Finds minimal code version capable of hosting specified data length.

Parameters
Integer$sizeamount of raw data
Integer$levelECC level
Returns
code version capable of hosting specified amount of data at specified ECC level
static QRspec::getRemainder (   $version)
static

Gets reminder chars length.

Parameters
Integer$versionCode version
Returns
Reminder length
static QRspec::getWidth (   $version)
static

Gets pixel width of code.

Parameters
Integer$versionCode version
Returns
Code width, in pixels
static QRspec::putAlignmentMarker ( array &  $frame,
  $ox,
  $oy 
)
static

Puts an alignment marker.

Parameters
frame
width
ox,oycenter coordinate of the pattern
static QRspec::putFinderPattern ( $frame,
  $ox,
  $oy 
)
static

Put a finder pattern.

Parameters
frame
width
ox,oyupper-left coordinate of the pattern
static QRspec::serial (   $frame)
static

Serializes frame.

Create compressed, serialized version of frame.

Parameters
Array$frameCode Frame
Returns
String binary compresed Code Frame
static QRspec::set ( $frame,
  $x,
  $y,
  $repl,
  $replLen = false 
)
static

Sets code frame with speciffied code.

Parameters
Array$frametarget frame (modified by reference)
Integer$xX-axis position of replacement
Integer$yY-axis position of replacement
Byte$replreplacement string
Integer$replLen(optional) replacement string length, when Integer > 1 subset of given $repl is used, when false whole $repl is used
static QRspec::unserial (   $code)
static

Deserializes frame.

Loads frame from serialized compressed binary

Parameters
String$codebinary, GZipped, serialized frame
Returns
Array Code Frame array

Member Data Documentation

QRspec::$alignmentPattern
static

Positions of alignment patterns.

This array includes only the second and the third position of the lignment patterns. Rest of them can be calculated from the distance between them.

See Also
Table 1 in Appendix E (pp.71) of JIS X0510:2004.
QRspec::$capacity
static

Array specifying properties of QR-Code "versions".

Each so-called version has specified code area size and capacity. There are 40 versions, this table specifies for each of them four parameters:

  • Integer QRCAP_WIDTH - size of code in pixels
  • Integer QRCAP_WORDS - code capacity, in words
  • Integer QRCAP_REMINDER - remainder words
  • Array of Integers QRCAP_EC - RS correction code count for each of four ECC levels
QRspec::$eccTable
static

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

See Also
Table 12-16 (pp.30-36), JIS X0510:2004.
QRspec::$formatInfo
static

Format information.

See Also
calcFormatInfo in tests/test_qrspec.c (orginal qrencode c lib)
QRspec::$frames = array()
static

Cache of initial frames.

QRspec::$versionPattern
static

Version information pattern (BCH coded).

size: [QRSPEC_VERSION_MAX - 6]

See Also
Table 1 in Appendix D (pp.68) of JIS X0510:2004.

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