dynamsoft-capture-vision-bundle 3.4.1000__cp314-cp314-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. dynamsoft_capture_vision_bundle/ConfusableChars.data +0 -0
  2. dynamsoft_capture_vision_bundle/DynamicPdfx64.dll +0 -0
  3. dynamsoft_capture_vision_bundle/DynamsoftBarcodeReaderx64.dll +0 -0
  4. dynamsoft_capture_vision_bundle/DynamsoftCaptureVisionRouterx64.dll +0 -0
  5. dynamsoft_capture_vision_bundle/DynamsoftCodeParserDedicatorx64.dll +0 -0
  6. dynamsoft_capture_vision_bundle/DynamsoftCodeParserx64.dll +0 -0
  7. dynamsoft_capture_vision_bundle/DynamsoftCorex64.dll +0 -0
  8. dynamsoft_capture_vision_bundle/DynamsoftDocumentNormalizerx64.dll +0 -0
  9. dynamsoft_capture_vision_bundle/DynamsoftIdentityUtilityx64.dll +0 -0
  10. dynamsoft_capture_vision_bundle/DynamsoftImageProcessingx64.dll +0 -0
  11. dynamsoft_capture_vision_bundle/DynamsoftLabelRecognizerx64.dll +0 -0
  12. dynamsoft_capture_vision_bundle/DynamsoftLicensex64.dll +0 -0
  13. dynamsoft_capture_vision_bundle/DynamsoftNeuralNetworkx64.dll +0 -0
  14. dynamsoft_capture_vision_bundle/DynamsoftUtilityx64.dll +0 -0
  15. dynamsoft_capture_vision_bundle/Models/Code128Decoder.data +0 -0
  16. dynamsoft_capture_vision_bundle/Models/Code39ITFDecoder.data +0 -0
  17. dynamsoft_capture_vision_bundle/Models/DataMatrixQRCodeDeblur.data +0 -0
  18. dynamsoft_capture_vision_bundle/Models/DataMatrixQRCodeLocalization.data +0 -0
  19. dynamsoft_capture_vision_bundle/Models/EAN13Decoder.data +0 -0
  20. dynamsoft_capture_vision_bundle/Models/LetterCharRecognition.data +0 -0
  21. dynamsoft_capture_vision_bundle/Models/LowercaseCharRecognition.data +0 -0
  22. dynamsoft_capture_vision_bundle/Models/MRZCharRecognition.data +0 -0
  23. dynamsoft_capture_vision_bundle/Models/MRZLocalization.data +0 -0
  24. dynamsoft_capture_vision_bundle/Models/MRZTextLineRecognition.data +0 -0
  25. dynamsoft_capture_vision_bundle/Models/NumberCharRecognition.data +0 -0
  26. dynamsoft_capture_vision_bundle/Models/NumberLetterCharRecognition.data +0 -0
  27. dynamsoft_capture_vision_bundle/Models/NumberLowercaseCharRecognition.data +0 -0
  28. dynamsoft_capture_vision_bundle/Models/NumberUppercaseCharRecognition.data +0 -0
  29. dynamsoft_capture_vision_bundle/Models/OneDDeblur.data +0 -0
  30. dynamsoft_capture_vision_bundle/Models/OneDLocalization.data +0 -0
  31. dynamsoft_capture_vision_bundle/Models/PDF417Deblur.data +0 -0
  32. dynamsoft_capture_vision_bundle/Models/PDF417Localization.data +0 -0
  33. dynamsoft_capture_vision_bundle/Models/UppercaseCharRecognition.data +0 -0
  34. dynamsoft_capture_vision_bundle/Models/VINCharRecognition.data +0 -0
  35. dynamsoft_capture_vision_bundle/OverlappingChars.data +1 -0
  36. dynamsoft_capture_vision_bundle/ParserResources/AADHAAR.data +0 -0
  37. dynamsoft_capture_vision_bundle/ParserResources/AAMVA_DL_ID.data +1 -0
  38. dynamsoft_capture_vision_bundle/ParserResources/GS1_AI.data +66 -0
  39. dynamsoft_capture_vision_bundle/ParserResources/MRTD.data +1 -0
  40. dynamsoft_capture_vision_bundle/ParserResources/SOUTH_AFRICA_DL.data +1 -0
  41. dynamsoft_capture_vision_bundle/ParserResources/VIN.data +0 -0
  42. dynamsoft_capture_vision_bundle/Templates/DBR-PresetTemplates.json +546 -0
  43. dynamsoft_capture_vision_bundle/Templates/DDN-PresetTemplates.json +316 -0
  44. dynamsoft_capture_vision_bundle/Templates/DLR-PresetTemplates.json +471 -0
  45. dynamsoft_capture_vision_bundle/Templates/DriverLicenseScanner.json +94 -0
  46. dynamsoft_capture_vision_bundle/Templates/MRZScanner.json +804 -0
  47. dynamsoft_capture_vision_bundle/Templates/VINScanner.json +299 -0
  48. dynamsoft_capture_vision_bundle/_DynamsoftBarcodeReader.cp314-win_amd64.pyd +0 -0
  49. dynamsoft_capture_vision_bundle/_DynamsoftCaptureVisionRouter.cp314-win_amd64.pyd +0 -0
  50. dynamsoft_capture_vision_bundle/_DynamsoftCodeParser.cp314-win_amd64.pyd +0 -0
  51. dynamsoft_capture_vision_bundle/_DynamsoftCodeParserDedicator.cp314-win_amd64.pyd +0 -0
  52. dynamsoft_capture_vision_bundle/_DynamsoftCore.cp314-win_amd64.pyd +0 -0
  53. dynamsoft_capture_vision_bundle/_DynamsoftDocumentNormalizer.cp314-win_amd64.pyd +0 -0
  54. dynamsoft_capture_vision_bundle/_DynamsoftIdentityUtility.cp314-win_amd64.pyd +0 -0
  55. dynamsoft_capture_vision_bundle/_DynamsoftImageProcessing.cp314-win_amd64.pyd +0 -0
  56. dynamsoft_capture_vision_bundle/_DynamsoftLabelRecognizer.cp314-win_amd64.pyd +0 -0
  57. dynamsoft_capture_vision_bundle/_DynamsoftLicense.cp314-win_amd64.pyd +0 -0
  58. dynamsoft_capture_vision_bundle/_DynamsoftUtility.cp314-win_amd64.pyd +0 -0
  59. dynamsoft_capture_vision_bundle/__init__.py +13 -0
  60. dynamsoft_capture_vision_bundle/core.py +2785 -0
  61. dynamsoft_capture_vision_bundle/cvr.py +1347 -0
  62. dynamsoft_capture_vision_bundle/dbr.py +1223 -0
  63. dynamsoft_capture_vision_bundle/dcp.py +208 -0
  64. dynamsoft_capture_vision_bundle/dcpd.py +21 -0
  65. dynamsoft_capture_vision_bundle/ddn.py +985 -0
  66. dynamsoft_capture_vision_bundle/dip.py +24 -0
  67. dynamsoft_capture_vision_bundle/dlr.py +1136 -0
  68. dynamsoft_capture_vision_bundle/id_utility.py +98 -0
  69. dynamsoft_capture_vision_bundle/license.py +146 -0
  70. dynamsoft_capture_vision_bundle/utility.py +835 -0
  71. dynamsoft_capture_vision_bundle-3.4.1000.dist-info/METADATA +89 -0
  72. dynamsoft_capture_vision_bundle-3.4.1000.dist-info/RECORD +75 -0
  73. dynamsoft_capture_vision_bundle-3.4.1000.dist-info/WHEEL +5 -0
  74. dynamsoft_capture_vision_bundle-3.4.1000.dist-info/licenses/LICENSE.txt +1 -0
  75. dynamsoft_capture_vision_bundle-3.4.1000.dist-info/top_level.txt +12 -0
