Esempio n. 1
0
        private void DrawCurve(IGraphDrawer Drawer)
        {
            PointD[] pout;

            //Drawing Brightness Curve
            if (ProjectManager.CurrentProject.Frames.Count > 0 && ProjectManager.CurrentProject.IsBrightnessCalculated)
            {
                Drawer.SetCurveLinePen();
                List <PointD> BrP = new List <PointD>();
                for (int i = 0; i < ProjectManager.CurrentProject.Frames.Count; i++)
                {
                    BrP.Add(new PointD(i, (float)ProjectManager.CurrentProject.Frames[i].AlternativeBrightness));
                }

                pout = this.RealToGraph(BrP);
                for (int i = 1; i < pout.Length; i++)
                {
                    Drawer.DrawLine((float)pout[i - 1].X, (float)pout[i - 1].Y, (float)pout[i].X, (float)pout[i].Y);
                }
            }

            if (this.Points.Count > 0 && ProjectManager.CurrentProject.IsBrightnessCalculated)
            {
                //Drawing Custom Curve
                Drawer.SetCustomCurveLinePen();
                pout = this.RealToGraph(Interpolation.Do(this.Points.ToArray(), BrightnessGraph.Smoothness));
                for (int i = 1; i < pout.Length; i++)
                {
                    Drawer.DrawLine((float)pout[i - 1].X, (float)pout[i - 1].Y, (float)pout[i].X, (float)pout[i].Y);
                }

                //Drawing Points
                Drawer.SetPointPen();
                for (int i = 0; i < this.Points.Count; i++)
                {
                    PointD tmp = this.RealToGraph(this.Points[i]);
                    Drawer.DrawCircle((float)tmp.X - PointRadius, (float)tmp.Y - PointRadius, PointRadius * 2);
                }
                //Drawing Selected Point
                Drawer.SetSelectedPointPen();
                PointD tmpSel = this.RealToGraph(this.Points[this.SelectedPoint]);
                Drawer.DrawCircle((float)tmpSel.X - PointRadius, (float)tmpSel.Y - PointRadius, PointRadius * 2);
            }
        }