Barcode Xpress Mobile for iOS
 All Classes Functions Variables Properties Pages
BXAuxFunctions Class Reference

Performs basic image operations for the barcode decoder. More...

#import <BXAuxFunctions.h>

Inheritance diagram for BXAuxFunctions:

Class Methods

(void) + getPixelData::::::
 Returns information about a CGImageRef and provides an 8-bpp grayscale copy of the image. More...
 
(void) + YUVtoRGBA:width:height:rgbData:
 Converts an input image from YUV420p format to RGBA format. More...
 
(UIImage *) + binarizeUIImage:
 Performs thresholding on an image and returns a version of it that has been reduced to 1 bit per pixel. More...
 
(UIImage *) + binarizeGrayscaleImage:width:height:
 Performs thresholding on an 8-bpp grayscale image and returns a version of it that has been reduced to 1 bit per pixel. More...
 
(const char *) + BarcodeTypeToString:
 Gets a character string that corresponds to the name of the enumerated barcode type. More...
 

Detailed Description

Performs basic image operations for the barcode decoder.

Method Documentation

+ (const char *) BarcodeTypeToString: (enum BarcodeTypes)  barcodeType

Gets a character string that corresponds to the name of the enumerated barcode type.

Parameters
barcodeTypeA value of type enum BarcodeTypes (see top of this file for definition of the enum values).
Returns
A character string containing the name of the barcode type.
+ (UIImage *) binarizeGrayscaleImage: (const uint8_t*)  inImage
width: (size_t)  width
height: (size_t)  height 

Performs thresholding on an 8-bpp grayscale image and returns a version of it that has been reduced to 1 bit per pixel.

Parameters
inImageA pointer to byte data containing an 8-bpp grayscale image that will used as the source to create a UIImage that is black/white with a 1 bit per pixel depth.
widthWidth of the input image, in pixels.
heightHeight of the input image, in pixels.
Returns
A thresholded black/white version of the input image, at 1-bpp.
+ (UIImage *) binarizeUIImage: (UIImage*)  inImage

Performs thresholding on an image and returns a version of it that has been reduced to 1 bit per pixel.

Parameters
inImageA UIImage that will used as the source to create another UIImage that is black/white with a 1 bit per pixel depth.
Returns
A thresholded black/white version of the input image, at 1-bpp.
+ (void) : (CGImageRef)  inImage
: (size_t *)  width
: (size_t *)  height
: (long *)  bpp
: (long *)  stride
: (unsigned char**)  gdata 

Returns information about a CGImageRef and provides an 8-bpp grayscale copy of the image.

This method is used primarily to access the byte data of a UIImage before sending that data to the barcode recognition routines. If the inImage has a pixel depth of 1 bit per pixel, then no grayscale image will be created, and all return parameters are set with values obtained from inImage. gdata will be set to nil. For input images with pixel depths other than 1 bpp, malloc() is used to allocate memory for a grayscale copy of inImage, pointed to by the return parameter gdata. The caller is responsible for invoking free() to release this memory. The other return parameters will be set with values that reflect the attributes of this new grayscale image. The grayscale image will contain no padding, and its width will be equal to its stride.

Parameters
inImageThe input image to get information about.
widthA pointer to the size_t variable that will contain the image width in pixels.
heightA pointer to the size_t variable that will contain the image height in pixels.
bppA pointer to the size_t variable that will contain the pixel depth in bits per pixel.
strideA pointer to the size_t variable that will contain the number of bytes per row
gdataAddress of a pointer to byte data for a grayscale copy of the input image, if the input image has a pixel depth greater than 1, else gdata is set to nil.
+ (void) YUVtoRGBA: (uint8_t*)  yuvData
width: (size_t)  width
height: (size_t)  height
rgbData: (uint8_t*)  rgbData 

Converts an input image from YUV420p format to RGBA format.

The resulting image copy will be placed into memory allocated by malloc() and pointed to by the return parameter rgbData. The caller is responsible for invoking free() to release this memory.

Parameters
yuvDataPointer to byte data of a YUV402p (planar format) image in standard format. The first width * height bytes contain the Y pixel data. The next ((width * height) / 2) pixels contain interleaved UV data.
widthWidth of the image in pixels.
heightHeight of the image in pixels.
rgbDataAddress of a pointer to byte data for an RGBA-format copy of the input image. The copy has a bit depth of 8 bits per pixel, and full opacity.