@@ -0,0 +1,2785 @@
1
+ __version__ = "4.0.40.7449"
2
+
3
+ import sys
4
+
5
+ module_name = "runtime_data_dynamsoft"
6
+ module = sys.modules.setdefault(module_name, type(sys)(module_name))
7
+
8
+ if __package__ or "." in __name__:
9
+ from . import _DynamsoftCore
10
+ else:
11
+ import _DynamsoftCore
12
+
13
+ from typing import List, Tuple
14
+ from enum import Enum, IntEnum
15
+ from abc import ABC, abstractmethod
16
+
17
+ class EnumErrorCode(IntEnum):
18
+ EC_OK = _DynamsoftCore.EC_OK
19
+ EC_UNKNOWN = _DynamsoftCore.EC_UNKNOWN
20
+ EC_NO_MEMORY = _DynamsoftCore.EC_NO_MEMORY
21
+ EC_NULL_POINTER = _DynamsoftCore.EC_NULL_POINTER
22
+ EC_LICENSE_INVALID = _DynamsoftCore.EC_LICENSE_INVALID
23
+ EC_LICENSE_EXPIRED = _DynamsoftCore.EC_LICENSE_EXPIRED
24
+ EC_FILE_NOT_FOUND = _DynamsoftCore.EC_FILE_NOT_FOUND
25
+ EC_FILE_TYPE_NOT_SUPPORTED = _DynamsoftCore.EC_FILE_TYPE_NOT_SUPPORTED
26
+ EC_BPP_NOT_SUPPORTED = _DynamsoftCore.EC_BPP_NOT_SUPPORTED
27
+ EC_INDEX_INVALID = _DynamsoftCore.EC_INDEX_INVALID
28
+ EC_CUSTOM_REGION_INVALID = _DynamsoftCore.EC_CUSTOM_REGION_INVALID
29
+ EC_IMAGE_READ_FAILED = _DynamsoftCore.EC_IMAGE_READ_FAILED
30
+ EC_TIFF_READ_FAILED = _DynamsoftCore.EC_TIFF_READ_FAILED
31
+ EC_DIB_BUFFER_INVALID = _DynamsoftCore.EC_DIB_BUFFER_INVALID
32
+ EC_PDF_READ_FAILED = _DynamsoftCore.EC_PDF_READ_FAILED
33
+ EC_PDF_DLL_MISSING = _DynamsoftCore.EC_PDF_DLL_MISSING
34
+ EC_PAGE_NUMBER_INVALID = _DynamsoftCore.EC_PAGE_NUMBER_INVALID
35
+ EC_CUSTOM_SIZE_INVALID = _DynamsoftCore.EC_CUSTOM_SIZE_INVALID
36
+ EC_TIMEOUT = _DynamsoftCore.EC_TIMEOUT
37
+ EC_JSON_PARSE_FAILED = _DynamsoftCore.EC_JSON_PARSE_FAILED
38
+ EC_JSON_TYPE_INVALID = _DynamsoftCore.EC_JSON_TYPE_INVALID
39
+ EC_JSON_KEY_INVALID = _DynamsoftCore.EC_JSON_KEY_INVALID
40
+ EC_JSON_VALUE_INVALID = _DynamsoftCore.EC_JSON_VALUE_INVALID
41
+ EC_JSON_NAME_KEY_MISSING = _DynamsoftCore.EC_JSON_NAME_KEY_MISSING
42
+ EC_JSON_NAME_VALUE_DUPLICATED = _DynamsoftCore.EC_JSON_NAME_VALUE_DUPLICATED
43
+ EC_TEMPLATE_NAME_INVALID = _DynamsoftCore.EC_TEMPLATE_NAME_INVALID
44
+ EC_JSON_NAME_REFERENCE_INVALID = _DynamsoftCore.EC_JSON_NAME_REFERENCE_INVALID
45
+ EC_PARAMETER_VALUE_INVALID = _DynamsoftCore.EC_PARAMETER_VALUE_INVALID
46
+ EC_DOMAIN_NOT_MATCH = _DynamsoftCore.EC_DOMAIN_NOT_MATCH
47
+ EC_RESERVED_INFO_NOT_MATCH = _DynamsoftCore.EC_RESERVED_INFO_NOT_MATCH
48
+ EC_LICENSE_KEY_NOT_MATCH = _DynamsoftCore.EC_LICENSE_KEY_NOT_MATCH
49
+ EC_REQUEST_FAILED = _DynamsoftCore.EC_REQUEST_FAILED
50
+ EC_LICENSE_INIT_FAILED = _DynamsoftCore.EC_LICENSE_INIT_FAILED
51
+ EC_SET_MODE_ARGUMENT_ERROR = _DynamsoftCore.EC_SET_MODE_ARGUMENT_ERROR
52
+ EC_LICENSE_CONTENT_INVALID = _DynamsoftCore.EC_LICENSE_CONTENT_INVALID
53
+ EC_LICENSE_KEY_INVALID = _DynamsoftCore.EC_LICENSE_KEY_INVALID
54
+ EC_LICENSE_DEVICE_RUNS_OUT = _DynamsoftCore.EC_LICENSE_DEVICE_RUNS_OUT
55
+ EC_GET_MODE_ARGUMENT_ERROR = _DynamsoftCore.EC_GET_MODE_ARGUMENT_ERROR
56
+ EC_IRT_LICENSE_INVALID = _DynamsoftCore.EC_IRT_LICENSE_INVALID
57
+ EC_FILE_SAVE_FAILED = _DynamsoftCore.EC_FILE_SAVE_FAILED
58
+ EC_STAGE_TYPE_INVALID = _DynamsoftCore.EC_STAGE_TYPE_INVALID
59
+ EC_IMAGE_ORIENTATION_INVALID = _DynamsoftCore.EC_IMAGE_ORIENTATION_INVALID
60
+ EC_CONVERT_COMPLEX_TEMPLATE_ERROR = _DynamsoftCore.EC_CONVERT_COMPLEX_TEMPLATE_ERROR
61
+ EC_CALL_REJECTED_WHEN_CAPTURING = _DynamsoftCore.EC_CALL_REJECTED_WHEN_CAPTURING
62
+ EC_NO_IMAGE_SOURCE = _DynamsoftCore.EC_NO_IMAGE_SOURCE
63
+ EC_READ_DIRECTORY_FAILED = _DynamsoftCore.EC_READ_DIRECTORY_FAILED
64
+ EC_MODULE_NOT_FOUND = _DynamsoftCore.EC_MODULE_NOT_FOUND
65
+ EC_MULTI_PAGES_NOT_SUPPORTED = _DynamsoftCore.EC_MULTI_PAGES_NOT_SUPPORTED
66
+ EC_FILE_ALREADY_EXISTS = _DynamsoftCore.EC_FILE_ALREADY_EXISTS
67
+ EC_CREATE_FILE_FAILED = _DynamsoftCore.EC_CREATE_FILE_FAILED
68
+ EC_IMAGE_DATA_INVALID = _DynamsoftCore.EC_IMAGE_DATA_INVALID
69
+ EC_IMAGE_SIZE_NOT_MATCH = _DynamsoftCore.EC_IMAGE_SIZE_NOT_MATCH
70
+ EC_IMAGE_PIXEL_FORMAT_NOT_MATCH = _DynamsoftCore.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH
71
+ EC_SECTION_LEVEL_RESULT_IRREPLACEABLE = (
72
+ _DynamsoftCore.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE
73
+ )
74
+ EC_AXIS_DEFINITION_INCORRECT = _DynamsoftCore.EC_AXIS_DEFINITION_INCORRECT
75
+ EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE = (
76
+ _DynamsoftCore.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE
77
+ )
78
+ EC_PDF_LIBRARY_LOAD_FAILED = _DynamsoftCore.EC_PDF_LIBRARY_LOAD_FAILED
79
+ EC_LICENSE_WARNING = _DynamsoftCore.EC_LICENSE_WARNING
80
+ EC_UNSUPPORTED_JSON_KEY_WARNING = _DynamsoftCore.EC_UNSUPPORTED_JSON_KEY_WARNING
81
+ EC_MODEL_FILE_NOT_FOUND = _DynamsoftCore.EC_MODEL_FILE_NOT_FOUND
82
+ EC_PDF_LICENSE_NOT_FOUND = _DynamsoftCore.EC_PDF_LICENSE_NOT_FOUND
83
+ EC_RECT_INVALID = _DynamsoftCore.EC_RECT_INVALID
84
+ EC_TEMPLATE_VERSION_INCOMPATIBLE = _DynamsoftCore.EC_TEMPLATE_VERSION_INCOMPATIBLE
85
+ EC_NO_LICENSE = _DynamsoftCore.EC_NO_LICENSE
86
+ EC_HANDSHAKE_CODE_INVALID = _DynamsoftCore.EC_HANDSHAKE_CODE_INVALID
87
+ EC_LICENSE_BUFFER_FAILED = _DynamsoftCore.EC_LICENSE_BUFFER_FAILED
88
+ EC_LICENSE_SYNC_FAILED = _DynamsoftCore.EC_LICENSE_SYNC_FAILED
89
+ EC_DEVICE_NOT_MATCH = _DynamsoftCore.EC_DEVICE_NOT_MATCH
90
+ EC_BIND_DEVICE_FAILED = _DynamsoftCore.EC_BIND_DEVICE_FAILED
91
+ EC_LICENSE_CLIENT_DLL_MISSING = _DynamsoftCore.EC_LICENSE_CLIENT_DLL_MISSING
92
+ EC_INSTANCE_COUNT_OVER_LIMIT = _DynamsoftCore.EC_INSTANCE_COUNT_OVER_LIMIT
93
+ EC_LICENSE_INIT_SEQUENCE_FAILED = _DynamsoftCore.EC_LICENSE_INIT_SEQUENCE_FAILED
94
+ EC_TRIAL_LICENSE = _DynamsoftCore.EC_TRIAL_LICENSE
95
+ EC_LICENSE_VERSION_NOT_MATCH = _DynamsoftCore.EC_LICENSE_VERSION_NOT_MATCH
96
+ EC_LICENSE_CACHE_USED = _DynamsoftCore.EC_LICENSE_CACHE_USED
97
+ EC_LICENSE_AUTH_QUOTA_EXCEEDED = _DynamsoftCore.EC_LICENSE_AUTH_QUOTA_EXCEEDED
98
+ EC_LICENSE_RESULTS_LIMIT_EXCEEDED = _DynamsoftCore.EC_LICENSE_RESULTS_LIMIT_EXCEEDED
99
+ EC_FAILED_TO_REACH_DLS = _DynamsoftCore.EC_FAILED_TO_REACH_DLS
100
+ EC_BARCODE_FORMAT_INVALID = _DynamsoftCore.EC_BARCODE_FORMAT_INVALID
101
+ EC_QR_LICENSE_INVALID = _DynamsoftCore.EC_QR_LICENSE_INVALID
102
+ EC_1D_LICENSE_INVALID = _DynamsoftCore.EC_1D_LICENSE_INVALID
103
+ EC_PDF417_LICENSE_INVALID = _DynamsoftCore.EC_PDF417_LICENSE_INVALID
104
+ EC_DATAMATRIX_LICENSE_INVALID = _DynamsoftCore.EC_DATAMATRIX_LICENSE_INVALID
105
+ EC_CUSTOM_MODULESIZE_INVALID = _DynamsoftCore.EC_CUSTOM_MODULESIZE_INVALID
106
+ EC_AZTEC_LICENSE_INVALID = _DynamsoftCore.EC_AZTEC_LICENSE_INVALID
107
+ EC_PATCHCODE_LICENSE_INVALID = _DynamsoftCore.EC_PATCHCODE_LICENSE_INVALID
108
+ EC_POSTALCODE_LICENSE_INVALID = _DynamsoftCore.EC_POSTALCODE_LICENSE_INVALID
109
+ EC_DPM_LICENSE_INVALID = _DynamsoftCore.EC_DPM_LICENSE_INVALID
110
+ EC_FRAME_DECODING_THREAD_EXISTS = _DynamsoftCore.EC_FRAME_DECODING_THREAD_EXISTS
111
+ EC_STOP_DECODING_THREAD_FAILED = _DynamsoftCore.EC_STOP_DECODING_THREAD_FAILED
112
+ EC_MAXICODE_LICENSE_INVALID = _DynamsoftCore.EC_MAXICODE_LICENSE_INVALID
113
+ EC_GS1_DATABAR_LICENSE_INVALID = _DynamsoftCore.EC_GS1_DATABAR_LICENSE_INVALID
114
+ EC_GS1_COMPOSITE_LICENSE_INVALID = _DynamsoftCore.EC_GS1_COMPOSITE_LICENSE_INVALID
115
+ EC_DOTCODE_LICENSE_INVALID = _DynamsoftCore.EC_DOTCODE_LICENSE_INVALID
116
+ EC_PHARMACODE_LICENSE_INVALID = _DynamsoftCore.EC_PHARMACODE_LICENSE_INVALID
117
+ EC_BARCODE_READER_LICENSE_NOT_FOUND = _DynamsoftCore.EC_BARCODE_READER_LICENSE_NOT_FOUND
118
+ EC_CHARACTER_MODEL_FILE_NOT_FOUND = _DynamsoftCore.EC_CHARACTER_MODEL_FILE_NOT_FOUND
119
+ EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT = (
120
+ _DynamsoftCore.EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT
121
+ )
122
+ EC_TEXT_LINE_GROUP_REGEX_CONFLICT = _DynamsoftCore.EC_TEXT_LINE_GROUP_REGEX_CONFLICT
123
+ EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND = _DynamsoftCore.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND
124
+ EC_QUADRILATERAL_INVALID = _DynamsoftCore.EC_QUADRILATERAL_INVALID
125
+ EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND = _DynamsoftCore.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND
126
+ EC_PANORAMA_LICENSE_INVALID = _DynamsoftCore.EC_PANORAMA_LICENSE_INVALID
127
+ EC_RESOURCE_PATH_NOT_EXIST = _DynamsoftCore.EC_RESOURCE_PATH_NOT_EXIST
128
+ EC_RESOURCE_LOAD_FAILED = _DynamsoftCore.EC_RESOURCE_LOAD_FAILED
129
+ EC_CODE_SPECIFICATION_NOT_FOUND = _DynamsoftCore.EC_CODE_SPECIFICATION_NOT_FOUND
130
+ EC_FULL_CODE_EMPTY = _DynamsoftCore.EC_FULL_CODE_EMPTY
131
+ EC_FULL_CODE_PREPROCESS_FAILED = _DynamsoftCore.EC_FULL_CODE_PREPROCESS_FAILED
132
+ EC_ZA_DL_LICENSE_INVALID = _DynamsoftCore.EC_ZA_DL_LICENSE_INVALID
133
+ EC_AAMVA_DL_ID_LICENSE_INVALID = _DynamsoftCore.EC_AAMVA_DL_ID_LICENSE_INVALID
134
+ EC_AADHAAR_LICENSE_INVALID = _DynamsoftCore.EC_AADHAAR_LICENSE_INVALID
135
+ EC_MRTD_LICENSE_INVALID = _DynamsoftCore.EC_MRTD_LICENSE_INVALID
136
+ EC_VIN_LICENSE_INVALID = _DynamsoftCore.EC_VIN_LICENSE_INVALID
137
+ EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID = (
138
+ _DynamsoftCore.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID
139
+ )
140
+ EC_CODE_PARSER_LICENSE_NOT_FOUND = _DynamsoftCore.EC_CODE_PARSER_LICENSE_NOT_FOUND
141
+
142
+
143
+ class EnumImagePixelFormat(IntEnum):
144
+ IPF_BINARY = _DynamsoftCore.IPF_BINARY
145
+ IPF_BINARYINVERTED = _DynamsoftCore.IPF_BINARYINVERTED
146
+ IPF_GRAYSCALED = _DynamsoftCore.IPF_GRAYSCALED
147
+ IPF_NV21 = _DynamsoftCore.IPF_NV21
148
+ IPF_RGB_565 = _DynamsoftCore.IPF_RGB_565
149
+ IPF_RGB_555 = _DynamsoftCore.IPF_RGB_555
150
+ IPF_RGB_888 = _DynamsoftCore.IPF_RGB_888
151
+ IPF_ARGB_8888 = _DynamsoftCore.IPF_ARGB_8888
152
+ IPF_RGB_161616 = _DynamsoftCore.IPF_RGB_161616
153
+ IPF_ARGB_16161616 = _DynamsoftCore.IPF_ARGB_16161616
154
+ IPF_ABGR_8888 = _DynamsoftCore.IPF_ABGR_8888
155
+ IPF_ABGR_16161616 = _DynamsoftCore.IPF_ABGR_16161616
156
+ IPF_BGR_888 = _DynamsoftCore.IPF_BGR_888
157
+ IPF_BINARY_8 = _DynamsoftCore.IPF_BINARY_8
158
+ IPF_NV12 = _DynamsoftCore.IPF_NV12
159
+ IPF_BINARY_8_INVERTED = _DynamsoftCore.IPF_BINARY_8_INVERTED
160
+
161
+
162
+ class EnumGrayscaleTransformationMode(IntEnum):
163
+ GTM_INVERTED = _DynamsoftCore.GTM_INVERTED
164
+ GTM_ORIGINAL = _DynamsoftCore.GTM_ORIGINAL
165
+ GTM_AUTO = _DynamsoftCore.GTM_AUTO
166
+ GTM_REV = _DynamsoftCore.GTM_REV
167
+ GTM_END = _DynamsoftCore.GTM_END
168
+ GTM_SKIP = _DynamsoftCore.GTM_SKIP
169
+
170
+
171
+ class EnumGrayscaleEnhancementMode(IntEnum):
172
+ GEM_AUTO = _DynamsoftCore.GEM_AUTO
173
+ GEM_GENERAL = _DynamsoftCore.GEM_GENERAL
174
+ GEM_GRAY_EQUALIZE = _DynamsoftCore.GEM_GRAY_EQUALIZE
175
+ GEM_GRAY_SMOOTH = _DynamsoftCore.GEM_GRAY_SMOOTH
176
+ GEM_SHARPEN_SMOOTH = _DynamsoftCore.GEM_SHARPEN_SMOOTH
177
+ GEM_REV = _DynamsoftCore.GEM_REV
178
+ GEM_END = _DynamsoftCore.GEM_END
179
+ GEM_SKIP = _DynamsoftCore.GEM_SKIP
180
+
181
+
182
+ class EnumPDFReadingMode(IntEnum):
183
+ PDFRM_VECTOR = _DynamsoftCore.PDFRM_VECTOR
184
+ PDFRM_RASTER = _DynamsoftCore.PDFRM_RASTER
185
+ PDFRM_REV = _DynamsoftCore.PDFRM_REV
186
+
187
+
188
+ class EnumRasterDataSource(IntEnum):
189
+ RDS_RASTERIZED_PAGES = _DynamsoftCore.RDS_RASTERIZED_PAGES
190
+ RDS_EXTRACTED_IMAGES = _DynamsoftCore.RDS_EXTRACTED_IMAGES
191
+
192
+
193
+ class EnumCapturedResultItemType(IntEnum):
194
+ CRIT_ORIGINAL_IMAGE = _DynamsoftCore.CRIT_ORIGINAL_IMAGE
195
+ CRIT_BARCODE = _DynamsoftCore.CRIT_BARCODE
196
+ CRIT_TEXT_LINE = _DynamsoftCore.CRIT_TEXT_LINE
197
+ CRIT_DETECTED_QUAD = _DynamsoftCore.CRIT_DETECTED_QUAD
198
+ CRIT_DESKEWED_IMAGE = _DynamsoftCore.CRIT_DESKEWED_IMAGE
199
+ CRIT_PARSED_RESULT = _DynamsoftCore.CRIT_PARSED_RESULT
200
+ CRIT_ENHANCED_IMAGE = _DynamsoftCore.CRIT_ENHANCED_IMAGE
201
+
202
+
203
+ class EnumBufferOverflowProtectionMode(IntEnum):
204
+ BOPM_BLOCK = _DynamsoftCore.BOPM_BLOCK
205
+ BOPM_UPDATE = _DynamsoftCore.BOPM_UPDATE
206
+
207
+
208
+ class EnumImageTagType(IntEnum):
209
+ ITT_FILE_IMAGE = _DynamsoftCore.ITT_FILE_IMAGE
210
+ ITT_VIDEO_FRAME = _DynamsoftCore.ITT_VIDEO_FRAME
211
+
212
+
213
+ class EnumVideoFrameQuality(IntEnum):
214
+ VFQ_HIGH = _DynamsoftCore.VFQ_HIGH
215
+ VFQ_LOW = _DynamsoftCore.VFQ_LOW
216
+ VFQ_UNKNOWN = _DynamsoftCore.VFQ_UNKNOWN
217
+
218
+
219
+ class EnumImageCaptureDistanceMode(IntEnum):
220
+ ICDM_NEAR = _DynamsoftCore.ICDM_NEAR
221
+ ICDM_FAR = _DynamsoftCore.ICDM_FAR
222
+
223
+
224
+ class EnumColourChannelUsageType(IntEnum):
225
+ CCUT_AUTO = _DynamsoftCore.CCUT_AUTO
226
+ CCUT_FULL_CHANNEL = _DynamsoftCore.CCUT_FULL_CHANNEL
227
+ CCUT_Y_CHANNEL_ONLY = _DynamsoftCore.CCUT_Y_CHANNEL_ONLY
228
+ CCUT_RGB_R_CHANNEL_ONLY = _DynamsoftCore.CCUT_RGB_R_CHANNEL_ONLY
229
+ CCUT_RGB_G_CHANNEL_ONLY = _DynamsoftCore.CCUT_RGB_G_CHANNEL_ONLY
230
+ CCUT_RGB_B_CHANNEL_ONLY = _DynamsoftCore.CCUT_RGB_B_CHANNEL_ONLY
231
+ class EnumCornerType(IntEnum):
232
+ CT_NORMAL_INTERSECTED = _DynamsoftCore.CT_NORMAL_INTERSECTED
233
+ CT_T_INTERSECTED = _DynamsoftCore.CT_T_INTERSECTED
234
+ CT_CROSS_INTERSECTED = _DynamsoftCore.CT_CROSS_INTERSECTED
235
+ CT_NOT_INTERSECTED = _DynamsoftCore.CT_NOT_INTERSECTED
236
+ class EnumSectionType(IntEnum):
237
+ ST_NULL = _DynamsoftCore.ST_NULL
238
+ ST_REGION_PREDETECTION = _DynamsoftCore.ST_REGION_PREDETECTION
239
+ ST_BARCODE_LOCALIZATION = _DynamsoftCore.ST_BARCODE_LOCALIZATION
240
+ ST_BARCODE_DECODING = _DynamsoftCore.ST_BARCODE_DECODING
241
+ ST_TEXT_LINE_LOCALIZATION = _DynamsoftCore.ST_TEXT_LINE_LOCALIZATION
242
+ ST_TEXT_LINE_RECOGNITION = _DynamsoftCore.ST_TEXT_LINE_RECOGNITION
243
+ ST_DOCUMENT_DETECTION = _DynamsoftCore.ST_DOCUMENT_DETECTION
244
+ ST_DOCUMENT_DESKEWING = _DynamsoftCore.ST_DOCUMENT_DESKEWING
245
+ ST_IMAGE_ENHANCEMENT = _DynamsoftCore.ST_IMAGE_ENHANCEMENT
246
+ class EnumIntermediateResultUnitType(IntEnum):
247
+ IRUT_NULL = _DynamsoftCore.IRUT_NULL
248
+ IRUT_COLOUR_IMAGE = _DynamsoftCore.IRUT_COLOUR_IMAGE
249
+ IRUT_SCALED_COLOUR_IMAGE = _DynamsoftCore.IRUT_SCALED_COLOUR_IMAGE
250
+ IRUT_GRAYSCALE_IMAGE = _DynamsoftCore.IRUT_GRAYSCALE_IMAGE
251
+ IRUT_TRANSFORMED_GRAYSCALE_IMAGE = _DynamsoftCore.IRUT_TRANSFORMED_GRAYSCALE_IMAGE
252
+ IRUT_ENHANCED_GRAYSCALE_IMAGE = _DynamsoftCore.IRUT_ENHANCED_GRAYSCALE_IMAGE
253
+ IRUT_PREDETECTED_REGIONS = _DynamsoftCore.IRUT_PREDETECTED_REGIONS
254
+ IRUT_BINARY_IMAGE = _DynamsoftCore.IRUT_BINARY_IMAGE
255
+ IRUT_TEXTURE_DETECTION_RESULT = _DynamsoftCore.IRUT_TEXTURE_DETECTION_RESULT
256
+ IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE = _DynamsoftCore.IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE
257
+ IRUT_TEXTURE_REMOVED_BINARY_IMAGE = _DynamsoftCore.IRUT_TEXTURE_REMOVED_BINARY_IMAGE
258
+ IRUT_CONTOURS = _DynamsoftCore.IRUT_CONTOURS
259
+ IRUT_LINE_SEGMENTS = _DynamsoftCore.IRUT_LINE_SEGMENTS
260
+ IRUT_TEXT_ZONES = _DynamsoftCore.IRUT_TEXT_ZONES
261
+ IRUT_TEXT_REMOVED_BINARY_IMAGE = _DynamsoftCore.IRUT_TEXT_REMOVED_BINARY_IMAGE
262
+ IRUT_CANDIDATE_BARCODE_ZONES = _DynamsoftCore.IRUT_CANDIDATE_BARCODE_ZONES
263
+ IRUT_LOCALIZED_BARCODES = _DynamsoftCore.IRUT_LOCALIZED_BARCODES
264
+ IRUT_SCALED_BARCODE_IMAGE = _DynamsoftCore.IRUT_SCALED_BARCODE_IMAGE
265
+ IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE = _DynamsoftCore.IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE
266
+ IRUT_COMPLEMENTED_BARCODE_IMAGE = _DynamsoftCore.IRUT_COMPLEMENTED_BARCODE_IMAGE
267
+ IRUT_DECODED_BARCODES = _DynamsoftCore.IRUT_DECODED_BARCODES
268
+ IRUT_LONG_LINES = _DynamsoftCore.IRUT_LONG_LINES
269
+ IRUT_CORNERS = _DynamsoftCore.IRUT_CORNERS
270
+ IRUT_CANDIDATE_QUAD_EDGES = _DynamsoftCore.IRUT_CANDIDATE_QUAD_EDGES
271
+ IRUT_DETECTED_QUADS = _DynamsoftCore.IRUT_DETECTED_QUADS
272
+ IRUT_LOCALIZED_TEXT_LINES = _DynamsoftCore.IRUT_LOCALIZED_TEXT_LINES
273
+ IRUT_RECOGNIZED_TEXT_LINES = _DynamsoftCore.IRUT_RECOGNIZED_TEXT_LINES
274
+ IRUT_DESKEWED_IMAGE = _DynamsoftCore.IRUT_DESKEWED_IMAGE
275
+ IRUT_SHORT_LINES = _DynamsoftCore.IRUT_SHORT_LINES
276
+ IRUT_RAW_TEXT_LINES = _DynamsoftCore.IRUT_RAW_TEXT_LINES
277
+ IRUT_LOGIC_LINES = _DynamsoftCore.IRUT_LOGIC_LINES
278
+ IRUT_ENHANCED_IMAGE = _DynamsoftCore.IRUT_ENHANCED_IMAGE
279
+ IRUT_ALL = _DynamsoftCore.IRUT_ALL
280
+ class EnumRegionObjectElementType(IntEnum):
281
+ ROET_PREDETECTED_REGION = _DynamsoftCore.ROET_PREDETECTED_REGION
282
+ ROET_LOCALIZED_BARCODE = _DynamsoftCore.ROET_LOCALIZED_BARCODE
283
+ ROET_DECODED_BARCODE = _DynamsoftCore.ROET_DECODED_BARCODE
284
+ ROET_LOCALIZED_TEXT_LINE = _DynamsoftCore.ROET_LOCALIZED_TEXT_LINE
285
+ ROET_RECOGNIZED_TEXT_LINE = _DynamsoftCore.ROET_RECOGNIZED_TEXT_LINE
286
+ ROET_DETECTED_QUAD = _DynamsoftCore.ROET_DETECTED_QUAD
287
+ ROET_DESKEWED_IMAGE = _DynamsoftCore.ROET_DESKEWED_IMAGE
288
+ ROET_SOURCE_IMAGE = _DynamsoftCore.ROET_SOURCE_IMAGE
289
+ ROET_TARGET_ROI = _DynamsoftCore.ROET_TARGET_ROI
290
+ ROET_ENHANCED_IMAGE = _DynamsoftCore.ROET_ENHANCED_IMAGE
291
+ ROET_AUXILIARY_REGION = _DynamsoftCore.ROET_AUXILIARY_REGION
292
+ class EnumTransformMatrixType(IntEnum):
293
+ TMT_LOCAL_TO_ORIGINAL_IMAGE = _DynamsoftCore.TMT_LOCAL_TO_ORIGINAL_IMAGE
294
+ TMT_ORIGINAL_TO_LOCAL_IMAGE = _DynamsoftCore.TMT_ORIGINAL_TO_LOCAL_IMAGE
295
+ TMT_ROTATED_TO_ORIGINAL_IMAGE = _DynamsoftCore.TMT_ROTATED_TO_ORIGINAL_IMAGE
296
+ TMT_ORIGINAL_TO_ROTATED_IMAGE = _DynamsoftCore.TMT_ORIGINAL_TO_ROTATED_IMAGE
297
+ TMT_LOCAL_TO_SECTION_IMAGE = _DynamsoftCore.TMT_LOCAL_TO_SECTION_IMAGE
298
+ TMT_SECTION_TO_LOCAL_IMAGE = _DynamsoftCore.TMT_SECTION_TO_LOCAL_IMAGE
299
+ class EnumCrossVerificationStatus(IntEnum):
300
+ CVS_NOT_VERIFIED = _DynamsoftCore.CVS_NOT_VERIFIED
301
+ CVS_PASSED = _DynamsoftCore.CVS_PASSED
302
+ CVS_FAILED = _DynamsoftCore.CVS_FAILED
303
+ class EnumImageFileFormat(IntEnum):
304
+ IFF_JPEG = _DynamsoftCore.IFF_JPEG
305
+ IFF_PNG = _DynamsoftCore.IFF_PNG
306
+ IFF_BMP = _DynamsoftCore.IFF_BMP
307
+ IFF_PDF = _DynamsoftCore.IFF_PDF
308
+
309
+ IDENTITY_MATRIX = [
310
+ 1.0, 0.0, 0.0,
311
+ 0.0, 1.0, 0.0,
312
+ 0.0, 0.0, 1.0
313
+ ]
314
+
315
+ class CoreModule:
316
+ """
317
+ The CoreModule class defines general functions in the core module.
318
+
319
+ Methods:
320
+ get_version() -> str: Returns a string representing the version of the core module.
321
+ """
322
+
323
+ _thisown = property(
324
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
325
+ )
326
+
327
+ @staticmethod
328
+ def get_version() -> str:
329
+ """
330
+ Returns a string representing the version of the core module.
331
+
332
+ Returns:
333
+ str: A string representing the version of the core module.
334
+ """
335
+ return __version__ + " (Algorithm " + _DynamsoftCore.CCoreModule_GetVersion() + ")"
336
+
337
+
338
+ def __init__(self):
339
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CCoreModule())
340
+
341
+ __destroy__ = _DynamsoftCore.delete_CCoreModule
342
+
343
+
344
+ _DynamsoftCore.CCoreModule_register(CoreModule)
345
+
346
+
347
+ class Point:
348
+ """
349
+ A class representing a point in 2D space.
350
+
351
+ Attributes:
352
+ x (int): The x coordinate of the point.
353
+ y (int): The y coordinate of the point.
354
+
355
+ Methods:
356
+ distance_to(self, pt: 'Point') -> float: Calculates the distance between the current point and the specified target point.
357
+ transform_coordinates(original_point: 'Point', transformation_matrix: List[float]) -> 'Point': Transforms the coordinates of a point using a given transformation matrix.
358
+ """
359
+
360
+ _thisown = property(
361
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
362
+ )
363
+
364
+ __destroy__ = _DynamsoftCore.delete_CPoint
365
+
366
+ x: int = property(_DynamsoftCore.CPoint_Getx, _DynamsoftCore.CPoint_Setx)
367
+ y: int = property(_DynamsoftCore.CPoint_Gety, _DynamsoftCore.CPoint_Sety)
368
+
369
+ def __init__(self, x: int = 0, y: int = 0):
370
+ """
371
+ Constructs a Point object.
372
+
373
+ Args:
374
+ x (int, optional): The x coordinate of the point. Defaults to 0.
375
+ y (int, optional): The y coordinate of the point. Defaults to 0.
376
+ """
377
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CPoint(x,y))
378
+
379
+ def __repr__(self):
380
+ return f"Point({self.x}, {self.y})"
381
+
382
+ def distance_to(self, pt: "Point") -> float:
383
+ """
384
+ Calculates the distance between the current point and the specified target point.
385
+
386
+ Args:
387
+ pt: The target point to which the distance is calculated.
388
+
389
+ Returns:
390
+ A value representing the distance between the current point and the specified target point.
391
+ """
392
+ return _DynamsoftCore.CPoint_DistanceTo(self, pt)
393
+
394
+ @staticmethod
395
+ def transform_coordinates(original_point: "Point", transformation_matrix: List[float]) -> "Point":
396
+ """
397
+ Transforms the coordinates of a point using a given transformation matrix.
398
+
399
+ Args:
400
+ original_point: The original point to transform.
401
+ transformation_matrix: The transformation matrix to apply to the coordinates.
402
+
403
+ Returns:
404
+ A new Point object with the transformed coordinates.
405
+ """
406
+ return _DynamsoftCore.CPoint_TransformCoordinates(
407
+ original_point, transformation_matrix
408
+ )
409
+
410
+
411
+ _DynamsoftCore.CPoint_register(Point)
412
+
413
+ class Rect:
414
+ """
415
+ The Rect class represents a rectangle in 2D space.
416
+
417
+ Attributes:
418
+ top (int): The top coordinate of the rectangle.
419
+ left (int): The left coordinate of the rectangle.
420
+ right (int): The right coordinate of the rectangle.
421
+ bottom (int): The bottom coordinate of the rectangle.
422
+ """
423
+ _thisown = property(
424
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
425
+ )
426
+
427
+ top: int = property(_DynamsoftCore.CRect_top_get, _DynamsoftCore.CRect_top_set)
428
+ left: int = property(_DynamsoftCore.CRect_left_get, _DynamsoftCore.CRect_left_set)
429
+ right: int = property(_DynamsoftCore.CRect_right_get, _DynamsoftCore.CRect_right_set)
430
+ bottom: int = property(_DynamsoftCore.CRect_bottom_get, _DynamsoftCore.CRect_bottom_set)
431
+ id: int = property(_DynamsoftCore.CRect_id_get, _DynamsoftCore.CRect_id_set)
432
+
433
+ def __init__(self):
434
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CRect())
435
+
436
+ def __repr__(self):
437
+ return f"Rect(top={self.top}, left={self.left}, right={self.right}, bottom={self.bottom})"
438
+
439
+ __destroy__ = _DynamsoftCore.delete_CRect
440
+
441
+
442
+ _DynamsoftCore.CRect_register(Rect)
443
+
444
+ class Quadrilateral:
445
+ """
446
+ A quadrilateral.
447
+
448
+ Attributes:
449
+ points: A Point list of length 4 that define the quadrilateral.
450
+ id: The ID of the quadrilateral.
451
+ Methods:
452
+ contains(self, point: 'Point') -> bool: Determines whether a point is inside the quadrilateral.
453
+ get_area(self) -> int: Gets the area of the quadrilateral.
454
+ get_bounding_rect(self) -> Rect: Gets the bounding rectangle of the quadrilateral.
455
+ """
456
+
457
+ class _OwnerList(List):
458
+ def __init__(self,owner, list):
459
+ self._owner = owner
460
+ super().__init__(list)
461
+
462
+ _thisown = property(
463
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
464
+ )
465
+
466
+
467
+
468
+ def __init__(self):
469
+ """
470
+ Initializes a new instance of the Quadrilateral class with default values.
471
+ """
472
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CQuadrilateral())
473
+ self._point_list = None
474
+
475
+ def __repr__(self):
476
+ list_repr = ", ".join(f"({obj.x}, {obj.y})" for obj in self.points)
477
+ return f"Quadrilateral[{list_repr}]"
478
+
479
+ id: int = property(_DynamsoftCore.CQuadrilateral_id_get, _DynamsoftCore.CQuadrilateral_id_set)
480
+
481
+ @property
482
+ def points(self) -> List[Point]:
483
+ if not hasattr(self, '_point_list') or self._point_list is None:
484
+ self._point_list = Quadrilateral._OwnerList(self,_DynamsoftCore.CQuadrilateral_points_get(self))
485
+ return self._point_list
486
+
487
+ @points.setter
488
+ def points(self, point_list):
489
+ if not hasattr(self, '_point_list') or self._point_list is None:
490
+ self._point_list = Quadrilateral._OwnerList(self,_DynamsoftCore.CQuadrilateral_points_get(self))
491
+ _DynamsoftCore.CQuadrilateral_points_set(self, point_list)
492
+ self._point_list = point_list
493
+
494
+ def contains(self, point: "Point") -> bool:
495
+ """
496
+ Determines whether a point is inside the quadrilateral.
497
+
498
+ Args:
499
+ point: The point to test.
500
+
501
+ Returns:
502
+ True if the point inside the quadrilateral, False otherwise.
503
+ """
504
+ return _DynamsoftCore.CQuadrilateral_Contains(self, point)
505
+
506
+ def get_area(self) -> int:
507
+ """
508
+ Gets the area of the quadrilateral.
509
+
510
+ Returns:
511
+ The area of the quadrilateral.
512
+ """
513
+ return _DynamsoftCore.CQuadrilateral_GetArea(self)
514
+
515
+ def get_bounding_rect(self) -> Rect:
516
+ """
517
+ Gets the bounding rectangle of the quadrilateral.
518
+
519
+ Returns:
520
+ The bounding rectangle of the quadrilateral.
521
+ """
522
+ return _DynamsoftCore.CQuadrilateral_GetBoundingRect(self)
523
+
524
+ __destroy__ = _DynamsoftCore.delete_CQuadrilateral
525
+
526
+ _DynamsoftCore.CQuadrilateral_register(Quadrilateral)
527
+
528
+
529
+
530
+ class ImageTag(ABC):
531
+ """
532
+ ImageTag represents an image tag that can be attached to an image in a system.
533
+ It contains information about the image, such as the image ID and the image capture distance mode.
534
+
535
+ Methods:
536
+ __init__(self): Initializes a new instance of the ImageTag class.
537
+ get_type(self) -> int: Gets the type of the image tag.
538
+ clone(self) -> ImageTag: Creates a copy of the image tag.
539
+ get_image_id(self) -> int: Gets the ID of the image.
540
+ set_image_id(self, imgId: int) -> None: Sets the ID of the image.
541
+ get_image_capture_distance_mode(self) -> int: Gets the capture distance mode of the image.
542
+ set_image_capture_distance_mode(self, mode: int) -> None: Sets the capture distance mode of the image.
543
+ """
544
+
545
+ _thisown = property(
546
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
547
+ )
548
+
549
+ def __init__(self):
550
+ """
551
+ Initializes a new instance of the ImageTag class.
552
+ """
553
+
554
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CImageTag(self))
555
+
556
+ __destroy__ = _DynamsoftCore.delete_CImageTag
557
+
558
+ @abstractmethod
559
+ def get_type(self) -> int:
560
+ """
561
+ Gets the type of the image tag.
562
+
563
+ Returns:
564
+ int: The type of the image tag.
565
+ """
566
+ pass
567
+
568
+ @abstractmethod
569
+ def clone(self) -> "ImageTag":
570
+ """
571
+ Creates a copy of the image tag.
572
+
573
+ Returns:
574
+ ImageTag: A copy of the ImageTag object.
575
+ """
576
+ pass
577
+
578
+ def get_image_id(self) -> int:
579
+ """
580
+ Gets the ID of the image.
581
+
582
+ Returns:
583
+ int: The ID of the image.
584
+ """
585
+ return _DynamsoftCore.CImageTag_GetImageId(self)
586
+
587
+ def set_image_id(self, imgId: int) -> None:
588
+ """
589
+ Sets the ID of the image.
590
+
591
+ Args:
592
+ imgId (int): The ID of the image.
593
+ """
594
+ return _DynamsoftCore.CImageTag_SetImageId(self, imgId)
595
+
596
+ def get_image_capture_distance_mode(self) -> int:
597
+ """
598
+ Gets the capture distance mode of the image.
599
+
600
+ Returns:
601
+ int: The capture distance mode of the image.
602
+ """
603
+ return _DynamsoftCore.CImageTag_GetImageCaptureDistanceMode(self)
604
+
605
+ def set_image_capture_distance_mode(self, mode: int) -> None:
606
+ """
607
+ Sets the capture distance mode of the image.
608
+
609
+ Args:
610
+ mode (int): The capture distance mode of the image.
611
+ """
612
+ return _DynamsoftCore.CImageTag_SetImageCaptureDistanceMode(self, mode)
613
+
614
+ _DynamsoftCore.CImageTag_register(ImageTag)
615
+
616
+ class FileImageTag(ImageTag):
617
+ """
618
+ FileImageTag represents an image tag that is associated with a file.
619
+ It inherits from the ImageTag class and adds two attributes, a file path and a page number.
620
+
621
+ Methods:
622
+ __init__(file_path: str, page_number: int, total_pages: int):Initializes a new instance of the FileImageTag class.
623
+ get_type(self) -> int: Gets the type of the image tag.
624
+ clone(self) -> FileImageTag: Creates a copy of the image tag.
625
+ get_file_path(self) -> str: Gets the file path of the image.
626
+ get_page_number(self) -> int: Gets the page number of the current image in the Multi-Page image file.
627
+ get_total_pages(self) -> int: Gets the total page number of the Multi-Page image file.
628
+ """
629
+ _thisown = property(
630
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
631
+ )
632
+
633
+ def __init__(self, file_path: str, page_number: int, total_pages: int):
634
+ """
635
+ Initializes a new instance of the FileImageTag class.
636
+
637
+ Args:
638
+ file_path (str): The file path.
639
+ page_number (int): The page number of the file image.
640
+ total_pages (int): The total pages of the file image.
641
+ """
642
+ _DynamsoftCore.Class_init(
643
+ self, _DynamsoftCore.new_CFileImageTag(self, file_path, page_number, total_pages)
644
+ )
645
+
646
+ __destroy__ = _DynamsoftCore.delete_CFileImageTag
647
+
648
+ def get_type(self) -> int:
649
+ """
650
+ Gets the type of the image tag.
651
+
652
+ Returns:
653
+ int: The type of the image tag.
654
+ """
655
+ return _DynamsoftCore.CFileImageTag_GetType(self)
656
+
657
+ def clone(self) -> "FileImageTag":
658
+ """
659
+ Creates a copy of the image tag.
660
+
661
+ Returns:
662
+ FileImageTag: A copy of the FileImageTag object.
663
+ """
664
+ return _DynamsoftCore.CFileImageTag_Clone(self)
665
+
666
+ def get_file_path(self) -> str:
667
+ """
668
+ Gets the file path of the image.
669
+
670
+ Returns:
671
+ str: The file path of the image.
672
+ """
673
+ return _DynamsoftCore.CFileImageTag_GetFilePath(self)
674
+
675
+ def get_page_number(self) -> int:
676
+ """
677
+ Gets the page number of the current image in the Multi-Page image file.
678
+
679
+ Returns:
680
+ int: The page number of the current image in the Multi-Page image file.
681
+ """
682
+ return _DynamsoftCore.CFileImageTag_GetPageNumber(self)
683
+
684
+ def get_total_pages(self) -> int:
685
+ """
686
+ Gets the total page number of the Multi-Page image file.
687
+
688
+ Returns:
689
+ int: The total page number of the Multi-Page image file.
690
+ """
691
+ return _DynamsoftCore.CFileImageTag_GetTotalPages(self)
692
+
693
+ _DynamsoftCore.CFileImageTag_register(FileImageTag)
694
+
695
+ class VideoFrameTag(ImageTag):
696
+ """
697
+ VideoFrameTag represents a video frame tag, which is a type of image tag that is used to store additional information about a video frame.
698
+
699
+ Methods:
700
+ __init__(self, quality: int, is_cropped: bool, crop_region: Rect, original_width: int, original_height: int): Initializes a new instance of the VideoFrameTag class.
701
+ get_video_frame_quality(self) -> int: Gets the quality of the video frame.
702
+ is_cropped(self) -> bool: Determines whether the video frame is cropped.
703
+ get_crop_region(self) -> Rect: Gets the crop region of the video frame.
704
+ get_original_width(self) -> int: Gets the original width of the video frame.
705
+ get_original_height(self) -> int: Gets the original height of the video frame.
706
+ get_type(self) -> int: Gets the type of the image tag.
707
+ clone(self) -> VideoFrameTag: Creates a copy of the image tag.
708
+ """
709
+ _thisown = property(
710
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
711
+ )
712
+
713
+ def get_video_frame_quality(self) -> int:
714
+ """
715
+ Gets the quality of the video frame.
716
+
717
+ Returns:
718
+ The quality of the video frame.
719
+ """
720
+ return _DynamsoftCore.CVideoFrameTag_GetVideoFrameQuality(self)
721
+
722
+ def is_cropped(self) -> bool:
723
+ """
724
+ Determines whether the video frame is cropped.
725
+
726
+ Returns:
727
+ True if the video frame is cropped, False otherwise.
728
+ """
729
+ return _DynamsoftCore.CVideoFrameTag_IsCropped(self)
730
+
731
+ def get_crop_region(self) -> Rect:
732
+ """
733
+ Gets the crop region of the video frame.
734
+
735
+ Returns:
736
+ A Rect object that represents the crop region of the video frame. It may be null.
737
+ """
738
+ return _DynamsoftCore.CVideoFrameTag_GetCropRegion(self)
739
+
740
+ def get_original_width(self) -> int:
741
+ """
742
+ Gets the original width of the video frame.
743
+
744
+ Returns:
745
+ The original width of the video frame.
746
+ """
747
+ return _DynamsoftCore.CVideoFrameTag_GetOriginalWidth(self)
748
+
749
+ def get_original_height(self) -> int:
750
+ """
751
+ Gets the original height of the video frame.
752
+
753
+ Returns:
754
+ The original height of the video frame.
755
+ """
756
+ return _DynamsoftCore.CVideoFrameTag_GetOriginalHeight(self)
757
+
758
+ def get_type(self) -> int:
759
+ """
760
+ Gets the type of the image tag.
761
+
762
+ Returns:
763
+ The type of the image tag.
764
+ """
765
+ return _DynamsoftCore.CVideoFrameTag_GetType(self)
766
+
767
+ def clone(self) -> "VideoFrameTag":
768
+ """
769
+ Creates a copy of the image tag.
770
+
771
+ Returns:
772
+ A copy of the VideoFrameTag object.
773
+ """
774
+ return _DynamsoftCore.CVideoFrameTag_Clone(self)
775
+
776
+ def __init__(
777
+ self,
778
+ quality: int,
779
+ is_cropped: bool,
780
+ crop_region: Rect,
781
+ original_width: int,
782
+ original_height: int,
783
+ ):
784
+ """
785
+ Initializes a new instance of the VideoFrameTag class.
786
+
787
+ Args:
788
+ quality (int): The quality of the video frame.
789
+ is_cropped (bool): A boolean value indicating whether the video frame is cropped.
790
+ crop_region (Rect): A Rect object that represents the crop region of the video frame.
791
+ original_width (int): The original width of the video frame.
792
+ original_height (int): The original height of the video frame.
793
+ """
794
+ _DynamsoftCore.Class_init(
795
+ self,
796
+ _DynamsoftCore.new_CVideoFrameTag(
797
+ self, quality, is_cropped, crop_region, original_width, original_height
798
+ ),
799
+ )
800
+
801
+ __destroy__ = _DynamsoftCore.delete_CVideoFrameTag
802
+
803
+
804
+ _DynamsoftCore.CVideoFrameTag_register(VideoFrameTag)
805
+
806
+ class ImageData:
807
+ """
808
+ This class represents image data, which contains the image bytes, width, height, stride, pixel format, orientation, and a tag.
809
+
810
+ Methods:
811
+ __init__(self, bytes: bytes, width: int, height: int, stride: int, format: int, orientation: int = 0, tag: ImageTag = None): Initializes an ImageData object.
812
+ get_bytes(self) -> bytes: Returns the image bytes.
813
+ get_width(self) -> int: Returns the width of the image.
814
+ get_height(self) -> int: Returns the height of the image.
815
+ get_stride(self) -> int: Returns the stride of the image.
816
+ get_image_pixel_format(self) -> int: Returns the pixel format of the image.
817
+ get_orientation(self) -> int: Returns the orientation of the image.
818
+ get_image_tag(self) -> ImageTag: Returns the tag of the image.
819
+ set_image_tag(self, tag: ImageTag): Sets the tag of the image.
820
+ """
821
+ _thisown = property(
822
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
823
+ )
824
+
825
+ def __init__(
826
+ self,
827
+ bytes: bytes,
828
+ width: int,
829
+ height: int,
830
+ stride: int,
831
+ format: int,
832
+ orientation: int = 0,
833
+ tag: ImageTag = None,
834
+ ):
835
+ """
836
+ Initializes an ImageData object.
837
+
838
+ Args:
839
+ bytes: The image byte array.
840
+ width: The width of the image.
841
+ height: The height of the image.
842
+ stride: The stride of the image.
843
+ format: The pixel format of the image.
844
+ orientation: The orientation of the image.
845
+ tag: The tag of the image.
846
+ """
847
+ _DynamsoftCore.Class_init(
848
+ self,
849
+ _DynamsoftCore.new_CImageData(
850
+ bytes, width, height, stride, format, orientation, tag
851
+ ),
852
+ )
853
+
854
+ __destroy__ = _DynamsoftCore.delete_CImageData
855
+
856
+ def get_bytes(self) -> bytes:
857
+ """
858
+ Gets the image byte array.
859
+
860
+ Returns:
861
+ The image byte array.
862
+ """
863
+ return _DynamsoftCore.CImageData_GetBytes(self)
864
+
865
+ def get_width(self) -> int:
866
+ """
867
+ Gets the width of the image.
868
+
869
+ Returns:
870
+ The width of the image.
871
+ """
872
+ return _DynamsoftCore.CImageData_GetWidth(self)
873
+
874
+ def get_height(self) -> int:
875
+ """
876
+ Gets the height of the image.
877
+
878
+ Returns:
879
+ The height of the image.
880
+ """
881
+ return _DynamsoftCore.CImageData_GetHeight(self)
882
+
883
+ def get_stride(self) -> int:
884
+ """
885
+ Gets the stride of the image.
886
+
887
+ Returns:
888
+ The stride of the image.
889
+ """
890
+ return _DynamsoftCore.CImageData_GetStride(self)
891
+
892
+ def get_image_pixel_format(self) -> EnumImagePixelFormat:
893
+ """
894
+ Gets the pixel format of the image.
895
+
896
+ Returns:
897
+ The pixel format of the image.
898
+ """
899
+ return _DynamsoftCore.CImageData_GetImagePixelFormat(self)
900
+
901
+ def get_orientation(self) -> int:
902
+ """
903
+ Gets the orientation of the image.
904
+
905
+ Returns:
906
+ The orientation of the image.
907
+ """
908
+ return _DynamsoftCore.CImageData_GetOrientation(self)
909
+
910
+ def get_image_tag(self) -> ImageTag:
911
+ """
912
+ Gets the tag of the image.
913
+
914
+ Returns:
915
+ The tag of the image.
916
+ """
917
+ return _DynamsoftCore.CImageData_GetImageTag(self)
918
+
919
+ def set_image_tag(self, tag: ImageTag) -> None:
920
+ """
921
+ Sets the tag of the image.
922
+
923
+ Args:
924
+ tag: The tag of the image.
925
+ """
926
+ return _DynamsoftCore.CImageData_SetImageTag(self, tag)
927
+
928
+ _DynamsoftCore.CImageData_register(ImageData)
929
+
930
+ class CapturedResultItem:
931
+ """
932
+ The CapturedResultItem class represents an item in a captured result.
933
+ It is an abstract base class with multiple subclasses, each representing a different type of captured item such as barcode, text line, detected quad, normalized image, raw image, parsed item, etc.
934
+
935
+ Methods:
936
+ get_type(self): Gets the type of the captured result item.
937
+ get_reference_item(self): Gets the referenced item in the captured result item.
938
+ get_target_roi_def_name(self): Gets the name of the target ROI definition.
939
+ get_task_name(self): Gets the name of the task.
940
+ """
941
+
942
+ _thisown = property(
943
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
944
+ )
945
+
946
+ __destroy__ = _DynamsoftCore.CCapturedResultItem_Release
947
+
948
+ def __init__(self):
949
+ """
950
+ Initializes an instance of the CapturedResultItem class.
951
+
952
+ Raises:
953
+ AttributeError: If the constructor is called directly.
954
+ """
955
+ raise AttributeError("No constructor defined - class is abstract")
956
+
957
+ def get_type(self) -> int:
958
+ """
959
+ Gets the type of the captured result item.
960
+
961
+ Returns:
962
+ int: The type of the captured result item.
963
+ """
964
+ return _DynamsoftCore.CCapturedResultItem_GetType(self)
965
+
966
+ def get_reference_item(self) -> "CapturedResultItem":
967
+ """
968
+ Gets the referenced item in the captured result item.
969
+
970
+ Returns:
971
+ CapturedResultItem: The referenced item in the captured result item.
972
+ """
973
+ if not hasattr(self, '_ref_item'):
974
+ self._ref_item = _DynamsoftCore.CCapturedResultItem_GetReferenceItem(self)
975
+ return self._ref_item
976
+
977
+ def get_target_roi_def_name(self) -> str:
978
+ """
979
+ Gets the name of the target ROI definition.
980
+
981
+ Returns:
982
+ str: The name of the target ROI definition.
983
+ """
984
+ return _DynamsoftCore.CCapturedResultItem_GetTargetROIDefName(self)
985
+
986
+ def get_task_name(self) -> str:
987
+ """
988
+ Gets the name of the task.
989
+
990
+ Returns:
991
+ str: The name of the task.
992
+ """
993
+ return _DynamsoftCore.CCapturedResultItem_GetTaskName(self)
994
+
995
+
996
+ _DynamsoftCore.CCapturedResultItem_register(CapturedResultItem)
997
+
998
+ class OriginalImageResultItem(CapturedResultItem):
999
+ """
1000
+ The OriginalImageResultItem class represents a captured original image result item. It is a derived class of CapturedResultItem and provides a class to get the image data.
1001
+
1002
+ Methods:
1003
+ get_image_data(self): Gets the image data for the OriginalImageResultItem.
1004
+ """
1005
+ _thisown = property(
1006
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
1007
+ )
1008
+
1009
+ def __init__(self):
1010
+ """
1011
+ Initializes a new instance of the OriginalImageResultItem class.
1012
+
1013
+ Raises:
1014
+ AttributeError: If the constructor is called.
1015
+ """
1016
+ raise AttributeError("No constructor defined - class is abstract")
1017
+
1018
+ def get_image_data(self) -> ImageData:
1019
+ """
1020
+ Gets the image data for the OriginalImageResultItem.
1021
+
1022
+ Returns:
1023
+ ImageData: The ImageData object that contains the image data for the OriginalImageResultItem.
1024
+ """
1025
+ return _DynamsoftCore.COriginalImageResultItem_GetImageData(self)
1026
+
1027
+
1028
+ _DynamsoftCore.COriginalImageResultItem_register(OriginalImageResultItem)
1029
+
1030
+ #new
1031
+ class CapturedResultBase:
1032
+ """
1033
+ The CapturedResultBase class is an abstract base class for captured results.
1034
+
1035
+ Methods:
1036
+ get_original_image_hash_id(self) -> str: Gets the hash ID of the original image.
1037
+ get_original_image_tag(self) -> ImageTag: Gets the tag of the original image.
1038
+ get_rotation_transform_matrix(self) -> List[float]: Gets the rotation transform matrix.
1039
+ get_error_code(self) -> int: Gets the error code of the detection operation.
1040
+ get_error_string(self) -> str: Gets the error string of the detection operation.
1041
+ """
1042
+ _thisown = property(
1043
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
1044
+ )
1045
+ def __init__(self):
1046
+ """
1047
+ Initializes a new instance of the OriginalImageResultItem class.
1048
+
1049
+ Raises:
1050
+ AttributeError: If the constructor is called.
1051
+ """
1052
+ raise AttributeError("No constructor defined - class is abstract")
1053
+
1054
+ def get_original_image_hash_id(self) -> str:
1055
+ """
1056
+ Gets the hash ID of the original image.
1057
+
1058
+ Returns:
1059
+ The hash ID of the original image as a string.
1060
+ """
1061
+ return _DynamsoftCore.CCapturedResultBase_GetOriginalImageHashId(
1062
+ self
1063
+ )
1064
+
1065
+ def get_original_image_tag(self) -> ImageTag:
1066
+ """
1067
+ Gets the tag of the original image.
1068
+
1069
+ Returns:
1070
+ An ImageTag object containing the tag of the original image.
1071
+ """
1072
+ return _DynamsoftCore.CCapturedResultBase_GetOriginalImageTag(self)
1073
+
1074
+ def get_rotation_transform_matrix(self) -> List[float]:
1075
+ """
1076
+ Gets the 3x3 rotation transformation matrix of the original image relative to the rotated image.
1077
+
1078
+ Returns:
1079
+ A float list of length 9 which represents a 3x3 rotation matrix.
1080
+ """
1081
+ return _DynamsoftCore.CCapturedResultBase_GetRotationTransformMatrix(
1082
+ self
1083
+ )
1084
+
1085
+ def get_error_code(self) -> int:
1086
+ """
1087
+ Gets the error code of the detection operation.
1088
+
1089
+ Returns:
1090
+ The error code of the detection operation.
1091
+ """
1092
+ return _DynamsoftCore.CCapturedResultBase_GetErrorCode(self)
1093
+
1094
+ def get_error_string(self) -> str:
1095
+ """
1096
+ Gets the error message of the detection operation.
1097
+
1098
+ Returns:
1099
+ The error message of the detection operation as a string.
1100
+ """
1101
+ return _DynamsoftCore.CCapturedResultBase_GetErrorString(self)
1102
+
1103
+ _DynamsoftCore.CCapturedResultBase_register(CapturedResultBase)
1104
+ #end new
1105
+
1106
+ class ImageSourceErrorListener(ABC):
1107
+ """
1108
+ The ImageSourceErrorListener class defines a listener for receiving error notifications from an image source.
1109
+
1110
+ Methods:
1111
+ on_error_received(self, error_code: int, error_message: str) -> None: Called when an error is received.
1112
+ """
1113
+
1114
+ _thisown = property(
1115
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
1116
+ )
1117
+
1118
+ def __init__(self):
1119
+ _DynamsoftCore.Class_init(
1120
+ self, _DynamsoftCore.new_CImageSourceErrorListener(self)
1121
+ )
1122
+
1123
+ @abstractmethod
1124
+ def on_error_received(self, error_code: int, error_message: str) -> None:
1125
+ """
1126
+ Called when an error is received from the image source.
1127
+
1128
+ Args:
1129
+ error_code (int): The integer error code indicating the type of error.
1130
+ error_message(str): A string containing the error message providing additional information about the error.
1131
+ """
1132
+
1133
+ pass
1134
+
1135
+ __destroy__ = _DynamsoftCore.delete_CImageSourceErrorListener
1136
+
1137
+ _DynamsoftCore.CImageSourceErrorListener_register(ImageSourceErrorListener)
1138
+
1139
+
1140
+ class ImageSourceAdapter(ABC):
1141
+ """
1142
+ This class provides an interface for fetching and buffering images.
1143
+ It is an abstract class that needs to be implemented by a concrete class to provide actual functionality.
1144
+
1145
+ Methods:
1146
+ add_image_to_buffer(self, image: ImageData) -> None: Adds an image to the buffer.
1147
+ has_next_image_to_fetch(self) -> bool: Checks if there is the next image to fetch.
1148
+ start_fetching(self) -> None: Starts fetching images.
1149
+ stop_fetching(self) -> None: Stops fetching images.
1150
+ get_image(self) -> ImageData: Gets an image from the buffer.
1151
+ set_max_image_count(self, count: int) -> None: Sets the maximum count of images in the buffer.
1152
+ get_max_image_count(self) -> int: Gets the maximum count of images in the buffer.
1153
+ set_buffer_overflow_protection_mode(self, mode: int) -> None: Sets the mode of buffer overflow protection.
1154
+ get_buffer_overflow_protection_mode(self) -> int: Gets the mode of buffer overflow protection.
1155
+ has_image(self, image_id: int) -> bool: Checks if there is an image with the specified ID in the buffer.
1156
+ set_next_image_to_return(self, image_id: int, keep_in_buffer: bool = True) -> bool: Sets the next image to return and optionally keeps it in the buffer.
1157
+ get_image_count(self) -> int: Gets the number of images in the buffer.
1158
+ is_buffer_empty(self) -> bool: Checks if the buffer is empty.
1159
+ clear_buffer(self) -> None: Clears the buffer.
1160
+ set_colour_channel_usage_type(self, type: int) -> None: Sets the usage type of a color channel in images.
1161
+ get_colour_channel_usage_type(self) -> int: Gets the usage type of a color channel in images.
1162
+ set_error_listener(self, listener: ImageSourceErrorListener) -> None: Sets an error listener object that will receive notifications when errors occur during image source operations.
1163
+ """
1164
+
1165
+ _thisown = property(
1166
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
1167
+ )
1168
+
1169
+ def __init__(self):
1170
+ _DynamsoftCore.Class_init(
1171
+ self, _DynamsoftCore.new_CImageSourceAdapter(self)
1172
+ )
1173
+
1174
+ __destroy__ = _DynamsoftCore.delete_CImageSourceAdapter
1175
+
1176
+ def add_image_to_buffer(self, image: ImageData) -> None:
1177
+ """
1178
+ Adds an image to the buffer.
1179
+
1180
+ Args:
1181
+ image (ImageData): The image to be added.
1182
+ """
1183
+ return _DynamsoftCore.CImageSourceAdapter_AddImageToBuffer(self, image)
1184
+
1185
+ @abstractmethod
1186
+ def has_next_image_to_fetch(self) -> bool:
1187
+ """
1188
+ Checks if there is the next image to fetch.
1189
+
1190
+ Returns:
1191
+ bool: True if there is the next image to fetch, False otherwise.
1192
+ """
1193
+ return _DynamsoftCore.CImageSourceAdapter_HasNextImageToFetch(self)
1194
+
1195
+ def start_fetching(self) -> None:
1196
+ """
1197
+ Starts fetching images.
1198
+ """
1199
+ return _DynamsoftCore.CImageSourceAdapter_StartFetching(self)
1200
+
1201
+ def stop_fetching(self) -> None:
1202
+ """
1203
+ Stops fetching images.
1204
+ """
1205
+ return _DynamsoftCore.CImageSourceAdapter_StopFetching(self)
1206
+
1207
+ def get_image(self) -> ImageData:
1208
+ """
1209
+ Gets an image from the buffer.
1210
+
1211
+ Returns:
1212
+ ImageData: The image from the buffer.
1213
+ """
1214
+ return _DynamsoftCore.CImageSourceAdapter_GetImage(self)
1215
+
1216
+ def set_max_image_count(self, count: int) -> None:
1217
+ """
1218
+ Sets the maximum count of images in the buffer.
1219
+
1220
+ Args:
1221
+ count (int): The maximum count of images.
1222
+ """
1223
+ return _DynamsoftCore.CImageSourceAdapter_SetMaxImageCount(self, count)
1224
+
1225
+ def get_max_image_count(self) -> int:
1226
+ """
1227
+ Gets the maximum count of images in the buffer.
1228
+
1229
+ Returns:
1230
+ int: The maximum count of images.
1231
+ """
1232
+ return _DynamsoftCore.CImageSourceAdapter_GetMaxImageCount(self)
1233
+
1234
+ def set_buffer_overflow_protection_mode(self, mode: int) -> None:
1235
+ """
1236
+ Sets the mode of buffer overflow protection.
1237
+
1238
+ Args:
1239
+ mode (int): The mode of buffer overflow protection.
1240
+ """
1241
+ return _DynamsoftCore.CImageSourceAdapter_SetBufferOverflowProtectionMode(
1242
+ self, mode
1243
+ )
1244
+
1245
+ def get_buffer_overflow_protection_mode(self) -> int:
1246
+ """
1247
+ Gets the mode of buffer overflow protection.
1248
+
1249
+ Returns:
1250
+ int: The mode of buffer overflow protection.
1251
+ """
1252
+ return _DynamsoftCore.CImageSourceAdapter_GetBufferOverflowProtectionMode(self)
1253
+
1254
+ def has_image(self, image_id: int) -> bool:
1255
+ """
1256
+ Checks if there is an image with the specified ID in the buffer.
1257
+
1258
+ Args:
1259
+ image_id (int): The ID of the image to check.
1260
+
1261
+ Returns:
1262
+ bool: True if there is the image with the specified ID, False otherwise.
1263
+ """
1264
+ return _DynamsoftCore.CImageSourceAdapter_HasImage(self, image_id)
1265
+
1266
+ def set_next_image_to_return(
1267
+ self, image_id: int, keep_in_buffer: bool = True
1268
+ ) -> bool:
1269
+ """
1270
+ Sets the next image to return and optionally keeps it in the buffer.
1271
+
1272
+ Args:
1273
+ image_id (int): The ID of the image to set as the next image to return.
1274
+ keep_in_buffer (bool, optional): Whether to keep the image in the buffer. Defaults to True.
1275
+
1276
+ Returns:
1277
+ bool: True if the image is set as the next image to return, False otherwise.
1278
+ """
1279
+ return _DynamsoftCore.CImageSourceAdapter_SetNextImageToReturn(
1280
+ self, image_id, keep_in_buffer
1281
+ )
1282
+
1283
+ def get_image_count(self) -> int:
1284
+ """
1285
+ Gets the number of images in the buffer.
1286
+
1287
+ Returns:
1288
+ int: The number of images in the buffer.
1289
+ """
1290
+ return _DynamsoftCore.CImageSourceAdapter_GetImageCount(self)
1291
+
1292
+ def is_buffer_empty(self) -> bool:
1293
+ """
1294
+ Checks if the buffer is empty.
1295
+
1296
+ Returns:
1297
+ bool: True if the buffer is empty, False otherwise.
1298
+ """
1299
+ return _DynamsoftCore.CImageSourceAdapter_IsBufferEmpty(self)
1300
+
1301
+ def clear_buffer(self) -> None:
1302
+ """
1303
+ Clears the buffer.
1304
+ """
1305
+ return _DynamsoftCore.CImageSourceAdapter_ClearBuffer(self)
1306
+
1307
+ def set_colour_channel_usage_type(self, type: int) -> None:
1308
+ """
1309
+ Sets the usage type of a color channel in images.
1310
+
1311
+ Args:
1312
+ type (int): The usage type of a color channel in images.
1313
+ """
1314
+ return _DynamsoftCore.CImageSourceAdapter_SetColourChannelUsageType(self, type)
1315
+
1316
+ def get_colour_channel_usage_type(self) -> int:
1317
+ """
1318
+ Gets the usage type of a color channel in images.
1319
+
1320
+ Returns:
1321
+ int: The usage type of a color channel in images.
1322
+ """
1323
+ return _DynamsoftCore.CImageSourceAdapter_GetColourChannelUsageType(self)
1324
+
1325
+ def set_error_listener(self, listener: ImageSourceErrorListener) -> None:
1326
+ """
1327
+ Sets an error listener object that will receive notifications when errors occur during image source operations.
1328
+
1329
+ Args:
1330
+ listener (ImageSourceErrorListener): The listening object of the type ImageSourceErrorListener that will handle error notifications.
1331
+ """
1332
+ return _DynamsoftCore.CImageSourceAdapter_SetErrorListener(self, listener)
1333
+
1334
+
1335
+ _DynamsoftCore.CImageSourceAdapter_register(ImageSourceAdapter)
1336
+
1337
+
1338
+ class PDFReadingParameter:
1339
+ """
1340
+ The PDFReadingParameter class represents the parameters for reading a PDF file.
1341
+ It contains the mode of PDF reading, the DPI (dots per inch) value, and the raster data source type.
1342
+
1343
+ Attributes:
1344
+ mode (int): The mode used for PDF reading. This is one of the values of the EnumPDFReadingMode enumeration.
1345
+ dpi (int): The DPI (dots per inch) value.
1346
+ raster_data_source (int): The raster data source type. This is one of the values of the EnumRasterDataSource enumeration.
1347
+ Methods:
1348
+ __init__(self): Initializes a new instance of the PDFReadingParameter class.
1349
+ """
1350
+
1351
+ _thisown = property(
1352
+ lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag"
1353
+ )
1354
+
1355
+ mode: int = property(
1356
+ _DynamsoftCore.CPDFReadingParameter_mode_get,
1357
+ _DynamsoftCore.CPDFReadingParameter_mode_set,
1358
+ )
1359
+ dpi: int = property(
1360
+ _DynamsoftCore.CPDFReadingParameter_dpi_get,
1361
+ _DynamsoftCore.CPDFReadingParameter_dpi_set,
1362
+ )
1363
+ raster_data_source: int = property(
1364
+ _DynamsoftCore.CPDFReadingParameter_rasterDataSource_get,
1365
+ _DynamsoftCore.CPDFReadingParameter_rasterDataSource_set,
1366
+ )
1367
+
1368
+ def __init__(self):
1369
+ """
1370
+ Initializes a new instance of the PDFReadingParameter class.
1371
+
1372
+ This constructor initializes the properties with default values:
1373
+ mode: 2 (EnumPDFReadingMode.PDFRM_RASTER.value)
1374
+ dpi: 300
1375
+ raster_data_source: 0 (EnumRasterDataSource.RDS_RASTERIZED_PAGES.value)
1376
+ """
1377
+ _DynamsoftCore.Class_init(
1378
+ self, _DynamsoftCore.new_CPDFReadingParameter()
1379
+ )
1380
+
1381
+ __destroy__ = _DynamsoftCore.delete_CPDFReadingParameter
1382
+
1383
+
1384
+ _DynamsoftCore.CPDFReadingParameter_register(PDFReadingParameter)
1385
+
1386
+ class Contour:
1387
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1388
+
1389
+ __destroy__ = _DynamsoftCore.delete_CContour
1390
+
1391
+ def __init__(self):
1392
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CContour())
1393
+ def __repr__(self):
1394
+ points = self.get_points()
1395
+ list_repr = ", ".join(f"({obj.x}, {obj.y})" for obj in points)
1396
+ return f"Contour[{list_repr}]"
1397
+ def set_points(self, points: List[Point]) -> None:
1398
+ _DynamsoftCore.CContour_SetPoints(self, points)
1399
+
1400
+ def get_points(self) -> List[Point]:
1401
+ return _DynamsoftCore.CContour_GetPoints(self)
1402
+
1403
+ _DynamsoftCore.CContour_register(Contour)
1404
+ class Vector4:
1405
+ """
1406
+ The CVector4 class represents a four-dimensional vector.
1407
+
1408
+ Attributes:
1409
+ value (List[int]): A list of four integer values representing the components of the vector.
1410
+
1411
+ Methods:
1412
+ Set(self, v1: int, v2: int, v3: int, v4: int) -> None: Sets the components value of a four-dimensional vector.
1413
+ __getitem__(self, index: int) -> int: Gets the component value at the specified index in the CVector4.
1414
+ __setitem__(self, index: int, value: int) -> None: Sets the component value at the specified index in the CVector4.
1415
+ """
1416
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1417
+
1418
+ value = property(_DynamsoftCore.CVector4_value_get, _DynamsoftCore.CVector4_value_set)
1419
+
1420
+ def __init__(self, v1: int, v2: int, v3: int, v4: int):
1421
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CVector4(v1, v2, v3, v4))
1422
+ __destroy__ = _DynamsoftCore.delete_CVector4
1423
+
1424
+ def Set(self, v1: int, v2: int, v3: int, v4: int) -> None:
1425
+ """
1426
+ Sets the components value of a four-dimensional vector.
1427
+
1428
+ Args:
1429
+ v1 (int): The first component value of the four-dimensional vector.
1430
+ v2 (int): The second component value of the four-dimensional vector.
1431
+ v3 (int): The third component value of the four-dimensional vector.
1432
+ v4 (int): The fourth component value of the four-dimensional vector.
1433
+ """
1434
+ return _DynamsoftCore.CVector4_Set(self, v1, v2, v3, v4)
1435
+
1436
+ def __getitem__(self, index: int) -> int:
1437
+ if index < 0 or index > 3:
1438
+ raise IndexError("Index out of range")
1439
+ return _DynamsoftCore.CVector4_GetItem(self, index)
1440
+
1441
+ def __setitem__(self, index: int, value: int) -> None:
1442
+ if index < 0 or index > 3:
1443
+ raise IndexError("Index out of range")
1444
+ _DynamsoftCore.CVector4_SetItem(self, index, value)
1445
+
1446
+ _DynamsoftCore.CVector4_register(Vector4)
1447
+
1448
+ class LineSegment:
1449
+ """
1450
+ The LineSegment class represents a line segment in 2D space.
1451
+ It contains two CPoint objects, which represent the start point and end point of the line segment.
1452
+
1453
+ Attributes:
1454
+ start_point (Point): The start point of the line segment.
1455
+ end_point (Point): The end point of the line segment.
1456
+ id (int): The ID of the line segment.
1457
+
1458
+ Methods:
1459
+ __repr__(self) -> str: Returns a string representation of the LineSegment object.
1460
+ """
1461
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1462
+
1463
+ start_point: Point = property(_DynamsoftCore.CLineSegment_GetStartPoint, _DynamsoftCore.CLineSegment_SetStartPoint)
1464
+ end_point: Point = property(_DynamsoftCore.CLineSegment_GetEndPoint, _DynamsoftCore.CLineSegment_SetEndPoint)
1465
+ id: int = property(_DynamsoftCore.CLineSegment_GetId, _DynamsoftCore.CLineSegment_SetId)
1466
+
1467
+ def __init__(self, start_point: Point, end_point: Point, line_id: int = -1):
1468
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CLineSegment(start_point, end_point, line_id))
1469
+
1470
+ def __repr__(self):
1471
+ return f"LineSegment[start_point=({self.start_point.x},{self.start_point.y}), end_point=({self.end_point.x},{self.end_point.y})]"
1472
+
1473
+ __destroy__ = _DynamsoftCore.delete_CLineSegment
1474
+
1475
+ _DynamsoftCore.CLineSegment_register(LineSegment)
1476
+ class Corner:
1477
+ """
1478
+ Corner is a structure in an image consisting of two line segments and intersection point. A Corner represents a point at which the image's brightness or color sharply changes.
1479
+
1480
+ Attributes:
1481
+ type (int): The type of the corner.
1482
+ intersection (Point): The intersection point of the two line segments.
1483
+ line1 (LineSegment): The first line segment.
1484
+ line2 (LineSegment): The second line segment.
1485
+ """
1486
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1487
+
1488
+ type: int = property(_DynamsoftCore.CCorner_type_get, _DynamsoftCore.CCorner_type_set)
1489
+ intersection: Point = property(_DynamsoftCore.CCorner_intersection_get, _DynamsoftCore.CCorner_intersection_set)
1490
+ line1: LineSegment = property(_DynamsoftCore.CCorner_line1_get, _DynamsoftCore.CCorner_line1_set)
1491
+ line2: LineSegment = property(_DynamsoftCore.CCorner_line2_get, _DynamsoftCore.CCorner_line2_set)
1492
+ def __init__(self):
1493
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CCorner())
1494
+ __destroy__ = _DynamsoftCore.delete_CCorner
1495
+
1496
+ _DynamsoftCore.CCorner_register(Corner)
1497
+ class Edge:
1498
+ """
1499
+ CEdge is a structure composed of two Corner points in an image.
1500
+ A Corner represents a point at which the image's brightness or color sharply changes.
1501
+ Therefore, a CEdge is a line segment connecting two such points that have been identified as Corners.
1502
+
1503
+ Attributes:
1504
+ start_corner (Corner): The start corner of the edge.
1505
+ end_corner (Corner): The end corner of the edge.
1506
+ """
1507
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1508
+
1509
+ start_corner: Corner = property(_DynamsoftCore.CEdge_startCorner_get, _DynamsoftCore.CEdge_startCorner_set)
1510
+ end_corner: Corner = property(_DynamsoftCore.CEdge_endCorner_get, _DynamsoftCore.CEdge_endCorner_set)
1511
+
1512
+ def __init__(self):
1513
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CEdge())
1514
+ __destroy__ = _DynamsoftCore.delete_CEdge
1515
+
1516
+ _DynamsoftCore.CEdge_register(Edge)
1517
+
1518
+ class IntermediateResultExtraInfo:
1519
+ """
1520
+ The IntermediateResultExtraInfo class represents the extra information for generating an intermediate result unit.
1521
+
1522
+ Attributes:
1523
+ target_roi_def_name (str): Specifies the name of the TargetROIDef object that generates the intermediate result.
1524
+ task_name (str): Specifies the name of the task that generates the intermediate result.
1525
+ is_section_level_result (bool): Specifies whether the intermediate result is section-level result.
1526
+ section_type (int): Specifies the SectionType that generates the intermediate result.
1527
+ """
1528
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1529
+
1530
+ target_roi_def_name: str = property(_DynamsoftCore.IntermediateResultExtraInfo_targetROIDefName_get, _DynamsoftCore.IntermediateResultExtraInfo_targetROIDefName_set)
1531
+ task_name: str = property(_DynamsoftCore.IntermediateResultExtraInfo_taskName_get, _DynamsoftCore.IntermediateResultExtraInfo_taskName_set)
1532
+ is_section_level_result: bool = property(_DynamsoftCore.IntermediateResultExtraInfo_isSectionLevelResult_get, _DynamsoftCore.IntermediateResultExtraInfo_isSectionLevelResult_set)
1533
+ section_type: int = property(_DynamsoftCore.IntermediateResultExtraInfo_sectionType_get, _DynamsoftCore.IntermediateResultExtraInfo_sectionType_set)
1534
+
1535
+ def __init__(self):
1536
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_IntermediateResultExtraInfo())
1537
+ __destroy__ = _DynamsoftCore.delete_IntermediateResultExtraInfo
1538
+
1539
+ _DynamsoftCore.IntermediateResultExtraInfo_register(IntermediateResultExtraInfo)
1540
+
1541
+ class RegionObjectElement:
1542
+ """
1543
+ The RegionObjectElement class represents an element of a region object in 2D space. It is an abstract class that provides the interface for region object elements.
1544
+
1545
+ Methods:
1546
+ get_location(self) -> Quadrilateral: Gets the location of the region object element.
1547
+ get_referenced_element(self) -> RegionObjectElement: Gets the referenced element of the region object element.
1548
+ get_element_type(self) -> int: Gets the type of the region object element.
1549
+ clone(self) -> RegionObjectElement: Clones the region object element.
1550
+ get_image_data(self) -> ImageData: Gets the image data of the region object element.
1551
+ """
1552
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1553
+
1554
+ __destroy__ = _DynamsoftCore.CRegionObjectElement_Release
1555
+
1556
+ def __init__(self):
1557
+ raise AttributeError("No constructor defined - class is abstract")
1558
+
1559
+
1560
+ def get_location(self) -> Quadrilateral:
1561
+ """
1562
+ Gets the location of the region object element.
1563
+
1564
+ Returns:
1565
+ A Quadrilateral object which represents the location of the region object element.
1566
+ """
1567
+ return _DynamsoftCore.CRegionObjectElement_GetLocation(self)
1568
+
1569
+ def get_referenced_element(self) -> "RegionObjectElement":
1570
+ """
1571
+ Gets the referenced element of the region object element.
1572
+
1573
+ Returns:
1574
+ A RegionObjectElement object which represents the referenced element of the region object element.
1575
+ """
1576
+ return _DynamsoftCore.CRegionObjectElement_GetReferencedElement(self)
1577
+
1578
+ def get_element_type(self) -> int:
1579
+ """
1580
+ Gets the type of the region object element.
1581
+
1582
+ Returns:
1583
+ An integer which represents the type of the region object element.
1584
+ """
1585
+ return _DynamsoftCore.CRegionObjectElement_GetElementType(self)
1586
+
1587
+ def clone(self) -> "RegionObjectElement":
1588
+ """
1589
+ Clones the region object element.
1590
+
1591
+ Returns:
1592
+ A copy of the region object element.
1593
+ """
1594
+ return _DynamsoftCore.CRegionObjectElement_Clone(self)
1595
+
1596
+ def get_image_data(self) -> ImageData:
1597
+ """
1598
+ Gets the image data for the RegionObjectElement.
1599
+
1600
+ Returns:
1601
+ An ImageData object that contains the image data for the RegionObjectElement.
1602
+ """
1603
+ return _DynamsoftCore.CRegionObjectElement_GetImageData(self)
1604
+
1605
+ _DynamsoftCore.CRegionObjectElement_register(RegionObjectElement)
1606
+ class PredetectedRegionElement(RegionObjectElement):
1607
+ """
1608
+ The PredetectedRegionElement class represents a region element that has been pre-detected in an image.
1609
+ It is a subclass of the CRegionObjectElement.
1610
+
1611
+ Methods:
1612
+ get_mode_name(self) -> str: Gets the name of the detection mode used to detect this region element.
1613
+ set_location(self, loc: Quadrilateral) -> int: Sets the location of the region object element.
1614
+ get_label_id(self) -> int: Gets the label ID of the predetected region element.
1615
+ get_label_name(self) -> str: Gets the label name of the predetected region element.
1616
+ """
1617
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1618
+
1619
+ def __init__(self):
1620
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.CImageProcessingModule_CreatePredetectedRegionElement())
1621
+
1622
+ def get_mode_name(self) -> str:
1623
+ """
1624
+ Gets the name of the detection mode used to detect this region element.
1625
+
1626
+ Returns:
1627
+ The name of the detection mode used to detect this region element.
1628
+ """
1629
+ return _DynamsoftCore.CPredetectedRegionElement_GetModeName(self)
1630
+
1631
+ def set_location(self, loc: Quadrilateral) -> int:
1632
+ """
1633
+ Sets the location of the region object element.
1634
+
1635
+ Args:
1636
+ loc(Quadrilateral): The location of the predetected region element.
1637
+
1638
+ Returns:
1639
+ Returns 0 if success, otherwise an error code.
1640
+ """
1641
+ return _DynamsoftCore.CPredetectedRegionElement_SetLocation(self, loc)
1642
+
1643
+ def get_label_id(self) -> int:
1644
+ """
1645
+ Gets the label ID of the predetected region element.
1646
+
1647
+ Returns:
1648
+ The label ID of the predetected region element.
1649
+ """
1650
+ return _DynamsoftCore.CPredetectedRegionElement_GetLabelId(self)
1651
+
1652
+ def get_label_name(self) -> str:
1653
+ """
1654
+ Gets the label name of the predetected region element.
1655
+
1656
+ Returns:
1657
+ The label name of the predetected region element.
1658
+ """
1659
+ return _DynamsoftCore.CPredetectedRegionElement_GetLabelName(self)
1660
+
1661
+ _DynamsoftCore.CPredetectedRegionElement_register(PredetectedRegionElement)
1662
+
1663
+ class AuxiliaryRegionElement(RegionObjectElement):
1664
+ """
1665
+ The AuxiliaryRegionElement class represents a region element that is auxiliary to a predetected region element.
1666
+ It is a subclass of the CRegionObjectElement.
1667
+
1668
+ Methods:
1669
+ get_name(self) -> str: Gets the name of this auxiliary region.
1670
+ get_confidence(self) -> int: Gets the confidence level of this auxiliary region detection.
1671
+ set_name(self, name: str) -> None: Sets the name/type of this auxiliary region.
1672
+ set_location(self, location: Quadrilateral) -> int: Sets the location of the auxiliary region element.
1673
+ set_confidence(self, confidence: int) -> None: Sets the confidence level of this auxiliary region detection.
1674
+ """
1675
+ def __init__(self):
1676
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.CImageProcessingModule_CreateAuxiliaryRegionElement())
1677
+
1678
+ def get_name(self) -> str:
1679
+ """
1680
+ Gets the name of this auxiliary region.
1681
+
1682
+ Returns:
1683
+ Returns a string representing the region name (e.g., "PortraitZone", "SignatureArea").
1684
+ """
1685
+ return _DynamsoftCore.CAuxiliaryRegionElement_GetName(self)
1686
+
1687
+ def get_confidence(self) -> int:
1688
+ """
1689
+ Gets the confidence level of this auxiliary region detection.
1690
+
1691
+ Returns:
1692
+ Returns the confidence value, typically in the range [0, 100].
1693
+ """
1694
+ return _DynamsoftCore.CAuxiliaryRegionElement_GetConfidence(self)
1695
+
1696
+ def set_name(self, name: str) -> None:
1697
+ """
1698
+ Sets the name/type of this auxiliary region.
1699
+
1700
+ Args:
1701
+ name(str): The region name to set (e.g., "PortraitZone", "SignatureArea").
1702
+ """
1703
+ _DynamsoftCore.CAuxiliaryRegionElement_SetName(self, name)
1704
+
1705
+ def set_location(self, location: Quadrilateral) -> int:
1706
+ """
1707
+ Sets the location of this auxiliary region.
1708
+
1709
+ Args:
1710
+ location(Quadrilateral): A quadrilateral defining the region boundaries.
1711
+
1712
+ Returns:
1713
+ Returns 0 if success, otherwise an error code.
1714
+ """
1715
+ return _DynamsoftCore.CAuxiliaryRegionElement_SetLocation(self, location)
1716
+
1717
+ def set_confidence(self, confidence: int) -> None:
1718
+ """
1719
+ Sets the confidence level of this auxiliary region detection.
1720
+
1721
+ Args:
1722
+ confidence(int): The confidence value to set, typically in the range [0, 100].
1723
+ """
1724
+ return _DynamsoftCore.CAuxiliaryRegionElement_SetConfidence(self, confidence)
1725
+
1726
+ _DynamsoftCore.CAuxiliaryRegionElement_register(AuxiliaryRegionElement)
1727
+
1728
+ class IntermediateResultUnit:
1729
+ """
1730
+ The IntermediateResultUnit class represents an intermediate result unit used in image processing.
1731
+ It is an abstract base class with multiple subclasses, each representing a different type of unit such as pre-detected regions, localized barcodes, decoded barcodes, localized text lines, binary image, gray image, etc.
1732
+
1733
+ Methods:
1734
+ get_hash_id(self) -> str: Gets the hash ID of the intermediate result unit.
1735
+ get_original_image_hash_id(self) -> str: Gets the hash ID of the original image.
1736
+ get_original_image_tag(self) -> ImageTag: Gets the image tag of the original image.
1737
+ get_transform_matrix(self, matrix_type: EnumTransformMatrixType) -> List[float]: Gets the transformation matrix via EnumTransformMatrixType.
1738
+ get_type(self) -> int: Gets the type of the intermediate result unit.
1739
+ clone(self) -> IntermediateResultUnit: Creates a copy of the intermediate result unit.
1740
+ replace(self, unit: IntermediateResultUnit) -> int: Replaces the specified IntermediateResultUnit object with the current IntermediateResultUnit object.
1741
+ get_usage_count(self) -> int: Gets the usage count of the intermediate result unit.
1742
+ """
1743
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1744
+
1745
+ __destroy__ = _DynamsoftCore.CIntermediateResultUnit_Release
1746
+
1747
+ def __init__(self):
1748
+ raise AttributeError("No constructor defined - class is abstract")
1749
+
1750
+ def get_hash_id(self) -> str:
1751
+ """
1752
+ Gets the hash ID of the intermediate result unit.
1753
+
1754
+ Returns:
1755
+ The hash ID of the intermediate result unit.
1756
+ """
1757
+ return _DynamsoftCore.CIntermediateResultUnit_GetHashId(self)
1758
+
1759
+ def get_original_image_hash_id(self) -> str:
1760
+ """
1761
+ Gets the hash ID of the original image.
1762
+
1763
+ Returns:
1764
+ The hash ID of the original image.
1765
+ """
1766
+ return _DynamsoftCore.CIntermediateResultUnit_GetOriginalImageHashId(self)
1767
+
1768
+ def get_original_image_tag(self) -> ImageTag:
1769
+ """
1770
+ Gets the image tag of the original image.
1771
+
1772
+ Returns:
1773
+ The image tag of the original image.
1774
+ """
1775
+ return _DynamsoftCore.CIntermediateResultUnit_GetOriginalImageTag(self)
1776
+
1777
+ def get_transform_matrix(self, matrix_type: EnumTransformMatrixType) -> List[float]:
1778
+ """
1779
+ Gets the transformation matrix via EnumTransformMatrixType.
1780
+
1781
+ Args:
1782
+ matrix_type(EnumTransformMatrixType): The type of the transformation matrix.
1783
+
1784
+ Returns:
1785
+ A float array which represents the transform matrix.
1786
+ """
1787
+ return _DynamsoftCore.CIntermediateResultUnit_GetTransformMatrix(self, matrix_type)
1788
+
1789
+ def get_type(self) -> int:
1790
+ """
1791
+ Gets the type of the intermediate result unit.
1792
+
1793
+ Returns:
1794
+ The type of the intermediate result unit.
1795
+ """
1796
+ return _DynamsoftCore.CIntermediateResultUnit_GetType(self)
1797
+
1798
+ def clone(self) -> "IntermediateResultUnit":
1799
+ """
1800
+ Creates a copy of the intermediate result unit.
1801
+
1802
+ Returns:
1803
+ A copy of the intermediate result unit.
1804
+ """
1805
+ return _DynamsoftCore.CIntermediateResultUnit_Clone(self)
1806
+
1807
+ def replace(self, unit: "IntermediateResultUnit") -> int:
1808
+ """
1809
+ Replaces the specified IntermediateResultUnit object with the current IntermediateResultUnit object.
1810
+
1811
+ Args:
1812
+ unit(IntermediateResultUnit): The IntermediateResultUnit object to be replaced.
1813
+
1814
+ Returns:
1815
+ Returns 0 if success, otherwise an error code.
1816
+ """
1817
+ return _DynamsoftCore.CIntermediateResultUnit_Replace(self, unit)
1818
+
1819
+ def get_usage_count(self) -> int:
1820
+ """
1821
+ Gets the usage count of the intermediate result unit.
1822
+
1823
+ Returns:
1824
+ The usage count of the intermediate result unit.
1825
+ """
1826
+ return _DynamsoftCore.CIntermediateResultUnit_GetUsageCount(self)
1827
+
1828
+ _DynamsoftCore.CIntermediateResultUnit_register(IntermediateResultUnit)
1829
+ class IntermediateResult:
1830
+ """
1831
+ The IntermediateResult class represents a container containing a collection of IntermediateResultUnit objects.
1832
+
1833
+ Methods:
1834
+ get_intermediate_result_units(self) -> List[IntermediateResultUnit]: Gets a list of IntermediateResultUnit objects in the collection.
1835
+ """
1836
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1837
+
1838
+ def __init__(self):
1839
+ raise AttributeError("No constructor defined - class is abstract")
1840
+
1841
+ def get_intermediate_result_units(self) -> List[IntermediateResultUnit]:
1842
+ """
1843
+ Gets a list of IntermediateResultUnit objects in the collection.
1844
+
1845
+ Returns:
1846
+ A list of IntermediateResultUnit objects.
1847
+ """
1848
+ list = []
1849
+ count = _DynamsoftCore.CIntermediateResult_GetCount(self)
1850
+ for i in range(count):
1851
+ list.append(_DynamsoftCore.CIntermediateResult_GetIntermediateResultUnit(self, i))
1852
+ return list
1853
+
1854
+ _DynamsoftCore.CIntermediateResult_register(IntermediateResult)
1855
+
1856
+ class ColourImageUnit(IntermediateResultUnit):
1857
+ """
1858
+ The ColourImageUnit class represents a unit that contains color image.
1859
+ It is derived from the IntermediateResultUnit class.
1860
+
1861
+ Methods:
1862
+ get_image_data(self) -> ImageData: Gets the image data of the colour image unit.
1863
+ set_image_data(self, img_data: ImageData) -> int: Sets the image data of the color image unit.
1864
+ """
1865
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1866
+
1867
+ def __init__(self):
1868
+ raise AttributeError("No constructor defined - class is abstract")
1869
+
1870
+
1871
+ def get_image_data(self) -> ImageData:
1872
+ """
1873
+ Gets the image data of the colour image unit.
1874
+
1875
+ Returns:
1876
+ the ImageData object that contains the image data of the color image unit.
1877
+ """
1878
+ return _DynamsoftCore.CColourImageUnit_GetImageData(self)
1879
+
1880
+ def set_image_data(self, img_data: ImageData) -> int:
1881
+ """
1882
+ Sets the image data of the color image unit.
1883
+
1884
+ Args:
1885
+ img_data(ImageData): The image data to set.
1886
+
1887
+ Returns:
1888
+ Returns 0 if success, otherwise an error code.
1889
+ """
1890
+ return _DynamsoftCore.CColourImageUnit_SetImageData(self, img_data)
1891
+
1892
+ _DynamsoftCore.CColourImageUnit_register(ColourImageUnit)
1893
+ class ScaledColourImageUnit(IntermediateResultUnit):
1894
+ """
1895
+ The ScaledColourImageUnit class represents an intermediate result unit that contains scaled color image.
1896
+ It is derived from the IntermediateResultUnit class.
1897
+
1898
+ Methods:
1899
+ get_image_data(self) -> ImageData: Gets the image data of the scaled color image unit.
1900
+ set_image_data(self, img_data: ImageData) -> int: Sets the image data of the scaled color image unit.
1901
+ """
1902
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1903
+
1904
+ def __init__(self):
1905
+ raise AttributeError("No constructor defined - class is abstract")
1906
+
1907
+
1908
+ def get_image_data(self) -> ImageData:
1909
+ """
1910
+ Gets the image data of the scaled color image unit.
1911
+
1912
+ Returns:
1913
+ the ImageData object that contains the image data of the scaled color image unit.
1914
+ """
1915
+ return _DynamsoftCore.CScaledColourImageUnit_GetImageData(self)
1916
+
1917
+ def set_image_data(self, img_data: ImageData) -> int:
1918
+ """
1919
+ Sets the image data of the scaled color image unit.
1920
+
1921
+ Args:
1922
+ img_data(ImageData): The image data to set.
1923
+
1924
+ Returns:
1925
+ Returns 0 if success, otherwise an error code.
1926
+ """
1927
+ return _DynamsoftCore.CScaledColourImageUnit_SetImageData(self, img_data)
1928
+
1929
+ _DynamsoftCore.CScaledColourImageUnit_register(ScaledColourImageUnit)
1930
+ class GrayscaleImageUnit(IntermediateResultUnit):
1931
+ """
1932
+ The GrayscaleImageUnit class represents a grayscale image unit.
1933
+ It is a subclass of IntermediateResultUnit.
1934
+
1935
+ Methods:
1936
+ get_image_data(self) -> ImageData: Gets the image data of the grayscale image unit.
1937
+ set_image_data(self, img_data: ImageData) -> int: Sets the image data of the grayscale image unit.
1938
+ """
1939
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1940
+
1941
+ def __init__(self):
1942
+ raise AttributeError("No constructor defined - class is abstract")
1943
+
1944
+
1945
+ def get_image_data(self) -> ImageData:
1946
+ """
1947
+ Gets the image data of the grayscale image unit.
1948
+
1949
+ Returns:
1950
+ the ImageData object that contains the image data of the grayscale image unit.
1951
+ """
1952
+ return _DynamsoftCore.CGrayscaleImageUnit_GetImageData(self)
1953
+
1954
+ def set_image_data(self, img_data: ImageData) -> int:
1955
+ """
1956
+ Sets the image data of the grayscale image unit.
1957
+
1958
+ Args:
1959
+ img_data(ImageData): The image data to set.
1960
+
1961
+ Returns:
1962
+ Returns 0 if success, otherwise an error code.
1963
+ """
1964
+ return _DynamsoftCore.CGrayscaleImageUnit_SetImageData(self, img_data)
1965
+
1966
+ _DynamsoftCore.CGrayscaleImageUnit_register(GrayscaleImageUnit)
1967
+ class TransformedGrayscaleImageUnit(IntermediateResultUnit):
1968
+ """
1969
+ The TransformedGrayscaleImageUnit class is a subclass of IntermediateResultUnit that represents a transformed grayscale image.
1970
+ It may be the original grayscale image or the inverted image of the original grayscale image.
1971
+
1972
+ Methods:
1973
+ get_image_data(self) -> ImageData: Gets the image data of the transformed grayscale image unit.
1974
+ set_image_data(self, img_data: ImageData) -> int: Sets the image data of the transformed grayscale image unit.
1975
+ """
1976
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
1977
+
1978
+ def __init__(self):
1979
+ raise AttributeError("No constructor defined - class is abstract")
1980
+
1981
+
1982
+ def get_image_data(self) -> ImageData:
1983
+ """
1984
+ Gets the image data of the transformed grayscale image unit.
1985
+
1986
+ Returns:
1987
+ the ImageData object that contains the image data of the transformed grayscale image unit.
1988
+ """
1989
+ return _DynamsoftCore.CTransformedGrayscaleImageUnit_GetImageData(self)
1990
+
1991
+ def set_image_data(self, img_data: ImageData) -> int:
1992
+ """
1993
+ Sets the image data of the transformed grayscale image unit.
1994
+
1995
+ Args:
1996
+ img_data(ImageData): The image data to set.
1997
+
1998
+ Returns:
1999
+ Returns 0 if success, otherwise an error code.
2000
+ """
2001
+ return _DynamsoftCore.CTransformedGrayscaleImageUnit_SetImageData(self, img_data)
2002
+
2003
+ _DynamsoftCore.CTransformedGrayscaleImageUnit_register(TransformedGrayscaleImageUnit)
2004
+ class PredetectedRegionsUnit(IntermediateResultUnit):
2005
+ """
2006
+ The PredetectedRegionsUnit class represents a unit that contains a collection of pre-detected regions.
2007
+ It inherits from the IntermediateResultUnit class and stores the result of image color pre-detection.
2008
+ """
2009
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2010
+
2011
+ def __init__(self):
2012
+ raise AttributeError("No constructor defined - class is abstract")
2013
+
2014
+
2015
+ def get_count(self) -> int:
2016
+ """
2017
+ Gets the number of pre-detected regions in the collection.
2018
+
2019
+ Returns:
2020
+ The number of pre-detected regions in the collection.
2021
+ """
2022
+ return _DynamsoftCore.CPredetectedRegionsUnit_GetCount(self)
2023
+
2024
+ def get_predetected_region(self, index: int) -> PredetectedRegionElement:
2025
+ """
2026
+ Gets a pre-detected region in the collection.
2027
+
2028
+ Args:
2029
+ index(int): The index of the pre-detected region to get.
2030
+
2031
+ Returns:
2032
+ The pre-detected region at the specified index.
2033
+ """
2034
+ return _DynamsoftCore.CPredetectedRegionsUnit_GetPredetectedRegion(self, index)
2035
+
2036
+ def remove_all_predetected_regions(self) -> None:
2037
+ """
2038
+ Removes all pre-detected regions in the unit.
2039
+ """
2040
+ return _DynamsoftCore.CPredetectedRegionsUnit_RemoveAllPredetectedRegions(self)
2041
+
2042
+ def remove_predetected_region(self, index: int) -> int:
2043
+ """
2044
+ Removes a pre-detected region in the unit at the specified index.
2045
+
2046
+ Args:
2047
+ index(int): The index of the pre-detected region to remove.
2048
+
2049
+ Returns:
2050
+ Returns 0 if success, otherwise an error code.
2051
+ """
2052
+ return _DynamsoftCore.CPredetectedRegionsUnit_RemovePredetectedRegion(self, index)
2053
+
2054
+ def add_predetected_region(self, element: PredetectedRegionElement, matrix_to_original_image: List[float] = IDENTITY_MATRIX):
2055
+ """
2056
+ Adds a pre-detected region to the unit.
2057
+
2058
+ Args:
2059
+ element(PredetectedRegionElement): The pre-detected region to add.
2060
+ matrix_to_original_image(List[float]): The transformation matrix from the pre-detected region to the original image.
2061
+
2062
+ Returns:
2063
+ Returns 0 if success, otherwise an error code.
2064
+ """
2065
+ return _DynamsoftCore.CPredetectedRegionsUnit_AddPredetectedRegion(self, element, matrix_to_original_image)
2066
+
2067
+ def set_predetected_region(self, index: int, element: PredetectedRegionElement, matrix_to_original_image: List[float] = IDENTITY_MATRIX):
2068
+ """
2069
+ Sets a pre-detected region in the unit at the specified index.
2070
+
2071
+ Args:
2072
+ index(int): The index of the pre-detected region to set.
2073
+ element(PredetectedRegionElement): The pre-detected region to set.
2074
+ matrix_to_original_image(List[float]): The transformation matrix from the pre-detected region to the original image.
2075
+
2076
+ Returns:
2077
+ Returns 0 if success, otherwise an error code.
2078
+ """
2079
+ return _DynamsoftCore.CPredetectedRegionsUnit_SetPredetectedRegion(self, index, element, matrix_to_original_image)
2080
+
2081
+ _DynamsoftCore.CPredetectedRegionsUnit_register(PredetectedRegionsUnit)
2082
+ class EnhancedGrayscaleImageUnit(IntermediateResultUnit):
2083
+ """
2084
+ The EnhancedGrayscaleImageUnit class represents an intermediate result unit that contains an enhanced grayscale image data.
2085
+ Gray enhancement methods include gray equalization, gray smoothing, gray sharpening and smoothing.
2086
+
2087
+ Methods:
2088
+ get_image_data(self) -> ImageData: Gets the image data of the enhanced grayscale image unit.
2089
+ set_image_data(self, img_data: ImageData) -> int: Sets the image data of the enhanced grayscale image unit.
2090
+ """
2091
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2092
+
2093
+ def __init__(self):
2094
+ raise AttributeError("No constructor defined - class is abstract")
2095
+
2096
+
2097
+ def get_image_data(self) -> ImageData:
2098
+ """
2099
+ Gets the image data of the enhanced grayscale image unit.
2100
+
2101
+ Returns:
2102
+ the ImageData object that contains the image data of the enhanced grayscale image unit.
2103
+ """
2104
+ return _DynamsoftCore.CEnhancedGrayscaleImageUnit_GetImageData(self)
2105
+
2106
+ def set_image_data(self, img_data: ImageData) -> int:
2107
+ """
2108
+ Sets the image data of the enhanced grayscale image unit.
2109
+
2110
+ Args:
2111
+ img_data(ImageData): The image data to set.
2112
+
2113
+ Returns:
2114
+ Returns 0 if success, otherwise an error code.
2115
+ """
2116
+ return _DynamsoftCore.CEnhancedGrayscaleImageUnit_SetImageData(self, img_data)
2117
+
2118
+ _DynamsoftCore.CEnhancedGrayscaleImageUnit_register(EnhancedGrayscaleImageUnit)
2119
+ class BinaryImageUnit(IntermediateResultUnit):
2120
+ """
2121
+ The BinaryImageUnit class represents a binary image unit that inherits from IntermediateResultUnit.
2122
+ It inherits from the IntermediateResultUnit class and stores binary image data.
2123
+
2124
+ Methods:
2125
+ get_image_data(self) -> ImageData: Gets the image data of the binary image unit.
2126
+ set_image_data(self, img_data: ImageData) -> int: Sets the image data of the binary image unit.
2127
+ """
2128
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2129
+
2130
+ def __init__(self):
2131
+ raise AttributeError("No constructor defined - class is abstract")
2132
+
2133
+
2134
+ def get_image_data(self) -> ImageData:
2135
+ """
2136
+ Gets the image data of the binary image unit.
2137
+
2138
+ Returns:
2139
+ the ImageData object that contains the image data of the binary image unit.
2140
+ """
2141
+ return _DynamsoftCore.CBinaryImageUnit_GetImageData(self)
2142
+
2143
+ def set_image_data(self, img_data: ImageData) -> int:
2144
+ """
2145
+ Sets the image data of the binary image unit.
2146
+
2147
+ Args:
2148
+ img_data(ImageData): The image data to set.
2149
+
2150
+ Returns:
2151
+ Returns 0 if success, otherwise an error code.
2152
+ """
2153
+ return _DynamsoftCore.CBinaryImageUnit_SetImageData(self, img_data)
2154
+
2155
+ _DynamsoftCore.CBinaryImageUnit_register(BinaryImageUnit)
2156
+ class TextureDetectionResultUnit(IntermediateResultUnit):
2157
+ """
2158
+ The TextureDetectionResultUnit class represents an intermediate result unit for texture detection.
2159
+ It is derived from the IntermediateResultUnit class and contains the x-direction spacing and y-direction spacing of the texture stripes.
2160
+
2161
+ Methods:
2162
+ get_x_spacing(self) -> int: Gets the x-direction spacing of the texture stripes.
2163
+ get_y_spacing(self) -> int: Gets the y-direction spacing of the texture stripes.
2164
+ set_x_spacing(self, x_spacing: int): Sets the x-direction spacing of the texture stripes.
2165
+ set_y_spacing(self, y_spacing: int): Sets the y-direction spacing of the texture stripes.
2166
+ """
2167
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2168
+
2169
+ def __init__(self):
2170
+ raise AttributeError("No constructor defined - class is abstract")
2171
+
2172
+
2173
+ def get_x_spacing(self) -> int:
2174
+ """
2175
+ Gets x-direction spacing of the texture stripes.
2176
+
2177
+ Returns:
2178
+ The x-direction spacing of the texture stripes.
2179
+ """
2180
+ return _DynamsoftCore.CTextureDetectionResultUnit_GetXSpacing(self)
2181
+
2182
+ def get_y_spacing(self) -> int:
2183
+ """
2184
+ Gets y-direction spacing of the texture stripes.
2185
+
2186
+ Returns:
2187
+ The y-direction spacing of the texture stripes.
2188
+ """
2189
+ return _DynamsoftCore.CTextureDetectionResultUnit_GetYSpacing(self)
2190
+
2191
+ def set_x_spacing(self, x_spacing: int) -> None:
2192
+ """
2193
+ Sets the x-direction spacing of the texture stripes.
2194
+
2195
+ Args:
2196
+ x_spacing (int): The x-direction spacing of the texture stripes.
2197
+ """
2198
+ return _DynamsoftCore.CTextureDetectionResultUnit_SetXSpacing(self, x_spacing)
2199
+
2200
+ def set_y_spacing(self, y_spacing: int) -> None:
2201
+ """
2202
+ Sets the y-direction spacing of the texture stripes.
2203
+
2204
+ Args:
2205
+ y_spacing (int): The y-direction spacing of the texture stripes.
2206
+ """
2207
+ return _DynamsoftCore.CTextureDetectionResultUnit_SetYSpacing(self, y_spacing)
2208
+
2209
+ _DynamsoftCore.CTextureDetectionResultUnit_register(TextureDetectionResultUnit)
2210
+ class TextureRemovedGrayscaleImageUnit(IntermediateResultUnit):
2211
+ """
2212
+ The TextureRemovedGrayscaleImageUnit class represents an intermediate result unit that contains grayscale image data with textures removed.
2213
+
2214
+ Methods:
2215
+ get_image_data(self) -> ImageData: Gets the grayscale image data with textures removed.
2216
+ set_image_data(self, img_data: ImageData) -> int: Sets the grayscale image data with textures removed.
2217
+ """
2218
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2219
+
2220
+ def __init__(self):
2221
+ raise AttributeError("No constructor defined - class is abstract")
2222
+
2223
+
2224
+ def get_image_data(self) -> ImageData:
2225
+ """
2226
+ Gets the grayscale image data with textures removed.
2227
+
2228
+ Returns:
2229
+ the ImageData object that contains the grayscale image data with textures removed.
2230
+ """
2231
+ return _DynamsoftCore.CTextureRemovedGrayscaleImageUnit_GetImageData(self)
2232
+
2233
+ def set_image_data(self, img_data: ImageData) -> int:
2234
+ """
2235
+ Sets the grayscale image data with textures removed.
2236
+
2237
+ Args:
2238
+ img_data(ImageData): The grayscale image data to set.
2239
+
2240
+ Returns:
2241
+ Returns 0 if success, otherwise an error code.
2242
+ """
2243
+ return _DynamsoftCore.CTextureRemovedGrayscaleImageUnit_SetImageData(self, img_data)
2244
+
2245
+ _DynamsoftCore.CTextureRemovedGrayscaleImageUnit_register(TextureRemovedGrayscaleImageUnit)
2246
+ class TextureRemovedBinaryImageUnit(IntermediateResultUnit):
2247
+ """
2248
+ The TextureRemovedBinaryImageUnit class represents an intermediate result unit that stores binary image data with texture removed.
2249
+
2250
+ Methods:
2251
+ get_image_data(self) -> ImageData: Gets the binary image data with texture removed.
2252
+ set_image_data(self, img_data: ImageData) -> int: Sets the binary image data with texture removed.
2253
+ """
2254
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2255
+
2256
+ def __init__(self):
2257
+ raise AttributeError("No constructor defined - class is abstract")
2258
+
2259
+ def get_image_data(self) -> ImageData:
2260
+ """
2261
+ Gets the binary image data with texture removed.
2262
+
2263
+ Returns:
2264
+ the ImageData object that contains the binary image data with texture removed.
2265
+ """
2266
+ return _DynamsoftCore.CTextureRemovedBinaryImageUnit_GetImageData(self)
2267
+
2268
+ def set_image_data(self, img_data: ImageData) -> int:
2269
+ """
2270
+ Sets the binary image data with texture removed.
2271
+
2272
+ Args:
2273
+ img_data(ImageData): The binary image data to set.
2274
+
2275
+ Returns:
2276
+ Returns 0 if success, otherwise an error code.
2277
+ """
2278
+ return _DynamsoftCore.CTextureRemovedBinaryImageUnit_SetImageData(self, img_data)
2279
+
2280
+ _DynamsoftCore.CTextureRemovedBinaryImageUnit_register(TextureRemovedBinaryImageUnit)
2281
+ class TextZone(object):
2282
+ """
2283
+ The TextZone class represents a text zone.
2284
+
2285
+ Methods:
2286
+ get_location(self) -> Quadrilateral: Gets the location of the text zone.
2287
+ set_location(self, loc: Quadrilateral) -> None: Sets the location of the text zone.
2288
+ get_char_contours_indices(self) -> List[int]: Gets the indices of the character contours.
2289
+ set_char_contours_indices(self, char_contours_indices: List[int]): Sets the indices of the character contours.
2290
+ """
2291
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2292
+
2293
+ def __init__(self, loc: Quadrilateral = None, char_contours_indices: List[int] = None):
2294
+ if char_contours_indices is not None and loc is None:
2295
+ raise ValueError("If char_contours_indices is not None, loc should not be None")
2296
+ _DynamsoftCore.Class_init(self, _DynamsoftCore.new_CTextZone(loc, char_contours_indices))
2297
+
2298
+ def get_location(self) -> Quadrilateral:
2299
+ """
2300
+ Gets the location of the text zone.
2301
+
2302
+ Returns:
2303
+ The location of the text zone.
2304
+ """
2305
+ return _DynamsoftCore.CTextZone_GetLocation(self)
2306
+
2307
+ def set_location(self, loc: Quadrilateral) -> None:
2308
+ """
2309
+ Sets the location of the text zone.
2310
+
2311
+ Args:
2312
+ loc(Quadrilateral): The location of the text zone.
2313
+ """
2314
+ return _DynamsoftCore.CTextZone_SetLocation(self, loc)
2315
+
2316
+ def get_char_contours_indices(self) -> List[int]:
2317
+ """
2318
+ Gets the indices of the character contours.
2319
+
2320
+ Returns:
2321
+ The indices of the character contours.
2322
+ """
2323
+ return _DynamsoftCore.CTextZone_GetCharContoursIndices(self)
2324
+
2325
+ def set_char_contours_indices(self, char_contours_indices: List[int]) -> None:
2326
+ """
2327
+ Sets the indices of the character contours.
2328
+
2329
+ Args:
2330
+ char_contours_indices(List[int]): The indices of the character contours.
2331
+ """
2332
+ return _DynamsoftCore.CTextZone_SetCharContoursIndices(self, char_contours_indices)
2333
+
2334
+ __destroy__ = _DynamsoftCore.delete_CTextZone
2335
+
2336
+ _DynamsoftCore.CTextZone_register(TextZone)
2337
+ class TextZonesUnit(IntermediateResultUnit):
2338
+ """
2339
+ The TextZonesUnit class represents a unit that contains text zones.
2340
+ It is derived from IntermediateResultUnit class and provides methods to retrieve the count and details of text zones.
2341
+
2342
+ Methods:
2343
+ get_count(self) -> int: Gets the number of text zones in the unit.
2344
+ get_text_zone(self, index: int) -> Tuple[int, TextZone]: Gets the quadrilateral shape of the text zone at the specified index.
2345
+ remove_all_text_zones(self) -> None: Removes all text zones from the unit.
2346
+ remove_text_zone(self, index: int) -> int: Removes the text zone at the specified index.
2347
+ add_text_zone(self, text_zone: TextZone, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Adds a text zone to the unit.
2348
+ set_text_zone(self, index: int, text_zone: TextZone, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Sets the text zone at the specified index.
2349
+ """
2350
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2351
+
2352
+ def __init__(self):
2353
+ raise AttributeError("No constructor defined - class is abstract")
2354
+
2355
+
2356
+ def get_count(self) -> int:
2357
+ """
2358
+ Gets the number of text zones in the unit.
2359
+
2360
+ Returns:
2361
+ The number of text zones in the unit.
2362
+ """
2363
+ return _DynamsoftCore.CTextZonesUnit_GetCount(self)
2364
+
2365
+ def get_text_zone(self, index: int) -> Tuple[int, TextZone]:
2366
+ """
2367
+ Gets the quadrilateral shape of the text zone at the specified index.
2368
+
2369
+ Args:
2370
+ index(int): The index of the text zone.
2371
+
2372
+ Returns:
2373
+ A tuple containing following elements:
2374
+ - error_code (int): The error code indicating the status of the operation, returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2375
+ - text_zone (TextZone): The quadrilateral shape of the text zone at the specified index.
2376
+ """
2377
+ return _DynamsoftCore.CTextZonesUnit_GetTextZone(self, index)
2378
+
2379
+ def remove_all_text_zones(self) -> None:
2380
+ """
2381
+ Removes all text zones from the unit.
2382
+ """
2383
+ return _DynamsoftCore.CTextZonesUnit_RemoveAllTextZones(self)
2384
+
2385
+ def remove_text_zone(self, index: int) -> int:
2386
+ """
2387
+ Removes the text zone at the specified index.
2388
+
2389
+ Args:
2390
+ index(int): The index of the text zone.
2391
+
2392
+ Returns:
2393
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2394
+ """
2395
+ return _DynamsoftCore.CTextZonesUnit_RemoveTextZone(self, index)
2396
+
2397
+ def add_text_zone(self,text_zone: TextZone, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
2398
+ """
2399
+ Adds a text zone to the unit.
2400
+
2401
+ Args:
2402
+ text_zone(TextZone): The text zone to add.
2403
+ matrix_to_original_image(List[float]): The matrix to original image.
2404
+
2405
+ Returns:
2406
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2407
+ """
2408
+ return _DynamsoftCore.CTextZonesUnit_AddTextZone(self, text_zone, matrix_to_original_image)
2409
+
2410
+ def set_text_zone(self, index: int, text_zone: TextZone, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
2411
+ """
2412
+ Sets the text zone at the specified index.
2413
+
2414
+ Args:
2415
+ index(int): The index of the text zone.
2416
+ text_zone(TextZone): The text zone to set.
2417
+ matrix_to_original_image(List[float]): The matrix to original image.
2418
+
2419
+ Returns:
2420
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2421
+ """
2422
+ return _DynamsoftCore.CTextZonesUnit_SetTextZone(self, index, text_zone, matrix_to_original_image)
2423
+
2424
+ _DynamsoftCore.CTextZonesUnit_register(TextZonesUnit)
2425
+ class TextRemovedBinaryImageUnit(IntermediateResultUnit):
2426
+ """
2427
+ The TextRemovedBinaryImageUnit class represents an intermediate result unit that contains a binary image with the text removed.
2428
+
2429
+ Methods:
2430
+ get_image_data(self) -> ImageData: Gets the binary image data.
2431
+ set_image_data(self, img_data: ImageData) -> int: Sets the binary image data.
2432
+ """
2433
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2434
+
2435
+ def __init__(self):
2436
+ raise AttributeError("No constructor defined - class is abstract")
2437
+
2438
+
2439
+ def get_image_data(self) -> ImageData:
2440
+ """
2441
+ Gets the binary image data with the text removed.
2442
+
2443
+ Returns:
2444
+ The binary image data with the text removed.
2445
+ """
2446
+ return _DynamsoftCore.CTextRemovedBinaryImageUnit_GetImageData(self)
2447
+
2448
+ def set_image_data(self, img_data: ImageData) -> int:
2449
+ """
2450
+ Sets the binary image data with the text removed.
2451
+
2452
+ Args:
2453
+ img_data(ImageData): The binary image data with the text removed.
2454
+
2455
+ Returns:
2456
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2457
+ """
2458
+ return _DynamsoftCore.CTextRemovedBinaryImageUnit_SetImageData(self, img_data)
2459
+
2460
+ _DynamsoftCore.CTextRemovedBinaryImageUnit_register(TextRemovedBinaryImageUnit)
2461
+ class ContoursUnit(IntermediateResultUnit):
2462
+ """
2463
+ The ContoursUnit class represents a unit that contains contours as intermediate results.
2464
+ It is derived from the IntermediateResultUnit class.
2465
+
2466
+ Methods:
2467
+ get_contours(self) -> Tuple[int, List[Contour], List[Vector4]]: Gets the contours and hierarchies in the unit.
2468
+ set_contours(self, contours: List[Contour], hierarchies: List[Vector4], matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Sets the contours and hierarchies in the unit.
2469
+ """
2470
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2471
+
2472
+ def __init__(self):
2473
+ raise AttributeError("No constructor defined - class is abstract")
2474
+
2475
+ def get_contours(self) -> Tuple[int, List[Contour], List[Vector4]]:
2476
+ """
2477
+ Gets the contours and hierarchies in the unit.
2478
+
2479
+ Returns:
2480
+ A tuple containing following elements:
2481
+ - error_code (int): The error code indicating the status of the operation, returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2482
+ - contours <List[Contour]>: The contours in the unit.
2483
+ - hierarchies <List[Vector4]>: AThe hierarchies in the unit.
2484
+ """
2485
+ return _DynamsoftCore.CContoursUnit_GetContours(self)
2486
+
2487
+ def set_contours(self, contours: List[Contour], hierarchies: List[Vector4], matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
2488
+ """
2489
+ Sets the contours and hierarchies in the unit.
2490
+
2491
+ Args:
2492
+ contours(List[Contour]): The contours to set.
2493
+ hierarchies(List[Vector4]): The hierarchies to set.
2494
+ matrix_to_original_image(List[float]): The matrix to original image.
2495
+
2496
+ Returns:
2497
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2498
+ """
2499
+ return _DynamsoftCore.CContoursUnit_SetContours(self, contours, hierarchies, matrix_to_original_image)
2500
+
2501
+ _DynamsoftCore.CContoursUnit_register(ContoursUnit)
2502
+ class LineSegmentsUnit(IntermediateResultUnit):
2503
+ """
2504
+ The LineSegmentsUnit class represents a collection of line segments in 2D space. It is a derived class of IntermediateResultUnit.
2505
+
2506
+ Methods:
2507
+ get_count(self) -> int: Gets the number of line segments in the collection.
2508
+ get_line_segment(self, index: int) -> LineSegment: Gets the line segment at the specified index.
2509
+ remove_all_line_segments(self) -> None: Removes all line segments from the unit.
2510
+ remove_line_segment(self, index: int) -> int: Removes the line segment at the specified index.
2511
+ add_line_segment(self, line : LineSegment, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Adds a line segment to the unit.
2512
+ set_line_segment(self, index: int, line : LineSegment, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Sets the line segment at the specified index.
2513
+ """
2514
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2515
+
2516
+ def __init__(self):
2517
+ raise AttributeError("No constructor defined - class is abstract")
2518
+
2519
+
2520
+ def get_count(self) -> int:
2521
+ """
2522
+ Gets the number of line segments in the collection.
2523
+
2524
+ Returns:
2525
+ The number of line segments in the collection.
2526
+ """
2527
+ return _DynamsoftCore.CLineSegmentsUnit_GetCount(self)
2528
+
2529
+ def get_line_segment(self, index: int) -> LineSegment:
2530
+ """
2531
+ Gets the line segment at the specified index.
2532
+
2533
+ Args:
2534
+ index(int): The index of the line segment to retrieve.
2535
+
2536
+ Returns:
2537
+ The line segment at the specified index.
2538
+ """
2539
+ return _DynamsoftCore.CLineSegmentsUnit_GetLineSegment(self, index)
2540
+
2541
+ def remove_all_line_segments(self) -> None:
2542
+ """
2543
+ Removes all line segments from the unit.
2544
+ """
2545
+ return _DynamsoftCore.CLineSegmentsUnit_RemoveAllLineSegments(self)
2546
+
2547
+ def remove_line_segment(self, index: int) -> int:
2548
+ """
2549
+ Removes the line segment at the specified index.
2550
+
2551
+ Args:
2552
+ index(int): The index of the line segment to remove.
2553
+
2554
+ Returns:
2555
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2556
+ """
2557
+ return _DynamsoftCore.CLineSegmentsUnit_RemoveLineSegment(self, index)
2558
+
2559
+ def add_line_segment(self, line : LineSegment, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
2560
+ """
2561
+ Adds a line segment to the unit.
2562
+
2563
+ Args:
2564
+ line(LineSegment): The line segment to add.
2565
+ matrix_to_original_image(List[float]): The matrix to original image.
2566
+
2567
+ Returns:
2568
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2569
+ """
2570
+ return _DynamsoftCore.CLineSegmentsUnit_AddLineSegment(self, line, matrix_to_original_image)
2571
+
2572
+ def set_line_segment(self, index: int, line: LineSegment, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
2573
+ """
2574
+ Sets the line segment at the specified index.
2575
+
2576
+ Args:
2577
+ index(int): The index of the line segment to set.
2578
+ line(LineSegment): The line segment to set.
2579
+ matrix_to_original_image(List[float]): The matrix to original image.
2580
+
2581
+ Returns:
2582
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2583
+ """
2584
+ return _DynamsoftCore.CLineSegmentsUnit_SetLineSegment(self, index, line, matrix_to_original_image)
2585
+
2586
+ _DynamsoftCore.CLineSegmentsUnit_register(LineSegmentsUnit)
2587
+ class ShortLinesUnit(IntermediateResultUnit):
2588
+ """
2589
+ The ShortLinesUnit class represents a collection of short lines in 2D space.
2590
+ It is a derived class of IntermediateResultUnit.
2591
+
2592
+ Methods:
2593
+ get_count(self) -> int: Gets the number of short lines in the collection.
2594
+ get_short_line(self, index: int) -> LineSegment: Gets the short line at the specified index.
2595
+ remove_all_short_lines(self) -> None: Removes all short lines from the unit.
2596
+ remove_short_line(self, index: int) -> int: Removes the short line at the specified index.
2597
+ add_short_line(self, line : LineSegment, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Adds a short line to the unit.
2598
+ set_short_line(self, index: int, line : LineSegment, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int: Sets the short line at the specified index.
2599
+ """
2600
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2601
+
2602
+ def __init__(self):
2603
+ raise AttributeError("No constructor defined - class is abstract")
2604
+
2605
+
2606
+ def get_count(self) -> int:
2607
+ """
2608
+ Gets the number of short lines in the collection.
2609
+
2610
+ Returns:
2611
+ The number of short lines in the collection.
2612
+ """
2613
+ return _DynamsoftCore.CShortLinesUnit_GetCount(self)
2614
+
2615
+ def get_short_line(self, index: int) -> LineSegment:
2616
+ """
2617
+ Gets the short line at the specified index.
2618
+
2619
+ Args:
2620
+ index(int): The index of the short line to get.
2621
+
2622
+ Returns:
2623
+ The short line at the specified index.
2624
+ """
2625
+ return _DynamsoftCore.CShortLinesUnit_GetShortLine(self, index)
2626
+
2627
+ def remove_all_short_lines(self) -> None:
2628
+ """
2629
+ Removes all short lines from the unit.
2630
+ """
2631
+ return _DynamsoftCore.CShortLinesUnit_RemoveAllShortLines(self)
2632
+
2633
+ def remove_short_line(self, index: int) -> int:
2634
+ """
2635
+ Removes the short line at the specified index.
2636
+
2637
+ Args:
2638
+ index(int): The index of the short line to remove.
2639
+
2640
+ Returns:
2641
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2642
+ """
2643
+ return _DynamsoftCore.CShortLinesUnit_RemoveShortLine(self, index)
2644
+
2645
+ def add_short_line(self, line: LineSegment, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
2646
+ """
2647
+ Adds a short line to the unit.
2648
+
2649
+ Args:
2650
+ line(LineSegment): The short line to add.
2651
+ matrix_to_original_image(List[float]): The matrix to original image.
2652
+
2653
+ Returns:
2654
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2655
+ """
2656
+ return _DynamsoftCore.CShortLinesUnit_AddShortLine(self, line, matrix_to_original_image)
2657
+
2658
+ def set_short_line(self, index: int, line: LineSegment, matrix_to_original_image: List[float] = IDENTITY_MATRIX) -> int:
2659
+ """
2660
+ Sets the short line at the specified index.
2661
+
2662
+ Args:
2663
+ index(int): The index of the short line to set.
2664
+ line(LineSegment): The short line to set.
2665
+ matrix_to_original_image(List[float]): The matrix to original image.
2666
+
2667
+ Returns:
2668
+ Returns 0 if the operation succeeds, or a nonzero error code if the operation fails.
2669
+ """
2670
+ return _DynamsoftCore.CShortLinesUnit_SetShortLine(self, index, line, matrix_to_original_image)
2671
+
2672
+ _DynamsoftCore.CShortLinesUnit_register(ShortLinesUnit)
2673
+ class ObservationParameters:
2674
+ """
2675
+ The ObservationParameters class is used to set filter conditions for the IntermediateReusltReceiver, so that only intermediate results meeting specific conditions will be called back.
2676
+
2677
+ Methods:
2678
+ set_observed_result_unit_types(self, types: int) -> None: Sets the types of intermediate result units that have been observed.
2679
+ get_observed_result_unit_types(self) -> int: Gets the types of intermediate result units that have been observed.
2680
+ is_result_unit_type_observed(self, type: int) -> bool: Determines whether the specified result unit type was observed.
2681
+ def add_observed_task(self, task_name: str) ->None: Adds observed task name to be notified when relevant results are available.
2682
+ def remove_observed_task(self, task_name: str) -> None:Removes observed task name to be notified when relevant results are available.
2683
+ is_task_observed(self, task_name: str) -> bool: Determines whether the specified task was observed.
2684
+ set_result_unit_types_only_for_input(self, types: int) -> None: Sets the type of intermediate result unit that indicates skipping default calculations and replacing with input data units.
2685
+ get_result_unit_types_only_for_input(self) -> int: Gets the type of intermediate result unit that indicates skipping default calculations and replacing with input data units.
2686
+ is_result_unit_type_only_for_input(self, type: int) -> bool: Determines whether the specified type of intermediate result unit indicates skipping default calculations and replacing with input data units.
2687
+ """
2688
+ _thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
2689
+
2690
+ def __init__(self):
2691
+ raise AttributeError("No constructor defined - class is abstract")
2692
+
2693
+ __destroy__ = _DynamsoftCore.delete_CObservationParameters
2694
+
2695
+ def set_observed_result_unit_types(self, types: int) -> None:
2696
+ """
2697
+ Sets the types of intermediate result units that have been observed.
2698
+
2699
+ Args:
2700
+ types(int): The observed types of intermediate result units.
2701
+ """
2702
+ return _DynamsoftCore.CObservationParameters_SetObservedResultUnitTypes(self, types)
2703
+
2704
+ def get_observed_result_unit_types(self) -> int:
2705
+ """
2706
+ Gets the types of intermediate result units that have been observed.
2707
+
2708
+ Returns:
2709
+ The observed types of intermediate result units.
2710
+ """
2711
+ return _DynamsoftCore.CObservationParameters_GetObservedResultUnitTypes(self)
2712
+
2713
+ def is_result_unit_type_observed(self, type: int) -> bool:
2714
+ """
2715
+ Determines whether the specified result unit type was observed.
2716
+
2717
+ Args:
2718
+ type(int): The type of the result unit to check.
2719
+
2720
+ Returns:
2721
+ Returns a boolean value indicating whether the specified result unit type was observed.
2722
+ """
2723
+ return _DynamsoftCore.CObservationParameters_IsResultUnitTypeObserved(self, type)
2724
+
2725
+ def add_observed_task(self, task_name: str) ->None:
2726
+ """
2727
+ Adds observed task name to be notified when relevant results are available.
2728
+
2729
+ Args:
2730
+ task_name(str): The specified task name.
2731
+ """
2732
+ return _DynamsoftCore.CObservationParameters_AddObservedTask(self, task_name)
2733
+
2734
+ def remove_observed_task(self, task_name: str) -> None:
2735
+ """
2736
+ Removes observed task name to be notified when relevant results are available.
2737
+
2738
+ Args:
2739
+ task_name(str): The specified task name.
2740
+ """
2741
+ return _DynamsoftCore.CObservationParameters_RemoveObservedTask(self, task_name)
2742
+
2743
+ def is_task_observed(self, task_name: str) -> bool:
2744
+ """
2745
+ Determines whether the specified task was observed.
2746
+
2747
+ Args:
2748
+ task_name(str): The specified task name.
2749
+
2750
+ Returns:
2751
+ Returns a boolean value indicating whether the specified task was observed.
2752
+ """
2753
+ return _DynamsoftCore.CObservationParameters_IsTaskObserved(self, task_name)
2754
+
2755
+ def set_result_unit_types_only_for_input(self, types: int) -> None:
2756
+ """
2757
+ Sets the type of intermediate result unit that indicates skipping default calculations and replacing with input data units.
2758
+
2759
+ Args:
2760
+ types(int): The type of intermediate result unit that serves as the combination value of EnumIntermediateResultUnitType.
2761
+ """
2762
+ return _DynamsoftCore.CObservationParameters_SetResultUnitTypesOnlyForInput(self, types)
2763
+
2764
+ def get_result_unit_types_only_for_input(self) -> int:
2765
+ """
2766
+ Gets the type of intermediate result unit that indicates skipping default calculations and replacing with input data units.
2767
+
2768
+ Returns:
2769
+ Returns the type of intermediate result unit that serves as the combination value of IntermediateResultUnitType.
2770
+ """
2771
+ return _DynamsoftCore.CObservationParameters_GetResultUnitTypesOnlyForInput(self)
2772
+
2773
+ def is_result_unit_type_only_for_input(self, type: int) -> bool:
2774
+ """
2775
+ Determines whether the specified type of intermediate result unit indicates skipping default calculations and replacing with input data units.
2776
+
2777
+ Args:
2778
+ type(int): The type of intermediate result unit to check.
2779
+
2780
+ Returns:
2781
+ Returns a boolean value indicating whether the specified type of intermediate result unit indicates skipping default calculations and replacing with input data units.
2782
+ """
2783
+ return _DynamsoftCore.CObservationParameters_IsResultUnitTypeOnlyForInput(self, type)
2784
+
2785
+ _DynamsoftCore.CObservationParameters_register(ObservationParameters)