Barcode Xpress Mobile for iOS
|
Defines a class that manages the threads using Barcode Xpress to perform recognition and decoding of images. More...
#import <BXThreadQueue.h>
Instance Methods | |
(id) | - init |
Initializes an empty thread queue. More... | |
(id) | - initWithInfo:threadcount:sender:executioncallback:processingcallback: |
Initializes the thread control data structures. More... | |
(void) | - dispatch: |
Creates a new thread to perform recognition on an image, if a thread in the queue is available. More... | |
(bool) | - canDispatch |
Tests if there is a slot in the thread queue that is not being used by an active thread. More... | |
(bool) | - canDispatch: |
Tests if there is a slot in the thread queue that is not being used by an active thread. More... | |
Protected Attributes | |
int | m_threadCount |
An int specifying the maximum number of threads to use. | |
bool * | m_threadUsed |
A boolean array of length m_threadCount. More... | |
NSLock * | m_captureMutex |
Mutex used to synchronize access to thread control data structures. | |
id | m_sender |
Object instance that will execute callbacks. | |
NSString * | m_name |
A string representing the name of the thread queue. Set any arbitrary name. | |
SEL | m_executionCallback |
Callback function to be executed to perform recognition. | |
SEL | m_processingCallback |
Callback function to be executed before recognition is performed. | |
Defines a class that manages the threads using Barcode Xpress to perform recognition and decoding of images.
- (bool) canDispatch |
Tests if there is a slot in the thread queue that is not being used by an active thread.
- (bool) canDispatch: | (int*) | pIndex |
Tests if there is a slot in the thread queue that is not being used by an active thread.
pIndex | Address of an int that will contain the first available queue slot number if any are not being used by active threads. This return parameter will not be changed if the method returns FALSE. |
- (void) dispatch: | (BXThreadData*) | threadData |
Creates a new thread to perform recognition on an image, if a thread in the queue is available.
threadData | This object contains a pointer to an image captured from the video camera, information about the image, and the ID of the thread that this is executing on. See BXThreadData. The image is byte data in YUV420p (planar) format. This format provides grayscale data without having to perform a conversion before calling the Barcode Xpress recognition methods. |
- (id) init |
Initializes an empty thread queue.
Without any callbacks, and with a maximum thread count of zero, it won't be useful to call this method. Call initWithInfo:threadcount:sender:executioncallback:processingcallback: instead.
- (id) initWithInfo: | (NSString*) | name | |
threadcount: | (int) | threadCount | |
sender: | (id) | sender | |
executioncallback: | (SEL) | executionCallback | |
processingcallback: | (SEL) | processingCallback | |
Initializes the thread control data structures.
name | An abitrary name for the thread queue. |
threadCount | Maximum number of active threads. |
sender | Object instance that will execute callbacks. |
executionCallback | Callback executed to perform recognition. |
processingCallback | Callback executed before recognition is performed. |
|
protected |
A boolean array of length m_threadCount.
Each boolean is TRUE if a thread is currently performing an executionCallback.