|
|
|
@ -4,10 +4,18 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Numerics; |
|
|
|
using SixLabors.ImageSharp.ColorSpaces; |
|
|
|
using SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation.RgbColorSapce; |
|
|
|
|
|
|
|
namespace SixLabors.ImageSharp.Tests |
|
|
|
{ |
|
|
|
internal struct ApproximateFloatComparer : IEqualityComparer<float>, IEqualityComparer<Vector4> |
|
|
|
internal struct ApproximateFloatComparer : |
|
|
|
IEqualityComparer<float>, |
|
|
|
IEqualityComparer<Vector4>, |
|
|
|
IEqualityComparer<CieXyChromaticityCoordinates>, |
|
|
|
IEqualityComparer<RgbPrimariesChromaticityCoordinates>, |
|
|
|
IEqualityComparer<CieXyz>, |
|
|
|
IEqualityComparer<IRgbWorkingSpace> |
|
|
|
{ |
|
|
|
private readonly float Eps; |
|
|
|
|
|
|
|
@ -37,5 +45,52 @@ namespace SixLabors.ImageSharp.Tests |
|
|
|
{ |
|
|
|
throw new InvalidOperationException(); |
|
|
|
} |
|
|
|
|
|
|
|
public bool Equals(CieXyChromaticityCoordinates x, CieXyChromaticityCoordinates y) |
|
|
|
{ |
|
|
|
return this.Equals(x.X, y.X) && this.Equals(x.Y, y.Y); |
|
|
|
} |
|
|
|
|
|
|
|
public int GetHashCode(CieXyChromaticityCoordinates obj) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
|
|
|
|
public bool Equals(RgbPrimariesChromaticityCoordinates x, RgbPrimariesChromaticityCoordinates y) |
|
|
|
{ |
|
|
|
return this.Equals(x.R, y.R) && this.Equals(x.G, y.G) && this.Equals(x.B, y.B); |
|
|
|
} |
|
|
|
|
|
|
|
public int GetHashCode(RgbPrimariesChromaticityCoordinates obj) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
|
|
|
|
public bool Equals(CieXyz x, CieXyz y) |
|
|
|
{ |
|
|
|
return this.Equals(x.X, y.X) && this.Equals(x.Y, y.Y) && this.Equals(x.Z, y.Z); |
|
|
|
} |
|
|
|
|
|
|
|
public int GetHashCode(CieXyz obj) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
|
|
|
|
public bool Equals(IRgbWorkingSpace x, IRgbWorkingSpace y) |
|
|
|
{ |
|
|
|
if (x is RgbGammaWorkingSpace g1 && y is RgbGammaWorkingSpace g2) |
|
|
|
{ |
|
|
|
return this.Equals(g1.WhitePoint, g2.WhitePoint) |
|
|
|
&& this.Equals(g1.ChromaticityCoordinates, g2.ChromaticityCoordinates); |
|
|
|
} |
|
|
|
|
|
|
|
return this.Equals(x.WhitePoint, y.WhitePoint) |
|
|
|
&& this.Equals(x.ChromaticityCoordinates, y.ChromaticityCoordinates); |
|
|
|
} |
|
|
|
|
|
|
|
public int GetHashCode(IRgbWorkingSpace obj) |
|
|
|
{ |
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |