classes-Com-Tecnick-Barcode-Type-Square-QrCode-Encoder

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.

Encoder extends Init

Com\Tecnick\Barcode\Type\Square\QrCode\Encoder

Tags
since
2015-02-21
category

Library

author

Nicola Asuni info@tecnick.com

copyright

2010-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

$version  : int
QR code version.
$bit  : int
Single bit value
$blocks  : array<string|int, mixed>
Blocks
$bv1  : int
Value bv1
$count  : int
Counter
$datacode  : array<string|int, mixed>
Data code
$dataLength  : int
Data length
$dir  : int
Direction
$ecccode  : array<string|int, mixed>
Error correction code
$eccLength  : int
Error correction length
$frame  : array<string|int, mixed>
Frame
$level  : int
Error correction level
$qr_default_mask  : int
Default mask used when $this->qr_find_best_mask === false
$qr_find_best_mask  : bool
If true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code
$qr_find_from_random  : int
If false, checks all masks available, otherwise the value indicates the number of masks to be checked, mask id are random
$rsblocks  : array<string|int, mixed>
Reed-Solomon blocks
$rsitems  : mixed
Reed-Solomon items
$runLength  : array<string|int, mixed>
Run length
$spc  : Spec
Spec class object
$width  : int
Width.
$xpos  : int
Horizontal bit position
$ypos  : int
Vertical bit position
__construct()  : mixed
Initialize
encodeMask()  : array<string|int, mixed>
Encode mask
calcN1N3()  : int
Calc N1 N3
calcN1N3delta()  : int
Calc N1 N3 delta
checkRsCharParamsA()  : mixed
Check the params for the initRsChar and throws an exception in case of error.
checkRsCharParamsB()  : mixed
Check the params for the initRsChar and throws an exception in case of error.
encodeRsChar()  : array<string|int, mixed>
Encode a Reed-Solomon codec and returns the parity array
evaluateSymbol()  : int
Evaluate Symbol
evaluateSymbolB()  : int
Evaluate Symbol
generateMaskNo()  : array<string|int, mixed>
Return bit mask
getCode()  : array<string|int, mixed>
Return Reed-Solomon block code
getNextPosition()  : array<string|int, mixed>
Return the next frame position
getNextPositionB()  : mixed
Internal cycle for getNextPosition
init()  : mixed
Initialize code
initLoop()  : mixed
Internal loop for init
initRs()  : array<string|int, mixed>
Initialize a Reed-Solomon codec and add it to existing rsitems
initRsChar()  : array<string|int, mixed>
Initialize a Reed-Solomon codec and returns an array of values.
makeMask()  : array<string|int, mixed>
Make a mask
makeMaskNo()  : int
Make Mask Number
mask()  : array<string|int, mixed>
Get the best mask
mask0()  : int
Mask 0
mask1()  : int
Mask 1
mask2()  : int
Mask 2
mask3()  : int
Mask 3
mask4()  : int
Mask 4
mask5()  : int
Mask 5
mask6()  : int
Mask 6
mask7()  : int
Mask 7
modnn()  : int
modnn
setFrameAt()  : mixed
Set frame value at specified position
writeFormatInformation()  : int
Write Format Information on the frame and returns the number of black bits

Properties

$version

QR code version.

public int $version = 0

The Size of QRcode is defined as version. Version is an integer value from 1 to 40. Version 1 is 2121 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177177 matrix.

$bit

Single bit value

protected int $bit

$blocks

Blocks

protected array<string|int, mixed> $blocks

$datacode

Data code

protected array<string|int, mixed> $datacode = array()

$dataLength

Data length

protected int $dataLength

$ecccode

Error correction code

protected array<string|int, mixed> $ecccode = array()

$eccLength

Error correction length

protected int $eccLength

$frame

Frame

protected array<string|int, mixed> $frame

$level

Error correction level

protected int $level = 0

$qr_default_mask

Default mask used when $this->qr_find_best_mask === false

protected int $qr_default_mask = 2

$qr_find_best_mask

If true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code

protected bool $qr_find_best_mask = true

$qr_find_from_random

If false, checks all masks available, otherwise the value indicates the number of masks to be checked, mask id are random

protected int $qr_find_from_random = false

$rsblocks

Reed-Solomon blocks

protected array<string|int, mixed> $rsblocks = array()

$rsitems

Reed-Solomon items

protected mixed $rsitems = array()
Tags
va

array

$runLength

Run length

protected array<string|int, mixed> $runLength = array()

$xpos

Horizontal bit position

protected int $xpos

$ypos

Vertical bit position

protected int $ypos

Methods

__construct()

Initialize

