Browse Source

Use HashHelpers

af/merge-core
Jason Nelson 8 years ago
parent
commit
ebb76ff474
  1. 16
      src/ImageSharp/ColorSpaces/CieLab.cs
  2. 16
      src/ImageSharp/ColorSpaces/CieLch.cs
  3. 17
      src/ImageSharp/ColorSpaces/CieLchuv.cs
  4. 16
      src/ImageSharp/ColorSpaces/CieLuv.cs
  5. 16
      src/ImageSharp/ColorSpaces/HunterLab.cs

16
src/ImageSharp/ColorSpaces/CieLab.cs

@ -165,23 +165,15 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
public override int GetHashCode()
{
unchecked
{
int hashCode = this.WhitePoint.GetHashCode();
hashCode = (hashCode * 397) ^ this.backingVector.GetHashCode();
return hashCode;
}
return HashHelpers.Combine(this.WhitePoint.GetHashCode(), this.backingVector.GetHashCode());
}
/// <inheritdoc/>
public override string ToString()
{
if (this.IsEmpty)
{
return "CieLab [Empty]";
}
return $"CieLab [ L={this.L:#0.##}, A={this.A:#0.##}, B={this.B:#0.##}]";
return this.IsEmpty
? "CieLab [Empty]"
: $"CieLab [ L={this.L:#0.##}, A={this.A:#0.##}, B={this.B:#0.##}]";
}
/// <inheritdoc/>

16
src/ImageSharp/ColorSpaces/CieLch.cs

@ -167,23 +167,15 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
public override int GetHashCode()
{
unchecked
{
int hashCode = this.WhitePoint.GetHashCode();
hashCode = (hashCode * 397) ^ this.backingVector.GetHashCode();
return hashCode;
}
return HashHelpers.Combine(this.WhitePoint.GetHashCode(), this.backingVector.GetHashCode());
}
/// <inheritdoc/>
public override string ToString()
{
if (this.IsEmpty)
{
return "CieLch [Empty]";
}
return $"CieLch [ L={this.L:#0.##}, C={this.C:#0.##}, H={this.H:#0.##}]";
return this.IsEmpty
? "CieLch [Empty]"
: $"CieLch [ L={this.L:#0.##}, C={this.C:#0.##}, H={this.H:#0.##}]";
}
/// <inheritdoc/>

17
src/ImageSharp/ColorSpaces/CieLchuv.cs

@ -165,23 +165,15 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
public override int GetHashCode()
{
unchecked
{
int hashCode = this.WhitePoint.GetHashCode();
hashCode = (hashCode * 397) ^ this.backingVector.GetHashCode();
return hashCode;
}
return HashHelpers.Combine(this.WhitePoint.GetHashCode(), this.backingVector.GetHashCode());
}
/// <inheritdoc/>
public override string ToString()
{
if (this.IsEmpty)
{
return "CieLchuv [Empty]";
}
return $"CieLchuv [ L={this.L:#0.##}, C={this.C:#0.##}, H={this.H:#0.##}]";
return this.IsEmpty
? "CieLchuv [Empty]"
: $"CieLchuv [ L={this.L:#0.##}, C={this.C:#0.##}, H={this.H:#0.##}";
}
/// <inheritdoc/>
@ -191,7 +183,6 @@ namespace SixLabors.ImageSharp.ColorSpaces
}
/// <inheritdoc/>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public bool Equals(CieLchuv other)
{
return this.backingVector.Equals(other.backingVector)

16
src/ImageSharp/ColorSpaces/CieLuv.cs

@ -167,23 +167,15 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
public override int GetHashCode()
{
unchecked
{
int hashCode = this.WhitePoint.GetHashCode();
hashCode = (hashCode * 397) ^ this.backingVector.GetHashCode();
return hashCode;
}
return HashHelpers.Combine(this.WhitePoint.GetHashCode(), this.backingVector.GetHashCode());
}
/// <inheritdoc/>
public override string ToString()
{
if (this.IsEmpty)
{
return "CieLuv [ Empty ]";
}
return $"CieLuv [ L={this.L:#0.##}, U={this.U:#0.##}, V={this.V:#0.##} ]";
return this.IsEmpty
? "CieLuv [ Empty ]"
: $"CieLuv [ L={this.L:#0.##}, U={this.U:#0.##}, V={this.V:#0.##} ]";
}
/// <inheritdoc/>

16
src/ImageSharp/ColorSpaces/HunterLab.cs

@ -161,23 +161,15 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
public override int GetHashCode()
{
unchecked
{
int hashCode = this.WhitePoint.GetHashCode();
hashCode = (hashCode * 397) ^ this.backingVector.GetHashCode();
return hashCode;
}
return HashHelpers.Combine(this.WhitePoint.GetHashCode(), this.backingVector.GetHashCode());
}
/// <inheritdoc/>
public override string ToString()
{
if (this.IsEmpty)
{
return "HunterLab [Empty]";
}
return $"HunterLab [ L={this.L:#0.##}, A={this.A:#0.##}, B={this.B:#0.##}]";
return this.IsEmpty
? "HunterLab [Empty]"
: $"HunterLab [ L={this.L:#0.##}, A={this.A:#0.##}, B={this.B:#0.##}]";
}
/// <inheritdoc/>

Loading…
Cancel
Save