Class QrCodeCodecBitsUtils

java.lang.Object
boofcv.alg.fiducial.qrcode.QrCodeCodecBitsUtils
All Implemented Interfaces:
VerbosePrint

public class QrCodeCodecBitsUtils extends Object implements VerbosePrint
Various functions to encode and decode QR and Micro QR data.
  • Field Details

    • ALPHANUMERIC

      public static final String ALPHANUMERIC
      All the possible values in alphanumeric mode.
      See Also:
    • failureCause

      public QrCode.Failure failureCause
    • workString

      public final StringBuilder workString
    • selectedByteEncoding

      public String selectedByteEncoding
      The encoding it selected when decoding a BYTE message
    • defaultEncoding

      public String defaultEncoding
  • Constructor Details

    • QrCodeCodecBitsUtils

      public QrCodeCodecBitsUtils(@Nullable @Nullable String forceEncoding, String defaultEncoding)
  • Method Details

    • decodeNumeric

      public int decodeNumeric(PackedBits8 data, int bitLocation, int lengthBits)
      Decodes a numeric message
      Parameters:
      data - encoded data
      Returns:
      Location it has read up to in bits
    • decodeAlphanumeric

      public int decodeAlphanumeric(PackedBits8 data, int bitLocation, int lengthBits)
      Decodes alphanumeric messages
      Parameters:
      data - encoded data
      Returns:
      Location it has read up to in bits
    • decodeByte

      public int decodeByte(PackedBits8 data, int bitLocation, int lengthBits)
      Decodes byte messages
      Parameters:
      data - encoded data
      Returns:
      Location it has read up to in bits
    • decodeKanji

      public int decodeKanji(PackedBits8 data, int bitLocation, int lengthBits)
      Decodes Kanji messages
      Parameters:
      data - encoded data
      Returns:
      Location it has read up to in bits
    • isKanji

      public static boolean isKanji(char c)
    • containsKanji

      public static boolean containsKanji(String message)
    • containsByte

      public static boolean containsByte(String message)
    • containsAlphaNumeric

      public static boolean containsAlphaNumeric(String message)
    • alphanumericToValues

      public static byte[] alphanumericToValues(String data)
    • flipBits8

      public static void flipBits8(byte[] array, int size)
    • flipBits8

      public static void flipBits8(DogArray_I8 array)
    • flipBits8

      public static byte flipBits8(int x)
    • valueToAlphanumeric

      public static char valueToAlphanumeric(int value)
    • encodeNumeric

      public static void encodeNumeric(byte[] numbers, int length, int lengthBits, PackedBits8 packed)
    • encodeAlphanumeric

      public static void encodeAlphanumeric(byte[] numbers, int length, int lengthBits, PackedBits8 packed)
    • encodeBytes

      public static void encodeBytes(byte[] data, int length, int lengthBits, PackedBits8 packed)
    • encodeKanji

      public static void encodeKanji(byte[] bytes, int length, int lengthBits, PackedBits8 packed)
    • createSegmentNumeric

      public static QrCodeCodecBitsUtils.MessageSegment createSegmentNumeric(String message)
    • createSegmentNumeric

      public static QrCodeCodecBitsUtils.MessageSegment createSegmentNumeric(byte[] numbers)
    • createSegmentAlphanumeric

      public static QrCodeCodecBitsUtils.MessageSegment createSegmentAlphanumeric(String alphaNumeric)
    • createSegmentBytes

      public static QrCodeCodecBitsUtils.MessageSegment createSegmentBytes(byte[] data)
    • createSegmentKanji

      public static QrCodeCodecBitsUtils.MessageSegment createSegmentKanji(String message)
    • 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 interface VerbosePrint