本文整理汇总了C#中ColorBgra.GetIntensity方法的典型用法代码示例。如果您正苦于以下问题:C# ColorBgra.GetIntensity方法的具体用法?C# ColorBgra.GetIntensity怎么用?C# ColorBgra.GetIntensity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColorBgra
的用法示例。
在下文中一共展示了ColorBgra.GetIntensity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Apply
public override unsafe ColorBgra Apply (ColorBgra color, int area, int* hb, int* hg, int* hr, int* ha)
{
var normalized = GetPercentileOfColor (color, area, hb, hg, hr, ha);
var lerp = strength * (1 - 0.75 * color.GetIntensity ());
return ColorBgra.Lerp (color, normalized, lerp);
}
示例2: Apply
public override ColorBgra Apply (ColorBgra color)
{
// The higher the saturation, the more red it is
var saturation = GetSaturation (color);
// The higher the difference between the other colors, the more red it is
var difference = color.R - Math.Max (color.B, color.G);
// If it is within tolerence, and the saturation is high
if ((difference > tolerence) && (saturation > 100)) {
var i = 255.0 * color.GetIntensity ();
var ib = (byte)(i * set_saturation); // adjust the red color for user inputted saturation
return ColorBgra.FromBgra ((byte)color.B, (byte)color.G, ib, color.A);
} else {
return color;
}
}