示例#1
0
文件: Dye.cs 项目: Burkhardt/RaiImage
        /// <summary>
        /// Calculate angle between two colors in the color wheel
        /// </summary>
        /// <param name="otherColor"></param>
        /// <returns> IM wants it -100 .. 0 .. 100</returns>
        public int Phi(Dye otherColor)
        {
            var hueDelta = otherColor.Hue - Hue;
            var rotation = 100 + (int)(hueDelta / 180 * 100 + 0.5);

            return /*rotation > 200 ? rotation - 200 : */ (rotation);
        }
示例#2
0
文件: Dye.cs 项目: Burkhardt/RaiImage
        public int DeltaSb(Dye other)
        {
            var myS    = Color.GetSaturation();
            var otherS = other.Color.GetSaturation();

            return((int)(100 * (1.0 + (otherS - myS) / myS) + 0.5));
            // ImageMagick interprets 100 as unchanged (100%), 0 is grayscale, 200 is very colorful (cartoonish)
        }
示例#3
0
文件: Dye.cs 项目: Burkhardt/RaiImage
 /// <summary>
 /// reduced version: colors were too bright
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public int DeltaS(Dye other)
 {
     return(DeltaSa(other));
     //return (DeltaSa(other) + DeltaSb(other)) / 2;
     // ImageMagick interprets 100 as unchanged (100%), 0 is grayscale, 200 is very colorful (cartoonish)
 }
示例#4
0
文件: Dye.cs 项目: Burkhardt/RaiImage
 public int DeltaB(Dye other)
 {
     return((int)(100 * (other.Color.GetBrightness() / Color.GetBrightness()) + .5));
     // ImageMagick interprets 100 as unchanged (100%), 200 as twice as bright 50 as half as bright
 }
示例#5
0
文件: Dye.cs 项目: Burkhardt/RaiImage
 public DyeDelta(Dye color1, Dye color2)
 {
     Phi    = color1.Phi(color2);
     DeltaB = color1.DeltaB(color2);
     DeltaS = color1.DeltaS(color2);
 }