Example #1
0
        public void DrawWhiteBalanceCurve(WriteableBitmap b, string ChartType)//绘制白平衡的分析图
        {
            this.ChartType = ChartType;
            List <Color> al = new List <Color>();

            if (ChartType == "XMark")
            {
                XMarkChart xm = new XMarkChart(b);
                al = xm.getCurveWhiteBalance();
            }
            if (ChartType == "XRite")
            {
                XRiteColorChart x = new XRiteColorChart(b);
                al = x.getCurveWhiteBalance();
            }
            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            //dg.InitCanvas(picCanvas.Width, picCanvas.Height);//需要先设置画布
            dg.DrawColorCy(0.9f);

            for (int i = 0; i < al.Count; i++)
            {
                Color c = (Color)al[i];
                dg.DrawColorPoint(c, 0.9f, 3);
            }
        }
Example #2
0
        public void DrawColorDisCurve(int cNo, WriteableBitmap b, string ChartType)//绘制单个色差
        {
            this.ChartType = ChartType;
            List <List <Color> > al = new List <List <Color> >();

            if (ChartType == "XMark")
            {
                XMarkChart xm = new XMarkChart(b);
                al  = xm.getCurveColorDis();
                cNo = cNo - 7;
            }
            if (ChartType == "XRite")
            {
                XRiteColorChart x = new XRiteColorChart(b);
                al  = x.getCurveColorDis();
                cNo = cNo - 1;
            }
            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            dg.DrawColorCy(0.9f);

            List <Color> tal = al[cNo];
            Color        c0  = (Color)tal[0];
            Color        c1  = (Color)tal[1];

            //picS.BackColor = c0;
            //picV.BackColor = c1;
            dg.DrawColorMoveHue(c0, c1, 0.9f);
        }
Example #3
0
        public void DrawColorDisCurve(WriteableBitmap b, string ChartType)//绘制描述色差的图形
        {
            this.ChartType = ChartType;
            List <List <Color> > al = new List <List <Color> >();

            if (ChartType == "XMark")
            {
                XMarkChart xm = new XMarkChart(b);
                al = xm.getCurveColorDis();
            }
            if (ChartType == "XRite")
            {
                XRiteColorChart x = new XRiteColorChart(b);
                al = x.getCurveColorDis();
            }
            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            dg.DrawColorCy(0.9f);
            for (int i = 7; i < 19; i++)
            {
                List <Color> tal = al[i - 7];
                Color        c0  = (Color)tal[0];
                Color        c1  = (Color)tal[1];
                //picS.BackColor = c0;
                //picV.BackColor = c1;
                dg.DrawColorMoveHue(c0, c1, 0.9f);
            }
        }
Example #4
0
        public void XRiteTest()
        {
            processbar.Value = 0;
            ResultPanel.Children.Clear();

            Button          li;
            XRiteColorChart xr = new XRiteColorChart(SourcePhoto);

            //xr.NoiseSwing = XRite_NoiseBrightChange;
            xr.BeginAnalyse();

            sw.Stop();
            sw.Start();

            decimal d = Convert.ToDecimal(xr.getWhiteBanlance()) * 100;

            li         = new Button();
            li.Name    = "AutoWhiteBalanceDistance";
            li.Content = "白平衡误差:";
            li.Content = li.Content + d.ToString();
            li.Content = li.Content + " %";

            li.Click += new RoutedEventHandler(XRiteWhiteBalance_Click);
            //li.SubItems.Add(sw.ElapsedMilliseconds.ToString());
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示拍摄灰度的时刻偏离灰度的程度,完全准确时为0");

            ResultPanel.Children.Add(li);
            processbar.Value = 30;

            d          = xr.getColorDistance();
            li         = new Button();
            li.Name    = "ColorTrendValue";
            li.Content = "色彩趋向误差:" + d.ToString() + " 度";
            li.Click  += new RoutedEventHandler(XRiteColorDis_Click);
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示在拍摄标准颜色时候色调的偏差,完全准确时为0");

            ResultPanel.Children.Add(li);
            processbar.Value = 60;

            d = Convert.ToDecimal(xr.getNoiseNum(25)) * 100;

            li         = new Button();
            li.Name    = "Noise";
            li.Content = "噪点:" + d.ToString() + " %";
            li.SetValue(ToolTipService.ToolTipProperty, "数据表示在一张照片里面可以分辨的噪点数量");
            ResultPanel.Children.Add(li);
            processbar.Value = 100;

            sw.Stop();
            li.SetValue(ToolTipService.ToolTipProperty, "测试共花费" + sw.Interval.Milliseconds.ToString() + "ms");

            Logo.Source = xr.AnalysePhoto;
        }
Example #5
0
        public void DrawLatitudeCurve(WriteableBitmap b, string ChartType)//绘制动态范围的分析图
        {
            this.ChartType = ChartType;
            List <decimal> al = new List <decimal>();

            if (ChartType == "XMark")
            {
                XMarkChart xm = new XMarkChart(b);
                al = xm.getCurveLatitude();
            }
            if (ChartType == "XRite")
            {
                XRiteColorChart xr = new XRiteColorChart(b);
                al = xr.getCurveLatitude();
            }
            DrawGraphic dg = new DrawGraphic(DrawCanvas);

            dg.DrawX();
            List <double> MarkList = new List <double>();

            for (int i = 0; i < 101; i = i + 20)
            {
                MarkList.Add(i);
            }
            dg.DrawXMark(MarkList);
            MarkList.Clear();
            for (int i = 0; i < 255; i = i + 40)
            {
                MarkList.Add(i);
            }
            dg.DrawY();
            dg.DrawYMark(MarkList);
            dg.ForeColor = Colors.Red;
            dg.DrawStepPoint(SilverlightLFC.common.Environment.getDoubleList <decimal>(al));
            dg.DrawTitle("宽容度");
            //picCanvas.Image = dg.Canvas;
        }
Example #6
0
 public XRiteChartTestViewModel()
 {
     TestChart = new XRiteColorChart();
     Test      = TestXRite;
 }