Barcode Xpress Mobile for Android
 All Classes Functions Variables Pages
BXAPI Class Reference

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

Public Member Functions

 BXAPI (BXLicense license)
 Constructor. More...
 
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. More...
 
boolean getBlurDetection ()
 Getter for doBlurDetection member variable. More...
 
BXResult recognizeImage (Bitmap image, long barcodeTypes)
 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. More...
 
BXResult recognizeImage (byte[] rawPixels, int width, int height, int stride, int bpp, long barcodeTypes)
 Recognize and decode barcode from an array of uncompressed pixel data, which can be in RGB_565, ARGB_8888, or 8-bit gray format. More...
 
BXResult recognizeImageFromJPEGPixels (byte[] jpegPixels, long barcodeTypes)
 Recognize and decode barcode from a byte array of JPEG-compressed pixel data. More...
 
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. More...
 
static byte[] YUVtoRGB565 (byte[] pixels, int width, int height)
 Converts YUV NV21 format image to RGB 565 format. More...
 

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 ( )
inlinestatic

Get the version information from the decoding library via JNI.

Returns
BXResult recognizeImage ( Bitmap  image,
long  barcodeTypes 
)
inline

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 recognizeImage ( byte[]  rawPixels,
int  width,
int  height,
int  stride,
int  bpp,
long  barcodeTypes 
)
inline

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 recognizeImageFromJPEGPixels ( byte[]  jpegPixels,
long  barcodeTypes 
)
inline

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 
)
inlinestatic

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.