2014-04-02 19:13:15 -04:00
|
|
|
|
using NTwain.Data;
|
2014-04-20 16:57:38 -04:00
|
|
|
|
using NTwain.Internals;
|
2014-04-02 19:01:21 -04:00
|
|
|
|
|
|
|
|
|
|
namespace NTwain.Triplets
|
|
|
|
|
|
{
|
2014-04-04 22:19:16 -04:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents <see cref="DataArgumentType.GrayResponse"/>.
|
|
|
|
|
|
/// </summary>
|
2014-04-02 19:01:21 -04:00
|
|
|
|
public sealed class GrayResponse : OpBase
|
|
|
|
|
|
{
|
2014-04-20 18:42:51 -04:00
|
|
|
|
internal GrayResponse(ITwainSessionInternal session) : base(session) { }
|
2014-04-02 19:01:21 -04:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The Reset operation causes the Source to use its "identity response curve." The identity
|
|
|
|
|
|
/// curve causes no change in the values of the captured data when it is applied.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="response">The response.</param>
|
|
|
|
|
|
/// <returns></returns>
|
2014-04-20 20:45:08 -04:00
|
|
|
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
|
|
|
|
|
|
public ReturnCode Reset(out TWGrayResponse response)
|
2014-04-02 19:01:21 -04:00
|
|
|
|
{
|
|
|
|
|
|
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.GrayResponse, Message.Reset);
|
|
|
|
|
|
response = new TWGrayResponse();
|
2014-04-16 06:53:05 -04:00
|
|
|
|
return Dsm.DsmEntry(Session.AppId, Session.SourceId, Message.Reset, response);
|
2014-04-02 19:01:21 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This operation causes the Source to transform any grayscale data according to the response
|
|
|
|
|
|
/// curve specified.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="response">The response.</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
public ReturnCode Set(TWGrayResponse response)
|
|
|
|
|
|
{
|
|
|
|
|
|
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.GrayResponse, Message.Set);
|
2014-04-16 06:53:05 -04:00
|
|
|
|
return Dsm.DsmEntry(Session.AppId, Session.SourceId, Message.Set, response);
|
2014-04-02 19:01:21 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|