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

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.

ByteStream extends Encode

Com\Tecnick\Barcode\Type\Square\QrCode\ByteStream

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.
$hint  : int
Encoding mode
$level  : int
Error correction level
__construct()  : mixed
Initialize
appendNewInputItem()  : array<string|int, mixed>
Append data to an input object.
encodeBitStream()  : array<string|int, mixed>
Encode BitStream
estimateBitsMode8()  : int
estimateBitsMode8
estimateBitsModeAn()  : int
estimateBitsModeAn
estimateBitsModeKanji()  : int
estimateBitsModeKanji
estimateBitsModeNum()  : int
estimateBitsModeNum
estimateVersion()  : int
Estimate version
getByteStream()  : array<string|int, mixed>
Pack all bit streams padding bits into a byte array
getEncodingMode()  : int
Get the encoding mode to use
getLengthIndicator()  : int
Return the size of length indicator for the mode and version
isAlphanumericAt()  : bool
Return true if the character at specified position is an alphanumeric character
isDigitAt()  : bool
Return true if the character at specified position is a number
lookAnTable()  : value
Look up the alphabet-numeric conversion table (see JIS X0510:2004, pp.19)
allocate()  : array<string|int, mixed>
Return an array with zeros
appendBitstream()  : array<string|int, mixed>
Append one bitstream to another
appendBytes()  : array<string|int, mixed>
Append one bitstream created from bytes to another
appendNum()  : array<string|int, mixed>
Append one bitstream created from number to another
appendPaddingBit()  : array<string|int, mixed>
Append Padding Bit to bitstream
bitstreamToByte()  : array<string|int, mixed>
Convert bitstream to bytes
check()  : bool
Validate the input data.
checkModeAn()  : bool
checkModeAn
checkModeKanji()  : bool
checkModeKanji
checkModeNum()  : bool
checkModeNum
convertData()  : array<string|int, mixed>
convertData
createBitStream()  : array<string|int, mixed>
Create BitStream
encodeMode8()  : array<string|int, mixed>
encode Mode 8
encodeModeAn()  : array<string|int, mixed>
encode Mode An
encodeModeKanji()  : array<string|int, mixed>
encode Mode Kanji
encodeModeNum()  : array<string|int, mixed>
encode Mode Num
encodeModeStructure()  : array<string|int, mixed>
encode Mode Structure
estimateBitStreamSize()  : int
estimateBitStreamSize
getEncodingModeKj()  : int
Get the encoding mode for KJ or 8B
getMinimumVersion()  : int
Return a version number that satisfies the input code length.
mergeBitStream()  : array<string|int, mixed>
merge the bit stream
newFromBytes()  : array<string|int, mixed>
Return new bitstream from bytes
newFromNum()  : array<string|int, mixed>
Return new bitstream from number
newInputItem()  : array<string|int, mixed>
newInputItem

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.

$level

Error correction level

protected int $level = 0

Methods

__construct()

Initialize

public __construct(int $hint, int $version, int $level) : mixed
Parameters
$hint : int

Encoding mode

$version : int

Code version

$level : int

Error Correction Level

Return values
mixed

appendNewInputItem()

Append data to an input object.

public appendNewInputItem(array<string|int, mixed> $items, int $mode, int $size, array<string|int, mixed> $data) : array<string|int, mixed>

The data is copied and appended to the input object.

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

Input items

$mode : int

Encoding mode.

$size : int

Size of data (byte).

$data : array<string|int, mixed>

Array of input data.

Return values
array<string|int, mixed>

items

encodeBitStream()

Encode BitStream

public encodeBitStream(array<string|int, mixed> $inputitem, int $version) : array<string|int, mixed>
Parameters
$inputitem : array<string|int, mixed>
$version : int
Return values
array<string|int, mixed>

input item

estimateBitsMode8()

estimateBitsMode8

public estimateBitsMode8(int $size) : int
Parameters
$size : int
Return values
int

number of bits

estimateBitsModeAn()

estimateBitsModeAn

public estimateBitsModeAn(int $size) : int
Parameters
$size : int
Return values
int

number of bits

estimateBitsModeKanji()

estimateBitsModeKanji

public estimateBitsModeKanji(int $size) : int
Parameters
$size : int
Return values
int

number of bits

estimateBitsModeNum()

estimateBitsModeNum

public estimateBitsModeNum(int $size) : int
Parameters
$size : int
Return values
int

number of bits

estimateVersion()

Estimate version

public estimateVersion(array<string|int, mixed> $items, int $level) : int
Parameters
$items : array<string|int, mixed>
$level : int
Return values
int

version

getByteStream()

Pack all bit streams padding bits into a byte array

