classes-Com-Tecnick-Barcode-Type-Square-Datamatrix-Encode

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.

Encode extends EncodeTxt

Com\Tecnick\Barcode\Type\Square\Datamatrix\Encode

Datamatrix Barcode type class DATAMATRIX (ISO/IEC 16022)

Tags
since
2015-02-21
category

Library

author

Nicola Asuni info@tecnick.com

copyright

2015-2016 Nicola Asuni - Tecnick.com LTD

license

http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT)

link
https://github.com/tecnickcom/tc-lib-barcode

Table of Contents

$last_enc  : int
Store last used encoding for data codewords.
$shape  : string
Datamatrix shape key (S=square, R=rectangular)
__construct()  : mixed
Initialize a new encode object
encodeASCII()  : mixed
Encode ASCII
encodeBase256()  : mixed
Encode Base256
encodeEDF()  : mixed
Encode EDF
encodeEDFfour()  : bool
Encode EDF4
encodeTXT()  : mixed
Encode TXT
encodeTXTC40()  : int
Encode TXTC40
encodeTXTC40last()  : mixed
Encode TXTC40 last The following rules apply when only one or two symbol characters remain in the symbol before the start of the error correction codewords.
encodeTXTC40shift()  : mixed
Encode TXTC40 shift
get253StateCodeword()  : pad
Return the 253-state codeword
getPlacementMap()  : array<string|int, mixed>
Build a placement map.
lookAheadTest()  : int
The look-ahead test scans the data to be encoded to find the best mode (Annex P - steps from J to S).
get255StateCodeword()  : int
Return the 255-state codeword
getMaxDataCodewords()  : number
Choose the minimum matrix size and return the max number of data codewords.
getSwitchEncodingCodeword()  : (int)
Get the switching codeword to a new encoding mode (latch codeword)
isASCIIEXTMode()  : bool
Tell if char is ASCII character 128 to 255
isASCIINUMMode()  : bool
Tell if char is ASCII digits
isBASE256Mode()  : bool
Tell if char is Function character (FNC1, Structured Append, Reader Program, or Code Page)
isC40Mode()  : bool
Tell if char is Upper-case alphanumeric
isCharMode()  : bool
Returns true if the char belongs to the selected mode
isEDFMode()  : bool
Tell if char is ASCII character 32 to 94
isTXTMode()  : bool
Tell if char is Lower-case alphanumeric
isX12Mode()  : bool
Tell if char is ANSI X12
placeCornerA()  : array<string|int, mixed>
Places the 8 bits of the first special corner case.
placeCornerB()  : array<string|int, mixed>
Places the 8 bits of the second special corner case.
placeCornerC()  : array<string|int, mixed>
Places the 8 bits of the third special corner case.
placeCornerD()  : array<string|int, mixed>
Places the 8 bits of the fourth special corner case.
placeModule()  : array<string|int, mixed>
Places "chr+bit" with appropriate wrapping within array[].
placeSweepDownward()  : array<string|int, mixed>
Sweep downward diagonally, inserting successive characters, (Annex F - ECC 200 symbol character placement)
placeSweepUpward()  : array<string|int, mixed>
Sweep upward diagonally, inserting successive characters, (Annex F - ECC 200 symbol character placement)
placeUtah()  : array<string|int, mixed>
Places the 8 bits of a utah-shaped symbol character.
stepK()  : int
Step K
stepL()  : mixed
Step L
stepM()  : mixed
Step M
stepN()  : mixed
Step N
stepO()  : mixed
Step O
stepP()  : mixed
Step P
stepQ()  : mixed
Step Q
stepR()  : mixed
Step R
stepRf()  : int
Step R-f

Properties

$last_enc

Store last used encoding for data codewords.

public int $last_enc

$shape

Datamatrix shape key (S=square, R=rectangular)

public string $shape

Methods

__construct()

Initialize a new encode object

public __construct([string $shape = 'S' ]) : mixed
Parameters
$shape : string = 'S'

Datamatrix shape key (S=square, R=rectangular)

Return values
mixed

encodeASCII()

Encode ASCII

public encodeASCII(int &$cdw, int &$cdw_num, int &$pos, int &$data_length, string &$data, int &$enc) : mixed
Parameters
$cdw : int
$cdw_num : int
$pos : int
$data_length : int
$data : string
$enc : int
Return values
mixed

encodeBase256()

Encode Base256

public encodeBase256(int &$cdw, int &$cdw_num, int &$pos, int &$data_length, int &$field_length, string &$data, int &$enc) : mixed
Parameters
$cdw : int
$cdw_num : int
$pos : int
$data_length : int
$field_length : int
$data : string
$enc : int
Return values
mixed

encodeEDF()

Encode EDF

public encodeEDF(int &$cdw, int &$cdw_num, int &$pos, int &$data_length, int &$field_length, string &$data, int &$enc) : mixed
Parameters
$cdw : int
$cdw_num : int
$pos : int
$data_length : int
$field_length : int
$data : string
$enc : int
Return values
mixed

encodeEDFfour()

Encode EDF4

