00001 #ifndef __KSJ_API_BARCODEREADER_H__
00002 #define __KSJ_API_BARCODEREADER_H__
00003
00004
00005
00006 #ifdef KSJAPI_EXPORTS
00007 #define KSJ_API __declspec(dllexport)
00008 #elif defined KSJAPI_STATIC
00009 #define KSJ_API
00010 #else
00011 #define KSJ_API __declspec(dllimport)
00012 #endif
00013
00014 #ifndef IN
00015 #define IN
00016 #endif
00017
00018 #ifndef OUT
00019 #define OUT
00020 #endif
00021
00022 #ifndef OPTIONAL
00023 #define OPTIONAL
00024 #endif
00025
00026 #ifdef __cplusplus
00027 extern "C"{
00028 #endif
00029
00030
00041 KSJ_API int __stdcall KSJBR_CreateInstance(HANDLE* phReader);
00042
00050 KSJ_API int __stdcall KSJBR_DestroyInstance(HANDLE* phReader);
00051
00061 KSJ_API int __stdcall KSJBR_SetTimeOut(HANDLE hReader, int nTimeOutMS);
00062
00072 KSJ_API int __stdcall KSJBR_GetTimeOut(HANDLE hReader, int* pnTimeOutMS);
00073
00075 enum BARCODETYPE{
00076 BT_CODE39 = 0x1,
00077 BT_CODE128 = 0x2,
00078 BT_EAN13 = 0x20,
00079 BT_EAN8 = 0x40,
00080 BT_UPCA = 0x80,
00081 BT_UPCE = 0x100,
00082 BT_PDF417 = 0x02000000,
00083 BT_QRCODE = 0x04000000,
00084 BT_DATAMATRIX = 0x08000000,
00085 };
00086
00096 KSJ_API int __stdcall KSJBR_SetCodeType(HANDLE hReader, int nBarCodeTypes);
00097
00107 KSJ_API int __stdcall KSJBR_GetCodeType(HANDLE hReader, int* pnBarCodeTypes);
00108
00110 enum LOCALIZATIONMODE
00111 {
00112 LOC_AUTO = 0x01,
00113 LOC_CONNECTED_BLOCKS = 0x02,
00114 LOC_STATISTICS = 0x04,
00115 LOC_LINES = 0x08,
00116 LOC_SCAN_DIRECTLY = 0x10,
00117 LOC_STATISTICS_MARKS = 0x20,
00118 LOC_SKIP = 0x00
00119
00120 };
00121
00131 KSJ_API int __stdcall KSJBR_SetLocalizationMode(HANDLE hReader, int nLocalizationMode);
00132
00142 KSJ_API int __stdcall KSJBR_GetLocalizationMode(HANDLE hReader, int* pnLocalizationMode);
00143
00145 enum CODEGRAYTYPE
00146 {
00147 CT_DARK = 0x01,
00148 CT_BRIGHT = 0x02,
00149 CT_BOTH = 0x03,
00150 };
00151
00161 KSJ_API int __stdcall KSJBR_SetCodeGrayType(HANDLE hReader, CODEGRAYTYPE type);
00162
00172 KSJ_API int __stdcall KSJBR_GetCodeGrayType(HANDLE hReader, CODEGRAYTYPE* pType);
00173
00183 KSJ_API int __stdcall KSJBR_SetExpectedBarcodesCount(HANDLE hReader, int nCount);
00184
00194 KSJ_API int __stdcall KSJBR_GetExpectedBarcodesCount(HANDLE hReader, int* pnCount);
00195
00205 KSJ_API int __stdcall KSJBR_InitRuntimeSettingsWithFile(HANDLE hReader, const char* pSettingFile);
00206
00208 struct BarcodeResult
00209 {
00210 char* sczBarcode;
00211 int x[4];
00212 int y[4];
00213 };
00214
00216 struct BarcodeResultArray
00217 {
00218 int resultsCount;
00219 BarcodeResult* results;
00220 };
00221
00236 KSJ_API int __stdcall KSJBR_Decode(HANDLE hReader, BarcodeResultArray** pResults, unsigned char* pBufferBytes, int nWidth, int nHeight, int nStride);
00237
00246 KSJ_API void __stdcall KSJBR_FreeTextResults(BarcodeResultArray** pResults);
00247
00248
00249
00250 #ifdef __cplusplus
00251 }
00252 #endif
00253
00254 #endif