Package com.journeyapps.barcodescanner
Class Decoder
- java.lang.Object
-
- com.journeyapps.barcodescanner.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.zxing.Resultdecode(com.google.zxing.BinaryBitmap bitmap)Decode a binary bitmap.com.google.zxing.Resultdecode(com.google.zxing.LuminanceSource source)Given an image source, attempt to decode the barcode.voidfoundPossibleResultPoint(com.google.zxing.ResultPoint point)List<com.google.zxing.ResultPoint>getPossibleResultPoints()Call immediately after decode(), from the same thread.protected com.google.zxing.ReadergetReader()protected com.google.zxing.BinaryBitmaptoBitmap(com.google.zxing.LuminanceSource source)Given an image source, convert to a binary bitmap.
-
-
-
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:
foundPossibleResultPointin interfacecom.google.zxing.ResultPointCallback
-
-