diff --git a/.travis.yml b/.travis.yml index db36cf7..6cdf84d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ jobs: branches: only: - - master + - main script: - mkdir build diff --git a/BarcodeReader.cxx b/BarcodeReader.cxx index 373c3f8..97cdd33 100644 --- a/BarcodeReader.cxx +++ b/BarcodeReader.cxx @@ -9,98 +9,121 @@ using namespace std; using namespace dynamsoft::dbr; #if defined(LINUX) || defined(MACOS) - #include +#include -int gettime() +int gettime() { - struct timeval time; + struct timeval time; gettimeofday(&time, NULL); - return (int)(time.tv_sec * 1000 * 1000 + time.tv_usec) / 1000; -} + return (int)(time.tv_sec * 1000 * 1000 + time.tv_usec) / 1000; +} #else -int gettime() +int gettime() { return (int)(GetTickCount()); } #endif -char* read_file_text(const char* filename) { - FILE *fp = fopen(filename, "r"); - size_t size; - char *text = NULL; +char *read_file_text(const char *filename) +{ + FILE *fp = fopen(filename, "r"); + size_t size; + char *text = NULL; if (fp) { fseek(fp, 0, SEEK_END); size = ftell(fp); } - else { + else + { cout << "Fail to open file" << endl; return NULL; } rewind(fp); text = (char *)calloc((size + 1), sizeof(char)); - if (text == NULL) {fputs ("Memory error",stderr); return NULL;} - + if (text == NULL) + { + fputs("Memory error", stderr); + return NULL; + } + char c; char *tmp = text; - do { - c = fgetc (fp); - *tmp = c; - tmp++; - } while (c != EOF); - fclose (fp); + do + { + c = fgetc(fp); + *tmp = c; + tmp++; + } while (c != EOF); + fclose(fp); return text; } -unsigned char * read_file_binary(const char* filename, int* out_size) { - FILE *fp = fopen(filename, "rb"); - size_t size; - unsigned char *buffer = NULL; +unsigned char *read_file_binary(const char *filename, int *out_size) +{ + FILE *fp = fopen(filename, "rb"); + size_t size; + unsigned char *buffer = NULL; if (fp) { fseek(fp, 0, SEEK_END); size = ftell(fp); } - else { + else + { cout << "Fail to open file" << endl; return NULL; } rewind(fp); - buffer = ( unsigned char *)malloc(sizeof( unsigned char) * size); - if (buffer == NULL) {fputs ("Memory error",stderr); return NULL;} + buffer = (unsigned char *)malloc(sizeof(unsigned char) * size); + if (buffer == NULL) + { + fputs("Memory error", stderr); + return NULL; + } size_t result = fread(buffer, 1, size, fp); *out_size = size; - if (result != size) {fputs ("Reading error",stderr); return NULL;} - fclose (fp); + if (result != size) + { + fputs("Reading error", stderr); + return NULL; + } + fclose(fp); return buffer; } -int barcode_decoding(const unsigned char* buffer, int size, int formats, int threadcount, char* license, char* config) +int barcode_decoding(const unsigned char *buffer, int size, int formats, int threadcount, char *license, char *config) { std::thread::id thread_id = std::this_thread::get_id(); + if (license) + { + char errorMsgBuffer[512]; + // Click https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr to get a trial license. + DBR_InitLicense(license, errorMsgBuffer, 512); + printf("DBR_InitLicense: %s\n", errorMsgBuffer); + } + // Initialize Dynamsoft Barcode Reader - void* reader = DBR_CreateInstance(); - const char* version = DBR_GetVersion(); + void *reader = DBR_CreateInstance(); + const char *version = DBR_GetVersion(); printf("DBR version: %s\n", version); - - - if (license) {DBR_InitLicense (reader, license);} // Load the configuration from a template file if (config) { char szErrorMsg[256]; int ret = DBR_InitRuntimeSettingsWithString(reader, config, CM_OVERWRITE, szErrorMsg, 256); - if (ret) printf("Template status: %s\n\n", szErrorMsg); + if (ret) + printf("Template status: %s\n\n", szErrorMsg); } // Update the parameters char sError[512]; - PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings(); + PublicRuntimeSettings *runtimeSettings = new PublicRuntimeSettings(); DBR_GetRuntimeSettings(reader, runtimeSettings); runtimeSettings->maxAlgorithmThreadCount = threadcount; runtimeSettings->barcodeFormatIds = formats; @@ -112,7 +135,7 @@ int barcode_decoding(const unsigned char* buffer, int size, int formats, int thr int iRet = DBR_DecodeFileInMemory(reader, buffer, (int)size, ""); int endtime = gettime(); int timecost = endtime - starttime; - + // Output barcode result if (iRet != DBR_OK && iRet != DBRERR_MAXICODE_LICENSE_INVALID && iRet != DBRERR_AZTEC_LICENSE_INVALID && iRet != DBRERR_LICENSE_EXPIRED && iRet != DBRERR_QR_LICENSE_INVALID && iRet != DBRERR_GS1_COMPOSITE_LICENSE_INVALID && iRet != DBRERR_1D_LICENSE_INVALID && iRet != DBRERR_PDF417_LICENSE_INVALID && iRet != DBRERR_DATAMATRIX_LICENSE_INVALID && iRet != DBRERR_GS1_DATABAR_LICENSE_INVALID && iRet != DBRERR_PATCHCODE_LICENSE_INVALID) @@ -123,22 +146,22 @@ int barcode_decoding(const unsigned char* buffer, int size, int formats, int thr TextResultArray *paryResult = NULL; DBR_GetAllTextResults(reader, &paryResult); - + if (paryResult->resultsCount == 0) { printf("No barcode found.\n"); DBR_FreeTextResults(&paryResult); return -1; } - + printf("Thread id: %d. Total barcode(s) found: %d. Time cost: %d ms\n\n", thread_id, paryResult->resultsCount, timecost); - - // for (int index = 0; index < paryResult->resultsCount; index++) - // { - // printf("Barcode %d:\n", index + 1); - // printf(" Type: %s\n", paryResult->results[index]->barcodeFormatString); - // printf(" Text: %s\n", paryResult->results[index]->barcodeText); - // } + + for (int index = 0; index < paryResult->resultsCount; index++) + { + printf("Barcode %d:\n", index + 1); + printf(" Type: %s\n", paryResult->results[index]->barcodeFormatString); + printf(" Text: %s\n", paryResult->results[index]->barcodeText); + } DBR_FreeTextResults(&paryResult); @@ -146,71 +169,74 @@ int barcode_decoding(const unsigned char* buffer, int size, int formats, int thr return timecost; } -void ToHexString(unsigned char* pSrc, int iLen, char* pDest) +void ToHexString(unsigned char *pSrc, int iLen, char *pDest) { - const char HEXCHARS[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + const char HEXCHARS[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; int i; - char* ptr = pDest; + char *ptr = pDest; - for(i = 0; i < iLen; ++i) + for (i = 0; i < iLen; ++i) { - snprintf(ptr, 4, "%c%c ", HEXCHARS[ ( pSrc[i] & 0xF0 ) >> 4 ], HEXCHARS[ ( pSrc[i] & 0x0F ) >> 0 ]); + snprintf(ptr, 4, "%c%c ", HEXCHARS[(pSrc[i] & 0xF0) >> 4], HEXCHARS[(pSrc[i] & 0x0F) >> 0]); ptr += 3; } } -void multi_thread_performance(int processor_count, unsigned char *buffer, int size, int formats, char* license, char* config) +void multi_thread_performance(int processor_count, unsigned char *buffer, int size, int formats, char *license, char *config) { int minimum_count = 1, minimum_timecost = 0; - for (int i = 0; i < processor_count; i++) + for (int i = 0; i < processor_count; i++) { printf("Thread count: %d. ", i + 1); int timecost = barcode_decoding(buffer, size, formats, i, license, config); - if (i == 0) + if (i == 0) { - minimum_count = 1; + minimum_count = 1; if (timecost > 0) { - minimum_timecost = timecost; + minimum_timecost = timecost; } } - else { + else + { if (timecost < minimum_timecost) { minimum_count = i + 1; - minimum_timecost = timecost; + minimum_timecost = timecost; } } } printf("Multi-thread best performance: thread_count = %d, timecost = %d \n\n", minimum_count, minimum_timecost); } -int main(int argc, const char* argv[]) +int main(int argc, const char *argv[]) { const auto processor_count = std::thread::hardware_concurrency(); printf("CPU threads: %d\n\n", processor_count); printf("Barcode Reader Version %d.%d\n\n", - BarcodeReader_VERSION_MAJOR, BarcodeReader_VERSION_MINOR); + BarcodeReader_VERSION_MAJOR, BarcodeReader_VERSION_MINOR); - if (argc < 2) { + if (argc < 2) + { printf("Usage: BarcodeReader [image-file] [optional: license-file] [optional: template-file] \n"); - return 0; + return 0; } - char* license = NULL; - char* config = NULL; - switch(argc) { - case 4: + char *license = NULL; + char *config = NULL; + switch (argc) + { + case 4: config = read_file_text(argv[3]); - case 3: + case 3: license = read_file_text(argv[2]); } int size = 0; - unsigned char* buffer = read_file_binary(argv[1], &size); - if (!buffer) return 0; - + unsigned char *buffer = read_file_binary(argv[1], &size); + if (!buffer) + return 0; // Call decoding methods on the main thread printf("---------------- Single thread decoding performance ----------------\n\n"); @@ -227,7 +253,7 @@ int main(int argc, const char* argv[]) // Call decoding methods on worker threads printf("---------------- Decoding barcodes on worker threads ----------------\n\n"); int starttime = gettime(); - // thread t1(barcode_decoding, buffer, size, BF_ONED); + // thread t1(barcode_decoding, buffer, size, BF_ONED); thread t2(barcode_decoding, buffer, size, BF_QR_CODE, 1, license, config); thread t3(barcode_decoding, buffer, size, BF_PDF417, 1, license, config); thread t4(barcode_decoding, buffer, size, BF_DATAMATRIX, 1, license, config); @@ -248,7 +274,7 @@ int main(int argc, const char* argv[]) // All printf("-------------------------------- All --------------------------------\n\n"); multi_thread_performance((int)processor_count, buffer, size, BF_ALL, license, config); - + free(license); free(config); free(buffer); diff --git a/README.md b/README.md index 9b42d90..0715745 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ # Building C/C++ Barcode Reader with CMake [![release](https://img.shields.io/github/release/Dynamsoft/cmake.svg)](https://github.com/Dynamsoft/cmake/releases/latest) -[![Travis CI status](https://img.shields.io/travis/dynamsoft/cmake/master?label=Travis%20CI&logo=travis)](https://travis-ci.com/github/Dynamsoft/cmake) -## What You Should Know -- [![](https://img.shields.io/badge/Download-Offline%20SDK-orange)](https://www.dynamsoft.com/barcode-reader/downloads) -- [![](https://img.shields.io/badge/Get-30--day%20FREE%20Trial%20License-blue)](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr) +## SDK Version +[v9.0](https://www.dynamsoft.com/barcode-reader/downloads) + +## SDK Activation +Click [here](https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr) to get a trial license. ## Supported Platforms - Windows x86/x64 @@ -17,13 +18,9 @@ Set the license key in `BarcodeReader.cxx`: ```cpp -DBR_InitLicense(reader, "LICENSE-KEY"); +DBR_InitLicense(license, errorMsgBuffer, 512); ``` -## Contact Us -- support@dynamsoft.com -- https://www.dynamsoft.com/Company/Contact.aspx - ## Windows 1. Create a **build** folder: ``` @@ -48,7 +45,7 @@ DBR_InitLicense(reader, "LICENSE-KEY"); ``` 3. Run the app: ``` - Release\BarcodeReader [image-file] [optional: license-file] [optional: template-file] + .\Release\BarcodeReader.exe [image-file] [optional: license-file] [optional: template-file] ``` ## Linux and Raspberry Pi OS diff --git a/dbr.json b/dbr.json deleted file mode 100644 index b3d3da5..0000000 --- a/dbr.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "title": "JSON schema for DBR configuration files", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "A representation of Dynamsoft Barcode Reader template.", - "type": "object", - "required": ["Version", "ImageParameters"], - "properties": { - "Version": { - "description": "The template version number.", - "type": "string", - "enum": [ - "1.0" - ] - }, - "ImageParameters": { - "description": "Parameters for barcode detection", - "type": "object", - "required": [ - "Name" - ], - "properties": { - "Name": { - "description": "The name of the ImageParameters object", - "type": "string", - "maxLength": 50, - "minLength": 1 - }, - "Description": { - "description": "The description of the ImageParameters object", - "type": "string" - }, - "BarcodeFormatIds": { - "description": "Sets which types of barcode to be read. Barcode types can be combined", - "type": "array", - "items": { - "type": "string", - "enum": [ - "All", "OneD", "CODE_39", "CODE_128", "CODE_93", "CODABAR", "ITF", "EAN_13", "EAN_8", "UPC_A", "UPC_E", "INDUSTRIAL_25", "PDF417", "QR_CODE", "DATAMATRIX" - ] - } - }, - "MaxBarcodesCount": { - "description": "Sets the maximum number of barcodes to read", - "type": "number", - "maximum": 2147483647, - "minimum": 1, - "default": 2147483647 - }, - "Timeout": { - "description": "Sets the maximum amount of time (in milliseconds) it should spend searching for a barcode per page", - "type": "number", - "maximum": 2147483647, - "minimum": 0, - "default": 2147483647 - }, - "ScaleDownThreshold": { - "description": "Sets the threshold value of the image shrinking", - "type": "number", - "maximum": 2147483647, - "minimum": 512, - "default": 2048 - }, - "DeblurLevel": { - "description": "The blurriness of the barcode", - "type": "number", - "maximum": 9, - "minimum": 0, - "default": 5 - } - } - } - } -} \ No newline at end of file diff --git a/include/DynamsoftBarcodeReader.h b/include/DynamsoftBarcodeReader.h index e1c5b77..e17f2ce 100644 --- a/include/DynamsoftBarcodeReader.h +++ b/include/DynamsoftBarcodeReader.h @@ -202,6 +202,8 @@ typedef void* HANDLE; /**The DotCode license is invalid. */ #define DBRERR_DOTCODE_LICENSE_INVALID -10061 +#define DBRERR_PHARMACODE_LICENSE_INVALID -10062 + /** * @}defgroup ErrorCode */ @@ -382,13 +384,13 @@ typedef enum BarcodeFormat { /**All supported formats in BarcodeFormat group 1*/ #if defined(_WIN32) || defined(_WIN64) - BF_ALL = 0xFE1FFFFF, + BF_ALL = 0xFE3FFFFF, #else - BF_ALL = -31457281, + BF_ALL = -29360129, #endif /**Combined value of BF_CODABAR, BF_CODE_128, BF_CODE_39, BF_CODE_39_Extended, BF_CODE_93, BF_EAN_13, BF_EAN_8, INDUSTRIAL_25, BF_ITF, BF_UPC_A, BF_UPC_E, BF_MSI_CODE; */ - BF_ONED = 0x001007FF, + BF_ONED = 0x003007FF, /**Combined value of BF_GS1_DATABAR_OMNIDIRECTIONAL, BF_GS1_DATABAR_TRUNCATED, BF_GS1_DATABAR_STACKED, BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL, BF_GS1_DATABAR_EXPANDED, BF_GS1_DATABAR_EXPANDED_STACKED, BF_GS1_DATABAR_LIMITED*/ BF_GS1_DATABAR = 0x0003F800, @@ -481,6 +483,9 @@ typedef enum BarcodeFormat /**MSI Code*/ BF_MSI_CODE = 0x100000, + /*Code 11*/ + BF_CODE_11 = 0x200000, + /**No barcode format in BarcodeFormat group 1*/ BF_NULL = 0x00 @@ -519,7 +524,16 @@ typedef enum BarcodeFormat_2 BF2_RM4SCC = 0x01000000, /**DotCode.*/ - BF2_DOTCODE = 0x02 + BF2_DOTCODE = 0x02, + + /**_PHARMACODE_ONE_TRACK.*/ + BF2_PHARMACODE_ONE_TRACK = 0x04, + + /**PHARMACODE_TWO_TRACK.*/ + BF2_PHARMACODE_TWO_TRACK = 0x08, + + /**PHARMACODE.*/ + BF2_PHARMACODE = 0x0C }BarcodeFormat_2; @@ -932,6 +946,9 @@ typedef enum LocalizationMode /**Localizes barcodes from the centre of the image. Check @ref LM for available argument settings. */ LM_CENTRE = 0x80, + /**Localizes 1D barcodes fast. Check @ref LM for available argument settings. */ + LM_ONED_FAST_SCAN = 0x100, + /**Reserved setting for localization mode.*/ #if defined(_WIN32) || defined(_WIN64) LM_REV = 0x80000000, @@ -990,6 +1007,12 @@ typedef enum DeformationResistingMode /**Resists deformation using the general algorithm. Check @ref DRM for available argument settings.*/ DRM_GENERAL = 0x02, + /**Resists deformation when the barcode is warped gently.*/ + DRM_BROAD_WARP = 0x04, + /**Resists deformation for barcodes with minor deformation in local modules.*/ + DRM_LOCAL_REFERENCE = 0x08, + /**Resists deformation for barcodes on a wrinkled surface.*/ + DRM_DEWRINKLE = 0x10, /**Reserved setting for deformation resisting mode.*/ #if defined(_WIN32) || defined(_WIN64) @@ -1289,6 +1312,12 @@ typedef enum DeblurMode DM_SKIP = 0x00 }DeblurMode; +typedef enum PartitionMode +{ + PM_WHOLE_BARCODE = 0x01, + PM_ALIGNMENT_PARTITION = 0x02 +}PartitionMode; + /** * @} defgroup Enum Enumerations */ @@ -2742,14 +2771,6 @@ extern "C" { * * @return The error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - int errorCode = DBR_DecodeFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - const char* errorString = DBR_GetErrorString(errorCode); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API const char* DBR_GetErrorString(int errorCode); @@ -2758,10 +2779,6 @@ extern "C" { * * @return The version info string. * - * @par Code Snippet: - * @code - const char* versionInfo = DBR_GetVersion(); - * @endcode */ DBR_API const char* DBR_GetVersion(); @@ -2783,12 +2800,6 @@ extern "C" { * @par Remarks: * Partial of the decoding result will be masked with "*" without a valid license key. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API void* DBR_CreateInstance(); @@ -2797,12 +2808,6 @@ extern "C" { * * @param [in] barcodeReader Handle of the barcode reader instance. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API void DBR_DestroyInstance(void* barcodeReader); @@ -2882,20 +2887,15 @@ extern "C" { /** * Reads product key and activates the SDK. * - * @param [in] barcodeReader Handle of the barcode reader instance. * @param [in] pLicense The product keys. + * @param [in, out] errorMsgBuffer The buffer is allocated by caller and the recommending length is 256. The error message will be copied to the buffer. + * @param [in] errorMsgBufferLen The length of allocated buffer. * * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - DBR_DestroyInstance(barcodeReader); - * @endcode */ - DBR_API int DBR_InitLicense(void* barcodeReader, const char* pLicense); + DBR_API int DBR_InitLicense(const char* pLicense, char errorMsgBuffer[], const int errorMsgBufferLen); /** * Initializes barcode reader license and connects to the specified server for online verification. @@ -2978,14 +2978,6 @@ extern "C" { * * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. - * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - int errorCode = DBR_DecodeFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API int DBR_DecodeFile(void* barcodeReader, const char* pFileName, const char* pTemplateName); @@ -3000,17 +2992,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - unsigned char* pFileBytes; - int nFileSize = 0; - GetFileStream("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", &pFileBytes, &nFileSize); - int errorCode = DBR_DecodeFileInMemory(barcodeReader, pFileBytes, nFileSize, ""); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API int DBR_DecodeFileInMemory(void* barcodeReader, const unsigned char* pFileBytes, const int fileSize, const char* pTemplateName); @@ -3028,19 +3009,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - unsigned char* pBufferBytes; - int iWidth = 0; - int iHeight = 0; - int iStride = 0; - ImagePixelFormat format; - GetBufferFromFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", &pBufferBytes, &iWidth, &iHeight, &iStride, &format); - int errorCode = DBR_DecodeBuffer(barcodeReader, pBufferBytes, iWidth, iHeight, iStride, format, ""); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API int DBR_DecodeBuffer(void* barcodeReader, const unsigned char* pBufferBytes, const int width, const int height, const int stride, const ImagePixelFormat format, const char* pTemplateName); @@ -3054,18 +3022,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - unsigned char* pBufferBytes; - int nFileSize = 0; - GetFileStream("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", &pFileBytes, &nFileSize); - char* strBase64String; - GetFileBase64String(pBufferBytes, &strBase64String); - int errorCode = DBR_DecodeBase64String(barcodeReader, strBase64String, ""); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API int DBR_DecodeBase64String(void* barcodeReader, const char* pBase64String, const char* pTemplateName); @@ -3079,15 +3035,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - HANDLE pDIB; - GetDIBFromImage("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", &pDIB); - int errorCode = DBR_DecodeDIB(barcodeReader, pDIB, ""); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API int DBR_DecodeDIB(void* barcodeReader, const HANDLE hDIB, const char* pTemplateName); @@ -3137,14 +3084,6 @@ extern "C" { * DBRERR_PARAMETER_VALUE_INVALID; * DBRERR_NULL_POINTER; * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - int errorCode = DBR_StartFrameDecoding(barcodeReader, 2, 10, 1024, 720, 1024, IPF_GRAYSCALED, ""); - DBR_DestroyInstance(barcodeReader); - * @endcode - * */ DBR_API int DBR_StartFrameDecoding(void *barcodeReader, const int maxQueueLength, const int maxResultQueueLength, const int width, const int height, const int stride, const ImagePixelFormat format, const char *pTemplateName); @@ -3162,32 +3101,6 @@ extern "C" { * DBRERR_PARAMETER_VALUE_INVALID; * DBRERR_NULL_POINTER; * - * @par Code Snippet: - * @code - * void* barcodeReader = DBR_CreateInstance(); - * DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - * FrameDecodingParameters parameters; - * int errorCode = DBR_InitFrameDecodingParameters(barcodeReader, ¶meters); - * if(errorCode == DBR_OK) - * { - * parameters.maxQueueLength = 3; - * parameters.maxResultQueueLength = 10; - * parameters.width = 1024; - * parameters.height = 720; - * parameters.stride = 1024; - * parameters.imagePixelFormat = IPF_GRAYSCALED; - * parameters.region.regionMeasuredByPercentage = 1; - * parameters.region.regionTop = 0; - * parameters.region.regionBottom = 100; - * parameters.region.regionLeft = 0; - * parameters.region.regionRight = 100; - * parameters.threshold = 0.01; - * parameters.fps = 0; - * int errorCode = DBR_StartFrameDecodingEx(barcodeReader, parameters, ""); - * DBR_DestroyInstance(barcodeReader); - * } - * @endcode - * */ DBR_API int DBR_StartFrameDecodingEx(void *barcodeReader, FrameDecodingParameters parameters, const char* pTemplateName); @@ -3199,14 +3112,6 @@ extern "C" { * * @return Returns the ID of the appended frame. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - int frameId = DBR_AppendFrame(barcodeReader, pBufferBytes); - DBR_DestroyInstance(barcodeReader); - * @endcode - * */ DBR_API int DBR_AppendFrame(void *barcodeReader, unsigned char *pBufferBytes); @@ -3216,15 +3121,6 @@ extern "C" { * @param [in] barcodeReader Handle of the barcode reader instance. * * @return Returns the length of the inner frame queue. - * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - int frameLength = DBR_GetLengthOfFrameQueue(barcodeReader); - DBR_DestroyInstance(barcodeReader); - * @endcode - * */ DBR_API int DBR_GetLengthOfFrameQueue(void *barcodeReader); @@ -3238,14 +3134,6 @@ extern "C" { * DBR_OK; * DBRERR_STOP_DECODING_THREAD_FAILED; * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - int errorCode = DBR_StopFrameDecoding(barcodeReader); - DBR_DestroyInstance(barcodeReader); - * @endcode - * */ DBR_API int DBR_StopFrameDecoding(void *barcodeReader); @@ -3274,18 +3162,6 @@ extern "C" { * DBR_GetErrorString() to get detailed error message. Possible returns are: * DBR_OK; * DBRERR_SET_MODE_ARGUMENT_ERROR; - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - PublicRuntimeSettings settings; - DBR_GetRuntimeSettings(barcodeReader, &settings); - settings.binarizationModes[0] = BM_LOCAL_BLOCK; - char errorMessage[256]; - DBR_UpdateRuntimeSettings(barcodeReader, &settings, errorMessage, 256); - DBR_SetModeArgument(barcodeReader, "BinarizationModes", 0, "EnableFillBinaryVacancy", "1", errorMessage, 256); - DBR_DestroyInstance(barcodeReader); - * @endcode * * @par Remarks: * Check @ref ModesArgument for available argument settings @@ -3309,20 +3185,6 @@ extern "C" { * DBR_GetErrorString to get detail message. Possible returns are: * DBR_OK; * DBRERR_GET_MODE_ARGUMENT_ERROR; - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - PublicRuntimeSettings settings; - DBR_GetRuntimeSettings(barcodeReader, &settings); - settings.binarizationModes[0] = BM_LOCAL_BLOCK; - char errorMessage[256]; - char argumentValue[480]; - DBR_UpdateRuntimeSettings(barcodeReader, &settings, errorMessage, 256); - DBR_SetModeArgument(barcodeReader, "BinarizationModes", 0, "EnableFillBinaryVacancy", "1", errorMessage, 256); - DBR_GetModeArgument(barcodeReader, "BinarizationModes", 0, "EnableFillBinaryVacancy", argumentValue, 480, errorMessage, 256); - DBR_DestroyInstance(barcodeReader); - * @endcode * * @par Remarks: * Check @ref ModesArgument for available argument settings @@ -3338,14 +3200,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - PublicRuntimeSettings settings; - int errorCode = DBR_GetRuntimeSettings(barcodeReader, &settings); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API int DBR_GetRuntimeSettings(void* barcodeReader, PublicRuntimeSettings *pSettings); @@ -3361,17 +3215,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - PublicRuntimeSettings settings; - int errorCode = DBR_GetRuntimeSettings(barcodeReader, &settings); - settings.deblurLevel = 9; - char errorMessage[256]; - DBR_UpdateRuntimeSettings(barcodeReader, &settings, errorMessage, 256); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API int DBR_UpdateRuntimeSettings(void* barcodeReader, PublicRuntimeSettings *pSettings, char errorMsgBuffer[], const int errorMsgBufferLen); @@ -3383,17 +3226,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - PublicRuntimeSettings settings; - int errorCode = DBR_GetRuntimeSettings(barcodeReader, &settings); - settings.deblurLevel = 9; - DBR_UpdateRuntimeSettings(barcodeReader, &settings); - DBR_ResetRuntimeSettings(barcodeReader); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API int DBR_ResetRuntimeSettings(void* barcodeReader); @@ -3420,14 +3252,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - char errorMessage[256]; - DBR_InitRuntimeSettingsWithFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessage, 256); - DBR_DestroyInstance(barcodeReader); - * @endcode * * @sa CFunctions PublicRuntimeSettings */ @@ -3447,14 +3271,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. YOu can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - char errorMessage[256]; - DBR_InitRuntimeSettingsWithString(barcodeReader, "{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_OVERWRITE, errorMessage, 256); - DBR_DestroyInstance(barcodeReader); - * @endcode * * @sa CFunctions PublicRuntimeSettings */ @@ -3474,14 +3290,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - char errorMessage[256]; - DBR_AppendTplFileToRuntimeSettings(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_IGNORE, errorMessage, 256); - DBR_DestroyInstance(barcodeReader); - * @endcode * * @sa CFunctions PublicRuntimeSettings */ @@ -3501,14 +3309,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - char errorMessage[256]; - DBR_AppendTplStringToRuntimeSettings(barcodeReader, "{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessage, 256); - DBR_DestroyInstance(barcodeReader); - * @endcode * * @sa CFunctions PublicRuntimeSettings */ @@ -3521,17 +3321,6 @@ extern "C" { * * @return Returns the count of parameter templates. Returns -1 if DBRERR_NULL_POINTER happens. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - DBR_InitRuntimeSettingsWithFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - DBR_AppendTplStringToRuntimeSettings(barcodeReader, "{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - int currentTemplateCount = DBR_GetParameterTemplateCount(barcodeReader); - DBR_DestroyInstance(barcodeReader); - * @endcode * */ DBR_API int DBR_GetParameterTemplateCount(void* barcodeReader); @@ -3548,21 +3337,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - DBR_InitRuntimeSettingsWithFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - DBR_AppendTplStringToRuntimeSettings(barcodeReader, "{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - int currentTemplateCount = DBR_GetParameterTemplateCount(barcodeReader); - int templateIndex = 1; - // notice that the value of 'templateIndex' should less than currentTemplateCount. - char templateName[256]; - DBR_GetParameterTemplateName(barcodeReader, templateIndex, templateName, 256); - DBR_DestroyInstance(barcodeReader); - * @endcode * */ DBR_API int DBR_GetParameterTemplateName(void* barcodeReader, const int index, char nameBuffer[], const int nameBufferLen); @@ -3578,18 +3352,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - DBR_InitRuntimeSettingsWithFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - DBR_AppendTplStringToRuntimeSettings(barcodeReader, "{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - char pContent[256]; - DBR_OutputSettingsToString(barcodeReader, pContent, 256, "currentRuntimeSettings"); - DBR_DestroyInstance(barcodeReader); - * @endcode * */ DBR_API int DBR_OutputSettingsToString(void* barcodeReader, char content[], const int contentLen, const char* pSettingsName); @@ -3604,19 +3366,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - DBR_InitRuntimeSettingsWithFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - DBR_AppendTplStringToRuntimeSettings(barcodeReader, "{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - char* pContent = NULL; - DBR_OutputSettingsToStringPtr(barcodeReader, &pContent, "currentRuntimeSettings"); - DBR_FreeSettingsString(&pContent); - DBR_DestroyInstance(barcodeReader); - * @endcode * */ DBR_API int DBR_OutputSettingsToStringPtr(void* barcodeReader, char** content, const char* pSettingsName); @@ -3626,19 +3375,6 @@ extern "C" { * * @param [in] content The runtime settings string. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - DBR_InitRuntimeSettingsWithFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - DBR_AppendTplStringToRuntimeSettings(barcodeReader, "{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - char* pContent = NULL; - DBR_OutputSettingsToString(barcodeReader, &pContent, "currentRuntimeSettings"); - DBR_FreeSettingsString(&pContent); - DBR_DestroyInstance(barcodeReader); - * @endcode * */ DBR_API void DBR_FreeSettingsString(char** content); @@ -3653,17 +3389,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - DBR_InitRuntimeSettingsWithFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - DBR_AppendTplStringToRuntimeSettings(barcodeReader, "{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - DBR_OutputSettingsToFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\CurrentRuntimeSettings.json", "currentRuntimeSettings"); - DBR_DestroyInstance(barcodeReader); - * @endcode * */ DBR_API int DBR_OutputSettingsToFile(void* barcodeReader, const char* pFilePath, const char* pSettingsName); @@ -3689,16 +3414,6 @@ extern "C" { * @return Returns error code. Returns 0 if the function operates successfully. You can call * DBR_GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - TextResultArray* pResults; - int errorCode = DBR_DecodeFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - DBR_GetAllTextResults(barcodeReader, &pResults); - DBR_FreeTextResults(&pResults); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API int DBR_GetAllTextResults(void* barcodeReader, TextResultArray **pResults); @@ -3708,16 +3423,6 @@ extern "C" { * @param [in] pResults Text results. * * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - TextResultArray* pResults; - int errorCode = DBR_DecodeFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - DBR_GetAllTextResults(barcodeReader, &pResults); - DBR_FreeTextResults(&pResults); - DBR_DestroyInstance(barcodeReader); - * @endcode */ DBR_API void DBR_FreeTextResults(TextResultArray **pResults); @@ -3731,21 +3436,6 @@ extern "C" { * DBR_GetErrorString() to get detailed error message. Possible returns are: * DBR_OK; * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - PublicRuntimeSettings settings; - DBR_GetRuntimeSettings(barcodeReader, &settings); - settings.intermediateResultTypes = IRT_ORIGINAL_IMAGE | IRT_COLOUR_CLUSTERED_IMAGE | IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE; - char errorMessage[256]; - DBR_UpdateRuntimeSettings(barcodeReader, &settings, errorMessage, 256); - DBR_DecodeFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - IntermediateResultArray* pResults = NULL; - DBR_GetIntermediateResults(barcodeReader, &pResults); - DBR_FreeIntermediateResults(&pResults); - DBR_DestroyInstance(barcodeReader); - * @endcode * */ DBR_API int DBR_GetIntermediateResults(void *barcodeReader, IntermediateResultArray **pResult); @@ -3755,22 +3445,6 @@ extern "C" { * * @param [in] pResults The intermediate results. * - * @par Code Snippet: - * @code - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - PublicRuntimeSettings settings; - DBR_GetRuntimeSettings(barcodeReader, &settings); - settings.intermediateResultTypes = IRT_ORIGINAL_IMAGE | IRT_COLOUR_CLUSTERED_IMAGE | IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE; - char errorMessage[256]; - DBR_UpdateRuntimeSettings(barcodeReader, &settings, errorMessage, 256); - DBR_DecodeFile(barcodeReader, "C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - IntermediateResultArray* pResults = NULL; - DBR_GetIntermediateResults(barcodeReader, &pResults); - DBR_FreeIntermediateResults(&pResults); - DBR_DestroyInstance(barcodeReader); - * @endcode - * */ DBR_API void DBR_FreeIntermediateResults(IntermediateResultArray **pResults); @@ -3796,18 +3470,6 @@ extern "C" { * DBR_OK; * DBRERR_FRAME_DECODING_THREAD_EXISTS; * - * @par Code Snippet: - * @code - void ErrorFunction(int frameId, int errorCode, void * pUser) - { - //TODO add your code for using error code - } - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - DBR_SetErrorCallback(barcodeReader, ErrorFunction, NULL); - DBR_StartFrameDecoding(barcodeReader, 2, 10, 1024, 720, 1024, IPF_GRAYSCALED, ""); - * @endcode - * */ DBR_API int DBR_SetErrorCallback(void *barcodeReader, CB_Error cbFunction, void * pUser); @@ -3823,17 +3485,6 @@ extern "C" { * DBR_OK; * DBRERR_FRAME_DECODING_THREAD_EXISTS; * - * @par Code Snippet: - * @code - void TextResultFunction(int frameId, TextResultArray *pResults, void * pUser) - { - //TODO add your code for using test results - } - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - DBR_SetTextResultCallback(barcodeReader, TextResultFunction, NULL); - DBR_StartFrameDecoding(barcodeReader, 2, 10, 1024, 720, 1024, IPF_GRAYSCALED, ""); - * @endcode * */ DBR_API int DBR_SetTextResultCallback(void *barcodeReader, CB_TextResult cbFunction, void * pUser); @@ -3850,22 +3501,6 @@ extern "C" { * DBR_OK; * DBRERR_FRAME_DECODING_THREAD_EXISTS; * - * @par Code Snippet: - * @code - void IntermediateResultFunction(int frameId, IntermediateResultArray *pResults, void * pUser) - { - //TODO add your code for using intermediate results - } - void* barcodeReader = DBR_CreateInstance(); - DBR_InitLicense(barcodeReader, "t0260NwAAAHV***************"); - PublicRuntimeSettings settings; - int errorCode = DBR_GetRuntimeSettings(barcodeReader, &settings); - settings.intermediateResultTypes = IRT_ORIGINAL_IMAGE | IRT_COLOUR_CLUSTERED_IMAGE | IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE; - char errorMessage[256]; - DBR_UpdateRuntimeSettings(barcodeReader, &settings, errorMessage, 256); - DBR_SetIntermediateResultCallback(barcodeReader, IntermediateResultFunction, NULL); - DBR_StartFrameDecoding(barcodeReader, 2, 10, 1024, 720, 1024, IPF_GRAYSCALED, ""); - * @endcode * */ DBR_API int DBR_SetIntermediateResultCallback(void *barcodeReader, CB_IntermediateResult cbFunction, void * pUser); @@ -3962,14 +3597,6 @@ namespace dynamsoft * * @return The error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - int errorCode = reader->DecodeFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - const char* errorString = CBarcodeReader::GetErrorString(errorCode); - delete reader; - * @endcode * */ static const char* GetErrorString(const int iErrorCode); @@ -3979,10 +3606,6 @@ namespace dynamsoft * * @return The version info string. * - * @par Code Snippet: - * @code - const char* versionInfo = CBarcodeReader::GetVersion(); - * @endcode * */ @@ -4070,18 +3693,14 @@ namespace dynamsoft * Reads product key and activates the SDK. * * @param [in] pLicense The product keys. + * @param [in, out] errorMsgBuffer The buffer is allocated by caller and the recommending length is 256. The error message will be copied to the buffer. + * @param [in] errorMsgBufferLen The length of allocated buffer. * * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - delete reader; - * @endcode */ - int InitLicense(const char* pLicense); + static int InitLicense(const char* pLicense, char errorMsgBuffer[] = NULL, const int errorMsgBufferLen = 0); /** * Initializes the license and connects to the specified server for online verification. @@ -4159,13 +3778,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - int errorCode = reader->DecodeFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - delete reader; - * @endcode * * @par Remarks: * If no template name is specified, current runtime settings will be used. @@ -4182,16 +3794,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - unsigned char* pFileBytes; - int nFileSize = 0; - GetFileStream("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", &pFileBytes, &nFileSize); - int errorCode = reader->DecodeFileInMemory(pFileBytes, nFileSize, ""); - delete reader; - * @endcode * * @par Remarks: * If no template name is specified, current runtime settings will be used. @@ -4211,19 +3813,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - unsigned char* pBufferBytes; - int iWidth = 0; - int iHeight = 0; - int iStride = 0; - ImagePixelFormat format; - GetBufferFromFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", &pBufferBytes, &iWidth, &iHeight, &iStride, &format); - int errorCode = reader->DecodeBuffer(pBufferBytes, iWidth, iHeight, iStride, format, ""); - delete reader; - * @endcode * * @par Remarks: * If no template name is specified, current runtime settings will be used. @@ -4239,18 +3828,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - unsigned char* pFileBytes; - int nFileSize = 0; - GetFileStream("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", &pFileBytes, &nFileSize); - char* strBase64String; - GetFileBase64String(pBufferBytes, &strBase64String); - int errorCode = reader->DecodeBase64String(strBase64String, ""); - delete reader; - * @endcode * * @par Remarks: * If no template name is specified, current runtime settings will be used. @@ -4266,15 +3843,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - HANDLE pDIB; - GetDIBFromImage("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", &pDIB); - int errorCode = reader->DecodeDIB(pDIB ""); - delete reader; - * @endcode * * @par Remarks: * If no template name is specified, current runtime settings will be used. @@ -4321,14 +3889,6 @@ namespace dynamsoft * DBRERR_FRAME_DECODING_THREAD_EXISTS; * DBRERR_PARAMETER_VALUE_INVALID; * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - reader->StartFrameDecoding(2, 10, 1024, 720, 1024, IPF_GRAYSCALED, ""); - delete reader; - * @endcode - * */ int StartFrameDecoding(const int maxQueueLength, const int maxResultQueueLength, const int width, const int height, const int stride, const ImagePixelFormat format, const char *pTemplateName = ""); @@ -4344,31 +3904,6 @@ namespace dynamsoft * DBRERR_FRAME_DECODING_THREAD_EXISTS; * DBRERR_PARAMETER_VALUE_INVALID; * - * @par Code Snippet: - * @code - * CBarcodeReader* reader = new CBarcodeReader(); - * reader->InitLicense("t0260NwAAAHV***************"); - * FrameDecodingParameters parameters; - * int errorCode = reader->InitFrameDecodingParameters(¶meters); - * if(errorCode == DBR_OK) - * { - * parameters.maxQueueLength = 3; - * parameters.maxResultQueueLength = 10; - * parameters.width = 1024; - * parameters.height = 720; - * parameters.stride = 1024; - * parameters.imagePixelFormat = IPF_GRAYSCALED; - * parameters.region.regionMeasuredByPercentage = 1; - * parameters.region.regionTop = 0; - * parameters.region.regionBottom = 100; - * parameters.region.regionLeft = 0; - * parameters.region.regionRight = 100; - * parameters.threshold = 0.01; - * parameters.fps = 0; - * reader->StartFrameDecodingEx(parameters, ""); - * delete reader; - * } - * @endcode * */ int StartFrameDecodingEx(FrameDecodingParameters parameters, const char* pTemplateName = ""); @@ -4380,13 +3915,6 @@ namespace dynamsoft * * @return Returns the ID of the appended frame. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - int frameId = reader->AppendFrame(pBufferBytes); - delete reader; - * @endcode * */ int AppendFrame(unsigned char *pBufferBytes); @@ -4396,14 +3924,6 @@ namespace dynamsoft * * @return Returns the length of the inner frame queue. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - int frameLength = reader->GetLengthOfFrameQueue(); - delete reader; - * @endcode - * */ int GetLengthOfFrameQueue(); @@ -4415,13 +3935,6 @@ namespace dynamsoft * DBR_OK; * DBRERR_STOP_DECODING_THREAD_FAILED; * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - int errorCode = reader->StopFrameDecoding(); - delete reader; - * @endcode * */ int StopFrameDecoding(); @@ -4443,15 +3956,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - PublicRuntimeSettings* pSettings = new PublicRuntimeSettings; - int errorCode = reader->GetRuntimeSettings(pSettings); - delete pSettings; - delete reader; - * @endcode * */ int GetRuntimeSettings(PublicRuntimeSettings *psettings); @@ -4467,18 +3971,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - PublicRuntimeSettings* pSettings = new PublicRuntimeSettings; - int errorCode = reader->GetRuntimeSettings(pSettings); - pSettings->deblurLevel = 9; - char errorMessage[256]; - reader->UpdateRuntimeSettings(pSettings, errorMessage, 256); - delete pSettings; - delete reader; - * @endcode * */ int UpdateRuntimeSettings(PublicRuntimeSettings *pSettings, char errorMsgBuffer[] = NULL, const int errorMsgBufferLen = 0); @@ -4489,19 +3981,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - PublicRuntimeSettings* pSettings = new PublicRuntimeSettings; - int errorCode = reader->GetRuntimeSettings(pSettings); - pSettings->deblurLevel = 9; - char errorMessage[256]; - reader->UpdateRuntimeSettings(pSettings, errorMessage, 256); - reader->ResetRuntimeSettings(); - delete pSettings; - delete reader; - * @endcode * */ int ResetRuntimeSettings(); @@ -4521,19 +4000,6 @@ namespace dynamsoft * DBR_OK; * DBRERR_SET_MODE_ARGUMENT_ERROR; * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - PublicRuntimeSettings* pSettings = new PublicRuntimeSettings; - reader->GetRuntimeSettings(pSettings); - pSettings->binarizationModes[0] = BM_LOCAL_BLOCK; - char errorMessage[256]; - reader->UpdateRuntimeSettings(pSettings, errorMessage, 256); - reader->SetModeArgument("BinarizationModes", 0, "EnableFillBinaryVacancy", "1", errorMessage, 256); - delete pSettings; - delete reader; - * @endcode * * @par Remarks: * Check @ref ModesArgument for available argument settings @@ -4557,22 +4023,6 @@ namespace dynamsoft * DBR_OK; * DBRERR_GET_MODE_ARGUMENT_ERROR; * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - PublicRuntimeSettings* pSettings = new PublicRuntimeSettings; - reader->GetRuntimeSettings(pSettings); - pSettings->binarizationModes[0] = BM_LOCAL_BLOCK; - char errorMessage[256]; - char argumentValue[480]; - reader->UpdateRuntimeSettings(pSettings, errorMessage, 256); - reader->SetModeArgument("BinarizationModes", 0, "EnableFillBinaryVacancy", "1", errorMessage, 256); - reader->GetModeArgument("BinarizationModes", 0, "EnableFillBinaryVacancy", argumentValue, 480, errorMessage, 256); - delete pSettings; - delete reader; - * @endcode - * * @par Remarks: * Check @ref ModesArgument for available argument settings * @@ -4600,14 +4050,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - char errorMessage[256]; - reader->InitRuntimeSettingsWithFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessage, 256); - delete reader; - * @endcode * * @sa CBarcodeReader PublicRuntimeSettings */ @@ -4626,14 +4068,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - char errorMessage[256]; - reader->InitRuntimeSettingsWithString("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_OVERWRITE, errorMessage, 256); - delete reader; - * @endcode * * @sa CBarcodeReader PublicRuntimeSettings */ @@ -4652,14 +4086,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - char errorMessage[256]; - reader->AppendTplFileToRuntimeSettings("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_IGNORE, errorMessage, 256); - delete reader; - * @endcode * * @sa CBarcodeReader PublicRuntimeSettings */ @@ -4679,13 +4105,6 @@ namespace dynamsoft * GetErrorString() to get detailed error message. * * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - char errorMessage[256]; - reader->AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessage, 256); - delete reader; - * @endcode * * @sa CBarcodeReader PublicRuntimeSettings */ @@ -4696,18 +4115,6 @@ namespace dynamsoft * * @return Returns the count of parameter template. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - reader->InitRuntimeSettingsWithFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - reader->AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - int currentTemplateCount = reader->GetParameterTemplateCount(); - delete reader; - * @endcode - * */ int GetParameterTemplateCount(); @@ -4723,21 +4130,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - reader->InitRuntimeSettingsWithFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - reader->AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - int currentTemplateCount = reader->GetParameterTemplateCount(); - int templateIndex = 1; - // notice that the value of 'templateIndex' should less than currentTemplateCount. - char templateName[256]; - reader->GetParameterTemplateName(templateIndex, templateName, 256); - delete reader; - * @endcode * */ int GetParameterTemplateName(const int index, char nameBuffer[], int nameBufferLen); @@ -4751,17 +4143,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - reader->InitRuntimeSettingsWithFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - reader->AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - reader->OutputSettingsToFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\CurrentRuntimeSettings.json", "currentRuntimeSettings"); - delete reader; - * @endcode * */ int OutputSettingsToFile(const char* pFilePath, const char* pSettingsName); @@ -4776,18 +4157,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - reader->InitRuntimeSettingsWithFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - reader->AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - char content[256]; - reader->OutputSettingsToString(content, 256, "currentRuntimeSettings"); - delete reader; - * @endcode * */ int OutputSettingsToString(char content[], const int contentLen, const char* pSettingsName); @@ -4800,20 +4169,6 @@ namespace dynamsoft * * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. - * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - reader->InitRuntimeSettingsWithFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - reader->AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - char* content = NULL; - reader->OutputSettingsToStringPtr(&content, "currentRuntimeSettings"); - reader->FreeSettingsString(&content); - delete reader; - * @endcode * */ int OutputSettingsToStringPtr(char** content, const char* pSettingsName); @@ -4823,19 +4178,6 @@ namespace dynamsoft * * @param [in] content The runtime settings string. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - char errorMessageInit[256]; - char errorMessageAppend[256]; - reader->InitRuntimeSettingsWithFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Templates\\RuntimeSettings.json", CM_OVERWRITE, errorMessageInit, 256); - reader->AppendTplStringToRuntimeSettings("{\"Version\":\"3.0\", \"ImageParameter\":{\"Name\":\"IP1\", \"BarcodeFormatIds\":[\"BF_QR_CODE\"], \"ExpectedBarcodesCount\":10}}", CM_IGNORE, errorMessageAppend, 256); - char* content = NULL; - reader->OutputSettingsToStringPtr(&content, "currentRuntimeSettings"); - reader->FreeSettingsString(&content); - delete reader; - * @endcode * */ void FreeSettingsString(char** content); @@ -4859,16 +4201,6 @@ namespace dynamsoft * @return Returns error code. Returns 0 if the function operates successfully. You can call * GetErrorString() to get detailed error message. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - TextResultArray* pResults; - int errorCode = reader->DecodeFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - reader->GetAllTextResults(&pResults); - CBarcodeReader::FreeTextResults(&pResults); - delete reader; - * @endcode * */ int GetAllTextResults(TextResultArray **pResults); @@ -4878,16 +4210,6 @@ namespace dynamsoft * * @param [in] pResults Text results. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - TextResultArray* pResults; - int errorCode = reader->DecodeFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - reader->GetAllTextResults(&pResults); - CBarcodeReader::FreeTextResults(&pResults); - delete reader; - * @endcode * */ static void FreeTextResults(TextResultArray **pResults); @@ -4901,22 +4223,6 @@ namespace dynamsoft * GetErrorString() to get detailed error message. Possible returns are: * DBR_OK; * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - PublicRuntimeSettings* pSettings = new PublicRuntimeSettings; - reader->GetRuntimeSettings(pSettings); - pSettings->intermediateResultTypes = IRT_ORIGINAL_IMAGE | IRT_COLOUR_CLUSTERED_IMAGE | IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE; - char errorMessage[256]; - reader->UpdateRuntimeSettings(pSettings, errorMessage, 256); - reader->DecodeFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - IntermediateResultArray* pResults = NULL; - reader->GetIntermediateResults(&pResults); - CBarcodeReader::FreeIntermediateResults(&pResults); - delete pSettings; - delete reader; - * @endcode * */ int GetIntermediateResults(IntermediateResultArray **pResults); @@ -4926,22 +4232,6 @@ namespace dynamsoft * * @param [in] pResults The intermediate results. * - * @par Code Snippet: - * @code - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - PublicRuntimeSettings* pSettings = new PublicRuntimeSettings; - reader->GetRuntimeSettings(pSettings); - pSettings->intermediateResultTypes = IRT_ORIGINAL_IMAGE | IRT_COLOUR_CLUSTERED_IMAGE | IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE; - char errorMessage[256]; - reader->UpdateRuntimeSettings(pSettings, errorMessage, 256); - reader->DecodeFile("C:\\Program Files (x86)\\Dynamsoft\\{Version number}\\Images\\AllSupportedBarcodeTypes.tif", ""); - IntermediateResultArray* pResults = NULL; - reader->GetIntermediateResults(&pResults); - CBarcodeReader::FreeIntermediateResults(&pResults); - delete pSettings; - delete reader; - * @endcode * */ static void FreeIntermediateResults(IntermediateResultArray **pResults); @@ -4967,17 +4257,6 @@ namespace dynamsoft * DBR_OK; * DBRERR_FRAME_DECODING_THREAD_EXISTS; * - * @par Code Snippet: - * @code - void ErrorFunction(int frameId, int errorCode, void * pUser) - { - //TODO add your code for using error code - } - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - reader->SetErrorCallback(ErrorFunction, NULL); - reader->StartFrameDecoding(2, 10, 1024, 720, 1024, IPF_GRAYSCALED, ""); - * @endcode * */ int SetErrorCallback(CB_Error cbFunction, void * pUser); @@ -4993,17 +4272,6 @@ namespace dynamsoft * DBR_OK; * DBRERR_FRAME_DECODING_THREAD_EXISTS; * - * @par Code Snippet: - * @code - void TextResultFunction(int frameId, TextResultArray *pResults, void * pUser) - { - //TODO add your code for using text results - } - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - reader->SetTextResultCallback(TextResultFunction, NULL); - reader->StartFrameDecoding(2, 10, 1024, 720, 1024, IPF_GRAYSCALED, ""); - * @endcode * */ int SetTextResultCallback(CB_TextResult cbFunction, void * pUser); @@ -5019,22 +4287,6 @@ namespace dynamsoft * DBR_OK; * DBRERR_FRAME_DECODING_THREAD_EXISTS; * - * @par Code Snippet: - * @code - void IntermediateResultFunction(int frameId, IntermediateResultArray *pResults, void * pUser) - { - //TODO add your code for using intermediate results - } - CBarcodeReader* reader = new CBarcodeReader(); - reader->InitLicense("t0260NwAAAHV***************"); - PublicRuntimeSettings* pSettings = new PublicRuntimeSettings; - reader->GetRuntimeSettings(pSettings); - pSettings->intermediateResultTypes = IRT_ORIGINAL_IMAGE | IRT_COLOUR_CLUSTERED_IMAGE | IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE; - char errorMessage[256]; - reader->UpdateRuntimeSettings(pSettings, errorMessage, 256); - reader->SetIntermediateResultCallback(IntermediateResultFunction, NULL); - reader->StartFrameDecoding(2, 10, 1024, 720, 1024, IPF_GRAYSCALED, ""); - * @endcode * */ int SetIntermediateResultCallback(CB_IntermediateResult cbFunction, void * pUser); diff --git a/include/DynamsoftCommon.h b/include/DynamsoftCommon.h index cc3d63b..48655c5 100644 --- a/include/DynamsoftCommon.h +++ b/include/DynamsoftCommon.h @@ -61,7 +61,9 @@ typedef enum DM_DeploymentType DM_DT_EMBEDDED_DEVICE = 6, /**OEM deployment type*/ - DM_DT_OEM = 7 + DM_DT_OEM = 7, + /**Mobile deployment type*/ + DM_DT_MOBILE = 9 }DM_DeploymentType; /** diff --git a/license-key.txt b/license-key.txt new file mode 100644 index 0000000..bc754f2 --- /dev/null +++ b/license-key.txt @@ -0,0 +1 @@ +Click https://www.dynamsoft.com/customer/license/trialLicense/?product=dbr to get a trial license. \ No newline at end of file diff --git a/platforms/aarch64/libDynamsoftBarcodeReader.so b/platforms/aarch64/libDynamsoftBarcodeReader.so index 2e5a084..b5943a8 100644 Binary files a/platforms/aarch64/libDynamsoftBarcodeReader.so and b/platforms/aarch64/libDynamsoftBarcodeReader.so differ diff --git a/platforms/arm32/libDynamsoftBarcodeReader.so b/platforms/arm32/libDynamsoftBarcodeReader.so index 183deb1..8024771 100644 Binary files a/platforms/arm32/libDynamsoftBarcodeReader.so and b/platforms/arm32/libDynamsoftBarcodeReader.so differ diff --git a/platforms/linux/README.md b/platforms/linux/README.md deleted file mode 100644 index 544a076..0000000 --- a/platforms/linux/README.md +++ /dev/null @@ -1 +0,0 @@ -Get [Dynamsoft Barcode Reader SDK for Linux](https://www.dynamsoft.com/Downloads/Dynamic-Barcode-Reader-for-Linux-Download.aspx). \ No newline at end of file diff --git a/platforms/linux/libDynamLicenseClient.so b/platforms/linux/libDynamLicenseClient.so index 88857e5..f2dc767 100644 Binary files a/platforms/linux/libDynamLicenseClient.so and b/platforms/linux/libDynamLicenseClient.so differ diff --git a/platforms/linux/libDynamsoftBarcodeReader.so b/platforms/linux/libDynamsoftBarcodeReader.so index d803aaa..94e08bb 100644 Binary files a/platforms/linux/libDynamsoftBarcodeReader.so and b/platforms/linux/libDynamsoftBarcodeReader.so differ diff --git a/platforms/macos/README.md b/platforms/macos/README.md deleted file mode 100644 index 60a2d53..0000000 --- a/platforms/macos/README.md +++ /dev/null @@ -1 +0,0 @@ -Get [Dynamsoft Barcode Reader SDK for macOS](https://www.dynamsoft.com/Downloads/Dynamic-Barcode-Reader-Download.aspx). \ No newline at end of file diff --git a/platforms/win/README.md b/platforms/win/README.md deleted file mode 100644 index 9b37037..0000000 --- a/platforms/win/README.md +++ /dev/null @@ -1 +0,0 @@ -Get [Dynamsoft Barcode Reader SDK for Windows](https://www.dynamsoft.com/Downloads/Dynamic-Barcode-Reader-Download.aspx). \ No newline at end of file diff --git a/platforms/win/bin/DynamsoftBarcodeReaderx64.dll b/platforms/win/bin/DynamsoftBarcodeReaderx64.dll index 82c0c18..6c90177 100644 Binary files a/platforms/win/bin/DynamsoftBarcodeReaderx64.dll and b/platforms/win/bin/DynamsoftBarcodeReaderx64.dll differ diff --git a/platforms/win/bin/DynamsoftLicenseClientx64.dll b/platforms/win/bin/DynamsoftLicenseClientx64.dll index 5bc80c1..90905fc 100644 Binary files a/platforms/win/bin/DynamsoftLicenseClientx64.dll and b/platforms/win/bin/DynamsoftLicenseClientx64.dll differ diff --git a/platforms/win/lib/DBRx64.lib b/platforms/win/lib/DBRx64.lib index db26030..0627097 100644 Binary files a/platforms/win/lib/DBRx64.lib and b/platforms/win/lib/DBRx64.lib differ