Encoder

object Encoder

Properties

Functions

Link copied to clipboard
fun append8BitBytes(content: String, bits: BitArray, encoding: KiteCharset)
Link copied to clipboard
Link copied to clipboard
fun appendBytes(content: String, mode: Mode, bits: BitArray, encoding: KiteCharset)

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

Link copied to clipboard
fun appendKanjiBytes(content: String, bits: BitArray)
Link copied to clipboard
fun appendLengthInfo(numLetters: Int, version: Version, mode: Mode, bits: BitArray)

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

Link copied to clipboard
fun appendModeInfo(mode: Mode, bits: BitArray)

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

Link copied to clipboard
Link copied to clipboard
fun chooseMode(content: String): Mode
Link copied to clipboard
fun encode(content: String, ecLevel: ErrorCorrectionLevel): QRCode
fun encode(content: String, ecLevel: ErrorCorrectionLevel, hints: Map<EncodeHintType, Any?>?): QRCode
Link copied to clipboard
fun generateECBytes(dataBytes: ByteArray, numEcBytesInBlock: Int): ByteArray
Link copied to clipboard
Link copied to clipboard
fun getNumDataBytesAndNumECBytesForBlockID(numTotalBytes: Int, numDataBytes: Int, numRSBlocks: Int, blockID: Int, numDataBytesInBlock: IntArray, numECBytesInBlock: IntArray)

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)

Link copied to clipboard
fun interleaveWithECBytes(bits: BitArray, numTotalBytes: Int, numDataBytes: Int, numRSBlocks: Int): 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.

Link copied to clipboard
Link copied to clipboard
fun terminateBits(numDataBytes: Int, bits: BitArray)

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

Link copied to clipboard
fun willFit(numInputBits: Int, version: Version, ecLevel: ErrorCorrectionLevel): Boolean