Pinta.Core.ColorBgra.GetIntensityByte C# (CSharp) Method

GetIntensityByte() public method

Gets the luminance intensity of the pixel based on the values of the red, green, and blue components. Alpha is ignored.
public GetIntensityByte ( ) : byte
return byte
        public byte GetIntensityByte()
        {
            return (byte)((7471 * B + 38470 * G + 19595 * R) >> 16);
        }

Usage Example

Example #1
0
            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));
            }
All Usage Examples Of Pinta.Core.ColorBgra::GetIntensityByte