Moodle  2.2.1
http://www.collinsharper.com
Datamatrix Class Reference

Public Member Functions

 __construct ($code)
 getBarcodeArray ()

Protected Member Functions

 getGFProduct ($a, $b, $log, $alog, $gf)
 getErrorCorrection ($wd, $nb, $nd, $nc, $gf=256, $pp=301)
 get253StateCodeword ($cwpad, $cwpos)
 get255StateCodeword ($cwpad, $cwpos)
 isCharMode ($chr, $mode)
 lookAheadTest ($data, $pos, $mode)
 getSwitchEncodingCodeword ($mode)
 getMaxDataCodewords ($numcw)
 getHighLevelEncoding ($data)
 placeModule ($marr, $nrow, $ncol, $row, $col, $chr, $bit)
 placeUtah ($marr, $nrow, $ncol, $row, $col, $chr)
 placeCornerA ($marr, $nrow, $ncol, $chr)
 placeCornerB ($marr, $nrow, $ncol, $chr)
 placeCornerC ($marr, $nrow, $ncol, $chr)
 placeCornerD ($marr, $nrow, $ncol, $chr)
 getPlacemetMap ($nrow, $ncol)

Protected Attributes

 $barcode_array = array()
 $last_enc = ENC_ASCII
 $symbattr
 $chset_id = array(ENC_C40 => 'C40', ENC_TXT => 'TXT', ENC_X12 =>'X12')
 $chset

Detailed Description

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.


Constructor & Destructor Documentation

__construct ( code)

This is the class constructor. Creates a datamatrix object

Parameters:
$code(string) Code to represent using Datamatrix.

Definition at line 235 of file datamatrix.php.

Here is the call graph for this function:


Member Function Documentation

get253StateCodeword ( cwpad,
cwpos 
) [protected]

Return the 253-state codeword

Parameters:
$cwpad(int) Pad codeword.
$cwpos(int) Number of data codewords from the beginning of encoded data.
Returns:
pad codeword

Definition at line 444 of file datamatrix.php.

Here is the caller graph for this function:

get255StateCodeword ( cwpad,
cwpos 
) [protected]

Return the 255-state codeword

Parameters:
$cwpad(int) Pad codeword.
$cwpos(int) Number of data codewords from the beginning of encoded data.
Returns:
pad codeword

Definition at line 459 of file datamatrix.php.

Here is the caller graph for this function:

Returns a barcode array which is readable by TCPDF

Returns:
array barcode array readable by TCPDF;

Definition at line 350 of file datamatrix.php.

getErrorCorrection ( wd,
nb,
nd,
nc,
gf = 256,
pp = 301 
) [protected]

Add error correction codewords to data codewords array (ANNEX E).

Parameters:
$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).
Returns:
array data codewords + error codewords

Definition at line 382 of file datamatrix.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getGFProduct ( a,
b,
log,
alog,
gf 
) [protected]

Product of two numbers in a Power-of-Two Galois Field

Parameters:
$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.
Returns:
int product

Definition at line 364 of file datamatrix.php.

Here is the caller graph for this function:

getHighLevelEncoding ( data) [protected]

Get high level encoding using the minimum symbol data characters for ECC 200

Parameters:
$data(string) data to encode
Returns:
array of codewords

Definition at line 702 of file datamatrix.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getMaxDataCodewords ( numcw) [protected]

Choose the minimum matrix size and return the max number of data codewords.

Parameters:
$numcw(int) Number of current codewords.
Returns:
number of data codewords in matrix

Definition at line 687 of file datamatrix.php.

Here is the caller graph for this function:

getPlacemetMap ( nrow,
ncol 
) [protected]

Build a placement map. (Annex F - ECC 200 symbol character placement)

Parameters:
$nrow(int) Number of rows.
$ncol(int) Number of columns.
Returns:
array

Definition at line 1088 of file datamatrix.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getSwitchEncodingCodeword ( mode) [protected]

Get the switching codeword to a new encoding mode (latch codeword)

Parameters:
$mode(int) New encoding mode.
Returns:
(int) Switch codeword.

Definition at line 651 of file datamatrix.php.

Here is the caller graph for this function:

isCharMode ( chr,
mode 
) [protected]

Returns true if the char belongs to the selected mode

