-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathTwainCapabilities.cs
1404 lines (1152 loc) · 59.8 KB
/
TwainCapabilities.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Этот файл является частью библиотеки Saraff.Twain.NET
* © SARAFF SOFTWARE (Кирножицкий Андрей), 2011.
* Saraff.Twain.NET - свободная программа: вы можете перераспространять ее и/или
* изменять ее на условиях Меньшей Стандартной общественной лицензии GNU в том виде,
* в каком она была опубликована Фондом свободного программного обеспечения;
* либо версии 3 лицензии, либо (по вашему выбору) любой более поздней
* версии.
* Saraff.Twain.NET распространяется в надежде, что она будет полезной,
* но БЕЗО ВСЯКИХ ГАРАНТИЙ; даже без неявной гарантии ТОВАРНОГО ВИДА
* или ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЕННЫХ ЦЕЛЕЙ. Подробнее см. в Меньшей Стандартной
* общественной лицензии GNU.
* Вы должны были получить копию Меньшей Стандартной общественной лицензии GNU
* вместе с этой программой. Если это не так, см.
* <http://www.gnu.org/licenses/>.)
*
* This file is part of Saraff.Twain.NET.
* © SARAFF SOFTWARE (Kirnazhytski Andrei), 2011.
* Saraff.Twain.NET is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Saraff.Twain.NET is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License
* along with Saraff.Twain.NET. If not, see <http://www.gnu.org/licenses/>.
*
* PLEASE SEND EMAIL TO: [email protected].
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Drawing;
using System.Diagnostics;
namespace Saraff.Twain {
/// <summary>
/// A set of capabilities
/// <para xml:lang="ru">Набор возможностей (Capabilities).</para>
/// </summary>
[DebuggerDisplay("SupportedCaps = {SupportedCaps.Get().Count}")]
public sealed class TwainCapabilities : MarshalByRefObject {
private Dictionary<TwCap, Type> _caps = new Dictionary<TwCap, Type>();
internal TwainCapabilities(Twain32 twain) {
MethodInfo _сreateCapability = typeof(TwainCapabilities).GetMethod("CreateCapability", BindingFlags.Instance | BindingFlags.NonPublic);
foreach(PropertyInfo _prop in typeof(TwainCapabilities).GetProperties()) {
object[] _attrs = _prop.GetCustomAttributes(typeof(CapabilityAttribute), false);
if(_attrs.Length > 0) {
CapabilityAttribute _attr = _attrs[0] as CapabilityAttribute;
this._caps.Add(_attr.Cap, _prop.PropertyType);
_prop.SetValue(this, _сreateCapability.MakeGenericMethod(_prop.PropertyType.GetGenericArguments()[0]).Invoke(this, new object[] { twain, _attr.Cap }), null);
}
}
}
private Capability<T> CreateCapability<T>(Twain32 twain, TwCap cap) => Activator.CreateInstance(typeof(Capability<T>), new object[] { twain, cap }) as Capability<T>;
#region Properties
#region Asynchronous Device Events
/// <summary>
/// CAP_DEVICEEVENT. MSG_SET selects which events the application wants the source
/// to report; MSG_RESET resets the capability to the empty array
/// (no events set).
/// </summary>
[Capability(TwCap.DeviceEvent)]
public ICapability2<TwDE> DeviceEvent { get; private set; }
#endregion
#region Audible Alarms
/// <summary>
/// CAP_ALARMS. Turns specific audible alarms on and off.
/// </summary>
[Capability(TwCap.Alarms)]
public ICapability2<TwAL> Alarms { get; private set; }
/// <summary>
/// CAP_ALARMVOLUME. Controls the volume of a device’s audible alarm.
/// </summary>
[Capability(TwCap.AlarmVolume)]
public ICapability<int> AlarmVolume { get; private set; }
#endregion
#region Automatic Adjustments
/// <summary>
/// CAP_AUTOMATICSENSEMEDIUM. Configures a Source to check for paper in the Automatic
/// Document Feeder.
/// </summary>
[Capability(TwCap.AutomaticSenseMedium)]
public ICapability<bool> AutomaticSenseMedium { get; private set; }
/// <summary>
/// ICAP_AUTODISCARDBLANKPAGES. Discards blank pages.
/// </summary>
[Capability(TwCap.AutoDiscardBlankPages)]
public ICapability<TwBP> AutoDiscardBlankPages { get; private set; }
/// <summary>
/// ICAP_AUTOMATICBORDERDETECTION. Turns automatic border detection on and off.
/// </summary>
[Capability(TwCap.AutomaticBorderDetection)]
public ICapability<bool> AutomaticBorderDetection { get; private set; }
/// <summary>
/// ICAP_AUTOMATICCOLORENABLED. Detects the pixel type of the image and returns either a color
/// image or a non-color image specified by
/// ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE.
/// </summary>
[Capability(TwCap.AutomaticColorEnabled)]
public ICapability<bool> AutomaticColorEnabled { get; private set; }
/// <summary>
/// ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE. Specifies the non-color pixel type to use when automatic color
/// is enabled.
/// </summary>
[Capability(TwCap.AutomaticColorNonColorPixelType)]
public ICapability<TwPixelType> AutomaticColorNonColorPixelType { get; private set; }
/// <summary>
/// ICAP_AUTOMATICCROPUSESFRAME. Reduces the amount of data captured from the device,
/// potentially improving the performance of the driver.
/// </summary>
[Capability(TwCap.AutomaticCropUsesFrame)]
public ICapability<bool> AutomaticCropUsesFrame { get; private set; }
/// <summary>
/// ICAP_AUTOMATICDESKEW. Turns automatic skew correction on and off.
/// </summary>
[Capability(TwCap.AutomaticDeskew)]
public ICapability<bool> AutomaticDeskew { get; private set; }
/// <summary>
/// ICAP_AUTOMATICLENGTHDETECTION. Controls the automatic detection of the length of a document,
/// this is intended for use with an Automatic Document Feeder.
/// </summary>
[Capability(TwCap.AutomaticLengthDetection)]
public ICapability<bool> AutomaticLengthDetection { get; private set; }
/// <summary>
/// ICAP_AUTOMATICROTATE. When TRUE, depends on source to automatically rotate the
/// image.
/// </summary>
[Capability(TwCap.AutomaticRotate)]
public ICapability<bool> AutomaticRotate { get; private set; }
/// <summary>
/// ICAP_AUTOSIZE. Force the output image dimensions to match either the current
/// value of ICAP_SUPPORTEDSIZES or any of its current allowed
/// values.
/// </summary>
[Capability(TwCap.AutoSize)]
public ICapability<TwAS> AutoSize { get; private set; }
/// <summary>
/// ICAP_FLIPROTATION. Orients images that flip orientation every other image.
/// </summary>
[Capability(TwCap.FlipRotation)]
public ICapability<TwFR> FlipRotation { get; private set; }
/// <summary>
/// ICAP_IMAGEMERGE. Merges the front and rear image of a document in one of four
/// orientations: front on the top.
/// </summary>
[Capability(TwCap.ImageMerge)]
public ICapability<TwIM> ImageMerge { get; private set; }
/// <summary>
/// ICAP_IMAGEMERGEHEIGHTTHRESHOLD. Specifies a Y-Offset in ICAP_UNITS units.
/// </summary>
[Capability(TwCap.ImageMergeHeightThreshold)]
public ICapability<float> ImageMergeHeightThreshold { get; private set; }
#endregion
#region Automatic Capture
/// <summary>
/// CAP_AUTOMATICCAPTURE. Specifies the number of images to automatically capture.
/// </summary>
[Capability(TwCap.AutomaticCapture)]
public ICapability<int> AutomaticCapture { get; private set; }
/// <summary>
/// CAP_TIMEBEFOREFIRSTCAPTURE. Selects the number of seconds before the first picture taken.
/// </summary>
[Capability(TwCap.TimeBeforeFirstCapture)]
public ICapability<int> TimeBeforeFirstCapture { get; private set; }
/// <summary>
/// CAP_TIMEBETWEENCAPTURES. Selects the hundredths of a second to wait between pictures
/// taken.
/// </summary>
[Capability(TwCap.TimeBetweenCaptures)]
public ICapability<int> TimeBetweenCaptures { get; private set; }
#endregion
#region Automatic Scanning
/// <summary>
/// CAP_AUTOSCAN. Enables the source’s automatic document scanning process.
/// </summary>
[Capability(TwCap.AutoScan)]
public ICapability<bool> AutoScan { get; private set; }
/// <summary>
/// CAP_CAMERAENABLED. Delivers images from the current camera.
/// </summary>
[Capability(TwCap.CameraEnabled)]
public ICapability<bool> CameraEnabled { get; private set; }
/// <summary>
/// CAP_CAMERAORDER. Selects the order of output for Single Document Multiple Image
/// mode.
/// </summary>
[Capability(TwCap.CameraOrder)]
public ICapability2<TwPixelType> CameraOrder { get; private set; }
/// <summary>
/// CAP_CAMERASIDE. Sets the top and bottom values of cameras in a scanning device.
/// </summary>
[Capability(TwCap.CameraSide)]
public ICapability<TwCS> CameraSide { get; private set; }
/// <summary>
/// CAP_CLEARBUFFERS. MSG_GET reports presence of data in scanner’s buffers;
/// MSG_SET clears the buffers.
/// </summary>
[Capability(TwCap.ClearBuffers)]
public ICapability<TwCB> ClearBuffers { get; private set; }
/// <summary>
/// CAP_MAXBATCHBUFFERS. Describes the number of pages that the scanner can buffer when
/// CAP_AUTOSCAN is enabled.
/// </summary>
[Capability(TwCap.MaxBatchBuffers)]
public ICapability<uint> MaxBatchBuffers { get; private set; }
#endregion
#region Bar Code Detection Search Parameters
/// <summary>
/// ICAP_BARCODEDETECTIONENABLED. Turns bar code detection on and off.
/// </summary>
[Capability(TwCap.BarCodeDetectionEnabled)]
public ICapability<bool> BarCodeDetectionEnabled { get; private set; }
/// <summary>
/// ICAP_SUPPORTEDBARCODETYPES. Provides a list of bar code types that can be detected by current
/// data source.
/// </summary>
[Capability(TwCap.SupportedBarCodeTypes)]
public ICapability2<TwBT> SupportedBarCodeTypes { get; private set; }
/// <summary>
/// ICAP_BARCODEMAXRETRIES. Restricts the number of times a search will be retried if no bar
/// codes are found.
/// </summary>
[Capability(TwCap.BarCodeMaxRetries)]
public ICapability<uint> BarCodeMaxRetries { get; private set; }
/// <summary>
/// ICAP_BARCODEMAXSEARCHPRIORITIES. Specifies the maximum number of supported search priorities.
/// </summary>
[Capability(TwCap.BarCodeMaxSearchPriorities)]
public ICapability<uint> BarCodeMaxSearchPriorities { get; private set; }
/// <summary>
/// ICAP_BARCODESEARCHMODE. Restricts bar code searching to certain orientations, or
/// prioritizes one orientation over another.
/// </summary>
[Capability(TwCap.BarCodeSearchMode)]
public ICapability<TwBD> BarCodeSearchMode { get; private set; }
/// <summary>
/// ICAP_BARCODESEARCHPRIORITIES A prioritized list of bar code types dictating the order in which
/// they will be sought.
/// </summary>
[Capability(TwCap.BarCodeSearchPriorities)]
public ICapability2<TwBT> BarCodeSearchPriorities { get; private set; }
/// <summary>
/// ICAP_BARCODETIMEOUT. Restricts the total time spent on searching for bar codes on a
/// page.
/// </summary>
[Capability(TwCap.BarCodeTimeout)]
public ICapability<uint> BarCodeTimeout { get; private set; }
#endregion
#region Capability Negotiation Parameters
/// <summary>
/// CAP_SUPPORTEDCAPS. Inquire Source’s capabilities valid for MSG_GET.
/// </summary>
[Capability(TwCap.SupportedCaps)]
public ICapability2<TwCap> SupportedCaps { get; private set; }
#endregion
#region Color
/// <summary>
/// ICAP_COLORMANAGEMENTENABLED. Disables the Source’s color and gamma tables for color and
/// grayscale images, resulting in output that that could be termed “raw”.
/// </summary>
[Capability(TwCap.ColorManagementEnabled)]
public ICapability<bool> ColorManagementEnabled { get; private set; }
/// <summary>
/// ICAP_FILTER. Color characteristics of the subtractive filter applied to the
/// image data.
/// </summary>
[Capability(TwCap.Filter)]
public ICapability2<TwFT> Filter { get; private set; }
/// <summary>
/// ICAP_GAMMA. Gamma correction value for the image data.
/// </summary>
[Capability(TwCap.Gamma)]
public ICapability<float> Gamma { get; private set; }
/// <summary>
/// ICAP_ICCPROFILE. Embeds or links ICC profiles into files.
/// </summary>
[Capability(TwCap.IccProfile)]
public ICapability<TwIC> IccProfile { get; private set; }
/// <summary>
/// ICAP_PLANARCHUNKY. Color data format - Planar or Chunky.
/// </summary>
[Capability(TwCap.PlanarChunky)]
public ICapability<TwPC> PlanarChunky { get; private set; }
#endregion
#region Compression
/// <summary>
/// ICAP_BITORDERCODES. CCITT Compression.
/// </summary>
[Capability(TwCap.BitOrderCodes)]
public ICapability<TwBO> BitOrderCodes { get; private set; }
/// <summary>
/// ICAP_CCITTKFACTOR. CCITT Compression.
/// </summary>
[Capability(TwCap.CcittKFactor)]
public ICapability<ushort> CcittKFactor { get; private set; }
/// <summary>
/// ICAP_COMPRESSION. Compression method for Buffered Memory Transfers.
/// </summary>
[Capability(TwCap.ICompression)]
public ICapability<TwCompression> Compression { get; private set; }
/// <summary>
/// ICAP_JPEGPIXELTYPE. JPEG Compression.
/// </summary>
[Capability(TwCap.JpegPixelType)]
public ICapability<TwPixelType> JpegPixelType { get; private set; }
/// <summary>
/// ICAP_JPEGQUALITY. JPEG quality.
/// </summary>
[Capability(TwCap.JpegQuality)]
public ICapability<TwJQ> JpegQuality { get; private set; }
/// <summary>
/// ICAP_JPEGSUBSAMPLING. JPEG subsampling.
/// </summary>
[Capability(TwCap.JpegSubSampling)]
public ICapability<TwJS> JpegSubSampling { get; private set; }
/// <summary>
/// ICAP_PIXELFLAVORCODES. CCITT Compression.
/// </summary>
[Capability(TwCap.PixelFlavor)]
public ICapability<TwPF> PixelFlavor { get; private set; }
/// <summary>
/// ICAP_TIMEFILL. CCITT Compression.
/// </summary>
[Capability(TwCap.TimeFill)]
public ICapability<ushort> TimeFill { get; private set; }
#endregion
#region Device Parameters
/// <summary>
/// CAP_DEVICEONLINE. Determines if hardware is on and ready.
/// </summary>
[Capability(TwCap.DeviceOnline)]
public ICapability<bool> DeviceOnline { get; private set; }
/// <summary>
/// CAP_DEVICETIMEDATE. Date and time of a device’s clock.
/// </summary>
[Capability(TwCap.DeviceTimeDate)] // TW_STR32
public ICapability<string> DeviceTimeDate { get; private set; }
/// <summary>
/// CAP_SERIALNUMBER. The serial number of the currently selected source device.
/// </summary>
[Capability(TwCap.SerialNumber)] // TW_STR255
public ICapability<string> SerialNumber { get; private set; }
/// <summary>
/// ICAP_MINIMUMHEIGHT Allows the source to define the minimum height (Y-axis) that
/// the source can acquire.
/// </summary>
[Capability(TwCap.MinimumHeight)]
public ICapability<float> MinimumHeight { get; private set; }
/// <summary>
/// ICAP_MINIMUMWIDTH Allows the source to define the minimum width (X-axis) that
/// the source can acquire.
/// </summary>
[Capability(TwCap.MinimumWidth)]
public ICapability<float> MinimumWidth { get; private set; }
/// <summary>
/// ICAP_EXPOSURETIME. Exposure time used to capture the image, in seconds.
/// </summary>
[Capability(TwCap.ExposureTime)]
public ICapability<float> ExposureTime { get; private set; }
/// <summary>
/// ICAP_FLASHUSED2. For devices that support a flash, MSG_SET selects the flash to be
/// used; MSG_GET reports the current setting.
/// </summary>
[Capability(TwCap.FlashUsed2)]
public ICapability<TwFL> FlashUsed2 { get; private set; }
/// <summary>
/// ICAP_IMAGEFILTER. For devices that support image filtering, selects the algorithm to
/// be used.
/// </summary>
[Capability(TwCap.ImageFilter)]
public ICapability<TwIF> ImageFilter { get; private set; }
/// <summary>
/// ICAP_LAMPSTATE. Is the lamp on?
/// </summary>
[Capability(TwCap.LampState)]
public ICapability<bool> LampState { get; private set; }
/// <summary>
/// ICAP_LIGHTPATH. Image was captured transmissively or reflectively.
/// </summary>
[Capability(TwCap.LightPath)]
public ICapability<TwLP> LightPath { get; private set; }
/// <summary>
/// ICAP_LIGHTSOURCE. Describes the color characteristic of the light source used to
/// acquire the image.
/// </summary>
[Capability(TwCap.LightSource)]
public ICapability<TwLS> LightSource { get; private set; }
/// <summary>
/// ICAP_NOISEFILTER. For devices that support noise filtering, selects the algorithm to
/// be used.
/// </summary>
[Capability(TwCap.NoiseFilter)]
public ICapability<TwNF> NoiseFilter { get; private set; }
/// <summary>
/// ICAP_OVERSCAN. For devices that support overscanning, controls whether
/// additional rows or columns are appended to the image.
/// </summary>
[Capability(TwCap.OverScan)]
public ICapability<TwOV> OverScan { get; private set; }
/// <summary>
/// ICAP_PHYSICALHEIGHT. Maximum height Source can acquire (in ICAP_UNITS).
/// </summary>
[Capability(TwCap.PhysicalHeight)]
public ICapability<float> PhysicalHeight { get; private set; }
/// <summary>
/// ICAP_PHYSICALWIDTH. Maximum width Source can acquire (in ICAP_UNITS).
/// </summary>
[Capability(TwCap.PhysicalWidth)]
public ICapability<float> PhysicalWidth { get; private set; }
/// <summary>
/// ICAP_UNITS. Unit of measure (inches, centimeters, etc.).
/// </summary>
[Capability(TwCap.IUnits)]
public ICapability<TwUnits> Units { get; private set; }
/// <summary>
/// ICAP_ZOOMFACTOR. With MSG_GET, returns all camera supported lens zooming
/// range.
/// </summary>
[Capability(TwCap.ZoomFactor)]
public ICapability<short> ZoomFactor { get; private set; }
#endregion
#region Doublefeed Detection
/// <summary>
/// CAP_DOUBLEFEEDDETECTION. Control DFD functionality.
/// </summary>
[Capability(TwCap.DoubleFeedDetection)]
public ICapability2<TwDF> DoubleFeedDetection { get; private set; }
/// <summary>
/// CAP_DOUBLEFEEDDETECTIONLENGTH. Set the minimum length.
/// </summary>
[Capability(TwCap.DoubleFeedDetectionLength)]
public ICapability<float> DoubleFeedDetectionLength { get; private set; }
/// <summary>
/// CAP_DOUBLEFEEDDETECTIONSENSITIVITY. Set detector sensitivity.
/// </summary>
[Capability(TwCap.DoubleFeedDetectionSensitivity)]
public ICapability<TwUS> DoubleFeedDetectionSensitivity { get; private set; }
/// <summary>
/// CAP_DOUBLEFEEDDETECTIONRESPONSE. Describe Source behavior in case of DFD.
/// </summary>
[Capability(TwCap.DoubleFeedDetectionResponse)]
public ICapability2<TwDP> DoubleFeedDetectionResponse { get; private set; }
#endregion
#region Imprinter/Endorser Functionality
/// <summary>
/// CAP_ENDORSER. Allows the application to specify the starting endorser / imprinter number.
/// </summary>
[Capability(TwCap.Endorser)]
public ICapability<uint> Endorser { get; private set; }
/// <summary>
/// CAP_PRINTER. MSG_GET returns current list of available printer devices;
/// MSG_SET selects the device for negotiation.
/// </summary>
[Capability(TwCap.Printer)]
public ICapability<TwPR> Printer { get; private set; }
/// <summary>
/// CAP_PRINTERENABLED. Turns the current CAP_PRINTER device on or off.
/// </summary>
[Capability(TwCap.PrinterEnabled)]
public ICapability<bool> PrinterEnabled { get; private set; }
/// <summary>
/// CAP_PRINTERINDEX. Starting number for the CAP_PRINTER device.
/// </summary>
[Capability(TwCap.PrinterIndex)]
public ICapability<uint> PrinterIndex { get; private set; }
/// <summary>
/// CAP_PRINTERMODE. Specifies appropriate current CAP_PRINTER device mode.
/// </summary>
[Capability(TwCap.PrinterMode)]
public ICapability<TwPM> PrinterMode { get; private set; }
/// <summary>
/// CAP_PRINTERSTRING. String(s) to be used in the string component when
/// CAP_PRINTER device is enabled.
/// </summary>
[Capability(TwCap.PrinterString)] // TW_STR255
public ICapability<string> PrinterString { get; private set; }
/// <summary>
/// CAP_PRINTERSUFFIX. String to be used as current CAP_PRINTER device’s suffix.
/// </summary>
[Capability(TwCap.PrinterSuffix)] // TW_STR255
public ICapability<string> PrinterSuffix { get; private set; }
/// <summary>
/// CAP_PRINTERVERTICALOFFSET. Y-Offset for current CAP_PRINTER device.
/// </summary>
[Capability(TwCap.PrinterVerticalOffset)]
public ICapability<float> PrinterVerticalOffset { get; private set; }
#endregion
#region Image Information
/// <summary>
/// CAP_AUTHOR. Author of acquired image (may include a copyright string).
/// </summary>
[Capability(TwCap.Author)] // TW_STR128
public ICapability<string> Author { get; private set; }
/// <summary>
/// CAP_CAPTION. General note about acquired image.
/// </summary>
[Capability(TwCap.Caption)] // TW_STR255
public ICapability<string> Caption { get; private set; }
/// <summary>
/// CAP_TIMEDATE Date and Time the image was acquired (entered State 7).
/// </summary>
[Capability(TwCap.TimeDate)] // TW_STR32
public ICapability<string> TimeDate { get; private set; }
/// <summary>
/// ICAP_EXTIMAGEINFO. Allows the application to query the data source to see if it
/// supports the new operation triplet DG_IMAGE / DAT_EXTIMAGEINFO/ MSG_GET.
/// </summary>
[Capability(TwCap.ExtImageInfo)]
public ICapability<bool> ExtImageInfo { get; private set; }
/// <summary>
/// ICAP_SUPPORTEDEXTIMAGEINFO. Lists all of the information that the Source is capable of
/// returning from a call to DAT_EXTIMAGEINFO.
/// </summary>
[Capability(TwCap.SupportedExtImageInfo)]
public ICapability2<TwEI> SupportedExtImageInfo { get; private set; }
#endregion
#region Image Parameters for Acquire
/// <summary>
/// CAP_THUMBNAILSENABLED. Allows an application to request the delivery of thumbnail
/// representations for the set of images that are to be delivered.
/// </summary>
[Capability(TwCap.ThumbnailsEnabled)]
public ICapability<bool> ThumbnailsEnabled { get; private set; }
/// <summary>
/// ICAP_AUTOBRIGHT. Enable Source’s Auto-brightness function.
/// </summary>
[Capability(TwCap.AutoBright)]
public ICapability<bool> AutoBright { get; private set; }
/// <summary>
/// ICAP_BRIGHTNESS. Source brightness values.
/// </summary>
[Capability(TwCap.Brightness)]
public ICapability<float> Brightness { get; private set; }
/// <summary>
/// ICAP_CONTRAST. Source contrast values.
/// </summary>
[Capability(TwCap.Contrast)]
public ICapability<float> Contrast { get; private set; }
/// <summary>
/// ICAP_HIGHLIGHT. Lightest highlight, values lighter than this value will be set to
/// this value.
/// </summary>
[Capability(TwCap.Highlight)]
public ICapability<float> Highlight { get; private set; }
/// <summary>
/// ICAP_IMAGEDATASET. Gets or sets the image indices that will be delivered during the
/// standard image transfer done in States 6 and 7.
/// </summary>
[Capability(TwCap.ImageDataSet)]
public ICapability2<uint> ImageDataSet { get; private set; }
/// <summary>
/// ICAP_MIRROR. Source can, or should, mirror image.
/// </summary>
[Capability(TwCap.Mirror)]
public ICapability<TwNF> Mirror { get; private set; }
/// <summary>
/// ICAP_ORIENTATION Defines which edge of the paper is the top: Portrait or
/// Landscape.
/// </summary>
[Capability(TwCap.Orientation)]
public ICapability<TwOR> Orientation { get; private set; }
/// <summary>
/// ICAP_ROTATION. Source can, or should, rotate image this number of degrees.
/// </summary>
[Capability(TwCap.Rotation)]
public ICapability<float> Rotation { get; private set; }
/// <summary>
/// ICAP_SHADOW. Darkest shadow, values darker than this value will be set to this
/// value.
/// </summary>
[Capability(TwCap.Shadow)]
public ICapability<float> Shadow { get; private set; }
/// <summary>
/// ICAP_XSCALING. Source Scaling value (1.0 = 100%) for x-axis.
/// </summary>
[Capability(TwCap.XScaling)]
public ICapability<float> XScaling { get; private set; }
/// <summary>
/// ICAP_YSCALING. Source Scaling value (1.0 = 100%) for y-axis.
/// </summary>
[Capability(TwCap.YScaling)]
public ICapability<float> YScaling { get; private set; }
#endregion
#region Image Type
/// <summary>
/// ICAP_BITDEPTH. Pixel bit depth for Current value of ICAP_PIXELTYPE.
/// </summary>
[Capability(TwCap.BitDepth)]
public ICapability<ushort> BitDepth { get; private set; }
/// <summary>
/// ICAP_BITDEPTHREDUCTION. Allows a choice of the reduction method for bit depth loss.
/// </summary>
[Capability(TwCap.BitDepthReduction)]
public ICapability<TwBR> BitDepthReduction { get; private set; }
/// <summary>
/// ICAP_BITORDER. Specifies how the bytes in an image are filled by the Source.
/// </summary>
[Capability(TwCap.BitOrder)]
public ICapability<TwBO> BitOrder { get; private set; }
/// <summary>
/// ICAP_CUSTHALFTONE. Square-cell halftone (dithering) matrix to be used.
/// </summary>
[Capability(TwCap.CustHalftone)]
public ICapability2<byte> CustHalftone { get; private set; }
/// <summary>
/// ICAP_HALFTONES. Source halftone patterns.
/// </summary>
[Capability(TwCap.Halftones)] // TW_STR32
public ICapability<string> Halftones { get; private set; }
/// <summary>
/// ICAP_PIXELTYPE. The type of pixel data (B/W, gray, color, etc.)
/// </summary>
[Capability(TwCap.IPixelType)]
public ICapability<TwPixelType> PixelType { get; private set; }
/// <summary>
/// ICAP_THRESHOLD. Specifies the dividing line between black and white values.
/// </summary>
[Capability(TwCap.Threshold)]
public ICapability<float> Threshold { get; private set; }
#endregion
#region Language Support
/// <summary>
/// CAP_LANGUAGE. Allows application and source to identify which languages they
/// have in common.
/// </summary>
[Capability(TwCap.Language)]
public ICapability<TwLanguage> Language { get; private set; }
#endregion
#region MICR
/// <summary>
/// CAP_MICRENABLED. Enables actions needed to support check scanning.
/// </summary>
[Capability(TwCap.MicrEnabled)]
public ICapability<bool> MicrEnabled { get; private set; }
#endregion
#region Pages
/// <summary>
/// CAP_SEGMENTED. Describes the segmentation setting for captured images.
/// </summary>
[Capability(TwCap.Segmented)]
public ICapability<TwSG> Segmented { get; private set; }
/// <summary>
/// ICAP_FRAMES. Size and location of frames on page.
/// </summary>
[Capability(TwCap.Frames)]
public ICapability<RectangleF> Frames { get; private set; }
/// <summary>
/// ICAP_MAXFRAMES. Maximum number of frames possible per page.
/// </summary>
[Capability(TwCap.MaxFrames)]
public ICapability<ushort> MaxFrames { get; private set; }
/// <summary>
/// ICAP_SUPPORTEDSIZES. Fixed frame sizes for typical page sizes.
/// </summary>
[Capability(TwCap.SupportedSizes)]
public ICapability<TwSS> SupportedSizes { get; private set; }
#endregion
#region Paper Handling
/// <summary>
/// CAP_AUTOFEED. MSG_SET to TRUE to enable Source’s automatic feeding.
/// </summary>
[Capability(TwCap.AutoFeed)]
public ICapability<bool> AutoFeed { get; private set; }
/// <summary>
/// CAP_CLEARPAGE. MSG_SET to TRUE to eject current page and leave acquire area empty.
/// </summary>
[Capability(TwCap.ClearPage)]
public ICapability<bool> ClearPage { get; private set; }
/// <summary>
/// CAP_DUPLEX. Indicates whether the scanner supports duplex.
/// </summary>
[Capability(TwCap.Duplex)]
public ICapability<TwDX> Duplex { get; private set; }
/// <summary>
/// CAP_DUPLEXENABLED. Enables the user to set the duplex option to be TRUE or FALSE.
/// </summary>
[Capability(TwCap.DuplexEnabled)]
public ICapability<bool> DuplexEnabled { get; private set; }
/// <summary>
/// CAP_FEEDERALIGNMENT. Indicates the alignment of the document feeder.
/// </summary>
[Capability(TwCap.FeederAlignment)]
public ICapability<TwFA> FeederAlignment { get; private set; }
/// <summary>
/// CAP_FEEDERENABLED. If TRUE, Source’s feeder is available.
/// </summary>
[Capability(TwCap.FeederEnabled)]
public ICapability<bool> FeederEnabled { get; private set; }
/// <summary>
/// CAP_FEEDERLOADED. If TRUE, Source has documents loaded in feeder (MSG_GET only).
/// </summary>
[Capability(TwCap.FeederLoaded)]
public ICapability<bool> FeederLoaded { get; private set; }
/// <summary>
/// CAP_FEEDERORDER. Specifies whether feeder starts with top of first or last page.
/// </summary>
[Capability(TwCap.FeederOrder)]
public ICapability<TwFO> FeederOrder { get; private set; }
/// <summary>
/// CAP_FEEDERPOCKET. Report what pockets are available as paper leaves a device.
/// </summary>
[Capability(TwCap.FeederPocket)]
public ICapability2<TwFP> FeederPocket { get; private set; }
/// <summary>
/// CAP_FEEDERPREP. Improve the movement of paper through a scanner ADF.
/// </summary>
[Capability(TwCap.FeederPrep)]
public ICapability<bool> FeederPrep { get; private set; }
/// <summary>
/// CAP_FEEDPAGE. MSG_SET to TRUE to eject current page and feed next page.
/// </summary>
[Capability(TwCap.FeedPage)]
public ICapability<bool> FeedPage { get; private set; }
/// <summary>
/// CAP_PAPERDETECTABLE. Determines whether source can detect documents on the ADF.
/// </summary>
[Capability(TwCap.PaperDetectable)]
public ICapability<bool> PaperDetectable { get; private set; }
/// <summary>
/// CAP_PAPERHANDLING. Control paper handling.
/// </summary>
[Capability(TwCap.PaperHandling)]
public ICapability2<TwPH> PaperHandling { get; private set; }
/// <summary>
/// CAP_REACQUIREALLOWED. Capable of acquring muliple images of the same page wihtout
/// changing the physical registraion of that page.
/// </summary>
[Capability(TwCap.ReacquireAllowed)]
public ICapability<bool> ReacquireAllowed { get; private set; }
/// <summary>
/// CAP_REWINDPAGE. MSG_SET to TRUE to do a reverse feed.
/// </summary>
[Capability(TwCap.RewindPage)]
public ICapability<bool> RewindPage { get; private set; }
/// <summary>
/// ICAP_FEEDERTYPE. Allows application to set scan parameters depending on the
/// type of feeder being used.
/// </summary>
[Capability(TwCap.FeederType)]
public ICapability<TwFE> FeederType { get; private set; }
#endregion
#region Patch Code Detection
/// <summary>
/// ICAP_PATCHCODEDETECTIONENABLED. Turns patch code detection on and off.
/// </summary>
[Capability(TwCap.PatchCodeDetectionEnabled)]
public ICapability<bool> PatchCodeDetectionEnabled { get; private set; }
/// <summary>
/// ICAP_SUPPORTEDPATCHCODETYPES. List of patch code types that can be detected by current data
/// source.
/// </summary>
[Capability(TwCap.SupportedPatchCodeTypes)]
public ICapability2<TwPch> SupportedPatchCodeTypes { get; private set; }
/// <summary>
/// ICAP_PATCHCODEMAXSEARCHPRIORITIES. Maximum number of search priorities.
/// </summary>
[Capability(TwCap.PatchCodeMaxSearchPriorities)]
public ICapability<uint> PatchCodeMaxSearchPriorities { get; private set; }
/// <summary>
/// ICAP_PATCHCODESEARCHPRIORITIES. List of patch code types dictating the order in which patch
/// codes will be sought.
/// </summary>
[Capability(TwCap.PatchCodeSearchPriorities)]
public ICapability2<TwPch> PatchCodeSearchPriorities { get; private set; }
/// <summary>
/// ICAP_PATCHCODESEARCHMODE. Restricts patch code searching to certain orientations, or
/// prioritizes one orientation over another.
/// </summary>
[Capability(TwCap.PatchCodeSearchMode)]
public ICapability<TwBD> PatchCodeSearchMode { get; private set; }
/// <summary>
/// ICAP_PATCHCODEMAXRETRIES. Restricts the number of times a search will be retried if none are
/// found on a page.
/// </summary>
[Capability(TwCap.PatchCodeMaxRetries)]
public ICapability<uint> PatchCodeMaxRetries { get; private set; }
/// <summary>
/// ICAP_PATCHCODETIMEOUT. Restricts total time for searching for a patch code on a page.
/// </summary>
[Capability(TwCap.PatchCodeTimeout)]
public ICapability<uint> PatchCodeTimeout { get; private set; }
#endregion
#region Power Monitoring
/// <summary>
/// CAP_BATTERYMINUTES. The minutes of battery power remaining on a device.
/// </summary>
[Capability(TwCap.BatteryMinutes)]
public ICapability<TwBM1> BatteryMinutes { get; private set; }
/// <summary>
/// CAP_BATTERYPERCENTAGE. With MSG_GET, indicates battery power status.
/// </summary>
[Capability(TwCap.BatteryPercentage)]
public ICapability<TwBM2> BatteryPercentage { get; private set; }
/// <summary>
/// CAP_POWERSAVETIME. With MSG_SET, sets the camera power down timer in seconds;
/// with MSG_GET, returns the current setting of the power down time.
/// </summary>
[Capability(TwCap.PowerSaveTime)]
public ICapability<int> PowerSaveTime { get; private set; }
/// <summary>
/// CAP_POWERSUPPLY. MSG_GET reports the kinds of power available;
/// MSG_GETCURRENT reports the current power supply to use.
/// </summary>
[Capability(TwCap.PowerSupply)]
public ICapability<TwPS> PowerSupply { get; private set; }
#endregion
#region Resolution
/// <summary>
/// ICAP_XNATIVERESOLUTION. Native optical resolution of device for x-axis.
/// </summary>
[Capability(TwCap.XNativeResolution)]
public ICapability<float> XNativeResolution { get; private set; }
/// <summary>
/// ICAP_XRESOLUTION. Current/Available optical resolutions for x-axis.
/// </summary>
[Capability(TwCap.XResolution)]