mirror of
https://github.com/soukoku/ntwain.git
synced 2025-10-27 04:29:03 +08:00
Cleared some CA items.
This commit is contained in:
@@ -371,42 +371,42 @@ namespace NTwain.Data
|
||||
/// Starting input value of the extended gamma function. Defines the
|
||||
/// minimum input value of channel data.
|
||||
/// </summary>
|
||||
public float StartIn { get { return _startIn; } set { _startIn = value; } }
|
||||
public float StartIn { get { return _startIn; } }//set { _startIn = value; } }
|
||||
/// <summary>
|
||||
/// Ending input value of the extended gamma function. Defines the maximum
|
||||
/// input value of channel data.
|
||||
/// </summary>
|
||||
public float BreakIn { get { return _breakIn; } set { _breakIn = value; } }
|
||||
public float BreakIn { get { return _breakIn; } }//set { _breakIn = value; } }
|
||||
/// <summary>
|
||||
/// The input value at which the transform switches from linear
|
||||
/// transformation/interpolation to gamma transformation.
|
||||
/// </summary>
|
||||
public float EndIn { get { return _endIn; } set { _endIn = value; } }
|
||||
public float EndIn { get { return _endIn; } }//set { _endIn = value; } }
|
||||
/// <summary>
|
||||
/// Starting output value of the extended gamma function. Defines the
|
||||
/// minimum output value of channel data.
|
||||
/// </summary>
|
||||
public float StartOut { get { return _startOut; } set { _startOut = value; } }
|
||||
public float StartOut { get { return _startOut; } }//set { _startOut = value; } }
|
||||
/// <summary>
|
||||
/// Ending output value of the extended gamma function. Defines the
|
||||
/// maximum output value of channel data.
|
||||
/// </summary>
|
||||
public float BreakOut { get { return _breakOut; } set { _breakOut = value; } }
|
||||
public float BreakOut { get { return _breakOut; } }//set { _breakOut = value; } }
|
||||
/// <summary>
|
||||
/// The output value at which the transform switches from linear
|
||||
/// transformation/interpolation to gamma transformation.
|
||||
/// </summary>
|
||||
public float EndOut { get { return _endOut; } set { _endOut = value; } }
|
||||
public float EndOut { get { return _endOut; } }//set { _endOut = value; } }
|
||||
/// <summary>
|
||||
/// Constant value. The exponential used in the gamma function.
|
||||
/// </summary>
|
||||
public float Gamma { get { return _gamma; } set { _gamma = value; } }
|
||||
public float Gamma { get { return _gamma; } }//set { _gamma = value; } }
|
||||
/// <summary>
|
||||
/// The number of samples in the look-up table. Includes the values of StartIn
|
||||
/// and EndIn. Zero-based index (actually, number of samples - 1). If zero, use
|
||||
/// extended gamma, otherwise use table look-up.
|
||||
/// </summary>
|
||||
public float SampleCount { get { return _sampleCount; } set { _sampleCount = value; } }
|
||||
public float SampleCount { get { return _sampleCount; } }//set { _sampleCount = value; } }
|
||||
#endregion
|
||||
|
||||
#region equals
|
||||
@@ -486,20 +486,22 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Channel-specific transform parameters.
|
||||
/// </summary>
|
||||
public TWDecodeFunction[] Decode { get { return _decode; } set { _decode = value; } }
|
||||
public TWDecodeFunction[] Decode { get { return _decode; } }//set { _decode = value; } }
|
||||
/// <summary>
|
||||
/// Flattened 3x3 matrix that specifies how channels are mixed in.
|
||||
/// </summary>
|
||||
public TWFix32[] Mix { get { return _mix; } set { _mix = value; } }
|
||||
public TWFix32[] Mix { get { return _mix; } }//set { _mix = value; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="Mix"/> value as matrix.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1814:PreferJaggedArraysOverMultidimensional", MessageId = "Body"),
|
||||
System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1814:PreferJaggedArraysOverMultidimensional", MessageId = "Return")]
|
||||
public TWFix32[,] GetMixMatrix()
|
||||
{
|
||||
// from http://stackoverflow.com/questions/3845235/convert-array-to-matrix, haven't tested it
|
||||
TWFix32[,] mat = new TWFix32[3, 3];
|
||||
TWFix32[,] mat = new TWFix32[3, 3];
|
||||
Buffer.BlockCopy(_mix, 0, mat, 0, _mix.Length * 4);
|
||||
return mat;
|
||||
}
|
||||
@@ -542,6 +544,8 @@ namespace NTwain.Data
|
||||
/// </summary>
|
||||
public partial class TWAudioInfo
|
||||
{
|
||||
internal TWAudioInfo() { }
|
||||
|
||||
/// <summary>
|
||||
/// Name of audio data.
|
||||
/// </summary>
|
||||
@@ -746,6 +750,7 @@ namespace NTwain.Data
|
||||
/// <param name="offset"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="value"></param>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
|
||||
void WriteValue(IntPtr baseAddr, ref int offset, ItemType type, object value)
|
||||
{
|
||||
switch (type)
|
||||
@@ -786,16 +791,16 @@ namespace NTwain.Data
|
||||
// WriteString(baseAddr, offset, value as string, 1024);
|
||||
// break;
|
||||
case ItemType.String128:
|
||||
WriteString(baseAddr, offset, value as string, 128);
|
||||
WriteString(baseAddr, offset, (string)value, 128);
|
||||
break;
|
||||
case ItemType.String255:
|
||||
WriteString(baseAddr, offset, value as string, 255);
|
||||
WriteString(baseAddr, offset, (string)value, 255);
|
||||
break;
|
||||
case ItemType.String32:
|
||||
WriteString(baseAddr, offset, value as string, 32);
|
||||
WriteString(baseAddr, offset, (string)value, 32);
|
||||
break;
|
||||
case ItemType.String64:
|
||||
WriteString(baseAddr, offset, value as string, 64);
|
||||
WriteString(baseAddr, offset, (string)value, 64);
|
||||
break;
|
||||
//case ItemType.Unicode512:
|
||||
// WriteUString(baseAddr, offset, value as string, 512);
|
||||
@@ -998,6 +1003,8 @@ namespace NTwain.Data
|
||||
/// </summary>
|
||||
public partial class TWCieColor
|
||||
{
|
||||
internal TWCieColor() { }
|
||||
|
||||
/// <summary>
|
||||
/// Defines the original color space that was transformed into CIE XYZ.
|
||||
/// This value is not set-able by the application.
|
||||
@@ -1042,6 +1049,7 @@ namespace NTwain.Data
|
||||
/// Values that specify the CIE 1931 (XYZ space) tri-stimulus value of inkless
|
||||
/// "paper" from which the image was acquired.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "WhitePaper")]
|
||||
public TWCiePoint WhitePaper { get { return _whitePaper; } }
|
||||
/// <summary>
|
||||
/// Values that specify the CIE 1931 (XYZ space) tri-stimulus value of solid
|
||||
@@ -1077,6 +1085,8 @@ namespace NTwain.Data
|
||||
/// </summary>
|
||||
public partial class TWDeviceEvent
|
||||
{
|
||||
internal TWDeviceEvent() { }
|
||||
|
||||
/// <summary>
|
||||
/// Defines event that has taken place.
|
||||
/// </summary>
|
||||
@@ -1330,6 +1340,8 @@ namespace NTwain.Data
|
||||
/// </summary>
|
||||
public sealed partial class TWExtImageInfo : IDisposable
|
||||
{
|
||||
internal TWExtImageInfo() { }
|
||||
|
||||
/// <summary>
|
||||
/// Number of information that application is requesting. This is filled by the
|
||||
/// application. If positive, then the application is requesting specific extended
|
||||
@@ -1723,6 +1735,8 @@ namespace NTwain.Data
|
||||
/// </summary>
|
||||
public partial class TWImageInfo
|
||||
{
|
||||
internal TWImageInfo() { }
|
||||
|
||||
/// <summary>
|
||||
/// The number of pixels per ICapUnits in the horizontal direction. The
|
||||
/// current unit is assumed to be "inches" unless it has been otherwise
|
||||
@@ -1853,6 +1867,7 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Encodes which entity releases the buffer and how the buffer is referenced.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Flags")]
|
||||
public MemoryFlags Flags { get { return (MemoryFlags)_flags; } set { _flags = (uint)value; } }
|
||||
/// <summary>
|
||||
/// The size of the buffer in bytes. Should always be an even number and wordaligned.
|
||||
@@ -1939,7 +1954,7 @@ namespace NTwain.Data
|
||||
/// image, this field would hold 0x10001000. A CMYK image could hold
|
||||
/// 0x11111111.
|
||||
/// </summary>
|
||||
public uint SubSampling { get { return _subSampling; } set { _subSampling = value; } }
|
||||
public uint Subsampling { get { return _subSampling; } set { _subSampling = value; } }
|
||||
/// <summary>
|
||||
/// Number of color components in the image to be compressed.
|
||||
/// </summary>
|
||||
@@ -2151,6 +2166,8 @@ namespace NTwain.Data
|
||||
/// </summary>
|
||||
public partial class TWSetupMemXfer
|
||||
{
|
||||
internal TWSetupMemXfer() { }
|
||||
|
||||
/// <summary>
|
||||
/// The size of the smallest transfer buffer, in bytes, that a Source can be
|
||||
/// successful with. This will typically be the number of bytes in an
|
||||
@@ -2181,10 +2198,7 @@ namespace NTwain.Data
|
||||
/// </summary>
|
||||
public partial class TWStatus
|
||||
{
|
||||
public TWStatus()
|
||||
{
|
||||
|
||||
}
|
||||
internal TWStatus() { }
|
||||
internal TWStatus(ushort code, ushort data)
|
||||
{
|
||||
_conditionCode = code;
|
||||
@@ -2232,7 +2246,7 @@ namespace NTwain.Data
|
||||
/// Gets the actual string from the pointer. This may be incorrect.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public string GetActualString()
|
||||
public string TryGetString()
|
||||
{
|
||||
if (_uTF8string != IntPtr.Zero)
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace NTwain.Data
|
||||
/// Indicates the type of container used in capability.
|
||||
/// Corresponds to TWON_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum ContainerType : ushort
|
||||
{
|
||||
Invalid = 0,
|
||||
@@ -40,10 +41,11 @@ namespace NTwain.Data
|
||||
/// Flags used in <see cref="TWMemory"/>.
|
||||
/// Corresponds to TWMF_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Flags"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
[Flags]
|
||||
public enum MemoryFlags : uint
|
||||
{
|
||||
Invalid = 0,
|
||||
None = 0,
|
||||
AppOwns = 0x1,
|
||||
DsmOwns = 0x2,
|
||||
DSOwns = 0x4,
|
||||
@@ -56,6 +58,7 @@ namespace NTwain.Data
|
||||
/// capability containers.
|
||||
/// Corresponds to TWTY_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]
|
||||
public enum ItemType : ushort
|
||||
{
|
||||
/// <summary>
|
||||
@@ -130,6 +133,7 @@ namespace NTwain.Data
|
||||
/// CapAlarms values.
|
||||
/// Corresponds to TWAL_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum AlarmType : ushort
|
||||
{
|
||||
Alarm = 0,
|
||||
@@ -147,6 +151,7 @@ namespace NTwain.Data
|
||||
/// ICapAutoSize values.
|
||||
/// Corresponds to TWAS_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum AutoSize : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -159,6 +164,7 @@ namespace NTwain.Data
|
||||
/// reference to a Western-style interpretation of the image.
|
||||
/// Corresponds to TWBCOR_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum BarcodeRotation : uint
|
||||
{
|
||||
/// <summary>
|
||||
@@ -188,6 +194,7 @@ namespace NTwain.Data
|
||||
/// ICapPatchCodeSearchMode values.
|
||||
/// Corresponds to TWBD_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum BarcodeDirection : ushort
|
||||
{
|
||||
Horz = 0,
|
||||
@@ -200,6 +207,7 @@ namespace NTwain.Data
|
||||
/// ICapBitOrder/ICapBitOrderCodes values.
|
||||
/// Corresponds to TWBO_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum BitOrder : ushort
|
||||
{
|
||||
LsbFirst = 0,
|
||||
@@ -210,6 +218,7 @@ namespace NTwain.Data
|
||||
/// ICapAutoDiscardBlankPages values.
|
||||
/// Corresponds to TWBP_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum BlankPage : short
|
||||
{
|
||||
Invalid = 0,
|
||||
@@ -221,6 +230,7 @@ namespace NTwain.Data
|
||||
/// Values for ICapBitDepthReduction.
|
||||
/// Corresponds to TWBR_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum BitDepthReduction : ushort
|
||||
{
|
||||
Threshold = 0,
|
||||
@@ -235,6 +245,7 @@ namespace NTwain.Data
|
||||
/// ICapSupportedBarcodeTypes values.
|
||||
/// Corresponds to TWBT_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum BarcodeType : ushort
|
||||
{
|
||||
ThreeOfNine = 0,
|
||||
@@ -266,6 +277,7 @@ namespace NTwain.Data
|
||||
/// setting the desired file format with ICAP_IMAGEFILEFORMAT.
|
||||
/// Corresponds to TWCP_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum CompressionType : ushort
|
||||
{
|
||||
/// <summary>
|
||||
@@ -334,6 +346,7 @@ namespace NTwain.Data
|
||||
/// CapCameraSide/TWEI_PAGESIDE values.
|
||||
/// Corresponds to TWCS_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum CameraSide : ushort
|
||||
{
|
||||
Both = 0,
|
||||
@@ -345,6 +358,7 @@ namespace NTwain.Data
|
||||
/// CapClearBuffers values.
|
||||
/// Corresponds to TWCB_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum ClearBuffer : ushort
|
||||
{
|
||||
Auto = 0,
|
||||
@@ -358,6 +372,7 @@ namespace NTwain.Data
|
||||
/// a cap value it's ushort.
|
||||
/// Corresponds to TWDE_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]
|
||||
public enum DeviceEvent : uint // using uint to support custom event values
|
||||
{
|
||||
CheckAutomaticCapture = 0,
|
||||
@@ -396,6 +411,7 @@ namespace NTwain.Data
|
||||
/// TWEI_DESKEWSTATUS values.
|
||||
/// Corresponds to TWDSK_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum DeskewStatus : uint
|
||||
{
|
||||
Success = 0,
|
||||
@@ -408,6 +424,7 @@ namespace NTwain.Data
|
||||
/// CapDuplex values.
|
||||
/// Corresponds to TWDX_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum Duplex : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -419,6 +436,7 @@ namespace NTwain.Data
|
||||
/// CapFeederAlignment values.
|
||||
/// Corresponds to TWFA_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum FeederAlignment : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -431,6 +449,7 @@ namespace NTwain.Data
|
||||
/// ICapFeederType values.
|
||||
/// Corresponds to TWFE_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum FeederType : ushort
|
||||
{
|
||||
General = 0,
|
||||
@@ -441,6 +460,7 @@ namespace NTwain.Data
|
||||
/// ICapImageFileFormat values.
|
||||
/// Corresponds to TWFF_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]
|
||||
public enum FileFormat : ushort
|
||||
{
|
||||
/// <summary>
|
||||
@@ -513,19 +533,21 @@ namespace NTwain.Data
|
||||
/// ICapFlashUsed2 values.
|
||||
/// Corresponds to TWFL_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum FlashedUsed : ushort
|
||||
{
|
||||
None = 0,
|
||||
Off = 1,
|
||||
On = 2,
|
||||
Auto = 3,
|
||||
RedEye = 4
|
||||
Redeye = 4
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CapFeederOrder values.
|
||||
/// Corresponds to TWFO_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum FeederOrder : ushort
|
||||
{
|
||||
FirstPageFirst = 0,
|
||||
@@ -536,6 +558,7 @@ namespace NTwain.Data
|
||||
/// CapFeederPocket values.
|
||||
/// Corresponds to TWFP_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum FeederPocket : ushort
|
||||
{
|
||||
PocketError = 0,
|
||||
@@ -561,16 +584,18 @@ namespace NTwain.Data
|
||||
/// ICapFlipRotation values.
|
||||
/// Corresponds to TWFR_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum FlipRotation : ushort
|
||||
{
|
||||
Book = 0,
|
||||
FanFold = 1
|
||||
Fanfold = 1
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ICapFilter values.
|
||||
/// Corresponds to TWFT_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum FilterType : ushort
|
||||
{
|
||||
Red = 0,
|
||||
@@ -605,6 +630,7 @@ namespace NTwain.Data
|
||||
/// ICapIccProfile values.
|
||||
/// Corresponds to TWIC* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum IccProfile : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -616,6 +642,7 @@ namespace NTwain.Data
|
||||
/// ICapImageFilter values.
|
||||
/// Corresponds to TWIF_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum ImageFilter : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -631,12 +658,17 @@ namespace NTwain.Data
|
||||
/// ICapImageMerge values.
|
||||
/// Corresponds to TWIM_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum ImageMerge : ushort
|
||||
{
|
||||
None = 0,
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "FrontOn")]
|
||||
FrontOnTop = 1,
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "FrontOn")]
|
||||
FrontOnBottom = 2,
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "FrontOn")]
|
||||
FrontOnLeft = 3,
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "FrontOn")]
|
||||
FrontOnRight = 4
|
||||
}
|
||||
|
||||
@@ -644,6 +676,7 @@ namespace NTwain.Data
|
||||
/// CapJobControl values.
|
||||
/// Corresponds to TWJC_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum JobControl : ushort
|
||||
{
|
||||
/// <summary>
|
||||
@@ -672,6 +705,7 @@ namespace NTwain.Data
|
||||
/// ICapJpegQuality values.
|
||||
/// Corresponds to TWJQ_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum JpegQuality : short
|
||||
{
|
||||
Invalid = 0,
|
||||
@@ -685,6 +719,7 @@ namespace NTwain.Data
|
||||
/// ICapLightPath values.
|
||||
/// Corresponds to TWLP_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum LightPath : ushort
|
||||
{
|
||||
Reflective = 0,
|
||||
@@ -695,6 +730,7 @@ namespace NTwain.Data
|
||||
/// ICapLightSource values.
|
||||
/// Corresponds to TWLS_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum LightSource : ushort
|
||||
{
|
||||
Red = 0,
|
||||
@@ -710,6 +746,7 @@ namespace NTwain.Data
|
||||
/// TWEI_MAGTYPE values.
|
||||
/// Corresponds to TWMD_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum MagType : ushort
|
||||
{
|
||||
Micr = 0,
|
||||
@@ -721,6 +758,7 @@ namespace NTwain.Data
|
||||
/// ICapNoiseFilter values.
|
||||
/// Corresponds to TWNF_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum NoiseFilter : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -733,6 +771,7 @@ namespace NTwain.Data
|
||||
/// ICapOrientation values.
|
||||
/// Corresponds to TWOR_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum OrientationType : ushort
|
||||
{
|
||||
Rot0 = 0,
|
||||
@@ -750,6 +789,7 @@ namespace NTwain.Data
|
||||
/// ICapOverscan values.
|
||||
/// Corresponds to TWOV_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum OverScan : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -763,6 +803,7 @@ namespace NTwain.Data
|
||||
/// <see cref="TWPalette8.PaletteType"/> values.
|
||||
/// Corresponds to TWPA_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum PaletteType : ushort
|
||||
{
|
||||
Rgb = 0,
|
||||
@@ -774,6 +815,7 @@ namespace NTwain.Data
|
||||
/// ICapPlanarChunky values.
|
||||
/// Corresponds to TWPC_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum PlanarChunky : ushort
|
||||
{
|
||||
Chunky = 0,
|
||||
@@ -785,6 +827,7 @@ namespace NTwain.Data
|
||||
/// ICapSupportedPatchCodeTypes values.
|
||||
/// Corresponds to TWPCH_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum PatchCode : ushort
|
||||
{
|
||||
Patch1 = 0,
|
||||
@@ -799,6 +842,7 @@ namespace NTwain.Data
|
||||
/// ICapPixelFlavor, ICapPixelFlavorCodes values.
|
||||
/// Corresponds to TWPF_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum PixelFlavor : ushort
|
||||
{
|
||||
Chocolate = 0,
|
||||
@@ -809,9 +853,11 @@ namespace NTwain.Data
|
||||
/// CapPrinterMode values.
|
||||
/// Corresponds to TWPM_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum PrinterMode : ushort
|
||||
{
|
||||
SingleString = 0,
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "MultiString")]
|
||||
MultiString = 1,
|
||||
CompoundString = 2
|
||||
}
|
||||
@@ -820,6 +866,7 @@ namespace NTwain.Data
|
||||
/// CapPrinter values.
|
||||
/// Corresponds to TWPR_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum Printer : ushort
|
||||
{
|
||||
ImprinterTopBefore = 0,
|
||||
@@ -836,6 +883,7 @@ namespace NTwain.Data
|
||||
/// CapPrinterFontStyle values.
|
||||
/// Corresponds to TWPF_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum PrinterFontStyle : ushort
|
||||
{
|
||||
Normal = 0,
|
||||
@@ -849,6 +897,7 @@ namespace NTwain.Data
|
||||
/// CapPrinterIndexTrigger values.
|
||||
/// Corresponds to TWCT_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum PrinterIndexTrigger : ushort
|
||||
{
|
||||
Page = 0,
|
||||
@@ -864,6 +913,7 @@ namespace NTwain.Data
|
||||
/// CapPowerSupply values.
|
||||
/// Corresponds to TWPS_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum PowerSupply : ushort
|
||||
{
|
||||
External = 0,
|
||||
@@ -875,6 +925,7 @@ namespace NTwain.Data
|
||||
/// ICapJpegPixelType, ICapPixelType values.
|
||||
/// Corresponds to TWPT_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]
|
||||
public enum PixelType : ushort
|
||||
{
|
||||
BlackWhite = 0,
|
||||
@@ -896,6 +947,7 @@ namespace NTwain.Data
|
||||
/// CapSegmented values.
|
||||
/// Corresponds to TWSG_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum Segmented : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -907,6 +959,7 @@ namespace NTwain.Data
|
||||
/// ICapFilmType values.
|
||||
/// Corresponds to TWFM_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum FilmType : ushort
|
||||
{
|
||||
Positive = 0,
|
||||
@@ -917,9 +970,10 @@ namespace NTwain.Data
|
||||
/// CapDoubleFeedDetection values.
|
||||
/// Corresponds to TWDF_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum DoubleFeedDetection : ushort
|
||||
{
|
||||
UltraSonic = 0,
|
||||
Ultrasonic = 0,
|
||||
ByLength = 1,
|
||||
Infrared = 2
|
||||
}
|
||||
@@ -928,6 +982,7 @@ namespace NTwain.Data
|
||||
/// CapDoubleFeedDetectionSensitivity values.
|
||||
/// Corresponds to TWUS_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum DoubleFeedDetectionSensitivity : ushort
|
||||
{
|
||||
Low = 0,
|
||||
@@ -939,6 +994,7 @@ namespace NTwain.Data
|
||||
/// CapDoubleFeedDetectionResponse values.
|
||||
/// Corresponds to TWDP_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum DoubleFeedDetectionResponse : ushort
|
||||
{
|
||||
Stop = 0,
|
||||
@@ -951,6 +1007,7 @@ namespace NTwain.Data
|
||||
/// ICapMirror values.
|
||||
/// Corresponds to TWMR* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum Mirror : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -959,10 +1016,11 @@ namespace NTwain.Data
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ICapJpegSubSampling values.
|
||||
/// ICapJpegSubsampling values.
|
||||
/// Corresponds to TWJS_* values.
|
||||
/// </summary>
|
||||
public enum JpegSubSampling : ushort
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum JpegSubsampling : ushort
|
||||
{
|
||||
x444YCBCR = 0,
|
||||
x444RGB = 1,
|
||||
@@ -978,12 +1036,13 @@ namespace NTwain.Data
|
||||
/// CapPaperHandling values.
|
||||
/// Corresponds to TWPH_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum PaperHandling : ushort
|
||||
{
|
||||
Normal = 0,
|
||||
Fragile = 1,
|
||||
Thick = 2,
|
||||
TriFold = 3,
|
||||
Trifold = 3,
|
||||
Photograph = 4
|
||||
}
|
||||
|
||||
@@ -991,6 +1050,7 @@ namespace NTwain.Data
|
||||
/// CapIndicatorsMode values.
|
||||
/// Corresponds to TWCI_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum IndicatorsMode : ushort
|
||||
{
|
||||
Info = 0,
|
||||
@@ -1003,6 +1063,7 @@ namespace NTwain.Data
|
||||
/// ICapSupportedSizes values.
|
||||
/// Corresponds to TWSS_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum SupportedSize : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -1065,6 +1126,7 @@ namespace NTwain.Data
|
||||
/// ICapXferMech, ACapXferMech values.
|
||||
/// Corresponds to TWSX_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]
|
||||
public enum XferMech : ushort
|
||||
{
|
||||
Native = 0,
|
||||
@@ -1077,6 +1139,7 @@ namespace NTwain.Data
|
||||
/// ICapUnits values.
|
||||
/// Corresponds to TWUN_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum Unit : ushort
|
||||
{
|
||||
Inches = 0,
|
||||
@@ -1097,6 +1160,7 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Corresponds to TWCY_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum Country : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -1156,6 +1220,7 @@ namespace NTwain.Data
|
||||
EasterIs = 1014,
|
||||
Ecuador = 593,
|
||||
Egypt = 20,
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "El")]
|
||||
ElSalvador = 503,
|
||||
Eqguinea = 1015,
|
||||
Ethiopia = 251,
|
||||
@@ -1344,6 +1409,7 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Corresponds to TWLG_* values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum Language : short
|
||||
{
|
||||
UserLocale = -1,
|
||||
@@ -1360,6 +1426,7 @@ namespace NTwain.Data
|
||||
Portuguese = 10,
|
||||
Spanish = 11,
|
||||
Swedish = 12,
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "USA")]
|
||||
EnglishUSA = 13,
|
||||
Afrikaans = 14,
|
||||
Albania = 15,
|
||||
@@ -1467,7 +1534,8 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Corresponds to DG_*.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2217:DoNotMarkEnumsWithFlags"), Flags]
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2217:DoNotMarkEnumsWithFlags")]
|
||||
[Flags]
|
||||
public enum DataGroups : uint
|
||||
{
|
||||
None = 0,
|
||||
@@ -1480,6 +1548,7 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Corresponds to DF_*.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
[Flags]
|
||||
public enum DataFunctionalities : uint
|
||||
{
|
||||
@@ -1492,6 +1561,7 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Corresponds to DAT_*.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum DataArgumentType : ushort
|
||||
{
|
||||
Null = 0,
|
||||
@@ -1544,6 +1614,7 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Corresponds to MSG_*.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum Message : ushort
|
||||
{
|
||||
Null = 0,
|
||||
@@ -1570,8 +1641,8 @@ namespace NTwain.Data
|
||||
DeviceEvent = 0x104,
|
||||
|
||||
// Messages used with a pointer to DAT_PARENT data
|
||||
OpenDsm = 0x301,
|
||||
CloseDsm = 0x302,
|
||||
OpenDSM = 0x301,
|
||||
CloseDSM = 0x302,
|
||||
|
||||
// Messages used with a pointer to a DAT_IDENTITY structure
|
||||
OpenDS = 0x401,
|
||||
@@ -1616,6 +1687,7 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Indicates the type of capability.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum CapabilityId : ushort
|
||||
{
|
||||
None = 0,
|
||||
@@ -1749,7 +1821,7 @@ namespace NTwain.Data
|
||||
ICapBitDepth = 0x112b,
|
||||
ICapBitDepthReduction = 0x112c, /* Added 1.5 */
|
||||
ICapUndefinedImageSize = 0x112d, /* Added 1.6 */
|
||||
ICapImageDataset = 0x112e, /* Added 1.7 */
|
||||
ICapImageDataSet = 0x112e, /* Added 1.7 */
|
||||
ICapExtImageInfo = 0x112f, /* Added 1.7 */
|
||||
ICapMinimumHeight = 0x1130, /* Added 1.7 */
|
||||
ICapMinimumWidth = 0x1131, /* Added 1.7 */
|
||||
@@ -1791,7 +1863,7 @@ namespace NTwain.Data
|
||||
ICapSupportedExtImageInfo = 0x115e, /* Added 2.1 */
|
||||
ICapFilmType = 0x115f,
|
||||
ICapMirror = 0x1160,
|
||||
ICapJpegSubSampling = 0x1161,
|
||||
ICapJpegSubsampling = 0x1161,
|
||||
|
||||
/* image data sources MAY support these audio caps */
|
||||
ACapXferMech = 0x1202, /* Added 1.8 */
|
||||
@@ -1802,6 +1874,7 @@ namespace NTwain.Data
|
||||
/// Extended Image Info Attributes.
|
||||
/// Corresponds to TWEI_*.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum ExtendedImageInfo : ushort
|
||||
{
|
||||
Invalid = 0,
|
||||
@@ -1885,6 +1958,7 @@ namespace NTwain.Data
|
||||
/// EndXfer job control values.
|
||||
/// Corresponds to TWEJ_*.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum TWEJ : ushort
|
||||
{
|
||||
None = 0x0000,
|
||||
@@ -1900,6 +1974,7 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Corresponds to TWRC_*.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags")]
|
||||
public enum ReturnCode : ushort
|
||||
{
|
||||
CustomBase = 0x8000,
|
||||
@@ -1921,6 +1996,7 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Corresponds to TWCC_*.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum ConditionCode : ushort
|
||||
{
|
||||
CustomBase = 0x8000,
|
||||
@@ -1978,6 +2054,7 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// TWAIN's boolean values.
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1028:EnumStorageShouldBeInt32")]
|
||||
public enum BoolType : ushort
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -12,61 +12,62 @@ namespace NTwain.Data
|
||||
/// <summary>
|
||||
/// Reads a TWAIN value.
|
||||
/// </summary>
|
||||
/// <param name="baseAddr">The base addr.</param>
|
||||
/// <param name="baseAddress">The base address.</param>
|
||||
/// <param name="offset">The offset.</param>
|
||||
/// <param name="type">The TWAIN type.</param>
|
||||
/// <returns></returns>
|
||||
public static object ReadValue(IntPtr baseAddr, ref int offset, ItemType type)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "1#")]
|
||||
public static object ReadValue(IntPtr baseAddress, ref int offset, ItemType type)
|
||||
{
|
||||
object val = null;
|
||||
switch (type)
|
||||
{
|
||||
case ItemType.Int8:
|
||||
val = (sbyte)Marshal.ReadByte(baseAddr, offset);
|
||||
val = (sbyte)Marshal.ReadByte(baseAddress, offset);
|
||||
break;
|
||||
case ItemType.UInt8:
|
||||
val = Marshal.ReadByte(baseAddr, offset);
|
||||
val = Marshal.ReadByte(baseAddress, offset);
|
||||
break;
|
||||
case ItemType.Bool:
|
||||
case ItemType.UInt16:
|
||||
val = (ushort)Marshal.ReadInt16(baseAddr, offset);
|
||||
val = (ushort)Marshal.ReadInt16(baseAddress, offset);
|
||||
break;
|
||||
case ItemType.Int16:
|
||||
val = Marshal.ReadInt16(baseAddr, offset);
|
||||
val = Marshal.ReadInt16(baseAddress, offset);
|
||||
break;
|
||||
case ItemType.UInt32:
|
||||
val = (uint)Marshal.ReadInt32(baseAddr, offset);
|
||||
val = (uint)Marshal.ReadInt32(baseAddress, offset);
|
||||
break;
|
||||
case ItemType.Int32:
|
||||
val = Marshal.ReadInt32(baseAddr, offset);
|
||||
val = Marshal.ReadInt32(baseAddress, offset);
|
||||
break;
|
||||
case ItemType.Fix32:
|
||||
TWFix32 f32 = new TWFix32();
|
||||
f32.Whole = Marshal.ReadInt16(baseAddr, offset);
|
||||
f32.Fraction = (ushort)Marshal.ReadInt16(baseAddr, offset + 2);
|
||||
f32.Whole = Marshal.ReadInt16(baseAddress, offset);
|
||||
f32.Fraction = (ushort)Marshal.ReadInt16(baseAddress, offset + 2);
|
||||
val = f32;
|
||||
break;
|
||||
case ItemType.Frame:
|
||||
TWFrame frame = new TWFrame();
|
||||
frame.Left = (TWFix32)ReadValue(baseAddr, ref offset, ItemType.Fix32);
|
||||
frame.Top = (TWFix32)ReadValue(baseAddr, ref offset, ItemType.Fix32);
|
||||
frame.Right = (TWFix32)ReadValue(baseAddr, ref offset, ItemType.Fix32);
|
||||
frame.Bottom = (TWFix32)ReadValue(baseAddr, ref offset, ItemType.Fix32);
|
||||
frame.Left = (TWFix32)ReadValue(baseAddress, ref offset, ItemType.Fix32);
|
||||
frame.Top = (TWFix32)ReadValue(baseAddress, ref offset, ItemType.Fix32);
|
||||
frame.Right = (TWFix32)ReadValue(baseAddress, ref offset, ItemType.Fix32);
|
||||
frame.Bottom = (TWFix32)ReadValue(baseAddress, ref offset, ItemType.Fix32);
|
||||
return frame; // no need to update offset again after reading fix32
|
||||
case ItemType.String128:
|
||||
val = ReadString(baseAddr, offset, TwainConst.String128 - 2);
|
||||
val = ReadString(baseAddress, offset, TwainConst.String128 - 2);
|
||||
break;
|
||||
case ItemType.String255:
|
||||
val = ReadString(baseAddr, offset, TwainConst.String255 - 1);
|
||||
val = ReadString(baseAddress, offset, TwainConst.String255 - 1);
|
||||
break;
|
||||
case ItemType.String32:
|
||||
val = ReadString(baseAddr, offset, TwainConst.String32 - 2);
|
||||
val = ReadString(baseAddress, offset, TwainConst.String32 - 2);
|
||||
break;
|
||||
case ItemType.String64:
|
||||
val = ReadString(baseAddr, offset, TwainConst.String64 - 2);
|
||||
val = ReadString(baseAddress, offset, TwainConst.String64 - 2);
|
||||
break;
|
||||
case ItemType.Handle:
|
||||
val = new IntPtr(baseAddr.ToInt64() + offset);
|
||||
val = new IntPtr(baseAddress.ToInt64() + offset);
|
||||
break;
|
||||
}
|
||||
offset += GetItemTypeSize(type);
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace NTwain.Internals
|
||||
catch
|
||||
{
|
||||
if (win != null) { win.Dispose(); }
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace NTwain
|
||||
// in essence it only exists in 64 bit systems and thus
|
||||
// the 2 sets of identical pinvokes for windows :(
|
||||
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1810:InitializeReferenceTypeStaticFieldsInline")]
|
||||
static Platform()
|
||||
{
|
||||
IsApp64bit = IntPtr.Size == 8;
|
||||
@@ -29,6 +30,8 @@ namespace NTwain
|
||||
IsOnMono = Type.GetType("Mono.Runtime") != null;
|
||||
IsWin = Environment.OSVersion.Platform == PlatformID.Win32NT;
|
||||
IsLinux = Environment.OSVersion.Platform == PlatformID.Unix;
|
||||
|
||||
_defaultMemManager = new WinMemoryManager();
|
||||
}
|
||||
|
||||
internal static readonly bool UseNewDSM;
|
||||
@@ -61,8 +64,8 @@ namespace NTwain
|
||||
}
|
||||
|
||||
|
||||
static readonly WinMemoryManager _defaultMemManager = new WinMemoryManager();
|
||||
static IMemoryManager _specifiedMemManager = null;
|
||||
static readonly WinMemoryManager _defaultMemManager;
|
||||
static IMemoryManager _specifiedMemManager;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="IMemoryManager"/> for communicating with data sources.
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="info">The info.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Get(out TWAudioInfo info)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWAudioInfo info)
|
||||
{
|
||||
Session.VerifyState(6, 7, DataGroups.Audio, DataArgumentType.AudioInfo, Message.Get);
|
||||
info = new TWAudioInfo();
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="customData">The custom data.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Get(out TWCustomDSData customData)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWCustomDSData customData)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.CustomDSData, Message.Get);
|
||||
customData = new TWCustomDSData();
|
||||
|
||||
@@ -9,7 +9,8 @@ namespace NTwain.Triplets
|
||||
public sealed class DeviceEvent : OpBase
|
||||
{
|
||||
internal DeviceEvent(ITwainSessionInternal session) : base(session) { }
|
||||
public ReturnCode Get(out TWDeviceEvent sourceDeviceEvent)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWDeviceEvent sourceDeviceEvent)
|
||||
{
|
||||
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.DeviceEvent, Message.Get);
|
||||
sourceDeviceEvent = new TWDeviceEvent();
|
||||
|
||||
@@ -33,7 +33,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="source">The source.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode GetDefault(out TWIdentity source)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetDefault(out TWIdentity source)
|
||||
{
|
||||
Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.GetDefault);
|
||||
source = new TWIdentity();
|
||||
@@ -47,7 +48,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="source">The source.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode GetFirst(out TWIdentity source)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetFirst(out TWIdentity source)
|
||||
{
|
||||
Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.GetFirst);
|
||||
source = new TWIdentity();
|
||||
@@ -60,7 +62,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="source">The source.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode GetNext(out TWIdentity source)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetNext(out TWIdentity source)
|
||||
{
|
||||
Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.GetNext);
|
||||
source = new TWIdentity();
|
||||
@@ -103,7 +106,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="source">The source.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode UserSelect(out TWIdentity source)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode UserSelect(out TWIdentity source)
|
||||
{
|
||||
Session.VerifyState(3, 7, DataGroups.Control, DataArgumentType.Identity, Message.UserSelect);
|
||||
source = new TWIdentity();
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace NTwain.Triplets
|
||||
/// <returns></returns>
|
||||
public ReturnCode CloseDsm(IntPtr handle)
|
||||
{
|
||||
Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.Parent, Message.CloseDsm);
|
||||
var rc = Dsm.DsmEntry(Session.AppId, null, DataGroups.Control, DataArgumentType.Parent, Message.CloseDsm, ref handle);
|
||||
Session.VerifyState(3, 3, DataGroups.Control, DataArgumentType.Parent, Message.CloseDSM);
|
||||
var rc = Dsm.DsmEntry(Session.AppId, null, DataGroups.Control, DataArgumentType.Parent, Message.CloseDSM, ref handle);
|
||||
if (rc == ReturnCode.Success)
|
||||
{
|
||||
Session.ChangeState(2, true);
|
||||
@@ -39,8 +39,8 @@ namespace NTwain.Triplets
|
||||
/// <returns></returns>
|
||||
public ReturnCode OpenDsm(IntPtr handle)
|
||||
{
|
||||
Session.VerifyState(1, 2, DataGroups.Control, DataArgumentType.Parent, Message.OpenDsm);
|
||||
var rc = Dsm.DsmEntry(Session.AppId, null, DataGroups.Control, DataArgumentType.Parent, Message.OpenDsm, ref handle);
|
||||
Session.VerifyState(1, 2, DataGroups.Control, DataArgumentType.Parent, Message.OpenDSM);
|
||||
var rc = Dsm.DsmEntry(Session.AppId, null, DataGroups.Control, DataArgumentType.Parent, Message.OpenDSM, ref handle);
|
||||
if (rc == ReturnCode.Success)
|
||||
{
|
||||
Session.ChangeState(3, true);
|
||||
|
||||
@@ -6,7 +6,8 @@ namespace NTwain.Triplets
|
||||
/// <summary>
|
||||
/// Represents <see cref="DataArgumentType.SetupFileXfer"/>.
|
||||
/// </summary>
|
||||
public sealed class SetupFileXfer : OpBase
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer")]
|
||||
public sealed class SetupFileXfer : OpBase
|
||||
{
|
||||
internal SetupFileXfer(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
@@ -15,7 +16,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="setupFileXfer">The setup file xfer.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Get(out TWSetupFileXfer setupFileXfer)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWSetupFileXfer setupFileXfer)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Get);
|
||||
setupFileXfer = new TWSetupFileXfer();
|
||||
@@ -27,7 +29,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="setupFileXfer">The setup file xfer.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode GetDefault(out TWSetupFileXfer setupFileXfer)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetDefault(out TWSetupFileXfer setupFileXfer)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.GetDefault);
|
||||
setupFileXfer = new TWSetupFileXfer();
|
||||
@@ -40,7 +43,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="setupFileXfer">The setup file xfer.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Reset(out TWSetupFileXfer setupFileXfer)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Reset(out TWSetupFileXfer setupFileXfer)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Control, DataArgumentType.SetupFileXfer, Message.Reset);
|
||||
setupFileXfer = new TWSetupFileXfer();
|
||||
|
||||
@@ -6,7 +6,8 @@ namespace NTwain.Triplets
|
||||
/// <summary>
|
||||
/// Represents <see cref="DataArgumentType.SetupMemXfer"/>.
|
||||
/// </summary>
|
||||
public sealed class SetupMemXfer : OpBase
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Mem")]
|
||||
public sealed class SetupMemXfer : OpBase
|
||||
{
|
||||
internal SetupMemXfer(ITwainSessionInternal session) : base(session) { }
|
||||
/// <summary>
|
||||
@@ -15,7 +16,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="setupMemXfer">The setup mem xfer.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Get(out TWSetupMemXfer setupMemXfer)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWSetupMemXfer setupMemXfer)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.SetupMemXfer, Message.Get);
|
||||
setupMemXfer = new TWSetupMemXfer();
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="status">The status.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode GetManager(out TWStatus status)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetManager(out TWStatus status)
|
||||
{
|
||||
Session.VerifyState(2, 7, DataGroups.Control, DataArgumentType.Status, Message.Get);
|
||||
status = new TWStatus();
|
||||
@@ -26,7 +27,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="status">The status.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode GetSource(out TWStatus status)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetSource(out TWStatus status)
|
||||
{
|
||||
Session.VerifyState(4, 7, DataGroups.Control, DataArgumentType.Status, Message.Get);
|
||||
status = new TWStatus();
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "0#")]
|
||||
public ReturnCode Get(ref DataGroups value)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Control, DataArgumentType.XferGroup, Message.Get);
|
||||
|
||||
@@ -125,7 +125,8 @@ namespace NTwain.Triplets
|
||||
}
|
||||
}
|
||||
SetupFileXfer _setupFileXfer;
|
||||
public SetupFileXfer SetupFileXfer
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer")]
|
||||
public SetupFileXfer SetupFileXfer
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -134,7 +135,8 @@ namespace NTwain.Triplets
|
||||
}
|
||||
}
|
||||
SetupMemXfer _setupMemXfer;
|
||||
public SetupMemXfer SetupMemXfer
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Mem")]
|
||||
public SetupMemXfer SetupMemXfer
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -170,7 +172,8 @@ namespace NTwain.Triplets
|
||||
}
|
||||
}
|
||||
XferGroup _xferGroup;
|
||||
public XferGroup XferGroup
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Xfer")]
|
||||
public XferGroup XferGroup
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="cieColor">Color data.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Get(out TWCieColor cieColor)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWCieColor cieColor)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.CieColor, Message.Get);
|
||||
cieColor = new TWCieColor();
|
||||
|
||||
@@ -10,7 +10,8 @@ namespace NTwain.Triplets
|
||||
{
|
||||
internal ExtImageInfo(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
public ReturnCode Get(out TWExtImageInfo info)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWExtImageInfo info)
|
||||
{
|
||||
Session.VerifyState(7, 7, DataGroups.Image, DataArgumentType.ExtImageInfo, Message.Get);
|
||||
info = new TWExtImageInfo();
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="filter">The filter.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWFilter filter)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Filter, Message.Get);
|
||||
@@ -29,6 +30,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="filter">The filter.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetDefault(out TWFilter filter)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Filter, Message.GetDefault);
|
||||
@@ -53,6 +55,7 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="filter">The filter.</param>
|
||||
/// <returns></returns>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Reset(out TWFilter filter)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Filter, Message.Reset);
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="response">The response.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Reset(out TWGrayResponse response)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Reset(out TWGrayResponse response)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.GrayResponse, Message.Reset);
|
||||
response = new TWGrayResponse();
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="profile">The profile.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Get(ref TWMemory profile)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference", MessageId = "0#")]
|
||||
public ReturnCode Get(ref TWMemory profile)
|
||||
{
|
||||
Session.VerifyState(6, 7, DataGroups.Image, DataArgumentType.IccProfile, Message.Get);
|
||||
profile = new TWMemory();
|
||||
|
||||
@@ -10,7 +10,8 @@ namespace NTwain.Triplets
|
||||
{
|
||||
internal ImageInfo(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
public ReturnCode Get(out TWImageInfo info)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWImageInfo info)
|
||||
{
|
||||
Session.VerifyState(6, 7, DataGroups.Image, DataArgumentType.ImageInfo, Message.Get);
|
||||
info = new TWImageInfo();
|
||||
|
||||
@@ -10,21 +10,24 @@ namespace NTwain.Triplets
|
||||
{
|
||||
internal ImageLayout(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
public ReturnCode Get(out TWImageLayout layout)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWImageLayout layout)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.ImageLayout, Message.Get);
|
||||
layout = new TWImageLayout();
|
||||
return Dsm.DsmEntry(Session.AppId, Session.SourceId, Message.Get, layout);
|
||||
}
|
||||
|
||||
public ReturnCode GetDefault(out TWImageLayout layout)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetDefault(out TWImageLayout layout)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.ImageLayout, Message.GetDefault);
|
||||
layout = new TWImageLayout();
|
||||
return Dsm.DsmEntry(Session.AppId, Session.SourceId, Message.GetDefault, layout);
|
||||
}
|
||||
|
||||
public ReturnCode Reset(out TWImageLayout layout)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Reset(out TWImageLayout layout)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.ImageLayout, Message.Reset);
|
||||
layout = new TWImageLayout();
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="compression">The compression.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Get(out TWJpegCompression compression)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWJpegCompression compression)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.JpegCompression, Message.Get);
|
||||
compression = new TWJpegCompression();
|
||||
@@ -29,7 +30,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="compression">The compression.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode GetDefault(out TWJpegCompression compression)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetDefault(out TWJpegCompression compression)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.JpegCompression, Message.GetDefault);
|
||||
compression = new TWJpegCompression();
|
||||
@@ -41,7 +43,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="compression">The compression.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Reset(out TWJpegCompression compression)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Reset(out TWJpegCompression compression)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.JpegCompression, Message.Reset);
|
||||
compression = new TWJpegCompression();
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="palette">The palette.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Get(out TWPalette8 palette)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Get(out TWPalette8 palette)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Palette8, Message.Get);
|
||||
palette = new TWPalette8();
|
||||
@@ -27,7 +28,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="palette">The palette.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode GetDefault(out TWPalette8 palette)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode GetDefault(out TWPalette8 palette)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Palette8, Message.GetDefault);
|
||||
palette = new TWPalette8();
|
||||
@@ -40,7 +42,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="palette">The palette.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Reset(out TWPalette8 palette)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Reset(out TWPalette8 palette)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Palette8, Message.Reset);
|
||||
palette = new TWPalette8();
|
||||
|
||||
@@ -17,7 +17,8 @@ namespace NTwain.Triplets
|
||||
/// </summary>
|
||||
/// <param name="response">The response.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Reset(out TWRgbResponse response)
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
||||
public ReturnCode Reset(out TWRgbResponse response)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.RgbResponse, Message.Reset);
|
||||
response = new TWRgbResponse();
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace NTwain
|
||||
private set
|
||||
{
|
||||
_supportedCaps = value;
|
||||
RaisePropertyChanged("SupportedCaps");
|
||||
OnPropertyChanged("SupportedCaps");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace NTwain
|
||||
_state = newState;
|
||||
if (notifyChange)
|
||||
{
|
||||
RaisePropertyChanged("State");
|
||||
OnPropertyChanged("State");
|
||||
SafeAsyncSyncableRaiseOnEvent(OnStateChanged, StateChanged);
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ namespace NTwain
|
||||
void ITwainSessionInternal.ChangeSourceId(TWIdentity sourceId)
|
||||
{
|
||||
SourceId = sourceId;
|
||||
RaisePropertyChanged("SourceId");
|
||||
OnPropertyChanged("SourceId");
|
||||
SafeAsyncSyncableRaiseOnEvent(OnSourceChanged, SourceChanged);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace NTwain
|
||||
if (value > 0 && value < 8)
|
||||
{
|
||||
_state = value;
|
||||
RaisePropertyChanged("State");
|
||||
OnPropertyChanged("State");
|
||||
SafeAsyncSyncableRaiseOnEvent(OnStateChanged, StateChanged);
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,7 @@ namespace NTwain
|
||||
/// Raises the <see cref="PropertyChanged"/> event.
|
||||
/// </summary>
|
||||
/// <param name="propertyName">Name of the property.</param>
|
||||
protected void RaisePropertyChanged(string propertyName)
|
||||
protected void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
if (SynchronizationContext == null)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using NTwain.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -17,6 +18,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static TWStatus GetManagerStatus(this ITwainOperation session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
TWStatus stat;
|
||||
session.DGControl.Status.GetManager(out stat);
|
||||
return stat;
|
||||
@@ -28,6 +31,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static TWStatus GetSourceStatus(this ITwainOperation session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
TWStatus stat;
|
||||
session.DGControl.Status.GetSource(out stat);
|
||||
return stat;
|
||||
@@ -41,6 +46,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static IList<TWIdentity> GetSources(this ITwainOperation session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
List<TWIdentity> list = new List<TWIdentity>();
|
||||
|
||||
// now enumerate
|
||||
@@ -69,6 +76,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static object GetCurrentCap(this ITwainOperation session, CapabilityId capId)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
using (TWCapability cap = new TWCapability(capId))
|
||||
{
|
||||
var rc = session.DGControl.Capability.GetCurrent(cap);
|
||||
@@ -109,6 +118,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static IList<object> ReadMultiCapValues(this TWCapability capability, IList<object> toPopulate)
|
||||
{
|
||||
if (capability == null) { throw new ArgumentNullException("capability"); }
|
||||
|
||||
if (toPopulate == null) { toPopulate = new List<object>(); }
|
||||
|
||||
var read = CapReadOut.ReadValue(capability);
|
||||
@@ -149,6 +160,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static IList<object> GetCapabilityValues(this ITwainOperation session, CapabilityId capabilityId)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
var list = new List<object>();
|
||||
using (TWCapability cap = new TWCapability(capabilityId))
|
||||
{
|
||||
@@ -169,6 +182,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
internal static IList<CapabilityId> GetCapabilities(this ITwainOperation session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
return session.GetCapabilityValues(CapabilityId.CapSupportedCaps).CastToEnum<CapabilityId>(false);
|
||||
}
|
||||
|
||||
@@ -226,6 +241,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static IList<FileFormat> CapGetImageFileFormat(this ITwainOperation session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
return session.GetCapabilityValues(CapabilityId.ICapImageFileFormat).CastToEnum<FileFormat>(true);
|
||||
}
|
||||
|
||||
@@ -237,6 +254,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetImageFormat(this ITwainOperation session, FileFormat format)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
using (TWCapability formatCap = new TWCapability(CapabilityId.ICapImageFileFormat, new TWOneValue { Item = (uint)format, ItemType = ItemType.UInt16 }))
|
||||
{
|
||||
return session.DGControl.Capability.Set(formatCap);
|
||||
@@ -255,6 +274,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static IList<PixelType> CapGetPixelTypes(this ITwainOperation session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
return session.GetCapabilityValues(CapabilityId.ICapPixelType).CastToEnum<PixelType>(true);
|
||||
}
|
||||
|
||||
@@ -266,6 +287,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetPixelType(this ITwainOperation session, PixelType type)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
var one = new TWOneValue();
|
||||
one.Item = (uint)type;
|
||||
one.ItemType = ItemType.UInt16;
|
||||
@@ -287,6 +310,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static IList<XferMech> CapGetImageXferMechs(this ITwainOperation session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
return session.GetCapabilityValues(CapabilityId.ICapXferMech).CastToEnum<XferMech>(true);
|
||||
}
|
||||
|
||||
@@ -298,6 +323,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static IList<XferMech> CapGetAudioXferMechs(this ITwainOperation session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
return session.GetCapabilityValues(CapabilityId.ACapXferMech).CastToEnum<XferMech>(true);
|
||||
}
|
||||
|
||||
@@ -309,6 +336,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetImageXferMech(this ITwainOperation session, XferMech type)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
var one = new TWOneValue();
|
||||
one.Item = (uint)type;
|
||||
one.ItemType = ItemType.UInt16;
|
||||
@@ -326,6 +355,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetAudioXferMech(this ITwainOperation session, XferMech type)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
var one = new TWOneValue();
|
||||
one.Item = (uint)type;
|
||||
one.ItemType = ItemType.UInt16;
|
||||
@@ -347,6 +378,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static IList<TWFix32> CapGetDPIs(this ITwainOperation session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
var list = session.GetCapabilityValues(CapabilityId.ICapXResolution);
|
||||
return list.Select(o => o.ConvertToFix32()).ToList();
|
||||
}
|
||||
@@ -359,6 +392,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetDPI(this ITwainOperation session, TWFix32 dpi)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
return CapSetDPI(session, dpi, dpi);
|
||||
}
|
||||
|
||||
@@ -371,6 +406,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetDPI(this ITwainOperation session, TWFix32 xDPI, TWFix32 yDPI)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
TWOneValue one = new TWOneValue();
|
||||
one.Item = (uint)xDPI;// ((uint)dpi) << 16;
|
||||
one.ItemType = ItemType.Fix32;
|
||||
@@ -402,6 +439,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static IList<SupportedSize> CapGetSupportedSizes(this ITwainOperation session)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
return session.GetCapabilityValues(CapabilityId.ICapSupportedSizes).CastToEnum<SupportedSize>(true);
|
||||
}
|
||||
|
||||
@@ -413,6 +452,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetSupportedSize(this ITwainOperation session, SupportedSize size)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
var one = new TWOneValue();
|
||||
one.Item = (uint)size;
|
||||
one.ItemType = ItemType.UInt16;
|
||||
@@ -436,6 +477,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetAutoDeskew(this TwainSession session, bool useIt)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
var rc = ReturnCode.Failure;
|
||||
if (session.SupportedCaps.Contains(CapabilityId.ICapAutomaticDeskew))
|
||||
{
|
||||
@@ -476,6 +519,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetAutoRotate(this ITwainSession session, bool useIt)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
var rc = ReturnCode.Failure;
|
||||
if (session.SupportedCaps.Contains(CapabilityId.ICapAutomaticRotate))
|
||||
{
|
||||
@@ -514,6 +559,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetBorderDetection(this ITwainSession session, bool useIt)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
var rc = ReturnCode.Failure;
|
||||
if (session.SupportedCaps.Contains(CapabilityId.ICapAutomaticBorderDetection))
|
||||
{
|
||||
@@ -562,6 +609,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetDuplex(this ITwainSession session, bool useIt)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
if (session.SourceId.ProtocolMajor >= 2)
|
||||
{
|
||||
// twain 2 likes to use enum :(
|
||||
@@ -596,6 +645,8 @@ namespace NTwain
|
||||
/// <returns></returns>
|
||||
public static ReturnCode CapSetFeeder(this ITwainSession session, bool useIt)
|
||||
{
|
||||
if (session == null) { throw new ArgumentNullException("session"); }
|
||||
|
||||
var rc = ReturnCode.Failure;
|
||||
if (session.SupportedCaps.Contains(CapabilityId.CapFeederEnabled))
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace NTwain
|
||||
/// Initializes a new instance of the <see cref="TwainStateException"/> class.
|
||||
/// </summary>
|
||||
public TwainStateException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TwainStateException"/> class.
|
||||
/// </summary>
|
||||
|
||||
@@ -460,7 +460,7 @@ namespace Tester.WPF
|
||||
case CapabilityId.ICapICCProfile:
|
||||
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap).CastToEnum<IccProfile>();
|
||||
break;
|
||||
case CapabilityId.ICapImageDataset:
|
||||
case CapabilityId.ICapImageDataSet:
|
||||
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap);
|
||||
break;
|
||||
case CapabilityId.ICapImageFileFormat:
|
||||
@@ -481,8 +481,8 @@ namespace Tester.WPF
|
||||
case CapabilityId.ICapJpegQuality:
|
||||
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap).CastToEnum<JpegQuality>();
|
||||
break;
|
||||
case CapabilityId.ICapJpegSubSampling:
|
||||
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap).CastToEnum<JpegSubSampling>();
|
||||
case CapabilityId.ICapJpegSubsampling:
|
||||
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap).CastToEnum<JpegSubsampling>();
|
||||
break;
|
||||
case CapabilityId.ICapLampState:
|
||||
CapDetailList.ItemsSource = _twainVM.GetCapabilityValues(cap);
|
||||
|
||||
@@ -21,6 +21,14 @@ namespace Tester.WPF
|
||||
}
|
||||
}
|
||||
|
||||
//public void SupportedOperations
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Tester.WPF
|
||||
set
|
||||
{
|
||||
_image = value;
|
||||
RaisePropertyChanged("Image");
|
||||
OnPropertyChanged("Image");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user