Encode

Symbol builder for the HanXin Barcode type class

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

class Encode extends Compaction

Extends: Compaction

Source: src/Type/Square/HanXin/Encode.php:37

Symbol builder for the HanXin Barcode type class

Methods

__construct()

Build the symbol.

public __construct(string $code, int $level, int $version, int $mask)

Parameters:

  • $code (string): Code to encode.
  • $level (int): Error correction level, from 1 to 4.
  • $version (int): Symbol version, from 1 to 84, or 0 to select the smallest symbol able to carry the data.
  • $mask (int): Data mask pattern reference, from 0 to 3, or a negative value to select the one with the lowest penalty score.

Throws:

Source: src/Type/Square/HanXin/Encode.php:114

getDataCodewords()

Returns the number of data codewords of a version and error correction level.

public static getDataCodewords(int $version, int $level): int

Parameters:

  • $version (int): Symbol version.
  • $level (int): Error correction level.

Returns: int

Source: src/Type/Square/HanXin/Encode.php:172

getGrid()

Returns the module matrix as an array of rows of binary digits.

public getGrid(): array<int,string>

Returns: array<int,string>

Source: src/Type/Square/HanXin/Encode.php:131

getLevel()

Returns the error correction level, from 1 to 4.

public getLevel(): int

Returns: int

Source: src/Type/Square/HanXin/Encode.php:152

getMask()

Returns the data mask pattern reference, from 0 to 3.

public getMask(): int

Returns: int

Source: src/Type/Square/HanXin/Encode.php:160

getTotalCodewords()

Returns the total number of codewords of a version and error correction level.

public static getTotalCodewords(int $version, int $level): int

Parameters:

  • $version (int): Symbol version.
  • $level (int): Error correction level.

Returns: int

Source: src/Type/Square/HanXin/Encode.php:189

getVersion()

Returns the symbol version, from 1 to 84.

public getVersion(): int

Returns: int

Source: src/Type/Square/HanXin/Encode.php:144