Barcode Xpress Mobile for Android

BXAPI Class Reference

Interface for the Barcode Xpress Mobile native recognition library. More...

List of all members.

Public Member Functions

 BXAPI (BXLicense license)
 Constructor.
byte[] binarizeImage (byte[] rawPixels, int width, int height, int stride, int bpp)
 Binarize (threshold and reduce to 1 bit per pixel) image contained in an array of uncompressed pixel data, which can be in either 8-bit grayscale, 16-bit RGB_565, 32-bit ARGB_8888 format.
boolean getBlurDetection ()
 Getter for doBlurDetection member variable.
BXResult recognizeImage (Bitmap image, long barcodeTypes)
BXResult recognizeImage (byte[] rawPixels, int width, int height, int stride, int bpp, long barcodeTypes)
BXResult recognizeImageFromJPEGPixels (byte[] jpegPixels, long barcodeTypes)
BXResult[] recognize (Bitmap image, long barcodeTypes, int maxBarcodeCount)
 Recognize and decode barcodes from a Bitmap image, which may be in RGB_565 (16 bits per pixel), ARGB_8888 (32 bits per pixel), or grayscale (8 bits per pixel) format.
BXResult[] recognize (byte[] rawPixels, int width, int height, int stride, int bpp, long barcodeTypes, int maxBarcodeCount)
 Recognize and decode barcodes from an array of uncompressed pixel data, which can be in RGB_565, ARGB_8888, or 8-bit gray format.
BXResult[] recognizeFromJPEGPixels (byte[] jpegPixels, long barcodeTypes, int maxBarcodeCount)
 Recognize and decode barcodes from a byte array of JPEG-compressed pixel data.
void setBlurDetection (boolean blurToggle)
 Setter for doBlurDetection member variable.

Static Public Member Functions

static String getWorkerLibraryVersion ()
 Get the version information from the decoding library via JNI.
static byte[] YUVtoRGB565 (byte[] pixels, int width, int height)
 Converts YUV NV21 format image to RGB 565 format.

Static Package Functions

 [static initializer]
 Load the native library.

Detailed Description

Interface for the Barcode Xpress Mobile native recognition library.

This class contains methods to call recognition and get the results back. Some additional utility functions are in this class as well.


Constructor & Destructor Documentation

BXAPI ( BXLicense  license) [inline]

Constructor.

Sets the License to be used when invoking recognizeImage().

Parameters:
licenseThe native decoding library uses a single license for all decoding threads. If multiple instances of BXAPI are created, each with a different instance of BXLicense, each BXLicense reference will replace the previous reference.

Member Function Documentation

byte [] binarizeImage ( byte[]  rawPixels,
int  width,
int  height,
int  stride,
int  bpp 
) [inline]

Binarize (threshold and reduce to 1 bit per pixel) image contained in an array of uncompressed pixel data, which can be in either 8-bit grayscale, 16-bit RGB_565, 32-bit ARGB_8888 format.

Parameters:
rawPixelsAn array of bytes containing the pixel data.
widthWidth of the image, measured in pixels.
heightHeight of the image, measured in pixels.
strideWidth of the image, measured in bytes.
bppBits per pixel of the image.
Returns:
A byte array containing the binarized image.
boolean getBlurDetection ( ) [inline]

Getter for doBlurDetection member variable.

Returns:
True if blurred images are rejected before recognition, false otherwise.
static String getWorkerLibraryVersion ( ) [inline, static]

Get the version information from the decoding library via JNI.

Returns:
BXResult [] recognize ( Bitmap  image,
long  barcodeTypes,
int  maxBarcodeCount 
) [inline]

Recognize and decode barcodes from a Bitmap image, which may be in RGB_565 (16 bits per pixel), ARGB_8888 (32 bits per pixel), or grayscale (8 bits per pixel) format.

