ILIAS
Release_5_0_x_branch Revision 61816
|
Class to create DataMatrix ECC 200 barcode arrays for TCPDF class. More...
Public Member Functions | |
__construct ($code) | |
This is the class constructor. | |
getBarcodeArray () | |
Returns a barcode array which is readable by TCPDF. |
Protected Member Functions | |
getGFProduct ($a, $b, $log, $alog, $gf) | |
Product of two numbers in a Power-of-Two Galois Field. | |
getErrorCorrection ($wd, $nb, $nd, $nc, $gf=256, $pp=301) | |
Add error correction codewords to data codewords array (ANNEX E). | |
get253StateCodeword ($cwpad, $cwpos) | |
Return the 253-state codeword. | |
get255StateCodeword ($cwpad, $cwpos) | |
Return the 255-state codeword. | |
isCharMode ($chr, $mode) | |
Returns true if the char belongs to the selected mode. | |
lookAheadTest ($data, $pos, $mode) | |
The look-ahead test scans the data to be encoded to find the best mode (Annex P - steps from J to S). | |
getSwitchEncodingCodeword ($mode) | |
Get the switching codeword to a new encoding mode (latch codeword) | |
getMaxDataCodewords ($numcw) | |
Choose the minimum matrix size and return the max number of data codewords. | |
getHighLevelEncoding ($data) | |
Get high level encoding using the minimum symbol data characters for ECC 200. | |
placeModule ($marr, $nrow, $ncol, $row, $col, $chr, $bit) | |
Places "chr+bit" with appropriate wrapping within array[]. | |
placeUtah ($marr, $nrow, $ncol, $row, $col, $chr) | |
Places the 8 bits of a utah-shaped symbol character. | |
placeCornerA ($marr, $nrow, $ncol, $chr) | |
Places the 8 bits of the first special corner case. | |
placeCornerB ($marr, $nrow, $ncol, $chr) | |
Places the 8 bits of the second special corner case. | |
placeCornerC ($marr, $nrow, $ncol, $chr) | |
Places the 8 bits of the third special corner case. | |
placeCornerD ($marr, $nrow, $ncol, $chr) | |
Places the 8 bits of the fourth special corner case. | |
getPlacementMap ($nrow, $ncol) | |
Build a placement map. |
Protected Attributes | |
$barcode_array = array() | |
Barcode array to be returned which is readable by TCPDF. | |
$last_enc = ENC_ASCII | |
Store last used encoding for data codewords. | |
$symbattr | |
Table of Data Matrix ECC 200 Symbol Attributes: | |
$chset_id = array(ENC_C40 => 'C40', ENC_TXT => 'TXT', ENC_X12 =>'X12') | |
Map encodation modes whit character sets. | |
$chset | |
Basic set of characters for each encodation mode. |
Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
Definition at line 110 of file datamatrix.php.
Datamatrix::__construct | ( | $code | ) |
This is the class constructor.
Creates a datamatrix object
$code | (string) Code to represent using Datamatrix. |
Definition at line 235 of file datamatrix.php.
References $barcode_array, $nd, $row, ENC_ASCII, ENC_BASE256, ENC_EDF, get253StateCodeword(), getErrorCorrection(), getHighLevelEncoding(), and getPlacementMap().
|
protected |
Return the 253-state codeword.
$cwpad | (int) Pad codeword. |
$cwpos | (int) Number of data codewords from the beginning of encoded data. |
Definition at line 444 of file datamatrix.php.
Referenced by __construct().
|
protected |
Return the 255-state codeword.
$cwpad | (int) Pad codeword. |
$cwpos | (int) Number of data codewords from the beginning of encoded data. |
Definition at line 459 of file datamatrix.php.
Referenced by getHighLevelEncoding().
Datamatrix::getBarcodeArray | ( | ) |
Returns a barcode array which is readable by TCPDF.
Definition at line 350 of file datamatrix.php.
References $barcode_array.
|
protected |
Add error correction codewords to data codewords array (ANNEX E).
$wd | (array) Array of datacodewords. |
$nb | (int) Number of blocks. |
$nd | (int) Number of data codewords per block. |
$nc | (int) Number of correction codewords per block. |
$gf | (int) numner of fields on log/antilog table (power of 2). |
$pp | (int) The value of its prime modulus polynomial (301 for ECC200). |
Definition at line 382 of file datamatrix.php.
References $log, $n, $nd, and getGFProduct().
Referenced by __construct().
|
protected |
Product of two numbers in a Power-of-Two Galois Field.
$a | (int) first number to multiply. |
$b | (int) second number to multiply. |
$log | (array) Log table. |
$alog | (array) Anti-Log table. |
$gf | (array) Number of Factors of the Reed-Solomon polynomial. |
Definition at line 364 of file datamatrix.php.
References $log.
Referenced by getErrorCorrection().
|
protected |
Get high level encoding using the minimum symbol data characters for ECC 200.
$data | (string) data to encode |
Definition at line 702 of file datamatrix.php.
References ENC_ASCII, ENC_ASCII_EXT, ENC_ASCII_NUM, ENC_BASE256, ENC_C40, ENC_EDF, ENC_TXT, ENC_X12, get255StateCodeword(), getMaxDataCodewords(), getSwitchEncodingCodeword(), isCharMode(), and lookAheadTest().
Referenced by __construct().
|
protected |
Choose the minimum matrix size and return the max number of data codewords.
$numcw | (int) Number of current codewords. |
Definition at line 687 of file datamatrix.php.
Referenced by getHighLevelEncoding().
|
protected |
Build a placement map.
(Annex F - ECC 200 symbol character placement)
$nrow | (int) Number of rows. |
$ncol | (int) Number of columns. |
Definition at line 1089 of file datamatrix.php.
References $row, placeCornerA(), placeCornerB(), placeCornerC(), placeCornerD(), and placeUtah().
Referenced by __construct().
|
protected |
Get the switching codeword to a new encoding mode (latch codeword)
$mode | (int) New encoding mode. |
Definition at line 651 of file datamatrix.php.
References ENC_ASCII, ENC_BASE256, ENC_C40, ENC_EDF, ENC_TXT, and ENC_X12.
Referenced by getHighLevelEncoding().
|
protected |
Returns true if the char belongs to the selected mode.
$chr | (int) Character (byte) to check. |
$mode | (int) Current encoding mode. |
Definition at line 474 of file datamatrix.php.
References ENC_ASCII, ENC_ASCII_EXT, ENC_ASCII_NUM, ENC_BASE256, ENC_C40, ENC_EDF, ENC_TXT, and ENC_X12.
Referenced by getHighLevelEncoding(), and lookAheadTest().
|
protected |
The look-ahead test scans the data to be encoded to find the best mode (Annex P - steps from J to S).
$data | (string) data to encode |
$pos | (int) current position |
$mode | (int) current encoding mode |
Definition at line 521 of file datamatrix.php.
References ENC_ASCII, ENC_ASCII_EXT, ENC_ASCII_NUM, ENC_BASE256, ENC_C40, ENC_EDF, ENC_TXT, ENC_X12, and isCharMode().
Referenced by getHighLevelEncoding().
|
protected |
Places the 8 bits of the first special corner case.
(Annex F - ECC 200 symbol character placement)
$marr | (array) Array of symbols. |
$nrow | (int) Number of rows. |
$ncol | (int) Number of columns. |
$chr | (int) Char byte. |
Definition at line 1003 of file datamatrix.php.
References placeModule().
Referenced by getPlacementMap().
|
protected |
Places the 8 bits of the second special corner case.
(Annex F - ECC 200 symbol character placement)
$marr | (array) Array of symbols. |
$nrow | (int) Number of rows. |
$ncol | (int) Number of columns. |
$chr | (int) Char byte. |
Definition at line 1025 of file datamatrix.php.
References placeModule().
Referenced by getPlacementMap().
|
protected |
Places the 8 bits of the third special corner case.
(Annex F - ECC 200 symbol character placement)
$marr | (array) Array of symbols. |
$nrow | (int) Number of rows. |
$ncol | (int) Number of columns. |
$chr | (int) Char byte. |
Definition at line 1047 of file datamatrix.php.
References placeModule().
Referenced by getPlacementMap().
|
protected |
Places the 8 bits of the fourth special corner case.
(Annex F - ECC 200 symbol character placement)
$marr | (array) Array of symbols. |
$nrow | (int) Number of rows. |
$ncol | (int) Number of columns. |
$chr | (int) Char byte. |
Definition at line 1069 of file datamatrix.php.
References placeModule().
Referenced by getPlacementMap().
|
protected |
Places "chr+bit" with appropriate wrapping within array[].
(Annex F - ECC 200 symbol character placement)
$marr | (array) Array of symbols. |
$nrow | (int) Number of rows. |
$ncol | (int) Number of columns. |
$row | (int) Row number. |
$col | (int) Column number. |
$chr | (int) Char byte. |
$bit | (int) Bit. |
Definition at line 956 of file datamatrix.php.
References $row.
Referenced by placeCornerA(), placeCornerB(), placeCornerC(), placeCornerD(), and placeUtah().
|
protected |
Places the 8 bits of a utah-shaped symbol character.
(Annex F - ECC 200 symbol character placement)
$marr | (array) Array of symbols. |
$nrow | (int) Number of rows. |
$ncol | (int) Number of columns. |
$row | (int) Row number. |
$col | (int) Column number. |
$chr | (int) Char byte. |
Definition at line 981 of file datamatrix.php.
References $row, and placeModule().
Referenced by getPlacementMap().
|
protected |
Barcode array to be returned which is readable by TCPDF.
Definition at line 116 of file datamatrix.php.
Referenced by __construct(), and getBarcodeArray().
|
protected |
Basic set of characters for each encodation mode.
Definition at line 190 of file datamatrix.php.
Map encodation modes whit character sets.
Definition at line 184 of file datamatrix.php.
|
protected |
Store last used encoding for data codewords.
Definition at line 122 of file datamatrix.php.
|
protected |
Table of Data Matrix ECC 200 Symbol Attributes:
Definition at line 145 of file datamatrix.php.