Decoder (ZXing 3.5.2 API)
Description: declaration: package: com.google.zxing.qrcode.decoder, class: Decoder

Package com.google.zxing.qrcode.decoder

# Class Decoder

java.lang.Object
com.google.zxing.qrcode.decoder.Decoder

public final class Decoder extends Object

The main class which implements QR Code decoding -- as opposed to locating and extracting the QR Code from an image.

Author:
  Sean Owen

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Decoder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DecoderResult`
  `decode(boolean[][] image)`
  `DecoderResult`
  `decode(boolean[][] image, Map<DecodeHintType,?> hints)`
  Convenience method that can decode a QR Code represented as a 2D array of booleans.
  `DecoderResult`
  `decode(BitMatrix bits)`
  `DecoderResult`
  `decode(BitMatrix bits, Map<DecodeHintType,?> hints)`
  Decodes a QR Code represented as a `BitMatrix`.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Decoder

    public Decoder()

- ## Method Details

  - ### decode

    public DecoderResult decode(boolean[][] image) throws ChecksumException, FormatException
    Throws:
      `ChecksumException`
      `FormatException`

  - ### decode

    public DecoderResult decode(boolean[][] image, Map<DecodeHintType,?> hints) throws ChecksumException, FormatException

    Convenience method that can decode a QR Code represented as a 2D array of booleans. "true" is taken to mean a black module.

    Parameters:
      `image` - booleans representing white/black QR Code modules
      `hints` - decoding hints that should be used to influence decoding
    Returns:
      text and bytes encoded within the QR Code
    Throws:
      `FormatException` - if the QR Code cannot be decoded
      `ChecksumException` - if error correction fails

  - ### decode

    public DecoderResult decode(BitMatrix bits) throws ChecksumException, FormatException
    Throws:
      `ChecksumException`
      `FormatException`

  - ### decode

    public DecoderResult decode(BitMatrix bits, Map<DecodeHintType,?> hints) throws FormatException, ChecksumException

    Decodes a QR Code represented as a `BitMatrix`. A 1 or "true" is taken to mean a black module.

    Parameters:
      `bits` - booleans representing white/black QR Code modules
      `hints` - decoding hints that should be used to influence decoding
    Returns:
      text and bytes encoded within the QR Code
    Throws:
      `FormatException` - if the QR Code cannot be decoded
      `ChecksumException` - if error correction fails