Skip to content

Commit 25c46bc

Browse files
committed
Support DPM (Direct Part Marking)
1 parent 7ec63a4 commit 25c46bc

File tree

1 file changed

+10
-51
lines changed

1 file changed

+10
-51
lines changed

BarcodeReader.cxx

Lines changed: 10 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,6 @@
66
#include <sys/time.h>
77
#endif
88

9-
const int GetBarcodeFormatId(int iIndex)
10-
{
11-
switch(iIndex)
12-
{
13-
case 1:
14-
return BF_ALL;
15-
case 2:
16-
return BF_ONED;
17-
case 3:
18-
return BF_QR_CODE;
19-
case 4:
20-
return BF_CODE_39;
21-
case 5:
22-
return BF_CODE_128;
23-
case 6:
24-
return BF_CODE_93;
25-
case 7:
26-
return BF_CODABAR;
27-
case 8:
28-
return BF_ITF;
29-
case 9:
30-
return BF_INDUSTRIAL_25;
31-
case 10:
32-
return BF_EAN_13;
33-
case 11:
34-
return BF_EAN_8;
35-
case 12:
36-
return BF_UPC_A;
37-
case 13:
38-
return BF_UPC_E;
39-
case 14:
40-
return BF_PDF417;
41-
case 15:
42-
return BF_DATAMATRIX;
43-
case 16:
44-
return BF_AZTEC;
45-
case 17:
46-
return BF_CODE_39_EXTENDED;
47-
case 18:
48-
return BF_MAXICODE;
49-
case 19:
50-
return BF_GS1_DATABAR;
51-
case 20:
52-
return BF_PATCHCODE;
53-
case 21:
54-
return BF_GS1_COMPOSITE;
55-
default:
56-
return -1;
57-
}
58-
}
59-
609
void ToHexString(unsigned char* pSrc, int iLen, char* pDest)
6110
{
6211
const char HEXCHARS[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
@@ -89,6 +38,16 @@ int main(int argc, const char* argv[])
8938
const char* pszLicense = "LICENSE-KEY";
9039
reader.InitLicense (pszLicense);
9140

41+
// DPM settings
42+
char sError[512];
43+
PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings();
44+
reader.GetRuntimeSettings(runtimeSettings);
45+
//turn on the DPM mode
46+
runtimeSettings->furtherModes.dpmCodeReadingModes[0] = DPMCRM_GENERAL;
47+
runtimeSettings->localizationModes[0] = LM_STATISTICS_MARKS;
48+
//update the runtime settings
49+
reader.UpdateRuntimeSettings(runtimeSettings, sError, 512);
50+
9251
// Read barcode
9352
#if defined(WINDOWS)
9453
unsigned __int64 ullTimeBegin = GetTickCount();

0 commit comments

Comments
 (0)