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
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
All the possible values in alphanumeric mode.The encoding it selected when decoding a BYTE messagefinal StringBuilder
-
Constructor Summary
ConstructorDescriptionQrCodeCodecBitsUtils
(@Nullable String forceEncoding, String defaultEncoding) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAutomatic
(Charset byteCharacterSet, String message, List<QrCodeCodecBitsUtils.MessageSegment> segments) Select the encoding based on the letters in the message.static byte[]
alphanumericToValues
(String data) static boolean
containsAlphaNumeric
(String message) static boolean
containsByte
(String message) static boolean
containsKanji
(String message) createSegmentAlphanumeric
(String alphaNumeric) createSegmentBytes
(byte[] data) createSegmentKanji
(String message) createSegmentNumeric
(byte[] numbers) createSegmentNumeric
(String message) int
decodeAlphanumeric
(PackedBits8 data, int bitLocation, int lengthBits) Decodes alphanumeric messagesint
decodeByte
(PackedBits8 data, int bitLocation, int lengthBits) Decodes byte messagesint
decodeKanji
(PackedBits8 data, int bitLocation, int lengthBits) Decodes Kanji messagesint
decodeNumeric
(PackedBits8 data, int bitLocation, int lengthBits) Decodes a numeric messagestatic void
encodeAlphanumeric
(byte[] numbers, int length, int lengthBits, PackedBits8 packed) static void
encodeBytes
(byte[] data, int length, int lengthBits, PackedBits8 packed) static void
encodeKanji
(byte[] bytes, int length, int lengthBits, PackedBits8 packed) static void
encodeNumeric
(byte[] numbers, int length, int lengthBits, PackedBits8 packed) static void
flipBits8
(byte[] array, int size) static byte
flipBits8
(int x) static void
flipBits8
(DogArray_I8 array) static boolean
isKanji
(char c) void
setVerbose
(@Nullable PrintStream out, @Nullable Set<String> configuration) static char
valueToAlphanumeric
(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:
setVerbose
in interfaceVerbosePrint
-