classDatamatrix

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.

Public Member Functions

 construct ($code)
 
 getBarcodeArray ()
 
 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)
 
 getPlacementMap ($nrow, $ncol)
 
 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)
 
 getPlacementMap ($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.

Constructor & Destructor Documentation

Datamatrix::__construct (   $code)

This is the class constructor. Creates a datamatrix object

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

Datamatrix::__construct (   $code)

This is the class constructor. Creates a datamatrix object

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

Member Function Documentation

Datamatrix::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

Datamatrix::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

Datamatrix::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

Datamatrix::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

Datamatrix::getBarcodeArray ( )

Returns a barcode array which is readable by TCPDF

Returns
array barcode array readable by TCPDF;

Datamatrix::getBarcodeArray ( )

Returns a barcode array which is readable by TCPDF

Returns
array barcode array readable by TCPDF;

Datamatrix::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

Datamatrix::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

Datamatrix::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

Datamatrix::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

Datamatrix::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

Datamatrix::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

Datamatrix::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

Datamatrix::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

Datamatrix::getPlacementMap (   $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

Datamatrix::getPlacementMap (   $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

Datamatrix::getSwitchEncodingCodeword (   $mode)
protected

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

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

Datamatrix::getSwitchEncodingCodeword (   $mode)
protected

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

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

Datamatrix::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.

Datamatrix::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.

Datamatrix::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

Datamatrix::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

Datamatrix::placeCornerA (   $marr,
  $nrow,
  $ncol,
  $chr 
)
protected

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

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

Datamatrix::placeCornerA (   $marr,
  $nrow,
  $ncol,
  $chr 
)
protected

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

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

Datamatrix::placeCornerB (   $marr,
  $nrow,
  $ncol,
  $chr 
)
protected

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

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

Datamatrix::placeCornerB (   $marr,
  $nrow,
  $ncol,
  $chr 
)
protected

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

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

Datamatrix::placeCornerC (   $marr,
  $nrow,
  $ncol,
  $chr 
)
protected

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

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

Datamatrix::placeCornerC (   $marr,
  $nrow,
  $ncol,
  $chr 
)
protected

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

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

Datamatrix::placeCornerD (   $marr,
  $nrow,
  $ncol,
  $chr 
)
protected

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

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

Datamatrix::placeCornerD (   $marr,
  $nrow,
  $ncol,
  $chr 
)
protected

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

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

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

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

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

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

Member Data Documentation

Datamatrix::$barcode_array = array()
protected

Barcode array to be returned which is readable by TCPDF.

Datamatrix::$chset
protected

Basic set of characters for each encodation mode.

Datamatrix::$chset_id = array(ENC_C40 => ‘C40’, ENC_TXT => ‘TXT’, ENC_X12 =>‘X12’)
protected

Map encodation modes whit character sets.

Datamatrix::$last_enc = ENC_ASCII
protected

Store last used encoding for data codewords.

Datamatrix::$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


The documentation for this class was generated from the following file:
  • /home/nick/WWW/_OPENSOURCE/TCExam/shared/include/barcodes/datamatrix.php

 

© 2004-2017 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy