Esempio n. 1
0
        public void TestLinearZeroBlur()
        {
            Frame[] testFrame = { new Frame(new YuvKA.VideoModel.Size(5, 5)) };
            for (int x = 0; x < testFrame[0].Size.Width; x++)
            {
                for (int y = 0; y < testFrame[0].Size.Height; y++)
                {
                    testFrame[0][x, y] = new Rgb((byte)(10 * x * y), (byte)(10 * x * y), (byte)(10 * x * y));
                }
            }
            BlurNode blur = new BlurNode();

            blur.Radius = 0;
            Frame[] result = blur.Process(testFrame, 0);
            for (int x = 0; x < testFrame[0].Size.Width; x++)
            {
                for (int y = 0; y < testFrame[0].Size.Height; y++)
                {
                    Assert.Equal(testFrame[0][x, y], result[0][x, y]);
                }
            }
        }
Esempio n. 2
0
 public void TestLinearBlurMonocolor()
 {
     Frame[] testFrame = { new Frame(new YuvKA.VideoModel.Size(5, 5)) };
     for (int i = 0; i < 256; i++)
     {
         for (int x = 0; x < testFrame[0].Size.Width; x++)
         {
             for (int y = 0; y < testFrame[0].Size.Height; y++)
             {
                 testFrame[0][x, y] = new Rgb((byte)i, (byte)i, (byte)i);
             }
         }
         BlurNode blur   = new BlurNode();
         Frame[]  result = blur.Process(testFrame, 0);
         for (int x = 0; x < testFrame[0].Size.Width; x++)
         {
             for (int y = 0; y < testFrame[0].Size.Height; y++)
             {
                 Assert.Equal(testFrame[0][x, y], result[0][x, y]);
             }
         }
     }
 }