Пример #1
0
        public Bitmap Blur(double sigma)
        {
            YiqImage yiq = GetYiq().Clone();

            yiq.Y = Blur(sigma, yiq.Y);
            return(yiq.ToBitmap());
        }
Пример #2
0
        public Bitmap Distorsion(double L)
        {
            double[,] result = new double[Width, Height];
            double diagonal = Math.Sqrt(Width * Width + Height * Height) / 2;

            for (int y = 0; y < Height; y++)
            {
                for (int x = 0; x < Width; x++)
                {
                    result[x, y] = 0;
                    double u = x - Width / 2;
                    double v = y - Height / 2;
                    double r = Math.Sqrt(u * u + v * v);
                    double g = Math.Cos(r * Math.PI * L / (2 * diagonal));

                    int xi = (int)(u * g + Width / 2);
                    int yi = (int)(v * g + Height / 2);
                    result[x, y] = GetYiq().Y[xi, yi];
                }
            }

            YiqImage img = GetYiq().Clone();

            img.Y = result;

            return(img.ToBitmap());
        }
Пример #3
0
        public Bitmap EqualizContrast()
        {
            int[]    barChart = GetYiq().GetBarChart();
            YiqImage yiq      = GetYiq().Clone();

            yiq.Y = _EqualizContrast(GetYiq().Y, barChart);
            return(yiq.ToBitmap());
        }