GetIntensity() public method

Gets the luminance intensity of the pixel based on the values of the red, green, and blue components. Alpha is ignored.
public GetIntensity ( ) : double
return double
Ejemplo n.º 1
0
		public override unsafe ColorBgra Apply (ColorBgra color, int area, int* hb, int* hg, int* hr, int* ha)
		{
			ColorBgra normalized = GetPercentileOfColor (color, area, hb, hg, hr, ha);
			double lerp = strength * (1 - 0.75 * color.GetIntensity ());

			return ColorBgra.Lerp (color, normalized, lerp);
		}
Ejemplo n.º 2
0
            public override ColorBgra Apply(ColorBgra color)
            {
                // The higher the saturation, the more red it is
                int saturation = GetSaturation(color);

                // The higher the difference between the other colors, the more red it is
                int difference = color.R - Math.Max(color.B, color.G);

                // If it is within tolerence, and the saturation is high
                if ((difference > tolerence) && (saturation > 100))
                {
                    double i  = 255.0 * color.GetIntensity();
                    byte   ib = (byte)(i * setSaturation);                    // adjust the red color for user inputted saturation
                    return(ColorBgra.FromBgra((byte)color.B, (byte)color.G, ib, color.A));
                }
                else
                {
                    return(color);
                }
            }
Ejemplo n.º 3
0
            public override ColorBgra Apply(ColorBgra color)
            {
                // The higher the saturation, the more red it is
                int saturation = GetSaturation(color);

                // The higher the difference between the other colors, the more red it is
                int difference = color.R - Math.Max(color.B,color.G);

                // If it is within tolerence, and the saturation is high
                if ((difference > tolerence) && (saturation > 100)) 
                {
                    double i = 255.0 * color.GetIntensity();
                    byte ib = (byte)(i * setSaturation); // adjust the red color for user inputted saturation
                    return ColorBgra.FromBgra((byte)color.B,(byte)color.G, ib, color.A);
                }
                else
                {
                    return color;
                }
            }