mirror of
https://github.com/soukoku/ntwain.git
synced 2025-11-07 18:14:46 +08:00
Cleared some todos.
This commit is contained in:
@@ -83,10 +83,8 @@ namespace NTwain.Data
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
TWDecodeFunction[] _decode;
|
||||
// TODO: research jagged aray mapping (3x3).
|
||||
// maybe can only have 1-D
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
|
||||
TWFix32[][] _mix;
|
||||
TWFix32[] _mix;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 2)]
|
||||
@@ -230,61 +228,58 @@ namespace NTwain.Data
|
||||
TWInfo[] _info;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Pack = 2),
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 2),
|
||||
BestFitMapping(false, ThrowOnUnmappableChar = true)]
|
||||
partial class TWFileSystem
|
||||
{
|
||||
// TODO: verify all field offset #s
|
||||
|
||||
[FieldOffset(0)]
|
||||
//[FieldOffset(0)]
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
||||
string _inputName;
|
||||
|
||||
[FieldOffset(TwainConst.String255)]
|
||||
//[FieldOffset(TwainConst.String255)]
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String255)]
|
||||
string _outputName;
|
||||
|
||||
[FieldOffset(512)]
|
||||
//[FieldOffset(512)]
|
||||
TW_MEMREF _context;
|
||||
|
||||
//TODO: verify this field offset in 64bit due to previous pointer
|
||||
[FieldOffset(520)]
|
||||
short _recursive;
|
||||
[FieldOffset(520)]
|
||||
//[FieldOffset(520)]
|
||||
//short _recursive;
|
||||
//[FieldOffset(520)]
|
||||
TW_BOOL _subdirectories;
|
||||
|
||||
[FieldOffset(524)]
|
||||
//[FieldOffset(524)]
|
||||
TW_INT32 _fileType;
|
||||
[FieldOffset(524)]
|
||||
TW_UINT32 _fileSystemType;
|
||||
//[FieldOffset(524)]
|
||||
//TW_UINT32 _fileSystemType;
|
||||
|
||||
[FieldOffset(528)]
|
||||
//[FieldOffset(528)]
|
||||
TW_UINT32 _size;
|
||||
|
||||
[FieldOffset(532)]
|
||||
//[FieldOffset(532)]
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String32)]
|
||||
string _createTimeDate;
|
||||
|
||||
[FieldOffset(566)]
|
||||
//[FieldOffset(566)]
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = TwainConst.String32)]
|
||||
string _modifiedTimeDate;
|
||||
|
||||
[FieldOffset(600)]
|
||||
//[FieldOffset(600)]
|
||||
TW_UINT32 _freeSpace;
|
||||
|
||||
[FieldOffset(604)]
|
||||
//[FieldOffset(604)]
|
||||
TW_INT32 _newImageSize;
|
||||
|
||||
[FieldOffset(608)]
|
||||
//[FieldOffset(608)]
|
||||
TW_UINT32 _numberOfFiles;
|
||||
|
||||
[FieldOffset(612)]
|
||||
//[FieldOffset(612)]
|
||||
TW_UINT32 _numberOfSnippets;
|
||||
|
||||
[FieldOffset(616)]
|
||||
//[FieldOffset(616)]
|
||||
TW_UINT32 _deviceGroupMask;
|
||||
|
||||
[FieldOffset(620)]
|
||||
//[FieldOffset(620)]
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 508)]
|
||||
TW_INT8[] _reserved;
|
||||
}
|
||||
|
||||
@@ -470,9 +470,21 @@ namespace NTwain.Data
|
||||
/// </summary>
|
||||
public TWDecodeFunction[] Decode { get { return _decode; } set { _decode = value; } }
|
||||
/// <summary>
|
||||
/// 3x3 matrix that specifies how channels are mixed in.
|
||||
/// 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>
|
||||
public TWFix32[,] GetMixMatrix()
|
||||
{
|
||||
// from http://stackoverflow.com/questions/3845235/convert-array-to-matrix, haven't tested it
|
||||
TWFix32[,] mat = new TWFix32[3, 3];
|
||||
Buffer.BlockCopy(_mix, 0, mat, 0, _mix.Length * 4);
|
||||
return mat;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1606,9 +1618,8 @@ namespace NTwain.Data
|
||||
/// all subdirectories in the directory being deleted; or copies all
|
||||
/// sub-directories in the directory being copied.
|
||||
/// </summary>
|
||||
public short Recursive { get { return _recursive; } set { _recursive = value; } }
|
||||
public bool Subdirectories { get { return _subdirectories == TwainConst.True; } }
|
||||
|
||||
public bool Recursive { get { return _subdirectories == TwainConst.True; } set { _subdirectories = value ? TwainConst.True : TwainConst.False; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the file.
|
||||
/// </summary>
|
||||
@@ -1616,8 +1627,7 @@ namespace NTwain.Data
|
||||
/// The type of the file.
|
||||
/// </value>
|
||||
public FileType FileType { get { return (FileType)_fileType; } set { _fileType = (int)value; } }
|
||||
public uint FileSystemType { get { return _fileSystemType; } set { _fileSystemType = value; } }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// If <see cref="NTwain.Values.FileType.Directory"/>, total size of media in bytes.
|
||||
/// If <see cref="NTwain.Values.FileType.Image"/>, size of image in bytes.
|
||||
|
||||
Reference in New Issue
Block a user