public getByteStream(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>

items

Return values
array<string|int, mixed>

padded merged byte stream

getEncodingMode()

Get the encoding mode to use

public getEncodingMode(string $data, int $pos) : int
Parameters
$data : string

Data

$pos : int

Position

Return values
int

mode

getLengthIndicator()

Return the size of length indicator for the mode and version

public getLengthIndicator(int $mode) : int
Parameters
$mode : int

Encoding mode

Return values
int

the size of the appropriate length indicator (bits).

isAlphanumericAt()

Return true if the character at specified position is an alphanumeric character

public isAlphanumericAt(string $str, int $pos) : bool
Parameters
$str : string

Data

$pos : int

Character position

Return values
bool

isDigitAt()

Return true if the character at specified position is a number

public isDigitAt(string $str, int $pos) : bool
Parameters
$str : string

Data

$pos : int

Character position

Return values
bool

lookAnTable()

Look up the alphabet-numeric conversion table (see JIS X0510:2004, pp.19)

public lookAnTable(int $chr) : value
Parameters
$chr : int

Character value

Return values
value

allocate()

Return an array with zeros

protected allocate(int $setLength) : array<string|int, mixed>
Parameters
$setLength : int

Array size

Return values
array<string|int, mixed>

appendBitstream()

Append one bitstream to another

protected appendBitstream(array<string|int, mixed> $bitstream, array<string|int, mixed> $append) : array<string|int, mixed>
Parameters
$bitstream : array<string|int, mixed>

Original bitstream

$append : array<string|int, mixed>

Bitstream to append

Return values
array<string|int, mixed>

bitstream

appendBytes()

Append one bitstream created from bytes to another

protected appendBytes(array<string|int, mixed> $bitstream, int $size, array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$bitstream : array<string|int, mixed>

Original bitstream

$size : int

Size

$data : array<string|int, mixed>

Bytes

Return values
array<string|int, mixed>

bitstream

appendNum()

Append one bitstream created from number to another

protected appendNum(array<string|int, mixed> $bitstream, int $bits, int $num) : array<string|int, mixed>
Parameters
$bitstream : array<string|int, mixed>

Original bitstream

$bits : int

Number of bits

$num : int

Number

Return values
array<string|int, mixed>

bitstream

appendPaddingBit()

Append Padding Bit to bitstream

protected appendPaddingBit(array<string|int, mixed> $bstream) : array<string|int, mixed>
Parameters
$bstream : array<string|int, mixed>

Bit stream

Return values
array<string|int, mixed>

bitstream

bitstreamToByte()

Convert bitstream to bytes

protected bitstreamToByte(array<string|int, mixed> $bstream) : array<string|int, mixed>
Parameters
$bstream : array<string|int, mixed>

Original bitstream

Return values
array<string|int, mixed>

of bytes

check()

Validate the input data.

protected check(int $mode, int $size, array<string|int, mixed> $data) : bool
Parameters
$mode : int

Encoding mode.

$size : int

Size of data (byte).

$data : array<string|int, mixed>

Data to validate

Return values
bool

true in case of valid data, false otherwise

checkModeAn()

checkModeAn

protected checkModeAn(int $size, int $data) : bool
Parameters
$size : int
$data : int
Return values
bool

true or false

checkModeKanji()

checkModeKanji

protected checkModeKanji(int $size, int $data) : bool
Parameters
$size : int
$data : int
Return values
bool

true or false

checkModeNum()

checkModeNum

protected checkModeNum(int $size, int $data) : bool
Parameters
$size : int
$data : int
Return values
bool

true or false

convertData()

convertData

protected convertData(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>

Items

Return values
array<string|int, mixed>

items

createBitStream()

Create BitStream

protected createBitStream( $items) : array<string|int, mixed>
Parameters
$items :
Return values
array<string|int, mixed>

of items and total bits

encodeMode8()

encode Mode 8

protected encodeMode8(array<string|int, mixed> $inputitem, int $version) : array<string|int, mixed>
Parameters
$inputitem : array<string|int, mixed>
$version : int
Return values
array<string|int, mixed>

input item

encodeModeAn()

encode Mode An

protected encodeModeAn(array<string|int, mixed> $inputitem, int $version) : array<string|int, mixed>
Parameters
$inputitem : array<string|int, mixed>
$version : int
Return values
array<string|int, mixed>

input item

encodeModeKanji()

encode Mode Kanji

protected encodeModeKanji(array<string|int, mixed> $inputitem, int $version) : array<string|int, mixed>
Parameters
$inputitem : array<string|int, mixed>
$version : int
Return values
array<string|int, mixed>

input item

encodeModeNum()

encode Mode Num

protected encodeModeNum(array<string|int, mixed> $inputitem, int $version) : array<string|int, mixed>
Parameters
$inputitem : array<string|int, mixed>
$version : int
Return values
array<string|int, mixed>

input item

encodeModeStructure()

encode Mode Structure

protected encodeModeStructure(array<string|int, mixed> $inputitem) : array<string|int, mixed>
Parameters
$inputitem : array<string|int, mixed>
Return values
array<string|int, mixed>

input item

estimateBitStreamSize()

estimateBitStreamSize

protected estimateBitStreamSize(array<string|int, mixed> $items, int $version) : int
Parameters
$items : array<string|int, mixed>
$version : int
Return values
int

bits

getEncodingModeKj()

Get the encoding mode for KJ or 8B

protected getEncodingModeKj(string $data, int $pos) : int
Parameters
$data : string

Data

$pos : int

Position

Return values
int

mode

getMinimumVersion()

Return a version number that satisfies the input code length.

protected getMinimumVersion(int $size, int $level) : int
Parameters
$size : int

Input code length (bytes)

$level : int

Error correction level

Tags
throws
Exception
Return values
int

version number

mergeBitStream()

merge the bit stream

protected mergeBitStream(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>

Items

Return values
array<string|int, mixed>

bitstream

newFromBytes()

Return new bitstream from bytes

protected newFromBytes(int $size, array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$size : int

Size

$data : array<string|int, mixed>

Bytes

Return values
array<string|int, mixed>

bitstream

newFromNum()

Return new bitstream from number

protected newFromNum(int $bits, int $num) : array<string|int, mixed>
Parameters
$bits : int

Number of bits

$num : int

Number

Return values
array<string|int, mixed>

bitstream

newInputItem()

newInputItem

protected newInputItem(int $mode, int $size, array<string|int, mixed> $data[, array<string|int, mixed> $bstream = null ]) : array<string|int, mixed>
Parameters
$mode : int

Encoding mode.

$size : int

Size of data (byte).

$data : array<string|int, mixed>

Array of input data.

$bstream : array<string|int, mixed> = null

Binary stream

Return values
array<string|int, mixed>

input item

 

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