Imager.sPixel.IsLike C# (CSharp) Method

IsLike() public method

Determines whether the specified sPixel instance is similar to this instance.
public IsLike ( sPixel pixel ) : bool
pixel sPixel The instance to compare to.
return bool
        public bool IsLike(sPixel pixel)
        {
            if (!AllowThresholds)
            return (this == pixel);
              var delta = this.ChrominanceV - pixel.ChrominanceV;
              if (delta > _CHROMA_V_TRIGGER || delta < -_CHROMA_V_TRIGGER)
            return false;
              delta = this.Luminance - pixel.Luminance;
              if (delta > _LUMINANCE_TRIGGER || delta < -_LUMINANCE_TRIGGER)
            return false;
              delta = this.ChrominanceU - pixel.ChrominanceU;
              return delta <= _CHROMA_U_TRIGGER && delta >= -_CHROMA_U_TRIGGER;
        }