mirror of
https://github.com/soukoku/ntwain.git
synced 2025-12-01 10:54:08 +08:00
Completed all triplet mapping.
This commit is contained in:
@@ -8,6 +8,54 @@ namespace NTwain.Triplets
|
||||
{
|
||||
internal Filter(ITwainSessionInternal session) : base(session) { }
|
||||
|
||||
//TODO: implement this
|
||||
|
||||
/// <summary>
|
||||
/// Causes the Source to return the filter parameters that will be used during the next image
|
||||
/// acquisition.
|
||||
/// </summary>
|
||||
/// <param name="filter">The filter.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Get(out TWFilter filter)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Filter, Message.Get);
|
||||
filter = new TWFilter();
|
||||
return PInvoke.DsmEntry(Session.AppId, Session.SourceId, Message.Get, filter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Causes the Source to return the power-on default values applied to the filter.
|
||||
/// </summary>
|
||||
/// <param name="filter">The filter.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode GetDefault(out TWFilter filter)
|
||||
{
|
||||
Session.VerifyState(4, 6, DataGroups.Image, DataArgumentType.Filter, Message.GetDefault);
|
||||
filter = new TWFilter();
|
||||
return PInvoke.DsmEntry(Session.AppId, Session.SourceId, Message.GetDefault, filter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Allows the Application to configure the filter parameters that will be used during the next image
|
||||
/// acquisition.
|
||||
/// </summary>
|
||||
/// <param name="filter">The filter.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Set(TWFilter filter)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Filter, Message.Set);
|
||||
return PInvoke.DsmEntry(Session.AppId, Session.SourceId, Message.Set, filter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the Source to using its power-on default values when it is applying the filter.
|
||||
/// </summary>
|
||||
/// <param name="filter">The filter.</param>
|
||||
/// <returns></returns>
|
||||
public ReturnCode Reset(out TWFilter filter)
|
||||
{
|
||||
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.Filter, Message.Reset);
|
||||
filter = new TWFilter();
|
||||
return PInvoke.DsmEntry(Session.AppId, Session.SourceId, Message.Reset, filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,18 @@ namespace NTwain.Triplets
|
||||
if (_extImgInfo == null) { _extImgInfo = new ExtImageInfo(_session); }
|
||||
return _extImgInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Filter _filter;
|
||||
public Filter Filter
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_filter == null) { _filter = new Filter(_session); }
|
||||
return _filter;
|
||||
}
|
||||
}
|
||||
|
||||
GrayResponse _grayResponse;
|
||||
public GrayResponse GrayResponse
|
||||
|
||||
Reference in New Issue
Block a user