Class Decoder

  • All Implemented Interfaces:
    com.google.zxing.ResultPointCallback
    Direct Known Subclasses:
    InvertedDecoder, MixedDecoder

    public class Decoder
    extends Object
    implements com.google.zxing.ResultPointCallback
    A class for decoding images. A decoder contains all the configuration required for the binarization and decoding process. The actual decoding should happen on a dedicated thread.
    • Constructor Summary

      Constructors 
      Constructor Description
      Decoder​(com.google.zxing.Reader reader)
      Create a new Decoder with the specified Reader.
    • Constructor Detail

      • Decoder

        public Decoder​(com.google.zxing.Reader reader)
        Create a new Decoder with the specified Reader. It is recommended to use an instance of MultiFormatReader in most cases.
        Parameters:
        reader - the reader
    • Method Detail

      • getReader

        protected com.google.zxing.Reader getReader()
      • decode

        public com.google.zxing.Result decode​(com.google.zxing.LuminanceSource source)
        Given an image source, attempt to decode the barcode. Must not raise an exception.
        Parameters:
        source - the image source
        Returns:
        a Result or null
      • toBitmap

        protected com.google.zxing.BinaryBitmap toBitmap​(com.google.zxing.LuminanceSource source)
        Given an image source, convert to a binary bitmap. Override this to use a custom binarizer.
        Parameters:
        source - the image source
        Returns:
        a BinaryBitmap
      • decode

        protected com.google.zxing.Result decode​(com.google.zxing.BinaryBitmap bitmap)
        Decode a binary bitmap.
        Parameters:
        bitmap - the binary bitmap
        Returns:
        a Result or null
      • getPossibleResultPoints

        public List<com.google.zxing.ResultPoint> getPossibleResultPoints()
        Call immediately after decode(), from the same thread. The result is undefined while decode() is running.
        Returns:
        possible ResultPoints from the last decode.
      • foundPossibleResultPoint

        public void foundPossibleResultPoint​(com.google.zxing.ResultPoint point)
        Specified by:
        foundPossibleResultPoint in interface com.google.zxing.ResultPointCallback