Package boofcv.alg.fiducial.qrcode
Class QrCodeEncoder
java.lang.Object
boofcv.alg.fiducial.qrcode.QrCodeEncoder
Provides an easy to use interface for specifying QR-Code parameters and generating the raw data sequence. After
the QR Code has been created using this class it can then be rendered.
By default it will select the qr code version based on the number of
bits and the error correction level based on the version and number of bits. If the error correction isn't specified
and the version isn't specified then error correction level M is used by default.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAlphanumeric
(String alphaNumeric) Creates a QR-Code which encodes data in the alphanumeric formataddAutomatic
(String message) Select the encoding based on the letters in the message.addBytes
(byte[] data) Creates a QR-Code which encodes data in the byte format.Creates a QR-Code which encodes Kanji charactersaddNumeric
(byte[] numbers) Creates a QR-Code which encodes a number sequenceaddNumeric
(String message) Creates a QR-Code which encodes a number sequenceprotected void
bitsToMessage
(PackedBits8 stream) fixate()
Call this function after you are done adding to the QR codestatic int
getLengthBitsAlphanumeric
(int version) static int
getLengthBitsBytes
(int version) static int
getLengthBitsKanji
(int version) static int
getLengthBitsNumeric
(int version) void
reset()
void
setByteCharacterSet
(Charset byteCharacterSet) setError
(QrCode.ErrorLevel level) setMask
(QrCodeMaskPattern pattern) setVersion
(int version) int
sizeInBits
(QrCodeCodecBitsUtils.MessageSegment segment, int version)
-
Constructor Details
-
QrCodeEncoder
public QrCodeEncoder()
-
-
Method Details
-
reset
public void reset() -
setVersion
-
setError
-
setMask
-
addAutomatic
Select the encoding based on the letters in the message. A very simple algorithm is used internally. -
addNumeric
Creates a QR-Code which encodes a number sequence- Parameters:
message
- String that specifies numbers and no other types. Each number has to be from 0 to 9 inclusive.- Returns:
- The QR-Code
-
addNumeric
Creates a QR-Code which encodes a number sequence- Parameters:
numbers
- Array of numbers. Each number has to be from 0 to 9 inclusive.- Returns:
- The QR-Code
-
addAlphanumeric
Creates a QR-Code which encodes data in the alphanumeric format- Parameters:
alphaNumeric
- String containing only alphanumeric values.- Returns:
- The QR-Code
-
addBytes
-
addBytes
Creates a QR-Code which encodes data in the byte format.- Parameters:
data
- Data to be encoded- Returns:
- The QR-Code
-
addKanji
Creates a QR-Code which encodes Kanji characters- Parameters:
message
- Data to be encoded- Returns:
- The QR-Code
-
getLengthBitsNumeric
public static int getLengthBitsNumeric(int version) -
getLengthBitsAlphanumeric
public static int getLengthBitsAlphanumeric(int version) -
getLengthBitsBytes
public static int getLengthBitsBytes(int version) -
getLengthBitsKanji
public static int getLengthBitsKanji(int version) -
fixate
Call this function after you are done adding to the QR code- Returns:
- The generated QR Code
-
bitsToMessage
-
getByteCharacterSet
-
setByteCharacterSet
-
sizeInBits
-