public encodeEDFfour(int $epos, int &$cdw, int &$cdw_num, int &$pos, int &$data_length, int &$field_length, int &$enc, array<string|int, mixed> &$temp_cw) : bool
Parameters
$epos : int
$cdw : int
$cdw_num : int
$pos : int
$data_length : int
$field_length : int
$enc : int
$temp_cw : array<string|int, mixed>
Return values
bool

true to break the loop

encodeTXT()

Encode TXT

public encodeTXT(int &$cdw, int &$cdw_num, int &$pos, int &$data_length, string &$data, int &$enc) : mixed
Parameters
$cdw : int
$cdw_num : int
$pos : int
$data_length : int
$data : string
$enc : int
Return values
mixed

encodeTXTC40()

Encode TXTC40

public encodeTXTC40(string &$data, int &$enc, int &$temp_cw, int &$ptr, int &$epos, array<string|int, mixed> &$charset) : int
Parameters
$data : string
$enc : int
$temp_cw : int
$ptr : int
$epos : int
$charset : array<string|int, mixed>
Return values
int

Curent character code

encodeTXTC40last()

Encode TXTC40 last The following rules apply when only one or two symbol characters remain in the symbol before the start of the error correction codewords.

public encodeTXTC40last(int $chr, int &$cdw, int &$cdw_num, int &$enc, int &$temp_cw, int &$ptr, int &$epos) : mixed
Parameters
$chr : int
$cdw : int
$cdw_num : int
$enc : int
$temp_cw : int
$ptr : int
$epos : int
Return values
mixed

encodeTXTC40shift()

Encode TXTC40 shift

public encodeTXTC40shift(int &$chr, int &$enc, int &$temp_cw, int &$ptr) : mixed
Parameters
$chr : int
$enc : int
$temp_cw : int
$ptr : int
Return values
mixed

get253StateCodeword()

Return the 253-state codeword

public get253StateCodeword(int $cdwpad, int $cdwpos) : pad
Parameters
$cdwpad : int

Pad codeword.

$cdwpos : int

Number of data codewords from the beginning of encoded data.

Return values
pad

codeword

getPlacementMap()

Build a placement map.

public getPlacementMap(int $nrow, int $ncol) : array<string|int, mixed>

(Annex F - ECC 200 symbol character placement)

Parameters
$nrow : int

Number of rows.

$ncol : int

Number of columns.

Return values
array<string|int, mixed>

lookAheadTest()

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

public lookAheadTest(string $data, int $pos, int $mode) : int
Parameters
$data : string

Data to encode

$pos : int

Current position

$mode : int

Current encoding mode

Return values
int

encoding mode

get255StateCodeword()

Return the 255-state codeword

protected get255StateCodeword(int $cdwpad, int $cdwpos) : int
Parameters
$cdwpad : int

Pad codeword.

$cdwpos : int

Number of data codewords from the beginning of encoded data.

Return values
int

pad codeword

getMaxDataCodewords()

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

protected getMaxDataCodewords(int $numcw) : number
Parameters
$numcw : int

Number of current codewords.

Return values
number

of data codewords in matrix

getSwitchEncodingCodeword()

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

protected getSwitchEncodingCodeword( $mode) : (int)
Parameters
$mode :

(int) New encoding mode.

Tags
protected
Return values
(int)

Switch codeword.

isASCIIEXTMode()

Tell if char is ASCII character 128 to 255

protected isASCIIEXTMode(int $chr) : bool
Parameters
$chr : int

Character (byte) to check.

Return values
bool

isASCIINUMMode()

Tell if char is ASCII digits

protected isASCIINUMMode(int $chr) : bool
Parameters
$chr : int

Character (byte) to check.

Return values
bool

isBASE256Mode()

Tell if char is Function character (FNC1, Structured Append, Reader Program, or Code Page)

protected isBASE256Mode(int $chr) : bool
Parameters
$chr : int

Character (byte) to check.

Return values
bool

isC40Mode()

Tell if char is Upper-case alphanumeric

protected isC40Mode(int $chr) : bool
Parameters
$chr : int

Character (byte) to check.

Return values
bool

isCharMode()

Returns true if the char belongs to the selected mode

protected isCharMode(int $chr, int $mode) : bool
Parameters
$chr : int

Character (byte) to check.

$mode : int

Current encoding mode.

Return values
bool

true if the char is of the selected mode.

isEDFMode()

Tell if char is ASCII character 32 to 94

protected isEDFMode(int $chr) : bool
Parameters
$chr : int

Character (byte) to check.

Return values
bool

isTXTMode()

Tell if char is Lower-case alphanumeric

protected isTXTMode(int $chr) : bool
Parameters
$chr : int

Character (byte) to check.

Return values
bool

isX12Mode()

Tell if char is ANSI X12

protected isX12Mode(int $chr) : bool
Parameters
$chr : int

Character (byte) to check.

Return values
bool

placeCornerA()

Places the 8 bits of the first special corner case.

protected placeCornerA(array<string|int, mixed> $marr, int $nrow, int $ncol, int &$chr, int $row, int $col) : array<string|int, mixed>

