当前位置: 首页>>代码示例>>C#>>正文


C# ColorSpaces.Rgb类代码示例

本文整理汇总了C#中ColorMine.ColorSpaces.Rgb的典型用法代码示例。如果您正苦于以下问题:C# Rgb类的具体用法?C# Rgb怎么用?C# Rgb使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Rgb类属于ColorMine.ColorSpaces命名空间,在下文中一共展示了Rgb类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WhiteRgbToLch

            public void WhiteRgbToLch()
            {
				var knownColor = new Rgb { R = 255, G = 255, B = 255, };
				var expectedColor = new Lch { L = 100, C = .01166, H = 296.813, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
开发者ID:nnabike,项目名称:ColorMine,代码行数:7,代码来源:ConversionTests.cs

示例2: WhiteRgbToRgb

            public void WhiteRgbToRgb()
            {
				var knownColor = new Rgb { R = 255, G = 255, B = 255, };
				var expectedColor = new Rgb { R = 255, G = 255, B = 255, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
开发者ID:nnabike,项目名称:ColorMine,代码行数:7,代码来源:ConversionTests.cs

示例3: WhiteRgbToHsl

            public void WhiteRgbToHsl()
            {
				var knownColor = new Rgb { R = 255, G = 255, B = 255, };
				var expectedColor = new Hsl { H = 0, S = 0, L = 100, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
开发者ID:nnabike,项目名称:ColorMine,代码行数:7,代码来源:ConversionTests.cs

示例4: WhiteRgbToLab

            public void WhiteRgbToLab()
            {
				var knownColor = new Rgb { R = 255, G = 255, B = 255, };
				var expectedColor = new Lab { L = 100, A = 0.00526, B = -.0104, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
开发者ID:nnabike,项目名称:ColorMine,代码行数:7,代码来源:ConversionTests.cs

示例5: GetDifferenceUsingCie1976Comparison

        public double GetDifferenceUsingCie1976Comparison(Rgb color1, Rgb color2)
        {
            var colorRgb1 = new Rgb { R = color1.R, G = color1.G, B = color1.B };
            var colorRgb2 = new Rgb { R = color2.R, G = color2.G, B = color2.B };

            return _comparer.Compare(colorRgb1, colorRgb2);
        }
开发者ID:MasterPieceCode,项目名称:YangManic,代码行数:7,代码来源:ColorFilter.cs

示例6: WhiteRgbToCmyk

            public void WhiteRgbToCmyk()
            {
				var knownColor = new Rgb { R = 255, G = 255, B = 255, };
				var expectedColor = new Cmyk { C = 0, M = 0, Y = 0, K = 0, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
开发者ID:nnabike,项目名称:ColorMine,代码行数:7,代码来源:ConversionTests.cs

示例7: ToListLabInfo

        public static List<LabInfo> ToListLabInfo(List<PixelInfo> pixelInfo)
        {
            var labInfo = new List<LabInfo>();

            var labList = new List<Lab>();

            var listColors = new List<Color>();
            var listLabLists = new List<List<Lab>>();

            foreach (var pixInfo in pixelInfo)
            {
                foreach (var pix in pixInfo.PixelData)
                {
                    var rgb = new Rgb();
                    rgb.R = pix.red;
                    rgb.G = pix.green;
                    rgb.B = pix.blue;
                    labList.Add(rgb.To<Lab>());
                }
                listLabLists.Add(new List<Lab>(labList));
                listColors.Add(pixInfo.Color);
                labList.Clear();
            }

            for (int i = 0; i < listColors.Count; i++)
            {
                labInfo.Add(new LabInfo(listLabLists[i], listColors[i]));
            }

            return labInfo;
        }
开发者ID:mikhail-efremov,项目名称:pouring_picture,代码行数:31,代码来源:LabInfo.cs

示例8: WhiteRgbToXyz

            public void WhiteRgbToXyz()
            {
				var knownColor = new Rgb { R = 255, G = 255, B = 255, };
				var expectedColor = new Xyz { X = 95.050, Y = 100, Z = 108.900, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
开发者ID:skataben,项目名称:ColorMine,代码行数:7,代码来源:ConversionTests.cs

示例9: PaletteTile

 protected PaletteTile(int id, double widthAndHeight, Rgb rgb)
 {
     Id = id;
     Width = widthAndHeight;
     Height = widthAndHeight;
     Rgb = rgb;
 }
开发者ID:MasterPieceCode,项目名称:YangManic,代码行数:7,代码来源:PaletteTile.cs

示例10: DarkVioletCmykToRgb

            public void DarkVioletCmykToRgb()
            {
                var knownColor = new Cmyk { C = .29858, M = 1, Y = 0, K = .17255, };
                var expectedColor = new Rgb { R = 148, G = 0, B = 211, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
开发者ID:hvalidi,项目名称:ColorMine,代码行数:7,代码来源:ConversionTests.cs

示例11: ReturnsZeroForSameColors

            public void ReturnsZeroForSameColors()
            {
                var compareColor = new Rgb {R = 140, G = 130, B = 23};
                // Todo, should be mocking!!
                var a = new Rgb();
                a.Initialize(compareColor);

                var b = new Rgb();
                b.Initialize(compareColor);

                ReturnsExpectedValueForKnownInput(0.0, a, b);
            }
开发者ID:nnabike,项目名称:ColorMine,代码行数:12,代码来源:Cie1976ComparisonTest.cs

示例12: ToLabData

        public static List<Lab> ToLabData(List<PixelData> pixelData)
        {
            var labData = new List<Lab>();

            foreach (var pix in pixelData)
            {
                var rgb = new Rgb();
                rgb.R = pix.red;
                rgb.G = pix.green;
                rgb.B = pix.blue;
                labData.Add(rgb.To<Lab>());
            }
            return labData;
        }
开发者ID:mikhail-efremov,项目名称:pouring_picture,代码行数:14,代码来源:LabInfo.cs

示例13: FindBestTile

        public PaletteTile FindBestTile(Rgb rgb)
        {
            var minimumDeltaE = double.MaxValue;
            PaletteTile result = null;
            foreach (var tileInfo in _tiles)
            {
                var deltaE = GetDifferenceUsingCie1976Comparison(tileInfo.Rgb, rgb);
                if (deltaE < minimumDeltaE)
                {
                    minimumDeltaE = deltaE;
                    result = tileInfo;
                }
            }

            return result;
        }
开发者ID:MasterPieceCode,项目名称:YangManic,代码行数:16,代码来源:ColorFilter.cs

示例14: Calculate

        public Rgb Calculate(Bitmap bitmap)
        {
            double rSum = 0;
            double gSum = 0;
            double bSum = 0;

            for (var y = 0; y < bitmap.Height; y++)
            {
                for (var x = 0; x < bitmap.Width; x++)
                {
                    var pixel = bitmap.GetPixel(x, y);
                    var rgb = new Rgb{ R = pixel.R, G = pixel.G, B = pixel.B };
                    //  var lab= rgb.To<Lab>();

                    rSum += rgb.R;
                    gSum += rgb.G;
                    bSum += rgb.B;
                }
            }

            var pixelCount = bitmap.Width * bitmap.Height;

            return new Rgb(rSum / pixelCount, gSum / pixelCount, bSum / pixelCount);
        }
开发者ID:MasterPieceCode,项目名称:YangManic,代码行数:24,代码来源:AvgColorCalculator.cs

示例15: GoldenrodRgbToYxy

            public void GoldenrodRgbToYxy()
            {
                var knownColor = new Rgb { R = 218, G = 165, B = 32, };
                var expectedColor = new Yxy { Y1 = 41.920, X = .46457, Y2 = .45684, };

                ExpectedValuesForKnownColor(knownColor,expectedColor);
            }
开发者ID:hvalidi,项目名称:ColorMine,代码行数:7,代码来源:ConversionTests.cs


注:本文中的ColorMine.ColorSpaces.Rgb类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。