本文整理汇总了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);
}