public void ConstructionTest() { for(int i = 0; i < TestParameters.ColorTest; i++) { ushort s0 = (ushort)(Maths.RandomGenerator.Next()&0xffff); ushort s1 = (ushort)(Maths.RandomGenerator.Next()&0xffff); ushort s2 = (ushort)(Maths.RandomGenerator.Next()&0xffff); ushort s3 = (ushort)(Maths.RandomGenerator.Next()&0xffff); ushort s4 = (ushort)(Maths.RandomGenerator.Next()&0xffff); ushort s5 = (ushort)(Maths.RandomGenerator.Next()&0xffff); Color6 c = new Color6(s0, s1, s2, s3, s4, s5); Assert.AreEqual(s0, c.Seg0); Assert.AreEqual(s1, c.Seg1); Assert.AreEqual(s2, c.Seg2); Assert.AreEqual(s3, c.Seg3); Assert.AreEqual(s4, c.Seg4); Assert.AreEqual(s5, c.Seg5); } }
public void AddColor6Test() { for(int i = 0x00; i < TestParameters.ColorTest; i++) { ushort s0 = (ushort)(Maths.RandomGenerator.Next()&0xffff); ushort s1 = (ushort)(Maths.RandomGenerator.Next()&0xffff); ushort s2 = (ushort)(Maths.RandomGenerator.Next()&0xffff); ushort s3 = (ushort)(Maths.RandomGenerator.Next()&0xffff); ushort s4 = (ushort)(Maths.RandomGenerator.Next()&0xffff); ushort s5 = (ushort)(Maths.RandomGenerator.Next()&0xffff); Color6Cache65536 cc = new Color6Cache65536(0x00); Color6 c = new Color6(s0, s1, s2, s3, s4, s5); uint n = (uint)Maths.RandomGenerator.Next(TestParameters.ColorDepthTest)+0x01; for(int j = 0x00; j < n; j++) { cc.AddColor6(c); } Assert.AreEqual(c, cc.Mix(n)); } }
public void AddColor6(Color6 color) { Low += (color.Low&0xffff)|((color.Low&0x1fffe00000)<<0x0b); Mid += ((color.Low&0x3fffc0000000000)>>0x2a)|((color.High&0xffff)<<0x20); High += ((color.High&0x1fffe00000)>>0x15)|((color.High&0x3fffc0000000000)>>0x0a); }