本文整理汇总了C#中Pixel.SetChannel方法的典型用法代码示例。如果您正苦于以下问题:C# Pixel.SetChannel方法的具体用法?C# Pixel.SetChannel怎么用?C# Pixel.SetChannel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pixel
的用法示例。
在下文中一共展示了Pixel.SetChannel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test_IEquatable
public void Test_IEquatable()
{
Pixel first = new Pixel(0, 0, 3);
first.SetChannel(0, 100);
first.SetChannel(1, 100);
first.SetChannel(2, 100);
Assert.IsFalse(first == null);
Assert.IsFalse(first.Equals(null));
Assert.IsTrue(first.Equals(first));
Assert.IsTrue(first.Equals((object)first));
Pixel second = new Pixel(10, 10, 3);
second.SetChannel(0, 100);
second.SetChannel(1, 0);
second.SetChannel(2, 100);
Assert.IsTrue(first != second);
Assert.IsTrue(!first.Equals(second));
Assert.IsTrue(!first.Equals((object)second));
second.SetChannel(1, 100);
Assert.IsTrue(first == second);
Assert.IsTrue(first.Equals(second));
Assert.IsTrue(first.Equals((object)second));
}
示例2: Test_Set_SetChannel
public void Test_Set_SetChannel()
{
QuantumType half = (QuantumType)(Quantum.Max / 2.0);
Pixel first = new Pixel(0, 0, 3);
first.Set(new QuantumType[] { Quantum.Max, 0, half });
Assert.AreEqual(Quantum.Max, first.GetChannel(0));
Assert.AreEqual(0, first.GetChannel(1));
Assert.AreEqual(half, first.GetChannel(2));
first.SetChannel(0, 0);
first.SetChannel(1, half);
first.SetChannel(2, Quantum.Max);
Assert.AreEqual(0, first.GetChannel(0));
Assert.AreEqual(half, first.GetChannel(1));
Assert.AreEqual(Quantum.Max, first.GetChannel(2));
}