Class MicroQrCodeEncoder

java.lang.Object
boofcv.alg.fiducial.microqr.MicroQrCodeEncoder
All Implemented Interfaces:
VerbosePrint

public class MicroQrCodeEncoder
extends Object
implements VerbosePrint
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 Details

    • MicroQrCodeEncoder

      public MicroQrCodeEncoder()
  • Method Details

    • reset

      public void reset()
    • setVersion

      public MicroQrCodeEncoder setVersion​(int version)
    • setError

      public MicroQrCodeEncoder setError​(@Nullable MicroQrCode.ErrorLevel level)
    • setMask

      public MicroQrCodeEncoder setMask​(MicroQrCodeMaskPattern pattern)
    • addAutomatic

      public MicroQrCodeEncoder addAutomatic​(String message)
      Select the encoding based on the letters in the message. A very simple algorithm is used internally.
    • addNumeric

      public MicroQrCodeEncoder addNumeric​(String message)
      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

      public MicroQrCodeEncoder addNumeric​(byte[] numbers)
      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

      public MicroQrCodeEncoder addAlphanumeric​(String alphaNumeric)
      Creates a QR-Code which encodes data in the alphanumeric format
      Parameters:
      alphaNumeric - String containing only alphanumeric values.
      Returns:
      The QR-Code
    • addBytes

      public MicroQrCodeEncoder addBytes​(String message)
    • addBytes

      public MicroQrCodeEncoder addBytes​(byte[] data)
      Creates a QR-Code which encodes data in the byte format.
      Parameters:
      data - Data to be encoded
      Returns:
      The QR-Code
    • addKanji

      public MicroQrCodeEncoder addKanji​(String message)
      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

      public MicroQrCode fixate()
      Call this function after you are done adding to the QR code
      Returns:
      The generated QR Code
    • bitsToMessage

      protected void bitsToMessage​(PackedBits8 stream)
    • sizeInBits

      public int sizeInBits​(QrCodeCodecBitsUtils.MessageSegment segment, int version)
    • setVerbose

      public void setVerbose​(@Nullable @Nullable PrintStream out, @Nullable @Nullable Set<String> configuration)
      Specified by:
      setVerbose in interface VerbosePrint