Barcode Xpress Mobile for iOS
|
Manages access to the camera, executes callbacks, and executes Barcode Xpress library functions to perform recognition operations on imagery gathered from the camera. More...
#import <BarcodeXpressIOS.h>
Instance Methods | |
(id) | - init |
Initializes a class that implements the BXInterface. More... | |
(id) | - initWithLicense: |
Initializes a class that implements the BXInterface with a license (required). More... | |
(void) | - StartRecognition |
Initializes the video camera interface, and starts the process of gathering images from the video camera and sending them to the Barcode Xpress library for recognition. | |
(void) | - StopRecognition |
Stops the process of gathering images from the video camera and sending them to the Barcode Xpress library for recognition. More... | |
(void) | - PauseRecognition |
Pauses recognition by no longer sending images to the Barcode Xpress recognition library. More... | |
(void) | - ResumeRecognition |
Resumes sending images to the Barcode Xpress recognition library. More... | |
(void) | - SetCameraCallback:: |
Sets the callback to be executed each time an image is captured from the video camera. More... | |
(void) | - SetRecognitionCallback:: |
Sets the callback to be executed each time the Barcode Xpress recognition library has found a barcode in an image, or has encountered an error. More... | |
(void) | - SetProcessingCallback:: |
Sets the callback to be executed each time a thread begins to process an image captured from the video camera. More... | |
(BXiOS_Status) | - RecognizeImage:result: |
Looks for a single barcode in a UIImage and decodes it. More... | |
(BXiOS_Status) | - RecognizeImage:width:height:bpp:stride:result: |
Looks for a single barcode in an image and, if found, returns the decoded value. More... | |
(BXiOS_Status) | - RecognizeImage:results:maxBarcodes: |
Looks for multiple barcodes in a UIImage and decodes them. More... | |
(BXiOS_Status) | - RecognizeImage:width:height:bpp:stride:results:maxBarcodes: |
Looks for multiple barcodes in an image and, if found, returns the decoded values. More... | |
(const char *) | - ReportVersion |
Reports the version of the recognition library. More... | |
(long) | - SetBarcodeTypes: |
Sets the barcode types that can be recognized in an image. More... | |
(CGSize) | - GetCameraResolution |
Returns the camera resolution being used, in pixels. More... | |
(void) | - ClearNumProcessedFrames |
Clears the counter that keeps track of the number of frames sent for processing since the last time a barcode was found, or since the object was instantiated, whichever is most recent. | |
(long) | - GetNumProcessedFrames |
Gets a count of the number of frames sent for processing since the last time a barcode was found, or since the object was instantiated, whichever is most recent. More... | |
(AVCaptureSession *) | - GetCaptureSession |
Returns a reference to the video capture session. More... | |
Class Methods | |
(UIImage *) | + binarizeUIImage: |
Thresholds an 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... | |
Manages access to the camera, executes callbacks, and executes Barcode Xpress library functions to perform recognition operations on imagery gathered from the camera.
Defines the iOS interface used by the Software Development Kit for Barcode Xpress.
This interface manages the camera, obtaining images from it and processing them with the Accusoft Barcode Xpress recognition library. The recognition results are made available via callbacks. Other callbacks provide copies of the images as soon as they are captured, and also before they are dispatched to a processing thread. These callbacks allow your application to easily interact with the capture-recognize-report cycle.
+ (const char *) BarcodeTypeToString: | (enum BarcodeTypes) | barcodeType |
Gets a character string that corresponds to the name of the enumerated barcode type.
barcodeType | A value of type enum BarcodeTypes (see top of this file for definition of the enum values). |
+ (UIImage *) binarizeUIImage: | (UIImage*) | inImage |
Thresholds an image and returns a version of it that has been reduced to 1 bit per pixel.
inImage | A UIImage that will used as the source to create another UIImage that is black/white with a 1 bit per pixel depth. |
- (CGSize) GetCameraResolution |
Returns the camera resolution being used, in pixels.
This may differ from the camera's actual resolution.
- (AVCaptureSession *) GetCaptureSession |
Returns a reference to the video capture session.
- (long) GetNumProcessedFrames |
Gets a count of the number of frames sent for processing since the last time a barcode was found, or since the object was instantiated, whichever is most recent.
- (id) init |
Initializes a class that implements the BXInterface.
Calls initWithLicense:
Calls -(id) initWithLicense().
- (id) initWithLicense: | (BXLicense*) | inLicense |
Initializes a class that implements the BXInterface with a license (required).
inLicense | A BXLicense created with information from a valid Accusoft license. |
- (void) PauseRecognition |
Pauses recognition by no longer sending images to the Barcode Xpress recognition library.
The camera interface is not released.
- (BXiOS_Status) RecognizeImage: | (UIImage*) | image | |
result: | (BXResult **) | result | |
Looks for a single barcode in a UIImage and decodes it.
This is not as efficient as using the RecognizeImage method which takes in byte data as parameters, since the byte data must first be extracted from the UIImage before passing it to the Barcode Xpress recognition library. The types of barcodes that can be decoded will have been set earlier with a call to SetBarcodeTypes.
image | The image to search. |
result | The address of a pointer to a BXResult object. The pointer will be changed to point to an autoreleased BXResult object which contains the result of the recognition for the image if a barcode is found. |
- (BXiOS_Status) RecognizeImage: | (UIImage*) | image | |
results: | (NSMutableArray*) | results | |
maxBarcodes: | (int) | maxBarcodes | |
Looks for multiple barcodes in a UIImage and decodes them.
This is not as efficient as using the RecognizeImage method which takes in byte data as parameters, since the byte data must first be extracted from the UIImage before passing it to the Barcode Xpress recognition library. The types of barcodes that can be decoded will have been set earlier with a call to SetBarcodeTypes.
image | The image to search. |
results | The barcodes that are found in the image. This will always be a size of at least one, even when no barcodes are found. If no barcodes are found the return value will be something other than StatusOK and the first item in the array will give a description of the result. |
maxBarcodes | The maximum number of barcodes to search for. |
- (BXiOS_Status) RecognizeImage: | (void*) | image | |
width: | (size_t) | width | |
height: | (size_t) | height | |
bpp: | (size_t) | bpp | |
stride: | (size_t) | stride | |
result: | (BXResult**) | result | |
Looks for a single barcode in an image and, if found, returns the decoded value.
The types of barcodes that can be decoded will have been set earlier with a call to SetBarcodeTypes.
image | The image to search, in grayscale format with 8 bits per pixel. |
width | The image width in pixels (not including any padding). |
height | The image height in pixels. |
bpp | The pixel depth, in bits per pixel. |
stride | The number of bytes per row in the image, including any padding. |
result | The address of a pointer to a BXResult object. The pointer will be changed to point to an autoreleased BXResult object which contains the result of the recognition for the image if a barcode is found. |
- (BXiOS_Status) RecognizeImage: | (void*) | image | |
width: | (size_t) | width | |
height: | (size_t) | height | |
bpp: | (size_t) | bpp | |
stride: | (size_t) | stride | |
results: | (NSMutableArray*) | results | |
maxBarcodes: | (int) | maxBarcodes | |
Looks for multiple barcodes in an image and, if found, returns the decoded values.
The types of barcodes that can be decoded will have been set earlier with a call to SetBarcodeTypes.
image | The image to search, in grayscale format with 8 bits per pixel. |
width | The image width in pixels (not including any padding). |
height | The image height in pixels. |
bpp | The pixel depth, in bits per pixel. |
stride | The number of bytes per row in the image, including any padding. |
results | The barcodes that are found in the image. This will always be a size of at least one, even when no barcodes are found. If no barcodes are found the return value will be something other than StatusOK and the first item in the array will give a description of the result. |
maxBarcodes | The maximum number of barcodes to search for. |
- (const char *) ReportVersion |
Reports the version of the recognition library.
- (void) ResumeRecognition |
Resumes sending images to the Barcode Xpress recognition library.
See PauseRecognition .
- (long) SetBarcodeTypes: | (long) | types |
Sets the barcode types that can be recognized in an image.
types | The set of types constructed via bitwise OR from constants defined in BarcodeConstants.h |
- (void) | (id) | sender | |
: | (SEL) | callback | |
Sets the callback to be executed each time an image is captured from the video camera.
The callback method returns void and takes a single parameter, which is the ID of a BXThreadData object. The BXThreadData object contains raw YUV420p (planar YUV) data copied from the video pixel buffer, as well as information about the image, such as width and height.
sender | ID of the object with the callback method to be invoked. |
callback | Selector of the callback method. |
- (void) | (id) | sender | |
: | (SEL) | callback | |
Sets the callback to be executed each time a thread begins to process an image captured from the video camera.
The callback method returns void and takes a single parameter, which is the ID of a BXThreadData object. The BXThreadData object contains raw YUV420p (planar YUV) data copied from the video pixel buffer, as well as information about the image, such as width and height.
sender | ID of the object with the callback method to be invoked. |
callback | Selector of the callback method. |
- (void) | (id) | sender | |
: | (SEL) | callback | |
Sets the callback to be executed each time the Barcode Xpress recognition library has found a barcode in an image, or has encountered an error.
The callback is not executed when no errors are encountered AND no barcodes were found in the image.
The callback method returns void and takes a single parameter, which is the ID of an NSDictionary object. The NSDictionary will contain two keys, "image" and "result". "image" is a UIImage*, and "result" is a BXResult*.
sender | ID of the object with the callback method to be invoked. |
callback | Selector of the callback method. |
- (void) StopRecognition |
Stops the process of gathering images from the video camera and sending them to the Barcode Xpress library for recognition.
Releases the video camera interface.