@ -17,7 +17,7 @@ namespace ImageSharp.Colors.Spaces.Conversion.Implementation.Lms
/// Two New von Kries Based Chromatic Adaptation Transforms Found by Numerical Optimization
/// Two New von Kries Based Chromatic Adaptation Transforms Found by Numerical Optimization
/// S. Bianco, R. Schettini
/// S. Bianco, R. Schettini
/// DISCo, Department of Informatics, Systems and Communication, University of Milan-Bicocca, viale Sarca 336, 20126 Milan, Italy
/// DISCo, Department of Informatics, Systems and Communication, University of Milan-Bicocca, viale Sarca 336, 20126 Milan, Italy
/// http://www.ivl.disco.unimib.it/papers2003/CRA-CAT .pdf
/// https://web.stanford.edu/~sujason/ColorBalancing/Papers/Two%20New%20von%20Kries%20Based%20Chromatic%20Adaptation .pdf
/// </remarks>
/// </remarks>
public static class LmsAdaptationMatrix
public static class LmsAdaptationMatrix
{
{
@ -25,77 +25,77 @@ namespace ImageSharp.Colors.Spaces.Conversion.Implementation.Lms
/// Von Kries chromatic adaptation transform matrix (Hunt-Pointer-Estevez adjusted for D65)
/// Von Kries chromatic adaptation transform matrix (Hunt-Pointer-Estevez adjusted for D65)
/// </summary>
/// </summary>
public static readonly Matrix4x4 VonKriesHPEAdjusted
public static readonly Matrix4x4 VonKriesHPEAdjusted
= new Matrix4x4
= Matrix4x4 . Transpose ( new Matrix4x4
{
{
M11 = 0.40024F , M12 = 0.7076F , M13 = - 0.08081F ,
M11 = 0.40024F , M12 = 0.7076F , M13 = - 0.08081F ,
M21 = - 0.2263F , M22 = 1.16532F , M23 = 0.0457F ,
M21 = - 0.2263F , M22 = 1.16532F , M23 = 0.0457F ,
M31 = 0 , M32 = 0 , M33 = 0.91822F ,
M31 = 0 , M32 = 0 , M33 = 0.91822F ,
M44 = 1F // Important for inverse transforms.
M44 = 1F // Important for inverse transforms.
} ;
} ) ;
/// <summary>
/// <summary>
/// Von Kries chromatic adaptation transform matrix (Hunt-Pointer-Estevez for equal energy)
/// Von Kries chromatic adaptation transform matrix (Hunt-Pointer-Estevez for equal energy)
/// </summary>
/// </summary>
public static readonly Matrix4x4 VonKriesHPE
public static readonly Matrix4x4 VonKriesHPE
= new Matrix4x4
= Matrix4x4 . Transpose ( new Matrix4x4
{
{
M11 = 0.3897F , M12 = 0.6890F , M13 = - 0.0787F ,
M11 = 0.3897F , M12 = 0.6890F , M13 = - 0.0787F ,
M21 = - 0.2298F , M22 = 1.1834F , M23 = 0.0464F ,
M21 = - 0.2298F , M22 = 1.1834F , M23 = 0.0464F ,
M31 = 0 , M32 = 0 , M33 = 1F ,
M31 = 0 , M32 = 0 , M33 = 1F ,
M44 = 1F
M44 = 1F
} ;
} ) ;
/// <summary>
/// <summary>
/// XYZ scaling chromatic adaptation transform matrix
/// XYZ scaling chromatic adaptation transform matrix
/// </summary>
/// </summary>
public static readonly Matrix4x4 XYZScaling = Matrix4x4 . Identity ;
public static readonly Matrix4x4 XYZScaling = Matrix4x4 . Transpose ( Matrix4x4 . Identity ) ;
/// <summary>
/// <summary>
/// Bradford chromatic adaptation transform matrix (used in CMCCAT97)
/// Bradford chromatic adaptation transform matrix (used in CMCCAT97)
/// </summary>
/// </summary>
public static readonly Matrix4x4 Bradford
public static readonly Matrix4x4 Bradford
= new Matrix4x4
= Matrix4x4 . Transpose ( new Matrix4x4
{
{
M11 = 0.8951F , M12 = 0.2664F , M13 = - 0.1614F ,
M11 = 0.8951F , M12 = 0.2664F , M13 = - 0.1614F ,
M21 = - 0.7502F , M22 = 1.7135F , M23 = 0.0367F ,
M21 = - 0.7502F , M22 = 1.7135F , M23 = 0.0367F ,
M31 = 0.0389F , M32 = - 0.0685F , M33 = 1.0296F ,
M31 = 0.0389F , M32 = - 0.0685F , M33 = 1.0296F ,
M44 = 1F
M44 = 1F
} ;
} ) ;
/// <summary>
/// <summary>
/// Spectral sharpening and the Bradford transform
/// Spectral sharpening and the Bradford transform
/// </summary>
/// </summary>
public static readonly Matrix4x4 BradfordSharp
public static readonly Matrix4x4 BradfordSharp
= new Matrix4x4
= Matrix4x4 . Transpose ( new Matrix4x4
{
{
M11 = 1.2694F , M12 = - 0.0988F , M13 = - 0.1706F ,
M11 = 1.2694F , M12 = - 0.0988F , M13 = - 0.1706F ,
M21 = - 0.8364F , M22 = 1.8006F , M23 = 0.0357F ,
M21 = - 0.8364F , M22 = 1.8006F , M23 = 0.0357F ,
M31 = 0.0297F , M32 = - 0.0315F , M33 = 1.0018F ,
M31 = 0.0297F , M32 = - 0.0315F , M33 = 1.0018F ,
M44 = 1F
M44 = 1F
} ;
} ) ;
/// <summary>
/// <summary>
/// CMCCAT2000 (fitted from all available color data sets)
/// CMCCAT2000 (fitted from all available color data sets)
/// </summary>
/// </summary>
public static readonly Matrix4x4 CMCCAT2000
public static readonly Matrix4x4 CMCCAT2000
= new Matrix4x4
= Matrix4x4 . Transpose ( new Matrix4x4
{
{
M11 = 0.7982F , M12 = 0.3389F , M13 = - 0.1371F ,
M11 = 0.7982F , M12 = 0.3389F , M13 = - 0.1371F ,
M21 = - 0.5918F , M22 = 1.5512F , M23 = 0.0406F ,
M21 = - 0.5918F , M22 = 1.5512F , M23 = 0.0406F ,
M31 = 0.0008F , M32 = 0.239F , M33 = 0.9753F ,
M31 = 0.0008F , M32 = 0.239F , M33 = 0.9753F ,
M44 = 1F
M44 = 1F
} ;
} ) ;
/// <summary>
/// <summary>
/// CAT02 (optimized for minimizing CIELAB differences)
/// CAT02 (optimized for minimizing CIELAB differences)
/// </summary>
/// </summary>
public static readonly Matrix4x4 CAT02
public static readonly Matrix4x4 CAT02
= new Matrix4x4
= Matrix4x4 . Transpose ( new Matrix4x4
{
{
M11 = 0.7328F , M12 = 0.4296F , M13 = - 0.1624F ,
M11 = 0.7328F , M12 = 0.4296F , M13 = - 0.1624F ,
M21 = - 0.7036F , M22 = 1.6975F , M23 = 0.0061F ,
M21 = - 0.7036F , M22 = 1.6975F , M23 = 0.0061F ,
M31 = 0.0030F , M32 = 0.0136F , M33 = 0.9834F ,
M31 = 0.0030F , M32 = 0.0136F , M33 = 0.9834F ,
M44 = 1F
M44 = 1F
} ;
} ) ;
}
}
}
}