Esempio n. 1
0
        public void BuildFromImage(Bitmap source)
        {
            var r = new int[256];
            var g = new int[256];
            var b = new int[256];

            var gray = new int[256];

            for (int i = 0; i < source.Width; ++i)
            {
                for (int j = 0; j < source.Height; ++j)
                {
                    var p = source.GetPixel(i, j);

                    r[p.R] += 1;
                    g[p.G] += 1;
                    b[p.B] += 1;
                }
            }

            Filter grayMaker = new GrayScaleFilter();

            var img = grayMaker.ProcessImage(source, null);

            for (int i = 0; i < img.Width; ++i)
            {
                for (int j = 0; j < img.Height; ++j)
                {
                    var p = img.GetPixel(i, j);
                    gray[p.R] += 1;
                }
            }


            SetRHistgram = r;
            SetGHistgram = g;
            SetBHistgram = b;
            SetLHistgram = gray;
        }
Esempio n. 2
0
        private void вОттенкахСерогоToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Filter filter = new GrayScaleFilter();

            backgroundWorker1.RunWorkerAsync(filter);
        }
Esempio n. 3
0
        private void grayscaleToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GrayScaleFilter gs = new GrayScaleFilter();

            backgroundWorker1.RunWorkerAsync(gs);
        }
Esempio n. 4
0
        private void полутонToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Filters filter = new GrayScaleFilter();

            backgroundWorker1.RunWorkerAsync(filter);
        }