public __construct(int $version, int $level[, bool $random_mask = false ][, bool $best_mask = true ][, int $default_mask = 2 ]) : mixed
Parameters
$version : int

Code version

$level : int

Error Correction Level

$random_mask : bool = false

If false, checks all masks available, otherwise the value indicates the number of masks to be checked, mask id are random

$best_mask : bool = true

If true, estimates best mask (slow)

$default_mask : int = 2

Default mask used when $fbm is false

Return values
mixed

encodeMask()

Encode mask

public encodeMask(int $maskNo, array<string|int, mixed> $datacode) : array<string|int, mixed>
Parameters
$maskNo : int

Mask number (masking mode)

$datacode : array<string|int, mixed>

Data code to encode

Return values
array<string|int, mixed>

Encoded Mask

calcN1N3()

Calc N1 N3

protected calcN1N3(int $length) : int
Parameters
$length : int
Return values
int

demerit

calcN1N3delta()

Calc N1 N3 delta

protected calcN1N3delta(int $length, int $idx) : int
Parameters
$length : int
$idx : int
Return values
int

demerit delta

checkRsCharParamsA()

Check the params for the initRsChar and throws an exception in case of error.

protected checkRsCharParamsA(int $symsize, int $fcr, int $prim) : mixed
Parameters
$symsize : int

Symbol size, bits

$fcr : int

First root of RS code generator polynomial, index form

$prim : int

Primitive element to generate polynomial roots

Tags
throws
Exception

in case of error

Return values
mixed

checkRsCharParamsB()

Check the params for the initRsChar and throws an exception in case of error.

protected checkRsCharParamsB(int $symsize, int $nroots, int $pad) : mixed
Parameters
$symsize : int

Symbol size, bits

$nroots : int

RS code generator polynomial degree (number of roots)

$pad : int

Padding bytes at front of shortened block

Tags
throws
Exception

in case of error

Return values
mixed

encodeRsChar()

Encode a Reed-Solomon codec and returns the parity array

protected encodeRsChar(array<string|int, mixed> $rsv, array<string|int, mixed> $data, array<string|int, mixed> $parity) : array<string|int, mixed>
Parameters
$rsv : array<string|int, mixed>

RS values

$data : array<string|int, mixed>

Data

$parity : array<string|int, mixed>

Parity

Return values
array<string|int, mixed>

Parity array

evaluateSymbol()

Evaluate Symbol

protected evaluateSymbol(int $width, array<string|int, mixed> $frame) : int
Parameters
$width : int

Width

$frame : array<string|int, mixed>

Frame

Return values
int

demerit

evaluateSymbolB()

Evaluate Symbol

protected evaluateSymbolB(int $ypos, int $width, array<string|int, mixed> $frameY, array<string|int, mixed> $frameYM) : int
Parameters
$ypos : int

Y position

$width : int

Width

$frameY : array<string|int, mixed>
$frameYM : array<string|int, mixed>
Return values
int

demerit

generateMaskNo()

Return bit mask

protected generateMaskNo(int $maskNo, int $width, array<string|int, mixed> $frame) : array<string|int, mixed>
Parameters
$maskNo : int

Mask number

$width : int

Width

$frame : array<string|int, mixed>

Frame

Return values
array<string|int, mixed>

bit mask

getCode()

Return Reed-Solomon block code

protected getCode() : array<string|int, mixed>
Return values
array<string|int, mixed>

rsblocks

getNextPosition()

Return the next frame position

protected getNextPosition() : array<string|int, mixed>
Return values
array<string|int, mixed>

of x,y coordinates

getNextPositionB()

Internal cycle for getNextPosition

protected getNextPositionB(int &$xpos, int &$ypos, int $wdt) : mixed
Parameters
$xpos : int
$ypos : int
$wdt : int
Return values
mixed

init()

Initialize code

protected init(array<string|int, mixed> $spec) : mixed
Parameters
$spec : array<string|int, mixed>

Array of ECC specification

Return values
mixed

initLoop()

Internal loop for init

protected initLoop(int $endfor, int $dlv, int $elv, int $rsv, int &$eccPos, int &$blockNo, int &$dataPos, int &$ecc) : mixed
Parameters
$endfor : int
$dlv : int
$elv : int
$rsv : int
$eccPos : int
$blockNo : int
$dataPos : int
$ecc : int
Return values
mixed

initRs()

Initialize a Reed-Solomon codec and add it to existing rsitems

protected initRs(int $symsize, int $gfpoly, int $fcr, int $prim, int $nroots, int $pad) : array<string|int, mixed>
Parameters
$symsize : int

Symbol size, bits

$gfpoly : int

Field generator polynomial coefficients

$fcr : int

First root of RS code generator polynomial, index form

