ntwain/NTwain/Triplets/DGImage/DGImage.RgbResponse.cs

39 lines
1.4 KiB
C#
Raw Normal View History

2014-04-03 07:13:15 +08:00
using NTwain.Data;
2014-04-03 07:01:21 +08:00
using NTwain.Values;
namespace NTwain.Triplets
{
2014-04-05 10:19:16 +08:00
/// <summary>
/// Represents <see cref="DataArgumentType.RgbResponse"/>.
/// </summary>
2014-04-03 07:01:21 +08:00
public sealed class RgbResponse : OpBase
{
2014-04-06 04:48:28 +08:00
internal RgbResponse(ITwainStateInternal session) : base(session) { }
2014-04-03 07:01:21 +08:00
/// <summary>
/// Causes the Source to use its "identity" response curves for future RGB transfers. The identity
/// curve causes no change in the values of the captured data when it is applied. (Note that
/// resetting the curves for RGB data does not reset any curves for other pixel types).
/// </summary>
/// <param name="response">The response.</param>
/// <returns></returns>
public ReturnCode Reset(out TWRgbResponse response)
{
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.RgbResponse, Message.Reset);
response = new TWRgbResponse();
2014-04-16 18:53:05 +08:00
return Dsm.DsmEntry(Session.AppId, Session.SourceId, Message.Reset, response);
2014-04-03 07:01:21 +08:00
}
/// <summary>
/// Causes the Source to transform any RGB data according to the response curves specified by the
/// application.
/// </summary>
/// <param name="response">The response.</param>
/// <returns></returns>
public ReturnCode Set(TWRgbResponse response)
{
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.RgbResponse, Message.Set);
2014-04-16 18:53:05 +08:00
return Dsm.DsmEntry(Session.AppId, Session.SourceId, Message.Set, response);
2014-04-03 07:01:21 +08:00
}
}
}