public static void AreEqual(ColorTransformRGB expected, ColorTransformRGB actual, string message) { Assert.AreEqual(expected.HasAddTerms, actual.HasAddTerms, message + ".HasAddTerms"); Assert.AreEqual(expected.HasMultTerms, actual.HasMultTerms, message + ".HasMultTerms"); Assert.AreEqual(expected.RedAddTerm, actual.RedAddTerm, message + ".RedAddTerm"); Assert.AreEqual(expected.GreenAddTerm, actual.GreenAddTerm, message + ".GreenAddTerm"); Assert.AreEqual(expected.BlueAddTerm, actual.BlueAddTerm, message + ".BlueAddTerm"); Assert.AreEqual(expected.RedMultTerm, actual.RedMultTerm, message + ".RedMultTerm"); Assert.AreEqual(expected.GreenMultTerm, actual.GreenMultTerm, message + ".GreenMultTerm"); Assert.AreEqual(expected.BlueMultTerm, actual.BlueMultTerm, message + ".BlueMultTerm"); }
public static XElement ToXml(ColorTransformRGB transform) { var res = new XElement(TAG_NAME); if (transform.HasMultTerms) { res.Add(new XAttribute("factorRed", transform.RedMultTerm)); res.Add(new XAttribute("factorGreen", transform.GreenMultTerm)); res.Add(new XAttribute("factorBlue", transform.BlueMultTerm)); } if (transform.HasAddTerms) { res.Add(new XAttribute("redadd", transform.RedAddTerm)); res.Add(new XAttribute("greenadd", transform.GreenAddTerm)); res.Add(new XAttribute("blueadd", transform.BlueAddTerm)); } return(res); }
public void WriteColorTransformRGBFromBitsMultTest() { var mem = new MemoryStream(); var writer = new SwfStreamWriter(mem); var tranform = new ColorTransformRGB { RedMultTerm = 10, GreenMultTerm = 224, BlueMultTerm = -10, HasMultTerms = true, RedAddTerm = 0, GreenAddTerm = 0, BlueAddTerm = 0, HasAddTerms = false }; writer.WriteColorTransformRGB(ref tranform); CheckBits(mem, "0", "1", "1001", "0.00001010", "0.11100000", "1.11110110"); }