BSS QRCode Reader SDK (ver 1.2)
Description
SDK BSS QRCode Reader Win32 is a robust solution for decoding QRCode barcodes from the raster halftone images with a value of BPP (BitsPerPixel) equal 8. This SDK is Windows based. The document includes the description of software interface, the description of a package contents and instructions on how to build a sample project and examples of functions’ calls.
Structure of delivery
SDK BSS QRCode Reader Win32 is an archive which includes several components:
Components list
- Documentation (this document);
- Dynamic-linked libraries;
- Static library;
- Header file;
- Sample applications (console and GUI).
Description of Subdirectories
- include – Headers;
- examples – Sample applications;
- make - Project files of sample applications;
- doc – Documentation;
- lib – Import static library.
Activation
Trial version of the SDK can be used within 30 days on a standalone PC. During the first use (after 30 days trial period) of dynamic library from the delivery (for example when use a sample application) there will be a message with request to activate the copy of SDK. You will have to enter a License Key in the respective field. In order to receive it you will need to purchase the respective Commercial License at www.BarcodeSoftwareSolutions.com and send a System-ID and the version of used SDK to support@barcodesoftwaresolutions.com. Within 24 hours we will send the Commercial License Key.
Sample project
In order to compile a sample project you need to open .sln file which can be found in the “make” subdirectory. Select needed configuration to build (Release, Debug). Binary files will be created in the “bin” directory.
Projects’ configurations
SDK BSS QRCode Reader Win32 includes sample projects for Microsoft Visual Studio 8.0 IDE. There are two configurations in the delivery:
- Debug – Debug version of libraries, debug information is switched on, optimization is switched off;
- Release - optimization is switched on.
Program interface
The structure of SDK BSS QRCode Reader Win32 program interface is focused to provide developer with the easiest way to use SDK. There are only two plane C functions exported from dynamic library.
User data types
Structure bssQRCodeInfo contains information regarding read symbols of barcode.
typedef struct BSS_QRCodeInfo_Struct
{
int nCenterPosX;
int nCenterPosY;
int nDataLength;
char* pchData;
} bssQRCodeInfo;
- nCenterPosX - a central position of the barcode on the original image on the X axis;
- nCenterPosY – a central position of the barcode on the original image on the Y axis;
- nDataLength - a length of the decoded data (in bytes) contained in a read barcode;
- pchData - a pointer to the decoded barcode data.
Functions
Function BSS_ReadQRCode() search and decode a QRCode barcode or barcodes on the image and returns an array of structures with the decoded data.
int BSS_ReadQRCode
(
const unsigned char* pImageData,
int nImageWidth,
int nImageHeight,
int nImageRowDist,
int nTryReadMultiple,
bssQRCodeInfo** ppQRCodeInfo,
int* pnQRCodeInfoCount
);
- pImageData – a pointer to a grayscale image;
- nImageWidth – a width of the image in pixels;
- nImageHeight – a height of the image in pixels;
- nImageRowDist – a string length of the image in bytes;
- nTryReadMultiple – try to find and read multiple barcodes on the image (it can take more time);
- ppQRCodeInfo – pointer-to-pointer with an array of data structures;
- pnQRCodeInfoCount – a pointer to an integer specifying the number of structures in the array.
Return codes
- BSS_QR_OK - function was correctly completed. The results of reading were recorded in an array.
- BSS_QR_NOTFOUND - function was correctly completed, but there is no barcode on an image.
- BSS_QR_INVALIDARGS - function cannot work due to the incorrectly specified parameters.
- BSS_QR_OUTOFMEMORY – there was not enough available memory for a function.
Function BSS_ReleaseQRCodeResults() releases resources which were allocated during the barcode reading.
int BSS_ReleaseQRCodeResults
(
bssQRCodeInfo* pQRCodeInfo,
int nQRCodeInfoCount
);
- pQRCodeInfo - a pointer to an array of structures;
- nQRCodeInfoCount - a number of elements in an array.
Return codes
- BSS_QR_OK - function was correctly completed. The results of the reading recorded in an array.
- BSS_QR_INVALIDARGS - function cannot work due to the incorrectly specified parameters
Example
// Declare variables to store results
bssQRCodeInfo* pInfo;
int nInfoCnt;
// Call a barcode reading function
int nResult = BSS_ReadQRCode( …, &pInfo, &nInfoCnt );
// Check the return code, process (output) the results of reading
if( nResult == BSS_QR_OK )
for( int n = 0; n < nInfoCnt; n++ )
cout << n << " : " << pInfo[ n ].pchData << endl;
// Releasing resources
BSS_ReleaseQRCodeResults( pInfo, nInfoCnt );