dwt 18.4.2 → 18.5.0

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.
@@ -42,6 +42,20 @@ export interface WebTwainEdit extends WebTwainBuffer {
42
42
  index: number,
43
43
  bitDepth: number,
44
44
  highQuality: boolean,
45
+ ): boolean;
46
+ /**
47
+ * @deprecated since version 18.5. This property will be removed in future versions. Use asynchronous function `ChangeImageSize` instead.
48
+ * Change the size of the specified image.
49
+ * @param index Specify the image.
50
+ * @param width Specify the new width.
51
+ * @param height Specify the new height.
52
+ * @param method Specify the algorithm for the change.
53
+ */
54
+ ChangeImageSize(
55
+ index: number,
56
+ width: number,
57
+ height: number,
58
+ method: DynamsoftEnumsDWT.EnumDWT_InterpolationMethod | number
45
59
  ): boolean;
46
60
  /**
47
61
  * Change the size of the specified image.
@@ -64,7 +78,7 @@ export interface WebTwainEdit extends WebTwainBuffer {
64
78
  errorCode: number,
65
79
  errorString: string
66
80
  ) => void
67
- ): void | boolean;
81
+ ): void;
68
82
  /**
69
83
  * Change the DPI (dots per inch) of the specified image.
70
84
  * @param index Specify the image.
@@ -72,7 +86,22 @@ export interface WebTwainEdit extends WebTwainBuffer {
72
86
  * @param yResolution Specify the vertical DPI.
73
87
  * @param resample Whether to resample the image.
74
88
  * @param method Specify the algorithm for the change.
75
- * @param successCallback A callback function that is executed if the request succeeds.
89
+ */
90
+ SetDPI(
91
+ index: number,
92
+ xResolution: number,
93
+ yResolution: number,
94
+ resample: boolean,
95
+ method: DynamsoftEnumsDWT.EnumDWT_InterpolationMethod | number
96
+ ): boolean;
97
+ /**
98
+ * Change the DPI (dots per inch) of the specified image.
99
+ * @param index Specify the image.
100
+ * @param xResolution Specify the horizontal DPI.
101
+ * @param yResolution Specify the vertical DPI.
102
+ * @param resample Whether to resample the image.
103
+ * @param method Specify the algorithm for the change.
104
+ * @param successCallback A callback function that is executed if the request succeeds.
76
105
  * @param failureCallback A callback function that is executed if the request fails.
77
106
  * @argument errorCode The error code.
78
107
  * @argument errorString The error string.
@@ -83,15 +112,22 @@ export interface WebTwainEdit extends WebTwainBuffer {
83
112
  yResolution: number,
84
113
  resample: boolean,
85
114
  method: DynamsoftEnumsDWT.EnumDWT_InterpolationMethod | number,
86
- successCallback?: () => void,
87
- failureCallback?: (
115
+ successCallback: () => void,
116
+ failureCallback: (
88
117
  errorCode: number,
89
118
  errorString: string
90
119
  ) => void
91
- ): void | boolean;
120
+ ): void;
92
121
  /**
93
122
  * Convert the specified image to black & white.
94
123
  * @param index Specify the image.
124
+ */
125
+ ConvertToBW(
126
+ index: number
127
+ ): boolean;
128
+ /**
129
+ * Convert the specified image to black & white.
130
+ * @param index Specify the image.
95
131
  * @param successCallback A callback function that is executed if the request succeeds.
96
132
  * @param failureCallback A callback function that is executed if the request fails.
97
133
  * @argument errorCode The error code.
@@ -99,15 +135,22 @@ export interface WebTwainEdit extends WebTwainBuffer {
99
135
  */
100
136
  ConvertToBW(
101
137
  index: number,
102
- successCallback?: () => void,
103
- failureCallback?: (
138
+ successCallback: () => void,
139
+ failureCallback: (
104
140
  errorCode: number,
105
141
  errorString: string
106
142
  ) => void
107
- ): void | boolean;
143
+ ): void;
108
144
  /**
109
145
  * Convert the specified image to grayscale.
110
146
  * @param index Specify the image.
147
+ */
148
+ ConvertToGrayScale(
149
+ index: number
150
+ ): boolean;
151
+ /**
152
+ * Convert the specified image to grayscale.
153
+ * @param index Specify the image.
111
154
  * @param successCallback A callback function that is executed if the request succeeds.
112
155
  * @param failureCallback A callback function that is executed if the request fails.
113
156
  * @argument errorCode The error code.
@@ -115,15 +158,22 @@ export interface WebTwainEdit extends WebTwainBuffer {
115
158
  */
