本文整理匯總了C#中ColorBgra.GetIntensityByte方法的典型用法代碼示例。如果您正苦於以下問題:C# ColorBgra.GetIntensityByte方法的具體用法?C# ColorBgra.GetIntensityByte怎麽用?C# ColorBgra.GetIntensityByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ColorBgra
的用法示例。
在下文中一共展示了ColorBgra.GetIntensityByte方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Apply
public override ColorBgra Apply (ColorBgra color)
{
// Adjust saturation
var intensity = color.GetIntensityByte ();
color.R = Utility.ClampToByte ((intensity * 1024 + (color.R - intensity) * sat_factor) >> 10);
color.G = Utility.ClampToByte ((intensity * 1024 + (color.G - intensity) * sat_factor) >> 10);
color.B = Utility.ClampToByte ((intensity * 1024 + (color.B - intensity) * sat_factor) >> 10);
var hsvColor = (new RgbColor (color.R, color.G, color.B)).ToHsv ();
int hue = hsvColor.Hue;
hue += hue_delta;
while (hue < 0)
hue += 360;
while (hue > 360)
hue -= 360;
hsvColor.Hue = hue;
var rgbColor = hsvColor.ToRgb ();
var newColor = ColorBgra.FromBgr ((byte)rgbColor.Blue, (byte)rgbColor.Green, (byte)rgbColor.Red);
newColor = blend_op.Apply (newColor);
newColor.A = color.A;
return newColor;
}
示例2: Apply
public override ColorBgra Apply (ColorBgra color)
{
byte lumi = color.GetIntensityByte ();
int diff = Curve[lumi] - lumi;
return ColorBgra.FromBgraClamped (
color.B + diff,
color.G + diff,
color.R + diff,
color.A);
}
示例3: Apply
public override ColorBgra Apply(ColorBgra lhs, ColorBgra rhs)
{
byte intensity = rhs.GetIntensityByte();
ColorBgra result = ColorBgra.FromBgra(lhs.B, lhs.G, lhs.R, (byte)Utility.FastScaleByteByByte(intensity, lhs.A));
return result;
}
示例4: Apply
public override ColorBgra Apply (ColorBgra color)
{
var i = color.GetIntensityByte ();
return ColorBgra.FromBgra (i, i, i, color.A);
}