Parameters:
$chr(int) Character (byte) to check.
$mode(int) Current encoding mode.
Returns:
boolean true if the char is of the selected mode.

Definition at line 474 of file datamatrix.php.

Here is the caller graph for this function:

lookAheadTest ( data,
pos,
mode 
) [protected]

The look-ahead test scans the data to be encoded to find the best mode (Annex P - steps from J to S).

Parameters:
$data(string) data to encode
$pos(int) current position
$mode(int) current encoding mode
Returns:
int encoding mode

Definition at line 521 of file datamatrix.php.

Here is the call graph for this function:

Here is the caller graph for this function:

placeCornerA ( marr,
nrow,
ncol,
chr 
) [protected]

Places the 8 bits of the first special corner case. (Annex F - ECC 200 symbol character placement)

Parameters:
$marrarray Array of symbols.
$nrow(int) Number of rows.
$ncol(int) Number of columns.
$chr(int) Char byte.
Returns:
array

Definition at line 1001 of file datamatrix.php.

Here is the call graph for this function:

Here is the caller graph for this function:

placeCornerB ( marr,
nrow,
ncol,
chr 
) [protected]

Places the 8 bits of the second special corner case. (Annex F - ECC 200 symbol character placement)

Parameters:
$marrarray Array of symbols.
$nrow(int) Number of rows.
$ncol(int) Number of columns.
$chr(int) Char byte.
Returns:
array

Definition at line 1023 of file datamatrix.php.

Here is the call graph for this function:

Here is the caller graph for this function:

placeCornerC ( marr,
nrow,
ncol,
chr 
) [protected]

Places the 8 bits of the third special corner case. (Annex F - ECC 200 symbol character placement)

Parameters:
$marrarray Array of symbols.
$nrow(int) Number of rows.
$ncol(int) Number of columns.
$chr(int) Char byte.
Returns:
array

Definition at line 1045 of file datamatrix.php.

Here is the call graph for this function:

Here is the caller graph for this function:

placeCornerD ( marr,
nrow,
ncol,
chr 
) [protected]

Places the 8 bits of the fourth special corner case. (Annex F - ECC 200 symbol character placement)

Parameters:
$marrarray Array of symbols.
$nrow(int) Number of rows.
$ncol(int) Number of columns.
$chr(int) Char byte.
Returns:
array

Definition at line 1067 of file datamatrix.php.

Here is the call graph for this function:

Here is the caller graph for this function:

placeModule ( marr,
nrow,
ncol,
row,
col,
chr,
bit 
) [protected]

Places "chr+bit" with appropriate wrapping within array[]. (Annex F - ECC 200 symbol character placement)

Parameters:
$marrarray 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.
Returns:
array

Definition at line 954 of file datamatrix.php.

Here is the caller graph for this function:

placeUtah ( marr,
nrow,
ncol,
row,
col,
chr 
) [protected]

Places the 8 bits of a utah-shaped symbol character. (Annex F - ECC 200 symbol character placement)

Parameters:
$marrarray 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.
Returns:
array

Definition at line 979 of file datamatrix.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

$barcode_array = array() [protected]

Barcode array to be returned which is readable by TCPDF.

Definition at line 116 of file datamatrix.php.

$chset [protected]

Basic set of charactes for each encodation mode.

Definition at line 190 of file datamatrix.php.

$chset_id = array(ENC_C40 => 'C40', ENC_TXT => 'TXT', ENC_X12 =>'X12') [protected]

Map encodation modes whit character sets.

Definition at line 184 of file datamatrix.php.

$last_enc = ENC_ASCII [protected]

Store last used encoding for data codewords.

Definition at line 122 of file datamatrix.php.

$symbattr [protected]

Table of Data Matrix ECC 200 Symbol Attributes:

  • total matrix rows (including finder pattern)
  • total matrix cols (including finder pattern)
  • total matrix rows (without finder pattern)
  • total matrix cols (without finder pattern)
  • region data rows (with finder pattern)
  • region data col (with finder pattern)
  • region data rows (without finder pattern)
  • region data col (without finder pattern)
  • horizontal regions
  • vertical regions
  • regions
  • data codewords
  • error codewords
  • blocks
  • data codewords per block
  • error codewords per block

Definition at line 145 of file datamatrix.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations