Modes

Modes for Datamatrix Barcode type class

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

abstract class Modes extends Placement

Extends: Placement

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

Modes for Datamatrix Barcode type class

Properties

$gsonemode

True when the GS1 variant is selected and FNC1 separators are encoded as codeword 232.

public bool $gsonemode = false

Source: src/Type/Square/Datamatrix/Modes.php:74

$last_enc

Store last used encoding for data codewords.

public int $last_enc = 0

Source: src/Type/Square/Datamatrix/Modes.php:57

$shape

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

public string $shape

Source: src/Type/Square/Datamatrix/Modes.php:62

$size

Requested symbol size as rows by columns, empty for the smallest size that fits. The encodation termination rules depend on how many codewords the symbol holds, so they need the requested size and not the smallest.

public string $size = ''

Source: src/Type/Square/Datamatrix/Modes.php:69

Methods

canStartEncodation()

Returns true if the encodation can start on the character.

C40, Text and Base 256 encode every character; X12 and EDIFACT only their own sets.

public canStartEncodation(int $chr, int $mode): bool

Parameters:

  • $chr (int): Character (byte) to check.
  • $mode (int): Encoding mode.

Returns: bool

Source: src/Type/Square/Datamatrix/Modes.php:151

get253StateCodeword()

Return the 253-state codeword

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

Parameters:

  • $cdwpad (int): Pad codeword.
  • $cdwpos (int): Number of data codewords from the beginning of encoded data.

Returns: int

Source: src/Type/Square/Datamatrix/Modes.php:93

getSwitchEncodingCodeword()

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

public getSwitchEncodingCodeword(int $mode): int

Parameters:

  • $mode (int): New encoding mode.

Returns: int: Switch codeword.

Source: src/Type/Square/Datamatrix/Modes.php:279

isGsOneChar()

Tell if the character is a GS1 separator: FNC1 (232) or GS (29).

Only meaningful when the GS1 variant is selected.

public isGsOneChar(int $chr): bool

Parameters:

  • $chr (int): Character (byte) to check.

Returns: bool

Source: src/Type/Square/Datamatrix/Modes.php:82

Inherited members

From Placement