Package boofcv.alg.fiducial.qrcode
Class QrCodeCodecBitsUtils
java.lang.Object
boofcv.alg.fiducial.qrcode.QrCodeCodecBitsUtils
- All Implemented Interfaces:
VerbosePrint
Various functions to encode and decode QR and Micro QR data.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAll the possible values in alphanumeric mode.The encoding it selected when decoding a BYTE messagefinal StringBuilder -
Constructor Summary
ConstructorsConstructorDescriptionQrCodeCodecBitsUtils(@Nullable String forceEncoding, String defaultEncoding) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAutomatic(Charset byteCharacterSet, String message, List<QrCodeCodecBitsUtils.MessageSegment> segments) Select the encoding based on the letters in the message.static byte[]alphanumericToValues(String data) static booleancontainsAlphaNumeric(String message) static booleancontainsByte(String message) static booleancontainsKanji(String message) createSegmentAlphanumeric(String alphaNumeric) createSegmentBytes(byte[] data) createSegmentKanji(String message) createSegmentNumeric(byte[] numbers) createSegmentNumeric(String message) intdecodeAlphanumeric(PackedBits8 data, int bitLocation, int lengthBits) Decodes alphanumeric messagesintdecodeByte(PackedBits8 data, int bitLocation, int lengthBits) Decodes byte messagesintdecodeKanji(PackedBits8 data, int bitLocation, int lengthBits) Decodes Kanji messagesintdecodeNumeric(PackedBits8 data, int bitLocation, int lengthBits) Decodes a numeric messagestatic voidencodeAlphanumeric(byte[] numbers, int length, int lengthBits, PackedBits8 packed) static voidencodeBytes(byte[] data, int length, int lengthBits, PackedBits8 packed) static voidencodeKanji(byte[] bytes, int length, int lengthBits, PackedBits8 packed) static voidencodeNumeric(byte[] numbers, int length, int lengthBits, PackedBits8 packed) static voidflipBits8(byte[] array, int size) static byteflipBits8(int x) static voidflipBits8(DogArray_I8 array) static booleanisKanji(char c) voidsetVerbose(@Nullable PrintStream out, @Nullable Set<String> configuration) static charvalueToAlphanumeric(int value)
-
Field Details
-
ALPHANUMERIC
All the possible values in alphanumeric mode.- See Also:
-
failureCause
-
workString
-
selectedByteEncoding
The encoding it selected when decoding a BYTE message -
defaultEncoding
-
-
Constructor Details
-
QrCodeCodecBitsUtils
-
-
Method Details
-
decodeNumeric
Decodes a numeric message- Parameters:
data- encoded data- Returns:
- Location it has read up to in bits
-
decodeAlphanumeric
Decodes alphanumeric messages- Parameters:
data- encoded data- Returns:
- Location it has read up to in bits
-
decodeByte
Decodes byte messages- Parameters:
data- encoded data- Returns:
- Location it has read up to in bits
-
decodeKanji
Decodes Kanji messages- Parameters:
data- encoded data- Returns:
- Location it has read up to in bits
-
isKanji
public static boolean isKanji(char c) -
containsKanji
-
containsByte
-
containsAlphaNumeric
-
alphanumericToValues
-
flipBits8
public static void flipBits8(byte[] array, int size) -
flipBits8
-
flipBits8
public static byte flipBits8(int x) -
valueToAlphanumeric
public static char valueToAlphanumeric(int value) -
encodeNumeric
-
encodeAlphanumeric
public static void encodeAlphanumeric(byte[] numbers, int length, int lengthBits, PackedBits8 packed) -
encodeBytes
-
encodeKanji
-
createSegmentNumeric
-
createSegmentNumeric
-
createSegmentAlphanumeric
-
createSegmentBytes
-
createSegmentKanji
-
addAutomatic
public static void addAutomatic(Charset byteCharacterSet, String message, List<QrCodeCodecBitsUtils.MessageSegment> segments) Select the encoding based on the letters in the message. A very simple algorithm is used internally. -
setVerbose
public void setVerbose(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration) - Specified by:
setVerbosein interfaceVerbosePrint
-