java.lang.Object
eu.webtoolkit.jwt.thirdparty.qrcodegen.QrCode

public final class QrCode extends Object
A QR Code symbol, which is a type of two-dimension barcode. Invented by Denso Wave and described in the ISO/IEC 18004 standard. Instances of this class represent an immutable square grid of dark and light cells. The class provides static factory functions to create a QR Code from text or binary data. The class covers the QR Code Model 2 specification, supporting all versions (sizes) from 1 to 40, all 4 error correction levels, and 4 character encoding modes.

Ways to create a QR Code object:

  • High level: Take the payload data and call QrCode::encodeText() or QrCode::encodeBinary().
  • Mid level: Custom-make the list of segments and call QrCode::encodeSegments().
  • Low level: Custom-make the array of data codeword bytes (including segment headers and final padding, excluding error correction codewords), supply the appropriate version number, and call the QrCode() constructor. (Note that all ways require supplying the desired error correction level.)
  • Field Details

  • Constructor Details

    • QrCode

      public QrCode(int ver, Ecc ecl, List<Integer> dataCodewords, int msk)
  • Method Details

    • encodeText

      public static QrCode encodeText(String text, Ecc ecl)
    • encodeBinary

      public static QrCode encodeBinary(List<Integer> data, Ecc ecl)
    • encodeSegments

      public static QrCode encodeSegments(List<QrSegment> segs, Ecc ecl, int minVersion, int maxVersion, int mask, boolean boostEcl)
    • encodeSegments

      public static final QrCode encodeSegments(List<QrSegment> segs, Ecc ecl)
    • encodeSegments

      public static final QrCode encodeSegments(List<QrSegment> segs, Ecc ecl, int minVersion)
    • encodeSegments

      public static final QrCode encodeSegments(List<QrSegment> segs, Ecc ecl, int minVersion, int maxVersion)
    • encodeSegments

      public static final QrCode encodeSegments(List<QrSegment> segs, Ecc ecl, int minVersion, int maxVersion, int mask)
    • getVersion

      public int getVersion()
    • getSize

      public int getSize()
    • getErrorCorrectionLevel

      public Ecc getErrorCorrectionLevel()
    • getMask

      public int getMask()
    • getModule

      public boolean getModule(int x, int y)