Completed all triplet mapping.

This commit is contained in:
soukoku
2014-04-04 18:51:44 -04:00
parent 428a024124
commit c7ca66836b
7 changed files with 147 additions and 24 deletions

View File

@@ -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);
}
}
}

View File

@@ -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