public class BarcodeDetectorFrameHandler implements PreviewBuffer.FrameHandler
Performs barcode/QR code detection on camera preview frames. Outputs results via BarcodeDetectorFrameHandler.ResultHandler (). BarcodeDetectorFrameHandler.addResultHandler
Preview frame considered intercepted if at least one BarcodeDetectorFrameHandler.ResultHandler returns true from BarcodeDetectorFrameHandler.ResultHandler.handleResult
| Constructor and Description |
|---|
BarcodeDetectorFrameHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
addResultHandler()
Registers result handler which will be notified about barcode/QR code detection results. Results are coming on the worker thread. Don't forget to move execution to main thread before updating UI.
|
static BarcodeDetectorFrameHandler |
attach()
Convenience method for creating new BarcodeDetectorFrameHandler and adding it as PreviewBuffer.FrameHandler to given camera view.
|
boolean |
handleFrame() |
boolean |
isEnabled() |
void |
removeResultHandler()
Unregisters handler.
|
void |
setBarcodeFormatsFilter()
Sets List BarcodeFormat to scan
|
void |
setDetectionInterval()
Set barcode detection interval in milliseconds
|
void |
setEnabled() |
handleFramepublic static BarcodeDetectorFrameHandler attach()
Convenience method for creating new BarcodeDetectorFrameHandler and adding it as PreviewBuffer.FrameHandler to given camera view.
public boolean handleFrame()
public void addResultHandler()
Registers result handler which will be notified about barcode/QR code detection results.
Results are coming on the worker thread. Don't forget to move execution to main thread before updating UI.
public void removeResultHandler()
Unregisters handler.
public boolean isEnabled()
true if barcode/QR code detection is enabled. false if barcode/QR code detection is disabled, i.e. incoming frames are skipped.public void setEnabled()
public void setDetectionInterval()
Set barcode detection interval in milliseconds
public void setBarcodeFormatsFilter()
Sets List BarcodeFormat to scan