-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDynamsoftCore.h
More file actions
3488 lines (2929 loc) · 93.9 KB
/
DynamsoftCore.h
File metadata and controls
3488 lines (2929 loc) · 93.9 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
#pragma once
#define DYNAMSOFT_CORE_VERSION "4.4.20.7177"
/**Enumeration section*/
/**
* @enum ErrorCode
*
* Describes the error code that can be output by the library.
*/
typedef enum ErrorCode {
/**Successful. */
EC_OK = 0,
/** -10000~-19999: Common error code. */
/**Unknown error. */
EC_UNKNOWN = -10000,
/**Not enough memory to perform the operation. */
EC_NO_MEMORY = -10001,
/**Null pointer */
EC_NULL_POINTER = -10002,
/**License invalid*/
EC_LICENSE_INVALID = -10003,
/**License expired*/
EC_LICENSE_EXPIRED = -10004,
/**File not found*/
EC_FILE_NOT_FOUND = -10005,
/**The file type is not supported. */
EC_FILE_TYPE_NOT_SUPPORTED = -10006,
/**The BPP (Bits Per Pixel) is not supported. */
EC_BPP_NOT_SUPPORTED = -10007,
/**The index is invalid.*/
EC_INDEX_INVALID = -10008,
/**The input region value parameter is invalid.*/
EC_CUSTOM_REGION_INVALID = -10010,
/**Failed to read the image. */
EC_IMAGE_READ_FAILED = -10012,
/**Failed to read the TIFF image. */
EC_TIFF_READ_FAILED = -10013,
/**The DIB (Device-Independent Bitmaps) buffer is invalid. */
EC_DIB_BUFFER_INVALID = -10018,
/**Failed to read the PDF image. */
EC_PDF_READ_FAILED = -10021,
/**The PDF DLL is missing. */
EC_PDF_DLL_MISSING = -10022,
/**The page number is invalid. */
EC_PAGE_NUMBER_INVALID = -10023,
/**The custom size is invalid. */
EC_CUSTOM_SIZE_INVALID = -10024,
/** timeout. */
EC_TIMEOUT = -10026,
/**Json parse failed*/
EC_JSON_PARSE_FAILED = -10030,
/**Json type invalid*/
EC_JSON_TYPE_INVALID = -10031,
/**Json key invalid*/
EC_JSON_KEY_INVALID = -10032,
/**Json value invalid*/
EC_JSON_VALUE_INVALID = -10033,
/**Json name key missing*/
EC_JSON_NAME_KEY_MISSING = -10034,
/**The value of the key "Name" is duplicated.*/
EC_JSON_NAME_VALUE_DUPLICATED = -10035,
/**Template name invalid*/
EC_TEMPLATE_NAME_INVALID = -10036,
/**The name reference is invalid.*/
EC_JSON_NAME_REFERENCE_INVALID = -10037,
/**Parameter value invalid*/
EC_PARAMETER_VALUE_INVALID = -10038,
/**The domain of your current site does not match the domain bound in the current product key.*/
EC_DOMAIN_NOT_MATCH = -10039,
/**The reserved info does not match the reserved info bound in the current product key.*/
EC_RESERVED_INFO_NOT_MATCH = -10040,
/**The license key does not match the license content.*/
EC_LICENSE_KEY_NOT_MATCH = -10043,
/**Failed to request the license content.*/
EC_REQUEST_FAILED = -10044,
/**Failed to init the license.*/
EC_LICENSE_INIT_FAILED = -10045,
/**Failed to set mode's argument.*/
EC_SET_MODE_ARGUMENT_ERROR = -10051,
/**The license content is invalid.*/
EC_LICENSE_CONTENT_INVALID = -10052,
/**The license key is invalid.*/
EC_LICENSE_KEY_INVALID = -10053,
/**The license key has no remaining quota.*/
EC_LICENSE_DEVICE_RUNS_OUT = -10054,
/**Failed to get mode's argument.*/
EC_GET_MODE_ARGUMENT_ERROR = -10055,
/**The Intermediate Result Types license is invalid.*/
EC_IRT_LICENSE_INVALID = -10056,
/**Failed to save file.*/
EC_FILE_SAVE_FAILED = -10058,
/**The stage type is invalid.*/
EC_STAGE_TYPE_INVALID = -10059,
/**The image orientation is invalid.*/
EC_IMAGE_ORIENTATION_INVALID = -10060,
/**Complex template can't be converted to simplified settings.*/
EC_CONVERT_COMPLEX_TEMPLATE_ERROR = -10061,
/**Reject function call while capturing in progress.*/
EC_CALL_REJECTED_WHEN_CAPTURING = -10062,
/**The input image source was not found.*/
EC_NO_IMAGE_SOURCE = -10063,
/**Failed to read directory.*/
EC_READ_DIRECTORY_FAILED = -10064,
/**[Name] Module not found.*/
/**Name: */
/**DynamsoftBarcodeReader*/
/**DynamsoftLabelRecognizer*/
/**DynamsoftDocumentNormalizer*/
EC_MODULE_NOT_FOUND = -10065,
/**The api does not support multi-page files. Please use CaptureMultiPages instead.*/
EC_MULTI_PAGES_NOT_SUPPORTED = -10066,
/**The file already exists but overwriting is disabled.*/
EC_FILE_ALREADY_EXISTS = -10067,
/**The file path does not exist but cannot be created, or the file
cannot be created for any other reason.*/
EC_CREATE_FILE_FAILED = -10068,
/**The input ImageData object contains invalid parameter(s).*/
EC_IMAGE_DATA_INVALID = -10069,
/**The size of the input image does not meet the requirements.*/
EC_IMAGE_SIZE_NOT_MATCH = -10070,
/**The pixel format of the input image does not meet the requirements.*/
EC_IMAGE_PIXEL_FORMAT_NOT_MATCH = -10071,
/**The section level result is irreplaceable.*/
EC_SECTION_LEVEL_RESULT_IRREPLACEABLE = -10072,
/**The axis definition is incorrect.*/
EC_AXIS_DEFINITION_INCORRECT = -10073,
/**The result is not replaceable due to type mismatch.*/
EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE = -10074,
/**Failed to load the PDF library.*/
EC_PDF_LIBRARY_LOAD_FAILED = -10075,
/**The license is initialized successfully but detected invalid content in your key.*/
EC_LICENSE_WARNING = -10076,
/**One or more unsupported JSON keys were encountered and ignored from the template.*/
EC_UNSUPPORTED_JSON_KEY_WARNING = -10077,
/**Model file is not found.*/
EC_MODEL_FILE_NOT_FOUND = -10078,
/**[PDF] No license found.*/
EC_PDF_LICENSE_NOT_FOUND = -10079,
/**The rectangle is invalid.*/
EC_RECT_INVALID = -10080,
/*The template version is incompatible. Please use a compatible template.*/
EC_TEMPLATE_VERSION_INCOMPATIBLE = -10081,
/**The portrait zone could not be located on the identity document.*/
EC_PORTRAIT_ZONE_NOT_FOUND = -10082,
/** -20000~-29999: DLS license error code. */
/**No license.*/
EC_NO_LICENSE = -20000,
/**The Handshake Code is invalid.*/
EC_HANDSHAKE_CODE_INVALID = -20001,
/**Failed to read or write license buffer. */
EC_LICENSE_BUFFER_FAILED = -20002,
/**Failed to synchronize license info with license server. */
EC_LICENSE_SYNC_FAILED = -20003,
/**Device does not match with buffer. */
EC_DEVICE_NOT_MATCH = -20004,
/**Failed to bind device. */
EC_BIND_DEVICE_FAILED = -20005,
/**License Client dll is missing.*/
EC_LICENSE_CLIENT_DLL_MISSING = -20007,
/**Instance count is over limit.*/
EC_INSTANCE_COUNT_OVER_LIMIT = -20008,
/**Interface InitLicense has to be called before creating any SDK objects.*/
EC_LICENSE_INIT_SEQUENCE_FAILED = -20009,
/**Trial License*/
EC_TRIAL_LICENSE = -20010,
/**The license is not valid for current version*/
EC_LICENSE_VERSION_NOT_MATCH = -20011,
/**Online license validation failed due to network issues.Using cached license information for validation.*/
EC_LICENSE_CACHE_USED = -20012,
/*License authentication failed: quota exceeded.*/
EC_LICENSE_AUTH_QUOTA_EXCEEDED = -20013,
/**License restriction: the number of results has exceeded the allowed limit.*/
EC_LICENSE_RESULTS_LIMIT_EXCEEDED = -20014,
/**Failed to reach License Server.*/
EC_FAILED_TO_REACH_DLS = -20200,
/**-30000~-39999: DBR error code*/
/**The barcode format is invalid.*/
EC_BARCODE_FORMAT_INVALID = -30009,
/**The QR Code license is invalid.*/
EC_QR_LICENSE_INVALID = -30016,
/**The 1D Barcode license is invalid.*/
EC_1D_LICENSE_INVALID = -30017,
/**The PDF417 license is invalid.*/
EC_PDF417_LICENSE_INVALID = -30019,
/**The DATAMATRIX license is invalid. */
EC_DATAMATRIX_LICENSE_INVALID = -30020,
/**The custom module size is invalid. */
EC_CUSTOM_MODULESIZE_INVALID = -30025,
/**The AZTEC license is invalid.*/
EC_AZTEC_LICENSE_INVALID = -30041,
/**The Patchcode license is invalid.*/
EC_PATCHCODE_LICENSE_INVALID = -30046,
/**The Postal code license is invalid.*/
EC_POSTALCODE_LICENSE_INVALID = -30047,
/**The DPM license is invalid.*/
EC_DPM_LICENSE_INVALID = -30048,
/**The frame decoding thread already exists.*/
EC_FRAME_DECODING_THREAD_EXISTS = -30049,
/**Failed to stop the frame decoding thread.*/
EC_STOP_DECODING_THREAD_FAILED = -30050,
/**The Maxicode license is invalid.*/
EC_MAXICODE_LICENSE_INVALID = -30057,
/**The GS1 Databar license is invalid.*/
EC_GS1_DATABAR_LICENSE_INVALID = -30058,
/**The GS1 Composite code license is invalid.*/
EC_GS1_COMPOSITE_LICENSE_INVALID = -30059,
/**The DotCode license is invalid.*/
EC_DOTCODE_LICENSE_INVALID = -30061,
/**The Pharmacode license is invalid.*/
EC_PHARMACODE_LICENSE_INVALID = -30062,
/**The barcode license is not found.*/
EC_BARCODE_READER_LICENSE_NOT_FOUND = -30063,
/**-40000~-49999: DLR error code*/
/**Character Model file is not found*/
EC_CHARACTER_MODEL_FILE_NOT_FOUND = -40100,
/**There is a conflict in the layout of TextLineGroup. */
EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT = -40101,
/**There is a conflict in the regex of TextLineGroup. */
EC_TEXT_LINE_GROUP_REGEX_CONFLICT = -40102,
/**The label recognizer license is not found.*/
EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND = -40103,
/**-50000~-59999: DDN error code*/
/*The quadrilateral is invalid*/
EC_QUADRILATERAL_INVALID = -50057,
/**The document normalizer license is not found.*/
EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND = -50058,
/**-60000~-69999: DCE error code*/
/**-70000~-79999: Panorama error code*/
/**The panorama license is invalid.*/
EC_PANORAMA_LICENSE_INVALID = -70060,
/**-80000~-89999: Reserved error code*/
/**-90000~-99999: DCP error code*/
/*The resource path does not exist.*/
EC_RESOURCE_PATH_NOT_EXIST = -90001,
/*Failed to load resource.*/
EC_RESOURCE_LOAD_FAILED = -90002,
/*The code specification is not found.*/
EC_CODE_SPECIFICATION_NOT_FOUND = -90003,
/*The full code string is empty.*/
EC_FULL_CODE_EMPTY = -90004,
/*Failed to preprocess the full code string.*/
EC_FULL_CODE_PREPROCESS_FAILED = -90005,
/*The license for parsing South Africa Driver License is invalid.*/
EC_ZA_DL_LICENSE_INVALID = -90006,
/*The license for parsing North America DL/ID is invalid.*/
EC_AAMVA_DL_ID_LICENSE_INVALID = -90007,
/*The license for parsing Aadhaar is invalid.*/
EC_AADHAAR_LICENSE_INVALID = -90008,
/*The license for parsing Machine Readable Travel Documents is invalid.*/
EC_MRTD_LICENSE_INVALID = -90009,
/*The license for parsing Vehicle Identification Number is invalid.*/
EC_VIN_LICENSE_INVALID = -90010,
/*The license for parsing customized code type is invalid.*/
EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID = -90011,
/**The code parser license is not found.*/
EC_CODE_PARSER_LICENSE_NOT_FOUND = -90012
} ErrorCode;
/**
* @enum ImagePixelFormat
*
* Describes all the supported image pixel formats.
*/
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,
/**0:Black, 255:White */
IPF_BINARY_8,
/**NV12 */
IPF_NV12,
/**0:White, 255:Black */
IPF_BINARY_8_INVERTED
} ImagePixelFormat;
/**
* @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,
/**Lets the library choose an algorithm automatically for grayscale transformation.*/
GTM_AUTO = 0x04,
/**Reserved setting for grayscale transformation mode.*/
#if defined(_WIN32) || defined(_WIN64)
GTM_REV = 0x80000000,
/**Placeholder value with no functional meaning.*/
GTM_END = 0xFFFFFFFF,
#else
GTM_REV = -2147483648,
/**Placeholder value with no functional meaning.*/
GTM_END = -1,
#endif
/**Skips grayscale transformation. */
GTM_SKIP = 0x00
} GrayscaleTransformationMode;
/**
* @enum GrayscaleEnhancementMode
*
* Describes the grayscaleEnhancementMode.
*/
typedef enum GrayscaleEnhancementMode
{
/**Not supported yet. */
GEM_AUTO = 0x01,
/**Takes the unpreprocessed image for following operations. */
GEM_GENERAL = 0x02,
/**Preprocesses the image using the gray equalization algorithm. Check @ref IPM for available argument settings.*/
GEM_GRAY_EQUALIZE = 0x04,
/**Preprocesses the image using the gray smoothing algorithm. Check @ref IPM for available argument settings.*/
GEM_GRAY_SMOOTH = 0x08,
/**Preprocesses the image using the sharpening and smoothing algorithm. Check @ref IPM for available argument settings.*/
GEM_SHARPEN_SMOOTH = 0x10,
/**Reserved setting for image preprocessing mode.*/
#if defined(_WIN32) || defined(_WIN64)
GEM_REV = 0x80000000,
/**Placeholder value with no functional meaning.*/
GEM_END = 0xFFFFFFFF,
#else
GEM_REV = -2147483648,
/**Placeholder value with no functional meaning.*/
GEM_END = -1,
#endif
/**Skips image preprocessing. */
GEM_SKIP = 0x00
} GrayscaleEnhancementMode;
/**
* @enum PDFReadingMode
*
* Describes the PDF reading mode.
*/
typedef enum PDFReadingMode
{
/** Outputs vector data found in the PDFs.*/
PDFRM_VECTOR = 0x01,
/**The default value.
* Outputs raster data found in the PDFs.
* Depending on the argument Resolution,
* the SDK may rasterize the PDF pages.
* Check the template for available argument settings.*/
PDFRM_RASTER = 0x02,
/**Reserved setting for PDF reading mode.*/
#if defined(_WIN32) || defined(_WIN64)
PDFRM_REV = 0x80000000,
#else
PDFRM_REV = -2147483648,
#endif
} PDFReadingMode;
/**
* @enum RasterDataSource
*
* Describes the raster data sources.
*/
typedef enum RasterDataSource
{
/**The target type of the PDF file is "page". Only available for PDFReadingMode PDFRM_RASTER.*/
RDS_RASTERIZED_PAGES,
/**The target type of the PDF file is "image".*/
RDS_EXTRACTED_IMAGES
} RasterDataSource;
/**
* @enum CapturedResultItemType
*
* Describes all types of captured result item.
*/
typedef enum CapturedResultItemType
{
/** The type of the CapturedResultItem is "original image". */
CRIT_ORIGINAL_IMAGE = 1,
/** The type of the CapturedResultItem is "barcode". */
CRIT_BARCODE = 2,
/** The type of the CapturedResultItem is "text line". */
CRIT_TEXT_LINE = 4,
/** The type of the CapturedResultItem is "detected quad". */
CRIT_DETECTED_QUAD = 8,
/** The type of the CapturedResultItem is "deskewed image". */
CRIT_DESKEWED_IMAGE = 16,
/** The type of the CapturedResultItem is "parsed result". */
CRIT_PARSED_RESULT = 32,
/** The type of the CapturedResultItem is "enhanced image". */
CRIT_ENHANCED_IMAGE = 64
} CapturedResultItemType;
/**
* @enum BufferOverflowProtectionMode
*
* Describes the protection modes when the buffer of ImageSourceAdapter is overflow.
*/
typedef enum BufferOverflowProtectionMode
{
/** New images are blocked when the buffer is full. */
BOPM_BLOCK = 0x00,
/** New images are appended at the end, and the oldest images are pushed out from the beginning if the buffer is full. */
BOPM_UPDATE = 0x01,
} BufferOverflowProtectionMode;
/**
* @enum ImageTagType
*
* Describes the type of the image tag, which is used to distinguish video frame and file images.
*/
typedef enum ImageTagType
{
/**The image is a file image.*/
ITT_FILE_IMAGE,
/**The image is a video frame.*/
ITT_VIDEO_FRAME
} ImageTagType;
/**
* @enum VideoFrameQuality
*
* Describes the quality of video frames.
*/
typedef enum VideoFrameQuality
{
/**The frame quality is measured to be high.*/
VFQ_HIGH,
/**The frame quality is measured to be low.*/
VFQ_LOW,
/**The frame quality is unknown.*/
VFQ_UNKNOWN
} VideoFrameQuality;
/**
* @enum CornerType
*
* Describes how the corner is formed by its sides.
*/
typedef enum CornerType
{
/**The sides of the corner is normally intersected.*/
CT_NORMAL_INTERSECTED = 0,
/**The sides of the corner is T-intersected.*/
CT_T_INTERSECTED = 1,
/**The sides of the corner is cross-intersected.*/
CT_CROSS_INTERSECTED = 2,
/**The sides are not intersected but they definitely make up a corner.*/
CT_NOT_INTERSECTED = 3
} CornerType;
/**
* @enum SectionType
*
* Describes the section of the algorithm.
* In the IntermediateResultReceiver, the SectionType indicate the algorithm section that produced the IntermediateResult.
*/
typedef enum SectionType
{
ST_NULL,
/**The result is output by "region prediction" section.*/
ST_REGION_PREDETECTION,
/**The result is output by "barcode localization" section.*/
ST_BARCODE_LOCALIZATION,
/**The result is output by "barcode decoding" section.*/
ST_BARCODE_DECODING,
/**The result is output by "text line localization" section.*/
ST_TEXT_LINE_LOCALIZATION,
/**The result is output by "text line recognition" section.*/
ST_TEXT_LINE_RECOGNITION,
/**The result is output by "document detection" section.*/
ST_DOCUMENT_DETECTION,
/**The result is output by "document deskewing" section.*/
ST_DOCUMENT_DESKEWING,
/**The result is output by "image enhancement" section.*/
ST_IMAGE_ENHANCEMENT
} SectionType;
/**
* @enum IntermediateResultUnitType
*
* IntermediateResultUnitType is used in each subclass of IntermediateResult to indicate the type of the result.
* It is also used to declare which kinds IntermediateResult should be output by the library.
*/
enum IntermediateResultUnitType : unsigned long long
{
/**No IntermediateResult type is specified.*/
IRUT_NULL = 0,
/**The type of the IntermediateResult is "colour image".*/
IRUT_COLOUR_IMAGE = 1,
/**The type of the IntermediateResult is "scaled colour image".*/
IRUT_SCALED_COLOUR_IMAGE = 1 << 1,
/**The type of the IntermediateResult is "grayscale image".*/
IRUT_GRAYSCALE_IMAGE = 1 << 2,
/**The type of the IntermediateResult is "transformed grayscale image".*/
IRUT_TRANSFORMED_GRAYSCALE_IMAGE = 1 << 3,
/**The type of the IntermediateResult is "enhanced grayscale image".*/
IRUT_ENHANCED_GRAYSCALE_IMAGE = 1 << 4,
/**The type of the IntermediateResult is "predected regions".*/
IRUT_PREDETECTED_REGIONS = 1 << 5,
/**The type of the IntermediateResult is "binary image".*/
IRUT_BINARY_IMAGE = 1 << 6,
/**The type of the IntermediateResult is "texture detection result".*/
IRUT_TEXTURE_DETECTION_RESULT = 1 << 7,
/**The type of the IntermediateResult is "texture-removed grayscale image".*/
IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE = 1 << 8,
/**The type of the IntermediateResult is "texture-removed binary image".*/
IRUT_TEXTURE_REMOVED_BINARY_IMAGE = 1 << 9,
/**The type of the IntermediateResult is "contours".*/
IRUT_CONTOURS = 1 << 10,
/**The type of the IntermediateResult is "line segments".*/
IRUT_LINE_SEGMENTS = 1 << 11,
/**The type of the IntermediateResult is "text zones".*/
IRUT_TEXT_ZONES = 1 << 12,
/**The type of the IntermediateResult is "text removed binary image".*/
IRUT_TEXT_REMOVED_BINARY_IMAGE = 1 << 13,
/**The type of the IntermediateResult is "candidate barcode zones".*/
IRUT_CANDIDATE_BARCODE_ZONES = 1 << 14,
/**The type of the IntermediateResult is "localized barcodes".*/
IRUT_LOCALIZED_BARCODES = 1 << 15,
/**The type of the IntermediateResult is "scaled barcode image".*/
IRUT_SCALED_BARCODE_IMAGE = 1 << 16,
/**The type of the IntermediateResult is "deformation resisted barcode image".*/
IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE = 1 << 17,
/**The type of the IntermediateResult is "complemented barcode image".*/
IRUT_COMPLEMENTED_BARCODE_IMAGE = 1 << 18,
/**The type of the IntermediateResult is "decoded barcodes".*/
IRUT_DECODED_BARCODES = 1 << 19,
/**The type of the IntermediateResult is "long lines".*/
IRUT_LONG_LINES = 1 << 20,
/**The type of the IntermediateResult is "corners".*/
IRUT_CORNERS = 1 << 21,
/**The type of the IntermediateResult is "candidate quad edges".*/
IRUT_CANDIDATE_QUAD_EDGES = 1 << 22,
/**The type of the IntermediateResult is "detected quads".*/
IRUT_DETECTED_QUADS = 1 << 23,
/**The type of the IntermediateResult is "localized text lines".*/
IRUT_LOCALIZED_TEXT_LINES = 1 << 24,
/**The type of the IntermediateResult is "recognized text lines".*/
IRUT_RECOGNIZED_TEXT_LINES = 1 << 25,
/**The type of the IntermediateResult is "deskewed image".*/
IRUT_DESKEWED_IMAGE = 1 << 26,
/**The type of the IntermediateResult is "short lines".*/
IRUT_SHORT_LINES = 1 << 27,
/**The type of the IntermediateResult is "text line groups".*/
IRUT_RAW_TEXT_LINES = 1 << 28,
/**The type of the IntermediateResult is "logic line segment".*/
IRUT_LOGIC_LINES = 1 << 29,
/**The type of the IntermediateResult is "enhanced image".*/
IRUT_ENHANCED_IMAGE = 1ULL << 30,
/**The type of the IntermediateResult is "all".*/
IRUT_ALL = 0xFFFFFFFFFFFFFFFF
};
/**
* @enum RegionObjectElementType
*
* RegionObjectElementType is used to determine the particular type of the subclassed of RegionObjectElement.
*/
typedef enum RegionObjectElementType
{
/**The type of subclass PredetectedRegionElement.*/
ROET_PREDETECTED_REGION,
/**The type of subclass LocalizedBarcodeElement.*/
ROET_LOCALIZED_BARCODE,
/**The type of subclass DecodedBarcodeElement.*/
ROET_DECODED_BARCODE,
/**The type of subclass LocalizedTextLineElement.*/
ROET_LOCALIZED_TEXT_LINE,
/**The type of subclass RecognizedTextLineElement.*/
ROET_RECOGNIZED_TEXT_LINE,
/**The type of subclass DetectedQuadElement.*/
ROET_DETECTED_QUAD,
/**The type of subclass DeskewedImageElement.*/
ROET_DESKEWED_IMAGE,
/**The type of subclass SourceImageElement.*/
ROET_SOURCE_IMAGE,
/**The type of subclass TargetROIElement.*/
ROET_TARGET_ROI,
/**The type of subclass EnhancedImageElement.*/
ROET_ENHANCED_IMAGE,
/**The type for the AuxiliaryRegionElement class.*/
ROET_AUXILIARY_REGION
} RegionObjectElementType;
/**
* @enum ImageCaptureDistanceMode
*
* Describes the shooting mode of the image. It is used in the overlap mode of Panorama.
*/
typedef enum ImageCaptureDistanceMode
{
/**The image is taken by a camera from a close distance.*/
ICDM_NEAR,
/**The image is taken by a camera from a distance.*/
ICDM_FAR
} ImageCaptureDistanceMode;
/**
* @enum ColourChannelUsageType
*
* Describes how the color channel is used in the image.
*/
typedef enum ColourChannelUsageType
{
/**Automatic color channel usage determination based on image pixel format and scene.*/
CCUT_AUTO,
/**Use all available color channels for processing.*/
CCUT_FULL_CHANNEL,
/**Use only the Y(luminance) channel for processing in images represented in the NV21 format.*/
CCUT_Y_CHANNEL_ONLY,
/**Use only the red channel for processing in RGB images.*/
CCUT_RGB_R_CHANNEL_ONLY,
/**Use only the green channel for processing in RGB images.*/
CCUT_RGB_G_CHANNEL_ONLY,
/**Use only the blue channel for processing in RGB images.*/
CCUT_RGB_B_CHANNEL_ONLY
}ColourChannelUsageType;
/**
* @enum TransformMatrixType
*
* Describes the type of the transformation matrix.
*/
typedef enum TransformMatrixType
{
/**Represents a transformation matrix that converts coordinates from the local image to the original image.*/
TMT_LOCAL_TO_ORIGINAL_IMAGE,
/**Represents a transformation matrix that converts coordinates from the original image to the local image.*/
TMT_ORIGINAL_TO_LOCAL_IMAGE,
/**Represents a transformation matrix that converts coordinates from the rotated image to the original image.*/
TMT_ROTATED_TO_ORIGINAL_IMAGE,
/**Represents a transformation matrix that converts coordinates from the original image to the rotated image.*/
TMT_ORIGINAL_TO_ROTATED_IMAGE,
/**Represents a transformation matrix that converts coordinates from the local image to the section image.*/
TMT_LOCAL_TO_SECTION_IMAGE,
/**Represents a transformation matrix that converts coordinates from the section image to the local image.*/
TMT_SECTION_TO_LOCAL_IMAGE
}TransformMatrixType;
/**
* @enum CrossVerificationStatus
*/
typedef enum CrossVerificationStatus
{
/**The cross verification has not been performed yet.*/
CVS_NOT_VERIFIED,
/**The cross verification has been passed successfully.*/
CVS_PASSED,
/**The cross verification has failed.*/
CVS_FAILED
}CrossVerificationStatus;
/**
* @enum ImageFileFormat
*/
typedef enum ImageFileFormat
{
/** JPEG image format.*/
IFF_JPEG = 0,
/** PNG image format.*/
IFF_PNG = 1,
/** BMP (Bitmap) image format.*/
IFF_BMP = 2,
/** PDF (portable Document Format) image format.*/
IFF_PDF = 3
}ImageFileFormat;
/**Structures section*/
#pragma pack(push)
#pragma pack(4)
/**
* @struct IntermediateResultExtraInfo
*
* The IntermediateResultExtraInfo structure represents the extra information for generating an intermediate result unit.
*/
typedef struct IntermediateResultExtraInfo
{
/**Specifies the name of the TargetROIDef object that generates the intermediate result.*/
const char* targetROIDefName;
/**Specifies the name of the task that generates the intermediate result.*/
const char* taskName;
/**Specifies whether the intermediate result is section-level result.*/
bool isSectionLevelResult;
/**Specifies the SectionType that generates the intermediate result.*/
SectionType sectionType;
/**Reserved for future use.*/
char reserved[64];
}IntermediateResultExtraInfo;
#pragma pack(pop)
#if !defined(_WIN32) && !defined(_WIN64)
#define DS_API __attribute__((visibility("default")))
#include <stddef.h>
#else
#if defined(DS_EXPORTS)
#define DS_API __declspec(dllexport)
#else
#define DS_API __declspec(dllimport)
#endif
#include <windows.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* Gets error message by error code.
*
* @param [in] errorCode The error code.
*
* @return Returns the error message.
*
*/
DS_API const char* DC_GetErrorString(int errorCode);
/**
* Calculates the square root of a number.
*
* @param [in] x A non-negative number whose square root is to be computed.
*
* @return Returns the square root of the given argument.
*
*/
DS_API double DC_Sqrt(double x);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
namespace dynamsoft
{
namespace basic_structures
{