Exemplo n.º 1
0
 public void ReadEmptyColorTransformTest()
 {
     var mem = new MemoryStream(new byte[] { 0 });
     var reader = new SwfStreamReader(mem);
     var transform = reader.ReadColorTransformRGBA();
     Assert.IsFalse(transform.HasAddTerms);
     Assert.IsFalse(transform.HasMultTerms);
 }
Exemplo n.º 2
0
 public void ReadColorTransformRGBAFromBitsMultTest()
 {
     var mem = new MemoryStream();
     WriteBits(mem,
         "0", "1", "1001", "0.00001010", "0.11100000", "1.11110110", "0.00010001");
     var reader = new SwfStreamReader(mem);
     ColorTransformRGBA color;
     reader.ReadColorTransformRGBA(out color);
     Assert.AreEqual(mem.Length, mem.Position, "Should reach end of the stream");
     AssertData.AreEqual(new ColorTransformRGBA {
         HasAddTerms = false,
         HasMultTerms = true,
         RedMultTerm = 10,
         GreenMultTerm = 224,
         BlueMultTerm = -10,
         AlphaMultTerm = 17
     }, color, "ColorTransform");
 }