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
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));
            }
Example #2
0
            public override ColorBgra Apply(ColorBgra color)
            {
                byte i = color.GetIntensityByte();

                return(ColorBgra.FromBgra(i, i, i, color.A));
            }
Example #3
0
			public override ColorBgra Apply (ColorBgra color)
            {
            	//adjust saturation
	            byte intensity = color.GetIntensityByte();
	            color.R = Utility.ClampToByte((intensity * 1024 + (color.R - intensity) * satFactor) >> 10);
	            color.G = Utility.ClampToByte((intensity * 1024 + (color.G - intensity) * satFactor) >> 10);
	            color.B = Utility.ClampToByte((intensity * 1024 + (color.B - intensity) * satFactor) >> 10);
	
	            HsvColor  hsvColor = (new RgbColor(color.R, color.G, color.B)).ToHsv();
				int hue = hsvColor.Hue;
	
	            hue += hueDelta;
	
	            while (hue < 0)
                {
                	hue += 360;
                }
                       
                while (hue > 360)
                {
                	hue -= 360;
                }
	
	            hsvColor.Hue = hue;
	
				RgbColor rgbColor=hsvColor.ToRgb();
				ColorBgra newColor = ColorBgra.FromBgr((byte)rgbColor.Blue, (byte)rgbColor.Green, (byte)rgbColor.Red);
	            newColor = blendOp.Apply(newColor);
	            newColor.A = color.A;
	              
	            return newColor;
            }
Example #4
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);
            }
Example #5
0
 public override ColorBgra Apply(ColorBgra color)
 {
     byte i = color.GetIntensityByte();
     return ColorBgra.FromBgra(i, i, i, color.A);
 }