# Print output for @column tags ?>
public
class
Scanner
extends Object
| java.lang.Object | |
| ↳ | com.vuzix.sdk.barcode.Scanner |
This class is deprecated.
As of Scanner 2
Main entry point into the barcode scanning library. The library needs to be initialized once via the init() method. Then to perform a scan, simply call scan().
Public constructors | |
|---|---|
Scanner()
|
|
Public methods | |
|---|---|
static
ScanResult[]
|
convertToResults(ScanResult2[] inResult)
|
static
void
|
init(Context context, String licenseKey)
Initialize the barcode scanner with a custom license key. |
static
void
|
init(Context context)
Initialize the barcode scanner with the default Vuzix license key. |
static
ScanResult[]
|
scan(byte[] imageData, int width, int height, ScanningRect rect, BarcodeType... intypes)
Scans the supplied image data for the requested barcode types. |
static
ScanResult[]
|
scan(byte[] imageData, int width, int height, ScanningRect rect)
Scans the supplied image data for barcodes. |
static
ScanResult[]
|
scan(byte[] imageData, int width, int height)
Scans the supplied image data for barcodes. |
public Scanner ()
public static ScanResult[] convertToResults (ScanResult2[] inResult)
| Parameters | |
|---|---|
inResult |
ScanResult2 |
| Returns | |
|---|---|
ScanResult[] |
|
public static void init (Context context,
String licenseKey)
Initialize the barcode scanner with a custom license key. An invalid license key will result in an IllegalArgumentException. Note that barcode scanning can still take place, however results may be obfuscated.
| Parameters | |
|---|---|
context |
Context: the Context using the barcode scanner |
licenseKey |
String: the license key to use |
| Throws | |
|---|---|
IllegalArgumentException |
if the license key is not valid |
public static void init (Context context)
Initialize the barcode scanner with the default Vuzix license key. The following barcode types will be fully functional:
Attempts to use other barcode types are not supported and may result in obfuscated results.
| Parameters | |
|---|---|
context |
Context: the Context using the barcode scanner
|
public static ScanResult[] scan (byte[] imageData, int width, int height, ScanningRect rect, BarcodeType... intypes)
Scans the supplied image data for the requested barcode types. Only the supplied scanning rectangle will be scanned.
| Parameters | |
|---|---|
imageData |
byte: gray-scale image data |
width |
int: width in pixels of the image data |
height |
int: height in pixels of the image data |
rect |
ScanningRect: the scanning rectangle in which to look for barcodes, if null the entire image will be scanned |
intypes |
BarcodeType: the barcode types that should be scanned for |
| Returns | |
|---|---|
ScanResult[] |
an array of ScanResult |
public static ScanResult[] scan (byte[] imageData, int width, int height, ScanningRect rect)
Scans the supplied image data for barcodes. Only the supplied scanning rectangle will be scanned. If a custom license key was supplied via init(), all possible barcode types will be scanned for. Otherwise only Vuzix supported barcode types will be scanned for.
| Parameters | |
|---|---|
imageData |
byte: gray-scale image data |
width |
int: width in pixels of the image data |
height |
int: height in pixels of the image data |
rect |
ScanningRect: the scanning rectangle in which to look for barcodes, if null the entire image will be scanned |
| Returns | |
|---|---|
ScanResult[] |
an array of ScanResult |
public static ScanResult[] scan (byte[] imageData, int width, int height)
Scans the supplied image data for barcodes. The entire image will be scanned. If a custom license key was supplied via init(), all possible barcode types will be scanned for. Otherwise only Vuzix supported barcode types will be scanned for.
| Parameters | |
|---|---|
imageData |
byte: gray-scale image data |
width |
int: width in pixels of the image data |
height |
int: height in pixels of the image data |
| Returns | |
|---|---|
ScanResult[] |
an array of ScanResult |