Ejemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            photo              = new DirectBitmap(GK3.Properties.Resources.Lenna);
            orginalPicture     = new DirectBitmap(GK3.Properties.Resources.Lenna);
            transformedPicture = new DirectBitmap(GK3.Properties.Resources.Lenna);
            ownFunctionPicture = new DirectBitmap(300, 300);

            pictureBox.Image            = photo.Bitmap;
            pictureBoxOwnFunction.Image = ownFunctionPicture.Bitmap;
            polygons = new List <Polygon>();

            isPolygonCreating = false;
            isDrawing         = false;
            ownFunction       = new Vertex[OWN_FUNCTION_POINTS];
            FillFunction(ownFunction);

            setMode(ModeType.AddPolygon);
            filterType = FilterType.NoFilter;

            filter            = new NegationFilter();
            brightnessFilter  = new BrightnessChangeFilter();
            contrastFilter    = new ContrastFilter();
            gammaFilter       = new GammaCorrectionFilter();
            ownFunctionFilter = new OwnFunctionFilter(ownFunction);

            filter.setNext(brightnessFilter);
            brightnessFilter.setNext(contrastFilter);
            contrastFilter.setNext(gammaFilter);
            gammaFilter.setNext(ownFunctionFilter);

            histR.Series[0].Color = Color.Red;
            histG.Series[0].Color = Color.Green;
            histB.Series[0].Color = Color.Blue;

            DrawOwnFunctionAxis();
            DrawOwnFunction();
            UpdatePhoto();
        }