本文整理匯總了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;
}
}