Пример #1
0
        public void WriteEmptyColorTransformTest()
        {
            var mem    = new MemoryStream();
            var writer = new SwfStreamWriter(mem);

            writer.WriteColorTransformRGB(new ColorTransformRGB());
            Assert.AreEqual(new byte[] { 4 }, mem.ToArray());
        }
Пример #2
0
        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");
        }
Пример #3
0
 public void WriteColorTransformRGBFromBitsAddTest()
 {
     var mem = new MemoryStream();
     var writer = new SwfStreamWriter(mem);
     var tranform = new ColorTransformRGB {
         RedMultTerm = 0,
         GreenMultTerm = 0,
         BlueMultTerm = 0,
         HasMultTerms = false,
         RedAddTerm = 10,
         GreenAddTerm = -10,
         BlueAddTerm = 224,
         HasAddTerms = true
     };
     writer.WriteColorTransformRGB(ref tranform);
     CheckBits(mem,
         "1", "0", "1001", "0.00001010", "1.11110110", "0.11100000");
 }
Пример #4
0
 public void WriteEmptyColorTransformTest()
 {
     var mem = new MemoryStream();
     var writer = new SwfStreamWriter(mem);
     writer.WriteColorTransformRGB(new ColorTransformRGB());
     Assert.AreEqual(new byte[] { 4 }, mem.ToArray());
 }