Parameters:
imageBitmap that contains an image to be decoded.
barcodeTypesThe type of barcode(s) that should be decoded. See BXTypeConstants. To create this value, use the sum of the desired constant types.
maxBarcodeCountThe maximum number of barcodes that may be returned by this call. A maxCount of zero means read as many as possible.
Returns:
BXResult array that contains information decoded from the image. See BXResult.
BXResult [] recognize ( byte[]  rawPixels,
int  width,
int  height,
int  stride,
int  bpp,
long  barcodeTypes,
int  maxBarcodeCount 
) [inline]

Recognize and decode barcodes from an array of uncompressed pixel data, which can be in RGB_565, ARGB_8888, or 8-bit gray format.

Parameters:
rawPixelsAn array of bytes containing an image to be decoded.
widthWidth of the image, measured in pixels.
heightHeight of the image, measured in pixels.
strideWidth of the image, measured in bytes.
bppBits per pixel of the image.
barcodeTypesThe type of barcode(s) that should be decoded. See BXTypeConstants. To create this value, use the sum of the desired constant types.
maxBarcodeCountThe maximum number of barcodes that may be returned by this call. A maxCount of zero means read as many as possible.
Returns:
BXResult array that contains information decoded from the image. See BXResult.
BXResult [] recognizeFromJPEGPixels ( byte[]  jpegPixels,
long  barcodeTypes,
int  maxBarcodeCount 
) [inline]

Recognize and decode barcodes from a byte array of JPEG-compressed pixel data.

Parameters:
jpegPixelsAn array of JPEG-encoded bytes containing an image to be decoded.
barcodeTypesThe types of barcodes that will be decoded from the image. See BXTypeConstants.
maxBarcodeCountThe maximum number of barcodes that may be returned by this call. A maxCount of zero means read as many as possible.
Returns:
BXResult array that contains information decoded from the image. See BXResult.
BXResult recognizeImage ( byte[]  rawPixels,
int  width,
int  height,
int  stride,
int  bpp,
long  barcodeTypes 
) [inline]
Deprecated:
This function has been replaced by recognize(byte[], int, int, int, int, long, int)

Recognize and decode barcode from an array of uncompressed pixel data, which can be in RGB_565, ARGB_8888, or 8-bit gray format.

Parameters:
rawPixelsAn array of bytes containing an image to be decoded.
widthWidth of the image, measured in pixels.
heightHeight of the image, measured in pixels.
strideWidth of the image, measured in bytes.
bppBits per pixel of the image.
barcodeTypesThe type of barcode(s) that should be decoded. See BXTypeConstants. To create this value, use the sum of the desired constant types.
Returns:
BXResult that contains information decoded from the image. See BXResult.
BXResult recognizeImage ( Bitmap  image,
long  barcodeTypes 
) [inline]
Deprecated:
This function has been replaced by the function recognize(Bitmap, long, int)

Recognize and decode barcode from a Bitmap image, which may be in RGB_565 (16 bits per pixel), ARGB_8888 (32 bits per pixel), or grayscale (8 bits per pixel) format.

Parameters:
imageBitmap that contains an image to be decoded.
barcodeTypesThe type of barcode(s) that should be decoded. See BXTypeConstants. To create this value, use the sum of the desired constant types.
Returns:
BXResult that contains information decoded from the image. See BXResult.
BXResult recognizeImageFromJPEGPixels ( byte[]  jpegPixels,
long  barcodeTypes 
) [inline]
Deprecated:
This function has been replaced by recognizeFromJPEGPixels(byte[], long, int)

Recognize and decode barcode from a byte array of JPEG-compressed pixel data.

Parameters:
jpegPixelsAn array of JPEG-encoded bytes containing an image to be decoded.
barcodeTypesThe types of barcodes that will be decoded from the image. See BXTypeConstants.
Returns:
BXResult that contains information decoded from the image. See BXResult.
static byte [] YUVtoRGB565 ( byte[]  pixels,
int  width,
int  height 
) [inline, static]

Converts YUV NV21 format image to RGB 565 format.

Parameters:
pixelsAn array of bytes that contains a YUV image encoded in NV21 format, 12 bits per pixel
widthWidth of the image, measured in pixels.
heightHeight of the image, measured in pixels.
Returns:
An array of bytes that contains the converted image, in RGB 565 format, 16 bits per pixel.