QRDecoders

Documentation for QRDecoders.

QRDecoders.EuclideanType
Euclidean <: ReedSolomonAlgorithm

Euclidean algorithm for error correction.

QRDecoders.InfoErrorType
InfoError <: Exception

The non-data part of QR-matrix contains error.

For example, Finder pattern, Alignment pattern, Timing pattern, Format information, Version information, matrix size and etc.

QRDecoders.correct_messageMethod
correct_message(msgblock::AbstractVector
               , ecblock::AbstractVector
               , alg::ReedSolomonAlgorithm
               ; noerror::Bool=false)

Error correction of the message block using the given algorithm.

Throw DecodeError if the value noerror is true and the message need error correction.

QRDecoders.decodedataMethod
decodedata(bits::AbstractVector, msglen::Int, ::Mode)

Decode message from bits without checking the pad_bits.

QRDecoders.decodemodeMethod
decodemode(bits::AbstractVector)

Decode mode from the bits of length 4. Note: the Byte mode and the UTF8 mode use the same mode indicator(0100).

QRDecoders.deinterleaveMethod
deinterleave(bytes::AbstractVector, ec::ErrCorrLevel, version::Int)

De-interleave the message, i.e. sperate msgblocks and ecblocks from data bits.

QRDecoders.extract_databitsMethod
extract_databits(mat::AbstractMatrix, datapos::AbstractMatrix)

Extract data bits from the QR-Code.(Inverse procedure of placedata!)

QRDecoders.getalterposMethod
getalterpos(array::AbstractVector)

Get the switch-value indexes of the input array. It can be used for detecting the finder patterns.

Examples

julis> using QRDecoders: getalterpos
julia> array = Bool[1,1,0,0,0,1,1,0]
julia> getalterpos(array)
3-element Vector{Int64}:
 2
 5
 7
QRDecoders.getqrmatrixMethod
getqrmatrix(img)

Get the QR-code matrix from an image.

Note that the input must be a standard QR-code image with or without white border, i.e. the image should not contain any other non-QR-Code information.

QRDecoders.qrdecodeMethod
qrdecode(mat::AbstractMatrix
        ; noerror::Bool=false
        , preferutf8::Bool=true
        , alg::ReedSolomonAlgorithm=Euclidean()
        )::QRInfo

QR code decoder.

If noerror is true, the decoder will raise an Exception(ReedSolomonError/InfoError) when the QR code mat needs error correction.

If preferutf8 is true, the decoder will try to decode the message by UTF8 mode when dealing with Byte mode.

The error correction algorithm is specified by the variable alg(default: Euclidean).

QRDecoders.qrdecodeMethod
qrdecode(path::AbstractString; keywords...)

QR code decoder.

For more information of the keywords, see qrdecode(mat::AbstractMatrix; keywords...).

QRDecoders.qrdecode_formatMethod
qrdecode_format(mat::AbstractMatrix; noerror=false)

Return the format of the QR-Code(ErrCorrLevel + mask).

QRDecoders.qrdecode_versionMethod
qrdecode_version(mat::AbstractMatrix; noerror=false)

Return the version of the QR-Code.(Matrix to Integer)

QRDecoders.qrdecomposeMethod
qrdecompose(mat::AbstractMatrix, noerror=false)

Decompose the QR-Code into its constituent parts.

QRDecoders.trybyteMethod
trybyte(bits::AbstractVector, msglen::Int)

Try decoding message by Byte mode, where bits = message_bits + pad_bits. Return true if the pad_bits is correct.

QRDecoders.tryutf8Method
tryutf8(bits::AbstractVector, msglen::Int)

Try decoding message by utf-8 mode.