Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
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 | |
get253StateCodeword ($cwpad, $cwpos) | |
Return the 253-state codeword. | |
get255StateCodeword ($cwpad, $cwpos) | |
Return the 255-state codeword. | |
getErrorCorrection ($wd, $nb, $nd, $nc, $gf=256, $pp=301) | |
Add error correction codewords to data codewords array (ANNEX E). | |
getGFProduct ($a, $b, $log, $alog, $gf) | |
Product of two numbers in a Power-of-Two Galois Field. | |
getHighLevelEncoding ($data) | |
Get high level encoding using the minimum symbol data characters for ECC 200. | |
getMaxDataCodewords ($numcw) | |
Choose the minimum matrix size and return the max number of data codewords. | |
getPlacementMap ($nrow, $ncol) | |
Build a placement map. | |
getSwitchEncodingCodeword ($mode) | |
Get the switching codeword to a new encoding mode (latch 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). | |
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. | |
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. | |
Protected Attributes | |
$barcode_array = array() | |
Barcode array to be returned which is readable by TCPDF. | |
$chset | |
Basic set of characters for each encodation mode. | |
$chset_id = array(ENC_C40 => 'C40', ENC_TXT => 'TXT', ENC_X12 =>'X12') | |
Map encodation modes whit character sets. | |
$last_enc = ENC_ASCII | |
Store last used encoding for data codewords. | |
$symbattr | |
Table of Data Matrix ECC 200 Symbol Attributes: | |
Class to create DataMatrix ECC 200 barcode arrays for TCPDF class.
DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code.
..
Datamatrix::__construct | ( | $code | ) |
This is the class constructor.
Creates a datamatrix object
string | $code | Code to represent using Datamatrix. |
|
protected |
Return the 253-state codeword.
int | $cwpad | Pad codeword. |
int | $cwpos | Number of data codewords from the beginning of encoded data. |
int | pad codeword |
|
protected |
Return the 255-state codeword.
int | $cwpad | Pad codeword. |
int | $cwpos | Number of data codewords from the beginning of encoded data. |
int | pad codeword |
Datamatrix::getBarcodeArray | ( | ) |
Returns a barcode array which is readable by TCPDF.
array | barcode array readable by TCPDF; |
|
protected |
Add error correction codewords to data codewords array (ANNEX E).
array | $wd | Array of datacodewords. |
int | $nb | Number of blocks. |
int | $nd | Number of data codewords per block. |
int | $nc | Number of correction codewords per block. |
int | $gf | numner of fields on log/antilog table (power of 2). |
int | $pp | The value of its prime modulus polynomial (301 for ECC200). |
array | data codewords + error codewords |
|
protected |
Product of two numbers in a Power-of-Two Galois Field.
int | $a | first number to multiply. |
int | $b | second number to multiply. |
array | $log | Log table. |
array | $alog | Anti-Log table. |
int | $gf | Number of Factors of the Reed-Solomon polynomial. |
int | product |
|
protected |
Get high level encoding using the minimum symbol data characters for ECC 200.
string | $data | data to encode |
array | of codewords |
|
protected |
Choose the minimum matrix size and return the max number of data codewords.
int | $numcw | Number of current codewords. |
int | number of data codewords in matrix |
|
protected |
Build a placement map.
(Annex F - ECC 200 symbol character placement)
int | $nrow | Number of rows. |
int | $ncol | Number of columns. |
array |
|
protected |
Get the switching codeword to a new encoding mode (latch codeword)
int | $mode | New encoding mode. |
int | Switch codeword. |
|
protected |
Returns true if the char belongs to the selected mode.
int | $chr | Character (byte) to check. |
int | $mode | Current encoding mode. |
boolean | true if the char is of the selected mode. |
|
protected |
The look-ahead test scans the data to be encoded to find the best mode (Annex P - steps from J to S).
string | $data | data to encode |
int | $pos | current position |
int | $mode | current encoding mode |
int | encoding mode |
|
protected |
Places the 8 bits of the first special corner case.
(Annex F - ECC 200 symbol character placement)
array | $marr | Array of symbols. |
int | $nrow | Number of rows. |
int | $ncol | Number of columns. |
int | $chr | Char byte. |
array |
|
protected |
Places the 8 bits of the second special corner case.
(Annex F - ECC 200 symbol character placement)
array | $marr | Array of symbols. |
int | $nrow | Number of rows. |
int | $ncol | Number of columns. |
int | $chr | Char byte. |
array |
|
protected |
Places the 8 bits of the third special corner case.
(Annex F - ECC 200 symbol character placement)
array | $marr | Array of symbols. |
int | $nrow | Number of rows. |
int | $ncol | Number of columns. |
int | $chr | Char byte. |
array |
|
protected |
Places the 8 bits of the fourth special corner case.
(Annex F - ECC 200 symbol character placement)
array | $marr | Array of symbols. |
int | $nrow | Number of rows. |
int | $ncol | Number of columns. |
int | $chr | Char byte. |
array |
|
protected |
Places "chr+bit" with appropriate wrapping within array[].
(Annex F - ECC 200 symbol character placement)
array | $marr | Array of symbols. |
int | $nrow | Number of rows. |
int | $ncol | Number of columns. |
int | $row | Row number. |
int | $col | Column number. |
int | $chr | Char byte. |
int | $bit | Bit. |
array |
|
protected |
Places the 8 bits of a utah-shaped symbol character.
(Annex F - ECC 200 symbol character placement)
array | $marr | Array of symbols. |
int | $nrow | Number of rows. |
int | $ncol | Number of columns. |
int | $row | Row number. |
int | $col | Column number. |
int | $chr | Char byte. |
array |
|
protected |
Table of Data Matrix ECC 200 Symbol Attributes: