public class QRCodeReader extends java.lang.Object implements Reader
Modifier and Type | Field and Description |
---|---|
private Decoder |
decoder |
private static ResultPoint[] |
NO_POINTS |
Constructor and Description |
---|
QRCodeReader() |
Modifier and Type | Method and Description |
---|---|
Result |
decode(BinaryBitmap image)
Locates and decodes a QR code in an image.
|
Result |
decode(BinaryBitmap image,
java.util.Map<DecodeHintType,?> hints)
Locates and decodes a barcode in some format within an image.
|
private static BitMatrix |
extractPureBits(BitMatrix image)
This method detects a code in a "pure" image -- that is, pure monochrome image
which contains only an unrotated, unskewed, image of a code, with some white border
around it.
|
protected Decoder |
getDecoder() |
private static float |
moduleSize(int[] leftTopBlack,
BitMatrix image) |
void |
reset()
Resets any internal state the implementation has after a decode, to prepare it
for reuse.
|
private static final ResultPoint[] NO_POINTS
private final Decoder decoder
protected final Decoder getDecoder()
public Result decode(BinaryBitmap image) throws NotFoundException, ChecksumException, FormatException
decode
in interface Reader
image
- image of barcode to decodeNotFoundException
- if a QR code cannot be foundFormatException
- if a QR code cannot be decodedChecksumException
- if error correction failspublic final Result decode(BinaryBitmap image, java.util.Map<DecodeHintType,?> hints) throws NotFoundException, ChecksumException, FormatException
Reader
decode
in interface Reader
image
- image of barcode to decodehints
- passed as a Map
from DecodeHintType
to arbitrary data. The
meaning of the data depends upon the hint type. The implementation may or may not do
anything with these hints.NotFoundException
- if no potential barcode is foundChecksumException
- if a potential barcode is found but does not pass its checksumFormatException
- if a potential barcode is found but format is invalidpublic void reset()
Reader
private static BitMatrix extractPureBits(BitMatrix image) throws NotFoundException
NotFoundException
private static float moduleSize(int[] leftTopBlack, BitMatrix image) throws NotFoundException
NotFoundException