(Annex F - ECC 200 symbol character placement)

Parameters
$marr : array<string|int, mixed>

Array of symbols

$nrow : int

Number of rows

$ncol : int

Number of columns

$chr : int

Char byte

$row : int

Current row

$col : int

Current column

Return values
array<string|int, mixed>

placeCornerB()

Places the 8 bits of the second special corner case.

protected placeCornerB(array<string|int, mixed> $marr, int $nrow, int $ncol, int &$chr, int $row, int $col) : array<string|int, mixed>

(Annex F - ECC 200 symbol character placement)

Parameters
$marr : array<string|int, mixed>

Array of symbols

$nrow : int

Number of rows

$ncol : int

Number of columns

$chr : int

Char byte

$row : int

Current row

$col : int

Current column

Return values
array<string|int, mixed>

placeCornerC()

Places the 8 bits of the third special corner case.

protected placeCornerC(array<string|int, mixed> $marr, int $nrow, int $ncol, int &$chr, int $row, int $col) : array<string|int, mixed>

(Annex F - ECC 200 symbol character placement)

Parameters
$marr : array<string|int, mixed>

Array of symbols

$nrow : int

Number of rows

$ncol : int

Number of columns

$chr : int

Char byte

$row : int

Current row

$col : int

Current column

Return values
array<string|int, mixed>

placeCornerD()

Places the 8 bits of the fourth special corner case.

protected placeCornerD(array<string|int, mixed> $marr, int $nrow, int $ncol, int &$chr, int $row, int $col) : array<string|int, mixed>

(Annex F - ECC 200 symbol character placement)

Parameters
$marr : array<string|int, mixed>

Array of symbols

$nrow : int

Number of rows

$ncol : int

Number of columns

$chr : int

Char byte

$row : int

Current row

$col : int

Current column

Return values
array<string|int, mixed>

placeModule()

Places "chr+bit" with appropriate wrapping within array[].

protected placeModule(array<string|int, mixed> $marr, int $nrow, int $ncol, int $row, int $col, int $chr, int $bit) : array<string|int, mixed>

(Annex F - ECC 200 symbol character placement)

Parameters
$marr : array<string|int, mixed>

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.

Return values
array<string|int, mixed>

placeSweepDownward()

Sweep downward diagonally, inserting successive characters, (Annex F - ECC 200 symbol character placement)

protected placeSweepDownward(array<string|int, mixed> $marr, int $nrow, int $ncol, int &$chr, int &$row, int &$col) : array<string|int, mixed>
Parameters
$marr : array<string|int, mixed>

Array of symbols

$nrow : int

Number of rows

$ncol : int

Number of columns

$chr : int

Char byte

$row : int

Current row

$col : int

Current column

Return values
array<string|int, mixed>

placeSweepUpward()

Sweep upward diagonally, inserting successive characters, (Annex F - ECC 200 symbol character placement)

protected placeSweepUpward(array<string|int, mixed> $marr, int $nrow, int $ncol, int &$chr, int &$row, int &$col) : array<string|int, mixed>
Parameters
$marr : array<string|int, mixed>

Array of symbols

$nrow : int

Number of rows

$ncol : int

Number of columns

$chr : int

Char byte

$row : int

Current row

$col : int

Current column

Return values
array<string|int, mixed>

placeUtah()

Places the 8 bits of a utah-shaped symbol character.

protected placeUtah(array<string|int, mixed> $marr, int $nrow, int $ncol, int $row, int $col, int $chr) : array<string|int, mixed>

(Annex F - ECC 200 symbol character placement)

Parameters
$marr : array<string|int, mixed>

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.

Return values
array<string|int, mixed>

stepK()

Step K

protected stepK(int $numch) : int
Parameters
$numch : int
Return values
int

stepL()

Step L

protected stepL(int $chr, int &$numch) : mixed
Parameters
$chr : int
$numch : int
Return values
mixed

stepM()

Step M

protected stepM(int $chr, int &$numch) : mixed
Parameters
$chr : int
$numch : int
Return values
mixed

stepN()

Step N

protected stepN(int $chr, int &$numch) : mixed
Parameters
$chr : int
$numch : int
Return values
mixed

stepO()

Step O

protected stepO(int $chr, int &$numch) : mixed
Parameters
$chr : int
$numch : int
Return values
mixed

stepP()

Step P

protected stepP(int $chr, int &$numch) : mixed
Parameters
$chr : int
$numch : int
Return values
mixed

stepQ()

Step Q

protected stepQ(int $chr, int &$numch) : mixed
Parameters
$chr : int
$numch : int
Return values
mixed

stepR()

Step R

protected stepR(int $numch, int $pos, int $data_length, int $charscount, string $data) : mixed
Parameters
$numch : int
$pos : int
$data_length : int
$charscount : int
$data : string
Return values
mixed

stepRf()

Step R-f

protected stepRf(int $numch, int $pos, int $data_length, int $charscount, string $data) : int
Parameters
$numch : int
$pos : int
$data_length : int
$charscount : int
$data : string
Return values
int

Encoding mode

 

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