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

40 lines
1.5 KiB
C#
Raw Normal View History

2014-04-03 07:13:15 +08:00
using NTwain.Data;
2014-04-21 04:57:38 +08:00
using NTwain.Internals;
2014-04-03 07:01:21 +08:00
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
{
internal RgbResponse(ITwainSessionInternal 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>
2014-04-21 08:45:08 +08:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "0#")]
public ReturnCode Reset(out TWRgbResponse response)
2014-04-03 07:01:21 +08:00
{
Session.VerifyState(4, 4, DataGroups.Image, DataArgumentType.RgbResponse, Message.Reset);
response = new TWRgbResponse();
return Dsm.DsmEntry(Session.AppId, Session.Source.Identity, 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);
return Dsm.DsmEntry(Session.AppId, Session.Source.Identity, Message.Set, response);
2014-04-03 07:01:21 +08:00
}
}
}