Exemple #1
0
        public WatercolorFilter() : base()
        {
            KernelMaps.Add(new float[9]);

            for (int i = 0; i < KernelMaps[0].Length; i++)
            {
                if (i == 4)
                {
                    KernelMaps[0][i] = 2.0f;
                }
                else if (i % 2 == 0)
                {
                    KernelMaps[0][i] = 0.5f;
                }
                else
                {
                    KernelMaps[0][i] = 1.0f;
                }
            }

            for (int i = 0; i < KernelMaps[1].Length; i++)
            {
                if (i == 4)
                {
                    KernelMaps[1][i] = 6.0f;
                }
                else
                {
                    KernelMaps[1][i] = -0.5f;
                }
            }
        }
        public SobelFilter() : base()
        {
            KernelMaps[0][0] = KernelMaps[0][6] = 1;
            KernelMaps[0][2] = KernelMaps[0][8] = -1;
            KernelMaps[0][3] = 2;
            KernelMaps[0][5] = -2;

            KernelMaps.Add(new float[9]);

            KernelMaps[1][0] = KernelMaps[1][2] = -1;
            KernelMaps[1][6] = KernelMaps[1][8] = 1;
            KernelMaps[1][7] = 2;
            KernelMaps[1][1] = -2;
        }