-
Notifications
You must be signed in to change notification settings - Fork 950
/
DensityCurveEffect.cs
33 lines (29 loc) · 1.41 KB
/
DensityCurveEffect.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#if NET9_0_OR_GREATER
namespace System.Drawing.Imaging.Effects;
/// <summary>
/// Simulates increasing or decreasing the film density of a photograph.
/// </summary>
public class DensityCurveEffect : ColorCurveEffect
{
/// <summary>
/// Creates a new <see cref="DensityCurveEffect"/> with the given <paramref name="density"/>.
/// </summary>
/// <param name="channel">The channel or channels that the effect is applied to.</param>
/// <param name="density">
/// A value in the range of -256 through 256. A value of 0 specifies no change in density. Positive values specify
/// increased density (lighter picture) and negative values specify decreased density (darker picture).
/// </param>
/// <exception cref="ArgumentException"><paramref name="density"/> is less than -256 or greater than 256.</exception>
public DensityCurveEffect(CurveChannel channel, int density)
: base(CurveAdjustments.AdjustDensity, channel, density)
{
}
/// <summary>
/// A value in the range of -256 through 256. A value of 0 specifies no change in density. Positive values specify
/// increased density (lighter picture) and negative values specify decreased density (darker picture).
/// </summary>
public int Density => AdjustValue;
}
#endif