• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ColorSpaces.Rgb类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: GoldenrodRgbToXyz

            public void GoldenrodRgbToXyz()
            {
                var knownColor = new Rgb { R = 218, G = 165, B = 32, };
                var expectedColor = new Xyz { X = 42.629, Y = 41.920, Z = 7.211, };

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


示例17: GoldenrodRgbToRgb

            public void GoldenrodRgbToRgb()
            {
                var knownColor = new Rgb { R = 218, G = 165, B = 32, };
                var expectedColor = new Rgb { R = 218, G = 165, B = 32, };

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


示例18: GoldenrodRgbToLch

            public void GoldenrodRgbToLch()
            {
                var knownColor = new Rgb { R = 218, G = 165, B = 32, };
                var expectedColor = new Lch { L = 70.816, C = 69.291, H = 82.933, };

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


示例19: GoldenrodRgbToLab

            public void GoldenrodRgbToLab()
            {
                var knownColor = new Rgb { R = 218, G = 165, B = 32, };
                var expectedColor = new Lab { L = 70.816, A = 8.525, B = 68.765, };

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


示例20: GoldenrodRgbToHsl

            public void GoldenrodRgbToHsl()
            {
                var knownColor = new Rgb { R = 218, G = 165, B = 32, };
                var expectedColor = new Hsl { H = 43, S = 74, L = 49, };

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Behaviors.BatchExcuteAction类代码示例发布时间:2022-05-24
下一篇:
C# ColorCode.CodeColorizer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap