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

            writer.WriteColorTransformRGBA(new ColorTransformRGBA());
            Assert.AreEqual(new byte[] { 4 }, mem.ToArray());
        }
Пример #2
0
        public void WriteColorTransformRGBAFromBitsAddTest()
        {
            var mem      = new MemoryStream();
            var writer   = new SwfStreamWriter(mem);
            var tranform = new ColorTransformRGBA {
                RedMultTerm   = 0,
                GreenMultTerm = 0,
                BlueMultTerm  = 0,
                AlphaMultTerm = 0,
                HasMultTerms  = false,
                RedAddTerm    = 10,
                GreenAddTerm  = -10,
                BlueAddTerm   = 224,
                AlphaAddTerm  = 192,
                HasAddTerms   = true
            };

            writer.WriteColorTransformRGBA(ref tranform);
            CheckBits(mem,
                      "1", "0", "1001", "0.00001010", "1.11110110", "0.11100000", "0.11000000");
        }
Пример #3
0
 public void WriteColorTransformRGBAFromBitsAddTest()
 {
     var mem = new MemoryStream();
     var writer = new SwfStreamWriter(mem);
     var tranform = new ColorTransformRGBA {
         RedMultTerm = 0,
         GreenMultTerm = 0,
         BlueMultTerm = 0,
         AlphaMultTerm = 0,
         HasMultTerms = false,
         RedAddTerm = 10,
         GreenAddTerm = -10,
         BlueAddTerm = 224,
         AlphaAddTerm = 192,
         HasAddTerms = true
     };
     writer.WriteColorTransformRGBA(ref tranform);
     CheckBits(mem,
         "1", "0", "1001", "0.00001010", "1.11110110", "0.11100000", "0.11000000");
 }
Пример #4
0
 public void WriteEmptyColorTransformTest()
 {
     var mem = new MemoryStream();
     var writer = new SwfStreamWriter(mem);
     writer.WriteColorTransformRGBA(new ColorTransformRGBA());
     Assert.AreEqual(new byte[] { 4 }, mem.ToArray());
 }