Encode

Encode methods for Datamatrix Barcode type class

Namespace: Com\Tecnick\Barcode\Type\Square\Datamatrix

class Encode extends EncodeTxt

Extends: EncodeTxt

Source: src/Type/Square/Datamatrix/Encode.php:34

Encode methods for Datamatrix Barcode type class

Methods

__construct()

Initialize a new encode object

public __construct(string $shape = 'S', bool $gsonemode = false, string $size = '')

Parameters:

  • $shape (string): Datamatrix shape key (S=square, R=rectangular)
  • $gsonemode (bool): True to encode the FNC1 and GS characters as the FNC1 codeword
  • $size (string): Requested symbol size as rows by columns, empty for the smallest that fits

Source: src/Type/Square/Datamatrix/Encode.php:51

encodeASCII()

Encode ASCII

public encodeASCII(
    array<int,int> &$cdw,
    int &$cdw_num,
    int &$pos,
    int &$data_length,
    string &$data,
    int &$enc
): void

Parameters:

  • $cdw (array<int,int>): Codewords array
  • $cdw_num (int): Codewords number
  • $pos (int): Current position
  • $data_length (int): Data length
  • $data (string): Data string
  • $enc (int): Current encoding

Source: src/Type/Square/Datamatrix/Encode.php:68

encodeBase256()

Encode Base256

public encodeBase256(
    array<int,int> &$cdw,
    int &$cdw_num,
    int &$pos,
    int &$data_length,
    int &$field_length,
    string &$data,
    int &$enc
): void

Parameters:

  • $cdw (array<int,int>): Codewords array
  • $cdw_num (int): Codewords number
  • $pos (int): Current position
  • $data_length (int): Data length
  • $field_length (int): Field length
  • $data (string): Data string
  • $enc (int): Current encoding

Source: src/Type/Square/Datamatrix/Encode.php:299

encodeEDF()

Encode EDF

public encodeEDF(
    array<int,int> &$cdw,
    int &$cdw_num,
    int &$pos,
    int &$data_length,
    int &$field_length,
    string &$data,
    int &$enc
): void

Parameters:

  • $cdw (array<int,int>): Codewords array
  • $cdw_num (int): Codewords number
  • $pos (int): Current position
  • $data_length (int): Data length
  • $field_length (int): Field length
  • $data (string): Data string
  • $enc (int): Current encoding

Source: src/Type/Square/Datamatrix/Encode.php:257

encodeEDFfour()

Encode EDF4

public encodeEDFfour(
    int $epos,
    array<int,int> &$cdw,
    int &$cdw_num,
    int &$pos,
    int &$data_length,
    int &$field_length,
    int &$enc,
    array<int,int> &$temp_cw,
    string $data
): bool

Parameters:

  • $epos (int): Current position
  • $cdw (array<int,int>): Codewords array
  • $cdw_num (int): Codewords number
  • $pos (int): Current position
  • $data_length (int): Data length
  • $field_length (int): Field length
  • $enc (int): Current encoding
  • $temp_cw (array<int,int>): Temporary codewords array
  • $data (string): Data string

Returns: bool: true to break the loop

Throws:

Source: src/Type/Square/Datamatrix/Encode.php:168

Inherited members

From EncodeTxt

From Modes

  • $gsonemode: True when the GS1 variant is selected and FNC1 separators are encoded as codeword 232.
  • $last_enc: Store last used encoding for data codewords.
  • $shape: Datamatrix shape key (S=square, R=rectangular)
  • $size: Requested symbol size as rows by columns, empty for the smallest size that fits.
  • canStartEncodation(): Returns true if the encodation can start on the character.
  • get253StateCodeword(): Return the 253-state codeword
  • getSwitchEncodingCodeword(): Get the switching codeword to a new encoding mode (latch codeword)
  • isGsOneChar(): Tell if the character is a GS1 separator: FNC1 (232) or GS (29).

From Placement

From Steps

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