116
159
  ConvertToGrayScale(
117
160
  index: number,
118
- successCallback?: () => void,
119
- failureCallback?: (
161
+ successCallback: () => void,
162
+ failureCallback: (
120
163
  errorCode: number,
121
164
  errorString: string
122
165
  ) => void
123
- ): void | boolean;
166
+ ): void;
124
167
  /**
125
168
  * Invert the colour of the pixels on the specified image.
126
169
  * @param index Specify the image.
170
+ */
171
+ Invert(
172
+ index: number
173
+ ): boolean;
174
+ /**
175
+ * Invert the colour of the pixels on the specified image.
176
+ * @param index Specify the image.
127
177
  * @param successCallback A callback function that is executed if the request succeeds.
128
178
  * @param failureCallback A callback function that is executed if the request fails.
129
179
  * @argument errorCode The error code.
@@ -131,16 +181,25 @@ export interface WebTwainEdit extends WebTwainBuffer {
131
181
  */
132
182
  Invert(
133
183
  index: number,
134
- successCallback?: () => void,
135
- failureCallback?: (
184
+ successCallback: () => void,
185
+ failureCallback: (
136
186
  errorCode: number,
137
187
  errorString: string
138
188
  ) => void
139
- ): void | boolean;
189
+ ): void;
140
190
  /**
141
191
  * Change the width of the specified image by adding a margin or removing part of the image.
142
192
  * @param index Specify the image.
143
193
  * @param width Specify the new width.
194
+ */
195
+ SetImageWidth(
196
+ index: number,
197
+ width: number
198
+ ): boolean;
199
+ /**
200
+ * Change the width of the specified image by adding a margin or removing part of the image.
201
+ * @param index Specify the image.
202
+ * @param width Specify the new width.
144
203
  * @param successCallback A callback function that is executed if the request succeeds.
145
204
  * @param failureCallback A callback function that is executed if the request fails.
146
205
  * @argument errorCode The error code.
@@ -149,12 +208,20 @@ export interface WebTwainEdit extends WebTwainBuffer {
149
208
  SetImageWidth(
150
209
  index: number,
151
210
  width: number,
152
- successCallback?: () => void,
153
- failureCallback?: (
211
+ successCallback: () => void,
212
+ failureCallback: (
154
213
  errorCode: number,
155
214
  errorString: string
156
215
  ) => void
157
- ): void | boolean;
216
+ ): void;
217
+ /**
218
+ * @deprecated since version 18.5. This property will be removed in future versions. Use asynchronous function `Flip` instead.
219
+ * Flip the specified image.
220
+ * @param index Specify the image.
221
+ */
222
+ Flip(
223
+ index: number
224
+ ): boolean;
158
225
  /**
159
226
  * Flip the specified image.
160
227
  * @param index Specify the image.
@@ -170,7 +237,15 @@ export interface WebTwainEdit extends WebTwainBuffer {
170
237
  errorCode: number,
171
238
  errorString: string
172
239
  ) => void
173
- ): void | boolean;
240
+ ): void;
241
+ /**
242
+ * @deprecated since version 18.5. This property will be removed in future versions. Use asynchronous function `Mirror` instead.
243
+ * Mirror the specified image.
244
+ * @param index Specify the image.
245
+ */
246
+ Mirror(
247
+ index: number
248
+ ): boolean;
174
249
  /**
175
250
  * Mirror the specified image.
176
251
  * @param index Specify the image.
@@ -186,7 +261,15 @@ export interface WebTwainEdit extends WebTwainBuffer {
186
261
  errorCode: number,
187
262
  errorString: string
188
263
  ) => void
189
- ): void | boolean;
264
+ ): void;
265
+ /**
266
+ * @deprecated since version 18.5. This property will be removed in future versions. Use asynchronous function `RotateLeft` instead.
267
+ * Rotate the specified image 90 degrees counterclockwise.
268
+ * @param index Specify the image.
269
+ */
270
+ RotateLeft(
271
+ index: number
272
+ ): boolean;
190
273
  /**
191
274
  * Rotate the specified image 90 degrees counterclockwise.
192
275
  * @param index Specify the image.
@@ -202,7 +285,15 @@ export interface WebTwainEdit extends WebTwainBuffer {
202
285
  errorCode: number,
203
286
  errorString: string
204
287
  ) => void
205
- ): void | boolean;
288
+ ): void;
289
+ /**
290
+ * @deprecated since version 18.5. This property will be removed in future versions. Use asynchronous function `RotateRight` instead.
291
+ * Rotate the specified image 90 degrees clockwise.
292
+ * @param index Specify the image.
293
+ */
294
+ RotateRight(
295
+ index: number
296
+ ): boolean;
206
297
  /**
207
298
  * Rotate the specified image 90 degrees clockwise.
208
299
  * @param index Specify the image.
@@ -218,7 +309,19 @@ export interface WebTwainEdit extends WebTwainBuffer {
218
309
  errorCode: number,
219
310
  errorString: string
220
311
  ) => void
221
- ): void | boolean;
312
+ ): void;
313
+ /**
314
+ * @deprecated since version 18.5. This property will be removed in future versions. Use asynchronous function `Rotate` instead.
315
+ * Rotate the specified image by the specified angle.
316
+ * @param index Specify the image.
317
+ * @param angle Specify the angle.
318
+ * @param keepSize Whether to keep the original size.
319
+ */
320
+ Rotate(
321
+ index: number,
322
+ angle: number,
323
+ keepSize: boolean
324
+ ): boolean;
222
325
  /**
223
326
  * Rotate the specified image by the specified angle.
224
327
  * @param index Specify the image.
@@ -238,7 +341,21 @@ export interface WebTwainEdit extends WebTwainBuffer {
238
341
  errorCode: number,
239
342
  errorString: string
240
343
  ) => void
241
- ): void | boolean;
344
+ ): void;
345
+ /**
346
+ * @deprecated since version 18.5. This property will be removed in future versions. Use asynchronous function `RotateEx` instead.
347
+ * Rotate the specified image by the specified angle.
348
+ * @param index Specify the image.
349
+ * @param angle Specify the angle.
350
+ * @param keepSize Whether to keep the original size.
351
+ * @param method Specify the algorithm for the change.
352
+ */
353
+ RotateEx(
354
+ index: number,
355
+ angle: number,
356
+ keepSize: boolean,
357
+ method: DynamsoftEnumsDWT.EnumDWT_InterpolationMethod | number
358
+ ): boolean;
242
359
  /**
243
360
  * Rotate the specified image by the specified angle.
244
361
  * @param index Specify the image.
@@ -260,7 +377,23 @@ export interface WebTwainEdit extends WebTwainBuffer {
260
377
  errorCode: number,
261
378
  errorString: string
262
379
  ) => void
263
- ): void | boolean;
380
+ ): void;
381
+ /**
382
+ * @deprecated since version 18.5. This property will be removed in future versions. Use asynchronous function `Crop` instead.
383
+ * Crop the specified image using the specified coordinates.
384
+ * @param index Specify the image.
385
+ * @param left Specify the rectangle (leftmost coordinate).
386
+ * @param top Specify the rectangle (topmost coordinate).
387
+ * @param right Specify the rectangle (rightmost coordinate).
388
+ * @param bottom Specify the rectangle (bottommost coordinate).
389
+ */
390
+ Crop(
391
+ index: number,
392
+ left: number,
393
+ top: number,
394
+ right: number,
395
+ bottom: number
396
+ ): boolean;
264
397
  /**
265
398
  * Crop the specified image using the specified coordinates.
266
399
  * @param index Specify the image.
@@ -284,7 +417,23 @@ export interface WebTwainEdit extends WebTwainBuffer {
284
417
  errorCode: number,
285
418
  errorString: string
286
419
  ) => void
287
- ): void | boolean;
420
+ ): void;
421
+ /**
422
+ * @deprecated since version 18.5. This property will be removed in future versions. Use asynchronous function `Erase` instead.
423
+ * Erase a rectangular area from the specified image.
424
+ * @param index Specify the image.
425
+ * @param left Specify the rectangle (leftmost coordinate).
426
+ * @param top Specify the rectangle (topmost coordinate).
427
+ * @param right Specify the rectangle (rightmost coordinate).
428
+ * @param bottom Specify the rectangle (bottommost coordinate).
429
+ */
430
+ Erase(
431
+ index: number,
432
+ left: number,
433
+ top: number,
434
+ right: number,
435
+ bottom: number
436
+ ): boolean;
288
437
  /**
289
438
  * Erase a rectangular area from the specified image.
290
439
  * @param index Specify the image.
@@ -308,7 +457,7 @@ export interface WebTwainEdit extends WebTwainBuffer {
308
457
  errorCode: number,
309
458
  errorString: string
310
459
  ) => void
311
- ): void | boolean;
460
+ ): void;
312
461
  /**
313
462
  * Copy the specified image to the clipboard of the operating system.
314
463
  * @param index Specify the image.