-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDynamsoftBarcodeReader.h
More file actions
5071 lines (4360 loc) · 164 KB
/
DynamsoftBarcodeReader.h
File metadata and controls
5071 lines (4360 loc) · 164 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef __DYNAMSOFT_BARCODE_READER_H__
#define __DYNAMSOFT_BARCODE_READER_H__
#if !defined(_WIN32) && !defined(_WIN64)
#define DBR_API __attribute__((visibility("default")))
#ifdef __APPLE__
#else
typedef signed char BOOL;
#endif
typedef void* HANDLE;
#include <stddef.h>
#else
#ifdef DBR_EXPORTS
#define DBR_API __declspec(dllexport)
#else
#define DBR_API
#endif
#include <windows.h>
#endif
/**
* @defgroup CandCPlus C/C++ APIs
* @{
* Dynamsoft Barcode Reader - C/C++ APIs Description.
*/
#pragma region ErrorCode
/**Successful. */
#define DBR_OK 0
/**The file is not found. */
#define DBRERR_FILE_NOT_FOUND -10005
/**The file type is not supported. */
#define DBRERR_FILETYPE_NOT_SUPPORTED -10006
/**The DIB (Device-Independent Bitmaps) buffer is invalid. */
#define DBRERR_DIB_BUFFER_INVALID -10018
/**Recognition timeout. */
#define DBRERR_RECOGNITION_TIMEOUT -10026
/**Unknown error. */
#define DBRERR_UNKNOWN -10000
/**Not enough memory to perform the operation. */
#define DBRERR_NO_MEMORY -10001
/**Null pointer. */
#define DBRERR_NULL_POINTER -10002
/**The license is invalid. */
#define DBRERR_LICENSE_INVALID -10003
/**The license has expired. */
#define DBRERR_LICENSE_EXPIRED -10004
/**The BPP (Bits Per Pixel) is not supported. */
#define DBRERR_BPP_NOT_SUPPORTED -10007
/**The index is invalid. */
#define DBRERR_INDEX_INVALID -10008
/**The barcode format is invalid. */
#define DBRERR_BARCODE_FORMAT_INVALID -10009
/**The input region value parameter is invalid. */
#define DBRERR_CUSTOM_REGION_INVALID -10010
/**The maximum barcode number is invalid. */
#define DBRERR_MAX_BARCODE_NUMBER_INVALID -10011
/**Failed to read the image. */
#define DBRERR_IMAGE_READ_FAILED -10012
/**Failed to read the TIFF image. */
#define DBRERR_TIFF_READ_FAILED -10013
/**The QR Code license is invalid. */
#define DBRERR_QR_LICENSE_INVALID -10016
/**The 1D Barcode license is invalid. */
#define DBRERR_1D_LICENSE_INVALID -10017
/**The PDF417 license is invalid. */
#define DBRERR_PDF417_LICENSE_INVALID -10019
/**The DATAMATRIX license is invalid. */
#define DBRERR_DATAMATRIX_LICENSE_INVALID -10020
/**Failed to read the PDF file. */
#define DBRERR_PDF_READ_FAILED -10021
/**The PDF DLL is missing. */
#define DBRERR_PDF_DLL_MISSING -10022
/**The page number is invalid. */
#define DBRERR_PAGE_NUMBER_INVALID -10023
/**The custom size is invalid. */
#define DBRERR_CUSTOM_SIZE_INVALID -10024
/**The custom module size is invalid. */
#define DBRERR_CUSTOM_MODULESIZE_INVALID -10025
/**Failed to parse JSON string. */
#define DBRERR_JSON_PARSE_FAILED -10030
/**The value type is invalid. */
#define DBRERR_JSON_TYPE_INVALID -10031
/**The key is invalid. */
#define DBRERR_JSON_KEY_INVALID -10032
/**The value is invalid or out of range. */
#define DBRERR_JSON_VALUE_INVALID -10033
/**The mandatory key "Name" is missing. */
#define DBRERR_JSON_NAME_KEY_MISSING -10034
/**The value of the key "Name" is duplicated. */
#define DBRERR_JSON_NAME_VALUE_DUPLICATED -10035
/**The template name is invalid. */
#define DBRERR_TEMPLATE_NAME_INVALID -10036
/**The name reference is invalid. */
#define DBRERR_JSON_NAME_REFERENCE_INVALID -10037
/**The parameter value is invalid or out of range. */
#define DBRERR_PARAMETER_VALUE_INVALID -10038
/**The domain of your current site does not match the domain bound in the current product key. */
#define DBRERR_DOMAIN_NOT_MATCHED -10039
/**The reserved info does not match the reserved info bound in the current product key. */
#define DBRERR_RESERVEDINFO_NOT_MATCHED -10040
/**The AZTEC license is invalid. */
#define DBRERR_AZTEC_LICENSE_INVALID -10041
/**The License DLL is missing. */
#define DBRERR_LICENSE_DLL_MISSING -10042
/**The license key does not match the license content. */
#define DBRERR_LICENSEKEY_NOT_MATCHED -10043
/**Failed to request the license content. */
#define DBRERR_REQUESTED_FAILED -10044
/**Failed to init the license. */
#define DBRERR_LICENSE_INIT_FAILED -10045
/**The Patchcode license is invalid. */
#define DBRERR_PATCHCODE_LICENSE_INVALID -10046
/**The Postal code license is invalid. */
#define DBRERR_POSTALCODE_LICENSE_INVALID -10047
/**The DPM license is invalid. */
#define DBRERR_DPM_LICENSE_INVALID -10048
/**The frame decoding thread already exists. */
#define DBRERR_FRAME_DECODING_THREAD_EXISTS -10049
/**Failed to stop the frame decoding thread. */
#define DBRERR_STOP_DECODING_THREAD_FAILED -10050
/**Failed to set mode's argument. */
#define DBRERR_SET_MODE_ARGUMENT_ERROR -10051
/**The license content is invalid. */
#define DBRERR_LICENSE_CONTENT_INVALID -10052
/**The license key is invalid. */
#define DBRERR_LICENSE_KEY_INVALID -10053
/**The device number in the license key runs out. */
#define DBRERR_LICENSE_DEVICE_RUNS_OUT -10054
/**Failed to get mode's argument. */
#define DBRERR_GET_MODE_ARGUMENT_ERROR -10055
/**The Intermediate Result Types license is invalid. */
#define DBRERR_IRT_LICENSE_INVALID -10056
/**The Maxicode license is invalid. */
#define DBRERR_MAXICODE_LICENSE_INVALID -10057
/**The GS1 Databar license is invalid. */
#define DBRERR_GS1_DATABAR_LICENSE_INVALID -10058
/**The GS1 Composite code license is invalid. */
#define DBRERR_GS1_COMPOSITE_LICENSE_INVALID -10059
/**The panorama license is invalid. */
#define DBRERR_PANORAMA_LICENSE_INVALID -10060
/**The DotCode license is invalid. */
#define DBRERR_DOTCODE_LICENSE_INVALID -10061
/**
* @}defgroup ErrorCode
*/
#pragma endregion
#pragma pack(push)
#pragma pack(1)
/**
* @defgroup DBRPoint DBRPoint
* @{
*/
/**
* Stores an x- and y-coordinate pair in two-dimensional space.
*
*/
typedef struct tagDBRPoint
{
/**The X coordinate of the point */
int x;
/**The Y coordinate of the point */
int y;
}DBRPoint, *PDBRPoint;
/**
* @} defgroup DBRPoint
*/
#pragma pack(pop)
#pragma region Enum
#ifndef _COMMON_PART2_
#define _COMMON_PART2_
/**
* @enum ImagePixelFormat
*
* Describes the image pixel format.
*/
typedef enum ImagePixelFormat
{
/**0:Black, 1:White */
IPF_BINARY,
/**0:White, 1:Black */
IPF_BINARYINVERTED,
/**8bit gray */
IPF_GRAYSCALED,
/**NV21 */
IPF_NV21,
/**16bit with RGB channel order stored in memory from high to low address*/
IPF_RGB_565,
/**16bit with RGB channel order stored in memory from high to low address*/
IPF_RGB_555,
/**24bit with RGB channel order stored in memory from high to low address*/
IPF_RGB_888,
/**32bit with ARGB channel order stored in memory from high to low address*/
IPF_ARGB_8888,
/**48bit with RGB channel order stored in memory from high to low address*/
IPF_RGB_161616,
/**64bit with ARGB channel order stored in memory from high to low address*/
IPF_ARGB_16161616,
/**32bit with ABGR channel order stored in memory from high to low address*/
IPF_ABGR_8888,
/**64bit with ABGR channel order stored in memory from high to low address*/
IPF_ABGR_16161616,
/**24bit with BGR channel order stored in memory from high to low address*/
IPF_BGR_888
}ImagePixelFormat;
/**
* @enum BinarizationMode
*
* Describes the binarization mode.
*/
typedef enum BinarizationMode
{
/**Not supported yet. */
BM_AUTO = 0x01,
/**Binarizes the image based on the local block. Check @ref BM for available argument settings.*/
BM_LOCAL_BLOCK = 0x02,
/**Performs image binarization based on the given threshold. Check @ref BM for available argument settings.*/
BM_THRESHOLD = 0x04,
/**Reserved setting for binarization mode.*/
#if defined(_WIN32) || defined(_WIN64)
BM_REV = 0x80000000,
#else
BM_REV = -2147483648,
#endif
/**Skips the binarization. */
BM_SKIP = 0x00
}BinarizationMode;
/**
* @enum ScaleUpMode
*
* Describes the scale up mode .
*/
typedef enum ScaleUpMode
{
/**The library chooses an interpolation method automatically to scale up.*/
SUM_AUTO = 0x01,
/**Scales up using the linear interpolation method. Check @ref SUM for available argument settings.*/
SUM_LINEAR_INTERPOLATION = 0x02,
/**Scales up using the nearest-neighbour interpolation method. Check @ref SUM for available argument settings.*/
SUM_NEAREST_NEIGHBOUR_INTERPOLATION = 0x04,
/**Reserved setting for scale up mode.*/
#if defined(_WIN32) || defined(_WIN64)
SUM_REV = 0x80000000,
#else
SUM_REV = -2147483648,
#endif
/**Skip the scale-up process.*/
SUM_SKIP = 0x00
}ScaleUpMode;
typedef enum RegionPredetectionMode
{
/**Lets the library choose an algorithm automatically to detect region. */
RPM_AUTO = 0x01,
/**Takes the whole image as a region. */
RPM_GENERAL = 0x02,
/**Detects region using the general algorithm based on RGB colour contrast. Check @ref RPM for available argument settings.*/
RPM_GENERAL_RGB_CONTRAST = 0x04,
/**Detects region using the general algorithm based on gray contrast. Check @ref RPM for available argument settings.*/
RPM_GENERAL_GRAY_CONTRAST = 0x08,
/**Detects region using the general algorithm based on HSV colour contrast. Check @ref RPM for available argument settings.*/
RPM_GENERAL_HSV_CONTRAST = 0x10,
/**Reserved setting for region predection mode.*/
#if defined(_WIN32) || defined(_WIN64)
RPM_REV = 0x80000000,
#else
RPM_REV = -2147483648,
#endif
/**Skips region detection. */
RPM_SKIP = 0x00
}RegionPredetectionMode;
/**
* @defgroup Enum Enumerations
* @{
*/
/**
* @enum BarcodeFormat
*
* Describes the barcode types in BarcodeFormat group 1. All the formats can be combined, such as BF_CODE_39 | BF_CODE_128.
* Note: The barcode format our library will search for is composed of [BarcodeFormat group 1](@ref BarcodeFormat) and [BarcodeFormat group 2](@ref BarcodeFormat_2), so you need to specify the barcode format in group 1 and group 2 individually.
*/
typedef enum BarcodeFormat
{
/**All supported formats in BarcodeFormat group 1*/
#if defined(_WIN32) || defined(_WIN64)
BF_ALL = 0xFE1FFFFF,
#else
BF_ALL = -31457281,
#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,
/**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,
/**Code 39 */
BF_CODE_39 = 0x1,
/**Code 128 */
BF_CODE_128 = 0x2,
/**Code 93 */
BF_CODE_93 = 0x4,
/**Codabar */
BF_CODABAR = 0x8,
/**Interleaved 2 of 5 */
BF_ITF = 0x10,
/**EAN-13 */
BF_EAN_13 = 0x20,
/**EAN-8 */
BF_EAN_8 = 0x40,
/**UPC-A */
BF_UPC_A = 0x80,
/**UPC-E */
BF_UPC_E = 0x100,
/**Industrial 2 of 5 */
BF_INDUSTRIAL_25 = 0x200,
/**CODE39 Extended */
BF_CODE_39_EXTENDED = 0x400,
/**GS1 Databar Omnidirectional*/
BF_GS1_DATABAR_OMNIDIRECTIONAL = 0x800,
/**GS1 Databar Truncated*/
BF_GS1_DATABAR_TRUNCATED = 0x1000,
/**GS1 Databar Stacked*/
BF_GS1_DATABAR_STACKED = 0x2000,
/**GS1 Databar Stacked Omnidirectional*/
BF_GS1_DATABAR_STACKED_OMNIDIRECTIONAL = 0x4000,
/**GS1 Databar Expanded*/
BF_GS1_DATABAR_EXPANDED = 0x8000,
/**GS1 Databar Expaned Stacked*/
BF_GS1_DATABAR_EXPANDED_STACKED = 0x10000,
/**GS1 Databar Limited*/
BF_GS1_DATABAR_LIMITED = 0x20000,
/**Patch code. */
BF_PATCHCODE = 0x00040000,
/**PDF417 */
BF_PDF417 = 0x02000000,
/**QRCode */
BF_QR_CODE = 0x04000000,
/**DataMatrix */
BF_DATAMATRIX = 0x08000000,
/**AZTEC */
BF_AZTEC = 0x10000000,
/**MAXICODE */
BF_MAXICODE = 0x20000000,
/**Micro QR Code*/
BF_MICRO_QR = 0x40000000,
/**Micro PDF417*/
BF_MICRO_PDF417 = 0x00080000,
/**GS1 Composite Code*/
#if defined(_WIN32) || defined(_WIN64)
BF_GS1_COMPOSITE = 0x80000000,
#else
BF_GS1_COMPOSITE = -2147483648,
#endif
/**MSI Code*/
BF_MSI_CODE = 0x100000,
/**No barcode format in BarcodeFormat group 1*/
BF_NULL = 0x00
}BarcodeFormat;
/**
* @enum BarcodeFormat_2
*
* Describes the barcode types in BarcodeFormat group 2.
* Note: The barcode format our library will search for is composed of [BarcodeFormat group 1](@ref BarcodeFormat) and [BarcodeFormat group 2](@ref BarcodeFormat_2), so you need to specify the barcode format in group 1 and group 2 individually.
*/
typedef enum BarcodeFormat_2
{
/**No barcode format in BarcodeFormat group 2*/
BF2_NULL = 0x00,
/**Combined value of BF2_USPSINTELLIGENTMAIL, BF2_POSTNET, BF2_PLANET, BF2_AUSTRALIANPOST, BF2_RM4SCC.*/
BF2_POSTALCODE = 0x01F00000,
/**Nonstandard barcode */
BF2_NONSTANDARD_BARCODE = 0x01,
/**USPS Intelligent Mail.*/
BF2_USPSINTELLIGENTMAIL = 0x00100000,
/**Postnet.*/
BF2_POSTNET = 0x00200000,
/**Planet.*/
BF2_PLANET = 0x00400000,
/**Australian Post.*/
BF2_AUSTRALIANPOST = 0x00800000,
/**Royal Mail 4-State Customer Barcode.*/
BF2_RM4SCC = 0x01000000,
/**DotCode.*/
BF2_DOTCODE = 0x02
}BarcodeFormat_2;
/**
* @enum ColourConversionMode
*
* Describes the colour conversion mode.
*/
typedef enum ColourConversionMode
{
/**Converts a colour image to a grayscale image using the general algorithm. Check @ref CICM for available argument settings. */
CICM_GENERAL = 0x01,
/**Reserved setting for colour conversion mode.*/
#if defined(_WIN32) || defined(_WIN64)
CICM_REV = 0x80000000,
#else
CICM_REV = -2147483648,
#endif
/**Skips the colour conversion. */
CICM_SKIP = 0x00
}ColourConversionMode;
/**
* @enum TextureDetectionMode
*
* Describes the texture detection mode.
*/
typedef enum TextureDetectionMode
{
/**Not supported yet. */
TDM_AUTO = 0X01,
/**Detects texture using the general algorithm. Check @ref TDM for available argument settings.*/
TDM_GENERAL_WIDTH_CONCENTRATION = 0X02,
/**Reserved setting for texture detection mode.*/
#if defined(_WIN32) || defined(_WIN64)
TDM_REV = 0x80000000,
#else
TDM_REV = -2147483648,
#endif
/**Skips texture detection. */
TDM_SKIP = 0x00
}TextureDetectionMode;
/**
* @enum GrayscaleTransformationMode
*
* Describes the grayscale transformation mode.
*/
typedef enum GrayscaleTransformationMode
{
/**Transforms to inverted grayscale. Recommended for light on dark images. */
GTM_INVERTED = 0x01,
/**Keeps the original grayscale. Recommended for dark on light images. */
GTM_ORIGINAL = 0x02,
/**Reserved setting for grayscale transformation mode.*/
#if defined(_WIN32) || defined(_WIN64)
GTM_REV = 0x80000000,
#else
GTM_REV = -2147483648,
#endif
/**Skips grayscale transformation. */
GTM_SKIP = 0x00
}GrayscaleTransformationMode;
/**
* @enum PDFReadingMode
*
* Describes the PDF reading mode.
*/
typedef enum PDFReadingMode
{
/** Lets the library choose the reading mode automatically. */
PDFRM_AUTO = 0x01,
/** Detects barcode from vector data in PDF file.*/
PDFRM_VECTOR = 0x02,
/** Converts the PDF file to image(s) first, then perform barcode recognition.*/
PDFRM_RASTER = 0x04,
/**Reserved setting for PDF reading mode.*/
#if defined(_WIN32) || defined(_WIN64)
PDFRM_REV = 0x80000000,
#else
PDFRM_REV = -2147483648,
#endif
}PDFReadingMode;
#pragma pack(push)
#pragma pack(1)
typedef DBRPoint DM_Point;
/**
* @defgroup Quadrilateral Quadrilateral
* @{
*/
/**
* Stores the quadrilateral.
*
*/
typedef struct tagQuadrilateral
{
/**Four vertexes in a clockwise direction of a quadrilateral. Index 0 represents the left-most vertex. */
DBRPoint points[4];
}Quadrilateral;
/**
* @} defgroup Quadrilateral
*/
/**
* @defgroup ImageData ImageData
* @{
*/
/**
* Stores the image data.
*
*/
typedef struct tagImageData
{
/**The length of the image data byte array */
int bytesLength;
/**The image data content in a byte array */
unsigned char* bytes;
/**The width of the image in pixels */
int width;
/**The height of the image in pixels */
int height;
/**The stride (or scan width) of the image */
int stride;
/**The image pixel format used in the image byte array */
ImagePixelFormat format;
}ImageData;
/**
* @} defgroup ImageData
*/
#pragma pack(pop)
#endif
/**
* @enum ImagePreprocessingMode
*
* Describes the image preprocessing mode.
*/
typedef enum ImagePreprocessingMode
{
/**Not supported yet. */
IPM_AUTO = 0x01,
/**Takes the unpreprocessed image for following operations. */
IPM_GENERAL = 0x02,
/**Preprocesses the image using the gray equalization algorithm. Check @ref IPM for available argument settings.*/
IPM_GRAY_EQUALIZE = 0x04,
/**Preprocesses the image using the gray smoothing algorithm. Check @ref IPM for available argument settings.*/
IPM_GRAY_SMOOTH = 0x08,
/**Preprocesses the image using the sharpening and smoothing algorithm. Check @ref IPM for available argument settings.*/
IPM_SHARPEN_SMOOTH = 0x10,
/**Preprocesses the image using the morphology algorithm. Check @ref IPM for available argument settings.*/
IPM_MORPHOLOGY = 0x20,
/**Reserved setting for image preprocessing mode.*/
#if defined(_WIN32) || defined(_WIN64)
IPM_REV = 0x80000000,
#else
IPM_REV = -2147483648,
#endif
/**Skips image preprocessing. */
IPM_SKIP = 0x00
}ImagePreprocessingMode;
/**
* @enum BarcodeComplementMode
*
* Describes the barcode complement mode.
*/
typedef enum BarcodeComplementMode
{
/**Not supported yet. */
BCM_AUTO = 0x01,
/**Complements the barcode using the general algorithm.*/
BCM_GENERAL = 0x02,
/**Reserved setting for barcode complement mode.*/
#if defined(_WIN32) || defined(_WIN64)
BCM_REV = 0x80000000,
#else
BCM_REV = -2147483648,
#endif
/**Skips the barcode complement. */
BCM_SKIP = 0x00
}BarcodeComplementMode;
/**
* @enum BarcodeColourMode
*
* Describes the barcode colour mode.
*/
typedef enum BarcodeColourMode
{
/**Dark items on a light background. Check @ref BICM for available argument settings.*/
BICM_DARK_ON_LIGHT = 0x01,
/**Light items on a dark background. Not supported yet. Check @ref BICM for available argument settings.*/
BICM_LIGHT_ON_DARK = 0x02,
/**Dark items on a dark background. Not supported yet. Check @ref BICM for available argument settings.*/
BICM_DARK_ON_DARK = 0x04,
/**Light items on a light background. Not supported yet. Check @ref BICM for available argument settings.*/
BICM_LIGHT_ON_LIGHT = 0x08,
/**The background is mixed by dark and light. Not supported yet. Check @ref BICM for available argument settings.*/
BICM_DARK_LIGHT_MIXED = 0x10,
/**Dark item on a light background surrounded by dark. Check @ref BICM for available argument settings.*/
BICM_DARK_ON_LIGHT_DARK_SURROUNDING = 0x20,
/**Reserved setting for barcode colour mode.*/
#if defined(_WIN32) || defined(_WIN64)
BICM_REV = 0x80000000,
#else
BICM_REV = -2147483648,
#endif
/**Skips the barcode colour operation. */
BICM_SKIP = 0x00
}BarcodeColourMode;
/**
* @enum ColourClusteringMode
*
* Describes the colour clustering mode. Not supported yet.
*/
typedef enum ColourClusteringMode
{
/**Not supported yet. */
CCM_AUTO = 0x00000001,
/**Clusters colours using the general algorithm based on HSV. Check @ref CCM for available argument settings. */
CCM_GENERAL_HSV = 0x00000002,
/**Reserved setting for colour clustering mode.*/
#if defined(_WIN32) || defined(_WIN64)
CCM_REV = 0x80000000,
#else
CCM_REV = -2147483648,
#endif
/**Skips the colour clustering. */
CCM_SKIP = 0x00
}ColourClusteringMode;
/**
* @enum DPMCodeReadingMode
*
* Describes the DPM code reading mode.
*/
typedef enum DPMCodeReadingMode
{
/**Not supported yet. */
DPMCRM_AUTO = 0x01,
/**Reads DPM code using the general algorithm.
When this mode is set, the library will automatically add LM_STATISTICS_MARKS to LocalizationModes and add a BM_LOCAL_BLOCK to BinarizationModes which is with arguments:
BlockSizeX=0, BlockSizeY=0, EnableFillBinaryVacancy=0, ImagePreprocessingModesIndex=1, ThreshValueCoefficient=15 if you doesn't set them.*/
DPMCRM_GENERAL = 0x02,
/**Reserved setting for DPM code reading mode.*/
#if defined(_WIN32) || defined(_WIN64)
DPMCRM_REV = 0x80000000,
#else
DPMCRM_REV = -2147483648,
#endif
/**Skips DPM code reading. */
DPMCRM_SKIP = 0x00
}DPMCodeReadingMode;
/**
* @enum ConflictMode
*
* Describes the conflict mode.
*/
typedef enum ConflictMode
{
/**Ignores new settings and inherits the previous settings. */
CM_IGNORE = 1,
/**Overwrites the old settings with new settings. */
CM_OVERWRITE = 2
}ConflictMode;
/**
* @enum IntermediateResultType
*
* Describes the intermediate result type.
*/
typedef enum IntermediateResultType
{
/**No intermediate result */
IRT_NO_RESULT = 0x00000000,
/**Original image */
IRT_ORIGINAL_IMAGE = 0x00000001,
/**Colour clustered image. Not supported yet. */
IRT_COLOUR_CLUSTERED_IMAGE = 0x00000002,
/**Colour image converted to grayscale */
IRT_COLOUR_CONVERTED_GRAYSCALE_IMAGE = 0x00000004,
/**Transformed grayscale image */
IRT_TRANSFORMED_GRAYSCALE_IMAGE = 0x00000008,
/**Predetected region */
IRT_PREDETECTED_REGION = 0x00000010,
/**Preprocessed image */
IRT_PREPROCESSED_IMAGE = 0x00000020,
/**Binarized image */
IRT_BINARIZED_IMAGE = 0x00000040,
/**Text zone */
IRT_TEXT_ZONE = 0x00000080,
/**Contour */
IRT_CONTOUR = 0x00000100,
/**Line segment */
IRT_LINE_SEGMENT = 0x00000200,
/**Form. Not supported yet. */
IRT_FORM = 0x00000400,
/**Segmentation block. Not supported yet. */
IRT_SEGMENTATION_BLOCK = 0x00000800,
/**Typed barcode zone */
IRT_TYPED_BARCODE_ZONE = 0x00001000,
/**Predetected quadrilateral*/
IRT_PREDETECTED_QUADRILATERAL = 0x00002000
}IntermediateResultType;
/**
* @enum LocalizationMode
*
* Describes the localization mode.
*/
typedef enum LocalizationMode
{
/**Not supported yet. */
LM_AUTO = 0x01,
/**Localizes barcodes by searching for connected blocks. This algorithm usually gives best result and it is recommended to set ConnectedBlocks to the highest priority. */
LM_CONNECTED_BLOCKS = 0x02,
/**Localizes barcodes by groups of contiguous black-white regions. This is optimized for QRCode and DataMatrix. */
LM_STATISTICS = 0x04,
/**Localizes barcodes by searching for groups of lines. This is optimized for 1D and PDF417 barcodes. */
LM_LINES = 0x08,
/**Localizes barcodes quickly. This mode is recommended in interactive scenario. Check @ref LM for available argument settings.*/
LM_SCAN_DIRECTLY = 0x10,
/**Localizes barcodes by groups of marks.This is optimized for DPM codes. */
LM_STATISTICS_MARKS = 0x20,
/**Localizes barcodes by groups of connected blocks and lines.This is optimized for postal codes. */
LM_STATISTICS_POSTAL_CODE = 0x40,
/**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,
#else
LM_REV = -2147483648,
#endif
/**Skips localization. */
LM_SKIP = 0x00
}LocalizationMode;
/**
* @enum MirrorMode
*
* Describes the mirror mode.
*/
typedef enum MirrorMode
{
MM_NORMAL = 0x01,
MM_MIRROR = 0x02,
MM_BOTH = 0x04
}MirrorMode;
/**
* @enum QRCodeErrorCorrectionLevel
*
* Describes the QR Code error correction level.
*/
typedef enum QRCodeErrorCorrectionLevel
{
/**Error Correction Level H (high) */
QRECL_ERROR_CORRECTION_H,
/**Error Correction Level L (low) */
QRECL_ERROR_CORRECTION_L,
/**Error Correction Level M (medium-low) */
QRECL_ERROR_CORRECTION_M,
/**Error Correction Level Q (medium-high) */
QRECL_ERROR_CORRECTION_Q
}QRCodeErrorCorrectionLevel;
/**
* @enum DeformationResistingMode
*
* Describes the deformation resisting mode.
*/
typedef enum DeformationResistingMode
{
/**Not supported yet. */
DRM_AUTO = 0x01,
/**Resists deformation using the general algorithm. Check @ref DRM for available argument settings.*/
DRM_GENERAL = 0x02,
/**Reserved setting for deformation resisting mode.*/
#if defined(_WIN32) || defined(_WIN64)
DRM_REV = 0x80000000,
#else