-
Notifications
You must be signed in to change notification settings - Fork 5
/
KnownYuvTests.cs
44 lines (37 loc) · 1.01 KB
/
KnownYuvTests.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
34
35
36
37
38
39
40
41
42
43
44
using NUnit.Framework;
using Wacton.Unicolour.Tests.Utils;
namespace Wacton.Unicolour.Tests;
public class KnownYuvTests
{
private const double Tolerance = 0.0000005;
[Test]
public void Red()
{
var red = StandardRgb.Red;
TestUtils.AssertTriplet<Yuv>(red, new(0.299, -0.147138, 0.614), Tolerance);
}
[Test]
public void Green()
{
var green = StandardRgb.Green;
TestUtils.AssertTriplet<Yuv>(green, new(0.587, -0.288862, -0.514148), Tolerance);
}
[Test]
public void Blue()
{
var blue = StandardRgb.Blue;
TestUtils.AssertTriplet<Yuv>(blue, new(0.114, 0.436, -0.099852), Tolerance);
}
[Test]
public void Black()
{
var black = StandardRgb.Black;
TestUtils.AssertTriplet<Yuv>(black, new(0.0, 0.0, 0.0), Tolerance);
}
[Test]
public void White()
{
var white = StandardRgb.White;
TestUtils.AssertTriplet<Yuv>(white, new(1.0, 0.0, 0.0), Tolerance);
}
}