$prim : int

Primitive element to generate polynomial roots

$nroots : int

RS code generator polynomial degree (number of roots)

$pad : int

Padding bytes at front of shortened block

Return values
array<string|int, mixed>

Array of RS values: mm = Bits per symbol; nn = Symbols per block; alpha_to = log lookup table array; index_of = Antilog lookup table array; genpoly = Generator polynomial array; nroots = Number of generator; roots = number of parity symbols; fcr = First consecutive root, index form; prim = Primitive element, index form; iprim = prim-th root of 1, index form; pad = Padding bytes in shortened block; gfpoly.

initRsChar()

Initialize a Reed-Solomon codec and returns an array of values.

protected initRsChar(int $symsize, int $gfpoly, int $fcr, int $prim, int $nroots, int $pad) : array<string|int, mixed>
Parameters
$symsize : int

Symbol size, bits

$gfpoly : int

Field generator polynomial coefficients

$fcr : int

First root of RS code generator polynomial, index form

$prim : int

Primitive element to generate polynomial roots

$nroots : int

RS code generator polynomial degree (number of roots)

$pad : int

Padding bytes at front of shortened block

Return values
array<string|int, mixed>

Array of RS values: mm = Bits per symbol; nn = Symbols per block; alpha_to = log lookup table array; index_of = Antilog lookup table array; genpoly = Generator polynomial array; nroots = Number of generator; roots = number of parity symbols; fcr = First consecutive root, index form; prim = Primitive element, index form; iprim = prim-th root of 1, index form; pad = Padding bytes in shortened block; gfpoly.

makeMask()

Make a mask

protected makeMask(int $width, array<string|int, mixed> $frame, int $maskNo, int $level) : array<string|int, mixed>
Parameters
$width : int

Mask width

$frame : array<string|int, mixed>

Frame

$maskNo : int

Mask number

$level : int

Error Correction level

Return values
array<string|int, mixed>

mask

makeMaskNo()

Make Mask Number

protected makeMaskNo(int $maskNo, int $width, int $frame, int &$mask) : int
Parameters
$maskNo : int

Mask number

$width : int

Width

$frame : int

Frame

$mask : int

Mask

Return values
int

mask number

mask()

Get the best mask

protected mask(int $width, array<string|int, mixed> $frame, int $level) : array<string|int, mixed>
Parameters
$width : int

Width

$frame : array<string|int, mixed>

Frame

$level : int

Error Correction lLevel

Return values
array<string|int, mixed>

best mask

mask0()

Mask 0

protected mask0(int $xpos, int $ypos) : int
Parameters
$xpos : int

X position

$ypos : int

Y position

Return values
int

mask

mask1()

Mask 1

protected mask1(int $xpos, int $ypos) : int
Parameters
$xpos : int

X position

$ypos : int

Y position

Return values
int

mask

mask2()

Mask 2

protected mask2(int $xpos, int $ypos) : int
Parameters
$xpos : int

X position

$ypos : int

Y position

Return values
int

mask

mask3()

Mask 3

protected mask3(int $xpos, int $ypos) : int
Parameters
$xpos : int

X position

$ypos : int

Y position

Return values
int

mask

mask4()

Mask 4

protected mask4(int $xpos, int $ypos) : int
Parameters
$xpos : int

X position

$ypos : int

Y position

Return values
int

mask

mask5()

Mask 5

protected mask5(int $xpos, int $ypos) : int
Parameters
$xpos : int

X position

$ypos : int

Y position

Return values
int

mask

mask6()

Mask 6

protected mask6(int $xpos, int $ypos) : int
Parameters
$xpos : int

X position

$ypos : int

Y position

Return values
int

mask

mask7()

Mask 7

protected mask7(int $xpos, int $ypos) : int
Parameters
$xpos : int

X position

$ypos : int

Y position

Return values
int

mask

modnn()

modnn

protected modnn(array<string|int, mixed> $rsv, int $xpos) : int
Parameters
$rsv : array<string|int, mixed>

RS values

$xpos : int

X position

Return values
int

X position

setFrameAt()

Set frame value at specified position

protected setFrameAt(array<string|int, mixed> $pos, int $val) : mixed
Parameters
$pos : array<string|int, mixed>

X,Y position

$val : int

Value of the character to set

Return values
mixed

writeFormatInformation()

Write Format Information on the frame and returns the number of black bits

protected writeFormatInformation(int $width, array<string|int, mixed> &$frame, int $maskNo, int $level) : int
Parameters
$width : int

Mask width

$frame : array<string|int, mixed>

Frame

$maskNo : int

Mask number

$level : int

Error Correction level

Return values
int

blacks

 

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