C# Класс ZXing.QrCode.Internal.Encoder

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
chooseMode ( String content ) : Mode

Chooses the mode.

encode ( String content, ErrorCorrectionLevel ecLevel ) : QRCode

Encode "bytes" with the error correction level "ecLevel". The encoding mode will be chosen internally by chooseMode(). On success, store the result in "qrCode". We recommend you to use QRCode.EC_LEVEL_L (the lowest level) for "getECLevel" since our primary use is to show QR code on desktop screens. We don't need very strong error correction for this purpose. Note that there is no way to encode bytes in MODE_KANJI. We might want to add EncodeWithMode() with which clients can specify the encoding mode. For now, we don't need the functionality.

encode ( String content, ErrorCorrectionLevel ecLevel, object>.IDictionary hints ) : QRCode

Encodes the specified content.

Приватные методы

Метод Описание
append8BitBytes ( String content, BitArray bits, String encoding ) : void
appendAlphanumericBytes ( String content, BitArray bits ) : void
appendBytes ( String content, Mode mode, BitArray bits, String encoding ) : void

Append "bytes" in "mode" mode (encoding) into "bits". On success, store the result in "bits".

appendECI ( CharacterSetECI eci, BitArray bits ) : void
appendKanjiBytes ( String content, BitArray bits ) : void
appendLengthInfo ( int numLetters, Version version, Mode mode, BitArray bits ) : void

Append length info. On success, store the result in "bits".

appendModeInfo ( Mode mode, BitArray bits ) : void

Append mode info. On success, store the result in "bits".

appendNumericBytes ( String content, BitArray bits ) : void
calculateMaskPenalty ( ByteMatrix matrix ) : int
chooseMaskPattern ( BitArray bits, ErrorCorrectionLevel ecLevel, Version version, ByteMatrix matrix ) : int
chooseMode ( String content, String encoding ) : Mode

Choose the best mode by examining the content. Note that 'encoding' is used as a hint; if it is Shift_JIS, and the input is only double-byte Kanji, then we return {@link Mode#KANJI}.

chooseVersion ( int numInputBits, ErrorCorrectionLevel ecLevel ) : Version
generateECBytes ( byte dataBytes, int numEcBytesInBlock ) : byte[]
getAlphanumericCode ( int code ) : int

Gets the alphanumeric code.

getNumDataBytesAndNumECBytesForBlockID ( int numTotalBytes, int numDataBytes, int numRSBlocks, int blockID, int numDataBytesInBlock, int numECBytesInBlock ) : void

Get number of data bytes and number of error correction bytes for block id "blockID". Store the result in "numDataBytesInBlock", and "numECBytesInBlock". See table 12 in 8.5.1 of JISX0510:2004 (p.30)

interleaveWithECBytes ( BitArray bits, int numTotalBytes, int numDataBytes, int numRSBlocks ) : BitArray

Interleave "bits" with corresponding error correction bytes. On success, store the result in "result". The interleave rule is complicated. See 8.6 of JISX0510:2004 (p.37) for details.

isOnlyDoubleByteKanji ( String content ) : bool
terminateBits ( int numDataBytes, BitArray bits ) : void

Terminate bits as described in 8.4.8 and 8.4.9 of JISX0510:2004 (p.24).

Описание методов

chooseMode() публичный статический метод

Chooses the mode.
public static chooseMode ( String content ) : Mode
content String The content.
Результат Mode

encode() публичный статический метод

Encode "bytes" with the error correction level "ecLevel". The encoding mode will be chosen internally by chooseMode(). On success, store the result in "qrCode". We recommend you to use QRCode.EC_LEVEL_L (the lowest level) for "getECLevel" since our primary use is to show QR code on desktop screens. We don't need very strong error correction for this purpose. Note that there is no way to encode bytes in MODE_KANJI. We might want to add EncodeWithMode() with which clients can specify the encoding mode. For now, we don't need the functionality.
public static encode ( String content, ErrorCorrectionLevel ecLevel ) : QRCode
content String text to encode
ecLevel ErrorCorrectionLevel error correction level to use
Результат QRCode

encode() публичный статический метод

Encodes the specified content.
public static encode ( String content, ErrorCorrectionLevel ecLevel, object>.IDictionary hints ) : QRCode
content String The content.
ecLevel ErrorCorrectionLevel The ec level.
hints object>.IDictionary The hints.
Результат QRCode