Barcode Xpress Mobile for iOS
|
Defines a class that handles the interactions between camera hardware, BXInterface (called by user programs), and the iOS wrapper around the native recognition library Barcode Xpress. More...
#import <BXRuntime.h>
Public Member Functions | |
(id) | - init |
Initialize. | |
(id) | - initWithLicense: |
Initialize with a license (required). | |
(void) | - StartCaptureSession |
Acquire the video camera, register the resolution and format of video frame we want to capture. | |
(void) | - StopCaptureSession |
Halt the acquisition of new video frames, release the queue to which they are sent, and release the video hardware. | |
(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 |
Stop the process of gathering images from the video camera and sending them to the Barcode Xpress library for recognition. | |
(void) | - PauseRecognition |
Pause recognition by no longer sending images to the Barcode Xpress recognition library. | |
(void) | - ResumeRecognition |
Resume sending images to the Barcode Xpress recognition library. | |
(void) | - SetCameraCallback:: |
Set the callback which will be executed each time an image is captured from the video camera. | |
(void) | - SetRecognitionCallback:: |
Set the callback which will be executed each time the Barcode Xpress recognition library has found a barcode in an image, or has encountered an error. | |
(void) | - SetProcessingCallback:: |
Set the callback which will be executed each time a thread begins to process an image captured from the video camera. | |
(enum Status) | - RecognizeImage:result: |
Look for a barcode in a UIImage and decode it. | |
(enum Status) | - RecognizeImage:width:height:stride:result: |
Look for a barcode in an image and, if found, return the decoded value. | |
(const char *) | - ReportVersion |
Report the version of the recognition library. | |
(long) | - SetBarcodeTypes: |
Set the barcode types that can be recognized in an image. | |
(AVCaptureSession *) | - GetCaptureSession |
Return a reference to the video capture session. | |
Public Attributes | |
long | m_numProcessedFrames |
The number of frames processed since the object was instantiated, or the most recent barcode recognition, whichever is most recent. | |
Properties | |
AVCaptureSession * | m_videoCaptureSession |
Video camera hardware manager. | |
long | m_barcodeTypes |
The types of barcodes that Barcode Xpress should search for and decode. | |
assign long | m_numProcessedFrames |
The number of frames processed since the object was instantiated, or the most recent barcode recognition, whichever is most recent. | |
id | m_cameraReceiver |
Object that has registered to receive messages when a video frame has been captured. | |
id | m_recognitionReceiver |
Object that has registered to receive messages when a barcode has been found, or when the recognition method encounters an error. | |
id | m_processingReceiver |
Object that has registered to receive messages when a thread begins to process an image in search of a barcode. | |
SEL | m_cameraCallback |
Method that will be called to receive messages when a video frame has been captured. | |
SEL | m_recognitionCallback |
Method that will be called to receive messages when a barcode has been found, or when the recognition method encounters an error. | |
SEL | m_processingCallback |
Method that will be called to receive messages when a thread begins to process an image in search of a barcode. | |
BOOL | m_isPaused |
Set TRUE when recognition should be paused. | |
BOOL | m_licenseAlertIsActive |
Set YES when an alert has been set because recognition was attempted with an invalid license. | |
BOOL | m_useBlurDetection |
Set TRUE when the iOS wrapper for Barcode Xpress should detect and filter out blurred images before sending to Barcode Xpress for recognition. | |
BXiOSAPI * | m_bxInterface |
Object that is the iOS wrapper around Barcode Xpress. | |
CGSize | cameraResolution |
The camera resolution that is being used. | |
BOOL | m_terminateBackgroundImageSource |
Set TRUE if the thread generated video frames from an alternate source (not the video camera) should terminate. |
Defines a class that handles the interactions between camera hardware, BXInterface (called by user programs), and the iOS wrapper around the native recognition library Barcode Xpress.
- (AVCaptureSession *) GetCaptureSession |
Return a reference to the video capture session.
- (id) init |
Initialize.
The number of frames processed since the object was instantiated, or the most recent barcode recognition, whichever is most recent.
Calls -initwithLicense.
Video camera hardware manager The types of barcodes that Barcode Xpress should search for and decode. Object that has registered to receive messages when a video frame has been captured. Object that has registered to receive messages when a barcode has been found, or when the recognition method encounters an error. Object that has registered to receive messages when a thread begins to process an image in search of a barcode. Method that will be called to receive messages when a video frame has been captured. Method that will be called to receive messages when a barcode has been found, or when the recognition method encounters an error. Method that will be called to receive messages when a thread begins to process an image in search of a barcode. Set TRUE when recognition should be paused. In that state, video frames are captured, but immediately released before sending them to the threads that would use Barcode Xpress to decode them. Set YES when an alert has been set because recognition was attempted with an invalid license. Set TRUE when the iOS wrapper for Barcode Xpress should detect and filter out blurred images before sending to Barcode Xpress for recognition. Object that is the iOS wrapper around Barcode Xpress. The camera resolution that is being used. This may differ from the actual camera max or min resolution. Set TRUE if the thread generated video frames from an alternate source (not the video camera) should terminate. The background thread is intended for use in the simulator, where the camera can't be accessed. It will be started only if the code to start it is uncommented in StartRecognition. Initialize. Calls -initwithLicense.
- (id) initWithLicense: | (BXLicense*) | inLicense |
Initialize with a license (required).
inLicense | A BXLicense created with information from a valid Accusoft license. The demonstration SDK does not require this information, but will only run for a short amount of time. |
- (void) PauseRecognition |
Pause recognition by no longer sending images to the Barcode Xpress recognition library.
The camera interface is not released.
- (enum Status) RecognizeImage: | (UIImage*) | image | |
result: | (BXResult **) | result | |
Look for a barcode in a UIImage and decode 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 searched. |
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. |
- (enum Status) RecognizeImage: | (void*) | image | |
width: | (size_t) | width | |
height: | (size_t) | height | |
stride: | (size_t) | stride | |
result: | (BXResult **) | result | |
Look for a barcode in an image and, if found, return 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 searched, in grayscale format with 8 bits per pixel. |
width | The image width in pixels (not including any padding). |
height | The image height in pixels. |
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. |
- (const char *) ReportVersion |
Report the version of the recognition library.
- (void) ResumeRecognition |
Resume sending images to the Barcode Xpress recognition library.
See -PauseRecognition.
- (long) SetBarcodeTypes: | (long) | types |
Set 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) | receiver | |
: | (SEL) | callback | |
Set the callback which will 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.
receiver | ID of the object with the callback method to be invoked. |
callback | Selector of the callback method. |
- (void) | (id) | receiver | |
: | (SEL) | callback | |
Set the callback which will 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.
receiver | ID of the object with the callback method to be invoked. |
callback | Selector of the callback method. |
- (void) | (id) | receiver | |
: | (SEL) | callback | |
Set the callback which will 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*.
receiver | ID of the object with the callback method to be invoked. |
callback | Selector of the callback method. |
- (void) StopRecognition |
Stop the process of gathering images from the video camera and sending them to the Barcode Xpress library for recognition.
Releases the video camera interface.
- (CGSize) cameraResolution [read, write, assign] |
The camera resolution that is being used.
This may differ from the actual camera max or min resolution.
- (BOOL) m_isPaused [read, write, assign] |
Set TRUE when recognition should be paused.
In that state, video frames are captured, but immediately released before sending them to the threads that would use Barcode Xpress to decode them.
- (BOOL) m_terminateBackgroundImageSource [read, write, assign] |
Set TRUE if the thread generated video frames from an alternate source (not the video camera) should terminate.
The background thread is started only if code is uncommented in StartRecognition, and is intended for use while in the simulator (which doesn't have a camera to supply imagery).